about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries')
-rw-r--r--nixpkgs/pkgs/development/libraries/AntTweakBar/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/CGAL/4.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/CGAL/cgal_path.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/CGAL/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/CoinMP/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/LAStools/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/LAStools/drop-64-suffix.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/LASzip/LASzip2.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/LASzip/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/NSPlist/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/PlistCpp/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL/default.nix135
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL/find-headers.patch26
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL/setup-hook.sh10
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2/default.nix137
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2/find-headers.patch46
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2/setup-hook.sh7
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2_gfx/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2_image/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2_mixer/default.nix66
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2_net/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2_ttf/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_Pango/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_Pango/fixes.patch148
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_gfx/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_gpu/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_image/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_mixer/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_net/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_sixel/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_sound/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_stretch/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_ttf/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/Xaw3d/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/a52dec/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/aalib/darwin.patch106
-rw-r--r--nixpkgs/pkgs/development/libraries/aalib/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/abseil-cpp/cmake-full-dirs.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/abseil-cpp/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/accounts-qt/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/accountsservice/Disable-methods-that-change-files-in-etc.patch130
-rw-r--r--nixpkgs/pkgs/development/libraries/accountsservice/default.nix94
-rw-r--r--nixpkgs/pkgs/development/libraries/accountsservice/drop-prefix-check-extensions.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/accountsservice/fix-paths.patch125
-rw-r--r--nixpkgs/pkgs/development/libraries/accountsservice/no-create-dirs.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/ace/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/acl/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/ada/gnatcoll/bindings.nix88
-rw-r--r--nixpkgs/pkgs/development/libraries/ada/gnatcoll/core.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/ada/gnatcoll/db.nix110
-rw-r--r--nixpkgs/pkgs/development/libraries/ada/gnatcoll/gnatcoll-db-sqlite-static-external.patch18
-rw-r--r--nixpkgs/pkgs/development/libraries/ada/gnatcoll/omp-setup-text-mode.patch23
-rw-r--r--nixpkgs/pkgs/development/libraries/ada/xmlada/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/adns/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/adslib/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/afflib/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/aften/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/aften/simd-fallback.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/agda-categories/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/agda-prelude/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/cubical/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/functional-linear-algebra/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/generic/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/iowa-stdlib/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/standard-library/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/agg/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/alembic/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/alkimia/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/allegro/5.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/allegro/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/allegro/encoding.patch10
-rw-r--r--nixpkgs/pkgs/development/libraries/allegro/nix-unstable-sandbox-fix.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/alure/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/alure2/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/amdvlk/default.nix90
-rw-r--r--nixpkgs/pkgs/development/libraries/aml/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/amrnb/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/amrwb/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/amtk/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/apache-activemq/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/appindicator-sharp/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/applet-window-buttons/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/appstream-glib/default.nix95
-rw-r--r--nixpkgs/pkgs/development/libraries/appstream-glib/paths.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/appstream/default.nix92
-rw-r--r--nixpkgs/pkgs/development/libraries/appstream/fix-paths.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/appstream/qt.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/apr-util/default.nix72
-rw-r--r--nixpkgs/pkgs/development/libraries/apr-util/include-static-dependencies.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/apr/default.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/apr/is-this-a-compiler-bug.patch17
-rw-r--r--nixpkgs/pkgs/development/libraries/aqbanking/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/aqbanking/gwenhywfar.nix69
-rw-r--r--nixpkgs/pkgs/development/libraries/aqbanking/libchipcard.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/aqbanking/sources.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/aravis/default.nix90
-rw-r--r--nixpkgs/pkgs/development/libraries/arb/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/argp-standalone/default.nix62
-rw-r--r--nixpkgs/pkgs/development/libraries/argtable/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/arguments/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/aribb25/default.nix57
-rw-r--r--nixpkgs/pkgs/development/libraries/armadillo/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/armadillo/use-unix-config-on-OS-X.patch10
-rw-r--r--nixpkgs/pkgs/development/libraries/arpa2common/default.nix58
-rw-r--r--nixpkgs/pkgs/development/libraries/arrayfire/default.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/arrayfire/no-download.patch28
-rw-r--r--nixpkgs/pkgs/development/libraries/arrow-cpp/darwin.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/arrow-cpp/default.nix156
-rw-r--r--nixpkgs/pkgs/development/libraries/asio/1.10.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/asio/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/asio/generic.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/aspell/aspell-with-dicts.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/aspell/clang.patch18
-rw-r--r--nixpkgs/pkgs/development/libraries/aspell/data-dirs-from-nix-profiles.patch38
-rw-r--r--nixpkgs/pkgs/development/libraries/aspell/default.nix65
-rw-r--r--nixpkgs/pkgs/development/libraries/aspell/dictionaries.nix950
-rw-r--r--nixpkgs/pkgs/development/libraries/assimp/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/at-spi2-atk/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/at-spi2-core/default.nix68
-rw-r--r--nixpkgs/pkgs/development/libraries/atk/default.nix66
-rw-r--r--nixpkgs/pkgs/development/libraries/atk/fix_pc.patch9
-rw-r--r--nixpkgs/pkgs/development/libraries/atkmm/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/attr/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/aubio/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/audiality2/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/libbass/default.nix66
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/libbs2b/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/libgme/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/libinstpatch/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/libmysofa/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/libsmf/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/lilv/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/lilv/lilv-pkgconfig.patch6
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/lv2/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/lvtk/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/mbelib/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/ntk/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/qm-dsp/default.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/raul/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/rtaudio/default.nix65
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/rtmidi/default.nix71
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/sratom/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/suil/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix64
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/zita-convolver/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/zita-resampler/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/audiofile/CVE-2015-7747.patch161
-rw-r--r--nixpkgs/pkgs/development/libraries/audiofile/default.nix94
-rw-r--r--nixpkgs/pkgs/development/libraries/audiofile/gcc-6.patch30
-rw-r--r--nixpkgs/pkgs/development/libraries/avahi/default.nix100
-rw-r--r--nixpkgs/pkgs/development/libraries/avahi/no-mkdir-localstatedir.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/avro-c++/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/avro-c/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/aws-c-cal/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/aws-c-common/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/aws-c-event-stream/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/aws-c-io/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/aws-checksums/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/aws-sdk-cpp/cmake-dirs.patch65
-rw-r--r--nixpkgs/pkgs/development/libraries/aws-sdk-cpp/default.nix94
-rw-r--r--nixpkgs/pkgs/development/libraries/ayatana-ido/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/babl/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/backward-cpp/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/bamf/default.nix104
-rw-r--r--nixpkgs/pkgs/development/libraries/bamf/gtester2xunit-python3.patch53
-rw-r--r--nixpkgs/pkgs/development/libraries/bashup-events/3.2.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/bashup-events/4.4.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/bashup-events/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/bashup-events/generic.nix89
-rw-r--r--nixpkgs/pkgs/development/libraries/bcg729/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/bctoolbox/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/bearssl/default.nix56
-rw-r--r--nixpkgs/pkgs/development/libraries/beecrypt/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/beignet/clang_llvm.patch49
-rw-r--r--nixpkgs/pkgs/development/libraries/beignet/default.nix112
-rw-r--r--nixpkgs/pkgs/development/libraries/belcard/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/belle-sip/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/belr/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/biblesync/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/bobcat/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/boca/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix71
-rw-r--r--nixpkgs/pkgs/development/libraries/boehm-gc/default.nix69
-rw-r--r--nixpkgs/pkgs/development/libraries/boehm-gc/mcfgthread.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/boehm-gc/riscv.patch53
-rw-r--r--nixpkgs/pkgs/development/libraries/boolstuff/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/boost-process/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/1.55.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/1.59.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/1.60.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/1.65.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/1.66.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/1.68.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/1.69.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/1.70.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/1.72.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/1.73.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/1.74.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/1.75.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/clang-math-2.patch45
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/clang-math.patch65
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/cmake-paths-173.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/cmake-paths.patch21
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/darwin-1.55-no-system-python.patch45
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/darwin-no-system-python.patch45
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/gcc-5.patch64
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/generic.nix209
-rw-r--r--nixpkgs/pkgs/development/libraries/bootil/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/boringssl/default.nix58
-rw-r--r--nixpkgs/pkgs/development/libraries/botan/2.0.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/botan/2.0.upstream10
-rw-r--r--nixpkgs/pkgs/development/libraries/botan/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/botan/default.upstream9
-rw-r--r--nixpkgs/pkgs/development/libraries/botan/generic.nix55
-rw-r--r--nixpkgs/pkgs/development/libraries/box2d/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/boxfort/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/brigand/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/buddy/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/buddy/gcc-4.3.3-fixes.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/bullet/default.nix55
-rw-r--r--nixpkgs/pkgs/development/libraries/bullet/gwen-narrowing.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/bullet/roboschool-fork.nix55
-rw-r--r--nixpkgs/pkgs/development/libraries/bulletml/default.nix74
-rw-r--r--nixpkgs/pkgs/development/libraries/bwidget/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/bzrtp/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/c-ares/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/c-blosc/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/caf/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/cairo/0001-test-don-t-always-build-FreeType-dependent-test.patch34
-rw-r--r--nixpkgs/pkgs/development/libraries/cairo/0002-gl-don-t-implicitly-include-X11-headers.patch40
-rw-r--r--nixpkgs/pkgs/development/libraries/cairo/0003-test-only-build-GL-tests-when-Xlib-is-enabled.patch41
-rw-r--r--nixpkgs/pkgs/development/libraries/cairo/0004-util-don-t-build-cairo-sphinx-unless-PNG-enabled.patch32
-rw-r--r--nixpkgs/pkgs/development/libraries/cairo/default.nix164
-rw-r--r--nixpkgs/pkgs/development/libraries/cairo/skip-configure-stderr-check.patch89
-rw-r--r--nixpkgs/pkgs/development/libraries/cairomm/1.16.nix74
-rw-r--r--nixpkgs/pkgs/development/libraries/cairomm/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/capnproto/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/capstone/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/catch/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/catch2/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/ccrtp/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/cctz/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/cddlib/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/cdk/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/cdo/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/cegui/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/celt/0.5.1.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/celt/0.7.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/celt/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/celt/generic.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/cereal/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/ceres-solver/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/cglm/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/cgreen/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/cgui/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/check/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/chipmunk/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/chmlib/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/chromaprint/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/cimg/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/civetweb/0001-allow-setting-paths-in-makefile.patch33
-rw-r--r--nixpkgs/pkgs/development/libraries/civetweb/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/cjose/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/cjson/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/cl/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/clanlib/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/classads/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/clearsilver/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/clfft/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/clipp/clipp.pc9
-rw-r--r--nixpkgs/pkgs/development/libraries/clipp/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/clipper/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/cln/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/cloog-ppl/default.nix71
-rw-r--r--nixpkgs/pkgs/development/libraries/cloog-ppl/fix-ppl-version.patch16
-rw-r--r--nixpkgs/pkgs/development/libraries/cloog/0.18.0.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/cloog/default.nix65
-rw-r--r--nixpkgs/pkgs/development/libraries/clucene-core/2.x.nix57
-rw-r--r--nixpkgs/pkgs/development/libraries/clucene-core/Fix-pkgconfig-file-by-adding-clucene-shared-library.patch19
-rw-r--r--nixpkgs/pkgs/development/libraries/clucene-core/Fixing_ZLIB_configuration_in_shared_CMakeLists.patch20
-rw-r--r--nixpkgs/pkgs/development/libraries/clucene-core/Install-contribs-lib.patch49
-rw-r--r--nixpkgs/pkgs/development/libraries/clucene-core/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/clucene-core/fix-darwin.patch75
-rw-r--r--nixpkgs/pkgs/development/libraries/clucene-core/gcc6.patch146
-rw-r--r--nixpkgs/pkgs/development/libraries/clutter-gst/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/clutter-gtk/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/clutter/default.nix62
-rw-r--r--nixpkgs/pkgs/development/libraries/cm256cc/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/cmark-gfm/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/cmark/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/cminpack/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/cmocka/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/cmrt/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/codec2/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/cogl/default.nix82
-rw-r--r--nixpkgs/pkgs/development/libraries/coin3d/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/comedilib/default.nix56
-rw-r--r--nixpkgs/pkgs/development/libraries/console-bridge/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/coordgenlibs/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/cosmopolitan/default.nix80
-rw-r--r--nixpkgs/pkgs/development/libraries/cpp-hocon/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/cpp-ipfs-api/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/cpp-netlib/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/cpp-utilities/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/cppcms/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/cppdb/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/cpptest/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/cppunit/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/cpputest/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/cppzmq/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/cracklib/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/crc32c/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/crcpp/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/cre2/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/criterion/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/croaring/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/crypto++/default.nix61
-rw-r--r--nixpkgs/pkgs/development/libraries/csfml/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/ctl/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/ctpl/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/ctpp2/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/ctypes_sh/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/cudd/cudd.patch14
-rw-r--r--nixpkgs/pkgs/development/libraries/cudd/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/curlcpp/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/curlpp/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/cutee/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/cutelyst/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/cwiid/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/cxx-prettyprint/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/cxxopts/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/cxxtest/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/cxxtools/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/cyrus-sasl/cyrus-sasl-ac-try-run-fix.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/cyrus-sasl/default.nix55
-rw-r--r--nixpkgs/pkgs/development/libraries/cyrus-sasl/missing-size_t.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/czmq/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/dav1d/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/db/CVE-2017-10140-4.8-cwd-db_config.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/db/CVE-2017-10140-cwd-db_config.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/db/clang-4.8.patch141
-rw-r--r--nixpkgs/pkgs/development/libraries/db/clang-5.3.patch141
-rw-r--r--nixpkgs/pkgs/development/libraries/db/clang-6.0.patch123
-rw-r--r--nixpkgs/pkgs/development/libraries/db/db-4.8.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/db/db-5.3.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/db/db-6.0.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/db/db-6.2.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/db/generic.nix56
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus-cplusplus/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus-glib/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus-sharp-glib/dbus-sharp-glib-1.0.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus-sharp-glib/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus-sharp/dbus-sharp-1.0.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus-sharp/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus/default.nix122
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus/docs-reproducible-ids.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus/implement-getgrouplist.patch108
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus/make-dbus-conf.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus/make-session-conf.xsl36
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus/make-system-conf.xsl39
-rw-r--r--nixpkgs/pkgs/development/libraries/dbxml/cxx11.patch59
-rw-r--r--nixpkgs/pkgs/development/libraries/dbxml/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/dbxml/incorrect-optimization.patch34
-rw-r--r--nixpkgs/pkgs/development/libraries/dclib/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/dclxvi/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/dconf/default.nix76
-rw-r--r--nixpkgs/pkgs/development/libraries/dee/default.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/directfb/default.nix68
-rw-r--r--nixpkgs/pkgs/development/libraries/discord-rpc/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/dleyna-connector-dbus/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/dleyna-core/0001-Search-connectors-in-DLEYNA_CONNECTOR_PATH.patch95
-rw-r--r--nixpkgs/pkgs/development/libraries/dleyna-core/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/dleyna-core/setup-hook.sh8
-rw-r--r--nixpkgs/pkgs/development/libraries/dleyna-renderer/default.nix60
-rw-r--r--nixpkgs/pkgs/development/libraries/dleyna-renderer/gupnp-1.2.diff130
-rw-r--r--nixpkgs/pkgs/development/libraries/dleyna-server/default.nix64
-rw-r--r--nixpkgs/pkgs/development/libraries/dlib/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/docopt_cpp/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/doctest/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/dotconf/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/dotnetfx35/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/dotnetfx40/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/double-conversion/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/dqlite/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/draco/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/drogon/default.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/drogon/fix_find_package.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/drumstick/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/drumstick/drumstick-plugins.patch14
-rw-r--r--nixpkgs/pkgs/development/libraries/dssi/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/duckdb/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/dxflib/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/dyncall/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/easyloggingpp/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/eccodes/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/eclib/default.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/editline/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/egl-wayland/default.nix88
-rw-r--r--nixpkgs/pkgs/development/libraries/eigen/2.0.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/eigen/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/eigen/default.upstream4
-rw-r--r--nixpkgs/pkgs/development/libraries/eigen/include-dir.patch58
-rw-r--r--nixpkgs/pkgs/development/libraries/elementary-cmake-modules/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/elementary-cmake-modules/setup-hook.sh4
-rw-r--r--nixpkgs/pkgs/development/libraries/elf-header/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/embree/2.x.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/embree/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/enchant/1.x.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/enchant/2.x.nix58
-rw-r--r--nixpkgs/pkgs/development/libraries/enet/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/entt/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/epoxy/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/epoxy/libgl-path.patch24
-rw-r--r--nixpkgs/pkgs/development/libraries/ethash/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/eventlog/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/exempi/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/exiv2/default.nix102
-rw-r--r--nixpkgs/pkgs/development/libraries/exosip/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/expat/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/faac/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/faad2/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/farbfeld/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/farstream/default.nix66
-rw-r--r--nixpkgs/pkgs/development/libraries/fast-cpp-csv-parser/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/fast-cpp-csv-parser/fast-cpp-csv-parser.pc.in8
-rw-r--r--nixpkgs/pkgs/development/libraries/fastjson/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/fastpbkdf2/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/faudio/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/fcft/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/fcgi/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/fcgi/gcc-4.4.diff12
-rw-r--r--nixpkgs/pkgs/development/libraries/fcl/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/fcppt/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/fdk-aac/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/fflas-ffpack/default.nix58
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpeg-full/default.nix488
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpeg-sixel/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpeg/2.8.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpeg/3.4.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpeg/4.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpeg/generic.nix230
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpeg/v2-0001-avcodec-videotoolboxenc-define-TARGET_CPU_ARM64-t.patch35
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpegthumbnailer/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/ffms/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/fftw/default.nix73
-rw-r--r--nixpkgs/pkgs/development/libraries/filter-audio/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/flann/default.nix71
-rw-r--r--nixpkgs/pkgs/development/libraries/flatbuffers/1.12.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/flatbuffers/2.0.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/flatbuffers/generic.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/flatcc/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/flatpak/bubblewrap-paths.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/flatpak/default.nix208
-rw-r--r--nixpkgs/pkgs/development/libraries/flatpak/fix-paths.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/flatpak/fix-test-paths.patch205
-rw-r--r--nixpkgs/pkgs/development/libraries/flatpak/respect-xml-catalog-files-var.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/flatpak/unset-env-vars.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/flatpak/use-flatpak-from-path.patch50
-rw-r--r--nixpkgs/pkgs/development/libraries/flatpak/validate-icon-pixbuf.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/flint/default.nix56
-rw-r--r--nixpkgs/pkgs/development/libraries/flite/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/fltk/1.4.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/fltk/common.nix205
-rw-r--r--nixpkgs/pkgs/development/libraries/fltk/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/fltk/nsosv.patch20
-rw-r--r--nixpkgs/pkgs/development/libraries/fmt/default.nix55
-rw-r--r--nixpkgs/pkgs/development/libraries/folks/default.nix129
-rw-r--r--nixpkgs/pkgs/development/libraries/folly/default.nix65
-rw-r--r--nixpkgs/pkgs/development/libraries/fontconfig/default.nix87
-rw-r--r--nixpkgs/pkgs/development/libraries/fontconfig/make-fonts-cache.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/fontconfig/make-fonts-conf.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/fontconfig/make-fonts-conf.xsl62
-rw-r--r--nixpkgs/pkgs/development/libraries/forge/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/fox/clang.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/fox/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/fox/fox-1.6.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/fplll/20160331.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/fplll/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/frame/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/freealut/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/freeglut/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/freeimage/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/freeimage/unbundle.diff584
-rw-r--r--nixpkgs/pkgs/development/libraries/freenect/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/freetds/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/freetts/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/freetype/default.nix69
-rw-r--r--nixpkgs/pkgs/development/libraries/freetype/enable-subpixel-rendering.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/freetype/enable-table-validation.patch20
-rw-r--r--nixpkgs/pkgs/development/libraries/frei0r/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/fribidi/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/fstrcmp/cross.patch24
-rw-r--r--nixpkgs/pkgs/development/libraries/fstrcmp/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/fstrm/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/ftgl/default.nix66
-rw-r--r--nixpkgs/pkgs/development/libraries/ftxui/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/funambol/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/g2o/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/g2o/remove-compiler-reference.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/gaia/default.nix87
-rw-r--r--nixpkgs/pkgs/development/libraries/galario/default.nix78
-rw-r--r--nixpkgs/pkgs/development/libraries/gamenetworkingsockets/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/gamin/abstract-socket-namespace.patch73
-rw-r--r--nixpkgs/pkgs/development/libraries/gamin/deadlock.patch68
-rw-r--r--nixpkgs/pkgs/development/libraries/gamin/debian-patches.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gamin/debian-patches.txt2
-rw-r--r--nixpkgs/pkgs/development/libraries/gamin/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/gamin/returnval.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/ganv/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/garmintools/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/gbenchmark/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/gcab/default.nix83
-rw-r--r--nixpkgs/pkgs/development/libraries/gcab/installed-tests-path.patch21
-rw-r--r--nixpkgs/pkgs/development/libraries/gcc/libgcc/default.nix152
-rw-r--r--nixpkgs/pkgs/development/libraries/gcc/libstdc++/5.nix117
-rw-r--r--nixpkgs/pkgs/development/libraries/gcc/libstdc++/no-sys-dirs.patch53
-rw-r--r--nixpkgs/pkgs/development/libraries/gcc/libstdc++/struct-ucontext.patch61
-rw-r--r--nixpkgs/pkgs/development/libraries/gcr/default.nix105
-rw-r--r--nixpkgs/pkgs/development/libraries/gd/default.nix61
-rw-r--r--nixpkgs/pkgs/development/libraries/gdal/2.4.nix82
-rw-r--r--nixpkgs/pkgs/development/libraries/gdal/default.nix92
-rw-r--r--nixpkgs/pkgs/development/libraries/gdata-sharp/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/gdbm/default.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/gdcm/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/gdk-pixbuf/default.nix144
-rw-r--r--nixpkgs/pkgs/development/libraries/gdk-pixbuf/installed-tests-path.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh17
-rw-r--r--nixpkgs/pkgs/development/libraries/gdk-pixbuf/xlib.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/gdl/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/gdome2/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/gdome2/xml-document.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/gecode/3.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/gecode/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/gegl/default.nix121
-rw-r--r--nixpkgs/pkgs/development/libraries/geis/default.nix60
-rw-r--r--nixpkgs/pkgs/development/libraries/genann/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/gensio/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/geoclue/add-option-for-installation-sysconfdir.patch84
-rw-r--r--nixpkgs/pkgs/development/libraries/geoclue/default.nix114
-rw-r--r--nixpkgs/pkgs/development/libraries/geocode-glib/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/geocode-glib/installed-tests-path.patch8
-rw-r--r--nixpkgs/pkgs/development/libraries/geoip/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/geos/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/getdata/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/getdns/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/gettext/absolute-paths.diff21
-rw-r--r--nixpkgs/pkgs/development/libraries/gettext/default.nix99
-rw-r--r--nixpkgs/pkgs/development/libraries/gettext/gettext-setup-hook.sh17
-rw-r--r--nixpkgs/pkgs/development/libraries/gexiv2/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/gf2x/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/gfbgraph/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/gflags/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/ggz_base_libs/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/ghc_filesystem/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/giblib/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/giflib/4.1.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/giflib/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/gio-sharp/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/git2/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/givaro/3.7.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/givaro/3.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/givaro/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/gjs/default.nix140
-rw-r--r--nixpkgs/pkgs/development/libraries/gjs/fix-paths.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/gjs/installed-tests-path.patch37
-rw-r--r--nixpkgs/pkgs/development/libraries/gl2ps/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/glbinding/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/gle/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/glew/1.10.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/glew/default.nix57
-rw-r--r--nixpkgs/pkgs/development/libraries/glfw/2.x.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/glfw/3.x.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/glfw/wayland.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/glib-networking/default.nix94
-rw-r--r--nixpkgs/pkgs/development/libraries/glib-networking/hardcode-gsettings.patch341
-rw-r--r--nixpkgs/pkgs/development/libraries/glib-networking/installed-tests-path.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/glib-testing/default.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/glib-testing/installed-tests-path.patch32
-rw-r--r--nixpkgs/pkgs/development/libraries/glib/darwin-compilation.patch24
-rw-r--r--nixpkgs/pkgs/development/libraries/glib/default.nix215
-rw-r--r--nixpkgs/pkgs/development/libraries/glib/gobject_init_on_demand.patch87
-rw-r--r--nixpkgs/pkgs/development/libraries/glib/link-with-coreservices.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/glib/quark_init_on_demand.patch33
-rw-r--r--nixpkgs/pkgs/development/libraries/glib/schema-override-variable.patch14
-rw-r--r--nixpkgs/pkgs/development/libraries/glib/setup-hook.sh34
-rw-r--r--nixpkgs/pkgs/development/libraries/glib/skip-timer-test.patch17
-rw-r--r--nixpkgs/pkgs/development/libraries/glib/split-dev-programs.patch154
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/2.33-master.patch.gzbin0 -> 56984 bytes
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/allow-kernel-2.6.32.patch39
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/common.nix291
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/darwin-cross-build.patch77
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/default.nix150
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/dont-use-system-ld-so-cache.patch64
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/dont-use-system-ld-so-preload.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/fix-rpc-types-musl-conflicts.patch38
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/fix-x64-abi.patch35
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/fix_path_attribute_in_getconf.patch6
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/info.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/locales-builder.sh17
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/locales.nix68
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/multi.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/nix-locale-archive.patch118
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/rpcgen-path.patch54
-rw-r--r--nixpkgs/pkgs/development/libraries/glibmm/2.68.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/glibmm/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/glm/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/globalarrays/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/globalplatform/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/globalplatform/gppcscconnectionplugin.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/glog/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/gloox/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/glpk/default.nix78
-rw-r--r--nixpkgs/pkgs/development/libraries/glpng/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/glui/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/gmime/2.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/gmime/3.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/gmm/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/gmp/4.3.2.nix75
-rw-r--r--nixpkgs/pkgs/development/libraries/gmp/5.1.x.nix81
-rw-r--r--nixpkgs/pkgs/development/libraries/gmp/6.x.nix88
-rw-r--r--nixpkgs/pkgs/development/libraries/gmp/need-size-t.patch18
-rw-r--r--nixpkgs/pkgs/development/libraries/gmtk/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/gmtk/fix-paths.patch20
-rw-r--r--nixpkgs/pkgs/development/libraries/gnet/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/gnome-menus/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/gnome-online-accounts/default.nix104
-rw-r--r--nixpkgs/pkgs/development/libraries/gnome-sharp/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/gnome-sharp/fix-mono-path.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/gnome-video-effects/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/gnome-video-effects/fix-pc-file.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/gnu-config/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/gnu-efi/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/gnutls-kdh/3.5.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/gnutls-kdh/generic.nix95
-rw-r--r--nixpkgs/pkgs/development/libraries/gnutls/default.nix119
-rw-r--r--nixpkgs/pkgs/development/libraries/gnutls/nix-ssl-cert-file.patch19
-rw-r--r--nixpkgs/pkgs/development/libraries/gnutls/no-security-framework.patch126
-rw-r--r--nixpkgs/pkgs/development/libraries/gobject-introspection/absolute_gir_path.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch184
-rw-r--r--nixpkgs/pkgs/development/libraries/gobject-introspection/default.nix136
-rw-r--r--nixpkgs/pkgs/development/libraries/gobject-introspection/setup-hook.sh34
-rw-r--r--nixpkgs/pkgs/development/libraries/goffice/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/gom/default.nix64
-rw-r--r--nixpkgs/pkgs/development/libraries/gom/longer-stress-timeout.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/goocanvas/2.x.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/goocanvas/3.x.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/goocanvas/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/goocanvasmm/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix76
-rw-r--r--nixpkgs/pkgs/development/libraries/gperftools/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/gpgme/default.nix101
-rw-r--r--nixpkgs/pkgs/development/libraries/gpgme/disable-python-tests.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/gpgme/fix-clang-autoconf-undeclared-warning.patch36
-rw-r--r--nixpkgs/pkgs/development/libraries/grail/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/grantlee/5/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/grantlee/5/grantlee-nix-profiles.patch19
-rw-r--r--nixpkgs/pkgs/development/libraries/grantlee/5/grantlee-no-canonicalize-filepath.patch27
-rw-r--r--nixpkgs/pkgs/development/libraries/grantlee/5/setup-hook.sh13
-rw-r--r--nixpkgs/pkgs/development/libraries/grantlee/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/graphene-hardened-malloc/default.nix88
-rw-r--r--nixpkgs/pkgs/development/libraries/graphene/0001-meson-add-options-for-tests-installation-dirs.patch97
-rw-r--r--nixpkgs/pkgs/development/libraries/graphene/default.nix92
-rw-r--r--nixpkgs/pkgs/development/libraries/grib-api/default.nix71
-rw-r--r--nixpkgs/pkgs/development/libraries/grilo-plugins/chromaprint-gst-plugins.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/grilo-plugins/default.nix101
-rw-r--r--nixpkgs/pkgs/development/libraries/grilo/default.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/grilo/setup-hook.sh7
-rw-r--r--nixpkgs/pkgs/development/libraries/grpc/default.nix80
-rw-r--r--nixpkgs/pkgs/development/libraries/gsasl/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/gsettings-desktop-schemas/default.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/gsettings-qt/default.nix71
-rw-r--r--nixpkgs/pkgs/development/libraries/gsignond/conf.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/gsignond/default.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/gsignond/plugin-load-env.patch35
-rw-r--r--nixpkgs/pkgs/development/libraries/gsignond/plugins/lastfm.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/gsignond/plugins/mail.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/gsignond/plugins/oauth.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/gsignond/plugins/sasl.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/gsignond/wrapper.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/gsl/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/gsl/gsl-1_16.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/gsm/default.nix56
-rw-r--r--nixpkgs/pkgs/development/libraries/gsmlib/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/gsoap/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/gsound/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/gspell/0001-Darwin-build-fix.patch37
-rw-r--r--nixpkgs/pkgs/development/libraries/gspell/default.nix70
-rw-r--r--nixpkgs/pkgs/development/libraries/gss/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/gssdp/default.nix66
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix326
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/bad/fix_pkgconfig_includedir.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix156
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/base/fix_pkgconfig_includedir.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix116
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/core/fix_pkgconfig_includedir.patch17
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/core/setup-hook.sh9
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/devtools/default.nix64
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/devtools/fix_pkgconfig_includedir.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix77
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/ges/fix_pkgconfig_includedir.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix170
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/gstreamermm/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix55
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/default.nix76
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/fix_pkgconfig_includedir.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix83
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/vaapi/default.nix85
-rw-r--r--nixpkgs/pkgs/development/libraries/gtdialog/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/gtdialog/default.upstream3
-rw-r--r--nixpkgs/pkgs/development/libraries/gtest/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/gtest/fix-cmake-config-includedir.patch30
-rw-r--r--nixpkgs/pkgs/development/libraries/gthree/default.nix73
-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-frdp/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-layer-shell/default.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-mac-integration/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-sharp-beans/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-sharp/2.0.nix79
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-sharp/3.0.nix64
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-sharp/builder.sh11
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/2.x.nix112
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/3.x.nix231
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/4.x.nix243
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/hooks/clean-immodules-cache.sh15
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/hooks/drop-icon-theme-cache.sh19
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/patches/2.0-darwin-x11.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/patches/2.0-immodules.cache.patch27
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/patches/3.0-darwin-x11.patch28
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/patches/3.0-immodules.cache.patch27
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/patches/gtk2-theme-paths.patch40
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkd/default.nix138
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkd/paths.d142
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkdatabox/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkextra/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkimageview/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkmathview/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkmathview/gcc-4.3-build-fixes.patch74
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkmathview/gcc-4.4-build-fixes.patch21
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkmm/2.x.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkmm/3.x.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkmm/4.x.nix91
-rw-r--r--nixpkgs/pkgs/development/libraries/gtksourceview/3.x-nix_share_path.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/gtksourceview/3.x.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/gtksourceview/4.x-nix_share_path.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/gtksourceview/4.x.nix109
-rw-r--r--nixpkgs/pkgs/development/libraries/gtksourceview/5.x.nix99
-rw-r--r--nixpkgs/pkgs/development/libraries/gtksourceviewmm/4.x.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/gtksourceviewmm/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkspell/3.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkspell/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkspellmm/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/gts/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/gumbo/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/gupnp-av/default.nix58
-rw-r--r--nixpkgs/pkgs/development/libraries/gupnp-dlna/default.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/gupnp-igd/default.nix64
-rw-r--r--nixpkgs/pkgs/development/libraries/gupnp/default.nix81
-rw-r--r--nixpkgs/pkgs/development/libraries/gusb/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/gusb/fix-python-path.patch14
-rw-r--r--nixpkgs/pkgs/development/libraries/gvfs/default.nix132
-rw-r--r--nixpkgs/pkgs/development/libraries/half/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/hamlib/4.nix64
-rw-r--r--nixpkgs/pkgs/development/libraries/hamlib/default.nix64
-rw-r--r--nixpkgs/pkgs/development/libraries/harfbuzz/default.nix109
-rw-r--r--nixpkgs/pkgs/development/libraries/hawknl/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/hdf5-blosc/blosc_filter.pc.in13
-rw-r--r--nixpkgs/pkgs/development/libraries/hdf5-blosc/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/hdf5-blosc/no-external-blosc.patch26
-rw-r--r--nixpkgs/pkgs/development/libraries/herqq/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/hidapi/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/highfive/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/hiredis-vip/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/hiredis/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/hivex/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/hivex/hivex-syms.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/hotpatch/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/howard-hinnant-date/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/howard-hinnant-date/make-zoneinfo-available.diff13
-rw-r--r--nixpkgs/pkgs/development/libraries/hpx/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/hspell/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/hspell/dicts.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/htmlcxx/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/htmlcxx/ptrdiff.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/http-parser/build-shared.patch30
-rw-r--r--nixpkgs/pkgs/development/libraries/http-parser/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/hunspell/0001-Make-hunspell-look-in-XDG_DATA_DIRS-for-dictionaries.patch37
-rw-r--r--nixpkgs/pkgs/development/libraries/hunspell/default.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/hunspell/dictionaries.nix824
-rw-r--r--nixpkgs/pkgs/development/libraries/hunspell/wrapper.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/hwloc/default.nix83
-rw-r--r--nixpkgs/pkgs/development/libraries/hyena/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/hyperscan/default.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/hyphen/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/icu/58.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/icu/59.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/icu/60.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/icu/63.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/icu/64.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/icu/65.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/icu/66.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/icu/67.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/icu/68.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/icu/69.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/icu/base.nix100
-rw-r--r--nixpkgs/pkgs/development/libraries/id3lib/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/id3lib/id3lib-3.8.3-gcc43-1.patch104
-rw-r--r--nixpkgs/pkgs/development/libraries/id3lib/patch_id3lib_3.8.3_UTF16_writing_bug.diff39
-rw-r--r--nixpkgs/pkgs/development/libraries/idnkit/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/igraph/default.nix110
-rw-r--r--nixpkgs/pkgs/development/libraries/ijs/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/iksemel/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/ilbc/CMakeLists.txt11
-rw-r--r--nixpkgs/pkgs/development/libraries/ilbc/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/ilbc/extract-cfile.awk24
-rw-r--r--nixpkgs/pkgs/development/libraries/ilixi/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/ilmbase/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/imath/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/iml/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/imlib/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/imlib2/default.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/impy/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/inchi/default.nix74
-rw-r--r--nixpkgs/pkgs/development/libraries/incrtcl/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/indicator-application/gtk2.nix55
-rw-r--r--nixpkgs/pkgs/development/libraries/indicator-application/gtk3.nix57
-rw-r--r--nixpkgs/pkgs/development/libraries/inih/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/iniparser/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/iniparser/iniparser.pc.in12
-rw-r--r--nixpkgs/pkgs/development/libraries/iniparser/no-usr.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/intel-gmmlib/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/intel-media-driver/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/intel-media-sdk/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/iodash/0001-Add-cmake-install-directives.patch44
-rw-r--r--nixpkgs/pkgs/development/libraries/iodash/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/ip2location-c/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/irrlicht/common.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/irrlicht/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/irrlicht/mac.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/irrlicht/mac_device.patch20
-rw-r--r--nixpkgs/pkgs/development/libraries/isl/0.11.1.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/isl/0.14.1.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/isl/0.17.1.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/isl/0.20.0.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/isl/fix-gcc-build.diff12
-rw-r--r--nixpkgs/pkgs/development/libraries/iso-codes/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/itk/4.x.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/itk/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/itktcl/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/jabcode/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/jama/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/jansson/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/jasper/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/java/commons/bcel/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/java/commons/bsf/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/java/commons/compress/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/java/commons/daemon/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/java/commons/fileupload/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/java/commons/io/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/java/commons/lang/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/java/commons/logging/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/java/commons/math/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/java/cup/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/java/cup/javacup-0.11b_beta20160615-build-xml-git.patch38
-rw-r--r--nixpkgs/pkgs/development/libraries/java/dbus-java/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/java/geoipjava/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/java/gwt-dragdrop/builder.sh4
-rw-r--r--nixpkgs/pkgs/development/libraries/java/gwt-dragdrop/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/java/gwt-widgets/builder.sh6
-rw-r--r--nixpkgs/pkgs/development/libraries/java/gwt-widgets/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/java/hsqldb/default.nix38
-rwxr-xr-xnixpkgs/pkgs/development/libraries/java/httpunit/builder.sh5
-rw-r--r--nixpkgs/pkgs/development/libraries/java/httpunit/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/java/hydra-ant-logger/default.nix25
-rwxr-xr-xnixpkgs/pkgs/development/libraries/java/jdom/builder.sh6
-rw-r--r--nixpkgs/pkgs/development/libraries/java/jdom/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/java/jflex/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/java/junit/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/java/junixsocket/darwin.patch20
-rw-r--r--nixpkgs/pkgs/development/libraries/java/junixsocket/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/java/libmatthew-java/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/java/lombok/default.nix31
-rwxr-xr-xnixpkgs/pkgs/development/libraries/java/lucene/builder.sh6
-rw-r--r--nixpkgs/pkgs/development/libraries/java/lucene/default.nix19
-rwxr-xr-xnixpkgs/pkgs/development/libraries/java/mockobjects/builder.sh6
-rw-r--r--nixpkgs/pkgs/development/libraries/java/mockobjects/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/java/rhino/default.nix58
-rw-r--r--nixpkgs/pkgs/development/libraries/java/rhino/gcj-type-mismatch.patch103
-rw-r--r--nixpkgs/pkgs/development/libraries/java/saxon/default.nix85
-rw-r--r--nixpkgs/pkgs/development/libraries/java/smack/builder.sh7
-rw-r--r--nixpkgs/pkgs/development/libraries/java/smack/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/java/swt/default.nix73
-rw-r--r--nixpkgs/pkgs/development/libraries/jbig2dec/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/jbigkit/default.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/jcal/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/jemalloc/common.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/jemalloc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/jemalloc/jemalloc450.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/jitterentropy/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/jitterentropy/reproducible-manpages.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/jose/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/json-c/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/json-glib/default.nix77
-rw-r--r--nixpkgs/pkgs/development/libraries/jsoncpp/default.nix57
-rw-r--r--nixpkgs/pkgs/development/libraries/jsonrpc-glib/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/judy/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/jxrlib/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/kcolorpicker/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/kdb/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/kddockwidgets/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/attica.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/baloo.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/bluez-qt.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/breeze-icons.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/default.nix196
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/nix-lib-path.patch40
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh112
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/fetch.sh1
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/frameworkintegration.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kactivities-stats.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kactivities.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kapidox.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/karchive.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kauth/cmake-install-paths.patch17
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kauth/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kbookmarks.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kcalendarcore.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kcmutils/0001-kcmutils-follow-symlinks.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kcmutils/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kcodecs.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kcompletion.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kconfig.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kconfigwidgets/0001-QDirIterator-follow-symlinks.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kconfigwidgets/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kcontacts.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kcoreaddons.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kcrash.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kdav.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kdbusaddons.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kdeclarative.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kded.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kdelibs4support/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kdelibs4support/nix-kde-include-dir.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kdelibs4support/setup-hook.sh1
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kdesignerplugin.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kdesu/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kdesu/kdesu-search-for-wrapped-daemon-first.patch38
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kdewebkit.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kdnssd.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kdoctools/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kdoctools/kdoctools-no-find-docbook-xml.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh5
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kemoticons.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kfilemetadata/cmake-install-paths.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kfilemetadata/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kglobalaccel.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kguiaddons.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kholidays.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/khtml.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/ki18n.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kiconthemes/default-theme-breeze.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kiconthemes/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kidletime.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kimageformats.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/0001-kinit-libpath.patch45
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/0002-start_kdeinit-path.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/0003-kdeinit-extra-libs.patch59
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/0004-start_kdeinit-environ-hard-limit.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kio/0001-Remove-impure-smbd-search-path.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kio/0002-Debug-module-loader.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kio/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kirigami2.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kitemmodels.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kitemviews.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kjobwidgets.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kjs.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kjsembed.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kmediaplayer.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/knewstuff/0001-Delay-resolving-knsrcdir.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/knewstuff/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/knotifications.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/knotifyconfig.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kpackage/0001-Allow-external-paths-default.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kpackage/0002-QDirIterator-follow-symlinks.patch26
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kpackage/default.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kparts.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kpeople.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kplotting.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kpty.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kquickcharts.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kross.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/krunner.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kservice/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kservice/no-canonicalize-path.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kservice/qdiriterator-follow-symlinks.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/ktexteditor.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/ktextwidgets.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kunitconversion.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kwallet.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kwayland.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kwidgetsaddons.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kwindowsystem/0001-platform-plugins-path.patch50
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kwindowsystem/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kxmlgui.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kxmlrpcclient.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/modemmanager-qt.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/networkmanager-qt.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/oxygen-icons5.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/plasma-framework.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/prison.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/purpose.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/qqc2-desktop-style.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/solid.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/sonnet.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/srcs.nix670
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/syndication.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/syntax-highlighting.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/threadweaver.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/kdiagram/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/kdsoap/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/kerberos/heimdal-make-missing-headers.patch10
-rw-r--r--nixpkgs/pkgs/development/libraries/kerberos/heimdal.nix101
-rw-r--r--nixpkgs/pkgs/development/libraries/kerberos/krb5-Fix-Linux-build-error-with-musl-libc.patch32
-rw-r--r--nixpkgs/pkgs/development/libraries/kerberos/krb5-Fix-typo-in-musl-build-fix.patch28
-rw-r--r--nixpkgs/pkgs/development/libraries/kerberos/krb5.nix97
-rw-r--r--nixpkgs/pkgs/development/libraries/keybinder/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/keybinder3/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/keystone/default.nix37
-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/kimageannotator/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/kissfft/0001-pkgconfig-darwin.patch48
-rw-r--r--nixpkgs/pkgs/development/libraries/kissfft/default.nix85
-rw-r--r--nixpkgs/pkgs/development/libraries/kmsxx/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/kpeoplevcard/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/kpmcore/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/kproperty/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/kquickimageedit/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/kreport/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/kronosnet/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/kyotocabinet/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/l-smash/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/lame/default.nix71
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/frog.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/frogdata.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/libfolia.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/mbt-add-libxml2-dep.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/mbt.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/packages.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-frog.json5
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-frogdata.json5
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-libfolia.json5
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-mbt.json5
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-ticcutils.json5
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-timbl.json5
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-timblserver.json5
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-ucto.json5
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-uctodata.json5
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/test.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/ticcutils.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/timbl.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/timblserver.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/ucto.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/uctodata.nix32
-rwxr-xr-xnixpkgs/pkgs/development/libraries/languagemachines/update79
-rw-r--r--nixpkgs/pkgs/development/libraries/lasem/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/lasso/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/lcms/cve-2013-4276.patch62
-rw-r--r--nixpkgs/pkgs/development/libraries/lcms/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/lcms2/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/ldacbt/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/ldb/default.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/ldns/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/ldutils/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/leatherman/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/lemon-graph/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/lensfun/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/leptonica/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/lesstif/c-missing_xm_h.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/lesstif/c-render_table_crash.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/lesstif/c-xpmpipethrough.patch381
-rw-r--r--nixpkgs/pkgs/development/libraries/lesstif/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/leveldb/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/levmar/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/lib2geom/default.nix60
-rw-r--r--nixpkgs/pkgs/development/libraries/lib3ds/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/lib3mf/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/libAfterImage/default.nix76
-rw-r--r--nixpkgs/pkgs/development/libraries/libHX/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libLAS/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libaacs/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libaal/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libaal/libaal-1.0.6-glibc-2.26.patch89
-rw-r--r--nixpkgs/pkgs/development/libraries/libabigail/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/libabw/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libaccounts-glib/default.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/libaccounts-glib/py-override.patch38
-rw-r--r--nixpkgs/pkgs/development/libraries/libadwaita/default.nix77
-rw-r--r--nixpkgs/pkgs/development/libraries/libaec/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libagar/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/libagar/libagar_test.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libagar/srcs.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libamqpcpp/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libamqpcpp/libamqpcpp-darwin.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/libantlr3c/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libao/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/libaom/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/libaom/outputs.patch45
-rw-r--r--nixpkgs/pkgs/development/libraries/libaosd/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/libappindicator/default.nix66
-rw-r--r--nixpkgs/pkgs/development/libraries/libarchive-qt/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/libarchive/default.nix65
-rw-r--r--nixpkgs/pkgs/development/libraries/libargon2/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/libargs/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libasr/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libass/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/libassuan/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/libast/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libasyncns/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libatomic_ops/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libaudclient/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libaudec/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libav/default.nix137
-rw-r--r--nixpkgs/pkgs/development/libraries/libav/vpx-12.3-libvpx-1.8.patch46
-rw-r--r--nixpkgs/pkgs/development/libraries/libav/vpxenc-0.8.17-libvpx-1.5.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/libavc1394/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libavif/default.nix61
-rw-r--r--nixpkgs/pkgs/development/libraries/libayatana-appindicator/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/libayatana-indicator/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/libb2/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libb64/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libbacktrace/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libbap/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/libbaseencode/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libbdplus/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libbencodetools/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libbfd/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/libbladeRF/default.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/libblockdev/default.nix60
-rw-r--r--nixpkgs/pkgs/development/libraries/libblockdev/fix-paths.patch47
-rw-r--r--nixpkgs/pkgs/development/libraries/libblocksruntime/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libbluedevil/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libbluray/BDJ-JARFILE-path.patch27
-rw-r--r--nixpkgs/pkgs/development/libraries/libbluray/default.nix66
-rw-r--r--nixpkgs/pkgs/development/libraries/libbsd/darwin.patch454
-rw-r--r--nixpkgs/pkgs/development/libraries/libbsd/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libbson/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libbtbb/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libburn/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/libbytesize/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libcaca/default.nix75
-rw-r--r--nixpkgs/pkgs/development/libraries/libcacard/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libcamera/default.nix76
-rw-r--r--nixpkgs/pkgs/development/libraries/libcanberra/default.nix70
-rw-r--r--nixpkgs/pkgs/development/libraries/libcangjie/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/libcbor/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libccd/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libcdaudio/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/libcddb/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libcdio-paranoia/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/libcdio/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/libcdr/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libcec/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libcec/platform.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libcef/default.nix112
-rw-r--r--nixpkgs/pkgs/development/libraries/libcello/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libcerf/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libchamplain/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/libchardet/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libchewing/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libchop/0001-Fix-RPC-compilation-when-using-libtirpc-rather-than-.patch41
-rw-r--r--nixpkgs/pkgs/development/libraries/libchop/default.nix58
-rw-r--r--nixpkgs/pkgs/development/libraries/libchop/gets-undeclared.patch71
-rw-r--r--nixpkgs/pkgs/development/libraries/libchop/size_t.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/libcint/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/libck/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libclc/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/libcli/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libcloudproviders/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libclthreads/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/libclxclient/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/libcmis/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libcollectdclient/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libcommuni/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/libconfig/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libconfuse/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/libcork/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/libcotp/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libcouchbase/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libcprime/0001-fix-application-dirs.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/libcprime/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/libcrafter/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libcredis/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libcrossguid/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/libcryptui/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/libcryptui/fix-gnupg-2.2.patch26
-rw-r--r--nixpkgs/pkgs/development/libraries/libcsptr/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libcsys/default.nix31
-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/libctemplate/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libcue/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libcutl/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libcyaml/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libdaemon/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libdaemon/fix-includes.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/libdap/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libdatrie/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/libdazzle/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/libdbi-drivers/default.nix62
-rw-r--r--nixpkgs/pkgs/development/libraries/libdbi/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libdbusmenu-qt/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libdbusmenu/default.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/libdc1394/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libde265/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libdeflate/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/libdeltachat/default.nix75
-rw-r--r--nixpkgs/pkgs/development/libraries/libdeltachat/no-static-lib.patch39
-rw-r--r--nixpkgs/pkgs/development/libraries/libdevil/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/libdevil/ftbfs-libpng15.patch31
-rw-r--r--nixpkgs/pkgs/development/libraries/libdevil/il_endian.h.patch27
-rw-r--r--nixpkgs/pkgs/development/libraries/libdigidoc/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libdigidocpp/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libdiscid/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libdivecomputer/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libdivsufsort/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libdmapsharing/default.nix95
-rw-r--r--nixpkgs/pkgs/development/libraries/libdmtx/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libdnet/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libdrm/cross-build-nm-path.patch47
-rw-r--r--nixpkgs/pkgs/development/libraries/libdrm/default.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/libdv/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libdvbpsi/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/libdvdcss/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/libdvdnav/4.2.1.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libdvdnav/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libdvdread/4.9.9.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libdvdread/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libdwarf/default.nix56
-rw-r--r--nixpkgs/pkgs/development/libraries/libdwg/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libdynd/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/libe-book/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/libe-book/default.upstream4
-rw-r--r--nixpkgs/pkgs/development/libraries/libe57format/default.nix60
-rw-r--r--nixpkgs/pkgs/development/libraries/libeatmydata/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/libeatmydata/find-shell-lib.patch20
-rw-r--r--nixpkgs/pkgs/development/libraries/libeb/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libebml/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libebur128/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libechonest/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/libedit/01-cygwin.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/libedit/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libee/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/libelf-freebsd/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/libelf/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/libelf/dont-hardcode-ar.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/libelf/preprocessor-warnings.patch264
-rw-r--r--nixpkgs/pkgs/development/libraries/libelfin/0001-Don-t-detect-package-version-with-Git.patch72
-rw-r--r--nixpkgs/pkgs/development/libraries/libelfin/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libemf2svg/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libepc/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/liberfa/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/liberio/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/libesmtp/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libestr/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libetpan/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/libev/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libevdev/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libevdevplus/0001-Add-cmake-install-directives.patch41
-rw-r--r--nixpkgs/pkgs/development/libraries/libevdevplus/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libevent/default.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/libewf/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libexecinfo/30-linux-makefile.patch44
-rw-r--r--nixpkgs/pkgs/development/libraries/libexecinfo/default.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/libexif/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/libexsid/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/libextractor/default.nix99
-rw-r--r--nixpkgs/pkgs/development/libraries/libextractor/gst-hardcode-plugins.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/libexttextcat/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libf2c/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/libfakekey/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libfaketime/0001-Remove-unsupported-clang-flags.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/libfaketime/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/libfaketime/nix-store-date.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/libfaketime/no-date-in-gzip-man-page.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/libfann/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libff/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libffcall/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libffi/default.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/libfido2/default.nix58
-rw-r--r--nixpkgs/pkgs/development/libraries/libfilezilla/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/libfishsound/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libfive/default.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/libfixposix/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libfm/default.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/libfprint-2-tod1-goodix/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/libfprint-2-tod1-vfs0090/0001-vfs0090-add-missing-explicit-dependencies-in-meson.b.patch28
-rw-r--r--nixpkgs/pkgs/development/libraries/libfprint-2-tod1-vfs0090/0002-vfs0090-add-missing-linux-limits.h-include.patch26
-rw-r--r--nixpkgs/pkgs/development/libraries/libfprint-2-tod1-vfs0090/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/libfprint-tod/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/libfprint/default.nix81
-rw-r--r--nixpkgs/pkgs/development/libraries/libfpx/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/libfreeaptx/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libfreefare/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libfsm/default.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/libftdi/1.x.nix73
-rw-r--r--nixpkgs/pkgs/development/libraries/libftdi/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/libfyaml/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libgadu/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libgaminggear/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/libgcrypt/1.5.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/libgcrypt/default.nix68
-rw-r--r--nixpkgs/pkgs/development/libraries/libgda/6.x.nix93
-rw-r--r--nixpkgs/pkgs/development/libraries/libgda/default.nix105
-rw-r--r--nixpkgs/pkgs/development/libraries/libgdamm/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/libgdata/default.nix86
-rw-r--r--nixpkgs/pkgs/development/libraries/libgdata/installed-tests-path.patch94
-rw-r--r--nixpkgs/pkgs/development/libraries/libgdiplus/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/libgee/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/libgeotiff/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/libgepub/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libgig/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libgit2-glib/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/libgksu/default.nix86
-rw-r--r--nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.0-fbsd.patch60
-rw-r--r--nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.12-automake-1.11.2.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.12-fix-make-3.82.patch19
-rw-r--r--nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.12-notests.patch26
-rw-r--r--nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.12-revert-forkpty.patch359
-rw-r--r--nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.7-libs.patch76
-rw-r--r--nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.7-polinguas.patch40
-rw-r--r--nixpkgs/pkgs/development/libraries/libglvnd/default.nix70
-rw-r--r--nixpkgs/pkgs/development/libraries/libgmpris/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libgnome-keyring/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libgnomekbd/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/libgnt/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/libgnurl/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/libgpg-error/default.nix78
-rw-r--r--nixpkgs/pkgs/development/libraries/libgpg-error/fix-1.42-cross-compilation.patch142
-rw-r--r--nixpkgs/pkgs/development/libraries/libgphoto2/default.nix56
-rw-r--r--nixpkgs/pkgs/development/libraries/libgpiod/0001-Drop-AC_FUNC_MALLOC-and-_REALLOC-and-check-for-them-.patch31
-rw-r--r--nixpkgs/pkgs/development/libraries/libgpiod/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/libgpod/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/libgringotts/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libgroove/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/libgroove/no-warnings-as-errors.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/libgrss/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/libgsf/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/libgssglue/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libgtop/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/libgudev/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/libguestfs/appliance.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/libguestfs/default.nix109
-rw-r--r--nixpkgs/pkgs/development/libraries/libguestfs/libguestfs-syms.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/libgumath/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libgweather/default.nix82
-rw-r--r--nixpkgs/pkgs/development/libraries/libgxps/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/libhandy/0.x.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/libhandy/default.nix120
-rw-r--r--nixpkgs/pkgs/development/libraries/libhangul/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/libharu/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libhdhomerun/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/libheif/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libhsts/default.nix40
-rwxr-xr-xnixpkgs/pkgs/development/libraries/libhsts/update.sh13
-rw-r--r--nixpkgs/pkgs/development/libraries/libhttpseverywhere/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/libhugetlbfs/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/libiberty/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libibmad/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/libibumad/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/libical/default.nix106
-rw-r--r--nixpkgs/pkgs/development/libraries/libical/respect-env-tzdir.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/libicns/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libiconv/default.nix57
-rw-r--r--nixpkgs/pkgs/development/libraries/libiconv/setup-hook.sh8
-rw-r--r--nixpkgs/pkgs/development/libraries/libid3tag/CVE-2017-11550-and-CVE-2017-11551.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/libid3tag/debian-patches.patch89
-rw-r--r--nixpkgs/pkgs/development/libraries/libid3tag/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/libid3tag/id3tag.pc11
-rw-r--r--nixpkgs/pkgs/development/libraries/libidn/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/libidn2/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/libidn2/fix-error-darwin.patch20
-rw-r--r--nixpkgs/pkgs/development/libraries/libiec61883/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libieee1284/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/libiio/cmake-fix-libxml2-find-package.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/libiio/default.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/libiio/hardcode-library-path.patch38
-rw-r--r--nixpkgs/pkgs/development/libraries/libimagequant/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libime/default.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/libimobiledevice/default.nix64
-rw-r--r--nixpkgs/pkgs/development/libraries/libindicator/default.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/libinfinity/default.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/libinjection/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/libinklevel/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/libinotify-kqueue/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libinput/default.nix91
-rw-r--r--nixpkgs/pkgs/development/libraries/libinput/udev-absolute-path.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/libinsane/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/libint/default.nix102
-rw-r--r--nixpkgs/pkgs/development/libraries/libint/fix-paths.patch96
-rw-r--r--nixpkgs/pkgs/development/libraries/libiodbc/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libipfix/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/libipt/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libiptcdata/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libircclient/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libirecovery/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/libiscsi/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libisds/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libisoburn/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libisofs/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libite/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/libivykis/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libixp-hg/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libjcat/default.nix82
-rw-r--r--nixpkgs/pkgs/development/libraries/libjcat/installed-tests-path.patch24
-rw-r--r--nixpkgs/pkgs/development/libraries/libjpeg-turbo/0001-Compile-transupp.c-as-part-of-the-library.patch104
-rw-r--r--nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix71
-rw-r--r--nixpkgs/pkgs/development/libraries/libjpeg-turbo/mingw-boolean.patch19
-rw-r--r--nixpkgs/pkgs/development/libraries/libjpeg/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libjreen/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libjson-rpc-cpp/default.nix101
-rw-r--r--nixpkgs/pkgs/development/libraries/libjson/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libjson/install-fix.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/libjwt/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libjxl/default.nix106
-rw-r--r--nixpkgs/pkgs/development/libraries/libkate/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libkeyfinder/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libkml/default.nix56
-rw-r--r--nixpkgs/pkgs/development/libraries/libksba/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libksi/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libktorrent/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/liblangtag/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/liblastfm/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/liblastfmSF/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/liblaxjson/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/liblcf/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libliftoff/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/liblinear/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/liblinphone/default.nix132
-rw-r--r--nixpkgs/pkgs/development/libraries/liblo/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/liblockfile/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/liblogging/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/liblognorm/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/liblouis/default.nix68
-rw-r--r--nixpkgs/pkgs/development/libraries/liblqr-1/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/liblscp/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libltc/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/liblxi/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libmad/default.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/libmanette/default.nix65
-rw-r--r--nixpkgs/pkgs/development/libraries/libmatchbox/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libmatheval/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/libmatroska/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libmaxminddb/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/libmbim/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/libmcrypt/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libmd/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libmediaart/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/libmediainfo/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libmemcached/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/libmemcached/libmemcached-fix-linking-with-libpthread.patch19
-rw-r--r--nixpkgs/pkgs/development/libraries/libmemcached/musl-fixes.patch58
-rw-r--r--nixpkgs/pkgs/development/libraries/libmesode/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/libmhash/autotools-define-conflict-debian-fix.patch78
-rw-r--r--nixpkgs/pkgs/development/libraries/libmhash/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libmicrodns/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libmicrohttpd/0.9.70.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libmicrohttpd/0.9.71.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libmicrohttpd/0.9.72.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libmicrohttpd/generic.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libmikmod/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/libmilter/darwin.patch28
-rw-r--r--nixpkgs/pkgs/development/libraries/libmilter/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/libmilter/glibc-2.30.patch44
-rw-r--r--nixpkgs/pkgs/development/libraries/libmilter/install.patch42
-rw-r--r--nixpkgs/pkgs/development/libraries/libmilter/sharedlib.patch56
-rw-r--r--nixpkgs/pkgs/development/libraries/libminc/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/libmkv/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libmms/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libmng/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libmnl/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libmodbus/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libmodplug/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libmodule/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libmodulemd/default.nix76
-rw-r--r--nixpkgs/pkgs/development/libraries/libmodulemd/glib-devdoc.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/libmongo-client/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libmowgli/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libmp3splt/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libmpack/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libmpc/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/libmpcdec/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/libmpeg2/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libmrss/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libmspack/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libmtp/default.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/libmusicbrainz/5.x.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libmusicbrainz/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libmwaw/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libmwaw/default.upstream4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmx/default.nix62
-rw-r--r--nixpkgs/pkgs/development/libraries/libmypaint/default.nix55
-rw-r--r--nixpkgs/pkgs/development/libraries/libmysqlconnectorcpp/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/libnabo/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libnatpmp/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libnats-c/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libnatspec/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libnbd/default.nix62
-rw-r--r--nixpkgs/pkgs/development/libraries/libndctl/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/libndp/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/libndtypes/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libnest2d/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libnet/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/libnet/fix-includes.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/libnetfilter_acct/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libnetfilter_conntrack/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libnetfilter_cthelper/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libnetfilter_cttimeout/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libnetfilter_log/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libnetfilter_queue/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libnfc/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libnfnetlink/Use-stdlib-uint-instead-of-u_int.patch499
-rw-r--r--nixpkgs/pkgs/development/libraries/libnfnetlink/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libnfs/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libnftnl/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libngspice/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libnice/default.nix85
-rw-r--r--nixpkgs/pkgs/development/libraries/libnih/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libnixxml/default.nix61
-rw-r--r--nixpkgs/pkgs/development/libraries/libnotify/default.nix60
-rw-r--r--nixpkgs/pkgs/development/libraries/libnsl/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libnxml/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/liboauth/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libodfgen/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libodfgen/default.upstream4
-rw-r--r--nixpkgs/pkgs/development/libraries/libofa/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/libofx/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libogg/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/liboggz/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/liboil/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/liboil/x86_64-cpuid.patch38
-rw-r--r--nixpkgs/pkgs/development/libraries/libomxil-bellagio/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libomxil-bellagio/fedora-fixes.patch199
-rw-r--r--nixpkgs/pkgs/development/libraries/liboop/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/libopcodes/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/libopenaptx/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/liboping/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/libopus/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libopusenc/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libosinfo/default.nix84
-rw-r--r--nixpkgs/pkgs/development/libraries/libosinfo/osinfo-db-data-dir.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/libosmium/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libosmscout/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libossp-uuid/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/libossp-uuid/shtool.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/libotr/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libow/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/libowfat/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libowlevelzs/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libp11/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libpam-wrapper/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/libpaper/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/libpar2/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libpar2/libpar2-0.4-external-verification.patch16
-rw-r--r--nixpkgs/pkgs/development/libraries/libpcap/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/libpeas/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/libpfm/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/libpg_query/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libpgf/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libphonenumber/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/libpinyin/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/libpipeline/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/libpipeline/fix-on-osx.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/libplacebo/default.nix66
-rw-r--r--nixpkgs/pkgs/development/libraries/libplctag/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libplist/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/libpng/12.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libpng/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/libpointmatcher/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libportal/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/libpostal/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libpqxx/6.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libpqxx/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libproxy/default.nix74
-rw-r--r--nixpkgs/pkgs/development/libraries/libpseudo/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libpsl/default.nix88
-rw-r--r--nixpkgs/pkgs/development/libraries/libpst/default.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/libpwquality/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/libqalculate/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/libqb/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libqglviewer/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libqmi/default.nix68
-rw-r--r--nixpkgs/pkgs/development/libraries/libqrtr-glib/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/libqtav/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/libquotient/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libr3/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/libraspberrypi/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/libraw/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libraw1394/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/librdf/raptor.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/librdf/raptor2.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/librdf/rasqal.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/librdf/redland.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/libre/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/librealsense/default.nix78
-rw-r--r--nixpkgs/pkgs/development/libraries/librealsense/py_pybind11_no_external_download.patch39
-rw-r--r--nixpkgs/pkgs/development/libraries/librealsense/py_sitepackage_dir.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/libredwg/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/librelp/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/librem/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/librep/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/librep/setup-hook.sh5
-rw-r--r--nixpkgs/pkgs/development/libraries/libresample/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libressl/default.nix70
-rw-r--r--nixpkgs/pkgs/development/libraries/librest/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/librevenge/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/librevenge/default.upstream4
-rw-r--r--nixpkgs/pkgs/development/libraries/librevisa/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/librime/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libroxml/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/librsb/default.nix86
-rw-r--r--nixpkgs/pkgs/development/libraries/librseq/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/librsvg/default.nix123
-rw-r--r--nixpkgs/pkgs/development/libraries/librsync/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/librtlsdr/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/librtprocess/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/librttopo/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libs3/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libsamplerate/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/libsass/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libschrift/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/libscrypt/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libsearpc/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libseccomp/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/libsecret/default.nix61
-rw-r--r--nixpkgs/pkgs/development/libraries/libserdes/default.nix61
-rw-r--r--nixpkgs/pkgs/development/libraries/libserialport/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libshout/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libsidplayfp/default.nix81
-rw-r--r--nixpkgs/pkgs/development/libraries/libsieve/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/libsigcxx/1.2.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libsigcxx/3.0.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/libsigcxx/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libsignal-protocol-c/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libsignon-glib/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/libsigsegv/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/libsigsegv/sigbus_fix.patch8
-rw-r--r--nixpkgs/pkgs/development/libraries/libsixel/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libskk/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/libslirp/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/libsmartcols/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libsmi/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libsnark/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libsndfile/default.nix61
-rw-r--r--nixpkgs/pkgs/development/libraries/libsodium/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/libsodium/mingw-no-fortify.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/libsolv/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/libsoundio/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libsoup/default.nix90
-rw-r--r--nixpkgs/pkgs/development/libraries/libspatialindex/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/libspatialite/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/libspectre/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libspectre/libspectre-0.2.7-gs918.patch42
-rw-r--r--nixpkgs/pkgs/development/libraries/libspectrum/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libspf2/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/libspiro/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libspnav/configure-socket-path.patch47
-rw-r--r--nixpkgs/pkgs/development/libraries/libspnav/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/libspotify/default.nix91
-rw-r--r--nixpkgs/pkgs/development/libraries/libsrs2/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libssh/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libssh2/CVE-2019-17498.patch210
-rw-r--r--nixpkgs/pkgs/development/libraries/libssh2/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libstatgrab/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libstemmer/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libstroke/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/libstrophe/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/libsurvive/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/libsvm/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/libsystemtap/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libtap/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libtar/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/libtasn1/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/libtcod/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libtelnet/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libtermkey/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libthai/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libtheora/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/libthreadar/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/libticables2/default.nix64
-rw-r--r--nixpkgs/pkgs/development/libraries/libticalcs2/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/libticonv/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/libtiff/aarch64-darwin.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/libtiff/default.nix55
-rw-r--r--nixpkgs/pkgs/development/libraries/libtiff/headers-cmake.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/libtiff/headers.patch16
-rw-r--r--nixpkgs/pkgs/development/libraries/libtifiles2/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/libtiger/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libtins/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/libtomcrypt/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/libtommath/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.1.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.2.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/libtoxcore/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/libtoxcore/new-api.nix56
-rw-r--r--nixpkgs/pkgs/development/libraries/libtsm/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libu2f-host/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libu2f-server/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libubox/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libuchardet/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libucl/default.nix58
-rw-r--r--nixpkgs/pkgs/development/libraries/libuecc/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libui/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/libui/libui.pc11
-rw-r--r--nixpkgs/pkgs/development/libraries/libuinputplus/0001-Add-cmake-install-directives.patch40
-rw-r--r--nixpkgs/pkgs/development/libraries/libuinputplus/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libuldaq/0001-uldaq.patch28
-rw-r--r--nixpkgs/pkgs/development/libraries/libuldaq/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libunarr/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/libunibreak/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libuninameslist/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libunique/1.1.6-G_CONST_RETURN.patch143
-rw-r--r--nixpkgs/pkgs/development/libraries/libunique/1.1.6-compiler-warnings.patch50
-rw-r--r--nixpkgs/pkgs/development/libraries/libunique/1.1.6-fix-test.patch26
-rw-r--r--nixpkgs/pkgs/development/libraries/libunique/1.1.6-include-terminator.patch37
-rw-r--r--nixpkgs/pkgs/development/libraries/libunique/3.x.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libunique/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/libunique/gcc7-bug.patch18
-rw-r--r--nixpkgs/pkgs/development/libraries/libunistring/default.nix72
-rw-r--r--nixpkgs/pkgs/development/libraries/libunity/default.nix70
-rw-r--r--nixpkgs/pkgs/development/libraries/libunity/fix-vala.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch45
-rw-r--r--nixpkgs/pkgs/development/libraries/libunwind/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/liburcu/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/liburing/default.nix62
-rw-r--r--nixpkgs/pkgs/development/libraries/libusb-compat/0.1.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/libusb-compat/fix-headers.patch10
-rw-r--r--nixpkgs/pkgs/development/libraries/libusb1/default.nix57
-rw-r--r--nixpkgs/pkgs/development/libraries/libusbmuxd/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libutempter/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/libutempter/exec_path.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/libuv/default.nix77
-rw-r--r--nixpkgs/pkgs/development/libraries/libuvc/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libva/1.0.0.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/libva/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/libva/utils.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libvarlink/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/libvdpau-va-gl/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libvdpau/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libvdpau/installdir.patch9
-rw-r--r--nixpkgs/pkgs/development/libraries/libversion/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/libviper/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libvirt-glib/default.nix62
-rw-r--r--nixpkgs/pkgs/development/libraries/libvirt/0001-meson-patch-in-an-install-prefix-for-building-on-nix.patch326
-rw-r--r--nixpkgs/pkgs/development/libraries/libvirt/5.9.0.nix142
-rw-r--r--nixpkgs/pkgs/development/libraries/libvirt/default.nix162
-rw-r--r--nixpkgs/pkgs/development/libraries/libvisio/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libvisio2svg/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libvisual/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libvmaf/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libvmi/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/libvncserver/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/libvorbis/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libvori/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libvpx/1_8.nix185
-rw-r--r--nixpkgs/pkgs/development/libraries/libvpx/default.nix187
-rw-r--r--nixpkgs/pkgs/development/libraries/libvterm-neovim/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libvterm/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libwacom/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libwebp/default.nix74
-rw-r--r--nixpkgs/pkgs/development/libraries/libwebsockets/default.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/libwhereami/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libwmf/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libwnck/2.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libwnck/default.nix76
-rw-r--r--nixpkgs/pkgs/development/libraries/libwnck/fix-pc-file.patch24
-rw-r--r--nixpkgs/pkgs/development/libraries/libwpd/0.8.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libwpd/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libwpd/gcc-0.8.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/libwpe/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/libwpe/fdo.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/libwpg/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/libwps/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libx86/constants.patch20
-rw-r--r--nixpkgs/pkgs/development/libraries/libx86/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/libx86/non-x86.patch38
-rw-r--r--nixpkgs/pkgs/development/libraries/libx86/src-for-default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/libx86/src-info-for-default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libx86emu/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/libxc/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/libxcomp/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libxcrypt/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libxdg-basedir/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libxkbcommon/default.nix66
-rw-r--r--nixpkgs/pkgs/development/libraries/libxkbcommon/libxkbcommon_7.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libxklavier/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/libxklavier/honor-XKB_CONFIG_ROOT.patch89
-rw-r--r--nixpkgs/pkgs/development/libraries/libxl/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libxls/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libxlsxwriter/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/libxmi/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libxml2/default.nix100
-rw-r--r--nixpkgs/pkgs/development/libraries/libxml2/utf8-xmlErrorFuncHandler.patch30
-rw-r--r--nixpkgs/pkgs/development/libraries/libxmlb/default.nix74
-rw-r--r--nixpkgs/pkgs/development/libraries/libxmlb/installed-tests-path.patch24
-rw-r--r--nixpkgs/pkgs/development/libraries/libxmlxx/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libxmlxx/v3.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libxmp/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/libxnd/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/libxslt/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/libxsmm/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/libyaml-cpp/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/libyaml/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libykclient/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libykneomgr/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libytnef/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libyubikey/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libzapojit/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/libzdb/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libzen/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/libzip/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/libzmf/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/libzra/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/lief/default.nix70
-rw-r--r--nixpkgs/pkgs/development/libraries/lightning/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/lightstep-tracer-cpp/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/lime/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/linbox/default.nix80
-rw-r--r--nixpkgs/pkgs/development/libraries/linbox/patches/linbox-pr256-part2.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/linenoise-ng/default.nix23
-rwxr-xr-xnixpkgs/pkgs/development/libraries/linenoise/create-pkg-config-file.sh13
-rw-r--r--nixpkgs/pkgs/development/libraries/linenoise/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/liquid-dsp/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/liquidfun/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/lirc/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/live555/default.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/lmdb/default.nix62
-rw-r--r--nixpkgs/pkgs/development/libraries/lmdb/hardcoded-compiler.patch26
-rw-r--r--nixpkgs/pkgs/development/libraries/lmdbxx/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/log4cplus/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/log4cpp/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/log4cxx/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/log4cxx/narrowing-fixes.patch117
-rw-r--r--nixpkgs/pkgs/development/libraries/log4shib/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/loki/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/loudmouth/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/loudmouth/glib-2.32.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/lrdf/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/luabind/0.9.1_boost_1.57_fix.patch23
-rw-r--r--nixpkgs/pkgs/development/libraries/luabind/0.9.1_discover_luajit.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/luabind/0.9.1_modern_boost_fix.patch59
-rw-r--r--nixpkgs/pkgs/development/libraries/luabind/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/lucene++/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/luksmeta/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/lyra/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/lzo/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/mac/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/maeparser/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/mailcore2/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/malcontent/better-separation.patch58
-rw-r--r--nixpkgs/pkgs/development/libraries/malcontent/default.nix104
-rw-r--r--nixpkgs/pkgs/development/libraries/malcontent/installed-tests-path.patch56
-rw-r--r--nixpkgs/pkgs/development/libraries/malcontent/ui.nix74
-rw-r--r--nixpkgs/pkgs/development/libraries/mapbox-gl-native/default.nix57
-rw-r--r--nixpkgs/pkgs/development/libraries/mapbox-gl-qml/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/mapnik/default.nix100
-rw-r--r--nixpkgs/pkgs/development/libraries/marisa/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/marl/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/martyr/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/matio/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/mauikit-filebrowsing/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/mauikit/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/maxflow/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/mbedtls/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/md4c/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/mdds/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/mdds/default.upstream10
-rw-r--r--nixpkgs/pkgs/development/libraries/medfile/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/medfile/hdf5-1.12.patch86
-rw-r--r--nixpkgs/pkgs/development/libraries/mediastreamer/default.nix111
-rw-r--r--nixpkgs/pkgs/development/libraries/mediastreamer/msopenh264.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/mediastreamer/plugins_dir.patch18
-rw-r--r--nixpkgs/pkgs/development/libraries/menu-cache/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/mesa-glu/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/mesa/aarch64-darwin.patch33
-rw-r--r--nixpkgs/pkgs/development/libraries/mesa/default.nix253
-rw-r--r--nixpkgs/pkgs/development/libraries/mesa/disk_cache-include-dri-driver-path-in-cache-key.patch74
-rw-r--r--nixpkgs/pkgs/development/libraries/mesa/missing-includes.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/mesa/opencl-install-dir.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/mesa/stubs.nix75
-rw-r--r--nixpkgs/pkgs/development/libraries/metal/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/microsoft_gsl/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/mimalloc/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/mimetic/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/mimetic/narrowing.patch32
-rw-r--r--nixpkgs/pkgs/development/libraries/miniball/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/minixml/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/minizip/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/minizip2/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/mlt/default.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/mlt/qt-5.nix112
-rw-r--r--nixpkgs/pkgs/development/libraries/mm-common/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/mongoc/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/mono-addins/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/motif/Add-X.Org-to-bindings-file.patch7
-rw-r--r--nixpkgs/pkgs/development/libraries/motif/Remove-unsupported-weak-refs-on-darwin.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/motif/default.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/movit/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/mp4v2/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/mp4v2/fix-build-clang.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/mpfi/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/mpfr/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/mpich/default.nix57
-rw-r--r--nixpkgs/pkgs/development/libraries/mpir/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/mps/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/msgpack/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/msgpack/generic.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/msgpuck/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/msilbc/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/mtdev/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/mtxclient/default.nix56
-rw-r--r--nixpkgs/pkgs/development/libraries/multipart-parser-c/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/mumlib/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/muparser/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/muparserx/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/mustache-hpp/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/mutest/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/mvapich/default.nix73
-rw-r--r--nixpkgs/pkgs/development/libraries/mygui/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/mypaint-brushes/1.0.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/mypaint-brushes/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/mysocketw/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/mysocketw/gcc.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/mythes/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/nanoflann/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/nanomsg/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/nanopb/default.nix74
-rw-r--r--nixpkgs/pkgs/development/libraries/nanopb/test-message-with-annotations/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/nanopb/test-message-with-annotations/withannotations.proto7
-rw-r--r--nixpkgs/pkgs/development/libraries/nanopb/test-message-with-options/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/nanopb/test-message-with-options/withoptions.options1
-rw-r--r--nixpkgs/pkgs/development/libraries/nanopb/test-message-with-options/withoptions.proto5
-rw-r--r--nixpkgs/pkgs/development/libraries/nanopb/test-simple-proto2/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/nanopb/test-simple-proto2/simple.proto5
-rw-r--r--nixpkgs/pkgs/development/libraries/nanopb/test-simple-proto3/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/nanopb/test-simple-proto3/simple.proto5
-rw-r--r--nixpkgs/pkgs/development/libraries/nco/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/ncurses/clang.patch42
-rw-r--r--nixpkgs/pkgs/development/libraries/ncurses/default.nix179
-rw-r--r--nixpkgs/pkgs/development/libraries/ndi/default.nix61
-rw-r--r--nixpkgs/pkgs/development/libraries/ndn-cxx/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/ndpi/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/neardal/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/neatvnc/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/nemo-qml-plugin-dbus/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/neon/0.29.6-darwin-fix-configure.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/neon/0.29.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/neon/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/netcdf-cxx4/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/netcdf-fortran/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/netcdf/default.nix75
-rw-r--r--nixpkgs/pkgs/development/libraries/nettle/cygwin.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/nettle/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/nettle/generic.nix68
-rw-r--r--nixpkgs/pkgs/development/libraries/networking-ts-cxx/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/networking-ts-cxx/networking_ts.pc.in8
-rw-r--r--nixpkgs/pkgs/development/libraries/newt/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/nghttp2/default.nix82
-rw-r--r--nixpkgs/pkgs/development/libraries/ngt/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/nix-plugins/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/nlopt/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/notcurses/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/notify-sharp/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/npapi-sdk/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/npth/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/nspr/0001-Makefile-use-SOURCE_DATE_EPOCH-for-reproducibility.patch84
-rw-r--r--nixpkgs/pkgs/development/libraries/nspr/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/nss/3.53.nix182
-rw-r--r--nixpkgs/pkgs/development/libraries/nss/85_security_load.patch76
-rw-r--r--nixpkgs/pkgs/development/libraries/nss/ckpem.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/nss/default.nix197
-rw-r--r--nixpkgs/pkgs/development/libraries/nss/fix-cross-compilation.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/nss_wrapper/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/nsss/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/ntbtls/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/ntdb/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/ntirpc/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/ntl/default.nix76
-rw-r--r--nixpkgs/pkgs/development/libraries/ntrack/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/ntrack/libnl-fix.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/nuraft/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/nuspell/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/nuspell/wrapper.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/nv-codec-headers/10_x.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/nv-codec-headers/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/nvidia-optical-flow-sdk/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/nvidia-texture-tools/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/nvidia-video-sdk/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/oatpp/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/ocl-icd/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/octomap/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/ode/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/odpic/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/ogdf/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/ogre/1.9.x.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/ogre/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/ogrepaged/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/ois/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/olm/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/oneDNN/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/oniguruma/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/opae/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/openal-soft/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/openal-soft/search-out.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/openbabel/2.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/openbabel/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/openbr/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/openbsm/bsm-add-audit_token_to_pid.patch24
-rw-r--r--nixpkgs/pkgs/development/libraries/openbsm/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/opencascade-occt/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/opencascade/default.nix66
-rw-r--r--nixpkgs/pkgs/development/libraries/opencl-clang/default.nix107
-rw-r--r--nixpkgs/pkgs/development/libraries/opencl-clang/opencl-headers-dir.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/opencl-clhpp/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/opencl-headers/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/opencollada/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/opencollada/pcre.patch14
-rw-r--r--nixpkgs/pkgs/development/libraries/opencolorio/1.x.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/opencolorio/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/opencore-amr/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/opencsg/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/opencsg/fix-pro-files.patch21
-rw-r--r--nixpkgs/pkgs/development/libraries/openct/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/opencv/3.x.nix281
-rw-r--r--nixpkgs/pkgs/development/libraries/opencv/4.x.nix342
-rw-r--r--nixpkgs/pkgs/development/libraries/opencv/cmake-don-t-use-OpenCVFindOpenEXR.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/opencv/cuda_opt_flow.patch27
-rw-r--r--nixpkgs/pkgs/development/libraries/opencv/default.nix89
-rw-r--r--nixpkgs/pkgs/development/libraries/opencv/no-build-info.patch14
-rw-r--r--nixpkgs/pkgs/development/libraries/opendbx/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/opendht/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/opendkim/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/opendmarc/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/openexr/3.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/openexr/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/openexrid-unstable/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/openexrid-unstable/openexrid.patch35
-rw-r--r--nixpkgs/pkgs/development/libraries/openfst/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/openfx/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/opengrm-ngram/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/openh264/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/openhmd/default.nix61
-rw-r--r--nixpkgs/pkgs/development/libraries/openimagedenoise/1_2_x.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/openimagedenoise/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/openjpeg/default.nix90
-rw-r--r--nixpkgs/pkgs/development/libraries/openjpeg/fix-cmake-config-includedir.patch44
-rw-r--r--nixpkgs/pkgs/development/libraries/openldap/default.nix98
-rw-r--r--nixpkgs/pkgs/development/libraries/openmpi/default.nix122
-rw-r--r--nixpkgs/pkgs/development/libraries/openpa/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/openpam/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/opensaml-cpp/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/openscenegraph/default.nix76
-rw-r--r--nixpkgs/pkgs/development/libraries/openslide/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/openslp/CVE-2016-4912.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/openslp/CVE-2019-5544.patch165
-rw-r--r--nixpkgs/pkgs/development/libraries/openslp/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/openssl/1.0.2/darwin64-arm64.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/openssl/1.0.2/nix-ssl-cert-file.patch16
-rw-r--r--nixpkgs/pkgs/development/libraries/openssl/1.0.2/use-etc-ssl-certs-darwin.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/openssl/1.0.2/use-etc-ssl-certs.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/openssl/1.1/macos-yosemite-compat.patch56
-rw-r--r--nixpkgs/pkgs/development/libraries/openssl/1.1/nix-ssl-cert-file.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/openssl/1.1/use-etc-ssl-certs-darwin.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/openssl/1.1/use-etc-ssl-certs.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/openssl/chacha.nix82
-rw-r--r--nixpkgs/pkgs/development/libraries/openssl/default.nix208
-rw-r--r--nixpkgs/pkgs/development/libraries/opensubdiv/default.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/opentracing-cpp/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/openvdb/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/openvino/default.nix121
-rw-r--r--nixpkgs/pkgs/development/libraries/openwsman/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/openxr-loader/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/openzwave/default.nix58
-rw-r--r--nixpkgs/pkgs/development/libraries/optparse-bash/default.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/oracle-instantclient/default.nix133
-rw-r--r--nixpkgs/pkgs/development/libraries/orcania/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/orocos-kdl/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/ortp/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/osip/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/osip/default.upstream3
-rw-r--r--nixpkgs/pkgs/development/libraries/osm-gps-map/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/p11-kit/default.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/packr/default.nix60
-rw-r--r--nixpkgs/pkgs/development/libraries/pagmo2/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/pango/default.nix111
-rw-r--r--nixpkgs/pkgs/development/libraries/pangolin/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/pangomm/2.48.nix65
-rw-r--r--nixpkgs/pkgs/development/libraries/pangomm/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/pangoxsl/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/parquet-cpp/api.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/partio/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/pc-ble-driver/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/pcaudiolib/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/pcg-c/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/pcg-c/prefix-variable.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/pcl/default.nix61
-rw-r--r--nixpkgs/pkgs/development/libraries/pcmsolver/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/pcre/default.nix66
-rw-r--r--nixpkgs/pkgs/development/libraries/pcre/stacksize-detection.patch16
-rw-r--r--nixpkgs/pkgs/development/libraries/pcre2/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/pdal/default.nix81
-rw-r--r--nixpkgs/pkgs/development/libraries/pdf2xml/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/pdf2xml/pdf2xml.patch48
-rw-r--r--nixpkgs/pkgs/development/libraries/pe-parse/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/phash/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/phonetisaurus/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/phonon/backends/gst-plugin-paths.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/phonon/backends/vlc.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/phonon/default.nix90
-rw-r--r--nixpkgs/pkgs/development/libraries/physfs/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/apfel/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/apfelgrid/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/applgrid/bad_code.patch50
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/applgrid/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/cernlib/0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch94
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/cernlib/default.nix69
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/cernlib/patch.patch186
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/cernlib/setup-hook.sh3
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/fastjet-contrib/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/fastjet/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/fastnlo_toolkit/default.nix93
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/geant4/datasets-hook.sh5
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix119
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/geant4/default.nix143
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/geant4/geant4-hook.sh1
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/geant4/tests.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/hepmc2/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/hepmc3/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/herwig/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/hoppet/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/lhapdf/default.nix32
-rwxr-xr-xnixpkgs/pkgs/development/libraries/physics/lhapdf/maintainer.sh13
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/lhapdf/pdf_sets.nix1067
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/lhapdf/pdfset-hook.sh5
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/mela/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/nlojet/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/nlojet/nlojet_clang_fix.patch30
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/pythia/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/rivet/default.nix81
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/thepeg/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/yoda/default.nix68
-rw-r--r--nixpkgs/pkgs/development/libraries/pico-sdk/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/pipewire/0.2.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/pipewire/0040-alsa-profiles-use-libdir.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/pipewire/0050-pipewire-pulse-path.patch27
-rw-r--r--nixpkgs/pkgs/development/libraries/pipewire/0055-pipewire-media-session-path.patch24
-rw-r--r--nixpkgs/pkgs/development/libraries/pipewire/0070-installed-tests-path.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/pipewire/0080-pipewire-config-dir.patch30
-rw-r--r--nixpkgs/pkgs/development/libraries/pipewire/0090-pipewire-config-template-paths.patch28
-rw-r--r--nixpkgs/pkgs/development/libraries/pipewire/default.nix226
-rw-r--r--nixpkgs/pkgs/development/libraries/pipewire/test-paths.nix24
-rwxr-xr-xnixpkgs/pkgs/development/libraries/pipewire/update.sh24
-rw-r--r--nixpkgs/pkgs/development/libraries/pixman/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/pkcs11helper/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/pkger/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/plasma-wayland-protocols/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/plib/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/plplot/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/pmdk/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/pmix/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/png++/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/pocketsphinx/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/poco/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/podofo/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/polkit-qt-1/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/polkit/default.nix118
-rw-r--r--nixpkgs/pkgs/development/libraries/polkit/system_bus.conf58
-rw-r--r--nixpkgs/pkgs/development/libraries/poly2tri-c/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/poppler/0.61-CVE-2019-9959.patch20
-rw-r--r--nixpkgs/pkgs/development/libraries/poppler/0.61.nix94
-rw-r--r--nixpkgs/pkgs/development/libraries/poppler/default.nix113
-rw-r--r--nixpkgs/pkgs/development/libraries/popt/1.16-cygwin.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/popt/1.16-vpath.patch34
-rw-r--r--nixpkgs/pkgs/development/libraries/popt/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/portaudio/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/portmidi/default.nix84
-rw-r--r--nixpkgs/pkgs/development/libraries/portmidi/remove-darwin-variables.diff52
-rw-r--r--nixpkgs/pkgs/development/libraries/ppl/default.nix61
-rw-r--r--nixpkgs/pkgs/development/libraries/precice/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/presage/default.nix69
-rw-r--r--nixpkgs/pkgs/development/libraries/presage/fixed-cppunit-detection.patch46
-rw-r--r--nixpkgs/pkgs/development/libraries/prime-server/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/prison/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/proj-datumgrid/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/proj/default.nix62
-rw-r--r--nixpkgs/pkgs/development/libraries/prometheus-client-c/default.nix71
-rw-r--r--nixpkgs/pkgs/development/libraries/prometheus-cpp/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/prometheus-cpp/prometheus-cpp.pc.in10
-rw-r--r--nixpkgs/pkgs/development/libraries/properties-cpp/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/2.5.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/3.1.nix6
-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.12.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/3.13.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/3.14.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/3.15.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/3.16.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/3.17.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/3.6.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/3.7.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/3.8.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/3.9.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/generic-v3.nix60
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/generic.nix61
-rw-r--r--nixpkgs/pkgs/development/libraries/protobufc/1.3.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/protobufc/generic.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/protolock/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/prototypejs/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/protozero/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/pslib/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/psol/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/psol/generic.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/psqlodbc/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/pstreams/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/ptex/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/pth/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/pugixml/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/pulseaudio-qt/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/pupnp/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/pxlib/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/py3c/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/pyotherside/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/pyotherside/qml-path.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/pystring/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/python-qt/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/qca-qt5/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/qca2/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/qca2/libressl.patch28
-rw-r--r--nixpkgs/pkgs/development/libraries/qgnomeplatform/default.nix65
-rw-r--r--nixpkgs/pkgs/development/libraries/qgnomeplatform/hardcode-gsettings.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/qhull/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/qimageblitz/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/qimageblitz/qimageblitz-9999-exec-stack.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/qjson/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/qmlbox2d/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/qmltermwidget/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/qoauth/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/qpdf/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/qrcodegen/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/qrencode/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/qrupdate/default.nix56
-rw-r--r--nixpkgs/pkgs/development/libraries/qscintilla/default.nix70
-rw-r--r--nixpkgs/pkgs/development/libraries/qscintilla/fix-qt4-build.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/clang-5-darwin.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/default.nix239
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/dlopen-absolute-paths.diff74
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/dlopen-gtkstyle.diff37
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/glib-2.32.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/kill-legacy-darwin-apis.patch330
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/libressl.patch64
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/parallel-configure.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/patch-qthread-stacksize.diff54
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qmake-hook.sh16
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qsettings-recursive-global-mutex.patch17
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt-4.8.7-unixmake-darwin.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt-musl-iconv-no-bom.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt-musl.patch14
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt4-gcc6.patch33
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt4-openssl-1.1.patch398
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/default.nix222
-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.patch.d/0001-qtbase-mkspecs-mac.patch387
-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.patch491
-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/qtbase.patch.d/0014-qtbase-pkg-config.patch14
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0015-qtbase-tbd-frameworks.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtdeclarative.patch33
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtlocation-gcc-9.patch21
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtscript.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtserialport.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qttools.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebengine-darwin-fix-failed-static-assertion.patch31
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebengine-darwin-no-platform-check.patch69
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebengine-no-build-skip.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-qos-classes.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-readline.patch45
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebkit-icu68.patch170
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebkit.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/srcs.nix326
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/default.nix232
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/fetch.sh2
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch409
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0003-qtbase-mkspecs.patch490
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0004-qtbase-replace-libdir.patch68
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0005-qtbase-cmake.patch194
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0006-qtbase-gtk3.patch48
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0007-qtbase-xcursor.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0008-qtbase-tzdir.patch64
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0009-qtbase-qtpluginpath.patch19
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0010-qtbase-assert.patch32
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0011-fix-header_module.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0012-qtbase-tbd-frameworks.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0013-define-kiosurfacesuccess.patch16
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/qtbase-sdk-10.12-mac.patch77
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtdeclarative.patch33
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtlocation-gcc-9.patch21
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtscript.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtserialport.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qttools.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwayland-libdrm-build.patch56
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebengine-darwin-no-platform-check.patch33
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebkit-darwin-no-qos-classes.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebkit-darwin-no-readline.patch30
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebkit-icu68.patch170
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebkit.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/srcs.nix342
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix261
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/fetch.sh2
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch409
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0003-qtbase-mkspecs.patch490
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0004-qtbase-replace-libdir.patch68
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0005-qtbase-cmake.patch194
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0006-qtbase-gtk3.patch48
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0007-qtbase-xcursor.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0008-qtbase-tzdir.patch64
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0009-qtbase-qtpluginpath.patch33
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0010-qtbase-assert.patch32
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0011-fix-header_module.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0012-qtbase-tbd-frameworks.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0013-define-kiosurfacesuccess.patch16
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0001-Revert-QCocoaDrag-set-image-only-on-the-first-drag-i.patch47
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0002-Revert-QCocoaDrag-drag-make-sure-clipboard-is-ours-a.patch40
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0003-Revert-QCocoaDrag-maybeDragMultipleItems-fix-erroneo.patch27
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0004-Revert-QCocoaDrag-avoid-using-the-deprecated-API-if-.patch192
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0005-Revert-macOS-Fix-use-of-deprecated-NSOffState.patch26
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0006-git-checkout-v5.15.0-src-plugins-platforms-cocoa-qco.patch77
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/qtbase-sdk-10.12-mac.patch77
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtdeclarative.patch114
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtscript.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtserialport.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qttools.patch15
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebengine-darwin-no-platform-check.patch37
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebengine-mac-dont-set-dsymutil-path.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebkit-darwin-no-qos-classes.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebkit-darwin-no-readline.patch45
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebkit-icu68.patch170
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebkit.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/srcs.nix342
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/README.md81
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qmake-libtool.sh25
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qt-builtin-paths.sh64
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qt-module-paths.sh36
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/hooks/move-qt-dev-tools.sh34
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh46
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh112
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/hooks/qttools-setup-hook.sh1
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh107
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/mkDerivation.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qt3d.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix357
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtcharts.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtconnectivity.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtdeclarative.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtdoc.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtgamepad.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtgraphicaleffects.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtimageformats.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtlocation.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtmacextras.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtnetworkauth.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtquickcontrols.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtquickcontrols2.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtscript.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtscxml.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtsensors.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtserialbus.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtserialport.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtspeech.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtsvg.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qttools.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qttranslations.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtvirtualkeyboard.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtwayland.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebchannel.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix243
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebglplugin.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebkit.nix73
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebsockets.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebview.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtx11extras.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtxmlpatterns.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/qt-env.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/qtModule.nix60
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-mobility/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/qtfeedback/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/qtinstaller/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/qtkeychain/0002-Fix-install-name-Darwin.patch10
-rw-r--r--nixpkgs/pkgs/development/libraries/qtkeychain/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/qtpbfimageplugin/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/qtscriptgenerator/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/qtscriptgenerator/qt-4.8.patch23
-rw-r--r--nixpkgs/pkgs/development/libraries/qtscriptgenerator/qtscriptgenerator.gcc-4.4.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/qtstyleplugins/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/qtutilities/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/qtwebkit-plugins/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/quazip/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/quesoglc/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/quickder/default.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/quickfix/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/quickfix/disableUnitTests.patch65
-rw-r--r--nixpkgs/pkgs/development/libraries/qwt/6.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/qwt/6_qt4.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/qwt/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/qxmpp/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/qxt/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/rabbitmq-c/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/rabbitmq-java-client/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/raft-canonical/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/randomx/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/rang/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/range-v3/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/range-v3/gcc10.patch133
-rw-r--r--nixpkgs/pkgs/development/libraries/rapidcheck/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/rapidjson/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/rapidxml/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/rarian/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/raylib/default.nix55
-rw-r--r--nixpkgs/pkgs/development/libraries/rdkafka/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/re2/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/5.x.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/6.2.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/6.3.nix62
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/7.0.nix62
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/8.1.nix62
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/android.patch16
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/clang.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/link-against-ncurses.patch18
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/no-arch_only-6.3.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/no-arch_only.patch14
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/readline-6.2-patches.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/readline-6.3-patches.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/readline-7.0-patches.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/readline-8.1-patches.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/shobj-darwin.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/readosm/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/relibc/default.nix78
-rw-r--r--nixpkgs/pkgs/development/libraries/rep-gtk/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/rep-gtk/setup-hook.sh5
-rw-r--r--nixpkgs/pkgs/development/libraries/reproc/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/resolv_wrapper/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/retro-gtk/default.nix70
-rw-r--r--nixpkgs/pkgs/development/libraries/retro-gtk/gio-unix.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/rinutils/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/rlog/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/rlottie/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/rnnoise-plugin/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/rnnoise/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/robin-map/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/rocclr/default.nix64
-rw-r--r--nixpkgs/pkgs/development/libraries/rocksdb/default.nix68
-rw-r--r--nixpkgs/pkgs/development/libraries/rocm-comgr/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/rocm-device-libs/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/rocm-opencl-icd/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/rocm-opencl-runtime/default.nix83
-rw-r--r--nixpkgs/pkgs/development/libraries/rocm-runtime/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/rocm-thunk/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/rote/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/rttr/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/rubberband/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/rustc-demangle/add-Cargo.lock.patch73
-rw-r--r--nixpkgs/pkgs/development/libraries/rustc-demangle/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/s2geometry/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/s2n-tls/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/safefile/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/sbc/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/sblim-sfcc/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/schroedinger/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/science/astronomy/cfitsio/darwin-rpath-universal.patch21
-rw-r--r--nixpkgs/pkgs/development/libraries/science/astronomy/cfitsio/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/science/astronomy/indilib/default.nix56
-rw-r--r--nixpkgs/pkgs/development/libraries/science/astronomy/indilib/indi-3rdparty.nix78
-rw-r--r--nixpkgs/pkgs/development/libraries/science/astronomy/indilib/indi-firmware.nix66
-rw-r--r--nixpkgs/pkgs/development/libraries/science/astronomy/indilib/indi-full.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/science/astronomy/indilib/indi-with-drivers.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/science/astronomy/libnova/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/science/astronomy/stellarsolver/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/science/astronomy/wcslib/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/science/benchmark/papi/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/EBTKS/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/bicgl/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/bicpl/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/bpp-core/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/bpp-phyl/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/bpp-popgen/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/bpp-seq/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/elastix/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/gifticlib/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/mirtk/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/nifticlib/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/oobicpl/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/science/chemistry/avogadrolibs/default.nix68
-rw-r--r--nixpkgs/pkgs/development/libraries/science/chemistry/libmsym/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/science/chemistry/mmtf-cpp/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/science/chemistry/molequeue/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/science/chemistry/xcfun/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/science/electronics/qcsxcad/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/QuadProgpp/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/amd-blis/default.nix70
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/amd-libflame/add-lapacke.diff34
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/amd-libflame/default.nix72
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/arpack/default.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/blas/default.nix71
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/blis/default.nix64
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/brial/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/caffe2/default.nix143
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/caffe2/fix_compilation_on_gcc7.patch46
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/caffe2/update_clang_cvtsh_bugfix.patch55
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/cholmod-extra/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/clblas/default.nix69
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/clblas/platform.patch34
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/cliquer/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/clmagma/default.nix75
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/cudnn/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix83
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/cutensor/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/cutensor/generic.nix69
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/ecos/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix261
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/flintqs/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/ipopt/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/itpp/default.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/lcalc/default.nix97
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/lcalc/makefile.patch113
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/libbraiding/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/libhomfly/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix61
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/liblbfgs/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/libtorch/bin.nix123
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/libtorch/binary-hashes.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/libtorch/test/CMakeLists.txt5
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/libtorch/test/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/libtorch/test/test.cpp20
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/lrs/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/m4ri/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/m4rie/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/magma/default.nix89
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/metis/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/mkl/default.nix201
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/mkl/test/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/mkl/test/test.c12
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/mongoose/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/nccl/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix243
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/openspecfun/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/or-tools/default.nix117
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/osi/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/osqp/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/p4est-sc/default.nix71
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/p4est/default.nix58
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/p4est/p4est-metis.patch26
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/parmetis/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/petsc/default.nix77
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/planarity/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/rankwidth/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/rubiks/default.nix81
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix56
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/scs/default.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/spooles/default.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/spooles/spooles.patch188
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/suitesparse-graphblas/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.2.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.4.nix100
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/suitesparse/default.nix74
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/superlu/add-superlu-lib-as-dependency-for-the-unit-tests.patch7
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/superlu/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/sympow/clean-extra-logfile-output-from-pari.patch39
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/sympow/default.nix76
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/tensorflow-lite/default.nix181
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/tensorflow-lite/eigen_include_dir.patch45
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/tensorflow/bin.nix71
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/tensorflow/binary-hashes.nix15
-rwxr-xr-xnixpkgs/pkgs/development/libraries/science/math/tensorflow/prefetcher.sh26
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/zn_poly/default.nix74
-rw-r--r--nixpkgs/pkgs/development/libraries/science/networking/ns-3/default.nix110
-rw-r--r--nixpkgs/pkgs/development/libraries/science/robotics/edgetpu-compiler/default.nix58
-rw-r--r--nixpkgs/pkgs/development/libraries/science/robotics/ispike/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/scmccid/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/scriptaculous/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/seasocks/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/sentencepiece/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/sentry-native/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/serd/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/serf/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/serf/scons.patch43
-rw-r--r--nixpkgs/pkgs/development/libraries/serialdv/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/sfml/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/sfsexp/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/shapelib/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/sharness/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/shhmsg/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/shhopt/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/shibboleth-sp/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/signond/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/silgraphite/graphite2.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/silgraphite/macosx.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/simdjson/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/simgear/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/simpleitk/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/skalibs/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/slang/default.nix82
-rw-r--r--nixpkgs/pkgs/development/libraries/slang/terminfo-dirs.patch172
-rw-r--r--nixpkgs/pkgs/development/libraries/slib/catalog-in-library-vicinity.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/slib/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/slib/setup-hook.sh13
-rw-r--r--nixpkgs/pkgs/development/libraries/smarty3-i18n/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/smarty3/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/smesh/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/smooth/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/smpeg/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/smpeg/format.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/smpeg/gcc6.patch33
-rw-r--r--nixpkgs/pkgs/development/libraries/smpeg/libx11.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/smpeg2/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/smpeg2/hufftable-uint_max.patch33
-rw-r--r--nixpkgs/pkgs/development/libraries/snack/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/snap7/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/snappy/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/snappy/disable-benchmark.patch5
-rw-r--r--nixpkgs/pkgs/development/libraries/soci/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/socket_wrapper/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/sofia-sip/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/soil/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/sonic/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/sope/default.nix50
-rw-r--r--nixpkgs/pkgs/development/libraries/soprano/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/soprano/find-virtuoso.patch86
-rw-r--r--nixpkgs/pkgs/development/libraries/soqt/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/sord/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/soundtouch/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/soxt/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/spandsp/3.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/spandsp/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/sparsehash/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/spatialite-tools/default.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/spdk/default.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/spdk/spdk-dpdk-meson.patch17
-rw-r--r--nixpkgs/pkgs/development/libraries/spdlog/default.nix60
-rw-r--r--nixpkgs/pkgs/development/libraries/speech-tools/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/speechd/default.nix128
-rw-r--r--nixpkgs/pkgs/development/libraries/speechd/fix-paths.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/speex/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/speexdsp/build-fix.patch24
-rw-r--r--nixpkgs/pkgs/development/libraries/speexdsp/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/spglib/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/sphinxbase/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/spice-gtk/default.nix135
-rw-r--r--nixpkgs/pkgs/development/libraries/spice-protocol/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/spice/default.nix98
-rw-r--r--nixpkgs/pkgs/development/libraries/spirv-headers/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/sqlcipher/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/sqlite/archive-version.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/sqlite/default.nix95
-rw-r--r--nixpkgs/pkgs/development/libraries/sqlite/sqlar.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/sqlite/tools.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/sqlitecpp/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/srt/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/srtp/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/startup-notification/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/stb/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/stfl/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/stlport/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/stxxl/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/subunit/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/sundials/default.nix73
-rw-r--r--nixpkgs/pkgs/development/libraries/svrcore/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/swiften/build-fix.patch32
-rw-r--r--nixpkgs/pkgs/development/libraries/swiften/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/swiften/scons.patch9
-rw-r--r--nixpkgs/pkgs/development/libraries/swiftshader/default.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/sword/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/sycl-info/default.nix57
-rw-r--r--nixpkgs/pkgs/development/libraries/symengine/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/szip/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/t1lib/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/tachyon/default.nix81
-rw-r--r--nixpkgs/pkgs/development/libraries/tachyon/make-archs.patch37
-rw-r--r--nixpkgs/pkgs/development/libraries/tachyon/no-absolute-paths.patch60
-rw-r--r--nixpkgs/pkgs/development/libraries/taglib-extras/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/taglib-sharp/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/taglib/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/tagparser/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/talloc/default.nix65
-rw-r--r--nixpkgs/pkgs/development/libraries/tbb/default.nix86
-rw-r--r--nixpkgs/pkgs/development/libraries/tclap/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/tcllib/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/tcltls/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/tclx/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/tdb/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/tdlib/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/tecla/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/telepathy/farstream/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/telepathy/glib/default.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/telepathy/qt/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/template-glib/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/tepl/default.nix61
-rw-r--r--nixpkgs/pkgs/development/libraries/termbox/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/tevent/default.nix52
-rw-r--r--nixpkgs/pkgs/development/libraries/tezos-rust-libs/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/theft/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/thrift/0.10.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/thrift/default.nix75
-rw-r--r--nixpkgs/pkgs/development/libraries/ti-rpc/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/ticpp/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/tidyp/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/tiledb/default.nix85
-rw-r--r--nixpkgs/pkgs/development/libraries/timezonemap/default.nix65
-rw-r--r--nixpkgs/pkgs/development/libraries/tinycbor/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/tinycdb/default.nix55
-rw-r--r--nixpkgs/pkgs/development/libraries/tinyobjloader/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/tinyxml-2/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/tinyxml/2.6.2-add-pkgconfig.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/tinyxml/2.6.2-cxx.patch17
-rw-r--r--nixpkgs/pkgs/development/libraries/tinyxml/2.6.2-entity.patch64
-rw-r--r--nixpkgs/pkgs/development/libraries/tinyxml/2.6.2.nix80
-rw-r--r--nixpkgs/pkgs/development/libraries/tix/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/tk/8.5.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/tk/8.6.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/tk/Fix-bad-install_name-for-libtk8.6.dylib.patch29
-rw-r--r--nixpkgs/pkgs/development/libraries/tk/different-prefix-with-tcl.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/tk/generic.nix61
-rw-r--r--nixpkgs/pkgs/development/libraries/tkrzw/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/tl-expected/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/tllist/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/tnt/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/tntdb/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/tntnet/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/tokyo-cabinet/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/tokyo-tyrant/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/totem-pl-parser/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/tpm2-tss/default.nix74
-rw-r--r--nixpkgs/pkgs/development/libraries/tpm2-tss/no-dynamic-loader-path.patch39
-rw-r--r--nixpkgs/pkgs/development/libraries/tracker-miners/default.nix141
-rw-r--r--nixpkgs/pkgs/development/libraries/tracker-miners/fix-paths.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/tracker/default.nix149
-rw-r--r--nixpkgs/pkgs/development/libraries/tracker/fix-docs.patch28
-rw-r--r--nixpkgs/pkgs/development/libraries/tracker/fix-paths.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/tre/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/tremor/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/trompeloeil/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/tsocks/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/tsocks/poll.patch26
-rw-r--r--nixpkgs/pkgs/development/libraries/tweeny/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/twolame/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/ubus/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/uci/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/ucl/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/ucommon/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/ucx/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/udns/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/udunits/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/uhttpmock/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/uid_wrapper/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/umockdev/default.nix73
-rw-r--r--nixpkgs/pkgs/development/libraries/unibilium/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/unicap/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/unicorn/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/unittest-cpp/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/unixODBC/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/unixODBCDrivers/default.nix177
-rw-r--r--nixpkgs/pkgs/development/libraries/unqlite/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/urdfdom-headers/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/urdfdom/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/uri/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/uriparser/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/usbredir/default.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/usrsctp/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/ustr/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/ustr/va_args.patch23
-rw-r--r--nixpkgs/pkgs/development/libraries/utf8cpp/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/utf8proc/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/uthash/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/uthenticode/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/utmps/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/v8/5_x.nix199
-rw-r--r--nixpkgs/pkgs/development/libraries/v8/darwin.patch22
-rw-r--r--nixpkgs/pkgs/development/libraries/v8/default.nix155
-rw-r--r--nixpkgs/pkgs/development/libraries/v8/gcc_arm.patch31
-rw-r--r--nixpkgs/pkgs/development/libraries/v8/libv8-5.4.232.patch97
-rw-r--r--nixpkgs/pkgs/development/libraries/v8/plv8_6_x.nix189
-rwxr-xr-xnixpkgs/pkgs/development/libraries/v8/update.sh47
-rw-r--r--nixpkgs/pkgs/development/libraries/vaapi-intel-hybrid/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/vaapi-intel/default.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/vaapi-vdpau/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/valhalla/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/vapoursynth-mvtools/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/vapoursynth/0001-Call-weak-function-to-allow-adding-preloaded-plugins.patch74
-rw-r--r--nixpkgs/pkgs/development/libraries/vapoursynth/default.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/vapoursynth/editor.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/vapoursynth/plugin-interface.nix113
-rw-r--r--nixpkgs/pkgs/development/libraries/vc/0.7.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/vc/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/vcdimager/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/vcg/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/vid-stab/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/vigra/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/virglrenderer/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/vmime/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/vmmlib/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/vmmlib/disable-cpack.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/vo-aacenc/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/vo-amrwbenc/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/volk/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/volume-key/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/vrb/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/vrb/removed_options.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/vrb/unused-but-set-variable.patch19
-rw-r--r--nixpkgs/pkgs/development/libraries/vrpn/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/vsqlite/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/vte/2.90.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/vte/default.nix105
-rw-r--r--nixpkgs/pkgs/development/libraries/vtk/7.x.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/vtk/8.x.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/vtk/9.x.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/vtk/generic.nix99
-rw-r--r--nixpkgs/pkgs/development/libraries/vulkan-headers/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/vulkan-loader/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/vxl/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/waffle/default.nix71
-rw-r--r--nixpkgs/pkgs/development/libraries/wasilibc/default.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/wavpack/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/wayland/0001-add-placeholder-for-nm.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/wayland/default.nix125
-rw-r--r--nixpkgs/pkgs/development/libraries/wayland/protocols.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/waylandpp/default.nix45
-rw-r--r--nixpkgs/pkgs/development/libraries/webkit2-sharp/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/webkitgtk/428774.patch86
-rw-r--r--nixpkgs/pkgs/development/libraries/webkitgtk/default.nix230
-rw-r--r--nixpkgs/pkgs/development/libraries/webkitgtk/fix-bubblewrap-paths.patch16
-rw-r--r--nixpkgs/pkgs/development/libraries/webkitgtk/libglvnd-headers.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/webrtc-audio-processing/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/webrtc-audio-processing/enable-riscv.patch18
-rw-r--r--nixpkgs/pkgs/development/libraries/websocket++/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/wiiuse/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/wildmidi/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/wiredtiger/default.nix67
-rw-r--r--nixpkgs/pkgs/development/libraries/wlroots/0.12.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/wlroots/default.nix55
-rw-r--r--nixpkgs/pkgs/development/libraries/wolfssl/default.nix53
-rw-r--r--nixpkgs/pkgs/development/libraries/wt/default.nix56
-rw-r--r--nixpkgs/pkgs/development/libraries/wtk/builder.sh27
-rw-r--r--nixpkgs/pkgs/development/libraries/wtk/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/wxSVG/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/wxsqlite3/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/wxsqliteplus/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/wxwidgets/2.8/default.nix76
-rw-r--r--nixpkgs/pkgs/development/libraries/wxwidgets/2.9/default.nix84
-rw-r--r--nixpkgs/pkgs/development/libraries/wxwidgets/3.0/default.nix95
-rw-r--r--nixpkgs/pkgs/development/libraries/wxwidgets/3.0/mac.nix69
-rw-r--r--nixpkgs/pkgs/development/libraries/wxwidgets/3.1/default.nix138
-rw-r--r--nixpkgs/pkgs/development/libraries/x264/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/x264/disable-arm-neon-default.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/x265/default.nix104
-rw-r--r--nixpkgs/pkgs/development/libraries/xalanc/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/xapian/default.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/xapian/skip-flaky-darwin-test.patch33
-rw-r--r--nixpkgs/pkgs/development/libraries/xapian/tools/omega/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/xavs/default.nix48
-rw-r--r--nixpkgs/pkgs/development/libraries/xbase/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/xbase/xbase-fixes.patch34
-rw-r--r--nixpkgs/pkgs/development/libraries/xcb-imdkit/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/xcb-util-cursor/HEAD.nix42
-rw-r--r--nixpkgs/pkgs/development/libraries/xcb-util-cursor/m4/ax_compare_version.m4174
-rw-r--r--nixpkgs/pkgs/development/libraries/xcb-util-cursor/m4/xcb_util_common.m444
-rw-r--r--nixpkgs/pkgs/development/libraries/xcb-util-cursor/m4/xcb_util_m4_with_include_path.m424
-rw-r--r--nixpkgs/pkgs/development/libraries/xdg-dbus-proxy/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/xdg-desktop-portal-gtk/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/xdg-desktop-portal-wlr/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix83
-rw-r--r--nixpkgs/pkgs/development/libraries/xdg-desktop-portal/fix-paths.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/xed/default.nix46
-rw-r--r--nixpkgs/pkgs/development/libraries/xercesc/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/xgboost/default.nix58
-rw-r--r--nixpkgs/pkgs/development/libraries/xine-lib/default.nix80
-rw-r--r--nixpkgs/pkgs/development/libraries/xlibs-wrapper/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/xlslib/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/xml-security-c/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/xml-tooling-c/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/xmlrpc-c/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/xmlsec/default.nix81
-rw-r--r--nixpkgs/pkgs/development/libraries/xmlsec/lt_dladdsearchdir.patch16
-rw-r--r--nixpkgs/pkgs/development/libraries/xmlsec/remove_bsd_base64_decode_flag.patch12
-rw-r--r--nixpkgs/pkgs/development/libraries/xsd/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/xsd/xsdcxx.patch126
-rw-r--r--nixpkgs/pkgs/development/libraries/xsimd/default.nix56
-rw-r--r--nixpkgs/pkgs/development/libraries/xtensor/default.nix36
-rw-r--r--nixpkgs/pkgs/development/libraries/xtl/default.nix33
-rw-r--r--nixpkgs/pkgs/development/libraries/xvidcore/default.nix47
-rw-r--r--nixpkgs/pkgs/development/libraries/xxHash/default.nix39
-rw-r--r--nixpkgs/pkgs/development/libraries/xylib/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/yajl/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/yder/default.nix54
-rw-r--r--nixpkgs/pkgs/development/libraries/yder/fix-pkgconfig.patch9
-rw-r--r--nixpkgs/pkgs/development/libraries/yojimbo/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/yubico-pam/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/zchunk/default.nix51
-rw-r--r--nixpkgs/pkgs/development/libraries/zeitgeist/default.nix89
-rw-r--r--nixpkgs/pkgs/development/libraries/zeroc-ice/3.6.nix59
-rw-r--r--nixpkgs/pkgs/development/libraries/zeroc-ice/default.nix88
-rw-r--r--nixpkgs/pkgs/development/libraries/zeroc-ice/uninitialized-variable-warning.patch20
-rw-r--r--nixpkgs/pkgs/development/libraries/zeromq/4.x.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/zimg/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/zimlib/default.nix55
-rw-r--r--nixpkgs/pkgs/development/libraries/zlib-ng/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/zlib/default.nix135
-rw-r--r--nixpkgs/pkgs/development/libraries/zlib/disable-cygwin-widechar.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/zlog/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/zmqpp/default.nix27
-rw-r--r--nixpkgs/pkgs/development/libraries/zookeeper_mt/default.nix56
-rw-r--r--nixpkgs/pkgs/development/libraries/zxcvbn-c/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/zxing-cpp/default.nix44
-rw-r--r--nixpkgs/pkgs/development/libraries/zydis/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/zziplib/default.nix81
2951 files changed, 131621 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/AntTweakBar/default.nix b/nixpkgs/pkgs/development/libraries/AntTweakBar/default.nix
new file mode 100644
index 000000000000..4c67c927e57f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/AntTweakBar/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl, unzip, xorg, libGLU, libGL }:
+
+stdenv.mkDerivation rec {
+  pname = "AntTweakBar";
+  version = "1.16";
+
+  nativeBuildInputs = [ unzip ];
+  buildInputs = [ xorg.libX11 libGLU libGL ];
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/anttweakbar/AntTweakBar_${lib.replaceStrings ["."] [""] version}.zip";
+    sha256 = "0z3frxpzf54cjs07m6kg09p7nljhr7140f4pznwi7srwq4cvgkpv";
+  };
+
+  postPatch = "cd src";
+  installPhase = ''
+    mkdir -p $out/lib/
+    cp ../lib/{libAntTweakBar.so,libAntTweakBar.so.1,libAntTweakBar.a} $out/lib/
+    cp -r ../include $out/
+  '';
+
+  meta = {
+    description = "Add a light/intuitive GUI to OpenGL applications";
+    longDescription = ''
+      A small and easy-to-use C/C++ library that allows to quickly add a light
+      and intuitive graphical user interface into graphic applications based on OpenGL
+      (compatibility and core profiles), DirectX 9, DirectX 10 or DirectX 11
+      to interactively tweak parameters on-screen
+    '';
+    homepage = "http://anttweakbar.sourceforge.net/";
+    license = lib.licenses.zlib;
+    maintainers = [ lib.maintainers.razvan ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/CGAL/4.nix b/nixpkgs/pkgs/development/libraries/CGAL/4.nix
new file mode 100644
index 000000000000..7028572174ff
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/CGAL/4.nix
@@ -0,0 +1,28 @@
+{ lib, 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 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/cgal_path.patch b/nixpkgs/pkgs/development/libraries/CGAL/cgal_path.patch
new file mode 100644
index 000000000000..68eec5fbb21f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/CGAL/cgal_path.patch
@@ -0,0 +1,15 @@
+--- Installation/cmake/modules/CGALConfig_install.cmake.in.original	2019-07-10 10:39:12.377022659 -0700
++++ Installation/cmake/modules/CGALConfig_install.cmake.in	2019-07-10 10:47:24.310154928 -0700
+@@ -45,9 +45,9 @@
+ set(CGAL_SHARED_LINKER_FLAGS_DEBUG_INIT   "@CMAKE_SHARED_LINKER_FLAGS_DEBUG@" )
+ set(CGAL_BUILD_TYPE_INIT                  "@CMAKE_BUILD_TYPE@" )
+
+-set(CGAL_INCLUDE_DIRS  "${CGAL_INSTALL_PREFIX}/@CGAL_INSTALL_INC_DIR@" )
+-set(CGAL_MODULES_DIR   "${CGAL_INSTALL_PREFIX}/@CGAL_INSTALL_CMAKE_DIR@" )
+-set(CGAL_LIBRARIES_DIR "${CGAL_INSTALL_PREFIX}/@CGAL_INSTALL_LIB_DIR@" )
++set(CGAL_INCLUDE_DIRS  "@CGAL_INSTALL_INC_DIR@" )
++set(CGAL_MODULES_DIR   "@CGAL_INSTALL_CMAKE_DIR@" )
++set(CGAL_LIBRARIES_DIR "@CGAL_INSTALL_LIB_DIR@" )
+
+ # If CGAL_ImageIO is built, tell if it was linked with Zlib.
+ set(CGAL_ImageIO_USE_ZLIB                 "@CGAL_ImageIO_USE_ZLIB@" )
diff --git a/nixpkgs/pkgs/development/libraries/CGAL/default.nix b/nixpkgs/pkgs/development/libraries/CGAL/default.nix
new file mode 100644
index 000000000000..d83560568121
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/CGAL/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, boost
+, gmp
+, mpfr
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cgal";
+  version = "5.3";
+
+  src = fetchFromGitHub {
+    owner = "CGAL";
+    repo = "releases";
+    rev = "CGAL-${version}";
+    sha256 = "sha256-ogY47Ggtj9k2U5pop1DNFkTusgQi2nNLc5OGN45SBCk=";
+  };
+
+  # 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 ];
+
+  patches = [ ./cgal_path.patch ];
+
+  doCheck = false;
+
+  meta = with 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/CoinMP/default.nix b/nixpkgs/pkgs/development/libraries/CoinMP/default.nix
new file mode 100644
index 000000000000..d34b465f135a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/CoinMP/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "CoinMP";
+  version = "1.8.4";
+
+  src = fetchurl {
+    url = "https://www.coin-or.org/download/source/CoinMP/${pname}-${version}.tgz";
+    sha256 = "13d3j1sdcjzpijp4qks3n0zibk649ac3hhv88hkk8ffxrc6gnn9l";
+  };
+
+  hardeningDisable = [ "format" ];
+
+  meta = with lib; {
+    homepage = "https://projects.coin-or.org/CoinMP/";
+    description = "COIN-OR lightweight API for COIN-OR libraries CLP, CBC, and CGL";
+    platforms = platforms.unix;
+    license = licenses.epl10;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/LAStools/default.nix b/nixpkgs/pkgs/development/libraries/LAStools/default.nix
new file mode 100644
index 000000000000..61a39aa8e76d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/LAStools/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "LAStools";
+  version = "201003"; # LAStools makes release-ish commits with a message containing their version number as YYMMDD; these align with their website changelog
+
+  src = fetchFromGitHub {
+    owner = "LAStools";
+    repo = "LAStools";
+    rev = "635b76b42cc4912762da31b92f875df5310e1714";
+    sha256 = "0682ca3bp51lmfp46vsjnd1bqpn05g95pf4kclvjv1y8qivkxsaq";
+  };
+
+  patches = [
+    ./drop-64-suffix.patch # necessary to prevent '64' from being appended to the names of the executables
+  ];
+
+  hardeningDisable = [
+    "format"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  meta = with lib; {
+    description = "Software for rapid LiDAR processing";
+    homepage = http://lastools.org/;
+    license = licenses.unfree;
+    maintainers = with maintainers; [ stephenwithph ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/LAStools/drop-64-suffix.patch b/nixpkgs/pkgs/development/libraries/LAStools/drop-64-suffix.patch
new file mode 100644
index 000000000000..2090baeb3b2b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/LAStools/drop-64-suffix.patch
@@ -0,0 +1,13 @@
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -32,6 +32,6 @@ endforeach(TARGET)
+ foreach(TARGET ${ALL_TARGETS})
+ 	target_link_libraries(${TARGET} LASlib)
+ 	set_target_properties(${TARGET} PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../bin64)
+-	set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME ${TARGET}64)
++	set_target_properties(${TARGET} PROPERTIES OUTPUT_NAME ${TARGET})
+ 	install(TARGETS ${TARGET} RUNTIME DESTINATION bin)
+ endforeach(TARGET)
+-- 
+2.28.0
+
diff --git a/nixpkgs/pkgs/development/libraries/LASzip/LASzip2.nix b/nixpkgs/pkgs/development/libraries/LASzip/LASzip2.nix
new file mode 100644
index 000000000000..b080153826ad
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/LASzip/LASzip2.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  version = "2.2.0";
+  pname = "LASzip";
+
+  src = fetchurl {
+    url = "https://github.com/LASzip/LASzip/archive/v${version}.tar.gz";
+    sha256 = "b8e8cc295f764b9d402bc587f3aac67c83ed8b39f1cb686b07c168579c61fbb2";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Turn quickly bulky LAS files into compact LAZ files without information loss";
+    homepage = "https://laszip.org";
+    license = licenses.lgpl2;
+    maintainers = [ maintainers.michelk ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/LASzip/default.nix b/nixpkgs/pkgs/development/libraries/LASzip/default.nix
new file mode 100644
index 000000000000..f170ea44c0ee
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/LASzip/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  version = "3.4.3";
+  pname = "LASzip";
+
+  src = fetchFromGitHub {
+    owner = "LASzip";
+    repo = "LASzip";
+    rev = version;
+    sha256 = "09lcsgxwv0jq50fhsgfhx0npbf1zcwn3hbnq6q78fshqksbxmz7m";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  meta = {
+    description = "Turn quickly bulky LAS files into compact LAZ files without information loss";
+    homepage = "https://laszip.org";
+    license = lib.licenses.lgpl2;
+    maintainers = [ lib.maintainers.michelk ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/NSPlist/default.nix b/nixpkgs/pkgs/development/libraries/NSPlist/default.nix
new file mode 100644
index 000000000000..680e86dd64ef
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/NSPlist/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation {
+  pname = "NSPlist";
+  version = "unstable-2017-04-11";
+
+  src = fetchFromGitHub {
+    owner = "matthewbauer";
+    repo = "NSPlist";
+    rev = "713decf06c1ef6c39a707bc99eb45ac9925f2b8a";
+    sha256 = "0v4yfiwfd08hmh2ydgy6pnmlzjbd96k78dsla9pfd56ka89aw74r";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    maintainers = with maintainers; [ matthewbauer ];
+    description = "Parses .plist files";
+    license = licenses.mit;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/PlistCpp/default.nix b/nixpkgs/pkgs/development/libraries/PlistCpp/default.nix
new file mode 100644
index 000000000000..c2d5e6dceac7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/PlistCpp/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, cmake, boost, NSPlist, pugixml }:
+
+stdenv.mkDerivation {
+  pname = "PlistCpp";
+  version = "unstable-11615d";
+
+  src = fetchFromGitHub {
+    owner = "matthewbauer";
+    repo = "PlistCpp";
+    rev = "11615deab3369356a182dabbf5bae30574967264";
+    sha256 = "10jn6bvm9vn6492zix2pd724v5h4lccmkqg3lxfw8r0qg3av0yzv";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost NSPlist pugixml ];
+
+  meta = with lib; {
+    maintainers = with maintainers; [ matthewbauer ];
+    description = "CPP bindings for Plist";
+    license = licenses.mit;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/SDL/default.nix b/nixpkgs/pkgs/development/libraries/SDL/default.nix
new file mode 100644
index 000000000000..059ba65b25c4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL/default.nix
@@ -0,0 +1,135 @@
+{ lib, stdenv, config, fetchurl, fetchpatch, pkg-config, audiofile, libcap, libiconv
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
+, openglSupport ? libGLSupported, libGL, libGLU
+, alsaSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid, alsa-lib
+, x11Support ? !stdenv.isCygwin && !stdenv.hostPlatform.isAndroid
+, libXext, libICE, libXrandr
+, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux && !stdenv.hostPlatform.isAndroid, libpulseaudio
+, OpenGL, GLUT, CoreAudio, CoreServices, AudioUnit, Kernel, Cocoa
+}:
+
+# NOTE: When editing this expression see if the same change applies to
+# SDL2 expression too
+
+with lib;
+
+let
+  extraPropagatedBuildInputs = [ ]
+    ++ optionals x11Support [ libXext libICE libXrandr ]
+    ++ optionals (openglSupport && stdenv.isLinux) [ libGL libGLU ]
+    ++ optionals (openglSupport && stdenv.isDarwin) [ OpenGL GLUT ]
+    ++ optional alsaSupport alsa-lib
+    ++ optional pulseaudioSupport libpulseaudio
+    ++ optional stdenv.isDarwin Cocoa;
+  rpath = makeLibraryPath extraPropagatedBuildInputs;
+in
+
+stdenv.mkDerivation rec {
+  pname = "SDL";
+  version = "1.2.15";
+
+  src = fetchurl {
+    url    = "https://www.libsdl.org/release/${pname}-${version}.tar.gz";
+    sha256 = "005d993xcac8236fpvd1iawkz4wqjybkpn8dbwaliqz5jfkidlyn";
+  };
+
+  # make: *** No rule to make target 'build/*.lo', needed by 'build/libSDL.la'.  Stop.
+  postPatch = "patchShebangs ./configure";
+
+  outputs = [ "out" "dev" ];
+  outputBin = "dev"; # sdl-config
+
+  nativeBuildInputs = [ pkg-config ]
+    ++ optional stdenv.isLinux libcap;
+
+  propagatedBuildInputs = [ libiconv ] ++ extraPropagatedBuildInputs;
+
+  buildInputs = [ ]
+    ++ optional (!stdenv.hostPlatform.isMinGW && alsaSupport) audiofile
+    ++ optionals stdenv.isDarwin [ AudioUnit CoreAudio CoreServices Kernel OpenGL ];
+
+  configureFlags = [
+    "--disable-oss"
+    "--disable-video-x11-xme"
+    "--enable-rpath"
+  # Building without this fails on Darwin with
+  #
+  #   ./src/video/x11/SDL_x11sym.h:168:17: error: conflicting types for '_XData32'
+  #   SDL_X11_SYM(int,_XData32,(Display *dpy,register long *data,unsigned len),(dpy,data,len),return)
+  #
+  # Please try revert the change that introduced this comment when updating SDL.
+  ] ++ optional stdenv.isDarwin "--disable-x11-shared"
+    ++ optional (!x11Support) "--without-x"
+    ++ optional alsaSupport "--with-alsa-prefix=${alsa-lib.out}/lib";
+
+  patches = [
+    ./find-headers.patch
+
+    # Fix window resizing issues, e.g. for xmonad
+    # Ticket: http://bugzilla.libsdl.org/show_bug.cgi?id=1430
+    (fetchpatch {
+      name = "fix_window_resizing.diff";
+      url = "https://bugs.debian.org/cgi-bin/bugreport.cgi?msg=10;filename=fix_window_resizing.diff;att=2;bug=665779";
+      sha256 = "1z35azc73vvi19pzi6byck31132a8w1vzrghp1x3hy4a4f9z4gc6";
+    })
+    # Fix drops of keyboard events for SDL_EnableUNICODE
+    (fetchpatch {
+      url = "https://github.com/libsdl-org/SDL-1.2/commit/0332e2bb18dc68d6892c3b653b2547afe323854b.patch";
+      sha256 = "0g458iv6pp9sikdch6ms8svz60lf5ks2q5wgid8s9rydhk98lpp5";
+    })
+    # Ignore insane joystick axis events
+    (fetchpatch {
+      url = "https://github.com/libsdl-org/SDL-1.2/commit/ab99cc82b0a898ad528d46fa128b649a220a94f4.patch";
+      sha256 = "1b3473sawfdbkkxaqf1hg0vn37yk8hf655jhnjwdk296z4gclazh";
+    })
+    # https://bugzilla.libsdl.org/show_bug.cgi?id=1769
+    (fetchpatch {
+      url = "https://github.com/libsdl-org/SDL-1.2/commit/5d79977ec7a6b58afa6e4817035aaaba186f7e9f.patch";
+      sha256 = "1k7y57b1zy5afib1g7w3in36n8cswbcrzdbrjpn5cb105rnb9vmp";
+    })
+    # Workaround X11 bug to allow changing gamma
+    # Ticket: https://bugs.freedesktop.org/show_bug.cgi?id=27222
+    (fetchpatch {
+      name = "SDL_SetGamma.patch";
+      url = "https://src.fedoraproject.org/cgit/rpms/SDL.git/plain/SDL-1.2.15-x11-Bypass-SetGammaRamp-when-changing-gamma.patch?id=04a3a7b1bd88c2d5502292fad27e0e02d084698d";
+      sha256 = "0x52s4328kilyq43i7psqkqg7chsfwh0aawr50j566nzd7j51dlv";
+    })
+    # Fix a build failure on OS X Mavericks
+    # Ticket: https://bugzilla.libsdl.org/show_bug.cgi?id=2085
+    (fetchpatch {
+      url = "https://github.com/libsdl-org/SDL-1.2/commit/19039324be71738d8990e91b9ba341b2ea068445.patch";
+      sha256 = "0ckwling2ad27c9vxgp97ndjd098d6zbrydza8b9l77k8airj98c";
+    })
+    (fetchpatch {
+      url = "https://github.com/libsdl-org/SDL-1.2/commit/7933032ad4d57c24f2230db29f67eb7d21bb5654.patch";
+      sha256 = "1by16firaxyr0hjvn35whsgcmq6bl0nwhnpjf75grjzsw9qvwyia";
+    })
+  ];
+
+  postInstall = ''
+    moveToOutput share/aclocal "$dev"
+  '';
+
+  # See the same place in the expression for SDL2
+  postFixup = ''
+    for lib in $out/lib/*.so* ; do
+      if [[ -L "$lib" ]]; then
+        patchelf --set-rpath "$(patchelf --print-rpath $lib):${rpath}" "$lib"
+      fi
+    done
+  '';
+
+  setupHook = ./setup-hook.sh;
+
+  passthru = { inherit openglSupport; };
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A cross-platform multimedia library";
+    homepage    = "http://www.libsdl.org/";
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.unix;
+    license     = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/SDL/find-headers.patch b/nixpkgs/pkgs/development/libraries/SDL/find-headers.patch
new file mode 100644
index 000000000000..fd498117fd64
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL/find-headers.patch
@@ -0,0 +1,26 @@
+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)
+-      echo -I@includedir@/SDL @SDL_CFLAGS@
++      SDL_CFLAGS=""
++      for i in @includedir@/SDL $SDL_PATH; do
++        SDL_CFLAGS="$SDL_CFLAGS -I$i"
++      done
++      echo $SDL_CFLAGS @SDL_CFLAGS@
+       ;;
+ @ENABLE_SHARED_TRUE@    --libs)
+-@ENABLE_SHARED_TRUE@      echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@
++@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
new file mode 100644
index 000000000000..553e8553a77f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL/setup-hook.sh
@@ -0,0 +1,10 @@
+addSDLPath () {
+  if [ -e "$1/include/SDL" ]; then
+    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
+}
+
+addEnvHooks "$hostOffset" addSDLPath
diff --git a/nixpkgs/pkgs/development/libraries/SDL2/default.nix b/nixpkgs/pkgs/development/libraries/SDL2/default.nix
new file mode 100644
index 000000000000..d02dac1f562f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL2/default.nix
@@ -0,0 +1,137 @@
+{ lib, stdenv, config, fetchurl, pkg-config
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
+, openglSupport ? libGLSupported, libGL
+, alsaSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid, alsa-lib
+, x11Support ? !stdenv.targetPlatform.isWindows && !stdenv.hostPlatform.isAndroid
+, libX11, xorgproto, libICE, libXi, libXScrnSaver, libXcursor
+, libXinerama, libXext, libXxf86vm, libXrandr
+, waylandSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid
+, wayland, wayland-protocols, libxkbcommon
+, dbusSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid, dbus
+, udevSupport ? false, udev
+, ibusSupport ? false, ibus
+, fcitxSupport ? false, fcitx
+, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux && !stdenv.hostPlatform.isAndroid
+, libpulseaudio
+, AudioUnit, Cocoa, CoreAudio, CoreServices, ForceFeedback, OpenGL
+, audiofile, libiconv
+, withStatic ? false
+}:
+
+# NOTE: When editing this expression see if the same change applies to
+# SDL expression too
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "SDL2";
+  version = "2.0.14";
+
+  src = fetchurl {
+    url = "https://www.libsdl.org/release/${pname}-${version}.tar.gz";
+    sha256 = "1g1jahknv5r4yhh1xq5sf0md20ybdw1zh1i15lry26sq39bmn8fq";
+  };
+  dontDisableStatic = withStatic;
+  outputs = [ "out" "dev" ];
+  outputBin = "dev"; # sdl-config
+
+  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;"
+
+    substituteInPlace configure \
+      --replace 'WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`' 'WAYLAND_SCANNER=`pkg-config --variable=wayland_scanner wayland-scanner`'
+  '';
+
+  depsBuildBuild = [ pkg-config ];
+
+  nativeBuildInputs = [ pkg-config ] ++ optionals waylandSupport [ wayland ];
+
+  propagatedBuildInputs = dlopenPropagatedBuildInputs;
+
+  dlopenPropagatedBuildInputs = [ ]
+    # Propagated for #include <GLES/gl.h> in SDL_opengles.h.
+    ++ optional openglSupport libGL
+    # Propagated for #include <X11/Xlib.h> and <X11/Xatom.h> in SDL_syswm.h.
+    ++ optionals x11Support [ libX11 xorgproto ];
+
+  dlopenBuildInputs = [ ]
+    ++ optionals  alsaSupport [ alsa-lib audiofile ]
+    ++ optional  dbusSupport dbus
+    ++ optional  pulseaudioSupport libpulseaudio
+    ++ optional  udevSupport udev
+    ++ optionals waylandSupport [ wayland wayland-protocols libxkbcommon ]
+    ++ optionals x11Support [ libICE libXi libXScrnSaver libXcursor libXinerama libXext libXrandr libXxf86vm ];
+
+  buildInputs = [ libiconv ]
+    ++ dlopenBuildInputs
+    ++ optional  ibusSupport ibus
+    ++ optional  fcitxSupport fcitx
+    ++ optionals stdenv.isDarwin [ AudioUnit Cocoa CoreAudio CoreServices ForceFeedback OpenGL ];
+
+  enableParallelBuilding = true;
+
+  configureFlags = [
+    "--disable-oss"
+  ] ++ optional (!x11Support) "--without-x"
+    ++ optional alsaSupport "--with-alsa-prefix=${alsa-lib.out}/lib"
+    ++ optional stdenv.targetPlatform.isWindows "--disable-video-opengles"
+    ++ 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 = ''
+    if [ "$dontDisableStatic" -eq "1" ]; then
+      rm $out/lib/*.la
+    else
+      rm $out/lib/*.a
+    fi
+    moveToOutput bin/sdl2-config "$dev"
+  '';
+
+  # SDL is weird in that instead of just dynamically linking with
+  # libraries when you `--enable-*` (or when `configure` finds) them
+  # it `dlopen`s them at runtime. In principle, this means it can
+  # ignore any missing optional dependencies like alsa, pulseaudio,
+  # some x11 libs, wayland, etc if they are missing on the system
+  # and/or work with wide array of versions of said libraries. In
+  # nixpkgs, however, we don't need any of that. Moreover, since we
+  # don't have a global ld-cache we have to stuff all the propagated
+  # libraries into rpath by hand or else some applications that use
+  # SDL API that requires said libraries will fail to start.
+  #
+  # You can grep SDL sources with `grep -rE 'SDL_(NAME|.*_SYM)'` to
+  # list the symbols used in this way.
+  postFixup = let
+    rpath = makeLibraryPath (dlopenPropagatedBuildInputs ++ dlopenBuildInputs);
+  in optionalString (stdenv.hostPlatform.extensions.sharedLibrary == ".so") ''
+    for lib in $out/lib/*.so* ; do
+      if ! [[ -L "$lib" ]]; then
+        patchelf --set-rpath "$(patchelf --print-rpath $lib):${rpath}" "$lib"
+      fi
+    done
+  '';
+
+  setupHook = ./setup-hook.sh;
+
+  passthru = { inherit openglSupport; };
+
+  meta = with lib; {
+    description = "A cross-platform multimedia library";
+    homepage = "http://www.libsdl.org/";
+    license = licenses.zlib;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ cpages ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/SDL2/find-headers.patch b/nixpkgs/pkgs/development/libraries/SDL2/find-headers.patch
new file mode 100644
index 000000000000..a2e0c4837031
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL2/find-headers.patch
@@ -0,0 +1,46 @@
+diff -ru3 SDL2-2.0.14/sdl2-config.cmake.in SDL2-2.0.14-new/sdl2-config.cmake.in
+--- SDL2-2.0.14/sdl2-config.cmake.in	2020-12-21 18:44:36.000000000 +0100
++++ SDL2-2.0.14-new/sdl2-config.cmake.in	2021-01-16 23:53:40.721121792 +0100
+@@ -6,7 +6,8 @@
+ set(SDL2_PREFIX "@prefix@")
+ set(SDL2_EXEC_PREFIX "@prefix@")
+ set(SDL2_LIBDIR "@libdir@")
+-set(SDL2_INCLUDE_DIRS "@includedir@/SDL2")
++set(SDL2_INCLUDE_DIRS "@includedir@/SDL2" $ENV{SDL2_PATH})
++separate_arguments(SDL2_INCLUDE_DIRS)
+ set(SDL2_LIBRARIES "-L${SDL2_LIBDIR} @SDL_RLD_FLAGS@ @SDL_LIBS@")
+ string(STRIP "${SDL2_LIBRARIES}" SDL2_LIBRARIES)
+ 
+@@ -20,14 +21,14 @@
+ 
+   add_library(SDL2::SDL2 SHARED IMPORTED)
+   set_target_properties(SDL2::SDL2 PROPERTIES
+-    INTERFACE_INCLUDE_DIRECTORIES "@includedir@/SDL2"
++    INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}"
+     IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+     IMPORTED_LOCATION "@libdir@/${CMAKE_SHARED_LIBRARY_PREFIX}SDL2${CMAKE_SHARED_LIBRARY_SUFFIX}"
+     INTERFACE_LINK_LIBRARIES "${SDL2_EXTRA_LINK_FLAGS}")
+ 
+   add_library(SDL2::SDL2-static STATIC IMPORTED)
+   set_target_properties(SDL2::SDL2-static PROPERTIES
+-    INTERFACE_INCLUDE_DIRECTORIES "@includedir@/SDL2"
++    INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIRS}"
+     IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+     IMPORTED_LOCATION "@libdir@/${CMAKE_STATIC_LIBRARY_PREFIX}SDL2${CMAKE_STATIC_LIBRARY_SUFFIX}"
+     INTERFACE_LINK_LIBRARIES "${SDL2_EXTRA_LINK_FLAGS_STATIC}")
+diff -ru3 SDL2-2.0.14/sdl2-config.in SDL2-2.0.14-new/sdl2-config.in
+--- SDL2-2.0.14/sdl2-config.in	2020-12-21 18:44:36.000000000 +0100
++++ SDL2-2.0.14-new/sdl2-config.in	2021-01-16 23:57:11.940353171 +0100
+@@ -42,7 +42,11 @@
+       echo @SDL_VERSION@
+       ;;
+     --cflags)
+-      echo -I@includedir@/SDL2 @SDL_CFLAGS@
++      SDL_CFLAGS=""
++      for i in @includedir@/SDL2 $SDL2_PATH; do
++        SDL_CFLAGS="$SDL_CFLAGS -I$i"
++      done
++      echo $SDL_CFLAGS @SDL_CFLAGS@
+       ;;
+ @ENABLE_SHARED_TRUE@    --libs)
+ @ENABLE_SHARED_TRUE@      echo -L@libdir@ @SDL_RLD_FLAGS@ @SDL_LIBS@
diff --git a/nixpkgs/pkgs/development/libraries/SDL2/setup-hook.sh b/nixpkgs/pkgs/development/libraries/SDL2/setup-hook.sh
new file mode 100644
index 000000000000..0119926491af
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL2/setup-hook.sh
@@ -0,0 +1,7 @@
+addSDL2Path () {
+  if [ -e "$1/include/SDL2" ]; then
+    export SDL2_PATH="${SDL2_PATH-}${SDL2_PATH:+ }$1/include/SDL2"
+  fi
+}
+
+addEnvHooks "$hostOffset" addSDL2Path
diff --git a/nixpkgs/pkgs/development/libraries/SDL2_gfx/default.nix b/nixpkgs/pkgs/development/libraries/SDL2_gfx/default.nix
new file mode 100644
index 000000000000..2da2189b1a87
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL2_gfx/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, darwin, fetchurl, SDL2 }:
+
+stdenv.mkDerivation rec {
+  pname = "SDL2_gfx";
+  version = "1.0.4";
+
+  src = fetchurl {
+    url = "http://www.ferzkopp.net/Software/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "0qk2ax7f7grlxb13ba0ll3zlm8780s7j8fmrhlpxzjgdvldf1q33";
+  };
+
+  buildInputs = [ SDL2 ]
+    ++ lib.optional stdenv.isDarwin darwin.libobjc;
+
+  configureFlags = [(if stdenv.isi686 || stdenv.isx86_64 then "--enable-mmx" else "--disable-mmx")]
+     ++ lib.optional stdenv.isDarwin "--disable-sdltest";
+
+  meta = with lib; {
+    description = "SDL graphics drawing primitives and support functions";
+
+    longDescription = ''
+      The SDL_gfx library evolved out of the SDL_gfxPrimitives code
+      which provided basic drawing routines such as lines, circles or
+      polygons and SDL_rotozoom which implemented a interpolating
+      rotozoomer for SDL surfaces.
+
+      The current components of the SDL_gfx library are:
+
+          * Graphic Primitives (SDL_gfxPrimitves.h)
+          * Rotozoomer (SDL_rotozoom.h)
+          * Framerate control (SDL_framerate.h)
+          * MMX image filters (SDL_imageFilter.h)
+          * Custom Blit functions (SDL_gfxBlitFunc.h)
+
+      The library is backwards compatible to the above mentioned
+      code. Its is written in plain C and can be used in C++ code.
+    '';
+
+    homepage = "http://www.ferzkopp.net/wordpress/2016/01/02/sdl_gfx-sdl2_gfx/";
+    license = licenses.zlib;
+    maintainers = with maintainers; [ cpages ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/SDL2_image/default.nix b/nixpkgs/pkgs/development/libraries/SDL2_image/default.nix
new file mode 100644
index 000000000000..3c7c13319991
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL2_image/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, SDL2, libpng, libjpeg, libtiff, giflib, libwebp, libXpm, zlib, Foundation }:
+
+stdenv.mkDerivation rec {
+  pname = "SDL2_image";
+  version = "2.0.5";
+
+  src = fetchurl {
+    url = "https://www.libsdl.org/projects/SDL_image/release/${pname}-${version}.tar.gz";
+    sha256 = "1l0864kas9cwpp2d32yxl81g98lx40dhbdp03dz7sbv84vhgdmdx";
+  };
+
+  buildInputs = [ SDL2 libpng libjpeg libtiff giflib libwebp libXpm zlib ]
+    ++ lib.optional stdenv.isDarwin Foundation;
+
+  configureFlags = [
+    # Disable dynamically loaded dependencies
+    "--disable-jpg-shared"
+    "--disable-png-shared"
+    "--disable-tif-shared"
+    "--disable-webp-shared"
+  ] ++ lib.optionals stdenv.isDarwin [
+    # Darwin headless will hang when trying to run the SDL test program
+    "--disable-sdltest"
+    # Don't use native macOS frameworks
+    "--disable-imageio"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "SDL image library";
+    homepage = "http://www.libsdl.org/projects/SDL_image/";
+    platforms = platforms.unix;
+    license = licenses.zlib;
+    maintainers = with maintainers; [ cpages ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/SDL2_mixer/default.nix b/nixpkgs/pkgs/development/libraries/SDL2_mixer/default.nix
new file mode 100644
index 000000000000..7e1d097ba5cb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL2_mixer/default.nix
@@ -0,0 +1,66 @@
+{ lib, stdenv
+, fetchurl
+, pkg-config
+, AudioToolbox
+, AudioUnit
+, CoreServices
+, SDL2
+, flac
+, fluidsynth
+, libmodplug
+, libogg
+, libvorbis
+, mpg123
+, opusfile
+, smpeg2
+}:
+
+stdenv.mkDerivation rec {
+  pname = "SDL2_mixer";
+  version = "2.0.4";
+
+  src = fetchurl {
+    url = "https://www.libsdl.org/projects/SDL_mixer/release/${pname}-${version}.tar.gz";
+    sha256 = "0694vsz5bjkcdgfdra6x9fq8vpzrl8m6q96gh58df7065hw5mkxl";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = lib.optionals stdenv.isDarwin [
+    AudioToolbox
+    AudioUnit
+    CoreServices
+  ];
+
+  propagatedBuildInputs = [
+    SDL2
+    flac
+    fluidsynth
+    libmodplug
+    libogg
+    libvorbis
+    mpg123
+    opusfile
+    smpeg2
+  ];
+
+  configureFlags = [
+    "--disable-music-ogg-shared"
+    "--disable-music-flac-shared"
+    "--disable-music-mod-modplug-shared"
+    "--disable-music-mp3-mpg123-shared"
+    "--disable-music-opus-shared"
+    "--disable-music-midi-fluidsynth-shared"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "--disable-sdltest"
+    "--disable-smpegtest"
+  ];
+
+  meta = with lib; {
+    description = "SDL multi-channel audio mixer library";
+    platforms = platforms.unix;
+    homepage = "https://www.libsdl.org/projects/SDL_mixer/";
+    maintainers = with maintainers; [ MP2E ];
+    license = licenses.zlib;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/SDL2_net/default.nix b/nixpkgs/pkgs/development/libraries/SDL2_net/default.nix
new file mode 100644
index 000000000000..fe6cb9445a39
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL2_net/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, darwin, fetchurl, SDL2 }:
+
+stdenv.mkDerivation rec {
+  pname = "SDL2_net";
+  version = "2.0.1";
+
+  src = fetchurl {
+    url = "https://www.libsdl.org/projects/SDL_net/release/${pname}-${version}.tar.gz";
+    sha256 = "08cxc1bicmyk89kiks7izw1rlx5ng5n6xpy8fy0zxni3b9z8mkhm";
+  };
+
+  buildInputs = lib.optional stdenv.isDarwin darwin.libobjc;
+
+  configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest";
+
+  propagatedBuildInputs = [ SDL2 ];
+
+  meta = with lib; {
+    description = "SDL multiplatform networking library";
+    homepage = "https://www.libsdl.org/projects/SDL_net";
+    license = licenses.zlib;
+    maintainers = with maintainers; [ MP2E ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/SDL2_ttf/default.nix b/nixpkgs/pkgs/development/libraries/SDL2_ttf/default.nix
new file mode 100644
index 000000000000..e23b3fb92150
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL2_ttf/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, darwin, fetchurl, SDL2, freetype, libGL }:
+
+stdenv.mkDerivation rec {
+  pname = "SDL2_ttf";
+  version = "2.0.15";
+
+  src = fetchurl {
+    url = "https://www.libsdl.org/projects/SDL_ttf/release/${pname}-${version}.tar.gz";
+    sha256 = "0cyd48dipc0m399qy8s03lci8b0bpiy8xlkvrm2ia7wcv0dfpv59";
+  };
+
+  configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest";
+
+  buildInputs = [ SDL2 freetype libGL ]
+    ++ lib.optional stdenv.isDarwin darwin.libobjc;
+
+  meta = with lib; {
+    description = "SDL TrueType library";
+    platforms = platforms.unix;
+    license = licenses.zlib;
+    homepage = "https://www.libsdl.org/projects/SDL_ttf/";
+  };
+}
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..7c90092fe8dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL_Pango/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchpatch, fetchurl, SDL, autoreconfHook, pango, pkg-config }:
+
+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";
+  configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest";
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+  buildInputs = [ SDL pango ];
+
+  meta = with 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/SDL_gfx/default.nix b/nixpkgs/pkgs/development/libraries/SDL_gfx/default.nix
new file mode 100644
index 000000000000..f5a3d8635531
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL_gfx/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchurl, SDL }:
+
+stdenv.mkDerivation rec {
+  pname = "SDL_gfx";
+  version = "2.0.26";
+
+  src = fetchurl {
+    url = "https://www.ferzkopp.net/Software/SDL_gfx-2.0/${pname}-${version}.tar.gz";
+    sha256 = "0ijljhs0v99dj6y27hc10z6qchyp8gdp4199y6jzngy6dzxlzsvw";
+  };
+
+  buildInputs = [ SDL ] ;
+
+  configureFlags = [ "--disable-mmx" ]
+    ++ lib.optional stdenv.isDarwin "--disable-sdltest";
+
+  meta = with lib; {
+    description = "SDL graphics drawing primitives and support functions";
+
+    longDescription = ''
+      The SDL_gfx library evolved out of the SDL_gfxPrimitives code
+      which provided basic drawing routines such as lines, circles or
+      polygons and SDL_rotozoom which implemented a interpolating
+      rotozoomer for SDL surfaces.
+
+      The current components of the SDL_gfx library are:
+
+        * Graphic Primitives (SDL_gfxPrimitves.h)
+        * Rotozoomer (SDL_rotozoom.h)
+        * Framerate control (SDL_framerate.h)
+        * MMX image filters (SDL_imageFilter.h)
+        * Custom Blit functions (SDL_gfxBlitFunc.h)
+
+      The library is backwards compatible to the above mentioned
+      code. Its is written in plain C and can be used in C++ code.
+    '';
+
+    homepage = "https://sourceforge.net/projects/sdlgfx/";
+    license = licenses.zlib;
+
+    maintainers = with maintainers; [ bjg ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/SDL_gpu/default.nix b/nixpkgs/pkgs/development/libraries/SDL_gpu/default.nix
new file mode 100644
index 000000000000..dc52e6afeea7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL_gpu/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, cmake, SDL2, libGLU }:
+
+stdenv.mkDerivation {
+  pname = "SDL_gpu-unstable";
+  version = "2019-01-24";
+
+  src = fetchFromGitHub {
+    owner = "grimfang4";
+    repo = "sdl-gpu";
+    rev = "e3d350b325a0e0d0b3007f69ede62313df46c6ef";
+    sha256 = "0kibcaim01inb6xxn4mr6affn4hm50vz9kahb5k9iz8dmdsrhxy1";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ SDL2 libGLU ];
+
+  cmakeFlags = [
+    "-DSDL_gpu_BUILD_DEMOS=OFF"
+    "-DSDL_gpu_BUILD_TOOLS=OFF"
+    "-DSDL_gpu_BUILD_VIDEO_TEST=OFF"
+    "-DSDL_gpu_BUILD_TESTS=OFF"
+  ];
+
+  patchPhase = ''
+    sed -ie '210s#''${OUTPUT_DIR}/lib#''${CMAKE_INSTALL_LIBDIR}#' src/CMakeLists.txt
+    sed -ie '213s#''${OUTPUT_DIR}/lib#''${CMAKE_INSTALL_LIBDIR}#' src/CMakeLists.txt
+  '';
+
+  meta = with lib; {
+    description = "A library for high-performance, modern 2D graphics with SDL written in C";
+    homepage = "https://github.com/grimfang4/sdl-gpu";
+    license = licenses.mit;
+    maintainers = with maintainers; [ pmiddend ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/SDL_image/default.nix b/nixpkgs/pkgs/development/libraries/SDL_image/default.nix
new file mode 100644
index 000000000000..d6424575a764
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL_image/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, fetchpatch, SDL, libpng, libjpeg, libtiff, giflib, libXpm }:
+
+stdenv.mkDerivation rec {
+  pname = "SDL_image";
+  version = "1.2.12";
+
+  src = fetchurl {
+    url    = "https://www.libsdl.org/projects/SDL_image/release/${pname}-${version}.tar.gz";
+    sha256 = "16an9slbb8ci7d89wakkmyfvp7c0cval8xw4hkg0842nhhlp540b";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "CVE-2017-2887";
+      url = "https://github.com/libsdl-org/SDL_image/commit/e7723676825cd2b2ffef3316ec1879d7726618f2.patch";
+      includes = [ "IMG_xcf.c" ];
+      sha256 = "174ka2r95i29nlshzgp6x5vc68v7pi8lhzf33and2b1ms49g4jb7";
+    })
+  ];
+
+  configureFlags = [
+    # Disable its dynamic loading or dlopen will fail because of no proper rpath
+    "--disable-jpg-shared"
+    "--disable-png-shared"
+    "--disable-tif-shared"
+  ] ++ lib.optional stdenv.isDarwin "--disable-sdltest";
+
+  buildInputs = [ SDL libpng libjpeg libtiff giflib libXpm ];
+
+  meta = with lib; {
+    description = "SDL image library";
+    homepage    = "http://www.libsdl.org/projects/SDL_image/";
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.unix;
+    license     = licenses.zlib;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/SDL_mixer/default.nix b/nixpkgs/pkgs/development/libraries/SDL_mixer/default.nix
new file mode 100644
index 000000000000..291e9790e442
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL_mixer/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, lib, fetchurl
+, SDL, libogg, libvorbis, smpeg, libmikmod
+, fluidsynth
+, enableNativeMidi ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname   = "SDL_mixer";
+  version = "1.2.12";
+
+  src = fetchurl {
+    url    = "http://www.libsdl.org/projects/${pname}/release/${pname}-${version}.tar.gz";
+    sha256 = "0alrhqgm40p4c92s26mimg9cm1y7rzr6m0p49687jxd9g6130i0n";
+  };
+
+  buildInputs = [ SDL libogg libvorbis fluidsynth smpeg libmikmod ];
+
+  configureFlags = [ "--disable-music-ogg-shared" "--disable-music-mod-shared" ]
+    ++ lib.optional enableNativeMidi " --enable-music-native-midi-gpl"
+    ++ lib.optionals stdenv.isDarwin [ "--disable-sdltest" "--disable-smpegtest" ];
+
+  meta = with lib; {
+    description = "SDL multi-channel audio mixer library";
+    homepage    = "http://www.libsdl.org/projects/SDL_mixer/";
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.unix;
+    license     = licenses.zlib;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/SDL_net/default.nix b/nixpkgs/pkgs/development/libraries/SDL_net/default.nix
new file mode 100644
index 000000000000..f55332a0ee0e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL_net/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, SDL }:
+
+stdenv.mkDerivation rec {
+  pname = "SDL_net";
+  version = "1.2.8";
+
+  src = fetchurl {
+    url = "http://www.libsdl.org/projects/SDL_net/release/${pname}-${version}.tar.gz";
+    sha256 = "1d5c9xqlf4s1c01gzv6cxmg0r621pq9kfgxcg3197xw4p25pljjz";
+  };
+
+  configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest";
+
+  propagatedBuildInputs = [ SDL ];
+
+  meta = with lib; {
+    description = "SDL networking library";
+    platforms = platforms.unix;
+    license = licenses.zlib;
+    homepage = "https://www.libsdl.org/projects/SDL_net/release-1.2.html";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/SDL_sixel/default.nix b/nixpkgs/pkgs/development/libraries/SDL_sixel/default.nix
new file mode 100644
index 000000000000..1bc4c8ba35c0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL_sixel/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, libsixel }:
+
+stdenv.mkDerivation {
+  pname = "SDL_sixel";
+  version = "1.2-nightly";
+
+  src = fetchFromGitHub {
+    owner = "saitoha";
+    repo = "SDL1.2-SIXEL";
+    rev = "ab3fccac6e34260a617be511bd8c2b2beae41952";
+    sha256 = "0gm2vngdac17lzw9azkhzazmfq3byjddms14gqjk18vnynfqp5wp";
+  };
+
+  configureFlags = [ "--enable-video-sixel" ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libsixel ];
+
+  meta = with lib; {
+    description = "A cross-platform multimedia library, that supports sixel graphics on consoles";
+    homepage    = "https://github.com/saitoha/SDL1.2-SIXEL";
+    maintainers = with maintainers; [ vrthra ];
+    platforms   = platforms.linux;
+    license     = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/SDL_sound/default.nix b/nixpkgs/pkgs/development/libraries/SDL_sound/default.nix
new file mode 100644
index 000000000000..bdc97e98f341
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL_sound/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, lib, fetchurl, SDL, libvorbis, flac, libmikmod }:
+
+stdenv.mkDerivation rec {
+  pname = "SDL_sound";
+  version = "1.0.3";
+
+  src = fetchurl {
+    url = "https://icculus.org/SDL_sound/downloads/${pname}-${version}.tar.gz";
+    sha256 = "1pz6g56gcy7pmmz3hhych3iq9jvinml2yjz15fjqjlj8pc5zv69r";
+  };
+
+  buildInputs = [ SDL libvorbis flac libmikmod ];
+
+  configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest";
+
+  meta = with lib; {
+    description = "SDL sound library";
+    platforms = platforms.unix;
+    license = licenses.lgpl21;
+    homepage = "https://www.icculus.org/SDL_sound/";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/SDL_stretch/default.nix b/nixpkgs/pkgs/development/libraries/SDL_stretch/default.nix
new file mode 100644
index 000000000000..e6318b84859e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL_stretch/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl, SDL }:
+
+stdenv.mkDerivation rec {
+  pname = "SDL_stretch";
+  version = "0.3.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/sdl-stretch/${version}/${pname}-${version}.tar.bz2";
+    sha256 = "1mzw68sn4yxbp8429jg2h23h8xw2qjid51z1f5pdsghcn3x0pgvw";
+  };
+
+  buildInputs = [ SDL ];
+
+  meta = with lib; {
+     description = "Stretch Functions For SDL";
+     homepage = "http://sdl-stretch.sourceforge.net/";
+     license = licenses.lgpl2;
+     platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/SDL_ttf/default.nix b/nixpkgs/pkgs/development/libraries/SDL_ttf/default.nix
new file mode 100644
index 000000000000..5d353e3a6c0d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/SDL_ttf/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, fetchpatch, SDL, freetype }:
+
+stdenv.mkDerivation rec {
+  pname = "SDL_ttf";
+  version = "2.0.11";
+
+  src = fetchurl {
+    url = "https://www.libsdl.org/projects/SDL_ttf/release/${pname}-${version}.tar.gz";
+    sha256 = "1dydxd4f5kb1288i5n5568kdk2q7f8mqjr7i7sd33nplxjaxhk3j";
+  };
+
+  patches = [
+    # Bug #830: TTF_RenderGlyph_Shaded is broken
+    (fetchpatch {
+      url = "https://bugzilla-attachments.libsdl.org/attachment.cgi?id=830";
+      sha256 = "0cfznfzg1hs10wl349z9n8chw80i5adl3iwhq4y102g0xrjyb72d";
+    })
+  ];
+
+  patchFlags = [ "-p0" ];
+
+  buildInputs = [ SDL freetype ];
+
+  configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest";
+
+  meta = with lib; {
+    description = "SDL TrueType library";
+    license = licenses.zlib;
+    platforms = platforms.all;
+    homepage = "https://www.libsdl.org/projects/SDL_ttf/release-1.2.html";
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/Xaw3d/default.nix b/nixpkgs/pkgs/development/libraries/Xaw3d/default.nix
new file mode 100644
index 000000000000..88501ca1ee60
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/Xaw3d/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl
+, imake, gccmakedep, bison, flex, pkg-config
+, xlibsWrapper, libXmu, libXpm, libXp }:
+
+stdenv.mkDerivation {
+  name = "Xaw3d-1.6.3";
+  src = fetchurl {
+    url = "https://www.x.org/releases/individual/lib/libXaw3d-1.6.3.tar.bz2";
+    sha256 = "0i653s8g25cc0mimkwid9366bqkbyhdyjhckx7bw77j20hzrkfid";
+  };
+  dontUseImakeConfigure = true;
+  nativeBuildInputs = [ pkg-config bison flex imake gccmakedep ];
+  buildInputs = [ libXpm libXp ];
+  propagatedBuildInputs = [ xlibsWrapper libXmu ];
+
+  meta = with lib; {
+    description = "3D widget set based on the Athena Widget set";
+    platforms = lib.platforms.unix;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/a52dec/default.nix b/nixpkgs/pkgs/development/libraries/a52dec/default.nix
new file mode 100644
index 000000000000..1322ec10eb17
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/a52dec/default.nix
@@ -0,0 +1,32 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "a52dec";
+  version = "0.7.4";
+
+  src = fetchurl {
+    url = "https://liba52.sourceforge.net/files/${pname}-${version}.tar.gz";
+    sha256 = "oh1ySrOzkzMwGUNTaH34LEdbXfuZdRPu9MJd5shl7DM=";
+  };
+
+  configureFlags = [
+    "--enable-shared"
+  ];
+
+  makeFlags = [
+    "AR=${stdenv.cc.targetPrefix}ar"
+  ];
+
+  # fails 1 out of 1 tests with "BAD GLOBAL SYMBOLS" on i686
+  # which can also be fixed with
+  # hardeningDisable = lib.optional stdenv.isi686 "pic";
+  # but it's better to disable tests than loose ASLR on i686
+  doCheck = !stdenv.isi686;
+
+  meta = with lib; {
+    description = "ATSC A/52 stream decoder";
+    homepage = "https://liba52.sourceforge.io/";
+    platforms = platforms.unix;
+    license = licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/aalib/darwin.patch b/nixpkgs/pkgs/development/libraries/aalib/darwin.patch
new file mode 100644
index 000000000000..44559d06210c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aalib/darwin.patch
@@ -0,0 +1,106 @@
+diff --git a/src/aaedit.c b/src/aaedit.c
+index 09534d2..2ea52f9 100644
+--- a/src/aaedit.c
++++ b/src/aaedit.c
+@@ -1,6 +1,6 @@
+ #include <string.h>
+ #include <ctype.h>
+-#include <malloc.h>
++#include <stdlib.h>
+ #include "aalib.h"
+ #include "aaint.h"
+ static void aa_editdisplay(struct aa_edit *e)
+ 
+diff --git a/src/aakbdreg.c b/src/aakbdreg.c
+index def65fe..f4f8efb 100644
+--- a/src/aakbdreg.c
++++ b/src/aakbdreg.c
+@@ -1,4 +1,4 @@
+-#include <malloc.h>
++#include <stdlib.h>
+ #include "config.h"
+ #include "aalib.h"
+ #include "aaint.h"
+diff --git a/src/aalib.c b/src/aalib.c
+index 11fecc8..e3063b4 100644
+--- a/src/aalib.c
++++ b/src/aalib.c
+@@ -1,6 +1,6 @@
+ #include <stdio.h>
+ #include <string.h>
+-#include <malloc.h>
++#include <stdlib.h>
+ #include "aalib.h"
+ #include "aaint.h"
+ 
+diff --git a/src/aamoureg.c b/src/aamoureg.c
+index 0380828..bb55fe3 100644
+--- a/src/aamoureg.c
++++ b/src/aamoureg.c
+@@ -1,4 +1,4 @@
+-#include <malloc.h>
++#include <stdlib.h>
+ #include "config.h"
+ #include "aalib.h"
+ #include "aaint.h"
+diff --git a/src/aarec.c b/src/aarec.c
+index 70f4ebc..ee43e8a 100644
+--- a/src/aarec.c
++++ b/src/aarec.c
+@@ -1,5 +1,5 @@
+ #include <string.h>
+-#include <malloc.h>
++#include <stdlib.h>
+ #include "aalib.h"
+ #include "aaint.h"
+ aa_linkedlist *aa_kbdrecommended = NULL, *aa_mouserecommended = NULL,
+diff --git a/src/aaregist.c b/src/aaregist.c
+index 54abec0..765155e 100644
+--- a/src/aaregist.c
++++ b/src/aaregist.c
+@@ -1,4 +1,4 @@
+-#include <malloc.h>
++#include <stdlib.h>
+ #include "config.h"
+ #include "aalib.h"
+ #include "aaint.h"
+diff --git a/src/aax.c b/src/aax.c
+index adcbd82..36e3294 100644
+--- a/src/aax.c
++++ b/src/aax.c
+@@ -1,4 +1,3 @@
+-#include <malloc.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+diff --git a/src/aaxkbd.c b/src/aaxkbd.c
+index 30d5903..da2248d 100644
+--- a/src/aaxkbd.c
++++ b/src/aaxkbd.c
+@@ -1,4 +1,3 @@
+-#include <malloc.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+diff --git a/src/aaxmouse.c b/src/aaxmouse.c
+index 9935b03..7e725ad 100644
+--- a/src/aaxmouse.c
++++ b/src/aaxmouse.c
+@@ -1,4 +1,3 @@
+-#include <malloc.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <stdio.h>
+diff --git a/aalib.m4 b/aalib.m4
+index c40b8db..991fbda 100644
+--- a/aalib.m4
++++ b/aalib.m4
+@@ -9,7 +9,7 @@
+ dnl AM_PATH_AALIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
+ dnl Test for AALIB, and define AALIB_CFLAGS and AALIB_LIBS
+ dnl
+-AC_DEFUN(AM_PATH_AALIB,
++AC_DEFUN([AM_PATH_AALIB],
+ [dnl 
+ dnl Get the cflags and libraries from the aalib-config script
+ dnl
diff --git a/nixpkgs/pkgs/development/libraries/aalib/default.nix b/nixpkgs/pkgs/development/libraries/aalib/default.nix
new file mode 100644
index 000000000000..b007e71ce44d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aalib/default.nix
@@ -0,0 +1,41 @@
+{lib, stdenv, fetchurl, ncurses, automake}:
+
+stdenv.mkDerivation {
+  name = "aalib-1.4rc5";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/aa-project/aalib-1.4rc5.tar.gz";
+    sha256 = "1vkh19gb76agvh4h87ysbrgy82hrw88lnsvhynjf4vng629dmpgv";
+  };
+
+  outputs = [ "bin" "dev" "out" "man" "info" ];
+  setOutputFlags = false; # Doesn't support all the flags
+
+  patches = lib.optionals stdenv.isDarwin [ ./darwin.patch ];
+
+  # The fuloong2f is not supported by aalib still
+  preConfigure = ''
+    cp ${automake}/share/automake*/config.{sub,guess} .
+    configureFlagsArray+=(
+      "--bindir=$bin/bin"
+      "--includedir=$dev/include"
+      "--libdir=$out/lib"
+    )
+  '';
+
+  buildInputs = [ ncurses ];
+
+  configureFlags = [ "--without-x" "--with-ncurses=${ncurses.dev}" ];
+
+  postInstall = ''
+    mkdir -p $dev/bin
+    mv $bin/bin/aalib-config $dev/bin/aalib-config
+    substituteInPlace $out/lib/libaa.la --replace "${ncurses.dev}/lib" "${ncurses.out}/lib"
+  '';
+
+  meta = {
+    description = "ASCII art graphics library";
+    platforms = lib.platforms.unix;
+    license = lib.licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/abseil-cpp/cmake-full-dirs.patch b/nixpkgs/pkgs/development/libraries/abseil-cpp/cmake-full-dirs.patch
new file mode 100644
index 000000000000..c18420711b90
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/abseil-cpp/cmake-full-dirs.patch
@@ -0,0 +1,15 @@
+diff --git a/CMake/AbseilHelpers.cmake b/CMake/AbseilHelpers.cmake
+index 1a80b5b..1fa57a7 100644
+--- a/CMake/AbseilHelpers.cmake
++++ b/CMake/AbseilHelpers.cmake
+@@ -171,8 +171,8 @@ function(absl_cc_library)
+       FILE(GENERATE OUTPUT "${CMAKE_BINARY_DIR}/lib/pkgconfig/absl_${_NAME}.pc" CONTENT "\
+ prefix=${CMAKE_INSTALL_PREFIX}\n\
+ exec_prefix=\${prefix}\n\
+-libdir=\${prefix}/${CMAKE_INSTALL_LIBDIR}\n\
+-includedir=\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}\n\
++libdir=${CMAKE_INSTALL_FULL_LIBDIR}\n\
++includedir=${CMAKE_INSTALL_FULL_INCLUDEDIR}\n\
+ \n\
+ Name: absl_${_NAME}\n\
+ Description: Abseil ${_NAME} library\n\
diff --git a/nixpkgs/pkgs/development/libraries/abseil-cpp/default.nix b/nixpkgs/pkgs/development/libraries/abseil-cpp/default.nix
new file mode 100644
index 000000000000..a1610ce82624
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/abseil-cpp/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, static ? stdenv.hostPlatform.isStatic }:
+
+stdenv.mkDerivation rec {
+  pname = "abseil-cpp";
+  version = "20210324.1";
+
+  src = fetchFromGitHub {
+    owner = "abseil";
+    repo = "abseil-cpp";
+    rev = version;
+    sha256 = "16w63brfwgiayiyhvawsnr14xyy5hpp68k8fj0z6yk0bjzw6jvjw";
+  };
+
+  patches = [
+    # Use CMAKE_INSTALL_FULL_{LIBDIR,INCLUDEDIR}
+    # https://github.com/abseil/abseil-cpp/pull/963
+    (fetchpatch {
+      url = "https://github.com/abseil/abseil-cpp/commit/5bfa70c75e621c5d5ec095c8c4c0c050dcb2957e.patch";
+      sha256 = "0nhjxqfxpi2pkfinnqvd5m4npf9l1kg39mjx9l3087ajhadaywl5";
+    })
+  ];
+
+  cmakeFlags = [
+    "-DCMAKE_CXX_STANDARD=17"
+    "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "An open-source collection of C++ code designed to augment the C++ standard library";
+    homepage = "https://abseil.io/";
+    license = licenses.asl20;
+    platforms = platforms.all;
+    maintainers = [ maintainers.andersk ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/accounts-qt/default.nix b/nixpkgs/pkgs/development/libraries/accounts-qt/default.nix
new file mode 100644
index 000000000000..dcfe4a4ef27b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/accounts-qt/default.nix
@@ -0,0 +1,26 @@
+{ mkDerivation, lib, fetchFromGitLab, doxygen, glib, libaccounts-glib, pkg-config, qmake }:
+
+mkDerivation rec {
+  pname = "accounts-qt";
+  version = "1.16";
+
+  src = fetchFromGitLab {
+    sha256 = "1vmpjvysm0ld8dqnx8msa15hlhrkny02cqycsh4k2azrnijg0xjz";
+    rev = "VERSION_${version}";
+    repo = "libaccounts-qt";
+    owner = "accounts-sso";
+  };
+
+  propagatedBuildInputs = [ glib libaccounts-glib ];
+  nativeBuildInputs = [ doxygen pkg-config qmake ];
+
+  # Hack to avoid TMPDIR in RPATHs.
+  preFixup = ''rm -rf "$(pwd)" '';
+
+  meta = with lib; {
+    description = "Qt library for accessing the online accounts database";
+    homepage = "https://gitlab.com/accounts-sso";
+    license = licenses.lgpl21;
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/accountsservice/Disable-methods-that-change-files-in-etc.patch b/nixpkgs/pkgs/development/libraries/accountsservice/Disable-methods-that-change-files-in-etc.patch
new file mode 100644
index 000000000000..acaccb8c8485
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/accountsservice/Disable-methods-that-change-files-in-etc.patch
@@ -0,0 +1,130 @@
+From 6f172007452b39bfda5062fc29ea5382671ac16e Mon Sep 17 00:00:00 2001
+From: Alexander Ried <ried@mytum.de>
+Date: Thu, 26 May 2016 19:54:21 +0200
+Subject: [PATCH] Disable methods that change files in /etc
+
+Only if environment variable NIXOS_USERS_PURE is set.
+---
+ src/daemon.c | 10 ++++++++++
+ src/user.c   | 35 +++++++++++++++++++++++++++++++++++
+ 2 files changed, 45 insertions(+)
+
+diff --git a/src/daemon.c b/src/daemon.c
+index e62e124..87459b2 100644
+--- a/src/daemon.c
++++ b/src/daemon.c
+@@ -931,6 +931,11 @@ daemon_create_user (AccountsAccounts      *accounts,
+                     const gchar           *real_name,
+                     gint                   account_type)
+ {
++        if (getenv("NIXOS_USERS_PURE")) {
++                throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
++                return;
++        }
++
+         Daemon *daemon = (Daemon*)accounts;
+         CreateUserData *data;
+ 
+@@ -1138,6 +1143,11 @@ daemon_delete_user (AccountsAccounts      *accounts,
+                     gint64                 uid,
+                     gboolean               remove_files)
+ {
++        if (getenv("NIXOS_USERS_PURE")) {
++                throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
++                return;
++        }
++
+         Daemon *daemon = (Daemon*)accounts;
+         DeleteUserData *data;
+ 
+diff --git a/src/user.c b/src/user.c
+index 0fb1a17..dbdebaf 100644
+--- a/src/user.c
++++ b/src/user.c
+@@ -904,6 +904,11 @@ user_set_real_name (AccountsUser          *auser,
+                     GDBusMethodInvocation *context,
+                     const gchar           *real_name)
+ {
++        if (getenv("NIXOS_USERS_PURE")) {
++                throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
++                return;
++        }
++
+         User *user = (User*)auser;
+         int uid;
+         const gchar *action_id;
+@@ -981,6 +986,11 @@ user_set_user_name (AccountsUser          *auser,
+                     GDBusMethodInvocation *context,
+                     const gchar           *user_name)
+ {
++        if (getenv("NIXOS_USERS_PURE")) {
++                throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
++                return;
++        }
++
+         User *user = (User*)auser;
+         daemon_local_check_auth (user->daemon,
+                                  user,
+@@ -1263,6 +1273,11 @@ user_set_home_directory (AccountsUser          *auser,
+                          GDBusMethodInvocation *context,
+                          const gchar           *home_dir)
+ {
++        if (getenv("NIXOS_USERS_PURE")) {
++                throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
++                return;
++        }
++
+         User *user = (User*)auser;
+         daemon_local_check_auth (user->daemon,
+                                  user,
+@@ -1322,6 +1337,11 @@ user_set_shell (AccountsUser          *auser,
+                 GDBusMethodInvocation *context,
+                 const gchar           *shell)
+ {
++        if (getenv("NIXOS_USERS_PURE")) {
++                throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
++                return;
++        }
++
+         User *user = (User*)auser;
+         daemon_local_check_auth (user->daemon,
+                                  user,
+@@ -1602,6 +1622,11 @@ user_set_locked (AccountsUser          *auser,
+                  GDBusMethodInvocation *context,
+                  gboolean               locked)
+ {
++        if (getenv("NIXOS_USERS_PURE")) {
++                throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
++                return;
++        }
++
+         User *user = (User*)auser;
+         daemon_local_check_auth (user->daemon,
+                                  user,
+@@ -1814,6 +1839,11 @@ user_set_password_mode (AccountsUser          *auser,
+                         GDBusMethodInvocation *context,
+                         gint                   mode)
+ {
++        if (getenv("NIXOS_USERS_PURE")) {
++                throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
++                return;
++        }
++
+         User *user = (User*)auser;
+         const gchar *action_id;
+ 
+@@ -1905,6 +1935,11 @@ user_set_password (AccountsUser          *auser,
+                    const gchar           *password,
+                    const gchar           *hint)
+ {
++        if (getenv("NIXOS_USERS_PURE")) {
++                throw_error (context, ERROR_NOT_SUPPORTED, "Modifying users not supported without users.mutableUsers");
++                return;
++        }
++
+         User *user = (User*)auser;
+         gchar **data;
+ 
+-- 
+2.9.3
+
diff --git a/nixpkgs/pkgs/development/libraries/accountsservice/default.nix b/nixpkgs/pkgs/development/libraries/accountsservice/default.nix
new file mode 100644
index 000000000000..f87a0bbe68ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/accountsservice/default.nix
@@ -0,0 +1,94 @@
+{ lib, stdenv
+, fetchurl
+, fetchpatch
+, substituteAll
+, pkg-config
+, glib
+, shadow
+, gobject-introspection
+, polkit
+, systemd
+, coreutils
+, meson
+, dbus
+, ninja
+, python3
+, gettext
+}:
+
+stdenv.mkDerivation rec {
+  pname = "accountsservice";
+  version = "0.6.55";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "https://www.freedesktop.org/software/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "16wwd633jak9ajyr1f1h047rmd09fhf3kzjz6g5xjsz0lwcj8azz";
+  };
+
+  nativeBuildInputs = [
+    dbus
+    gettext
+    gobject-introspection
+    meson
+    ninja
+    pkg-config
+    python3
+  ];
+
+  buildInputs = [
+    glib
+    polkit
+  ];
+
+  mesonFlags = [
+    "-Dadmin_group=wheel"
+    "-Dlocalstatedir=/var"
+    "-Dsystemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
+  ];
+
+  postPatch = ''
+    chmod +x meson_post_install.py
+    patchShebangs meson_post_install.py
+  '';
+
+  patches = [
+    # https://gitlab.freedesktop.org/accountsservice/accountsservice/-/issues/55
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/accountsservice/accountsservice/-/merge_requests/58.patch";
+      sha256 = "1pnwq4ycnryb2kkgvnz44qzm71240ybqj6507wynlkdsw8180fdw";
+    })
+    (substituteAll {
+      src = ./fix-paths.patch;
+      inherit shadow coreutils;
+    })
+    ./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 {
+      url = "https://gitlab.freedesktop.org/accountsservice/accountsservice/commit/152b845bbd3ca2a64516691493a160825f1a2046.patch";
+      sha256 = "114wrf5mwj5bgc5v1g05md4ridcnwdrwppr3bjz96sknwh5hk8s5";
+    })
+    (fetchpatch {
+      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 lib; {
+    description = "D-Bus interface for user account query and manipulation";
+    homepage = "https://www.freedesktop.org/wiki/Software/AccountsService";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ pSub ];
+    platforms = with platforms; linux;
+  };
+}
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/accountsservice/fix-paths.patch b/nixpkgs/pkgs/development/libraries/accountsservice/fix-paths.patch
new file mode 100644
index 000000000000..0bf6ee3d91a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/accountsservice/fix-paths.patch
@@ -0,0 +1,125 @@
+diff --git a/src/daemon.c b/src/daemon.c
+index c52bda3..75d214e 100644
+--- a/src/daemon.c
++++ b/src/daemon.c
+@@ -1106,7 +1106,7 @@ daemon_create_user_authorized_cb (Daemon                *daemon,
+ 
+         sys_log (context, "create user '%s'", cd->user_name);
+ 
+-        argv[0] = "/usr/sbin/useradd";
++        argv[0] = "@shadow@/bin/useradd";
+         argv[1] = "-m";
+         argv[2] = "-c";
+         argv[3] = cd->real_name;
+@@ -1318,7 +1318,7 @@ daemon_delete_user_authorized_cb (Daemon                *daemon,
+ 
+         user_set_saved (user, FALSE);
+ 
+-        argv[0] = "/usr/sbin/userdel";
++        argv[0] = "@shadow@/bin/userdel";
+         if (ud->remove_files) {
+                 argv[1] = "-f";
+                 argv[2] = "-r";
+diff --git a/src/user.c b/src/user.c
+index 9f57af5..e65289d 100644
+--- a/src/user.c
++++ b/src/user.c
+@@ -844,7 +844,7 @@ user_change_real_name_authorized_cb (Daemon                *daemon,
+                          accounts_user_get_uid (ACCOUNTS_USER (user)),
+                          name);
+ 
+-                argv[0] = "/usr/sbin/usermod";
++                argv[0] = "@shadown@/bin/usermod";
+                 argv[1] = "-c";
+                 argv[2] = name;
+                 argv[3] = "--";
+@@ -913,7 +913,7 @@ user_change_user_name_authorized_cb (Daemon                *daemon,
+                          accounts_user_get_uid (ACCOUNTS_USER (user)),
+                          name);
+ 
+-                argv[0] = "/usr/sbin/usermod";
++                argv[0] = "@shadow@/bin/usermod";
+                 argv[1] = "-l";
+                 argv[2] = name;
+                 argv[3] = "--";
+@@ -1321,7 +1321,7 @@ user_change_home_dir_authorized_cb (Daemon                *daemon,
+                          accounts_user_get_uid (ACCOUNTS_USER (user)),
+                          home_dir);
+ 
+-                argv[0] = "/usr/sbin/usermod";
++                argv[0] = "@shadow@/bin/usermod";
+                 argv[1] = "-m";
+                 argv[2] = "-d";
+                 argv[3] = home_dir;
+@@ -1378,7 +1378,7 @@ user_change_shell_authorized_cb (Daemon                *daemon,
+                          accounts_user_get_uid (ACCOUNTS_USER (user)),
+                          shell);
+ 
+-                argv[0] = "/usr/sbin/usermod";
++                argv[0] = "@shadow@/bin/usermod";
+                 argv[1] = "-s";
+                 argv[2] = shell;
+                 argv[3] = "--";
+@@ -1520,7 +1520,7 @@ user_change_icon_file_authorized_cb (Daemon                *daemon,
+                         return;
+                 }
+ 
+-                argv[0] = "/bin/cat";
++                argv[0] = "@coreutils@/bin/cat";
+                 argv[1] = filename;
+                 argv[2] = NULL;
+ 
+@@ -1601,7 +1601,7 @@ user_change_locked_authorized_cb (Daemon                *daemon,
+                          locked ? "locking" : "unlocking",
+                          accounts_user_get_user_name (ACCOUNTS_USER (user)),
+                          accounts_user_get_uid (ACCOUNTS_USER (user)));
+-                argv[0] = "/usr/sbin/usermod";
++                argv[0] = "@shadow@/bin/usermod";
+                 argv[1] = locked ? "-L" : "-U";
+                 argv[2] = "--";
+                 argv[3] = accounts_user_get_user_name (ACCOUNTS_USER (user));
+@@ -1726,7 +1726,7 @@ user_change_account_type_authorized_cb (Daemon                *daemon,
+ 
+                 g_free (groups);
+ 
+-                argv[0] = "/usr/sbin/usermod";
++                argv[0] = "@shadow@/bin/usermod";
+                 argv[1] = "-G";
+                 argv[2] = str->str;
+                 argv[3] = "--";
+@@ -1794,7 +1794,7 @@ user_change_password_mode_authorized_cb (Daemon                *daemon,
+                 if (mode == PASSWORD_MODE_SET_AT_LOGIN ||
+                     mode == PASSWORD_MODE_NONE) {
+ 
+-                        argv[0] = "/usr/bin/passwd";
++                        argv[0] = "/run/wrappers/bin/passwd";
+                         argv[1] = "-d";
+                         argv[2] = "--";
+                         argv[3] = accounts_user_get_user_name (ACCOUNTS_USER (user));
+@@ -1806,7 +1806,7 @@ user_change_password_mode_authorized_cb (Daemon                *daemon,
+                         }
+ 
+                         if (mode == PASSWORD_MODE_SET_AT_LOGIN) {
+-                                argv[0] = "/usr/bin/chage";
++                                argv[0] = "@shadow@/bin/chage";
+                                 argv[1] = "-d";
+                                 argv[2] = "0";
+                                 argv[3] = "--";
+@@ -1827,7 +1827,7 @@ user_change_password_mode_authorized_cb (Daemon                *daemon,
+                         accounts_user_set_locked (ACCOUNTS_USER (user), FALSE);
+                 }
+                 else if (accounts_user_get_locked (ACCOUNTS_USER (user))) {
+-                        argv[0] = "/usr/sbin/usermod";
++                        argv[0] = "@shadow@/bin/usermod";
+                         argv[1] = "-U";
+                         argv[2] = "--";
+                         argv[3] = accounts_user_get_user_name (ACCOUNTS_USER (user));
+@@ -1905,7 +1905,7 @@ user_change_password_authorized_cb (Daemon                *daemon,
+ 
+         g_object_freeze_notify (G_OBJECT (user));
+ 
+-        argv[0] = "/usr/sbin/usermod";
++        argv[0] = "@shadow@/bin/usermod";
+         argv[1] = "-p";
+         argv[2] = strings[0];
+         argv[3] = "--";
diff --git a/nixpkgs/pkgs/development/libraries/accountsservice/no-create-dirs.patch b/nixpkgs/pkgs/development/libraries/accountsservice/no-create-dirs.patch
new file mode 100644
index 000000000000..0333f925d267
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/accountsservice/no-create-dirs.patch
@@ -0,0 +1,15 @@
+diff --git a/meson_post_install.py b/meson_post_install.py
+index 5cc2dc4..dd27ad5 100644
+--- a/meson_post_install.py
++++ b/meson_post_install.py
+@@ -9,8 +9,8 @@ localstatedir = os.path.normpath(destdir + os.sep + sys.argv[1])
+ # FIXME: meson will not track the creation of these directories
+ #        https://github.com/mesonbuild/meson/blob/master/mesonbuild/scripts/uninstall.py#L39
+ dst_dirs = [
+-  (os.path.join(localstatedir, 'lib', 'AccountsService', 'icons'), 0o775),
+-  (os.path.join(localstatedir, 'lib', 'AccountsService', 'users'), 0o700),
++#  (os.path.join(localstatedir, 'lib', 'AccountsService', 'icons'), 0o775),
++#  (os.path.join(localstatedir, 'lib', 'AccountsService', 'users'), 0o700),
+ ]
+ 
+ for (dst_dir, dst_dir_mode) in dst_dirs:
diff --git a/nixpkgs/pkgs/development/libraries/ace/default.nix b/nixpkgs/pkgs/development/libraries/ace/default.nix
new file mode 100644
index 000000000000..35f78d4afeb4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ace/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, pkg-config, libtool, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "ace";
+  version = "7.0.3";
+
+  src = fetchurl {
+    url = "https://download.dre.vanderbilt.edu/previous_versions/ACE-${version}.tar.bz2";
+    sha256 = "sha256-aKSxKYJ2OmxCDHwBrfUMenT9LYzFYH5P3R8q/QhkM+c=";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ pkg-config libtool ];
+  buildInputs = [ perl ];
+
+  NIX_CFLAGS_COMPILE = [
+    "-Wno-error=format-security"
+  ];
+
+  postPatch = ''
+    patchShebangs ./MPC/prj_install.pl
+  '';
+
+  preConfigure = ''
+    export INSTALL_PREFIX=$out
+    export ACE_ROOT=$(pwd)
+    export LD_LIBRARY_PATH="$ACE_ROOT/ace:$ACE_ROOT/lib"
+    echo '#include "ace/config-linux.h"' > ace/config.h
+    echo 'include $(ACE_ROOT)/include/makeinclude/platform_linux.GNU'\
+    > include/makeinclude/platform_macros.GNU
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.dre.vanderbilt.edu/~schmidt/ACE.html";
+    description = "ADAPTIVE Communication Environment";
+    license = licenses.doc;
+    maintainers = with maintainers; [ nico202 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/acl/default.nix b/nixpkgs/pkgs/development/libraries/acl/default.nix
new file mode 100644
index 000000000000..936e793cafef
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/acl/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, gettext, attr }:
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+stdenv.mkDerivation rec {
+  name = "acl-2.3.1";
+
+  src = fetchurl {
+    url = "mirror://savannah/acl/${name}.tar.gz";
+    sha256 = "sha256-dgxhxokBs3/dXu/ur0wMeia9/disdHoe3/HODiQ8Ea8=";
+  };
+
+  outputs = [ "bin" "dev" "out" "man" "doc" ];
+
+  nativeBuildInputs = [ gettext ];
+  buildInputs = [ attr ];
+
+  # Upstream use C++-style comments in C code. Remove them.
+  # This comment breaks compilation if too strict gcc flags are used.
+  patchPhase = ''
+    echo "Removing C++-style comments from include/acl.h"
+    sed -e '/^\/\//d' -i include/acl.h
+
+    patchShebangs .
+  '';
+
+  meta = with lib; {
+    homepage = "https://savannah.nongnu.org/projects/acl";
+    description = "Library and tools for manipulating access control lists";
+    platforms = platforms.linux;
+    license = licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ada/gnatcoll/bindings.nix b/nixpkgs/pkgs/development/libraries/ada/gnatcoll/bindings.nix
new file mode 100644
index 000000000000..666989af0acc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ada/gnatcoll/bindings.nix
@@ -0,0 +1,88 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, gnat
+, gprbuild
+, gnatcoll-core
+, component
+# component dependencies
+, gmp
+, libiconv
+, xz
+, gcc-unwrapped
+, readline
+, zlib
+, python3
+, ncurses
+}:
+
+let
+  # omit python (2.7), no need to introduce a
+  # dependency on an EOL package for no reason
+  libsFor = {
+    iconv = [ libiconv ];
+    gmp = [ gmp ];
+    lzma = [ xz ];
+    readline = [ readline ];
+    python3 = [ python3 ncurses ];
+    syslog = [ ];
+    zlib = [ zlib ];
+  };
+in
+
+
+stdenv.mkDerivation rec {
+  pname = "gnatcoll-${component}";
+  version = "21.0.0";
+
+  src = fetchFromGitHub {
+    owner = "AdaCore";
+    repo = "gnatcoll-bindings";
+    rev = "v${version}";
+    sha256 = "1214hf0m8iz289rjpxdiddnixj65l2xjwbcr7mq5ysbddmig5992";
+  };
+
+  patches = [
+    ./omp-setup-text-mode.patch
+  ];
+
+  nativeBuildInputs = [
+    gprbuild
+    gnat
+    python3
+  ];
+
+  # propagate since gprbuild needs to find referenced .gpr files
+  # and all dependency C libraries when statically linking a
+  # downstream executable.
+  propagatedBuildInputs = [
+    gnatcoll-core
+  ] ++ libsFor."${component}" or [];
+
+  # explicit flag for GPL acceptance because upstreams
+  # allows a gcc runtime exception for all bindings
+  # except for readline (since it is GPL w/o exceptions)
+  buildFlags = lib.optionals (component == "readline") [
+    "--accept-gpl"
+  ];
+
+  buildPhase = ''
+    runHook preBuild
+    python3 ${component}/setup.py build $buildFlags
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    python3 ${component}/setup.py install --prefix $out
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "GNAT Components Collection - Bindings to C libraries";
+    homepage = "https://github.com/AdaCore/gnatcoll-bindings";
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ada/gnatcoll/core.nix b/nixpkgs/pkgs/development/libraries/ada/gnatcoll/core.nix
new file mode 100644
index 000000000000..f5f84342137e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ada/gnatcoll/core.nix
@@ -0,0 +1,47 @@
+{ stdenv
+, lib
+, gnat
+, gprbuild
+, fetchFromGitHub
+, xmlada
+, which
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gnatcoll-core";
+  version = "21.0.0";
+
+  src = fetchFromGitHub {
+    owner = "AdaCore";
+    repo = "gnatcoll-core";
+    rev = "v${version}";
+    sha256 = "0jgs2299zfbr6jg5bxlhqizi60si2m8vw7zq6ns4yhr38qqdskqg";
+  };
+
+  nativeBuildInputs = [
+    gprbuild
+    which
+    gnat
+  ];
+
+  # propagate since gprbuild needs to find
+  # referenced GPR project definitions
+  propagatedBuildInputs = [
+    gprbuild # libgpr
+  ];
+
+  makeFlags = [
+    "prefix=${placeholder "out"}"
+    "PROCESSORS=$(NIX_BUILD_CORES)"
+    # confusingly, for gprbuild --target is autoconf --host
+    "TARGET=${stdenv.hostPlatform.config}"
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/AdaCore/gnatcoll-core";
+    description = "GNAT Components Collection - Core packages";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.sternenseemann ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ada/gnatcoll/db.nix b/nixpkgs/pkgs/development/libraries/ada/gnatcoll/db.nix
new file mode 100644
index 000000000000..d0512507db24
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ada/gnatcoll/db.nix
@@ -0,0 +1,110 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, gnat
+, gprbuild
+, which
+, gnatcoll-core
+, xmlada
+, component
+# components built by this derivation other components depend on
+, gnatcoll-sql
+, gnatcoll-sqlite
+, gnatcoll-xref
+# component specific extra dependencies
+, gnatcoll-iconv
+, gnatcoll-readline
+, sqlite
+, postgresql
+}:
+
+let
+  libsFor = {
+    gnatcoll_db2ada = [
+      gnatcoll-sql
+    ];
+    gnatinspect = [
+      gnatcoll-sqlite
+      gnatcoll-readline
+      gnatcoll-xref
+    ];
+    postgres = [
+      gnatcoll-sql
+      postgresql
+    ];
+    sqlite = [
+      gnatcoll-sql
+      sqlite
+    ];
+    xref = [
+      gnatcoll-iconv
+      gnatcoll-sqlite
+    ];
+  };
+
+  # These components are just tools and don't install a library
+  onlyExecutable = builtins.elem component [
+    "gnatcoll_db2ada"
+    "gnatinspect"
+  ];
+in
+
+stdenv.mkDerivation rec {
+  pname = "gnatcoll-${component}";
+  version = "21.0.0";
+
+  src = fetchFromGitHub {
+    owner = "AdaCore";
+    repo = "gnatcoll-db";
+    rev = "v${version}";
+    sha256 = "0fdfng3yfy645nlw8l3c2za0zkn6pdhkvyrw20wnjx4k26glgb6r";
+  };
+
+  patches = lib.optionals (component == "sqlite") [
+    # fixes build of the static sqlite component
+    # when building against the system libsqlite3
+    # See https://github.com/AdaCore/gprbuild/issues/27#issuecomment-298444608
+    ./gnatcoll-db-sqlite-static-external.patch
+  ];
+
+  # Link executables dynamically unless specified by the platform,
+  # as we usually do in nixpkgs where possible
+  postPatch = lib.optionalString (!stdenv.hostPlatform.isStatic) ''
+    for f in gnatcoll_db2ada/Makefile gnatinspect/Makefile; do
+      substituteInPlace "$f" --replace "=static" "=relocatable"
+    done
+  '';
+
+  nativeBuildInputs = [
+    gnat
+    gprbuild
+    which
+  ];
+
+  # Propagate since GPRbuild needs to find referenced .gpr files
+  # and other libraries to link against when static linking is used.
+  # For executables this is of course not relevant and we can reduce
+  # the closure size dramatically
+  ${if onlyExecutable then "buildInputs" else "propagatedBuildInputs"} = [
+    gnatcoll-core
+  ] ++ libsFor."${component}" or [];
+
+  makeFlags = [
+    "-C" component
+    "PROCESSORS=$(NIX_BUILD_CORES)"
+    # confusingly, for gprbuild --target is autoconf --host
+    "TARGET=${stdenv.hostPlatform.config}"
+    "prefix=${placeholder "out"}"
+  ] ++ lib.optional (component == "sqlite") [
+    # link against packaged, not vendored libsqlite3
+    "GNATCOLL_SQLITE=external"
+  ];
+
+  meta = with lib; {
+    description = "GNAT Components Collection - Database packages";
+    homepage = "https://github.com/AdaCore/gnatcoll-db";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.sternenseemann ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ada/gnatcoll/gnatcoll-db-sqlite-static-external.patch b/nixpkgs/pkgs/development/libraries/ada/gnatcoll/gnatcoll-db-sqlite-static-external.patch
new file mode 100644
index 000000000000..f67837d7d516
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ada/gnatcoll/gnatcoll-db-sqlite-static-external.patch
@@ -0,0 +1,18 @@
+diff --git a/sqlite/gnatcoll_sqlite.gpr b/sqlite/gnatcoll_sqlite.gpr
+index 5bd53d35..580739f8 100644
+--- a/sqlite/gnatcoll_sqlite.gpr
++++ b/sqlite/gnatcoll_sqlite.gpr
+@@ -69,7 +69,12 @@ project GnatColl_Sqlite is
+          for Source_Dirs use (".", "amalgamation");
+       when "external" =>
+          for Source_Dirs use (".");
+-         for Library_Options use ("-lsqlite3") & Thread_Lib;
++         case Library_Type is
++            when "relocatable" =>
++               for Library_Options use ("-lsqlite3") & Thread_Lib;
++            when others =>
++               null;
++         end case;
+    end case;
+ 
+    package Compiler is
diff --git a/nixpkgs/pkgs/development/libraries/ada/gnatcoll/omp-setup-text-mode.patch b/nixpkgs/pkgs/development/libraries/ada/gnatcoll/omp-setup-text-mode.patch
new file mode 100644
index 000000000000..07953809bb20
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ada/gnatcoll/omp-setup-text-mode.patch
@@ -0,0 +1,23 @@
+commit 37c815ee660d1bf37256638d23b0346ad7cc19e7
+Author: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>
+Date:   Wed Jul 21 00:18:30 2021 +0200
+
+    omp/setup.py: open version_information in text mode
+    
+    Otherwise saving the config in setup_support.py will fail as a bytes
+    object is not encodeable as JSON. Luckily, version_information is text
+    anyways.
+
+diff --git a/omp/setup.py b/omp/setup.py
+index 942ab1f5..5281398e 100755
+--- a/omp/setup.py
++++ b/omp/setup.py
+@@ -25,7 +25,7 @@ class GNATCollOMP(SetupApp):
+ 
+         # Set library version
+         with open(os.path.join(config.source_dir, '..',
+-                               'version_information'), 'rb') as fd:
++                               'version_information'), 'r') as fd:
+             version = fd.read().strip()
+         config.set_data('GNATCOLL_VERSION', version, sub='gprbuild')
+ 
diff --git a/nixpkgs/pkgs/development/libraries/ada/xmlada/default.nix b/nixpkgs/pkgs/development/libraries/ada/xmlada/default.nix
new file mode 100644
index 000000000000..b855166d5590
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ada/xmlada/default.nix
@@ -0,0 +1,35 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, gnat
+# use gprbuild-boot since gprbuild proper depends
+# on this xmlada derivation.
+, gprbuild-boot
+}:
+
+stdenv.mkDerivation rec {
+  pname = "xmlada";
+  version = "21.0.0";
+
+  src = fetchFromGitHub {
+    name = "xmlada-${version}-src";
+    owner = "AdaCore";
+    repo = "xmlada";
+    rev = "v${version}";
+    sha256 = "00vljkvck951nj853v9sda5qbfm1mp8y2k61ja2595rmp8qcrazw";
+  };
+
+  nativeBuildInputs = [
+    gnat
+    gprbuild-boot
+  ];
+
+  meta = with lib; {
+    description = "XML/Ada: An XML parser for Ada";
+    homepage = "https://github.com/AdaCore/xmlada";
+    maintainers = [ maintainers.sternenseemann ];
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/adns/default.nix b/nixpkgs/pkgs/development/libraries/adns/default.nix
new file mode 100644
index 000000000000..db5284e91278
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/adns/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, lib, fetchurl, gnum4 }:
+
+stdenv.mkDerivation rec {
+  pname = "adns";
+  version = "1.6.0";
+
+  src = fetchurl {
+    urls = [
+      "https://www.chiark.greenend.org.uk/~ian/adns/ftp/adns-${version}.tar.gz"
+      "ftp://ftp.chiark.greenend.org.uk/users/ian/adns/adns-${version}.tar.gz"
+      "mirror://gnu/adns/adns-${version}.tar.gz"
+    ];
+    sha256 = "1pi0xl07pav4zm2jrbrfpv43s1r1q1y12awgak8k7q41m5jp4hpv";
+  };
+
+  nativeBuildInputs = [ gnum4 ];
+
+  preConfigure =
+    lib.optionalString stdenv.isDarwin "sed -i -e 's|-Wl,-soname=$(SHLIBSONAME)||' configure";
+
+  # https://www.mail-archive.com/nix-dev@cs.uu.nl/msg01347.html for details.
+  doCheck = false;
+
+  postInstall = let suffix = lib.versions.majorMinor version;
+  in lib.optionalString stdenv.isDarwin ''
+    install_name_tool -id $out/lib/libadns.so.${suffix} $out/lib/libadns.so.${suffix}
+  '';
+
+  # darwin executables fail, but I don't want to fail the 100-500 packages depending on this lib
+  doInstallCheck = !stdenv.isDarwin;
+  installCheckPhase = ''
+    set -eo pipefail
+
+    for prog in $out/bin/*; do
+      $prog --help > /dev/null && echo $(basename $prog) shows usage
+    done
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.chiark.greenend.org.uk/~ian/adns/";
+    description = "Asynchronous DNS Resolver Library";
+    license = licenses.lgpl2;
+
+    platforms = platforms.unix;
+    maintainers = [ maintainers.peti ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/adslib/default.nix b/nixpkgs/pkgs/development/libraries/adslib/default.nix
new file mode 100644
index 000000000000..49b54960b7e6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/adslib/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "adslib";
+  version = "unstable-2020-08-28";
+
+  src = fetchFromGitHub {
+    owner = "stlehmann";
+    repo = "ADS";
+    rev = "c457b60d61d73325837ca50be2cc997c4792d481";
+    sha256 = "11r86xa8fr4z957hd0abn8x7182nz30a198d02y7gzpbhpi3z43k";
+  };
+
+  installPhase = ''
+    mkdir -p $out/lib
+    cp adslib.so $out/lib/adslib.so
+  '';
+
+  meta = with lib; {
+    description = "Beckhoff protocol to communicate with TwinCAT devices";
+    homepage = "https://github.com/stlehmann/ADS";
+    license = licenses.mit;
+    maintainers = with maintainers; [ jamiemagee ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/afflib/default.nix b/nixpkgs/pkgs/development/libraries/afflib/default.nix
new file mode 100644
index 000000000000..cb0c8025ddfa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/afflib/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, zlib, curl, expat, fuse, openssl
+, autoreconfHook, python3, libiconv
+}:
+
+stdenv.mkDerivation rec {
+  version = "3.7.19";
+  pname = "afflib";
+
+  src = fetchFromGitHub {
+    owner = "sshock";
+    repo = "AFFLIBv3";
+    rev = "v${version}";
+    sha256 = "1qs843yi33yqbp0scqirn753lxzg762rz6xy2h3f8f77fijqj2qb";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ zlib curl expat openssl python3 ]
+    ++ lib.optionals (with stdenv; isLinux || isDarwin) [ fuse ]
+    ++ lib.optionals stdenv.isDarwin [ libiconv ];
+
+  meta = {
+    homepage = "http://afflib.sourceforge.net/";
+    description = "Advanced forensic format library";
+    platforms = lib.platforms.unix;
+    license = lib.licenses.bsdOriginal;
+    maintainers = [ lib.maintainers.raskin ];
+    downloadPage = "https://github.com/sshock/AFFLIBv3/tags";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/aften/default.nix b/nixpkgs/pkgs/development/libraries/aften/default.nix
new file mode 100644
index 000000000000..488c5b6e729a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aften/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "aften";
+  version = "0.0.8";
+  src = fetchurl {
+    url = "mirror://sourceforge/aften/${pname}-${version}.tar.bz2";
+    sha256 = "02hc5x9vkgng1v9bzvza9985ifrjd7fjr7nlpvazp4mv6dr89k47";
+  };
+
+  patches = [
+    # Add fallback for missing SIMD functions on ARM
+    # Source https://github.com/Homebrew/homebrew-core/blob/cad412c7fb4b64925f821fcc9ac5f16a2c40f32d/Formula/aften.rb
+    ./simd-fallback.patch
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [ "-DSHARED=ON" ];
+
+  meta = with lib; {
+    description = "An audio encoder which generates compressed audio streams based on ATSC A/52 specification";
+    homepage = "http://aften.sourceforge.net/";
+    license = licenses.lgpl21Only;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ angustrau ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/aften/simd-fallback.patch b/nixpkgs/pkgs/development/libraries/aften/simd-fallback.patch
new file mode 100644
index 000000000000..cdc961a7f5df
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aften/simd-fallback.patch
@@ -0,0 +1,25 @@
+From dca9c03930d669233258c114e914a01f7c0aeb05 Mon Sep 17 00:00:00 2001
+From: jbr79 <jbr79@ef0d8562-5c19-0410-972e-841db63a069c>
+Date: Wed, 24 Sep 2008 22:02:59 +0000
+Subject: [PATCH] add fallback function for apply_simd_restrictions() on
+ non-x86/ppc
+
+git-svn-id: https://aften.svn.sourceforge.net/svnroot/aften@766 ef0d8562-5c19-0410-972e-841db63a069c
+---
+ libaften/cpu_caps.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/libaften/cpu_caps.h b/libaften/cpu_caps.h
+index b7c6159..4db11f7 100644
+--- a/libaften/cpu_caps.h
++++ b/libaften/cpu_caps.h
+@@ -26,6 +26,7 @@
+ #include "ppc_cpu_caps.h"
+ #else
+ static inline void cpu_caps_detect(void){}
++static inline void apply_simd_restrictions(AftenSimdInstructions *simd_instructions){}
+ #endif
+
+ #endif /* CPU_CAPS_H */
+--
+2.24.3 (Apple Git-128)
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/libraries/agda/agda-categories/default.nix b/nixpkgs/pkgs/development/libraries/agda/agda-categories/default.nix
new file mode 100644
index 000000000000..267ee041bdc1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/agda/agda-categories/default.nix
@@ -0,0 +1,23 @@
+{ lib, mkDerivation, fetchFromGitHub, standard-library }:
+
+mkDerivation rec {
+  version = "0.1.7.1";
+  pname = "agda-categories";
+
+  src = fetchFromGitHub {
+    owner = "agda";
+    repo = "agda-categories";
+    rev = "v${version}";
+    sha256 = "1acb693ad2nrmnn6jxsyrlkc0di3kk2ksj2w9wnyfxrgvfsil7rn";
+  };
+
+  buildInputs = [ standard-library ];
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "A new Categories library";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ alexarice turion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/agda/agda-prelude/default.nix b/nixpkgs/pkgs/development/libraries/agda/agda-prelude/default.nix
new file mode 100644
index 000000000000..c546badef2d2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/agda/agda-prelude/default.nix
@@ -0,0 +1,30 @@
+{ lib, mkDerivation, fetchFromGitHub }:
+
+mkDerivation rec {
+  version = "compat-2.6.1";
+  pname = "agda-prelude";
+
+  src = fetchFromGitHub {
+    owner = "UlfNorell";
+    repo = "agda-prelude";
+    rev = version;
+    sha256 = "128rbhd32qlq2nq3wgqni4ih58zzwvs9pkn9j8236ycxxp6x81sl";
+  };
+
+  preConfigure = ''
+    cd test
+    make everything
+    mv Everything.agda ..
+    cd ..
+  '';
+
+  meta = with lib; {
+    # Remove if a version compatible with agda 2.6.2 is made
+    broken = true;
+    homepage = "https://github.com/UlfNorell/agda-prelude";
+    description = "Programming library for Agda";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.unix;
+    maintainers = with maintainers; [ mudri alexarice turion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/agda/cubical/default.nix b/nixpkgs/pkgs/development/libraries/agda/cubical/default.nix
new file mode 100644
index 000000000000..8e654444dd6a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/agda/cubical/default.nix
@@ -0,0 +1,33 @@
+{ lib, mkDerivation, fetchFromGitHub, ghc, glibcLocales }:
+
+mkDerivation rec {
+  pname = "cubical";
+  version = "0.3pred5030a9";
+
+  src = fetchFromGitHub {
+    repo = pname;
+    owner = "agda";
+    rev = "d5030a9c89070255fc575add4e9f37b97e6a0c0c";
+    sha256 = "18achbxap4ikydigmz3m3xjfn3i9dw4rn8yih82vrlc01j02nqpi";
+  };
+
+  LC_ALL = "en_US.UTF-8";
+
+  preConfigure = ''export AGDA_EXEC=agda'';
+
+  # The cubical library has several `Everything.agda` files, which are
+  # compiled through the make file they provide.
+  nativeBuildInputs = [ ghc glibcLocales ];
+  buildPhase = ''
+    make
+  '';
+
+  meta = with lib; {
+    description =
+      "A cubical type theory library for use with the Agda compiler";
+    homepage = src.meta.homepage;
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ alexarice ryanorendorff ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/agda/functional-linear-algebra/default.nix b/nixpkgs/pkgs/development/libraries/agda/functional-linear-algebra/default.nix
new file mode 100644
index 000000000000..083741d58e94
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/agda/functional-linear-algebra/default.nix
@@ -0,0 +1,30 @@
+{ fetchFromGitHub, lib, mkDerivation, standard-library }:
+
+mkDerivation rec {
+  version = "0.4";
+  pname = "functional-linear-algebra";
+
+  buildInputs = [ standard-library ];
+
+  src = fetchFromGitHub {
+    repo = "functional-linear-algebra";
+    owner = "ryanorendorff";
+    rev = "v${version}";
+    sha256 = "05jk3792k9xf8iiwzm2hwlvd25f2pqqr3gppmqjf8xb9199i8fk0";
+  };
+
+  preConfigure = ''
+    sh generate-everything.sh
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/ryanorendorff/functional-linear-algebra";
+    description = ''
+      Formalizing linear algebra in Agda by representing matrices as functions
+      from one vector space to another.
+    '';
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ryanorendorff ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/agda/generic/default.nix b/nixpkgs/pkgs/development/libraries/agda/generic/default.nix
new file mode 100644
index 000000000000..855dd0f33c51
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/agda/generic/default.nix
@@ -0,0 +1,33 @@
+{ lib, mkDerivation, fetchFromGitHub, standard-library }:
+
+mkDerivation rec {
+  pname = "generic";
+  version = "0.1.0.2";
+
+  src = fetchFromGitHub {
+    owner = "effectfully";
+    repo = "Generic";
+    rev = "v${version}";
+    sha256 = "05igsd2gaj6h9bkqwp8llhvn4qvc5gmi03x4fnz096ba8m6x8s3n";
+  };
+
+  buildInputs = [
+    standard-library
+  ];
+
+  preBuild = ''
+    echo "module Everything where" > Everything.agda
+    find src -name '*.agda' | sed -e 's/src\///;s/\//./g;s/\.agda$//;s/^/import /' >> Everything.agda
+  '';
+
+  meta = with lib; {
+    # Remove if a version compatible with agda 2.6.2 is made
+    broken = true;
+    description =
+      "A library for doing generic programming in Agda";
+    homepage = src.meta.homepage;
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ alexarice turion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/agda/iowa-stdlib/default.nix b/nixpkgs/pkgs/development/libraries/agda/iowa-stdlib/default.nix
new file mode 100644
index 000000000000..1383cff9e55a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/agda/iowa-stdlib/default.nix
@@ -0,0 +1,31 @@
+{ lib, mkDerivation, fetchFromGitHub }:
+
+mkDerivation (rec {
+  version = "1.5.0";
+  pname = "iowa-stdlib";
+
+  src = fetchFromGitHub {
+    owner = "cedille";
+    repo  = "ial";
+    rev = "v${version}";
+    sha256 = "0dlis6v6nzbscf713cmwlx8h9n2gxghci8y21qak3hp18gkxdp0g";
+  };
+
+  libraryFile = "";
+  libraryName = "IAL-1.3";
+
+  buildPhase = ''
+    patchShebangs find-deps.sh
+    make
+  '';
+
+  meta = {
+    homepage = "https://github.com/cedille/ial";
+    description = "Agda standard library developed at Iowa";
+    license = lib.licenses.free;
+    platforms = lib.platforms.unix;
+    # broken since Agda 2.6.1
+    broken = true;
+    maintainers = with lib.maintainers; [ alexarice turion ];
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/agda/standard-library/default.nix b/nixpkgs/pkgs/development/libraries/agda/standard-library/default.nix
new file mode 100644
index 000000000000..99cb863a598d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/agda/standard-library/default.nix
@@ -0,0 +1,30 @@
+{ lib, mkDerivation, fetchFromGitHub, ghcWithPackages, nixosTests }:
+
+mkDerivation rec {
+  pname = "standard-library";
+  version = "1.7";
+
+  src = fetchFromGitHub {
+    repo = "agda-stdlib";
+    owner = "agda";
+    rev = "v${version}";
+    sha256 = "14h3jprm6924g9576v25axn9v6xnip354hvpzlcqsc5qqyj7zzjs";
+  };
+
+  nativeBuildInputs = [ (ghcWithPackages (self : [ self.filemanip ])) ];
+  preConfigure = ''
+    runhaskell GenerateEverything.hs
+    # We will only build/consider Everything.agda, in particular we don't want Everything*.agda
+    # do be copied to the store.
+    rm EverythingSafe.agda
+  '';
+
+  passthru.tests = { inherit (nixosTests) agda; };
+  meta = with lib; {
+    homepage = "https://wiki.portal.chalmers.se/agda/pmwiki.php?n=Libraries.StandardLibrary";
+    description = "A standard library for use with the Agda compiler";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.unix;
+    maintainers = with maintainers; [ jwiegley mudri alexarice turion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/agg/default.nix b/nixpkgs/pkgs/development/libraries/agg/default.nix
new file mode 100644
index 000000000000..39e27c909b50
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/agg/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchurl, autoconf, automake, libtool, pkg-config
+, freetype, SDL, libX11 }:
+
+stdenv.mkDerivation rec {
+  pname = "agg";
+  version = "2.5";
+  src = fetchurl {
+    url = "https://www.antigrain.com/${pname}-${version}.tar.gz";
+    sha256 = "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb";
+  };
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ autoconf automake libtool freetype SDL libX11 ];
+
+  postPatch = ''
+    substituteInPlace include/agg_renderer_outline_aa.h \
+      --replace 'line_profile_aa& profile() {' 'const line_profile_aa& profile() {'
+  '';
+
+  # fix build with new automake, from Gentoo ebuild
+  preConfigure = ''
+    sed -i '/^AM_C_PROTOTYPES/d' configure.in
+    sh autogen.sh
+  '';
+
+  configureFlags = [ "--x-includes=${libX11.dev}/include" "--x-libraries=${libX11.out}/lib" "--enable-examples=no" ];
+
+  # libtool --tag=CXX --mode=link g++ -g -O2 libexamples.la ../src/platform/X11/libaggplatformX11.la ../src/libagg.la -o alpha_mask2 alpha_mask2.o
+  # libtool: error: cannot find the library 'libexamples.la'
+  enableParallelBuilding = false;
+
+  meta = {
+    description = "High quality rendering engine for C++";
+
+    longDescription = ''
+      Anti-Grain Geometry (AGG) is an Open Source, free of charge
+      graphic library, written in industrially standard C++.  The
+      terms and conditions of use AGG are described on The License
+      page.  AGG doesn't depend on any graphic API or technology.
+      Basically, you can think of AGG as of a rendering engine that
+      produces pixel images in memory from some vectorial data.  But
+      of course, AGG can do much more than that.
+    '';
+
+    license = lib.licenses.gpl2Plus;
+    homepage = "http://www.antigrain.com/";
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/alembic/default.nix b/nixpkgs/pkgs/development/libraries/alembic/default.nix
new file mode 100644
index 000000000000..0ed9aa204706
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/alembic/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchFromGitHub, unzip, cmake, openexr, hdf5-threadsafe }:
+
+stdenv.mkDerivation rec
+{
+  pname = "alembic";
+  version = "1.8.2";
+
+  src = fetchFromGitHub {
+    owner = "alembic";
+    repo = "alembic";
+    rev = version;
+    sha256 = "sha256-e87pnWIV8fbjEQa5iXRPXA9MkJN9NwY9PW/QI+cVSKo=";
+  };
+
+  outputs = [ "bin" "dev" "out" "lib" ];
+
+  nativeBuildInputs = [ unzip cmake ];
+  buildInputs = [ openexr hdf5-threadsafe ];
+
+  buildPhase = ''
+    cmake -DUSE_HDF5=ON -DCMAKE_INSTALL_PREFIX=$out/ -DUSE_TESTS=OFF .
+
+    mkdir $out
+    mkdir -p $bin/bin
+    mkdir -p $dev/include
+    mkdir -p $lib/lib
+  '';
+
+  installPhase = ''
+    make install
+
+    mv $out/bin $bin/
+    mv $out/lib $lib/
+    mv $out/include $dev/
+  '';
+
+  meta = with lib; {
+    description = "An open framework for storing and sharing scene data";
+    homepage = "http://alembic.io/";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+    maintainers = [ maintainers.guibou ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/alkimia/default.nix b/nixpkgs/pkgs/development/libraries/alkimia/default.nix
new file mode 100644
index 000000000000..34d6bf14e0b6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/alkimia/default.nix
@@ -0,0 +1,32 @@
+{ mkDerivation, fetchurl, lib
+, extra-cmake-modules, doxygen, graphviz, qtbase, qtwebkit, mpir
+, kdelibs4support, plasma-framework, knewstuff, kpackage
+}:
+
+mkDerivation rec {
+  pname = "alkimia";
+  version = "8.1.0";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/alkimia/${version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-kWgHNScHsEkM3ZymVoLv9zsAylIwKb2m/nonSaG8knw=";
+  };
+
+  nativeBuildInputs = [ extra-cmake-modules doxygen graphviz ];
+
+  buildInputs = [ qtbase qtwebkit kdelibs4support plasma-framework knewstuff kpackage ];
+  propagatedBuildInputs = [ mpir ];
+
+  meta = {
+    description = "Library used by KDE finance applications";
+    longDescription = ''
+      Alkimia is the infrastructure for common storage and business
+      logic that will be used by all financial applications in KDE.
+
+      The target is to share financial related information over
+      application bounderies.
+    '';
+    license = lib.licenses.lgpl21Plus;
+    platforms = qtbase.meta.platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/allegro/5.nix b/nixpkgs/pkgs/development/libraries/allegro/5.nix
new file mode 100644
index 000000000000..380cc1f7198e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/allegro/5.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, texinfo, libXext, xorgproto, libX11
+, libXpm, libXt, libXcursor, alsa-lib, cmake, zlib, libpng, libvorbis
+, libXxf86dga, libXxf86misc
+, libXxf86vm, openal, libGLU, libGL, libjpeg, flac
+, libXi, libXfixes, freetype, libopus, libtheora
+, physfs, enet, pkg-config, gtk3, pcre, libpulseaudio, libpthreadstubs
+, libXdmcp
+}:
+
+stdenv.mkDerivation rec {
+  pname = "allegro";
+  version = "5.2.7.0";
+
+  src = fetchFromGitHub {
+    owner = "liballeg";
+    repo = "allegro5";
+    rev = version;
+    sha256 = "sha256-JdnzEW+qAhAljR+WfmgE3P9xeR2HvjS64tFgCC0tNA0=";
+  };
+
+  buildInputs = [
+    texinfo libXext xorgproto libX11 libXpm libXt libXcursor
+    alsa-lib cmake zlib libpng libvorbis libXxf86dga libXxf86misc
+    libXxf86vm openal libGLU libGL
+    libjpeg flac
+    libXi libXfixes
+    enet libtheora freetype physfs libopus pkg-config gtk3 pcre libXdmcp
+    libpulseaudio libpthreadstubs
+  ];
+
+  postPatch = ''
+    sed -e 's@/XInput2.h@/XI2.h@g' -i CMakeLists.txt "src/"*.c
+  '';
+
+  cmakeFlags = [ "-DCMAKE_SKIP_RPATH=ON" ];
+
+  meta = with lib; {
+    description = "A game programming library";
+    homepage = "https://liballeg.org/";
+    license = licenses.zlib;
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/allegro/default.nix b/nixpkgs/pkgs/development/libraries/allegro/default.nix
new file mode 100644
index 000000000000..6abf632806a4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/allegro/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, texinfo6_5, libXext, xorgproto, libX11
+, libXpm, libXt, libXcursor, alsa-lib, cmake, zlib, libpng, libvorbis
+, libXxf86dga, libXxf86misc
+, libXxf86vm, openal, libGLU, libGL }:
+
+stdenv.mkDerivation rec {
+  pname = "allegro";
+  version="4.4.3.1";
+
+  src = fetchurl {
+    url = "https://github.com/liballeg/allegro5/releases/download/${version}/${pname}-${version}.tar.gz";
+    sha256 = "1m6lz35nk07dli26kkwz3wa50jsrxs1kb6w1nj14a911l34xn6gc";
+  };
+
+  patches = [
+    ./nix-unstable-sandbox-fix.patch
+    ./encoding.patch
+  ];
+
+  buildInputs = [
+    texinfo6_5 libXext xorgproto libX11 libXpm libXt libXcursor
+    alsa-lib cmake zlib libpng libvorbis libXxf86dga libXxf86misc
+    libXxf86vm openal libGLU libGL
+  ];
+
+  hardeningDisable = [ "format" ];
+
+  cmakeFlags = [ "-DCMAKE_SKIP_RPATH=ON" ];
+
+  meta = with lib; {
+    description = "A game programming library";
+    homepage = "https://liballeg.org/";
+    license = licenses.free; # giftware
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/allegro/encoding.patch b/nixpkgs/pkgs/development/libraries/allegro/encoding.patch
new file mode 100644
index 000000000000..1dca94752801
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/allegro/encoding.patch
@@ -0,0 +1,10 @@
+--- allegro-4.4.3/docs/src/allegro._tx.orig     2019-02-02 20:28:46.000000000 +0100
++++ allegro-4.4.3/docs/src/allegro._tx  2019-11-04 11:12:39.352699777 +0100
+@@ -23,6 +23,7 @@
+ @man_shortdesc_force1=allegro
+ @man_shortdesc_force2=Allegro game programming library.
+ @$\input texinfo
++@$@documentencoding ISO-8859-1
+ @$@setfilename allegro.inf
+ @$@settitle Allegro Manual
+ @$@setchapternewpage odd
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/libraries/allegro/nix-unstable-sandbox-fix.patch b/nixpkgs/pkgs/development/libraries/allegro/nix-unstable-sandbox-fix.patch
new file mode 100644
index 000000000000..a227cea1ce7b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/allegro/nix-unstable-sandbox-fix.patch
@@ -0,0 +1,13 @@
+diff --git a/docs/CMakeLists.txt b/docs/CMakeLists.txt
+index 32ed053..73ba87f 100644
+--- a/docs/CMakeLists.txt
++++ b/docs/CMakeLists.txt
+@@ -72,7 +72,7 @@ foreach(page ${DOC_SRCS})
+     string(REPLACE "._tx" "" basename ${basename})
+ 
+     set(page ${CMAKE_CURRENT_SOURCE_DIR}/${page})
+-    if(${page} MATCHES "/build/")
++    if(${page} MATCHES ".+/build/")
+         set(txt_out ${CMAKE_CURRENT_BINARY_DIR}/build/${basename}.txt)
+         set(html_out ${CMAKE_CURRENT_BINARY_DIR}/build/${basename}.html)
+     else()
diff --git a/nixpkgs/pkgs/development/libraries/alure/default.nix b/nixpkgs/pkgs/development/libraries/alure/default.nix
new file mode 100644
index 000000000000..a1bb5798b0e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/alure/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, cmake, openal }:
+
+stdenv.mkDerivation rec {
+  pname = "alure";
+  version = "1.2";
+
+  src = fetchurl {
+    url = "http://kcat.strangesoft.net/alure-releases/alure-${version}.tar.bz2";
+    sha256 = "0w8gsyqki21s1qb2s5ac1kj08i6nc937c0rr08xbw9w9wvd6lpj6";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ openal ];
+
+  meta = with lib; {
+    description = "A utility library to help manage common tasks with OpenAL applications";
+    homepage = "https://github.com/kcat/alure";
+    license = licenses.mit;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/alure2/default.nix b/nixpkgs/pkgs/development/libraries/alure2/default.nix
new file mode 100644
index 000000000000..fa42c4fd53a3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/alure2/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, cmake, openal, libvorbis, opusfile, libsndfile }:
+
+stdenv.mkDerivation rec {
+  pname = "alure2";
+  version = "unstable-2020-02-06";
+
+  src = fetchFromGitHub {
+    owner = "kcat";
+    repo = "alure";
+    rev = "50f92fe528e77da82197fd947d1cf9b0a82a0c7d";
+    sha256 = "1gmc1yfhwaj6lik0vn7zv8y23i05f4rw25v2jg34n856jcs02svx";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ openal libvorbis opusfile libsndfile ];
+
+  meta = with lib; {
+    description = "A utility library for OpenAL, providing a C++ API and managing common tasks that include file loading, caching, and streaming";
+    homepage = "https://github.com/kcat/alure";
+    license = licenses.zlib;
+    platforms = platforms.linux;
+    maintainers  = with maintainers; [ McSinyx ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/amdvlk/default.nix b/nixpkgs/pkgs/development/libraries/amdvlk/default.nix
new file mode 100644
index 000000000000..05174c89f7e3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/amdvlk/default.nix
@@ -0,0 +1,90 @@
+{ stdenv
+, lib
+, fetchRepoProject
+, cmake
+, ninja
+, patchelf
+, perl
+, pkg-config
+, python3
+, expat
+, libdrm
+, ncurses
+, openssl
+, wayland
+, xorg
+, zlib
+}:
+let
+
+  suffix = if stdenv.system == "x86_64-linux" then "64" else "32";
+
+in stdenv.mkDerivation rec {
+  pname = "amdvlk";
+  version = "2021.Q3.4";
+
+  src = fetchRepoProject {
+    name = "${pname}-src";
+    manifest = "https://github.com/GPUOpen-Drivers/AMDVLK.git";
+    rev = "refs/tags/v-${version}";
+    sha256 = "Rmx5vicxKXstI8TdxeFVjEFe71XJOyzp5L6VyDNuXmM=";
+  };
+
+  buildInputs = [
+    expat
+    ncurses
+    openssl
+    wayland
+    xorg.libX11
+    xorg.libxcb
+    xorg.xcbproto
+    xorg.libXext
+    xorg.libXrandr
+    xorg.libXft
+    xorg.libxshmfence
+    zlib
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    ninja
+    patchelf
+    perl
+    pkg-config
+    python3
+  ];
+
+  rpath = lib.makeLibraryPath [
+    libdrm
+    openssl
+    stdenv.cc.cc.lib
+    xorg.libX11
+    xorg.libxcb
+    xorg.libxshmfence
+  ];
+
+  cmakeDir = "../drivers/xgl";
+
+  # LTO is disabled in gcc for i686 as of #66528
+  cmakeFlags = lib.optionals stdenv.is32bit ["-DXGL_ENABLE_LTO=OFF"];
+
+  installPhase = ''
+    install -Dm755 -t $out/lib icd/amdvlk${suffix}.so
+    install -Dm644 -t $out/share/vulkan/icd.d icd/amd_icd${suffix}.json
+    install -Dm644 -t $out/share/vulkan/implicit_layer.d icd/amd_icd${suffix}.json
+
+    patchelf --set-rpath "$rpath" $out/lib/amdvlk${suffix}.so
+  '';
+
+  # Keep the rpath, otherwise vulkaninfo and vkcube segfault
+  dontPatchELF = true;
+
+  meta = with lib; {
+    description = "AMD Open Source Driver For Vulkan";
+    homepage = "https://github.com/GPUOpen-Drivers/AMDVLK";
+    changelog = "https://github.com/GPUOpen-Drivers/AMDVLK/releases/tag/v-${version}";
+    license = licenses.mit;
+    platforms = [ "x86_64-linux" "i686-linux" ];
+    maintainers = with maintainers; [ Flakebi ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/aml/default.nix b/nixpkgs/pkgs/development/libraries/aml/default.nix
new file mode 100644
index 000000000000..899dafde76f2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aml/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, meson, pkg-config, ninja }:
+
+stdenv.mkDerivation rec {
+  pname = "aml";
+  version = "0.2.0";
+
+  src = fetchFromGitHub {
+    owner = "any1";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0mxmzlhiv88hm4sf8kyawyrml8qy1xis019hdyb5skl9g95z9yyf";
+  };
+
+  nativeBuildInputs = [ meson pkg-config ninja ];
+
+  meta = with lib; {
+    description = "Another main loop";
+    inherit (src.meta) homepage;
+    license = licenses.isc;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ primeos ];
+    broken = stdenv.isDarwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/amrnb/default.nix b/nixpkgs/pkgs/development/libraries/amrnb/default.nix
new file mode 100644
index 000000000000..4e325932b5e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/amrnb/default.nix
@@ -0,0 +1,32 @@
+{lib, stdenv, fetchurl, unzip}:
+
+stdenv.mkDerivation {
+  pname = "amrnb";
+  version = "11.0.0.0";
+  srcAmr = fetchurl {
+    url = "https://www.3gpp.org/ftp/Specs/latest/Rel-11/26_series/26104-b00.zip";
+    sha256 = "1wf8ih0hk7w20vdlnw7jb7w73v15hbxgbvmq4wq7h2ghn0j8ppr3";
+  };
+
+  src = fetchurl {
+    url = "http://www.penguin.cz/~utx/ftp/amr/amrnb-11.0.0.0.tar.bz2";
+    sha256 = "1qgiw02n2a6r32pimnd97v2jkvnw449xrqmaxiivjy2jcr5h141q";
+  };
+
+  nativeBuildInputs = [ unzip ];
+
+  configureFlags = [ "--cache-file=config.cache" "--with-downloader=true" ];
+
+  postConfigure = ''
+    cp $srcAmr 26104-b00.zip
+  '';
+
+  meta = {
+    homepage = "http://www.penguin.cz/~utx/amr";
+    description = "AMR Narrow-Band Codec";
+    # The wrapper code is free, but not the libraries from 3gpp.
+    # It's a source code reference implementation with patents and licenses on
+    # some countries, not redistributable.
+    license = lib.licenses.unfree;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/amrwb/default.nix b/nixpkgs/pkgs/development/libraries/amrwb/default.nix
new file mode 100644
index 000000000000..81938bb4cba7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/amrwb/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, unzip }:
+
+stdenv.mkDerivation rec {
+  pname = "amrwb";
+  version = "11.0.0.0";
+
+  srcAmr = fetchurl {
+    url = "http://www.3gpp.org/ftp/Specs/archive/26_series/26.204/26204-b00.zip";
+    sha256 = "1v4zhs6f1mf1xkrzhljh05890in0rpr5d5pcak9h4igxhd2c91f8";
+  };
+
+  src = fetchurl {
+    url = "http://www.penguin.cz/~utx/ftp/amr/amrwb-${version}.tar.bz2";
+    sha256 = "1p6m9nd08mv525w14py9qzs9zwsa5i3vxf5bgcmcvc408jqmkbsw";
+  };
+
+  nativeBuildInputs = [ unzip ];
+
+  configureFlags = [ "--cache-file=config.cache" "--with-downloader=true" ];
+
+  postConfigure = ''
+    cp $srcAmr 26204-b00.zip
+  '';
+
+  meta = {
+    homepage = "http://www.penguin.cz/~utx/amr";
+    description = "AMR Wide-Band Codec";
+    # The wrapper code is free, but not the libraries from 3gpp.
+    # It's a source code reference implementation with patents and licenses on
+    # some countries, not redistributable.
+    license = lib.licenses.unfree;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/amtk/default.nix b/nixpkgs/pkgs/development/libraries/amtk/default.nix
new file mode 100644
index 000000000000..5743a18c0fd0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/amtk/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv
+, fetchurl
+, gtk3
+, meson
+, ninja
+, pkg-config
+, gobject-introspection
+, gnome
+, dbus
+, xvfb-run
+}:
+
+stdenv.mkDerivation rec {
+  pname = "amtk";
+  version = "5.3.1";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "12v3nj1bb7507ndprjggq0hpz8k719b4bwvl8sm43p3ibmn27anm";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    dbus
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    gtk3
+  ];
+
+  doCheck = stdenv.isLinux;
+  checkPhase = ''
+    export NO_AT_BRIDGE=1
+    ${xvfb-run}/bin/xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
+      --config-file=${dbus.daemon}/share/dbus-1/session.conf \
+      meson test --print-errorlogs
+  '';
+
+  passthru.updateScript = gnome.updateScript {
+    packageName = pname;
+    versionPolicy = "none";
+  };
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Projects/Amtk";
+    description = "Actions, Menus and Toolbars Kit for GTK applications";
+    maintainers = [ maintainers.manveru ];
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/apache-activemq/default.nix b/nixpkgs/pkgs/development/libraries/apache-activemq/default.nix
new file mode 100644
index 000000000000..13305d312736
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/apache-activemq/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "apache-activemq";
+  version = "5.16.2";
+
+  src = fetchurl {
+    sha256 = "sha256-IS/soe5Lx1C+/UWnNcv+8AwMmu5FHvURbpkTMMGrEFs=";
+    url = "mirror://apache/activemq/${version}/${pname}-${version}-bin.tar.gz";
+  };
+
+  installPhase = ''
+    mkdir -p $out
+    mv * $out/
+    for j in `find $out/lib -name "*.jar"`; do
+      cp="''${cp:+"$cp:"}$j";
+    done
+    echo "CLASSPATH=$cp" > $out/lib/classpath.env
+  '';
+
+  meta = {
+    homepage = "http://activemq.apache.org/";
+    description = "Messaging and Integration Patterns server written in Java";
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.unix;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/appindicator-sharp/default.nix b/nixpkgs/pkgs/development/libraries/appindicator-sharp/default.nix
new file mode 100644
index 000000000000..9eff4e3895ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/appindicator-sharp/default.nix
@@ -0,0 +1,43 @@
+{
+  autoreconfHook,
+  fetchFromGitHub,
+  lib,
+  libappindicator,
+  mono,
+  gtk-sharp-3_0,
+  pkg-config,
+  stdenv,
+}:
+
+stdenv.mkDerivation rec {
+  pname = "appindicator-sharp";
+  version = "5a79cde93da6d68a4b1373f1ce5796c3c5fe1b37";
+
+  src = fetchFromGitHub {
+    owner = "stsundermann";
+    repo = "appindicator-sharp";
+    rev = version;
+    sha256 = "sha256:1i0vqbp05l29f5v9ygp7flm4s05pcnn5ivl578mxmhb51s7ncw6l";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    mono
+    pkg-config
+  ];
+
+  buildInputs = [
+    gtk-sharp-3_0
+    libappindicator
+  ];
+
+  ac_cv_path_MDOC = "no";
+  installFlagsArray = ["GAPIXMLDIR=/tmp/gapixml"];
+
+  meta = {
+    description = "Bindings for appindicator using gobject-introspection";
+    homepage = "https://github.com/stsundermann/appindicator-sharp";
+    license = lib.licenses.lgpl3Only;
+    maintainers = with lib.maintainers; [ kevincox ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/applet-window-buttons/default.nix b/nixpkgs/pkgs/development/libraries/applet-window-buttons/default.nix
new file mode 100644
index 000000000000..d1d20ef0e489
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/applet-window-buttons/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, mkDerivation
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, kcoreaddons
+, kdeclarative
+, kdecoration
+, plasma-framework
+}:
+
+mkDerivation rec {
+  pname = "applet-window-buttons";
+  version = "0.9.0";
+
+  src = fetchFromGitHub {
+    owner = "psifidotos";
+    repo = "applet-window-buttons";
+    rev = version;
+    sha256 = "sha256-ikgUE8GaiTpNjwrz7SbNQ3+b8KiigDgMREQ7J2b+EEs=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+  ];
+
+  buildInputs = [
+    kcoreaddons
+    kdeclarative
+    kdecoration
+    plasma-framework
+  ];
+
+  meta = with lib; {
+    description = "Plasma 5 applet in order to show window buttons in your panels";
+    homepage = "https://github.com/psifidotos/applet-window-buttons";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ dotlambda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/appstream-glib/default.nix b/nixpkgs/pkgs/development/libraries/appstream-glib/default.nix
new file mode 100644
index 000000000000..5882805fdfc6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/appstream-glib/default.nix
@@ -0,0 +1,95 @@
+{ lib, stdenv
+, fetchFromGitHub
+, substituteAll
+, docbook_xml_dtd_42
+, docbook_xsl
+, fontconfig
+, freetype
+, gdk-pixbuf
+, gettext
+, glib
+, gobject-introspection
+, gperf
+, gtk-doc
+, gtk3
+, json-glib
+, libarchive
+, libsoup
+, libuuid
+, libxslt
+, meson
+, ninja
+, pkg-config
+, pngquant
+}:
+stdenv.mkDerivation rec {
+  pname = "appstream-glib";
+  version = "0.7.18";
+
+  outputs = [ "out" "dev" "man" "installedTests" ];
+  outputBin = "dev";
+
+  src = fetchFromGitHub {
+    owner = "hughsie";
+    repo = "appstream-glib";
+    rev = "${lib.replaceStrings ["-"] ["_"] pname}_${lib.replaceStrings ["."] ["_"] version}";
+    sha256 = "12s7d3nqjs1fldnppbg2mkjg4280f3h8yzj3q1hiz3chh1w0vjbx";
+  };
+
+  nativeBuildInputs = [
+    docbook_xml_dtd_42
+    docbook_xsl
+    gettext
+    gobject-introspection
+    gperf
+    gtk-doc
+    libxslt
+    meson
+    ninja
+    pkg-config
+  ];
+
+  buildInputs = [
+    fontconfig
+    freetype
+    gdk-pixbuf
+    glib
+    gtk3
+    json-glib
+    libarchive
+    libsoup
+    libuuid
+  ];
+
+  propagatedBuildInputs = [
+    glib
+    gdk-pixbuf
+  ];
+
+  patches = [
+    (substituteAll {
+      src = ./paths.patch;
+      pngquant = "${pngquant}/bin/pngquant";
+    })
+  ];
+
+  mesonFlags = [
+    "-Drpm=false"
+    "-Dstemmer=false"
+    "-Ddep11=false"
+  ];
+
+  doCheck = false; # fails at least 1 test
+
+  postInstall = ''
+    moveToOutput "share/installed-tests" "$installedTests"
+  '';
+
+  meta = with lib; {
+    description = "Objects and helper methods to read and write AppStream metadata";
+    homepage = "https://people.freedesktop.org/~hughsient/appstream-glib/";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ matthewbauer ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/appstream-glib/paths.patch b/nixpkgs/pkgs/development/libraries/appstream-glib/paths.patch
new file mode 100644
index 000000000000..5c6396988a17
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/appstream-glib/paths.patch
@@ -0,0 +1,11 @@
+--- a/libappstream-builder/asb-utils.c
++++ b/libappstream-builder/asb-utils.c
+@@ -294,7 +294,7 @@
+ {
+ 	g_autofree gchar *standard_error = NULL;
+ 	gint exit_status = 0;
+-	const gchar *argv[] = { "/usr/bin/pngquant", "--skip-if-larger",
++	const gchar *argv[] = { "@pngquant@", "--skip-if-larger",
+ 				"--strip", "--ext", ".png",
+ 				"--force", "--speed", "1", filename, NULL };
+ 	if (!g_file_test (argv[0], G_FILE_TEST_IS_EXECUTABLE))
diff --git a/nixpkgs/pkgs/development/libraries/appstream/default.nix b/nixpkgs/pkgs/development/libraries/appstream/default.nix
new file mode 100644
index 000000000000..c39ea78a7757
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/appstream/default.nix
@@ -0,0 +1,92 @@
+{ lib
+, stdenv
+, substituteAll
+, fetchFromGitHub
+, meson
+, ninja
+, pkg-config
+, gettext
+, xmlto
+, docbook-xsl-nons
+, docbook_xml_dtd_45
+, libxslt
+, libstemmer
+, glib
+, xapian
+, libxml2
+, libyaml
+, gobject-introspection
+, pcre
+, itstool
+, gperf
+, vala
+, lmdb
+, curl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "appstream";
+  version = "0.14.4";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "ximion";
+    repo = "appstream";
+    rev = "v${version}";
+    sha256 = "sha256-DJXCw50f+8c58bJw6xx0ECfkc9/KcWaeA+ne2zmTyhg=";
+  };
+
+  patches = [
+    # Fix hardcoded paths
+    (substituteAll {
+      src = ./fix-paths.patch;
+      libstemmer_includedir = "${lib.getDev libstemmer}/include";
+    })
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gettext
+    libxslt
+    xmlto
+    docbook-xsl-nons
+    docbook_xml_dtd_45
+    gobject-introspection
+    itstool
+    vala
+  ];
+
+  buildInputs = [
+    libstemmer
+    pcre
+    glib
+    xapian
+    libxml2
+    libyaml
+    gperf
+    lmdb
+    curl
+  ];
+
+  mesonFlags = [
+    "-Dapidocs=false"
+    "-Ddocs=false"
+    "-Dvapi=true"
+  ];
+
+  meta = with lib; {
+    description = "Software metadata handling library";
+    homepage = "https://www.freedesktop.org/wiki/Distributions/AppStream/";
+    longDescription = ''
+      AppStream is a cross-distro effort for building Software-Center applications
+      and enhancing metadata provided by software components.  It provides
+      specifications for meta-information which is shipped by upstream projects and
+      can be consumed by other software.
+    '';
+    license = licenses.lgpl21Plus;
+    platforms = platforms.unix;
+ };
+}
diff --git a/nixpkgs/pkgs/development/libraries/appstream/fix-paths.patch b/nixpkgs/pkgs/development/libraries/appstream/fix-paths.patch
new file mode 100644
index 000000000000..0da72a78cbcf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/appstream/fix-paths.patch
@@ -0,0 +1,29 @@
+diff --git a/data/meson.build b/data/meson.build
+index 1eb3dfb0..623b66ec 100644
+--- a/data/meson.build
++++ b/data/meson.build
+@@ -26,4 +26,4 @@ i18n.merge_file (
+ )
+ 
+ install_data ('appstream.conf',
+-              install_dir: get_option('sysconfdir'))
++              install_dir: get_option('prefix') / 'etc')
+diff --git a/meson.build b/meson.build
+index dc1fb1a5..5ee03b73 100644
+--- a/meson.build
++++ b/meson.build
+@@ -108,12 +108,12 @@ if get_option ('gir')
+     dependency('gobject-introspection-1.0', version: '>=1.56')
+ endif
+ 
+-stemmer_inc_dirs = include_directories(['/usr/include'])
++stemmer_inc_dirs = include_directories(['@libstemmer_includedir@'])
+ if get_option('stemming')
+     stemmer_lib = cc.find_library('stemmer', required: true)
+     if not cc.has_header('libstemmer.h')
+         if cc.has_header('libstemmer/libstemmer.h')
+-            stemmer_inc_dirs = include_directories('/usr/include/libstemmer')
++            stemmer_inc_dirs = include_directories('@libstemmer_includedir@/libstemmer')
+         else
+             error('Unable to find Snowball header "libstemmer.h". Please ensure libstemmer/Snowball is installed properly in order to continue.')
+         endif
diff --git a/nixpkgs/pkgs/development/libraries/appstream/qt.nix b/nixpkgs/pkgs/development/libraries/appstream/qt.nix
new file mode 100644
index 000000000000..0bcb4741ff12
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/appstream/qt.nix
@@ -0,0 +1,25 @@
+{ mkDerivation, appstream, qtbase, qttools }:
+
+# TODO: look into using the libraries from the regular appstream derivation as we keep duplicates here
+
+mkDerivation {
+  pname = "appstream-qt";
+  inherit (appstream) version src patches;
+
+  outputs = [ "out" "dev" ];
+
+  buildInputs = appstream.buildInputs ++ [ appstream qtbase ];
+
+  nativeBuildInputs = appstream.nativeBuildInputs ++ [ qttools ];
+
+  mesonFlags = appstream.mesonFlags ++ [ "-Dqt=true" ];
+
+  postFixup = ''
+    sed -i "$dev/lib/cmake/AppStreamQt/AppStreamQtConfig.cmake" \
+      -e "/INTERFACE_INCLUDE_DIRECTORIES/ s@\''${PACKAGE_PREFIX_DIR}@$dev@"
+  '';
+
+  meta = appstream.meta // {
+    description = "Software metadata handling library - Qt";
+ };
+}
diff --git a/nixpkgs/pkgs/development/libraries/apr-util/default.nix b/nixpkgs/pkgs/development/libraries/apr-util/default.nix
new file mode 100644
index 000000000000..bd00a612d4ee
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/apr-util/default.nix
@@ -0,0 +1,72 @@
+{ lib, stdenv, fetchurl, makeWrapper, apr, expat, gnused
+, sslSupport ? true, openssl
+, bdbSupport ? true, db
+, ldapSupport ? !stdenv.isCygwin, openldap
+, libiconv
+, cyrus_sasl, autoreconfHook
+}:
+
+assert sslSupport -> openssl != null;
+assert bdbSupport -> db != null;
+assert ldapSupport -> openldap != null;
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "apr-util";
+  version = "1.6.1";
+
+  src = fetchurl {
+    url = "mirror://apache/apr/${pname}-${version}.tar.bz2";
+    sha256 = "0nq3s1yn13vplgl6qfm09f7n0wm08malff9s59bqf9nid9xjzqfk";
+  };
+
+  patches = optional stdenv.isFreeBSD ./include-static-dependencies.patch;
+
+  outputs = [ "out" "dev" ];
+  outputBin = "dev";
+
+  buildInputs = optional stdenv.isFreeBSD autoreconfHook;
+
+  configureFlags = [ "--with-apr=${apr.dev}" "--with-expat=${expat.dev}" ]
+    ++ optional (!stdenv.isCygwin) "--with-crypto"
+    ++ optional sslSupport "--with-openssl=${openssl.dev}"
+    ++ optional bdbSupport "--with-berkeley-db=${db.dev}"
+    ++ optional ldapSupport "--with-ldap=ldap"
+    ++ optionals stdenv.isCygwin
+      [ "--without-pgsql" "--without-sqlite2" "--without-sqlite3"
+        "--without-freetds" "--without-berkeley-db" "--without-crypto" ]
+    ;
+
+  propagatedBuildInputs = [ makeWrapper apr expat libiconv ]
+    ++ optional sslSupport openssl
+    ++ optional bdbSupport db
+    ++ optional ldapSupport openldap
+    ++ optional stdenv.isFreeBSD cyrus_sasl;
+
+  postInstall = ''
+    for f in $out/lib/*.la $out/lib/apr-util-1/*.la $dev/bin/apu-1-config; do
+      substituteInPlace $f \
+        --replace "${expat.dev}/lib" "${expat.out}/lib" \
+        --replace "${db.dev}/lib" "${db.out}/lib" \
+        --replace "${openssl.dev}/lib" "${openssl.out}/lib"
+    done
+
+    # Give apr1 access to sed for runtime invocations.
+    wrapProgram $dev/bin/apu-1-config --prefix PATH : "${gnused}/bin"
+  '';
+
+  enableParallelBuilding = true;
+
+  passthru = {
+    inherit sslSupport bdbSupport ldapSupport;
+  };
+
+  meta = with lib; {
+    homepage = "http://apr.apache.org/";
+    description = "A companion library to APR, the Apache Portable Runtime";
+    maintainers = [ maintainers.eelco ];
+    platforms = platforms.unix;
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/apr-util/include-static-dependencies.patch b/nixpkgs/pkgs/development/libraries/apr-util/include-static-dependencies.patch
new file mode 100644
index 000000000000..1813c7217810
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/apr-util/include-static-dependencies.patch
@@ -0,0 +1,12 @@
+diff --git a/build/apu-conf.m4 b/build/apu-conf.m4
+index 8943f10..aa44305 100644
+--- a/build/apu-conf.m4
++++ b/build/apu-conf.m4
+@@ -279,6 +279,7 @@ AC_ARG_WITH(ldap,[  --with-ldap=library     ldap library to use],
+         APU_FIND_LDAPLIB("ldap", "-llber -lresolv -lsocket -lnsl")
+         APU_FIND_LDAPLIB("ldap", "-ldl -lpthread")
+       else
++        APU_FIND_LDAPLIB($LIBLDAP, "-llber -lcrypto -lssl -lsasl2")
+         APU_FIND_LDAPLIB($LIBLDAP)
+         APU_FIND_LDAPLIB($LIBLDAP, "-lresolv")
+         APU_FIND_LDAPLIB($LIBLDAP, "-lresolv -lsocket -lnsl")
diff --git a/nixpkgs/pkgs/development/libraries/apr/default.nix b/nixpkgs/pkgs/development/libraries/apr/default.nix
new file mode 100644
index 000000000000..dd88cf7b1d49
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/apr/default.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv, fetchurl, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "apr";
+  version = "1.7.0";
+
+  src = fetchurl {
+    url = "mirror://apache/apr/${pname}-${version}.tar.bz2";
+    sha256 = "1spp6r2a3xcl5yajm9safhzyilsdzgagc2dadif8x6z9nbq4iqg2";
+  };
+
+  patches = lib.optionals stdenv.isDarwin [ ./is-this-a-compiler-bug.patch ];
+
+  # This test needs the net
+  postPatch = ''
+    rm test/testsock.*
+  '';
+
+  outputs = [ "out" "dev" ];
+  outputBin = "dev";
+
+  preConfigure =
+    ''
+      configureFlagsArray+=("--with-installbuilddir=$dev/share/build")
+    '';
+
+  configureFlags = 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"
+  ] ++ 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
+    "ac_cv_header_windows_h=no"
+  ];
+
+  CPPFLAGS=lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-DAPR_IOVEC_DEFINED";
+
+  nativeBuildInputs =
+    # Update libtool for macOS 11 support
+    lib.optional (stdenv.isDarwin && stdenv.isAarch64) [ autoreconfHook ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "http://apr.apache.org/";
+    description = "The Apache Portable Runtime library";
+    platforms = platforms.all;
+    license = licenses.asl20;
+    maintainers = [ maintainers.eelco ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/apr/is-this-a-compiler-bug.patch b/nixpkgs/pkgs/development/libraries/apr/is-this-a-compiler-bug.patch
new file mode 100644
index 000000000000..bbc10fabb268
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/apr/is-this-a-compiler-bug.patch
@@ -0,0 +1,17 @@
+--- apr-1.5.1/file_io/unix/filestat.c	2014-11-01 06:42:50.000000000 -0400
++++ apr-1.5.1/file_io/unix/filestat.c.new	2014-11-01 07:07:32.000000000 -0400
+@@ -297,9 +297,11 @@
+         finfo->pool = pool;
+         finfo->fname = fname;
+         fill_out_finfo(finfo, &info, wanted);
+-        if (wanted & APR_FINFO_LINK)
+-            wanted &= ~APR_FINFO_LINK;
+-        return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS;
++        if (wanted & APR_FINFO_LINK) {
++            return ((wanted & ~APR_FINFO_LINK) & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS;
++        } else {
++            return (wanted & ~finfo->valid) ? APR_INCOMPLETE : APR_SUCCESS;
++        }
+     }
+     else {
+ #if !defined(ENOENT) || !defined(ENOTDIR)
diff --git a/nixpkgs/pkgs/development/libraries/aqbanking/default.nix b/nixpkgs/pkgs/development/libraries/aqbanking/default.nix
new file mode 100644
index 000000000000..1e11661b0098
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aqbanking/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, gmp, gwenhywfar, libtool, libxml2, libxslt
+, pkg-config, gettext, xmlsec, zlib
+}:
+
+let
+  inherit ((import ./sources.nix).aqbanking) sha256 releaseId version;
+in stdenv.mkDerivation rec {
+  pname = "aqbanking";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://www.aquamaniac.de/rdm/attachments/download/${releaseId}/${pname}-${version}.tar.gz";
+    inherit sha256;
+  };
+
+  # Set the include dir explicitly, this fixes a build error when building
+  # kmymoney because otherwise the includedir is overwritten by gwenhywfar's
+  # cmake file
+  postPatch = ''
+    sed -i '/^set_and_check(AQBANKING_INCLUDE_DIRS "@aqbanking_headerdir@")/i set_and_check(includedir "@includedir@")' aqbanking-config.cmake.in
+    sed -i -e '/^aqbanking_plugindir=/ {
+      c aqbanking_plugindir="\''${libdir}/gwenhywfar/plugins"
+    }' configure
+  '';
+
+  buildInputs = [ gmp gwenhywfar libtool libxml2 libxslt xmlsec zlib ];
+
+  nativeBuildInputs = [ pkg-config gettext ];
+
+  meta = with lib; {
+    description = "An interface to banking tasks, file formats and country information";
+    homepage = "https://www.aquamaniac.de/";
+    hydraPlatforms = [];
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/aqbanking/gwenhywfar.nix b/nixpkgs/pkgs/development/libraries/aqbanking/gwenhywfar.nix
new file mode 100644
index 000000000000..073ad3254a0b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aqbanking/gwenhywfar.nix
@@ -0,0 +1,69 @@
+{ lib, stdenv, fetchurl, gnutls, openssl, libgcrypt, libgpgerror, pkg-config, gettext
+, which
+
+# GUI support
+, gtk2, gtk3, qt5
+
+, pluginSearchPaths ? [
+    "/run/current-system/sw/lib/gwenhywfar/plugins"
+    ".nix-profile/lib/gwenhywfar/plugins"
+  ]
+}:
+
+let
+  inherit ((import ./sources.nix).gwenhywfar) sha256 releaseId version;
+in stdenv.mkDerivation rec {
+  pname = "gwenhywfar";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://www.aquamaniac.de/rdm/attachments/download/${releaseId}/${pname}-${version}.tar.gz";
+    inherit sha256;
+  };
+
+  configureFlags = [
+    "--with-openssl-includes=${openssl.dev}/include"
+    "--with-openssl-libs=${openssl.out}/lib"
+  ];
+
+  preConfigure = ''
+    configureFlagsArray+=("--with-guis=gtk2 gtk3 qt5")
+  '';
+
+  postPatch = let
+    isRelative = path: builtins.substring 0 1 path != "/";
+    mkSearchPath = path: ''
+      p; g; s,\<PLUGINDIR\>,"${path}",g;
+    '' + lib.optionalString (isRelative path) ''
+      s/AddPath(\(.*\));/AddRelPath(\1, GWEN_PathManager_RelModeHome);/g
+    '';
+
+  in ''
+    sed -i -e '/GWEN_PathManager_DefinePath.*GWEN_PM_PLUGINDIR/,/^#endif/ {
+      /^#if/,/^#endif/ {
+        H; /^#endif/ {
+          ${lib.concatMapStrings mkSearchPath pluginSearchPaths}
+        }
+      }
+    }' src/gwenhywfar.c
+
+    # Strip off the effective SO version from the path so that for example
+    # "lib/gwenhywfar/plugins/60" becomes just "lib/gwenhywfar/plugins".
+    sed -i -e '/^gwenhywfar_plugindir=/s,/\''${GWENHYWFAR_SO_EFFECTIVE},,' \
+      configure
+  '';
+
+  nativeBuildInputs = [ pkg-config gettext which ];
+
+  buildInputs = [ gtk2 gtk3 qt5.qtbase gnutls openssl libgcrypt libgpgerror ];
+
+  dontWrapQtApps = true;
+
+  meta = with lib; {
+    description = "OS abstraction functions used by aqbanking and related tools";
+    homepage = "http://www2.aquamaniac.de/sites/download/packages.php?package=01&showall=1";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/aqbanking/libchipcard.nix b/nixpkgs/pkgs/development/libraries/aqbanking/libchipcard.nix
new file mode 100644
index 000000000000..f483f232e37b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aqbanking/libchipcard.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, pkg-config, gwenhywfar, pcsclite, zlib }:
+
+let
+  inherit ((import ./sources.nix).libchipcard) sha256 releaseId version;
+in stdenv.mkDerivation rec {
+  pname = "libchipcard";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://www.aquamaniac.de/rdm/attachments/download/${releaseId}/${pname}-${version}.tar.gz";
+    inherit sha256;
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ gwenhywfar pcsclite zlib ];
+
+  makeFlags = [ "crypttokenplugindir=$(out)/lib/gwenhywfar/plugins/ct" ];
+
+  configureFlags = [ "--with-gwen-dir=${gwenhywfar}" ];
+
+  meta = with lib; {
+    description = "Library for access to chipcards";
+    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/aqbanking/sources.nix b/nixpkgs/pkgs/development/libraries/aqbanking/sources.nix
new file mode 100644
index 000000000000..60f61324e650
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aqbanking/sources.nix
@@ -0,0 +1,11 @@
+{
+  gwenhywfar.version = "5.6.0";
+  gwenhywfar.sha256 = "1isbj4a7vdgagp3kkvx2pjcjy8lba6kzjr11fmr06aci1694dbsp";
+  gwenhywfar.releaseId = "364";
+  libchipcard.version = "5.0.4";
+  libchipcard.sha256 = "0fj2h39ll4kiv28ch8qgzdbdbnzs8gl812qnm660bw89rynpjnnj";
+  libchipcard.releaseId = "158";
+  aqbanking.version = "6.3.0";
+  aqbanking.sha256 = "1k2mhdnk0jc0inq1hmp74m3y7azxrjm8r07x5k1pp4ic0yi5vs50";
+  aqbanking.releaseId = "372";
+}
diff --git a/nixpkgs/pkgs/development/libraries/aravis/default.nix b/nixpkgs/pkgs/development/libraries/aravis/default.nix
new file mode 100644
index 000000000000..67e621ad8597
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aravis/default.nix
@@ -0,0 +1,90 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, gtk-doc, intltool
+, audit, glib, libusb1, libxml2
+, wrapGAppsHook
+, gstreamer ? null
+, gst-plugins-base ? null
+, gst-plugins-good ? null
+, gst-plugins-bad ? null
+, libnotify ? null
+, gnome ? null
+, gtk3 ? null
+, enableUsb ? true
+, enablePacketSocket ? true
+, enableViewer ? true
+, enableGstPlugin ? true
+, enableCppTest ? false
+, enableFastHeartbeat ? false
+, enableAsan ? false
+}:
+
+let
+  gstreamerAtLeastVersion1 =
+    lib.all
+      (pkg: pkg != null && lib.versionAtLeast (lib.getVersion pkg) "1.0")
+      [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad ];
+in
+  assert enableGstPlugin -> lib.all (pkg: pkg != null) [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad ];
+  assert enableViewer -> enableGstPlugin;
+  assert enableViewer -> libnotify != null;
+  assert enableViewer -> gnome != null;
+  assert enableViewer -> gtk3 != null;
+  assert enableViewer -> gstreamerAtLeastVersion1;
+
+  stdenv.mkDerivation rec {
+
+    pname = "aravis";
+    version = "0.6.4";
+
+    src = fetchFromGitHub {
+      owner = "AravisProject";
+      repo = pname;
+      rev= "ARAVIS_${builtins.replaceStrings ["."] ["_"] version}";
+      sha256 = "18fnliks661kzc3g8v08hcaj18hjid8b180d6s9gwn0zgv4g374w";
+    };
+
+    outputs = [ "bin" "dev" "out" "lib" ];
+
+    nativeBuildInputs = [
+      autoreconfHook
+      pkg-config
+      intltool
+      gtk-doc
+    ] ++ lib.optional enableViewer wrapGAppsHook;
+
+    buildInputs =
+      [ glib libxml2 ]
+      ++ lib.optional enableUsb libusb1
+      ++ lib.optional enablePacketSocket audit
+      ++ lib.optionals (enableViewer || enableGstPlugin) [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad ]
+      ++ lib.optionals (enableViewer) [ libnotify gtk3 gnome.adwaita-icon-theme ];
+
+    preAutoreconf = "./autogen.sh";
+
+    configureFlags =
+      lib.optional enableUsb "--enable-usb"
+        ++ lib.optional enablePacketSocket "--enable-packet-socket"
+        ++ lib.optional enableViewer "--enable-viewer"
+        ++ lib.optional enableGstPlugin
+        (if gstreamerAtLeastVersion1 then "--enable-gst-plugin" else "--enable-gst-0.10-plugin")
+        ++ lib.optional enableCppTest "--enable-cpp-test"
+        ++ lib.optional enableFastHeartbeat "--enable-fast-heartbeat"
+        ++ lib.optional enableAsan "--enable-asan";
+
+    postPatch = ''
+        ln -s ${gtk-doc}/share/gtk-doc/data/gtk-doc.make .
+      '';
+
+    doCheck = true;
+
+    meta = {
+      description = "Library for video acquisition using GenICam cameras";
+      longDescription = ''
+        Implements the gigabit ethernet and USB3 protocols used by industrial cameras.
+      '';
+      homepage = "https://aravisproject.github.io/docs/aravis-0.5";
+      license = lib.licenses.lgpl2;
+      maintainers = [];
+      platforms = lib.platforms.unix;
+    };
+  }
+
diff --git a/nixpkgs/pkgs/development/libraries/arb/default.nix b/nixpkgs/pkgs/development/libraries/arb/default.nix
new file mode 100644
index 000000000000..393639ea558b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/arb/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, mpir
+, gmp
+, mpfr
+, flint
+}:
+
+stdenv.mkDerivation rec {
+  pname = "arb";
+  version = "2.20.0";
+
+  src = fetchFromGitHub {
+    owner = "fredrik-johansson";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-HOIbdkVV7NKowIGhDdn/S8unIRV469OnRHiuiCGaWgk=";
+  };
+
+  buildInputs = [ mpir gmp mpfr flint ];
+
+  configureFlags = [
+    "--with-gmp=${gmp}"
+    "--with-mpir=${mpir}"
+    "--with-mpfr=${mpfr}"
+    "--with-flint=${flint}"
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A library for arbitrary-precision interval arithmetic";
+    homepage = "https://arblib.org/";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/argp-standalone/default.nix b/nixpkgs/pkgs/development/libraries/argp-standalone/default.nix
new file mode 100644
index 000000000000..1a09ed84a1cb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/argp-standalone/default.nix
@@ -0,0 +1,62 @@
+{ lib, stdenv, fetchurl, fetchpatch }:
+
+let
+  patch-argp-fmtstream = fetchpatch {
+    name = "patch-argp-fmtstream.h";
+    url = "https://raw.githubusercontent.com/Homebrew/formula-patches/b5f0ad3/argp-standalone/patch-argp-fmtstream.h";
+    sha256 = "5656273f622fdb7ca7cf1f98c0c9529bed461d23718bc2a6a85986e4f8ed1cb8";
+  };
+
+  patch-throw-in-funcdef = fetchpatch {
+    name = "argp-standalone-1.3-throw-in-funcdef.patch";
+    url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-libs/argp-standalone/files/argp-standalone-1.3-throw-in-funcdef.patch?id=409d0e2a9c9c899fb1fb04cc808fe0aff3f745ca";
+    sha256 = "0b2b4l1jkvmnffl22jcn4ydzxy2i7fnmmnfim12f0yg5pb8fs43c";
+  };
+
+  patch-shared = fetchpatch {
+    name = "argp-standalone-1.3-shared.patch";
+    url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sys-libs/argp-standalone/files/argp-standalone-1.3-shared.patch?id=409d0e2a9c9c899fb1fb04cc808fe0aff3f745ca";
+    sha256 = "1xx2zdc187a1m2x6c1qs62vcrycbycw7n0q3ks2zkxpaqzx2dgkw";
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "argp-standalone";
+  version = "1.3";
+
+  src = fetchurl {
+    url = "https://www.lysator.liu.se/~nisse/misc/argp-standalone-${version}.tar.gz";
+    sha256 = "dec79694da1319acd2238ce95df57f3680fea2482096e483323fddf3d818d8be";
+  };
+
+  patches =
+       lib.optionals stdenv.hostPlatform.isDarwin [ patch-argp-fmtstream ]
+    ++ lib.optionals stdenv.hostPlatform.isLinux [ patch-throw-in-funcdef patch-shared ];
+
+  patchFlags = lib.optional stdenv.hostPlatform.isDarwin "-p0";
+
+  # For currently unknown reason, `-fPIC` has to be passed explicitly, otherwise
+  # downstream software like `elfutils` will get `recompile errors like:
+  #     libargp.a(argp-help.o): relocation R_X86_64_PC32 against symbol `program_invocation_short_name' can not be used when making a shared object; recompile with -fPIC
+  # It seems that nixpkgs's on-by-default `-fPIC` is not in effect here.
+  preConfigure = lib.optionalString stdenv.hostPlatform.isLinux "export CFLAGS='-fgnu89-inline -fPIC'";
+
+  postInstall = ''
+    mkdir -p $out/lib $out/include
+    cp libargp.a $out/lib
+    cp argp.h $out/include
+  '';
+
+  doCheck = true;
+
+  makeFlags = [ "AR:=$(AR)" ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://www.lysator.liu.se/~nisse/misc/";
+    description = "Standalone version of arguments parsing functions from GLIBC";
+    platforms = with platforms; darwin ++ linux;
+    maintainers = with maintainers; [ amar1729 ];
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/argtable/default.nix b/nixpkgs/pkgs/development/libraries/argtable/default.nix
new file mode 100644
index 000000000000..a16885ab2549
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/argtable/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "argtable";
+  version = "3.1.5";
+  srcVersion = "v${version}.1c1bb23";
+
+  src = fetchFromGitHub {
+    owner = "argtable";
+    repo = "argtable3";
+    rev = srcVersion;
+    sha256 = "sha256-sL6mnxsuL1K0DY26jLF/2Czo0RxHYJ3xU3VyavISiMM=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  postPatch = ''
+    patchShebangs tools/build
+  '';
+
+  meta = with lib; {
+    homepage = "https://argtable.org";
+    description = "A single-file, ANSI C command-line parsing library";
+    longDescription = ''
+      Argtable is an open source ANSI C library that parses GNU-style
+      command-line options. It simplifies command-line parsing by defining a
+      declarative-style API that you can use to specify what your command-line
+      syntax looks like. Argtable will automatically generate consistent error
+      handling logic and textual descriptions of the command line syntax, which
+      are essential but tedious to implement for a robust CLI program.
+    '';
+    license = with licenses; bsd3;
+    maintainers = with maintainers; [ AndersonTorres artuuge ];
+    platforms = with platforms; all;
+  };
+}
+# TODO [ AndersonTorres ]: a NixOS test suite
diff --git a/nixpkgs/pkgs/development/libraries/arguments/default.nix b/nixpkgs/pkgs/development/libraries/arguments/default.nix
new file mode 100644
index 000000000000..85dafde83c27
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/arguments/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "arguments";
+  name  = "${pname}-2015-11-30";
+
+  owner = "BIC-MNI";
+
+  src = fetchFromGitHub {
+    inherit owner;
+    repo   = pname;
+    rev    = "b3aad97f6b6892cb8733455d0d448649a48fa108";
+    sha256 = "1ar8lm1w1jflz3vdmjr5c4x6y7rscvrj78b8gmrv79y95qrgzv6s";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ ];
+
+  #cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib" "-DBICPL_DIR=${bicpl}/lib" ];
+
+  doCheck = false;
+  # internal_volume_io.h: No such file or directory
+
+  meta = with lib; {
+    homepage = "https://github.com/${owner}/${pname}";
+    description = "Library for argument handling for MINC programs";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license   = licenses.free;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/aribb25/default.nix b/nixpkgs/pkgs/development/libraries/aribb25/default.nix
new file mode 100644
index 000000000000..3e171d757973
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aribb25/default.nix
@@ -0,0 +1,57 @@
+{ stdenv
+, lib
+, fetchFromGitLab
+, fetchpatch
+, autoreconfHook
+, pkg-config
+, pcsclite
+, PCSC
+, xcbuild
+}:
+
+stdenv.mkDerivation rec {
+  pname = "aribb25";
+  # FIXME: change the rev for fetchFromGitLab in next release
+  version = "0.2.7";
+
+  src = fetchFromGitLab {
+    domain = "code.videolan.org";
+    owner = "videolan";
+    repo = pname;
+    # rev = version; FIXME: uncomment in next release
+    rev = "c14938692b313b5ba953543fd94fd1cad0eeef18"; # 0.2.7 with build fixes
+    sha256 = "1kb9crfqib0npiyjk4zb63zqlzbhqm35nz8nafsvdjd71qbd2amp";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+  ] ++ lib.optional stdenv.isDarwin xcbuild;
+  buildInputs = if stdenv.isDarwin then [ PCSC ] else [ pcsclite ];
+
+  patches = let
+    url = commit: "https://code.videolan.org/videolan/${pname}/-/commit/${commit}.diff";
+  in [
+    (fetchpatch {
+      name = "make-cli-pipes-work-1.patch";
+      url = url "0425184dbf3fdaf59854af5f530da88b2196a57b";
+      sha256 = "0ysm2jivpnqxz71vw1102616qxww2gx005i0c5lhi6jbajqsa1cd";
+    })
+    (fetchpatch {
+      name = "make-cli-pipes-work-2.patch";
+      url = url "cebabeab2bda065dca1c9f033b42d391be866d86";
+      sha256 = "1283kqv1r4rbaba0sv2hphkhcxgjkmh8ndlcd24fhx43nn63hd28";
+    })
+  ];
+
+  buildFlags =
+    lib.optional stdenv.isDarwin "pcsclite_CFLAGS=-I${PCSC}/Library/Frameworks/PCSC.framework/Headers";
+
+  meta = with lib; {
+    homepage = "https://code.videolan.org/videolan/aribb25";
+    description = "Sample implementation of the ARIB STD-B25 standard";
+    platforms = platforms.all;
+    license = licenses.isc;
+    maintainers = with maintainers; [ midchildan ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/armadillo/default.nix b/nixpkgs/pkgs/development/libraries/armadillo/default.nix
new file mode 100644
index 000000000000..6e9f67a9a33c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/armadillo/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, cmake, blas, lapack, superlu, hdf5 }:
+
+stdenv.mkDerivation rec {
+  pname = "armadillo";
+  version = "10.6.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/arma/armadillo-${version}.tar.xz";
+    sha256 = "sha256-KoA9b4921AfbnBXtw4lJZSOMjliflMyQeoNz7pRXKKg=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ blas lapack superlu hdf5 ];
+
+  cmakeFlags = [
+    "-DLAPACK_LIBRARY=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
+    "-DDETECT_HDF5=ON"
+  ];
+
+  patches = [ ./use-unix-config-on-OS-X.patch ];
+
+  meta = with lib; {
+    description = "C++ linear algebra library";
+    homepage = "http://arma.sourceforge.net";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ juliendehos knedlsepp ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/armadillo/use-unix-config-on-OS-X.patch b/nixpkgs/pkgs/development/libraries/armadillo/use-unix-config-on-OS-X.patch
new file mode 100644
index 000000000000..a1442d141193
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/armadillo/use-unix-config-on-OS-X.patch
@@ -0,0 +1,10 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -152,6 +152,7 @@ message(STATUS "DETECT_HDF5                = ${DETECT_HDF5}"               )
+
+ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/cmake_aux/Modules/")
+
++set(APPLE false)
+ if(APPLE)
+   
+   set(ARMA_OS macos)
diff --git a/nixpkgs/pkgs/development/libraries/arpa2common/default.nix b/nixpkgs/pkgs/development/libraries/arpa2common/default.nix
new file mode 100644
index 000000000000..7fcb2a945e8f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/arpa2common/default.nix
@@ -0,0 +1,58 @@
+{ lib
+, stdenv
+, fetchFromGitLab
+, cmake
+
+, arpa2cm
+, doxygen
+, e2fsprogs
+, lmdb
+, openssl
+, pkg-config
+, ragel
+}:
+
+stdenv.mkDerivation rec {
+  pname = "arpa2common";
+  version = "2.2.14";
+
+  src = fetchFromGitLab {
+    owner = "arpa2";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-LWsWoHRdLWRSF9JaEwrw+CXm5Azgh7zNeq0a8Z/hijQ=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    arpa2cm
+    doxygen
+    pkg-config
+  ];
+
+  propagatedBuildInputs = [
+    e2fsprogs
+    lmdb
+    openssl
+    ragel
+  ];
+
+  # the project uses single argument `printf` throughout the program
+  hardeningDisable = [ "format" ];
+
+  meta = {
+    description =
+      "ARPA2 ID and ACL libraries and other core data structures for ARPA2";
+    longDescription = ''
+      The ARPA2 Common Library package offers elementary services that can
+      benefit many software packages.  They are designed to be easy to
+      include, with a minimum of dependencies.  At the same time, they were
+      designed with the InternetWide Architecture in mind, thus helping to
+      liberate users.
+    '';
+    homepage = "https://gitlab.com/arpa2/arpa2common";
+    license = with lib.licenses; [ bsd2 cc-by-sa-40 cc0 isc ];
+    maintainers = with lib.maintainers; [ fufexan ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/arrayfire/default.nix b/nixpkgs/pkgs/development/libraries/arrayfire/default.nix
new file mode 100644
index 000000000000..a66db4800177
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/arrayfire/default.nix
@@ -0,0 +1,67 @@
+{ lib, stdenv, fetchurl, fetchFromGitHub, cmake, pkg-config
+, opencl-clhpp, ocl-icd, fftw, fftwFloat
+, blas, lapack, boost, mesa, libGLU, libGL
+, freeimage, python3, clfft, clblas
+, doxygen, buildDocs ? false
+, cudaSupport ? false, cudatoolkit
+}:
+
+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"
+  ] ++ lib.optional cudaSupport "-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 = lib.optionalString cudaSupport ''
+    export CUDA_PATH="${cudatoolkit}"
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    python3
+  ];
+
+  strictDeps = true;
+
+  buildInputs = [
+    opencl-clhpp fftw fftwFloat
+    blas lapack
+    libGLU libGL
+    mesa freeimage
+    boost.out boost.dev
+  ] ++ (lib.optional stdenv.isLinux ocl-icd)
+    ++ (lib.optional cudaSupport cudatoolkit)
+    ++ (lib.optional buildDocs doxygen);
+
+  meta = with 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/darwin.patch b/nixpkgs/pkgs/development/libraries/arrow-cpp/darwin.patch
new file mode 100644
index 000000000000..de9b1986ffed
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/arrow-cpp/darwin.patch
@@ -0,0 +1,11 @@
+diff --git a/cmake_modules/FindPythonLibsNew.cmake b/cmake_modules/FindPythonLibsNew.cmake
+--- a/cmake_modules/FindPythonLibsNew.cmake
++++ b/cmake_modules/FindPythonLibsNew.cmake
+@@ -117,6 +117,7 @@ list(GET _PYTHON_VALUES 6 PYTHON_SIZEOF_VOID_P)
+ list(GET _PYTHON_VALUES 7 PYTHON_LIBRARY_SUFFIX)
+ list(GET _PYTHON_VALUES 8 PYTHON_LIBRARY_PATH)
+ list(GET _PYTHON_VALUES 9 PYTHON_OTHER_LIBS)
++string(REPLACE "-lncurses" "" PYTHON_OTHER_LIBS "${PYTHON_OTHER_LIBS}")
+ 
+ # Make sure the Python has the same pointer-size as the chosen compiler
+ # Skip the check on OS X, it doesn't consistently have CMAKE_SIZEOF_VOID_P defined
diff --git a/nixpkgs/pkgs/development/libraries/arrow-cpp/default.nix b/nixpkgs/pkgs/development/libraries/arrow-cpp/default.nix
new file mode 100644
index 000000000000..bea566174689
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/arrow-cpp/default.nix
@@ -0,0 +1,156 @@
+{ stdenv, lib, fetchurl, fetchFromGitHub, fixDarwinDylibNames
+, autoconf, boost, brotli, cmake, flatbuffers, gflags, glog, gtest, lz4
+, perl, python3, rapidjson, re2, snappy, thrift, utf8proc, which, xsimd
+, zlib, zstd
+, enableShared ? !stdenv.hostPlatform.isStatic
+}:
+
+let
+  arrow-testing = fetchFromGitHub {
+    owner = "apache";
+    repo = "arrow-testing";
+    rev = "6d98243093c0b36442da94de7010f3eacc2a9909";
+    hash = "sha256-n57Fuz2k6sX1o3vYBmC41eRKGnyt9+YL5r3WTHHRRzw=";
+  };
+
+  parquet-testing = fetchFromGitHub {
+    owner = "apache";
+    repo = "parquet-testing";
+    rev = "ddd898958803cb89b7156c6350584d1cda0fe8de";
+    hash = "sha256-gK04mj1Fuhkf82NDMrXplFa+cr/3Ij7I9VnYfinuJlg=";
+  };
+
+in stdenv.mkDerivation rec {
+  pname = "arrow-cpp";
+  version = "5.0.0";
+
+  src = fetchurl {
+    url =
+      "mirror://apache/arrow/arrow-${version}/apache-arrow-${version}.tar.gz";
+    hash = "sha256-w7QxPspZTCD3Yag2cZchqvB2AAGviWuuw6tkQg/5kQo=";
+  };
+  sourceRoot = "apache-arrow-${version}/cpp";
+
+  ARROW_JEMALLOC_URL = fetchurl {
+    # From
+    # ./cpp/cmake_modules/ThirdpartyToolchain.cmake
+    # ./cpp/thirdparty/versions.txt
+    url =
+      "https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2";
+    hash = "sha256-NDMOXOJ2CZ4uiVDZM121qHVomkxqVnUe87HYxTf4h/Y=";
+  };
+
+  ARROW_MIMALLOC_URL = fetchurl {
+    # From
+    # ./cpp/cmake_modules/ThirdpartyToolchain.cmake
+    # ./cpp/thirdparty/versions.txt
+    url =
+      "https://github.com/microsoft/mimalloc/archive/v1.7.2.tar.gz";
+    hash = "sha256-sZEuNUVlpLaYQQ91g8D4OTSm27Ot5Uq33csVaTIJNr0=";
+  };
+
+  patches = [
+    # patch to fix python-test
+    ./darwin.patch
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    autoconf # for vendored jemalloc
+    flatbuffers
+  ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
+  buildInputs = [
+    boost
+    brotli
+    flatbuffers
+    gflags
+    glog
+    gtest
+    lz4
+    rapidjson
+    re2
+    snappy
+    thrift
+    utf8proc
+    zlib
+    zstd
+  ] ++ lib.optionals enableShared [
+    python3.pkgs.python
+    python3.pkgs.numpy
+  ];
+
+  preConfigure = ''
+    patchShebangs build-support/
+  '';
+
+  cmakeFlags = [
+    "-DCMAKE_FIND_PACKAGE_PREFER_CONFIG=ON"
+    "-DARROW_BUILD_SHARED=${if enableShared then "ON" else "OFF"}"
+    "-DARROW_BUILD_STATIC=${if enableShared then "OFF" else "ON"}"
+    "-DARROW_BUILD_TESTS=ON"
+    "-DARROW_VERBOSE_THIRDPARTY_BUILD=ON"
+    "-DARROW_DEPENDENCY_SOURCE=SYSTEM"
+    "-DARROW_DEPENDENCY_USE_SHARED=${if enableShared then "ON" else "OFF"}"
+    "-DARROW_COMPUTE=ON"
+    "-DARROW_CSV=ON"
+    "-DARROW_DATASET=ON"
+    "-DARROW_JSON=ON"
+    "-DARROW_PLASMA=ON"
+    # Disable Python for static mode because openblas is currently broken there.
+    "-DARROW_PYTHON=${if enableShared then "ON" else "OFF"}"
+    "-DARROW_USE_GLOG=ON"
+    "-DARROW_WITH_BROTLI=ON"
+    "-DARROW_WITH_LZ4=ON"
+    "-DARROW_WITH_SNAPPY=ON"
+    "-DARROW_WITH_UTF8PROC=ON"
+    "-DARROW_WITH_ZLIB=ON"
+    "-DARROW_WITH_ZSTD=ON"
+    "-DARROW_MIMALLOC=ON"
+    # Parquet options:
+    "-DARROW_PARQUET=ON"
+    "-DPARQUET_BUILD_EXECUTABLES=ON"
+  ] ++ lib.optionals (!enableShared) [
+    "-DARROW_TEST_LINKAGE=static"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "-DCMAKE_SKIP_BUILD_RPATH=OFF" # needed for tests
+    "-DCMAKE_INSTALL_RPATH=@loader_path/../lib" # needed for tools executables
+  ] ++ lib.optional (!stdenv.isx86_64) "-DARROW_USE_SIMD=OFF";
+
+  ARROW_XSIMD_URL = xsimd.src;
+
+  doInstallCheck = true;
+  ARROW_TEST_DATA =
+    if doInstallCheck then "${arrow-testing}/data" else null;
+  PARQUET_TEST_DATA =
+    if doInstallCheck then "${parquet-testing}/data" else null;
+  GTEST_FILTER =
+    if doInstallCheck then let
+      # Upstream Issue: https://issues.apache.org/jira/browse/ARROW-11398
+      filteredTests = lib.optionals stdenv.hostPlatform.isAarch64 [
+        "TestFilterKernelWithNumeric/3.CompareArrayAndFilterRandomNumeric"
+        "TestFilterKernelWithNumeric/7.CompareArrayAndFilterRandomNumeric"
+        "TestCompareKernel.PrimitiveRandomTests"
+      ];
+    in "-${builtins.concatStringsSep ":" filteredTests}" else null;
+  installCheckInputs = [ perl which ];
+  installCheckPhase =
+  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 = with lib; {
+    description = "A  cross-language development platform for in-memory data";
+    homepage = "https://arrow.apache.org/";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ tobim veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/asio/1.10.nix b/nixpkgs/pkgs/development/libraries/asio/1.10.nix
new file mode 100644
index 000000000000..f63fbbd495cb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/asio/1.10.nix
@@ -0,0 +1,6 @@
+{callPackage, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  version = "1.10.8";
+  sha256 = "0jgdl4fxw0hwy768rl3lhdc0czz7ak7czf3dg10j21pdpfpfvpi6";
+})
diff --git a/nixpkgs/pkgs/development/libraries/asio/default.nix b/nixpkgs/pkgs/development/libraries/asio/default.nix
new file mode 100644
index 000000000000..9c89b27d371f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/asio/default.nix
@@ -0,0 +1,6 @@
+{callPackage, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  version = "1.16.1";
+  sha256 = "1333ca6lnsdck4fsgjpbqf4lagxsnbg9970wxlsrinmwvdvdnwg2";
+})
diff --git a/nixpkgs/pkgs/development/libraries/asio/generic.nix b/nixpkgs/pkgs/development/libraries/asio/generic.nix
new file mode 100644
index 000000000000..8bcc12ae2b3a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/asio/generic.nix
@@ -0,0 +1,27 @@
+{lib, stdenv, fetchurl, boost, openssl
+, version, sha256, ...
+}:
+
+with lib;
+
+stdenv.mkDerivation {
+  pname = "asio";
+  inherit version;
+
+  src = fetchurl {
+    url = "mirror://sourceforge/asio/asio-${version}.tar.bz2";
+    inherit sha256;
+  };
+
+  propagatedBuildInputs = [ boost ];
+
+  buildInputs = [ openssl ];
+
+  meta = {
+    homepage = "http://asio.sourceforge.net/";
+    description = "Cross-platform C++ library for network and low-level I/O programming";
+    license = licenses.boost;
+    broken = stdenv.isDarwin && lib.versionOlder version "1.16.1";
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/aspell/aspell-with-dicts.nix b/nixpkgs/pkgs/development/libraries/aspell/aspell-with-dicts.nix
new file mode 100644
index 000000000000..88b1302271fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aspell/aspell-with-dicts.nix
@@ -0,0 +1,36 @@
+# Create a derivation that contains aspell and selected dictionaries.
+# Composition is done using `pkgs.buildEnv`.
+# Beware of that `ASPELL_CONF` used by this derivation is not always
+# respected by libaspell (#28815) and in some cases, when used as
+# dependency by another derivation, the passed dictionaries will be
+# missing. However, invoking aspell directly should be fine.
+
+{ aspell
+, aspellDicts
+, makeWrapper
+, buildEnv
+}:
+
+f:
+
+let
+  # Dictionaries we want
+  dicts = f aspellDicts;
+
+in buildEnv {
+  name = "aspell-env";
+  buildInputs = [ makeWrapper ];
+  paths = [ aspell ] ++ dicts;
+  postBuild = ''
+    # Construct wrappers in /bin
+    unlink "$out/bin"
+    mkdir -p "$out/bin"
+    pushd "${aspell}/bin"
+    for prg in *; do
+      if [ -f "$prg" ]; then
+        makeWrapper "${aspell}/bin/$prg" "$out/bin/$prg" --set ASPELL_CONF "dict-dir $out/lib/aspell"
+      fi
+    done
+    popd
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/aspell/clang.patch b/nixpkgs/pkgs/development/libraries/aspell/clang.patch
new file mode 100644
index 000000000000..c4cfa426588c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aspell/clang.patch
@@ -0,0 +1,18 @@
+--- interfaces/cc/aspell.h	2013-10-13 20:29:33.000000000 +0200
++++ interfaces/cc/aspell.h	2013-10-13 20:30:01.000000000 +0200
+@@ -237,6 +237,7 @@
+ /******************************** errors ********************************/
+ 
+ 
++#ifndef __cplusplus
+ extern const struct AspellErrorInfo * const aerror_other;
+ extern const struct AspellErrorInfo * const aerror_operation_not_supported;
+ extern const struct AspellErrorInfo * const   aerror_cant_copy;
+@@ -322,6 +323,7 @@
+ extern const struct AspellErrorInfo * const   aerror_bad_magic;
+ extern const struct AspellErrorInfo * const aerror_expression;
+ extern const struct AspellErrorInfo * const   aerror_invalid_expression;
++#endif
+ 
+ 
+ /******************************* speller *******************************/
diff --git a/nixpkgs/pkgs/development/libraries/aspell/data-dirs-from-nix-profiles.patch b/nixpkgs/pkgs/development/libraries/aspell/data-dirs-from-nix-profiles.patch
new file mode 100644
index 000000000000..c19827ba93e4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aspell/data-dirs-from-nix-profiles.patch
@@ -0,0 +1,38 @@
+diff --git a/common/info.cpp b/common/info.cpp
+index 8291cc7..6216326 100644
+--- a/common/info.cpp
++++ b/common/info.cpp
+@@ -36,6 +36,7 @@
+ #include "strtonum.hpp"
+ #include "lock.hpp"
+ #include "string_map.hpp"
++#include "file_util.hpp"
+ 
+ #include "gettext.h"
+ 
+@@ -495,6 +496,25 @@ namespace acommon {
+     lst.clear();
+     lst.add(config->retrieve("data-dir"));
+     lst.add(config->retrieve("dict-dir"));
++    if (config->lookup("data-dir") == NULL && config->lookup("dict-dir") == NULL) {
++        const char* cprofiles = getenv("NIX_PROFILES");
++        if (cprofiles != NULL) {
++            char* profiles = strdup(cprofiles);
++            char* profile = profiles;
++            char* end = profile;
++            while (*end != '\0') {
++                if (*end == ' ') {
++                    *end = '\0';
++                    lst.add(add_possible_dir(profile, "lib/aspell"));
++                    profile = ++end;
++                } else {
++                    ++end;
++                }
++            }
++            lst.add(add_possible_dir(profile, "lib/aspell"));
++            free(profiles);
++        }
++    }
+   }
+ 
+   DictExt::DictExt(ModuleInfo * m, const char * e)
diff --git a/nixpkgs/pkgs/development/libraries/aspell/default.nix b/nixpkgs/pkgs/development/libraries/aspell/default.nix
new file mode 100644
index 000000000000..777bad1e5a53
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aspell/default.nix
@@ -0,0 +1,65 @@
+{ lib, stdenv, fetchurl, fetchpatch, fetchzip, perl
+, searchNixProfiles ? true
+}:
+
+let
+
+  # Source for u-deva.cmap and u-deva.cset: use the Marathi
+  # dictionary like Debian does.
+  devaMapsSource = fetchzip {
+    name = "aspell-u-deva";
+    url = "https://ftp.gnu.org/gnu/aspell/dict/mr/aspell6-mr-0.10-0.tar.bz2";
+    sha256 = "1v8cdl8x2j1d4vbvsq1xrqys69bbccd6mi03fywrhkrrljviyri1";
+  };
+
+in
+
+stdenv.mkDerivation rec {
+  pname = "aspell";
+  version = "0.60.8";
+
+  src = fetchurl {
+    url = "mirror://gnu/aspell/aspell-${version}.tar.gz";
+    sha256 = "1wi60ankalmh8ds7nplz434jd7j94gdvbahdwsr539rlad8pxdzr";
+  };
+
+  patches = [
+    (fetchpatch {
+      #  objstack: assert that the alloc size will fit within a chunk
+      name = "CVE-2019-25051.patch";
+      url = "https://github.com/gnuaspell/aspell/commit/0718b375425aad8e54e1150313b862e4c6fd324a.patch";
+      sha256 = "03z259xrk41x3j190gaprf3mqysyfgh3a04rjmch3h625vj95x39";
+    })
+  ] ++ lib.optional searchNixProfiles ./data-dirs-from-nix-profiles.patch;
+
+  postPatch = ''
+    patch interfaces/cc/aspell.h < ${./clang.patch}
+  '';
+
+  nativeBuildInputs = [ perl ];
+  buildInputs = [ perl ];
+
+  doCheck = true;
+
+  preConfigure = ''
+    configureFlagsArray=(
+      --enable-pkglibdir=$out/lib/aspell
+      --enable-pkgdatadir=$out/lib/aspell
+    );
+  '';
+
+  # Include u-deva.cmap and u-deva.cset in the aspell package
+  # to avoid conflict between 'mr' and 'hi' dictionaries as they
+  # both include those files.
+  postInstall = ''
+    cp ${devaMapsSource}/u-deva.{cmap,cset} $out/lib/aspell/
+  '';
+
+  meta = {
+    description = "Spell checker for many languages";
+    homepage = "http://aspell.net/";
+    license = lib.licenses.lgpl2Plus;
+    maintainers = [ ];
+    platforms = with lib.platforms; all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/aspell/dictionaries.nix b/nixpkgs/pkgs/development/libraries/aspell/dictionaries.nix
new file mode 100644
index 000000000000..81f4bb6c2dce
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aspell/dictionaries.nix
@@ -0,0 +1,950 @@
+{lib, stdenv, fetchurl, aspell, which, writeScript}:
+
+with lib;
+
+/* HOWTO:
+
+   * Add some of these to your profile or systemPackages.
+
+     ~~~~
+     environment.systemPackages = [
+       aspell
+       aspellDicts.en
+       aspellDicts.en-computers
+       aspellDicts.en-science
+     ];
+     ~~~~
+
+   * Rebuild and switch to the new profile.
+   * Add something like
+
+     ~~~~
+     master en_US
+     extra-dicts en-computers.rws
+     add-extra-dicts en_US-science.rws
+     ~~~~
+
+     to `/etc/aspell.conf` or `~/.aspell.conf`.
+   * Check that `aspell -a` starts without errors.
+   * (optional) Check your config with `aspell dump config | grep -vE '^(#|$)'`.
+   * Enjoy.
+
+*/
+
+let
+
+  /* Function to compile an Aspell dictionary.  Fortunately, they all
+     build in the exact same way. */
+  buildDict =
+    {shortName, fullName, ...}@args:
+
+    stdenv.mkDerivation ({
+      name = "aspell-dict-${shortName}";
+
+      buildInputs = [aspell which];
+
+      dontAddPrefix = true;
+
+      preBuild = "makeFlagsArray=(dictdir=$out/lib/aspell datadir=$out/lib/aspell)";
+
+      meta = {
+        description = "Aspell dictionary for ${fullName}";
+        platforms = lib.platforms.all;
+      } // (args.meta or {});
+    } // removeAttrs args [ "meta" ]);
+
+
+  buildOfficialDict =
+    {language, version, filename, fullName, sha256, ...}@args:
+    let buildArgs = {
+      shortName = "${language}-${version}";
+
+      src = fetchurl {
+        url = "mirror://gnu/aspell/dict/${language}/${filename}-${language}-${version}.tar.bz2";
+        inherit sha256;
+      };
+
+      /* Remove any instances of u-deva.cmap and u-deva.cset since
+         they are included in the main aspell package and can
+         cause conflicts otherwise. */
+      postInstall = ''
+        rm -f $out/lib/aspell/u-deva.{cmap,cset}
+      '';
+
+      passthru.updateScript = writeScript "update-aspellDict-${language}" ''
+        #!/usr/bin/env nix-shell
+        #!nix-shell -i bash -p nix curl gnused common-updater-scripts
+        set -eu -o pipefail
+
+        # List tarballs in the dictionary's subdirectory via HTTPS and
+        # the simple list method of Apache's mod_autoindex.
+        #
+        # Catalan dictionary has an exception where an earlier version
+        # compares as newer because the versioning scheme has changed.
+        versions=$(
+            echo '[';
+            curl -s 'https://ftp.gnu.org/gnu/aspell/dict/${language}/?F=0' | \
+                sed -r 's/.* href="${filename}-${language}-([A-Za-z0-9_+.-]+)\.tar\.bz2".*/"\1"/;t;d' | \
+                if [ '${language}' = "ca" ]; then grep -v 20040130-1; else cat; fi; \
+            echo ']')
+
+        # Sort versions in descending order using Nix's and take the first as the latest.
+        sortVersions="(with builtins; head (sort (a: b: compareVersions a b > 0) $versions))"
+        # nix-instantiate outputs Nix strings (with quotes), so remove them to get
+        # a result similar to `nix eval --raw`.
+        latestVersion=$(nix-instantiate --eval --expr "$sortVersions" | tr -d '"')
+
+        update-source-version aspellDicts.${language} "$latestVersion"
+      '';
+
+      meta = {
+        homepage = "http://ftp.gnu.org/gnu/aspell/dict/0index.html";
+      } // (args.meta or {});
+
+    } // removeAttrs args [ "language" "filename" "sha256" "meta" ];
+    in buildDict buildArgs;
+
+  /* Function to compile txt dict files into Aspell dictionaries. */
+  buildTxtDict =
+    {langInputs ? [], ...}@args:
+    buildDict ({
+      propagatedUserEnvPackages = langInputs;
+
+      preBuild = ''
+        # Aspell can't handle multiple data-dirs
+        # Copy everything we might possibly need
+        ${concatMapStringsSep "\n" (p: ''
+          cp -a ${p}/lib/aspell/* .
+        '') ([ aspell ] ++ langInputs)}
+        export ASPELL_CONF="data-dir $(pwd)"
+
+        aspell-create() {
+          target=$1
+          shift
+          echo building $target
+          aspell create "$@" master ./$target.rws
+        }
+
+        words-only() {
+          awk -F'\t' '{print $1}' | sort | uniq
+        }
+
+        # drop comments
+        aspell-affix() {
+          words-only \
+            | grep -a -v '#' \
+            | aspell-create "$@"
+        }
+
+        # Hack: drop comments and words with affixes
+        aspell-plain() {
+          words-only \
+            | grep -a -v '#' \
+            | grep -a -v '/' \
+            | aspell-create "$@"
+        }
+
+        aspell-install() {
+          install -d $out/lib/aspell
+          for a in "$@"; do
+            echo installing $a
+            install -t $out/lib/aspell $a.rws
+          done
+        }
+      '';
+
+      dontUnpack = true;
+    } // args);
+
+in rec {
+
+  ### Languages
+
+  af = buildOfficialDict {
+    language = "af";
+    version = "0.50-0";
+    fullName = "Afrikaans";
+    filename = "aspell";
+    sha256 = "00p6k2ndi0gzfr5fkbvx4hkcpj223pidjvmxg0r384arrap00q4x";
+  };
+
+  am = buildOfficialDict {
+    language = "am";
+    version = "0.03-1";
+    fullName = "Amharic";
+    filename = "aspell6";
+    sha256 = "11ylp7gjq94wfacyawvp391lsq26rl1b84f268rjn7l7z0hxs9xz";
+  };
+
+  ar = buildOfficialDict {
+    language = "ar";
+    version = "1.2-0";
+    fullName = "Arabic";
+    filename = "aspell6";
+    sha256 = "1avw40bp8yi5bnkq64ihm2rldgw34lk89yz281q9bmndh95a47h4";
+  };
+
+  ast = buildOfficialDict {
+    language = "ast";
+    version = "0.01";
+    fullName = "Asturian";
+    filename = "aspell6";
+    sha256 = "14hg85mxcyvdigf96yvslk7f3v9ngdsxn85qpgwkg31k3k83xwj3";
+  };
+
+  az = buildOfficialDict {
+    language = "az";
+    version = "0.02-0";
+    fullName = "Azerbaijani";
+    filename = "aspell6";
+    sha256 = "1hs4h1jscpxf9f9iyk6mvjqsnhkf0yslkbjhjkasqqcx8pn7cc86";
+  };
+
+  be = buildOfficialDict {
+    language = "be";
+    version = "0.01";
+    fullName = "Belarusian";
+    filename = "aspell5";
+    sha256 = "1svls9p7rsfi3hs0afh0cssj006qb4v1ik2yzqgj8hm10c6as2sm";
+  };
+
+  bg = buildOfficialDict {
+    language = "bg";
+    version = "4.1-0";
+    fullName = "Bulgarian";
+    filename = "aspell6";
+    sha256 = "1alacmgpfk0yrgq83y23d16fhav1bxmb98kg8d2a5r9bvh2h0mvl";
+  };
+
+  bn = buildOfficialDict {
+    language = "bn";
+    version = "0.01.1-1";
+    fullName = "Bengali";
+    filename = "aspell6";
+    sha256 = "1nc02jd67iggirwxnhdvlvaqm0xfyks35c4psszzj3dhzv29qgxh";
+  };
+
+  br = buildOfficialDict {
+    language = "br";
+    version = "0.50-2";
+    fullName = "Breton";
+    filename = "aspell";
+    sha256 = "0fradnm8424bkq9a9zhpl2132dk7y95xmw45sy1c0lx6rinjl4n2";
+  };
+
+  ca = buildOfficialDict {
+    language = "ca";
+    version = "2.1.5-1";
+    fullName = "Catalan";
+    filename = "aspell6";
+    sha256 = "1fb5y5kgvk25nlsfvc8cai978hg66x3pbp9py56pldc7vxzf9npb";
+  };
+
+  cs = buildOfficialDict {
+    language = "cs";
+    version = "20040614-1";
+    fullName = "Czech";
+    filename = "aspell6";
+    sha256 = "0rihj4hsw96pd9casvmpvw3r8040pfa28p1h73x4vyn20zwr3h01";
+  };
+
+  csb = buildOfficialDict {
+    language = "csb";
+    version = "0.02-0";
+    fullName = "Kashubian";
+    filename = "aspell6";
+    sha256 = "1612ypkm684wjvc7n081i87mlrrzif9simc7kyn177hfsl3ssrn1";
+  };
+
+  cy = buildOfficialDict {
+    language = "cy";
+    version = "0.50-3";
+    fullName = "Welsh";
+    filename = "aspell";
+    sha256 = "15vq601lzz1gi311xym4bv9lv1k21xcfn50jmzamw7h6f36rsffm";
+  };
+
+  da = buildOfficialDict {
+    language = "da";
+    version = "1.4.42-1";
+    fullName = "Danish";
+    filename = "aspell5";
+    sha256 = "1hfkmiyhgrx5lgrb2mffjbdn1hivrm73wcg7x0iid74p2yb0fjpp";
+  };
+
+  de = buildOfficialDict {
+    language = "de";
+    version = "20161207-7-0";
+    fullName = "German";
+    filename = "aspell6";
+    sha256 = "0wamclvp66xfmv5wff96v6gdlnfv4y8lx3f8wvxyzm5imwgms4n2";
+  };
+
+  de-alt = buildOfficialDict {
+    language = "de-alt";
+    version = "2.1-1";
+    fullName = "German - Old Spelling";
+    filename = "aspell6";
+    sha256 = "0wwc2l29svv3fv041fh6vfa5m3hi9q9pkbxibzq1ysrsfin3rl9n";
+  };
+
+  el = buildOfficialDict {
+    language = "el";
+    version = "0.08-0";
+    fullName = "Greek";
+    filename = "aspell6";
+    sha256 = "1ljcc30zg2v2h3w5h5jr5im41mw8jbsgvvhdd2cii2yzi8d0zxja";
+  };
+
+  en = buildOfficialDict {
+    language = "en";
+    version = "2020.12.07-0";
+    fullName = "English";
+    filename = "aspell6";
+    sha256 = "1cwzqkm8gr1w51rpckwlvb43sb0b5nbwy7s8ns5vi250515773sc";
+  };
+
+  eo = buildOfficialDict {
+    language = "eo";
+    version = "2.1.20000225a-2";
+    fullName = "Esperanto";
+    filename = "aspell6";
+    sha256 = "09vf0mbiicbmyb4bwb7v7lgpabnylg0wy7m3hlhl5rjdda6x3lj1";
+  };
+
+  es = buildOfficialDict {
+    language = "es";
+    version = "1.11-2";
+    fullName = "Spanish";
+    filename = "aspell6";
+    sha256 = "1k5g328ac1hdpp6fsg57d8md6i0aqcwlszp3gbmp5706wyhpydmd";
+  };
+
+  et = buildOfficialDict {
+    language = "et";
+    version = "0.1.21-1";
+    fullName = "Estonian";
+    filename = "aspell6";
+    sha256 = "0jdjfa2fskirhnb70fy86xryp9r6gkl729ib8qcjmsma7nm5gs5i";
+  };
+
+  fa = buildOfficialDict {
+    language = "fa";
+    version = "0.11-0";
+    fullName = "Persian";
+    filename = "aspell6";
+    sha256 = "0nz1ybwv56q7nl9ip12hfmdch1vyyq2j55bkjcns13lshzm2cba8";
+  };
+
+  fi = buildOfficialDict {
+    language = "fi";
+    version = "0.7-0";
+    fullName = "Finnish";
+    filename = "aspell6";
+    sha256 = "07d5s08ba4dd89cmwy9icc01i6fjdykxlb9ravmhdrhi8mxz1mzq";
+  };
+
+  fo = buildOfficialDict {
+    language = "fo";
+    version = "0.2.16-1";
+    fullName = "Faroese";
+    filename = "aspell5";
+    sha256 = "022yz5lll20xrzizcyb7wksm3fgwklnvgnir5la5qkxv770dvq7p";
+  };
+
+  fr = buildOfficialDict {
+    language = "fr";
+    version = "0.50-3";
+    fullName = "French";
+    filename = "aspell";
+    sha256 = "14ffy9mn5jqqpp437kannc3559bfdrpk7r36ljkzjalxa53i0hpr";
+  };
+
+  fy = buildOfficialDict {
+    language = "fy";
+    version = "0.12-0";
+    fullName = "Frisian";
+    filename = "aspell6";
+    sha256 = "1almi6n4ni91d0rzrk8ig0473m9ypbwqmg56hchz76j51slwyirl";
+  };
+
+  ga = buildOfficialDict {
+    language = "ga";
+    version = "4.5-0";
+    fullName = "Irish";
+    filename = "aspell5";
+    sha256 = "0y869mmvfb3bzadfgajwa2rfb0xfhi6m9ydwgxkb9v2claydnps5";
+  };
+
+  gd = buildOfficialDict {
+    language = "gd";
+    version = "0.1.1-1";
+    fullName = "Scottish Gaelic";
+    filename = "aspell5";
+    sha256 = "0a89irv5d65j5m9sb0k36851x5rs0wij12gb2m6hv2nsfn5a05p3";
+  };
+
+  gl = buildOfficialDict {
+    language = "gl";
+    version = "0.5a-2";
+    fullName = "Galician";
+    filename = "aspell6";
+    sha256 = "12pwghmy18fcdvf9hvhb4q6shi339hb1kwxpkz0bhw0yjxjwzkdk";
+  };
+
+  grc = buildOfficialDict {
+    language = "grc";
+    version = "0.02-0";
+    fullName = "Ancient Greek";
+    filename = "aspell6";
+    sha256 = "1zxr8958v37v260fkqd4pg37ns5h5kyqm54hn1hg70wq5cz8h512";
+  };
+
+  gu = buildOfficialDict {
+    language = "gu";
+    version = "0.03-0";
+    fullName = "Gujarati";
+    filename = "aspell6";
+    sha256 = "04c38jnl74lpj2jhjz4zpqbs2623vwc71m6wc5h4b1karid14b23";
+  };
+
+  gv = buildOfficialDict {
+    language = "gv";
+    version = "0.50-0";
+    fullName = "Manx Gaelic";
+    filename = "aspell";
+    sha256 = "1rknf4yaw9s29c77sdzg98nhnmjwpicdb69igmz1n768npz2drmv";
+  };
+
+  he = buildOfficialDict {
+    language = "he";
+    version = "1.0-0";
+    fullName = "Hebrew";
+    filename = "aspell6";
+    sha256 = "13bhbghx5b8g0119g3wxd4n8mlf707y41vlf59irxjj0kynankfn";
+  };
+
+  hi = buildOfficialDict {
+    language = "hi";
+    version = "0.02-0";
+    fullName = "Hindi";
+    filename = "aspell6";
+    sha256 = "0drs374qz4419zx1lf2k281ydxf2750jk5ailafj1x0ncz27h1ys";
+  };
+
+  hil = buildOfficialDict {
+    language = "hil";
+    version = "0.11-0";
+    fullName = "Hiligaynon";
+    filename = "aspell5";
+    sha256 = "1s482fsfhzic9qa80al4418q3ni3gfn2bkwkd2y46ydrs17kf2jp";
+  };
+
+  hr = buildOfficialDict {
+    language = "hr";
+    version = "0.51-0";
+    fullName = "Croatian";
+    filename = "aspell";
+    sha256 = "09aafyf1vqhaxvcf3jfzf365k394b5pf0iivsr2ix5npah1h7i1a";
+  };
+
+  hsb = buildOfficialDict {
+    language = "hsb";
+    version = "0.02-0";
+    fullName = "Upper Sorbian";
+    filename = "aspell6";
+    sha256 = "0bi2vhz7n1vmg43wbbh935pmzihv80iyz9z65j94lxf753j2m7wd";
+  };
+
+  hu = buildOfficialDict {
+    language = "hu";
+    version = "0.99.4.2-0";
+    fullName = "Hungarian";
+    filename = "aspell6";
+    sha256 = "1d9nybip2k1dz69zly3iv0npbi3yxgfznh1py364nxzrbjsafd9k";
+  };
+
+  hus = buildOfficialDict {
+    language = "hus";
+    version = "0.03-1";
+    fullName = "Huastec";
+    filename = "aspell6";
+    sha256 = "09glipfpkz9xch17z11zw1yn2z7jx1f2svfmjn9l6wm1s5qz6a3d";
+  };
+
+  hy = buildOfficialDict {
+    language = "hy";
+    version = "0.10.0-0";
+    fullName = "Armenian";
+    filename = "aspell6";
+    sha256 = "1w5wq8lfl2xp1nid30b1j5qmya4vjyidq0vpr4y3gf53jc08vsid";
+  };
+
+  ia = buildOfficialDict {
+    language = "ia";
+    version = "0.50-1";
+    fullName = "Interlingua";
+    filename = "aspell";
+    sha256 = "0bqcpgsa72pga24fv4fkw38b4qqdvqsw97jvzvw7q03dc1cwp5sp";
+  };
+
+  id = buildOfficialDict {
+    language = "id";
+    version = "1.2-0";
+    fullName = "Indonesian";
+    filename = "aspell5";
+    sha256 = "023knfg0q03f7y5w6xnwa1kspnrcvcnky8xvdms93n2850414faj";
+  };
+
+  is = buildOfficialDict {
+    language = "is";
+    version = "0.51.1-0";
+    fullName = "Icelandic";
+    filename = "aspell";
+    sha256 = "1mp3248lhbr13cj7iq9zs7h5ix0dcwlprp5cwrkcwafrv8lvsd9h";
+  };
+
+  it = buildOfficialDict {
+    language = "it";
+    version = "2.2_20050523-0";
+    fullName = "Italian";
+    filename = "aspell6";
+    sha256 = "1gdf7bc1a0kmxsmphdqq8pl01h667mjsj6hihy6kqy14k5qdq69v";
+  };
+
+  kn = buildOfficialDict {
+    language = "kn";
+    version = "0.01-1";
+    fullName = "Kannada";
+    filename = "aspell6";
+    sha256 = "10sk0wx4x4ds1403kf9dqxv9yjvh06w8qqf4agx57y0jlws0n0fb";
+  };
+
+  ku = buildOfficialDict {
+    language = "ku";
+    version = "0.20-1";
+    fullName = "Kurdi";
+    filename = "aspell5";
+    sha256 = "09va98krfbgdaxl101nmd85j3ysqgg88qgfcl42c07crii0pd3wn";
+  };
+
+  ky = buildOfficialDict {
+    language = "ky";
+    version = "0.01-0";
+    fullName = "Kirghiz";
+    filename = "aspell6";
+    sha256 = "0kzv2syjnnn6pnwx0d578n46hg2l0j62977al47y6wabnhjjy3z1";
+  };
+
+  la = buildOfficialDict {
+    language = "la";
+    version = "20020503-0";
+    fullName = "Latin";
+    filename = "aspell6";
+    sha256 = "1199inwi16dznzl087v4skn66fl7h555hi2palx6s1f3s54b11nl";
+  };
+
+  lt = buildOfficialDict {
+    language = "lt";
+    version = "1.2.1-0";
+    fullName = "Lithuanian";
+    filename = "aspell6";
+    sha256 = "1asjck911l96q26zj36lmz0jp4b6pivvrf3h38zgc8lc85p3pxgn";
+  };
+
+  lv = buildOfficialDict {
+    language = "lv";
+    version = "0.5.5-1";
+    fullName = "Latvian";
+    filename = "aspell6";
+    sha256 = "12pvs584a6437ijndggdqpp5s7d0w607cimpkxsjwasnx83f4c1w";
+  };
+
+  mg = buildOfficialDict {
+    language = "mg";
+    version = "0.03-0";
+    fullName = "Malagasy";
+    filename = "aspell5";
+    sha256 = "0hdhbk9b5immjp8l5h4cy82gwgsqzcqbb0qsf7syw333w4rgi0ji";
+  };
+
+  mi = buildOfficialDict {
+    language = "mi";
+    version = "0.50-0";
+    fullName = "Maori";
+    filename = "aspell";
+    sha256 = "12bxplpd348yx8d2q8qvahi9dlp7qf28qmanzhziwc7np8rixvmy";
+  };
+
+  mk = buildOfficialDict {
+    language = "mk";
+    version = "0.50-0";
+    fullName = "Macedonian";
+    filename = "aspell";
+    sha256 = "0wcr9n882xi5b7a7ln1hnhq4vfqd5gpqqp87v01j0gb7zf027z0m";
+  };
+
+  ml = buildOfficialDict {
+    language = "ml";
+    version = "0.03-1";
+    fullName = "Malayalam";
+    filename = "aspell6";
+    sha256 = "1zcn4114gwia085fkz77qk13z29xrbp53q2qvgj2cvcbalg5bkg4";
+  };
+
+  mn = buildOfficialDict {
+    language = "mn";
+    version = "0.06-2";
+    fullName = "Mongolian";
+    filename = "aspell6";
+    sha256 = "150j9y5c9pw80fwp5rzl5q31q9vjbxixaqljkfwxjb5q93fnw6rg";
+  };
+
+  mr = buildOfficialDict {
+    language = "mr";
+    version = "0.10-0";
+    fullName = "Marathi";
+    filename = "aspell6";
+    sha256 = "0cvgb2l40sppqbi842ivpznsh2xzp1d4hxc371dll8z0pr05m8yk";
+  };
+
+  ms = buildOfficialDict {
+    language = "ms";
+    version = "0.50-0";
+    fullName = "Malay";
+    filename = "aspell";
+    sha256 = "0vr4vhipcfhsxqfs8dim2ph7iiixn22gmlmlb375bx5hgd9y7i1w";
+  };
+
+  mt = buildOfficialDict {
+    language = "mt";
+    version = "0.50-0";
+    fullName = "Maltese";
+    filename = "aspell";
+    sha256 = "1d2rl1nlfjq6rfywblvx8m88cyy2x0mzc0mshzbgw359c2nwl3z0";
+  };
+
+  nb = buildOfficialDict {
+    language = "nb";
+    version = "0.50.1-0";
+    fullName = "Norwegian Bokmal";
+    filename = "aspell";
+    sha256 = "12i2bmgdnlkzfinb20j2a0j4a20q91a9j8qpq5vgabbvc65nwx77";
+  };
+
+  nds = buildOfficialDict {
+    language = "nds";
+    version = "0.01-0";
+    fullName = "Low Saxon";
+    filename = "aspell6";
+    sha256 = "1nkjhwzn45dizi89d19q4bqyd87cim8xyrgr655fampgkn31wf6f";
+  };
+
+  nl = buildOfficialDict {
+    language = "nl";
+    version = "0.50-2";
+    fullName = "Dutch";
+    filename = "aspell";
+    sha256 = "0ffb87yjsh211hllpc4b9khqqrblial4pzi1h9r3v465z1yhn3j4";
+    # Emacs expects a language called "nederlands".
+    postInstall = ''
+      echo "add nl.rws" > $out/lib/aspell/nederlands.multi
+    '';
+  };
+
+  nn = buildOfficialDict {
+    language = "nn";
+    version = "0.50.1-1";
+    fullName = "Norwegian Nynorsk";
+    filename = "aspell";
+    sha256 = "0w2k5l5rbqpliripgqwiqixz5ghnjf7i9ggbrc4ly4vy1ia10rmc";
+  };
+
+  ny = buildOfficialDict {
+    language = "ny";
+    version = "0.01-0";
+    fullName = "Chichewa";
+    filename = "aspell5";
+    sha256 = "0gjb92vcg60sfgvrm2f6i89sfkgb179ahvwlgs649fx3dc7rfvqp";
+  };
+
+  or = buildOfficialDict {
+    language = "or";
+    version = "0.03-1";
+    fullName = "Oriya";
+    filename = "aspell6";
+    sha256 = "0kzj9q225z0ccrlbkijsrafy005pbjy14qcnxb6p93ciz1ls7zyn";
+  };
+
+  pa = buildOfficialDict {
+    language = "pa";
+    version = "0.01-1";
+    fullName = "Punjabi";
+    filename = "aspell6";
+    sha256 = "0if93zk10pyrs38wwj3vpcdm01h51m5z9gm85h3jxrpgqnqspwy7";
+  };
+
+  pl = buildOfficialDict {
+    language = "pl";
+    version = "6.0_20061121-0";
+    fullName = "Polish";
+    filename = "aspell6";
+    sha256 = "0kap4kh6bqbb22ypja1m5z3krc06vv4n0hakiiqmv20anzy42xq1";
+  };
+
+  pt_BR = buildOfficialDict {
+    language = "pt_BR";
+    version = "20131030-12-0";
+    fullName = "Brazilian Portuguese";
+    filename = "aspell6";
+    sha256 = "1xqlpk21s93c6blkdnpk7l62q9fxjvzdv2x86chl8p2x1gdrj3gb";
+  };
+
+  pt_PT = buildOfficialDict {
+    language = "pt_PT";
+    version = "20190329-1-0";
+    fullName = "Portuguese";
+    filename = "aspell6";
+    sha256 = "0ld0d0ily4jqifjfsxfv4shbicz6ymm2gk56fq9gbzra1j4qnw75";
+  };
+
+  qu = buildOfficialDict {
+    language = "qu";
+    version = "0.02-0";
+    fullName = "Quechua";
+    filename = "aspell6";
+    sha256 = "009z0zsvzq7r3z3m30clyibs94v77b92h5lmzmzxlns2p0lpd5w0";
+  };
+
+  ro = buildOfficialDict {
+    language = "ro";
+    version = "3.3-2";
+    fullName = "Romanian";
+    filename = "aspell5";
+    sha256 = "0gb8j9iy1acdl11jq76idgc2lbc1rq3w04favn8cyh55d1v8phsk";
+  };
+
+  ru = buildOfficialDict {
+    language = "ru";
+    version = "0.99f7-1";
+    fullName = "Russian";
+    filename = "aspell6";
+    sha256 = "0ip6nq43hcr7vvzbv4lwwmlwgfa60hrhsldh9xy3zg2prv6bcaaw";
+  };
+
+  rw = buildOfficialDict {
+    language = "rw";
+    version = "0.50-0";
+    fullName = "Kinyarwanda";
+    filename = "aspell";
+    sha256 = "10gh8g747jbrvfk2fn3pjxy1nhcfdpwgmnvkmrp4nd1k1qp101il";
+  };
+
+  sc = buildOfficialDict {
+    language = "sc";
+    version = "1.0";
+    fullName = "Sardinian";
+    filename = "aspell5";
+    sha256 = "0hl7prh5rccsyljwrv3m1hjcsphyrrywk2qvnj122irbf4py46jr";
+  };
+
+  sk = buildOfficialDict {
+    language = "sk";
+    version = "2.01-2";
+    fullName = "Slovak";
+    filename = "aspell6";
+    sha256 = "19k0m1v5pcf7xr4lxgjkzqkdlks8nyb13bvi1n7521f3i4lhma66";
+  };
+
+  sl = buildOfficialDict {
+    language = "sl";
+    version = "0.50-0";
+    fullName = "Slovenian";
+    filename = "aspell";
+    sha256 = "1l9kc5g35flq8kw9jhn2n0bjb4sipjs4qkqzgggs438kywkx2rp5";
+  };
+
+  sr = buildOfficialDict {
+    language = "sr";
+    version = "0.02";
+    fullName = "Serbian";
+    filename = "aspell6";
+    sha256 = "12cj01p4nj80cpf7m3s4jsaf0rsfng7s295j9jfchcq677xmhpkh";
+  };
+
+  sv = buildOfficialDict {
+    language = "sv";
+    version = "0.51-0";
+    fullName = "Swedish";
+    filename = "aspell";
+    sha256 = "02jwkjhr32kvyibnyzgx3smbnm576jwdzg3avdf6zxwckhy5fw4v";
+  };
+
+  sw = buildOfficialDict {
+    language = "sw";
+    version = "0.50-0";
+    fullName = "Swahili";
+    filename = "aspell";
+    sha256 = "15zjh7hdj2b4dgm5bc12w1ims9q357p1q3gjalspnyn5gl81zmby";
+  };
+
+  ta = buildOfficialDict {
+    language = "ta";
+    version = "20040424-1";
+    fullName = "Tamil";
+    filename = "aspell6";
+    sha256 = "0sj8ygjsyvnr93cs6324y7az7k2vyw7rjxdc9vnm7z60lbqm5xaj";
+  };
+
+  te = buildOfficialDict {
+    language = "te";
+    version = "0.01-2";
+    fullName = "Telugu";
+    filename = "aspell6";
+    sha256 = "0pgcgxz7dz34zxp9sb85jjzbg3ky6il5wmhffz6ayrbsfn5670in";
+  };
+
+  tet = buildOfficialDict {
+    language = "tet";
+    version = "0.1.1";
+    fullName = "Tetum";
+    filename = "aspell5";
+    sha256 = "17n0y4fhjak47j9qnqf4m4z6zra6dn72rwhp7ig0hhlgqk4ldmcx";
+  };
+
+  tk = buildOfficialDict {
+    language = "tk";
+    version = "0.01-0";
+    fullName = "Turkmen";
+    filename = "aspell5";
+    sha256 = "02vad4jqhr0xpzqi5q5z7z0xxqccbn8j0c5dhpnm86mnr84l5wl6";
+  };
+
+  tl = buildOfficialDict {
+    language = "tl";
+    version = "0.02-1";
+    fullName = "Tagalog";
+    filename = "aspell5";
+    sha256 = "1kca6k7qnpfvvwjnq5r1n242payqsjy96skmw78m7ww6d0n5vdj8";
+  };
+
+  tn = buildOfficialDict {
+    language = "tn";
+    version = "1.0.1-0";
+    fullName = "Setswana";
+    filename = "aspell5";
+    sha256 = "0q5x7c6z88cn0kkpk7q1craq34g4g03v8x3xcj5a5jia3l7c5821";
+  };
+
+  tr = buildOfficialDict {
+    language = "tr";
+    version = "0.50-0";
+    fullName = "Turkish";
+    filename = "aspell";
+    sha256 = "0jpvpm96ga7s7rmsm6rbyrrr22b2dicxv2hy7ysv5y7bbq757ihb";
+  };
+
+  uk = buildOfficialDict {
+    language = "uk";
+    version = "1.4.0-0";
+    fullName = "Ukrainian";
+    filename = "aspell6";
+    sha256 = "137i4njvnslab6l4s291s11xijr5jsy75lbdph32f9y183lagy9m";
+  };
+
+  uz = buildOfficialDict {
+    language = "uz";
+    version = "0.6-0";
+    fullName = "Uzbek";
+    filename = "aspell6";
+    sha256 = "0sg3wlyply1idpq5ypyj7kgnaadaiskci1sqs811yhg2gzyc3092";
+  };
+
+  vi = buildOfficialDict {
+    language = "vi";
+    version = "0.01.1-1";
+    fullName = "Vietnamese";
+    filename = "aspell6";
+    sha256 = "05vwgvf1cj45azhflywx69javqdvqd1f20swrc2d3c32pd9mvn1w";
+  };
+
+  wa = buildOfficialDict {
+    language = "wa";
+    version = "0.50-0";
+    fullName = "Walloon";
+    filename = "aspell";
+    sha256 = "1r1zwz7xkx40dga9vf5wc9ja3jwk1dkpcr1kaa7wryvslf5al5ss";
+  };
+
+  yi = buildOfficialDict {
+    language = "yi";
+    version = "0.01.1-1";
+    fullName = "Yiddish";
+    filename = "aspell6";
+    sha256 = "0mi842l4038bx3ll2wx9nz44nqrg1x46h5b02zigi1hbbddd6ycq";
+  };
+
+  zu = buildOfficialDict {
+    language = "zu";
+    version = "0.50-0";
+    fullName = "Zulu";
+    filename = "aspell";
+    sha256 = "15k7gaxrnqnssdyk9l6g27dq317dqp9jz5yzafd25ri01g6mb8iz";
+  };
+
+  ### Jargons
+
+  en-computers = buildTxtDict {
+    shortName = "en-computers";
+    fullName = "English Computer Jargon";
+
+    src = fetchurl {
+      url = "https://mrsatterly.com/computer.dic";
+      sha256 = "1vzk7cdvcm9r1c6mgxpabrdcpvghdv9mjmnf6iq5wllcif5nsw2b";
+    };
+
+    langInputs = [ en ];
+
+    buildPhase = ''
+      runHook preBuild
+      cat $src | aspell-affix en-computers --dont-validate-words --lang=en
+      runHook postBuild
+    '';
+    installPhase = "aspell-install en-computers";
+
+    meta = {
+      homepage = "https://mrsatterly.com/spelling.html";
+    };
+  };
+
+  en-science = buildTxtDict {
+    shortName = "en-science";
+    fullName = "English Scientific Jargon";
+
+    src1 = fetchurl {
+      url = "http://jpetrie.net/wp-content/uploads/custom_scientific_US.txt";
+      sha256 = "1nf4py2mg0mlv9s5a7had2wn29z2v6bcca0fs6rbpdn4nqc4s7dm";
+    };
+
+    src2 = fetchurl {
+      url = "http://jpetrie.net/wp-content/uploads/custom_scientific_UK.txt";
+      sha256 = "0f88il1ds6qazy1ghxviqcwsywrbf6pzl2lmzf4f3qvhdfb6f1y0";
+    };
+
+    langInputs = [ en ];
+
+    buildPhase = ''
+      runHook preBuild
+      cat $src1 | aspell-plain en_US-science --dont-validate-words --lang=en
+      cat $src2 | aspell-plain en_GB-science --dont-validate-words --lang=en
+      runHook postBuild
+    '';
+    installPhase = "aspell-install en_US-science en_GB-science";
+
+    meta = {
+      homepage = "http://www.jpetrie.net/scientific-word-list-for-spell-checkersspelling-dictionaries/";
+    };
+
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/assimp/default.nix b/nixpkgs/pkgs/development/libraries/assimp/default.nix
new file mode 100644
index 000000000000..a2cd3a2a4571
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/assimp/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, cmake, boost, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "assimp";
+  version = "5.0.1";
+
+  src = fetchFromGitHub{
+    owner = "assimp";
+    repo = "assimp";
+    rev = "v${version}";
+    sha256 = "00vxzfcrs856qnyk806wqr67nmpjk06mjby0fqmyhm6i1jj2hg1w";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost zlib ];
+
+  meta = with lib; {
+    description = "A library to import various 3D model formats";
+    homepage = "http://assimp.sourceforge.net/";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ ehmry ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/at-spi2-atk/default.nix b/nixpkgs/pkgs/development/libraries/at-spi2-atk/default.nix
new file mode 100644
index 000000000000..7989cfd85777
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/at-spi2-atk/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv
+, fetchurl
+
+, meson
+, ninja
+, pkg-config
+
+, at-spi2-core
+, atk
+, dbus
+, glib
+, libxml2
+
+, gnome # To pass updateScript
+}:
+
+stdenv.mkDerivation rec {
+  pname = "at-spi2-atk";
+  version = "2.38.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "z6AIpa+CKzauYofxgYLEDJHdaZxV+qOGBYge0XXKRk8=";
+  };
+
+  nativeBuildInputs = [ meson ninja pkg-config ];
+  buildInputs = [ at-spi2-core atk dbus glib libxml2 ];
+
+  doCheck = false; # fails with "No test data file provided"
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with 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.lgpl21Plus;
+    maintainers = teams.gnome.members;
+    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
new file mode 100644
index 000000000000..8413ae597f77
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/at-spi2-core/default.nix
@@ -0,0 +1,68 @@
+{ lib, stdenv
+, fetchurl
+
+, meson
+, ninja
+, pkg-config
+, gobject-introspection
+, gsettings-desktop-schemas
+, makeWrapper
+
+, 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
+, libXext
+
+, gnome # To pass updateScript
+}:
+
+stdenv.mkDerivation rec {
+  pname = "at-spi2-core";
+  version = "2.40.3";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "5Jg3wq0w1x4fKcqOCWilS5UDAnL3/0C4m0iWhlPzelw=";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ meson ninja pkg-config gobject-introspection makeWrapper ];
+  # libXext is a transitive dependency of libXi
+  buildInputs = [ libX11 libXtst libXi libXext ];
+  # In atspi-2.pc dbus-1 glib-2.0
+  propagatedBuildInputs = [ dbus glib ];
+
+  doCheck = false; # fails with "AT-SPI: Couldn't connect to accessibility bus. Is at-spi-bus-launcher running?"
+
+  # Provide dbus-daemon fallback when it is not already running when
+  # at-spi2-bus-launcher is executed. This allows us to avoid
+  # including the entire dbus closure in libraries linked with
+  # the at-spi2-core libraries.
+  mesonFlags = [ "-Ddbus_daemon=/run/current-system/sw/bin/dbus-daemon" ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  postFixup = ''
+    # Cannot use wrapGAppsHook'due to a dependency cycle
+    wrapProgram $out/libexec/at-spi-bus-launcher \
+      --prefix GIO_EXTRA_MODULES : "${lib.getLib dconf}/lib/gio/modules" \
+      --prefix XDG_DATA_DIRS : ${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}
+  '';
+
+  meta = with 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.lgpl21Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/atk/default.nix b/nixpkgs/pkgs/development/libraries/atk/default.nix
new file mode 100644
index 000000000000..08e6e5b0e41b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/atk/default.nix
@@ -0,0 +1,66 @@
+{ lib, stdenv, fetchurl, meson, ninja, gettext, pkg-config, glib
+, fixDarwinDylibNames, gobject-introspection, gnome
+}:
+
+let
+  pname = "atk";
+  version = "2.36.0";
+in
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz";
+    sha256 = "1217cmmykjgkkim0zr1lv5j13733m4w5vipmy4ivw0ll6rz28xpv";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ meson ninja pkg-config gettext gobject-introspection glib ]
+    ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+
+  propagatedBuildInputs = [
+    # Required by atk.pc
+    glib
+  ];
+
+  patches = [
+    # meson builds an incorrect .pc file
+    # glib should be Requires not Requires.private
+    ./fix_pc.patch
+  ];
+
+  mesonFlags = [
+    "-Dintrospection=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}"
+  ];
+
+  doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = {
+    description = "Accessibility toolkit";
+
+    longDescription = ''
+      ATK is the Accessibility Toolkit.  It provides a set of generic
+      interfaces allowing accessibility technologies such as screen
+      readers to interact with a graphical user interface.  Using the
+      ATK interfaces, accessibility tools have full access to view and
+      control running applications.
+    '';
+
+    homepage = "http://library.gnome.org/devel/atk/";
+
+    license = lib.licenses.lgpl2Plus;
+
+    maintainers = with lib.maintainers; [ raskin ];
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
+  };
+
+}
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/atkmm/default.nix b/nixpkgs/pkgs/development/libraries/atkmm/default.nix
new file mode 100644
index 000000000000..b357ed047259
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/atkmm/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, atk, glibmm, pkg-config, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "atkmm";
+  version = "2.28.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0fnxrspxkhhbrjphqrpvl3zjm66n50s4cywrrrwkhbflgy8zqk2c";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  propagatedBuildInputs = [ atk glibmm ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = {
+    description = "C++ wrappers for ATK accessibility toolkit";
+    license = lib.licenses.lgpl21Plus;
+    homepage = "https://gtkmm.org";
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/attr/default.nix b/nixpkgs/pkgs/development/libraries/attr/default.nix
new file mode 100644
index 000000000000..4ad1525c2e09
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/attr/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, gettext }:
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+stdenv.mkDerivation rec {
+  pname = "attr";
+  version = "2.5.1";
+
+  src = fetchurl {
+    url = "mirror://savannah/attr/${pname}-${version}.tar.gz";
+    sha256 = "1y6sibbkrcjygv8naadnsg6xmsqwfh6cwrqk01l0v2i5kfacdqds";
+  };
+
+  outputs = [ "bin" "dev" "out" "man" "doc" ];
+
+  nativeBuildInputs = [ gettext ];
+
+  postPatch = ''
+    for script in install-sh include/install-sh; do
+      patchShebangs $script
+    done
+  '';
+
+  meta = with lib; {
+    homepage = "https://savannah.nongnu.org/projects/attr/";
+    description = "Library and tools for manipulating extended attributes";
+    platforms = platforms.linux;
+    license = licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/aubio/default.nix b/nixpkgs/pkgs/development/libraries/aubio/default.nix
new file mode 100644
index 000000000000..e1f2d326879c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aubio/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, alsa-lib, fftw, libjack2, libsamplerate
+, libsndfile, pkg-config, python3, wafHook
+}:
+
+stdenv.mkDerivation rec {
+  name = "aubio-0.4.9";
+
+  src = fetchurl {
+    url = "https://aubio.org/pub/${name}.tar.bz2";
+    sha256 = "1npks71ljc48w6858l9bq30kaf5nph8z0v61jkfb70xb9np850nl";
+  };
+
+  nativeBuildInputs = [ pkg-config python3 wafHook ];
+  buildInputs = [ alsa-lib fftw libjack2 libsamplerate libsndfile ];
+
+  strictDeps = true;
+
+  meta = with lib; {
+    description = "Library for audio labelling";
+    homepage = "https://aubio.org/";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ goibhniu marcweber fpletz ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audiality2/default.nix b/nixpkgs/pkgs/development/libraries/audiality2/default.nix
new file mode 100644
index 000000000000..e0ab0accdfde
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audiality2/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+# The two audio backends:
+, SDL2
+, jack2
+}:
+
+stdenv.mkDerivation rec {
+  pname = "audiality2";
+  version = "1.9.4";
+
+  src = fetchFromGitHub {
+    owner = "olofson";
+    repo = "audiality2";
+    rev = "v${version}";
+    sha256 = "0ipqna7a9mxqm0fl9ggwhbc7i9yxz3jfyi0w3dymjp40v7jw1n20";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  buildInputs = [
+    SDL2
+    jack2
+  ];
+
+  meta = with lib; {
+    description = "A realtime scripted modular audio engine for video games and musical applications";
+    homepage = "http://audiality.org";
+    license = licenses.zlib;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ fgaz ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/audio/libbass/default.nix b/nixpkgs/pkgs/development/libraries/audio/libbass/default.nix
new file mode 100644
index 000000000000..ab97090e8899
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/libbass/default.nix
@@ -0,0 +1,66 @@
+{ lib, stdenv, unzip, fetchurl }:
+
+# Upstream changes files in-place, to update:
+# 1. Check latest version at http://www.un4seen.com/
+# 2. Update `version`s and `sha256` sums.
+# See also http://www.un4seen.com/forum/?topic=18614.0
+
+let
+  allBass = {
+    bass = {
+      h = "bass.h";
+      version = "2.4.15";
+      so = {
+        i686_linux = "libbass.so";
+        x86_64-linux = "x64/libbass.so";
+      };
+      urlpath = "bass24-linux.zip";
+      sha256 = "1lmysxfhy727zskavml3ibg5w876ir88923bm17c21s59w5lh7l8";
+    };
+
+    bass_fx = {
+      h = "C/bass_fx.h";
+      version = "2.4.12.1";
+      so = {
+        i686_linux = "libbass_fx.so";
+        x86_64-linux = "x64/libbass_fx.so";
+      };
+      urlpath = "z/0/bass_fx24-linux.zip";
+      sha256 = "1q0g74z7iyhxqps5b3gnnbic8v2jji1r0mkvais57lsx8y21sbin";
+    };
+  };
+
+  dropBass = name: bass: stdenv.mkDerivation {
+    pname = "lib${name}";
+    inherit (bass) version;
+
+    src = fetchurl {
+      url = "https://www.un4seen.com/files/${bass.urlpath}";
+      inherit (bass) sha256;
+    };
+    unpackCmd = ''
+      mkdir out
+      ${unzip}/bin/unzip $curSrc -d out
+    '';
+
+    lpropagatedBuildInputs = [ unzip ];
+    dontBuild = true;
+    installPhase =
+      let so =
+            if bass.so ? ${stdenv.hostPlatform.system} then bass.so.${stdenv.hostPlatform.system}
+            else throw "${name} not packaged for ${stdenv.hostPlatform.system} (yet).";
+      in ''
+        mkdir -p $out/{lib,include}
+        install -m644 -t $out/lib/ ${so}
+        install -m644 -t $out/include/ ${bass.h}
+      '';
+
+    meta = with lib; {
+      description = "Shareware audio library";
+      homepage = "https://www.un4seen.com/";
+      license = licenses.unfreeRedistributable;
+      platforms = builtins.attrNames bass.so;
+    };
+  };
+
+in lib.mapAttrs dropBass allBass
diff --git a/nixpkgs/pkgs/development/libraries/audio/libbs2b/default.nix b/nixpkgs/pkgs/development/libraries/audio/libbs2b/default.nix
new file mode 100644
index 000000000000..11135b14fd48
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/libbs2b/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, pkg-config, libsndfile }:
+
+stdenv.mkDerivation rec {
+  pname = "libbs2b";
+  version = "3.1.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/bs2b/${pname}-${version}.tar.bz2";
+    sha256 = "0vz442kkjn2h0dlxppzi4m5zx8qfyrivq581n06xzvnyxi5rg6a7";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libsndfile ];
+
+  hardeningDisable = [ "format" ];
+
+  meta = {
+    homepage = "http://bs2b.sourceforge.net/";
+    description = "Bauer stereophonic-to-binaural DSP library";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/libgme/default.nix b/nixpkgs/pkgs/development/libraries/audio/libgme/default.nix
new file mode 100644
index 000000000000..d78756b0ca45
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/libgme/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromBitbucket, cmake, removeReferencesTo }:
+
+stdenv.mkDerivation rec {
+  pname = "libgme";
+  version = "0.6.3";
+
+  meta = with lib; {
+    description = "A collection of video game music chip emulators";
+    homepage = "https://bitbucket.org/mpyne/game-music-emu/overview";
+    license = licenses.lgpl21;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ lheckemann ];
+  };
+
+  src = fetchFromBitbucket {
+    owner = "mpyne";
+    repo = "game-music-emu";
+    rev = version;
+    sha256 = "100ahb4n4pvgcry9xzlf2fr4j57n5h9x7pvyhhxys4dcy8axqqsy";
+  };
+
+  nativeBuildInputs = [ cmake removeReferencesTo ];
+
+  # These checks fail on aarch64-darwin
+  cmakeFlags = [ "-DENABLE_UBSAN=OFF" ];
+
+  # It used to reference it, in the past, but thanks to the postFixup hook, now
+  # it doesn't.
+  disallowedReferences = [ stdenv.cc.cc ];
+
+  postFixup = lib.optionalString stdenv.isLinux ''
+    remove-references-to -t ${stdenv.cc.cc} "$(readlink -f $out/lib/libgme.so)"
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/libinstpatch/default.nix b/nixpkgs/pkgs/development/libraries/audio/libinstpatch/default.nix
new file mode 100644
index 000000000000..670dee26b2bf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/libinstpatch/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, glib, libsndfile }:
+
+stdenv.mkDerivation rec {
+  pname = "libinstpatch";
+  version = "1.1.6";
+
+  src = fetchFromGitHub {
+    owner = "swami";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-OU6/slrPDgzn9tvXZJKSWbcFbpS/EAsOi52FtjeYdvA=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  propagatedBuildInputs = [ glib libsndfile ]; # Both are needed for includes.
+
+  cmakeFlags = [
+    "-DLIB_SUFFIX=" # Install in $out/lib.
+  ];
+
+  meta = with lib; {
+    homepage = "http://www.swamiproject.org/";
+    description = "MIDI instrument patch files support library";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ orivej ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/libmysofa/default.nix b/nixpkgs/pkgs/development/libraries/audio/libmysofa/default.nix
new file mode 100644
index 000000000000..821a9ea9226a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/libmysofa/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, cmake, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "libmysofa";
+  version = "1.2";
+
+  src = fetchFromGitHub {
+    owner = "hoene";
+    repo = "libmysofa";
+    rev = "v${version}";
+    sha256 = "sha256-f+1CIVSxyScyNF92cPIiZwfnnCVrWfCZlbrIXtduIdY=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zlib ];
+
+  cmakeFlags = [ "-DBUILD_TESTS=OFF" "-DCODE_COVERAGE=OFF" ];
+
+  meta = with lib; {
+    description = "Reader for AES SOFA files to get better HRTFs";
+    homepage = "https://github.com/hoene/libmysofa";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ jfrankenau ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/libsmf/default.nix b/nixpkgs/pkgs/development/libraries/audio/libsmf/default.nix
new file mode 100644
index 000000000000..0c173a6a99e0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/libsmf/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, autoreconfHook, glib, pkg-config }:
+
+stdenv.mkDerivation rec {
+  version = "1.3";
+  pname = "libsmf";
+  src = fetchurl {
+    url = "https://github.com/stump/libsmf/archive/${pname}-${version}.tar.gz";
+    sha256 = "1527pcc1vd0l5iks2yw8m0bymcrnih2md5465lwpzw0wgy4rky7n";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ glib ];
+
+  meta = with lib; {
+    description = "A C library for reading and writing Standard MIDI Files";
+    homepage = "https://github.com/stump/libsmf";
+    license = licenses.bsd2;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/lilv/default.nix b/nixpkgs/pkgs/development/libraries/audio/lilv/default.nix
new file mode 100644
index 000000000000..f074287ab163
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/lilv/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, lv2, pkg-config, python3, serd, sord, sratom, wafHook }:
+
+stdenv.mkDerivation rec {
+  pname = "lilv";
+  version = "0.24.12";
+
+  src = fetchurl {
+    url = "https://download.drobilla.net/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-JqN3kIkMnB+DggO0f1sjIDNP6SwCpNJuu+Jmnb12kGE=";
+  };
+
+  patches = [ ./lilv-pkgconfig.patch ];
+
+  nativeBuildInputs = [ pkg-config python3 wafHook ];
+  buildInputs = [ serd sord sratom ];
+  propagatedBuildInputs = [ lv2 ];
+
+  meta = with lib; {
+    homepage = "http://drobilla.net/software/lilv";
+    description = "A C library to make the use of LV2 plugins";
+    license = licenses.mit;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/lilv/lilv-pkgconfig.patch b/nixpkgs/pkgs/development/libraries/audio/lilv/lilv-pkgconfig.patch
new file mode 100644
index 000000000000..a5a8c6007e43
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/lilv/lilv-pkgconfig.patch
@@ -0,0 +1,6 @@
+--- a/lilv.pc.in
++++ b/lilv.pc.in
+@@ -9 +9,2 @@ Description: Simple C library for hosting LV2 plugins
+-Requires: @LILV_PKG_DEPS@
++Requires: lv2
++Requires.private: @LILV_PKG_DEPS@
diff --git a/nixpkgs/pkgs/development/libraries/audio/lv2/default.nix b/nixpkgs/pkgs/development/libraries/audio/lv2/default.nix
new file mode 100644
index 000000000000..616ad5b0c892
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/lv2/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, gtk2, libsndfile, pkg-config, python3, wafHook }:
+
+stdenv.mkDerivation rec {
+  pname = "lv2";
+  version = "1.18.2";
+
+  src = fetchurl {
+    url = "https://lv2plug.in/spec/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-TokfvHRMBYVb6136gugisUkX3Wbpj4K4Iw29HHqy4F4=";
+  };
+
+  nativeBuildInputs = [ pkg-config wafHook ];
+  buildInputs = [ gtk2 libsndfile python3 ];
+
+  wafConfigureFlags = lib.optionals stdenv.isDarwin [ "--lv2dir=${placeholder "out"}/lib/lv2" ];
+
+  meta = with lib; {
+    homepage = "https://lv2plug.in";
+    description = "A plugin standard for audio systems";
+    license = licenses.mit;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/lvtk/default.nix b/nixpkgs/pkgs/development/libraries/audio/lvtk/default.nix
new file mode 100644
index 000000000000..0ded707b3a10
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/lvtk/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, boost, gtkmm2, lv2, pkg-config, python2, wafHook }:
+
+stdenv.mkDerivation rec {
+  pname = "lvtk";
+  version = "1.2.0";
+
+  src = fetchurl {
+    url = "https://github.com/lvtk/lvtk/archive/${version}.tar.gz";
+    sha256 = "03nbj2cqcklqwh50zj2gwm07crh5iwqbpxbpzwbg5hvgl4k4rnjd";
+  };
+
+  nativeBuildInputs = [ pkg-config python2 wafHook ];
+  buildInputs = [ boost gtkmm2 lv2 ];
+
+  enableParallelBuilding = true;
+
+  # Fix including the boost libraries during linking
+  postPatch = ''
+    sed -i '/target[ ]*= "ttl2c"/ ilib=["boost_system"],' tools/wscript_build
+  '';
+
+  wafConfigureFlags = [
+    "--boost-includes=${boost.dev}/include"
+    "--boost-libs=${boost.out}/lib"
+  ];
+
+  meta = with lib; {
+    description = "A set C++ wrappers around the LV2 C API";
+    homepage = "https://lvtk.org/";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/mbelib/default.nix b/nixpkgs/pkgs/development/libraries/audio/mbelib/default.nix
new file mode 100644
index 000000000000..f13f6d7063cb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/mbelib/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "mbelib";
+  version = "1.3.0";
+
+  src = fetchFromGitHub {
+    owner = "szechyjs";
+    repo = "mbelib";
+    rev = "v${version}";
+    sha256 = "0v6b7nf8fgxy7vzgcwffqyql5zhldrz30c88k1ylbjp78hwh4rif";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  doCheck = true;
+  preCheck = ''
+    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD
+    export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD
+  '';
+
+  meta = with lib; {
+    description = "P25 Phase 1 and ProVoice vocoder";
+    homepage = https://github.com/szechyjs/mbelib;
+    license = licenses.isc;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ andrew-d ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/ntk/default.nix b/nixpkgs/pkgs/development/libraries/audio/ntk/default.nix
new file mode 100644
index 000000000000..ecb0215a2287
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/ntk/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, cairo, libjpeg, libXft, pkg-config, python2, wafHook }:
+
+stdenv.mkDerivation rec {
+  pname = "ntk";
+  version = "1.3.1000";
+  src = fetchFromGitHub {
+    owner = "original-male";
+    repo = "ntk";
+    rev = "v${version}";
+    sha256 = "0j38mhnfqy6swcrnc5zxcwlqi8b1pgklyghxk6qs1lf4japv2zc0";
+  };
+
+  nativeBuildInputs = [ pkg-config wafHook ];
+  buildInputs = [
+    cairo libjpeg libXft python2
+  ];
+
+  meta = {
+    description = "Fork of FLTK 1.3.0 with additional functionality";
+    version = version;
+    homepage = "http://non.tuxfamily.org/";
+    license = lib.licenses.lgpl21;
+    maintainers = with lib.maintainers; [ magnetophon nico202 ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/qm-dsp/default.nix b/nixpkgs/pkgs/development/libraries/audio/qm-dsp/default.nix
new file mode 100644
index 000000000000..3d8e15f97cdb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/qm-dsp/default.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv
+, fetchFromGitHub
+, fetchpatch
+, kissfft
+}:
+
+stdenv.mkDerivation rec {
+  pname = "qm-dsp";
+  version = "1.7.1";
+
+  src = fetchFromGitHub {
+    owner = "c4dm";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1vkb1xr2hjcaw88gig7rknlwsx01lm0w94d2z0rk5vz9ih4fslvv";
+  };
+
+  patches = [
+    # Make installable
+    (fetchpatch {
+      url = "https://src.fedoraproject.org/rpms/qm-dsp/raw/6eb385e2f970c4150f9c8eba73b558318475ed15/f/qm-dsp-install.patch";
+      sha256 = "071g30p17ya0pknzqa950pb93vrgp2024ray8axn22c44gvy147c";
+    })
+    (fetchpatch {
+      url = "https://src.fedoraproject.org/rpms/qm-dsp/raw/6eb385e2f970c4150f9c8eba73b558318475ed15/f/qm-dsp-flags.patch";
+      sha256 = "127n6j5bsp94kf2m1zqfvkf4iqk1h5f7w778bk7w02vi45nm4x6q";
+      postFetch = ''
+        sed -i 's~/Makefile~/build/linux/Makefile.linux32~g' "$out"
+      '';
+    })
+  ];
+
+  buildInputs = [
+    kissfft
+  ];
+
+  makefile = "build/linux/Makefile.linux32";
+
+  makeFlags = [
+    "PREFIX=${placeholder "out"}"
+    "LIBDIR=${placeholder "out"}/lib"
+  ];
+
+  NIX_CFLAGS_COMPILE = "-I${kissfft}/include/kissfft";
+
+  meta = with lib; {
+    description = "A C++ library of functions for DSP and Music Informatics purposes";
+    homepage = "https://code.soundsoftware.ac.uk/projects/qm-dsp";
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/raul/default.nix b/nixpkgs/pkgs/development/libraries/audio/raul/default.nix
new file mode 100644
index 000000000000..b1a8288c5f04
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/raul/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchgit, boost, gtk2, pkg-config, python3, wafHook }:
+
+stdenv.mkDerivation rec {
+  pname = "raul";
+  version = "unstable-2019-12-09";
+  name = "${pname}-${version}";
+
+  src = fetchgit {
+    url = "https://gitlab.com/drobilla/raul.git";
+    fetchSubmodules = true;
+    rev = "e87bb398f025912fb989a09f1450b838b251aea1";
+    sha256 = "1z37jb6ghc13b8nv8a8hcg669gl8vh4ni9djvfgga9vcz8rmcg8l";
+  };
+
+  nativeBuildInputs = [ pkg-config wafHook python3 ];
+  buildInputs = [ boost gtk2 ];
+
+  strictDeps = true;
+
+  meta = with lib; {
+    description = "A C++ utility library primarily aimed at audio/musical applications";
+    homepage = "http://drobilla.net/software/raul";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/rtaudio/default.nix b/nixpkgs/pkgs/development/libraries/audio/rtaudio/default.nix
new file mode 100644
index 000000000000..4f2f78f20cf0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/rtaudio/default.nix
@@ -0,0 +1,65 @@
+{ stdenv
+, lib
+, config
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, pkg-config
+, alsaSupport ? stdenv.hostPlatform.isLinux
+, alsa-lib
+, pulseaudioSupport ? config.pulseaudio or stdenv.hostPlatform.isLinux
+, libpulseaudio
+, jackSupport ? true
+, jack
+, coreaudioSupport ? stdenv.hostPlatform.isDarwin
+, CoreAudio
+}:
+
+stdenv.mkDerivation rec {
+  version = "5.1.0";
+  pname = "rtaudio";
+
+  src = fetchFromGitHub {
+    owner = "thestk";
+    repo = "rtaudio";
+    rev = version;
+    sha256 = "1pglnjz907ajlhnlnig3p0sx7hdkpggr8ss7b3wzf1lykzgv9l52";
+  };
+
+  patches = [
+    # Fixes missing headers & install location
+    # Drop with version > 5.1.0
+    (fetchpatch {
+      name = "RtAudio-Adjust-CMake-public-header-installs-to-match-autotools.patch";
+      url = "https://github.com/thestk/rtaudio/commit/4273cf7572b8f51b5996cf6b42e3699cc6b165da.patch";
+      sha256 = "1p0idll0xsfk3jwjg83jkxkaf20gk0wqa7l982ni389rn6i4n26p";
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace rtaudio.pc.in \
+      --replace 'Requires:' 'Requires.private:'
+  '';
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = lib.optional alsaSupport alsa-lib
+    ++ lib.optional pulseaudioSupport libpulseaudio
+    ++ lib.optional jackSupport jack
+    ++ lib.optional coreaudioSupport CoreAudio;
+
+  cmakeFlags = [
+    "-DRTAUDIO_API_ALSA=${if alsaSupport then "ON" else "OFF"}"
+    "-DRTAUDIO_API_PULSE=${if pulseaudioSupport then "ON" else "OFF"}"
+    "-DRTAUDIO_API_JACK=${if jackSupport then "ON" else "OFF"}"
+    "-DRTAUDIO_API_CORE=${if coreaudioSupport then "ON" else "OFF"}"
+  ];
+
+  meta = with lib; {
+    description = "A set of C++ classes that provide a cross platform API for realtime audio input/output";
+    homepage = "https://www.music.mcgill.ca/~gary/rtaudio/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ magnetophon ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/rtmidi/default.nix b/nixpkgs/pkgs/development/libraries/audio/rtmidi/default.nix
new file mode 100644
index 000000000000..6c75b9866e89
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/rtmidi/default.nix
@@ -0,0 +1,71 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, pkg-config
+, alsaSupport ? stdenv.hostPlatform.isLinux
+, alsa-lib
+, jackSupport ? true
+, jack
+, coremidiSupport ? stdenv.hostPlatform.isDarwin
+, CoreMIDI
+, CoreAudio
+, CoreServices
+}:
+
+stdenv.mkDerivation rec {
+  version = "4.0.0";
+  pname = "rtmidi";
+
+  src = fetchFromGitHub {
+    owner = "thestk";
+    repo = "rtmidi";
+    rev = version;
+    sha256 = "1g31p6a96djlbk9jh5r4pjly3x76lhccva9hrw6xzdma8dsjzgyq";
+  };
+
+  patches = [
+    # PR #230, fix CMake problems
+    (fetchpatch {
+      name = "RtMidi-Fix-JACK_HAS_PORT_RENAME-define.patch";
+      url = "https://github.com/thestk/rtmidi/pull/230/commits/768a30a61b60240b66cc2d43bc27a544ff9f1622.patch";
+      sha256 = "1sym4f7nb2qyyxfhi1l0xsm2hfh6gddn81y36qvfq4mcs33vvid0";
+    })
+    (fetchpatch {
+      name = "RtMidi-Add-prefix-define-for-pkgconfig.patch";
+      url = "https://github.com/thestk/rtmidi/pull/230/commits/7a32e23e3f6cb43c0d2d58443ce205d438e76f44.patch";
+      sha256 = "06im8mb05wah6bnkadw2gpkhmilxb8p84pxqr50b205cchpq304w";
+    })
+    (fetchpatch {
+      name = "RtMidi-Adjust-public-header-installs-to-match-autotools.patch";
+      url = "https://github.com/thestk/rtmidi/pull/230/commits/892fe5492f0e787484fa4a37027b08c265ce001f.patch";
+      sha256 = "0ca9m42xa3gmycimzvzvl67wa266xq9pfp1b4v555rh2fp52kbcj";
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace rtmidi.pc.in \
+      --replace 'Requires:' 'Requires.private:'
+  '';
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = lib.optional alsaSupport alsa-lib
+    ++ lib.optional jackSupport jack
+    ++ lib.optionals coremidiSupport [ CoreMIDI CoreAudio CoreServices ];
+
+  cmakeFlags = [
+    "-DRTMIDI_API_ALSA=${if alsaSupport then "ON" else "OFF"}"
+    "-DRTMIDI_API_JACK=${if jackSupport then "ON" else "OFF"}"
+    "-DRTMIDI_API_CORE=${if coremidiSupport then "ON" else "OFF"}"
+  ];
+
+  meta = with lib; {
+    description = "A set of C++ classes that provide a cross platform API for realtime MIDI input/output";
+    homepage = "https://www.music.mcgill.ca/~gary/rtmidi/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ magnetophon ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/sratom/default.nix b/nixpkgs/pkgs/development/libraries/audio/sratom/default.nix
new file mode 100644
index 000000000000..bc8dc70f9b47
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/sratom/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, lv2, pkg-config, python3, serd, sord, wafHook }:
+
+stdenv.mkDerivation rec {
+  pname = "sratom";
+  version = "0.6.8";
+
+  src = fetchurl {
+    url = "https://download.drobilla.net/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-Ossysa3Forf6za3i4IGLzWxx8j+EoevBeBW7eg0tAt8=";
+  };
+
+  nativeBuildInputs = [ pkg-config wafHook python3 ];
+  buildInputs = [ lv2 serd sord ];
+
+  meta = with lib; {
+    homepage = "http://drobilla.net/software/sratom";
+    description = "A library for serialising LV2 atoms to/from RDF";
+    license = licenses.mit;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/suil/default.nix b/nixpkgs/pkgs/development/libraries/audio/suil/default.nix
new file mode 100644
index 000000000000..1c978a18f8f9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/suil/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, lib, fetchurl, gtk2, lv2, pkg-config, python3, serd, sord, sratom
+, wafHook
+, withQt4 ? true, qt4 ? null
+, withQt5 ? false, qt5 ? null }:
+
+# I haven't found an XOR operator in nix...
+assert withQt4 || withQt5;
+assert !(withQt4 && withQt5);
+
+stdenv.mkDerivation rec {
+  pname = "suil";
+  version = "0.10.6";
+  name = "${pname}-qt${if withQt4 then "4" else "5"}-${version}";
+
+  src = fetchurl {
+    url = "https://download.drobilla.net/${pname}-${version}.tar.bz2";
+    sha256 = "0z4v01pjw4wh65x38w6icn28wdwxz13ayl8hvn4p1g9kmamp1z06";
+  };
+
+  nativeBuildInputs = [ pkg-config wafHook python3 ];
+  buildInputs = [ gtk2 lv2 serd sord sratom ]
+    ++ (lib.optionals withQt4 [ qt4 ])
+    ++ (lib.optionals withQt5 (with qt5; [ qtbase qttools ]));
+
+  dontWrapQtApps = true;
+
+  strictDeps = true;
+
+  meta = with lib; {
+    homepage = "http://drobilla.net/software/suil";
+    description = "A lightweight C library for loading and wrapping LV2 plugin UIs";
+    license = licenses.mit;
+    maintainers = with maintainers; [ goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix b/nixpkgs/pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix
new file mode 100644
index 000000000000..4d033d99d295
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix
@@ -0,0 +1,29 @@
+# set VAMP_PATH ?
+# plugins availible on sourceforge and http://www.vamp-plugins.org/download.html (various licenses)
+
+{ lib, stdenv, fetchFromGitHub, pkg-config, libsndfile }:
+
+stdenv.mkDerivation rec {
+  pname = "vamp-plugin-sdk";
+  version = "2.10";
+
+  src = fetchFromGitHub {
+    owner = "c4dm";
+    repo = "vamp-plugin-sdk";
+    rev = "vamp-plugin-sdk-v${version}";
+    sha256 = "1lhmskcyk7qqfikmasiw7wjry74gc8g5q6a3j1iya84yd7ll0cz6";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libsndfile ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Audio processing plugin system for plugins that extract descriptive information from audio data";
+    homepage = "https://vamp-plugins.org/";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.goibhniu maintainers.marcweber ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix b/nixpkgs/pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix
new file mode 100644
index 000000000000..afecd561b727
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix
@@ -0,0 +1,64 @@
+{ lib, stdenv, fetchurl , alsa-lib, }:
+
+stdenv.mkDerivation rec {
+  pname = "zita-alsa-pcmi";
+  version = "0.3.2";
+  src = fetchurl {
+    url = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/${pname}-${version}.tar.bz2";
+    sha256 = "12d7vdg74yh21w69qi0wg57iz4876j94qbiq09bvscih6xz9y78s";
+  };
+
+  buildInputs = [ alsa-lib ];
+
+  buildPhase = ''
+    cd source
+    make PREFIX="$out"
+
+    # create lib link for building apps
+    ln -s libzita-alsa-pcmi.so.$version libzita-alsa-pcmi.so
+
+    # apps
+    cd ../apps
+    CXXFLAGS+=" -I../source" \
+    LDFLAGS+=" -L../source" \
+    make PREFIX="$out"
+  '';
+
+  installPhase = ''
+    mkdir "$out"
+    mkdir "$out/lib"
+    mkdir "$out/include"
+    mkdir "$out/bin"
+
+    cd ../source
+
+    # source
+    install -Dm755 libzita-alsa-pcmi.so.$version \
+      "$out/lib/libzita-alsa-pcmi.so.$version"
+
+    # link
+    ln -s libzita-alsa-pcmi.so.$version \
+      "$out/lib/libzita-alsa-pcmi.so"
+    ln -s libzita-alsa-pcmi.so.$version \
+      "$out/lib/libzita-alsa-pcmi.so.0"
+
+    # header
+    install -Dm644 zita-alsa-pcmi.h \
+      "$out/include/zita-alsa-pcmi.h"
+
+    # apps
+    install -Dm755 ../apps/alsa_delay \
+      "$out/bin/alsa_delay"
+    install -Dm755 ../apps/alsa_loopback \
+      "$out/bin/alsa_loopback"
+  '';
+
+  meta = {
+    description = "The successor of clalsadrv, provides easy access to ALSA PCM devices";
+    version = version;
+    homepage = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html";
+    license = lib.licenses.gpl3;
+    maintainers = [ lib.maintainers.magnetophon ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/zita-convolver/default.nix b/nixpkgs/pkgs/development/libraries/audio/zita-convolver/default.nix
new file mode 100644
index 000000000000..3b77bf549ca6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/zita-convolver/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, fftwFloat }:
+
+stdenv.mkDerivation rec {
+  pname = "zita-convolver";
+  version = "4.0.3";
+  src = fetchurl {
+    url = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/${pname}-${version}.tar.bz2";
+    sha256 = "0prji66p86z2bzminywkwchr5bfgxcg2i8y803pydd1hzf2198cs";
+  };
+
+  buildInputs = [ fftwFloat ];
+
+  patchPhase = ''
+    cd source
+    sed -e "s@ldconfig@@" -i Makefile
+  '';
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "SUFFIX="
+  ];
+
+  postInstall = ''
+    # create lib link for building apps
+    ln -s $out/lib/libzita-convolver.so.${version} $out/lib/libzita-convolver.so.${lib.versions.major version}
+  '';
+
+  meta = {
+    description = "Convolution library by Fons Adriaensen";
+    version = version;
+    homepage = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html";
+    license = lib.licenses.gpl2;
+    maintainers = [ lib.maintainers.magnetophon ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audio/zita-resampler/default.nix b/nixpkgs/pkgs/development/libraries/audio/zita-resampler/default.nix
new file mode 100644
index 000000000000..3b3c005a015b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audio/zita-resampler/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "zita-resampler";
+  version = "1.8.0";
+  src = fetchurl {
+    url = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-5XRPI8VN0Vs/eDpoe9h57uKmkKRUWhW0nEzwN6pGSqI=";
+  };
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "SUFFIX="
+  ];
+
+  patchPhase = ''
+    cd source
+    sed -e "s@ldconfig@@" -i Makefile
+  '';
+
+  fixupPhase = ''
+    ln -s $out/lib/libzita-resampler.so.$version $out/lib/libzita-resampler.so.1
+  '';
+
+  meta = {
+    description = "Resample library by Fons Adriaensen";
+    version = version;
+    homepage = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html";
+    license = lib.licenses.gpl2;
+    maintainers = [ lib.maintainers.magnetophon ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audiofile/CVE-2015-7747.patch b/nixpkgs/pkgs/development/libraries/audiofile/CVE-2015-7747.patch
new file mode 100644
index 000000000000..a01aaa14dcee
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audiofile/CVE-2015-7747.patch
@@ -0,0 +1,161 @@
+Description: fix buffer overflow when changing both sample format and
+ number of channels
+Origin: backport, https://github.com/mpruett/audiofile/pull/25
+Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/audiofile/+bug/1502721
+Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=801102
+
+Index: audiofile-0.3.6/libaudiofile/modules/ModuleState.cpp
+===================================================================
+--- audiofile-0.3.6.orig/libaudiofile/modules/ModuleState.cpp	2015-10-20 08:00:58.036128202 -0400
++++ audiofile-0.3.6/libaudiofile/modules/ModuleState.cpp	2015-10-20 08:00:58.036128202 -0400
+@@ -402,7 +402,7 @@
+		addModule(new Transform(outfc, in.pcm, out.pcm));
+
+	if (in.channelCount != out.channelCount)
+-		addModule(new ApplyChannelMatrix(infc, isReading,
++		addModule(new ApplyChannelMatrix(outfc, isReading,
+			in.channelCount, out.channelCount,
+			in.pcm.minClip, in.pcm.maxClip,
+			track->channelMatrix));
+Index: audiofile-0.3.6/test/Makefile.am
+===================================================================
+--- audiofile-0.3.6.orig/test/Makefile.am	2015-10-20 08:00:58.036128202 -0400
++++ audiofile-0.3.6/test/Makefile.am	2015-10-20 08:00:58.036128202 -0400
+@@ -26,6 +26,7 @@
+	VirtualFile \
+	floatto24 \
+	query2 \
++	sixteen-stereo-to-eight-mono \
+	sixteen-to-eight \
+	testchannelmatrix \
+	testdouble \
+@@ -139,6 +140,7 @@
+ printmarkers_LDADD = $(LIBAUDIOFILE) -lm
+
+ sixteen_to_eight_SOURCES = sixteen-to-eight.c TestUtilities.cpp TestUtilities.h
++sixteen_stereo_to_eight_mono_SOURCES = sixteen-stereo-to-eight-mono.c TestUtilities.cpp TestUtilities.h
+
+ testchannelmatrix_SOURCES = testchannelmatrix.c TestUtilities.cpp TestUtilities.h
+
+Index: audiofile-0.3.6/test/sixteen-stereo-to-eight-mono.c
+===================================================================
+--- /dev/null	1970-01-01 00:00:00.000000000 +0000
++++ audiofile-0.3.6/test/sixteen-stereo-to-eight-mono.c	2015-10-20 08:33:57.512286416 -0400
+@@ -0,0 +1,117 @@
++/*
++	Audio File Library
++
++	Copyright 2000, Silicon Graphics, Inc.
++
++	This program is free software; you can redistribute it and/or modify
++	it under the terms of the GNU General Public License as published by
++	the Free Software Foundation; either version 2 of the License, or
++	(at your option) any later version.
++
++	This program is distributed in the hope that it will be useful,
++	but WITHOUT ANY WARRANTY; without even the implied warranty of
++	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++	GNU General Public License for more details.
++
++	You should have received a copy of the GNU General Public License along
++	with this program; if not, write to the Free Software Foundation, Inc.,
++	51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
++*/
++
++/*
++	sixteen-stereo-to-eight-mono.c
++
++	This program tests the conversion from 2-channel 16-bit integers to
++	1-channel 8-bit	integers.
++*/
++
++#ifdef HAVE_CONFIG_H
++#include <config.h>
++#endif
++
++#include <stdint.h>
++#include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
++#include <unistd.h>
++#include <limits.h>
++
++#include <audiofile.h>
++
++#include "TestUtilities.h"
++
++int main (int argc, char **argv)
++{
++	AFfilehandle file;
++	AFfilesetup setup;
++	int16_t frames16[] = {14298, 392, 3923, -683, 958, -1921};
++	int8_t frames8[] = {28, 6, -2};
++	int i, frameCount = 3;
++	int8_t byte;
++	AFframecount result;
++
++	setup = afNewFileSetup();
++
++	afInitFileFormat(setup, AF_FILE_WAVE);
++
++	afInitSampleFormat(setup, AF_DEFAULT_TRACK, AF_SAMPFMT_TWOSCOMP, 16);
++	afInitChannels(setup, AF_DEFAULT_TRACK, 2);
++
++	char testFileName[PATH_MAX];
++	if (!createTemporaryFile("sixteen-to-eight", testFileName))
++	{
++		fprintf(stderr, "Could not create temporary file.\n");
++		exit(EXIT_FAILURE);
++	}
++
++	file = afOpenFile(testFileName, "w", setup);
++	if (file == AF_NULL_FILEHANDLE)
++	{
++		fprintf(stderr, "could not open file for writing\n");
++		exit(EXIT_FAILURE);
++	}
++
++	afFreeFileSetup(setup);
++
++	afWriteFrames(file, AF_DEFAULT_TRACK, frames16, frameCount);
++
++	afCloseFile(file);
++
++	file = afOpenFile(testFileName, "r", AF_NULL_FILESETUP);
++	if (file == AF_NULL_FILEHANDLE)
++	{
++		fprintf(stderr, "could not open file for reading\n");
++		exit(EXIT_FAILURE);
++	}
++
++	afSetVirtualSampleFormat(file, AF_DEFAULT_TRACK, AF_SAMPFMT_TWOSCOMP, 8);
++	afSetVirtualChannels(file, AF_DEFAULT_TRACK, 1);
++
++	for (i=0; i<frameCount; i++)
++	{
++		/* Read one frame. */
++		result = afReadFrames(file, AF_DEFAULT_TRACK, &byte, 1);
++
++		if (result != 1)
++			break;
++
++		/* Compare the byte read with its precalculated value. */
++		if (memcmp(&byte, &frames8[i], 1) != 0)
++		{
++			printf("error\n");
++			printf("expected %d, got %d\n", frames8[i], byte);
++			exit(EXIT_FAILURE);
++		}
++		else
++		{
++#ifdef DEBUG
++			printf("got what was expected: %d\n", byte);
++#endif
++		}
++	}
++
++	afCloseFile(file);
++	unlink(testFileName);
++
++	exit(EXIT_SUCCESS);
++}
diff --git a/nixpkgs/pkgs/development/libraries/audiofile/default.nix b/nixpkgs/pkgs/development/libraries/audiofile/default.nix
new file mode 100644
index 000000000000..54df6d7b2550
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audiofile/default.nix
@@ -0,0 +1,94 @@
+{ stdenv, lib, fetchurl, fetchpatch, alsa-lib, AudioUnit, CoreServices }:
+
+let
+
+  fetchDebianPatch = { name, debname, sha256 }:
+    fetchpatch {
+      inherit sha256 name;
+      url = "https://salsa.debian.org/multimedia-team/audiofile/raw/debian/0.3.6-4/debian/patches/${debname}";
+    };
+
+in
+
+stdenv.mkDerivation rec {
+  name = "audiofile-0.3.6";
+
+  buildInputs =
+    lib.optionals stdenv.isLinux [
+      alsa-lib
+    ] ++ lib.optionals stdenv.isDarwin [
+      CoreServices AudioUnit
+    ];
+
+  src = fetchurl {
+    url = "https://audiofile.68k.org/${name}.tar.gz";
+    sha256 = "0rb927zknk9kmhprd8rdr4azql4gn2dp75a36iazx2xhkbqhvind";
+  };
+
+  # fix build with gcc9
+  NIX_CFLAGS_LINK = lib.optional (stdenv.system == "i686-linux") "-lgcc";
+
+  # Even when statically linking, libstdc++.la is put in dependency_libs here,
+  # and hence libstdc++.so passed to the linker, just pass -lstdc++ and let the
+  # compiler do what it does best.  (libaudiofile.la is a generated file, so we
+  # have to run `make` that far first).
+  #
+  # Without this, the executables in this package (sfcommands and examples)
+  # fail to build: https://github.com/NixOS/nixpkgs/issues/103215
+  #
+  # There might be a more sensible way to do this with autotools, but I am not
+  # smart enough to discover it.
+  preBuild = lib.optionalString stdenv.hostPlatform.isStatic ''
+    make -C libaudiofile $makeFlags
+    sed -i "s/dependency_libs=.*/dependency_libs=' -lstdc++'/" libaudiofile/libaudiofile.la
+  '';
+
+  patches = [
+    ./gcc-6.patch
+    ./CVE-2015-7747.patch
+
+    (fetchDebianPatch {
+      name = "CVE-2017-6829.patch";
+      debname = "04_clamp-index-values-to-fix-index-overflow-in-IMA.cpp.patch";
+      sha256 = "04qxl51i64c53v69q2kx61qdq474f4vapk8rq97cipj7yrar392m";
+    })
+    (fetchDebianPatch {
+      name = "CVE-2017-6827+CVE-2017-6828+CVE-2017-6832+CVE-2017-6835+CVE-2017-6837.patch";
+      debname = "05_Always-check-the-number-of-coefficients.patch";
+      sha256 = "1ih03kfkabffi6ymp6832q470i28rsds78941vzqlshnqjb2nnxw";
+    })
+    (fetchDebianPatch {
+      name = "CVE-2017-6839.patch";
+      debname = "06_Check-for-multiplication-overflow-in-MSADPCM-decodeSam.patch";
+      sha256 = "0a8s2z8rljlj03p7l1is9s4fml8vyzvyvfrh1m6xj5a8vbi635d0";
+    })
+    (fetchDebianPatch {
+      name = "CVE-2017-6830+CVE-2017-6834+CVE-2017-6836+CVE-2017-6838.patch";
+      debname = "07_Check-for-multiplication-overflow-in-sfconvert.patch";
+      sha256 = "0rfba8rkasl5ycvc0kqlzinkl3rvyrrjvjhpc45h423wmjk2za2l";
+    })
+    (fetchDebianPatch {
+      name = "audiofile-fix-multiplyCheckOverflow-signature.patch";
+      debname = "08_Fix-signature-of-multiplyCheckOverflow.-It-returns-a-b.patch";
+      sha256 = "032p5jqp7q7jgc5axdnazz00zm7hd26z6m5j55ifs0sykr5lwldb";
+    })
+    (fetchDebianPatch {
+      name = "CVE-2017-6831.patch";
+      debname = "09_Actually-fail-when-error-occurs-in-parseFormat.patch";
+      sha256 = "0csikmj8cbiy6cigg0rmh67jrr0sgm56dfrnrxnac3m9635nxlac";
+    })
+    (fetchDebianPatch {
+      name = "CVE-2017-6833.patch";
+      debname = "10_Check-for-division-by-zero-in-BlockCodec-runPull.patch";
+      sha256 = "1rlislkjawq98bbcf1dgl741zd508wwsg85r37ca7pfdf6wgl6z7";
+    })
+  ];
+
+  meta = with lib; {
+    description = "Library for reading and writing audio files in various formats";
+    homepage    = "http://www.68k.org/~michael/audiofile/";
+    license     = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/audiofile/gcc-6.patch b/nixpkgs/pkgs/development/libraries/audiofile/gcc-6.patch
new file mode 100644
index 000000000000..1a7edd5af9a1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/audiofile/gcc-6.patch
@@ -0,0 +1,30 @@
+http://patchwork.ozlabs.org/patch/630200/
+
+From 28cfdbbcb96a69087c3d21faf69b5eae7bcf6d69 Mon Sep 17 00:00:00 2001
+From: Hodorgasm <nsane457@gmail.com>
+Date: Wed, 11 May 2016 21:42:07 -0400
+Subject: [PATCH] Cast to unsigned while left bit-shifting
+
+GCC-6 now treats the left bitwise-shift of a negative integer as nonconformant so explicitly cast to an unsigned int while bit-shifting.
+
+Downloaded from upstream PR:
+https://github.com/mpruett/audiofile/pull/28
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+ libaudiofile/modules/SimpleModule.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/libaudiofile/modules/SimpleModule.h b/libaudiofile/modules/SimpleModule.h
+index 03c6c69..4014fb2 100644
+--- a/libaudiofile/modules/SimpleModule.h
++++ b/libaudiofile/modules/SimpleModule.h
+@@ -123,7 +123,7 @@ struct signConverter
+ 	typedef typename IntTypes<Format>::UnsignedType UnsignedType;
+ 
+ 	static const int kScaleBits = (Format + 1) * CHAR_BIT - 1;
+-	static const int kMinSignedValue = -1 << kScaleBits;
++	static const int kMinSignedValue = static_cast<signed>(static_cast<unsigned>(-1) << kScaleBits);;
+ 
+ 	struct signedToUnsigned : public std::unary_function<SignedType, UnsignedType>
+ 	{
diff --git a/nixpkgs/pkgs/development/libraries/avahi/default.nix b/nixpkgs/pkgs/development/libraries/avahi/default.nix
new file mode 100644
index 000000000000..a52d1be566e6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/avahi/default.nix
@@ -0,0 +1,100 @@
+{ fetchurl, fetchpatch, lib, stdenv, pkg-config, libdaemon, dbus, perlPackages
+, expat, gettext, intltool, glib, libiconv, writeShellScriptBin, libevent
+, nixosTests
+, gtk3Support ? false, gtk3 ? null
+, qt4 ? null
+, qt4Support ? false
+, qt5 ? null
+, qt5Support ? false
+, withLibdnssdCompat ? false
+, python ? null
+, withPython ? false }:
+
+assert qt4Support -> qt4 != null;
+
+let
+  # despite the configure script claiming it supports $PKG_CONFIG, it doesnt respect it
+  pkg-config-helper = writeShellScriptBin "pkg-config" ''exec $PKG_CONFIG "$@"'';
+in
+
+stdenv.mkDerivation rec {
+  name = "avahi${lib.optionalString withLibdnssdCompat "-compat"}-${version}";
+  version = "0.8";
+
+  src = fetchurl {
+    url = "https://github.com/lathiat/avahi/releases/download/v${version}/avahi-${version}.tar.gz";
+    sha256 = "1npdixwxxn3s9q1f365x9n9rc5xgfz39hxf23faqvlrklgbhj0q6";
+  };
+
+  prePatch = ''
+    substituteInPlace configure \
+      --replace pkg-config "$PKG_CONFIG"
+  '';
+
+  patches = [
+    ./no-mkdir-localstatedir.patch
+  ];
+
+  buildInputs = [ libdaemon dbus glib expat libiconv libevent ]
+    ++ (with perlPackages; [ perl XMLParser ])
+    ++ (lib.optional gtk3Support gtk3)
+    ++ (lib.optional qt4Support qt4)
+    ++ (lib.optional qt5Support qt5);
+
+  propagatedBuildInputs =
+    lib.optionals withPython (with python.pkgs; [ python pygobject3 dbus-python ]);
+
+  nativeBuildInputs = [ pkg-config pkg-config-helper gettext intltool glib ];
+
+  configureFlags =
+    [ "--disable-qt3" "--disable-gdbm" "--disable-mono"
+      "--disable-gtk" "--with-dbus-sys=${placeholder "out"}/share/dbus-1/system.d"
+      (lib.enableFeature gtk3Support "gtk3")
+      "--${if qt4Support then "enable" else "disable"}-qt4"
+      "--${if qt5Support then "enable" else "disable"}-qt5"
+      (lib.enableFeature withPython "python")
+      "--localstatedir=/var" "--with-distro=none"
+      # A systemd unit is provided by the avahi-daemon NixOS module
+      "--with-systemdsystemunitdir=no" ]
+    ++ lib.optional withLibdnssdCompat "--enable-compat-libdns_sd"
+    # autoipd won't build on darwin
+    ++ lib.optional stdenv.isDarwin "--disable-autoipd";
+
+  NIX_CFLAGS_COMPILE = "-DAVAHI_SERVICE_DIR=\"/etc/avahi/services\"";
+
+  preBuild = lib.optionalString stdenv.isDarwin ''
+    sed -i '20 i\
+    #define __APPLE_USE_RFC_2292' \
+    avahi-core/socket.c
+  '';
+
+  postInstall =
+    # Maintain compat for mdnsresponder and howl
+    lib.optionalString withLibdnssdCompat ''
+      ln -s avahi-compat-libdns_sd/dns_sd.h "$out/include/dns_sd.h"
+    '';
+  /*  # these don't exist (anymore?)
+    ln -s avahi-compat-howl $out/include/howl
+    ln -s avahi-compat-howl.pc $out/lib/pkgconfig/howl.pc
+  */
+
+  passthru.tests = {
+    smoke-test = nixosTests.avahi;
+    smoke-test-resolved = nixosTests.avahi-with-resolved;
+  };
+
+  meta = with lib; {
+    description = "mDNS/DNS-SD implementation";
+    homepage    = "http://avahi.org";
+    license     = licenses.lgpl2Plus;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ lovek323 globin ];
+
+    longDescription = ''
+      Avahi is a system which facilitates service discovery on a local
+      network.  It is an implementation of the mDNS (for "Multicast
+      DNS") and DNS-SD (for "DNS-Based Service Discovery")
+      protocols.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/avahi/no-mkdir-localstatedir.patch b/nixpkgs/pkgs/development/libraries/avahi/no-mkdir-localstatedir.patch
new file mode 100644
index 000000000000..72965c9f0282
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/avahi/no-mkdir-localstatedir.patch
@@ -0,0 +1,12 @@
+Don't "mkdir $(localstatedir)" since we can't do it (/var).
+
+--- a/avahi-daemon/Makefile.in
++++ b/avahi-daemon/Makefile.in
+@@ -1625,7 +1625,6 @@ xmllint:
+ 	done
+ 
+ install-data-local:
+-	test -z "$(avahi_runtime_dir)" || $(MKDIR_P) "$(DESTDIR)$(avahi_runtime_dir)"
+ 
+ update-systemd:
+ 	curl http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c > sd-daemon.c
diff --git a/nixpkgs/pkgs/development/libraries/avro-c++/default.nix b/nixpkgs/pkgs/development/libraries/avro-c++/default.nix
new file mode 100644
index 000000000000..ad373300e02f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/avro-c++/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, cmake, boost, python2}:
+
+stdenv.mkDerivation rec {
+  pname = "avro-c++";
+  version = "1.8.2";
+
+  src = fetchurl {
+    url = "mirror://apache/avro/avro-${version}/cpp/avro-cpp-${version}.tar.gz";
+    sha256 = "1ars58bfw83s8f1iqbhnqp4n9wc9cxsph0gs2a8k7r9fi09vja2k";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ python2 boost ];
+
+  preConfigure = ''
+    substituteInPlace test/SchemaTests.cc --replace "BOOST_CHECKPOINT" "BOOST_TEST_CHECKPOINT"
+    substituteInPlace test/buffertest.cc --replace "BOOST_MESSAGE" "BOOST_TEST_MESSAGE"
+  '';
+
+  meta = {
+    description = "A C++ library which implements parts of the Avro Specification";
+    homepage = "https://avro.apache.org/";
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ rasendubi ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/avro-c/default.nix b/nixpkgs/pkgs/development/libraries/avro-c/default.nix
new file mode 100644
index 000000000000..ee43daf2d044
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/avro-c/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, cmake, fetchurl, pkg-config, jansson, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "avro-c";
+  version = "1.10.2";
+
+  src = fetchurl {
+    url = "mirror://apache/avro/avro-${version}/c/avro-c-${version}.tar.gz";
+    sha256 = "sha256-rj+zK+xKBon1Rn4JIBGS7cbo80ITTvBq1FLKhw9Wt+I=";
+  };
+
+  postPatch = ''
+    patchShebangs .
+  '';
+
+  nativeBuildInputs = [ pkg-config cmake ];
+
+  buildInputs = [ jansson zlib ];
+
+  meta = with lib; {
+    description = "A C library which implements parts of the Avro Specification";
+    homepage = "https://avro.apache.org/";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ lblasc ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/aws-c-cal/default.nix b/nixpkgs/pkgs/development/libraries/aws-c-cal/default.nix
new file mode 100644
index 000000000000..6f3df977efa8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aws-c-cal/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, cmake, aws-c-common, openssl, Security }:
+
+stdenv.mkDerivation rec {
+  pname = "aws-c-cal";
+  version = "0.5.11";
+
+  src = fetchFromGitHub {
+    owner = "awslabs";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-rmEsDsY50IKpCpQTvAFEkgCtuHwwgwMwcRpBUyyZGGc=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ aws-c-common openssl ];
+
+  propagatedBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ Security ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DCMAKE_MODULE_PATH=${aws-c-common}/lib/cmake"
+  ];
+
+  meta = with lib; {
+    description = "AWS Crypto Abstraction Layer ";
+    homepage = "https://github.com/awslabs/aws-c-cal";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ orivej ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/aws-c-common/default.nix b/nixpkgs/pkgs/development/libraries/aws-c-common/default.nix
new file mode 100644
index 000000000000..ae47959dd3aa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aws-c-common/default.nix
@@ -0,0 +1,42 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, coreutils
+}:
+
+stdenv.mkDerivation rec {
+  pname = "aws-c-common";
+  version = "0.6.9";
+
+  src = fetchFromGitHub {
+    owner = "awslabs";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-bnKIL51AW+0T87BxEazXDZElYqiwOUHQVEDKOCUzsbM=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DCMAKE_SKIP_BUILD_RPATH=OFF" # for tests
+  ];
+
+  # Prevent the execution of tests known to be flaky.
+  preCheck = ''
+    cat <<EOW >CTestCustom.cmake
+    SET(CTEST_CUSTOM_TESTS_IGNORE promise_test_multiple_waiters)
+    EOW
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "AWS SDK for C common core";
+    homepage = "https://github.com/awslabs/aws-c-common";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ orivej eelco r-burns ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/aws-c-event-stream/default.nix b/nixpkgs/pkgs/development/libraries/aws-c-event-stream/default.nix
new file mode 100644
index 000000000000..b6468a8dae0a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aws-c-event-stream/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, cmake, aws-c-cal, aws-c-common, aws-c-io, aws-checksums, s2n-tls, libexecinfo }:
+
+stdenv.mkDerivation rec {
+  pname = "aws-c-event-stream";
+  version = "0.2.7";
+
+  src = fetchFromGitHub {
+    owner = "awslabs";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-8Du9Ib3MhPcgetBIi0k1NboaXxZh7iPNhDe7197JnHc=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ aws-c-cal aws-c-common aws-c-io aws-checksums s2n-tls ]
+    ++ lib.optional stdenv.hostPlatform.isMusl libexecinfo;
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS:BOOL=ON"
+    "-DCMAKE_MODULE_PATH=${aws-c-common}/lib/cmake"
+  ];
+
+  meta = with lib; {
+    description = "C99 implementation of the vnd.amazon.eventstream content-type";
+    homepage = "https://github.com/awslabs/aws-c-event-stream";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ orivej eelco ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/aws-c-io/default.nix b/nixpkgs/pkgs/development/libraries/aws-c-io/default.nix
new file mode 100644
index 000000000000..012d96fca4d7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aws-c-io/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, cmake, aws-c-cal, aws-c-common, s2n-tls, Security }:
+
+stdenv.mkDerivation rec {
+  pname = "aws-c-io";
+  version = "0.10.5";
+
+  src = fetchFromGitHub {
+    owner = "awslabs";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-+H6dUKgpgXG1fh8r6k7TpVFMBso4G762zRfLAZD+Nss=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ aws-c-cal aws-c-common s2n-tls ];
+  propagatedBuildInputs = lib.optionals stdenv.hostPlatform.isDarwin [ Security ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DCMAKE_MODULE_PATH=${aws-c-common}/lib/cmake"
+  ];
+
+  meta = with lib; {
+    description = "AWS SDK for C module for IO and TLS";
+    homepage = "https://github.com/awslabs/aws-c-io";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ orivej ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/aws-checksums/default.nix b/nixpkgs/pkgs/development/libraries/aws-checksums/default.nix
new file mode 100644
index 000000000000..75b26695e2f2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aws-checksums/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, cmake, aws-c-common }:
+
+stdenv.mkDerivation rec {
+  pname = "aws-checksums";
+  version = "0.1.11";
+
+  src = fetchFromGitHub {
+    owner = "awslabs";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-fXu7GI2UR9QiBGP2n2pEFRjz9ZwA+BAK9zxhNnoYWt4=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ aws-c-common ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DCMAKE_MODULE_PATH=${aws-c-common}/lib/cmake"
+  ];
+
+  meta = with lib; {
+    description = "HW accelerated CRC32c and CRC32";
+    homepage = "https://github.com/awslabs/aws-checksums";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ orivej eelco ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/cmake-dirs.patch b/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/cmake-dirs.patch
new file mode 100644
index 000000000000..b2f12e77025c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/cmake-dirs.patch
@@ -0,0 +1,65 @@
+--- a/cmake/AWSSDKConfig.cmake
++++ b/cmake/AWSSDKConfig.cmake
+@@ -97,14 +98,18 @@ if (NOT AWSSDK_CORE_HEADER_FILE)
+     message(FATAL_ERROR "AWS SDK for C++ is missing, please install it first")
+ endif()
+ 
+-# based on core header file path, inspects the actual AWSSDK_ROOT_DIR
+-get_filename_component(AWSSDK_ROOT_DIR "${AWSSDK_CORE_HEADER_FILE}" PATH)
+-get_filename_component(AWSSDK_ROOT_DIR "${AWSSDK_ROOT_DIR}" PATH)
+-get_filename_component(AWSSDK_ROOT_DIR "${AWSSDK_ROOT_DIR}" PATH)
+-get_filename_component(AWSSDK_ROOT_DIR "${AWSSDK_ROOT_DIR}" PATH)
+-
+-if (NOT AWSSDK_ROOT_DIR)
+-    message(FATAL_ERROR "AWSSDK_ROOT_DIR is not set or can't be calculated from the path of core header file")
++if (IS_ABSOLUTE ${AWSSDK_INSTALL_LIBDIR})
++    set(AWSSDK_ROOT_DIR "")
++else()
++    # based on core header file path, inspects the actual AWSSDK_ROOT_DIR
++    get_filename_component(AWSSDK_ROOT_DIR "${AWSSDK_CORE_HEADER_FILE}" PATH)
++    get_filename_component(AWSSDK_ROOT_DIR "${AWSSDK_ROOT_DIR}" PATH)
++    get_filename_component(AWSSDK_ROOT_DIR "${AWSSDK_ROOT_DIR}" PATH)
++    get_filename_component(AWSSDK_ROOT_DIR "${AWSSDK_ROOT_DIR}" PATH)
++
++    if (NOT AWSSDK_ROOT_DIR)
++	message(FATAL_ERROR "AWSSDK_ROOT_DIR is not set or can't be calculated from the path of core header file")
++    endif()
+ endif()
+ 
+ 
+diff --git a/cmake/utilities.cmake b/cmake/utilities.cmake
+index 283a14a138..646aea1da3 100644
+--- a/cmake/utilities.cmake
++++ b/cmake/utilities.cmake
+@@ -43,7 +43,8 @@ macro(setup_install)
+                 EXPORT "${PROJECT_NAME}-targets"
+                 ARCHIVE DESTINATION ${ARCHIVE_DIRECTORY}
+                 LIBRARY DESTINATION ${LIBRARY_DIRECTORY}
+-                RUNTIME DESTINATION ${BINARY_DIRECTORY} )
++                RUNTIME DESTINATION ${BINARY_DIRECTORY}
++                INCLUDES DESTINATION ${INCLUDE_DIRECTORY} )
+ 
+         if (BUILD_SHARED_LIBS)
+             install(
+@@ -57,7 +58,8 @@ macro(setup_install)
+             install (TARGETS ${PROJECT_NAME}
+                      ARCHIVE DESTINATION ${ARCHIVE_DIRECTORY}/${SDK_INSTALL_BINARY_PREFIX}/${PLATFORM_INSTALL_QUALIFIER}/\${CMAKE_INSTALL_CONFIG_NAME}
+                      LIBRARY DESTINATION ${LIBRARY_DIRECTORY}/${SDK_INSTALL_BINARY_PREFIX}/${PLATFORM_INSTALL_QUALIFIER}/\${CMAKE_INSTALL_CONFIG_NAME}
+-                     RUNTIME DESTINATION ${BINARY_DIRECTORY}/${SDK_INSTALL_BINARY_PREFIX}/${PLATFORM_INSTALL_QUALIFIER}/\${CMAKE_INSTALL_CONFIG_NAME})
++                     RUNTIME DESTINATION ${BINARY_DIRECTORY}/${SDK_INSTALL_BINARY_PREFIX}/${PLATFORM_INSTALL_QUALIFIER}/\${CMAKE_INSTALL_CONFIG_NAME}
++                     INCLUDES DESTINATION ${INCLUDE_DIRECTORY}/${SDK_INSTALL_BINARY_PREFIX}/${PLATFORM_INSTALL_QUALIFIER}/\${CMAKE_INSTALL_CONFIG_NAME})
+         endif()
+     endif()
+ endmacro()
+diff --git a/toolchains/pkg-config.pc.in b/toolchains/pkg-config.pc.in
+index 9b519d2772..a61069225c 100644
+--- a/toolchains/pkg-config.pc.in
++++ b/toolchains/pkg-config.pc.in
+@@ -1,5 +1,5 @@
+-includedir=@CMAKE_INSTALL_PREFIX@/@INCLUDE_DIRECTORY@
+-libdir=@CMAKE_INSTALL_PREFIX@/@LIBRARY_DIRECTORY@
++includedir=@INCLUDE_DIRECTORY@
++libdir=@LIBRARY_DIRECTORY@
+ 
+ Name: @PROJECT_NAME@
+ Description: @PROJECT_DESCRIPTION@
diff --git a/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/default.nix b/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/default.nix
new file mode 100644
index 000000000000..fa081ab3f24f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/default.nix
@@ -0,0 +1,94 @@
+{ lib, stdenv, fetchFromGitHub, cmake, curl, openssl, s2n-tls, zlib
+, aws-c-cal, aws-c-common, aws-c-event-stream, aws-c-io, aws-checksums
+, CoreAudio, AudioToolbox
+, # Allow building a limited set of APIs, e.g. ["s3" "ec2"].
+  apis ? ["*"]
+, # Whether to enable AWS' custom memory management.
+  customMemoryManagement ? true
+}:
+
+let
+  host_os = if stdenv.hostPlatform.isDarwin then "APPLE"
+       else if stdenv.hostPlatform.isAndroid then "ANDROID"
+       else if stdenv.hostPlatform.isWindows then "WINDOWS"
+       else if stdenv.hostPlatform.isLinux then "LINUX"
+       else throw "Unknown host OS";
+in
+
+stdenv.mkDerivation rec {
+  pname = "aws-sdk-cpp";
+  version = "1.8.130";
+
+  src = fetchFromGitHub {
+    owner = "awslabs";
+    repo = "aws-sdk-cpp";
+    rev = version;
+    sha256 = "sha256-5T4l0KYB0utFTdEOtYT9trQ/JehQbXxk/IhI6YavErs=";
+  };
+
+  # FIXME: might be nice to put different APIs in different outputs
+  # (e.g. libaws-cpp-sdk-s3.so in output "s3").
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ cmake curl ];
+
+  buildInputs = [
+    curl openssl zlib
+  ] ++ lib.optionals (stdenv.isDarwin &&
+                        ((builtins.elem "text-to-speech" apis) ||
+                         (builtins.elem "*" apis)))
+         [ CoreAudio AudioToolbox ];
+
+  # propagation is needed for Security.framework to be available when linking
+  propagatedBuildInputs = [
+    aws-c-cal
+    aws-c-event-stream
+    aws-c-io
+    aws-c-common
+    aws-checksums
+    s2n-tls
+  ];
+
+  cmakeFlags = [
+    "-DBUILD_DEPS=OFF"
+    "-DCMAKE_SKIP_BUILD_RPATH=OFF"
+  ] ++ lib.optional (!customMemoryManagement) "-DCUSTOM_MEMORY_MANAGEMENT=0"
+  ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+    "-DENABLE_TESTING=OFF"
+    "-DCURL_HAS_H2=1"
+    "-DCURL_HAS_TLS_PROXY=1"
+    "-DTARGET_ARCH=${host_os}"
+  ] ++ 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
+    '';
+
+  postFixupHooks = [
+    # This bodge is necessary so that the file that the generated -config.cmake file
+    # points to an existing directory.
+    "mkdir -p $out/include"
+  ];
+
+  __darwinAllowLocalNetworking = true;
+
+  patches = [
+    ./cmake-dirs.patch
+  ];
+
+  # Builds in 2+h with 2 cores, and ~10m with a big-parallel builder.
+  requiredSystemFeatures = [ "big-parallel" ];
+
+  meta = with lib; {
+    description = "A C++ interface for Amazon Web Services";
+    homepage = "https://github.com/awslabs/aws-sdk-cpp";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ eelco orivej ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ayatana-ido/default.nix b/nixpkgs/pkgs/development/libraries/ayatana-ido/default.nix
new file mode 100644
index 000000000000..03b89411168a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ayatana-ido/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub
+, pkg-config, autoreconfHook
+, gtk3, gobject-introspection, gtk-doc, vala
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ayatana-ido";
+  version = "0.8.2";
+
+  src = fetchFromGitHub {
+    owner = "AyatanaIndicators";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-nJ4F2faK0XZPj9GzUk3Ueap5h6rALFXISHqFQ30RuoU=";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook gtk-doc vala gobject-introspection ];
+
+  buildInputs = [ gtk3 ];
+
+  meta = with lib; {
+    description = "Ayatana Display Indicator Objects";
+    homepage = "https://github.com/AyatanaIndicators/ayatana-ido";
+    changelog = "https://github.com/AyatanaIndicators/ayatana-ido/blob/${version}/ChangeLog";
+    license = [ licenses.lgpl3Plus licenses.lgpl21Plus ];
+    maintainers = [ maintainers.nickhu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/babl/default.nix b/nixpkgs/pkgs/development/libraries/babl/default.nix
new file mode 100644
index 000000000000..c0765922de5f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/babl/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, gobject-introspection
+, lcms2
+, vala
+}:
+
+stdenv.mkDerivation rec {
+  pname = "babl";
+  version = "0.1.88";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "https://download.gimp.org/pub/babl/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-Tw1/SqoLsucl80mt97NRqVfZ+ybVVdmJWnr4FrQWcDk=";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gobject-introspection
+    vala
+  ];
+
+  buildInputs = [
+    lcms2
+  ];
+
+  meta = with lib; {
+    description = "Image pixel format conversion library";
+    homepage = "https://gegl.org/babl/";
+    license = licenses.lgpl3Plus;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/backward-cpp/default.nix b/nixpkgs/pkgs/development/libraries/backward-cpp/default.nix
new file mode 100644
index 000000000000..03f49c3ee504
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/backward-cpp/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, lib, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "backward";
+  version = "1.3";
+
+  src = fetchFromGitHub {
+    owner = "bombela";
+    repo = "backward-cpp";
+    rev = "v${version}";
+    sha256 = "1nx77qamal53rq8qxsjzax6ljawb345a1v3cqmfwa0hx26srxcln";
+  };
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/include
+    cp backward.hpp $out/include
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Beautiful stack trace pretty printer for C++";
+    homepage = "https://github.com/bombela/backward-cpp";
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ cstrahan ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/bamf/default.nix b/nixpkgs/pkgs/development/libraries/bamf/default.nix
new file mode 100644
index 000000000000..f1a7420fbce7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bamf/default.nix
@@ -0,0 +1,104 @@
+{ lib, stdenv
+, pantheon
+, autoconf
+, automake
+, libtool
+, gnome
+, which
+, fetchgit
+, libgtop
+, libwnck
+, glib
+, vala
+, pkg-config
+, libstartup_notification
+, gobject-introspection
+, gtk-doc
+, docbook_xsl
+, xorgserver
+, dbus
+, python3
+, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "bamf";
+  version = "0.5.4";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchgit {
+    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
+    gnome.gnome-common
+    gobject-introspection
+    gtk-doc
+    libtool
+    pkg-config
+    vala
+    which
+    wrapGAppsHook
+    xorgserver
+  ];
+
+  buildInputs = [
+    glib
+    libgtop
+    libstartup_notification
+    libwnck
+  ];
+
+  patches = [
+    # Port tests and checks to python3 lxml.
+    ./gtester2xunit-python3.patch
+  ];
+
+  # Fix hard-coded path
+  # https://bugs.launchpad.net/bamf/+bug/1780557
+  postPatch = ''
+    substituteInPlace data/Makefile.am \
+      --replace '/usr/lib/systemd/user' '@prefix@/lib/systemd/user'
+  '';
+
+  configureFlags = [
+    "--enable-gtk-doc"
+    "--enable-headless-tests"
+  ];
+
+  # fix paths
+  makeFlags = [
+    "INTROSPECTION_GIRDIR=${placeholder "dev"}/share/gir-1.0/"
+    "INTROSPECTION_TYPELIBDIR=${placeholder "out"}/lib/girepository-1.0"
+  ];
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  # TODO: Requires /etc/machine-id
+  doCheck = false;
+
+  # glib-2.62 deprecations
+  NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS";
+
+  meta = with lib; {
+    description = "Application matching framework";
+    longDescription = ''
+      Removes the headache of applications matching
+      into a simple DBus daemon and c wrapper library.
+    '';
+    homepage = "https://launchpad.net/bamf";
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    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/bashup-events/3.2.nix b/nixpkgs/pkgs/development/libraries/bashup-events/3.2.nix
new file mode 100644
index 000000000000..f7e88c382511
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bashup-events/3.2.nix
@@ -0,0 +1,26 @@
+{ callPackage, fetchFromGitHub }:
+
+callPackage ./generic.nix {
+  variant = "3.2";
+  version = "2019-07-27";
+  branch = "master";
+  src = fetchFromGitHub {
+    owner = "bashup";
+    repo = "events";
+    rev = "83744c21bf720afb8325343674c62ab46a8f3d94";
+    hash = "sha256-0VDjd+1T1JBmSDGovWOOecUZmNztlwG32UcstfdigbI=";
+  };
+  fake = {
+    # Note: __ev.encode is actually defined, but it happens in a
+    # quoted arg to eval, which resholve currently doesn't (and may
+    # never) parse into. See abathur/resholve/issues/2.
+    function = [ "__ev.encode" ];
+  };
+  keep = {
+    # allow vars in eval
+    eval = [ "e" "f" "q" "r" ];
+    # allow vars executed as commands
+    "$f" = true;
+    "$n" = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/bashup-events/4.4.nix b/nixpkgs/pkgs/development/libraries/bashup-events/4.4.nix
new file mode 100644
index 000000000000..f880009ea71a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bashup-events/4.4.nix
@@ -0,0 +1,20 @@
+{ callPackage, fetchFromGitHub }:
+
+callPackage ./generic.nix {
+  variant = "4.4";
+  version = "2020-04-04";
+  branch = "bash44";
+  src = fetchFromGitHub {
+    owner = "bashup";
+    repo = "events";
+    rev = "e97654f5602fc4e31083b27afa18dcc89b3e8296";
+    hash = "sha256-51OSIod3mEg3MKs4rrMgRcOimDGC+3UIr4Bl/cTRyGM=";
+  };
+  keep = {
+    # allow vars in eval
+    eval = [ "e" "bashup_ev" "n" ];
+    # allow vars executed as commands
+    "$f" = true;
+    "$n" = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/bashup-events/default.nix b/nixpkgs/pkgs/development/libraries/bashup-events/default.nix
new file mode 100644
index 000000000000..bcefdd0fcacf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bashup-events/default.nix
@@ -0,0 +1,6 @@
+{ callPackage }:
+
+{
+  bashup-events32 = callPackage ./3.2.nix { };
+  bashup-events44 = callPackage ./4.4.nix { };
+}
diff --git a/nixpkgs/pkgs/development/libraries/bashup-events/generic.nix b/nixpkgs/pkgs/development/libraries/bashup-events/generic.nix
new file mode 100644
index 000000000000..fd4e2cfe9f5f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bashup-events/generic.nix
@@ -0,0 +1,89 @@
+{
+  # general
+  lib
+, resholvePackage
+, bash
+, shellcheck
+, doCheck ? true
+, doInstallCheck ? true
+  # variant-specific
+, variant
+, version
+, branch
+, src
+, fake ? false
+, keep
+}:
+let
+  # extracting this so that it's trivial to test in other shells
+  installCheck = shell:
+    ''
+      echo "testing bashup.events in ${shell}"
+      ${shell} <<'EOF'
+      source $out/bin/bashup.events
+      neat(){
+        echo $0: Hi from event \'test event\'. I can have both $1 and $2 arguments.
+        exit 0
+      }
+      event on "test event" @2 neat curried
+      echo event registered
+      event emit "test event" runtime
+      exit 1 # fail if emitting event didn't exit clean
+      EOF
+    '';
+
+in
+resholvePackage rec {
+  # bashup.events doesn't version yet but it has two variants with
+  # differing features/performance characteristics:
+  # - branch master: a variant for bash 3.2+
+  # - branch bash44: a variant for bash 4.4+
+  pname = "bashup-events${variant}-unstable";
+  # should be YYYY-MM-DD
+  inherit version;
+  inherit src;
+
+  installPhase = ''
+    runHook preInstall
+    install -Dt $out/bin bashup.events
+    runHook postInstall
+  '';
+
+  inherit doCheck;
+  checkInputs = [ shellcheck bash ];
+
+  # check based on https://github.com/bashup/events/blob/master/.dkrc
+  checkPhase = ''
+    runHook preCheck
+    SHELLCHECK_OPTS='-e SC2016,SC2145' ${shellcheck}/bin/shellcheck ./bashup.events
+    ${bash}/bin/bash -n ./bashup.events
+    ${bash}/bin/bash ./bashup.events
+    runHook postCheck
+  '';
+
+  solutions = {
+    events = {
+      inputs = [ ];
+      interpreter = "none";
+      scripts = [ "bin/bashup.events" ];
+      inherit keep;
+    } // lib.optionalAttrs (lib.isAttrs fake) { inherit fake; };
+  };
+
+  inherit doInstallCheck;
+  installCheckInputs = [ bash ];
+  installCheckPhase = ''
+    runHook preInstallCheck
+    ${installCheck "${bash}/bin/bash"}
+    runHook postInstallCheck
+  '';
+
+  meta = with lib; {
+    inherit branch;
+    description = "An event listener/callback API for creating extensible bash programs";
+    homepage = "https://github.com/bashup/events";
+    license = licenses.cc0;
+    maintainers = with maintainers; [ abathur ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/bcg729/default.nix b/nixpkgs/pkgs/development/libraries/bcg729/default.nix
new file mode 100644
index 000000000000..125512c3fed6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bcg729/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv
+, fetchFromGitLab
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "bcg729";
+  version = "1.1.1";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.linphone.org";
+    owner = "public";
+    group = "BC";
+    repo = pname;
+    rev = version;
+    sha256 = "1hal6b3w6f8y5r1wa0xzj8sj2jjndypaxyw62q50p63garp2h739";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with 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.gpl3Plus;
+    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
new file mode 100644
index 000000000000..c1d2813a4f2a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bctoolbox/default.nix
@@ -0,0 +1,36 @@
+{ bcunit
+, cmake
+, fetchFromGitLab
+, mbedtls
+, lib, stdenv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "bctoolbox";
+  version = "5.0.0";
+
+  nativeBuildInputs = [ cmake bcunit ];
+  buildInputs = [ mbedtls ];
+
+  src = fetchFromGitLab {
+    domain = "gitlab.linphone.org";
+    owner = "public";
+    group = "BC";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-/jv59ZeELfP7PokzthvZNL4FS3tyzRmCHp4I/Lp8BJM=";
+  };
+
+  # Do not build static libraries
+  cmakeFlags = [ "-DENABLE_STATIC=NO" ];
+
+  NIX_CFLAGS_COMPILE = [ "-Wno-error=stringop-truncation" ];
+
+  meta = with lib; {
+    description = "Utilities library for Linphone";
+    homepage = "https://gitlab.linphone.org/BC/public/bctoolbox";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ raskin jluttine ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/bearssl/default.nix b/nixpkgs/pkgs/development/libraries/bearssl/default.nix
new file mode 100644
index 000000000000..36873f03f7e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bearssl/default.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "bearssl";
+  version = "0.6";
+
+  src = fetchurl {
+    url = "https://www.bearssl.org/bearssl-${version}.tar.gz";
+    sha256 = "057zhgy9w4y8z2996r0pq5k2k39lpvmmvz4df8db8qa9f6hvn1b7";
+  };
+
+  outputs = [ "bin" "lib" "dev" "out" ];
+
+  enableParallelBuilding = true;
+
+  installPhase = ''
+    runHook preInstall
+    install -D build/brssl $bin/brssl
+    install -D build/testcrypto $bin/testcrypto
+    install -Dm644 build/libbearssl.so $lib/lib/libbearssl.so
+    install -Dm644 build/libbearssl.a $lib/lib/libbearssl.a
+    install -Dm644 -t $dev/include inc/*.h
+    touch $out
+    runHook postInstall
+  '';
+
+  meta = {
+    homepage = "https://www.bearssl.org/";
+    description = "An implementation of the SSL/TLS protocol written in C";
+    longDescription = ''
+      BearSSL is an implementation of the SSL/TLS protocol (RFC 5246)
+      written in C. It aims at offering the following features:
+
+      * Be correct and secure. In particular, insecure protocol versions and
+        choices of algorithms are not supported, by design; cryptographic
+        algorithm implementations are constant-time by default.
+
+      * Be small, both in RAM and code footprint. For instance, a minimal
+        server implementation may fit in about 20 kilobytes of compiled code
+        and 25 kilobytes of RAM.
+
+      * Be highly portable. BearSSL targets not only “big” operating systems
+        like Linux and Windows, but also small embedded systems and even
+        special contexts like bootstrap code.
+
+      * Be feature-rich and extensible. SSL/TLS has many defined cipher
+        suites and extensions; BearSSL should implement most of them, and
+        allow extra algorithm implementations to be added afterwards,
+        possibly from third parties.
+    '';
+    license = lib.licenses.mit;
+    platforms = lib.platforms.all;
+    maintainers = [ lib.maintainers.Profpatsch ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/beecrypt/default.nix b/nixpkgs/pkgs/development/libraries/beecrypt/default.nix
new file mode 100644
index 000000000000..6b86fca868f6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/beecrypt/default.nix
@@ -0,0 +1,16 @@
+{lib, stdenv, fetchurl, m4}:
+
+stdenv.mkDerivation {
+  name = "beecrypt-4.2.1";
+  src = fetchurl {
+    url = "mirror://sourceforge/beecrypt/beecrypt-4.2.1.tar.gz";
+    sha256 = "0pf5k1c4nsj77jfq5ip0ra1gzx2q47xaa0s008fnn6hd11b1yvr8";
+  };
+  buildInputs = [ m4 ];
+  configureFlags = [ "--disable-optimized" "--enable-static" ];
+
+  meta = {
+    platforms = lib.platforms.linux;
+    license = lib.licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/beignet/clang_llvm.patch b/nixpkgs/pkgs/development/libraries/beignet/clang_llvm.patch
new file mode 100644
index 000000000000..bcdad510e10d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/beignet/clang_llvm.patch
@@ -0,0 +1,49 @@
+diff --git a/./CMake/FindLLVM.cmake b/../Beignet-1.1.2-Source_new/CMake/FindLLVM.cmake
+index a148321..96cafb8 100644
+--- a/./CMake/FindLLVM.cmake
++++ b/../Beignet-1.1.2-Source_new/CMake/FindLLVM.cmake
+@@ -22,6 +22,7 @@ if (LLVM_CONFIG_EXECUTABLE)
+ else (LLVM_CONFIG_EXECUTABLE)
+   message(FATAL_ERROR "Could NOT find LLVM executable, please add -DLLVM_INSTALL_DIR=/path/to/llvm-config/ in cmake command")
+ endif (LLVM_CONFIG_EXECUTABLE)
++
+ execute_process(
+   COMMAND ${LLVM_CONFIG_EXECUTABLE} --version
+   OUTPUT_VARIABLE LLVM_VERSION
+@@ -44,10 +45,16 @@ if (LLVM_FIND_VERSION_MAJOR AND LLVM_FIND_VERSION_MINOR)
+   endif (LLVM_VERSION_NODOT VERSION_LESS LLVM_FIND_VERSION_NODOT)
+ endif (LLVM_FIND_VERSION_MAJOR AND LLVM_FIND_VERSION_MINOR)
+ 
+-if (LLVM_INSTALL_DIR)
++if (CLANG_INSTALL_DIR)
+   find_program(CLANG_EXECUTABLE
+                NAMES clang-${LLVM_VERSION_NODOT} clang-${LLVM_VERSION_NOPATCH} clang
+-               PATHS ${LLVM_INSTALL_DIR} NO_DEFAULT_PATH)
++               PATHS ${CLANG_INSTALL_DIR} NO_DEFAULT_PATH)
++else (CLANG_INSTALL_DIR)
++  find_program(CLANG_EXECUTABLE
++               NAMES clang-${LLVM_VERSION_NODOT} clang-${LLVM_VERSION_NOPATCH} clang)
++endif (CLANG_INSTALL_DIR)
++
++if (LLVM_INSTALL_DIR)
+   find_program(LLVM_AS_EXECUTABLE
+                NAMES llvm-as-${LLVM_VERSION_NODOT} llvm-as-${LLVM_VERSION_NOPATCH} llvm-as
+                PATHS ${LLVM_INSTALL_DIR} NO_DEFAULT_PATH)
+@@ -55,8 +62,6 @@ if (LLVM_INSTALL_DIR)
+                NAMES llvm-link-${LLVM_VERSION_NODOT} llvm-link-${LLVM_VERSION_NOPATCH} llvm-link
+                PATHS ${LLVM_INSTALL_DIR} NO_DEFAULT_PATH)
+ else (LLVM_INSTALL_DIR)
+-  find_program(CLANG_EXECUTABLE
+-               NAMES clang-${LLVM_VERSION_NODOT} clang-${LLVM_VERSION_NOPATCH} clang)
+   find_program(LLVM_AS_EXECUTABLE
+                NAMES llvm-as-${LLVM_VERSION_NODOT} llvm-as-${LLVM_VERSION_NOPATCH} llvm-as)
+   find_program(LLVM_LINK_EXECUTABLE
+@@ -105,7 +110,7 @@ endif (LLVM_VERSION_NODOT VERSION_GREATER 34)
+ macro(add_one_lib name)
+   FIND_LIBRARY(CLANG_LIB
+     NAMES ${name}
+-    PATHS ${LLVM_LIBRARY_DIR} NO_DEFAULT_PATH)
++    PATHS ${CLANG_LIBRARY_DIR} NO_DEFAULT_PATH)
+   set(CLANG_LIBRARIES ${CLANG_LIBRARIES} ${CLANG_LIB})
+ 	unset(CLANG_LIB CACHE)
+ endmacro()
diff --git a/nixpkgs/pkgs/development/libraries/beignet/default.nix b/nixpkgs/pkgs/development/libraries/beignet/default.nix
new file mode 100644
index 000000000000..3d88c93784a8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/beignet/default.nix
@@ -0,0 +1,112 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+, libclang
+, libllvm
+, libdrm
+, libX11
+, libpthreadstubs
+, libXdmcp
+, libXdamage
+, libXext
+, python3
+, ocl-icd
+, libGL
+, makeWrapper
+, beignet
+}:
+
+stdenv.mkDerivation rec {
+  pname = "beignet";
+  version = "unstable-2018.08.20";
+
+  src = fetchFromGitHub {
+    owner  = "intel";
+    repo   = "beignet";
+    rev    = "fc5f430cb7b7a8f694d86acbb038bd5b38ec389c";
+    sha256 = "1z64v69w7f52jrskh1jfyh1x46mzfhjrqxj9hhgzh3xxv9yla32h";
+  };
+
+  patches = [ ./clang_llvm.patch ];
+
+  postPatch = ''
+    substituteInPlace CMakeLists.txt --replace /etc/OpenCL/vendors "\''${CMAKE_INSTALL_PREFIX}/etc/OpenCL/vendors"
+    patchShebangs src/git_sha1.sh
+  '';
+
+  cmakeFlags = [ "-DCLANG_LIBRARY_DIR=${libclang.lib}/lib" ];
+
+  buildInputs = [
+    libllvm
+    libclang
+    libX11
+    libXext
+    libpthreadstubs
+    libdrm
+    libXdmcp
+    libXdamage
+    ocl-icd
+    libGL
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    python3
+  ];
+
+  passthru.utests = stdenv.mkDerivation {
+    pname = "beignet-utests";
+    inherit version src;
+
+    preConfigure = ''
+      cd utests
+    '';
+
+    nativeBuildInputs = [
+      cmake
+      python3
+      pkg-config
+      makeWrapper
+    ];
+
+    buildInputs = [
+      ocl-icd
+    ];
+
+    installPhase = ''
+      wrapBin() {
+        install -Dm755 "$1" "$out/bin/$(basename "$1")"
+        wrapProgram "$out/bin/$(basename "$1")" \
+          --set OCL_BITCODE_LIB_PATH ${beignet}/lib/beignet/beignet.bc \
+          --set OCL_HEADER_FILE_DIR "${beignet}/lib/beignet/include" \
+          --set OCL_PCH_PATH "${beignet}/lib/beignet/beignet.pch" \
+          --set OCL_GBE_PATH "${beignet}/lib/beignet/libgbe.so" \
+          --set OCL_INTERP_PATH "${beignet}/lib/beignet/libgbeinterp.so" \
+          --set OCL_KERNEL_PATH "$out/lib/beignet/kernels" \
+          --set OCL_IGNORE_SELF_TEST 1
+      }
+
+      install -Dm755 libutests.so $out/lib/libutests.so
+      wrapBin utest_run
+      wrapBin flat_address_space
+      mkdir $out/lib/beignet
+      cp -r ../../kernels $out/lib/beignet
+    '';
+  };
+
+  meta = with lib; {
+    homepage = "https://cgit.freedesktop.org/beignet/";
+    description = "OpenCL Library for Intel Ivy Bridge and newer GPUs";
+    longDescription = ''
+      The package provides an open source implementation of the OpenCL specification for Intel GPUs.
+      It supports the Intel OpenCL runtime library and compiler.
+    '';
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ artuuge zimbatm ];
+    platforms = platforms.linux;
+    # Requires libdrm_intel
+    badPlatforms = [ "aarch64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/belcard/default.nix b/nixpkgs/pkgs/development/libraries/belcard/default.nix
new file mode 100644
index 000000000000..dbc85992ba4e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/belcard/default.nix
@@ -0,0 +1,34 @@
+{ bctoolbox
+, belr
+, cmake
+, fetchFromGitLab
+, lib, stdenv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "belcard";
+  version = "4.5.3";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.linphone.org";
+    owner = "public";
+    group = "BC";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-+7vqTbg1QergWPx2LQ2wkVehOma6Ix02IfwnJTJ/E5I=";
+  };
+
+  buildInputs = [ bctoolbox belr ];
+  nativeBuildInputs = [ cmake ];
+
+  # Do not build static libraries
+  cmakeFlags = [ "-DENABLE_STATIC=NO" ];
+
+  meta = with lib; {
+    description = "C++ library to manipulate VCard standard format";
+    homepage = "https://gitlab.linphone.org/BC/public/belcard";
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/belle-sip/default.nix b/nixpkgs/pkgs/development/libraries/belle-sip/default.nix
new file mode 100644
index 000000000000..4032734416e4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/belle-sip/default.nix
@@ -0,0 +1,47 @@
+{ antlr3_4
+, bctoolbox
+, cmake
+, fetchFromGitLab
+, lib
+, libantlr3c
+, mbedtls
+, stdenv
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "belle-sip";
+  version = "4.5.14";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.linphone.org";
+    owner = "public";
+    group = "BC";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-L6dhgBJrzYgBuMNd2eMZJCqB/GIZjKipfn1SffxBFWw=";
+  };
+
+  nativeBuildInputs = [ antlr3_4 cmake ];
+
+  buildInputs = [ zlib ];
+
+  # Do not build static libraries
+  cmakeFlags = [ "-DENABLE_STATIC=NO" ];
+
+  NIX_CFLAGS_COMPILE = toString [
+    "-Wno-error=deprecated-declarations"
+    "-Wno-error=format-truncation"
+    "-Wno-error=cast-function-type"
+  ];
+
+  propagatedBuildInputs = [ libantlr3c mbedtls bctoolbox ];
+
+  meta = with lib; {
+    homepage = "https://linphone.org/technical-corner/belle-sip";
+    description = "Modern library implementing SIP (RFC 3261) transport, transaction and dialog layers";
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/belr/default.nix b/nixpkgs/pkgs/development/libraries/belr/default.nix
new file mode 100644
index 000000000000..90e27a6a9dc1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/belr/default.nix
@@ -0,0 +1,33 @@
+{ bctoolbox
+, cmake
+, fetchFromGitLab
+, lib, stdenv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "belr";
+  version = "4.5.3";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.linphone.org";
+    owner = "public";
+    group = "BC";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-TTfBOhnyyAvQe+HXfr2GkuDTx07cHLqcsssW0dA7GlQ=";
+  };
+
+  buildInputs = [ bctoolbox ];
+  nativeBuildInputs = [ cmake ];
+
+  # Do not build static libraries
+  cmakeFlags = [ "-DENABLE_STATIC=NO" ];
+
+  meta = with lib; {
+    description = "Belledonne Communications' language recognition library";
+    homepage = "https://gitlab.linphone.org/BC/public/belr";
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/biblesync/default.nix b/nixpkgs/pkgs/development/libraries/biblesync/default.nix
new file mode 100644
index 000000000000..74a938cf2a5c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/biblesync/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, cmake, libuuid }:
+
+stdenv.mkDerivation rec {
+
+  pname = "biblesync";
+  version = "2.1.0";
+
+  src = fetchFromGitHub {
+    owner = "karlkleinpaste";
+    repo = "biblesync";
+    rev = version;
+    sha256 = "0prmd12jq2cjdhsph5v89y38j7hhd51dr3r1hivgkhczr3m5hf4s";
+  };
+
+  nativeBuildInputs = [ pkg-config cmake ];
+  buildInputs = [ libuuid ];
+
+  meta = with lib; {
+    homepage = "https://wiki.crosswire.org/BibleSync";
+    description = "A multicast protocol to Bible software shared conavigation";
+    longDescription = ''
+      BibleSync is a multicast protocol to support Bible software shared
+      co-navigation. It uses LAN multicast in either a personal/small team
+      mutual navigation motif or in a classroom environment where there are
+      Speakers plus the Audience. The library implementing the protocol is a
+      single C++ class providing a complete yet minimal public interface to
+      support mode setting, setup for packet reception, transmit on local
+      navigation, and handling of incoming packets.
+    '';
+    license = licenses.publicDomain;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/bobcat/default.nix b/nixpkgs/pkgs/development/libraries/bobcat/default.nix
new file mode 100644
index 000000000000..d0d0720f20ca
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bobcat/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchFromGitLab, icmake
+, libmilter, libX11, openssl, readline
+, util-linux, yodl }:
+
+stdenv.mkDerivation rec {
+  pname = "bobcat";
+  version = "5.09.01";
+
+  src = fetchFromGitLab {
+    sha256 = "sha256-kaz15mNn/bq1HUknUJqXoLYxPRPX4w340sv9be0M+kQ=";
+    domain = "gitlab.com";
+    rev = version;
+    repo = "bobcat";
+    owner = "fbb-git";
+  };
+
+  buildInputs = [ libmilter libX11 openssl readline util-linux ];
+  nativeBuildInputs = [ icmake yodl ];
+
+  setSourceRoot = ''
+    sourceRoot=$(echo */bobcat)
+  '';
+
+  postPatch = ''
+    substituteInPlace INSTALL.im --replace /usr $out
+    patchShebangs .
+  '';
+
+  buildPhase = ''
+    ./build libraries all
+    ./build man
+  '';
+
+  installPhase = ''
+    ./build install x
+  '';
+
+  meta = with lib; {
+    description = "Brokken's Own Base Classes And Templates";
+    homepage = "https://fbb-git.gitlab.io/bobcat/";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/boca/default.nix b/nixpkgs/pkgs/development/libraries/boca/default.nix
new file mode 100644
index 000000000000..ffbc99f79f7d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boca/default.nix
@@ -0,0 +1,51 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, pkg-config
+
+, expat
+, libcdio
+, libcdio-paranoia
+, libpulseaudio
+, smooth
+, uriparser
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "BoCA";
+  version = "1.0.5";
+
+  src = fetchFromGitHub {
+    owner = "enzo1982";
+    repo = "boca";
+    rev = "v${version}";
+    sha256 = "sha256-ooLPpwTxG7QBAGhEGhta4T06ZDWlPysocHbb/Sq7Wyo=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  buildInputs = [
+    expat
+    libcdio
+    libcdio-paranoia
+    libpulseaudio
+    smooth
+    uriparser
+    zlib
+  ];
+
+  makeFlags = [
+    "prefix=$(out)"
+  ];
+
+  meta = with lib; {
+    description = "A component library used by the fre:ac audio converter";
+    license = licenses.gpl2Plus;
+    homepage = "https://github.com/enzo1982/boca";
+    maintainers = with maintainers; [ shamilton ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix b/nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix
new file mode 100644
index 000000000000..e951bdc34e4e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix
@@ -0,0 +1,71 @@
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, libatomic_ops
+, enableLargeConfig ? false # doc: https://github.com/ivmai/bdwgc/blob/v7.6.6/doc/README.macros#L179
+}:
+
+stdenv.mkDerivation rec {
+  pname = "boehm-gc";
+  version = "7.6.6";
+
+  src = fetchurl {
+    urls = [
+      "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";
+  };
+
+  buildInputs = [ libatomic_ops ];
+  nativeBuildInputs = [ pkg-config ];
+
+  outputs = [ "out" "dev" "doc" ];
+  separateDebugInfo = stdenv.isLinux;
+
+  preConfigure = 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;
+
+  configureFlags =
+    [ "--enable-cplusplus" ]
+    ++ lib.optional enableLargeConfig "--enable-large-config"
+    ++ lib.optional (stdenv.hostPlatform.libc == "musl") "--disable-static";
+
+  doCheck = true; # not cross;
+
+  # Don't run the native `strip' when cross-compiling.
+  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "The Boehm-Demers-Weiser conservative garbage collector for C and C++";
+
+    longDescription = ''
+      The Boehm-Demers-Weiser conservative garbage collector can be used as a
+      garbage collecting replacement for C malloc or C++ new.  It allows you
+      to allocate memory basically as you normally would, without explicitly
+      deallocating memory that is no longer useful.  The collector
+      automatically recycles memory when it determines that it can no longer
+      be otherwise accessed.
+
+      The collector is also used by a number of programming language
+      implementations that either use C as intermediate code, want to
+      facilitate easier interoperation with C libraries, or just prefer the
+      simple collector interface.
+
+      Alternatively, the garbage collector may be used as a leak detector for
+      C or C++ programs, though that is not its primary goal.
+    '';
+
+    homepage = "https://hboehm.info/gc/";
+
+    # non-copyleft, X11-style license
+    license = "https://hboehm.info/gc/license.txt";
+
+    maintainers = [ ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/boehm-gc/default.nix b/nixpkgs/pkgs/development/libraries/boehm-gc/default.nix
new file mode 100644
index 000000000000..85ae01036ed1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boehm-gc/default.nix
@@ -0,0 +1,69 @@
+{ lib, stdenv, fetchurl
+, autoreconfHook
+, enableLargeConfig ? false # doc: https://github.com/ivmai/bdwgc/blob/v7.6.6/doc/README.macros#L179
+}:
+
+stdenv.mkDerivation rec {
+  pname = "boehm-gc";
+  version = "8.0.4";
+
+  src = fetchurl {
+    urls = [
+      "https://github.com/ivmai/bdwgc/releases/download/v${version}/gc-${version}.tar.gz"
+      "https://www.hboehm.info/gc/gc_source/gc-${version}.tar.gz"
+    ];
+    sha256 = "1798rp3mcfkgs38ynkbg2p47bq59pisrc6mn0l20pb5iczf0ssj3";
+  };
+
+  outputs = [ "out" "dev" "doc" ];
+  separateDebugInfo = stdenv.isLinux && stdenv.hostPlatform.libc != "musl";
+
+  preConfigure = 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
+    # boehm-gc whitelists GCC threading models
+    ++ lib.optional stdenv.hostPlatform.isMinGW ./mcfgthread.patch;
+
+  configureFlags =
+    [ "--enable-cplusplus" "--with-libatomic-ops=none" ]
+    ++ lib.optional enableLargeConfig "--enable-large-config";
+
+  nativeBuildInputs =
+    lib.optional stdenv.hostPlatform.isMinGW autoreconfHook;
+
+  doCheck = true; # not cross;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "The Boehm-Demers-Weiser conservative garbage collector for C and C++";
+
+    longDescription = ''
+      The Boehm-Demers-Weiser conservative garbage collector can be used as a
+      garbage collecting replacement for C malloc or C++ new.  It allows you
+      to allocate memory basically as you normally would, without explicitly
+      deallocating memory that is no longer useful.  The collector
+      automatically recycles memory when it determines that it can no longer
+      be otherwise accessed.
+
+      The collector is also used by a number of programming language
+      implementations that either use C as intermediate code, want to
+      facilitate easier interoperation with C libraries, or just prefer the
+      simple collector interface.
+
+      Alternatively, the garbage collector may be used as a leak detector for
+      C or C++ programs, though that is not its primary goal.
+    '';
+
+    homepage = "https://hboehm.info/gc/";
+
+    # non-copyleft, X11-style license
+    license = "https://hboehm.info/gc/license.txt";
+
+    maintainers = [ ];
+    platforms = 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/boehm-gc/riscv.patch b/nixpkgs/pkgs/development/libraries/boehm-gc/riscv.patch
new file mode 100644
index 000000000000..249137d0a0dc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boehm-gc/riscv.patch
@@ -0,0 +1,53 @@
+diff --git a/include/private/gcconfig.h b/include/private/gcconfig.h
+index a8e55dd2..439cc88d 100644
+--- a/include/private/gcconfig.h
++++ b/include/private/gcconfig.h
+@@ -650,6 +650,15 @@
+ #   endif
+ #   define mach_type_known
+ # endif
++# if defined(__riscv) && defined(LINUX)
++#   if __riscv_xlen == 32
++#     define RISCV32
++#     define mach_type_known
++#   elif __riscv_xlen == 64
++#     define RISCV64
++#     define mach_type_known
++#   endif
++# endif
+ 
+ # if defined(SN_TARGET_PSP2)
+ #   define mach_type_known
+@@ -2970,6 +2979,32 @@
+ #   endif
+ # endif
+ 
++# ifdef RISCV32
++#   define CPP_WORDSZ 32
++#   define MACH_TYPE "RISC-V 32"
++#   define ALIGNMENT 4
++#   ifdef LINUX
++#     define OS_TYPE "LINUX"
++      extern int __data_start[];
++#     define DATASTART ((ptr_t)__data_start)
++#     define LINUX_STACKBOTTOM
++#     define DYNAMIC_LOADING
++#   endif
++# endif
++
++# ifdef RISCV64
++#   define CPP_WORDSZ 64
++#   define MACH_TYPE "RISC-V 64"
++#   define ALIGNMENT 8
++#   ifdef LINUX
++#     define OS_TYPE "LINUX"
++      extern int __data_start[];
++#     define DATASTART ((ptr_t)__data_start)
++#     define LINUX_STACKBOTTOM
++#     define DYNAMIC_LOADING
++#   endif
++# endif
++
+ #if defined(__GLIBC__) && !defined(DONT_USE_LIBC_PRIVATES)
+   /* Use glibc's stack-end marker. */
+ # define USE_LIBC_PRIVATES
diff --git a/nixpkgs/pkgs/development/libraries/boolstuff/default.nix b/nixpkgs/pkgs/development/libraries/boolstuff/default.nix
new file mode 100644
index 000000000000..c7520ff783e5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boolstuff/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl, pkg-config }:
+stdenv.mkDerivation rec {
+  pname = "boolstuff";
+  version = "0.1.16";
+
+  src = fetchurl {
+    url = "https://perso.b2b2c.ca/~sarrazip/dev/${pname}-${version}.tar.gz";
+    sha256 = "10qynbyw723gz2vrvn4xk2var172kvhlz3l3l80qbdsfb3d12wn0";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  meta = {
+    description = "Library for operations on boolean expression binary trees";
+    homepage = "http://perso.b2b2c.ca/~sarrazip/dev/boolstuff.html";
+    license = "GPL";
+    maintainers = [ lib.maintainers.marcweber ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/boost-process/default.nix b/nixpkgs/pkgs/development/libraries/boost-process/default.nix
new file mode 100644
index 000000000000..148e27faa2b6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost-process/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, unzip }:
+
+stdenv.mkDerivation {
+  name = "boost-process-0.5";
+
+  src = fetchurl {
+    url = "http://www.highscore.de/boost/process0.5/process.zip";
+    sha256 = "1v9y9pffb2b7p642kp9ic4z6kg42ziizmyvbgrqd1ci0i4gn0831";
+  };
+
+  nativeBuildInputs = [ unzip ];
+
+  unpackPhase = ''
+    mkdir $name
+    cd $name
+    unzip $src
+  '';
+
+  installPhase = ''
+    mkdir -p $out/include
+    cp -r boost $out/include
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.highscore.de/boost/process0.5/";
+    description = "Library to manage system processes";
+    license = licenses.boost;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/boost/1.55.nix b/nixpkgs/pkgs/development/libraries/boost/1.55.nix
new file mode 100644
index 000000000000..bcb452ea4f86
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/1.55.nix
@@ -0,0 +1,12 @@
+{ callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  version = "1.55.0";
+
+  patches = [ ./clang-math.patch ./clang-math-2.patch ./gcc-5.patch ];
+
+  src = fetchurl {
+    url = "mirror://sourceforge/boost/boost_1_55_0.tar.bz2";
+    sha256 = "0lkv5dzssbl5fmh2nkaszi8x9qbj80pr4acf9i26sj3rvlih1w7z";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/boost/1.59.nix b/nixpkgs/pkgs/development/libraries/boost/1.59.nix
new file mode 100644
index 000000000000..0f6e9a35b6e0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/1.59.nix
@@ -0,0 +1,10 @@
+{ callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  version = "1.59.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/boost/boost_1_59_0.tar.bz2";
+    sha256 = "1jj1aai5rdmd72g90a3pd8sw9vi32zad46xv5av8fhnr48ir6ykj";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/boost/1.60.nix b/nixpkgs/pkgs/development/libraries/boost/1.60.nix
new file mode 100644
index 000000000000..4bc7a1cc7327
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/1.60.nix
@@ -0,0 +1,11 @@
+{ callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  version = "1.60.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/boost/boost_1_60_0.tar.bz2";
+    sha256 = "0fzx6dwqbrkd4bcd8pjv0fpapwmrxxwr8yx9g67lihlsk3zzysk8";
+  };
+
+})
diff --git a/nixpkgs/pkgs/development/libraries/boost/1.65.nix b/nixpkgs/pkgs/development/libraries/boost/1.65.nix
new file mode 100644
index 000000000000..764f38d5b747
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/1.65.nix
@@ -0,0 +1,12 @@
+{ callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  version = "1.65.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/boost/boost_1_65_1.tar.bz2";
+    # SHA256 from http://www.boost.org/users/history/version_1_65_1.html
+    sha256 = "9807a5d16566c57fd74fb522764e0b134a8bbe6b6e8967b83afefd30dcd3be81";
+  };
+
+})
diff --git a/nixpkgs/pkgs/development/libraries/boost/1.66.nix b/nixpkgs/pkgs/development/libraries/boost/1.66.nix
new file mode 100644
index 000000000000..af61aa51944c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/1.66.nix
@@ -0,0 +1,11 @@
+{ callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  version = "1.66.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/boost/boost_1_66_0.tar.bz2";
+    # SHA256 from http://www.boost.org/users/history/version_1_66_0.html
+    sha256 = "5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/boost/1.68.nix b/nixpkgs/pkgs/development/libraries/boost/1.68.nix
new file mode 100644
index 000000000000..920dd9a300b1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/1.68.nix
@@ -0,0 +1,11 @@
+{ callPackage, fetchurl, fetchpatch, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  version = "1.68.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/boost/boost_1_68_0.tar.bz2";
+    # SHA256 from http://www.boost.org/users/history/version_1_68_0.html
+    sha256 = "7f6130bc3cf65f56a618888ce9d5ea704fa10b462be126ad053e80e553d6d8b7";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/boost/1.69.nix b/nixpkgs/pkgs/development/libraries/boost/1.69.nix
new file mode 100644
index 000000000000..7292356ecd1c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/1.69.nix
@@ -0,0 +1,11 @@
+{ callPackage, fetchurl, fetchpatch, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  version = "1.69.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/boost/boost_1_69_0.tar.bz2";
+    # SHA256 from http://www.boost.org/users/history/version_1_69_0.html
+    sha256 = "8f32d4617390d1c2d16f26a27ab60d97807b35440d45891fa340fc2648b04406";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/boost/1.70.nix b/nixpkgs/pkgs/development/libraries/boost/1.70.nix
new file mode 100644
index 000000000000..3b898cfc0ae5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/1.70.nix
@@ -0,0 +1,11 @@
+{ callPackage, fetchurl, fetchpatch, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  version = "1.70.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/boost/boost_1_70_0.tar.bz2";
+    # SHA256 from http://www.boost.org/users/history/version_1_70_0.html
+    sha256 = "430ae8354789de4fd19ee52f3b1f739e1fba576f0aded0897c3c2bc00fb38778";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/boost/1.72.nix b/nixpkgs/pkgs/development/libraries/boost/1.72.nix
new file mode 100644
index 000000000000..97dad9b6c8a8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/1.72.nix
@@ -0,0 +1,16 @@
+{ callPackage, fetchurl, fetchpatch, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "1.72.0";
+
+  src = fetchurl {
+    #url = "mirror://sourceforge/boost/boost_1_72_0.tar.bz2";
+    urls = [
+      "mirror://sourceforge/boost/boost_1_72_0.tar.bz2"
+      "https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.bz2"
+    ];
+    # SHA256 from http://www.boost.org/users/history/version_1_72_0.html
+    sha256 = "59c9b274bc451cf91a9ba1dd2c7fdcaf5d60b1b3aa83f2c9fa143417cc660722";
+  };
+})
+
diff --git a/nixpkgs/pkgs/development/libraries/boost/1.73.nix b/nixpkgs/pkgs/development/libraries/boost/1.73.nix
new file mode 100644
index 000000000000..289bea197c35
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/1.73.nix
@@ -0,0 +1,16 @@
+{ callPackage, fetchurl, fetchpatch, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "1.73.0";
+
+  src = fetchurl {
+    #url = "mirror://sourceforge/boost/boost_1_73_0.tar.bz2";
+    urls = [
+      "mirror://sourceforge/boost/boost_1_73_0.tar.bz2"
+      "https://dl.bintray.com/boostorg/release/1.73.0/source/boost_1_73_0.tar.bz2"
+    ];
+    # SHA256 from http://www.boost.org/users/history/version_1_73_0.html
+    sha256 = "4eb3b8d442b426dc35346235c8733b5ae35ba431690e38c6a8263dce9fcbb402";
+  };
+})
+
diff --git a/nixpkgs/pkgs/development/libraries/boost/1.74.nix b/nixpkgs/pkgs/development/libraries/boost/1.74.nix
new file mode 100644
index 000000000000..a181ed94c266
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/1.74.nix
@@ -0,0 +1,15 @@
+{ callPackage, fetchurl, fetchpatch, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "1.74.0";
+
+  src = fetchurl {
+    urls = [
+      "mirror://sourceforge/boost/boost_1_74_0.tar.bz2"
+      "https://dl.bintray.com/boostorg/release/1.74.0/source/boost_1_74_0.tar.bz2"
+    ];
+    # SHA256 from http://www.boost.org/users/history/version_1_74_0.html
+    sha256 = "83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1";
+  };
+})
+
diff --git a/nixpkgs/pkgs/development/libraries/boost/1.75.nix b/nixpkgs/pkgs/development/libraries/boost/1.75.nix
new file mode 100644
index 000000000000..ff1073bd0268
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/1.75.nix
@@ -0,0 +1,15 @@
+{ callPackage, fetchurl, fetchpatch, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "1.75.0";
+
+  src = fetchurl {
+    urls = [
+      "mirror://sourceforge/boost/boost_1_75_0.tar.bz2"
+      "https://dl.bintray.com/boostorg/release/1.75.0/source/boost_1_75_0.tar.bz2"
+    ];
+    # SHA256 from http://www.boost.org/users/history/version_1_75_0.html
+    sha256 = "953db31e016db7bb207f11432bef7df100516eeb746843fa0486a222e3fd49cb";
+  };
+})
+
diff --git a/nixpkgs/pkgs/development/libraries/boost/clang-math-2.patch b/nixpkgs/pkgs/development/libraries/boost/clang-math-2.patch
new file mode 100644
index 000000000000..f819e9bec623
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/clang-math-2.patch
@@ -0,0 +1,45 @@
+From 6bb71fdd8f7cc346d90fb14beb38b7297fc1ffd9 Mon Sep 17 00:00:00 2001
+From: Andrey Semashev <andrey.semashev@gmail.com>
+Date: Sun, 26 Jan 2014 13:58:48 +0400
+Subject: [PATCH] Fixed incorrect initialization of 128-bit values, when no
+ native support for 128-bit integers is available.
+
+---
+ boost/atomic/detail/cas128strong.hpp | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/boost/atomic/detail/cas128strong.hpp b/boost/atomic/detail/cas128strong.hpp
+index 906c13e..dcb4d7d 100644
+--- a/boost/atomic/detail/cas128strong.hpp
++++ b/boost/atomic/detail/cas128strong.hpp
+@@ -196,15 +196,17 @@ class base_atomic<T, void, 16, Sign>
+ 
+ public:
+     BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
+-    explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0)
++    explicit base_atomic(value_type const& v) BOOST_NOEXCEPT
+     {
++        memset(&v_, 0, sizeof(v_));
+         memcpy(&v_, &v, sizeof(value_type));
+     }
+ 
+     void
+     store(value_type const& value, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
+     {
+-        storage_type value_s = 0;
++        storage_type value_s;
++        memset(&value_s, 0, sizeof(value_s));
+         memcpy(&value_s, &value, sizeof(value_type));
+         platform_fence_before_store(order);
+         platform_store128(value_s, &v_);
+@@ -247,7 +249,9 @@ class base_atomic<T, void, 16, Sign>
+         memory_order success_order,
+         memory_order failure_order) volatile BOOST_NOEXCEPT
+     {
+-        storage_type expected_s = 0, desired_s = 0;
++        storage_type expected_s, desired_s;
++        memset(&expected_s, 0, sizeof(expected_s));
++        memset(&desired_s, 0, sizeof(desired_s));
+         memcpy(&expected_s, &expected, sizeof(value_type));
+         memcpy(&desired_s, &desired, sizeof(value_type));
+ 
diff --git a/nixpkgs/pkgs/development/libraries/boost/clang-math.patch b/nixpkgs/pkgs/development/libraries/boost/clang-math.patch
new file mode 100644
index 000000000000..aa3d76af28b2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/clang-math.patch
@@ -0,0 +1,65 @@
+From e4bde20f2eec0a51be14533871d2123bd2ab9cf3 Mon Sep 17 00:00:00 2001
+From: Andrey Semashev <andrey.semashev@gmail.com>
+Date: Fri, 28 Feb 2014 12:43:11 +0400
+Subject: [PATCH] More compilation fixes for the case when 128-bit integers are
+ not supported.
+
+---
+ boost/atomic/detail/gcc-atomic.hpp | 17 ++++++++++++-----
+ 1 file changed, 12 insertions(+), 5 deletions(-)
+
+diff --git a/boost/atomic/detail/gcc-atomic.hpp b/boost/atomic/detail/gcc-atomic.hpp
+index a130590..4af99a1 100644
+--- a/boost/atomic/detail/gcc-atomic.hpp
++++ b/boost/atomic/detail/gcc-atomic.hpp
+@@ -958,14 +958,16 @@ class base_atomic<T, void, 16, Sign>
+ 
+ public:
+     BOOST_DEFAULTED_FUNCTION(base_atomic(void), {})
+-    explicit base_atomic(value_type const& v) BOOST_NOEXCEPT : v_(0)
++    explicit base_atomic(value_type const& v) BOOST_NOEXCEPT
+     {
++        memset(&v_, 0, sizeof(v_));
+         memcpy(&v_, &v, sizeof(value_type));
+     }
+ 
+     void store(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
+     {
+-        storage_type tmp = 0;
++        storage_type tmp;
++        memset(&tmp, 0, sizeof(tmp));
+         memcpy(&tmp, &v, sizeof(value_type));
+         __atomic_store_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order));
+     }
+@@ -980,7 +982,8 @@ class base_atomic<T, void, 16, Sign>
+ 
+     value_type exchange(value_type const& v, memory_order order = memory_order_seq_cst) volatile BOOST_NOEXCEPT
+     {
+-        storage_type tmp = 0;
++        storage_type tmp;
++        memset(&tmp, 0, sizeof(tmp));
+         memcpy(&tmp, &v, sizeof(value_type));
+         tmp = __atomic_exchange_n(&v_, tmp, atomics::detail::convert_memory_order_to_gcc(order));
+         value_type res;
+@@ -994,7 +997,9 @@ class base_atomic<T, void, 16, Sign>
+         memory_order success_order,
+         memory_order failure_order) volatile BOOST_NOEXCEPT
+     {
+-        storage_type expected_s = 0, desired_s = 0;
++        storage_type expected_s, desired_s;
++        memset(&expected_s, 0, sizeof(expected_s));
++        memset(&desired_s, 0, sizeof(desired_s));
+         memcpy(&expected_s, &expected, sizeof(value_type));
+         memcpy(&desired_s, &desired, sizeof(value_type));
+         const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, false,
+@@ -1010,7 +1015,9 @@ class base_atomic<T, void, 16, Sign>
+         memory_order success_order,
+         memory_order failure_order) volatile BOOST_NOEXCEPT
+     {
+-        storage_type expected_s = 0, desired_s = 0;
++        storage_type expected_s, desired_s;
++        memset(&expected_s, 0, sizeof(expected_s));
++        memset(&desired_s, 0, sizeof(desired_s));
+         memcpy(&expected_s, &expected, sizeof(value_type));
+         memcpy(&desired_s, &desired, sizeof(value_type));
+         const bool success = __atomic_compare_exchange_n(&v_, &expected_s, desired_s, true,
diff --git a/nixpkgs/pkgs/development/libraries/boost/cmake-paths-173.patch b/nixpkgs/pkgs/development/libraries/boost/cmake-paths-173.patch
new file mode 100644
index 000000000000..7b88da0e42a9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/cmake-paths-173.patch
@@ -0,0 +1,22 @@
+diff --git a/tools/boost_install/boost-install.jam b/tools/boost_install/boost-install.jam
+index 4238f921e..8fc1ea269 100644
+--- a/tools/boost_install/boost-install.jam
++++ b/tools/boost_install/boost-install.jam
+@@ -649,7 +649,7 @@ rule generate-cmake-config- ( target : sources * : properties * )
+         ""
+         "# Compute the include and library directories relative to this file."
+         ""
+-        "get_filename_component(_BOOST_CMAKEDIR \"${CMAKE_CURRENT_LIST_DIR}/../\" REALPATH)"
++        "get_filename_component(_BOOST_REAL_CMAKEDIR \"${CMAKE_CURRENT_LIST_DIR}/../\" REALPATH)"
+         : true ;
+ 
+     if [ path.is-rooted $(cmakedir) ]
+@@ -668,6 +668,8 @@ rule generate-cmake-config- ( target : sources * : properties * )
+             "  unset(_BOOST_CMAKEDIR_ORIGINAL)"
+             "endif()"
+             ""
++	    "# Assume that the installer actually did know where the libs were to be installed"
++            "get_filename_component(_BOOST_CMAKEDIR \"$(cmakedir-native)\" REALPATH)"
+             : true ;
+     }
+ 
diff --git a/nixpkgs/pkgs/development/libraries/boost/cmake-paths.patch b/nixpkgs/pkgs/development/libraries/boost/cmake-paths.patch
new file mode 100644
index 000000000000..b7f90148f9dc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/cmake-paths.patch
@@ -0,0 +1,21 @@
+diff --git a/tools/boost_install/boost-install.jam b/tools/boost_install/boost-install.jam
+index ad19f7b55..ec6bf57ff 100644
+--- a/tools/boost_install/boost-install.jam
++++ b/tools/boost_install/boost-install.jam
+@@ -587,6 +587,7 @@ rule generate-cmake-config- ( target : sources * : properties * )
+         "# Compute the include and library directories relative to this file."
+         ""
+         "get_filename_component(_BOOST_CMAKEDIR \"${CMAKE_CURRENT_LIST_DIR}/../\" ABSOLUTE)"
++        "get_filename_component(_BOOST_REAL_CMAKEDIR \"${CMAKE_CURRENT_LIST_DIR}/../\" ABSOLUTE)"
+         : true ;
+ 
+     if [ path.is-rooted $(cmakedir) ]
+@@ -607,6 +608,8 @@ rule generate-cmake-config- ( target : sources * : properties * )
+             "  unset(_BOOST_CMAKEDIR_ORIGINAL)"
+             "endif()"
+             ""
++	    "# Assume that the installer actually did know where the libs were to be installed"
++            "get_filename_component(_BOOST_CMAKEDIR \"$(cmakedir-native)\" REALPATH)"
+             : true ;
+     }
+ 
diff --git a/nixpkgs/pkgs/development/libraries/boost/darwin-1.55-no-system-python.patch b/nixpkgs/pkgs/development/libraries/boost/darwin-1.55-no-system-python.patch
new file mode 100644
index 000000000000..f8163f6d2718
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/darwin-1.55-no-system-python.patch
@@ -0,0 +1,45 @@
+diff --git a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam
+index 273b28a..2d2031e 100644
+--- a/tools/build/v2/tools/python.jam
++++ b/tools/build/v2/tools/python.jam
+@@ -428,13 +428,7 @@ local rule windows-installed-pythons ( version ? )
+ 
+ local rule darwin-installed-pythons ( version ? )
+ {
+-    version ?= $(.version-countdown) ;
+-
+-    local prefix
+-      = [ GLOB /System/Library/Frameworks /Library/Frameworks
+-          : Python.framework ] ;
+-
+-    return $(prefix)/Versions/$(version)/bin/python ;
++    return ;
+ }
+ 
+ 
+@@ -890,25 +884,6 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? :
+ 
+     # See if we can find a framework directory on darwin.
+     local framework-directory ;
+-    if $(target-os) = darwin
+-    {
+-        # Search upward for the framework directory.
+-        local framework-directory = $(libraries[-1]) ;
+-        while $(framework-directory:D=) && $(framework-directory:D=) != Python.framework
+-        {
+-            framework-directory = $(framework-directory:D) ;
+-        }
+-
+-        if $(framework-directory:D=) = Python.framework
+-        {
+-            debug-message framework directory is \"$(framework-directory)\" ;
+-        }
+-        else
+-        {
+-            debug-message "no framework directory found; using library path" ;
+-            framework-directory = ;
+-        }
+-    }
+ 
+     local dll-path = $(libraries) ;
+ 
diff --git a/nixpkgs/pkgs/development/libraries/boost/darwin-no-system-python.patch b/nixpkgs/pkgs/development/libraries/boost/darwin-no-system-python.patch
new file mode 100644
index 000000000000..73e0910336a1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/darwin-no-system-python.patch
@@ -0,0 +1,45 @@
+diff --git a/tools/build/src/tools/python.jam b/tools/build/src/tools/python.jam
+index 273b28a..2d2031e 100644
+--- a/tools/build/src/tools/python.jam
++++ b/tools/build/src/tools/python.jam
+@@ -428,13 +428,7 @@ local rule windows-installed-pythons ( version ? )
+ 
+ local rule darwin-installed-pythons ( version ? )
+ {
+-    version ?= $(.version-countdown) ;
+-
+-    local prefix
+-      = [ GLOB /System/Library/Frameworks /Library/Frameworks
+-          : Python.framework ] ;
+-
+-    return $(prefix)/Versions/$(version)/bin/python ;
++    return ;
+ }
+ 
+ 
+@@ -890,25 +884,6 @@ local rule configure ( version ? : cmd-or-prefix ? : includes * : libraries ? :
+ 
+     # See if we can find a framework directory on darwin.
+     local framework-directory ;
+-    if $(target-os) = darwin
+-    {
+-        # Search upward for the framework directory.
+-        local framework-directory = $(libraries[-1]) ;
+-        while $(framework-directory:D=) && $(framework-directory:D=) != Python.framework
+-        {
+-            framework-directory = $(framework-directory:D) ;
+-        }
+-
+-        if $(framework-directory:D=) = Python.framework
+-        {
+-            debug-message framework directory is \"$(framework-directory)\" ;
+-        }
+-        else
+-        {
+-            debug-message "no framework directory found; using library path" ;
+-            framework-directory = ;
+-        }
+-    }
+ 
+     local dll-path = $(libraries) ;
+ 
diff --git a/nixpkgs/pkgs/development/libraries/boost/gcc-5.patch b/nixpkgs/pkgs/development/libraries/boost/gcc-5.patch
new file mode 100644
index 000000000000..2b2713590ca7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/gcc-5.patch
@@ -0,0 +1,64 @@
+https://svn.boost.org/trac/boost/ticket/10125
+
+ boost/thread/pthread/once.hpp        | 6 +++---
+ boost/thread/pthread/once_atomic.hpp | 2 +-
+ boost/thread/win32/once.hpp          | 2 +-
+ 3 files changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/boost/thread/pthread/once.hpp b/boost/thread/pthread/once.hpp
+index ccfb051..0bef038 100644
+--- a/boost/thread/pthread/once.hpp
++++ b/boost/thread/pthread/once.hpp
+@@ -42,7 +42,7 @@ namespace boost
+   }
+ 
+ #ifdef BOOST_THREAD_PROVIDES_ONCE_CXX11
+-#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
++#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+     template<typename Function, class ...ArgTypes>
+     inline void call_once(once_flag& flag, BOOST_THREAD_RV_REF(Function) f, BOOST_THREAD_RV_REF(ArgTypes)... args);
+ #else
+@@ -65,7 +65,7 @@ namespace boost
+   private:
+       volatile thread_detail::uintmax_atomic_t epoch;
+ 
+-#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
++#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+       template<typename Function, class ...ArgTypes>
+       friend void call_once(once_flag& flag, BOOST_THREAD_RV_REF(Function) f, BOOST_THREAD_RV_REF(ArgTypes)... args);
+ #else
+@@ -118,7 +118,7 @@ namespace boost
+     // http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2444.html
+ 
+ 
+-#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
++#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ 
+ 
+   template<typename Function, class ...ArgTypes>
+diff --git a/boost/thread/pthread/once_atomic.hpp b/boost/thread/pthread/once_atomic.hpp
+index 9e2f876..923f07b 100644
+--- a/boost/thread/pthread/once_atomic.hpp
++++ b/boost/thread/pthread/once_atomic.hpp
+@@ -115,7 +115,7 @@ namespace boost
+ #endif
+ 
+ 
+-#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
++#if !defined(BOOST_NO_CXX11_VARIADIC_TEMPLATES) && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ 
+   template<typename Function, class ...ArgTypes>
+   inline void call_once(once_flag& flag, BOOST_THREAD_RV_REF(Function) f, BOOST_THREAD_RV_REF(ArgTypes)... args)
+diff --git a/boost/thread/win32/once.hpp b/boost/thread/win32/once.hpp
+index cafcfd4..9b37b31 100644
+--- a/boost/thread/win32/once.hpp
++++ b/boost/thread/win32/once.hpp
+@@ -227,7 +227,7 @@ namespace boost
+         }
+     }
+ 
+-#ifndef BOOST_NO_CXX11_VARIADIC_TEMPLATES
++#if !defined BOOST_NO_CXX11_VARIADIC_TEMPLATES && !defined(BOOST_NO_CXX11_RVALUE_REFERENCES)
+ //#if defined(BOOST_THREAD_RVALUE_REFERENCES_DONT_MATCH_FUNTION_PTR)
+     inline void call_once(once_flag& flag, void (*f)())
+     {
diff --git a/nixpkgs/pkgs/development/libraries/boost/generic.nix b/nixpkgs/pkgs/development/libraries/boost/generic.nix
new file mode 100644
index 000000000000..1f9bbe5ffcad
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boost/generic.nix
@@ -0,0 +1,209 @@
+{ lib, stdenv, icu, expat, zlib, bzip2, python ? null, fixDarwinDylibNames, libiconv
+, fetchpatch
+, which
+, buildPackages
+, toolset ? /**/ if stdenv.cc.isClang  then "clang"
+            else null
+, enableRelease ? true
+, enableDebug ? false
+, enableSingleThreaded ? false
+, enableMultiThreaded ? true
+, enableShared ? !(with stdenv.hostPlatform; isStatic || libc == "msvcrt") # problems for now
+, enableStatic ? !enableShared
+, enablePython ? false
+, enableNumpy ? false
+, taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic))
+, patches ? []
+, useMpi ? false
+, mpi
+, extraB2Args ? []
+
+# Attributes inherit from specific versions
+, version, src
+, ...
+}:
+
+# We must build at least one type of libraries
+assert enableShared || enableStatic;
+
+# Python isn't supported when cross-compiling
+assert enablePython -> stdenv.hostPlatform == stdenv.buildPlatform;
+assert enableNumpy -> enablePython;
+
+# Boost <1.69 can't be build with clang >8, because pth was removed
+assert with lib; ((toolset == "clang" && !(versionOlder stdenv.cc.version "8.0.0")) -> !(versionOlder version "1.69"));
+
+with lib;
+let
+
+  variant = concatStringsSep ","
+    (optional enableRelease "release" ++
+     optional enableDebug "debug");
+
+  threading = concatStringsSep ","
+    (optional enableSingleThreaded "single" ++
+     optional enableMultiThreaded "multi");
+
+  link = concatStringsSep ","
+    (optional enableShared "shared" ++
+     optional enableStatic "static");
+
+  runtime-link = if enableShared then "shared" else "static";
+
+  # To avoid library name collisions
+  layout = if taggedLayout then "tagged" else "system";
+
+  # Versions of b2 before 1.65 have job limits; specifically:
+  #   - Versions before 1.58 support up to 64 jobs[0]
+  #   - Versions before 1.65 support up to 256 jobs[1]
+  #
+  # [0]: https://github.com/boostorg/build/commit/0ef40cb86728f1cd804830fef89a6d39153ff632
+  # [1]: https://github.com/boostorg/build/commit/316e26ca718afc65d6170029284521392524e4f8
+  jobs =
+    if versionOlder version "1.58" then
+      "$(($NIX_BUILD_CORES<=64 ? $NIX_BUILD_CORES : 64))"
+    else if versionOlder version "1.65" then
+      "$(($NIX_BUILD_CORES<=256 ? $NIX_BUILD_CORES : 256))"
+    else
+      "$NIX_BUILD_CORES";
+
+  b2Args = concatStringsSep " " ([
+    "--includedir=$dev/include"
+    "--libdir=$out/lib"
+    "-j${jobs}"
+    "--layout=${layout}"
+    "variant=${variant}"
+    "threading=${threading}"
+    "link=${link}"
+    "-sEXPAT_INCLUDE=${expat.dev}/include"
+    "-sEXPAT_LIBPATH=${expat.out}/lib"
+
+    # TODO: make this unconditional
+  ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "address-model=${toString stdenv.hostPlatform.parsed.cpu.bits}"
+    "architecture=${toString stdenv.hostPlatform.parsed.cpu.family}"
+    "binary-format=${toString stdenv.hostPlatform.parsed.kernel.execFormat.name}"
+    "target-os=${toString stdenv.hostPlatform.parsed.kernel.name}"
+
+    # adapted from table in boost manual
+    # https://www.boost.org/doc/libs/1_66_0/libs/context/doc/html/context/architectures.html
+    "abi=${if stdenv.hostPlatform.parsed.cpu.family == "arm" then "aapcs"
+           else if stdenv.hostPlatform.isWindows then "ms"
+           else if stdenv.hostPlatform.isMips then "o32"
+           else "sysv"}"
+  ] ++ optional (link != "static") "runtime-link=${runtime-link}"
+    ++ optional (variant == "release") "debug-symbols=off"
+    ++ optional (toolset != null) "toolset=${toolset}"
+    ++ optional (!enablePython) "--without-python"
+    ++ optional (useMpi || stdenv.hostPlatform != stdenv.buildPlatform) "--user-config=user-config.jam"
+    ++ optionals (stdenv.hostPlatform.libc == "msvcrt") [
+    "threadapi=win32"
+  ] ++ extraB2Args
+  );
+
+in
+
+stdenv.mkDerivation {
+  pname = "boost";
+
+  inherit src version;
+
+  patchFlags = [];
+
+  patches = patches
+  ++ optional stdenv.isDarwin (
+    if version == "1.55.0"
+    then ./darwin-1.55-no-system-python.patch
+    else ./darwin-no-system-python.patch)
+  # Fix boost-context segmentation faults on ppc64 due to ABI violation
+  ++ optional (versionAtLeast version "1.61" &&
+               versionOlder version "1.71") (fetchpatch {
+    url = "https://github.com/boostorg/context/commit/2354eca9b776a6739112833f64754108cc0d1dc5.patch";
+    sha256 = "067m4bjpmcanqvg28djax9a10avmdwhlpfx6gn73kbqqq70dnz29";
+    stripLen = 1;
+    extraPrefix = "libs/context/";
+  })
+  ++ optional (and (versionAtLeast version "1.70") (!versionAtLeast version "1.73")) ./cmake-paths.patch
+  ++ optional (versionAtLeast version "1.73") ./cmake-paths-173.patch;
+
+  meta = {
+    homepage = "http://boost.org/";
+    description = "Collection of C++ libraries";
+    license = licenses.boost;
+    platforms = platforms.unix ++ platforms.windows;
+    badPlatforms = optional (versionOlder version "1.59") "aarch64-linux"
+                 ++ optional ((versionOlder version "1.57") || version == "1.58") "x86_64-darwin"
+                 ++ optionals (versionOlder version "1.73") lib.platforms.riscv;
+    maintainers = with maintainers; [ peti ];
+  };
+
+  preConfigure = ''
+    if test -f tools/build/src/tools/clang-darwin.jam ; then
+        substituteInPlace tools/build/src/tools/clang-darwin.jam \
+          --replace '@rpath/$(<[1]:D=)' "$out/lib/\$(<[1]:D=)";
+    fi;
+  '' + optionalString useMpi ''
+    cat << EOF >> user-config.jam
+    using mpi : ${mpi}/bin/mpiCC ;
+    EOF
+  '' + optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+    cat << EOF >> user-config.jam
+    using gcc : cross : ${stdenv.cc.targetPrefix}c++ ;
+    EOF
+    # Build b2 with buildPlatform CC/CXX.
+    sed '2i export CC=$CC_FOR_BUILD; export CXX=$CXX_FOR_BUILD' \
+      -i ./tools/build/src/engine/build.sh
+  '';
+
+  NIX_CFLAGS_LINK = lib.optionalString stdenv.isDarwin
+                      "-headerpad_max_install_names";
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ which ]
+    ++ optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  buildInputs = [ expat zlib bzip2 libiconv ]
+    ++ optional (stdenv.hostPlatform == stdenv.buildPlatform) icu
+    ++ optional enablePython python
+    ++ optional enableNumpy python.pkgs.numpy;
+
+  configureScript = "./bootstrap.sh";
+  configurePlatforms = [];
+  configureFlags = [
+    "--includedir=$(dev)/include"
+    "--libdir=$(out)/lib"
+  ] ++ optional enablePython "--with-python=${python.interpreter}"
+    ++ [ (if stdenv.hostPlatform == stdenv.buildPlatform then "--with-icu=${icu.dev}" else "--without-icu") ]
+    ++ optional (toolset != null) "--with-toolset=${toolset}";
+
+  buildPhase = ''
+    runHook preBuild
+    ./b2 ${b2Args}
+    runHook postBuild
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    # boostbook is needed by some applications
+    mkdir -p $dev/share/boostbook
+    cp -a tools/boostbook/{xsl,dtd} $dev/share/boostbook/
+
+    # Let boost install everything else
+    ./b2 ${b2Args} install
+
+    runHook postInstall
+  '';
+
+  postFixup = ''
+    # Make boost header paths relative so that they are not runtime dependencies
+    cd "$dev" && find include \( -name '*.hpp' -or -name '*.h' -or -name '*.ipp' \) \
+      -exec sed '1s/^\xef\xbb\xbf//;1i#line 1 "{}"' -i '{}' \;
+  '' + optionalString (stdenv.hostPlatform.libc == "msvcrt") ''
+    $RANLIB "$out/lib/"*.a
+  '';
+
+  outputs = [ "out" "dev" ];
+  setOutputFlags = false;
+}
diff --git a/nixpkgs/pkgs/development/libraries/bootil/default.nix b/nixpkgs/pkgs/development/libraries/bootil/default.nix
new file mode 100644
index 000000000000..a2045e381436
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bootil/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, premake4
+}:
+
+stdenv.mkDerivation {
+  pname = "bootil";
+  version = "unstable-2019-11-18";
+
+  src = fetchFromGitHub {
+    owner = "garrynewman";
+    repo = "bootil";
+    rev = "beb4cec8ad29533965491b767b177dc549e62d23";
+    sha256 = "1njdj6nvmwf7j2fwqbyvd1cf5l52797vk2wnsliylqdzqcjmfpij";
+  };
+
+  # Avoid guessing where files end up. Just use current directory.
+  postPatch = ''
+    substituteInPlace projects/premake4.lua \
+      --replace 'location ( os.get() .. "/" .. _ACTION )' 'location ( ".." )'
+    substituteInPlace projects/bootil.lua \
+      --replace 'targetdir ( "../lib/" .. os.get() .. "/" .. _ACTION )' 'targetdir ( ".." )'
+  '';
+
+  nativeBuildInputs = [ premake4 ];
+
+  premakefile = "projects/premake4.lua";
+
+  installPhase = ''
+    install -D libbootil_static.a $out/lib/libbootil_static.a
+    cp -r include $out
+  '';
+
+  meta = with lib; {
+    description = "Garry Newman's personal utility library";
+    homepage = "https://github.com/garrynewman/bootil";
+    # License unsure - see https://github.com/garrynewman/bootil/issues/21
+    license = licenses.free;
+    maintainers = with maintainers; [ abigailbuccaneer ];
+    # Build uses `-msse` and `-mfpmath=sse`
+    badPlatforms = [ "aarch64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/boringssl/default.nix b/nixpkgs/pkgs/development/libraries/boringssl/default.nix
new file mode 100644
index 000000000000..32a4859a1bc9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boringssl/default.nix
@@ -0,0 +1,58 @@
+{ lib
+, stdenv
+, fetchgit
+, cmake
+, ninja
+, perl
+, buildGoModule
+}:
+
+# reference: https://boringssl.googlesource.com/boringssl/+/2661/BUILDING.md
+buildGoModule {
+  pname = "boringssl";
+  version = "2021-07-09";
+
+  src = fetchgit {
+    url    = "https://boringssl.googlesource.com/boringssl";
+    rev    = "268a4a6ff3bd656ae65fe41ef1185daa85cfae21";
+    sha256 = "04fja4fdwhc69clmvg8i12zm6ks3sfl3r8i5bxn4x63b9dj5znlx";
+  };
+
+  nativeBuildInputs = [ cmake ninja perl ];
+
+  vendorSha256 = "0sjjj9z1dhilhpc8pq4154czrb79z9cm044jvn75kxcjv6v5l2m5";
+
+  # hack to get both go and cmake configure phase
+  # (if we use postConfigure then cmake will loop runHook postConfigure)
+  preBuild = ''
+    cmakeConfigurePhase
+  '';
+
+  buildPhase = ''
+    ninjaBuildPhase
+  '';
+
+  # CMAKE_OSX_ARCHITECTURES is set to x86_64 by Nix, but it confuses boringssl on aarch64-linux.
+  cmakeFlags = [ "-GNinja" ] ++ lib.optionals (stdenv.isLinux) [ "-DCMAKE_OSX_ARCHITECTURES=" ];
+
+  installPhase = ''
+    mkdir -p $bin/bin $out/include $out/lib
+
+    mv tool/bssl $bin/bin
+
+    mv ssl/libssl.a           $out/lib
+    mv crypto/libcrypto.a     $out/lib
+    mv decrepit/libdecrepit.a $out/lib
+
+    mv ../include/openssl $out/include
+  '';
+
+  outputs = [ "out" "bin" ];
+
+  meta = with lib; {
+    description = "Free TLS/SSL implementation";
+    homepage    = "https://boringssl.googlesource.com";
+    maintainers = [ maintainers.thoughtpolice ];
+    license = with licenses; [ openssl isc mit bsd3 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/botan/2.0.nix b/nixpkgs/pkgs/development/libraries/botan/2.0.nix
new file mode 100644
index 000000000000..a486ba498205
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/botan/2.0.nix
@@ -0,0 +1,10 @@
+{ callPackage, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  baseVersion = "2.18";
+  revision = "0";
+  sha256 = "09z3fy31q1pvnvpy4fswrsl2aq8ksl94lbh5rl7b6nqc3qp8ar6c";
+  postPatch = ''
+    sed -e 's@lang_flags "@&--std=c++11 @' -i src/build-data/cc/{gcc,clang}.txt
+  '';
+})
diff --git a/nixpkgs/pkgs/development/libraries/botan/2.0.upstream b/nixpkgs/pkgs/development/libraries/botan/2.0.upstream
new file mode 100644
index 000000000000..74eb1a2ca83f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/botan/2.0.upstream
@@ -0,0 +1,10 @@
+url https://botan.randombit.net/
+version_link 'Botan-[0-9]+([.][0-9]+)*[.](tgz|tbz|tbz2|tar[.]bz2)$'
+ensure_version
+attribute_name botan2
+do_overwrite(){
+  ensure_hash
+  set_var_value sha256 $CURRENT_HASH
+  set_var_value baseVersion ${CURRENT_VERSION%.*}
+  set_var_value revision ${CURRENT_VERSION##*.}
+}
diff --git a/nixpkgs/pkgs/development/libraries/botan/default.nix b/nixpkgs/pkgs/development/libraries/botan/default.nix
new file mode 100644
index 000000000000..c494fa25f771
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/botan/default.nix
@@ -0,0 +1,16 @@
+{ callPackage, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  baseVersion = "1.10";
+  revision = "17";
+  sha256 = "04rnha712dd3sdb2q7k2yw45sf405jyigk7yrjfr6bwd9fvgyiv8";
+  sourceExtension = "tgz";
+  extraConfigureFlags = "--with-gnump";
+  postPatch = ''
+    sed -e 's@lang_flags "@&--std=c++11 @' -i src/build-data/cc/{gcc,clang}.txt
+  '';
+  knownVulnerabilities = [
+    # https://botan.randombit.net/security.html#id1
+    "2020-03-24: Side channel during CBC padding"
+  ];
+})
diff --git a/nixpkgs/pkgs/development/libraries/botan/default.upstream b/nixpkgs/pkgs/development/libraries/botan/default.upstream
new file mode 100644
index 000000000000..43f6a3b268ee
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/botan/default.upstream
@@ -0,0 +1,9 @@
+url http://botan.randombit.net/download.html
+version_link 'Botan-[0-9]+[.][0-9]*[02468]([.][0-9]+)?[.](tgz|tbz|tbz2|tar[.]bz2)$'
+ensure_version
+do_overwrite(){
+  ensure_hash
+  set_var_value sha256 $CURRENT_HASH
+  set_var_value baseVersion ${CURRENT_VERSION%.*}
+  set_var_value revision ${CURRENT_VERSION##*.}
+}
diff --git a/nixpkgs/pkgs/development/libraries/botan/generic.nix b/nixpkgs/pkgs/development/libraries/botan/generic.nix
new file mode 100644
index 000000000000..3313b8c4fcd1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/botan/generic.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv, fetchurl, python3, bzip2, zlib, gmp, openssl, boost
+# Passed by version specific builders
+, baseVersion, revision, sha256
+, sourceExtension ? "tar.xz"
+, extraConfigureFlags ? ""
+, postPatch ? null
+, knownVulnerabilities ? [ ]
+, CoreServices
+, Security
+, ...
+}:
+
+stdenv.mkDerivation rec {
+  pname = "botan";
+  version = "${baseVersion}.${revision}";
+
+  src = fetchurl {
+    name = "Botan-${version}.${sourceExtension}";
+    urls = [
+       "http://files.randombit.net/botan/v${baseVersion}/Botan-${version}.${sourceExtension}"
+       "http://botan.randombit.net/releases/Botan-${version}.${sourceExtension}"
+    ];
+    inherit sha256;
+  };
+  inherit postPatch;
+
+  buildInputs = [ python3 bzip2 zlib gmp openssl boost ]
+    ++ lib.optionals stdenv.isDarwin [ CoreServices Security ];
+
+  configurePhase = ''
+    python configure.py --prefix=$out --with-bzip2 --with-zlib ${if openssl != null then "--with-openssl" else ""} ${extraConfigureFlags}${if stdenv.cc.isClang then " --cc=clang" else "" }
+  '';
+
+  enableParallelBuilding = true;
+
+  preInstall = ''
+    if [ -d src/scripts ]; then
+      patchShebangs src/scripts
+    fi
+  '';
+
+  postInstall = ''
+    cd "$out"/lib/pkgconfig
+    ln -s botan-*.pc botan.pc || true
+  '';
+
+  meta = with lib; {
+    description = "Cryptographic algorithms library";
+    maintainers = with maintainers; [ raskin ];
+    platforms = platforms.unix;
+    license = licenses.bsd2;
+    inherit knownVulnerabilities;
+  };
+  passthru.updateInfo.downloadPage = "http://files.randombit.net/botan/";
+}
diff --git a/nixpkgs/pkgs/development/libraries/box2d/default.nix b/nixpkgs/pkgs/development/libraries/box2d/default.nix
new file mode 100644
index 000000000000..64349b1e3cf3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/box2d/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, unzip, cmake, libGLU, libGL, freeglut, libX11, xorgproto
+, libXi, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "box2d";
+  version = "2.3.1";
+
+  src = fetchurl {
+    url = "https://github.com/erincatto/box2d/archive/v${version}.tar.gz";
+    sha256 = "0p03ngsmyz0r5kbpiaq10ns4fxwkjvvawi8k6pfall46b93wizsq";
+  };
+
+  sourceRoot = "box2d-${version}/Box2D";
+
+  nativeBuildInputs = [ cmake unzip pkg-config ];
+  buildInputs = [ libGLU libGL freeglut libX11 xorgproto libXi ];
+
+  cmakeFlags = [
+    "-DBOX2D_INSTALL=ON"
+    "-DBOX2D_BUILD_SHARED=ON"
+    "-DBOX2D_BUILD_EXAMPLES=OFF"
+  ];
+
+  prePatch = ''
+    substituteInPlace Box2D/Common/b2Settings.h \
+      --replace 'b2_maxPolygonVertices	8' 'b2_maxPolygonVertices	15'
+  '';
+
+  meta = with lib; {
+    description = "2D physics engine";
+    homepage = "https://box2d.org/";
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.unix;
+    license = licenses.zlib;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/boxfort/default.nix b/nixpkgs/pkgs/development/libraries/boxfort/default.nix
new file mode 100644
index 000000000000..740e43216984
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/boxfort/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, meson, ninja, python37Packages }:
+
+stdenv.mkDerivation rec {
+  version = "unstable-2019-10-09";
+  pname = "boxfort";
+
+  src = fetchFromGitHub {
+    owner = "Snaipe";
+    repo = "BoxFort";
+    rev = "356f047db08b7344ea7980576b705e65b9fc8772";
+    sha256 = "1p0llz7n0p5gzpvqszmra9p88vnr0j88sp5ixhgbfz89bswg62ss";
+  };
+
+  nativeBuildInputs = [ meson ninja ];
+
+  preConfigure = ''
+    patchShebangs ci/isdir.py
+  '';
+
+  checkInputs = with python37Packages; [ cram ];
+
+  doCheck = true;
+
+  outputs = [ "dev" "out" ];
+
+  meta = with 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/brigand/default.nix b/nixpkgs/pkgs/development/libraries/brigand/default.nix
new file mode 100644
index 000000000000..3c0778de1d30
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/brigand/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation {
+  pname = "brigand";
+  version = "1.3.0";
+
+  src = fetchFromGitHub {
+    owner = "edouarda";
+    repo = "brigand";
+    rev = "4db9f665b4ece31b51aaf35b499b2c8e5811efa3";
+    sha256 = "14b8r3s24zq0l3addy3irzxs5cyqn3763y5s310lmzzswgj1v7r4";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Instant compile time C++ 11 metaprogramming library";
+    longDescription = ''
+      Brigand is a light-weight, fully functional, instant-compile time C++ 11 meta-programming library.
+      Everything you were doing with Boost.MPL can be done with Brigand. And if that's not the case, open an issue!'';
+    homepage = "https://github.com/edouarda/brigand";
+    license = licenses.boost;
+    maintainers = with maintainers; [ pmiddend ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/buddy/default.nix b/nixpkgs/pkgs/development/libraries/buddy/default.nix
new file mode 100644
index 000000000000..d6ab4fe0dfe5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/buddy/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, bison }:
+
+stdenv.mkDerivation rec {
+  pname = "buddy";
+  version = "2.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/buddy/${pname}-${version}.tar.gz";
+    sha256 = "0dl86l9xkl33wnkz684xa9axhcxx2zzi4q5lii0axnb9lsk81pyk";
+  };
+
+  buildInputs = [ bison ];
+  patches = [ ./gcc-4.3.3-fixes.patch ];
+  configureFlags = [ "CFLAGS=-O3" "CXXFLAGS=-O3" ];
+  NIX_LDFLAGS = "-lm";
+  doCheck = true;
+
+  meta = {
+    homepage = "https://sourceforge.net/projects/buddy/";
+    description = "Binary decision diagram package";
+    license = "as-is";
+
+    platforms = lib.platforms.unix; # Once had cygwin problems
+    maintainers = [ lib.maintainers.peti ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/buddy/gcc-4.3.3-fixes.patch b/nixpkgs/pkgs/development/libraries/buddy/gcc-4.3.3-fixes.patch
new file mode 100644
index 000000000000..2e7efd1c4666
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/buddy/gcc-4.3.3-fixes.patch
@@ -0,0 +1,22 @@
+diff -uwr buddy-2.4.orig/examples/bddcalc/parser.yxx buddy-2.4/examples/bddcalc/parser.yxx
+--- buddy-2.4.orig/examples/bddcalc/parser.yxx	2009-07-02 17:12:48.000000000 +0200
++++ buddy-2.4/examples/bddcalc/parser.yxx	2009-07-02 17:18:36.000000000 +0200
+@@ -7,6 +7,7 @@
+
+ %{
+ #include <string>
++#include <cstdlib>
+ #include <stdarg.h>
+ #include <fstream>
+ #include <getopt.h>
+diff -uwr buddy-2.4.orig/src/bddtest.cxx buddy-2.4/src/bddtest.cxx
+--- buddy-2.4.orig/src/bddtest.cxx	2009-07-02 17:12:48.000000000 +0200
++++ buddy-2.4/src/bddtest.cxx	2009-07-02 17:14:05.000000000 +0200
+@@ -28,6 +28,7 @@
+ ========================================================================*/
+
+ #include <string>
++#include <cstdlib>
+ #include "bdd.h"
+ #include "bvec.h"
+
diff --git a/nixpkgs/pkgs/development/libraries/bullet/default.nix b/nixpkgs/pkgs/development/libraries/bullet/default.nix
new file mode 100644
index 000000000000..50bf56bfbd22
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bullet/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv, fetchFromGitHub, cmake, libGLU, libGL, freeglut
+, Cocoa,  OpenGL
+}:
+
+stdenv.mkDerivation rec {
+  pname = "bullet";
+  version = "2.87";
+
+  src = fetchFromGitHub {
+    owner = "bulletphysics";
+    repo = "bullet3";
+    rev = version;
+    sha256 = "1msp7w3563vb43w70myjmqsdb97kna54dcfa7yvi9l3bvamb92w3";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = lib.optionals stdenv.isLinux [ libGLU libGL freeglut ]
+    ++ lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
+
+  patches = [ ./gwen-narrowing.patch ];
+
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    sed -i 's/FIND_PACKAGE(OpenGL)//' CMakeLists.txt
+    sed -i 's/FIND_LIBRARY(COCOA_LIBRARY Cocoa)//' CMakeLists.txt
+  '';
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DBUILD_CPU_DEMOS=OFF"
+    "-DINSTALL_EXTRA_LIBS=ON"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "-DOPENGL_FOUND=true"
+    "-DOPENGL_LIBRARIES=${OpenGL}/Library/Frameworks/OpenGL.framework"
+    "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks/OpenGL.framework"
+    "-DOPENGL_gl_LIBRARY=${OpenGL}/Library/Frameworks/OpenGL.framework"
+    "-DCOCOA_LIBRARY=${Cocoa}/Library/Frameworks/Cocoa.framework"
+    "-DBUILD_BULLET2_DEMOS=OFF"
+    "-DBUILD_UNIT_TESTS=OFF"
+  ];
+
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang
+    "-Wno-error=argument-outside-range -Wno-error=c++11-narrowing";
+
+  meta = with lib; {
+    description = "A professional free 3D Game Multiphysics Library";
+    longDescription = ''
+      Bullet 3D Game Multiphysics Library provides state of the art collision
+      detection, soft body and rigid body dynamics.
+    '';
+    homepage = "http://bulletphysics.org";
+    license = licenses.zlib;
+    maintainers = with maintainers; [ aforemny ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/bullet/gwen-narrowing.patch b/nixpkgs/pkgs/development/libraries/bullet/gwen-narrowing.patch
new file mode 100644
index 000000000000..c6c06325dae0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bullet/gwen-narrowing.patch
@@ -0,0 +1,22 @@
+commit a5d3497577c78b03c05c69d17df972fa9fb54f53
+Author: Linus Heckemann <git@sphalerite.org>
+Date:   Fri Jan 5 23:57:09 2018 +0100
+
+    Add -Wno-narrowing to GWEN's CMakeLists
+    
+    This avoids the compilation issue that occurs on aarch64 with gcc6.
+    (nixpkgs-specific patch)
+
+diff --git a/examples/ThirdPartyLibs/Gwen/CMakeLists.txt b/examples/ThirdPartyLibs/Gwen/CMakeLists.txt
+index 82fa0ffba..26c4bbd37 100644
+--- a/examples/ThirdPartyLibs/Gwen/CMakeLists.txt
++++ b/examples/ThirdPartyLibs/Gwen/CMakeLists.txt
+@@ -15,7 +15,7 @@ IF(NOT WIN32 AND NOT APPLE)
+         ADD_DEFINITIONS("-DDYNAMIC_LOAD_X11_FUNCTIONS=1")
+ ENDIF()
+ 
+-ADD_DEFINITIONS( -DGLEW_STATIC -DGWEN_COMPILE_STATIC -D_HAS_EXCEPTIONS=0 -D_STATIC_CPPLIB )
++ADD_DEFINITIONS( -DGLEW_STATIC -DGWEN_COMPILE_STATIC -D_HAS_EXCEPTIONS=0 -D_STATIC_CPPLIB -Wno-narrowing )
+ 
+ FILE(GLOB gwen_SRCS "*.cpp" "Controls/*.cpp" "Controls/Dialog/*.cpp" "Controls/Dialogs/*.cpp" "Controls/Layout/*.cpp" "Controls/Property/*.cpp" "Input/*.cpp" "Platforms/*.cpp" "Renderers/*.cpp" "Skins/*.cpp")
+ FILE(GLOB gwen_HDRS "*.h" "Controls/*.h" "Controls/Dialog/*.h" "Controls/Dialogs/*.h" "Controls/Layout/*.h" "Controls/Property/*.h" "Input/*.h" "Platforms/*.h" "Renderers/*.h" "Skins/*.h")
diff --git a/nixpkgs/pkgs/development/libraries/bullet/roboschool-fork.nix b/nixpkgs/pkgs/development/libraries/bullet/roboschool-fork.nix
new file mode 100644
index 000000000000..a3966eaa4a39
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bullet/roboschool-fork.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv, fetchFromGitHub, cmake, libGLU, libGL, freeglut
+, Cocoa,  OpenGL
+}:
+
+stdenv.mkDerivation {
+  pname = "bullet";
+  version = "2019-03-27";
+
+  src = fetchFromGitHub {
+    owner = "olegklimov";
+    repo = "bullet3";
+    # roboschool needs the HEAD of a specific branch of this fork, see
+    # https://github.com/openai/roboschool/issues/126#issuecomment-421643980
+    # https://github.com/openai/roboschool/pull/62
+    # https://github.com/openai/roboschool/issues/124
+    rev = "3687507ddc04a15de2c5db1e349ada3f2b34b3d6";
+    sha256 = "1wd7vj9136dl7lfb8ll0rc2fdl723y3ls9ipp7657yfl2xrqhvkb";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = lib.optionals stdenv.isLinux [ libGLU libGL freeglut ]
+    ++ lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
+
+  patches = [ ./gwen-narrowing.patch ];
+
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    sed -i 's/FIND_PACKAGE(OpenGL)//' CMakeLists.txt
+    sed -i 's/FIND_LIBRARY(COCOA_LIBRARY Cocoa)//' CMakeLists.txt
+  '';
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DBUILD_CPU_DEMOS=OFF"
+    "-DINSTALL_EXTRA_LIBS=ON"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "-DOPENGL_FOUND=true"
+    "-DOPENGL_LIBRARIES=${OpenGL}/Library/Frameworks/OpenGL.framework"
+    "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks/OpenGL.framework"
+    "-DOPENGL_gl_LIBRARY=${OpenGL}/Library/Frameworks/OpenGL.framework"
+    "-DCOCOA_LIBRARY=${Cocoa}/Library/Frameworks/Cocoa.framework"
+    "-DBUILD_BULLET2_DEMOS=OFF"
+    "-DBUILD_UNIT_TESTS=OFF"
+  ];
+
+  meta = with lib; {
+    description = "A professional free 3D Game Multiphysics Library";
+    longDescription = ''
+      Bullet 3D Game Multiphysics Library provides state of the art collision
+      detection, soft body and rigid body dynamics.
+    '';
+    homepage = "http://bulletphysics.org";
+    license = licenses.zlib;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/bulletml/default.nix b/nixpkgs/pkgs/development/libraries/bulletml/default.nix
new file mode 100644
index 000000000000..3da05302ac9f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bulletml/default.nix
@@ -0,0 +1,74 @@
+{ lib, stdenv, fetchpatch, fetchurl, bison, perl }:
+
+let
+  version = "0.0.6";
+  debianRevision = "7";
+  debianPatch = patchname: hash: fetchpatch {
+    name = "${patchname}.patch";
+    url = "https://sources.debian.org/data/main/b/bulletml/${version}-${debianRevision}/debian/patches/${patchname}.patch";
+    sha256 = hash;
+  };
+
+in stdenv.mkDerivation {
+  pname = "bulletml";
+  inherit version;
+
+  srcs = [
+    (fetchurl {
+      url = "http://shinh.skr.jp/libbulletml/libbulletml-${version}.tar.bz2";
+      sha256 = "0yda0zgj2ydgkmby5676f5iiawabxadzh5p7bmy42998sp9g6dvw";
+    })
+    (fetchurl {
+      url = "http://shinh.skr.jp/d/d_cpp.tar.bz2";
+      sha256 = "1ly9qmbb8q9nyadmdap1gmxs3vkniqgchlv2hw7riansz4gg1agh";
+    })
+  ];
+  sourceRoot = "bulletml";
+  postUnpack = "mv d_cpp bulletml/";
+
+  patches = [
+    (debianPatch "fixes" "0cnr968n0h50fjmjijx7idsa2pg2pv5cwy6nvfbkx9z8w2zf0mkl")
+    (debianPatch "bulletml_d" "03d1dgln3gkiw019pxn3gwgjkmvzisq8kp3n6fpn38yfwh4fp4hv")
+    (debianPatch "d_cpp" "04g9c7c89w7cgrxw75mcbdhzxqmz1716li49mhl98znakchrlb9h")
+    (debianPatch "warnings" "18px79x4drvm6dy6w6js53nzlyvha7qaxhz5a99b97pyk3qc7i9g")
+    (debianPatch "makefile" "0z6yxanxmarx0s08gh12pk2wfqjk8g797wmfcqczdv1i6xc7nqzp")
+    (debianPatch "includes" "1n11j5695hs9pspslf748w2cq5d78s6bwhyl476wp6gcq6jw20bw")
+  ];
+
+  makeFlags = [
+    "-C src"
+  ];
+  nativeBuildInputs = [ bison perl ];
+  hardeningDisable = [ "format" ];
+
+  installPhase = ''
+    install -D -m 644 src/bulletml.d "$out"/include/d/bulletml.d
+    install -d "$out"/include/bulletml/tinyxml
+    install -m 644 src/*.h "$out"/include/bulletml
+    install -m 644 src/tinyxml/tinyxml.h "$out"/include/bulletml/tinyxml
+    cp -r src/boost $out/include/boost
+
+    install -d "$out"/lib
+    install -m 644 src/libbulletml.{a,so}* "$out"/lib
+
+    install -D -m 644 README "$out"/share/doc/libbulletml/README.jp
+    install -m 644 README.en "$out"/share/doc/libbulletml
+    install -m 644 README.bulletml "$out"/share/doc/libbulletml
+    install -D -m 644 README "$out"/share/licenses/libbulletml/README.jp
+    install -m 644 README.en "$out"/share/licenses/libbulletml
+  '';
+
+  meta = with lib; {
+    description = "C++ library to handle BulletML easily";
+    longDescription = ''
+      BulletML is the Bullet Markup Language. BulletML can describe the barrage
+      of bullets in shooting games.
+    '';
+    homepage = "http://www.asahi-net.or.jp/~cs8k-cyu/bulletml/index_e.html";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ fgaz ];
+    # See https://github.com/NixOS/nixpkgs/pull/35482
+    # for some attempts in getting it to build on darwin
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/bwidget/default.nix b/nixpkgs/pkgs/development/libraries/bwidget/default.nix
new file mode 100644
index 000000000000..34f0e8b5b495
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bwidget/default.nix
@@ -0,0 +1,27 @@
+{ lib, fetchurl, tcl, tk }:
+
+tcl.mkTclDerivation rec {
+  pname = "bwidget";
+  version = "1.9.14";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/tcllib/bwidget-${version}.tar.gz";
+    sha256 = "0wm6hk3rnqhnn2cyw24drqwbfnysp6jyfi8lc1vih5k704a955lf";
+  };
+
+  dontBuild = true;
+  propagatedBuildInputs = [ tk ];
+
+  installPhase = ''
+    mkdir -p "$out/lib/bwidget${version}"
+    cp -R *.tcl lang images "$out/lib/bwidget${version}"
+  '';
+
+  meta = {
+    homepage = "https://sourceforge.net/projects/tcllib";
+    description = "High-level widget set for Tcl/Tk";
+    maintainers = with lib.maintainers; [ agbrooks ];
+    license = lib.licenses.tcltk;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/bzrtp/default.nix b/nixpkgs/pkgs/development/libraries/bzrtp/default.nix
new file mode 100644
index 000000000000..6ee48a0a042a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bzrtp/default.nix
@@ -0,0 +1,36 @@
+{ bctoolbox
+, cmake
+, fetchFromGitLab
+, sqlite
+, lib, stdenv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "bzrtp";
+  version = "5.0.0";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.linphone.org";
+    owner = "public";
+    group = "BC";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-cagRN0DQw1/efCuMWngcF04SE9bViHANaNsQNKB5txA=";
+  };
+
+  buildInputs = [ bctoolbox sqlite ];
+  nativeBuildInputs = [ cmake ];
+
+  # Do not build static libraries
+  cmakeFlags = [ "-DENABLE_STATIC=NO" ];
+
+  NIX_CFLAGS_COMPILE = "-Wno-error=cast-function-type";
+
+  meta = with lib; {
+    description = "An opensource implementation of ZRTP keys exchange protocol";
+    homepage = "https://gitlab.linphone.org/BC/public/bzrtp";
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/c-ares/default.nix b/nixpkgs/pkgs/development/libraries/c-ares/default.nix
new file mode 100644
index 000000000000..20bcf80d9e59
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/c-ares/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchurl, writeTextDir }:
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+let self =
+stdenv.mkDerivation rec {
+  pname = "c-ares";
+  version = "1.17.1";
+
+  src = fetchurl {
+    url = "https://c-ares.haxx.se/download/${pname}-${version}.tar.gz";
+    sha256 = "0h7wjfnk2092glqcp9mqaax7xx0s13m501z1gi0gsjl2vvvd0gfp";
+  };
+
+  meta = with lib; {
+    description = "A C library for asynchronous DNS requests";
+    homepage = "https://c-ares.haxx.se";
+    license = licenses.mit;
+    platforms = platforms.all;
+  };
+
+  # Adapted from running a cmake build
+  passthru.cmake-config = writeTextDir "c-ares-config.cmake"
+    ''
+      set(c-ares_INCLUDE_DIR "${self}/include")
+
+      set(c-ares_LIBRARY c-ares::cares)
+
+      add_library(c-ares::cares SHARED IMPORTED)
+
+      set_target_properties(c-ares::cares PROPERTIES
+        INTERFACE_INCLUDE_DIRECTORIES "${self}/include"
+        ${lib.optionalString stdenv.isLinux ''INTERFACE_LINK_LIBRARIES "nsl;rt"''}
+      )
+      set_property(TARGET c-ares::cares APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE)
+      set_target_properties(c-ares::cares PROPERTIES
+        IMPORTED_LOCATION_RELEASE "${self}/lib/libcares${stdenv.targetPlatform.extensions.sharedLibrary}"
+        IMPORTED_SONAME_RELEASE "libcares${stdenv.targetPlatform.extensions.sharedLibrary}"
+        )
+      add_library(c-ares::cares_shared INTERFACE IMPORTED)
+      set_target_properties(c-ares::cares_shared PROPERTIES INTERFACE_LINK_LIBRARIES "c-ares::cares")
+      set(c-ares_SHARED_LIBRARY c-ares::cares_shared)
+    '';
+
+}; in self
diff --git a/nixpkgs/pkgs/development/libraries/c-blosc/default.nix b/nixpkgs/pkgs/development/libraries/c-blosc/default.nix
new file mode 100644
index 000000000000..a7420e300ed4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/c-blosc/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "c-blosc";
+  version = "1.20.1";
+
+  src = fetchFromGitHub {
+    owner = "Blosc";
+    repo = "c-blosc";
+    rev = "v${version}";
+    sha256 = "0a3yrig78plzjbazfqcfrzqhnw17xd0dcayvp4z4kp415kgs2a3s";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "A blocking, shuffling and loss-less compression library";
+    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
new file mode 100644
index 000000000000..045595a84fde
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/caf/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, cmake, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "actor-framework";
+  version = "0.18.5";
+
+  src = fetchFromGitHub {
+    owner = "actor-framework";
+    repo = "actor-framework";
+    rev = version;
+    sha256 = "04b4kjisb5wzq6pilh8xzbxn7qcjgppl8k65hfv0zi0ja8fyp1xk";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ openssl ];
+
+  cmakeFlags = [
+    "-DCAF_ENABLE_EXAMPLES:BOOL=OFF"
+  ];
+
+  doCheck = true;
+  checkTarget = "test";
+  preCheck = ''
+    export LD_LIBRARY_PATH=$PWD/libcaf_core:$PWD/libcaf_io
+    export DYLD_LIBRARY_PATH=$PWD/libcaf_core:$PWD/libcaf_io
+  '';
+
+  meta = with lib; {
+    description = "An open source implementation of the actor model in C++";
+    homepage = "http://actor-framework.org/";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    changelog = "https://github.com/actor-framework/actor-framework/raw/${version}/CHANGELOG.md";
+    maintainers = with maintainers; [ bobakker tobim ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cairo/0001-test-don-t-always-build-FreeType-dependent-test.patch b/nixpkgs/pkgs/development/libraries/cairo/0001-test-don-t-always-build-FreeType-dependent-test.patch
new file mode 100644
index 000000000000..9688aca55ab9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cairo/0001-test-don-t-always-build-FreeType-dependent-test.patch
@@ -0,0 +1,34 @@
+From 3910b1155f2d5a98142ade67e09f097cb94a2d2e Mon Sep 17 00:00:00 2001
+From: Alyssa Ross <hi@alyssa.is>
+Date: Mon, 22 Apr 2019 09:53:54 +0000
+Subject: [PATCH 1/5] test: don't always build FreeType-dependent test
+
+This caused a build failure when attempting to build cairo without
+FreeType available on the system.
+---
+ test/Makefile.sources | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/test/Makefile.sources b/test/Makefile.sources
+index c47131faf..cc3d81f7e 100644
+--- a/test/Makefile.sources
++++ b/test/Makefile.sources
+@@ -144,7 +144,6 @@ test_sources = \
+ 	font-face-get-type.c				\
+ 	font-matrix-translation.c			\
+ 	font-options.c					\
+-	font-variations.c				\
+ 	glyph-cache-pressure.c				\
+ 	get-and-set.c					\
+ 	get-clip.c					\
+@@ -399,6 +398,7 @@ pthread_test_sources =					\
+ 
+ ft_font_test_sources = \
+ 	bitmap-font.c \
++	font-variations.c \
+ 	ft-font-create-for-ft-face.c \
+ 	ft-show-glyphs-positioning.c \
+ 	ft-show-glyphs-table.c \
+-- 
+2.19.2
+
diff --git a/nixpkgs/pkgs/development/libraries/cairo/0002-gl-don-t-implicitly-include-X11-headers.patch b/nixpkgs/pkgs/development/libraries/cairo/0002-gl-don-t-implicitly-include-X11-headers.patch
new file mode 100644
index 000000000000..c34e93ae676a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cairo/0002-gl-don-t-implicitly-include-X11-headers.patch
@@ -0,0 +1,40 @@
+From ec6ee0e09e2d59455241081af66fb3ba02def7e4 Mon Sep 17 00:00:00 2001
+From: Alyssa Ross <hi@alyssa.is>
+Date: Mon, 22 Apr 2019 10:41:27 +0000
+Subject: [PATCH 2/5] gl: don't implicitly include X11 headers
+
+EGL/egl.h on my system includes X11 headers by default, which breaks
+compilation when they aren't available, even though Cairo doesn't need
+them.
+
+Fortunately, this only happens if MESA_EGL_NO_X11_HEADERS is not
+defined, so defining that allows Cairo to be built with GL enabled even
+when X11 isn't available.
+
+Only when the Xlib surface is enabled are the headers guaranteed to be
+available. In that case, MESA_EGL_NO_X11_HEADERS should not be defined,
+to preserve compatibility with users expecting Cairo to include these
+headers. (There are tests that make this assumption.)
+---
+ src/cairo-gl.h | 5 +++++
+ 1 file changed, 5 insertions(+)
+
+diff --git a/src/cairo-gl.h b/src/cairo-gl.h
+index 7cd869c76..a95b07bc3 100644
+--- a/src/cairo-gl.h
++++ b/src/cairo-gl.h
+@@ -127,6 +127,11 @@ cairo_gl_surface_create_for_dc (cairo_device_t		*device,
+ #endif
+ 
+ #if CAIRO_HAS_EGL_FUNCTIONS
++
++#if !CAIRO_HAS_XLIB_SURFACE && !defined(MESA_EGL_NO_X11_HEADERS)
++#define MESA_EGL_NO_X11_HEADERS
++#endif
++
+ #include <EGL/egl.h>
+ 
+ cairo_public cairo_device_t *
+-- 
+2.19.2
+
diff --git a/nixpkgs/pkgs/development/libraries/cairo/0003-test-only-build-GL-tests-when-Xlib-is-enabled.patch b/nixpkgs/pkgs/development/libraries/cairo/0003-test-only-build-GL-tests-when-Xlib-is-enabled.patch
new file mode 100644
index 000000000000..09d7fd88627d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cairo/0003-test-only-build-GL-tests-when-Xlib-is-enabled.patch
@@ -0,0 +1,41 @@
+From 84593a7e01b9afa74ec0bddd9515b666d476efba Mon Sep 17 00:00:00 2001
+From: Alyssa Ross <hi@alyssa.is>
+Date: Mon, 22 Apr 2019 11:29:48 +0000
+Subject: [PATCH 3/5] test: only build GL tests when Xlib is enabled
+
+The GL tests all depend on Xlib functions, so they should only be
+enabled when Xlib is enabled, because otherwise the required functions
+might not be present.
+---
+ test/Makefile.am | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/test/Makefile.am b/test/Makefile.am
+index e3c42ea88..9f77622bc 100644
+--- a/test/Makefile.am
++++ b/test/Makefile.am
+@@ -16,10 +16,6 @@ test_sources += $(ft_font_test_sources)
+ endif
+ endif
+ 
+-if CAIRO_HAS_GL_SURFACE
+-test_sources += $(gl_surface_test_sources)
+-endif
+-
+ if CAIRO_HAS_EGL_FUNCTIONS
+ test_sources += $(egl_surface_test_sources)
+ endif
+@@ -51,6 +47,10 @@ endif
+ 
+ if CAIRO_HAS_XLIB_SURFACE
+ test_sources += $(xlib_surface_test_sources)
++
++if CAIRO_HAS_GL_SURFACE
++test_sources += $(gl_surface_test_sources)
++endif
+ endif
+ 
+ if CAIRO_HAS_XLIB_XRENDER_SURFACE
+-- 
+2.19.2
+
diff --git a/nixpkgs/pkgs/development/libraries/cairo/0004-util-don-t-build-cairo-sphinx-unless-PNG-enabled.patch b/nixpkgs/pkgs/development/libraries/cairo/0004-util-don-t-build-cairo-sphinx-unless-PNG-enabled.patch
new file mode 100644
index 000000000000..702c4d49e484
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cairo/0004-util-don-t-build-cairo-sphinx-unless-PNG-enabled.patch
@@ -0,0 +1,32 @@
+From 8b7816ea38a1869e7de94341e3ea9e1eebb8eb4f Mon Sep 17 00:00:00 2001
+From: Alyssa Ross <hi@alyssa.is>
+Date: Mon, 22 Apr 2019 13:08:30 +0000
+Subject: [PATCH 4/5] util: don't build cairo-sphinx unless PNG enabled
+
+cairo-sphinx won't build without libpng, because
+cairo_surface_write_to_png won't be defined.
+---
+ util/Makefile.am | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/util/Makefile.am b/util/Makefile.am
+index 82d0a804c..119b59f48 100644
+--- a/util/Makefile.am
++++ b/util/Makefile.am
+@@ -25,11 +25,13 @@ if BUILD_SPHINX
+ if CAIRO_HAS_DLSYM
+ if CAIRO_HAS_SCRIPT_SURFACE
+ if CAIRO_HAS_TEE_SURFACE
++if CAIRO_HAS_PNG_FUNCTIONS
+ SUBDIRS += cairo-sphinx
+ endif
+ endif
+ endif
+ endif
++endif
+ 
+ AM_CPPFLAGS = -I$(top_srcdir)/src \
+ 	      -I$(top_builddir)/src \
+-- 
+2.19.2
+
diff --git a/nixpkgs/pkgs/development/libraries/cairo/default.nix b/nixpkgs/pkgs/development/libraries/cairo/default.nix
new file mode 100644
index 000000000000..905098faead9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cairo/default.nix
@@ -0,0 +1,164 @@
+{ config, lib, stdenv, fetchurl, fetchpatch, pkg-config, autoreconfHook, gtk-doc
+, pixman
+, zlibSupport ? true, zlib
+, pngSupport ? true, libpng
+, freetypeSupport ? true, freetype
+, fontconfigSupport ? freetypeSupport, fontconfig
+, gobjectSupport ? true, glib
+, x11Support ? !stdenv.isDarwin, libX11, libXext
+, x11XrenderSupport ? x11Support, libXrender
+, xcbSupport ? !stdenv.isDarwin, libxcb # no longer experimental since 1.12
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
+, glSupport ? x11Support && config.cairo.gl or (libGLSupported && stdenv.isLinux)
+, libGL ? null # libGLU libGL is no longer a big dependency
+, darwin
+}:
+
+assert fontconfigSupport -> freetypeSupport;
+assert x11XrenderSupport -> x11Support;
+assert glSupport -> x11Support && libGL != null;
+
+let
+  version = "1.16.0";
+  inherit (lib) enableFeature optional optionals;
+in stdenv.mkDerivation rec {
+  pname = "cairo";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://cairographics.org/${if lib.mod (builtins.fromJSON (lib.versions.minor version)) 2 == 0 then "releases" else "snapshots"}/${pname}-${version}.tar.xz";
+    sha256 = "0c930mk5xr2bshbdljv005j3j8zr47gqmkry3q6qgvqky6rjjysy";
+  };
+
+  patches = [
+    # Fixes CVE-2018-19876; see Nixpkgs issue #55384
+    # CVE information: https://nvd.nist.gov/vuln/detail/CVE-2018-19876
+    # Upstream PR: https://gitlab.freedesktop.org/cairo/cairo/merge_requests/5
+    #
+    # This patch is the merged commit from the above PR.
+    (fetchpatch {
+      name   = "CVE-2018-19876.patch";
+      url    = "https://gitlab.freedesktop.org/cairo/cairo/commit/6edf572ebb27b00d3c371ba5ae267e39d27d5b6d.patch";
+      sha256 = "112hgrrsmcwxh1r52brhi5lksq4pvrz4xhkzcf2iqp55jl2pb7n1";
+    })
+
+    # Fix PDF output.
+    # https://gitlab.freedesktop.org/cairo/cairo/issues/342
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/cairo/cairo/commit/5e34c5a9640e49dcc29e6b954c4187cfc838dbd1.patch";
+      sha256 = "yCwsDUY7efVvOZkA6a0bPS+RrVc8Yk9bfPwWHeOjq5o=";
+    })
+
+    ./0001-test-don-t-always-build-FreeType-dependent-test.patch
+    ./0002-gl-don-t-implicitly-include-X11-headers.patch
+    ./0003-test-only-build-GL-tests-when-Xlib-is-enabled.patch
+    ./0004-util-don-t-build-cairo-sphinx-unless-PNG-enabled.patch
+
+    # Fixes CVE-2020-35492; see https://github.com/NixOS/nixpkgs/issues/120364.
+    # CVE information: https://nvd.nist.gov/vuln/detail/CVE-2020-35492
+    # Upstream PR: https://gitlab.freedesktop.org/cairo/cairo/merge_requests/85
+    (fetchpatch {
+      name = "CVE-2020-35492.patch";
+      includes = [ "src/cairo-image-compositor.c" ];
+      url = "https://github.com/freedesktop/cairo/commit/78266cc8c0f7a595cfe8f3b694bfb9bcc3700b38.patch";
+      sha256 = "048nzfz7rkgqb9xs0dfs56qdw7ckkxr87nbj3p0qziqdq4nb6wki";
+    })
+  ] ++ optionals stdenv.hostPlatform.isDarwin [
+    # Workaround https://gitlab.freedesktop.org/cairo/cairo/-/issues/121
+    ./skip-configure-stderr-check.patch
+  ];
+
+  outputs = [ "out" "dev" "devdoc" ];
+  outputBin = "dev"; # very small
+
+  nativeBuildInputs = [
+    autoreconfHook
+    gtk-doc
+    pkg-config
+  ];
+
+  buildInputs = optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+    CoreGraphics
+    CoreText
+    ApplicationServices
+    Carbon
+  ]);
+
+  propagatedBuildInputs =
+    [ pixman ]
+    ++ optional zlibSupport zlib
+    ++ optional pngSupport libpng
+    ++ optionals x11Support [ libX11 libXext ]
+    ++ optional x11XrenderSupport libXrender
+    ++ optional xcbSupport libxcb
+    ++ optional freetypeSupport freetype
+    ++ optional fontconfigSupport fontconfig
+    ++ optional gobjectSupport glib
+    ++ optional glSupport libGL
+    ; # TODO: maybe liblzo but what would it be for here?
+
+  configureFlags = [
+    "--enable-tee"
+  ] ++ (if stdenv.isDarwin then [
+    "--disable-dependency-tracking"
+    "--enable-quartz"
+    "--enable-quartz-font"
+    "--enable-quartz-image"
+    "--enable-ft"
+  ] else [
+    (enableFeature zlibSupport "script")
+    (enableFeature zlibSupport "ps")
+    (enableFeature zlibSupport "pdf")
+    (enableFeature zlibSupport "interpreter")
+    (enableFeature pngSupport "png")
+    (enableFeature pngSupport "svg")
+    (enableFeature glSupport "gl")
+    (enableFeature x11Support "xlib")
+  ]);
+
+  preConfigure =
+  # On FreeBSD, `-ldl' doesn't exist.
+    lib.optionalString stdenv.isFreeBSD
+       '' for i in "util/"*"/Makefile.in" boilerplate/Makefile.in
+          do
+            cat "$i" | sed -es/-ldl//g > t
+            mv t "$i"
+          done
+       ''
+    +
+    ''
+    # Work around broken `Requires.private' that prevents Freetype
+    # `-I' flags to be propagated.
+    sed -i "src/cairo.pc.in" \
+        -es'|^Cflags:\(.*\)$|Cflags: \1 -I${freetype.dev}/include/freetype2 -I${freetype.dev}/include|g'
+    substituteInPlace configure --replace strings $STRINGS
+    '';
+
+  enableParallelBuilding = true;
+
+  doCheck = false; # fails
+
+  postInstall = lib.optionalString stdenv.isDarwin glib.flattenInclude;
+
+  meta = with lib; {
+    description = "A 2D graphics library with support for multiple output devices";
+
+    longDescription = ''
+      Cairo is a 2D graphics library with support for multiple output
+      devices.  Currently supported output targets include the X
+      Window System, Quartz, Win32, image buffers, PostScript, PDF,
+      and SVG file output.  Experimental backends include OpenGL
+      (through glitz), XCB, BeOS, OS/2, and DirectFB.
+
+      Cairo is designed to produce consistent output on all output
+      media while taking advantage of display hardware acceleration
+      when available (e.g., through the X Render Extension).
+    '';
+
+    homepage = "http://cairographics.org/";
+
+    license = with licenses; [ lgpl2Plus mpl10 ];
+
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cairo/skip-configure-stderr-check.patch b/nixpkgs/pkgs/development/libraries/cairo/skip-configure-stderr-check.patch
new file mode 100644
index 000000000000..6deecf2a9717
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cairo/skip-configure-stderr-check.patch
@@ -0,0 +1,89 @@
+https://bugs.freedesktop.org/show_bug.cgi?id=30910#c6
+
+Comment 6 Jeremy Huddleston Sequoia 2014-07-15 04:12:40 UTC
+
+Yes, it is still an issue.  We just disable the buggy '"x$cairo_cc_stderr" != "x"' logic, but that's not really a portable solution for you:
+
+diff -Naurp cairo-1.12.2.orig/configure cairo-1.12.2/configure
+--- cairo-1.12.2.orig/configure	2012-04-29 11:49:59.000000000 -0700
++++ cairo-1.12.2/configure	2012-05-03 11:23:49.000000000 -0700
+@@ -18044,7 +18044,7 @@ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+ 
+-	if test "x$cairo_cc_stderr" != "x"; then
++	if false; then
+ 		cairo_cc_flag=no
+ 	fi
+ 
+@@ -18091,7 +18091,7 @@ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+ 
+-	if test "x$cairo_cc_stderr" != "x"; then
++	if false; then
+ 		cairo_cc_flag=no
+ 	fi
+ 
+@@ -18161,7 +18161,7 @@ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+ 
+-	if test "x$cairo_cc_stderr" != "x"; then
++	if false; then
+ 		cairo_cc_flag=no
+ 	fi
+ 
+@@ -18217,7 +18217,7 @@ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+ 
+-	if test "x$cairo_cc_stderr" != "x"; then
++	if false; then
+ 		cairo_cc_flag=no
+ 	fi
+ 
+@@ -19663,7 +19663,7 @@ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+ 
+-	if test "x$cairo_cc_stderr" != "x"; then
++	if false; then
+ 		cairo_cc_flag=no
+ 	fi
+ 
+@@ -19710,7 +19710,7 @@ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+ 
+-	if test "x$cairo_cc_stderr" != "x"; then
++	if false; then
+ 		cairo_cc_flag=no
+ 	fi
+ 
+@@ -32692,7 +32692,7 @@ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+ 
+-	if test "x$cairo_cc_stderr" != "x"; then
++	if false; then
+ 		cairo_cc_flag=no
+ 	fi
+ 
+@@ -32811,7 +32811,7 @@ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+ 
+-	if test "x$cairo_cc_stderr" != "x"; then
++	if false ; then
+ 		cairo_cc_flag=no
+ 	fi
+ 
+@@ -32892,7 +32892,7 @@ fi
+ rm -f core conftest.err conftest.$ac_objext \
+     conftest$ac_exeext conftest.$ac_ext
+ 
+-	if test "x$cairo_cc_stderr" != "x"; then
++	if false; then
+ 		cairo_cc_flag=no
+ 	fi
diff --git a/nixpkgs/pkgs/development/libraries/cairomm/1.16.nix b/nixpkgs/pkgs/development/libraries/cairomm/1.16.nix
new file mode 100644
index 000000000000..df9b8572ad0f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cairomm/1.16.nix
@@ -0,0 +1,74 @@
+{ stdenv
+, lib
+, fetchurl
+, boost
+, meson
+, ninja
+, pkg-config
+, cairo
+, fontconfig
+, libsigcxx30
+, ApplicationServices
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cairomm";
+  version = "1.16.1";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "https://www.cairographics.org/releases/${pname}-${version}.tar.xz";
+    sha256 = "sha256-b2Bg2OmN1Lis/uIpX92904z0h8B8JqrY0ag7ub/0osY=";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+  ];
+
+  buildInputs = [
+    boost # for tests
+    fontconfig
+  ] ++ lib.optionals stdenv.isDarwin [
+    ApplicationServices
+  ];
+
+  propagatedBuildInputs = [
+    cairo
+    libsigcxx30
+  ];
+
+  mesonFlags = [
+    "-Dbuild-tests=true"
+    "-Dboost-shared=true"
+  ];
+
+  # Meson is no longer able to pick up Boost automatically.
+  # https://github.com/NixOS/nixpkgs/issues/86131
+  BOOST_INCLUDEDIR = "${lib.getDev boost}/include";
+  BOOST_LIBRARYDIR = "${lib.getLib boost}/lib";
+
+  # Tests fail on Darwin, possibly because of sandboxing.
+  doCheck = !stdenv.isDarwin;
+
+  meta = with lib; {
+    description = "A 2D graphics library with support for multiple output devices";
+    longDescription = ''
+      Cairo is a 2D graphics library with support for multiple output
+      devices.  Currently supported output targets include the X
+      Window System, Quartz, Win32, image buffers, PostScript, PDF,
+      and SVG file output.  Experimental backends include OpenGL
+      (through glitz), XCB, BeOS, OS/2, and DirectFB.
+
+      Cairo is designed to produce consistent output on all output
+      media while taking advantage of display hardware acceleration
+      when available (e.g., through the X Render Extension).
+    '';
+    homepage = "https://www.cairographics.org/";
+    license = with licenses; [ lgpl2Plus mpl10 ];
+    maintainers = teams.gnome.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cairomm/default.nix b/nixpkgs/pkgs/development/libraries/cairomm/default.nix
new file mode 100644
index 000000000000..87b391d2ad0e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cairomm/default.nix
@@ -0,0 +1,44 @@
+{ fetchurl, lib, stdenv, pkg-config, darwin, cairo, fontconfig, freetype, libsigcxx }:
+stdenv.mkDerivation rec {
+  pname = "cairomm";
+  version = "1.12.2";
+
+  src = fetchurl {
+    url = "https://www.cairographics.org/releases/${pname}-${version}.tar.gz";
+    # gnome doesn't have the latest version ATM; beware: same name but different hash
+    #url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "16fmigxsaz85c3lgcls7biwyz8zy8c8h3jndfm54cxxas3a7zi25";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ pkg-config ];
+  propagatedBuildInputs = [ cairo libsigcxx ];
+  buildInputs = [ fontconfig freetype ]
+  ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+    ApplicationServices
+  ]);
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A 2D graphics library with support for multiple output devices";
+
+    longDescription = ''
+      Cairo is a 2D graphics library with support for multiple output
+      devices.  Currently supported output targets include the X
+      Window System, Quartz, Win32, image buffers, PostScript, PDF,
+      and SVG file output.  Experimental backends include OpenGL
+      (through glitz), XCB, BeOS, OS/2, and DirectFB.
+
+      Cairo is designed to produce consistent output on all output
+      media while taking advantage of display hardware acceleration
+      when available (e.g., through the X Render Extension).
+    '';
+
+    homepage = "https://www.cairographics.org/";
+
+    license = with licenses; [ lgpl2Plus mpl10 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/capnproto/default.nix b/nixpkgs/pkgs/development/libraries/capnproto/default.nix
new file mode 100644
index 000000000000..a27a54b1eacb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/capnproto/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "capnproto";
+  version = "0.9.0";
+
+  src = fetchurl {
+    url = "https://capnproto.org/capnproto-c++-${version}.tar.gz";
+    sha256 = "sha256-soBUp6K/6kK/w5LI0AljDZTXLozoaiOtbxi15yV0Bk8=";
+  };
+
+  meta = with lib; {
+    homepage    = "http://kentonv.github.io/capnproto";
+    description = "Cap'n Proto cerealization protocol";
+    longDescription = ''
+      Cap’n Proto is an insanely fast data interchange format and
+      capability-based RPC system. Think JSON, except binary. Or think Protocol
+      Buffers, except faster.
+    '';
+    license     = licenses.bsd2;
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ cstrahan ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/capstone/default.nix b/nixpkgs/pkgs/development/libraries/capstone/default.nix
new file mode 100644
index 000000000000..cce14951c8be
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/capstone/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchurl, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "capstone";
+  version = "4.0.2";
+
+  src = fetchurl {
+    url    = "https://github.com/aquynh/capstone/archive/${version}.tar.gz";
+    sha256 = "0sjjbqps48az4map0kmai7j7dak3gy0xcq0sgx8fg09g0acdg0bw";
+  };
+
+  # replace faulty macos detection
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    sed -i 's/^IS_APPLE := .*$/IS_APPLE := 1/' Makefile
+  '';
+
+  configurePhase = "patchShebangs make.sh ";
+  buildPhase = "PREFIX=$out ./make.sh";
+
+  doCheck = true;
+  checkPhase = ''
+    # first remove fuzzing steps from check target
+    substituteInPlace Makefile --replace "fuzztest fuzzallcorp" ""
+    make check
+  '';
+
+  installPhase = (lib.optionalString stdenv.isDarwin "HOMEBREW_CAPSTONE=1 ")
+    + "PREFIX=$out ./make.sh install";
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Advanced disassembly library";
+    homepage    = "http://www.capstone-engine.org";
+    license     = lib.licenses.bsd3;
+    platforms   = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ thoughtpolice ris ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/catch/default.nix b/nixpkgs/pkgs/development/libraries/catch/default.nix
new file mode 100644
index 000000000000..c89fbd477c96
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/catch/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "catch";
+  version = "1.12.2";
+
+  src = fetchFromGitHub {
+    owner = "catchorg";
+    repo = "Catch";
+    rev = "v${version}";
+    sha256 = "1gdp5wm8khn02g2miz381llw3191k7309qj8s3jd6sasj01rhf23";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  cmakeFlags = [ "-DUSE_CPP14=ON" ];
+
+  patches = [
+    # https://github.com/catchorg/Catch2/pull/2151
+    (fetchpatch {
+      url = "https://github.com/catchorg/Catch2/commit/bb6d08323f23a39eb65dd86671e68f4f5d3f2d6c.patch";
+      sha256 = "1vhbzx84nrhhf9zlbl6h5zmg3r5w5v833ihlswsysb9wp2i4isc5";
+    })
+  ];
+
+  doCheck = true;
+  checkTarget = "test";
+
+  meta = with lib; {
+    description = "A multi-paradigm automated test framework for C++ and Objective-C (and, maybe, C)";
+    homepage = "http://catch-lib.net";
+    license = licenses.boost;
+    maintainers = with maintainers; [ edwtjo knedlsepp ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/catch2/default.nix b/nixpkgs/pkgs/development/libraries/catch2/default.nix
new file mode 100644
index 000000000000..5adcc2d1dd9e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/catch2/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "catch2";
+  version = "2.13.7";
+
+  src = fetchFromGitHub {
+    owner = "catchorg";
+    repo = "Catch2";
+    rev = "v${version}";
+    sha256="sha256-NhZ8Hh7dka7KggEKKZyEbIZahuuTYeCT7cYYSUvkPzI=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [ "-H.." ];
+
+  meta = with lib; {
+    description = "A multi-paradigm automated test framework for C++ and Objective-C (and, maybe, C)";
+    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/default.nix b/nixpkgs/pkgs/development/libraries/ccrtp/default.nix
new file mode 100644
index 000000000000..39792d4fd6a1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ccrtp/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, pkg-config, ucommon, openssl, libgcrypt }:
+
+stdenv.mkDerivation rec {
+  name = "ccrtp-2.1.2";
+
+  src = fetchurl {
+    url = "mirror://gnu/ccrtp/${name}.tar.gz";
+    sha256 = "17ili8l7zqbbkzr1rcy4hlnazkf50mds41wg6n7bfdsx3c7cldgh";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  propagatedBuildInputs = [ ucommon openssl libgcrypt ];
+
+  configureFlags = [
+    "--disable-demos"
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "An implementation of the IETF real-time transport protocol (RTP)";
+    homepage = "https://www.gnu.org/software/ccrtp/";
+    license = lib.licenses.gpl2;
+    maintainers = with lib.maintainers; [ marcweber ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cctz/default.nix b/nixpkgs/pkgs/development/libraries/cctz/default.nix
new file mode 100644
index 000000000000..aff977edd912
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cctz/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, darwin }:
+
+stdenv.mkDerivation rec {
+  pname = "cctz";
+  version = "2.3";
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "cctz";
+    rev = "v${version}";
+    sha256 = "0254xfwscfkjc3fbvx6qgifr3pwkc2rb03z8pbvvqy098di9alhr";
+  };
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  buildInputs = lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Foundation;
+
+  installTargets = [ "install_hdrs" "install_shared_lib" ];
+
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    install_name_tool -id $out/lib/libcctz.so $out/lib/libcctz.so
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/google/cctz";
+    description = "C++ library for translating between absolute and civil times";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ orivej ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cddlib/default.nix b/nixpkgs/pkgs/development/libraries/cddlib/default.nix
new file mode 100644
index 000000000000..e0d6149362cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cddlib/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv
+, fetchFromGitHub
+, gmp
+, autoreconfHook
+, texlive
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cddlib";
+  version = "0.94m";
+  src = fetchFromGitHub {
+    owner = "cddlib";
+    repo = "cddlib";
+    rev = version;
+    sha256 = "09s8323h5w9j6mpl1yc6lm770dkskfxd2ayyafkcjllmnncxzfa0";
+  };
+  buildInputs = [gmp];
+  nativeBuildInputs = [
+    autoreconfHook
+    texlive.combined.scheme-small # for building the documentation
+  ];
+  # No actual checks yet (2018-05-05), but maybe one day.
+  # Requested here: https://github.com/cddlib/cddlib/issues/25
+  doCheck = true;
+  meta = with lib; {
+    description = "An implementation of the Double Description Method for generating all vertices of a convex polyhedron";
+    license = licenses.gpl2Plus;
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+    homepage = "https://www.inf.ethz.ch/personal/fukudak/cdd_home/index.html";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cdk/default.nix b/nixpkgs/pkgs/development/libraries/cdk/default.nix
new file mode 100644
index 000000000000..1a4f617cf469
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cdk/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, ncurses }:
+
+stdenv.mkDerivation rec {
+  pname = "cdk";
+  version ="5.0-20210109";
+
+  buildInputs = [
+    ncurses
+  ];
+
+  src = fetchurl {
+    urls = [
+      "ftp://ftp.invisible-island.net/cdk/cdk-${version}.tgz"
+      "https://invisible-mirror.net/archives/cdk/cdk-${version}.tgz"
+    ];
+    sha256 = "sha256-xBbJh793tPGycD18XkM7qUWMi+Uma/RUy/gBrYfnKTY=";
+  };
+
+  meta = with lib; {
+    description = "Curses development kit";
+    license = licenses.bsdOriginal ;
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cdo/default.nix b/nixpkgs/pkgs/development/libraries/cdo/default.nix
new file mode 100644
index 000000000000..a038b5885c2b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cdo/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl, curl, hdf5, netcdf
+, # build, install and link to a CDI library [default=no]
+  enable_cdi_lib ? false
+, # build a completely statically linked CDO binary
+  enable_all_static ? stdenv.hostPlatform.isStatic
+, # Use CXX as default compiler [default=no]
+  enable_cxx ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cdo";
+  version = "1.9.7.1";
+
+  # Dependencies
+  buildInputs = [ curl netcdf hdf5 ];
+
+  src = fetchurl {
+    url = "https://code.mpimet.mpg.de/attachments/download/20124/${pname}-${version}.tar.gz";
+    sha256 = "0b4n8dwxfsdbz4jflsx0b75hwapdf1rp14p48dfr7ksv0qp9aw9p";
+  };
+
+ # Configure phase
+ configureFlags = [
+   "--with-netcdf=${netcdf}" "--with-hdf5=${hdf5}"]
+   ++ lib.optional (enable_cdi_lib) "--enable-cdi-lib"
+   ++ lib.optional (enable_all_static) "--enable-all-static"
+   ++ lib.optional (enable_cxx) "--enable-cxx";
+
+  meta = with lib; {
+    description = "Collection of command line Operators to manipulate and analyse Climate and NWP model Data";
+    longDescription = ''
+      Supported data formats are GRIB 1/2, netCDF 3/4, SERVICE, EXTRA and IEG.
+      There are more than 600 operators available.
+    '';
+    homepage = "https://code.mpimet.mpg.de/projects/cdo/";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.ltavard ];
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cegui/default.nix b/nixpkgs/pkgs/development/libraries/cegui/default.nix
new file mode 100644
index 000000000000..ba3366198c2c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cegui/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, cmake, ogre, freetype, boost, expat }:
+
+stdenv.mkDerivation rec {
+  pname = "cegui";
+  version = "0.8.7";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/crayzedsgui/${pname}-${version}.tar.bz2";
+    sha256 = "067562s71kfsnbp2zb2bmq8zj3jk96g5a4rcc5qc3n8nfyayhldk";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ ogre freetype boost expat ];
+
+  meta = with lib; {
+    homepage = "http://cegui.org.uk/";
+    description = "C++ Library for creating GUIs";
+    license = licenses.mit;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/celt/0.5.1.nix b/nixpkgs/pkgs/development/libraries/celt/0.5.1.nix
new file mode 100644
index 000000000000..759dd6254b4e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/celt/0.5.1.nix
@@ -0,0 +1,17 @@
+{ callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "0.5.1.3";
+
+  src = fetchurl {
+    url = "http://downloads.xiph.org/releases/celt/celt-${version}.tar.gz";
+    sha256 = "0bkam9z5vnrxpbxkkh9kw6yzjka9di56h11iijikdd1f71l5nbpw";
+  };
+
+  # Don't build tests due to badness with ec_ilog
+  prePatch = ''
+    substituteInPlace Makefile.in \
+      --replace 'SUBDIRS = libcelt tests' \
+                'SUBDIRS = libcelt'
+  '';
+})
diff --git a/nixpkgs/pkgs/development/libraries/celt/0.7.nix b/nixpkgs/pkgs/development/libraries/celt/0.7.nix
new file mode 100644
index 000000000000..2092941dc761
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/celt/0.7.nix
@@ -0,0 +1,10 @@
+{ callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "0.7.1";
+
+  src = fetchurl {
+    url = "http://downloads.xiph.org/releases/celt/celt-${version}.tar.gz";
+    sha256 = "0rihjgzrqcprsv8a1pmiglwik7xqbs2yw3fwd6gb28chnpgy5w4k";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/celt/default.nix b/nixpkgs/pkgs/development/libraries/celt/default.nix
new file mode 100644
index 000000000000..3071b5d7c6bb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/celt/default.nix
@@ -0,0 +1,10 @@
+{ callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "0.11.3";
+
+  src = fetchurl {
+    url = "http://downloads.xiph.org/releases/celt/celt-${version}.tar.gz";
+    sha256 = "0dh893wqbh0q4a0x1xyqryykmnhpv7mkblpch019s04a99fq2r3y";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/celt/generic.nix b/nixpkgs/pkgs/development/libraries/celt/generic.nix
new file mode 100644
index 000000000000..d4fe5e83658b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/celt/generic.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, version, src
+, liboggSupport ? true, libogg ? null # if disabled only the library will be built
+, prePatch ? ""
+, ...
+}:
+
+# The celt codec has been deprecated and is now a part of the opus codec
+
+stdenv.mkDerivation {
+  pname = "celt";
+  inherit version;
+
+  inherit src;
+
+  inherit prePatch;
+
+  buildInputs = []
+    ++ lib.optional liboggSupport libogg;
+
+  doCheck = false; # fails
+
+  meta = with lib; {
+    description = "Ultra-low delay audio codec";
+    homepage    = "http://www.celt-codec.org/";
+    license     = licenses.bsd2;
+    maintainers = with maintainers; [ codyopel raskin ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cereal/default.nix b/nixpkgs/pkgs/development/libraries/cereal/default.nix
new file mode 100644
index 000000000000..958a92dec34e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cereal/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake }:
+stdenv.mkDerivation rec {
+  pname = "cereal";
+  version = "1.3.0";
+
+  nativeBuildInputs = [ cmake ];
+
+  src = fetchFromGitHub {
+    owner = "USCiLab";
+    repo = "cereal";
+    rev = "v${version}";
+    sha256 = "0hc8wh9dwpc1w1zf5lfss4vg5hmgpblqxbrpp1rggicpx9ar831p";
+  };
+
+  patches = [
+    # https://nvd.nist.gov/vuln/detail/CVE-2020-11105
+    # serialized std::shared_ptr variables cannot always be expected to
+    # serialize back into their original values. This can have any number of
+    # consequences, depending on the context within which this manifests.
+    (fetchpatch {
+      name = "CVE-2020-11105.patch";
+      url = "https://github.com/USCiLab/cereal/commit/f27c12d491955c94583512603bf32c4568f20929.patch";
+      sha256 = "CIkbJ7bAN0MXBhTXQdoQKXUmY60/wQvsdn99FaWt31w=";
+    })
+  ];
+
+  cmakeFlags = [ "-DJUST_INSTALL_CEREAL=yes" ];
+
+  meta = with 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/ceres-solver/default.nix b/nixpkgs/pkgs/development/libraries/ceres-solver/default.nix
new file mode 100644
index 000000000000..14d0e38f3d9f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ceres-solver/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv
+, eigen
+, fetchurl
+, cmake
+, gflags
+, glog
+, runTests ? false
+}:
+
+# gflags is required to run tests
+assert runTests -> gflags != null;
+
+stdenv.mkDerivation rec {
+  pname = "ceres-solver";
+  version = "2.0.0";
+
+  src = fetchurl {
+    url = "http://ceres-solver.org/ceres-solver-${version}.tar.gz";
+    sha256 = "00vng9vnmdb1qga01m0why90m0041w7bn6kxa2h4m26aflfqla8h";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ eigen glog ]
+    ++ lib.optional runTests gflags;
+
+  # The Basel BUILD file conflicts with the cmake build directory on
+  # case-insensitive filesystems, eg. darwin.
+  preConfigure = ''
+    rm BUILD
+  '';
+
+  doCheck = runTests;
+
+  checkTarget = "test";
+
+  meta = with lib; {
+    description = "C++ library for modeling and solving large, complicated optimization problems";
+    license = licenses.bsd3;
+    homepage = "http://ceres-solver.org";
+    maintainers = with maintainers; [ giogadi ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cglm/default.nix b/nixpkgs/pkgs/development/libraries/cglm/default.nix
new file mode 100644
index 000000000000..dfc9f81edb62
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cglm/default.nix
@@ -0,0 +1,27 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cglm";
+  version = "0.8.4";
+
+  src = fetchFromGitHub {
+    owner = "recp";
+    repo = "cglm";
+    rev = "v${version}";
+    sha256 = "sha256-AJK1M6iyYdL61pZQhbUWzf+YOUE5FEvUyKqxbQqc7H0=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://github.com/recp/cglm";
+    description = "Highly Optimized Graphics Math (glm) for C";
+    license = licenses.mit;
+    maintainers = [ maintainers.ivar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cgreen/default.nix b/nixpkgs/pkgs/development/libraries/cgreen/default.nix
new file mode 100644
index 000000000000..5a1dd2d26400
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cgreen/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, lib, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "cgreen";
+  version = "1.4.0";
+
+  src = fetchFromGitHub {
+    owner = "cgreen-devs";
+    repo = "cgreen";
+    rev = version;
+    sha256 = "JEpvkM0EZiiQUZRngICNxHbNqS/qjqkEdMPckGbdWac=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://github.com/cgreen-devs/cgreen";
+    description = "The Modern Unit Test and Mocking Framework for C and C++";
+    license = licenses.isc;
+    maintainers = [ maintainers.nichtsfrei ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cgui/default.nix b/nixpkgs/pkgs/development/libraries/cgui/default.nix
new file mode 100644
index 000000000000..1bc85d1fcd81
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cgui/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, texinfo, allegro, perl, libX11 }:
+
+stdenv.mkDerivation rec {
+  pname = "cgui";
+  version="2.1.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/cgui/${version}/${pname}-${version}.tar.gz";
+    sha256 = "1pp1hvidpilq37skkmbgba4lvzi01rasy04y0cnas9ck0canv00s";
+  };
+
+  buildInputs = [ texinfo allegro perl libX11 ];
+
+  configurePhase = ''
+    sh fix.sh unix
+  '';
+
+  hardeningDisable = [ "format" ];
+
+  makeFlags = [ "SYSTEM_DIR=$(out)" ];
+
+  meta = with lib; {
+    description = "A multiplatform basic GUI library";
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.linux;
+    license = licenses.free;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/check/default.nix b/nixpkgs/pkgs/development/libraries/check/default.nix
new file mode 100644
index 000000000000..37bde1caf437
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/check/default.nix
@@ -0,0 +1,36 @@
+{ fetchurl, lib, stdenv
+, CoreServices
+}:
+
+stdenv.mkDerivation rec {
+  pname = "check";
+  version = "0.15.2";
+
+  src = fetchurl {
+    url = "https://github.com/libcheck/check/releases/download/${version}/check-${version}.tar.gz";
+    sha256 = "02m25y9m46pb6n46s51av62kpd936lkfv3b13kfpckgvmh5lxpm8";
+  };
+
+  # Test can randomly fail: https://hydra.nixos.org/build/7243912
+  doCheck = false;
+
+  buildInputs = lib.optional stdenv.isDarwin CoreServices;
+
+  meta = with lib; {
+    description = "Unit testing framework for C";
+
+    longDescription =
+      '' Check is a unit testing framework for C.  It features a simple
+         interface for defining unit tests, putting little in the way of the
+         developer.  Tests are run in a separate address space, so Check can
+         catch both assertion failures and code errors that cause
+         segmentation faults or other signals.  The output from unit tests
+         can be used within source code editors and IDEs.
+      '';
+
+    homepage = "https://libcheck.github.io/check/";
+
+    license = licenses.lgpl2Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/chipmunk/default.nix b/nixpkgs/pkgs/development/libraries/chipmunk/default.nix
new file mode 100644
index 000000000000..8290e60a4850
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/chipmunk/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, cmake, freeglut, libGLU, libGL, glfw2, glew, libX11, xorgproto
+, libXi, libXmu, fetchpatch, libXrandr
+}:
+
+stdenv.mkDerivation rec {
+  pname = "chipmunk";
+  majorVersion = "7";
+  version = "${majorVersion}.0.3";
+
+  src = fetchurl {
+    url = "https://chipmunk-physics.net/release/Chipmunk-${majorVersion}.x/Chipmunk-${version}.tgz";
+    sha256 = "06j9cfxsyrrnyvl7hsf55ac5mgff939mmijliampphlizyg0r2q4";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/slembcke/Chipmunk2D/commit/9a051e6fb970c7afe09ce2d564c163b81df050a8.patch";
+      sha256 = "0ps8bjba1k544vcdx5w0qk7gcjq94yfigxf67j50s63yf70k2n70";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs =
+    [ freeglut libGLU libGL glfw2 glew libX11 xorgproto libXi libXmu libXrandr ];
+
+  postInstall = ''
+    mkdir -p $out/bin
+    cp demo/chipmunk_demos $out/bin
+  '';
+
+  meta = with lib; {
+    description = "A fast and lightweight 2D game physics library";
+    homepage = "http://chipmunk2d.net/";
+    license = licenses.mit;
+    platforms = platforms.unix; # supports Windows and MacOS as well, but those require more work
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/chmlib/default.nix b/nixpkgs/pkgs/development/libraries/chmlib/default.nix
new file mode 100644
index 000000000000..bc609d7bbf17
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/chmlib/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "chmlib";
+  version = "0.40a";
+
+  src = fetchFromGitHub {
+    owner = "jedwing";
+    repo = "CHMLib";
+    rev = "2bef8d063ec7d88a8de6fd9f0513ea42ac0fa21f";
+    sha256 = "1hah0nw0l05npva2r35ywwd0kzyiiz4vamghm6d71h8170iva6m9";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = with lib; {
+    homepage = "http://www.jedrea.com/chmlib";
+    license = licenses.lgpl2;
+    description = "A library for dealing with Microsoft ITSS/CHM format files";
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/chromaprint/default.nix b/nixpkgs/pkgs/development/libraries/chromaprint/default.nix
new file mode 100644
index 000000000000..599ef02eec09
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/chromaprint/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, cmake, boost, ffmpeg, darwin, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "chromaprint";
+  version = "1.5.0";
+
+  src = fetchurl {
+    url = "https://github.com/acoustid/chromaprint/releases/download/v${version}/${pname}-${version}.tar.gz";
+    sha256 = "0sknmyl5254rc55bvkhfwpl4dfvz45xglk1rq8zq5crmwq058fjp";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ boost ffmpeg ] ++ lib.optionals stdenv.isDarwin
+    (with darwin.apple_sdk.frameworks; [Accelerate CoreGraphics CoreVideo zlib]);
+
+  cmakeFlags = [ "-DBUILD_EXAMPLES=ON" "-DBUILD_TOOLS=ON" ];
+
+  meta = with lib; {
+    homepage = "https://acoustid.org/chromaprint";
+    description = "AcoustID audio fingerprinting library";
+    maintainers = with maintainers; [ ehmry ];
+    license = licenses.lgpl21Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cimg/default.nix b/nixpkgs/pkgs/development/libraries/cimg/default.nix
new file mode 100644
index 000000000000..69e16a8922a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cimg/default.nix
@@ -0,0 +1,42 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cimg";
+  version = "2.9.8";
+
+  src = fetchFromGitHub {
+    owner = "dtschump";
+    repo = "CImg";
+    rev = "v.${version}";
+    sha256 = "sha256-nEICs1oAIXu6/5O4R3mbwig1OY+HDIWWeQjrcYnCwT0=";
+  };
+
+  installPhase = ''
+    runHook preInstall
+    install -dm 755 $out/include/CImg/plugins $doc/share/doc/cimg/examples
+    install -m 644 CImg.h $out/include/
+    cp -dr --no-preserve=ownership examples/* $doc/share/doc/cimg/examples/
+    cp -dr --no-preserve=ownership plugins/* $out/include/CImg/plugins/
+    cp README.txt $doc/share/doc/cimg/
+    runHook postInstall
+  '';
+
+  outputs = [ "out" "doc" ];
+
+  meta = with lib; {
+    homepage = "http://cimg.eu/";
+    description = "A small, open source, C++ toolkit for image processing";
+    longDescription = ''
+      CImg stands for Cool Image. It is easy to use, efficient and is intended
+      to be a very pleasant toolbox to design image processing algorithms in
+      C++. Due to its generic conception, it can cover a wide range of image
+      processing applications.
+    '';
+    license = licenses.cecill-c;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/civetweb/0001-allow-setting-paths-in-makefile.patch b/nixpkgs/pkgs/development/libraries/civetweb/0001-allow-setting-paths-in-makefile.patch
new file mode 100644
index 000000000000..8a14fb3a5fab
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/civetweb/0001-allow-setting-paths-in-makefile.patch
@@ -0,0 +1,33 @@
+diff -u a/Makefile b/Makefile
+--- a/Makefile	2020-12-27 18:48:53.934098765 +0100
++++ b/Makefile	2020-12-27 18:50:44.022674117 +0100
+@@ -19,13 +19,13 @@
+ # http://www.gnu.org/prep/standards/html_node/Directory-Variables.html
+ PREFIX ?= /usr/local
+ EXEC_PREFIX = $(PREFIX)
+-BINDIR = $(EXEC_PREFIX)/bin
++BINDIR ?= $(EXEC_PREFIX)/bin
+ DATAROOTDIR = $(PREFIX)/share
+ DOCDIR = $(DATAROOTDIR)/doc/$(CPROG)
+ SYSCONFDIR ?= $(PREFIX)/etc
+ HTMLDIR = $(DOCDIR)
+-INCLUDEDIR = $(DESTDIR)$(PREFIX)/include
+-LIBDIR = $(DESTDIR)$(EXEC_PREFIX)/lib
++INCLUDEDIR ?= $(DESTDIR)$(PREFIX)/include
++LIBDIR ?= $(DESTDIR)$(EXEC_PREFIX)/lib
+ PID_FILE ?= /var/run/$(CPROG).pid
+ 
+ # build tools
+@@ -337,10 +337,10 @@
+ 	install -m 755 $(CPROG) "$(BINDIR)/"
+ 
+ install-headers:
+-	install -m 644 $(HEADERS) "$(INCLUDEDIR)"
++	install -m 644 $(HEADERS) "$(INCLUDEDIR)/"
+ 
+ install-lib: lib$(CPROG).a
+-	install -m 644 $< "$(LIBDIR)"
++	install -m 644 $< "$(LIBDIR)/"
+ 
+ install-slib: lib$(CPROG).so
+ 	$(eval version=$(shell grep -w "define CIVETWEB_VERSION" include/civetweb.h | sed 's|.*VERSION "\(.*\)"|\1|g'))
diff --git a/nixpkgs/pkgs/development/libraries/civetweb/default.nix b/nixpkgs/pkgs/development/libraries/civetweb/default.nix
new file mode 100644
index 000000000000..398ca028c09c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/civetweb/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv
+, fetchFromGitHub
+}:
+
+stdenv.mkDerivation rec {
+  pname = "civetweb";
+  version = "1.14";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-6qBsM9zkN838cMtpE3+c7qcrFpZCS/Av7Ch7EWmlnD4=";
+  };
+
+  makeFlags = [
+    "WITH_CPP=1"
+    "PREFIX=${placeholder "out"}"
+    "LIBDIR=${placeholder "out"}/lib"
+    "INCLUDEDIR=${placeholder "dev"}/include"
+  ];
+
+  patches = [
+    ./0001-allow-setting-paths-in-makefile.patch
+  ];
+
+  strictDeps = true;
+
+  outputs = [ "out" "dev" ];
+
+  installTargets = [
+    "install-headers"
+    "install-lib"
+    "install-slib"
+    "install"
+  ];
+
+  preInstall = ''
+    mkdir -p $dev/include
+    mkdir -p $out/lib
+  '';
+
+  meta = {
+    description = "Embedded C/C++ web server";
+    homepage = "https://github.com/civetweb/civetweb";
+    license = [ lib.licenses.mit ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cjose/default.nix b/nixpkgs/pkgs/development/libraries/cjose/default.nix
new file mode 100644
index 000000000000..57b5c6c1b8bf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cjose/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, pkg-config
+, doxygen
+, check
+, jansson
+, openssl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cjose";
+  version = "0.6.1";
+
+  src = fetchFromGitHub {
+    owner = "cisco";
+    repo = "cjose";
+    rev = version;
+    sha256 = "1msyjwmylb5c7jc16ryx3xb9cdwx682ihsm0ni766y6dfwx8bkhp";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config doxygen ];
+  buildInputs = [ jansson openssl ];
+  checkInputs = [ check ];
+
+  configureFlags = [
+    "--with-jansson=${jansson}"
+    "--with-openssl=${openssl.dev}"
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/cisco/cjose";
+    changelog = "https://github.com/cisco/cjose/blob/${version}/CHANGELOG.md";
+    description = "C library for Javascript Object Signing and Encryption";
+    license = licenses.mit;
+    maintainers = with maintainers; [ midchildan ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cjson/default.nix b/nixpkgs/pkgs/development/libraries/cjson/default.nix
new file mode 100644
index 000000000000..ccf3311317aa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cjson/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, lib, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "cjson";
+  version = "1.7.15";
+
+  src = fetchFromGitHub {
+    owner = "DaveGamble";
+    repo = "cJSON";
+    rev = "v${version}";
+    sha256 = "sha256-PpUVsLklcs5hCCsQcsXw0oEVIWecKnQO16Hy0Ba8ov8=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  # cJSON actually uses C99 standard, not C89
+  # https://github.com/DaveGamble/cJSON/issues/275
+  postPatch = ''
+    substituteInPlace CMakeLists.txt --replace -std=c89 -std=c99
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/DaveGamble/cJSON";
+    description = "Ultralightweight JSON parser in ANSI C";
+    license = licenses.mit;
+    maintainers = [ maintainers.matthiasbeyer ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cl/default.nix b/nixpkgs/pkgs/development/libraries/cl/default.nix
new file mode 100644
index 000000000000..a4b526ea25d3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cl/default.nix
@@ -0,0 +1,36 @@
+{lib, stdenv, fetchFromGitHub, rebar, erlang, opencl-headers, ocl-icd }:
+
+stdenv.mkDerivation rec {
+  version = "1.2.4";
+  pname = "cl";
+
+  src = fetchFromGitHub {
+    owner = "tonyrog";
+    repo = "cl";
+    rev = "cl-${version}";
+    sha256 = "1gwkjl305a0231hz3k0w448dsgbgdriaq764sizs5qfn59nzvinz";
+  };
+
+  buildInputs = [ erlang rebar opencl-headers ocl-icd ];
+
+  buildPhase = ''
+    rebar compile
+  '';
+
+  # 'cp' line taken from Arch recipe
+  # https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/erlang-sdl
+  installPhase = ''
+    DIR=$out/lib/erlang/lib/${pname}-${version}
+    mkdir -p $DIR
+    cp -ruv c_src doc ebin include priv src $DIR
+  '';
+
+  meta = with lib; {
+    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/clanlib/default.nix b/nixpkgs/pkgs/development/libraries/clanlib/default.nix
new file mode 100644
index 000000000000..0a0f976e0dc4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/clanlib/default.nix
@@ -0,0 +1,50 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, libGL
+, libpng
+, pkg-config
+, xorg
+, file
+, freetype
+, fontconfig
+, xlibsWrapper
+, alsa-lib
+, libXrender
+}:
+
+stdenv.mkDerivation rec {
+  pname = "clanlib";
+  version = "4.1.0";
+
+  src = fetchFromGitHub {
+    repo = "ClanLib";
+    owner = "sphair";
+    rev = "v${version}";
+    sha256 = "sha256-SVsLWcTP+PCIGDWLkadMpJPj4coLK9dJrW4sc2+HotE=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    autoreconfHook
+  ];
+  buildInputs = [
+    libGL
+    libpng
+    xorg.xorgproto
+    freetype
+    fontconfig
+    xlibsWrapper
+    alsa-lib
+    libXrender
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/sphair/ClanLib";
+    description = "A cross platform toolkit library with a primary focus on game creation";
+    license = licenses.mit;
+    maintainers = with maintainers; [ nixinator ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/classads/default.nix b/nixpkgs/pkgs/development/libraries/classads/default.nix
new file mode 100644
index 000000000000..991fb2b41d50
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/classads/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, pcre }:
+
+stdenv.mkDerivation rec {
+  pname = "classads";
+  version = "1.0.10";
+
+  src = fetchurl {
+    url = "ftp://ftp.cs.wisc.edu/condor/classad/c++/classads-${version}.tar.gz";
+    sha256 = "1czgj53gnfkq3ncwlsrwnr4y91wgz35sbicgkp4npfrajqizxqnd";
+  };
+
+  buildInputs = [ pcre ];
+
+  configureFlags = [
+    "--enable-namespace" "--enable-flexible-member"
+  ];
+
+  meta = {
+    homepage = "http://www.cs.wisc.edu/condor/classad/";
+    description = "The Classified Advertisements library provides a generic means for matching resources";
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/clearsilver/default.nix b/nixpkgs/pkgs/development/libraries/clearsilver/default.nix
new file mode 100644
index 000000000000..73ffd6c12b23
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/clearsilver/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchurl, fetchpatch, python2 }:
+
+stdenv.mkDerivation rec {
+  name = "clearsilver-0.10.5";
+
+  src = fetchurl {
+    url = "http://www.clearsilver.net/downloads/${name}.tar.gz";
+    sha256 = "1046m1dpq3nkgxbis2dr2x7hynmy51n64465q78d7pdgvqwa178y";
+  };
+
+  PYTHON_SITE = "${placeholder "out"}/${python2.sitePackages}";
+
+  configureFlags = [
+    "--with-python=${python2.interpreter}"
+    "--disable-apache"
+    "--disable-perl"
+    "--disable-ruby"
+    "--disable-java"
+    "--disable-csharp"
+  ];
+
+  preInstall = ''
+    mkdir -p $out
+    mkdir -p $out/${python2.sitePackages}
+  '';
+
+  patches = [
+    (fetchpatch {
+      url = "https://sources.debian.net/data/main/c/clearsilver/0.10.5-1.6/debian/patches/clang-gcc5.patch";
+      sha256 = "0d44v9jx0b6k8nvrhknd958i9rs59kdh73z0lb4f1mzi8if16c38";
+    })
+    (fetchpatch {
+      url = "https://sources.debian.net/data/main/c/clearsilver/0.10.5-1.6/debian/patches/CVE-2011-4357.diff";
+      sha256 = "1lfncavxdqckrz03gv97lcliygbpi9lnih944vmdbn9zw6fwcipi";
+    })
+  ];
+
+  meta = with lib; {
+    description = "Fast, powerful, and language-neutral HTML template system";
+    homepage = "http://www.clearsilver.net/";
+    license = licenses.free;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/clfft/default.nix b/nixpkgs/pkgs/development/libraries/clfft/default.nix
new file mode 100644
index 000000000000..db18bce72be8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/clfft/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, cmake, fftw, fftwFloat, boost166, opencl-clhpp, ocl-icd }:
+
+stdenv.mkDerivation rec {
+  pname = "clfft";
+  version = "2.12.2";
+
+  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 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 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/clipp/clipp.pc b/nixpkgs/pkgs/development/libraries/clipp/clipp.pc
new file mode 100644
index 000000000000..38c07e5ba162
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/clipp/clipp.pc
@@ -0,0 +1,9 @@
+prefix=@out@
+includedir=${prefix}/include
+
+Name: @pname@
+Description: Easy to use, powerful and expressive command line argument \
+handling for C++11/14/17
+URL: https://github.com/muellan/clipp
+Version: @version@
+Cflags: -I${includedir}
diff --git a/nixpkgs/pkgs/development/libraries/clipp/default.nix b/nixpkgs/pkgs/development/libraries/clipp/default.nix
new file mode 100644
index 000000000000..12b393e597d4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/clipp/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "clipp";
+  version = "1.2.3";
+
+  src = fetchFromGitHub {
+    owner = "muellan";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0rq80ba2krwzvcg4r2g1al88453c7lz6ziri2s1ygv8inp9r775s";
+  };
+
+  installPhase = ''
+    mkdir -p $out/share/pkgconfig
+    cp -r include $out/
+    substitute ${./clipp.pc} $out/share/pkgconfig/clipp.pc \
+      --subst-var out \
+      --subst-var pname \
+      --subst-var version
+  '';
+
+  meta = with lib; {
+    description = "Easy to use, powerful and expressive command line argument handling for C++11/14/17";
+    homepage = "https://github.com/muellan/clipp";
+    license = licenses.mit;
+    maintainers = with maintainers; [ xbreak ];
+    platforms = with platforms; all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/clipper/default.nix b/nixpkgs/pkgs/development/libraries/clipper/default.nix
new file mode 100644
index 000000000000..9eb34f6b6863
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/clipper/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, cmake, ninja, unzip }:
+
+stdenv.mkDerivation rec {
+  version = "6.4.2";
+  pname = "Clipper";
+  src = fetchurl {
+    url = "mirror://sourceforge/polyclipping/clipper_ver${version}.zip";
+    sha256 = "09q6jc5k7p9y5d75qr2na5d1gm0wly5cjnffh127r04l47c20hx1";
+  };
+
+  sourceRoot = "cpp";
+
+  buildInputs = [ ];
+
+  nativeBuildInputs = [ cmake ninja unzip ];
+
+  meta = with 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";
+    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
new file mode 100644
index 000000000000..23bbd84a2096
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cln/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl, gmp }:
+
+stdenv.mkDerivation rec {
+  pname = "cln";
+  version = "1.3.6";
+
+  src = fetchurl {
+    url = "${meta.homepage}${pname}-${version}.tar.bz2";
+    sha256 = "0jlq9l4hphk7qqlgqj9ihjp4m3rwjbhk6q4v00lsbgbri07574pl";
+  };
+
+  buildInputs = [ gmp ];
+
+  meta = with lib; {
+    description = "C/C++ library for numbers, a part of GiNaC";
+    homepage = "https://www.ginac.de/CLN/";
+    license = licenses.gpl2;
+    platforms = platforms.unix; # Once had cygwin problems
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cloog-ppl/default.nix b/nixpkgs/pkgs/development/libraries/cloog-ppl/default.nix
new file mode 100644
index 000000000000..65d6a392ffdb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cloog-ppl/default.nix
@@ -0,0 +1,71 @@
+{ fetchurl, lib, stdenv, ppl, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "cloog-ppl";
+  version = "0.15.11";
+
+  src = fetchurl {
+    url = "mirror://gcc/infrastructure/${pname}-${version}.tar.gz";
+    sha256 = "0psdm0bn5gx60glfh955x5b3b23zqrd92idmjr0b00dlnb839mkw";
+  };
+
+  propagatedBuildInputs = [ ppl ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  patches = [ ./fix-ppl-version.patch ];
+
+  configureFlags = [ "--with-ppl=${ppl}" ];
+
+  preAutoreconf = ''
+    touch NEWS ChangeLog AUTHORS
+  '';
+
+  doCheck = true;
+
+  meta = {
+    description = "CLooG-PPL, the Chunky Loop Generator";
+
+    longDescription = ''
+      CLooG is a free software library to generate code for scanning
+      Z-polyhedra.  That is, it finds a code (e.g., in C, FORTRAN...) that
+      reaches each integral point of one or more parameterized polyhedra.
+      CLooG has been originally written to solve the code generation problem
+      for optimizing compilers based on the polytope model.  Nevertheless it
+      is used now in various area e.g., to build control automata for
+      high-level synthesis or to find the best polynomial approximation of a
+      function.  CLooG may help in any situation where scanning polyhedra
+      matters.  While the user has full control on generated code quality,
+      CLooG is designed to avoid control overhead and to produce a very
+      effective code.
+    '';
+
+    # CLooG-PPL is actually a port of GLooG from PolyLib to PPL.
+    homepage = "http://www.cloog.org/";
+
+    license = lib.licenses.gpl2Plus;
+
+    maintainers = [ ];
+
+    /* Leads to an ICE on Cygwin:
+
+       make[3]: Entering directory `/tmp/nix-build-9q5gw5m37q5l4f0kjfv9ar8fsc9plk27-ppl-0.10.2.drv-1/ppl-0.10.2/src'
+       /bin/sh ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..  -I.. -I../src    -g -O2 -frounding-math  -W -Wall -c -o Box.lo Box.cc
+       libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -g -O2 -frounding-math -W -Wall -c Box.cc  -DDLL_EXPORT -DPIC -o .libs/Box.o
+       In file included from checked.defs.hh:595,
+                        from Checked_Number.defs.hh:27,
+                        from Coefficient.types.hh:15,
+                        from Coefficient.defs.hh:26,
+                        from Box.defs.hh:28,
+                        from Box.cc:24:
+       checked.inlines.hh: In function `Parma_Polyhedra_Library::Result Parma_Polyhedra_Library::Checked::input_generic(Type&, std::istream&, Parma_Polyhedra_Library::Rounding_Dir)':
+       checked.inlines.hh:607: internal compiler error: in invert_truthvalue, at fold-const.c:2719
+       Please submit a full bug report,
+       with preprocessed source if appropriate.
+       See <URL:http://cygwin.com/problems.html> for instructions.
+       make[3]: *** [Box.lo] Error 1
+
+    */
+    platforms = lib.platforms.unix; # Once had cygwin problems
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cloog-ppl/fix-ppl-version.patch b/nixpkgs/pkgs/development/libraries/cloog-ppl/fix-ppl-version.patch
new file mode 100644
index 000000000000..8440d839411b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cloog-ppl/fix-ppl-version.patch
@@ -0,0 +1,16 @@
+diff -rupN src/configure.in cloog-ppl-0.15.11/configure.in
+--- src/configure.in	2014-04-13 13:33:43.349392305 +0200
++++ cloog-ppl-0.15.11/configure.in	2014-04-13 13:34:12.695379888 +0200
+@@ -337,11 +337,7 @@ if test "x$with_ppl" != "x" -a "x$with_p
+ 		        [AC_MSG_ERROR(Can't find PPL headers.)])
+ 
+ 	AC_MSG_CHECKING([for version 0.10 (or later revision) of PPL])
+-	AC_TRY_COMPILE([#include "ppl_c.h"],[
+-	#if PPL_VERSION_MAJOR != 0 || PPL_VERSION_MINOR < 10
+-	choke me
+-	#endif
+-	], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR(Can't find correct version of PPL.) ])
++	AC_MSG_RESULT([yes])
+ 
+ 	LIBS="$LIBS -lppl_c -lppl -lgmpxx"
+ 	AC_DEFINE([CLOOG_PPL_BACKEND], 1, [Use the PPL backend])
diff --git a/nixpkgs/pkgs/development/libraries/cloog/0.18.0.nix b/nixpkgs/pkgs/development/libraries/cloog/0.18.0.nix
new file mode 100644
index 000000000000..c952c1a563b8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cloog/0.18.0.nix
@@ -0,0 +1,63 @@
+{ fetchurl, lib, stdenv, gmp, isl }:
+
+stdenv.mkDerivation rec {
+  name = "cloog-0.18.0";
+
+  src = fetchurl {
+    url = "http://www.bastoul.net/cloog/pages/download/count.php3?url=./${name}.tar.gz";
+    sha256 = "1c4aa8dde7886be9cbe0f9069c334843b21028f61d344a2d685f88cb1dcf2228";
+  };
+
+  buildInputs = [ gmp ];
+
+  propagatedBuildInputs = [ isl ];
+
+  configureFlags = [ "--with-isl=system" ];
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  meta = {
+    description = "Library that generates loops for scanning polyhedra";
+
+    longDescription = ''
+      CLooG is a free software library to generate code for scanning
+      Z-polyhedra.  That is, it finds a code (e.g., in C, FORTRAN...) that
+      reaches each integral point of one or more parameterized polyhedra.
+      CLooG has been originally written to solve the code generation problem
+      for optimizing compilers based on the polytope model.  Nevertheless it
+      is used now in various area e.g., to build control automata for
+      high-level synthesis or to find the best polynomial approximation of a
+      function.  CLooG may help in any situation where scanning polyhedra
+      matters.  While the user has full control on generated code quality,
+      CLooG is designed to avoid control overhead and to produce a very
+      effective code.
+    '';
+
+    homepage = "http://www.cloog.org/";
+
+    license = lib.licenses.gpl2Plus;
+
+    /* Leads to an ICE on Cygwin:
+
+       make[3]: Entering directory `/tmp/nix-build-9q5gw5m37q5l4f0kjfv9ar8fsc9plk27-ppl-0.10.2.drv-1/ppl-0.10.2/src'
+       /bin/sh ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..  -I.. -I../src    -g -O2 -frounding-math  -W -Wall -c -o Box.lo Box.cc
+       libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -g -O2 -frounding-math -W -Wall -c Box.cc  -DDLL_EXPORT -DPIC -o .libs/Box.o
+       In file included from checked.defs.hh:595,
+                        from Checked_Number.defs.hh:27,
+                        from Coefficient.types.hh:15,
+                        from Coefficient.defs.hh:26,
+                        from Box.defs.hh:28,
+                        from Box.cc:24:
+       checked.inlines.hh: In function `Parma_Polyhedra_Library::Result Parma_Polyhedra_Library::Checked::input_generic(Type&, std::istream&, Parma_Polyhedra_Library::Rounding_Dir)':
+       checked.inlines.hh:607: internal compiler error: in invert_truthvalue, at fold-const.c:2719
+       Please submit a full bug report,
+       with preprocessed source if appropriate.
+       See <URL:http://cygwin.com/problems.html> for instructions.
+       make[3]: *** [Box.lo] Error 1
+
+    */
+    platforms = lib.platforms.unix; # Once had cygwin problems
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cloog/default.nix b/nixpkgs/pkgs/development/libraries/cloog/default.nix
new file mode 100644
index 000000000000..02a91050e7ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cloog/default.nix
@@ -0,0 +1,65 @@
+{ fetchurl, lib, stdenv, gmp, isl }:
+
+stdenv.mkDerivation rec {
+  pname = "cloog";
+  version = "0.18.4";
+
+  src = fetchurl {
+    url = "http://www.bastoul.net/cloog/pages/download/count.php3?url=./${pname}-${version}.tar.gz";
+    sha256 = "03km1aqaiy3sbqc2f046ms9x0mlmacxlvs5rxsvjj8nf20vxynij";
+  };
+
+  buildInputs = [ gmp ];
+
+  propagatedBuildInputs = [ isl ];
+
+  configureFlags = [ "--with-isl=system" ];
+
+  # Breaks the test cases
+  #enableParallelBuilding = true;
+
+  doCheck = true;
+
+  meta = {
+    description = "Library that generates loops for scanning polyhedra";
+
+    longDescription = ''
+      CLooG is a free software library to generate code for scanning
+      Z-polyhedra.  That is, it finds a code (e.g., in C, FORTRAN...) that
+      reaches each integral point of one or more parameterized polyhedra.
+      CLooG has been originally written to solve the code generation problem
+      for optimizing compilers based on the polytope model.  Nevertheless it
+      is used now in various area e.g., to build control automata for
+      high-level synthesis or to find the best polynomial approximation of a
+      function.  CLooG may help in any situation where scanning polyhedra
+      matters.  While the user has full control on generated code quality,
+      CLooG is designed to avoid control overhead and to produce a very
+      effective code.
+    '';
+
+    homepage = "http://www.cloog.org/";
+
+    license = lib.licenses.gpl2Plus;
+
+    /* Leads to an ICE on Cygwin:
+
+       make[3]: Entering directory `/tmp/nix-build-9q5gw5m37q5l4f0kjfv9ar8fsc9plk27-ppl-0.10.2.drv-1/ppl-0.10.2/src'
+       /bin/sh ../libtool --tag=CXX   --mode=compile g++ -DHAVE_CONFIG_H -I. -I..  -I.. -I../src    -g -O2 -frounding-math  -W -Wall -c -o Box.lo Box.cc
+       libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I.. -I.. -I../src -g -O2 -frounding-math -W -Wall -c Box.cc  -DDLL_EXPORT -DPIC -o .libs/Box.o
+       In file included from checked.defs.hh:595,
+                        from Checked_Number.defs.hh:27,
+                        from Coefficient.types.hh:15,
+                        from Coefficient.defs.hh:26,
+                        from Box.defs.hh:28,
+                        from Box.cc:24:
+       checked.inlines.hh: In function `Parma_Polyhedra_Library::Result Parma_Polyhedra_Library::Checked::input_generic(Type&, std::istream&, Parma_Polyhedra_Library::Rounding_Dir)':
+       checked.inlines.hh:607: internal compiler error: in invert_truthvalue, at fold-const.c:2719
+       Please submit a full bug report,
+       with preprocessed source if appropriate.
+       See <URL:http://cygwin.com/problems.html> for instructions.
+       make[3]: *** [Box.lo] Error 1
+
+    */
+    platforms = lib.platforms.unix; # Once had cygwin problems
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/clucene-core/2.x.nix b/nixpkgs/pkgs/development/libraries/clucene-core/2.x.nix
new file mode 100644
index 000000000000..9c1f3c21cd27
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/clucene-core/2.x.nix
@@ -0,0 +1,57 @@
+{lib, stdenv, fetchurl, cmake, boost, zlib}:
+
+stdenv.mkDerivation rec {
+  name = "clucene-core-2.3.3.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/clucene/${name}.tar.gz";
+    sha256 = "1arffdwivig88kkx685pldr784njm0249k0rb1f1plwavlrw9zfx";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ boost zlib ];
+
+  cmakeFlags = [
+    "-DBUILD_CONTRIBS=ON"
+    "-DBUILD_CONTRIBS_LIB=ON"
+    "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON"
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "-D_CL_HAVE_GCC_ATOMIC_FUNCTIONS=0"
+    "-D_CL_HAVE_NAMESPACES_EXITCODE=0"
+    "-D_CL_HAVE_NO_SNPRINTF_BUG_EXITCODE=0"
+    "-D_CL_HAVE_NO_SNWPRINTF_BUG_EXITCODE=0"
+    "-D_CL_HAVE_TRY_BLOCKS_EXITCODE=0"
+    "-D_CL_HAVE_PTHREAD_MUTEX_RECURSIVE=0"
+    "-DLUCENE_STATIC_CONSTANT_SYNTAX_EXITCODE=0"
+  ];
+
+  patches = # From debian
+    [ ./Fix-pkgconfig-file-by-adding-clucene-shared-library.patch
+      ./Fixing_ZLIB_configuration_in_shared_CMakeLists.patch
+      ./Install-contribs-lib.patch
+    ] ++ lib.optionals stdenv.isDarwin [ ./fix-darwin.patch ];
+
+  # fails with "Unable to find executable:
+  # /build/clucene-core-2.3.3.4/build/bin/cl_test"
+  doCheck = false;
+
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
+
+  meta = with lib; {
+    description = "Core library for full-featured text search engine";
+    longDescription = ''
+      CLucene is a high-performance, scalable, cross platform, full-featured,
+      open-source indexing and searching API. Specifically, CLucene is the guts
+      of a search engine, the hard stuff. You write the easy stuff: the UI and
+      the process of selecting and parsing your data files to pump them into
+      the search engine yourself, and any specialized queries to pull it back
+      for display or further processing.
+
+      CLucene is a port of the very popular Java Lucene text search engine API.
+    '';
+    homepage = "http://clucene.sourceforge.net";
+    platforms = platforms.unix;
+    license = with licenses; [ asl20 lgpl2 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/clucene-core/Fix-pkgconfig-file-by-adding-clucene-shared-library.patch b/nixpkgs/pkgs/development/libraries/clucene-core/Fix-pkgconfig-file-by-adding-clucene-shared-library.patch
new file mode 100644
index 000000000000..80e49a8e712e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/clucene-core/Fix-pkgconfig-file-by-adding-clucene-shared-library.patch
@@ -0,0 +1,19 @@
+From 7be4a19b76d98260cf95040a47935f854a4ba7a4 Mon Sep 17 00:00:00 2001
+From: Valentin Rusu <kde@rusu.info>
+Date: Sat, 17 Dec 2011 13:47:58 +0100
+Subject: [PATCH] Fix .pc file by adding clucene-shared library
+
+---
+ src/core/libclucene-core.pc.cmake |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/core/libclucene-core.pc.cmake
++++ b/src/core/libclucene-core.pc.cmake
+@@ -6,6 +6,6 @@ includedir=${prefix}/include:${prefix}/i
+ Name: libclucene
+ Description: CLucene - a C++ search engine, ported from the popular Apache Lucene
+ Version: @CLUCENE_VERSION_MAJOR@.@CLUCENE_VERSION_MINOR@.@CLUCENE_VERSION_REVISION@.@CLUCENE_VERSION_PATCH@
+-Libs: -L${prefix}/@LIB_DESTINATION@/ -lclucene-core
++Libs: -L${prefix}/@LIB_DESTINATION@/ -lclucene-core -lclucene-shared
+ Cflags: -I${prefix}/include -I${prefix}/include/CLucene/ext
+ ~
diff --git a/nixpkgs/pkgs/development/libraries/clucene-core/Fixing_ZLIB_configuration_in_shared_CMakeLists.patch b/nixpkgs/pkgs/development/libraries/clucene-core/Fixing_ZLIB_configuration_in_shared_CMakeLists.patch
new file mode 100644
index 000000000000..f5f44a7fa2c4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/clucene-core/Fixing_ZLIB_configuration_in_shared_CMakeLists.patch
@@ -0,0 +1,20 @@
+From 772481ca94071ddfe65102a451926e4f9aeb4d2c Mon Sep 17 00:00:00 2001
+From: Veit Jahns <idolum@users.sourceforge.net>
+Date: Thu, 26 May 2011 13:35:28 +0200
+Subject: [PATCH] Fixing ZLIB configuration in shared's CMakeLists
+
+---
+ src/shared/CMakeLists.txt |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/src/shared/CMakeLists.txt
++++ b/src/shared/CMakeLists.txt
+@@ -42,7 +42,7 @@ INCLUDE (CheckAtomicFunctions)
+ find_package(ZLIB)
+ IF ( ZLIB_FOUND )
+   SET ( EXTRA_LIBS ${EXTRA_LIBS} ${ZLIB_LIBRARY} )
+-ELSEIF ( ZLIB_FOUND )
++ELSE ( ZLIB_FOUND )
+   MESSAGE( "ZLIB not found, using local: ${clucene-ext_SOURCE_DIR}/zlib" )
+   SET(ZLIB_INCLUDE_DIR ${clucene-ext_SOURCE_DIR}/zlib )
+   SET(ZLIB_LIBRARY ${clucene-ext_BINARY_DIR})
diff --git a/nixpkgs/pkgs/development/libraries/clucene-core/Install-contribs-lib.patch b/nixpkgs/pkgs/development/libraries/clucene-core/Install-contribs-lib.patch
new file mode 100644
index 000000000000..899411fe02b4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/clucene-core/Install-contribs-lib.patch
@@ -0,0 +1,49 @@
+Description: contribs-lib is not built and installed even with config
+Author: Vitaliy Filippov
+Bug: https://sourceforge.net/tracker/index.php?func=detail&aid=3392466&group_id=80013&atid=558446
+ 
+---
+ CMakeLists.txt                  |    2 +-
+ src/contribs-lib/CMakeLists.txt |   17 +++++++++++++++++
+ 2 files changed, 18 insertions(+), 1 deletion(-)
+
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -163,7 +163,7 @@ IF ( BUILD_CONTRIBS )
+   SET(BUILD_CONTRIBS_LIB 1)
+ ENDIF ( BUILD_CONTRIBS )
+ IF ( BUILD_CONTRIBS_LIB )
+-  ADD_SUBDIRECTORY (src/contribs-lib EXCLUDE_FROM_ALL)
++  ADD_SUBDIRECTORY (src/contribs-lib)
+ ENDIF ( BUILD_CONTRIBS_LIB )
+ 
+ 
+--- a/src/contribs-lib/CMakeLists.txt
++++ b/src/contribs-lib/CMakeLists.txt
+@@ -106,9 +106,26 @@ add_library(clucene-contribs-lib SHARED
+ )
+ TARGET_LINK_LIBRARIES(clucene-contribs-lib ${clucene_contrib_extra_libs})
+ 
++#install public headers.
++FOREACH(file ${HEADERS})
++	get_filename_component(apath ${file} PATH)
++	get_filename_component(aname ${file} NAME)
++	file(RELATIVE_PATH relpath ${CMAKE_SOURCE_DIR}/src/contribs-lib ${apath})
++	IF ( NOT aname MATCHES "^_.*" )
++		install(FILES ${file} 
++		        DESTINATION include/${relpath}
++		        COMPONENT development)
++	ENDIF ( NOT aname MATCHES "^_.*" )
++ENDFOREACH(file)
++
+ #set properties on the libraries
+ SET_TARGET_PROPERTIES(clucene-contribs-lib PROPERTIES
+     VERSION ${CLUCENE_VERSION}
+     SOVERSION ${CLUCENE_SOVERSION}
+     COMPILE_DEFINITIONS_DEBUG _DEBUG
+ )
++
++#and install library
++install(TARGETS clucene-contribs-lib 
++        DESTINATION ${LIB_DESTINATION}  
++        COMPONENT runtime )
diff --git a/nixpkgs/pkgs/development/libraries/clucene-core/default.nix b/nixpkgs/pkgs/development/libraries/clucene-core/default.nix
new file mode 100644
index 000000000000..8d5b389150a4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/clucene-core/default.nix
@@ -0,0 +1,29 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  name = "clucene-core-0.9.21b";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/clucene/${name}.tar.bz2";
+    sha256 = "202ee45af747f18642ae0a088d7c4553521714a511a1a9ec99b8144cf9928317";
+  };
+
+  patches = [ ./gcc6.patch ];
+
+  meta = with lib; {
+    description = "Core library for full-featured text search engine";
+    longDescription = ''
+      CLucene is a high-performance, scalable, cross platform, full-featured,
+      open-source indexing and searching API. Specifically, CLucene is the guts
+      of a search engine, the hard stuff. You write the easy stuff: the UI and
+      the process of selecting and parsing your data files to pump them into
+      the search engine yourself, and any specialized queries to pull it back
+      for display or further processing.
+
+      CLucene is a port of the very popular Java Lucene text search engine API.
+    '';
+    homepage = "http://clucene.sourceforge.net";
+    platforms = platforms.unix;
+    license = with licenses; [ asl20 lgpl2 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/clucene-core/fix-darwin.patch b/nixpkgs/pkgs/development/libraries/clucene-core/fix-darwin.patch
new file mode 100644
index 000000000000..c06413f3c2e1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/clucene-core/fix-darwin.patch
@@ -0,0 +1,75 @@
+--- a/src/shared/CLucene/LuceneThreads.h
++++ b/src/shared/CLucene/LuceneThreads.h
+@@ -7,6 +7,9 @@
+ #ifndef _LuceneThreads_h
+ #define  _LuceneThreads_h
+
++#if defined(_CL_HAVE_PTHREAD)
++	#include <pthread.h>
++#endif
+
+ CL_NS_DEF(util)
+ class CLuceneThreadIdCompare;
+
+--- a/src/shared/CLucene/config/repl_tchar.h
++++ b/src/shared/CLucene/config/repl_tchar.h
+@@ -28,26 +28,26 @@
+         #define _istdigit iswdigit //* digit char check
+         #define _totlower towlower //* convert char to lower case
+         #define _totupper towupper //* convert char to lower case
+-        #define _tcslwr wcslwr //* convert string to lower case
++        #define _tcslwr std::wcslwr //* convert string to lower case
+ 
+         //these are the string handling functions
+         //we may need to create wide-character/multi-byte replacements for these
+-        #define _tcscpy wcscpy //copy a string to another string
+-        #define _tcsncpy wcsncpy //copy a specified amount of one string to another string.
+-        #define _tcscat wcscat //copy a string onto the end of the other string
+-    		#define _tcsncat wcsncat
+-        #define _tcschr wcschr //find location of one character
+-        #define _tcsstr wcsstr //find location of a string
+-        #define _tcslen wcslen //get length of a string
+-        #define _tcscmp wcscmp //case sensitive compare two strings
+-        #define _tcsncmp wcsncmp //case sensitive compare two strings
+-        #define _tcscspn wcscspn //location of any of a set of character in a string
++        #define _tcscpy std::wcscpy //copy a string to another string
++        #define _tcsncpy std::wcsncpy //copy a specified amount of one string to another string.
++        #define _tcscat std::wcscat //copy a string onto the end of the other string
++    		#define _tcsncat std::wcsncat
++        #define _tcschr std::wcschr //find location of one character
++        #define _tcsstr std::wcsstr //find location of a string
++        #define _tcslen std::wcslen //get length of a string
++        #define _tcscmp std::wcscmp //case sensitive compare two strings
++        #define _tcsncmp std::wcsncmp //case sensitive compare two strings
++        #define _tcscspn std::wcscspn //location of any of a set of character in a string
+ 
+ 				//string compare
+         #ifdef _CL_HAVE_FUNCTION_WCSICMP
+-            #define _tcsicmp wcsicmp //* case insensitive compare two string
++            #define _tcsicmp std::wcsicmp //* case insensitive compare two string
+         #else
+-            #define _tcsicmp wcscasecmp //* case insensitive compare two string
++            #define _tcsicmp std::wcscasecmp //* case insensitive compare two string
+         #endif
+ 				#if defined(_CL_HAVE_FUNCTION_WCSDUP)
+ 			  	#define _tcsdup	wcsdup
+@@ -56,8 +56,8 @@
+ 			  #endif
+ 
+         //conversion functions
+-        #define _tcstod wcstod //convert a string to a double
+-        #define _tcstoi64 wcstoll //* convers a string to an 64bit bit integer
++        #define _tcstod std::wcstod //convert a string to a double
++        #define _tcstoi64 std::wcstoll //* convers a string to an 64bit bit integer
+         #define _itot _i64tot
+         #define _i64tot lltow //* converts a 64 bit integer to a string (with base)
+     #else //if defined(_ASCII)
+@@ -105,7 +105,7 @@
+     //some tchar headers miss these...
+     #ifndef _tcstoi64
+         #if defined(_UCS2)
+-        	#define _tcstoi64 wcstoll //* convers a string to an 64bit bit integer
++        	#define _tcstoi64 std::wcstoll //* convers a string to an 64bit bit integer
+         #else
+         	#define _tcstoi64 strtoll
+         #endif
diff --git a/nixpkgs/pkgs/development/libraries/clucene-core/gcc6.patch b/nixpkgs/pkgs/development/libraries/clucene-core/gcc6.patch
new file mode 100644
index 000000000000..f78b26d24f6a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/clucene-core/gcc6.patch
@@ -0,0 +1,146 @@
+https://bugzilla.redhat.com/show_bug.cgi?id=998477
+
+diff -up clucene-core-0.9.21b/src/CLucene/debug/lucenebase.h.gcc48 clucene-core-0.9.21b/src/CLucene/debug/lucenebase.h
+--- clucene-core-0.9.21b/src/CLucene/debug/lucenebase.h.gcc48	2008-10-23 12:44:35.000000000 -0500
++++ clucene-core-0.9.21b/src/CLucene/debug/lucenebase.h	2013-08-27 13:17:35.754234297 -0500
+@@ -58,7 +58,7 @@ public:
+ 		__cl_refcount--;
+ 		return __cl_refcount;
+ 	}
+-    virtual ~LuceneBase(){};
++    virtual ~LuceneBase() throw(CLuceneError&) {};
+ };
+ 
+ class LuceneVoidBase{
+diff -up clucene-core-0.9.21b/src/CLucene/index/CompoundFile.cpp.gcc48 clucene-core-0.9.21b/src/CLucene/index/CompoundFile.cpp
+--- clucene-core-0.9.21b/src/CLucene/index/CompoundFile.cpp.gcc48	2013-08-27 13:17:35.754234297 -0500
++++ clucene-core-0.9.21b/src/CLucene/index/CompoundFile.cpp	2013-08-27 13:18:02.844949386 -0500
+@@ -94,7 +94,7 @@ CompoundFileReader::CompoundFileReader(D
+    )
+ }
+ 
+-CompoundFileReader::~CompoundFileReader(){
++CompoundFileReader::~CompoundFileReader() throw(CLuceneError&) {
+ 	close();
+ }
+ 
+diff -up clucene-core-0.9.21b/src/CLucene/index/CompoundFile.h.gcc48 clucene-core-0.9.21b/src/CLucene/index/CompoundFile.h
+--- clucene-core-0.9.21b/src/CLucene/index/CompoundFile.h.gcc48	2008-10-23 12:44:37.000000000 -0500
++++ clucene-core-0.9.21b/src/CLucene/index/CompoundFile.h	2013-08-27 13:17:35.755234286 -0500
+@@ -95,7 +95,7 @@ protected:
+ 
+ public:
+ 	CompoundFileReader(CL_NS(store)::Directory* dir, char* name);
+-	~CompoundFileReader();
++	~CompoundFileReader() throw(CLuceneError&);
+ 	CL_NS(store)::Directory* getDirectory();
+ 	const char* getName() const;
+ 
+diff -up clucene-core-0.9.21b/src/CLucene/index/Term.cpp.gcc48 clucene-core-0.9.21b/src/CLucene/index/Term.cpp
+--- clucene-core-0.9.21b/src/CLucene/index/Term.cpp.gcc48	2008-10-23 12:44:37.000000000 -0500
++++ clucene-core-0.9.21b/src/CLucene/index/Term.cpp	2013-08-27 13:17:35.755234286 -0500
+@@ -81,7 +81,7 @@ Term::Term(const TCHAR* fld, const TCHAR
+     set(fld,txt);
+ }
+ 
+-Term::~Term(){
++Term::~Term() throw (CLuceneError&) {
+ //Func - Destructor.
+ //Pre  - true
+ //Post - The instance has been destroyed. field and text have been deleted if pre(intrn) is false
+diff -up clucene-core-0.9.21b/src/CLucene/index/Term.h.gcc48 clucene-core-0.9.21b/src/CLucene/index/Term.h
+--- clucene-core-0.9.21b/src/CLucene/index/Term.h.gcc48	2008-10-23 12:44:37.000000000 -0500
++++ clucene-core-0.9.21b/src/CLucene/index/Term.h	2013-08-27 13:17:35.755234286 -0500
+@@ -68,7 +68,7 @@ class Term:LUCENE_REFBASE {
+ 	Term(const TCHAR* fld, const TCHAR* txt);
+ 	
+ 	///Destructor.
+-	~Term();
++	~Term() throw(CLuceneError&);
+ 
+ 	///Returns the field of this term, an interned string. The field indicates
+ 	///the part of a document which this term came from. 
+diff -up clucene-core-0.9.21b/src/CLucene/store/Directory.h.gcc48 clucene-core-0.9.21b/src/CLucene/store/Directory.h
+--- clucene-core-0.9.21b/src/CLucene/store/Directory.h.gcc48	2008-10-23 12:44:36.000000000 -0500
++++ clucene-core-0.9.21b/src/CLucene/store/Directory.h	2013-08-27 13:17:35.756234276 -0500
+@@ -41,7 +41,7 @@ CL_NS_DEF(store)
+ 	public:
+ 		DEFINE_MUTEX(THIS_LOCK)
+ 	   
+-		virtual ~Directory(){ };
++		virtual ~Directory() throw(CLuceneError&) { };
+ 
+ 		// Returns an null terminated array of strings, one for each file in the directory. 
+ 		char** list() const{
+diff -up clucene-core-0.9.21b/src/CLucene/store/FSDirectory.cpp.gcc48 clucene-core-0.9.21b/src/CLucene/store/FSDirectory.cpp
+--- clucene-core-0.9.21b/src/CLucene/store/FSDirectory.cpp.gcc48	2008-10-23 13:01:52.000000000 -0500
++++ clucene-core-0.9.21b/src/CLucene/store/FSDirectory.cpp	2013-08-27 13:17:35.756234276 -0500
+@@ -368,7 +368,7 @@ void FSDirectory::FSIndexInput::readInte
+       strcat(buffer,name);
+   }
+ 
+-  FSDirectory::~FSDirectory(){
++  FSDirectory::~FSDirectory() throw(CLuceneError&) {
+   }
+ 
+   void FSDirectory::list(vector<string>* names) const{ //todo: fix this, ugly!!!
+diff -up clucene-core-0.9.21b/src/CLucene/store/FSDirectory.h.gcc48 clucene-core-0.9.21b/src/CLucene/store/FSDirectory.h
+--- clucene-core-0.9.21b/src/CLucene/store/FSDirectory.h.gcc48	2008-10-23 13:00:43.000000000 -0500
++++ clucene-core-0.9.21b/src/CLucene/store/FSDirectory.h	2013-08-27 13:17:35.756234276 -0500
+@@ -155,7 +155,7 @@
+ 	  ///Destructor - only call this if you are sure the directory
+ 	  ///is not being used anymore. Otherwise use the ref-counting
+ 	  ///facilities of _CLDECDELETE
+-		~FSDirectory();
++		~FSDirectory() throw(CLuceneError&);
+ 
+ 		/// Get a list of strings, one for each file in the directory. 
+ 		void list(vector<string>* names) const;
+diff -up clucene-core-0.9.21b/src/CLucene/store/RAMDirectory.cpp.gcc48 clucene-core-0.9.21b/src/CLucene/store/RAMDirectory.cpp
+--- clucene-core-0.9.21b/src/CLucene/store/RAMDirectory.cpp.gcc48	2008-10-23 12:44:36.000000000 -0500
++++ clucene-core-0.9.21b/src/CLucene/store/RAMDirectory.cpp	2013-08-27 13:17:35.757234265 -0500
+@@ -219,7 +219,7 @@ CL_NS_DEF(store)
+   {
+   }
+   
+-  RAMDirectory::~RAMDirectory(){
++  RAMDirectory::~RAMDirectory() throw(CLuceneError&) {
+    //todo: should call close directory?
+   }
+ 
+diff -up clucene-core-0.9.21b/src/CLucene/store/RAMDirectory.h.gcc48 clucene-core-0.9.21b/src/CLucene/store/RAMDirectory.h
+--- clucene-core-0.9.21b/src/CLucene/store/RAMDirectory.h.gcc48	2008-10-23 12:44:36.000000000 -0500
++++ clucene-core-0.9.21b/src/CLucene/store/RAMDirectory.h	2013-08-27 13:17:35.757234265 -0500
+@@ -131,7 +131,7 @@ CL_NS_DEF(store)
+ 	  ///Destructor - only call this if you are sure the directory
+ 	  ///is not being used anymore. Otherwise use the ref-counting
+ 	  ///facilities of dir->close
+-		virtual ~RAMDirectory();
++		virtual ~RAMDirectory() throw(CLuceneError&);
+ 		RAMDirectory(Directory* dir);
+ 		
+ 	  /**
+diff -up clucene-core-0.9.21b/src/CLucene/store/TransactionalRAMDirectory.cpp.gcc48 clucene-core-0.9.21b/src/CLucene/store/TransactionalRAMDirectory.cpp
+--- clucene-core-0.9.21b/src/CLucene/store/TransactionalRAMDirectory.cpp.gcc48	2008-10-23 12:44:36.000000000 -0500
++++ clucene-core-0.9.21b/src/CLucene/store/TransactionalRAMDirectory.cpp	2013-08-27 13:17:35.757234265 -0500
+@@ -16,7 +16,7 @@ CL_NS_USE(util)
+   {
+     transOpen = false;
+   }
+-  TransactionalRAMDirectory::~TransactionalRAMDirectory(){
++  TransactionalRAMDirectory::~TransactionalRAMDirectory() throw(CLuceneError&) {
+   }
+ 
+   bool TransactionalRAMDirectory::archiveOrigFileIfNecessary(const char* name) {
+diff -up clucene-core-0.9.21b/src/CLucene/store/TransactionalRAMDirectory.h.gcc48 clucene-core-0.9.21b/src/CLucene/store/TransactionalRAMDirectory.h
+--- clucene-core-0.9.21b/src/CLucene/store/TransactionalRAMDirectory.h.gcc48	2008-10-23 12:44:36.000000000 -0500
++++ clucene-core-0.9.21b/src/CLucene/store/TransactionalRAMDirectory.h	2013-08-27 13:17:35.757234265 -0500
+@@ -44,7 +44,7 @@ CL_NS_DEF(store)
+ 
+   public:
+     TransactionalRAMDirectory();
+-    virtual ~TransactionalRAMDirectory();
++    virtual ~TransactionalRAMDirectory() throw(CLuceneError&);
+ 
+     bool transIsOpen() const;
+     void transStart();
diff --git a/nixpkgs/pkgs/development/libraries/clutter-gst/default.nix b/nixpkgs/pkgs/development/libraries/clutter-gst/default.nix
new file mode 100644
index 000000000000..e4752c7748be
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/clutter-gst/default.nix
@@ -0,0 +1,36 @@
+{ fetchurl, lib, stdenv, pkg-config, clutter, gtk3, glib, cogl, gnome, gdk-pixbuf }:
+
+stdenv.mkDerivation rec {
+  pname = "clutter-gst";
+  version = "3.0.27";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "17czmpl92dzi4h3rn5rishk015yi3jwiw29zv8qan94xcmnbssgy";
+  };
+
+  propagatedBuildInputs = [ clutter gtk3 glib cogl gdk-pixbuf ];
+  nativeBuildInputs = [ pkg-config ];
+
+  postBuild = "rm -rf $out/share/gtk-doc";
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = {
+    description = "GStreamer bindings for clutter";
+
+    homepage = "http://www.clutter-project.org/";
+
+    license = lib.licenses.lgpl2Plus;
+
+    maintainers = with lib.maintainers; [ ];
+    platforms = lib.platforms.gnu ++ lib.platforms.linux;  # arbitrary choice
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/clutter-gtk/default.nix b/nixpkgs/pkgs/development/libraries/clutter-gtk/default.nix
new file mode 100644
index 000000000000..7573da66c0d8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/clutter-gtk/default.nix
@@ -0,0 +1,38 @@
+{ fetchurl, lib, stdenv, pkg-config, meson, ninja
+, gobject-introspection, clutter, gtk3, gnome }:
+
+let
+  pname = "clutter-gtk";
+  version = "1.8.4";
+in
+
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz";
+    sha256 = "01ibniy4ich0fgpam53q252idm7f4fn5xg5qvizcfww90gn9652j";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  propagatedBuildInputs = [ clutter gtk3 ];
+  nativeBuildInputs = [ meson ninja pkg-config gobject-introspection ];
+
+  postBuild = "rm -rf $out/share/gtk-doc";
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = {
+    description = "Clutter-GTK";
+    homepage = "http://www.clutter-project.org/";
+    license = lib.licenses.lgpl2Plus;
+    maintainers = with lib.maintainers; [ ];
+    platforms = lib.platforms.gnu ++ lib.platforms.linux;  # arbitrary choice
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/clutter/default.nix b/nixpkgs/pkgs/development/libraries/clutter/default.nix
new file mode 100644
index 000000000000..aacb8581c8fc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/clutter/default.nix
@@ -0,0 +1,62 @@
+{ lib, stdenv, fetchurl, pkg-config, libGLU, libGL, libX11, libXext, libXfixes
+, libXdamage, libXcomposite, libXi, libxcb, cogl, pango, atk, json-glib
+, gobject-introspection, gtk3, gnome, libinput, libgudev, libxkbcommon
+}:
+
+let
+  pname = "clutter";
+  version = "1.26.4";
+in
+stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz";
+    sha256 = "1rn4cd1an6a9dfda884aqpcwcgq8dgydpqvb19nmagw4b70zlj4b";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  buildInputs = [ gtk3 ];
+  nativeBuildInputs = [ pkg-config ];
+  propagatedBuildInputs =
+    [ libX11 libGL libGLU libXext libXfixes libXdamage libXcomposite libXi cogl pango
+      atk json-glib gobject-introspection libxcb libinput libgudev libxkbcommon
+    ];
+
+  configureFlags = [ "--enable-introspection" ]; # needed by muffin AFAIK
+
+  #doCheck = true; # no tests possible without a display
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = {
+    description = "Library for creating fast, dynamic graphical user interfaces";
+
+    longDescription =
+      '' Clutter is free software library for creating fast, compelling,
+         portable, and dynamic graphical user interfaces.  It is a core part
+         of MeeGo, and is supported by the open source community.  Its
+         development is sponsored by Intel.
+
+         Clutter uses OpenGL for rendering (and optionally OpenGL|ES for use
+         on mobile and embedded platforms), but wraps an easy to use,
+         efficient, flexible API around GL's complexity.
+
+         Clutter enforces no particular user interface style, but provides a
+         rich, generic foundation for higher-level toolkits tailored to
+         specific needs.
+      '';
+
+    license = lib.licenses.lgpl2Plus;
+    homepage = "http://www.clutter-project.org/";
+
+    maintainers = with lib.maintainers; [ ];
+    platforms = lib.platforms.mesaPlatforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cm256cc/default.nix b/nixpkgs/pkgs/development/libraries/cm256cc/default.nix
new file mode 100644
index 000000000000..09b0ffba98ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cm256cc/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, cmake, boost } :
+
+stdenv.mkDerivation rec {
+  pname = "cm256cc";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "f4exb";
+    repo = "cm256cc";
+    rev = "v${version}";
+    sha256 = "sha256-T7ZUVVYGdzAialse//MoqWCVNBpbZvzWMAKc0cw7O9k=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost ];
+
+  meta = with lib; {
+    description = "Fast GF(256) Cauchy MDS Block Erasure Codec in C++";
+    homepage = "https://github.com/f4exb/cm256cc";
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ alkeryn ];
+    license = licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cmark-gfm/default.nix b/nixpkgs/pkgs/development/libraries/cmark-gfm/default.nix
new file mode 100644
index 000000000000..8a9534365f4e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cmark-gfm/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+stdenv.mkDerivation rec {
+  pname = "cmark-gfm";
+  version = "0.29.0.gfm.0";
+
+  src = fetchFromGitHub {
+    owner = "github";
+    repo = "cmark-gfm";
+    rev = version;
+    sha256 = "0wfr3xwl4wria8vld71flv6vpsdj9aj81yqvj0azidyb8p229a1l";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  # tests load the library dynamically which for unknown reason failed
+  doCheck = false;
+
+  meta = with lib; {
+    description = "GitHub's fork of cmark, a CommonMark parsing and rendering library and program in C";
+    homepage = "https://github.com/github/cmark-gfm";
+    maintainers = with maintainers; [ cyplo ];
+    platforms = platforms.unix;
+    license = licenses.bsd2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cmark/default.nix b/nixpkgs/pkgs/development/libraries/cmark/default.nix
new file mode 100644
index 000000000000..d78db53ea4b5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cmark/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "cmark";
+  version = "0.30.1";
+
+  src = fetchFromGitHub {
+    owner = "jgm";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-UjDM2N6gCwO94F1nW3qCP9JX42MYAicAuGTKAXMy1Gg=";
+  };
+
+  patches = [
+    # Fix libcmark.pc paths (should be incorporated next release)
+    (fetchpatch {
+      url = "https://github.com/commonmark/cmark/commit/15762d7d391483859c241cdf82b1615c6b6a5a19.patch";
+      sha256 = "sha256-wdyK1tQolgfiwYMAaWMQZdCSbMDCijug5ykpoDl/HwI=";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    # https://github.com/commonmark/cmark/releases/tag/0.30.1
+    # recommends distributions dynamically link
+    "-DCMARK_STATIC=OFF"
+  ];
+
+  doCheck = true;
+
+  preCheck = let
+    lib_path = if stdenv.isDarwin then "DYLD_FALLBACK_LIBRARY_PATH" else "LD_LIBRARY_PATH";
+  in ''
+    export ${lib_path}=$(readlink -f ./src)
+  '';
+
+  meta = with lib; {
+    description = "CommonMark parsing and rendering library and program in C";
+    homepage = "https://github.com/jgm/cmark";
+    maintainers = [ maintainers.michelk ];
+    platforms = platforms.unix;
+    license = licenses.bsd2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cminpack/default.nix b/nixpkgs/pkgs/development/libraries/cminpack/default.nix
new file mode 100644
index 000000000000..10d068604369
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cminpack/default.nix
@@ -0,0 +1,30 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  name = "cminpack-1.3.6";
+
+  src = fetchurl {
+    url = "http://devernay.free.fr/hacks/cminpack/${name}.tar.gz";
+    sha256 = "17yh695aim508x1kn9zf6g13jxwk3pi3404h5ix4g5lc60hzs1rw";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace '/usr/local' '${placeholder "out"}' \
+      --replace 'gcc' '${stdenv.cc.targetPrefix}cc' \
+      --replace 'ranlib -t' '${stdenv.cc.targetPrefix}ranlib' \
+      --replace 'ranlib' '${stdenv.cc.targetPrefix}ranlib'
+  '';
+
+  preInstall = ''
+    mkdir -p $out/lib $out/include
+  '';
+
+  meta = {
+    homepage = "http://devernay.free.fr/hacks/cminpack/cminpack.html";
+    license = lib.licenses.bsd3;
+    description = "Software for solving nonlinear equations and nonlinear least squares problems";
+    platforms = lib.platforms.all;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/cmocka/default.nix b/nixpkgs/pkgs/development/libraries/cmocka/default.nix
new file mode 100644
index 000000000000..9bfbc410c007
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cmocka/default.nix
@@ -0,0 +1,49 @@
+{ fetchurl, lib, stdenv, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "cmocka";
+  majorVersion = "1.1";
+  version = "${majorVersion}.5";
+
+  src = fetchurl {
+    url = "https://cmocka.org/files/${majorVersion}/cmocka-${version}.tar.xz";
+    sha256 = "1dm8pdvkyfa8dsbz9bpq7wwgixjij4sii9bbn5sgvqjm5ljdik7h";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Lightweight library to simplify and generalize unit tests for C";
+
+    longDescription =
+      ''There are a variety of C unit testing frameworks available however
+        many of them are fairly complex and require the latest compiler
+        technology.  Some development requires the use of old compilers which
+        makes it difficult to use some unit testing frameworks. In addition
+        many unit testing frameworks assume the code being tested is an
+        application or module that is targeted to the same platform that will
+        ultimately execute the test.  Because of this assumption many
+        frameworks require the inclusion of standard C library headers in the
+        code module being tested which may collide with the custom or
+        incomplete implementation of the C library utilized by the code under
+        test.
+
+        Cmocka only requires a test application is linked with the standard C
+        library which minimizes conflicts with standard C library headers.
+        Also, CMocka tries to avoid the use of some of the newer features of
+        C compilers.
+
+        This results in CMocka being a relatively small library that can be
+        used to test a variety of exotic code. If a developer wishes to
+        simply test an application with the latest compiler then other unit
+        testing frameworks may be preferable.
+
+        This is the successor of Google's Cmockery.'';
+
+    homepage = "https://cmocka.org/";
+
+    license = licenses.asl20;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ kragniz rasendubi ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cmrt/default.nix b/nixpkgs/pkgs/development/libraries/cmrt/default.nix
new file mode 100644
index 000000000000..43d73ba200ce
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cmrt/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, libdrm, libva }:
+
+stdenv.mkDerivation rec {
+  pname = "cmrt";
+  version = "1.0.6";
+
+  src = fetchurl {
+    url = "https://github.com/intel/cmrt/archive/${version}.tar.gz";
+    sha256 = "1q7651nvvcqhph5rgfhklm71zqd0c405mrh3wx0cfzvil82yj8na";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  buildInputs = [ libdrm libva ];
+
+  meta = with lib; {
+    homepage = "https://01.org/linuxmedia";
+    description = "Intel C for Media Runtime";
+    longDescription = "Media GPU kernel manager for Intel G45 & HD Graphics family";
+    license = licenses.mit;
+    maintainers = with maintainers; [ tadfisher ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/codec2/default.nix b/nixpkgs/pkgs/development/libraries/codec2/default.nix
new file mode 100644
index 000000000000..a860470af317
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/codec2/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "codec2";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "drowe67";
+    repo = "codec2";
+    rev = "v${version}";
+    sha256 = "sha256-R4H6gwmc8nPgRfhNms7n7jMCHhkzX7i/zfGT4CYSsY8=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Speech codec designed for communications quality speech at low data rates";
+    homepage = "http://www.rowetel.com/blog/?page_id=452";
+    license = licenses.lgpl21Only;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ markuskowa ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cogl/default.nix b/nixpkgs/pkgs/development/libraries/cogl/default.nix
new file mode 100644
index 000000000000..75ec2a2acc7f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cogl/default.nix
@@ -0,0 +1,82 @@
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, libGL, glib, gdk-pixbuf, xorg, libintl
+, pangoSupport ? true, pango, cairo, gobject-introspection, wayland, gnome
+, mesa, automake, autoconf
+, gstreamerSupport ? true, gst_all_1 }:
+
+let
+  pname = "cogl";
+in stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+  version = "1.22.8";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz";
+    sha256 = "0nfph4ai60ncdx7hy6hl1i1cmp761jgnyjfhagzi0iqq36qb41d8";
+  };
+
+  patches = [
+    # Some deepin packages need the following patches. They have been
+    # submitted by Fedora on the GNOME Bugzilla
+    # (https://bugzilla.gnome.org/787443). Upstream thinks the patch
+    # could be merged, but dev can not make a new release.
+
+    (fetchpatch {
+      url = "https://bug787443.bugzilla-attachments.gnome.org/attachment.cgi?id=359589";
+      sha256 = "0f0d9iddg8zwy853phh7swikg4yzhxxv71fcag36f8gis0j5p998";
+    })
+
+    (fetchpatch {
+      url = "https://bug787443.bugzilla-attachments.gnome.org/attachment.cgi?id=361056";
+      sha256 = "09fyrdci4727fg6qm5aaapsbv71sf4wgfaqz8jqlyy61dibgg490";
+    })
+  ];
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ pkg-config libintl automake autoconf ];
+
+  configureFlags = [
+    "--enable-introspection"
+    "--enable-kms-egl-platform"
+    "--enable-wayland-egl-platform"
+    "--enable-wayland-egl-server"
+  ] ++ lib.optional gstreamerSupport "--enable-cogl-gst"
+  ++ lib.optionals (!stdenv.isDarwin) [ "--enable-gles1" "--enable-gles2" ];
+
+  propagatedBuildInputs = with xorg; [
+      glib gdk-pixbuf gobject-introspection wayland mesa
+      libGL libXrandr libXfixes libXcomposite libXdamage
+    ]
+    ++ lib.optionals gstreamerSupport [ gst_all_1.gstreamer
+                                               gst_all_1.gst-plugins-base ];
+
+  buildInputs = lib.optionals pangoSupport [ pango cairo ];
+
+  COGL_PANGO_DEP_CFLAGS
+    = lib.optionalString (stdenv.isDarwin && pangoSupport)
+      "-I${pango.dev}/include/pango-1.0 -I${cairo.dev}/include/cairo";
+
+  #doCheck = true; # all tests fail (no idea why)
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "A small open source library for using 3D graphics hardware for rendering";
+    maintainers = with maintainers; [ lovek323 ];
+
+    longDescription = ''
+      Cogl is a small open source library for using 3D graphics hardware for
+      rendering. The API departs from the flat state machine style of OpenGL
+      and is designed to make it easy to write orthogonal components that can
+      render without stepping on each other's toes.
+    '';
+
+    platforms = platforms.mesaPlatforms;
+    license = with licenses; [ mit bsd3 publicDomain sgi-b-20 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/coin3d/default.nix b/nixpkgs/pkgs/development/libraries/coin3d/default.nix
new file mode 100644
index 000000000000..3fe78e6d02e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/coin3d/default.nix
@@ -0,0 +1,29 @@
+{ fetchFromGitHub, lib, stdenv, boost, cmake, libX11, libGL, libGLU }:
+
+stdenv.mkDerivation rec {
+  pname = "coin";
+  version = "2020-12-07-unstable";
+
+  src = fetchFromGitHub {
+    owner = "coin3d";
+    repo = "coin";
+    # rev = "Coin-${version}";
+    rev = "d5539998aff272b349590fe74d068659682ecd0d";
+    sha256 = "11jaz8p9nn8jpd6dsgwgkldwr7z829gyf64g014qyyh8l6p7jzzd";
+  };
+
+  postPatch = ''
+    sed -i /cpack.d/d CMakeLists.txt
+  '';
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost libX11 libGL libGLU ];
+
+  meta = with lib; {
+    homepage = "https://github.com/coin3d/coin";
+    license = licenses.bsd3;
+    description = "High-level, retained-mode toolkit for effective 3D graphics development";
+    maintainers = with maintainers; [ gebner viric ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/comedilib/default.nix b/nixpkgs/pkgs/development/libraries/comedilib/default.nix
new file mode 100644
index 000000000000..d59f4acd8dcc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/comedilib/default.nix
@@ -0,0 +1,56 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, autoreconfHook
+, flex
+, bison
+, xmlto
+, docbook_xsl
+, docbook_xml_dtd_44
+, swig
+, perl
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "comedilib";
+  version = "0.12.0";
+
+  src = fetchFromGitHub {
+    owner = "Linux-Comedi";
+    repo = "comedilib";
+    rev = "r${lib.replaceStrings [ "." ] [ "_" ] version}";
+    sha256 = "0kfs2dw62vjz8j7fgsxq6ky8r8kca726gyklbm6kljvgfh47lyfw";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    flex
+    bison
+    swig
+    xmlto
+    docbook_xml_dtd_44
+    docbook_xsl
+    python3
+    perl
+  ];
+
+  preConfigure = ''
+    patchShebangs --build doc/mkref doc/mkdr perl/Comedi.pm
+  '';
+
+  configureFlags = [
+    "--with-udev-hotplug=${placeholder "out"}/lib"
+    "--sysconfdir=${placeholder "out"}/etc"
+  ];
+
+  outputs = [ "out" "dev" "man" "doc" ];
+
+  meta = with lib; {
+    description = "The Linux Control and Measurement Device Interface Library";
+    homepage = "https://github.com/Linux-Comedi/comedilib";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.doronbehar ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/console-bridge/default.nix b/nixpkgs/pkgs/development/libraries/console-bridge/default.nix
new file mode 100644
index 000000000000..e2370ecce647
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/console-bridge/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, cmake, validatePkgConfig }:
+
+stdenv.mkDerivation rec {
+  pname = "console-bridge";
+  version = "1.0.1";
+
+  src = fetchFromGitHub {
+    owner = "ros";
+    repo = "console_bridge";
+    rev = version;
+    sha256 = "18qycrjnf7v8n5bipij91jsv7ap98z5dsp93w2gz9rah4lfjb80q";
+  };
+
+  nativeBuildInputs = [ cmake validatePkgConfig ];
+
+  meta = with lib; {
+    description = "A ROS-independent package for logging that seamlessly pipes into rosconsole/rosout for ROS-dependent packages";
+    homepage = "https://github.com/ros/console_bridge";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ lopsided98 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/coordgenlibs/default.nix b/nixpkgs/pkgs/development/libraries/coordgenlibs/default.nix
new file mode 100644
index 000000000000..9dcfb79f3e3b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/coordgenlibs/default.nix
@@ -0,0 +1,29 @@
+{ fetchFromGitHub
+, lib
+, stdenv
+, boost
+, zlib
+, cmake
+, maeparser
+}:
+
+stdenv.mkDerivation rec {
+  pname = "coordgenlibs";
+  version = "2.0.3";
+
+  src = fetchFromGitHub {
+    owner = "schrodinger";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-uperQnJ1Q+s15pAlg/f4XR5VJI484ygZ0F6pMvcVDv8=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost zlib maeparser ];
+
+  meta = with lib; {
+    description = "Schrodinger-developed 2D Coordinate Generation";
+    maintainers = [ maintainers.rmcgibbo ];
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cosmopolitan/default.nix b/nixpkgs/pkgs/development/libraries/cosmopolitan/default.nix
new file mode 100644
index 000000000000..629e5465a044
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cosmopolitan/default.nix
@@ -0,0 +1,80 @@
+{ lib, gcc9Stdenv, fetchFromGitHub, runCommand, cosmopolitan }:
+
+gcc9Stdenv.mkDerivation rec {
+  pname = "cosmopolitan";
+  version = "0.3";
+
+  src = fetchFromGitHub {
+    owner = "jart";
+    repo = "cosmopolitan";
+    rev = version;
+    sha256 = "sha256-OVdOObO82W6JN63OWKHaERS7y0uvgxt+WLp6Y0LsmJk=";
+  };
+
+  postPatch = ''
+    patchShebangs build/
+    rm -r third_party/gcc
+  '';
+
+  dontConfigure = true;
+  dontFixup = true;
+  enableParallelBuilding = true;
+
+  preBuild = ''
+    makeFlagsArray=(
+      SHELL=/bin/sh
+      AS=${gcc9Stdenv.cc.targetPrefix}as
+      CC=${gcc9Stdenv.cc.targetPrefix}gcc
+      GCC=${gcc9Stdenv.cc.targetPrefix}gcc
+      CXX=${gcc9Stdenv.cc.targetPrefix}g++
+      LD=${gcc9Stdenv.cc.targetPrefix}ld
+      OBJCOPY=${gcc9Stdenv.cc.targetPrefix}objcopy
+      "MKDIR=mkdir -p"
+      )
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/{bin,lib/include}
+    install o/cosmopolitan.h $out/lib/include
+    install o/cosmopolitan.a o/libc/crt/crt.o o/ape/ape.{o,lds} $out/lib
+    cat > $out/bin/cosmoc <<EOF
+    #!${gcc9Stdenv.shell}
+    exec ${gcc9Stdenv.cc}/bin/${gcc9Stdenv.cc.targetPrefix}gcc \
+      -O -static -nostdlib -nostdinc -fno-pie -no-pie -mno-red-zone \
+      "\$@" \
+      -Wl,--oformat=binary -Wl,--gc-sections -Wl,-z,max-page-size=0x1000 \
+      -fuse-ld=bfd -Wl,-T,$out/lib/ape.lds \
+      -include $out/lib/{include/cosmopolitan.h,crt.o,ape.o,cosmopolitan.a}
+    EOF
+    chmod +x $out/bin/cosmoc
+    runHook postInstall
+  '';
+
+  passthru.tests = lib.optional (gcc9Stdenv.buildPlatform == gcc9Stdenv.hostPlatform) {
+    hello = runCommand "hello-world" { } ''
+      printf 'main() { printf("hello world\\n"); }\n' >hello.c
+      ${gcc9Stdenv.cc}/bin/gcc -g -O -static -nostdlib -nostdinc -fno-pie -no-pie -mno-red-zone -o hello.com.dbg hello.c \
+        -fuse-ld=bfd -Wl,-T,${cosmopolitan}/lib/ape.lds \
+        -include ${cosmopolitan}/lib/{include/cosmopolitan.h,crt.o,ape.o,cosmopolitan.a}
+      ${gcc9Stdenv.cc.bintools.bintools_bin}/bin/objcopy -S -O binary hello.com.dbg hello.com
+      ./hello.com
+      printf "test successful" > $out
+    '';
+    cosmoc = runCommand "cosmoc-hello" { } ''
+      printf 'main() { printf("hello world\\n"); }\n' >hello.c
+      ${cosmopolitan}/bin/cosmoc hello.c
+      ./a.out
+      printf "test successful" > $out
+    '';
+  };
+
+  meta = with lib; {
+    homepage = "https://justine.lol/cosmopolitan/";
+    description = "Your build-once run-anywhere c library";
+    platforms = platforms.x86_64;
+    badPlatforms = platforms.darwin;
+    license = licenses.isc;
+    maintainers = with maintainers; [ lourkeur tomberek ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cpp-hocon/default.nix b/nixpkgs/pkgs/development/libraries/cpp-hocon/default.nix
new file mode 100644
index 000000000000..dfe7f7776703
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cpp-hocon/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, cmake, boost, curl, leatherman }:
+
+stdenv.mkDerivation rec {
+  pname = "cpp-hocon";
+  version = "0.3.0";
+
+  src = fetchFromGitHub {
+    sha256 = "0b24anpwkmvbsn5klnr58vxksw00ci9pjhwzx7a61kplyhsaiydw";
+    rev = version;
+    repo = "cpp-hocon";
+    owner = "puppetlabs";
+  };
+
+  NIX_CFLAGS_COMPILE = "-Wno-error";
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ boost curl leatherman ];
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "A C++ port of the Typesafe Config library";
+    license = licenses.asl20;
+    maintainers = [ maintainers.womfoo ];
+    platforms = platforms.unix;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/cpp-ipfs-api/default.nix b/nixpkgs/pkgs/development/libraries/cpp-ipfs-api/default.nix
new file mode 100644
index 000000000000..839ddb9b76fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cpp-ipfs-api/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, curl, cmake, nlohmann_json }:
+
+stdenv.mkDerivation {
+  pname = "cpp-ipfs-api";
+  version = "2017-01-04";
+
+  src = fetchFromGitHub {
+    owner = "vasild";
+    repo = "cpp-ipfs-api";
+    rev = "96a890f4518665a56581a2a52311eaa65928eac8";
+    sha256 = "1z6gbd7npg4pd9wmdyzcp9h12sg84d7a43c69pp4lzqkyqg8pz1g";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ curl ];
+  propagatedBuildInputs = [ nlohmann_json ];
+
+  meta = with lib; {
+    description = "IPFS C++ API client library";
+    homepage = "https://github.com/vasild/cpp-ipfs-api";
+    license = licenses.mit;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cpp-netlib/default.nix b/nixpkgs/pkgs/development/libraries/cpp-netlib/default.nix
new file mode 100644
index 000000000000..6085a3c849cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cpp-netlib/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, cmake, boost, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "cpp-netlib";
+  version = "0.13.0-final";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "${pname}-${version}";
+    sha256 = "18782sz7aggsl66b4mmi1i0ijwa76iww337fi9sygnplz2hs03a3";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost openssl ];
+
+  cmakeFlags = [
+    "-DCPP-NETLIB_BUILD_SHARED_LIBS=ON"
+  ];
+
+  # The test driver binary lacks an RPath to the library's libs
+  preCheck = ''
+    export LD_LIBRARY_PATH=$PWD/libs/network/src
+  '';
+
+  # Most tests make network GET requests to various websites
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Collection of open-source libraries for high level network programming";
+    homepage    = "https://cpp-netlib.org";
+    license     = licenses.boost;
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cpp-utilities/default.nix b/nixpkgs/pkgs/development/libraries/cpp-utilities/default.nix
new file mode 100644
index 000000000000..769f573f7afd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cpp-utilities/default.nix
@@ -0,0 +1,36 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, cmake
+, cppunit
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cpp-utilities";
+  version = "5.11.0";
+
+  src = fetchFromGitHub {
+    owner = "Martchus";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-ibZ/cj+pDLxUugz5jTc3FcVlytwS+R1RTtISbXe1mq4=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  checkInputs = [ cppunit ];
+  # Otherwise, tests fail since the resulting shared object libc++utilities.so is only available in PWD of the make files
+  preCheck = ''
+    checkFlagsArray+=(
+      "LD_LIBRARY_PATH=$PWD"
+    )
+  '';
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/Martchus/cpp-utilities";
+    description = "Common C++ classes and routines used by @Martchus' applications featuring argument parser, IO and conversion utilities";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ doronbehar ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cppcms/default.nix b/nixpkgs/pkgs/development/libraries/cppcms/default.nix
new file mode 100644
index 000000000000..e0f9ed599123
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cppcms/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, cmake, pcre, zlib, python2, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "cppcms";
+  version = "1.2.1";
+
+  src = fetchurl {
+      url = "mirror://sourceforge/cppcms/${pname}-${version}.tar.bz2";
+      sha256 = "0lmcdjzicmzhnr8pa0q3f5lgapz2cnh9w0dr56i4kj890iqwgzhh";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ pcre zlib python2 openssl ];
+
+  strictDeps = true;
+
+  cmakeFlags = [
+    "--no-warn-unused-cli"
+  ];
+
+  meta = with lib; {
+    homepage = "http://cppcms.com";
+    description = "High Performance C++ Web Framework";
+    platforms = platforms.linux ;
+    license = licenses.lgpl3;
+    maintainers = [ maintainers.juliendehos ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/cppdb/default.nix b/nixpkgs/pkgs/development/libraries/cppdb/default.nix
new file mode 100644
index 000000000000..98c9c7ecac15
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cppdb/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, cmake, sqlite, libmysqlclient, postgresql, unixODBC }:
+
+stdenv.mkDerivation rec {
+  pname = "cppdb";
+  version = "0.3.1";
+
+  src = fetchurl {
+      url = "mirror://sourceforge/cppcms/${pname}-${version}.tar.bz2";
+      sha256 = "0blr1casmxickic84dxzfmn3lm7wrsl4aa2abvpq93rdfddfy3nn";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ sqlite libmysqlclient postgresql unixODBC ];
+
+  cmakeFlags = [ "--no-warn-unused-cli" ];
+  NIX_CFLAGS_COMPILE = "-I${libmysqlclient}/include/mysql -L${libmysqlclient}/lib/mysql";
+
+  meta = with lib; {
+    homepage = "http://cppcms.com/sql/cppdb/";
+    description = "C++ Connectivity library that supports MySQL, PostgreSQL, Sqlite3 databases and generic ODBC drivers";
+    platforms = platforms.linux ;
+    license = licenses.boost;
+    maintainers = [ maintainers.juliendehos ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cpptest/default.nix b/nixpkgs/pkgs/development/libraries/cpptest/default.nix
new file mode 100644
index 000000000000..17bd39003861
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cpptest/default.nix
@@ -0,0 +1,18 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "cpptest-2.0.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/cpptest/cpptest/${name}/${name}.tar.gz";
+    sha256 = "0lpy3f2fjx1srh02myanlp6zfi497whlldcrnij39ghfhm0arcnm";
+  };
+
+  meta = with lib; {
+    homepage = "http://cpptest.sourceforge.net/";
+    description = "Simple C++ unit testing framework";
+    maintainers = with maintainers; [ bosu ];
+    license = lib.licenses.lgpl3;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cppunit/default.nix b/nixpkgs/pkgs/development/libraries/cppunit/default.nix
new file mode 100644
index 000000000000..3cafa1c75d76
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cppunit/default.nix
@@ -0,0 +1,18 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "cppunit";
+  version = "1.15.1";
+
+  src = fetchurl {
+    url = "https://dev-www.libreoffice.org/src/${pname}-${version}.tar.gz";
+    sha256 = "19qpqzy66bq76wcyadmi3zahk5v1ll2kig1nvg96zx9padkcdic9";
+  };
+
+  meta = with lib; {
+    homepage = "https://freedesktop.org/wiki/Software/cppunit/";
+    description = "C++ unit testing framework";
+    license = licenses.lgpl21;
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cpputest/default.nix b/nixpkgs/pkgs/development/libraries/cpputest/default.nix
new file mode 100644
index 000000000000..39bed6025232
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cpputest/default.nix
@@ -0,0 +1,19 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "cpputest";
+  version = "4.0";
+
+  src = fetchurl {
+    url = "https://github.com/cpputest/cpputest/releases/download/v${version}/${pname}-${version}.tar.gz";
+    sha256 = "1xslavlb1974y5xvs8n1j9zkk05dlw8imy4saasrjlmibl895ii1";
+  };
+
+  meta = with lib; {
+    homepage = "https://cpputest.github.io/";
+    description = "Unit testing and mocking framework for C/C++";
+    platforms = platforms.all;
+    license = licenses.bsd3;
+    maintainers = [ maintainers.juliendehos ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cppzmq/default.nix b/nixpkgs/pkgs/development/libraries/cppzmq/default.nix
new file mode 100644
index 000000000000..9237c3bd3071
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cppzmq/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, cmake, zeromq }:
+
+stdenv.mkDerivation rec {
+  pname = "cppzmq";
+  version = "4.7.1";
+
+  src = fetchFromGitHub {
+    owner = "zeromq";
+    repo = "cppzmq";
+    rev = "v${version}";
+    sha256 = "00lb3pv923nbpaf7ric2cv6lbpspknj0pxj6yj5jyah7r3zw692m";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zeromq ];
+
+  cmakeFlags = [
+    # Tests try to download googletest at compile time; there is no option
+    # to use a system one and no simple way to download it beforehand.
+    "-DCPPZMQ_BUILD_TESTS=OFF"
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/zeromq/cppzmq";
+    license = licenses.bsd2;
+    description = "C++ binding for 0MQ";
+    maintainers = with maintainers; [ abbradar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cracklib/default.nix b/nixpkgs/pkgs/development/libraries/cracklib/default.nix
new file mode 100644
index 000000000000..13029f7739c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cracklib/default.nix
@@ -0,0 +1,42 @@
+let version = "2.9.7"; in
+{ stdenv, lib, buildPackages, fetchurl, zlib, gettext
+, wordlists ? [ (fetchurl {
+  url = "https://github.com/cracklib/cracklib/releases/download/v${version}/cracklib-words-${version}.gz";
+  sha256 = "12fk8w06q628v754l357cf8kfjna98wj09qybpqr892az3x4a33z";
+}) ]
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cracklib";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://github.com/${pname}/${pname}/releases/download/v${version}/${pname}-${version}.tar.bz2";
+    sha256 = "1rimpjsdnmw8f5b7k558cic41p2qy2n2yrlqp5vh7mp4162hk0py";
+  };
+
+  nativeBuildInputs = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) buildPackages.cracklib;
+  buildInputs = [ zlib gettext ];
+
+  postPatch = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
+    chmod +x util/cracklib-format
+    patchShebangs util
+
+  '' + ''
+    ln -vs ${toString wordlists} dicts/
+  '';
+
+  postInstall = ''
+    make dict-local
+  '';
+  doInstallCheck = true;
+  installCheckTarget = "test";
+
+  meta = with lib; {
+    homepage    = "https://github.com/cracklib/cracklib";
+    description = "A library for checking the strength of passwords";
+    license = licenses.lgpl21; # Different license for the wordlist: http://www.openwall.com/wordlists
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/crc32c/default.nix b/nixpkgs/pkgs/development/libraries/crc32c/default.nix
new file mode 100644
index 000000000000..bc46e80db9b3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/crc32c/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, lib, fetchFromGitHub, cmake, gflags
+, staticOnly ? stdenv.hostPlatform.isStatic
+}:
+
+stdenv.mkDerivation rec {
+  pname = "crc32c";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "crc32c";
+    rev = version;
+    sha256 = "1sazkis9rzbrklfrvk7jn1mqywnq4yghmzg94mxd153h8b1sb149";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ gflags ];
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isAarch64 "-march=armv8-a+crc";
+  cmakeFlags = lib.optionals (!staticOnly) [ "-DBUILD_SHARED_LIBS=1"  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/google/crc32c";
+    description = "CRC32C implementation with support for CPU-specific acceleration instructions";
+    license = with licenses; [ bsd3 ];
+    maintainers = with maintainers; [ andir ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/crcpp/default.nix b/nixpkgs/pkgs/development/libraries/crcpp/default.nix
new file mode 100644
index 000000000000..3b9f4f942acf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/crcpp/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv
+, fetchFromGitHub
+}:
+
+stdenv.mkDerivation rec {
+  pname = "crcpp";
+  version = "1.1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "d-bahr";
+    repo = "CRCpp";
+    rev = "release-${version}";
+    sha256 = "sha256-jBvh4dHSFChxNPVgkGVHy3TXSExsfwdVUfsA8XB1cn8=";
+  };
+
+  dontBuild = true;
+
+  installPhase = ''
+    mkdir -p $out/include
+    cp inc/CRC.h $out/include
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/d-bahr/CRCpp";
+    description = "Easy to use and fast C++ CRC library";
+    platforms = platforms.all;
+    maintainers = [ maintainers.ivar ];
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cre2/default.nix b/nixpkgs/pkgs/development/libraries/cre2/default.nix
new file mode 100644
index 000000000000..d85843a54f7c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cre2/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook,
+  libtool, pkg-config, re2, texinfo }:
+
+stdenv.mkDerivation rec {
+  pname = "cre2";
+  version = "0.3.6";
+
+  src = fetchFromGitHub {
+    owner = "marcomaggi";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1h9jwn6z8kjf4agla85b5xf7gfkdwncp0mfd8zwk98jkm8y2qx9q";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    libtool
+    pkg-config
+  ];
+  buildInputs = [ re2 texinfo ];
+
+  NIX_LDFLAGS="-lre2 -lpthread";
+
+  configureFlags = [
+    "--enable-maintainer-mode"
+  ];
+
+  meta = with lib; {
+    homepage = "http://marcomaggi.github.io/docs/cre2.html";
+    description = "C Wrapper for RE2";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/criterion/default.nix b/nixpkgs/pkgs/development/libraries/criterion/default.nix
new file mode 100644
index 000000000000..ba436fec0a26
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/criterion/default.nix
@@ -0,0 +1,47 @@
+{ lib, 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;
+  };
+
+  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:+:}$LD_LIBRARY_PATH
+  '';
+  checkTarget = "criterion_tests test";
+
+  outputs = [ "dev" "out" ];
+
+  meta = with 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/croaring/default.nix b/nixpkgs/pkgs/development/libraries/croaring/default.nix
new file mode 100644
index 000000000000..5c1afcbf1365
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/croaring/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "croaring";
+  version = "0.2.61";
+
+  src = fetchFromGitHub {
+    owner = "RoaringBitmap";
+    repo = "CRoaring";
+    rev = "v${version}";
+    sha256 = "14y8iwv6b6gg7hgs00yqg8rwx4vwbb1zs2s99lxa51zx9vp1alcn";
+  };
+
+  patches = fetchpatch {
+    url = "https://github.com/RoaringBitmap/CRoaring/commit/8d8c60736f506b2b8f1c365148a8a541b26a55f2.patch";
+    sha256 = "1y2mbn4i8lj3lkn5s8zziyr9pl1fq9hndzz9c01dkv3s8sn7f55s";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Compressed bitset library for C and C++";
+    homepage = "http://roaringbitmap.org/";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ orivej ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/crypto++/default.nix b/nixpkgs/pkgs/development/libraries/crypto++/default.nix
new file mode 100644
index 000000000000..fe553cb37b9e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/crypto++/default.nix
@@ -0,0 +1,61 @@
+{ lib, stdenv, fetchFromGitHub
+, enableStatic ? stdenv.hostPlatform.isStatic
+, enableShared ? !enableStatic
+}:
+
+stdenv.mkDerivation rec {
+  pname = "crypto++";
+  version = "8.4.0";
+  underscoredVersion = lib.strings.replaceStrings ["."] ["_"] version;
+
+  src = fetchFromGitHub {
+    owner = "weidai11";
+    repo = "cryptopp";
+    rev = "CRYPTOPP_${underscoredVersion}";
+    sha256 = "1gwn8yh1mh41hkh6sgnhb9c3ygrdazd7645msl20i0zdvcp7f5w3";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  postPatch = ''
+    substituteInPlace GNUmakefile \
+        --replace "AR = libtool" "AR = ar" \
+        --replace "ARFLAGS = -static -o" "ARFLAGS = -cru"
+
+    # See https://github.com/weidai11/cryptopp/issues/1011
+    substituteInPlace GNUmakefile \
+      --replace "ZOPT = -O0" "ZOPT ="
+  '';
+
+  preConfigure = ''
+    sh TestScripts/configure.sh
+  '';
+
+  makeFlags = [ "PREFIX=${placeholder "out"}" ];
+  buildFlags =
+       lib.optional enableStatic "static"
+    ++ lib.optional enableShared "shared"
+    ++ [ "libcryptopp.pc" ];
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  # built for checks but we don't install static lib into the nix store
+  preInstall = lib.optionalString (!enableStatic) "rm libcryptopp.a";
+
+  installTargets = [ "install-lib" ];
+  installFlags = [ "LDCONF=true" ];
+  postInstall = lib.optionalString (!stdenv.hostPlatform.isDarwin) ''
+    ln -sr $out/lib/libcryptopp.so.${version} $out/lib/libcryptopp.so.${lib.versions.majorMinor version}
+    ln -sr $out/lib/libcryptopp.so.${version} $out/lib/libcryptopp.so.${lib.versions.major version}
+  '';
+
+  meta = {
+    description = "Crypto++, a free C++ class library of cryptographic schemes";
+    homepage = "https://cryptopp.com/";
+    changelog = "https://raw.githubusercontent.com/weidai11/cryptopp/CRYPTOPP_${underscoredVersion}/History.txt";
+    license = with lib.licenses; [ boost publicDomain ];
+    platforms = lib.platforms.all;
+    maintainers = with lib.maintainers; [ c0bw3b ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/csfml/default.nix b/nixpkgs/pkgs/development/libraries/csfml/default.nix
new file mode 100644
index 000000000000..3aebe23ee38c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/csfml/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, cmake, sfml }:
+
+stdenv.mkDerivation rec {
+  pname = "csfml";
+  version = "2.5.1";
+  src = fetchFromGitHub {
+    owner = "SFML";
+    repo  = "CSFML";
+    rev   = version;
+    sha256 = "sha256-a46V5CakKVygNfr3/nZwlsCyqNsbti4a3cr7itK5QfI=";
+  };
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ sfml ];
+  cmakeFlags = [ "-DCMAKE_MODULE_PATH=${sfml}/share/SFML/cmake/Modules/" ];
+
+  meta = with lib; {
+    homepage = "https://www.sfml-dev.org/";
+    description = "Simple and fast multimedia library";
+    longDescription = ''
+      SFML is a simple, fast, cross-platform and object-oriented multimedia API.
+      It provides access to windowing, graphics, audio and network.
+      It is written in C++, and has bindings for various languages such as C, .Net, Ruby, Python.
+    '';
+    license = licenses.zlib;
+    maintainers = [ maintainers.jpdoyle ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ctl/default.nix b/nixpkgs/pkgs/development/libraries/ctl/default.nix
new file mode 100644
index 000000000000..be643e3a52c6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ctl/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, pkg-config, ilmbase, libtiff, openexr }:
+
+stdenv.mkDerivation rec {
+  pname = "ctl";
+  version = "1.5.2";
+
+  src = fetchFromGitHub {
+    owner = "ampas";
+    repo = pname;
+    rev = "${pname}-${version}";
+    sha256 = "0a698rd1cmixh3mk4r1xa6rjli8b8b7dbx89pb43xkgqxy67glwx";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "ctl-1.5.2-ilm_230.patch";
+      url = "https://src.fedoraproject.org/rpms/CTL/raw/9d7c15a91bccdc0a9485d463bf2789be72e6b17d/f/ctl-1.5.2-ilm_230.patch";
+      sha256 = "0mdx7llwrm0q8ai53zhyxi40i9h5s339dbkqpqv30yzi2xpnfj3d";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ libtiff ilmbase openexr ];
+
+  meta = with lib; {
+    description = "Color Transformation Language";
+    homepage = "https://github.com/ampas/CTL";
+    license = "A.M.P.A.S"; # BSD-derivative, free but GPL incompatible
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ctpl/default.nix b/nixpkgs/pkgs/development/libraries/ctpl/default.nix
new file mode 100644
index 000000000000..634c2cf44cf4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ctpl/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, pkg-config, glib }:
+
+stdenv.mkDerivation rec {
+  pname = "ctpl";
+  version = "0.3.4";
+
+  src = fetchurl {
+    url = "https://download.tuxfamily.org/ctpl/releases/ctpl-${version}.tar.gz";
+    sha256 = "1yr92xv9n6kgyixwg9ps4zb404ic5pgb171k4bi3mv9p6k8gv59s";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ glib ];
+
+  meta = with lib; {
+    homepage = "http://ctpl.tuxfamily.org/";
+    description = "Template engine library written in C";
+    platforms = platforms.linux;
+    maintainers = [ ];
+    license = licenses.gpl3Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ctpp2/default.nix b/nixpkgs/pkgs/development/libraries/ctpp2/default.nix
new file mode 100644
index 000000000000..626606d0526d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ctpp2/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "ctpp2";
+  version = "2.8.3";
+
+  src = fetchurl {
+    url = "http://ctpp.havoc.ru/download/${pname}-${version}.tar.gz";
+    sha256 = "1z22zfw9lb86z4hcan9hlvji49c9b7vznh7gjm95gnvsh43zsgx8";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  patchPhase = ''
+    # include <unistd.h> to fix undefined getcwd
+    sed -ie 's/<stdlib.h>/<stdlib.h>\n#include <unistd.h>/' src/CTPP2FileSourceLoader.cpp
+  '';
+
+  doCheck = false; # fails
+
+  meta = with lib; {
+    description = "A high performance templating engine";
+    homepage = "http://ctpp.havoc.ru";
+    maintainers = [ maintainers.robbinch ];
+    platforms = platforms.linux;
+    license = licenses.bsd2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ctypes_sh/default.nix b/nixpkgs/pkgs/development/libraries/ctypes_sh/default.nix
new file mode 100644
index 000000000000..644c68e85d86
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ctypes_sh/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook, pkg-config
+, zlib, libffi, elfutils, libdwarf
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ctypes.sh";
+  version = "1.2";
+
+  src = fetchFromGitHub {
+    owner = "taviso";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1wafyfhwd7nf7xdici0djpwgykizaz7jlarn0r1b4spnpjx1zbx4";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ zlib libffi elfutils libdwarf ];
+
+  meta = with lib; {
+    description = "A foreign function interface for bash";
+    homepage = "https://github.com/taviso/ctypes.sh";
+    license = licenses.mit;
+    maintainers = with maintainers; [ tadeokondrak ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cudd/cudd.patch b/nixpkgs/pkgs/development/libraries/cudd/cudd.patch
new file mode 100644
index 000000000000..152fa30997f9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cudd/cudd.patch
@@ -0,0 +1,14 @@
+diff --git a/Makefile.am b/Makefile.am
+index 45f216a..39c3c82 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -3,6 +3,9 @@ ACLOCAL_AMFLAGS = -I m4
+ include_HEADERS = cudd/cudd.h
+ if DDDMP
+ include_HEADERS += dddmp/dddmp.h
++include_HEADERS += util/util.h
++include_HEADERS += config.h
++include_HEADERS += mtr/mtr.h
+ endif
+ if OBJ
+ include_HEADERS += cplusplus/cuddObj.hh
diff --git a/nixpkgs/pkgs/development/libraries/cudd/default.nix b/nixpkgs/pkgs/development/libraries/cudd/default.nix
new file mode 100644
index 000000000000..4e8cf59fbffd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cudd/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "cudd";
+  version = "3.0.0";
+
+  src = fetchurl {
+    url = "https://davidkebo.com/source/cudd_versions/cudd-3.0.0.tar.gz";
+    sha256 = "0sgbgv7ljfr0lwwwrb9wsnav7mw7jmr3k8mygwza15icass6dsdq";
+  };
+
+  configureFlags = [
+    "--enable-dddmp"
+    "--enable-obj"
+  ];
+
+  patches = [
+    ./cudd.patch
+  ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = with lib; {
+    homepage = "https://davidkebo.com/cudd";
+    description = "Binary Decision Diagram (BDD) library";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ chessai ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/curlcpp/default.nix b/nixpkgs/pkgs/development/libraries/curlcpp/default.nix
new file mode 100644
index 000000000000..9d4ae41f384f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/curlcpp/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, cmake, curl }:
+
+stdenv.mkDerivation rec {
+  pname = "curlcpp";
+  version = "1.4";
+
+  src = fetchFromGitHub {
+    owner = "JosephP91";
+    repo = "curlcpp";
+    rev = version;
+    sha256 = "1zx76jcddqk4zkcdb6p7rsmkjbbjm2cj6drj0c8hdd61ms1d0f3n";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ curl ];
+
+  meta = with lib; {
+    homepage = "https://josephp91.github.io/curlcpp/";
+    description = "Object oriented C++ wrapper for CURL";
+    platforms = platforms.unix;
+    license = licenses.mit;
+    maintainers = with maintainers; [ rszibele ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/curlpp/default.nix b/nixpkgs/pkgs/development/libraries/curlpp/default.nix
new file mode 100644
index 000000000000..0aee75751d9e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/curlpp/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchFromGitHub, cmake, curl }:
+
+stdenv.mkDerivation rec {
+  pname = "curlpp";
+  version = "0.8.1";
+  src = fetchFromGitHub {
+    owner = "jpbarrette";
+    repo = "curlpp";
+    rev = "v${version}";
+    sha256 = "1b0ylnnrhdax4kwjq64r1fk0i24n5ss6zfzf4hxwgslny01xiwrk";
+  };
+
+  buildInputs = [ curl ];
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://www.curlpp.org/";
+    description = "C++ wrapper around libcURL";
+    license = licenses.mit;
+    maintainers = with maintainers; [ CrazedProgrammer ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cutee/default.nix b/nixpkgs/pkgs/development/libraries/cutee/default.nix
new file mode 100644
index 000000000000..748d495063de
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cutee/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "cutee";
+  version = "0.4.2";
+
+  src = fetchurl {
+    url    = "http://www.codesink.org/download/${pname}-${version}.tar.gz";
+    sha256 = "18bzvhzx8k24mpcim5669n3wg9hd0sfsxj8zjpbr24hywrlppgc2";
+  };
+
+  buildFlags = [ "cutee" ];
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp cutee $out/bin
+  '';
+
+  meta = with lib; {
+    description = "C++ Unit Testing Easy Environment";
+    homepage    = "http://www.codesink.org/cutee_unit_testing.html";
+    license     = licenses.gpl2Plus;
+    maintainers = with maintainers; [ leenaars];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cutelyst/default.nix b/nixpkgs/pkgs/development/libraries/cutelyst/default.nix
new file mode 100644
index 000000000000..9f7d020feaf7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cutelyst/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, wrapQtAppsHook
+, qtbase, libuuid, libcap, uwsgi, grantlee, pcre
+}:
+
+stdenv.mkDerivation rec {
+  pname = "cutelyst";
+  version = "2.14.2";
+
+  src = fetchFromGitHub {
+    owner = "cutelyst";
+    repo = "cutelyst";
+    rev = "v${version}";
+    sha256 = "sha256-JUffOeUTeaZvEssP5hfSGipeRuQ7FzLF4bOizCFhe5o=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ];
+  buildInputs = [ qtbase libuuid libcap uwsgi grantlee pcre ];
+
+  cmakeFlags = [
+    "-DPLUGIN_UWSGI=ON"
+    "-DPLUGIN_STATICCOMPRESSED=ON"
+    "-DPLUGIN_CSRFPROTECTION=ON"
+    "-DPLUGIN_VIEW_GRANTLEE=ON"
+  ];
+
+  preBuild = ''
+    export LD_LIBRARY_PATH="$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}`pwd`/Cutelyst:`pwd`/EventLoopEPoll"
+  '';
+
+  postBuild = ''
+    unset LD_LIBRARY_PATH
+  '';
+
+  meta = with lib; {
+    description = "C++ Web Framework built on top of Qt";
+    homepage = "https://cutelyst.org/";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ fpletz ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cwiid/default.nix b/nixpkgs/pkgs/development/libraries/cwiid/default.nix
new file mode 100644
index 000000000000..31a5420e375c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cwiid/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, bison, flex, bluez, pkg-config, gtk2 }:
+
+stdenv.mkDerivation rec {
+  name = "cwiid-${version}-git";
+  version = "2010-02-21";
+
+  src = fetchFromGitHub {
+    owner  = "abstrakraft";
+    repo   = "cwiid";
+    rev    = "fadf11e89b579bcc0336a0692ac15c93785f3f82";
+    sha256 = "0qdb0x757k76nfj32xc2nrrdqd9jlwgg63vfn02l2iznnzahxp0h";
+  };
+
+  hardeningDisable = [ "format" ];
+
+  configureFlags = [ "--without-python" ];
+
+  prePatch = ''
+    sed -i -e '/$(LDCONFIG)/d' common/include/lib.mak.in
+  '';
+
+  buildInputs = [ bison flex bluez gtk2 ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  NIX_LDFLAGS = "-lbluetooth";
+
+  postInstall = ''
+    # Some programs (for example, cabal-install) have problems with the double 0
+    sed -i -e "s/0.6.00/0.6.0/" $out/lib/pkgconfig/cwiid.pc
+  '';
+
+  meta = with lib; {
+    description = "Linux Nintendo Wiimote interface";
+    homepage    = "http://cwiid.org";
+    license     = licenses.gpl2Plus;
+    maintainers = with maintainers; [ bennofs ];
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cxx-prettyprint/default.nix b/nixpkgs/pkgs/development/libraries/cxx-prettyprint/default.nix
new file mode 100644
index 000000000000..f632fca714cf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cxx-prettyprint/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "cxx-prettyprint-unstable";
+  version = "2016-04-30";
+  rev = "9ab26d228f2960f50b38ad37fe0159b7381f7533";
+
+  src = fetchFromGitHub {
+    owner = "louisdx";
+    repo = "cxx-prettyprint";
+    inherit rev;
+    sha256 = "1bp25yw8fb0mi432f72ihfxfj887gi36b36fpv677gawm786l7p1";
+  };
+
+  installPhase = ''
+    mkdir -p "$out/include"
+    cp prettyprint.hpp "$out/include"
+  '';
+
+  meta = with lib; {
+    description    = "Header only C++ library for pretty printing standard containers";
+    homepage       = "https://github.com/louisdx/cxx-prettyprint";
+    license        = lib.licenses.boost;
+    platforms      = platforms.all;
+
+    # This is a header-only library, no point in hydra building it:
+    hydraPlatforms = [];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cxxopts/default.nix b/nixpkgs/pkgs/development/libraries/cxxopts/default.nix
new file mode 100644
index 000000000000..855a9eef8ea0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cxxopts/default.nix
@@ -0,0 +1,33 @@
+{ cmake, fetchFromGitHub, icu, lib, pkg-config, stdenv, enableUnicodeHelp ? true }:
+
+stdenv.mkDerivation rec {
+  name = "cxxopts";
+  version = "unstable-2020-12-14";
+
+  src = fetchFromGitHub {
+    owner = "jarro2783";
+    repo = name;
+    rev = "2d8e17c4f88efce80e274cb03eeb902e055a91d3";
+    sha256 = "0pwrac81zfqjs17g3hx8r3ds2xf04npb6mz111qjy4bx17314ib7";
+  };
+
+  buildInputs = lib.optional enableUnicodeHelp [ icu.dev ];
+  cmakeFlags = [ "-DCXXOPTS_BUILD_EXAMPLES=OFF" ]
+    ++ lib.optional enableUnicodeHelp "-DCXXOPTS_USE_UNICODE_HELP=TRUE"
+    # Due to -Wsuggest-override, remove when cxxopts is updated
+    ++ lib.optional stdenv.isDarwin "-DCXXOPTS_ENABLE_WARNINGS=OFF";
+  nativeBuildInputs = [ cmake ] ++ lib.optional enableUnicodeHelp [ pkg-config ];
+
+  doCheck = true;
+
+  # Conflict on case-insensitive filesystems.
+  dontUseCmakeBuildDir = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/jarro2783/cxxopts";
+    description = "Lightweight C++ GNU-style option parser library";
+    license = licenses.mit;
+    maintainers = [ maintainers.spease ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cxxtest/default.nix b/nixpkgs/pkgs/development/libraries/cxxtest/default.nix
new file mode 100644
index 000000000000..3469cda3fc70
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cxxtest/default.nix
@@ -0,0 +1,36 @@
+{ lib, buildPythonApplication, fetchFromGitHub }:
+
+buildPythonApplication rec {
+  pname = "cxxtest";
+  version = "4.4";
+
+  src = fetchFromGitHub {
+    owner = "CxxTest";
+    repo = pname;
+    rev = version;
+    sha256 = "19w92kipfhp5wvs47l0qpibn3x49sbmvkk91yxw6nwk6fafcdl17";
+  };
+
+  sourceRoot = "source/python";
+
+  postCheck = ''
+    python scripts/cxxtestgen --error-printer -o build/GoodSuite.cpp ../test/GoodSuite.h
+    $CXX -I.. -o build/GoodSuite build/GoodSuite.cpp
+    build/GoodSuite
+  '';
+
+  postInstall = ''
+    mkdir -p "$out/include"
+    cp -r ../cxxtest "$out/include"
+  '';
+
+  dontWrapPythonPrograms = true;
+
+  meta = with lib; {
+    homepage = "http://cxxtest.com";
+    description = "Unit testing framework for C++";
+    platforms = platforms.unix;
+    license = licenses.lgpl3;
+    maintainers = [ maintainers.juliendehos ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cxxtools/default.nix b/nixpkgs/pkgs/development/libraries/cxxtools/default.nix
new file mode 100644
index 000000000000..0d8d2498ae73
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cxxtools/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  version = "2.2.1";
+  pname = "cxxtools";
+
+  src = fetchurl {
+    url = "http://www.tntnet.org/download/${pname}-${version}.tar.gz";
+    sha256 = "0hp3qkyhidxkdf8qgkwrnqq5bpahink55mf0yz23rjd7rpbbdswc";
+  };
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "http://www.tntnet.org/cxxtools.html";
+    description = "Comprehensive C++ class library for Unix and Linux";
+    platforms = lib.platforms.linux ;
+    license = lib.licenses.lgpl21;
+    maintainers = [ lib.maintainers.juliendehos ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cyrus-sasl/cyrus-sasl-ac-try-run-fix.patch b/nixpkgs/pkgs/development/libraries/cyrus-sasl/cyrus-sasl-ac-try-run-fix.patch
new file mode 100644
index 000000000000..8662e812e995
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cyrus-sasl/cyrus-sasl-ac-try-run-fix.patch
@@ -0,0 +1,12 @@
+--- a/m4/sasl2.m4	2018-11-18 22:33:29.902625600 +0300
++++ b/m4/sasl2.m4	2018-11-18 22:33:59.828746176 +0300
+@@ -339,7 +339,8 @@
+ ],	
+ 	[ AC_DEFINE(HAVE_GSS_SPNEGO,,[Define if your GSSAPI implementation supports SPNEGO])
+ 	AC_MSG_RESULT(yes) ],
+-	AC_MSG_RESULT(no))
++	AC_MSG_RESULT(no),
++    AC_MSG_RESULT(no))
+   LIBS="$cmu_save_LIBS"
+ 
+ else
diff --git a/nixpkgs/pkgs/development/libraries/cyrus-sasl/default.nix b/nixpkgs/pkgs/development/libraries/cyrus-sasl/default.nix
new file mode 100644
index 000000000000..6e97c61a6a5e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cyrus-sasl/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv, fetchurl, openssl, openldap, libkrb5, db, gettext
+, pam, fixDarwinDylibNames, autoreconfHook, enableLdap ? false
+, buildPackages, pruneLibtoolFiles, fetchpatch }:
+
+with lib;
+stdenv.mkDerivation rec {
+  pname = "cyrus-sasl";
+  version = "2.1.27";
+
+  src = fetchurl {
+    urls =
+      [ "https://github.com/cyrusimap/${pname}/releases/download/${pname}-${version}/${pname}-${version}.tar.gz"
+        "http://www.cyrusimap.org/releases/${pname}-${version}.tar.gz"
+        "http://www.cyrusimap.org/releases/old/${pname}-${version}.tar.gz"
+      ];
+    sha256 = "1m85zcpgfdhm43cavpdkhb1s2zq1b31472hq1w1gs3xh94anp1i6";
+  };
+
+  outputs = [ "bin" "dev" "out" "man" "devdoc" ];
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ autoreconfHook pruneLibtoolFiles ]
+    ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+  buildInputs =
+    [ openssl db gettext libkrb5 ]
+    ++ lib.optional enableLdap openldap
+    ++ lib.optional stdenv.isLinux pam;
+
+  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 = [
+    "--with-openssl=${openssl.dev}"
+    "--with-plugindir=${placeholder "out"}/lib/sasl2"
+    "--with-saslauthd=/run/saslauthd"
+    "--enable-login"
+    "--enable-shared"
+  ] ++ lib.optional enableLdap "--with-ldap=${openldap.dev}";
+
+  installFlags = lib.optional stdenv.isDarwin [ "framedir=$(out)/Library/Frameworks/SASL2.framework" ];
+
+  meta = {
+    homepage = "https://www.cyrusimap.org/sasl";
+    description = "Library for adding authentication support to connection-based protocols";
+    platforms = platforms.unix;
+    license = licenses.bsdOriginal;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/cyrus-sasl/missing-size_t.patch b/nixpkgs/pkgs/development/libraries/cyrus-sasl/missing-size_t.patch
new file mode 100644
index 000000000000..da96818ca267
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/cyrus-sasl/missing-size_t.patch
@@ -0,0 +1,13 @@
+Gentoo bug #458790
+--- a/include/sasl.h	2012-10-12 17:05:48.000000000 +0300
++++ b/include/sasl.h	2013-02-23 16:56:44.648786268 +0200
+@@ -121,6 +121,9 @@
+ #ifndef SASL_H
+ #define SASL_H 1
+ 
++/* stddef.h to get size_t defined */
++#include <stddef.h>
++
+ /* Keep in sync with win32/common.mak */
+ #define SASL_VERSION_MAJOR 2
+ #define SASL_VERSION_MINOR 1
diff --git a/nixpkgs/pkgs/development/libraries/czmq/default.nix b/nixpkgs/pkgs/development/libraries/czmq/default.nix
new file mode 100644
index 000000000000..bb8ecafbb347
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/czmq/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, zeromq }:
+
+stdenv.mkDerivation rec {
+  version = "4.2.1";
+  pname = "czmq";
+
+  src = fetchurl {
+    url = "https://github.com/zeromq/czmq/releases/download/v${version}/${pname}-${version}.tar.gz";
+    sha256 = "sha256-XXIKIEwqWGRdb3ZDrxXVY6cS2tmMnTLB7ZEzd9qmrDk=";
+  };
+
+  # Needs to be propagated for the .pc file to work
+  propagatedBuildInputs = [ zeromq ];
+
+  meta = with 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/dav1d/default.nix b/nixpkgs/pkgs/development/libraries/dav1d/default.nix
new file mode 100644
index 000000000000..fe6926fe809a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dav1d/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchFromGitLab
+, meson, ninja, nasm, pkg-config
+, xxHash
+, withTools ? false # "dav1d" binary
+, withExamples ? false, SDL2 # "dav1dplay" binary
+, useVulkan ? false, libplacebo, vulkan-loader, vulkan-headers
+}:
+
+assert useVulkan -> withExamples;
+
+stdenv.mkDerivation rec {
+  pname = "dav1d";
+  version = "0.9.0";
+
+  src = fetchFromGitLab {
+    domain = "code.videolan.org";
+    owner = "videolan";
+    repo = pname;
+    rev = version;
+    sha256 = "0ki3wlyaqr80gl1srbbd18dd5bs1sl9icxym8ar62abpvgzxl5yk";
+  };
+
+  nativeBuildInputs = [ meson ninja nasm pkg-config ];
+  # TODO: doxygen (currently only HTML and not build by default).
+  buildInputs = [ xxHash ]
+    ++ lib.optional withExamples SDL2
+    ++ lib.optionals useVulkan [ libplacebo vulkan-loader vulkan-headers ];
+
+  mesonFlags= [
+    "-Denable_tools=${lib.boolToString withTools}"
+    "-Denable_examples=${lib.boolToString withExamples}"
+  ];
+
+  meta = with lib; {
+    description = "A cross-platform AV1 decoder focused on speed and correctness";
+    longDescription = ''
+      The goal of this project is to provide a decoder for most platforms, and
+      achieve the highest speed possible to overcome the temporary lack of AV1
+      hardware decoder. It supports all features from AV1, including all
+      subsampling and bit-depth parameters.
+    '';
+    inherit (src.meta) homepage;
+    changelog = "https://code.videolan.org/videolan/dav1d/-/tags/${version}";
+    # More technical: https://code.videolan.org/videolan/dav1d/blob/${version}/NEWS
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ primeos ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/db/CVE-2017-10140-4.8-cwd-db_config.patch b/nixpkgs/pkgs/development/libraries/db/CVE-2017-10140-4.8-cwd-db_config.patch
new file mode 100644
index 000000000000..ed916fcf4d1f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/db/CVE-2017-10140-4.8-cwd-db_config.patch
@@ -0,0 +1,11 @@
+--- a/env/env_open.c.old	2017-06-26 10:32:11.011419981 +0200
++++ b/env/env_open.c	2017-06-26 10:32:46.893721233 +0200
+@@ -473,7 +473,7 @@
+ 	env->db_mode = mode == 0 ? DB_MODE_660 : mode;
+ 
+ 	/* Read the DB_CONFIG file. */
+-	if ((ret = __env_read_db_config(env)) != 0)
++	if (env->db_home != NULL && (ret = __env_read_db_config(env)) != 0)
+ 		return (ret);
+ 
+ 	/*
diff --git a/nixpkgs/pkgs/development/libraries/db/CVE-2017-10140-cwd-db_config.patch b/nixpkgs/pkgs/development/libraries/db/CVE-2017-10140-cwd-db_config.patch
new file mode 100644
index 000000000000..652e962bbe18
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/db/CVE-2017-10140-cwd-db_config.patch
@@ -0,0 +1,11 @@
+--- db-5.3.28/src/env/env_open.c.old	2017-06-26 10:32:11.011419981 +0200
++++ db-5.3.28/src/env/env_open.c	2017-06-26 10:32:46.893721233 +0200
+@@ -473,7 +473,7 @@
+ 	env->db_mode = mode == 0 ? DB_MODE_660 : mode;
+ 
+ 	/* Read the DB_CONFIG file. */
+-	if ((ret = __env_read_db_config(env)) != 0)
++	if (env->db_home != NULL && (ret = __env_read_db_config(env)) != 0)
+ 		return (ret);
+ 
+ 	/*
diff --git a/nixpkgs/pkgs/development/libraries/db/clang-4.8.patch b/nixpkgs/pkgs/development/libraries/db/clang-4.8.patch
new file mode 100644
index 000000000000..aa46b8500b5a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/db/clang-4.8.patch
@@ -0,0 +1,141 @@
+diff --git a/dbinc/atomic.h b/dbinc/atomic.h
+index 0034dcc..160c8ea 100644
+--- a/dbinc/atomic.h
++++ b/dbinc/atomic.h
+@@ -70,7 +70,7 @@ typedef struct {
+  * These have no memory barriers; the caller must include them when necessary.
+  */
+ #define	atomic_read(p)		((p)->value)
+-#define	atomic_init(p, val)	((p)->value = (val))
++#define	atomic_init_db(p, val)	((p)->value = (val))
+ 
+ #ifdef HAVE_ATOMIC_SUPPORT
+ 
+@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val;
+ #define	atomic_inc(env, p)	__atomic_inc(p)
+ #define	atomic_dec(env, p)	__atomic_dec(p)
+ #define	atomic_compare_exchange(env, p, o, n)	\
+-	__atomic_compare_exchange((p), (o), (n))
++	__atomic_compare_exchange_int((p), (o), (n))
+ static inline int __atomic_inc(db_atomic_t *p)
+ {
+ 	int	temp;
+@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic_t *p)
+  * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
+  * which configure could be changed to use.
+  */
+-static inline int __atomic_compare_exchange(
++static inline int __atomic_compare_exchange_int(
+ 	db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
+ {
+ 	atomic_value_t was;
+@@ -206,7 +206,7 @@ static inline int __atomic_compare_exchange(
+ #define	atomic_dec(env, p)	(--(p)->value)
+ #define	atomic_compare_exchange(env, p, oldval, newval)		\
+ 	(DB_ASSERT(env, atomic_read(p) == (oldval)),		\
+-	atomic_init(p, (newval)), 1)
++	atomic_init_db(p, (newval)), 1)
+ #else
+ #define atomic_inc(env, p)	__atomic_inc(env, p)
+ #define atomic_dec(env, p)	__atomic_dec(env, p)
+diff --git a/mp/mp_fget.c b/mp/mp_fget.c
+index 5fdee5a..0b75f57 100644
+--- a/mp/mp_fget.c
++++ b/mp/mp_fget.c
+@@ -617,7 +617,7 @@ alloc:		/* Allocate a new buffer header and data space. */
+ 
+ 		/* Initialize enough so we can call __memp_bhfree. */
+ 		alloc_bhp->flags = 0;
+-		atomic_init(&alloc_bhp->ref, 1);
++		atomic_init_db(&alloc_bhp->ref, 1);
+ #ifdef DIAGNOSTIC
+ 		if ((uintptr_t)alloc_bhp->buf & (sizeof(size_t) - 1)) {
+ 			__db_errx(env,
+@@ -911,7 +911,7 @@ alloc:		/* Allocate a new buffer header and data space. */
+ 			MVCC_MPROTECT(bhp->buf, mfp->stat.st_pagesize,
+ 			    PROT_READ);
+ 
+-		atomic_init(&alloc_bhp->ref, 1);
++		atomic_init_db(&alloc_bhp->ref, 1);
+ 		MUTEX_LOCK(env, alloc_bhp->mtx_buf);
+ 		alloc_bhp->priority = bhp->priority;
+ 		alloc_bhp->pgno = bhp->pgno;
+diff --git a/mp/mp_mvcc.c b/mp/mp_mvcc.c
+index 34467d2..f05aa0c 100644
+--- a/mp/mp_mvcc.c
++++ b/mp/mp_mvcc.c
+@@ -276,7 +276,7 @@ __memp_bh_freeze(dbmp, infop, hp, bhp, need_frozenp)
+ #else
+ 	memcpy(frozen_bhp, bhp, SSZA(BH, buf));
+ #endif
+-	atomic_init(&frozen_bhp->ref, 0);
++	atomic_init_db(&frozen_bhp->ref, 0);
+ 	if (mutex != MUTEX_INVALID)
+ 		frozen_bhp->mtx_buf = mutex;
+ 	else if ((ret = __mutex_alloc(env, MTX_MPOOL_BH,
+@@ -428,7 +428,7 @@ __memp_bh_thaw(dbmp, infop, hp, frozen_bhp, alloc_bhp)
+ #endif
+ 		alloc_bhp->mtx_buf = mutex;
+ 		MUTEX_LOCK(env, alloc_bhp->mtx_buf);
+-		atomic_init(&alloc_bhp->ref, 1);
++		atomic_init_db(&alloc_bhp->ref, 1);
+ 		F_CLR(alloc_bhp, BH_FROZEN);
+ 	}
+ 
+diff --git a/mp/mp_region.c b/mp/mp_region.c
+index e6cece9..ddbe906 100644
+--- a/mp/mp_region.c
++++ b/mp/mp_region.c
+@@ -224,7 +224,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg)
+ 			     MTX_MPOOL_FILE_BUCKET, 0, &htab[i].mtx_hash)) != 0)
+ 				return (ret);
+ 			SH_TAILQ_INIT(&htab[i].hash_bucket);
+-			atomic_init(&htab[i].hash_page_dirty, 0);
++			atomic_init_db(&htab[i].hash_page_dirty, 0);
+ 		}
+ 
+ 		/*
+@@ -269,7 +269,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg)
+ 		hp->mtx_hash = (mtx_base == MUTEX_INVALID) ? MUTEX_INVALID :
+ 		    mtx_base + i;
+ 		SH_TAILQ_INIT(&hp->hash_bucket);
+-		atomic_init(&hp->hash_page_dirty, 0);
++		atomic_init_db(&hp->hash_page_dirty, 0);
+ #ifdef HAVE_STATISTICS
+ 		hp->hash_io_wait = 0;
+ 		hp->hash_frozen = hp->hash_thawed = hp->hash_frozen_freed = 0;
+diff --git a/mutex/mut_method.c b/mutex/mut_method.c
+index 2588763..5c6d516 100644
+--- a/mutex/mut_method.c
++++ b/mutex/mut_method.c
+@@ -426,7 +426,7 @@ atomic_compare_exchange(env, v, oldval, newval)
+ 	MUTEX_LOCK(env, mtx);
+ 	ret = atomic_read(v) == oldval;
+ 	if (ret)
+-		atomic_init(v, newval);
++		atomic_init_db(v, newval);
+ 	MUTEX_UNLOCK(env, mtx);
+ 
+ 	return (ret);
+diff --git a/mutex/mut_tas.c b/mutex/mut_tas.c
+index f3922e0..e40fcdf 100644
+--- a/mutex/mut_tas.c
++++ b/mutex/mut_tas.c
+@@ -46,7 +46,7 @@ __db_tas_mutex_init(env, mutex, flags)
+ 
+ #ifdef HAVE_SHARED_LATCHES
+ 	if (F_ISSET(mutexp, DB_MUTEX_SHARED))
+-		atomic_init(&mutexp->sharecount, 0);
++		atomic_init_db(&mutexp->sharecount, 0);
+ 	else
+ #endif
+ 	if (MUTEX_INIT(&mutexp->tas)) {
+@@ -486,7 +486,7 @@ __db_tas_mutex_unlock(env, mutex)
+ 			F_CLR(mutexp, DB_MUTEX_LOCKED);
+ 			/* Flush flag update before zeroing count */
+ 			MEMBAR_EXIT();
+-			atomic_init(&mutexp->sharecount, 0);
++			atomic_init_db(&mutexp->sharecount, 0);
+ 		} else {
+ 			DB_ASSERT(env, sharecount > 0);
+ 			MEMBAR_EXIT();
diff --git a/nixpkgs/pkgs/development/libraries/db/clang-5.3.patch b/nixpkgs/pkgs/development/libraries/db/clang-5.3.patch
new file mode 100644
index 000000000000..caf19ffeb92b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/db/clang-5.3.patch
@@ -0,0 +1,141 @@
+diff --git a/src/dbinc/atomic.h b/src/dbinc/atomic.h
+index 6a858f7..9f338dc 100644
+--- a/src/dbinc/atomic.h
++++ b/src/dbinc/atomic.h
+@@ -70,7 +70,7 @@ typedef struct {
+  * These have no memory barriers; the caller must include them when necessary.
+  */
+ #define	atomic_read(p)		((p)->value)
+-#define	atomic_init(p, val)	((p)->value = (val))
++#define	atomic_init_db(p, val)	((p)->value = (val))
+ 
+ #ifdef HAVE_ATOMIC_SUPPORT
+ 
+@@ -144,7 +144,7 @@ typedef LONG volatile *interlocked_val;
+ #define	atomic_inc(env, p)	__atomic_inc(p)
+ #define	atomic_dec(env, p)	__atomic_dec(p)
+ #define	atomic_compare_exchange(env, p, o, n)	\
+-	__atomic_compare_exchange((p), (o), (n))
++	__atomic_compare_exchange_int((p), (o), (n))
+ static inline int __atomic_inc(db_atomic_t *p)
+ {
+ 	int	temp;
+@@ -176,7 +176,7 @@ static inline int __atomic_dec(db_atomic_t *p)
+  * http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html
+  * which configure could be changed to use.
+  */
+-static inline int __atomic_compare_exchange(
++static inline int __atomic_compare_exchange_int(
+ 	db_atomic_t *p, atomic_value_t oldval, atomic_value_t newval)
+ {
+ 	atomic_value_t was;
+@@ -206,7 +206,7 @@ static inline int __atomic_compare_exchange(
+ #define	atomic_dec(env, p)	(--(p)->value)
+ #define	atomic_compare_exchange(env, p, oldval, newval)		\
+ 	(DB_ASSERT(env, atomic_read(p) == (oldval)),		\
+-	atomic_init(p, (newval)), 1)
++	atomic_init_db(p, (newval)), 1)
+ #else
+ #define atomic_inc(env, p)	__atomic_inc(env, p)
+ #define atomic_dec(env, p)	__atomic_dec(env, p)
+diff --git a/src/mp/mp_fget.c b/src/mp/mp_fget.c
+index 16de695..d0dcc29 100644
+--- a/src/mp/mp_fget.c
++++ b/src/mp/mp_fget.c
+@@ -649,7 +649,7 @@ alloc:		/* Allocate a new buffer header and data space. */
+ 
+ 		/* Initialize enough so we can call __memp_bhfree. */
+ 		alloc_bhp->flags = 0;
+-		atomic_init(&alloc_bhp->ref, 1);
++		atomic_init_db(&alloc_bhp->ref, 1);
+ #ifdef DIAGNOSTIC
+ 		if ((uintptr_t)alloc_bhp->buf & (sizeof(size_t) - 1)) {
+ 			__db_errx(env, DB_STR("3025",
+@@ -955,7 +955,7 @@ alloc:		/* Allocate a new buffer header and data space. */
+ 			MVCC_MPROTECT(bhp->buf, mfp->pagesize,
+ 			    PROT_READ);
+ 
+-		atomic_init(&alloc_bhp->ref, 1);
++		atomic_init_db(&alloc_bhp->ref, 1);
+ 		MUTEX_LOCK(env, alloc_bhp->mtx_buf);
+ 		alloc_bhp->priority = bhp->priority;
+ 		alloc_bhp->pgno = bhp->pgno;
+diff --git a/src/mp/mp_mvcc.c b/src/mp/mp_mvcc.c
+index 770bad8..e28cce0 100644
+--- a/src/mp/mp_mvcc.c
++++ b/src/mp/mp_mvcc.c
+@@ -276,7 +276,7 @@ __memp_bh_freeze(dbmp, infop, hp, bhp, need_frozenp)
+ #else
+ 	memcpy(frozen_bhp, bhp, SSZA(BH, buf));
+ #endif
+-	atomic_init(&frozen_bhp->ref, 0);
++	atomic_init_db(&frozen_bhp->ref, 0);
+ 	if (mutex != MUTEX_INVALID)
+ 		frozen_bhp->mtx_buf = mutex;
+ 	else if ((ret = __mutex_alloc(env, MTX_MPOOL_BH,
+@@ -428,7 +428,7 @@ __memp_bh_thaw(dbmp, infop, hp, frozen_bhp, alloc_bhp)
+ #endif
+ 		alloc_bhp->mtx_buf = mutex;
+ 		MUTEX_LOCK(env, alloc_bhp->mtx_buf);
+-		atomic_init(&alloc_bhp->ref, 1);
++		atomic_init_db(&alloc_bhp->ref, 1);
+ 		F_CLR(alloc_bhp, BH_FROZEN);
+ 	}
+ 
+diff --git a/src/mp/mp_region.c b/src/mp/mp_region.c
+index 4952030..47645f8 100644
+--- a/src/mp/mp_region.c
++++ b/src/mp/mp_region.c
+@@ -245,7 +245,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg)
+ 			     MTX_MPOOL_FILE_BUCKET, 0, &htab[i].mtx_hash)) != 0)
+ 				return (ret);
+ 			SH_TAILQ_INIT(&htab[i].hash_bucket);
+-			atomic_init(&htab[i].hash_page_dirty, 0);
++			atomic_init_db(&htab[i].hash_page_dirty, 0);
+ 		}
+ 
+ 		/*
+@@ -302,7 +302,7 @@ no_prealloc:
+ 		} else
+ 			hp->mtx_hash = mtx_base + (i % dbenv->mp_mtxcount);
+ 		SH_TAILQ_INIT(&hp->hash_bucket);
+-		atomic_init(&hp->hash_page_dirty, 0);
++		atomic_init_db(&hp->hash_page_dirty, 0);
+ #ifdef HAVE_STATISTICS
+ 		hp->hash_io_wait = 0;
+ 		hp->hash_frozen = hp->hash_thawed = hp->hash_frozen_freed = 0;
+diff --git a/src/mutex/mut_method.c b/src/mutex/mut_method.c
+index 09353b0..177353c 100644
+--- a/src/mutex/mut_method.c
++++ b/src/mutex/mut_method.c
+@@ -474,7 +474,7 @@ atomic_compare_exchange(env, v, oldval, newval)
+ 	MUTEX_LOCK(env, mtx);
+ 	ret = atomic_read(v) == oldval;
+ 	if (ret)
+-		atomic_init(v, newval);
++		atomic_init_db(v, newval);
+ 	MUTEX_UNLOCK(env, mtx);
+ 
+ 	return (ret);
+diff --git a/src/mutex/mut_tas.c b/src/mutex/mut_tas.c
+index 106b161..fc4de9d 100644
+--- a/src/mutex/mut_tas.c
++++ b/src/mutex/mut_tas.c
+@@ -47,7 +47,7 @@ __db_tas_mutex_init(env, mutex, flags)
+ 
+ #ifdef HAVE_SHARED_LATCHES
+ 	if (F_ISSET(mutexp, DB_MUTEX_SHARED))
+-		atomic_init(&mutexp->sharecount, 0);
++		atomic_init_db(&mutexp->sharecount, 0);
+ 	else
+ #endif
+ 	if (MUTEX_INIT(&mutexp->tas)) {
+@@ -536,7 +536,7 @@ __db_tas_mutex_unlock(env, mutex)
+ 			F_CLR(mutexp, DB_MUTEX_LOCKED);
+ 			/* Flush flag update before zeroing count */
+ 			MEMBAR_EXIT();
+-			atomic_init(&mutexp->sharecount, 0);
++			atomic_init_db(&mutexp->sharecount, 0);
+ 		} else {
+ 			DB_ASSERT(env, sharecount > 0);
+ 			MEMBAR_EXIT();
diff --git a/nixpkgs/pkgs/development/libraries/db/clang-6.0.patch b/nixpkgs/pkgs/development/libraries/db/clang-6.0.patch
new file mode 100644
index 000000000000..a411e60dc39b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/db/clang-6.0.patch
@@ -0,0 +1,123 @@
+diff --git a/src/dbinc/atomic.h b/src/dbinc/atomic.h
+index e4420aa..4799b5f 100644
+--- a/src/dbinc/atomic.h
++++ b/src/dbinc/atomic.h
+@@ -70,7 +70,7 @@ typedef struct {
+  * These have no memory barriers; the caller must include them when necessary.
+  */
+ #define	atomic_read(p)		((p)->value)
+-#define	atomic_init(p, val)	((p)->value = (val))
++#define	atomic_init_db(p, val)	((p)->value = (val))
+ 
+ #ifdef HAVE_ATOMIC_SUPPORT
+ 
+@@ -225,7 +225,7 @@ static inline int __atomic_compare_exchange_int(
+ #define	atomic_dec(env, p)	(--(p)->value)
+ #define	atomic_compare_exchange(env, p, oldval, newval)		\
+ 	(DB_ASSERT(env, atomic_read(p) == (oldval)),		\
+-	atomic_init(p, (newval)), 1)
++	atomic_init_db(p, (newval)), 1)
+ #else
+ #define	atomic_inc(env, p)	__atomic_inc_int(env, p)
+ #define	atomic_dec(env, p)	__atomic_dec_int(env, p)
+diff --git a/src/mp/mp_fget.c b/src/mp/mp_fget.c
+index 59fe9fe..fa4ced7 100644
+--- a/src/mp/mp_fget.c
++++ b/src/mp/mp_fget.c
+@@ -654,7 +654,7 @@ alloc:		/* Allocate a new buffer header and data space. */
+ 
+ 		/* Initialize enough so we can call __memp_bhfree. */
+ 		alloc_bhp->flags = 0;
+-		atomic_init(&alloc_bhp->ref, 1);
++		atomic_init_db(&alloc_bhp->ref, 1);
+ #ifdef DIAGNOSTIC
+ 		if ((uintptr_t)alloc_bhp->buf & (sizeof(size_t) - 1)) {
+ 			__db_errx(env, DB_STR("3025",
+@@ -969,7 +969,7 @@ alloc:		/* Allocate a new buffer header and data space. */
+ 			MVCC_MPROTECT(bhp->buf, mfp->pagesize,
+ 			    PROT_READ);
+ 
+-		atomic_init(&alloc_bhp->ref, 1);
++		atomic_init_db(&alloc_bhp->ref, 1);
+ 		MUTEX_LOCK(env, alloc_bhp->mtx_buf);
+ 		alloc_bhp->priority = bhp->priority;
+ 		alloc_bhp->pgno = bhp->pgno;
+diff --git a/src/mp/mp_mvcc.c b/src/mp/mp_mvcc.c
+index 83c4d72..0a47202 100644
+--- a/src/mp/mp_mvcc.c
++++ b/src/mp/mp_mvcc.c
+@@ -281,7 +281,7 @@ __memp_bh_freeze(dbmp, infop, hp, bhp, need_frozenp)
+ #else
+ 	memcpy(frozen_bhp, bhp, SSZA(BH, buf));
+ #endif
+-	atomic_init(&frozen_bhp->ref, 0);
++	atomic_init_db(&frozen_bhp->ref, 0);
+ 	if (mutex != MUTEX_INVALID)
+ 		frozen_bhp->mtx_buf = mutex;
+ 	else if ((ret = __mutex_alloc(env, MTX_MPOOL_BH,
+@@ -440,7 +440,7 @@ __memp_bh_thaw(dbmp, infop, hp, frozen_bhp, alloc_bhp)
+ #endif
+ 		alloc_bhp->mtx_buf = mutex;
+ 		MUTEX_LOCK(env, alloc_bhp->mtx_buf);
+-		atomic_init(&alloc_bhp->ref, 1);
++		atomic_init_db(&alloc_bhp->ref, 1);
+ 		F_CLR(alloc_bhp, BH_FROZEN);
+ 	}
+ 
+diff --git a/src/mp/mp_region.c b/src/mp/mp_region.c
+index 4d95e4f..e97459c 100644
+--- a/src/mp/mp_region.c
++++ b/src/mp/mp_region.c
+@@ -278,7 +278,7 @@ __memp_init(env, dbmp, reginfo_off, htab_buckets, max_nreg)
+ 			     MTX_MPOOL_FILE_BUCKET, 0, &htab[i].mtx_hash)) != 0)
+ 				return (ret);
+ 			SH_TAILQ_INIT(&htab[i].hash_bucket);
+-			atomic_init(&htab[i].hash_page_dirty, 0);
++			atomic_init_db(&htab[i].hash_page_dirty, 0);
+ 		}
+ 
+ 		mtx_base = mtx_prev = MUTEX_INVALID;
+@@ -332,7 +332,7 @@ no_prealloc:
+ 		    DB_MUTEX_SHARED, &hp->mtx_hash)) != 0)
+ 			return (ret);
+ 		SH_TAILQ_INIT(&hp->hash_bucket);
+-		atomic_init(&hp->hash_page_dirty, 0);
++		atomic_init_db(&hp->hash_page_dirty, 0);
+ #ifdef HAVE_STATISTICS
+ 		hp->hash_io_wait = 0;
+ 		hp->hash_frozen = hp->hash_thawed = hp->hash_frozen_freed = 0;
+diff --git a/src/mutex/mut_method.c b/src/mutex/mut_method.c
+index 72b34de..a9f9868 100644
+--- a/src/mutex/mut_method.c
++++ b/src/mutex/mut_method.c
+@@ -501,7 +501,7 @@ __atomic_compare_exchange_int(env, v, oldval, newval)
+ 	MUTEX_LOCK(env, mtx);
+ 	ret = atomic_read(v) == oldval;
+ 	if (ret)
+-		atomic_init(v, newval);
++		atomic_init_db(v, newval);
+ 	MUTEX_UNLOCK(env, mtx);
+ 
+ 	return (ret);
+diff --git a/src/mutex/mut_tas.c b/src/mutex/mut_tas.c
+index 7899c4b..d9420fa 100644
+--- a/src/mutex/mut_tas.c
++++ b/src/mutex/mut_tas.c
+@@ -47,7 +47,7 @@ __db_tas_mutex_init(env, mutex, flags)
+ 
+ #ifdef HAVE_SHARED_LATCHES
+ 	if (F_ISSET(mutexp, DB_MUTEX_SHARED))
+-		atomic_init(&mutexp->sharecount, 0);
++		atomic_init_db(&mutexp->sharecount, 0);
+ 	else
+ #endif
+ 	if (MUTEX_INIT(&mutexp->tas)) {
+@@ -643,7 +643,7 @@ was_not_locked:
+ 			F_CLR(mutexp, DB_MUTEX_LOCKED);
+ 			/* Flush flag update before zeroing count */
+ 			MEMBAR_EXIT();
+-			atomic_init(&mutexp->sharecount, 0);
++			atomic_init_db(&mutexp->sharecount, 0);
+ 		} else {
+ 			DB_ASSERT(env, sharecount > 0);
+ 			MEMBAR_EXIT();
diff --git a/nixpkgs/pkgs/development/libraries/db/db-4.8.nix b/nixpkgs/pkgs/development/libraries/db/db-4.8.nix
new file mode 100644
index 000000000000..5cf9200a9ab9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/db/db-4.8.nix
@@ -0,0 +1,10 @@
+{ lib, stdenv, fetchurl, ... } @ args:
+
+import ./generic.nix (args // {
+  version = "4.8.30";
+  sha256 = "0ampbl2f0hb1nix195kz1syrqqxpmvnvnfvphambj7xjrl3iljg0";
+  extraPatches = [ ./clang-4.8.patch ./CVE-2017-10140-4.8-cwd-db_config.patch ];
+
+  drvArgs.hardeningDisable = [ "format" ];
+  drvArgs.doCheck = false;
+})
diff --git a/nixpkgs/pkgs/development/libraries/db/db-5.3.nix b/nixpkgs/pkgs/development/libraries/db/db-5.3.nix
new file mode 100644
index 000000000000..0bb5c4cd6a4a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/db/db-5.3.nix
@@ -0,0 +1,7 @@
+{ lib, stdenv, fetchurl, ... } @ args:
+
+import ./generic.nix (args // {
+  version = "5.3.28";
+  sha256 = "0a1n5hbl7027fbz5lm0vp0zzfp1hmxnz14wx3zl9563h83br5ag0";
+  extraPatches = [ ./clang-5.3.patch ./CVE-2017-10140-cwd-db_config.patch ];
+})
diff --git a/nixpkgs/pkgs/development/libraries/db/db-6.0.nix b/nixpkgs/pkgs/development/libraries/db/db-6.0.nix
new file mode 100644
index 000000000000..49935dd2399b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/db/db-6.0.nix
@@ -0,0 +1,8 @@
+{ lib, stdenv, fetchurl, ... } @ args:
+
+import ./generic.nix (args // {
+  version = "6.0.20";
+  sha256 = "00r2aaglq625y8r9xd5vw2y070plp88f1mb2gbq3kqsl7128lsl0";
+  license = lib.licenses.agpl3;
+  extraPatches = [ ./clang-6.0.patch ./CVE-2017-10140-cwd-db_config.patch ];
+})
diff --git a/nixpkgs/pkgs/development/libraries/db/db-6.2.nix b/nixpkgs/pkgs/development/libraries/db/db-6.2.nix
new file mode 100644
index 000000000000..b2c0fd7ac8fc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/db/db-6.2.nix
@@ -0,0 +1,8 @@
+{ lib, stdenv, fetchurl, ... } @ args:
+
+import ./generic.nix (args // {
+  version = "6.2.23";
+  sha256 = "1isxx4jfmnh913jzhp8hhfngbk6dsg46f4kjpvvc56maj64jqqa7";
+  license = lib.licenses.agpl3;
+  extraPatches = [ ./clang-6.0.patch ./CVE-2017-10140-cwd-db_config.patch ];
+})
diff --git a/nixpkgs/pkgs/development/libraries/db/generic.nix b/nixpkgs/pkgs/development/libraries/db/generic.nix
new file mode 100644
index 000000000000..a564db369fba
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/db/generic.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv, fetchurl
+, cxxSupport ? true
+, compat185 ? true
+, dbmSupport ? false
+
+# Options from inherited versions
+, version, sha256
+, extraPatches ? [ ]
+, license ? lib.licenses.sleepycat
+, drvArgs ? {}
+}:
+
+stdenv.mkDerivation (rec {
+  name = "db-${version}";
+
+  src = fetchurl {
+    url = "https://download.oracle.com/berkeley-db/${name}.tar.gz";
+    sha256 = sha256;
+  };
+
+  patches = extraPatches;
+
+  outputs = [ "bin" "out" "dev" ];
+
+  configureFlags =
+    [
+      (if cxxSupport then "--enable-cxx" else "--disable-cxx")
+      (if compat185 then "--enable-compat185" else "--disable-compat185")
+    ]
+    ++ lib.optional dbmSupport "--enable-dbm"
+    ++ lib.optional stdenv.isFreeBSD "--with-pic";
+
+  preConfigure = ''
+    cd build_unix
+    configureScript=../dist/configure
+  '';
+
+  postInstall = ''
+    rm -rf $out/docs
+  '';
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  checkPhase = ''
+    make examples_c examples_cxx
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/index.html";
+    description = "Berkeley DB";
+    license = license;
+    platforms = platforms.unix;
+  };
+} // drvArgs)
diff --git a/nixpkgs/pkgs/development/libraries/dbus-cplusplus/default.nix b/nixpkgs/pkgs/development/libraries/dbus-cplusplus/default.nix
new file mode 100644
index 000000000000..731c038527ce
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dbus-cplusplus/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchurl, dbus, glib, pkg-config, expat }:
+
+stdenv.mkDerivation rec {
+  pname = "dbus-cplusplus";
+  version = "0.9.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/dbus-cplusplus/dbus-c%2B%2B/0.9.0/libdbus-c%2B%2B-0.9.0.tar.gz";
+    name = "${pname}-${version}.tar.gz";
+    sha256 = "0qafmy2i6dzx4n1dqp6pygyy6gjljnb7hwjcj2z11c1wgclsq4dw";
+  };
+
+  patches = [
+    (fetchurl {
+      name = "gcc-4.7.patch";
+      url = "http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-libs/"
+          + "dbus-c%2B%2B/files/dbus-c%2B%2B-0.9.0-gcc-4.7.patch";
+      sha256 = "0rwcz9pvc13b3yfr0lkifnfz0vb5q6dg240bzgf37ni4s8rpc72g";
+    })
+    (fetchurl {
+      name = "writechar.patch"; # since gcc7
+      url = "https://src.fedoraproject.org/cgit/rpms/dbus-c++.git/plain/"
+          + "dbus-c++-writechar.patch?id=7f371172f5c";
+      sha256 = "1kkg4gbpm4hp87l25zw2a3r9c58g7vvgzcqgiman734i66zsbb9l";
+    })
+    (fetchurl {
+      name = "threading.patch"; # since gcc7
+      url = "https://src.fedoraproject.org/cgit/rpms/dbus-c++.git/plain/"
+          + "dbus-c++-threading.patch?id=7f371172f5c";
+      sha256 = "1h362anx3wyxm5lq0v8girmip1jmkdbijrmbrq7k5pp47zkhwwrq";
+    })
+  ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dbus glib expat ];
+
+  configureFlags = [ "--disable-ecore" "--disable-tests" ];
+
+  meta = with lib; {
+    homepage = "http://dbus-cplusplus.sourceforge.net";
+    description = "C++ API for D-BUS";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dbus-glib/default.nix b/nixpkgs/pkgs/development/libraries/dbus-glib/default.nix
new file mode 100644
index 000000000000..0bab4eb1949e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dbus-glib/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, buildPackages
+, pkg-config, expat, gettext, libiconv, dbus, glib
+}:
+
+stdenv.mkDerivation rec {
+  name = "dbus-glib-0.112";
+
+  src = fetchurl {
+    url = "${meta.homepage}/releases/dbus-glib/${name}.tar.gz";
+    sha256 = "sha256-fVUNzN/NKG4ziVUBgp7Zce62XGFOc6rbSgiu73GbFDo=";
+  };
+
+  outputs = [ "out" "dev" "devdoc" ];
+  outputBin = "dev";
+
+  nativeBuildInputs = [ pkg-config gettext glib ];
+
+  buildInputs = [ expat libiconv ];
+
+  propagatedBuildInputs = [ dbus glib ];
+
+  configureFlags = [ "--exec-prefix=${placeholder "dev"}" ] ++
+    lib.optional (stdenv.buildPlatform != stdenv.hostPlatform)
+      "--with-dbus-binding-tool=${buildPackages.dbus-glib.dev}/bin/dbus-binding-tool";
+
+  doCheck = false;
+
+  passthru = { inherit dbus glib; };
+
+  meta = {
+    homepage = "https://dbus.freedesktop.org";
+    license = with lib.licenses; [ afl21 gpl2Plus ];
+    description = "Obsolete glib bindings for D-Bus lightweight IPC mechanism";
+    maintainers = [ ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dbus-sharp-glib/dbus-sharp-glib-1.0.nix b/nixpkgs/pkgs/development/libraries/dbus-sharp-glib/dbus-sharp-glib-1.0.nix
new file mode 100644
index 000000000000..f47c91ca3eaf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dbus-sharp-glib/dbus-sharp-glib-1.0.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, mono, dbus-sharp-1_0 }:
+
+stdenv.mkDerivation rec {
+  pname = "dbus-sharp-glib";
+  version = "0.5";
+
+  src = fetchFromGitHub {
+    owner = "mono";
+    repo = "dbus-sharp-glib";
+
+    rev = "v${version}";
+    sha256 = "0z8ylzby8n5sar7aywc8rngd9ap5qqznadsscp5v34cacdfz1gxm";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+  buildInputs = [ mono dbus-sharp-1_0 ];
+
+  dontStrip = true;
+
+  meta = with lib; {
+    description = "D-Bus for .NET: GLib integration module";
+    platforms = platforms.linux;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dbus-sharp-glib/default.nix b/nixpkgs/pkgs/development/libraries/dbus-sharp-glib/default.nix
new file mode 100644
index 000000000000..65cd89043663
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dbus-sharp-glib/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, mono, dbus-sharp-2_0, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "dbus-sharp-glib";
+  version = "0.6";
+
+  src = fetchFromGitHub {
+    owner = "mono";
+    repo = "dbus-sharp-glib";
+
+    rev = "v${version}";
+    sha256 = "0i39kfg731as6j0hlmasgj8dyw5xsak7rl2dlimi1naphhffwzm8";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+  buildInputs = [ mono dbus-sharp-2_0 ];
+
+  dontStrip = true;
+
+  meta = with lib; {
+    description = "D-Bus for .NET: GLib integration module";
+    platforms = platforms.linux;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dbus-sharp/dbus-sharp-1.0.nix b/nixpkgs/pkgs/development/libraries/dbus-sharp/dbus-sharp-1.0.nix
new file mode 100644
index 000000000000..eb1b20e29eb1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dbus-sharp/dbus-sharp-1.0.nix
@@ -0,0 +1,25 @@
+{lib, stdenv, fetchFromGitHub, pkg-config, mono, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "dbus-sharp";
+  version = "0.7";
+
+  src = fetchFromGitHub {
+    owner = "mono";
+    repo = "dbus-sharp";
+
+    rev = "v${version}";
+    sha256 = "13qlqx9wqahfpzzl59157cjxprqcx2bd40w5gb2bs3vdx058p562";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+  buildInputs = [ mono ];
+
+  dontStrip = true;
+
+  meta = with lib; {
+    description = "D-Bus for .NET";
+    platforms = platforms.linux;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dbus-sharp/default.nix b/nixpkgs/pkgs/development/libraries/dbus-sharp/default.nix
new file mode 100644
index 000000000000..c64d7bbef992
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dbus-sharp/default.nix
@@ -0,0 +1,28 @@
+{lib, stdenv, fetchFromGitHub, pkg-config, mono4, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "dbus-sharp";
+  version = "0.8.1";
+
+  src = fetchFromGitHub {
+    owner = "mono";
+    repo = "dbus-sharp";
+
+    rev = "v${version}";
+    sha256 = "1g5lblrvkd0wnhfzp326by6n3a9mj2bj7a7646g0ziwgsxp5w6y7";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+
+  # Use msbuild when https://github.com/NixOS/nixpkgs/pull/43680 is merged
+  # See: https://github.com/NixOS/nixpkgs/pull/46060
+  buildInputs = [ mono4 ];
+
+  dontStrip = true;
+
+  meta = with lib; {
+    description = "D-Bus for .NET";
+    platforms = platforms.linux;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dbus/default.nix b/nixpkgs/pkgs/development/libraries/dbus/default.nix
new file mode 100644
index 000000000000..1d1df0d24fc7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dbus/default.nix
@@ -0,0 +1,122 @@
+{ stdenv
+, lib
+, fetchurl
+, pkg-config
+, expat
+, enableSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isMusl
+, systemd
+, audit
+, libapparmor
+, libX11 ? null
+, libICE ? null
+, libSM ? null
+, x11Support ? (stdenv.isLinux || stdenv.isDarwin)
+, dbus
+, docbook_xml_dtd_44
+, docbook-xsl-nons
+, xmlto
+}:
+
+stdenv.mkDerivation rec {
+  pname = "dbus";
+  version = "1.12.20";
+
+  src = fetchurl {
+    url = "https://dbus.freedesktop.org/releases/dbus/dbus-${version}.tar.gz";
+    sha256 = "1zp5gpx61v1cpqf2zwb1cidhp9xylvw49d3zydkxqk6b1qa20xpp";
+  };
+
+  patches = [
+    # 'generate.consistent.ids=1' ensures reproducible docs, for further details see
+    # http://docbook.sourceforge.net/release/xsl/current/doc/html/generate.consistent.ids.html
+    # Also applied upstream in https://gitlab.freedesktop.org/dbus/dbus/-/merge_requests/189,
+    # expected in version 1.14
+    ./docs-reproducible-ids.patch
+  ] ++ (lib.optional stdenv.isSunOS ./implement-getgrouplist.patch);
+
+  postPatch = ''
+    substituteInPlace tools/Makefile.in \
+      --replace 'install-localstatelibDATA:' 'disabled:' \
+      --replace 'install-data-local:' 'disabled:' \
+      --replace 'installcheck-local:' 'disabled:'
+    substituteInPlace bus/Makefile.in \
+      --replace '$(mkinstalldirs) $(DESTDIR)$(localstatedir)/run/dbus' ':'
+  '' + /* cleanup of runtime references */ ''
+    substituteInPlace ./dbus/dbus-sysdeps-unix.c \
+      --replace 'DBUS_BINDIR "/dbus-launch"' "\"$lib/bin/dbus-launch\""
+    substituteInPlace ./tools/dbus-launch.c \
+      --replace 'DBUS_DAEMONDIR"/dbus-daemon"' '"/run/current-system/sw/bin/dbus-daemon"'
+  '';
+
+  outputs = [ "out" "dev" "lib" "doc" "man" ];
+
+  nativeBuildInputs = [
+    pkg-config
+    docbook_xml_dtd_44
+    docbook-xsl-nons
+    xmlto
+  ];
+
+  propagatedBuildInputs = [
+    expat
+  ];
+
+  buildInputs =
+    lib.optionals x11Support [
+      libX11
+      libICE
+      libSM
+    ] ++ lib.optional enableSystemd systemd
+    ++ lib.optionals stdenv.isLinux [ audit libapparmor ];
+  # ToDo: optional selinux?
+
+  configureFlags = [
+    "--enable-user-session"
+    "--enable-xml-docs"
+    "--libexecdir=${placeholder "out"}/libexec"
+    "--datadir=/etc"
+    "--localstatedir=/var"
+    "--runstatedir=/run"
+    "--sysconfdir=/etc"
+    "--with-session-socket-dir=/tmp"
+    "--with-system-pid-file=/run/dbus/pid"
+    "--with-system-socket=/run/dbus/system_bus_socket"
+    "--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
+    "--with-systemduserunitdir=${placeholder "out"}/etc/systemd/user"
+  ] ++ lib.optional (!x11Support) "--without-x"
+  ++ lib.optionals stdenv.isLinux [ "--enable-apparmor" "--enable-libaudit" ];
+
+  # Enable X11 autolaunch support in libdbus. This doesn't actually depend on X11
+  # (it just execs dbus-launch in dbus.tools), contrary to what the configure script demands.
+  # problems building without x11Support so disabled in that case for now
+  NIX_CFLAGS_COMPILE = lib.optionalString x11Support "-DDBUS_ENABLE_X11_AUTOLAUNCH=1";
+  NIX_CFLAGS_LINK = lib.optionalString (!stdenv.isDarwin) "-Wl,--as-needed";
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  installFlags = [
+    "sysconfdir=${placeholder "out"}/etc"
+    "datadir=${placeholder "out"}/share"
+  ];
+
+  # it's executed from $lib by absolute path
+  postFixup = ''
+    moveToOutput bin/dbus-launch "$lib"
+    ln -s "$lib/bin/dbus-launch" "$out/bin/"
+  '';
+
+  passthru = {
+    dbus-launch = "${dbus.lib}/bin/dbus-launch";
+    daemon = dbus.out;
+  };
+
+  meta = with lib; {
+    description = "Simple interprocess messaging system";
+    homepage = "http://www.freedesktop.org/wiki/Software/dbus/";
+    license = licenses.gpl2Plus; # most is also under AFL-2.1
+    maintainers = teams.freedesktop.members ++ (with maintainers; [ ]);
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dbus/docs-reproducible-ids.patch b/nixpkgs/pkgs/development/libraries/dbus/docs-reproducible-ids.patch
new file mode 100644
index 000000000000..2356b64d95cf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dbus/docs-reproducible-ids.patch
@@ -0,0 +1,15 @@
+diff --color -Naur dbus-1.12.20-original/doc/Makefile.in dbus-1.12.20-hacked2/doc/Makefile.in
+--- dbus-1.12.20-original/doc/Makefile.in	2020-07-02 12:10:41.000000000 +0200
++++ dbus-1.12.20-hacked2/doc/Makefile.in	2020-11-07 09:57:15.297694773 +0100
+@@ -870,8 +870,10 @@
+ .PRECIOUS: Makefile
+ 
+ 
++# 'generate.consistent.ids=1' ensures reproducible docs, for further details see
++# http://docbook.sourceforge.net/release/xsl/current/doc/html/generate.consistent.ids.html
+ @DBUS_XML_DOCS_ENABLED_TRUE@%.html: %.xml
+-@DBUS_XML_DOCS_ENABLED_TRUE@	$(XMLTO) html-nochunks $<
++@DBUS_XML_DOCS_ENABLED_TRUE@	$(XMLTO) --stringparam generate.consistent.ids=1 html-nochunks $<
+ 
+ @DBUS_XML_DOCS_ENABLED_TRUE@%.1: %.1.xml
+ @DBUS_XML_DOCS_ENABLED_TRUE@	$(XMLTO) man $<
diff --git a/nixpkgs/pkgs/development/libraries/dbus/implement-getgrouplist.patch b/nixpkgs/pkgs/development/libraries/dbus/implement-getgrouplist.patch
new file mode 100644
index 000000000000..e3a4a25cb720
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dbus/implement-getgrouplist.patch
@@ -0,0 +1,108 @@
+Compatibility patch for Illumos/Solaris and possibly other platforms.
+Implements getgrouplist when not provided by OS.
+Without it, only the user's primary group is used in authentication!
+--- 	1970-01-01 00:00:00.000000000 +0000
++++ dbus-1.6.8/dbus/getgrouplist.c	2013-02-28 13:10:51.081792722 +0000
+@@ -0,0 +1,89 @@
++/*	$OpenBSD: getgrouplist.c,v 1.12 2005/08/08 08:05:34 espie Exp $ */
++/*
++ * Copyright (c) 1991, 1993
++ *	The Regents of the University of California.  All rights reserved.
++ *
++ * Redistribution and use in source and binary forms, with or without
++ * modification, are permitted provided that the following conditions
++ * are met:
++ * 1. Redistributions of source code must retain the above copyright
++ *    notice, this list of conditions and the following disclaimer.
++ * 2. Redistributions in binary form must reproduce the above copyright
++ *    notice, this list of conditions and the following disclaimer in the
++ *    documentation and/or other materials provided with the distribution.
++ * 3. Neither the name of the University nor the names of its contributors
++ *    may be used to endorse or promote products derived from this software
++ *    without specific prior written permission.
++ *
++ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
++ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
++ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
++ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
++ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
++ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
++ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
++ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
++ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
++ * SUCH DAMAGE.
++ */
++
++/* OPENBSD ORIGINAL: lib/libc/gen/getgrouplist.c */
++
++/*
++ * get credential
++ */
++#include <sys/types.h>
++#include <string.h>
++#include <unistd.h>
++#include <grp.h>
++
++int
++getgrouplist(const char *uname, gid_t agroup, gid_t *groups, int *grpcnt)
++{
++	struct group *grp;
++	int i, ngroups;
++	int ret, maxgroups;
++	int bail;
++
++	ret = 0;
++	ngroups = 0;
++	maxgroups = *grpcnt;
++
++	/*
++	 * install primary group
++	 */
++	if (ngroups >= maxgroups) {
++		*grpcnt = ngroups;
++		return (-1);
++	}
++	groups[ngroups++] = agroup;
++
++	/*
++	 * Scan the group file to find additional groups.
++	 */
++	setgrent();
++	while ((grp = getgrent())) {
++		if (grp->gr_gid == agroup)
++			continue;
++		for (bail = 0, i = 0; bail == 0 && i < ngroups; i++)
++			if (groups[i] == grp->gr_gid)
++				bail = 1;
++		if (bail)
++			continue;
++		for (i = 0; grp->gr_mem[i]; i++) {
++			if (!strcmp(grp->gr_mem[i], uname)) {
++				if (ngroups >= maxgroups) {
++					ret = -1;
++					goto out;
++				}
++				groups[ngroups++] = grp->gr_gid;
++				break;
++			}
++		}
++	}
++out:
++	endgrent();
++	*grpcnt = ngroups;
++	return (ret);
++}
+--- dbus-1.6.8/dbus/dbus-sysdeps-unix.c.orig	2013-02-28 13:08:52.171215237 +0000
++++ dbus-1.6.8/dbus/dbus-sysdeps-unix.c	2013-02-28 13:13:52.224615146 +0000
+@@ -21,6 +21,10 @@
+  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
+  *
+  */
++#ifndef HAVE_GETGROUPLIST
++#include "getgrouplist.c"
++#define HAVE_GETGROUPLIST
++#endif
+ 
+ #include <config.h>
+ 
diff --git a/nixpkgs/pkgs/development/libraries/dbus/make-dbus-conf.nix b/nixpkgs/pkgs/development/libraries/dbus/make-dbus-conf.nix
new file mode 100644
index 000000000000..ce5c0b3b5772
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dbus/make-dbus-conf.nix
@@ -0,0 +1,45 @@
+{ runCommand, writeText, libxslt, dbus
+, serviceDirectories ? []
+, suidHelper ? "/var/setuid-wrappers/dbus-daemon-launch-helper"
+, apparmor ? "disabled" # one of enabled, disabled, required
+}:
+
+/* DBus has two configuration parsers -- normal and "trivial", which is used
+ * for suid helper. Unfortunately the latter doesn't support <include>
+ * directive. That means that we can't just place our configuration to
+ * *-local.conf -- it needs to be in the main configuration file.
+ */
+runCommand "dbus-1"
+  {
+    inherit serviceDirectories suidHelper apparmor;
+    preferLocalBuild = true;
+    allowSubstitutes = false;
+    XML_CATALOG_FILES = writeText "dbus-catalog.xml" ''
+      <?xml version="1.0"?>
+      <!DOCTYPE catalog PUBLIC
+        "-//OASIS//DTD Entity Resolution XML Catalog V1.0//EN"
+        "http://www.oasis-open.org/committees/entity/release/1.0/catalog.dtd">
+
+      <catalog xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
+        <rewriteSystem
+          systemIdStartString="http://www.freedesktop.org/standards/dbus/1.0/"
+          rewritePrefix="file://${dbus}/share/xml/dbus-1/"/>
+      </catalog>
+    '';
+    nativeBuildInputs = [ libxslt.bin ];
+  }
+  ''
+    mkdir -p $out
+
+    xsltproc --nonet \
+      --stringparam serviceDirectories "$serviceDirectories" \
+      --stringparam suidHelper "$suidHelper" \
+      --stringparam apparmor "$apparmor" \
+      ${./make-system-conf.xsl} ${dbus}/share/dbus-1/system.conf \
+      > $out/system.conf
+    xsltproc --nonet \
+      --stringparam serviceDirectories "$serviceDirectories" \
+      --stringparam apparmor "$apparmor" \
+      ${./make-session-conf.xsl} ${dbus}/share/dbus-1/session.conf \
+      > $out/session.conf
+  ''
diff --git a/nixpkgs/pkgs/development/libraries/dbus/make-session-conf.xsl b/nixpkgs/pkgs/development/libraries/dbus/make-session-conf.xsl
new file mode 100644
index 000000000000..a744905cdd39
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dbus/make-session-conf.xsl
@@ -0,0 +1,36 @@
+<?xml version="1.0"?>
+
+<!--
+  This script copies the original system.conf from the dbus
+  distribution, but sets paths from $serviceDirectories parameter
+  and suid helper from $suidHelper parameter.
+-->
+
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:str="http://exslt.org/strings"
+                extension-element-prefixes="str"
+                >
+
+  <xsl:output method='xml' encoding="UTF-8" doctype-system="busconfig.dtd" />
+
+  <xsl:param name="serviceDirectories" />
+  <xsl:param name="apparmor" />
+
+  <xsl:template match="/busconfig">
+    <busconfig>
+      <!-- We leave <standard_session_servicedirs/> because it includes XDG dirs and therefore user Nix profile. -->
+      <xsl:copy-of select="child::node()[name() != 'include' and name() != 'servicedir' and name() != 'includedir']" />
+
+      <!-- configure AppArmor -->
+      <apparmor mode="{$apparmor}"/>
+
+      <xsl:for-each select="str:tokenize($serviceDirectories)">
+        <servicedir><xsl:value-of select="." />/share/dbus-1/services</servicedir>
+        <includedir><xsl:value-of select="." />/etc/dbus-1/session.d</includedir>
+        <includedir><xsl:value-of select="." />/share/dbus-1/session.d</includedir>
+      </xsl:for-each>
+    </busconfig>
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/nixpkgs/pkgs/development/libraries/dbus/make-system-conf.xsl b/nixpkgs/pkgs/development/libraries/dbus/make-system-conf.xsl
new file mode 100644
index 000000000000..06233e764e16
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dbus/make-system-conf.xsl
@@ -0,0 +1,39 @@
+<?xml version="1.0"?>
+
+<!--
+  This script copies the original system.conf from the dbus
+  distribution, but sets paths from $serviceDirectories parameter
+  and suid helper from $suidHelper parameter.
+-->
+
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:str="http://exslt.org/strings"
+                extension-element-prefixes="str"
+                >
+
+  <xsl:output method='xml' encoding="UTF-8" doctype-system="busconfig.dtd" />
+
+  <xsl:param name="serviceDirectories" />
+  <xsl:param name="suidHelper" />
+  <xsl:param name="apparmor" />
+
+  <xsl:template match="/busconfig">
+    <busconfig>
+      <xsl:copy-of select="child::node()[name() != 'include' and name() != 'standard_system_servicedirs' and name() != 'servicehelper' and name() != 'servicedir' and name() != 'includedir']" />
+
+      <!-- configure AppArmor -->
+      <apparmor mode="{$apparmor}"/>
+
+      <!-- set suid helper -->
+      <servicehelper><xsl:value-of select="$suidHelper" /></servicehelper>
+
+      <xsl:for-each select="str:tokenize($serviceDirectories)">
+        <servicedir><xsl:value-of select="." />/share/dbus-1/system-services</servicedir>
+        <includedir><xsl:value-of select="." />/etc/dbus-1/system.d</includedir>
+        <includedir><xsl:value-of select="." />/share/dbus-1/system.d</includedir>
+      </xsl:for-each>
+    </busconfig>
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/nixpkgs/pkgs/development/libraries/dbxml/cxx11.patch b/nixpkgs/pkgs/development/libraries/dbxml/cxx11.patch
new file mode 100644
index 000000000000..f264515c7d67
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dbxml/cxx11.patch
@@ -0,0 +1,59 @@
+diff -urN dbxml-6.1.4.orig/dbxml/src/dbxml/nodeStore/NsUpdate.cpp dbxml-6.1.4/dbxml/src/dbxml/nodeStore/NsUpdate.cpp
+--- dbxml-6.1.4.orig/dbxml/src/dbxml/nodeStore/NsUpdate.cpp	2017-05-01 16:05:29.000000000 +0100
++++ dbxml-6.1.4/dbxml/src/dbxml/nodeStore/NsUpdate.cpp	2017-09-04 11:50:20.000000000 +0100
+@@ -1359,21 +1359,13 @@
+ void NsUpdate::attributeRemoved(const DbXmlNodeImpl &node)
+ {
+ 	string key = makeKey(node);
+-#if defined(_MSC_VER) && (_MSC_VER>1600)
+ 	attrMap_.insert(make_pair(key,node.getIndex()));
+-#else
+-	attrMap_.insert(make_pair<const std::string, int>(key,node.getIndex()));
+-#endif
+ }
+ 
+ void NsUpdate::textRemoved(const DbXmlNodeImpl &node)
+ {
+ 	string key = makeKey(node);
+-#if defined(_MSC_VER) && (_MSC_VER>1600)
+ 	textDeleteMap_.insert(make_pair(key,node.getIndex()));
+-#else
+-	textDeleteMap_.insert(make_pair<const std::string, int>(key,node.getIndex()));
+-#endif
+ }
+ 
+ void NsUpdate::textRemoved(int index, const NsNid &nid,
+@@ -1381,21 +1373,13 @@
+ 			   const std::string &cname)
+ {
+ 	string key = makeKey(nid, did, cname);
+-#if defined(_MSC_VER) && (_MSC_VER>1600)
+ 	textDeleteMap_.insert(make_pair(key,index));
+-#else
+-	textDeleteMap_.insert(make_pair<const std::string, int>(key,index));
+-#endif
+ }
+ 
+ void NsUpdate::textInserted(int index, const DbXmlNodeImpl &node)
+ {
+ 	string key = makeKey(node);
+-#if defined(_MSC_VER) && (_MSC_VER>1600)
+ 	textInsertMap_.insert(make_pair(key,index));
+-#else
+-	textInsertMap_.insert(make_pair<const std::string, int>(key,index));
+-#endif
+ }
+ 
+ void NsUpdate::textInserted(int index, const NsNid &nid,
+@@ -1403,11 +1387,7 @@
+ 			    const std::string &cname)
+ {
+ 	string key = makeKey(nid, did, cname);
+-#if defined(_MSC_VER) && (_MSC_VER>1600)
+ 	textInsertMap_.insert(make_pair(key,index));
+-#else
+-	textInsertMap_.insert(make_pair<const std::string, int>(key,index));
+-#endif
+ }
+ 
+ //
diff --git a/nixpkgs/pkgs/development/libraries/dbxml/default.nix b/nixpkgs/pkgs/development/libraries/dbxml/default.nix
new file mode 100644
index 000000000000..b4e74d036191
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dbxml/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchurl, db62, xercesc, xqilla }:
+
+stdenv.mkDerivation rec {
+  pname = "dbxml";
+  version = "6.1.4";
+
+  src = fetchurl {
+    url = "http://download.oracle.com/berkeley-db/${pname}-${version}.tar.gz";
+    sha256 = "a8fc8f5e0c3b6e42741fa4dfc3b878c982ff8f5e5f14843f6a7e20d22e64251a";
+  };
+
+  outputs = [ "bin" "dev" "out" ];
+
+  patches = [
+    ./cxx11.patch
+    ./incorrect-optimization.patch
+  ];
+
+  buildInputs = [
+    xercesc xqilla
+  ];
+
+  propagatedBuildInputs = [
+    db62
+  ];
+
+  configureFlags = [
+    "--with-berkeleydb=${db62.out}"
+    "--with-xerces=${xercesc}"
+    "--with-xqilla=${xqilla}"
+  ];
+
+  preConfigure = ''
+    cd dbxml
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.oracle.com/database/berkeley-db/xml.html";
+    description = "Embeddable XML database based on Berkeley DB";
+    license = licenses.agpl3;
+    maintainers = with maintainers; [ danieldk ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dbxml/incorrect-optimization.patch b/nixpkgs/pkgs/development/libraries/dbxml/incorrect-optimization.patch
new file mode 100644
index 000000000000..630dc972e188
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dbxml/incorrect-optimization.patch
@@ -0,0 +1,34 @@
+Patch provided by Lauren Foutz. See:
+https://community.oracle.com/thread/4093422
+
+--- dbxml-6.1.4-orig/dbxml/src/dbxml/query/ParentOfChildJoinQP.cpp
++++ dbxml-6.1.4/dbxml/src/dbxml/query/ParentOfChildJoinQP.cpp
+@@ -139,28 +139,16 @@ bool ParentOfChildIterator::doJoin(Dynam
+ 
+ 	// Invarient 4: When ancestorStack_ is empty we can output the
+ 	// buffered results_, since any more results will come after them in
+ 	// document order.
+ 
+ 	while(true) {
+ 		context->testInterrupt();
+ 
+-		/* 
+-		 * If current parent's node level already be larger than
+-		 * childen's, abandon current parent and move to next one.
+-		 */
+-		if (parents_ != NULL && 
+-		    parents_->getNodeLevel() > children_->getNodeLevel()) {
+-			if(!parents_->next(context)) {
+-				delete parents_;
+-				parents_ = 0;
+-			}
+-		}
+-
+ 		int cmp = parents_ == 0 ? -1 : isDescendantOf(children_, parents_, /*orSelf*/false);
+ 		if(cmp < 0) {
+ 			if(!ancestorStack_.empty()) {
+ 				// We've found the closest ancestor - is it a parent?
+ 				if(ancestorStack_.back()->getNodeLevel() == (children_->getNodeLevel() - 1)) {
+ 					// Maintain invarient 3
+ 					if(results_.empty() || NodeInfo::compare(results_.back(), ancestorStack_.back()) < 0)
+ 						results_.push_back(ancestorStack_.back());
diff --git a/nixpkgs/pkgs/development/libraries/dclib/default.nix b/nixpkgs/pkgs/development/libraries/dclib/default.nix
new file mode 100644
index 000000000000..b393b74f2b2f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dclib/default.nix
@@ -0,0 +1,19 @@
+{lib, stdenv, fetchurl, libxml2, openssl, bzip2}:
+
+stdenv.mkDerivation {
+  name = "dclib-0.3.7";
+
+  src = fetchurl {
+    url = "ftp://ftp.debian.nl/pub/freebsd/ports/distfiles/dclib-0.3.7.tar.bz2";
+    sha256 = "02jdzm5hqzs1dv2rd596vgpcjaapm55pqqapz5m94l30v4q72rfc";
+  };
+
+  buildInputs = [libxml2 openssl bzip2];
+
+  meta = with lib; {
+    description = "Peer-to-Peer file sharing client";
+    homepage = "http://dcgui.berlios.de";
+    platforms = platforms.linux;
+    license = [ licenses.openssl licenses.gpl2 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dclxvi/default.nix b/nixpkgs/pkgs/development/libraries/dclxvi/default.nix
new file mode 100644
index 000000000000..8d7dc5a01781
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dclxvi/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation {
+  name = "dclxvi-2013-01-27";
+
+  src = fetchFromGitHub {
+    owner = "agl";
+    repo = "dclxvi";
+    rev = "74009d58f2305be3b95d88717619bde8ecbdd9a2";
+    sha256 = "1kx4h8iv7yb30c6zjmj8zs9x12vxhi0jwkiwxsxj9swf6bww6p1g";
+  };
+
+  buildFlags = [ "libdclxvipairing.so" ];
+
+  patchPhase = ''
+    substituteInPlace Makefile \
+      --replace "gcc" "cc"
+  '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace Makefile \
+      --replace "-soname=libdclxvipairing.so" "-install_name,libdclxvipairing.so"
+  '';
+
+  installPhase = ''
+    mkdir -p $out/{include,lib}
+    find . -name \*.h -exec cp {} $out/include \;
+    find . -name \*.so -exec cp {} $out/lib \;
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/agl/dclxvi";
+    description = "Naehrig, Niederhagen and Schwabe's pairings code, massaged into a shared library";
+    platforms = platforms.x86_64;
+    license = licenses.publicDomain;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dconf/default.nix b/nixpkgs/pkgs/development/libraries/dconf/default.nix
new file mode 100644
index 000000000000..550940f5a1e7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dconf/default.nix
@@ -0,0 +1,76 @@
+{ lib, stdenv
+, fetchurl
+, meson
+, ninja
+, python3
+, vala
+, libxslt
+, pkg-config
+, glib
+, bash-completion
+, dbus
+, gnome
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_42
+}:
+let
+  isCross = (stdenv.hostPlatform != stdenv.buildPlatform);
+in
+stdenv.mkDerivation rec {
+  pname = "dconf";
+  version = "0.40.0";
+
+  outputs = [ "out" "lib" "dev" ]
+    ++ lib.optional (!isCross) "devdoc";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0cs5nayg080y8pb9b7qccm1ni8wkicdmqp1jsgc22110r6j24zyg";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    python3
+    libxslt
+    glib
+    docbook-xsl-nons
+    docbook_xml_dtd_42
+  ] ++ lib.optional (!isCross) gtk-doc;
+
+  buildInputs = [
+    glib
+    bash-completion
+    dbus
+  ] ++ lib.optional (!isCross) vala;
+  # Vala cross compilation is broken. For now, build dconf without vapi when cross-compiling.
+
+  mesonFlags = [
+    "--sysconfdir=/etc"
+    "-Dgtk_doc=${lib.boolToString (!isCross)}" # gtk-doc does do some gobject introspection, which doesn't yet cross-compile.
+  ] ++ lib.optional isCross "-Dvapi=false";
+
+  doCheck = !stdenv.isAarch32 && !stdenv.isAarch64 && !stdenv.isDarwin;
+
+  postPatch = ''
+    chmod +x meson_post_install.py tests/test-dconf.py
+    patchShebangs meson_post_install.py
+    patchShebangs tests/test-dconf.py
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Projects/dconf";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.unix;
+    maintainers = teams.gnome.members;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dee/default.nix b/nixpkgs/pkgs/development/libraries/dee/default.nix
new file mode 100644
index 000000000000..a023d164d8c3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dee/default.nix
@@ -0,0 +1,67 @@
+{ lib, stdenv
+, fetchgit
+, fetchpatch
+, pkg-config
+, glib
+, icu
+, gobject-introspection
+, dbus-glib
+, vala
+, python3
+, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "dee";
+  version = "unstable-2017-06-16";
+
+  outputs = [ "out" "dev" "py" ];
+
+  src = fetchgit {
+    url = "https://git.launchpad.net/ubuntu/+source/dee";
+    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/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 = [
+    pkg-config
+    vala
+    autoreconfHook
+    gobject-introspection
+    python3
+  ];
+
+  buildInputs = [
+    glib
+    icu
+    dbus-glib
+  ];
+
+  configureFlags = [
+    "--disable-gtk-doc"
+    "--with-pygi-overrides-dir=${placeholder "py"}/${python3.sitePackages}/gi/overrides"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A library that uses DBus to provide objects allowing you to create Model-View-Controller type programs across DBus";
+    homepage = "https://launchpad.net/dee";
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/directfb/default.nix b/nixpkgs/pkgs/development/libraries/directfb/default.nix
new file mode 100644
index 000000000000..1b0b50d28f00
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/directfb/default.nix
@@ -0,0 +1,68 @@
+{ stdenv, lib, fetchFromGitHub, fetchpatch
+, autoreconfHook, perl, pkg-config, flux, zlib
+, libjpeg, freetype, libpng, giflib
+, enableX11 ? true, xorg
+, enableSDL ? true, SDL }:
+
+stdenv.mkDerivation rec {
+  pname = "directfb";
+  version = "1.7.7";
+
+  src = fetchFromGitHub {
+    owner = "deniskropp";
+    repo = "DirectFB";
+    rev = "DIRECTFB_${lib.replaceStrings ["."] ["_"] version}";
+    sha256 = "0bs3yzb7hy3mgydrj8ycg7pllrd2b6j0gxj596inyr7ihssr3i0y";
+  };
+
+  patches = [
+    # Fixes build in "davinci" with glibc >= 2.28
+    # The "davinci" module is only enabled on 32-bit arm.
+    # https://github.com/deniskropp/DirectFB/pull/17
+    (fetchpatch {
+      url = "https://github.com/deniskropp/DirectFB/commit/3a236241bbec3f15b012b6f0dbe94353d8094557.patch";
+      sha256 = "0rj3gv0zlb225sqjz04p4yagy4xacf3210aa8vra8i1f0fv0w4kw";
+    })
+  ];
+
+  nativeBuildInputs = [ autoreconfHook perl pkg-config flux ];
+
+  buildInputs = [ zlib libjpeg freetype giflib libpng ]
+    ++ lib.optional enableSDL SDL
+    ++ lib.optionals enableX11 (with xorg; [
+      xorgproto libX11 libXext
+      libXrender
+    ]);
+
+  NIX_LDFLAGS = "-lgcc_s";
+
+  configureFlags = [
+    "--enable-sdl"
+    "--enable-zlib"
+    "--with-gfxdrivers=all"
+    "--enable-devmem"
+    "--enable-fbdev"
+    "--enable-mmx"
+    "--enable-sse"
+    "--with-software"
+    "--with-smooth-scaling"
+  ] ++ lib.optional enableX11 "--enable-x11";
+
+  meta = with lib; {
+    description = "Graphics and input library designed with embedded systems in mind";
+    longDescription = ''
+      DirectFB is a thin library that provides hardware graphics acceleration,
+      input device handling and abstraction, integrated windowing system with
+      support for translucent windows and multiple display layers, not only on
+      top of the Linux Framebuffer Device. It is a complete hardware
+      abstraction layer with software fallbacks for every graphics operation
+      that is not supported by the underlying hardware. DirectFB adds graphical
+      power to embedded systems and sets a new standard for graphics under
+      Linux.
+    '';
+    homepage = "https://github.com/deniskropp/DirectFB";
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/discord-rpc/default.nix b/nixpkgs/pkgs/development/libraries/discord-rpc/default.nix
new file mode 100644
index 000000000000..213096f5abf1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/discord-rpc/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, rapidjson
+, AppKit
+, buildExamples ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "discord-rpc";
+  version = "3.4.0";
+
+  src = fetchFromGitHub {
+    owner = "discordapp";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "04cxhqdv5r92lrpnhxf8702a8iackdf3sfk1050z7pijbijiql2a";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  buildInputs = [
+    rapidjson
+  ] ++ lib.optional stdenv.isDarwin AppKit;
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=true"
+    "-DBUILD_EXAMPLES=${lib.boolToString buildExamples}"
+  ];
+
+  meta = with lib; {
+    description = "Official library to interface with the Discord client";
+    homepage = "https://github.com/discordapp/discord-rpc";
+    license = licenses.mit;
+    maintainers = with maintainers; [ tadeokondrak ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dleyna-connector-dbus/default.nix b/nixpkgs/pkgs/development/libraries/dleyna-connector-dbus/default.nix
new file mode 100644
index 000000000000..a24e0b8d0144
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dleyna-connector-dbus/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, autoreconfHook, pkg-config, fetchFromGitHub, dbus, dleyna-core, glib }:
+
+stdenv.mkDerivation rec {
+  pname = "dleyna-connector-dbus";
+  version = "0.3.0";
+
+  src = fetchFromGitHub {
+    owner = "01org";
+    repo = pname;
+    rev = version;
+    sha256 = "0vziq5gwjm79yl2swch2mz6ias20nvfddf5cqgk9zbg25cb9m117";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ dbus dleyna-core glib ];
+
+  meta = with lib; {
+    description = "A D-Bus API for the dLeyna services";
+    homepage = "https://01.org/dleyna";
+    maintainers = [ maintainers.jtojnar ];
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dleyna-core/0001-Search-connectors-in-DLEYNA_CONNECTOR_PATH.patch b/nixpkgs/pkgs/development/libraries/dleyna-core/0001-Search-connectors-in-DLEYNA_CONNECTOR_PATH.patch
new file mode 100644
index 000000000000..cc50c1598005
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dleyna-core/0001-Search-connectors-in-DLEYNA_CONNECTOR_PATH.patch
@@ -0,0 +1,95 @@
+From bf549a028a5da122b7a4206529711b969c2ecd48 Mon Sep 17 00:00:00 2001
+From: Jan Tojnar <jtojnar@gmail.com>
+Date: Fri, 1 Sep 2017 13:49:06 +0200
+Subject: [PATCH] Search connectors in DLEYNA_CONNECTOR_PATH
+
+Previously, the connectors would only be looked for in a single
+directory, specified during compilation. This patch allows to
+traverse a list of directories provided by an environment variable.
+---
+ libdleyna/core/connector-mgr.c | 63 ++++++++++++++++++++++++++++--------------
+ 1 file changed, 42 insertions(+), 21 deletions(-)
+
+diff --git a/libdleyna/core/connector-mgr.c b/libdleyna/core/connector-mgr.c
+index eafb16c..8041c67 100644
+--- a/libdleyna/core/connector-mgr.c
++++ b/libdleyna/core/connector-mgr.c
+@@ -34,33 +34,54 @@ const dleyna_connector_t *dleyna_connector_mgr_load(const gchar *name)
+ 	const dleyna_connector_t *connector;
+ 	dleyna_connector_get_interface_t get_interface;
+ 	gchar *path;
++	const gchar *connector_path;
++	gchar **connector_path_list;
++	gsize i;
+ 
+ 	DLEYNA_LOG_DEBUG("Enter");
+ 
+-	path = g_strdup_printf("%s/%s%s.so", CONNECTOR_DIR,
+-			       DLEYNA_CONNECTOR_LIB_PATTERN, name);
+-	module = g_module_open(path, G_MODULE_BIND_LAZY);
+-	g_free(path);
++	connector_path = g_getenv ("DLEYNA_CONNECTOR_PATH");
++	if (!connector_path) {
++		DLEYNA_LOG_DEBUG ("DLEYNA_CONNECTOR_PATH not set");
++		connector_path = CONNECTOR_DIR;
++	} else {
++		DLEYNA_LOG_DEBUG ("DLEYNA_CONNECTOR_PATH set to %s", connector_path);
++	}
++
++	connector_path_list = g_strsplit (connector_path, G_SEARCHPATH_SEPARATOR_S, 0);
++
++	for (i = 0; connector_path_list[i]; i++) {
++		path = g_strdup_printf("%s/%s%s.so", connector_path_list[i],
++				       DLEYNA_CONNECTOR_LIB_PATTERN, name);
++		module = g_module_open(path, G_MODULE_BIND_LAZY);
++		g_free(path);
++
++		if (module) {
++			if (!g_connectors)
++				g_connectors = g_hash_table_new(g_direct_hash,
++								g_direct_equal);
++
++			if (g_module_symbol(module, "dleyna_connector_get_interface",
++					    (gpointer *)&get_interface)) {
++				connector = get_interface();
++				g_hash_table_insert(g_connectors, (gpointer)connector,
++						    module);
++
++				break;
++			} else {
++				connector = NULL;
++				g_module_close(module);
++				DLEYNA_LOG_CRITICAL(
++						"Connector '%s' entry point not found",
++						name);
++			}
+ 
+-	if (module) {
+-		if (!g_connectors)
+-			g_connectors = g_hash_table_new(g_direct_hash,
+-							g_direct_equal);
+-
+-		if (g_module_symbol(module, "dleyna_connector_get_interface",
+-				    (gpointer *)&get_interface)) {
+-			connector = get_interface();
+-			g_hash_table_insert(g_connectors, (gpointer)connector,
+-					    module);
+-		} else {
+-			connector = NULL;
+-			g_module_close(module);
+-			DLEYNA_LOG_CRITICAL(
+-					"Connector '%s' entry point not found",
+-					name);
+ 		}
++	}
+ 
+-	} else {
++	g_strfreev (connector_path_list);
++
++	if (!module) {
+ 		connector = NULL;
+ 		DLEYNA_LOG_CRITICAL("Connector '%s' not found", name);
+ 	}
+-- 
+2.14.1
+
diff --git a/nixpkgs/pkgs/development/libraries/dleyna-core/default.nix b/nixpkgs/pkgs/development/libraries/dleyna-core/default.nix
new file mode 100644
index 000000000000..4a4eecfdc0f2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dleyna-core/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv
+, fetchFromGitHub
+, fetchpatch
+, autoreconfHook
+, pkg-config
+, gupnp
+}:
+
+stdenv.mkDerivation rec {
+  pname = "dleyna-core";
+  version = "0.6.0";
+
+  setupHook = ./setup-hook.sh;
+
+  src = fetchFromGitHub {
+    owner = "01org";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1x5vj5zfk95avyg6g3nf6gar250cfrgla2ixj2ifn8pcick2d9vq";
+  };
+
+  patches = [
+    ./0001-Search-connectors-in-DLEYNA_CONNECTOR_PATH.patch
+
+    # fix build with gupnp 1.2
+    # https://github.com/intel/dleyna-core/pull/52
+    (fetchpatch {
+      url = "https://github.com/intel/dleyna-core/commit/41b2e56f67b6fc9c8c256b86957d281644b9b846.patch";
+      sha256 = "1h758cp65v7qyfpvyqdri7q0gwx85mhdpkb2y8waq735q5q9ib39";
+    })
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+  ];
+
+  propagatedBuildInputs = [
+    gupnp
+  ];
+
+  meta = with lib; {
+    description = "Library of utility functions that are used by the higher level dLeyna";
+    homepage = "https://01.org/dleyna";
+    maintainers = [ maintainers.jtojnar ];
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dleyna-core/setup-hook.sh b/nixpkgs/pkgs/development/libraries/dleyna-core/setup-hook.sh
new file mode 100644
index 000000000000..287ad4dc1897
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dleyna-core/setup-hook.sh
@@ -0,0 +1,8 @@
+addDleynaConnectorPath () {
+    if test -d "$1/lib/dleyna-1.0/connectors"
+    then
+        export DLEYNA_CONNECTOR_PATH="${DLEYNA_CONNECTOR_PATH-}${DLEYNA_CONNECTOR_PATH:+:}$1/lib/dleyna-1.0/connectors"
+    fi
+}
+
+addEnvHooks "$targetOffset" addDleynaConnectorPath
diff --git a/nixpkgs/pkgs/development/libraries/dleyna-renderer/default.nix b/nixpkgs/pkgs/development/libraries/dleyna-renderer/default.nix
new file mode 100644
index 000000000000..768af6a671a1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dleyna-renderer/default.nix
@@ -0,0 +1,60 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, pkg-config
+, dleyna-connector-dbus
+, dleyna-core
+, gssdp
+, gupnp
+, gupnp-av
+, gupnp-dlna
+, libsoup
+, makeWrapper
+}:
+
+stdenv.mkDerivation rec {
+  pname = "dleyna-renderer";
+  version = "0.6.0";
+
+  src = fetchFromGitHub {
+    owner = "01org";
+    repo = pname;
+    rev = version;
+    sha256 = "0jy54aq8hgrvzchrvfzqaj4pcn0cfhafl9bv8a9p6j82yjk4pvpp";
+  };
+
+  patches = [
+    # fix build with gupnp 1.2
+    # comes from arch linux packaging https://git.archlinux.org/svntogit/packages.git/tree/trunk/gupnp-1.2.diff?h=packages/dleyna-renderer
+    ./gupnp-1.2.diff
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+    makeWrapper
+  ];
+
+  buildInputs = [
+    dleyna-core
+    dleyna-connector-dbus
+    gssdp
+    gupnp
+    gupnp-av
+    gupnp-dlna
+    libsoup
+  ];
+
+  preFixup = ''
+    wrapProgram "$out/libexec/dleyna-renderer-service" \
+      --set DLEYNA_CONNECTOR_PATH "$DLEYNA_CONNECTOR_PATH"
+  '';
+
+  meta = with lib; {
+    description = "Library to discover and manipulate Digital Media Renderers";
+    homepage = "https://01.org/dleyna";
+    maintainers = [ maintainers.jtojnar ];
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dleyna-renderer/gupnp-1.2.diff b/nixpkgs/pkgs/development/libraries/dleyna-renderer/gupnp-1.2.diff
new file mode 100644
index 000000000000..3255695ab23e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dleyna-renderer/gupnp-1.2.diff
@@ -0,0 +1,130 @@
+ configure.ac                |  4 ++--
+ libdleyna/renderer/device.c | 51 +++++++++++++++++++++++++++++++++++++++++++--
+ libdleyna/renderer/upnp.c   |  4 ++--
+ 3 files changed, 53 insertions(+), 6 deletions(-)
+
+diff --git c/configure.ac i/configure.ac
+index 271ee92..364659d 100644
+--- c/configure.ac
++++ i/configure.ac
+@@ -38,8 +38,8 @@ LT_LANG([C])
+ PKG_PROG_PKG_CONFIG(0.16)
+ PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.28])
+ PKG_CHECK_MODULES([GIO], [gio-2.0 >= 2.28])
+-PKG_CHECK_MODULES([GSSDP], [gssdp-1.0 >= 0.13.2])
+-PKG_CHECK_MODULES([GUPNP], [gupnp-1.0 >= 0.20.5])
++PKG_CHECK_MODULES([GSSDP], [gssdp-1.2 >= 1.2.0])
++PKG_CHECK_MODULES([GUPNP], [gupnp-1.2 >= 1.2.0])
+ PKG_CHECK_MODULES([GUPNPAV], [gupnp-av-1.0 >= 0.11.5])
+ PKG_CHECK_MODULES([GUPNPDLNA], [gupnp-dlna-2.0 >= 0.9.4])
+ PKG_CHECK_MODULES([SOUP], [libsoup-2.4 >= 2.28.2])
+diff --git c/libdleyna/renderer/device.c i/libdleyna/renderer/device.c
+index 7acef89..f6d571e 100644
+--- c/libdleyna/renderer/device.c
++++ i/libdleyna/renderer/device.c
+@@ -2121,33 +2121,80 @@ exit:
+ 	return;
+ }
+ 
++typedef struct
++{
++  GMainLoop *loop;
++  GUPnPServiceIntrospection *introspection;
++  GError **error;
++} GetIntrospectionAsyncData;
++
++static void
++get_introspection_async_cb (GUPnPServiceInfo           *info,
++                            GUPnPServiceIntrospection  *introspection,
++                            const GError               *error,
++                            gpointer                    user_data)
++{
++  GetIntrospectionAsyncData *data = user_data;
++  data->introspection = introspection;
++  if (data->error)
++    *data->error = g_error_copy (error);
++  g_main_loop_quit (data->loop);
++}
++
++static GUPnPServiceIntrospection *
++_gupnp_service_info_get_introspection (GUPnPServiceInfo *info,
++                                       GError          **error)
++{
++  GetIntrospectionAsyncData data;
++  GMainContext *context;
++
++  context = g_main_context_new ();
++  data.loop = g_main_loop_new (context, FALSE);
++  data.error = error;
++
++  g_main_context_push_thread_default (context);
++
++  gupnp_service_info_get_introspection_async (info,
++                                              get_introspection_async_cb,
++                                              &data);
++
++  g_main_loop_run (data.loop);
++
++  g_main_context_pop_thread_default (context);
++
++  g_main_loop_unref (data.loop);
++  g_main_context_unref (context);
++
++  return data.introspection;
++}
++
+ static gboolean prv_get_av_service_states_values(GUPnPServiceProxy *av_proxy,
+ 						 GVariant **mpris_tp_speeds,
+ 						 GPtrArray **upnp_tp_speeds,
+ 						 double *min_rate,
+ 						 double *max_rate,
+ 						 gboolean *can_get_byte_pos)
+ {
+ 	const GUPnPServiceStateVariableInfo *svi;
+ 	const GUPnPServiceActionInfo *sai;
+ 	GUPnPServiceIntrospection *introspection;
+ 	GError *error = NULL;
+ 	GVariant *speeds = NULL;
+ 	GList *allowed_values;
+ 	gpointer weak_ref = NULL;
+ 	gboolean  device_alive = TRUE;
+ 
+ 	/* TODO: this weak_ref hack is needed as
+ 	   gupnp_service_info_get_introspection iterates the main loop.
+ 	   This can result in our device getting deleted before this
+ 	   function returns.  Ultimately, this code needs to be re-written
+ 	   to use gupnp_service_info_get_introspection_async but this cannot
+ 	   really be done until GUPnP provides a way to cancel this function. */
+ 
+ 	weak_ref = av_proxy;
+ 	g_object_add_weak_pointer(G_OBJECT(av_proxy), &weak_ref);
+ 
+-	introspection = gupnp_service_info_get_introspection(
++	introspection = _gupnp_service_info_get_introspection(
+ 		GUPNP_SERVICE_INFO(av_proxy),
+ 		&error);
+ 
+@@ -2215,7 +2262,7 @@ static gboolean prv_get_rc_service_states_values(GUPnPServiceProxy *rc_proxy,
+ 	weak_ref = rc_proxy;
+ 	g_object_add_weak_pointer(G_OBJECT(rc_proxy), &weak_ref);
+ 
+-	introspection = gupnp_service_info_get_introspection(
++	introspection = _gupnp_service_info_get_introspection(
+ 		GUPNP_SERVICE_INFO(rc_proxy),
+ 		&error);
+ 
+diff --git c/libdleyna/renderer/upnp.c i/libdleyna/renderer/upnp.c
+index 17cbda7..068912b 100644
+--- c/libdleyna/renderer/upnp.c
++++ i/libdleyna/renderer/upnp.c
+@@ -243,8 +243,8 @@ static void prv_server_unavailable_cb(GUPnPControlPoint *cp,
+ 
+ 	udn = gupnp_device_info_get_udn((GUPnPDeviceInfo *)proxy);
+ 
+-	ip_address = gupnp_context_get_host_ip(
+-		gupnp_control_point_get_context(cp));
++	ip_address = gssdp_client_get_host_ip(
++		GSSDP_CLIENT(gupnp_control_point_get_context(cp)));
+ 
+ 	if (!udn || !ip_address)
+ 		goto on_error;
diff --git a/nixpkgs/pkgs/development/libraries/dleyna-server/default.nix b/nixpkgs/pkgs/development/libraries/dleyna-server/default.nix
new file mode 100644
index 000000000000..a0a414abf748
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dleyna-server/default.nix
@@ -0,0 +1,64 @@
+{ lib, stdenv
+, fetchFromGitHub
+, fetchpatch
+, autoreconfHook
+, makeWrapper
+, pkg-config
+, dleyna-core
+, dleyna-connector-dbus
+, gssdp
+, gupnp
+, gupnp-av
+, gupnp-dlna
+, libsoup
+}:
+
+stdenv.mkDerivation rec {
+  pname = "dleyna-server";
+  version = "0.6.0";
+
+  src = fetchFromGitHub {
+    owner = "01org";
+    repo = pname;
+    rev = version;
+    sha256 = "13a2i6ms27s46yxdvlh2zm7pim7jmr5cylnygzbliz53g3gxxl3j";
+  };
+
+  patches = [
+    # fix build with gupnp 1.2
+    # https://github.com/intel/dleyna-server/pull/161
+    (fetchpatch {
+      url = "https://github.com/intel/dleyna-server/commit/96c01c88363d6e5e9b7519bc4e8b5d86cf783e1f.patch";
+      sha256 = "0p8fn331x2whvn6skxqvfzilx0m0yx2q5mm2wh2625l396m3fzmm";
+    })
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+    makeWrapper
+  ];
+
+  buildInputs = [
+    dleyna-core
+    dleyna-connector-dbus
+    gssdp
+    gupnp
+    gupnp-av
+    gupnp-dlna
+    libsoup
+  ];
+
+  preFixup = ''
+    wrapProgram "$out/libexec/dleyna-server-service" \
+      --set DLEYNA_CONNECTOR_PATH "$DLEYNA_CONNECTOR_PATH"
+  '';
+
+  meta = with lib; {
+    description = "Library to discover, browse and manipulate Digital Media Servers";
+    homepage = "https://01.org/dleyna";
+    maintainers = [ maintainers.jtojnar ];
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dlib/default.nix b/nixpkgs/pkgs/development/libraries/dlib/default.nix
new file mode 100644
index 000000000000..aadd61370b1f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dlib/default.nix
@@ -0,0 +1,40 @@
+{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, libpng, libjpeg
+, guiSupport ? false, libX11
+
+  # see http://dlib.net/compile.html
+, sse4Support ? stdenv.hostPlatform.sse4_1Support
+, avxSupport ? stdenv.hostPlatform.avxSupport
+, cudaSupport ? true
+}:
+
+stdenv.mkDerivation rec {
+  pname = "dlib";
+  version = "19.22";
+
+  src = fetchFromGitHub {
+    owner = "davisking";
+    repo = "dlib";
+    rev ="v${version}";
+    sha256 = "sha256-cEbw01w4KgSG3JTvTE/qruo7i4/L++m02HW+0VNmSSQ=";
+  };
+
+  postPatch = ''
+    rm -rf dlib/external
+  '';
+
+  cmakeFlags = [
+    "-DUSE_DLIB_USE_CUDA=${if cudaSupport then "1" else "0"}"
+    "-DUSE_SSE4_INSTRUCTIONS=${if sse4Support then "yes" else "no"}"
+    "-DUSE_AVX_INSTRUCTIONS=${if avxSupport then "yes" else "no"}" ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ libpng libjpeg ] ++ lib.optional guiSupport libX11;
+
+  meta = with lib; {
+    description = "A general purpose cross-platform C++ machine learning library";
+    homepage = "http://www.dlib.net";
+    license = licenses.boost;
+    maintainers = with maintainers; [ christopherpoole ma27 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/docopt_cpp/default.nix b/nixpkgs/pkgs/development/libraries/docopt_cpp/default.nix
new file mode 100644
index 000000000000..3de84b684e52
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/docopt_cpp/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, cmake, python2 }:
+
+stdenv.mkDerivation rec {
+  version = "0.6.3";
+  pname = "docopt.cpp";
+
+  src = fetchFromGitHub {
+    owner = "docopt";
+    repo = "docopt.cpp";
+    rev = "v${version}";
+    sha256 = "0cz3vv7g5snfbsqcf3q8bmd6kv5qp84gj3avwkn4vl00krw13bl7";
+  };
+
+  nativeBuildInputs = [ cmake python2 ];
+
+  cmakeFlags = ["-DWITH_TESTS=ON"];
+
+  strictDeps = true;
+
+  doCheck = true;
+
+  postPatch = ''
+    substituteInPlace docopt.pc.in \
+      --replace "@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@" \
+                "@CMAKE_INSTALL_LIBDIR@"
+  '';
+
+  checkPhase = "LD_LIBRARY_PATH=$(pwd) python ./run_tests";
+
+  meta = with lib; {
+    description = "C++11 port of docopt";
+    homepage = "https://github.com/docopt/docopt.cpp";
+    license = with licenses; [ mit boost ];
+    platforms = platforms.all;
+    maintainers = with maintainers; [ knedlsepp ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/doctest/default.nix b/nixpkgs/pkgs/development/libraries/doctest/default.nix
new file mode 100644
index 000000000000..c8e31d43e953
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/doctest/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, installShellFiles, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "doctest";
+  version = "2.4.6";
+
+  src = fetchFromGitHub {
+    owner = "onqtam";
+    repo = "doctest";
+    rev = version;
+    sha256 = "14m3q6d96zg6d99x1152jkly50gdjrn5ylrbhax53pfgfzzc5yqx";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://github.com/onqtam/doctest";
+    description = "The fastest feature-rich C++11/14/17/20 single-header testing framework";
+    platforms = platforms.all;
+    license = licenses.mit;
+    maintainers = with maintainers; [ davidtwco ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dotconf/default.nix b/nixpkgs/pkgs/development/libraries/dotconf/default.nix
new file mode 100644
index 000000000000..39d71eee432b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dotconf/default.nix
@@ -0,0 +1,24 @@
+{ fetchFromGitHub, lib, stdenv, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  name = "dotconf-" + version;
+  version = "1.3";
+
+  src = fetchFromGitHub {
+    owner = "williamh";
+    repo = "dotconf";
+    rev = "v${version}";
+    sha256 = "1sc95hw5k2xagpafny0v35filmcn05k1ds5ghkldfpf6xw4hakp7";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ ];
+
+  meta = with lib; {
+    description = "A configuration parser library";
+    maintainers = with maintainers; [ pSub ];
+    homepage = "https://github.com/williamh/dotconf";
+    license = licenses.lgpl21Plus;
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dotnetfx35/default.nix b/nixpkgs/pkgs/development/libraries/dotnetfx35/default.nix
new file mode 100644
index 000000000000..a3045949c6ca
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dotnetfx35/default.nix
@@ -0,0 +1,24 @@
+{stdenv}:
+
+let
+  windir = "/cygdrive/c/WINDOWS";
+in
+{
+  pkg = stdenv.mkDerivation rec {
+    pname = "dotnetfx";
+    version = "3.5";
+    src = "${windir}/Microsoft.NET/Framework/v${version}";
+    buildCommand = ''
+      mkdir -p $out/bin
+      ln -s $src/MSBuild.exe $out/bin
+    '';
+  };
+
+  assembly20Path = "/cygdrive/c/WINDOWS/Microsoft.NET/Framework/v2.0.50727";
+
+  wcfPath = "/cygdrive/c/WINDOWS/Microsoft.NET/Framework/v3.0/WINDOW~1";
+
+  referenceAssembly30Path = "/cygdrive/c/PROGRA~1/REFERE~1/Microsoft/Framework/v3.0";
+
+  referenceAssembly35Path = "/cygdrive/c/PROGRA~1/REFERE~1/Microsoft/Framework/v3.5";
+}
diff --git a/nixpkgs/pkgs/development/libraries/dotnetfx40/default.nix b/nixpkgs/pkgs/development/libraries/dotnetfx40/default.nix
new file mode 100644
index 000000000000..379be1bdc26d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dotnetfx40/default.nix
@@ -0,0 +1,24 @@
+{stdenv}:
+
+let
+  windir = "/cygdrive/c/WINDOWS";
+in
+{
+  pkg = stdenv.mkDerivation rec {
+    pname = "dotnetfx";
+    version = "4.0.30319";
+    src = "${windir}/Microsoft.NET/Framework/v${version}";
+    buildCommand = ''
+      mkdir -p $out/bin
+      ln -s $src/MSBuild.exe $out/bin
+    '';
+  };
+
+  assembly20Path = "/cygdrive/c/WINDOWS/Microsoft.NET/Framework/v2.0.50727";
+
+  wcfPath = "/cygdrive/c/WINDOWS/Microsoft.NET/Framework/v3.0/WINDOW~1";
+
+  referenceAssembly30Path = "/cygdrive/c/PROGRA~1/REFERE~1/Microsoft/Framework/v3.0";
+
+  referenceAssembly35Path = "/cygdrive/c/PROGRA~1/REFERE~1/Microsoft/Framework/v3.5";
+}
diff --git a/nixpkgs/pkgs/development/libraries/double-conversion/default.nix b/nixpkgs/pkgs/development/libraries/double-conversion/default.nix
new file mode 100644
index 000000000000..2bdcc3c8a997
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/double-conversion/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, lib, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "double-conversion";
+  version = "3.1.5";
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "double-conversion";
+    rev = "v${version}";
+    sha256 = "0csy4pjw1p8rp6g5qxi2h0ychhhp1fldv7gb761627fs2mclw9gv";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
+
+  # Case sensitivity issue
+  preConfigure = lib.optionalString stdenv.isDarwin ''
+    rm BUILD
+  '';
+
+  meta = with lib; {
+    description = "Binary-decimal and decimal-binary routines for IEEE doubles";
+    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
new file mode 100644
index 000000000000..eb14a44e4fa5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dqlite/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, file, libuv
+, raft-canonical, sqlite-replication }:
+
+stdenv.mkDerivation rec {
+  pname = "dqlite";
+  version = "1.9.0";
+
+  src = fetchFromGitHub {
+    owner = "canonical";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0zalsvr0vy7632nhm96a29lrfy18iqsmbxpyz2lvq80mrjlbrzsn";
+  };
+
+  nativeBuildInputs = [ autoreconfHook file pkg-config ];
+  buildInputs = [
+    libuv
+    raft-canonical.dev
+    sqlite-replication
+  ];
+
+  enableParallelBuilding = true;
+
+  # tests fail
+  doCheck = false;
+
+  outputs = [ "dev" "out" ];
+
+  meta = with lib; {
+    description = ''
+      Expose a SQLite database over the network and replicate it across a
+      cluster of peers
+    '';
+    homepage = "https://dqlite.io/";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ joko wucke13 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/draco/default.nix b/nixpkgs/pkgs/development/libraries/draco/default.nix
new file mode 100644
index 000000000000..41ffdd16f5a9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/draco/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, cmake
+}:
+
+stdenv.mkDerivation rec {
+  version = "1.4.1";
+  pname = "draco";
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "draco";
+    rev = version;
+    sha256 = "14ln4la52x38pf8syr7i5v4vd65ya4zij8zj5kgihah03cih0qcd";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    # Fake these since we are building from a tarball
+    "-Ddraco_git_hash=${version}"
+    "-Ddraco_git_desc=${version}"
+
+    "-DBUILD_UNITY_PLUGIN=1"
+  ];
+
+  meta = with lib; {
+    description = "Library for compressing and decompressing 3D geometric meshes and point clouds";
+    homepage = "https://google.github.io/draco/";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ jansol ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/drogon/default.nix b/nixpkgs/pkgs/development/libraries/drogon/default.nix
new file mode 100644
index 000000000000..f669d663379e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/drogon/default.nix
@@ -0,0 +1,63 @@
+{ stdenv, fetchFromGitHub, cmake, jsoncpp, libossp_uuid, zlib, lib
+# optional but of negligible size
+, openssl, brotli, c-ares
+# optional databases
+, sqliteSupport ? true, sqlite
+, postgresSupport ? false, postgresql
+, redisSupport ? false, hiredis
+, mysqlSupport ? false, libmysqlclient, mariadb }:
+
+stdenv.mkDerivation rec {
+  pname = "drogon";
+  version = "1.7.2";
+
+  src = fetchFromGitHub {
+    owner = "drogonframework";
+    repo = "drogon";
+    rev = "v${version}";
+    sha256 = "0g2fm8xb2gi7qaib6mxvg6k6y4g2d0a2jg4k5qvsjbd0n7j8746j";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    "-DBUILD_TESTING=${if doInstallCheck then "ON" else "OFF"}"
+    "-DBUILD_EXAMPLES=OFF"
+  ];
+
+  propagatedBuildInputs = [
+    jsoncpp
+    libossp_uuid
+    zlib
+    openssl
+    brotli
+    c-ares
+  ] ++ lib.optional sqliteSupport sqlite
+    ++ lib.optional postgresSupport postgresql
+    ++ lib.optional redisSupport hiredis
+    # drogon uses mariadb for mysql (see https://github.com/drogonframework/drogon/wiki/ENG-02-Installation#Library-Dependencies)
+    ++ lib.optional mysqlSupport [ libmysqlclient mariadb ];
+
+  patches = [
+    # this part of the test would normally fail because it attempts to configure a CMake project that uses find_package on itself
+    # this patch makes drogon and trantor visible to the test
+    ./fix_find_package.patch
+  ];
+
+  # modifying PATH here makes drogon_ctl visible to the test
+  installCheckPhase = ''
+    cd ..
+    PATH=$PATH:$out/bin bash test.sh
+  '';
+
+  doInstallCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/drogonframework/drogon";
+    description = "C++14/17 based HTTP web application framework";
+    license = licenses.mit;
+    maintainers = with maintainers; [ urlordjames ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/drogon/fix_find_package.patch b/nixpkgs/pkgs/development/libraries/drogon/fix_find_package.patch
new file mode 100644
index 000000000000..b76dbfe48830
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/drogon/fix_find_package.patch
@@ -0,0 +1,13 @@
+diff --git a/test.sh b/test.sh
+index f017b9a..027031e 100755
+--- a/test.sh
++++ b/test.sh
+@@ -135,7 +135,7 @@ if [ $os = "windows" ]; then
+   conan install $src_dir -s compiler="Visual Studio" -s compiler.version=16 -sbuild_type=Debug -g cmake_paths
+   cmake_gen="$cmake_gen -DCMAKE_TOOLCHAIN_FILE=conan_paths.cmake -DCMAKE_INSTALL_PREFIX=$src_dir/install"
+ fi
+-cmake .. $cmake_gen
++cmake .. $cmake_gen -DDrogon_DIR=$out/lib/cmake/Drogon -DTrantor_DIR=$out/lib/cmake/Trantor
+ 
+ if [ $? -ne 0 ]; then
+     echo "Failed to run CMake for example project"
diff --git a/nixpkgs/pkgs/development/libraries/drumstick/default.nix b/nixpkgs/pkgs/development/libraries/drumstick/default.nix
new file mode 100644
index 000000000000..36f2ecd84be2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/drumstick/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchurl
+, cmake, docbook_xml_dtd_45, docbook_xsl, doxygen, graphviz-nox, pkg-config, qttools, wrapQtAppsHook
+, alsa-lib, fluidsynth, qtbase, qtsvg, libpulseaudio
+}:
+
+stdenv.mkDerivation rec {
+  pname = "drumstick";
+  version = "2.3.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/drumstick/${version}/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-0DUFmL8sifxbC782CYT4eoe4m1kq8T1tEs3YNy8iQuc=";
+  };
+
+  patches = [
+    ./drumstick-plugins.patch
+  ];
+
+  postPatch = ''
+    substituteInPlace library/rt/backendmanager.cpp --subst-var out
+  '';
+
+  outputs = [ "out" "dev" "man" ];
+
+  nativeBuildInputs = [
+    cmake docbook_xml_dtd_45 docbook_xml_dtd_45 docbook_xsl doxygen graphviz-nox pkg-config qttools wrapQtAppsHook
+  ];
+
+  buildInputs = [
+    alsa-lib fluidsynth libpulseaudio qtbase qtsvg
+  ];
+
+  cmakeFlags = [
+    "-DUSE_DBUS=ON"
+  ];
+
+  meta = with lib; {
+    maintainers = [];
+    description = "MIDI libraries for Qt5/C++";
+    homepage = "http://drumstick.sourceforge.net/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/drumstick/drumstick-plugins.patch b/nixpkgs/pkgs/development/libraries/drumstick/drumstick-plugins.patch
new file mode 100644
index 000000000000..59711120a8e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/drumstick/drumstick-plugins.patch
@@ -0,0 +1,14 @@
+Make it look for its plugin in its own installation directory.
+
+Without this vmpk fails to start with "Unable to initialize all MIDI drivers".
+
+--- a/library/rt/backendmanager.cpp
++++ b/library/rt/backendmanager.cpp
+@@ -159,6 +159,7 @@ namespace rt {
+         foreach(const QString& path, QCoreApplication::libraryPaths()) {
+             d->appendDir( path + QDir::separator() + QSTR_DRUMSTICK, result );
+         }
++        d->appendDir( "@out@/lib/" + QSTR_DRUMSTICK, result );
+         return result;
+     }
+ 
diff --git a/nixpkgs/pkgs/development/libraries/dssi/default.nix b/nixpkgs/pkgs/development/libraries/dssi/default.nix
new file mode 100644
index 000000000000..ca7ea10afffa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dssi/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, ladspaH, libjack2, liblo, alsa-lib, qt4, libX11, libsndfile, libSM
+, libsamplerate, libtool, autoconf, automake, xorgproto, libICE, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "dssi";
+  version = "1.1.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/dssi/dssi/${version}/${pname}-${version}.tar.gz";
+    sha256 = "0kl1hzhb7cykzkrqcqgq1dk4xcgrcxv0jja251aq4z4l783jpj7j";
+  };
+
+  buildInputs =
+    [ ladspaH libjack2 liblo alsa-lib qt4 libX11 libsndfile libSM
+      libsamplerate libtool autoconf automake xorgproto libICE pkg-config
+    ];
+
+  meta = with lib; {
+    description = "A plugin SDK for virtual instruments";
+    maintainers = with maintainers;
+    [
+      raskin
+    ];
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
+    downloadPage = "https://sourceforge.net/projects/dssi/files/dssi/";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/duckdb/default.nix b/nixpkgs/pkgs/development/libraries/duckdb/default.nix
new file mode 100644
index 000000000000..92f6accd4262
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/duckdb/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "duckdb";
+  version = "0.2.8";
+
+  src = fetchFromGitHub {
+    owner = "cwida";
+    repo = "duckdb";
+    rev = "v${version}";
+    sha256 = "sha256-X8zk9D7BQQ6iHdfvpaTZ8wS779wt3nRthH7OG4p9bTg=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://github.com/cwida/duckdb";
+    description = "Embeddable SQL OLAP Database Management System";
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ costrouc ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dxflib/default.nix b/nixpkgs/pkgs/development/libraries/dxflib/default.nix
new file mode 100644
index 000000000000..09f2ad3ccad6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dxflib/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv
+, fetchurl
+, qmake
+}:
+
+stdenv.mkDerivation rec {
+  version = "3.17.0";
+  pname = "dxflib";
+  src = fetchurl {
+    url = "http://www.qcad.org/archives/dxflib/${pname}-${version}-src.tar.gz";
+    sha256 = "09yjgzh8677pzkkr7a59pql5d11451c22pxksk2my30mapxsri96";
+  };
+  nativeBuildInputs = [
+    qmake
+  ];
+  dontWrapQtApps = true;
+  preConfigure = ''
+    sed -i 's/CONFIG += staticlib/CONFIG += shared/' dxflib.pro
+  '';
+  installPhase = ''
+    install -d -m 0755 $out/lib
+    cp -pr *.so* $out/lib
+    install -d -m 0755 $out/include/dxflib
+    cp -pr src/*.h $out/include/dxflib
+    # Generate pkg-config file
+    install -d -m 0755 $out/lib/pkgconfig
+    cat << 'EOF' > $out/lib/pkgconfig/dxflib.pc
+    prefix=${placeholder "out"}
+    libdir=${placeholder "out"}/lib
+    includedir=${placeholder "out"}/include
+    Name: dxflib
+    Description: A C++ library for reading and writing DXF files
+    Version: %{version}
+    Libs: -L${placeholder "out"}/lib -ldxflib
+    Cflags: -I${placeholder "out"}/include/dxflib
+    EOF
+  '';
+  doCheck = true;
+
+  meta = {
+    maintainers = with lib.maintainers; [raskin];
+    platforms = lib.platforms.linux;
+    description = "DXF file format library";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/dyncall/default.nix b/nixpkgs/pkgs/development/libraries/dyncall/default.nix
new file mode 100644
index 000000000000..f92f2f0affe4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/dyncall/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "dyncall";
+  version = "1.2";
+
+  src = fetchurl {
+    url = "https://www.dyncall.org/r${version}/dyncall-${version}.tar.gz";
+    # https://www.dyncall.org/r1.2/SHA256
+    sha256 = "sha256-6IFUwCQ0IVYHBPXHKUr73snpka+gYB1a3/UELqgYCNc=";
+  };
+
+  # XXX: broken tests, failures masked, lets avoid crashing a bunch for now :)
+  doCheck = false;
+
+  # install bits not automatically installed
+  postInstall = ''
+    # install cmake modules to make using dyncall easier
+    # This is essentially what -DINSTALL_CMAKE_MODULES=ON if using cmake build
+    # We don't use the cmake-based build since it installs different set of headers
+    # (mostly fewer headers, but installs dyncall_alloc_wx.h "instead" dyncall_alloc.h)
+    # and we'd have to patch the cmake module installation to not use CMAKE_ROOT anyway :).
+    install -D -t $out/lib/cmake ./buildsys/cmake/Modules/Find*.cmake
+
+    # manpages are nice, install them
+    # doing this is in the project's "ToDo", so check this when updating!
+    install -D -t $out/share/man/man3 ./*/*.3
+  '';
+
+  meta = with lib; {
+    description = "Highly dynamic multi-platform foreign function call interface library";
+    homepage = "https://www.dyncall.org";
+    license = licenses.isc;
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/easyloggingpp/default.nix b/nixpkgs/pkgs/development/libraries/easyloggingpp/default.nix
new file mode 100644
index 000000000000..ad582d933059
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/easyloggingpp/default.nix
@@ -0,0 +1,31 @@
+# To use this package with a CMake and pkg-config build:
+# pkg_check_modules(EASYLOGGINGPP REQUIRED easyloggingpp)
+# add_executable(main src/main.cpp ${EASYLOGGINGPP_PREFIX}/include/easylogging++.cc)
+{ lib, stdenv, fetchFromGitHub, cmake, gtest }:
+stdenv.mkDerivation rec {
+  pname = "easyloggingpp";
+  version = "9.97.0";
+  src = fetchFromGitHub {
+    owner = "muflihun";
+    repo = "easyloggingpp";
+    rev = "v${version}";
+    sha256 = "sha256-sFWmZMnucMuvpwDzuowni21KiD3bx0lH1Ts+yhusOYs=";
+  };
+
+  nativeBuildInputs = [cmake];
+  buildInputs = [gtest];
+  cmakeFlags = [ "-Dtest=ON" ];
+  NIX_CFLAGS_COMPILE = "-std=c++11" +
+    lib.optionalString stdenv.isLinux " -pthread";
+  postInstall = ''
+    mkdir -p $out/include
+    cp ../src/easylogging++.cc $out/include
+  '';
+  meta = {
+    description = "C++ logging library";
+    homepage = "https://muflihun.github.io/easyloggingpp/";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [acowley];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/eccodes/default.nix b/nixpkgs/pkgs/development/libraries/eccodes/default.nix
new file mode 100644
index 000000000000..1050490a220b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/eccodes/default.nix
@@ -0,0 +1,54 @@
+{ fetchurl, lib, stdenv
+, cmake, netcdf, openjpeg, libpng, gfortran
+, enablePython ? false, pythonPackages
+, enablePosixThreads ? false
+, enableOpenMPThreads ? false}:
+with lib;
+stdenv.mkDerivation rec {
+  pname = "eccodes";
+  version = "2.12.5";
+
+  src = fetchurl {
+    url = "https://confluence.ecmwf.int/download/attachments/45757960/eccodes-${version}-Source.tar.gz";
+    sha256 = "0576fccng4nvmq5gma1nb1v00if5cwl81w4nv5zkb80q5wicn50c";
+  };
+
+  postPatch = ''
+    substituteInPlace cmake/FindOpenJPEG.cmake --replace openjpeg-2.1 ${openjpeg.incDir}
+  '';
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ netcdf
+                  openjpeg
+                  libpng
+                  gfortran
+                ];
+  propagatedBuildInputs = optionals enablePython [
+                  pythonPackages.python
+                  pythonPackages.numpy
+                ];
+
+  cmakeFlags = [ "-DENABLE_PYTHON=${if enablePython then "ON" else "OFF"}"
+                 "-DENABLE_PNG=ON"
+                 "-DENABLE_ECCODES_THREADS=${if enablePosixThreads then "ON" else "OFF"}"
+                 "-DENABLE_ECCODES_OMP_THREADS=${if enableOpenMPThreads then "ON" else "OFF"}"
+               ];
+
+  doCheck = true;
+
+  # Only do tests that don't require downloading 120MB of testdata
+  checkPhase = lib.optionalString (stdenv.isDarwin) ''
+    substituteInPlace "tests/include.sh" --replace "set -ea" "set -ea; export DYLD_LIBRARY_PATH=$(pwd)/lib"
+  '' + ''
+    ctest -R "eccodes_t_(definitions|calendar|unit_tests|md5|uerra|grib_2nd_order_numValues|julian)" -VV
+  '';
+
+  meta = {
+    homepage = "https://confluence.ecmwf.int/display/ECC/";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ knedlsepp ];
+    platforms = platforms.unix;
+    description = "ECMWF library for reading and writing GRIB, BUFR and GTS abbreviated header";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/eclib/default.nix b/nixpkgs/pkgs/development/libraries/eclib/default.nix
new file mode 100644
index 000000000000..74a6f21992b5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/eclib/default.nix
@@ -0,0 +1,52 @@
+{ lib, stdenv
+, fetchurl
+, autoreconfHook
+, pari
+, ntl
+, gmp
+# "FLINT is optional and only used for one part of sparse matrix reduction,
+# which is used in the modular symbol code but not mwrank or other elliptic
+# curve programs." -- https://github.com/JohnCremona/eclib/blob/master/README
+, withFlint ? false, flint ? null
+}:
+
+assert withFlint -> flint != null;
+
+stdenv.mkDerivation rec {
+  pname = "eclib";
+  version = "20210625"; # upgrade might break the sage interface
+  # sage tests to run:
+  # src/sage/interfaces/mwrank.py
+  # src/sage/libs/eclib
+  # ping @timokau for more info
+  src = fetchurl {
+    # all releases for this project appear on its GitHub releases page
+    # by definition! other distros sometimes update whenever they see
+    # a version bump in configure.ac or a new tag (and this might show
+    # up on repology). however, a version bump or a new tag may not
+    # represent a new release, and a new release might not be tagged.
+    #
+    # see https://github.com/JohnCremona/eclib/issues/64#issuecomment-789788561
+    # for upstream's explanation of the above
+    url = "https://github.com/JohnCremona/eclib/releases/download/${version}/eclib-${version}.tar.bz2";
+    sha256 = "sha256-fA3MPz/L+Q39sA8wxAYOUowlHRcgOd8VF4tpsBGI6BA=";
+  };
+  buildInputs = [
+    pari
+    ntl
+    gmp
+  ] ++ lib.optionals withFlint [
+    flint
+  ];
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+  doCheck = true;
+  meta = with lib; {
+    description = "Elliptic curve tools";
+    homepage = "https://github.com/JohnCremona/eclib";
+    license = licenses.gpl2Plus;
+    maintainers = teams.sage.members;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/editline/default.nix b/nixpkgs/pkgs/development/libraries/editline/default.nix
new file mode 100644
index 000000000000..2b2ffbea31e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/editline/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, nix-update-script, fetchpatch }:
+
+stdenv.mkDerivation rec {
+  pname = "editline";
+  version = "1.17.1";
+  src = fetchFromGitHub {
+    owner = "troglobit";
+    repo = "editline";
+    rev = version;
+    sha256 = "sha256-0FeDUVCUahbweH24nfaZwa7j7lSfZh1TnQK7KYqO+3g=";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "fix-for-home-end-in-tmux.patch";
+      url = "https://github.com/troglobit/editline/commit/265c1fb6a0b99bedb157dc7c320f2c9629136518.patch";
+      sha256 = "sha256-9fhQH0hT8BcykGzOUoT18HBtWjjoXnePSGDJQp8GH30=";
+    })
+  ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  outputs = [ "out" "dev" "man" "doc" ];
+
+  passthru.updateScript = nix-update-script {
+    attrPath = pname;
+  };
+
+  meta = with lib; {
+    homepage = "https://troglobit.com/projects/editline/";
+    description = "A readline() replacement for UNIX without termcap (ncurses)";
+    license = licenses.bsdOriginal;
+    maintainers = with maintainers; [ dtzWill oxalica ];
+    platforms = platforms.all;
+  };
+}
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..50a74088f2a7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/egl-wayland/default.nix
@@ -0,0 +1,88 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, pkg-config
+, meson
+, ninja
+, wayland-scanner
+, 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.7";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "Nvidia";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-pqpJ6Uo50BouBU0wGaL21VH5rDiVHKAvJtfzL0YInXU=";
+  };
+
+  depsBuildBuild = [
+    pkg-config
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    wayland-scanner
+  ];
+
+  buildInputs = [
+    eglexternalplatform
+    libX11
+    mesa
+    libGL
+    wayland
+  ];
+
+  postFixup = ''
+    # Doubled prefix in pc file after postbuild hook replaces includedir prefix variable with dev output path
+    substituteInPlace $dev/lib/pkgconfig/wayland-eglstream.pc \
+      --replace "=$dev/$dev" "=$dev" \
+      --replace "Requires:" "Requires.private:"
+  '';
+
+  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/eigen/2.0.nix b/nixpkgs/pkgs/development/libraries/eigen/2.0.nix
new file mode 100644
index 000000000000..a16335946367
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/eigen/2.0.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitLab, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "eigen";
+  version = "2.0.17";
+
+  src = fetchFromGitLab {
+    owner = "libeigen";
+    repo = pname;
+    rev = version;
+    hash = "sha256-C1Bu2H4zxd/2QVzz9AOdoCSRwOYjF41Vr/0S8Fm2kzQ=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://eigen.tuxfamily.org";
+    description = "C++ template library for linear algebra: vectors, matrices, and related algorithms";
+    license = licenses.lgpl3Plus;
+    maintainers = with maintainers; [ sander raskin ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/eigen/default.nix b/nixpkgs/pkgs/development/libraries/eigen/default.nix
new file mode 100644
index 000000000000..371805804210
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/eigen/default.nix
@@ -0,0 +1,31 @@
+{ lib
+, stdenv
+, fetchFromGitLab
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "eigen";
+  version = "3.3.9";
+
+  src = fetchFromGitLab {
+    owner = "libeigen";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-JMIG7CLMndUsECfbKpXE3BtVFuAjn+CZvf8GXZpLkFQ=";
+  };
+
+  patches = [
+    ./include-dir.patch
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://eigen.tuxfamily.org";
+    description = "C++ template library for linear algebra: vectors, matrices, and related algorithms";
+    license = licenses.lgpl3Plus;
+    maintainers = with maintainers; [ sander raskin ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/eigen/default.upstream b/nixpkgs/pkgs/development/libraries/eigen/default.upstream
new file mode 100644
index 000000000000..c0c05efc466c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/eigen/default.upstream
@@ -0,0 +1,4 @@
+url http://eigen.tuxfamily.org/
+ensure_choice
+version '.*/([-0-9.]+)[.]tar[.].*' '\1'
+do_overwrite() { do_overwrite_just_version; }
diff --git a/nixpkgs/pkgs/development/libraries/eigen/include-dir.patch b/nixpkgs/pkgs/development/libraries/eigen/include-dir.patch
new file mode 100644
index 000000000000..42f8e189c0b7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/eigen/include-dir.patch
@@ -0,0 +1,58 @@
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -1,6 +1,6 @@
+ project(Eigen3)
+ 
+-cmake_minimum_required(VERSION 2.8.5)
++cmake_minimum_required(VERSION 3.7)
+ 
+ # guard against in-source builds
+ 
+@@ -407,7 +407,7 @@ set(PKGCONFIG_INSTALL_DIR
+     CACHE STRING "The directory relative to CMAKE_PREFIX_PATH where eigen3.pc is installed"
+     )
+ 
+-foreach(var INCLUDE_INSTALL_DIR CMAKEPACKAGE_INSTALL_DIR PKGCONFIG_INSTALL_DIR)
++foreach(var CMAKEPACKAGE_INSTALL_DIR PKGCONFIG_INSTALL_DIR)
+   if(IS_ABSOLUTE "${${var}}")
+     message(FATAL_ERROR "${var} must be relative to CMAKE_PREFIX_PATH. Got: ${${var}}")
+   endif()
+@@ -429,13 +429,6 @@ install(FILES
+   DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel
+   )
+ 
+-if(EIGEN_BUILD_PKGCONFIG)
+-    configure_file(eigen3.pc.in eigen3.pc @ONLY)
+-    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eigen3.pc
+-        DESTINATION ${PKGCONFIG_INSTALL_DIR}
+-        )
+-endif()
+-
+ add_subdirectory(Eigen)
+ 
+ add_subdirectory(doc EXCLUDE_FROM_ALL)
+@@ -531,8 +524,15 @@ set ( EIGEN_VERSION_MAJOR  ${EIGEN_WORLD_VERSION} )
+ set ( EIGEN_VERSION_MINOR  ${EIGEN_MAJOR_VERSION} )
+ set ( EIGEN_VERSION_PATCH  ${EIGEN_MINOR_VERSION} )
+ set ( EIGEN_DEFINITIONS "")
+-set ( EIGEN_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}" )
+ set ( EIGEN_ROOT_DIR ${CMAKE_INSTALL_PREFIX} )
++GNUInstallDirs_get_absolute_install_dir(EIGEN_INCLUDE_DIR INCLUDE_INSTALL_DIR)
++
++if(EIGEN_BUILD_PKGCONFIG)
++    configure_file(eigen3.pc.in eigen3.pc @ONLY)
++    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eigen3.pc
++        DESTINATION ${PKGCONFIG_INSTALL_DIR}
++        )
++endif()
+ 
+ # Interface libraries require at least CMake 3.0
+ if (NOT CMAKE_VERSION VERSION_LESS 3.0)
+--- a/eigen3.pc.in
++++ b/eigen3.pc.in
+@@ -6,4 +6,4 @@ Description: A C++ template library for linear algebra: vectors, matrices, and r
+ Requires:
+ Version: @EIGEN_VERSION_NUMBER@
+ Libs:
+-Cflags: -I${prefix}/@INCLUDE_INSTALL_DIR@
++Cflags: -I@EIGEN_INCLUDE_DIR@
diff --git a/nixpkgs/pkgs/development/libraries/elementary-cmake-modules/default.nix b/nixpkgs/pkgs/development/libraries/elementary-cmake-modules/default.nix
new file mode 100644
index 000000000000..9f340545584f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/elementary-cmake-modules/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, lib, fetchFromGitHub, cmake, pkg-config }:
+
+stdenv.mkDerivation {
+  pname = "elementary-cmake-modules";
+  version = "0.1.0";
+
+  src = fetchFromGitHub {
+    owner = "elementary";
+    repo = "cmake-modules";
+    rev = "319ec5336e9f05f3f22b886cc2053ef3d4b6599e";
+    sha256 = "191hhvdxyqvh9axzndaqld7vrmv7xkn0czks908zhb2zpjhv9rby";
+  };
+
+  prePatch = ''
+    substituteInPlace CMakeLists.txt  \
+      --replace ' ''${CMAKE_ROOT}/Modules' " $out/lib/cmake"
+  '';
+
+  propagatedBuildInputs = [ cmake pkg-config ];
+
+  setupHook = ./setup-hook.sh;
+
+  meta = with lib; {
+    platforms = platforms.linux ++ platforms.darwin;
+    homepage = "https://github.com/elementary/cmake-modules";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.samdroid-apps ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/elementary-cmake-modules/setup-hook.sh b/nixpkgs/pkgs/development/libraries/elementary-cmake-modules/setup-hook.sh
new file mode 100644
index 000000000000..6408ac471577
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/elementary-cmake-modules/setup-hook.sh
@@ -0,0 +1,4 @@
+_elementaryCMakeEnvHook() {
+  cmakeFlagsArray+=(-DCMAKE_MODULE_PATH=@out@/lib/cmake)
+}
+addEnvHooks "$targetOffset" _elementaryCMakeEnvHook
diff --git a/nixpkgs/pkgs/development/libraries/elf-header/default.nix b/nixpkgs/pkgs/development/libraries/elf-header/default.nix
new file mode 100644
index 000000000000..72166bb38ce9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/elf-header/default.nix
@@ -0,0 +1,44 @@
+{ stdenvNoCC, lib, glibc, musl }:
+
+let
+   libc =
+     if stdenvNoCC.targetPlatform.isMusl
+     then musl
+     else glibc;
+   headerPath =
+     if stdenvNoCC.targetPlatform.isMusl
+     then "musl-${libc.version}/include/elf.h"
+     else "glibc-${libc.version}/elf/elf.h";
+in
+
+stdenvNoCC.mkDerivation {
+  pname = "elf-header";
+  inherit (libc) version;
+
+  src = null;
+
+  dontUnpack = true;
+
+  dontBuild = true;
+
+  installPhase = ''
+    mkdir -p "$out/include";
+    tar -xf \
+        ${lib.escapeShellArg libc.src} \
+        ${lib.escapeShellArg headerPath} \
+        --to-stdout \
+      | sed -e '/features\.h/d' \
+      > "$out/include/elf.h"
+  '';
+
+  meta = libc.meta // {
+    outputsToInstall = [ "out" ];
+    description = "The datastructures of ELF according to the target platform's libc";
+    longDescription = ''
+      The Executable and Linkable Format (ELF, formerly named Extensible Linking
+      Format), is usually defined in a header like this.
+    '';
+    platforms = lib.platforms.all;
+    maintainers = [ lib.maintainers.ericson2314 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/embree/2.x.nix b/nixpkgs/pkgs/development/libraries/embree/2.x.nix
new file mode 100644
index 000000000000..12d4e2a87ccd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/embree/2.x.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, ispc, tbb, glfw,
+openimageio, libjpeg, libpng, libpthreadstubs, libX11
+}:
+
+stdenv.mkDerivation {
+  pname = "embree";
+  version = "2.17.4";
+
+  src = fetchFromGitHub {
+    owner = "embree";
+    repo = "embree";
+    rev = "v2.17.4";
+    sha256 = "0q3r724r58j4b6cbyy657fsb78z7a2c7d5mwdp7552skynsn2mn9";
+  };
+
+  cmakeFlags = [ "-DEMBREE_TUTORIALS=OFF" ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ ispc tbb glfw openimageio libjpeg libpng libX11 libpthreadstubs ];
+  meta = with lib; {
+    description = "High performance ray tracing kernels from Intel";
+    homepage = "https://embree.github.io/";
+    maintainers = with maintainers; [ hodapp ];
+    license = licenses.asl20;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/embree/default.nix b/nixpkgs/pkgs/development/libraries/embree/default.nix
new file mode 100644
index 000000000000..b85c057217e7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/embree/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, ispc, tbb, glfw,
+  openimageio, libjpeg, libpng, libpthreadstubs, libX11, glib }:
+
+stdenv.mkDerivation rec {
+  pname = "embree";
+  version = "3.13.1";
+
+  src = fetchFromGitHub {
+    owner = "embree";
+    repo = "embree";
+    rev = "v${version}";
+    sha256 = "sha256-6BL/NnveIMg+xD8Zsc3sidL0iw0YbJITgd8Zf4Mh28I=";
+  };
+
+  postPatch = ''
+    # Fix duplicate /nix/store/.../nix/store/.../ paths
+    sed -i "s|SET(EMBREE_ROOT_DIR .*)|set(EMBREE_ROOT_DIR $out)|" \
+      common/cmake/embree-config.cmake
+    sed -i "s|$""{EMBREE_ROOT_DIR}/||" common/cmake/embree-config.cmake
+    substituteInPlace common/math/math.h --replace 'defined(__MACOSX__) && !defined(__INTEL_COMPILER)' 0
+    substituteInPlace common/math/math.h --replace 'defined(__WIN32__) || defined(__FreeBSD__)' 'defined(__WIN32__) || defined(__FreeBSD__) || defined(__MACOSX__)'
+  '';
+
+  cmakeFlags = [
+    "-DEMBREE_TUTORIALS=OFF"
+    "-DEMBREE_RAY_MASK=ON"
+  ];
+
+
+  nativeBuildInputs = [ ispc pkg-config cmake ];
+  buildInputs = [ tbb glfw openimageio libjpeg libpng libX11 libpthreadstubs ]
+                ++ lib.optionals stdenv.isDarwin [ glib ];
+
+  meta = with lib; {
+    description = "High performance ray tracing kernels from Intel";
+    homepage = "https://embree.github.io/";
+    maintainers = with maintainers; [ hodapp gebner ];
+    license = licenses.asl20;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/enchant/1.x.nix b/nixpkgs/pkgs/development/libraries/enchant/1.x.nix
new file mode 100644
index 000000000000..172d6747aa1c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/enchant/1.x.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, aspell, pkg-config, glib, hunspell, hspell }:
+
+stdenv.mkDerivation rec {
+  version = "1.6.1";
+  pname = "enchant";
+
+  src = fetchurl {
+    url = "https://github.com/AbiWord/${pname}/releases/download/${pname}-1-6-1/${pname}-${version}.tar.gz";
+    sha256 = "1xg3m7mniyqyff8qv46jbfwgchb6di6qxdjnd5sfir7jzv0dkw5y";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ aspell glib hunspell hspell ];
+
+  meta = with lib; {
+    description = "Generic spell checking library";
+    homepage = "https://abiword.github.io/enchant";
+    platforms = platforms.unix;
+    badPlatforms = [ "x86_64-darwin" ];
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/enchant/2.x.nix b/nixpkgs/pkgs/development/libraries/enchant/2.x.nix
new file mode 100644
index 000000000000..237ecf148cb8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/enchant/2.x.nix
@@ -0,0 +1,58 @@
+{ lib, stdenv
+, fetchurl
+, aspell
+, pkg-config
+, glib
+, hunspell
+, hspell
+, nuspell
+, unittest-cpp
+}:
+
+stdenv.mkDerivation rec {
+  pname = "enchant";
+  version = "2.3.0";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "https://github.com/AbiWord/${pname}/releases/download/v${version}/${pname}-${version}.tar.gz";
+    sha256 = "sha256-32gGO2wTskX6ckaw4JigPnT3qRxtiUe8XE9CzlXi5B0=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  buildInputs = [
+    glib
+    hunspell
+    nuspell
+  ];
+
+  checkInputs = [
+    unittest-cpp
+  ];
+
+  # libtool puts these to .la files
+  propagatedBuildInputs = [
+    hspell
+    aspell
+  ];
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  configureFlags = [
+    "--enable-relocatable" # needed for tests
+  ];
+
+  meta = with lib; {
+    description = "Generic spell checking library";
+    homepage = "https://abiword.github.io/enchant/";
+    license = licenses.lgpl21Plus; # with extra provision for non-free checkers
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/enet/default.nix b/nixpkgs/pkgs/development/libraries/enet/default.nix
new file mode 100644
index 000000000000..53aec96fe705
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/enet/default.nix
@@ -0,0 +1,19 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "enet";
+  version = "1.3.17";
+
+  src = fetchurl {
+    url = "http://enet.bespin.org/download/${pname}-${version}.tar.gz";
+    sha256 = "1p6f9mby86af6cs7pv6h48032ip9g32c05cb7d9mimam8lchz3x3";
+  };
+
+  meta = {
+    homepage = "http://enet.bespin.org/";
+    description = "Simple and robust network communication layer on top of UDP";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/entt/default.nix b/nixpkgs/pkgs/development/libraries/entt/default.nix
new file mode 100644
index 000000000000..122bd9387308
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/entt/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+stdenv.mkDerivation rec {
+  pname = "entt";
+  version = "3.8.1";
+
+  src = fetchFromGitHub {
+    owner = "skypjack";
+    repo = "entt";
+    rev = "v${version}";
+    sha256 = "sha256-vg2tpGyZZM8c97Qko88JMP5YNPZx5kI5qRkkRclvZtA=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://github.com/skypjack/entt";
+    description = "A header-only, tiny and easy to use library for game programming and much more written in modern C++";
+    maintainers = with maintainers; [ twey ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/epoxy/default.nix b/nixpkgs/pkgs/development/libraries/epoxy/default.nix
new file mode 100644
index 000000000000..7ae0e73953f4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/epoxy/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, utilmacros, python3
+, libGL, libX11
+}:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "epoxy";
+  version = "1.5.4";
+
+  src = fetchFromGitHub {
+    owner = "anholt";
+    repo = "libepoxy";
+    rev = version;
+    sha256 = "0rmg0qlswn250h0arx434jh3hwzsr95lawanpmh1czsfvrcx59l6";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config utilmacros python3 ];
+  buildInputs = [ libGL libX11 ];
+
+  preConfigure = optionalString stdenv.isDarwin ''
+    substituteInPlace configure --replace build_glx=no build_glx=yes
+    substituteInPlace src/dispatch_common.h --replace "PLATFORM_HAS_GLX 0" "PLATFORM_HAS_GLX 1"
+  '';
+
+  patches = [ ./libgl-path.patch ];
+
+  NIX_CFLAGS_COMPILE = ''-DLIBGL_PATH="${getLib libGL}/lib"'';
+
+  doCheck = false; # needs X11
+
+  meta = {
+    description = "A library for handling OpenGL function pointer management";
+    homepage = "https://github.com/anholt/libepoxy";
+    license = licenses.mit;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/epoxy/libgl-path.patch b/nixpkgs/pkgs/development/libraries/epoxy/libgl-path.patch
new file mode 100644
index 000000000000..8f38ee27174b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/epoxy/libgl-path.patch
@@ -0,0 +1,24 @@
+diff --git a/src/dispatch_common.c b/src/dispatch_common.c
+index b3e4f5f..303e8f5 100644
+--- a/src/dispatch_common.c
++++ b/src/dispatch_common.c
+@@ -310,6 +310,19 @@ get_dlopen_handle(void **handle, const char *lib_name, bool exit_on_fail, bool l
+             flags |= RTLD_NOLOAD;
+ 
+         *handle = dlopen(lib_name, flags);
++#ifdef LIBGL_PATH
++        if (!*handle) {
++          char pathbuf[sizeof(LIBGL_PATH) + 1 + 1024 + 1];
++          int l = snprintf(pathbuf, sizeof(pathbuf), "%s/%s", LIBGL_PATH, lib_name);
++          if (l < 0 || l >= sizeof(pathbuf)) {
++            // This really shouldn't happen
++            fprintf(stderr, "Error prefixing library pathname\n");
++            exit(1);
++          }
++          *handle = dlopen(pathbuf, flags);
++        }
++#endif
++
+         if (!*handle) {
+             if (exit_on_fail) {
+                 fprintf(stderr, "Couldn't open %s: %s\n", lib_name, dlerror());
diff --git a/nixpkgs/pkgs/development/libraries/ethash/default.nix b/nixpkgs/pkgs/development/libraries/ethash/default.nix
new file mode 100644
index 000000000000..c1ef9cee9906
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ethash/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, fetchFromGitHub, cmake, gbenchmark, gtest }:
+
+stdenv.mkDerivation rec {
+  pname = "ethash";
+  version = "0.7.0";
+
+  src =
+    fetchFromGitHub {
+      owner = "chfast";
+      repo = "ethash";
+      rev = "v${version}";
+      sha256 = "sha256-QQoWOJGwL03zbBfrFNXz0Ff9Agc2dMBW9nW3jdOwEE8=";
+    };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  checkInputs = [
+    gbenchmark
+    gtest
+  ];
+
+  #preConfigure = ''
+  #  sed -i 's/GTest::main//' test/unittests/CMakeLists.txt
+  #  cat test/unittests/CMakeLists.txt
+  #  ln -sfv ${gtest.src}/googletest gtest
+  #'';
+
+  # NOTE: disabling tests due to gtest issue
+  cmakeFlags = [
+    "-DHUNTER_ENABLED=OFF"
+    "-DETHASH_BUILD_TESTS=OFF"
+    #"-Dbenchmark_DIR=${gbenchmark}/lib/cmake/benchmark"
+    #"-DGTest_DIR=${gtest.dev}/lib/cmake/GTest"
+    #"-DGTest_DIR=${gtest.src}/googletest"
+    #"-DCMAKE_PREFIX_PATH=${gtest.dev}/lib/cmake"
+  ];
+
+  meta = with lib; {
+    description = "PoW algorithm for Ethereum 1.0 based on Dagger-Hashimoto";
+    homepage = "https://github.com/ethereum/ethash";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ];
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/eventlog/default.nix b/nixpkgs/pkgs/development/libraries/eventlog/default.nix
new file mode 100644
index 000000000000..b5b4bc556f69
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/eventlog/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "eventlog";
+  version = "0.2.13";
+
+  src = fetchFromGitHub {
+    owner = "balabit";
+    repo = "eventlog";
+    rev = "a5c19163ba131f79452c6dfe4e31c2b4ce4be741";
+    sha256 = "0a2za3hs7wzy14z7mfgldy1r9xdlqv97yli9wlm8xldr0amsx869";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = with lib; {
+    description = "Syslog event logger library";
+    longDescription = ''
+      The EventLog library aims to be a replacement of the simple syslog() API
+      provided on UNIX systems. The major difference between EventLog and
+      syslog is that EventLog tries to add structure to messages.
+
+      Where you had a simple non-structrured string in syslog() you have a
+      combination of description and tag/value pairs.
+    '';
+    homepage = "https://www.balabit.com/support/community/products/";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/exempi/default.nix b/nixpkgs/pkgs/development/libraries/exempi/default.nix
new file mode 100644
index 000000000000..332de1595a06
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/exempi/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, fetchpatch, expat, zlib, boost, libiconv, darwin }:
+
+stdenv.mkDerivation rec {
+  pname = "exempi";
+  version = "2.5.1";
+
+  src = fetchurl {
+    url = "https://libopenraw.freedesktop.org/download/${pname}-${version}.tar.bz2";
+    sha256 = "07i29xmg8bqriviaf4vi1mwha4lrw85kfla29cfym14fp3z8aqa0";
+  };
+
+  configureFlags = [
+    "--with-boost=${boost.dev}"
+  ] ++ lib.optionals (!doCheck) [
+    "--enable-unittest=no"
+  ];
+
+  buildInputs = [ expat zlib boost ]
+    ++ lib.optionals stdenv.isDarwin [ libiconv darwin.apple_sdk.frameworks.CoreServices ];
+
+  doCheck = stdenv.isLinux && stdenv.is64bit;
+
+  meta = with lib; {
+    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/exiv2/default.nix b/nixpkgs/pkgs/development/libraries/exiv2/default.nix
new file mode 100644
index 000000000000..930bfc99f28e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/exiv2/default.nix
@@ -0,0 +1,102 @@
+{ lib, stdenv
+, fetchFromGitHub
+, zlib
+, expat
+, cmake
+, which
+, libxml2
+, python3
+, gettext
+, doxygen
+, graphviz
+, libxslt
+, libiconv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "exiv2";
+  version = "0.27.4";
+
+  outputs = [ "out" "dev" "doc" "man" ];
+
+  src = fetchFromGitHub {
+    owner = "exiv2";
+    repo  = "exiv2";
+    rev = "v${version}";
+    sha256 = "0m1x79q6i5fw3gr9k0dw0bbl7ym27g9vbmxiamks6yw028xqwc5a";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    doxygen
+    gettext
+    graphviz
+    libxslt
+  ];
+
+  buildInputs = lib.optional stdenv.isDarwin libiconv;
+
+  propagatedBuildInputs = [
+    expat
+    zlib
+  ];
+
+  checkInputs = [
+    libxml2.bin
+    python3
+    which
+  ];
+
+  cmakeFlags = [
+    "-DEXIV2_ENABLE_NLS=ON"
+    "-DEXIV2_BUILD_DOC=ON"
+  ];
+
+  buildFlags = [
+    "all"
+    "doc"
+  ];
+
+  doCheck = true;
+
+  # Test setup found by inspecting ${src}/.travis/run.sh; problems without cmake.
+  checkTarget = "tests";
+
+  preCheck = ''
+    patchShebangs ../test/
+    mkdir ../test/tmp
+
+    ${lib.optionalString (stdenv.isAarch64 || stdenv.isAarch32) ''
+      # Fix tests on arm
+      # https://github.com/Exiv2/exiv2/issues/933
+      rm -f ../tests/bugfixes/github/test_CVE_2018_12265.py
+    ''}
+
+    ${lib.optionalString stdenv.isDarwin ''
+      export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/lib
+      # Removing tests depending on charset conversion
+      substituteInPlace ../test/Makefile --replace "conversions.sh" ""
+      rm -f ../tests/bugfixes/redmine/test_issue_460.py
+      rm -f ../tests/bugfixes/redmine/test_issue_662.py
+      rm -f ../tests/bugfixes/github/test_issue_1046.py
+     ''}
+  '';
+
+  # With CMake we have to enable samples or there won't be
+  # a tests target. This removes them.
+  postInstall = ''
+    ( cd "$out/bin"
+      mv exiv2 .exiv2
+      rm *
+      mv .exiv2 exiv2
+    )
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.exiv2.org/";
+    description = "A library and command-line utility to manage image metadata";
+    platforms = platforms.all;
+    license = licenses.gpl2Plus;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/exosip/default.nix b/nixpkgs/pkgs/development/libraries/exosip/default.nix
new file mode 100644
index 000000000000..f40dea19bb9d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/exosip/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl, libosip, openssl, pkg-config }:
+
+stdenv.mkDerivation rec {
+ pname = "libexosip2";
+ version = "5.2.0";
+
+ src = fetchurl {
+    url = "mirror://savannah/exosip/${pname}-${version}.tar.gz";
+    sha256 = "09bj7cm6mk8yr68y5a09a625x10ql6an3zi4pj6y1jbkhpgqibp3";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libosip openssl ];
+
+  meta = with lib; {
+    license = licenses.gpl2Plus;
+    description = "Library that hides the complexity of using the SIP protocol";
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/expat/default.nix b/nixpkgs/pkgs/development/libraries/expat/default.nix
new file mode 100644
index 000000000000..3bfc215aea7b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/expat/default.nix
@@ -0,0 +1,43 @@
+{ stdenv, fetchurl, lib }:
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+stdenv.mkDerivation rec {
+  pname = "expat";
+  version = "2.4.1";
+
+  src = fetchurl {
+    url = "https://github.com/libexpat/libexpat/releases/download/R_${lib.replaceStrings ["."] ["_"] version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-zwMtDbqbkoY2VI4ysyei1msaq2PE9KE90TLC0dLy+2o=";
+  };
+
+  outputs = [ "out" "dev" ]; # TODO: fix referrers
+  outputBin = "dev";
+
+  configureFlags = lib.optional stdenv.isFreeBSD "--with-pic";
+
+  outputMan = "dev"; # tiny page for a dev tool
+
+  doCheck = true; # not cross;
+
+  preCheck = ''
+    patchShebangs ./configure ./run.sh ./test-driver-wrapper.sh
+  '';
+
+  # CMake files incorrectly calculate library path from dev prefix
+  # https://github.com/libexpat/libexpat/issues/501
+  postFixup = ''
+    substituteInPlace $dev/lib/cmake/expat-${version}/expat-noconfig.cmake \
+      --replace "$"'{_IMPORT_PREFIX}' $out
+  '';
+
+  meta = with lib; {
+    homepage = "https://libexpat.github.io/";
+    description = "A stream-oriented XML parser library written in C";
+    platforms = platforms.all;
+    license = licenses.mit; # expat version
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/faac/default.nix b/nixpkgs/pkgs/development/libraries/faac/default.nix
new file mode 100644
index 000000000000..dbc56572d537
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/faac/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, autoreconfHook
+, mp4v2Support ? true, mp4v2 ? null
+, drmSupport ? false # Digital Radio Mondiale
+}:
+
+assert mp4v2Support -> (mp4v2 != null);
+
+with lib;
+stdenv.mkDerivation rec {
+  pname = "faac";
+  version = "1.30";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/faac/${pname}-${builtins.replaceStrings ["."] ["_"] version}.tar.gz";
+    sha256 = "1lmj0dib3mjp84jhxc5ddvydkzzhb0gfrdh3ikcidjlcb378ghxd";
+  };
+
+  configureFlags = [ ]
+    ++ optional mp4v2Support "--with-external-mp4v2"
+    ++ optional drmSupport "--enable-drm";
+
+  hardeningDisable = [ "format" ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  buildInputs = [ ]
+    ++ optional mp4v2Support mp4v2;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Open source MPEG-4 and MPEG-2 AAC encoder";
+    license     = licenses.unfreeRedistributable;
+    maintainers = with maintainers; [ codyopel ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/faad2/default.nix b/nixpkgs/pkgs/development/libraries/faad2/default.nix
new file mode 100644
index 000000000000..0afef1c9fd82
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/faad2/default.nix
@@ -0,0 +1,28 @@
+{lib, stdenv, fetchFromGitHub, autoreconfHook
+, drmSupport ? false # Digital Radio Mondiale
+}:
+
+with lib;
+stdenv.mkDerivation rec {
+  pname = "faad2";
+  version = "2.10.0";
+
+  src = fetchFromGitHub {
+    owner = "knik0";
+    repo = "faad2";
+    rev = builtins.replaceStrings [ "." ] [ "_" ] version;
+    sha256 = "0q52kdd95ls6ihzyspx176wg9x22425v5qsknrmrjq30q25qmmlg";
+  };
+
+  configureFlags = []
+    ++ optional drmSupport "--with-drm";
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = {
+    description = "An open source MPEG-4 and MPEG-2 AAC decoder";
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ codyopel ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/farbfeld/default.nix b/nixpkgs/pkgs/development/libraries/farbfeld/default.nix
new file mode 100644
index 000000000000..07957674bb31
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/farbfeld/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, makeWrapper, file, libpng, libjpeg }:
+
+stdenv.mkDerivation rec {
+  pname = "farbfeld";
+  version = "4";
+
+  src = fetchurl {
+    url = "https://dl.suckless.org/farbfeld/farbfeld-${version}.tar.gz";
+    sha256 = "0ap7rcngffhdd57jw9j22arzkbrhwh0zpxhwbdfwl8fixlhmkpy7";
+  };
+
+  buildInputs = [ libpng libjpeg ];
+  nativeBuildInputs = [ makeWrapper ];
+
+  installFlags = [ "PREFIX=$(out)" ];
+  postInstall = ''
+    wrapProgram "$out/bin/2ff" --prefix PATH : "${file}/bin"
+  '';
+
+  meta = with lib; {
+    description = "Suckless image format with conversion tools";
+    homepage = "https://tools.suckless.org/farbfeld/";
+    license = licenses.isc;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ pSub ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/farstream/default.nix b/nixpkgs/pkgs/development/libraries/farstream/default.nix
new file mode 100644
index 000000000000..e26ebef0c518
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/farstream/default.nix
@@ -0,0 +1,66 @@
+{ lib, stdenv
+, fetchurl
+, fetchpatch
+, libnice
+, pkg-config
+, autoreconfHook
+, gstreamer
+, gst-plugins-base
+, gupnp-igd
+, gobject-introspection
+, gst-plugins-good
+, gst-plugins-bad
+, gst-libav
+}:
+
+stdenv.mkDerivation rec {
+  pname = "farstream";
+  version = "0.2.8";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "https://www.freedesktop.org/software/farstream/releases/farstream/${pname}-${version}.tar.gz";
+    sha256 = "0249ncd20x5mf884fd8bw75c3118b9fdml837v4fib349xmrqfrb";
+  };
+
+  patches = [
+    # Python has not been used for ages
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/farstream/farstream/commit/73891c28fa27d5e65a71762e826f13747d743588.patch";
+      sha256 = "19pw1m8xhxyf5yhl6k898w240ra2k0m28gfv858x70c4wl786lrn";
+    })
+    # Fix build with newer gnumake.
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/farstream/farstream/-/commit/54987d44.diff";
+      sha256 = "02pka68p2j1wg7768rq7afa5wl9xv82wp86q7izrmwwnxdmz4zyg";
+    })
+  ];
+
+  buildInputs = [
+    libnice
+    gupnp-igd
+    libnice
+  ];
+
+  nativeBuildInputs = [
+    pkg-config
+    autoreconfHook
+    gobject-introspection
+  ];
+
+  propagatedBuildInputs = [
+    gstreamer
+    gst-plugins-base
+    gst-plugins-good
+    gst-plugins-bad
+    gst-libav
+  ];
+
+  meta = with lib; {
+    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/fast-cpp-csv-parser/default.nix b/nixpkgs/pkgs/development/libraries/fast-cpp-csv-parser/default.nix
new file mode 100644
index 000000000000..5a81e3f72746
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fast-cpp-csv-parser/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "fast-cpp-csv-parser";
+  version = "2021-01-03";
+
+  src = fetchFromGitHub {
+    owner = "ben-strasser";
+    repo = pname;
+    rev = "75600d0b77448e6c410893830df0aec1dbacf8e3";
+    sha256 = "04kalwgsr8khqr1j5j13vzwaml268c5dvc9wfcwfs13wp3snqwf2";
+  };
+
+  installPhase = ''
+    mkdir -p $out/lib/pkgconfig $out/include
+    cp -r *.h $out/include/
+    substituteAll ${./fast-cpp-csv-parser.pc.in} $out/lib/pkgconfig/fast-cpp-csv-parser.pc
+  '';
+
+  meta = with lib; {
+    description = "A small, easy-to-use and fast header-only library for reading comma separated value (CSV) files";
+    homepage = "https://github.com/ben-strasser/fast-cpp-csv-parser";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ bhipple ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fast-cpp-csv-parser/fast-cpp-csv-parser.pc.in b/nixpkgs/pkgs/development/libraries/fast-cpp-csv-parser/fast-cpp-csv-parser.pc.in
new file mode 100644
index 000000000000..4a8e57d20ffc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fast-cpp-csv-parser/fast-cpp-csv-parser.pc.in
@@ -0,0 +1,8 @@
+prefix=@out@
+includedir=${prefix}/include
+
+Name: fast-cpp-csv-parser
+Description: Fast header-only library for reading CSV files
+URL: https://github.com/ben-strasser/fast-cpp-csv-parser
+Version: @version@
+Cflags: -isystem${includedir}
diff --git a/nixpkgs/pkgs/development/libraries/fastjson/default.nix b/nixpkgs/pkgs/development/libraries/fastjson/default.nix
new file mode 100644
index 000000000000..9c7f4893cbe4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fastjson/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, libtool, autoconf, automake }:
+
+stdenv.mkDerivation rec {
+  version = "0.99.9";
+  pname = "fastjson";
+  src = fetchFromGitHub {
+    repo = "libfastjson";
+    owner = "rsyslog";
+    rev = "v${version}";
+    sha256 = "sha256-2LyBdJR0dV1CElcGfrlmNwX52lVtx9X/Z4h/1XFjOIs=";
+  };
+
+  buildInputs = [ autoconf automake libtool ];
+
+  preConfigure = ''
+    sh autogen.sh
+  '';
+
+  meta = with lib; {
+    description = "A fast json library for C";
+    homepage = "https://github.com/rsyslog/libfastjson";
+    license = licenses.mit;
+    maintainers = with maintainers; [ nequissimus ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fastpbkdf2/default.nix b/nixpkgs/pkgs/development/libraries/fastpbkdf2/default.nix
new file mode 100644
index 000000000000..723edd6f29d4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fastpbkdf2/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "fastpbkdf2";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "ctz";
+    repo = "fastpbkdf2";
+    rev = "v${version}";
+    sha256 = "09ax0h4ik3vhvp3s98lic93l3g9f4v1jkr5k6z4g1lvm7s3lrha2";
+  };
+
+  buildInputs = [ openssl ];
+
+  preBuild = ''
+    makeFlagsArray=(CFLAGS="-std=c99 -O3 -g")
+  '';
+
+  installPhase = ''
+    mkdir -p $out/{lib,include/fastpbkdf2}
+    cp *.a $out/lib
+    cp fastpbkdf2.h $out/include/fastpbkdf2
+  '';
+
+  meta = with lib; {
+    description = "A fast PBKDF2-HMAC-{SHA1,SHA256,SHA512} implementation in C";
+    homepage = "https://github.com/ctz/fastpbkdf2";
+    license = licenses.cc0;
+    maintainers = with maintainers; [ ledif ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/faudio/default.nix b/nixpkgs/pkgs/development/libraries/faudio/default.nix
new file mode 100644
index 000000000000..a4f19678f240
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/faudio/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, cmake, SDL2}:
+
+#TODO: tests
+
+stdenv.mkDerivation rec {
+  pname = "faudio";
+  version = "21.08";
+
+  src = fetchFromGitHub {
+    owner = "FNA-XNA";
+    repo = "FAudio";
+    rev = version;
+    sha256 = "sha256-zgXIho1jmoOCVcjvDwiq+J1jOzsPgxvvaWN8NfszEdA=";
+  };
+
+  nativeBuildInputs = [cmake];
+
+  buildInputs = [ SDL2 ];
+
+  meta = with 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/fcft/default.nix b/nixpkgs/pkgs/development/libraries/fcft/default.nix
new file mode 100644
index 000000000000..8f2d56fad285
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fcft/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, lib, fetchFromGitea, pkg-config, meson, ninja, scdoc
+, freetype, fontconfig, pixman, tllist, check
+, withHarfBuzz ? true
+, harfbuzz
+}:
+
+let
+  # Courtesy of sternenseemann and FRidh, commit c9a7fdfcfb420be8e0179214d0d91a34f5974c54
+  mesonFeatureFlag = opt: b: "-D${opt}=${if b then "enabled" else "disabled"}";
+in
+
+stdenv.mkDerivation rec {
+  pname = "fcft";
+  version = "2.4.5";
+
+  src = fetchFromGitea {
+    domain = "codeberg.org";
+    owner = "dnkl";
+    repo = "fcft";
+    rev = version;
+    sha256 = "0z4bqap88pydkgcxrsvm3fmcyhi9x7z8knliarvdcvqlk7qnyzfh";
+  };
+
+  depsBuildBuild = [ pkg-config ];
+  nativeBuildInputs = [ pkg-config meson ninja scdoc ];
+  buildInputs = [ freetype fontconfig pixman tllist ]
+    ++ lib.optional withHarfBuzz harfbuzz;
+  checkInputs = [ check ];
+
+  mesonBuildType = "release";
+  mesonFlags = [
+    (mesonFeatureFlag "text-shaping" withHarfBuzz)
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://codeberg.org/dnkl/fcft";
+    changelog = "https://codeberg.org/dnkl/fcft/releases/tag/${version}";
+    description = "Simple library for font loading and glyph rasterization";
+    maintainers = with maintainers; [
+      fionera
+      sternenseemann
+    ];
+    license = licenses.mit;
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fcgi/default.nix b/nixpkgs/pkgs/development/libraries/fcgi/default.nix
new file mode 100644
index 000000000000..1ec666a920c3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fcgi/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "fcgi";
+  version = "2.4.2";
+
+  src = fetchFromGitHub {
+    owner = "FastCGI-Archives";
+    repo = "fcgi2";
+    rev = version;
+    sha256 = "1jhz6jfwv5kawa8kajvg18nfwc1b30f38zc0lggszd1vcmrwqkz1";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  postInstall = "ln -s . $out/include/fastcgi";
+
+  meta = with lib; {
+    description = "A language independent, scalable, open extension to CG";
+    homepage = "http://www.fastcgi.com/";
+    license = "FastCGI see LICENSE.TERMS";
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fcgi/gcc-4.4.diff b/nixpkgs/pkgs/development/libraries/fcgi/gcc-4.4.diff
new file mode 100644
index 000000000000..c6806c12c067
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fcgi/gcc-4.4.diff
@@ -0,0 +1,12 @@
+diff --git a/libfcgi/fcgio.cpp b/libfcgi/fcgio.cpp
+index 95e28ca..a7eda0e 100644
+--- a/libfcgi/fcgio.cpp
++++ b/libfcgi/fcgio.cpp
+@@ -23,6 +23,7 @@
+ #endif
+ 
+ #include <limits.h>
++#include <cstdio>
+ #include "fcgio.h"
+ 
+ using std::streambuf;
diff --git a/nixpkgs/pkgs/development/libraries/fcl/default.nix b/nixpkgs/pkgs/development/libraries/fcl/default.nix
new file mode 100644
index 000000000000..33a600805846
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fcl/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, eigen, libccd, octomap }:
+
+stdenv.mkDerivation rec {
+  pname = "fcl";
+  version = "0.6.1";
+
+  src = fetchFromGitHub {
+    owner = "flexible-collision-library";
+    repo = pname;
+    rev = version;
+    sha256 = "1i1sd0fsvk5d529aw8aw29bsmymqgcmj3ci35sz58nzp2wjn0l5d";
+  };
+
+  patches = [
+    # Disable SSE on Emscripten (required for the next patch to apply cleanly)
+    # https://github.com/flexible-collision-library/fcl/pull/470
+    (fetchpatch {
+      url = "https://github.com/flexible-collision-library/fcl/commit/83a1af61ba4efa81ec0b552b3121100044a8cf46.patch";
+      sha256 = "0bbkv4xpkl3c0i8qdlkghj6qkybrrd491c8rd2cqnxfgspcd40p0";
+    })
+    # Detect SSE support to fix building on ARM
+    # https://github.com/flexible-collision-library/fcl/pull/506
+    (fetchpatch {
+      url = "https://github.com/flexible-collision-library/fcl/commit/cbfe1e9405aa68138ed1a8f33736429b85500dea.patch";
+      sha256 = "18qip8gwhm3fvbz1cvzf625rh5msq8m4669ld1m60fv6z50clr9h";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+  propagatedBuildInputs = [ eigen libccd octomap ];
+
+  outputs = [ "out" "dev" ];
+
+  meta = with lib; {
+    description = "Flexible Collision Library";
+    longDescription = ''
+      FCL is a library for performing three types of proximity queries on a
+      pair of geometric models composed of triangles.
+    '';
+    homepage = "https://github.com/flexible-collision-library/fcl";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ lopsided98 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fcppt/default.nix b/nixpkgs/pkgs/development/libraries/fcppt/default.nix
new file mode 100644
index 000000000000..380fdcce29f3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fcppt/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, cmake, boost, catch2, metal }:
+stdenv.mkDerivation rec {
+  pname = "fcppt";
+  version = "3.5.0";
+
+  src = fetchFromGitHub {
+    owner = "freundlich";
+    repo = "fcppt";
+    rev = version;
+    sha256 = "045cmn4sym6ria96l4fsc1vrs8l4xrl1gzkmja82f4ddj8qkji2f";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost catch2 metal ];
+
+  cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=false" "-DENABLE_BOOST=true" "-DENABLE_EXAMPLES=true" "-DENABLE_CATCH=true" "-DENABLE_TEST=true" ];
+
+  meta = with lib; {
+    description = "Freundlich's C++ toolkit";
+    longDescription = ''
+      Freundlich's C++ Toolkit (fcppt) is a collection of libraries focusing on
+      improving general C++ code by providing better types, a strong focus on
+      C++11 (non-conforming compilers are mostly not supported) and functional
+      programming (which is both efficient and syntactically affordable in
+      C++11).
+    '';
+    homepage = "https://fcppt.org";
+    license = licenses.boost;
+    maintainers = with maintainers; [ pmiddend ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fdk-aac/default.nix b/nixpkgs/pkgs/development/libraries/fdk-aac/default.nix
new file mode 100644
index 000000000000..a94c204c2f78
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fdk-aac/default.nix
@@ -0,0 +1,25 @@
+{ lib
+, stdenv
+, fetchurl
+, exampleSupport ? false # Example encoding program
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fdk-aac";
+  version = "2.0.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/opencore-amr/fdk-aac/${pname}-${version}.tar.gz";
+    sha256 = "sha256-yehjDPnUM/POrXSQahUg0iI/ibzT+pJUhhAXRAuOsi8=";
+  };
+
+  configureFlags = lib.optional exampleSupport "--enable-example";
+
+  meta = with lib; {
+    description = "A high-quality implementation of the AAC codec from Android";
+    homepage = "https://sourceforge.net/projects/opencore-amr/";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ codyopel ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fflas-ffpack/default.nix b/nixpkgs/pkgs/development/libraries/fflas-ffpack/default.nix
new file mode 100644
index 000000000000..ca2f3b0e381d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fflas-ffpack/default.nix
@@ -0,0 +1,58 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, givaro, pkg-config, blas, lapack
+, gmpxx
+}:
+
+assert (!blas.isILP64) && (!lapack.isILP64);
+
+stdenv.mkDerivation rec {
+  pname = "fflas-ffpack";
+  version = "2.4.3";
+
+  src = fetchFromGitHub {
+    owner = "linbox-team";
+    repo = pname;
+    rev = version;
+    sha256 = "1ynbjd72qrwp0b4kpn0p5d7gddpvj8dlb5fwdxajr5pvkvi3if74";
+  };
+
+  checkInputs = [
+    gmpxx
+  ];
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+  ] ++ lib.optionals doCheck checkInputs;
+
+  buildInputs = [ givaro blas lapack ];
+
+  configureFlags = [
+    "--with-blas-libs=-lcblas"
+    "--with-lapack-libs=-llapacke"
+  ] ++ lib.optionals stdenv.isx86_64 [
+    # disable SIMD instructions (which are enabled *when available* by default)
+    # 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)
+    "--${if stdenv.hostPlatform.sse3Support   then "enable" else "disable"}-sse3"
+    "--${if stdenv.hostPlatform.ssse3Support  then "enable" else "disable"}-ssse3"
+    "--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41"
+    "--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42"
+    "--${if stdenv.hostPlatform.avxSupport    then "enable" else "disable"}-avx"
+    "--${if stdenv.hostPlatform.avx2Support   then "enable" else "disable"}-avx2"
+    "--${if stdenv.hostPlatform.avx512Support then "enable" else "disable"}-avx512f"
+    "--${if stdenv.hostPlatform.avx512Support then "enable" else "disable"}-avx512dq"
+    "--${if stdenv.hostPlatform.avx512Support then "enable" else "disable"}-avx512vl"
+    "--${if stdenv.hostPlatform.fmaSupport    then "enable" else "disable"}-fma"
+    "--${if stdenv.hostPlatform.fma4Support   then "enable" else "disable"}-fma4"
+  ];
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Finite Field Linear Algebra Subroutines";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.sage.members;
+    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
new file mode 100644
index 000000000000..3dca11008f72
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ffmpeg-full/default.nix
@@ -0,0 +1,488 @@
+{ lib, stdenv, ffmpeg, addOpenGLRunpath, pkg-config, perl, texinfo, yasm
+/*
+ *  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: libvmaf,opencore-amrnb,opencore-amrwb,samba,vo-aacenc,vo-amrwbenc
+, nonfreeLicensing ? false # NONFREE: openssl,fdkaac,blackmagic-design-desktop-video
+/*
+ *  Build options
+ */
+, smallBuild ? false # Optimize for size instead of speed
+, runtimeCpuDetectBuild ? true # Detect CPU capabilities at runtime (disable to compile natively)
+, grayBuild ? true # Full grayscale support
+, swscaleAlphaBuild ? true # Alpha channel support in swscale
+, hardcodedTablesBuild ? true # Hardcode decode tables instead of runtime generation
+, safeBitstreamReaderBuild ? true # Buffer boundary checking in bitreaders
+, multithreadBuild ? true # Multithreading via pthreads/win32 threads
+, networkBuild ? true # Network support
+, pixelutilsBuild ? true # Pixel utils in libavutil
+, enableLto ? false # build with link-time optimization
+/*
+ *  Program options
+ */
+, ffmpegProgram ? true # Build ffmpeg executable
+, ffplayProgram ? true # Build ffplay executable
+, ffprobeProgram ? true # Build ffprobe executable
+, qtFaststartProgram ? true # Build qt-faststart executable
+/*
+ *  Library options
+ */
+, avcodecLibrary ? true # Build avcodec library
+, avdeviceLibrary ? true # Build avdevice library
+, avfilterLibrary ? true # Build avfilter library
+, avformatLibrary ? true # Build avformat library
+, avresampleLibrary ? true # Build avresample library
+, avutilLibrary ? true # Build avutil library
+, postprocLibrary ? true # Build postproc library
+, swresampleLibrary ? true # Build swresample library
+, swscaleLibrary ? true # Build swscale library
+/*
+ *  Documentation options
+ */
+, htmlpagesDocumentation ? false # HTML documentation pages
+, manpagesDocumentation ? true # Man documentation pages
+, podpagesDocumentation ? false # POD documentation pages
+, txtpagesDocumentation ? false # Text documentation pages
+/*
+ *  External libraries options
+ */
+, alsa-lib ? null # Alsa in/output support
+#, avisynth ? null # Support for reading AviSynth scripts
+, bzip2 ? null
+, celt ? null # CELT decoder
+#, crystalhd ? null # Broadcom CrystalHD hardware acceleration
+, dav1d ? null # AV1 decoder (focused on speed and correctness)
+#, decklinkExtlib ? false, blackmagic-design-desktop-video ? null # Blackmagic Design DeckLink I/O support
+, fdkaacExtlib ? false, fdk_aac ? null # Fraunhofer FDK AAC de/encoder
+#, flite ? null # Flite (voice synthesis) support
+, fontconfig ? null # Needed for drawtext filter
+, freetype ? null # Needed for drawtext filter
+, frei0r ? null # frei0r video filtering
+, fribidi ? null # Needed for drawtext filter
+, game-music-emu ? null # Game Music Emulator
+, gnutls ? null
+, gsm ? null # GSM de/encoder
+#, ilbc ? null # iLBC de/encoder
+, libjack2 ? null # Jack audio (only version 2 is supported in this build)
+, ladspaH ? null # LADSPA audio filtering
+, lame ? null # LAME MP3 encoder
+, libass ? null # (Advanced) SubStation Alpha subtitle rendering
+, libaom ? null # AV1 encoder
+, libbluray ? null # BluRay reading
+, libbs2b ? null # bs2b DSP library
+, libcaca ? null # Textual display (ASCII art)
+#, libcdio-paranoia ? null # Audio CD grabbing
+, libdc1394 ? null, libraw1394 ? null # IIDC-1394 grabbing (ieee 1394)
+, libdrm ? null # libdrm support
+, libiconv ? null
+#, libiec61883 ? null, libavc1394 ? null # iec61883 (also uses libraw1394)
+, libmfx ? null # Hardware acceleration vis libmfx
+, libmodplug ? null # ModPlug support
+, libmysofa ? null # HRTF support via SOFAlizer
+#, libnut ? null # NUT (de)muxer, native (de)muser exists
+, libogg ? null # Ogg container used by vorbis & theora
+, libopus ? null # Opus de/encoder
+, librsvg ? null # SVG protocol
+, libssh ? null # SFTP protocol
+, libtheora ? null # Theora encoder
+, 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
+, libX11 ? null # Xlib support
+, libxcb ? null # X11 grabbing using XCB
+, libxcbshmExtlib ? true # X11 grabbing shm communication
+, libxcbxfixesExtlib ? true # X11 grabbing mouse rendering
+, libxcbshapeExtlib ? true # X11 grabbing shape rendering
+, libXv ? null # Xlib support
+, libXext ? null # Xlib support
+, xz ? null # xz-utils
+, nvenc ? !stdenv.isDarwin && !stdenv.isAarch64, nv-codec-headers ? null # NVIDIA NVENC support
+, openal ? null # OpenAL 1.1 capture support
+#, opencl ? null # OpenCL code
+, opencore-amr ? null # AMR-NB de/encoder & AMR-WB decoder
+#, opencv ? null # Video filtering
+, openglExtlib ? false, libGL ? null, libGLU ? null # OpenGL rendering
+#, openh264 ? null # H.264/AVC encoder
+, openjpeg ? null # JPEG 2000 de/encoder
+, opensslExtlib ? false, openssl ? null
+, libpulseaudio ? null # Pulseaudio input support
+, rav1e ? null # AV1 encoder (focused on speed and safety)
+, svt-av1 ? null # AV1 encoder/decoder (focused on speed and correctness)
+, rtmpdump ? null # RTMP[E] support
+#, libquvi ? null # Quvi input support
+, samba ? null # Samba protocol
+#, schroedinger ? null # Dirac de/encoder
+, SDL2 ? null
+#, shine ? null # Fixed-point MP3 encoder
+, soxr ? null # Resampling via soxr
+, speex ? null # Speex de/encoder
+, srt ? null # Secure Reliable Transport (SRT) protocol
+#, twolame ? null # MP2 encoder
+#, utvideo ? null # Ut Video de/encoder
+, vid-stab ? null # Video stabilization
+#, vo-aacenc ? null # AAC encoder
+, vo-amrwbenc ? null # AMR-WB encoder
+, x264 ? null # H.264/AVC encoder
+, x265 ? null # H.265/HEVC encoder
+, xavs ? null # AVS encoder
+, xvidcore ? null # Xvid encoder, native encoder exists
+, zeromq4 ? null # Message passing
+, zlib ? null
+, vulkan-loader ? null
+, glslang ? null
+#, zvbi ? null # Teletext support
+/*
+ *  Developer options
+ */
+, debugDeveloper ? false
+, optimizationsDeveloper ? true
+, extraWarningsDeveloper ? false
+, strippingDeveloper ? false
+/*
+ *  Darwin frameworks
+ */
+, Cocoa, CoreAudio, CoreServices, AVFoundation, MediaToolbox
+, VideoDecodeAcceleration
+}:
+
+/* Maintainer notes:
+ *
+ * Version bumps:
+ * It should always be safe to bump patch releases (e.g. 2.1.x, x being a patch release)
+ * If adding a new branch, note any configure flags that were added, changed, or deprecated/removed
+ *   and make the necessary changes.
+ *
+ * Packages with errors:
+ *   flite ilbc schroedinger
+ *   opencv - circular dependency issue
+ *
+ * Not packaged:
+ *   aacplus avisynth cdio-paranoia crystalhd libavc1394 libiec61883
+ *   libnut libquvi nvenc opencl openh264 oss shine twolame
+ *   utvideo vo-aacenc vo-amrwbenc xvmc zvbi blackmagic-design-desktop-video
+ *
+ * Need fixes to support Darwin:
+ *   gsm libjack2 libmodplug libmfx(intel-media-sdk) nvenc pulseaudio samba
+ *   vid-stab
+ *
+ * Need fixes to support AArch64:
+ *   libmfx(intel-media-sdk) nvenc
+ *
+ * Not supported:
+ *   stagefright-h264(android only)
+ *
+ * Known issues:
+ * flite: configure fails to find library
+ *   Tried modifying ffmpeg's configure script and flite to use pkg-config
+ * Cross-compiling will disable features not present on host OS
+ *   (e.g. dxva2 support [DirectX] will not be enabled unless natively compiled on Cygwin)
+ *
+ */
+
+let
+  inherit (stdenv) isCygwin isDarwin isFreeBSD isLinux isAarch64;
+  inherit (lib) optional optionals optionalString enableFeature;
+in
+
+/*
+ *  Licensing dependencies
+ */
+assert version3Licensing -> gplLicensing;
+assert nonfreeLicensing -> gplLicensing && version3Licensing;
+/*
+ *  Build dependencies
+ */
+assert networkBuild -> gnutls != null || opensslExtlib;
+assert pixelutilsBuild -> avutilLibrary;
+/*
+ *  Platform dependencies
+ */
+assert isDarwin -> !nvenc;
+/*
+ *  Program dependencies
+ */
+assert ffmpegProgram -> avcodecLibrary
+                     && avfilterLibrary
+                     && avformatLibrary
+                     && swresampleLibrary;
+assert ffplayProgram -> avcodecLibrary
+                     && avformatLibrary
+                     && swscaleLibrary
+                     && swresampleLibrary
+                     && SDL2 != null;
+assert ffprobeProgram -> avcodecLibrary && avformatLibrary;
+/*
+ *  Library dependencies
+ */
+assert avcodecLibrary -> avutilLibrary; # configure flag since 0.6
+assert avdeviceLibrary -> avformatLibrary
+                       && avcodecLibrary
+                       && avutilLibrary; # configure flag since 0.6
+assert avformatLibrary -> avcodecLibrary && avutilLibrary; # configure flag since 0.6
+assert avresampleLibrary -> avutilLibrary;
+assert postprocLibrary -> avutilLibrary;
+assert swresampleLibrary -> soxr != null;
+assert swscaleLibrary -> avutilLibrary;
+/*
+ *  External libraries
+ */
+#assert decklinkExtlib -> blackmagic-design-desktop-video != null
+#                                       && !isCygwin && multithreadBuild # POSIX threads required
+#                                       && nonfreeLicensing;
+assert fdkaacExtlib -> fdk_aac != null && nonfreeLicensing;
+assert gnutls != null -> !opensslExtlib;
+assert libxcbshmExtlib -> libxcb != null;
+assert libxcbxfixesExtlib -> libxcb != null;
+assert libxcbshapeExtlib -> libxcb != null;
+assert openglExtlib -> libGL != null && libGLU != null;
+assert opensslExtlib -> gnutls == null && openssl != null && nonfreeLicensing;
+
+stdenv.mkDerivation rec {
+  pname = "ffmpeg-full";
+  inherit (ffmpeg) src version;
+
+  prePatch = ''
+    patchShebangs .
+  '' + lib.optionalString stdenv.isDarwin ''
+    sed -i 's/#ifndef __MAC_10_11/#if 1/' ./libavcodec/audiotoolboxdec.c
+  '' + lib.optionalString (frei0r != null) ''
+    substituteInPlace libavfilter/vf_frei0r.c \
+      --replace /usr/local/lib/frei0r-1 ${frei0r}/lib/frei0r-1
+    substituteInPlace doc/filters.texi \
+      --replace /usr/local/lib/frei0r-1 ${frei0r}/lib/frei0r-1
+  '';
+
+  configurePlatforms = [];
+  configureFlags = [
+    "--target_os=${stdenv.hostPlatform.parsed.kernel.name}"
+    "--arch=${stdenv.hostPlatform.parsed.cpu.name}"
+    /*
+     *  Licensing flags
+     */
+    (enableFeature gplLicensing "gpl")
+    (enableFeature version3Licensing "version3")
+    (enableFeature nonfreeLicensing "nonfree")
+    /*
+     *  Build flags
+     */
+    # On some ARM platforms --enable-thumb
+    "--enable-shared"
+    (enableFeature true "pic")
+    (enableFeature smallBuild "small")
+    (enableFeature runtimeCpuDetectBuild "runtime-cpudetect")
+    (enableFeature enableLto "lto")
+    (enableFeature grayBuild "gray")
+    (enableFeature swscaleAlphaBuild "swscale-alpha")
+    (enableFeature hardcodedTablesBuild "hardcoded-tables")
+    (enableFeature safeBitstreamReaderBuild "safe-bitstream-reader")
+    (if multithreadBuild then (
+       if isCygwin then
+         "--disable-pthreads --enable-w32threads"
+       else # Use POSIX threads by default
+         "--enable-pthreads --disable-w32threads")
+     else
+       "--disable-pthreads --disable-w32threads")
+    "--disable-os2threads" # We don't support OS/2
+    (enableFeature networkBuild "network")
+    (enableFeature pixelutilsBuild "pixelutils")
+    /*
+     *  Program flags
+     */
+    (enableFeature ffmpegProgram "ffmpeg")
+    (enableFeature ffplayProgram "ffplay")
+    (enableFeature ffprobeProgram "ffprobe")
+    /*
+     *  Library flags
+     */
+    (enableFeature avcodecLibrary "avcodec")
+    (enableFeature avdeviceLibrary "avdevice")
+    (enableFeature avfilterLibrary "avfilter")
+    (enableFeature avformatLibrary "avformat")
+    (enableFeature avresampleLibrary "avresample")
+    (enableFeature avutilLibrary "avutil")
+    (enableFeature (postprocLibrary && gplLicensing) "postproc")
+    (enableFeature swresampleLibrary "swresample")
+    (enableFeature swscaleLibrary "swscale")
+    /*
+     *  Documentation flags
+     */
+    (enableFeature (htmlpagesDocumentation
+          || manpagesDocumentation
+          || podpagesDocumentation
+          || txtpagesDocumentation) "doc")
+    (enableFeature htmlpagesDocumentation "htmlpages")
+    (enableFeature manpagesDocumentation "manpages")
+    (enableFeature podpagesDocumentation "podpages")
+    (enableFeature txtpagesDocumentation "txtpages")
+    /*
+     *  External libraries
+     */
+    #(enableFeature avisynth "avisynth")
+    (enableFeature (bzip2 != null) "bzlib")
+    (enableFeature (celt != null) "libcelt")
+    #(enableFeature crystalhd "crystalhd")
+    (enableFeature (dav1d != null) "libdav1d")
+    #(enableFeature decklinkExtlib "decklink")
+    (enableFeature (fdkaacExtlib && gplLicensing) "libfdk-aac")
+    #(enableFeature (flite != null) "libflite")
+    "--disable-libflite" # Force disable until a solution is found
+    (enableFeature (fontconfig != null) "fontconfig")
+    (enableFeature (freetype != null) "libfreetype")
+    (enableFeature (frei0r != null && gplLicensing) "frei0r")
+    (enableFeature (fribidi != null) "libfribidi")
+    (enableFeature (game-music-emu != null) "libgme")
+    (enableFeature (gnutls != null) "gnutls")
+    (enableFeature (gsm != null) "libgsm")
+    #(enableFeature (ilbc != null) "libilbc")
+    (enableFeature (ladspaH !=null) "ladspa")
+    (enableFeature (lame != null) "libmp3lame")
+    (enableFeature (libaom != null) "libaom")
+    (enableFeature (libass != null) "libass")
+    #(enableFeature (libavc1394 != null) null null)
+    (enableFeature (libbluray != null) "libbluray")
+    (enableFeature (libbs2b != null) "libbs2b")
+    #(enableFeature (libcaca != null) "libcaca")
+    #(enableFeature (cdio-paranoia != null && gplLicensing) "libcdio")
+    (enableFeature (if isLinux then libdc1394 != null && libraw1394 != null else false) "libdc1394")
+    (enableFeature ((isLinux || isFreeBSD) && libdrm != null) "libdrm")
+    (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")
+    (enableFeature (libmysofa != null) "libmysofa")
+    #(enableFeature (libnut != null) "libnut")
+    (enableFeature (libopus != null) "libopus")
+    (enableFeature (librsvg != null) "librsvg")
+    (enableFeature (srt != null) "libsrt")
+    (enableFeature (libssh != null) "libssh")
+    (enableFeature (libtheora != null) "libtheora")
+    (enableFeature (if isLinux then libv4l != null else false) "libv4l2")
+    (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")
+    (enableFeature (libxcb != null) "libxcb")
+    (enableFeature libxcbshmExtlib "libxcb-shm")
+    (enableFeature libxcbxfixesExtlib "libxcb-xfixes")
+    (enableFeature libxcbshapeExtlib "libxcb-shape")
+    (enableFeature (xz != null) "lzma")
+    (enableFeature nvenc "nvenc")
+    (enableFeature (openal != null) "openal")
+    #(enableFeature opencl "opencl")
+    (enableFeature (opencore-amr != null && version3Licensing) "libopencore-amrnb")
+    #(enableFeature (opencv != null) "libopencv")
+    (enableFeature openglExtlib "opengl")
+    #(enableFeature (openh264 != null) "openh264")
+    (enableFeature (openjpeg != null) "libopenjpeg")
+    (enableFeature (opensslExtlib && gplLicensing) "openssl")
+    (enableFeature (libpulseaudio != null) "libpulse")
+    #(enableFeature quvi "libquvi")
+    (enableFeature (rav1e != null) "librav1e")
+    (enableFeature (svt-av1 != null) "libsvtav1")
+    (enableFeature (rtmpdump != null) "librtmp")
+    #(enableFeature (schroedinger != null) "libschroedinger")
+    (enableFeature (SDL2 != null) "sdl2")
+    (enableFeature (soxr != null) "libsoxr")
+    (enableFeature (speex != null) "libspeex")
+    #(enableFeature (twolame != null) "libtwolame")
+    #(enableFeature (utvideo != null && gplLicensing) "libutvideo")
+    (enableFeature (vid-stab != null && gplLicensing) "libvidstab") # Actual min. version 2.0
+    #(enableFeature (vo-aacenc != null && version3Licensing) "libvo-aacenc")
+    (enableFeature (vo-amrwbenc != null && version3Licensing) "libvo-amrwbenc")
+    (enableFeature (x264 != null && gplLicensing) "libx264")
+    (enableFeature (x265 != null && gplLicensing) "libx265")
+    (enableFeature (xavs != null && gplLicensing) "libxavs")
+    (enableFeature (xvidcore != null && gplLicensing) "libxvid")
+    (enableFeature (zeromq4 != null) "libzmq")
+    (enableFeature (zlib != null) "zlib")
+    (enableFeature (isLinux && vulkan-loader != null) "vulkan")
+    (enableFeature (isLinux && vulkan-loader != null && glslang != null) "libglslang")
+    (enableFeature (samba != null && gplLicensing && version3Licensing) "libsmbclient")
+    #(enableFeature (zvbi != null && gplLicensing) "libzvbi")
+    /*
+     * Developer flags
+     */
+    (enableFeature debugDeveloper "debug")
+    (enableFeature optimizationsDeveloper "optimizations")
+    (enableFeature extraWarningsDeveloper "extra-warnings")
+    (enableFeature strippingDeveloper "stripping")
+  ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "--cross-prefix=${stdenv.cc.targetPrefix}"
+    "--enable-cross-compile"
+  ] ++ optionals stdenv.cc.isClang [
+    "--cc=clang"
+    "--cxx=clang++"
+  ];
+
+  nativeBuildInputs = [ addOpenGLRunpath perl pkg-config texinfo yasm ];
+
+  buildInputs = [
+    bzip2 celt dav1d fontconfig freetype frei0r fribidi game-music-emu gnutls gsm
+    libjack2 ladspaH lame libaom libass libbluray libbs2b libcaca libdc1394 libmodplug libmysofa
+    libogg libopus librsvg libssh libtheora libvdpau libvorbis libvpx libwebp libX11
+    libxcb libXv libXext xz openal openjpeg libpulseaudio rav1e svt-av1 rtmpdump opencore-amr
+    samba SDL2 soxr speex srt vid-stab vo-amrwbenc x264 x265 xavs xvidcore
+    zeromq4 zlib
+  ] ++ optionals openglExtlib [ libGL libGLU ]
+    ++ optionals nonfreeLicensing [ fdk_aac openssl ]
+    ++ optional ((isLinux || isFreeBSD) && libva != null) libva
+    ++ optional ((isLinux || isFreeBSD) && libdrm != null) libdrm
+    ++ optional (!isAarch64 && libvmaf != null && version3Licensing) libvmaf
+    ++ optionals isLinux [ alsa-lib libraw1394 libv4l vulkan-loader glslang ]
+    ++ optional (isLinux && !isAarch64 && libmfx != null) libmfx
+    ++ optional nvenc nv-codec-headers
+    ++ optionals stdenv.isDarwin [ Cocoa CoreServices CoreAudio AVFoundation
+                                   MediaToolbox VideoDecodeAcceleration
+                                   libiconv ];
+
+  buildFlags = [ "all" ]
+    ++ optional qtFaststartProgram "tools/qt-faststart"; # Build qt-faststart executable
+
+  # Hacky framework patching technique borrowed from the phantomjs2 package
+  postInstall = optionalString qtFaststartProgram ''
+    cp -a tools/qt-faststart $out/bin/
+  '';
+
+  postFixup = optionalString stdenv.isLinux ''
+    # Set RUNPATH so that libnvcuvid and libcuda in /run/opengl-driver(-32)/lib can be found.
+    # See the explanation in addOpenGLRunpath.
+    addOpenGLRunpath $out/lib/libavcodec.so
+    addOpenGLRunpath $out/lib/libavutil.so
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A complete, cross-platform solution to record, convert and stream audio and video";
+    homepage = "https://www.ffmpeg.org/";
+    changelog = "https://github.com/FFmpeg/FFmpeg/blob/n${version}/Changelog";
+    longDescription = ''
+      FFmpeg is the leading multimedia framework, able to decode, encode, transcode,
+      mux, demux, stream, filter and play pretty much anything that humans and machines
+      have created. It supports the most obscure ancient formats up to the cutting edge.
+      No matter if they were designed by some standards committee, the community or
+      a corporation.
+    '';
+    license = (
+      if nonfreeLicensing then
+        licenses.unfreeRedistributable
+      else if version3Licensing then
+        licenses.gpl3
+      else if gplLicensing then
+        licenses.gpl2Plus
+      else
+        licenses.lgpl21Plus
+    );
+    platforms = platforms.all;
+    maintainers = with maintainers; [ codyopel ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ffmpeg-sixel/default.nix b/nixpkgs/pkgs/development/libraries/ffmpeg-sixel/default.nix
new file mode 100644
index 000000000000..daa03d0293a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ffmpeg-sixel/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, libsixel, yasm
+}:
+
+stdenv.mkDerivation {
+
+  pname = "ffmpeg-sixel";
+  version = "nightly-2.3.x";
+
+  src = fetchFromGitHub {
+    owner = "saitoha";
+    repo = "FFmpeg-SIXEL";
+    rev = "8566fdb8b7516b54aed58f329dc216e06fc10052";
+    sha256 = "00s2lggfdj2ibpngpyqqg7360p7yb69ys1ppg59yvv0m0mxk5x3k";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    libsixel
+    yasm
+  ];
+
+  configurePhase = ''
+    ./configure --enable-libsixel --prefix=$out
+  '';
+
+  postInstall = ''
+    mv $out/bin/ffmpeg $out/bin/ffmpeg-sixel
+  '';
+
+  meta = with lib; {
+    description = "A complete, cross-platform solution to record, convert and stream audio and video, extended to support console graphics";
+    homepage = "http://www.ffmpeg.org/";
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ vrthra ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ffmpeg/2.8.nix b/nixpkgs/pkgs/development/libraries/ffmpeg/2.8.nix
new file mode 100644
index 000000000000..6d94c2e9974b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ffmpeg/2.8.nix
@@ -0,0 +1,10 @@
+{ callPackage, ... } @ args:
+
+callPackage ./generic.nix (rec {
+  version = "${branch}.17";
+  branch = "2.8";
+  sha256 = "05bnhvs2f82aq95z1wd3wr42sljdfq4kiyzqwhpji983mndx14vl";
+  knownVulnerabilities = [
+    "CVE-2021-30123"
+  ];
+} // args)
diff --git a/nixpkgs/pkgs/development/libraries/ffmpeg/3.4.nix b/nixpkgs/pkgs/development/libraries/ffmpeg/3.4.nix
new file mode 100644
index 000000000000..25c0a12f731a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ffmpeg/3.4.nix
@@ -0,0 +1,15 @@
+{ callPackage
+# Darwin frameworks
+, Cocoa, CoreMedia
+, ...
+}@args:
+
+callPackage ./generic.nix (rec {
+  version = branch;
+  branch = "3.4.8";
+  sha256 = "1d0r4yja2dkkyhdwx1migq46gsrcbajiv66263a5sq5bfr9dqkch";
+  darwinFrameworks = [ Cocoa CoreMedia ];
+  knownVulnerabilities = [
+    "CVE-2021-30123"
+  ];
+} // args)
diff --git a/nixpkgs/pkgs/development/libraries/ffmpeg/4.nix b/nixpkgs/pkgs/development/libraries/ffmpeg/4.nix
new file mode 100644
index 000000000000..d557c87ebdf6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ffmpeg/4.nix
@@ -0,0 +1,29 @@
+{ callPackage
+# Darwin frameworks
+, Cocoa, CoreMedia, VideoToolbox
+, stdenv, lib
+, fetchpatch
+, ...
+}@args:
+
+callPackage ./generic.nix (rec {
+  version = "4.4";
+  branch = "4.4";
+  sha256 = "03kxc29y8190k4y8s8qdpsghlbpmchv1m8iqygq2qn0vfm4ka2a2";
+  darwinFrameworks = [ Cocoa CoreMedia VideoToolbox ];
+
+  patches = [
+    # Fix incorrect segment length in HLS child playlist with fmp4 segment format
+    # FIXME remove in version 4.5
+    # https://trac.ffmpeg.org/ticket/9193
+    # https://trac.ffmpeg.org/ticket/9205
+    (fetchpatch {
+      name = "ffmpeg_fix_incorrect_segment_length_in_hls.patch";
+      url = "https://git.videolan.org/?p=ffmpeg.git;a=commitdiff_plain;h=59032494e81a1a65c0b960aaae7ec4c2cc9db35a";
+      sha256 = "03zz1lw51kkc3g3vh47xa5hfiz3g3g1rbrll3kcnslvwylmrqmy3";
+    })
+  ] ++ lib.optionals stdenv.isDarwin [
+    # Work around https://trac.ffmpeg.org/ticket/9242
+    ./v2-0001-avcodec-videotoolboxenc-define-TARGET_CPU_ARM64-t.patch
+  ];
+} // args)
diff --git a/nixpkgs/pkgs/development/libraries/ffmpeg/generic.nix b/nixpkgs/pkgs/development/libraries/ffmpeg/generic.nix
new file mode 100644
index 000000000000..d52abd4ab09f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ffmpeg/generic.nix
@@ -0,0 +1,230 @@
+{ lib, stdenv, buildPackages, fetchurl, pkg-config, addOpenGLRunpath, perl, texinfo, yasm
+, alsa-lib, bzip2, fontconfig, freetype, gnutls, libiconv, lame, libass, libogg
+, libssh, libtheora, libva, libdrm, libvorbis, libvpx, xz, libpulseaudio, soxr
+, x264, x265, xvidcore, zlib, libopus, speex, nv-codec-headers, dav1d
+, 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
+, sdlSupport ? !stdenv.isAarch32, SDL ? null, SDL2 ? null
+, vdpauSupport ? !stdenv.isAarch32, libvdpau ? null
+# Developer options
+, debugDeveloper ? false
+, optimizationsDeveloper ? true
+, extraWarningsDeveloper ? false
+# Darwin frameworks
+, Cocoa, darwinFrameworks ? [ Cocoa ]
+# Inherit generics
+, branch, sha256, version, patches ? [], knownVulnerabilities ? [], ...
+}:
+
+/* Maintainer notes:
+ *
+ * THIS IS A MINIMAL BUILD OF FFMPEG, do not include dependencies unless
+ * a build that depends on ffmpeg requires them to be compiled into ffmpeg,
+ * see `ffmpeg-full' for an ffmpeg build with all features included.
+ *
+ * Need fixes to support Darwin:
+ *   pulseaudio
+ *
+ * Known issues:
+ * 0.6     - fails to compile (unresolved) (so far, only disabling a number of
+ *           features works, but that is not a feasible solution)
+ * 0.6.90  - mmx: compile errors (fix: disable for 0.6.90-rc0)
+ * 1.1     - libsoxr: compile error (fix: disable for 1.1)
+ *           Support was initially added in 1.1 before soxr api change, fix
+ *           would probably be to add soxr-1.0
+ * ALL     - Cross-compiling will disable features not present on host OS
+ *           (e.g. dxva2 support [DirectX] will not be enabled unless natively
+ *           compiled on Cygwin)
+ *
+ */
+
+let
+  inherit (stdenv) isDarwin isFreeBSD isLinux isAarch32;
+  inherit (lib) optional optionals optionalString enableFeature filter;
+
+  cmpVer = builtins.compareVersions;
+  reqMin = requiredVersion: (cmpVer requiredVersion branch != 1);
+  reqMatch = requiredVersion: (cmpVer requiredVersion branch == 0);
+
+  ifMinVer = minVer: flag: if reqMin minVer then flag else null;
+
+  # Version specific fix
+  verFix = withoutFix: fixVer: withFix: if reqMatch fixVer then withFix else withoutFix;
+
+  # Disable dependency that needs fixes before it will work on Darwin or Arm
+  disDarwinOrArmFix = origArg: minVer: fixArg: if ((isDarwin || isAarch32) && reqMin minVer) then fixArg else origArg;
+
+  vaapiSupport = reqMin "0.6" && ((isLinux || isFreeBSD) && !isAarch32);
+
+  vpxSupport = reqMin "0.6" && !isAarch32;
+in
+
+assert openglSupport -> libGL != null && libGLU != null;
+assert libmfxSupport -> intel-media-sdk != null;
+assert libaomSupport -> libaom != null;
+
+stdenv.mkDerivation rec {
+
+  pname = "ffmpeg";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://www.ffmpeg.org/releases/${pname}-${version}.tar.bz2";
+    inherit sha256;
+  };
+
+  postPatch = "patchShebangs .";
+  inherit patches;
+
+  outputs = [ "bin" "dev" "out" "man" ]
+    ++ optional (reqMin "1.0") "doc" ; # just dev-doc
+  setOutputFlags = false; # doesn't accept all and stores configureFlags in libs!
+
+  configurePlatforms = [];
+  configureFlags = filter (v: v != null) ([
+      "--arch=${stdenv.hostPlatform.parsed.cpu.name}"
+      "--target_os=${stdenv.hostPlatform.parsed.kernel.name}"
+    # License
+      "--enable-gpl"
+      "--enable-version3"
+    # Build flags
+      "--enable-shared"
+      (ifMinVer "0.6" "--enable-pic")
+      (enableFeature runtimeCpuDetectBuild "runtime-cpudetect")
+      "--enable-hardcoded-tables"
+    ] ++
+      (if multithreadBuild then (
+         if stdenv.isCygwin then
+           ["--disable-pthreads" "--enable-w32threads"]
+         else # Use POSIX threads by default
+           ["--enable-pthreads" "--disable-w32threads"])
+       else
+         ["--disable-pthreads" "--disable-w32threads"])
+    ++ [
+      (ifMinVer "0.9" "--disable-os2threads") # We don't support OS/2
+      "--enable-network"
+      (ifMinVer "2.4" "--enable-pixelutils")
+    # Executables
+      "--enable-ffmpeg"
+      "--disable-ffplay"
+      (ifMinVer "0.6" "--enable-ffprobe")
+      (if reqMin "4" then null else "--disable-ffserver")
+    # Libraries
+      (ifMinVer "0.6" "--enable-avcodec")
+      (ifMinVer "0.6" "--enable-avdevice")
+      "--enable-avfilter"
+      (ifMinVer "0.6" "--enable-avformat")
+      (ifMinVer "1.0" "--enable-avresample")
+      (ifMinVer "1.1" "--enable-avutil")
+      "--enable-postproc"
+      (ifMinVer "0.9" "--enable-swresample")
+      "--enable-swscale"
+    # Docs
+      (ifMinVer "0.6" "--disable-doc")
+    # External Libraries
+      "--enable-libass"
+      "--enable-bzlib"
+      "--enable-gnutls"
+      (ifMinVer "1.0" "--enable-fontconfig")
+      (ifMinVer "0.7" "--enable-libfreetype")
+      "--enable-libmp3lame"
+      (ifMinVer "1.2" "--enable-iconv")
+      "--enable-libtheora"
+      (ifMinVer "2.1" "--enable-libssh")
+      (ifMinVer "0.6" (enableFeature vaapiSupport "vaapi"))
+      (ifMinVer "3.4" (enableFeature vaapiSupport "libdrm"))
+      (enableFeature vdpauSupport "vdpau")
+      "--enable-libvorbis"
+      (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")
+      "--enable-libx264"
+      "--enable-libxvid"
+      "--enable-zlib"
+      (ifMinVer "2.8" "--enable-libopus")
+      "--enable-libspeex"
+      (ifMinVer "2.8" "--enable-libx265")
+      (ifMinVer "4.2" (enableFeature (dav1d != null) "libdav1d"))
+    # Developer flags
+      (enableFeature debugDeveloper "debug")
+      (enableFeature optimizationsDeveloper "optimizations")
+      (enableFeature extraWarningsDeveloper "extra-warnings")
+      "--disable-stripping"
+    # Disable mmx support for 0.6.90
+      (verFix null "0.6.90" "--disable-mmx")
+  ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+      "--cross-prefix=${stdenv.cc.targetPrefix}"
+      "--enable-cross-compile"
+  ] ++ optional stdenv.cc.isClang "--cc=clang");
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ addOpenGLRunpath perl pkg-config texinfo yasm ];
+
+  buildInputs = [
+    bzip2 fontconfig freetype gnutls libiconv lame libass libogg libssh libtheora
+    libvorbis xz soxr x264 x265 xvidcore zlib libopus speex nv-codec-headers
+  ] ++ optionals openglSupport [ libGL libGLU ]
+    ++ optional libmfxSupport intel-media-sdk
+    ++ optional libaomSupport libaom
+    ++ optional vpxSupport libvpx
+    ++ optionals (!isDarwin && !isAarch32) [ libpulseaudio ] # Need to be fixed on Darwin and ARM
+    ++ optional ((isLinux || isFreeBSD) && !isAarch32) libva
+    ++ optional ((isLinux || isFreeBSD) && !isAarch32) libdrm
+    ++ optional isLinux alsa-lib
+    ++ optionals isDarwin darwinFrameworks
+    ++ optional vdpauSupport libvdpau
+    ++ optional sdlSupport (if reqMin "3.2" then SDL2 else SDL)
+    ++ optional (reqMin "4.2") dav1d;
+
+  enableParallelBuilding = true;
+
+  doCheck = false; # fails
+
+  # ffmpeg 3+ generates pkg-config (.pc) files that don't have the
+  # form automatically handled by the multiple-outputs hooks.
+  postFixup = ''
+    moveToOutput bin "$bin"
+    moveToOutput share/ffmpeg/examples "$doc"
+    for pc in ''${!outputDev}/lib/pkgconfig/*.pc; do
+      substituteInPlace $pc \
+        --replace "includedir=$out" "includedir=''${!outputInclude}"
+    done
+  '' + optionalString stdenv.isLinux ''
+    # Set RUNPATH so that libnvcuvid and libcuda in /run/opengl-driver(-32)/lib can be found.
+    # See the explanation in addOpenGLRunpath.
+    addOpenGLRunpath $out/lib/libavcodec.so
+    addOpenGLRunpath $out/lib/libavutil.so
+  '';
+
+  installFlags = [ "install-man" ];
+
+  passthru = {
+    inherit vaapiSupport vdpauSupport;
+  };
+
+  meta = with lib; {
+    description = "A complete, cross-platform solution to record, convert and stream audio and video";
+    homepage = "https://www.ffmpeg.org/";
+    changelog = "https://github.com/FFmpeg/FFmpeg/blob/n${version}/Changelog";
+    longDescription = ''
+      FFmpeg is the leading multimedia framework, able to decode, encode, transcode,
+      mux, demux, stream, filter and play pretty much anything that humans and machines
+      have created. It supports the most obscure ancient formats up to the cutting edge.
+      No matter if they were designed by some standards committee, the community or
+      a corporation.
+    '';
+    license = licenses.gpl3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ codyopel ];
+    inherit branch knownVulnerabilities;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ffmpeg/v2-0001-avcodec-videotoolboxenc-define-TARGET_CPU_ARM64-t.patch b/nixpkgs/pkgs/development/libraries/ffmpeg/v2-0001-avcodec-videotoolboxenc-define-TARGET_CPU_ARM64-t.patch
new file mode 100644
index 000000000000..c0c2c1fb23bb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ffmpeg/v2-0001-avcodec-videotoolboxenc-define-TARGET_CPU_ARM64-t.patch
@@ -0,0 +1,35 @@
+From 5b562aaddbc6e7a94a079c2e88230b205a7f4d73 Mon Sep 17 00:00:00 2001
+From: Zane van Iperen <zane@zanevaniperen.com>
+Date: Sat, 15 May 2021 19:33:52 +1000
+Subject: [PATCH v2] avcodec/videotoolboxenc: #define TARGET_CPU_ARM64 to 0 if
+ not provided by the SDK
+
+Fixes build failure on older SDKs without it.
+
+Fixes #9242
+
+Signed-off-by: Zane van Iperen <zane@zanevaniperen.com>
+---
+ libavcodec/videotoolboxenc.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+NB: This is untested, I do not have a Mac to try it on.
+
+diff --git a/libavcodec/videotoolboxenc.c b/libavcodec/videotoolboxenc.c
+index 58239e0ab9..f063a86e73 100644
+--- a/libavcodec/videotoolboxenc.c
++++ b/libavcodec/videotoolboxenc.c
+@@ -50,6 +50,10 @@ enum { kCVPixelFormatType_420YpCbCr10BiPlanarFullRange = 'xf20' };
+ enum { kCVPixelFormatType_420YpCbCr10BiPlanarVideoRange = 'x420' };
+ #endif
+ 
++#ifndef TARGET_CPU_ARM64
++#   define TARGET_CPU_ARM64 0
++#endif
++
+ typedef OSStatus (*getParameterSetAtIndex)(CMFormatDescriptionRef videoDesc,
+                                            size_t parameterSetIndex,
+                                            const uint8_t **parameterSetPointerOut,
+-- 
+2.29.3
+
diff --git a/nixpkgs/pkgs/development/libraries/ffmpegthumbnailer/default.nix b/nixpkgs/pkgs/development/libraries/ffmpegthumbnailer/default.nix
new file mode 100644
index 000000000000..dfdbf8eb2f80
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ffmpegthumbnailer/default.nix
@@ -0,0 +1,35 @@
+{ fetchFromGitHub, lib, stdenv, ffmpeg, cmake, libpng, pkg-config, libjpeg
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ffmpegthumbnailer";
+  version = "2.2.2";
+
+  src = fetchFromGitHub {
+    owner = "dirkvdb";
+    repo = "ffmpegthumbnailer";
+    rev = version;
+    sha256 = "1bakbr714j7yxdal1f5iq0gcl4cxggbbgj227ihdh5kvygqlwich";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ ffmpeg libpng libjpeg ];
+  cmakeFlags = [ "-DENABLE_THUMBNAILER=ON" ];
+
+  meta = with lib;  {
+    homepage = "https://github.com/dirkvdb/ffmpegthumbnailer";
+    description = "A lightweight video thumbnailer";
+    longDescription = "FFmpegthumbnailer is a lightweight video
+        thumbnailer that can be used by file managers to create thumbnails
+        for your video files. The thumbnailer uses ffmpeg o decode frames
+        from the video files, so supported videoformats depend on the
+        configuration flags of ffmpeg.
+        This thumbnailer was designed to be as fast and lightweight as possible.
+        The only dependencies are ffmpeg and libpng.
+    ";
+    platforms = platforms.linux;
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.jagajaga ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/ffms/default.nix b/nixpkgs/pkgs/development/libraries/ffms/default.nix
new file mode 100644
index 000000000000..283942df63f9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ffms/default.nix
@@ -0,0 +1,51 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, pkg-config
+, ffmpeg
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ffms";
+  version = "2.40";
+
+  src = fetchFromGitHub {
+    owner = "FFMS";
+    repo = "ffms2";
+    rev = version;
+    sha256 = "sha256-3bPxt911T0bGpAIS2RxBjo+VV84xW06eKcCj3ZAcmvw=";
+  };
+
+  NIX_CFLAGS_COMPILE = "-fPIC";
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+  ];
+
+  preAutoreconf = ''
+    mkdir src/config
+  '';
+
+  buildInputs = [
+    ffmpeg
+    zlib
+  ];
+
+  # ffms includes a built-in vapoursynth plugin, see:
+  # https://github.com/FFMS/ffms2#avisynth-and-vapoursynth-plugin
+  postInstall = ''
+    mkdir $out/lib/vapoursynth
+    ln -s $out/lib/libffms2.so $out/lib/vapoursynth/libffms2.so
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/FFMS/ffms2/";
+    description = "FFmpeg based source library for easy frame accurate access";
+    license = licenses.mit;
+    maintainers = with maintainers; [ tadeokondrak ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fftw/default.nix b/nixpkgs/pkgs/development/libraries/fftw/default.nix
new file mode 100644
index 000000000000..b2189b77bf76
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fftw/default.nix
@@ -0,0 +1,73 @@
+{ fetchurl
+, stdenv
+, lib
+, gfortran
+, perl
+, llvmPackages ? null
+, precision ? "double"
+, enableAvx ? stdenv.hostPlatform.avxSupport
+, enableAvx2 ? stdenv.hostPlatform.avx2Support
+, enableAvx512 ? stdenv.hostPlatform.avx512Support
+, enableFma ? stdenv.hostPlatform.fmaSupport
+}:
+
+with lib;
+
+assert stdenv.cc.isClang -> llvmPackages != null;
+assert elem precision [ "single" "double" "long-double" "quad-precision" ];
+
+let
+  version = "3.3.9";
+  withDoc = stdenv.cc.isGNU;
+in
+
+stdenv.mkDerivation {
+  name = "fftw-${precision}-${version}";
+
+  src = fetchurl {
+    urls = [
+      "http://fftw.org/fftw-${version}.tar.gz"
+      "ftp://ftp.fftw.org/pub/fftw/fftw-${version}.tar.gz"
+    ];
+    sha256 = "sha256-vyx85AsEroEa9xTetRJRDMLBe5q51t3PSf5Eh+6nrz0=";
+  };
+
+  outputs = [ "out" "dev" "man" ]
+    ++ optional withDoc "info"; # it's dev-doc only
+  outputBin = "dev"; # fftw-wisdom
+
+  nativeBuildInputs = [ gfortran ];
+
+  buildInputs = lib.optionals stdenv.cc.isClang [
+    # TODO: This may mismatch the LLVM version sin the stdenv, see #79818.
+    llvmPackages.openmp
+  ];
+
+  configureFlags =
+    [ "--enable-shared"
+      "--enable-threads"
+    ]
+    ++ optional (precision != "double") "--enable-${precision}"
+    # all x86_64 have sse2
+    # however, not all float sizes fit
+    ++ optional (stdenv.isx86_64 && (precision == "single" || precision == "double") )  "--enable-sse2"
+    ++ optional enableAvx "--enable-avx"
+    ++ optional enableAvx2 "--enable-avx2"
+    ++ optional enableAvx512 "--enable-avx512"
+    ++ optional enableFma "--enable-fma"
+    ++ [ "--enable-openmp" ]
+    # doc generation causes Fortran wrapper generation which hard-codes gcc
+    ++ optional (!withDoc) "--disable-doc";
+
+  enableParallelBuilding = true;
+
+  checkInputs = [ perl ];
+
+  meta = with lib; {
+    description = "Fastest Fourier Transform in the West library";
+    homepage = "http://www.fftw.org/";
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.spwhitt ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/filter-audio/default.nix b/nixpkgs/pkgs/development/libraries/filter-audio/default.nix
new file mode 100644
index 000000000000..a412f7070470
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/filter-audio/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "filter-audio";
+  version = "0.0.1";
+
+  src = fetchFromGitHub {
+    owner = "irungentoo";
+    repo ="filter_audio";
+    rev = "v${version}";
+    sha256 = "1dv4pram317c1w97cjsv9f6r8cdxhgri7ib0v364z08pk7r2avfn";
+  };
+
+  doCheck = false;
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = with lib; {
+    description = "Lightweight audio filtering library made from webrtc code";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/flann/default.nix b/nixpkgs/pkgs/development/libraries/flann/default.nix
new file mode 100644
index 000000000000..283c815b199b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/flann/default.nix
@@ -0,0 +1,71 @@
+{ lib
+, cmake
+, fetchFromGitHub
+, fetchpatch
+, lz4
+, pkg-config
+, python3
+, stdenv
+, unzip
+, enablePython ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "flann";
+  version = "1.9.1";
+
+  src = fetchFromGitHub {
+    owner = "flann-lib";
+    repo = "flann";
+    rev = version;
+    sha256 = "13lg9nazj5s9a41j61vbijy04v6839i67lqd925xmxsbybf36gjc";
+  };
+
+  patches = [
+    # Patch HDF5_INCLUDE_DIR -> HDF_INCLUDE_DIRS.
+    (fetchpatch {
+      url = "https://salsa.debian.org/science-team/flann/-/raw/debian/1.9.1+dfsg-9/debian/patches/0001-Updated-fix-cmake-hdf5.patch";
+      sha256 = "yM1ONU4mu6lctttM5YcSTg8F344TNUJXwjxXLqzr5Pk=";
+    })
+    # Patch no-source library workaround that breaks on CMake > 3.11.
+    (fetchpatch {
+      url = "https://salsa.debian.org/science-team/flann/-/raw/debian/1.9.1+dfsg-9/debian/patches/0001-src-cpp-fix-cmake-3.11-build.patch";
+      sha256 = "REsBnbe6vlrZ+iCcw43kR5wy2o6q10RM73xjW5kBsr4=";
+    })
+    # Avoid the bundled version of LZ4 and instead use the system one.
+    (fetchpatch {
+      url = "https://salsa.debian.org/science-team/flann/-/raw/debian/1.9.1+dfsg-9/debian/patches/0003-Use-system-version-of-liblz4.patch";
+      sha256 = "xi+GyFn9PEjLgbJeAIEmsbp7ut9G9KIBkVulyT3nfsg=";
+    })
+    # Fix LZ4 string separator issue, see: https://github.com/flann-lib/flann/pull/480
+    (fetchpatch {
+      url = "https://github.com/flann-lib/flann/commit/25eb56ec78472bd419a121c6905095a793cf8992.patch";
+      sha256 = "qt8h576Gn8uR7+T9u9bEBIRz6e6AoTKpa1JfdZVvW9s=";
+    })
+  ];
+
+  cmakeFlags = [
+    "-DBUILD_EXAMPLES:BOOL=OFF"
+    "-DBUILD_TESTS:BOOL=OFF"
+    "-DBUILD_MATLAB_BINDINGS:BOOL=OFF"
+    "-DBUILD_PYTHON_BINDINGS:BOOL=${if enablePython then "ON" else "OFF"}"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    unzip
+  ];
+
+  propagatedBuildInputs = [ lz4 ];
+
+  buildInputs = lib.optionals enablePython [ python3 ];
+
+  meta = {
+    homepage = "http://people.cs.ubc.ca/~mariusm/flann/";
+    license = lib.licenses.bsd3;
+    description = "Fast approximate nearest neighbor searches in high dimensional spaces";
+    maintainers = with lib.maintainers; [viric];
+    platforms = with lib.platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/flatbuffers/1.12.nix b/nixpkgs/pkgs/development/libraries/flatbuffers/1.12.nix
new file mode 100644
index 000000000000..1ad490d3a01b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/flatbuffers/1.12.nix
@@ -0,0 +1,26 @@
+{ callPackage, fetchpatch, lib, stdenv }:
+
+callPackage ./generic.nix {
+  version = "1.12.0";
+  sha256 = "0f7xd66vc1lzjbn7jzd5kyqrgxpsfxi4zc7iymhb5xrwyxipjl1g";
+
+  patches = [
+    (fetchpatch {
+      # Fixed a compilation error with GCC 10.0 to 11.0. June 1, 2020.
+      # Should be included in the next release after 1.12.0
+      url = "https://github.com/google/flatbuffers/commit/988164f6e1675bbea9c852e2d6001baf4d1fcf59.patch";
+      sha256 = "0d8c2bywqmkhdi0a41cry85wy4j58pl0vd6h5xpfqm3fr8w0mi9s";
+      excludes = [ "src/idl_gen_cpp.cpp" ];
+    })
+    (fetchpatch {
+      # Fixed a compilation error with GCC 10.0 to 11.0. July 6, 2020.
+      # Should be included in the next release after 1.12.0
+      url = "https://github.com/google/flatbuffers/pull/6020/commits/44c7a4cf439b0a298720b5a448bcc243a882b0c9.patch";
+      sha256 = "126xwkvnlc4ignjhxv9jygfd9j6kr1jx39hyk0ddpcmvzfqsccf4";
+    })
+  ];
+
+  preConfigure = lib.optionalString stdenv.buildPlatform.isDarwin ''
+    rm BUILD
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/flatbuffers/2.0.nix b/nixpkgs/pkgs/development/libraries/flatbuffers/2.0.nix
new file mode 100644
index 000000000000..2b907e77c499
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/flatbuffers/2.0.nix
@@ -0,0 +1,6 @@
+{ callPackage }:
+
+callPackage ./generic.nix {
+  version = "2.0.0";
+  sha256 = "1zbf6bdpps8369r1ql00irxrp58jnalycc8jcapb8iqg654vlfz8";
+}
diff --git a/nixpkgs/pkgs/development/libraries/flatbuffers/generic.nix b/nixpkgs/pkgs/development/libraries/flatbuffers/generic.nix
new file mode 100644
index 000000000000..1cdfb4b9c870
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/flatbuffers/generic.nix
@@ -0,0 +1,46 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, version
+, sha256
+, patches ? [ ]
+, preConfigure ? null
+}:
+
+stdenv.mkDerivation rec {
+  pname = "flatbuffers";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "flatbuffers";
+    rev = "v${version}";
+    inherit sha256;
+  };
+
+  inherit patches preConfigure;
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    "-DFLATBUFFERS_BUILD_TESTS=${if doCheck then "ON" else "OFF"}"
+  ];
+
+  doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
+  checkTarget = "test";
+
+  meta = with lib; {
+    description = "Memory Efficient Serialization Library";
+    longDescription = ''
+      FlatBuffers is an efficient cross platform serialization library for
+      games and other memory constrained apps. It allows you to directly
+      access serialized data without unpacking/parsing it first, while still
+      having great forwards/backwards compatibility.
+    '';
+    maintainers = [ maintainers.teh ];
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    homepage = "https://google.github.io/flatbuffers/";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/flatcc/default.nix b/nixpkgs/pkgs/development/libraries/flatcc/default.nix
new file mode 100644
index 000000000000..6b40814119c6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/flatcc/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "flatcc";
+  version = "0.6.0";
+
+  src = fetchFromGitHub {
+    owner = "dvidelabs";
+    repo = "flatcc";
+    rev = "v${version}";
+    sha256 = "0cy79swgdbaf3zmsaqa6gz3b0fad2yqawwcnsipnpl9d8hn1linm";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    "-DFLATCC_INSTALL=on"
+    "-DCMAKE_BUILD_TYPE=Release"
+  ];
+
+  meta = {
+    description = "FlatBuffers Compiler and Library in C for C ";
+    homepage = "https://github.com/dvidelabs/flatcc";
+    license = [ lib.licenses.asl20 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/flatpak/bubblewrap-paths.patch b/nixpkgs/pkgs/development/libraries/flatpak/bubblewrap-paths.patch
new file mode 100644
index 000000000000..407811736f83
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/flatpak/bubblewrap-paths.patch
@@ -0,0 +1,15 @@
+diff --git a/icon-validator/validate-icon.c b/icon-validator/validate-icon.c
+index 9e885070..d02eeb8c 100644
+--- a/icon-validator/validate-icon.c
++++ b/icon-validator/validate-icon.c
+@@ -156,8 +156,8 @@ rerun_in_sandbox (const char *arg_width,
+             "--unshare-ipc",
+             "--unshare-net",
+             "--unshare-pid",
+-            "--ro-bind", "/usr", "/usr",
+-            "--ro-bind", "/etc/ld.so.cache", "/etc/ld.so.cache",
++            "--ro-bind", "@storeDir@", "@storeDir@",
++            "--ro-bind", "/run/current-system", "/run/current-system",
+             "--ro-bind", validate_icon, validate_icon,
+             NULL);
+ 
diff --git a/nixpkgs/pkgs/development/libraries/flatpak/default.nix b/nixpkgs/pkgs/development/libraries/flatpak/default.nix
new file mode 100644
index 000000000000..97410fda0d31
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/flatpak/default.nix
@@ -0,0 +1,208 @@
+{ lib, stdenv
+, fetchurl
+, fetchpatch
+, autoreconfHook
+, docbook_xml_dtd_45
+, docbook-xsl-nons
+, which
+, libxml2
+, gobject-introspection
+, gtk-doc
+, intltool
+, libxslt
+, pkg-config
+, xmlto
+, appstream-glib
+, substituteAll
+, bison
+, xdg-dbus-proxy
+, p11-kit
+, bubblewrap
+, bzip2
+, dbus
+, glib
+, gpgme
+, json-glib
+, libarchive
+, libcap
+, libseccomp
+, coreutils
+, socat
+, gettext
+, hicolor-icon-theme
+, shared-mime-info
+, desktop-file-utils
+, gtk3
+, fuse
+, nixosTests
+, libsoup
+, xz
+, zstd
+, ostree
+, polkit
+, python3
+, systemd
+, xorg
+, valgrind
+, glib-networking
+, wrapGAppsNoGuiHook
+, dconf
+, gsettings-desktop-schemas
+, librsvg
+}:
+
+stdenv.mkDerivation rec {
+  pname = "flatpak";
+  version = "1.10.2";
+
+  # TODO: split out lib once we figure out what to do with triggerdir
+  outputs = [ "out" "dev" "man" "doc" "devdoc" "installedTests" ];
+
+  src = fetchurl {
+    url = "https://github.com/flatpak/flatpak/releases/download/${version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-2xUnOdBy+P8pnk6IjYljobRTjaexDguGUlvkOPLh3eQ=";
+  };
+
+  patches = [
+    # Hardcode paths used by tests and change test runtime generation to use files from Nix store.
+    # https://github.com/flatpak/flatpak/issues/1460
+    (substituteAll {
+      src = ./fix-test-paths.patch;
+      inherit coreutils gettext socat gtk3;
+      smi = shared-mime-info;
+      dfu = desktop-file-utils;
+      hicolorIconTheme = hicolor-icon-theme;
+    })
+
+    # Hardcode paths used by Flatpak itself.
+    (substituteAll {
+      src = ./fix-paths.patch;
+      p11kit = "${p11-kit.dev}/bin/p11-kit";
+    })
+
+    # Adapt paths exposed to sandbox for NixOS.
+    (substituteAll {
+      src = ./bubblewrap-paths.patch;
+      inherit (builtins) storeDir;
+    })
+
+    # Allow gtk-doc to find schemas using XML_CATALOG_FILES environment variable.
+    # Patch taken from gtk-doc expression.
+    ./respect-xml-catalog-files-var.patch
+
+    # Don’t hardcode flatpak binary path in launchers stored under user’s profile otherwise they will break after Flatpak update.
+    # https://github.com/NixOS/nixpkgs/issues/43581
+    ./use-flatpak-from-path.patch
+
+    # Hardcode flatpak binary path for flatpak-spawn.
+    # When calling the portal’s Spawn command with FLATPAK_SPAWN_FLAGS_CLEAR_ENV flag,
+    # it will clear environment, including PATH, making the flatpak run fail.
+    # https://github.com/flatpak/flatpak/pull/4174
+    (fetchpatch {
+      url = "https://github.com/flatpak/flatpak/commit/495449daf6d3c072519a36c9e4bc6cc1da4d31db.patch";
+      sha256 = "gOX/sGupAE7Yg3MVrMhFXzWHpFn+izVyjtkuPzIckuY=";
+    })
+
+    # Nix environment hacks should not leak into the apps.
+    # https://github.com/NixOS/nixpkgs/issues/53441
+    ./unset-env-vars.patch
+
+    # But we want the GDK_PIXBUF_MODULE_FILE from the wrapper affect the icon validator.
+    ./validate-icon-pixbuf.patch
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    libxml2
+    docbook_xml_dtd_45
+    docbook-xsl-nons
+    which
+    gobject-introspection
+    gtk-doc
+    intltool
+    libxslt
+    pkg-config
+    xmlto
+    appstream-glib
+    bison
+    wrapGAppsNoGuiHook
+  ];
+
+  buildInputs = [
+    bubblewrap
+    bzip2
+    dbus
+    dconf
+    gpgme
+    json-glib
+    libarchive
+    libcap
+    libseccomp
+    libsoup
+    xz
+    zstd
+    polkit
+    python3
+    systemd
+    xorg.libXau
+    fuse
+    gsettings-desktop-schemas
+    glib-networking
+    librsvg # for flatpak-validate-icon
+  ];
+
+  # Required by flatpak.pc
+  propagatedBuildInputs = [
+    glib
+    ostree
+  ];
+
+  checkInputs = [
+    valgrind
+  ];
+
+  # TODO: some issues with temporary files
+  doCheck = false;
+
+  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-gtk-doc"
+    "--enable-installed-tests"
+  ];
+
+  makeFlags = [
+    "installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/flatpak"
+    "installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/flatpak"
+  ];
+
+  postPatch = let
+    vsc-py = python3.withPackages (pp: [
+      pp.pyparsing
+    ]);
+  in ''
+    patchShebangs buildutil
+    patchShebangs tests
+    PATH=${lib.makeBinPath [vsc-py]}:$PATH patchShebangs --build variant-schema-compiler/variant-schema-compiler
+  '';
+
+  passthru = {
+    tests = {
+      installedTests = nixosTests.installed-tests.flatpak;
+    };
+  };
+
+  meta = with lib; {
+    description = "Linux application sandboxing and distribution framework";
+    homepage = "https://flatpak.org/";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/flatpak/fix-paths.patch b/nixpkgs/pkgs/development/libraries/flatpak/fix-paths.patch
new file mode 100644
index 000000000000..67f0d4eba71f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/flatpak/fix-paths.patch
@@ -0,0 +1,22 @@
+diff --git a/session-helper/flatpak-session-helper.c b/session-helper/flatpak-session-helper.c
+index 5dd7629e..ddc71a4c 100644
+--- a/session-helper/flatpak-session-helper.c
++++ b/session-helper/flatpak-session-helper.c
+@@ -693,7 +693,7 @@ start_p11_kit_server (const char *flatpak_dir)
+   g_auto(GStrv) stdout_lines = NULL;
+   int i;
+   char *p11_argv[] = {
+-    "p11-kit", "server",
++    "@p11kit@", "server",
+     /* We explicitly request --sh here, because we then fail on earlier versions that doesn't support
+      * this flag. This is good, because those earlier versions did not properly daemonize and caused
+      * the spawn_sync to hang forever, waiting for the pipe to close.
+@@ -836,7 +836,7 @@ main (int    argc,
+       exit (1);
+     }
+ 
+-  if (g_find_program_in_path ("p11-kit"))
++  if (TRUE)
+     start_p11_kit_server (flatpak_dir);
+   else
+     g_debug ("p11-kit not found");
diff --git a/nixpkgs/pkgs/development/libraries/flatpak/fix-test-paths.patch b/nixpkgs/pkgs/development/libraries/flatpak/fix-test-paths.patch
new file mode 100644
index 000000000000..dcba66681858
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/flatpak/fix-test-paths.patch
@@ -0,0 +1,205 @@
+diff --git a/app/flatpak-builtins-build-export.c b/app/flatpak-builtins-build-export.c
+index 43fd0563..4067bd36 100644
+--- a/app/flatpak-builtins-build-export.c
++++ b/app/flatpak-builtins-build-export.c
+@@ -458,7 +458,7 @@ validate_desktop_file (GFile      *desktop_file,
+   subprocess = g_subprocess_new (G_SUBPROCESS_FLAGS_STDOUT_PIPE |
+                                  G_SUBPROCESS_FLAGS_STDERR_PIPE |
+                                  G_SUBPROCESS_FLAGS_STDERR_MERGE,
+-                                 &local_error, "desktop-file-validate", path, NULL);
++                                 &local_error, "@dfu@/bin/desktop-file-validate", path, NULL);
+   if (!subprocess)
+     {
+       if (!g_error_matches (local_error, G_SPAWN_ERROR, G_SPAWN_ERROR_NOENT))
+diff --git a/tests/libtest.sh b/tests/libtest.sh
+index acb2095b..b361da16 100644
+--- a/tests/libtest.sh
++++ b/tests/libtest.sh
+@@ -431,7 +431,7 @@ if [ -z "${FLATPAK_BWRAP:-}" ]; then
+     # running installed-tests: assume we know what we're doing
+     _flatpak_bwrap_works=true
+ elif ! "$FLATPAK_BWRAP" --unshare-ipc --unshare-net --unshare-pid \
+-        --ro-bind / / /bin/true > bwrap-result 2>&1; then
++        --ro-bind / / @coreutils@/bin/true > bwrap-result 2>&1; then
+     _flatpak_bwrap_works=false
+ else
+     _flatpak_bwrap_works=true
+@@ -504,7 +504,7 @@ dbus-daemon --fork --config-file=session.conf --print-address=3 --print-pid=4 \
+ export DBUS_SESSION_BUS_ADDRESS="$(cat dbus-session-bus-address)"
+ DBUS_SESSION_BUS_PID="$(cat dbus-session-bus-pid)"
+ 
+-if ! /bin/kill -0 "$DBUS_SESSION_BUS_PID"; then
++if ! @coreutils@/bin/kill -0 "$DBUS_SESSION_BUS_PID"; then
+     assert_not_reached "Failed to start dbus-daemon"
+ fi
+ 
+@@ -519,7 +519,7 @@ commit_to_path () {
+ }
+ 
+ cleanup () {
+-    /bin/kill -9 $DBUS_SESSION_BUS_PID
++    @coreutils@/bin/kill -9 $DBUS_SESSION_BUS_PID
+     gpg-connect-agent --homedir "${FL_GPG_HOMEDIR}" killagent /bye || true
+     fusermount -u $XDG_RUNTIME_DIR/doc || :
+     kill $(jobs -p) &> /dev/null || true
+diff --git a/tests/make-test-app.sh b/tests/make-test-app.sh
+index 612f914f..4b890da2 100755
+--- a/tests/make-test-app.sh
++++ b/tests/make-test-app.sh
+@@ -151,13 +151,13 @@ msgid "Hello world"
+ msgstr "Hallo Welt"
+ EOF
+ mkdir -p ${DIR}/files/de/share/de/LC_MESSAGES
+-msgfmt --output-file ${DIR}/files/de/share/de/LC_MESSAGES/helloworld.mo de.po
++@gettext@/bin/msgfmt --output-file ${DIR}/files/de/share/de/LC_MESSAGES/helloworld.mo de.po
+ cat > fr.po <<EOF
+ msgid "Hello world"
+ msgstr "Bonjour le monde"
+ EOF
+ mkdir -p ${DIR}/files/fr/share/fr/LC_MESSAGES
+-msgfmt --output-file ${DIR}/files/fr/share/fr/LC_MESSAGES/helloworld.mo fr.po
++@gettext@/bin/msgfmt --output-file ${DIR}/files/fr/share/fr/LC_MESSAGES/helloworld.mo fr.po
+ 
+ flatpak build-finish ${DIR}
+ mkdir -p repos
+diff --git a/tests/make-test-runtime.sh b/tests/make-test-runtime.sh
+index af289625..7db51c17 100755
+--- a/tests/make-test-runtime.sh
++++ b/tests/make-test-runtime.sh
+@@ -28,9 +28,10 @@ EOF
+ 
+ # On Debian derivatives, /usr/sbin and /sbin aren't in ordinary users'
+ # PATHs, but ldconfig is kept in /sbin
+-PATH="$PATH:/usr/sbin:/sbin"
++PATH="$PATH:@socat@/bin:/usr/sbin:/sbin"
+ 
+ # Add bash and dependencies
++mkdir -p ${DIR}/nix/store
+ mkdir -p ${DIR}/usr/bin
+ mkdir -p ${DIR}/usr/lib
+ ln -s ../lib ${DIR}/usr/lib64
+@@ -40,40 +41,17 @@ if test -f /sbin/ldconfig.real; then
+ else
+     cp `which ldconfig` ${DIR}/usr/bin
+ fi
+-LIBS=`mktemp`
+-BINS=`mktemp`
+-
+-add_bin() {
+-    local f=$1
+-    shift
+-
+-    if grep -qFe "${f}" $BINS; then
+-        # Already handled
+-        return 0
+-    fi
+-
+-    echo $f >> $BINS
+-
+-    # Add library dependencies
+-    (ldd "${f}" | sed "s/.* => //"  | awk '{ print $1}' | grep ^/ | sort -u -o $LIBS $LIBS -)  || true
+-
+-    local shebang=$(sed -n '1s/^#!\([^ ]*\).*/\1/p' "${f}")
+-    if [ x$shebang != x ]; then
+-        add_bin "$shebang"
+-    fi
+-}
+-
+ for i in $@ bash ls cat echo readlink socat; do
+-    I=`which $i`
+-    add_bin $I
+-done
+-for i in `cat $BINS`; do
+-    #echo Adding binary $i 1>&2
+-    cp "$i" ${DIR}/usr/bin/
+-done
+-for i in `cat $LIBS`; do
+-    #echo Adding library $i 1>&2
+-    cp "$i" ${DIR}/usr/lib/
++    I=$(readlink -f $(which $i))
++    [ -e ${DIR}/usr/bin/$i ] && continue
++    requisites=$(nix-store --query --requisites "$I")
++    for r in $requisites; do
++        # a single store item can be needed by multiple paths, no need to copy it again
++        if [ ! -e ${DIR}/$r ]; then
++            cp -r $r ${DIR}/$r
++        fi
++    done
++    ln -s $I ${DIR}/usr/bin/$i
+ done
+ ln -s bash ${DIR}/usr/bin/sh
+ 
+@@ -84,11 +62,13 @@ echo "Hello world, from a runtime$EXTRA"
+ EOF
+ chmod a+x ${DIR}/usr/bin/runtime_hello.sh
+ 
+-# We copy the C.UTF8 locale and call it en_US. Its a bit of a lie, but
+-# the real en_US locale is often not available, because its in the
+-# local archive.
+-mkdir -p ${DIR}/usr/lib/locale/
+-cp -r /usr/lib/locale/C.* ${DIR}/usr/lib/locale/en_US
++# We do not copy C.UTF8 locale because it is in locale archive and
++# that is already copied with glibc.
++
++mv ${DIR}/nix/store ${DIR}/usr/store # files outside /usr are not permitted, we will have to replace /nix/store with /usr/store
++chmod -R u+w ${DIR} # nix store has read-only directories which would cause problems during clean-up, files need to be writable for sed
++find ${DIR} -type f -print0 | xargs -0 sed -i 's~/nix/store/~/usr/store/~g' # replace hardcoded paths
++find ${DIR} -type l | xargs -I '{}' sh -c 'tg="$(readlink "$1")"; newtg="${tg#/nix/store/}"; if [ "$tg" != "$newtg" ]; then ln -fs "/usr/store/$newtg" "$1"; fi' -- '{}' # replace symlink targets
+ 
+ if [ x$COLLECTION_ID != x ]; then
+     collection_args=--collection-id=${COLLECTION_ID}
+diff --git a/tests/testlibrary.c b/tests/testlibrary.c
+index 509ce6cc..6a333c9c 100644
+--- a/tests/testlibrary.c
++++ b/tests/testlibrary.c
+@@ -1399,7 +1399,7 @@ check_bwrap_support (void)
+     {
+       gint exit_code = 0;
+       char *argv[] = { (char *) bwrap, "--unshare-ipc", "--unshare-net",
+-                       "--unshare-pid", "--ro-bind", "/", "/", "/bin/true", NULL };
++                       "--unshare-pid", "--ro-bind", "/", "/", "@coreutils@/bin/true", NULL };
+       g_autofree char *argv_str = g_strjoinv (" ", argv);
+       g_test_message ("Spawning %s", argv_str);
+       g_spawn_sync (NULL, argv, NULL, G_SPAWN_SEARCH_PATH, NULL, NULL, NULL, NULL, &exit_code, &error);
+diff --git a/triggers/desktop-database.trigger b/triggers/desktop-database.trigger
+index 2188f535..d8283061 100755
+--- a/triggers/desktop-database.trigger
++++ b/triggers/desktop-database.trigger
+@@ -1,5 +1,5 @@
+ #!/bin/sh
+ 
+-if test \( -x "$(which update-desktop-database 2>/dev/null)" \) -a \( -d $1/exports/share/applications \); then
+-    exec update-desktop-database -q $1/exports/share/applications
++if test \( -d $1/exports/share/applications \); then
++    exec @dfu@/bin/update-desktop-database -q $1/exports/share/applications
+ fi
+diff --git a/triggers/gtk-icon-cache.trigger b/triggers/gtk-icon-cache.trigger
+index 711cfab2..07baa2ac 100755
+--- a/triggers/gtk-icon-cache.trigger
++++ b/triggers/gtk-icon-cache.trigger
+@@ -1,10 +1,10 @@
+ #!/bin/sh
+ 
+-if test \( -x "$(which gtk-update-icon-cache 2>/dev/null)" \) -a \( -d $1/exports/share/icons/hicolor \); then
+-    cp /usr/share/icons/hicolor/index.theme $1/exports/share/icons/hicolor/
++if test \( -d $1/exports/share/icons/hicolor \); then
++    cp @hicolorIconTheme@/share/icons/hicolor/index.theme $1/exports/share/icons/hicolor/
+     for dir in $1/exports/share/icons/*; do
+         if test -f $dir/index.theme; then
+-            if ! gtk-update-icon-cache --quiet $dir; then
++            if ! @gtk3@/bin/gtk-update-icon-cache --quiet $dir; then
+                 echo "Failed to run gtk-update-icon-cache for $dir"
+                 exit 1
+             fi
+diff --git a/triggers/mime-database.trigger b/triggers/mime-database.trigger
+index 2067d8ec..a49a8777 100755
+--- a/triggers/mime-database.trigger
++++ b/triggers/mime-database.trigger
+@@ -1,5 +1,5 @@
+ #!/bin/sh
+ 
+-if test \( -x "$(which update-mime-database 2>/dev/null)" \) -a \( -d $1/exports/share/mime/packages \); then
+-    exec update-mime-database $1/exports/share/mime
++if test \( -d $1/exports/share/mime/packages \); then
++    exec @smi@/bin/update-mime-database $1/exports/share/mime
+ fi
diff --git a/nixpkgs/pkgs/development/libraries/flatpak/respect-xml-catalog-files-var.patch b/nixpkgs/pkgs/development/libraries/flatpak/respect-xml-catalog-files-var.patch
new file mode 100644
index 000000000000..4cee60be2d07
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/flatpak/respect-xml-catalog-files-var.patch
@@ -0,0 +1,15 @@
+diff --git a/acinclude.m4 b/acinclude.m4
+index 92ec3985..b3fccf1d 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -40,8 +40,8 @@ AC_DEFUN([JH_CHECK_XML_CATALOG],
+ [
+   AC_REQUIRE([JH_PATH_XML_CATALOG],[JH_PATH_XML_CATALOG(,[:])])dnl
+   AC_MSG_CHECKING([for ifelse([$2],,[$1],[$2]) in XML catalog])
+-  if $jh_found_xmlcatalog && \
+-     AC_RUN_LOG([$XMLCATALOG --noout "$XML_CATALOG_FILE" "$1" >&2]); then
++  # empty argument forces libxml to use XML_CATALOG_FILES variable
++  if AC_RUN_LOG([$XMLCATALOG --noout "" "$1" >&2]); then
+     AC_MSG_RESULT([found])
+     ifelse([$3],,,[$3
+ ])dnl
diff --git a/nixpkgs/pkgs/development/libraries/flatpak/unset-env-vars.patch b/nixpkgs/pkgs/development/libraries/flatpak/unset-env-vars.patch
new file mode 100644
index 000000000000..63ce0d12fe07
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/flatpak/unset-env-vars.patch
@@ -0,0 +1,12 @@
+diff --git a/common/flatpak-run.c b/common/flatpak-run.c
+index 8d52d3a5..81700183 100644
+--- a/common/flatpak-run.c
++++ b/common/flatpak-run.c
+@@ -1232,6 +1232,7 @@ static const ExportData default_exports[] = {
+   {"PERLLIB", NULL},
+   {"PERL5LIB", NULL},
+   {"XCURSOR_PATH", NULL},
++  {"GDK_PIXBUF_MODULE_FILE", NULL},
+ };
+ 
+ static const ExportData no_ld_so_cache_exports[] = {
diff --git a/nixpkgs/pkgs/development/libraries/flatpak/use-flatpak-from-path.patch b/nixpkgs/pkgs/development/libraries/flatpak/use-flatpak-from-path.patch
new file mode 100644
index 000000000000..84534b7bc53a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/flatpak/use-flatpak-from-path.patch
@@ -0,0 +1,50 @@
+diff --git a/common/flatpak-dir.c b/common/flatpak-dir.c
+index 52b222ea..9489441f 100644
+--- a/common/flatpak-dir.c
++++ b/common/flatpak-dir.c
+@@ -6956,7 +6956,7 @@ export_desktop_file (const char         *app,
+ 
+       new_exec = g_string_new ("");
+       g_string_append_printf (new_exec,
+-                              FLATPAK_BINDIR "/flatpak run --branch=%s --arch=%s",
++                              "flatpak run --branch=%s --arch=%s",
+                               escaped_branch,
+                               escaped_arch);
+ 
+@@ -8290,8 +8290,8 @@ flatpak_dir_deploy (FlatpakDir          *self,
+                                        error))
+         return FALSE;
+ 
+-      bin_data = g_strdup_printf ("#!/bin/sh\nexec %s/flatpak run --branch=%s --arch=%s %s \"$@\"\n",
+-                                  FLATPAK_BINDIR, escaped_branch, escaped_arch, escaped_app);
++      bin_data = g_strdup_printf ("#!/bin/sh\nexec flatpak run --branch=%s --arch=%s %s \"$@\"\n",
++                                  escaped_branch, escaped_arch, escaped_app);
+       if (!g_file_replace_contents (wrapper, bin_data, strlen (bin_data), NULL, FALSE,
+                                     G_FILE_CREATE_REPLACE_DESTINATION, NULL, cancellable, error))
+         return FALSE;
+diff --git a/tests/test-bundle.sh b/tests/test-bundle.sh
+index d1682344..5e2b9a97 100755
+--- a/tests/test-bundle.sh
++++ b/tests/test-bundle.sh
+@@ -67,7 +67,7 @@ assert_has_dir $FL_DIR/app/org.test.Hello/$ARCH/master/active/files
+ assert_has_dir $FL_DIR/app/org.test.Hello/$ARCH/master/active/export
+ assert_has_file $FL_DIR/exports/share/applications/org.test.Hello.desktop
+ # Ensure Exec key is rewritten
+-assert_file_has_content $FL_DIR/exports/share/applications/org.test.Hello.desktop "^Exec=.*/flatpak run --branch=master --arch=$ARCH --command=hello\.sh org\.test\.Hello$"
++assert_file_has_content $FL_DIR/exports/share/applications/org.test.Hello.desktop "^Exec=flatpak run --branch=master --arch=$ARCH --command=hello\.sh org\.test\.Hello$"
+ assert_has_file $FL_DIR/exports/share/icons/hicolor/64x64/apps/org.test.Hello.png
+ assert_has_file $FL_DIR/exports/share/icons/HighContrast/64x64/apps/org.test.Hello.png
+ 
+diff --git a/tests/test-run.sh b/tests/test-run.sh
+index fecb756e..64043281 100644
+--- a/tests/test-run.sh
++++ b/tests/test-run.sh
+@@ -45,7 +45,7 @@ assert_has_dir $FL_DIR/app/org.test.Hello/$ARCH/stable/active/files
+ assert_has_dir $FL_DIR/app/org.test.Hello/$ARCH/stable/active/export
+ assert_has_file $FL_DIR/exports/share/applications/org.test.Hello.desktop
+ # Ensure Exec key is rewritten
+-assert_file_has_content $FL_DIR/exports/share/applications/org.test.Hello.desktop "^Exec=.*/flatpak run --branch=stable --arch=$ARCH --command=hello\.sh org\.test\.Hello$"
++assert_file_has_content $FL_DIR/exports/share/applications/org.test.Hello.desktop "^Exec=flatpak run --branch=stable --arch=$ARCH --command=hello\.sh org\.test\.Hello$"
+ assert_has_file $FL_DIR/exports/share/gnome-shell/search-providers/org.test.Hello.search-provider.ini
+ assert_file_has_content $FL_DIR/exports/share/gnome-shell/search-providers/org.test.Hello.search-provider.ini "^DefaultDisabled=true$"
+ assert_has_file $FL_DIR/exports/share/icons/hicolor/64x64/apps/org.test.Hello.png
diff --git a/nixpkgs/pkgs/development/libraries/flatpak/validate-icon-pixbuf.patch b/nixpkgs/pkgs/development/libraries/flatpak/validate-icon-pixbuf.patch
new file mode 100644
index 000000000000..086114e11c30
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/flatpak/validate-icon-pixbuf.patch
@@ -0,0 +1,13 @@
+diff --git a/icon-validator/validate-icon.c b/icon-validator/validate-icon.c
+index 9e885070..44fea035 100644
+--- a/icon-validator/validate-icon.c
++++ b/icon-validator/validate-icon.c
+@@ -200,6 +200,8 @@ rerun_in_sandbox (const char *arg_width,
+     add_args (args, "--setenv", "G_MESSAGES_DEBUG", g_getenv ("G_MESSAGES_DEBUG"), NULL);
+   if (g_getenv ("G_MESSAGES_PREFIXED"))
+     add_args (args, "--setenv", "G_MESSAGES_PREFIXED", g_getenv ("G_MESSAGES_PREFIXED"), NULL);
++  if (g_getenv ("GDK_PIXBUF_MODULE_FILE"))
++    add_args (args, "--setenv", "GDK_PIXBUF_MODULE_FILE", g_getenv ("GDK_PIXBUF_MODULE_FILE"), NULL);
+ 
+   add_args (args, validate_icon, arg_width, arg_height, filename, NULL);
+   g_ptr_array_add (args, NULL);
diff --git a/nixpkgs/pkgs/development/libraries/flint/default.nix b/nixpkgs/pkgs/development/libraries/flint/default.nix
new file mode 100644
index 000000000000..548f561f25a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/flint/default.nix
@@ -0,0 +1,56 @@
+{ lib
+, stdenv
+, fetchurl
+, gmp
+, mpir
+, mpfr
+, ntl
+, openblas ? null, blas, lapack
+, withBlas ? true
+}:
+
+assert withBlas -> openblas != null && blas.implementation == "openblas" && lapack.implementation == "openblas";
+
+stdenv.mkDerivation rec {
+  pname = "flint";
+  version = "2.8.0";
+
+  src = fetchurl {
+    url = "https://www.flintlib.org/flint-${version}.tar.gz";
+    sha256 = "sha256-WEI1zcOdd52ZIOrvFv4ITzwm/+7qADo//2SiCg8zRJ4=";
+  };
+
+  buildInputs = [
+    gmp
+    mpir
+    mpfr
+    ntl
+  ] ++ lib.optionals withBlas [
+    openblas
+  ];
+
+  propagatedBuildInputs = [
+    mpfr # flint.h includes mpfr.h
+  ];
+
+  configureFlags = [
+    "--with-gmp=${gmp}"
+    "--with-mpir=${mpir}"
+    "--with-mpfr=${mpfr}"
+    "--with-ntl=${ntl}"
+  ] ++ lib.optionals withBlas [
+    "--with-blas=${openblas}"
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Fast Library for Number Theory";
+    license = licenses.gpl2Plus;
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+    homepage = "https://www.flintlib.org/";
+    downloadPage = "https://www.flintlib.org/downloads.html";
+    updateWalker = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/flite/default.nix b/nixpkgs/pkgs/development/libraries/flite/default.nix
new file mode 100644
index 000000000000..cd8eb538462b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/flite/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, alsa-lib, fetchpatch }:
+
+stdenv.mkDerivation rec {
+  pname = "flite";
+  version = "2.2";
+
+  src = fetchFromGitHub {
+    owner = "festvox";
+    repo = "flite";
+    rev = "v${version}";
+    sha256 = "1n0p81jzndzc1rzgm66kw9ls189ricy5v1ps11y0p2fk1p56kbjf";
+  };
+
+  buildInputs = lib.optionals stdenv.isLinux [ alsa-lib ];
+
+  # https://github.com/festvox/flite/pull/60.
+  # Replaces `ar` with `$(AR)` in config/common_make_rules.
+  # Improves cross-compilation compatibility.
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/festvox/flite/commit/54c65164840777326bbb83517568e38a128122ef.patch";
+      sha256 = "sha256-hvKzdX7adiqd9D+9DbnfNdqEULg1Hhqe1xElYxNM1B8=";
+    })
+  ];
+
+  configureFlags = [
+    "--enable-shared"
+  ] ++ lib.optionals stdenv.isLinux [ "--with-audio=alsa" ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A small, fast run-time speech synthesis engine";
+    homepage = "http://www.festvox.org/flite/";
+    license = licenses.bsdOriginal;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fltk/1.4.nix b/nixpkgs/pkgs/development/libraries/fltk/1.4.nix
new file mode 100644
index 000000000000..2a430844ebe7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fltk/1.4.nix
@@ -0,0 +1,5 @@
+import ./common.nix rec {
+  version = "1.4.x-2021-07-04";
+  rev = "1008cdfab27609a6f6a0e82dadad9fd9cbd8a66d";
+  sha256 = "1h057dyhd04b9bjci952b2l7brxv183l9jw9i50mn9qjfljmvqim";
+}
diff --git a/nixpkgs/pkgs/development/libraries/fltk/common.nix b/nixpkgs/pkgs/development/libraries/fltk/common.nix
new file mode 100644
index 000000000000..06e1c05c7d07
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fltk/common.nix
@@ -0,0 +1,205 @@
+{ version, rev, sha256 }:
+
+{ stdenv
+, lib
+, fetchFromGitHub
+, cmake
+, pkg-config
+, zlib
+, libjpeg
+, libpng
+, fontconfig
+, freetype
+, libX11
+, libXext
+, libXinerama
+, libXfixes
+, libXcursor
+, libXft
+, libXrender
+, ApplicationServices
+, Carbon
+, Cocoa
+
+, withGL ? true
+, libGL
+, libGLU
+, glew
+, OpenGL
+
+, withCairo ? true
+, cairo
+
+, withPango ? (lib.strings.versionAtLeast version "1.4" && stdenv.hostPlatform.isLinux)
+, pango
+
+, withDocs ? true
+, doxygen
+, graphviz
+, texlive
+
+, withExamples ? true
+, withShared ? true
+}:
+
+let
+  onOff = value: if value then "ON" else "OFF";
+  tex = texlive.combine {
+    inherit (texlive)
+      scheme-medium varwidth multirow hanging adjustbox collectbox stackengine
+      sectsty tocloft newunicodechar etoc;
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "fltk";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "fltk";
+    repo = "fltk";
+    inherit rev sha256;
+  };
+
+  outputs = [ "out" ]
+    ++ lib.optional withExamples "bin"
+    ++ lib.optional withDocs "doc";
+
+  # Manually move example & test binaries to $bin to avoid cyclic dependencies on dev binaries
+  outputBin = lib.optionalString withExamples "out";
+
+  patches = lib.optionals stdenv.hostPlatform.isDarwin [
+    ./nsosv.patch
+  ];
+
+  postPatch = ''
+    patchShebangs documentation/make_*
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ] ++ lib.optionals withDocs [
+    doxygen
+    graphviz
+    tex
+  ];
+
+  buildInputs = lib.optionals stdenv.hostPlatform.isDarwin [
+    ApplicationServices
+    Carbon
+  ] ++ lib.optionals (withGL && !stdenv.hostPlatform.isDarwin) [
+    libGL
+    libGLU
+  ] ++ lib.optionals (withExamples && withGL) [
+    glew
+  ];
+
+  propagatedBuildInputs = [
+    zlib
+    libjpeg
+    libpng
+  ] ++ lib.optionals stdenv.hostPlatform.isLinux [
+    freetype
+    fontconfig
+    libX11
+    libXext
+    libXinerama
+    libXfixes
+    libXcursor
+    libXft
+    libXrender
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
+    Cocoa
+  ] ++ lib.optionals (withGL && stdenv.hostPlatform.isDarwin) [
+    OpenGL
+  ] ++ lib.optionals withCairo [
+    cairo
+  ] ++ lib.optionals withPango [
+    pango
+  ];
+
+  cmakeFlags = [
+    # Common
+    "-DOPTION_BUILD_SHARED_LIBS=${onOff withShared}"
+    "-DOPTION_USE_SYSTEM_ZLIB=ON"
+    "-DOPTION_USE_SYSTEM_LIBJPEG=ON"
+    "-DOPTION_USE_SYSTEM_LIBPNG=ON"
+
+    # X11
+    "-DOPTION_USE_XINERAMA=${onOff stdenv.hostPlatform.isLinux}"
+    "-DOPTION_USE_XFIXES=${onOff stdenv.hostPlatform.isLinux}"
+    "-DOPTION_USE_XCURSOR=${onOff stdenv.hostPlatform.isLinux}"
+    "-DOPTION_USE_XFT=${onOff stdenv.hostPlatform.isLinux}"
+    "-DOPTION_USE_XRENDER=${onOff stdenv.hostPlatform.isLinux}"
+    "-DOPTION_USE_XDBE=${onOff stdenv.hostPlatform.isLinux}"
+
+    # GL
+    "-DOPTION_USE_GL=${onOff withGL}"
+    "-DOpenGL_GL_PREFERENCE=GLVND"
+
+    # Cairo
+    "-DOPTION_CAIRO=${onOff withCairo}"
+    "-DOPTION_CAIROEXT=${onOff withCairo}"
+
+    # Pango
+    "-DOPTION_USE_PANGO=${onOff withPango}"
+
+    # Examples & Tests
+    "-DFLTK_BUILD_EXAMPLES=${onOff withExamples}"
+
+    # Docs
+    "-DOPTION_BUILD_HTML_DOCUMENTATION=${onOff withDocs}"
+    "-DOPTION_BUILD_PDF_DOCUMENTATION=${onOff withDocs}"
+    "-DOPTION_INSTALL_HTML_DOCUMENTATION=${onOff withDocs}"
+    "-DOPTION_INSTALL_PDF_DOCUMENTATION=${onOff withDocs}"
+    "-DOPTION_INCLUDE_DRIVER_DOCUMENTATION=${onOff withDocs}"
+  ];
+
+  preBuild = lib.optionalString (withCairo && withShared && stdenv.hostPlatform.isDarwin) ''
+    # unresolved symbols in cairo dylib without this: https://github.com/fltk/fltk/issues/250
+    export NIX_LDFLAGS="$NIX_LDFLAGS -undefined dynamic_lookup"
+  '';
+
+  postBuild = lib.optionalString withDocs ''
+    make docs
+  '';
+
+  postInstall = lib.optionalString withExamples ''
+    mkdir -p $bin/bin
+    mv bin/{test,examples}/* $bin/bin/
+  '' + lib.optionalString stdenv.hostPlatform.isDarwin ''
+    mkdir -p $out/Library/Frameworks
+    mv $out{,/Library/Frameworks}/FLTK.framework
+
+    moveAppBundles() {
+      echo "Moving and symlinking $1"
+      appname="$(basename "$1")"
+      binname="$(basename "$(find "$1"/Contents/MacOS/ -type f -executable | head -n1)")"
+      curpath="$(dirname "$1")"
+
+      mkdir -p "$curpath"/../Applications/
+      mv "$1" "$curpath"/../Applications/
+      [ -f "$curpath"/"$binname" ] && rm "$curpath"/"$binname"
+      ln -s ../Applications/"$appname"/Contents/MacOS/"$binname" "$curpath"/"$binname"
+    }
+
+    rm $out/bin/fluid.icns
+    for app in $out/bin/*.app ${lib.optionalString withExamples "$bin/bin/*.app"}; do
+      moveAppBundles "$app"
+    done
+  '';
+
+  postFixup = ''
+    substituteInPlace $out/bin/fltk-config \
+      --replace "/$out/" "/"
+  '';
+
+  meta = with lib; {
+    description = "A C++ cross-platform lightweight GUI library";
+    homepage = "https://www.fltk.org";
+    platforms = platforms.unix;
+    # LGPL2 with static linking exception
+    # https://www.fltk.org/COPYING.php
+    license = licenses.lgpl2Only;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fltk/default.nix b/nixpkgs/pkgs/development/libraries/fltk/default.nix
new file mode 100644
index 000000000000..831a96f71f3e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fltk/default.nix
@@ -0,0 +1,5 @@
+import ./common.nix rec {
+  version = "1.3.6";
+  rev = "release-${version}";
+  sha256 = "0vzk4d6j927v7dxywr5xlqlf70myal1xikkdfvd11p94rcdf9bsv";
+}
diff --git a/nixpkgs/pkgs/development/libraries/fltk/nsosv.patch b/nixpkgs/pkgs/development/libraries/fltk/nsosv.patch
new file mode 100644
index 000000000000..9e55b011b571
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fltk/nsosv.patch
@@ -0,0 +1,20 @@
+diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
+index 6f5b8b1..2c7763d 100644
+--- a/src/Fl_cocoa.mm
++++ b/src/Fl_cocoa.mm
+@@ -4074,15 +4074,6 @@ Window fl_xid(const Fl_Window* w)
+ static int calc_mac_os_version() {
+   int M, m, b = 0;
+   NSAutoreleasePool *localPool = [[NSAutoreleasePool alloc] init];
+-#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_10
+-  if ([NSProcessInfo instancesRespondToSelector:@selector(operatingSystemVersion)]) {
+-    NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
+-    M = version.majorVersion;
+-    m = version.minorVersion;
+-    b = version.patchVersion;
+-  }
+-  else
+-#endif
+   {
+     NSDictionary * sv = [NSDictionary dictionaryWithContentsOfFile:@"/System/Library/CoreServices/SystemVersion.plist"];
+     const char *s = [[sv objectForKey:@"ProductVersion"] UTF8String];
diff --git a/nixpkgs/pkgs/development/libraries/fmt/default.nix b/nixpkgs/pkgs/development/libraries/fmt/default.nix
new file mode 100644
index 000000000000..3fee016175bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fmt/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake
+, enableShared ? !stdenv.hostPlatform.isStatic
+}:
+
+let
+  generic = { version, sha256, patches ? [ ] }:
+    stdenv.mkDerivation {
+      pname = "fmt";
+      inherit version;
+
+      outputs = [ "out" "dev" ];
+
+      src = fetchFromGitHub {
+        owner = "fmtlib";
+        repo = "fmt";
+        rev = version;
+        inherit sha256;
+      };
+
+      inherit patches;
+
+      nativeBuildInputs = [ cmake ];
+
+      cmakeFlags = [
+        "-DBUILD_SHARED_LIBS=${if enableShared then "ON" else "OFF"}"
+        "-DCMAKE_SKIP_BUILD_RPATH=OFF" # for tests
+      ];
+
+      doCheck = true;
+
+      meta = with lib; {
+        description = "Small, safe and fast formatting library";
+        longDescription = ''
+          fmt (formerly cppformat) is an open-source formatting library. It can be
+          used as a fast and safe alternative to printf and IOStreams.
+        '';
+        homepage = "http://fmtlib.net/";
+        downloadPage = "https://github.com/fmtlib/fmt/";
+        maintainers = [ maintainers.jdehaas ];
+        license = licenses.mit;
+        platforms = platforms.all;
+      };
+    };
+in
+{
+  fmt_7 = generic {
+    version = "7.1.3";
+    sha256 = "08hyv73qp2ndbs0isk8pspsphdzz5qh8czl3wgyxy3mmif9xdg29";
+  };
+
+  fmt_8 = generic {
+    version = "8.0.1";
+    sha256 = "1mnvxqsan034d2jiqnw2yvkljl7lwvhakmj5bscwp1fpkn655bbw";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/folks/default.nix b/nixpkgs/pkgs/development/libraries/folks/default.nix
new file mode 100644
index 000000000000..720c274ad520
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/folks/default.nix
@@ -0,0 +1,129 @@
+{ fetchurl
+, lib, stdenv
+, pkg-config
+, meson
+, ninja
+, glib
+, gnome
+, nspr
+, gettext
+, gobject-introspection
+, vala
+, sqlite
+, libxml2
+, dbus-glib
+, libsoup
+, nss
+, dbus
+, libgee
+, evolution-data-server
+, libgdata
+, libsecret
+, db
+, python3
+, readline
+, gtk3
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+, telepathy-glib
+, telepathySupport ? false
+}:
+
+# TODO: enable more folks backends
+
+stdenv.mkDerivation rec {
+  pname = "folks";
+  version = "0.15.3";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "Idc3+vCT9L4GVHPucMogiFuaLDaFlB26JMIjn9PFRKU=";
+  };
+
+  nativeBuildInputs = [
+    gettext
+    gobject-introspection
+    gtk3
+    gtk-doc
+    docbook-xsl-nons
+    docbook_xml_dtd_43
+    meson
+    ninja
+    pkg-config
+    python3
+    vala
+  ];
+
+  buildInputs = [
+    db
+    dbus-glib
+    evolution-data-server
+    libgdata # required for some backends transitively
+    libsecret
+    libsoup
+    libxml2
+    nspr
+    nss
+    readline
+  ] ++ lib.optional telepathySupport telepathy-glib;
+
+  propagatedBuildInputs = [
+    glib
+    libgee
+    sqlite
+  ];
+
+  checkInputs = [
+    dbus
+    (python3.withPackages (pp: with pp; [
+      python-dbusmock
+      # The following possibly need to be propagated by dbusmock
+      # if they are not optional
+      dbus-python
+      pygobject3
+    ]))
+  ];
+
+  mesonFlags = [
+    "-Ddocs=true"
+    "-Dtelepathy_backend=${lib.boolToString telepathySupport}"
+    # For some reason, the tests are getting stuck on 31/32,
+    # even though the one missing test finishes just fine on next run,
+    # when tests are permuted differently. And another test that
+    # previously passed will be stuck instead.
+    "-Dtests=false"
+  ];
+
+  doCheck = false;
+
+  # Prevents e-d-s add-contacts-stress-test from timing out
+  checkPhase = ''
+    runHook preCheck
+    meson test --timeout-multiplier 4
+    runHook postCheck
+  '';
+
+  postPatch = ''
+    chmod +x meson_post_install.py
+    patchShebangs meson_post_install.py
+    patchShebangs tests/tools/manager-file.py
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    description = "A library that aggregates people from multiple sources to create metacontacts";
+    homepage = "https://wiki.gnome.org/Projects/Folks";
+    license = licenses.lgpl2Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.gnu ++ platforms.linux; # arbitrary choice
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/folly/default.nix b/nixpkgs/pkgs/development/libraries/folly/default.nix
new file mode 100644
index 000000000000..91551d076dcf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/folly/default.nix
@@ -0,0 +1,65 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, boost
+, libevent
+, double-conversion
+, glog
+, gflags
+, libiberty
+, lz4
+, xz
+, zlib
+, jemalloc
+, openssl
+, pkg-config
+, libunwind
+, fmt
+}:
+
+stdenv.mkDerivation (rec {
+  pname = "folly";
+  version = "2021.08.23.00";
+
+  src = fetchFromGitHub {
+    owner = "facebook";
+    repo = "folly";
+    rev = "v${version}";
+    sha256 = "sha256-B+J4h12jjusA15+QRR3egmUEwYRrnegtEWMuQX+QuJk=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  # See CMake/folly-deps.cmake in the Folly source tree.
+  buildInputs = [
+    boost
+    double-conversion
+    glog
+    gflags
+    libevent
+    libiberty
+    openssl
+    lz4
+    xz
+    zlib
+    jemalloc
+    libunwind
+    fmt
+  ];
+
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
+
+  meta = with lib; {
+    description = "An open-source C++ library developed and used at Facebook";
+    homepage = "https://github.com/facebook/folly";
+    license = licenses.asl20;
+    # 32bit is not supported: https://github.com/facebook/folly/issues/103
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+    maintainers = with maintainers; [ abbradar pierreis ];
+  };
+} // lib.optionalAttrs stdenv.isDarwin {
+  LDFLAGS = "-ljemalloc";
+})
diff --git a/nixpkgs/pkgs/development/libraries/fontconfig/default.nix b/nixpkgs/pkgs/development/libraries/fontconfig/default.nix
new file mode 100644
index 000000000000..22875e51842a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fontconfig/default.nix
@@ -0,0 +1,87 @@
+{ lib, stdenv
+, substituteAll
+, fetchurl
+, pkg-config
+, python3
+, freetype
+, expat
+, libxslt
+, gperf
+, dejavu_fonts
+, autoreconfHook
+, CoreFoundation
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fontconfig";
+  version = "2.13.94";
+
+  src = fetchurl {
+    url = "https://www.freedesktop.org/software/fontconfig/release/${pname}-${version}.tar.xz";
+    sha256 = "0g004r0bkkqz00mpm3svnnxn7d83158q0yb9ggxryizxfg5m5w55";
+  };
+
+  outputs = [ "bin" "dev" "lib" "out" ]; # $out contains all the config
+
+  nativeBuildInputs = [
+    autoreconfHook
+    gperf
+    libxslt
+    pkg-config
+    python3
+  ];
+
+  buildInputs = [
+    expat
+  ] ++ lib.optional stdenv.isDarwin CoreFoundation;
+
+  propagatedBuildInputs = [
+    freetype
+  ];
+
+  postPatch = ''
+    # Requires networking.
+    sed -i '/check_PROGRAMS += test-crbug1004254/d' test/Makefile.am
+  '';
+
+  configureFlags = [
+    "--sysconfdir=/etc"
+    "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
+    "--with-cache-dir=/var/cache/fontconfig" # otherwise the fallback is in $out/
+    # just <1MB; this is what you get when loading config fails for some reason
+    "--with-default-fonts=${dejavu_fonts.minimal}"
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
+  ];
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  installFlags = [
+    # Don't try to write to /var/cache/fontconfig at install time.
+    "fc_cachedir=$(TMPDIR)/dummy"
+    "RUN_FC_CACHE_TEST=false"
+    "sysconfdir=${placeholder "out"}/etc"
+  ];
+
+  postInstall = ''
+    cd "$out/etc/fonts"
+    xsltproc --stringparam fontDirectories "${dejavu_fonts.minimal}" \
+      --path $out/share/xml/fontconfig \
+      ${./make-fonts-conf.xsl} $out/etc/fonts/fonts.conf \
+      > fonts.conf.tmp
+    mv fonts.conf.tmp $out/etc/fonts/fonts.conf
+    # We don't keep section 3 of the manpages, as they are quite large and
+    # probably not so useful.
+    rm -r $bin/share/man/man3
+  '';
+
+  meta = with lib; {
+    description = "A library for font customization and configuration";
+    homepage = "http://fontconfig.org/";
+    license = licenses.bsd2; # custom but very bsd-like
+    platforms = platforms.all;
+    maintainers = with maintainers; teams.freedesktop.members ++ [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fontconfig/make-fonts-cache.nix b/nixpkgs/pkgs/development/libraries/fontconfig/make-fonts-cache.nix
new file mode 100644
index 000000000000..47884b9c3b92
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fontconfig/make-fonts-cache.nix
@@ -0,0 +1,33 @@
+{ runCommand, lib, fontconfig, fontDirectories }:
+
+runCommand "fc-cache"
+  {
+    nativeBuildInputs = [ fontconfig.bin ];
+    preferLocalBuild = true;
+    allowSubstitutes = false;
+    passAsFile = [ "fontDirs" ];
+    fontDirs = ''
+      <!-- Font directories -->
+      ${lib.concatStringsSep "\n" (map (font: "<dir>${font}</dir>") fontDirectories)}
+    '';
+  }
+  ''
+    export FONTCONFIG_FILE=$(pwd)/fonts.conf
+
+    cat > fonts.conf << EOF
+    <?xml version='1.0'?>
+    <!DOCTYPE fontconfig SYSTEM 'urn:fontconfig:fonts.dtd'>
+    <fontconfig>
+      <include>${fontconfig.out}/etc/fonts/fonts.conf</include>
+      <cachedir>$out</cachedir>
+    EOF
+    cat "$fontDirsPath" >> fonts.conf
+    echo "</fontconfig>" >> fonts.conf
+
+    mkdir -p $out
+    fc-cache -sv
+
+    # This is not a cache dir in the normal sense -- it won't be automatically
+    # recreated.
+    rm -f "$out/CACHEDIR.TAG"
+  ''
diff --git a/nixpkgs/pkgs/development/libraries/fontconfig/make-fonts-conf.nix b/nixpkgs/pkgs/development/libraries/fontconfig/make-fonts-conf.nix
new file mode 100644
index 000000000000..493f662d0ce3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fontconfig/make-fonts-conf.nix
@@ -0,0 +1,15 @@
+{ runCommand, libxslt, fontconfig, dejavu_fonts, fontDirectories }:
+
+runCommand "fonts.conf"
+  {
+    nativeBuildInputs = [ libxslt ];
+    buildInputs = [ fontconfig ];
+    # Add a default font for non-nixos systems, <1MB and in nixos defaults.
+    fontDirectories = fontDirectories ++ [ dejavu_fonts.minimal ];
+  }
+  ''
+    xsltproc --stringparam fontDirectories "$fontDirectories" \
+      --path ${fontconfig.out}/share/xml/fontconfig \
+      ${./make-fonts-conf.xsl} ${fontconfig.out}/etc/fonts/fonts.conf \
+      > $out
+  ''
diff --git a/nixpkgs/pkgs/development/libraries/fontconfig/make-fonts-conf.xsl b/nixpkgs/pkgs/development/libraries/fontconfig/make-fonts-conf.xsl
new file mode 100644
index 000000000000..ed51b62a1d08
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fontconfig/make-fonts-conf.xsl
@@ -0,0 +1,62 @@
+<?xml version="1.0"?>
+
+<!--
+  This script copies the original fonts.conf from the fontconfig
+  distribution, but replaces all <dir> entries with the directories
+  specified in the $fontDirectories parameter.
+-->
+
+<xsl:stylesheet version="1.0"
+                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+                xmlns:str="http://exslt.org/strings"
+                extension-element-prefixes="str"
+                >
+
+  <xsl:output method='xml' encoding="UTF-8" doctype-system="urn:fontconfig:fonts.dtd" />
+
+  <xsl:param name="fontDirectories" />
+
+  <xsl:template match="/fontconfig">
+
+    <fontconfig>
+      <xsl:apply-templates select="child::node()[name() != 'dir' and name() != 'cachedir' and name() != 'include']" />
+
+      <!-- the first cachedir will be used to store the cache -->
+      <cachedir prefix="xdg">fontconfig</cachedir>
+      <!-- /var/cache/fontconfig is useful for non-nixos systems -->
+      <cachedir>/var/cache/fontconfig</cachedir>
+
+      <!-- system-wide config -->
+      <include ignore_missing="yes">/etc/fonts/conf.d</include>
+
+      <dir prefix="xdg">fonts</dir>
+      <xsl:for-each select="str:tokenize($fontDirectories)">
+        <dir><xsl:value-of select="." /></dir>
+        <xsl:text>&#0010;</xsl:text>
+      </xsl:for-each>
+
+      <!-- nix user profile -->
+      <dir>~/.nix-profile/lib/X11/fonts</dir>
+      <dir>~/.nix-profile/share/fonts</dir>
+
+      <!-- FHS paths for non-NixOS platforms -->
+      <dir>/usr/share/fonts</dir>
+      <dir>/usr/local/share/fonts</dir>
+
+      <!-- nix default profile -->
+      <dir>/nix/var/nix/profiles/default/lib/X11/fonts</dir>
+      <dir>/nix/var/nix/profiles/default/share/fonts</dir>
+
+    </fontconfig>
+
+  </xsl:template>
+
+
+  <!-- New fontconfig >=2.11 doesn't like xml:space added by xsl:copy-of -->
+  <xsl:template match="node()|@*">
+    <xsl:copy>
+      <xsl:apply-templates select="node()|@*[name() != 'xml:space']"/>
+    </xsl:copy>
+  </xsl:template>
+
+</xsl:stylesheet>
diff --git a/nixpkgs/pkgs/development/libraries/forge/default.nix b/nixpkgs/pkgs/development/libraries/forge/default.nix
new file mode 100644
index 000000000000..ba85cea73d69
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/forge/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
+, 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
+    pkg-config
+  ];
+
+  buildInputs = [
+    expat
+    fontconfig
+    freetype
+    boost.out
+    boost.dev
+    freeimage
+    mesa
+    libGLU libGL
+    glfw3
+    SDL2
+    cudatoolkit
+    arrayfire
+  ];
+
+  meta = with 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/clang.patch b/nixpkgs/pkgs/development/libraries/fox/clang.patch
new file mode 100644
index 000000000000..0ca2ebf0d8da
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fox/clang.patch
@@ -0,0 +1,13 @@
+diff --git a/src/FXReactor.cpp b/src/FXReactor.cpp
+index 1ecdb45..9058a30 100644
+--- a/src/FXReactor.cpp
++++ b/src/FXReactor.cpp
+@@ -452,7 +452,7 @@ FXint FXReactor::processActiveHandles(FXTime block,FXuint flags){
+     }
+ 
+   // Normal case
+-  if(0<=hand){
++  if(0==hand){
+ 
+     // Any handles active?
+     if(0<nhand){
diff --git a/nixpkgs/pkgs/development/libraries/fox/default.nix b/nixpkgs/pkgs/development/libraries/fox/default.nix
new file mode 100644
index 000000000000..408518ba79ce
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fox/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, xlibsWrapper, libpng, libjpeg, libtiff, zlib, bzip2, libXcursor, libXrandr, libXft
+, CoreServices ? null }:
+
+stdenv.mkDerivation rec {
+  pname = "fox";
+  version = "1.7.9";
+
+  src = fetchurl {
+    url = "ftp://ftp.fox-toolkit.org/pub/${pname}-${version}.tar.gz";
+    sha256 = "1jb9368xsin3ppdf6979n5s7in3s9klbxqbwcp0z8misjixl7nzg";
+  };
+
+  patches = [ ./clang.patch ];
+
+  buildInputs = [ libpng xlibsWrapper libjpeg libtiff zlib bzip2 libXcursor libXrandr libXft ]
+    ++ lib.optional stdenv.isDarwin CoreServices;
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  hardeningDisable = [ "format" ];
+
+  meta = with lib; {
+    description = "C++ based class library for building Graphical User Interfaces";
+    longDescription = ''
+      FOX stands for Free Objects for X.
+      It is a C++ based class library for building Graphical User Interfaces.
+      Initially, it was developed for LINUX, but the scope of this project has in the course of time become somewhat more ambitious.
+      Current aims are to make FOX completely platform independent, and thus programs written against the FOX library will be only a compile away from running on a variety of platforms.
+    '';
+    homepage = "http://fox-toolkit.org";
+    license = licenses.lgpl3;
+    maintainers = [];
+    broken = stdenv.isDarwin;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fox/fox-1.6.nix b/nixpkgs/pkgs/development/libraries/fox/fox-1.6.nix
new file mode 100644
index 000000000000..028ab6a75302
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fox/fox-1.6.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchurl, xlibsWrapper, libpng, libjpeg, libtiff, zlib, bzip2, libXcursor
+, libXrandr, libGLU, libGL, libXft, libXfixes, xinput
+, CoreServices }:
+
+stdenv.mkDerivation rec {
+  pname = "fox";
+  version = "1.6.57";
+
+  src = fetchurl {
+    url = "ftp://ftp.fox-toolkit.org/pub/${pname}-${version}.tar.gz";
+    sha256 = "08w98m6wjadraw1pi13igzagly4b2nfa57kdqdnkjfhgkvg1bvv5";
+  };
+
+  buildInputs = [
+    xlibsWrapper libpng libjpeg libtiff zlib bzip2 libXcursor libXrandr
+    libXft libGLU libGL libXfixes xinput
+  ] ++ lib.optional stdenv.isDarwin CoreServices;
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  hardeningDisable = [ "format" ];
+
+  meta = {
+    branch = "1.6";
+    description = "A C++ based class library for building Graphical User Interfaces";
+    longDescription = ''
+        FOX stands for Free Objects for X.
+        It is a C++ based class library for building Graphical User Interfaces.
+        Initially, it was developed for LINUX, but the scope of this project has in the course of time become somewhat more ambitious.
+        Current aims are to make FOX completely platform independent, and thus programs written against the FOX library will be only a compile away from running on a variety of platforms.
+      '';
+    homepage = "http://fox-toolkit.org";
+    license = lib.licenses.lgpl3;
+    maintainers = [];
+    platforms = lib.platforms.mesaPlatforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fplll/20160331.nix b/nixpkgs/pkgs/development/libraries/fplll/20160331.nix
new file mode 100644
index 000000000000..6bb9570d998a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fplll/20160331.nix
@@ -0,0 +1,21 @@
+{lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, gettext, autoreconfHook
+, gmp, mpfr
+}:
+stdenv.mkDerivation rec {
+  pname = "fplll";
+  version = "20160331";
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "11dea26c2f9396ffb7a7191aa371343f1f74c5c3";
+    sha256 = "1clxch9hbr30w6s84m2mprxv58adhg5qw6sa2p3jr1cy4r7r59ib";
+  };
+  nativeBuildInputs = [autoconf automake libtool gettext autoreconfHook];
+  buildInputs = [gmp mpfr];
+  meta = {
+    description = "Lattice algorithms using floating-point arithmetic";
+    license = lib.licenses.lgpl21Plus;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fplll/default.nix b/nixpkgs/pkgs/development/libraries/fplll/default.nix
new file mode 100644
index 000000000000..3a82b566a50f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fplll/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv
+, fetchFromGitHub
+, fetchpatch
+, gettext
+, autoreconfHook
+, gmp
+, mpfr
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fplll";
+  version = "5.3.2";
+
+  src = fetchFromGitHub {
+    owner = "fplll";
+    repo = "fplll";
+    rev = version;
+    sha256 = "00iyz218ywspizjiimrjdcqvdqmrsb2367zyy3vkmypnf9i9l680";
+  };
+
+  nativeBuildInputs = [
+    gettext
+    autoreconfHook
+  ];
+
+  buildInputs = [
+    gmp
+    mpfr
+  ];
+
+  meta = with lib; {
+    description = "Lattice algorithms using floating-point arithmetic";
+    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 = teams.sage.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/frame/default.nix b/nixpkgs/pkgs/development/libraries/frame/default.nix
new file mode 100644
index 000000000000..e96aa9394da9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/frame/default.nix
@@ -0,0 +1,24 @@
+{ enableX11 ? true
+,  lib, stdenv, fetchurl, pkg-config, xorg }:
+
+stdenv.mkDerivation rec {
+  pname = "frame";
+  version = "2.5.0";
+  src = fetchurl {
+    url = "https://launchpad.net/frame/trunk/v${version}/+download/${pname}-${version}.tar.xz";
+    sha256 = "bc2a20cd3ac1e61fe0461bd3ee8cb250dbcc1fa511fad0686d267744e9c78f3a";
+  };
+
+  buildInputs = [
+    stdenv pkg-config
+  ] ++ lib.optionals enableX11 [xorg.xorgserver xorg.libX11 xorg.libXext xorg.libXi];
+
+  configureFlags = lib.optional enableX11 "--with-x11";
+
+  meta = {
+    homepage = "https://launchpad.net/frame";
+    description = "Handles the buildup and synchronization of a set of simultaneous touches";
+    license = lib.licenses.gpl3;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/freealut/default.nix b/nixpkgs/pkgs/development/libraries/freealut/default.nix
new file mode 100644
index 000000000000..3bb6eaddfa36
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/freealut/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, darwin, fetchurl, openal }:
+
+stdenv.mkDerivation rec {
+  name = "freealut-1.1.0";
+
+  src = fetchurl {
+    url = "http://www.openal.org/openal_webstf/downloads/${name}.tar.gz";
+    sha256 = "0kzlil6112x2429nw6mycmif8y6bxr2cwjcvp18vh6s7g63ymlb0";
+  };
+
+  buildInputs = [ openal
+  ] ++ lib.optional stdenv.isDarwin
+    darwin.apple_sdk.frameworks.OpenAL
+  ;
+
+  meta = {
+    homepage = "http://openal.org/";
+    description = "Free implementation of OpenAL's ALUT standard";
+    license = lib.licenses.lgpl2;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/freeglut/default.nix b/nixpkgs/pkgs/development/libraries/freeglut/default.nix
new file mode 100644
index 000000000000..ecdc1c19ff14
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/freeglut/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl, libXi, libXrandr, libXxf86vm, libGL, libGLU, xlibsWrapper, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "freeglut";
+  version = "3.2.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/freeglut/freeglut-${version}.tar.gz";
+    sha256 = "0s6sk49q8ijgbsrrryb7dzqx2fa744jhx1wck5cz5jia2010w06l";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libXi libXrandr libXxf86vm libGL libGLU xlibsWrapper ];
+
+  cmakeFlags = lib.optionals stdenv.isDarwin [
+                 "-DOPENGL_INCLUDE_DIR=${libGL}/include"
+                 "-DOPENGL_gl_LIBRARY:FILEPATH=${libGL}/lib/libGL.dylib"
+                 "-DOPENGL_glu_LIBRARY:FILEPATH=${libGLU}/lib/libGLU.dylib"
+                 "-DFREEGLUT_BUILD_DEMOS:BOOL=OFF"
+                 "-DFREEGLUT_BUILD_STATIC:BOOL=OFF"
+               ];
+
+  meta = with lib; {
+    description = "Create and manage windows containing OpenGL contexts";
+    longDescription = ''
+      FreeGLUT is an open source alternative to the OpenGL Utility Toolkit
+      (GLUT) library. GLUT (and hence FreeGLUT) allows the user to create and
+      manage windows containing OpenGL contexts on a wide range of platforms
+      and also read the mouse, keyboard and joystick functions. FreeGLUT is
+      intended to be a full replacement for GLUT, and has only a few
+      differences.
+    '';
+    homepage = "http://freeglut.sourceforge.net/";
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/freeimage/default.nix b/nixpkgs/pkgs/development/libraries/freeimage/default.nix
new file mode 100644
index 000000000000..236305a572bf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/freeimage/default.nix
@@ -0,0 +1,59 @@
+{ lib, stdenv, fetchsvn, darwin, libtiff
+, libpng, zlib, libwebp, libraw, openexr, openjpeg
+, libjpeg, jxrlib, pkg-config
+, fixDarwinDylibNames }:
+
+stdenv.mkDerivation {
+  pname = "freeimage";
+  version = "unstable-2020-07-04";
+
+  src = fetchsvn {
+    url = "svn://svn.code.sf.net/p/freeimage/svn/";
+    rev = "1859";
+    sha256 = "1d94935aqbkb994nqkw7m8xcynyz9rm6k7k59igrbjak8b63qpi6";
+  };
+  sourceRoot = "svn-r1859/FreeImage/trunk";
+
+  # Ensure that the bundled libraries are not used at all
+  prePatch = "rm -rf Source/Lib* Source/OpenEXR Source/ZLib";
+  patches = [ ./unbundle.diff ];
+
+  nativeBuildInputs = [
+    pkg-config
+  ] ++ lib.optionals stdenv.isDarwin [
+    darwin.cctools
+    fixDarwinDylibNames
+  ];
+  buildInputs = [ libtiff libtiff.dev_private libpng zlib libwebp libraw openexr openjpeg libjpeg libjpeg.dev_private jxrlib ];
+
+  postBuild = lib.optionalString (!stdenv.isDarwin) ''
+    make -f Makefile.fip
+  '';
+
+  INCDIR = "${placeholder "out"}/include";
+  INSTALLDIR = "${placeholder "out"}/lib";
+
+  preInstall = ''
+    mkdir -p $INCDIR $INSTALLDIR
+  ''
+  # Workaround for Makefiles.osx not using ?=
+  + lib.optionalString stdenv.isDarwin ''
+    makeFlagsArray+=( "INCDIR=$INCDIR" "INSTALLDIR=$INSTALLDIR" )
+  '';
+
+  postInstall = lib.optionalString (!stdenv.isDarwin) ''
+    make -f Makefile.fip install
+  '' + lib.optionalString stdenv.isDarwin ''
+    ln -s $out/lib/libfreeimage.3.dylib $out/lib/libfreeimage.dylib
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Open Source library for accessing popular graphics image file formats";
+    homepage = "http://freeimage.sourceforge.net/";
+    license = "GPL";
+    maintainers = with lib.maintainers; [viric l-as];
+    platforms = with lib.platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/freeimage/unbundle.diff b/nixpkgs/pkgs/development/libraries/freeimage/unbundle.diff
new file mode 100644
index 000000000000..22dac720155a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/freeimage/unbundle.diff
@@ -0,0 +1,584 @@
+diff --git a/Makefile.fip b/Makefile.fip
+index 660a026..86b3040 100644
+--- a/Makefile.fip
++++ b/Makefile.fip
+@@ -11,32 +11,21 @@ INSTALLDIR ?= $(DESTDIR)/usr/lib
+ # Converts cr/lf to just lf
+ DOS2UNIX = dos2unix
+ 
+-LIBRARIES = -lstdc++
++LIBRARIES = -lstdc++ $(shell pkg-config --libs OpenEXR libopenjp2 libraw libpng libtiff-4 libwebp libwebpmux zlib libjxr libjpeg)
+ 
+ MODULES = $(SRCS:.c=.o)
+ MODULES := $(MODULES:.cpp=.o)
+ 
++INCLUDE += $(shell pkg-config --cflags OpenEXR libopenjp2 libraw libpng libtiff-4 libwebp libwebpmux zlib libjxr libjpeg)
++
+ # C flags
+ CFLAGS ?= -std=c99 -O3 -fPIC -fexceptions -fvisibility=hidden
+-# OpenJPEG
+-CFLAGS += -DOPJ_STATIC
+-# LibRaw
+-CFLAGS += -DNO_LCMS
+-# LibJXR
+-CFLAGS += -DDISABLE_PERF_MEASUREMENT -D__ANSI__
+ CFLAGS += $(INCLUDE)
+ 
+ # C++ flags
+ CXXFLAGS ?= -std=c++0x -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy
+-# LibJXR
+-CXXFLAGS += -D__ANSI__
+ CXXFLAGS += $(INCLUDE)
+ 
+-ifeq ($(shell sh -c 'uname -m 2>/dev/null || echo not'),x86_64)
+-	CFLAGS += -fPIC
+-	CXXFLAGS += -fPIC
+-endif
+-
+ TARGET  = freeimageplus
+ STATICLIB = lib$(TARGET).a
+ SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).so
+@@ -76,10 +65,10 @@ $(SHAREDLIB): $(MODULES)
+ 
+ install:
+ 	install -d $(INCDIR) $(INSTALLDIR)
+-	install -m 644 -o root -g root $(HEADER) $(INCDIR)
+-	install -m 644 -o root -g root $(HEADERFIP) $(INCDIR)
+-	install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
+-	install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
++	install -m 644 $(HEADER) $(INCDIR)
++	install -m 644 $(HEADERFIP) $(INCDIR)
++	install -m 644 $(STATICLIB) $(INSTALLDIR)
++	install -m 755 $(SHAREDLIB) $(INSTALLDIR)
+ 	ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
+ 	ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)	
+ 
+diff --git a/Makefile.gnu b/Makefile.gnu
+index a4f2601..be95476 100644
+--- a/Makefile.gnu
++++ b/Makefile.gnu
+@@ -11,32 +11,21 @@ INSTALLDIR ?= $(DESTDIR)/usr/lib
+ # Converts cr/lf to just lf
+ DOS2UNIX = dos2unix
+ 
+-LIBRARIES = -lstdc++
++LIBRARIES = -lstdc++ $(shell pkg-config --libs OpenEXR libopenjp2 libraw libpng libtiff-4 libwebp libwebpmux zlib libjxr libjpeg)
+ 
+ MODULES = $(SRCS:.c=.o)
+ MODULES := $(MODULES:.cpp=.o)
+ 
++INCLUDE += $(shell pkg-config --cflags OpenEXR libopenjp2 libraw libpng libtiff-4 libwebp libwebpmux zlib libjxr libjpeg)
++
+ # C flags
+ CFLAGS ?= -std=c99 -O3 -fPIC -fexceptions -fvisibility=hidden
+-# OpenJPEG
+-CFLAGS += -DOPJ_STATIC
+-# LibRaw
+-CFLAGS += -DNO_LCMS
+-# LibJXR
+-CFLAGS += -DDISABLE_PERF_MEASUREMENT -D__ANSI__
+ CFLAGS += $(INCLUDE)
+ 
+ # C++ flags
+ CXXFLAGS ?= -std=c++0x -O3 -fPIC -fexceptions -fvisibility=hidden -Wno-ctor-dtor-privacy
+-# LibJXR
+-CXXFLAGS += -D__ANSI__
+ CXXFLAGS += $(INCLUDE)
+ 
+-ifeq ($(shell sh -c 'uname -m 2>/dev/null || echo not'),x86_64)
+-	CFLAGS += -fPIC
+-	CXXFLAGS += -fPIC
+-endif
+-
+ TARGET  = freeimage
+ STATICLIB = lib$(TARGET).a
+ SHAREDLIB = lib$(TARGET)-$(VER_MAJOR).$(VER_MINOR).so
+@@ -75,12 +64,11 @@ $(SHAREDLIB): $(MODULES)
+ 
+ install:
+ 	install -d $(INCDIR) $(INSTALLDIR)
+-	install -m 644 -o root -g root $(HEADER) $(INCDIR)
+-	install -m 644 -o root -g root $(STATICLIB) $(INSTALLDIR)
+-	install -m 755 -o root -g root $(SHAREDLIB) $(INSTALLDIR)
++	install -m 644 $(HEADER) $(INCDIR)
++	install -m 644 $(STATICLIB) $(INSTALLDIR)
++	install -m 755 $(SHAREDLIB) $(INSTALLDIR)
+ 	ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(VERLIBNAME)
+ 	ln -sf $(VERLIBNAME) $(INSTALLDIR)/$(LIBNAME)	
+-#	ldconfig
+ 
+ clean:
+ 	rm -f core Dist/*.* u2dtmp* $(MODULES) $(STATICLIB) $(SHAREDLIB) $(LIBNAME)
+diff --git a/Makefile.osx b/Makefile.osx
+index c39121d..3800e39 100644
+--- a/Makefile.osx
++++ b/Makefile.osx
+@@ -10,24 +10,25 @@ MACOSX_SYSROOT = $(shell xcrun --show-sdk-path)
+ MACOSX_DEPLOYMENT_TARGET = 10.11
+ 
+ # General configuration variables:
+-CC_I386 = $(shell xcrun -find clang)
+-CC_X86_64 = $(shell xcrun -find clang)
+-CPP_I386 = $(shell xcrun -find clang++)
+-CPP_X86_64 = $(shell xcrun -find clang++)
++CC_I386 = clang
++CC_X86_64 = clang
++CPP_I386 = clang++
++CPP_X86_64 = clang++
+ MACOSX_DEPLOY = -mmacosx-version-min=$(MACOSX_DEPLOYMENT_TARGET)
+ COMPILERFLAGS = -Os -fexceptions -fvisibility=hidden -DNO_LCMS -D__ANSI__
+ COMPILERFLAGS_I386 = -arch i386
+ COMPILERFLAGS_X86_64 = -arch x86_64
+ COMPILERPPFLAGS = -Wno-ctor-dtor-privacy -D__ANSI__ -std=c++11 -stdlib=libc++ -Wc++11-narrowing
+-INCLUDE +=
+-INCLUDE_I386 = -isysroot $(MACOSX_SYSROOT)
+-INCLUDE_X86_64 = -isysroot $(MACOSX_SYSROOT)
++INCLUDE += $(shell pkg-config --cflags OpenEXR libopenjp2 libraw libpng libtiff-4 libwebp libwebpmux zlib libjxr libjpeg)
++INCLUDE_I386 =
++INCLUDE_X86_64 =
+ CFLAGS_I386 = $(COMPILERFLAGS) $(COMPILERFLAGS_I386) $(INCLUDE) $(INCLUDE_I386) $(MACOSX_DEPLOY)
+ CFLAGS_X86_64 = $(COMPILERFLAGS) $(COMPILERFLAGS_X86_64) $(INCLUDE) $(INCLUDE_X86_64) $(MACOSX_DEPLOY)
+ CPPFLAGS_I386 = $(COMPILERPPFLAGS) $(CFLAGS_I386)
+ CPPFLAGS_X86_64 = $(COMPILERPPFLAGS) $(CFLAGS_X86_64)
+-LIBRARIES_I386 = $(MACOSX_DEPLOY) -Wl,-syslibroot $(MACOSX_SYSROOT)
+-LIBRARIES_X86_64 = $(MACOSX_DEPLOY) -Wl,-syslibroot $(MACOSX_SYSROOT)
++LIBS = $(shell pkg-config --libs OpenEXR libopenjp2 libraw libpng libtiff-4 libwebp libwebpmux zlib libjxr libjpeg)
++LIBRARIES_I386 = $(LIBS) $(MACOSX_DEPLOY)
++LIBRARIES_X86_64 = $(LIBS) $(MACOSX_DEPLOY)
+ LIBTOOL = libtool
+ LIPO = lipo
+ 
+@@ -57,7 +58,7 @@ dist: FreeImage
+ 	cp *.a Dist
+ 	cp Source/FreeImage.h Dist
+ 
+-FreeImage: $(STATICLIB)
++FreeImage: $(STATICLIB) $(SHAREDLIB)
+ 
+ $(STATICLIB): $(STATICLIB)-x86_64
+ 	cp -p $(STATICLIB)-x86_64 $(STATICLIB)
+@@ -84,13 +85,10 @@ $(STATICLIB)-i386: $(MODULES_I386)
+ $(STATICLIB)-x86_64: $(MODULES_X86_64)
+ 	$(LIBTOOL) -arch_only x86_64 -o $@ $(MODULES_X86_64)
+ 
+-$(SHAREDLIB): $(SHAREDLIB)-i386 $(SHAREDLIB)-x86_64
+-	$(LIPO) -create $(SHAREDLIB)-i386 $(SHAREDLIB)-x86_64 -output $(SHAREDLIB)
+-
+ $(SHAREDLIB)-i386: $(MODULES_I386)
+ 	$(CPP_I386) -arch i386 -dynamiclib $(LIBRARIES_I386) -o $@ $(MODULES_I386)
+ 
+-$(SHAREDLIB)-x86_64: $(MODULES_X86_64)
++$(SHAREDLIB): $(MODULES_X86_64)
+ 	$(CPP_X86_64) -arch x86_64 -dynamiclib $(LIBRARIES_X86_64) -o $@ $(MODULES_X86_64)
+ 
+ .c.o-i386:
+@@ -106,9 +104,8 @@ $(SHAREDLIB)-x86_64: $(MODULES_X86_64)
+ 	$(CPP_X86_64) $(CPPFLAGS_X86_64) -c $< -o $@
+ 
+ install:
+-	install -d -m 755 -o root -g wheel $(INCDIR) $(INSTALLDIR)
+-	install -m 644 -o root -g wheel $(HEADER) $(INCDIR)
+-	install -m 644 -o root -g wheel $(SHAREDLIB) $(STATICLIB) $(INSTALLDIR)
++	install $(HEADER) $(INCDIR)
++	install $(SHAREDLIB) $(STATICLIB) $(INSTALLDIR)
+ 	ranlib -sf $(INSTALLDIR)/$(STATICLIB)
+ 	ln -sf $(SHAREDLIB) $(INSTALLDIR)/$(LIBNAME)
+ 
+diff --git a/Makefile.srcs b/Makefile.srcs
+index 0b8d3a0..b706fd0 100644
+--- a/Makefile.srcs
++++ b/Makefile.srcs
+@@ -1,6 +1,6 @@
+ VER_MAJOR = 3
+ VER_MINOR = 19.0
+-SRCS = ./Source/FreeImage/BitmapAccess.cpp ./Source/FreeImage/ColorLookup.cpp ./Source/FreeImage/ConversionRGBA16.cpp ./Source/FreeImage/ConversionRGBAF.cpp ./Source/FreeImage/FreeImage.cpp ./Source/FreeImage/FreeImageC.c ./Source/FreeImage/FreeImageIO.cpp ./Source/FreeImage/GetType.cpp ./Source/FreeImage/LFPQuantizer.cpp ./Source/FreeImage/MemoryIO.cpp ./Source/FreeImage/PixelAccess.cpp ./Source/FreeImage/J2KHelper.cpp ./Source/FreeImage/MNGHelper.cpp ./Source/FreeImage/Plugin.cpp ./Source/FreeImage/PluginBMP.cpp ./Source/FreeImage/PluginCUT.cpp ./Source/FreeImage/PluginDDS.cpp ./Source/FreeImage/PluginEXR.cpp ./Source/FreeImage/PluginG3.cpp ./Source/FreeImage/PluginGIF.cpp ./Source/FreeImage/PluginHDR.cpp ./Source/FreeImage/PluginICO.cpp ./Source/FreeImage/PluginIFF.cpp ./Source/FreeImage/PluginJ2K.cpp ./Source/FreeImage/PluginJNG.cpp ./Source/FreeImage/PluginJP2.cpp ./Source/FreeImage/PluginJPEG.cpp ./Source/FreeImage/PluginJXR.cpp ./Source/FreeImage/PluginKOALA.cpp ./Source/FreeImage/PluginMNG.cpp ./Source/FreeImage/PluginPCD.cpp ./Source/FreeImage/PluginPCX.cpp ./Source/FreeImage/PluginPFM.cpp ./Source/FreeImage/PluginPICT.cpp ./Source/FreeImage/PluginPNG.cpp ./Source/FreeImage/PluginPNM.cpp ./Source/FreeImage/PluginPSD.cpp ./Source/FreeImage/PluginRAS.cpp ./Source/FreeImage/PluginRAW.cpp ./Source/FreeImage/PluginSGI.cpp ./Source/FreeImage/PluginTARGA.cpp ./Source/FreeImage/PluginTIFF.cpp ./Source/FreeImage/PluginWBMP.cpp ./Source/FreeImage/PluginWebP.cpp ./Source/FreeImage/PluginXBM.cpp ./Source/FreeImage/PluginXPM.cpp ./Source/FreeImage/PSDParser.cpp ./Source/FreeImage/TIFFLogLuv.cpp ./Source/FreeImage/Conversion.cpp ./Source/FreeImage/Conversion16_555.cpp ./Source/FreeImage/Conversion16_565.cpp ./Source/FreeImage/Conversion24.cpp ./Source/FreeImage/Conversion32.cpp ./Source/FreeImage/Conversion4.cpp ./Source/FreeImage/Conversion8.cpp ./Source/FreeImage/ConversionFloat.cpp ./Source/FreeImage/ConversionRGB16.cpp ./Source/FreeImage/ConversionRGBF.cpp ./Source/FreeImage/ConversionType.cpp ./Source/FreeImage/ConversionUINT16.cpp ./Source/FreeImage/Halftoning.cpp ./Source/FreeImage/tmoColorConvert.cpp ./Source/FreeImage/tmoDrago03.cpp ./Source/FreeImage/tmoFattal02.cpp ./Source/FreeImage/tmoReinhard05.cpp ./Source/FreeImage/ToneMapping.cpp ./Source/FreeImage/NNQuantizer.cpp ./Source/FreeImage/WuQuantizer.cpp ./Source/FreeImage/CacheFile.cpp ./Source/FreeImage/MultiPage.cpp ./Source/FreeImage/ZLibInterface.cpp ./Source/Metadata/Exif.cpp ./Source/Metadata/FIRational.cpp ./Source/Metadata/FreeImageTag.cpp ./Source/Metadata/IPTC.cpp ./Source/Metadata/TagConversion.cpp ./Source/Metadata/TagLib.cpp ./Source/Metadata/XTIFF.cpp ./Source/FreeImageToolkit/Background.cpp ./Source/FreeImageToolkit/BSplineRotate.cpp ./Source/FreeImageToolkit/Channels.cpp ./Source/FreeImageToolkit/ClassicRotate.cpp ./Source/FreeImageToolkit/Colors.cpp ./Source/FreeImageToolkit/CopyPaste.cpp ./Source/FreeImageToolkit/Display.cpp ./Source/FreeImageToolkit/Flip.cpp ./Source/FreeImageToolkit/JPEGTransform.cpp ./Source/FreeImageToolkit/MultigridPoissonSolver.cpp ./Source/FreeImageToolkit/Rescale.cpp ./Source/FreeImageToolkit/Resize.cpp Source/LibJPEG/jaricom.c Source/LibJPEG/jcapimin.c Source/LibJPEG/jcapistd.c Source/LibJPEG/jcarith.c Source/LibJPEG/jccoefct.c Source/LibJPEG/jccolor.c Source/LibJPEG/jcdctmgr.c Source/LibJPEG/jchuff.c Source/LibJPEG/jcinit.c Source/LibJPEG/jcmainct.c Source/LibJPEG/jcmarker.c Source/LibJPEG/jcmaster.c Source/LibJPEG/jcomapi.c Source/LibJPEG/jcparam.c Source/LibJPEG/jcprepct.c Source/LibJPEG/jcsample.c Source/LibJPEG/jctrans.c Source/LibJPEG/jdapimin.c Source/LibJPEG/jdapistd.c Source/LibJPEG/jdarith.c Source/LibJPEG/jdatadst.c Source/LibJPEG/jdatasrc.c Source/LibJPEG/jdcoefct.c Source/LibJPEG/jdcolor.c Source/LibJPEG/jddctmgr.c Source/LibJPEG/jdhuff.c Source/LibJPEG/jdinput.c Source/LibJPEG/jdmainct.c Source/LibJPEG/jdmarker.c Source/LibJPEG/jdmaster.c Source/LibJPEG/jdmerge.c Source/LibJPEG/jdpostct.c Source/LibJPEG/jdsample.c Source/LibJPEG/jdtrans.c Source/LibJPEG/jerror.c Source/LibJPEG/jfdctflt.c Source/LibJPEG/jfdctfst.c Source/LibJPEG/jfdctint.c Source/LibJPEG/jidctflt.c Source/LibJPEG/jidctfst.c Source/LibJPEG/jidctint.c Source/LibJPEG/jmemmgr.c Source/LibJPEG/jmemnobs.c Source/LibJPEG/jquant1.c Source/LibJPEG/jquant2.c Source/LibJPEG/jutils.c Source/LibJPEG/transupp.c Source/LibPNG/png.c Source/LibPNG/pngerror.c Source/LibPNG/pngget.c Source/LibPNG/pngmem.c Source/LibPNG/pngpread.c Source/LibPNG/pngread.c Source/LibPNG/pngrio.c Source/LibPNG/pngrtran.c Source/LibPNG/pngrutil.c Source/LibPNG/pngset.c Source/LibPNG/pngtrans.c Source/LibPNG/pngwio.c Source/LibPNG/pngwrite.c Source/LibPNG/pngwtran.c Source/LibPNG/pngwutil.c Source/LibTIFF4/tif_aux.c Source/LibTIFF4/tif_close.c Source/LibTIFF4/tif_codec.c Source/LibTIFF4/tif_color.c Source/LibTIFF4/tif_compress.c Source/LibTIFF4/tif_dir.c Source/LibTIFF4/tif_dirinfo.c Source/LibTIFF4/tif_dirread.c Source/LibTIFF4/tif_dirwrite.c Source/LibTIFF4/tif_dumpmode.c Source/LibTIFF4/tif_error.c Source/LibTIFF4/tif_extension.c Source/LibTIFF4/tif_fax3.c Source/LibTIFF4/tif_fax3sm.c Source/LibTIFF4/tif_flush.c Source/LibTIFF4/tif_getimage.c Source/LibTIFF4/tif_jpeg.c Source/LibTIFF4/tif_luv.c Source/LibTIFF4/tif_lzma.c Source/LibTIFF4/tif_lzw.c Source/LibTIFF4/tif_next.c Source/LibTIFF4/tif_ojpeg.c Source/LibTIFF4/tif_open.c Source/LibTIFF4/tif_packbits.c Source/LibTIFF4/tif_pixarlog.c Source/LibTIFF4/tif_predict.c Source/LibTIFF4/tif_print.c Source/LibTIFF4/tif_read.c Source/LibTIFF4/tif_strip.c Source/LibTIFF4/tif_swab.c Source/LibTIFF4/tif_thunder.c Source/LibTIFF4/tif_tile.c Source/LibTIFF4/tif_version.c Source/LibTIFF4/tif_warning.c Source/LibTIFF4/tif_write.c Source/LibTIFF4/tif_zip.c Source/ZLib/adler32.c Source/ZLib/compress.c Source/ZLib/crc32.c Source/ZLib/deflate.c Source/ZLib/gzclose.c Source/ZLib/gzlib.c Source/ZLib/gzread.c Source/ZLib/gzwrite.c Source/ZLib/infback.c Source/ZLib/inffast.c Source/ZLib/inflate.c Source/ZLib/inftrees.c Source/ZLib/trees.c Source/ZLib/uncompr.c Source/ZLib/zutil.c Source/LibOpenJPEG/bio.c Source/LibOpenJPEG/cio.c Source/LibOpenJPEG/dwt.c Source/LibOpenJPEG/event.c Source/LibOpenJPEG/function_list.c Source/LibOpenJPEG/image.c Source/LibOpenJPEG/invert.c Source/LibOpenJPEG/j2k.c Source/LibOpenJPEG/jp2.c Source/LibOpenJPEG/mct.c Source/LibOpenJPEG/mqc.c Source/LibOpenJPEG/openjpeg.c Source/LibOpenJPEG/opj_clock.c Source/LibOpenJPEG/pi.c Source/LibOpenJPEG/raw.c Source/LibOpenJPEG/t1.c Source/LibOpenJPEG/t2.c Source/LibOpenJPEG/tcd.c Source/LibOpenJPEG/tgt.c Source/OpenEXR/IexMath/IexMathFpu.cpp Source/OpenEXR/IlmImf/b44ExpLogTable.cpp Source/OpenEXR/IlmImf/ImfAcesFile.cpp Source/OpenEXR/IlmImf/ImfAttribute.cpp Source/OpenEXR/IlmImf/ImfB44Compressor.cpp Source/OpenEXR/IlmImf/ImfBoxAttribute.cpp Source/OpenEXR/IlmImf/ImfChannelList.cpp Source/OpenEXR/IlmImf/ImfChannelListAttribute.cpp Source/OpenEXR/IlmImf/ImfChromaticities.cpp Source/OpenEXR/IlmImf/ImfChromaticitiesAttribute.cpp Source/OpenEXR/IlmImf/ImfCompositeDeepScanLine.cpp Source/OpenEXR/IlmImf/ImfCompressionAttribute.cpp Source/OpenEXR/IlmImf/ImfCompressor.cpp Source/OpenEXR/IlmImf/ImfConvert.cpp Source/OpenEXR/IlmImf/ImfCRgbaFile.cpp Source/OpenEXR/IlmImf/ImfDeepCompositing.cpp Source/OpenEXR/IlmImf/ImfDeepFrameBuffer.cpp Source/OpenEXR/IlmImf/ImfDeepImageStateAttribute.cpp Source/OpenEXR/IlmImf/ImfDeepScanLineInputFile.cpp Source/OpenEXR/IlmImf/ImfDeepScanLineInputPart.cpp Source/OpenEXR/IlmImf/ImfDeepScanLineOutputFile.cpp Source/OpenEXR/IlmImf/ImfDeepScanLineOutputPart.cpp Source/OpenEXR/IlmImf/ImfDeepTiledInputFile.cpp Source/OpenEXR/IlmImf/ImfDeepTiledInputPart.cpp Source/OpenEXR/IlmImf/ImfDeepTiledOutputFile.cpp Source/OpenEXR/IlmImf/ImfDeepTiledOutputPart.cpp Source/OpenEXR/IlmImf/ImfDoubleAttribute.cpp Source/OpenEXR/IlmImf/ImfDwaCompressor.cpp Source/OpenEXR/IlmImf/ImfEnvmap.cpp Source/OpenEXR/IlmImf/ImfEnvmapAttribute.cpp Source/OpenEXR/IlmImf/ImfFastHuf.cpp Source/OpenEXR/IlmImf/ImfFloatAttribute.cpp Source/OpenEXR/IlmImf/ImfFloatVectorAttribute.cpp Source/OpenEXR/IlmImf/ImfFrameBuffer.cpp Source/OpenEXR/IlmImf/ImfFramesPerSecond.cpp Source/OpenEXR/IlmImf/ImfGenericInputFile.cpp Source/OpenEXR/IlmImf/ImfGenericOutputFile.cpp Source/OpenEXR/IlmImf/ImfHeader.cpp Source/OpenEXR/IlmImf/ImfHuf.cpp Source/OpenEXR/IlmImf/ImfInputFile.cpp Source/OpenEXR/IlmImf/ImfInputPart.cpp Source/OpenEXR/IlmImf/ImfInputPartData.cpp Source/OpenEXR/IlmImf/ImfIntAttribute.cpp Source/OpenEXR/IlmImf/ImfIO.cpp Source/OpenEXR/IlmImf/ImfKeyCode.cpp Source/OpenEXR/IlmImf/ImfKeyCodeAttribute.cpp Source/OpenEXR/IlmImf/ImfLineOrderAttribute.cpp Source/OpenEXR/IlmImf/ImfLut.cpp Source/OpenEXR/IlmImf/ImfMatrixAttribute.cpp Source/OpenEXR/IlmImf/ImfMisc.cpp Source/OpenEXR/IlmImf/ImfMultiPartInputFile.cpp Source/OpenEXR/IlmImf/ImfMultiPartOutputFile.cpp Source/OpenEXR/IlmImf/ImfMultiView.cpp Source/OpenEXR/IlmImf/ImfOpaqueAttribute.cpp Source/OpenEXR/IlmImf/ImfOutputFile.cpp Source/OpenEXR/IlmImf/ImfOutputPart.cpp Source/OpenEXR/IlmImf/ImfOutputPartData.cpp Source/OpenEXR/IlmImf/ImfPartType.cpp Source/OpenEXR/IlmImf/ImfPizCompressor.cpp Source/OpenEXR/IlmImf/ImfPreviewImage.cpp Source/OpenEXR/IlmImf/ImfPreviewImageAttribute.cpp Source/OpenEXR/IlmImf/ImfPxr24Compressor.cpp Source/OpenEXR/IlmImf/ImfRational.cpp Source/OpenEXR/IlmImf/ImfRationalAttribute.cpp Source/OpenEXR/IlmImf/ImfRgbaFile.cpp Source/OpenEXR/IlmImf/ImfRgbaYca.cpp Source/OpenEXR/IlmImf/ImfRle.cpp Source/OpenEXR/IlmImf/ImfRleCompressor.cpp Source/OpenEXR/IlmImf/ImfScanLineInputFile.cpp Source/OpenEXR/IlmImf/ImfStandardAttributes.cpp Source/OpenEXR/IlmImf/ImfStdIO.cpp Source/OpenEXR/IlmImf/ImfStringAttribute.cpp Source/OpenEXR/IlmImf/ImfStringVectorAttribute.cpp Source/OpenEXR/IlmImf/ImfSystemSpecific.cpp Source/OpenEXR/IlmImf/ImfTestFile.cpp Source/OpenEXR/IlmImf/ImfThreading.cpp Source/OpenEXR/IlmImf/ImfTileDescriptionAttribute.cpp Source/OpenEXR/IlmImf/ImfTiledInputFile.cpp Source/OpenEXR/IlmImf/ImfTiledInputPart.cpp Source/OpenEXR/IlmImf/ImfTiledMisc.cpp Source/OpenEXR/IlmImf/ImfTiledOutputFile.cpp Source/OpenEXR/IlmImf/ImfTiledOutputPart.cpp Source/OpenEXR/IlmImf/ImfTiledRgbaFile.cpp Source/OpenEXR/IlmImf/ImfTileOffsets.cpp Source/OpenEXR/IlmImf/ImfTimeCode.cpp Source/OpenEXR/IlmImf/ImfTimeCodeAttribute.cpp Source/OpenEXR/IlmImf/ImfVecAttribute.cpp Source/OpenEXR/IlmImf/ImfVersion.cpp Source/OpenEXR/IlmImf/ImfWav.cpp Source/OpenEXR/IlmImf/ImfZip.cpp Source/OpenEXR/IlmImf/ImfZipCompressor.cpp Source/OpenEXR/Imath/ImathBox.cpp Source/OpenEXR/Imath/ImathColorAlgo.cpp Source/OpenEXR/Imath/ImathFun.cpp Source/OpenEXR/Imath/ImathMatrixAlgo.cpp Source/OpenEXR/Imath/ImathRandom.cpp Source/OpenEXR/Imath/ImathShear.cpp Source/OpenEXR/Imath/ImathVec.cpp Source/OpenEXR/Iex/IexBaseExc.cpp Source/OpenEXR/Iex/IexThrowErrnoExc.cpp Source/OpenEXR/Half/half.cpp Source/OpenEXR/IlmThread/IlmThread.cpp Source/OpenEXR/IlmThread/IlmThreadMutex.cpp Source/OpenEXR/IlmThread/IlmThreadPool.cpp Source/OpenEXR/IlmThread/IlmThreadSemaphore.cpp Source/OpenEXR/IexMath/IexMathFloatExc.cpp Source/LibRawLite/internal/dcraw_common.cpp Source/LibRawLite/internal/dcraw_fileio.cpp Source/LibRawLite/internal/demosaic_packs.cpp Source/LibRawLite/src/libraw_c_api.cpp Source/LibRawLite/src/libraw_cxx.cpp Source/LibRawLite/src/libraw_datastream.cpp Source/LibWebP/src/dec/alpha_dec.c Source/LibWebP/src/dec/buffer_dec.c Source/LibWebP/src/dec/frame_dec.c Source/LibWebP/src/dec/idec_dec.c Source/LibWebP/src/dec/io_dec.c Source/LibWebP/src/dec/quant_dec.c Source/LibWebP/src/dec/tree_dec.c Source/LibWebP/src/dec/vp8l_dec.c Source/LibWebP/src/dec/vp8_dec.c Source/LibWebP/src/dec/webp_dec.c Source/LibWebP/src/demux/anim_decode.c Source/LibWebP/src/demux/demux.c Source/LibWebP/src/dsp/alpha_processing.c Source/LibWebP/src/dsp/alpha_processing_mips_dsp_r2.c Source/LibWebP/src/dsp/alpha_processing_neon.c Source/LibWebP/src/dsp/alpha_processing_sse2.c Source/LibWebP/src/dsp/alpha_processing_sse41.c Source/LibWebP/src/dsp/cost.c Source/LibWebP/src/dsp/cost_mips32.c Source/LibWebP/src/dsp/cost_mips_dsp_r2.c Source/LibWebP/src/dsp/cost_neon.c Source/LibWebP/src/dsp/cost_sse2.c Source/LibWebP/src/dsp/cpu.c Source/LibWebP/src/dsp/dec.c Source/LibWebP/src/dsp/dec_clip_tables.c Source/LibWebP/src/dsp/dec_mips32.c Source/LibWebP/src/dsp/dec_mips_dsp_r2.c Source/LibWebP/src/dsp/dec_msa.c Source/LibWebP/src/dsp/dec_neon.c Source/LibWebP/src/dsp/dec_sse2.c Source/LibWebP/src/dsp/dec_sse41.c Source/LibWebP/src/dsp/enc.c Source/LibWebP/src/dsp/enc_avx2.c Source/LibWebP/src/dsp/enc_mips32.c Source/LibWebP/src/dsp/enc_mips_dsp_r2.c Source/LibWebP/src/dsp/enc_msa.c Source/LibWebP/src/dsp/enc_neon.c Source/LibWebP/src/dsp/enc_sse2.c Source/LibWebP/src/dsp/enc_sse41.c Source/LibWebP/src/dsp/filters.c Source/LibWebP/src/dsp/filters_mips_dsp_r2.c Source/LibWebP/src/dsp/filters_msa.c Source/LibWebP/src/dsp/filters_neon.c Source/LibWebP/src/dsp/filters_sse2.c Source/LibWebP/src/dsp/lossless.c Source/LibWebP/src/dsp/lossless_enc.c Source/LibWebP/src/dsp/lossless_enc_mips32.c Source/LibWebP/src/dsp/lossless_enc_mips_dsp_r2.c Source/LibWebP/src/dsp/lossless_enc_msa.c Source/LibWebP/src/dsp/lossless_enc_neon.c Source/LibWebP/src/dsp/lossless_enc_sse2.c Source/LibWebP/src/dsp/lossless_enc_sse41.c Source/LibWebP/src/dsp/lossless_mips_dsp_r2.c Source/LibWebP/src/dsp/lossless_msa.c Source/LibWebP/src/dsp/lossless_neon.c Source/LibWebP/src/dsp/lossless_sse2.c Source/LibWebP/src/dsp/rescaler.c Source/LibWebP/src/dsp/rescaler_mips32.c Source/LibWebP/src/dsp/rescaler_mips_dsp_r2.c Source/LibWebP/src/dsp/rescaler_msa.c Source/LibWebP/src/dsp/rescaler_neon.c Source/LibWebP/src/dsp/rescaler_sse2.c Source/LibWebP/src/dsp/ssim.c Source/LibWebP/src/dsp/ssim_sse2.c Source/LibWebP/src/dsp/upsampling.c Source/LibWebP/src/dsp/upsampling_mips_dsp_r2.c Source/LibWebP/src/dsp/upsampling_msa.c Source/LibWebP/src/dsp/upsampling_neon.c Source/LibWebP/src/dsp/upsampling_sse2.c Source/LibWebP/src/dsp/upsampling_sse41.c Source/LibWebP/src/dsp/yuv.c Source/LibWebP/src/dsp/yuv_mips32.c Source/LibWebP/src/dsp/yuv_mips_dsp_r2.c Source/LibWebP/src/dsp/yuv_neon.c Source/LibWebP/src/dsp/yuv_sse2.c Source/LibWebP/src/dsp/yuv_sse41.c Source/LibWebP/src/enc/alpha_enc.c Source/LibWebP/src/enc/analysis_enc.c Source/LibWebP/src/enc/backward_references_cost_enc.c Source/LibWebP/src/enc/backward_references_enc.c Source/LibWebP/src/enc/config_enc.c Source/LibWebP/src/enc/cost_enc.c Source/LibWebP/src/enc/filter_enc.c Source/LibWebP/src/enc/frame_enc.c Source/LibWebP/src/enc/histogram_enc.c Source/LibWebP/src/enc/iterator_enc.c Source/LibWebP/src/enc/near_lossless_enc.c Source/LibWebP/src/enc/picture_csp_enc.c Source/LibWebP/src/enc/picture_enc.c Source/LibWebP/src/enc/picture_psnr_enc.c Source/LibWebP/src/enc/picture_rescale_enc.c Source/LibWebP/src/enc/picture_tools_enc.c Source/LibWebP/src/enc/predictor_enc.c Source/LibWebP/src/enc/quant_enc.c Source/LibWebP/src/enc/syntax_enc.c Source/LibWebP/src/enc/token_enc.c Source/LibWebP/src/enc/tree_enc.c Source/LibWebP/src/enc/vp8l_enc.c Source/LibWebP/src/enc/webp_enc.c Source/LibWebP/src/mux/anim_encode.c Source/LibWebP/src/mux/muxedit.c Source/LibWebP/src/mux/muxinternal.c Source/LibWebP/src/mux/muxread.c Source/LibWebP/src/utils/bit_reader_utils.c Source/LibWebP/src/utils/bit_writer_utils.c Source/LibWebP/src/utils/color_cache_utils.c Source/LibWebP/src/utils/filters_utils.c Source/LibWebP/src/utils/huffman_encode_utils.c Source/LibWebP/src/utils/huffman_utils.c Source/LibWebP/src/utils/quant_levels_dec_utils.c Source/LibWebP/src/utils/quant_levels_utils.c Source/LibWebP/src/utils/random_utils.c Source/LibWebP/src/utils/rescaler_utils.c Source/LibWebP/src/utils/thread_utils.c Source/LibWebP/src/utils/utils.c Source/LibJXR/image/decode/decode.c Source/LibJXR/image/decode/JXRTranscode.c Source/LibJXR/image/decode/postprocess.c Source/LibJXR/image/decode/segdec.c Source/LibJXR/image/decode/strdec.c Source/LibJXR/image/decode/strdec_x86.c Source/LibJXR/image/decode/strInvTransform.c Source/LibJXR/image/decode/strPredQuantDec.c Source/LibJXR/image/encode/encode.c Source/LibJXR/image/encode/segenc.c Source/LibJXR/image/encode/strenc.c Source/LibJXR/image/encode/strenc_x86.c Source/LibJXR/image/encode/strFwdTransform.c Source/LibJXR/image/encode/strPredQuantEnc.c Source/LibJXR/image/sys/adapthuff.c Source/LibJXR/image/sys/image.c Source/LibJXR/image/sys/strcodec.c Source/LibJXR/image/sys/strPredQuant.c Source/LibJXR/image/sys/strTransform.c Source/LibJXR/jxrgluelib/JXRGlue.c Source/LibJXR/jxrgluelib/JXRGlueJxr.c Source/LibJXR/jxrgluelib/JXRGluePFC.c Source/LibJXR/jxrgluelib/JXRMeta.c 
+-INCLS = ./Examples/OpenGL/TextureManager/TextureManager.h ./Examples/Plugin/PluginCradle.h ./Examples/Generic/FIIO_Mem.h ./Source/MapIntrospector.h ./Source/CacheFile.h ./Source/LibJPEG/cderror.h ./Source/LibJPEG/jmorecfg.h ./Source/LibJPEG/transupp.h ./Source/LibJPEG/jpeglib.h ./Source/LibJPEG/jversion.h ./Source/LibJPEG/jinclude.h ./Source/LibJPEG/jerror.h ./Source/LibJPEG/jconfig.h ./Source/LibJPEG/jdct.h ./Source/LibJPEG/cdjpeg.h ./Source/LibJPEG/jmemsys.h ./Source/LibJPEG/jpegint.h ./Source/Plugin.h ./Source/Metadata/FreeImageTag.h ./Source/Metadata/FIRational.h ./Source/ToneMapping.h ./Source/LibTIFF4/tiffconf.vc.h ./Source/LibTIFF4/tif_config.h ./Source/LibTIFF4/tif_fax3.h ./Source/LibTIFF4/tif_config.vc.h ./Source/LibTIFF4/tiffvers.h ./Source/LibTIFF4/tiffio.h ./Source/LibTIFF4/tif_config.wince.h ./Source/LibTIFF4/tiffconf.wince.h ./Source/LibTIFF4/tiff.h ./Source/LibTIFF4/uvcode.h ./Source/LibTIFF4/tif_dir.h ./Source/LibTIFF4/t4.h ./Source/LibTIFF4/tif_predict.h ./Source/LibTIFF4/tiffiop.h ./Source/LibTIFF4/tiffconf.h ./Source/LibWebP/src/dec/alphai_dec.h ./Source/LibWebP/src/dec/common_dec.h ./Source/LibWebP/src/dec/vp8i_dec.h ./Source/LibWebP/src/dec/webpi_dec.h ./Source/LibWebP/src/dec/vp8li_dec.h ./Source/LibWebP/src/dec/vp8_dec.h ./Source/LibWebP/src/enc/cost_enc.h ./Source/LibWebP/src/enc/histogram_enc.h ./Source/LibWebP/src/enc/vp8li_enc.h ./Source/LibWebP/src/enc/backward_references_enc.h ./Source/LibWebP/src/enc/vp8i_enc.h ./Source/LibWebP/src/utils/bit_reader_utils.h ./Source/LibWebP/src/utils/endian_inl_utils.h ./Source/LibWebP/src/utils/huffman_encode_utils.h ./Source/LibWebP/src/utils/bit_writer_utils.h ./Source/LibWebP/src/utils/random_utils.h ./Source/LibWebP/src/utils/bit_reader_inl_utils.h ./Source/LibWebP/src/utils/quant_levels_dec_utils.h ./Source/LibWebP/src/utils/color_cache_utils.h ./Source/LibWebP/src/utils/thread_utils.h ./Source/LibWebP/src/utils/filters_utils.h ./Source/LibWebP/src/utils/rescaler_utils.h ./Source/LibWebP/src/utils/huffman_utils.h ./Source/LibWebP/src/utils/quant_levels_utils.h ./Source/LibWebP/src/utils/utils.h ./Source/LibWebP/src/mux/muxi.h ./Source/LibWebP/src/mux/animi.h ./Source/LibWebP/src/webp/mux.h ./Source/LibWebP/src/webp/types.h ./Source/LibWebP/src/webp/format_constants.h ./Source/LibWebP/src/webp/demux.h ./Source/LibWebP/src/webp/encode.h ./Source/LibWebP/src/webp/decode.h ./Source/LibWebP/src/webp/mux_types.h ./Source/LibWebP/src/dsp/msa_macro.h ./Source/LibWebP/src/dsp/yuv.h ./Source/LibWebP/src/dsp/common_sse41.h ./Source/LibWebP/src/dsp/neon.h ./Source/LibWebP/src/dsp/common_sse2.h ./Source/LibWebP/src/dsp/quant.h ./Source/LibWebP/src/dsp/lossless_common.h ./Source/LibWebP/src/dsp/mips_macro.h ./Source/LibWebP/src/dsp/dsp.h ./Source/LibWebP/src/dsp/lossless.h ./Source/FreeImageIO.h ./Source/FreeImage.h ./Source/FreeImage/PSDParser.h ./Source/FreeImage/J2KHelper.h ./Source/ZLib/trees.h ./Source/ZLib/inffixed.h ./Source/ZLib/inflate.h ./Source/ZLib/zlib.h ./Source/ZLib/zconf.h ./Source/ZLib/inftrees.h ./Source/ZLib/zutil.h ./Source/ZLib/inffast.h ./Source/ZLib/crc32.h ./Source/ZLib/gzguts.h ./Source/ZLib/deflate.h ./Source/Quantizers.h ./Source/LibOpenJPEG/cio.h ./Source/LibOpenJPEG/mqc.h ./Source/LibOpenJPEG/cidx_manager.h ./Source/LibOpenJPEG/function_list.h ./Source/LibOpenJPEG/indexbox_manager.h ./Source/LibOpenJPEG/opj_config.h ./Source/LibOpenJPEG/opj_clock.h ./Source/LibOpenJPEG/event.h ./Source/LibOpenJPEG/opj_codec.h ./Source/LibOpenJPEG/pi.h ./Source/LibOpenJPEG/dwt.h ./Source/LibOpenJPEG/tgt.h ./Source/LibOpenJPEG/invert.h ./Source/LibOpenJPEG/opj_malloc.h ./Source/LibOpenJPEG/raw.h ./Source/LibOpenJPEG/jp2.h ./Source/LibOpenJPEG/bio.h ./Source/LibOpenJPEG/t2.h ./Source/LibOpenJPEG/mct.h ./Source/LibOpenJPEG/t1.h ./Source/LibOpenJPEG/t1_luts.h ./Source/LibOpenJPEG/j2k.h ./Source/LibOpenJPEG/opj_stdint.h ./Source/LibOpenJPEG/opj_config_private.h ./Source/LibOpenJPEG/opj_includes.h ./Source/LibOpenJPEG/opj_intmath.h ./Source/LibOpenJPEG/image.h ./Source/LibOpenJPEG/opj_inttypes.h ./Source/LibOpenJPEG/openjpeg.h ./Source/LibOpenJPEG/tcd.h ./Source/LibRawLite/libraw/libraw_version.h ./Source/LibRawLite/libraw/libraw_const.h ./Source/LibRawLite/libraw/libraw.h ./Source/LibRawLite/libraw/libraw_types.h ./Source/LibRawLite/libraw/libraw_alloc.h ./Source/LibRawLite/libraw/libraw_datastream.h ./Source/LibRawLite/libraw/libraw_internal.h ./Source/LibRawLite/internal/dmp_include.h ./Source/LibRawLite/internal/libraw_const.h ./Source/LibRawLite/internal/var_defines.h ./Source/LibRawLite/internal/x3f_tools.h ./Source/LibRawLite/internal/defines.h ./Source/LibRawLite/internal/dcraw_fileio_defs.h ./Source/LibRawLite/internal/dcraw_defs.h ./Source/LibRawLite/internal/libraw_cxx_defs.h ./Source/LibRawLite/internal/libraw_internal_funcs.h ./Source/LibPNG/png.h ./Source/LibPNG/pngdebug.h ./Source/LibPNG/pnginfo.h ./Source/LibPNG/pnglibconf.h ./Source/LibPNG/pngstruct.h ./Source/LibPNG/pngpriv.h ./Source/LibPNG/pngconf.h ./Source/LibJXR/common/include/wmspecstrings_strict.h ./Source/LibJXR/common/include/wmspecstring.h ./Source/LibJXR/common/include/guiddef.h ./Source/LibJXR/common/include/wmsal.h ./Source/LibJXR/common/include/wmspecstrings_undef.h ./Source/LibJXR/common/include/wmspecstrings_adt.h ./Source/LibJXR/jxrgluelib/JXRGlue.h ./Source/LibJXR/jxrgluelib/JXRMeta.h ./Source/LibJXR/image/sys/xplatform_image.h ./Source/LibJXR/image/sys/strTransform.h ./Source/LibJXR/image/sys/windowsmediaphoto.h ./Source/LibJXR/image/sys/strcodec.h ./Source/LibJXR/image/sys/ansi.h ./Source/LibJXR/image/sys/perfTimer.h ./Source/LibJXR/image/sys/common.h ./Source/LibJXR/image/decode/decode.h ./Source/LibJXR/image/x86/x86.h ./Source/LibJXR/image/encode/encode.h ./Source/Utilities.h ./Source/FreeImageToolkit/Resize.h ./Source/FreeImageToolkit/Filters.h ./Source/OpenEXR/OpenEXRConfig.h ./Source/OpenEXR/IexMath/IexMathFloatExc.h ./Source/OpenEXR/IexMath/IexMathFpu.h ./Source/OpenEXR/IexMath/IexMathIeeeExc.h ./Source/OpenEXR/IlmThread/IlmThread.h ./Source/OpenEXR/IlmThread/IlmThreadMutex.h ./Source/OpenEXR/IlmThread/IlmThreadForward.h ./Source/OpenEXR/IlmThread/IlmThreadExport.h ./Source/OpenEXR/IlmThread/IlmThreadSemaphore.h ./Source/OpenEXR/IlmThread/IlmThreadPool.h ./Source/OpenEXR/IlmThread/IlmThreadNamespace.h ./Source/OpenEXR/Iex/IexErrnoExc.h ./Source/OpenEXR/Iex/IexMacros.h ./Source/OpenEXR/Iex/IexForward.h ./Source/OpenEXR/Iex/IexExport.h ./Source/OpenEXR/Iex/IexThrowErrnoExc.h ./Source/OpenEXR/Iex/IexNamespace.h ./Source/OpenEXR/Iex/IexMathExc.h ./Source/OpenEXR/Iex/IexBaseExc.h ./Source/OpenEXR/Iex/Iex.h ./Source/OpenEXR/Imath/ImathColorAlgo.h ./Source/OpenEXR/Imath/ImathNamespace.h ./Source/OpenEXR/Imath/ImathVec.h ./Source/OpenEXR/Imath/ImathGL.h ./Source/OpenEXR/Imath/ImathSphere.h ./Source/OpenEXR/Imath/ImathEuler.h ./Source/OpenEXR/Imath/ImathLimits.h ./Source/OpenEXR/Imath/ImathQuat.h ./Source/OpenEXR/Imath/ImathRoots.h ./Source/OpenEXR/Imath/ImathFun.h ./Source/OpenEXR/Imath/ImathExport.h ./Source/OpenEXR/Imath/ImathShear.h ./Source/OpenEXR/Imath/ImathPlane.h ./Source/OpenEXR/Imath/ImathForward.h ./Source/OpenEXR/Imath/ImathHalfLimits.h ./Source/OpenEXR/Imath/ImathFrustumTest.h ./Source/OpenEXR/Imath/ImathMatrixAlgo.h ./Source/OpenEXR/Imath/ImathVecAlgo.h ./Source/OpenEXR/Imath/ImathInterval.h ./Source/OpenEXR/Imath/ImathBox.h ./Source/OpenEXR/Imath/ImathFrame.h ./Source/OpenEXR/Imath/ImathColor.h ./Source/OpenEXR/Imath/ImathMath.h ./Source/OpenEXR/Imath/ImathLine.h ./Source/OpenEXR/Imath/ImathBoxAlgo.h ./Source/OpenEXR/Imath/ImathFrustum.h ./Source/OpenEXR/Imath/ImathExc.h ./Source/OpenEXR/Imath/ImathLineAlgo.h ./Source/OpenEXR/Imath/ImathRandom.h ./Source/OpenEXR/Imath/ImathInt64.h ./Source/OpenEXR/Imath/ImathGLU.h ./Source/OpenEXR/Imath/ImathPlatform.h ./Source/OpenEXR/Imath/ImathMatrix.h ./Source/OpenEXR/IlmImf/ImfDeepScanLineOutputPart.h ./Source/OpenEXR/IlmImf/ImfDeepScanLineInputFile.h ./Source/OpenEXR/IlmImf/ImfIO.h ./Source/OpenEXR/IlmImf/ImfStdIO.h ./Source/OpenEXR/IlmImf/ImfPreviewImage.h ./Source/OpenEXR/IlmImf/ImfAttribute.h ./Source/OpenEXR/IlmImf/ImfDwaCompressor.h ./Source/OpenEXR/IlmImf/ImfChannelList.h ./Source/OpenEXR/IlmImf/ImfInt64.h ./Source/OpenEXR/IlmImf/ImfGenericOutputFile.h ./Source/OpenEXR/IlmImf/ImfHuf.h ./Source/OpenEXR/IlmImf/ImfOptimizedPixelReading.h ./Source/OpenEXR/IlmImf/b44ExpLogTable.h ./Source/OpenEXR/IlmImf/ImfMultiPartOutputFile.h ./Source/OpenEXR/IlmImf/ImfTileDescriptionAttribute.h ./Source/OpenEXR/IlmImf/ImfFastHuf.h ./Source/OpenEXR/IlmImf/dwaLookups.h ./Source/OpenEXR/IlmImf/ImfCompositeDeepScanLine.h ./Source/OpenEXR/IlmImf/ImfDeepFrameBuffer.h ./Source/OpenEXR/IlmImf/ImfInputPartData.h ./Source/OpenEXR/IlmImf/ImfAcesFile.h ./Source/OpenEXR/IlmImf/ImfRgbaYca.h ./Source/OpenEXR/IlmImf/ImfThreading.h ./Source/OpenEXR/IlmImf/ImfWav.h ./Source/OpenEXR/IlmImf/ImfChromaticitiesAttribute.h ./Source/OpenEXR/IlmImf/ImfDwaCompressorSimd.h ./Source/OpenEXR/IlmImf/ImfNamespace.h ./Source/OpenEXR/IlmImf/ImfMatrixAttribute.h ./Source/OpenEXR/IlmImf/ImfTimeCodeAttribute.h ./Source/OpenEXR/IlmImf/ImfInputFile.h ./Source/OpenEXR/IlmImf/ImfDeepScanLineInputPart.h ./Source/OpenEXR/IlmImf/ImfFloatAttribute.h ./Source/OpenEXR/IlmImf/ImfPxr24Compressor.h ./Source/OpenEXR/IlmImf/ImfCompressor.h ./Source/OpenEXR/IlmImf/ImfCRgbaFile.h ./Source/OpenEXR/IlmImf/ImfOutputFile.h ./Source/OpenEXR/IlmImf/ImfTiledInputPart.h ./Source/OpenEXR/IlmImf/ImfRationalAttribute.h ./Source/OpenEXR/IlmImf/ImfTileOffsets.h ./Source/OpenEXR/IlmImf/ImfInputStreamMutex.h ./Source/OpenEXR/IlmImf/ImfIntAttribute.h ./Source/OpenEXR/IlmImf/ImfTiledOutputPart.h ./Source/OpenEXR/IlmImf/ImfPartType.h ./Source/OpenEXR/IlmImf/ImfTiledInputFile.h ./Source/OpenEXR/IlmImf/ImfStringAttribute.h ./Source/OpenEXR/IlmImf/ImfDeepTiledOutputPart.h ./Source/OpenEXR/IlmImf/ImfRleCompressor.h ./Source/OpenEXR/IlmImf/ImfChromaticities.h ./Source/OpenEXR/IlmImf/ImfTestFile.h ./Source/OpenEXR/IlmImf/ImfInputPart.h ./Source/OpenEXR/IlmImf/ImfXdr.h ./Source/OpenEXR/IlmImf/ImfOutputPart.h ./Source/OpenEXR/IlmImf/ImfExport.h ./Source/OpenEXR/IlmImf/ImfRgba.h ./Source/OpenEXR/IlmImf/ImfLineOrder.h ./Source/OpenEXR/IlmImf/ImfCompression.h ./Source/OpenEXR/IlmImf/ImfTiledMisc.h ./Source/OpenEXR/IlmImf/ImfFramesPerSecond.h ./Source/OpenEXR/IlmImf/ImfZipCompressor.h ./Source/OpenEXR/IlmImf/ImfKeyCodeAttribute.h ./Source/OpenEXR/IlmImf/ImfFloatVectorAttribute.h ./Source/OpenEXR/IlmImf/ImfMultiPartInputFile.h ./Source/OpenEXR/IlmImf/ImfDeepTiledOutputFile.h ./Source/OpenEXR/IlmImf/ImfDeepScanLineOutputFile.h ./Source/OpenEXR/IlmImf/ImfRational.h ./Source/OpenEXR/IlmImf/ImfDeepImageStateAttribute.h ./Source/OpenEXR/IlmImf/ImfChannelListAttribute.h ./Source/OpenEXR/IlmImf/ImfDeepCompositing.h ./Source/OpenEXR/IlmImf/ImfOutputPartData.h ./Source/OpenEXR/IlmImf/ImfDeepTiledInputPart.h ./Source/OpenEXR/IlmImf/ImfPreviewImageAttribute.h ./Source/OpenEXR/IlmImf/ImfFrameBuffer.h ./Source/OpenEXR/IlmImf/ImfDeepImageState.h ./Source/OpenEXR/IlmImf/ImfOpaqueAttribute.h ./Source/OpenEXR/IlmImf/ImfEnvmapAttribute.h ./Source/OpenEXR/IlmImf/ImfPizCompressor.h ./Source/OpenEXR/IlmImf/ImfStringVectorAttribute.h ./Source/OpenEXR/IlmImf/ImfMultiView.h ./Source/OpenEXR/IlmImf/ImfAutoArray.h ./Source/OpenEXR/IlmImf/ImfLut.h ./Source/OpenEXR/IlmImf/ImfTiledOutputFile.h ./Source/OpenEXR/IlmImf/ImfBoxAttribute.h ./Source/OpenEXR/IlmImf/ImfCheckedArithmetic.h ./Source/OpenEXR/IlmImf/ImfB44Compressor.h ./Source/OpenEXR/IlmImf/ImfSystemSpecific.h ./Source/OpenEXR/IlmImf/ImfRgbaFile.h ./Source/OpenEXR/IlmImf/ImfTimeCode.h ./Source/OpenEXR/IlmImf/ImfVecAttribute.h ./Source/OpenEXR/IlmImf/ImfDeepTiledInputFile.h ./Source/OpenEXR/IlmImf/ImfZip.h ./Source/OpenEXR/IlmImf/ImfConvert.h ./Source/OpenEXR/IlmImf/ImfMisc.h ./Source/OpenEXR/IlmImf/ImfHeader.h ./Source/OpenEXR/IlmImf/ImfForward.h ./Source/OpenEXR/IlmImf/ImfPartHelper.h ./Source/OpenEXR/IlmImf/ImfKeyCode.h ./Source/OpenEXR/IlmImf/ImfVersion.h ./Source/OpenEXR/IlmImf/ImfStandardAttributes.h ./Source/OpenEXR/IlmImf/ImfPixelType.h ./Source/OpenEXR/IlmImf/ImfName.h ./Source/OpenEXR/IlmImf/ImfSimd.h ./Source/OpenEXR/IlmImf/ImfArray.h ./Source/OpenEXR/IlmImf/ImfOutputStreamMutex.h ./Source/OpenEXR/IlmImf/ImfTiledRgbaFile.h ./Source/OpenEXR/IlmImf/ImfRle.h ./Source/OpenEXR/IlmImf/ImfScanLineInputFile.h ./Source/OpenEXR/IlmImf/ImfDoubleAttribute.h ./Source/OpenEXR/IlmImf/ImfGenericInputFile.h ./Source/OpenEXR/IlmImf/ImfEnvmap.h ./Source/OpenEXR/IlmImf/ImfLineOrderAttribute.h ./Source/OpenEXR/IlmImf/ImfTileDescription.h ./Source/OpenEXR/IlmImf/ImfCompressionAttribute.h ./Source/OpenEXR/IlmBaseConfig.h ./Source/OpenEXR/Half/halfFunction.h ./Source/OpenEXR/Half/halfExport.h ./Source/OpenEXR/Half/half.h ./Source/OpenEXR/Half/eLut.h ./Source/OpenEXR/Half/halfLimits.h ./Source/OpenEXR/Half/toFloat.h ./Wrapper/FreeImage.NET/cpp/FreeImageIO/FreeImageIO.Net.h ./Wrapper/FreeImage.NET/cpp/FreeImageIO/Stdafx.h ./Wrapper/FreeImage.NET/cpp/FreeImageIO/resource.h ./Wrapper/FreeImagePlus/dist/x64/FreeImagePlus.h ./Wrapper/FreeImagePlus/FreeImagePlus.h ./Wrapper/FreeImagePlus/test/fipTest.h ./TestAPI/TestSuite.h
++SRCS = ./Source/FreeImage/BitmapAccess.cpp ./Source/FreeImage/ColorLookup.cpp ./Source/FreeImage/ConversionRGBA16.cpp ./Source/FreeImage/ConversionRGBAF.cpp ./Source/FreeImage/FreeImage.cpp ./Source/FreeImage/FreeImageC.c ./Source/FreeImage/FreeImageIO.cpp ./Source/FreeImage/GetType.cpp ./Source/FreeImage/LFPQuantizer.cpp ./Source/FreeImage/MemoryIO.cpp ./Source/FreeImage/PixelAccess.cpp ./Source/FreeImage/J2KHelper.cpp ./Source/FreeImage/MNGHelper.cpp ./Source/FreeImage/Plugin.cpp ./Source/FreeImage/PluginBMP.cpp ./Source/FreeImage/PluginCUT.cpp ./Source/FreeImage/PluginDDS.cpp ./Source/FreeImage/PluginEXR.cpp ./Source/FreeImage/PluginG3.cpp ./Source/FreeImage/PluginGIF.cpp ./Source/FreeImage/PluginHDR.cpp ./Source/FreeImage/PluginICO.cpp ./Source/FreeImage/PluginIFF.cpp ./Source/FreeImage/PluginJ2K.cpp ./Source/FreeImage/PluginJNG.cpp ./Source/FreeImage/PluginJP2.cpp ./Source/FreeImage/PluginJPEG.cpp ./Source/FreeImage/PluginJXR.cpp ./Source/FreeImage/PluginKOALA.cpp ./Source/FreeImage/PluginMNG.cpp ./Source/FreeImage/PluginPCD.cpp ./Source/FreeImage/PluginPCX.cpp ./Source/FreeImage/PluginPFM.cpp ./Source/FreeImage/PluginPICT.cpp ./Source/FreeImage/PluginPNG.cpp ./Source/FreeImage/PluginPNM.cpp ./Source/FreeImage/PluginPSD.cpp ./Source/FreeImage/PluginRAS.cpp ./Source/FreeImage/PluginRAW.cpp ./Source/FreeImage/PluginSGI.cpp ./Source/FreeImage/PluginTARGA.cpp ./Source/FreeImage/PluginTIFF.cpp ./Source/FreeImage/PluginWBMP.cpp ./Source/FreeImage/PluginWebP.cpp ./Source/FreeImage/PluginXBM.cpp ./Source/FreeImage/PluginXPM.cpp ./Source/FreeImage/PSDParser.cpp ./Source/FreeImage/TIFFLogLuv.cpp ./Source/FreeImage/Conversion.cpp ./Source/FreeImage/Conversion16_555.cpp ./Source/FreeImage/Conversion16_565.cpp ./Source/FreeImage/Conversion24.cpp ./Source/FreeImage/Conversion32.cpp ./Source/FreeImage/Conversion4.cpp ./Source/FreeImage/Conversion8.cpp ./Source/FreeImage/ConversionFloat.cpp ./Source/FreeImage/ConversionRGB16.cpp ./Source/FreeImage/ConversionRGBF.cpp ./Source/FreeImage/ConversionType.cpp ./Source/FreeImage/ConversionUINT16.cpp ./Source/FreeImage/Halftoning.cpp ./Source/FreeImage/tmoColorConvert.cpp ./Source/FreeImage/tmoDrago03.cpp ./Source/FreeImage/tmoFattal02.cpp ./Source/FreeImage/tmoReinhard05.cpp ./Source/FreeImage/ToneMapping.cpp ./Source/FreeImage/NNQuantizer.cpp ./Source/FreeImage/WuQuantizer.cpp ./Source/FreeImage/CacheFile.cpp ./Source/FreeImage/MultiPage.cpp ./Source/FreeImage/ZLibInterface.cpp ./Source/Metadata/Exif.cpp ./Source/Metadata/FIRational.cpp ./Source/Metadata/FreeImageTag.cpp ./Source/Metadata/IPTC.cpp ./Source/Metadata/TagConversion.cpp ./Source/Metadata/TagLib.cpp ./Source/Metadata/XTIFF.cpp ./Source/FreeImageToolkit/Background.cpp ./Source/FreeImageToolkit/BSplineRotate.cpp ./Source/FreeImageToolkit/Channels.cpp ./Source/FreeImageToolkit/ClassicRotate.cpp ./Source/FreeImageToolkit/Colors.cpp ./Source/FreeImageToolkit/CopyPaste.cpp ./Source/FreeImageToolkit/Display.cpp ./Source/FreeImageToolkit/Flip.cpp ./Source/FreeImageToolkit/JPEGTransform.cpp ./Source/FreeImageToolkit/MultigridPoissonSolver.cpp ./Source/FreeImageToolkit/Rescale.cpp ./Source/FreeImageToolkit/Resize.cpp 
++INCLS = ./Examples/OpenGL/TextureManager/TextureManager.h ./Examples/Generic/FIIO_Mem.h ./Examples/Plugin/PluginCradle.h ./Wrapper/FreeImage.NET/cpp/FreeImageIO/resource.h ./Wrapper/FreeImage.NET/cpp/FreeImageIO/FreeImageIO.Net.h ./Wrapper/FreeImage.NET/cpp/FreeImageIO/Stdafx.h ./Wrapper/FreeImagePlus/FreeImagePlus.h ./Wrapper/FreeImagePlus/test/fipTest.h ./TestAPI/TestSuite.h ./Source/FreeImage.h ./Source/FreeImage/PSDParser.h ./Source/FreeImage/J2KHelper.h ./Source/FreeImageToolkit/Filters.h ./Source/FreeImageToolkit/Resize.h ./Source/Metadata/FreeImageTag.h ./Source/Metadata/FIRational.h ./Source/ToneMapping.h ./Source/FreeImageIO.h ./Source/Plugin.h ./Source/CacheFile.h ./Source/Utilities.h ./Source/MapIntrospector.h ./Source/Quantizers.h
+ 
+-INCLUDE = -I. -ISource -ISource/Metadata -ISource/FreeImageToolkit -ISource/LibJPEG -ISource/LibPNG -ISource/LibTIFF4 -ISource/ZLib -ISource/LibOpenJPEG -ISource/OpenEXR -ISource/OpenEXR/Half -ISource/OpenEXR/Iex -ISource/OpenEXR/IlmImf -ISource/OpenEXR/IlmThread -ISource/OpenEXR/Imath -ISource/OpenEXR/IexMath -ISource/LibRawLite -ISource/LibRawLite/dcraw -ISource/LibRawLite/internal -ISource/LibRawLite/libraw -ISource/LibRawLite/src -ISource/LibWebP -ISource/LibJXR -ISource/LibJXR/common/include -ISource/LibJXR/image/sys -ISource/LibJXR/jxrgluelib
++INCLUDE = -I. -ISource -ISource/Metadata -ISource/FreeImageToolkit
+diff --git a/Source/FreeImage.h b/Source/FreeImage.h
+index e8f1da6..235563e 100644
+--- a/Source/FreeImage.h
++++ b/Source/FreeImage.h
+@@ -155,8 +155,8 @@ typedef uint8_t BYTE;
+ typedef uint16_t WORD;
+ typedef uint32_t DWORD;
+ typedef int32_t LONG;
+-typedef int64_t INT64;
+-typedef uint64_t UINT64;
++#define INT64 int64_t
++#define UINT64 uint64_t
+ #else
+ // MS is not C99 ISO compliant
+ typedef long BOOL;
+diff --git a/Source/FreeImage/J2KHelper.cpp b/Source/FreeImage/J2KHelper.cpp
+index 1776c3b..538f1c5 100644
+--- a/Source/FreeImage/J2KHelper.cpp
++++ b/Source/FreeImage/J2KHelper.cpp
+@@ -21,7 +21,7 @@
+ 
+ #include "FreeImage.h"
+ #include "Utilities.h"
+-#include "../LibOpenJPEG/openjpeg.h"
++#include <openjpeg.h>
+ #include "J2KHelper.h"
+ 
+ // --------------------------------------------------------------------------
+diff --git a/Source/FreeImage/PluginEXR.cpp b/Source/FreeImage/PluginEXR.cpp
+index b286430..9bf3ada 100644
+--- a/Source/FreeImage/PluginEXR.cpp
++++ b/Source/FreeImage/PluginEXR.cpp
+@@ -28,16 +28,16 @@
+ #pragma warning (disable : 4800) // ImfVersion.h - 'const int' : forcing value to bool 'true' or 'false' (performance warning)
+ #endif 
+ 
+-#include "../OpenEXR/IlmImf/ImfIO.h"
+-#include "../OpenEXR/Iex/Iex.h"
+-#include "../OpenEXR/IlmImf/ImfOutputFile.h"
+-#include "../OpenEXR/IlmImf/ImfInputFile.h"
+-#include "../OpenEXR/IlmImf/ImfRgbaFile.h"
+-#include "../OpenEXR/IlmImf/ImfChannelList.h"
+-#include "../OpenEXR/IlmImf/ImfRgba.h"
+-#include "../OpenEXR/IlmImf/ImfArray.h"
+-#include "../OpenEXR/IlmImf/ImfPreviewImage.h"
+-#include "../OpenEXR/Half/half.h"
++#include <OpenEXR/ImfIO.h>
++#include <OpenEXR/Iex.h>
++#include <OpenEXR/ImfOutputFile.h>
++#include <OpenEXR/ImfInputFile.h>
++#include <OpenEXR/ImfRgbaFile.h>
++#include <OpenEXR/ImfChannelList.h>
++#include <OpenEXR/ImfRgba.h>
++#include <OpenEXR/ImfArray.h>
++#include <OpenEXR/ImfPreviewImage.h>
++#include <OpenEXR/half.h>
+ 
+ 
+ // ==========================================================
+diff --git a/Source/FreeImage/PluginG3.cpp b/Source/FreeImage/PluginG3.cpp
+index 0a083b4..e2f1241 100644
+--- a/Source/FreeImage/PluginG3.cpp
++++ b/Source/FreeImage/PluginG3.cpp
+@@ -20,7 +20,7 @@
+ // Use at your own risk!
+ // ==========================================================
+ 
+-#include "../LibTIFF4/tiffiop.h"
++#include <tiffiop.h>
+ 
+ #include "FreeImage.h"
+ #include "Utilities.h"
+diff --git a/Source/FreeImage/PluginJ2K.cpp b/Source/FreeImage/PluginJ2K.cpp
+index b8bcfc8..621a903 100644
+--- a/Source/FreeImage/PluginJ2K.cpp
++++ b/Source/FreeImage/PluginJ2K.cpp
+@@ -21,7 +21,7 @@
+ 
+ #include "FreeImage.h"
+ #include "Utilities.h"
+-#include "../LibOpenJPEG/openjpeg.h"
++#include <openjpeg.h>
+ #include "J2KHelper.h"
+ 
+ // ==========================================================
+diff --git a/Source/FreeImage/PluginJP2.cpp b/Source/FreeImage/PluginJP2.cpp
+index 742fe2c..c57f626 100644
+--- a/Source/FreeImage/PluginJP2.cpp
++++ b/Source/FreeImage/PluginJP2.cpp
+@@ -21,7 +21,7 @@
+ 
+ #include "FreeImage.h"
+ #include "Utilities.h"
+-#include "../LibOpenJPEG/openjpeg.h"
++#include <openjpeg.h>
+ #include "J2KHelper.h"
+ 
+ // ==========================================================
+diff --git a/Source/FreeImage/PluginJPEG.cpp b/Source/FreeImage/PluginJPEG.cpp
+index 8db177d..a7de637 100644
+--- a/Source/FreeImage/PluginJPEG.cpp
++++ b/Source/FreeImage/PluginJPEG.cpp
+@@ -35,9 +35,9 @@ extern "C" {
+ #undef FAR
+ #include <setjmp.h>
+ 
+-#include "../LibJPEG/jinclude.h"
+-#include "../LibJPEG/jpeglib.h"
+-#include "../LibJPEG/jerror.h"
++#include <stdio.h>
++#include <jpeglib.h>
++#include <jerror.h>
+ }
+ 
+ #include "FreeImage.h"
+@@ -484,116 +484,6 @@ marker_is_icc(jpeg_saved_marker_ptr marker) {
+ 	return FALSE;
+ }
+ 
+-/**
+-  See if there was an ICC profile in the JPEG file being read;
+-  if so, reassemble and return the profile data.
+-
+-  TRUE is returned if an ICC profile was found, FALSE if not.
+-  If TRUE is returned, *icc_data_ptr is set to point to the
+-  returned data, and *icc_data_len is set to its length.
+-  
+-  IMPORTANT: the data at **icc_data_ptr has been allocated with malloc()
+-  and must be freed by the caller with free() when the caller no longer
+-  needs it.  (Alternatively, we could write this routine to use the
+-  IJG library's memory allocator, so that the data would be freed implicitly
+-  at jpeg_finish_decompress() time.  But it seems likely that many apps
+-  will prefer to have the data stick around after decompression finishes.)
+-  
+-  NOTE: if the file contains invalid ICC APP2 markers, we just silently
+-  return FALSE.  You might want to issue an error message instead.
+-*/
+-static BOOL 
+-jpeg_read_icc_profile(j_decompress_ptr cinfo, JOCTET **icc_data_ptr, unsigned *icc_data_len) {
+-	jpeg_saved_marker_ptr marker;
+-	int num_markers = 0;
+-	int seq_no;
+-	JOCTET *icc_data;
+-	unsigned total_length;
+-
+-	const int MAX_SEQ_NO = 255;			// sufficient since marker numbers are bytes
+-	BYTE marker_present[MAX_SEQ_NO+1];	// 1 if marker found
+-	unsigned data_length[MAX_SEQ_NO+1];	// size of profile data in marker
+-	unsigned data_offset[MAX_SEQ_NO+1];	// offset for data in marker
+-	
+-	*icc_data_ptr = NULL;		// avoid confusion if FALSE return
+-	*icc_data_len = 0;
+-	
+-	/**
+-	this first pass over the saved markers discovers whether there are
+-	any ICC markers and verifies the consistency of the marker numbering.
+-	*/
+-	
+-	memset(marker_present, 0, (MAX_SEQ_NO + 1));
+-	
+-	for(marker = cinfo->marker_list; marker != NULL; marker = marker->next) {
+-		if (marker_is_icc(marker)) {
+-			if (num_markers == 0) {
+-				// number of markers
+-				num_markers = GETJOCTET(marker->data[13]);
+-			}
+-			else if (num_markers != GETJOCTET(marker->data[13])) {
+-				return FALSE;		// inconsistent num_markers fields 
+-			}
+-			// sequence number
+-			seq_no = GETJOCTET(marker->data[12]);
+-			if (seq_no <= 0 || seq_no > num_markers) {
+-				return FALSE;		// bogus sequence number 
+-			}
+-			if (marker_present[seq_no]) {
+-				return FALSE;		// duplicate sequence numbers 
+-			}
+-			marker_present[seq_no] = 1;
+-			data_length[seq_no] = marker->data_length - ICC_HEADER_SIZE;
+-		}
+-	}
+-	
+-	if (num_markers == 0)
+-		return FALSE;
+-		
+-	/**
+-	check for missing markers, count total space needed,
+-	compute offset of each marker's part of the data.
+-	*/
+-	
+-	total_length = 0;
+-	for(seq_no = 1; seq_no <= num_markers; seq_no++) {
+-		if (marker_present[seq_no] == 0) {
+-			return FALSE;		// missing sequence number
+-		}
+-		data_offset[seq_no] = total_length;
+-		total_length += data_length[seq_no];
+-	}
+-	
+-	if (total_length <= 0)
+-		return FALSE;		// found only empty markers ?
+-	
+-	// allocate space for assembled data 
+-	icc_data = (JOCTET *) malloc(total_length * sizeof(JOCTET));
+-	if (icc_data == NULL)
+-		return FALSE;		// out of memory
+-	
+-	// and fill it in
+-	for (marker = cinfo->marker_list; marker != NULL; marker = marker->next) {
+-		if (marker_is_icc(marker)) {
+-			JOCTET FAR *src_ptr;
+-			JOCTET *dst_ptr;
+-			unsigned length;
+-			seq_no = GETJOCTET(marker->data[12]);
+-			dst_ptr = icc_data + data_offset[seq_no];
+-			src_ptr = marker->data + ICC_HEADER_SIZE;
+-			length = data_length[seq_no];
+-			while (length--) {
+-				*dst_ptr++ = *src_ptr++;
+-			}
+-		}
+-	}
+-	
+-	*icc_data_ptr = icc_data;
+-	*icc_data_len = total_length;
+-	
+-	return TRUE;
+-}
+-
+ /**
+ 	Read JPEG_APPD marker (IPTC or Adobe Photoshop profile)
+ */
+diff --git a/Source/FreeImage/PluginJXR.cpp b/Source/FreeImage/PluginJXR.cpp
+index 85c6ff3..163a93b 100644
+--- a/Source/FreeImage/PluginJXR.cpp
++++ b/Source/FreeImage/PluginJXR.cpp
+@@ -23,7 +23,7 @@
+ #include "Utilities.h"

+ #include "../Metadata/FreeImageTag.h"

+ 

+-#include "../LibJXR/jxrgluelib/JXRGlue.h"

++#include <JXRGlue.h>

+ 

+ // ==========================================================

+ // Plugin Interface

+diff --git a/Source/FreeImage/PluginPNG.cpp b/Source/FreeImage/PluginPNG.cpp
+index 661f160..504fafe 100644
+--- a/Source/FreeImage/PluginPNG.cpp
++++ b/Source/FreeImage/PluginPNG.cpp
+@@ -40,8 +40,8 @@
+ 
+ // ----------------------------------------------------------
+ 
+-#include "../ZLib/zlib.h"
+-#include "../LibPNG/png.h"
++#include <zlib.h>
++#include <png.h>
+ 
+ // ----------------------------------------------------------
+ 
+diff --git a/Source/FreeImage/PluginRAW.cpp b/Source/FreeImage/PluginRAW.cpp
+index ab0499f..2d3c9fd 100644
+--- a/Source/FreeImage/PluginRAW.cpp
++++ b/Source/FreeImage/PluginRAW.cpp
+@@ -19,12 +19,16 @@
+ // Use at your own risk!
+ // ==========================================================
+ 
+-#include "../LibRawLite/libraw/libraw.h"
++#include <libraw.h>
+ 
+ #include "FreeImage.h"
+ #include "Utilities.h"
+ #include "../Metadata/FreeImageTag.h"
+ 
++// What an ugly hack
++#undef INT64
++#undef UINT64
++
+ // ==========================================================
+ // Plugin Interface
+ // ==========================================================
+diff --git a/Source/FreeImage/PluginTIFF.cpp b/Source/FreeImage/PluginTIFF.cpp
+index a805319..3e318ba 100644
+--- a/Source/FreeImage/PluginTIFF.cpp
++++ b/Source/FreeImage/PluginTIFF.cpp
+@@ -37,9 +37,9 @@
+ 

+ #include "FreeImage.h"

+ #include "Utilities.h"

+-#include "../LibTIFF4/tiffiop.h"

++#include <tiffiop.h>

+ #include "../Metadata/FreeImageTag.h"

+-#include "../OpenEXR/Half/half.h"

++#include <OpenEXR/half.h>

+ 

+ #include "FreeImageIO.h"

+ #include "PSDParser.h"

+diff --git a/Source/FreeImage/PluginWebP.cpp b/Source/FreeImage/PluginWebP.cpp
+index 7c9f62f..c401447 100644
+--- a/Source/FreeImage/PluginWebP.cpp
++++ b/Source/FreeImage/PluginWebP.cpp
+@@ -24,9 +24,9 @@
+ 
+ #include "../Metadata/FreeImageTag.h"
+ 
+-#include "../LibWebP/src/webp/decode.h"
+-#include "../LibWebP/src/webp/encode.h"
+-#include "../LibWebP/src/webp/mux.h"
++#include <webp/decode.h>
++#include <webp/encode.h>
++#include <webp/mux.h>
+ 
+ // ==========================================================
+ // Plugin Interface
+diff --git a/Source/FreeImage/ZLibInterface.cpp b/Source/FreeImage/ZLibInterface.cpp
+index 3ab6d32..0973475 100644
+--- a/Source/FreeImage/ZLibInterface.cpp
++++ b/Source/FreeImage/ZLibInterface.cpp
+@@ -19,10 +19,9 @@
+ // Use at your own risk!
+ // ==========================================================
+ 
+-#include "../ZLib/zlib.h"
++#include <zlib.h>
+ #include "FreeImage.h"
+ #include "Utilities.h"
+-#include "../ZLib/zutil.h"	/* must be the last header because of error C3163 in VS2008 (_vsnprintf defined in stdio.h) */
+ 
+ /**
+ Compresses a source buffer into a target buffer, using the ZLib library. 
+@@ -115,7 +114,8 @@ FreeImage_ZLibGZip(BYTE *target, DWORD target_size, BYTE *source, DWORD source_s
+ 			return 0;
+         case Z_OK: {
+             // patch header, setup crc and length (stolen from mod_trace_output)
+-            BYTE *p = target + 8; *p++ = 2; *p = OS_CODE; // xflags, os_code
++            // OS_CODE is 0x03 on unix it seems, not sure how important this is
++            BYTE *p = target + 8; *p++ = 2; *p = 0x03; // xflags, os_code
+  	        crc = crc32(crc, source, source_size);
+ 	        memcpy(target + 4 + dest_len, &crc, 4);
+ 	        memcpy(target + 8 + dest_len, &source_size, 4);
+diff --git a/Source/FreeImageToolkit/JPEGTransform.cpp b/Source/FreeImageToolkit/JPEGTransform.cpp
+index 6f9ba8e..836bc90 100644
+--- a/Source/FreeImageToolkit/JPEGTransform.cpp
++++ b/Source/FreeImageToolkit/JPEGTransform.cpp
+@@ -26,10 +26,10 @@ extern "C" {
+ #undef FAR
+ #include <setjmp.h>
+ 
+-#include "../LibJPEG/jinclude.h"
+-#include "../LibJPEG/jpeglib.h"
+-#include "../LibJPEG/jerror.h"
+-#include "../LibJPEG/transupp.h"
++#include <stdio.h>
++#include <jpeglib.h>
++#include <jerror.h>
++#include <transupp.h>
+ }
+ 
+ #include "FreeImage.h"
+diff --git a/Source/Metadata/XTIFF.cpp b/Source/Metadata/XTIFF.cpp
+index d5be902..b6ecd11 100644
+--- a/Source/Metadata/XTIFF.cpp
++++ b/Source/Metadata/XTIFF.cpp
+@@ -29,7 +29,7 @@
+ #pragma warning (disable : 4786) // identifier was truncated to 'number' characters
+ #endif
+ 
+-#include "../LibTIFF4/tiffiop.h"
++#include <tiffiop.h>
+ 
+ #include "FreeImage.h"
+ #include "Utilities.h"
+diff --git a/fipMakefile.srcs b/fipMakefile.srcs
+index 15ec099..72ba4fb 100644
+--- a/fipMakefile.srcs
++++ b/fipMakefile.srcs
+@@ -1,4 +1,4 @@
+ VER_MAJOR = 3
+ VER_MINOR = 19.0
+-SRCS = ./Source/FreeImage/BitmapAccess.cpp ./Source/FreeImage/ColorLookup.cpp ./Source/FreeImage/ConversionRGBA16.cpp ./Source/FreeImage/ConversionRGBAF.cpp ./Source/FreeImage/FreeImage.cpp ./Source/FreeImage/FreeImageC.c ./Source/FreeImage/FreeImageIO.cpp ./Source/FreeImage/GetType.cpp ./Source/FreeImage/LFPQuantizer.cpp ./Source/FreeImage/MemoryIO.cpp ./Source/FreeImage/PixelAccess.cpp ./Source/FreeImage/J2KHelper.cpp ./Source/FreeImage/MNGHelper.cpp ./Source/FreeImage/Plugin.cpp ./Source/FreeImage/PluginBMP.cpp ./Source/FreeImage/PluginCUT.cpp ./Source/FreeImage/PluginDDS.cpp ./Source/FreeImage/PluginEXR.cpp ./Source/FreeImage/PluginG3.cpp ./Source/FreeImage/PluginGIF.cpp ./Source/FreeImage/PluginHDR.cpp ./Source/FreeImage/PluginICO.cpp ./Source/FreeImage/PluginIFF.cpp ./Source/FreeImage/PluginJ2K.cpp ./Source/FreeImage/PluginJNG.cpp ./Source/FreeImage/PluginJP2.cpp ./Source/FreeImage/PluginJPEG.cpp ./Source/FreeImage/PluginJXR.cpp ./Source/FreeImage/PluginKOALA.cpp ./Source/FreeImage/PluginMNG.cpp ./Source/FreeImage/PluginPCD.cpp ./Source/FreeImage/PluginPCX.cpp ./Source/FreeImage/PluginPFM.cpp ./Source/FreeImage/PluginPICT.cpp ./Source/FreeImage/PluginPNG.cpp ./Source/FreeImage/PluginPNM.cpp ./Source/FreeImage/PluginPSD.cpp ./Source/FreeImage/PluginRAS.cpp ./Source/FreeImage/PluginRAW.cpp ./Source/FreeImage/PluginSGI.cpp ./Source/FreeImage/PluginTARGA.cpp ./Source/FreeImage/PluginTIFF.cpp ./Source/FreeImage/PluginWBMP.cpp ./Source/FreeImage/PluginWebP.cpp ./Source/FreeImage/PluginXBM.cpp ./Source/FreeImage/PluginXPM.cpp ./Source/FreeImage/PSDParser.cpp ./Source/FreeImage/TIFFLogLuv.cpp ./Source/FreeImage/Conversion.cpp ./Source/FreeImage/Conversion16_555.cpp ./Source/FreeImage/Conversion16_565.cpp ./Source/FreeImage/Conversion24.cpp ./Source/FreeImage/Conversion32.cpp ./Source/FreeImage/Conversion4.cpp ./Source/FreeImage/Conversion8.cpp ./Source/FreeImage/ConversionFloat.cpp ./Source/FreeImage/ConversionRGB16.cpp ./Source/FreeImage/ConversionRGBF.cpp ./Source/FreeImage/ConversionType.cpp ./Source/FreeImage/ConversionUINT16.cpp ./Source/FreeImage/Halftoning.cpp ./Source/FreeImage/tmoColorConvert.cpp ./Source/FreeImage/tmoDrago03.cpp ./Source/FreeImage/tmoFattal02.cpp ./Source/FreeImage/tmoReinhard05.cpp ./Source/FreeImage/ToneMapping.cpp ./Source/FreeImage/NNQuantizer.cpp ./Source/FreeImage/WuQuantizer.cpp ./Source/FreeImage/CacheFile.cpp ./Source/FreeImage/MultiPage.cpp ./Source/FreeImage/ZLibInterface.cpp ./Source/Metadata/Exif.cpp ./Source/Metadata/FIRational.cpp ./Source/Metadata/FreeImageTag.cpp ./Source/Metadata/IPTC.cpp ./Source/Metadata/TagConversion.cpp ./Source/Metadata/TagLib.cpp ./Source/Metadata/XTIFF.cpp ./Source/FreeImageToolkit/Background.cpp ./Source/FreeImageToolkit/BSplineRotate.cpp ./Source/FreeImageToolkit/Channels.cpp ./Source/FreeImageToolkit/ClassicRotate.cpp ./Source/FreeImageToolkit/Colors.cpp ./Source/FreeImageToolkit/CopyPaste.cpp ./Source/FreeImageToolkit/Display.cpp ./Source/FreeImageToolkit/Flip.cpp ./Source/FreeImageToolkit/JPEGTransform.cpp ./Source/FreeImageToolkit/MultigridPoissonSolver.cpp ./Source/FreeImageToolkit/Rescale.cpp ./Source/FreeImageToolkit/Resize.cpp Source/LibJPEG/jaricom.c Source/LibJPEG/jcapimin.c Source/LibJPEG/jcapistd.c Source/LibJPEG/jcarith.c Source/LibJPEG/jccoefct.c Source/LibJPEG/jccolor.c Source/LibJPEG/jcdctmgr.c Source/LibJPEG/jchuff.c Source/LibJPEG/jcinit.c Source/LibJPEG/jcmainct.c Source/LibJPEG/jcmarker.c Source/LibJPEG/jcmaster.c Source/LibJPEG/jcomapi.c Source/LibJPEG/jcparam.c Source/LibJPEG/jcprepct.c Source/LibJPEG/jcsample.c Source/LibJPEG/jctrans.c Source/LibJPEG/jdapimin.c Source/LibJPEG/jdapistd.c Source/LibJPEG/jdarith.c Source/LibJPEG/jdatadst.c Source/LibJPEG/jdatasrc.c Source/LibJPEG/jdcoefct.c Source/LibJPEG/jdcolor.c Source/LibJPEG/jddctmgr.c Source/LibJPEG/jdhuff.c Source/LibJPEG/jdinput.c Source/LibJPEG/jdmainct.c Source/LibJPEG/jdmarker.c Source/LibJPEG/jdmaster.c Source/LibJPEG/jdmerge.c Source/LibJPEG/jdpostct.c Source/LibJPEG/jdsample.c Source/LibJPEG/jdtrans.c Source/LibJPEG/jerror.c Source/LibJPEG/jfdctflt.c Source/LibJPEG/jfdctfst.c Source/LibJPEG/jfdctint.c Source/LibJPEG/jidctflt.c Source/LibJPEG/jidctfst.c Source/LibJPEG/jidctint.c Source/LibJPEG/jmemmgr.c Source/LibJPEG/jmemnobs.c Source/LibJPEG/jquant1.c Source/LibJPEG/jquant2.c Source/LibJPEG/jutils.c Source/LibJPEG/transupp.c Source/LibPNG/png.c Source/LibPNG/pngerror.c Source/LibPNG/pngget.c Source/LibPNG/pngmem.c Source/LibPNG/pngpread.c Source/LibPNG/pngread.c Source/LibPNG/pngrio.c Source/LibPNG/pngrtran.c Source/LibPNG/pngrutil.c Source/LibPNG/pngset.c Source/LibPNG/pngtrans.c Source/LibPNG/pngwio.c Source/LibPNG/pngwrite.c Source/LibPNG/pngwtran.c Source/LibPNG/pngwutil.c Source/LibTIFF4/tif_aux.c Source/LibTIFF4/tif_close.c Source/LibTIFF4/tif_codec.c Source/LibTIFF4/tif_color.c Source/LibTIFF4/tif_compress.c Source/LibTIFF4/tif_dir.c Source/LibTIFF4/tif_dirinfo.c Source/LibTIFF4/tif_dirread.c Source/LibTIFF4/tif_dirwrite.c Source/LibTIFF4/tif_dumpmode.c Source/LibTIFF4/tif_error.c Source/LibTIFF4/tif_extension.c Source/LibTIFF4/tif_fax3.c Source/LibTIFF4/tif_fax3sm.c Source/LibTIFF4/tif_flush.c Source/LibTIFF4/tif_getimage.c Source/LibTIFF4/tif_jpeg.c Source/LibTIFF4/tif_luv.c Source/LibTIFF4/tif_lzma.c Source/LibTIFF4/tif_lzw.c Source/LibTIFF4/tif_next.c Source/LibTIFF4/tif_ojpeg.c Source/LibTIFF4/tif_open.c Source/LibTIFF4/tif_packbits.c Source/LibTIFF4/tif_pixarlog.c Source/LibTIFF4/tif_predict.c Source/LibTIFF4/tif_print.c Source/LibTIFF4/tif_read.c Source/LibTIFF4/tif_strip.c Source/LibTIFF4/tif_swab.c Source/LibTIFF4/tif_thunder.c Source/LibTIFF4/tif_tile.c Source/LibTIFF4/tif_version.c Source/LibTIFF4/tif_warning.c Source/LibTIFF4/tif_write.c Source/LibTIFF4/tif_zip.c Source/ZLib/adler32.c Source/ZLib/compress.c Source/ZLib/crc32.c Source/ZLib/deflate.c Source/ZLib/gzclose.c Source/ZLib/gzlib.c Source/ZLib/gzread.c Source/ZLib/gzwrite.c Source/ZLib/infback.c Source/ZLib/inffast.c Source/ZLib/inflate.c Source/ZLib/inftrees.c Source/ZLib/trees.c Source/ZLib/uncompr.c Source/ZLib/zutil.c Source/LibOpenJPEG/bio.c Source/LibOpenJPEG/cio.c Source/LibOpenJPEG/dwt.c Source/LibOpenJPEG/event.c Source/LibOpenJPEG/function_list.c Source/LibOpenJPEG/image.c Source/LibOpenJPEG/invert.c Source/LibOpenJPEG/j2k.c Source/LibOpenJPEG/jp2.c Source/LibOpenJPEG/mct.c Source/LibOpenJPEG/mqc.c Source/LibOpenJPEG/openjpeg.c Source/LibOpenJPEG/opj_clock.c Source/LibOpenJPEG/pi.c Source/LibOpenJPEG/raw.c Source/LibOpenJPEG/t1.c Source/LibOpenJPEG/t2.c Source/LibOpenJPEG/tcd.c Source/LibOpenJPEG/tgt.c Source/OpenEXR/IexMath/IexMathFpu.cpp Source/OpenEXR/IlmImf/b44ExpLogTable.cpp Source/OpenEXR/IlmImf/ImfAcesFile.cpp Source/OpenEXR/IlmImf/ImfAttribute.cpp Source/OpenEXR/IlmImf/ImfB44Compressor.cpp Source/OpenEXR/IlmImf/ImfBoxAttribute.cpp Source/OpenEXR/IlmImf/ImfChannelList.cpp Source/OpenEXR/IlmImf/ImfChannelListAttribute.cpp Source/OpenEXR/IlmImf/ImfChromaticities.cpp Source/OpenEXR/IlmImf/ImfChromaticitiesAttribute.cpp Source/OpenEXR/IlmImf/ImfCompositeDeepScanLine.cpp Source/OpenEXR/IlmImf/ImfCompressionAttribute.cpp Source/OpenEXR/IlmImf/ImfCompressor.cpp Source/OpenEXR/IlmImf/ImfConvert.cpp Source/OpenEXR/IlmImf/ImfCRgbaFile.cpp Source/OpenEXR/IlmImf/ImfDeepCompositing.cpp Source/OpenEXR/IlmImf/ImfDeepFrameBuffer.cpp Source/OpenEXR/IlmImf/ImfDeepImageStateAttribute.cpp Source/OpenEXR/IlmImf/ImfDeepScanLineInputFile.cpp Source/OpenEXR/IlmImf/ImfDeepScanLineInputPart.cpp Source/OpenEXR/IlmImf/ImfDeepScanLineOutputFile.cpp Source/OpenEXR/IlmImf/ImfDeepScanLineOutputPart.cpp Source/OpenEXR/IlmImf/ImfDeepTiledInputFile.cpp Source/OpenEXR/IlmImf/ImfDeepTiledInputPart.cpp Source/OpenEXR/IlmImf/ImfDeepTiledOutputFile.cpp Source/OpenEXR/IlmImf/ImfDeepTiledOutputPart.cpp Source/OpenEXR/IlmImf/ImfDoubleAttribute.cpp Source/OpenEXR/IlmImf/ImfDwaCompressor.cpp Source/OpenEXR/IlmImf/ImfEnvmap.cpp Source/OpenEXR/IlmImf/ImfEnvmapAttribute.cpp Source/OpenEXR/IlmImf/ImfFastHuf.cpp Source/OpenEXR/IlmImf/ImfFloatAttribute.cpp Source/OpenEXR/IlmImf/ImfFloatVectorAttribute.cpp Source/OpenEXR/IlmImf/ImfFrameBuffer.cpp Source/OpenEXR/IlmImf/ImfFramesPerSecond.cpp Source/OpenEXR/IlmImf/ImfGenericInputFile.cpp Source/OpenEXR/IlmImf/ImfGenericOutputFile.cpp Source/OpenEXR/IlmImf/ImfHeader.cpp Source/OpenEXR/IlmImf/ImfHuf.cpp Source/OpenEXR/IlmImf/ImfInputFile.cpp Source/OpenEXR/IlmImf/ImfInputPart.cpp Source/OpenEXR/IlmImf/ImfInputPartData.cpp Source/OpenEXR/IlmImf/ImfIntAttribute.cpp Source/OpenEXR/IlmImf/ImfIO.cpp Source/OpenEXR/IlmImf/ImfKeyCode.cpp Source/OpenEXR/IlmImf/ImfKeyCodeAttribute.cpp Source/OpenEXR/IlmImf/ImfLineOrderAttribute.cpp Source/OpenEXR/IlmImf/ImfLut.cpp Source/OpenEXR/IlmImf/ImfMatrixAttribute.cpp Source/OpenEXR/IlmImf/ImfMisc.cpp Source/OpenEXR/IlmImf/ImfMultiPartInputFile.cpp Source/OpenEXR/IlmImf/ImfMultiPartOutputFile.cpp Source/OpenEXR/IlmImf/ImfMultiView.cpp Source/OpenEXR/IlmImf/ImfOpaqueAttribute.cpp Source/OpenEXR/IlmImf/ImfOutputFile.cpp Source/OpenEXR/IlmImf/ImfOutputPart.cpp Source/OpenEXR/IlmImf/ImfOutputPartData.cpp Source/OpenEXR/IlmImf/ImfPartType.cpp Source/OpenEXR/IlmImf/ImfPizCompressor.cpp Source/OpenEXR/IlmImf/ImfPreviewImage.cpp Source/OpenEXR/IlmImf/ImfPreviewImageAttribute.cpp Source/OpenEXR/IlmImf/ImfPxr24Compressor.cpp Source/OpenEXR/IlmImf/ImfRational.cpp Source/OpenEXR/IlmImf/ImfRationalAttribute.cpp Source/OpenEXR/IlmImf/ImfRgbaFile.cpp Source/OpenEXR/IlmImf/ImfRgbaYca.cpp Source/OpenEXR/IlmImf/ImfRle.cpp Source/OpenEXR/IlmImf/ImfRleCompressor.cpp Source/OpenEXR/IlmImf/ImfScanLineInputFile.cpp Source/OpenEXR/IlmImf/ImfStandardAttributes.cpp Source/OpenEXR/IlmImf/ImfStdIO.cpp Source/OpenEXR/IlmImf/ImfStringAttribute.cpp Source/OpenEXR/IlmImf/ImfStringVectorAttribute.cpp Source/OpenEXR/IlmImf/ImfSystemSpecific.cpp Source/OpenEXR/IlmImf/ImfTestFile.cpp Source/OpenEXR/IlmImf/ImfThreading.cpp Source/OpenEXR/IlmImf/ImfTileDescriptionAttribute.cpp Source/OpenEXR/IlmImf/ImfTiledInputFile.cpp Source/OpenEXR/IlmImf/ImfTiledInputPart.cpp Source/OpenEXR/IlmImf/ImfTiledMisc.cpp Source/OpenEXR/IlmImf/ImfTiledOutputFile.cpp Source/OpenEXR/IlmImf/ImfTiledOutputPart.cpp Source/OpenEXR/IlmImf/ImfTiledRgbaFile.cpp Source/OpenEXR/IlmImf/ImfTileOffsets.cpp Source/OpenEXR/IlmImf/ImfTimeCode.cpp Source/OpenEXR/IlmImf/ImfTimeCodeAttribute.cpp Source/OpenEXR/IlmImf/ImfVecAttribute.cpp Source/OpenEXR/IlmImf/ImfVersion.cpp Source/OpenEXR/IlmImf/ImfWav.cpp Source/OpenEXR/IlmImf/ImfZip.cpp Source/OpenEXR/IlmImf/ImfZipCompressor.cpp Source/OpenEXR/Imath/ImathBox.cpp Source/OpenEXR/Imath/ImathColorAlgo.cpp Source/OpenEXR/Imath/ImathFun.cpp Source/OpenEXR/Imath/ImathMatrixAlgo.cpp Source/OpenEXR/Imath/ImathRandom.cpp Source/OpenEXR/Imath/ImathShear.cpp Source/OpenEXR/Imath/ImathVec.cpp Source/OpenEXR/Iex/IexBaseExc.cpp Source/OpenEXR/Iex/IexThrowErrnoExc.cpp Source/OpenEXR/Half/half.cpp Source/OpenEXR/IlmThread/IlmThread.cpp Source/OpenEXR/IlmThread/IlmThreadMutex.cpp Source/OpenEXR/IlmThread/IlmThreadPool.cpp Source/OpenEXR/IlmThread/IlmThreadSemaphore.cpp Source/OpenEXR/IexMath/IexMathFloatExc.cpp Source/LibRawLite/internal/dcraw_common.cpp Source/LibRawLite/internal/dcraw_fileio.cpp Source/LibRawLite/internal/demosaic_packs.cpp Source/LibRawLite/src/libraw_c_api.cpp Source/LibRawLite/src/libraw_cxx.cpp Source/LibRawLite/src/libraw_datastream.cpp Source/LibWebP/src/dec/alpha_dec.c Source/LibWebP/src/dec/buffer_dec.c Source/LibWebP/src/dec/frame_dec.c Source/LibWebP/src/dec/idec_dec.c Source/LibWebP/src/dec/io_dec.c Source/LibWebP/src/dec/quant_dec.c Source/LibWebP/src/dec/tree_dec.c Source/LibWebP/src/dec/vp8l_dec.c Source/LibWebP/src/dec/vp8_dec.c Source/LibWebP/src/dec/webp_dec.c Source/LibWebP/src/demux/anim_decode.c Source/LibWebP/src/demux/demux.c Source/LibWebP/src/dsp/alpha_processing.c Source/LibWebP/src/dsp/alpha_processing_mips_dsp_r2.c Source/LibWebP/src/dsp/alpha_processing_neon.c Source/LibWebP/src/dsp/alpha_processing_sse2.c Source/LibWebP/src/dsp/alpha_processing_sse41.c Source/LibWebP/src/dsp/cost.c Source/LibWebP/src/dsp/cost_mips32.c Source/LibWebP/src/dsp/cost_mips_dsp_r2.c Source/LibWebP/src/dsp/cost_neon.c Source/LibWebP/src/dsp/cost_sse2.c Source/LibWebP/src/dsp/cpu.c Source/LibWebP/src/dsp/dec.c Source/LibWebP/src/dsp/dec_clip_tables.c Source/LibWebP/src/dsp/dec_mips32.c Source/LibWebP/src/dsp/dec_mips_dsp_r2.c Source/LibWebP/src/dsp/dec_msa.c Source/LibWebP/src/dsp/dec_neon.c Source/LibWebP/src/dsp/dec_sse2.c Source/LibWebP/src/dsp/dec_sse41.c Source/LibWebP/src/dsp/enc.c Source/LibWebP/src/dsp/enc_avx2.c Source/LibWebP/src/dsp/enc_mips32.c Source/LibWebP/src/dsp/enc_mips_dsp_r2.c Source/LibWebP/src/dsp/enc_msa.c Source/LibWebP/src/dsp/enc_neon.c Source/LibWebP/src/dsp/enc_sse2.c Source/LibWebP/src/dsp/enc_sse41.c Source/LibWebP/src/dsp/filters.c Source/LibWebP/src/dsp/filters_mips_dsp_r2.c Source/LibWebP/src/dsp/filters_msa.c Source/LibWebP/src/dsp/filters_neon.c Source/LibWebP/src/dsp/filters_sse2.c Source/LibWebP/src/dsp/lossless.c Source/LibWebP/src/dsp/lossless_enc.c Source/LibWebP/src/dsp/lossless_enc_mips32.c Source/LibWebP/src/dsp/lossless_enc_mips_dsp_r2.c Source/LibWebP/src/dsp/lossless_enc_msa.c Source/LibWebP/src/dsp/lossless_enc_neon.c Source/LibWebP/src/dsp/lossless_enc_sse2.c Source/LibWebP/src/dsp/lossless_enc_sse41.c Source/LibWebP/src/dsp/lossless_mips_dsp_r2.c Source/LibWebP/src/dsp/lossless_msa.c Source/LibWebP/src/dsp/lossless_neon.c Source/LibWebP/src/dsp/lossless_sse2.c Source/LibWebP/src/dsp/rescaler.c Source/LibWebP/src/dsp/rescaler_mips32.c Source/LibWebP/src/dsp/rescaler_mips_dsp_r2.c Source/LibWebP/src/dsp/rescaler_msa.c Source/LibWebP/src/dsp/rescaler_neon.c Source/LibWebP/src/dsp/rescaler_sse2.c Source/LibWebP/src/dsp/ssim.c Source/LibWebP/src/dsp/ssim_sse2.c Source/LibWebP/src/dsp/upsampling.c Source/LibWebP/src/dsp/upsampling_mips_dsp_r2.c Source/LibWebP/src/dsp/upsampling_msa.c Source/LibWebP/src/dsp/upsampling_neon.c Source/LibWebP/src/dsp/upsampling_sse2.c Source/LibWebP/src/dsp/upsampling_sse41.c Source/LibWebP/src/dsp/yuv.c Source/LibWebP/src/dsp/yuv_mips32.c Source/LibWebP/src/dsp/yuv_mips_dsp_r2.c Source/LibWebP/src/dsp/yuv_neon.c Source/LibWebP/src/dsp/yuv_sse2.c Source/LibWebP/src/dsp/yuv_sse41.c Source/LibWebP/src/enc/alpha_enc.c Source/LibWebP/src/enc/analysis_enc.c Source/LibWebP/src/enc/backward_references_cost_enc.c Source/LibWebP/src/enc/backward_references_enc.c Source/LibWebP/src/enc/config_enc.c Source/LibWebP/src/enc/cost_enc.c Source/LibWebP/src/enc/filter_enc.c Source/LibWebP/src/enc/frame_enc.c Source/LibWebP/src/enc/histogram_enc.c Source/LibWebP/src/enc/iterator_enc.c Source/LibWebP/src/enc/near_lossless_enc.c Source/LibWebP/src/enc/picture_csp_enc.c Source/LibWebP/src/enc/picture_enc.c Source/LibWebP/src/enc/picture_psnr_enc.c Source/LibWebP/src/enc/picture_rescale_enc.c Source/LibWebP/src/enc/picture_tools_enc.c Source/LibWebP/src/enc/predictor_enc.c Source/LibWebP/src/enc/quant_enc.c Source/LibWebP/src/enc/syntax_enc.c Source/LibWebP/src/enc/token_enc.c Source/LibWebP/src/enc/tree_enc.c Source/LibWebP/src/enc/vp8l_enc.c Source/LibWebP/src/enc/webp_enc.c Source/LibWebP/src/mux/anim_encode.c Source/LibWebP/src/mux/muxedit.c Source/LibWebP/src/mux/muxinternal.c Source/LibWebP/src/mux/muxread.c Source/LibWebP/src/utils/bit_reader_utils.c Source/LibWebP/src/utils/bit_writer_utils.c Source/LibWebP/src/utils/color_cache_utils.c Source/LibWebP/src/utils/filters_utils.c Source/LibWebP/src/utils/huffman_encode_utils.c Source/LibWebP/src/utils/huffman_utils.c Source/LibWebP/src/utils/quant_levels_dec_utils.c Source/LibWebP/src/utils/quant_levels_utils.c Source/LibWebP/src/utils/random_utils.c Source/LibWebP/src/utils/rescaler_utils.c Source/LibWebP/src/utils/thread_utils.c Source/LibWebP/src/utils/utils.c Source/LibJXR/image/decode/decode.c Source/LibJXR/image/decode/JXRTranscode.c Source/LibJXR/image/decode/postprocess.c Source/LibJXR/image/decode/segdec.c Source/LibJXR/image/decode/strdec.c Source/LibJXR/image/decode/strdec_x86.c Source/LibJXR/image/decode/strInvTransform.c Source/LibJXR/image/decode/strPredQuantDec.c Source/LibJXR/image/encode/encode.c Source/LibJXR/image/encode/segenc.c Source/LibJXR/image/encode/strenc.c Source/LibJXR/image/encode/strenc_x86.c Source/LibJXR/image/encode/strFwdTransform.c Source/LibJXR/image/encode/strPredQuantEnc.c Source/LibJXR/image/sys/adapthuff.c Source/LibJXR/image/sys/image.c Source/LibJXR/image/sys/strcodec.c Source/LibJXR/image/sys/strPredQuant.c Source/LibJXR/image/sys/strTransform.c Source/LibJXR/jxrgluelib/JXRGlue.c Source/LibJXR/jxrgluelib/JXRGlueJxr.c Source/LibJXR/jxrgluelib/JXRGluePFC.c Source/LibJXR/jxrgluelib/JXRMeta.c Wrapper/FreeImagePlus/src/fipImage.cpp Wrapper/FreeImagePlus/src/fipMemoryIO.cpp Wrapper/FreeImagePlus/src/fipMetadataFind.cpp Wrapper/FreeImagePlus/src/fipMultiPage.cpp Wrapper/FreeImagePlus/src/fipTag.cpp Wrapper/FreeImagePlus/src/fipWinImage.cpp Wrapper/FreeImagePlus/src/FreeImagePlus.cpp 
+-INCLUDE = -I. -ISource -ISource/Metadata -ISource/FreeImageToolkit -ISource/LibJPEG -ISource/LibPNG -ISource/LibTIFF4 -ISource/ZLib -ISource/LibOpenJPEG -ISource/OpenEXR -ISource/OpenEXR/Half -ISource/OpenEXR/Iex -ISource/OpenEXR/IlmImf -ISource/OpenEXR/IlmThread -ISource/OpenEXR/Imath -ISource/OpenEXR/IexMath -ISource/LibRawLite -ISource/LibRawLite/dcraw -ISource/LibRawLite/internal -ISource/LibRawLite/libraw -ISource/LibRawLite/src -ISource/LibWebP -ISource/LibJXR -ISource/LibJXR/common/include -ISource/LibJXR/image/sys -ISource/LibJXR/jxrgluelib -IWrapper/FreeImagePlus
++SRCS = ./Source/FreeImage/BitmapAccess.cpp ./Source/FreeImage/ColorLookup.cpp ./Source/FreeImage/ConversionRGBA16.cpp ./Source/FreeImage/ConversionRGBAF.cpp ./Source/FreeImage/FreeImage.cpp ./Source/FreeImage/FreeImageC.c ./Source/FreeImage/FreeImageIO.cpp ./Source/FreeImage/GetType.cpp ./Source/FreeImage/LFPQuantizer.cpp ./Source/FreeImage/MemoryIO.cpp ./Source/FreeImage/PixelAccess.cpp ./Source/FreeImage/J2KHelper.cpp ./Source/FreeImage/MNGHelper.cpp ./Source/FreeImage/Plugin.cpp ./Source/FreeImage/PluginBMP.cpp ./Source/FreeImage/PluginCUT.cpp ./Source/FreeImage/PluginDDS.cpp ./Source/FreeImage/PluginEXR.cpp ./Source/FreeImage/PluginG3.cpp ./Source/FreeImage/PluginGIF.cpp ./Source/FreeImage/PluginHDR.cpp ./Source/FreeImage/PluginICO.cpp ./Source/FreeImage/PluginIFF.cpp ./Source/FreeImage/PluginJ2K.cpp ./Source/FreeImage/PluginJNG.cpp ./Source/FreeImage/PluginJP2.cpp ./Source/FreeImage/PluginJPEG.cpp ./Source/FreeImage/PluginJXR.cpp ./Source/FreeImage/PluginKOALA.cpp ./Source/FreeImage/PluginMNG.cpp ./Source/FreeImage/PluginPCD.cpp ./Source/FreeImage/PluginPCX.cpp ./Source/FreeImage/PluginPFM.cpp ./Source/FreeImage/PluginPICT.cpp ./Source/FreeImage/PluginPNG.cpp ./Source/FreeImage/PluginPNM.cpp ./Source/FreeImage/PluginPSD.cpp ./Source/FreeImage/PluginRAS.cpp ./Source/FreeImage/PluginRAW.cpp ./Source/FreeImage/PluginSGI.cpp ./Source/FreeImage/PluginTARGA.cpp ./Source/FreeImage/PluginTIFF.cpp ./Source/FreeImage/PluginWBMP.cpp ./Source/FreeImage/PluginWebP.cpp ./Source/FreeImage/PluginXBM.cpp ./Source/FreeImage/PluginXPM.cpp ./Source/FreeImage/PSDParser.cpp ./Source/FreeImage/TIFFLogLuv.cpp ./Source/FreeImage/Conversion.cpp ./Source/FreeImage/Conversion16_555.cpp ./Source/FreeImage/Conversion16_565.cpp ./Source/FreeImage/Conversion24.cpp ./Source/FreeImage/Conversion32.cpp ./Source/FreeImage/Conversion4.cpp ./Source/FreeImage/Conversion8.cpp ./Source/FreeImage/ConversionFloat.cpp ./Source/FreeImage/ConversionRGB16.cpp ./Source/FreeImage/ConversionRGBF.cpp ./Source/FreeImage/ConversionType.cpp ./Source/FreeImage/ConversionUINT16.cpp ./Source/FreeImage/Halftoning.cpp ./Source/FreeImage/tmoColorConvert.cpp ./Source/FreeImage/tmoDrago03.cpp ./Source/FreeImage/tmoFattal02.cpp ./Source/FreeImage/tmoReinhard05.cpp ./Source/FreeImage/ToneMapping.cpp ./Source/FreeImage/NNQuantizer.cpp ./Source/FreeImage/WuQuantizer.cpp ./Source/FreeImage/CacheFile.cpp ./Source/FreeImage/MultiPage.cpp ./Source/FreeImage/ZLibInterface.cpp ./Source/Metadata/Exif.cpp ./Source/Metadata/FIRational.cpp ./Source/Metadata/FreeImageTag.cpp ./Source/Metadata/IPTC.cpp ./Source/Metadata/TagConversion.cpp ./Source/Metadata/TagLib.cpp ./Source/Metadata/XTIFF.cpp ./Source/FreeImageToolkit/Background.cpp ./Source/FreeImageToolkit/BSplineRotate.cpp ./Source/FreeImageToolkit/Channels.cpp ./Source/FreeImageToolkit/ClassicRotate.cpp ./Source/FreeImageToolkit/Colors.cpp ./Source/FreeImageToolkit/CopyPaste.cpp ./Source/FreeImageToolkit/Display.cpp ./Source/FreeImageToolkit/Flip.cpp ./Source/FreeImageToolkit/JPEGTransform.cpp ./Source/FreeImageToolkit/MultigridPoissonSolver.cpp ./Source/FreeImageToolkit/Rescale.cpp ./Source/FreeImageToolkit/Resize.cpp Wrapper/FreeImagePlus/src/fipImage.cpp Wrapper/FreeImagePlus/src/fipMemoryIO.cpp Wrapper/FreeImagePlus/src/fipMetadataFind.cpp Wrapper/FreeImagePlus/src/fipMultiPage.cpp Wrapper/FreeImagePlus/src/fipTag.cpp Wrapper/FreeImagePlus/src/fipWinImage.cpp Wrapper/FreeImagePlus/src/FreeImagePlus.cpp 
++INCLUDE = -I. -ISource -ISource/Metadata -ISource/FreeImageToolkit -IWrapper/FreeImagePlus
diff --git a/nixpkgs/pkgs/development/libraries/freenect/default.nix b/nixpkgs/pkgs/development/libraries/freenect/default.nix
new file mode 100644
index 000000000000..0e96a346f418
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/freenect/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, lib, fetchFromGitHub, cmake, libusb1, pkg-config, freeglut, libGLU, libGL, libXi, libXmu
+, GLUT, Cocoa
+ }:
+
+stdenv.mkDerivation rec {
+  pname = "freenect";
+  version = "0.6.2";
+
+  src = fetchFromGitHub {
+    owner = "OpenKinect";
+    repo = "libfreenect";
+    rev = "v${version}";
+    sha256 = "sha256-/CR+r9/zMj+8gxhHeRGPCDhALeF5bLsea38KQ1lF6wo=";
+  };
+
+  buildInputs = [ libusb1 freeglut libGLU libGL libXi libXmu ]
+    ++ lib.optionals stdenv.isDarwin [ GLUT Cocoa ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  meta = {
+    description = "Drivers and libraries for the Xbox Kinect device on Windows, Linux, and macOS";
+    homepage = "http://openkinect.org";
+    license = with lib.licenses; [ gpl2 asl20 ];
+    maintainers = with lib.maintainers; [ bennofs ];
+    platforms = with lib.platforms; linux ++ darwin ;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/freetds/default.nix b/nixpkgs/pkgs/development/libraries/freetds/default.nix
new file mode 100644
index 000000000000..b79fb2fd06dc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/freetds/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config
+, openssl
+, odbcSupport ? true, unixODBC ? null }:
+
+assert odbcSupport -> unixODBC != null;
+
+# Work is in progress to move to cmake so revisit that later
+
+stdenv.mkDerivation rec {
+  pname = "freetds";
+  version = "1.3";
+
+  src = fetchurl {
+    url    = "https://www.freetds.org/files/stable/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-j5ecrU2DUJBubDZF9wRxr0eNCHWe2TzToxQn8HkrX5c=";
+  };
+
+  buildInputs = [
+    openssl
+  ] ++ lib.optional odbcSupport unixODBC;
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  meta = with lib; {
+    description = "Libraries to natively talk to Microsoft SQL Server and Sybase databases";
+    homepage    = "https://www.freetds.org";
+    license     = licenses.lgpl2;
+    maintainers = with maintainers; [ peterhoeg ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/freetts/default.nix b/nixpkgs/pkgs/development/libraries/freetts/default.nix
new file mode 100644
index 000000000000..06535c087dc6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/freetts/default.nix
@@ -0,0 +1,39 @@
+{stdenv, fetchurl, apacheAnt, unzip, sharutils, lib, jdk}:
+
+stdenv.mkDerivation rec {
+  pname = "freetts";
+  version = "1.2.2";
+  src = fetchurl {
+    url = "mirror://sourceforge/freetts/${pname}-${version}-src.zip";
+    sha256 = "0mnikqhpf4f4jdr0irmibr8yy0dnffx1i257y22iamxi7a6by2r7";
+  };
+  nativeBuildInputs = [ unzip ];
+  buildInputs = [ apacheAnt sharutils jdk ];
+  unpackPhase = ''
+    unzip $src -x META-INF/*
+  '';
+
+  buildPhase = ''
+    cd */lib
+    sed -i -e "s/more/cat/" jsapi.sh
+    echo y | sh jsapi.sh
+    cd ..
+    ln -s . src
+    ant
+  '';
+  installPhase = ''
+    install -v -m755 -d $out/{lib,docs/{audio,images}}
+    install -v -m644 lib/*.jar $out/lib
+  '';
+
+  meta = {
+    description = "Text to speech system based on Festival written in Java";
+    longDescription = ''
+      Text to speech system based on Festival written in Java.
+      Can be used in combination with KDE accessibility.
+    '';
+    license = "GPL";
+    homepage = "http://freetts.sourceforge.net";
+    maintainers = [ lib.maintainers.sander ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/freetype/default.nix b/nixpkgs/pkgs/development/libraries/freetype/default.nix
new file mode 100644
index 000000000000..6c66561f29f2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/freetype/default.nix
@@ -0,0 +1,69 @@
+{ lib, stdenv, fetchurl
+, buildPackages, pkgsHostHost
+, pkg-config, which, makeWrapper
+, zlib, bzip2, libpng, gnumake, glib
+
+, # FreeType supports LCD filtering (colloquially referred to as sub-pixel rendering).
+  # LCD filtering is also known as ClearType and covered by several Microsoft patents.
+  # This option allows it to be disabled. See http://www.freetype.org/patents.html.
+  useEncumberedCode ? true
+}:
+
+
+stdenv.mkDerivation rec {
+  pname = "freetype";
+  version = "2.11.0";
+
+  src = fetchurl {
+    url = "mirror://savannah/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-i+45vTloxIBLcGFKCjrVlyma0OgkvIqtXOiq9IBnvec=";
+  };
+
+  propagatedBuildInputs = [ zlib bzip2 libpng ]; # needed when linking against freetype
+
+  # dependence on harfbuzz is looser than the reverse dependence
+  nativeBuildInputs = [ pkg-config which makeWrapper ]
+    # FreeType requires GNU Make, which is not part of stdenv on FreeBSD.
+    ++ lib.optional (!stdenv.isLinux) gnumake;
+
+  patches = [
+    ./enable-table-validation.patch
+  ] ++ lib.optional useEncumberedCode ./enable-subpixel-rendering.patch;
+
+  outputs = [ "out" "dev" ];
+
+  configureFlags = [ "--bindir=$(dev)/bin" "--enable-freetype-config" ];
+
+  # native compiler to generate building tool
+  CC_BUILD = "${buildPackages.stdenv.cc}/bin/cc";
+
+  # The asm for armel is written with the 'asm' keyword.
+  CFLAGS = lib.optionalString stdenv.isAarch32 "-std=gnu99";
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  postInstall = glib.flattenInclude + ''
+    substituteInPlace $dev/bin/freetype-config \
+      --replace ${buildPackages.pkg-config} ${pkgsHostHost.pkg-config}
+
+    wrapProgram "$dev/bin/freetype-config" \
+      --set PKG_CONFIG_PATH "$PKG_CONFIG_PATH:$dev/lib/pkgconfig"
+  '';
+
+  meta = with lib; {
+    description = "A font rendering engine";
+    longDescription = ''
+      FreeType is a portable and efficient library for rendering fonts. It
+      supports TrueType, Type 1, CFF fonts, and WOFF, PCF, FNT, BDF and PFR
+      fonts. It has a bytecode interpreter and has an automatic hinter called
+      autofit which can be used instead of hinting instructions included in
+      fonts.
+    '';
+    homepage = "https://www.freetype.org/";
+    license = licenses.gpl2Plus; # or the FreeType License (BSD + advertising clause)
+    platforms = platforms.all;
+    maintainers = with maintainers; [ ttuegel ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/freetype/enable-subpixel-rendering.patch b/nixpkgs/pkgs/development/libraries/freetype/enable-subpixel-rendering.patch
new file mode 100644
index 000000000000..6b3577eb4f02
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/freetype/enable-subpixel-rendering.patch
@@ -0,0 +1,12 @@
+Index: freetype-2.10.0/include/freetype/config/ftoption.h
+--- a/include/freetype/config/ftoption.h
++++ b/include/freetype/config/ftoption.h
+@@ -126,7 +126,7 @@ FT_BEGIN_HEADER
+    * macro is not defined, FreeType offers alternative LCD rendering
+    * technology that produces excellent output without LCD filtering.
+    */
+-/* #define FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
++#define FT_CONFIG_OPTION_SUBPIXEL_RENDERING
+ 
+ 
+   /**************************************************************************
diff --git a/nixpkgs/pkgs/development/libraries/freetype/enable-table-validation.patch b/nixpkgs/pkgs/development/libraries/freetype/enable-table-validation.patch
new file mode 100644
index 000000000000..bd964c3342d8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/freetype/enable-table-validation.patch
@@ -0,0 +1,20 @@
+Index: freetype-2.10.0/modules.cfg
+===================================================================
+--- freetype-2.10.0.orig/modules.cfg
++++ freetype-2.10.0/modules.cfg
+@@ -120,6 +120,6 @@ AUX_MODULES += cache
+ # TrueType GX/AAT table validation.  Needs ftgxval.c below.
+ #
+-# AUX_MODULES += gxvalid
++AUX_MODULES += gxvalid
+ 
+ # Support for streams compressed with gzip (files with suffix .gz).
+ #
+@@ -143,6 +143,6 @@ AUX_MODULES += bzip2
+ # OpenType table validation.  Needs ftotval.c below.
+ #
+-# AUX_MODULES += otvalid
++AUX_MODULES += otvalid
+ 
+ # Auxiliary PostScript driver component to share common code.
+ #
diff --git a/nixpkgs/pkgs/development/libraries/frei0r/default.nix b/nixpkgs/pkgs/development/libraries/frei0r/default.nix
new file mode 100644
index 000000000000..ac2c43ce8dbb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/frei0r/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchurl, fetchpatch, cairo, cmake, opencv, pcre, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "frei0r-plugins";
+  version = "1.7.0";
+
+  src = fetchurl {
+    url = "https://files.dyne.org/frei0r/releases/${pname}-${version}.tar.gz";
+    hash = "sha256-Gx/48Pm8I+7XJOlOmnwdjwJEv+M0JLtP5o5kYMCIUjo=";
+  };
+
+  # A PR to add support for OpenCV 4 was merged in May 2020. This
+  # patch can be removed when a release beyond 1.7.0 is issued.
+  patches = [
+    (fetchpatch {
+      name = "opencv4-support.patch";
+      url = "https://github.com/dyne/frei0r/commit/c0c8eed79fc8abe6c9881a53d7391efb526a3064.patch";
+      sha256 = "sha256-qxUAui4EEBEj8M/SoyMUkj//KegMTTT6FTBDC/Chxz4=";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ cairo opencv pcre ];
+
+  postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
+    for f in $out/lib/frei0r-1/*.so* ; do
+      ln -s $f "''${f%.*}.dylib"
+    done
+  '';
+
+  meta = with lib; {
+    homepage = "https://frei0r.dyne.org";
+    description = "Minimalist, cross-platform, shared video plugins";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux ++ platforms.darwin;
+
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fribidi/default.nix b/nixpkgs/pkgs/development/libraries/fribidi/default.nix
new file mode 100644
index 000000000000..27f3b825d10a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fribidi/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv
+, buildPackages
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, fixDarwinDylibNames
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "fribidi";
+  version = "1.0.10";
+
+  outputs = [ "out" "devdoc" ];
+
+  # 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.xz";
+    sha256 = "009wcpgk4jj5x52skjkfs6xar6x38mcngs75rb59nj9ig1y6h73z";
+  };
+
+  postPatch = ''
+    patchShebangs test
+  '';
+
+  nativeBuildInputs = [ meson ninja pkg-config ]
+    ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+
+  doCheck = true;
+  checkInputs = [ python3 ];
+
+  meta = with lib; {
+    homepage = "https://github.com/fribidi/fribidi";
+    description = "GNU implementation of the Unicode Bidirectional Algorithm (bidi)";
+    license = licenses.lgpl21;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fstrcmp/cross.patch b/nixpkgs/pkgs/development/libraries/fstrcmp/cross.patch
new file mode 100644
index 000000000000..f794e3b91da6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fstrcmp/cross.patch
@@ -0,0 +1,24 @@
+diff '--color=auto' -ur fstrcmp-0.7-D001-old/configure.ac fstrcmp-0.7.D001/configure.ac
+--- fstrcmp-0.7-D001-old/configure.ac	2014-03-04 19:13:45.000000000 -0500
++++ fstrcmp-0.7.D001/configure.ac	2020-04-02 13:57:52.805154634 -0400
+@@ -32,6 +32,8 @@
+ AC_OBJEXT
+ AC_EXEEXT
+ 
++LT_INIT
++
+ dnl @synopsis AC_ADD_CFLAGS
+ dnl
+ dnl Add the given option to CFLAGS, if it doesn't break the compiler
+diff '--color=auto' -ur fstrcmp-0.7-D001-old/Makefile.in fstrcmp-0.7.D001/Makefile.in
+--- fstrcmp-0.7-D001-old/Makefile.in	2014-03-04 19:13:45.000000000 -0500
++++ fstrcmp-0.7.D001/Makefile.in	2020-04-02 13:57:12.355269595 -0400
+@@ -37,6 +37,8 @@
+ srcdir = @srcdir@
+ VPATH = @srcdir@
+ 
++top_builddir = $(srcdir)
++
+ #
+ # the name of the install program to use
+ #
diff --git a/nixpkgs/pkgs/development/libraries/fstrcmp/default.nix b/nixpkgs/pkgs/development/libraries/fstrcmp/default.nix
new file mode 100644
index 000000000000..c91e8517b078
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fstrcmp/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchzip, libtool, ghostscript, groff, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "fstrcmp";
+  version = "0.7";
+
+  src = fetchzip {
+    url = "https://sourceforge.net/projects/fstrcmp/files/fstrcmp/${version}/fstrcmp-${version}.D001.tar.gz";
+    sha256 = "0yg3y3k0wz50gmhgigfi2dx725w1gc8snb95ih7vpcnj6kabgz9a";
+  };
+
+  patches = [ ./cross.patch ];
+
+  outputs = [ "out" "dev" "doc" "man" "devman" ];
+
+  nativeBuildInputs = [ libtool ghostscript groff autoreconfHook ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Make fuzzy comparisons of strings and byte arrays";
+    longDescription = ''
+      The fstrcmp project provides a library that is used to make fuzzy
+      comparisons of strings and byte arrays, including multi-byte character
+      strings.
+    '';
+    homepage = "http://fstrcmp.sourceforge.net/";
+    downloadPage = "https://sourceforge.net/projects/fstrcmp/";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.sephalon ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/fstrm/default.nix b/nixpkgs/pkgs/development/libraries/fstrm/default.nix
new file mode 100644
index 000000000000..15daa7e5a959
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/fstrm/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, libevent, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "fstrm";
+  version = "0.6.1";
+
+  src = fetchFromGitHub {
+    owner = "farsightsec";
+    repo = "fstrm";
+    rev = "v${version}";
+    sha256 = "sha256-/WFP2g3Vuf/qaY8pprY8XFAlpEE+0SJUlFNWfa+7ZlE=";
+  };
+
+  outputs = [ "bin" "out" "dev" ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ libevent openssl ];
+
+  preBuild = ''
+    NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -L${openssl}/lib"
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Frame Streams implementation in C";
+    homepage = "https://github.com/farsightsec/fstrm";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/ftgl/default.nix b/nixpkgs/pkgs/development/libraries/ftgl/default.nix
new file mode 100644
index 000000000000..466ffcbb73a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ftgl/default.nix
@@ -0,0 +1,66 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, doxygen
+, freeglut
+, freetype
+, GLUT
+, libGL
+, libGLU
+, OpenGL
+, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ftgl";
+  version = "2.4.0";
+
+  src = fetchFromGitHub {
+    owner = "frankheckenbach";
+    repo = "ftgl";
+    rev = "v${version}";
+    hash = "sha256-6TDNGoMeBLnucmHRgEDIVWcjlJb7N0sTluqBwRMMWn4=";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    doxygen
+    pkg-config
+  ];
+  buildInputs = [
+    freetype
+  ] ++ (if stdenv.isDarwin then [
+    OpenGL
+    GLUT
+  ] else [
+    libGL
+    libGLU
+    freeglut
+  ]);
+
+  configureFlags = [
+    "--with-ft-prefix=${lib.getDev freetype}"
+  ];
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    install -Dm644 src/FTSize.h -t ${placeholder "out"}/include/FTGL
+    install -Dm644 src/FTFace.h -t ${placeholder "out"}/include/FTGL
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/frankheckenbach/ftgl";
+    description = "Font rendering library for OpenGL applications";
+    longDescription = ''
+      FTGL is a free cross-platform Open Source C++ library that uses Freetype2
+      to simplify rendering fonts in OpenGL applications. FTGL supports bitmaps,
+      pixmaps, texture maps, outlines, polygon mesh, and extruded polygon
+      rendering modes.
+    '';
+    license = licenses.mit;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ftxui/default.nix b/nixpkgs/pkgs/development/libraries/ftxui/default.nix
new file mode 100644
index 000000000000..df664a309a7c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ftxui/default.nix
@@ -0,0 +1,33 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, doxygen
+, graphviz
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ftxui";
+  version = "unstable-2021-08-13";
+
+  src = fetchFromGitHub {
+    owner = "ArthurSonzogni";
+    repo = pname;
+    rev = "69b0c9e53e523ac43a303964fc9c5bc0da7d5d61";
+    sha256 = "0cbljksgy1ckw34h0mq70s8sma0p16sznn4z9r4hwv76y530m0ww";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    doxygen
+    graphviz
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/ArthurSonzogni/FTXUI";
+    description = "Functional Terminal User Interface for C++";
+    license = licenses.mit;
+    maintainers = [ maintainers.ivar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/funambol/default.nix b/nixpkgs/pkgs/development/libraries/funambol/default.nix
new file mode 100644
index 000000000000..e5ad34a56bb6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/funambol/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, zlib, curl, autoreconfHook, unzip }:
+
+stdenv.mkDerivation rec {
+  pname = "funambol-client-cpp";
+  version = "9.0.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/funambol/funambol-client-sdk-${version}.zip";
+    sha256 = "1667gahz30i5r8kbv7w415z0hbgm6f6pln1137l5skapi1if6r73";
+  };
+
+  postUnpack = ''sourceRoot+="/sdk/cpp/build/autotools"'';
+
+  propagatedBuildInputs = [ zlib curl ];
+
+  nativeBuildInputs = [ autoreconfHook unzip ];
+
+  meta = with lib; {
+    description = "SyncML client sdk by Funambol project";
+    homepage = "http://www.funambol.com";
+    license = licenses.agpl3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/g2o/default.nix b/nixpkgs/pkgs/development/libraries/g2o/default.nix
new file mode 100644
index 000000000000..0536ec95c6ff
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/g2o/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, mkDerivation, fetchFromGitHub, cmake, eigen, suitesparse, blas
+, lapack, libGLU, qtbase, libqglviewer, makeWrapper }:
+
+mkDerivation rec {
+  pname = "g2o";
+  version = "20201223";
+
+  src = fetchFromGitHub {
+    owner = "RainerKuemmerle";
+    repo = pname;
+    rev = "${version}_git";
+    sha256 = "sha256-Ik6uBz4Z4rc5+mPNdT8vlNZSBom4Tvt8Y6myBC/s0m8=";
+  };
+
+  # Removes a reference to gcc that is only used in a debug message
+  patches = [ ./remove-compiler-reference.patch ];
+
+  separateDebugInfo = true;
+
+  nativeBuildInputs = [ cmake makeWrapper ];
+  buildInputs = [ eigen suitesparse blas lapack libGLU qtbase libqglviewer ];
+
+  # Silence noisy warning
+  CXXFLAGS = "-Wno-deprecated-copy";
+
+  dontWrapQtApps = true;
+
+  cmakeFlags = [
+    # Detection script is broken
+    "-DQGLVIEWER_INCLUDE_DIR=${libqglviewer}/include/QGLViewer"
+    "-DG2O_BUILD_EXAMPLES=OFF"
+  ] ++ lib.optionals stdenv.isx86_64 [
+    "-DDO_SSE_AUTODETECT=OFF"
+    "-DDISABLE_SSE3=${  if stdenv.hostPlatform.sse3Support   then "OFF" else "ON"}"
+    "-DDISABLE_SSE4_1=${if stdenv.hostPlatform.sse4_1Support then "OFF" else "ON"}"
+    "-DDISABLE_SSE4_2=${if stdenv.hostPlatform.sse4_2Support then "OFF" else "ON"}"
+    "-DDISABLE_SSE4_A=${if stdenv.hostPlatform.sse4_aSupport then "OFF" else "ON"}"
+  ];
+
+  meta = with lib; {
+    description = "A General Framework for Graph Optimization";
+    homepage = "https://github.com/RainerKuemmerle/g2o";
+    license = with licenses; [ bsd3 lgpl3 gpl3 ];
+    maintainers = with maintainers; [ lopsided98 ];
+    platforms = platforms.all;
+    # fatal error: 'qglviewer.h' file not found
+    broken = stdenv.isDarwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/g2o/remove-compiler-reference.patch b/nixpkgs/pkgs/development/libraries/g2o/remove-compiler-reference.patch
new file mode 100644
index 000000000000..347c57802403
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/g2o/remove-compiler-reference.patch
@@ -0,0 +1,25 @@
+From b9bfed09e4e3c481b7eb36bee1ff4202ccf69dee Mon Sep 17 00:00:00 2001
+From: Ben Wolsieffer <benwolsieffer@gmail.com>
+Date: Fri, 17 May 2019 19:05:36 -0400
+Subject: [PATCH] Remove reference to compiler.
+
+---
+ CMakeLists.txt | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a3f66dd..bb05bd0 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -371,7 +371,7 @@ set(G2O_HAVE_CHOLMOD ${CHOLMOD_FOUND})
+ set(G2O_HAVE_CSPARSE ${CSPARSE_FOUND})
+ set(G2O_SHARED_LIBS ${BUILD_SHARED_LIBS})
+ set(G2O_LGPL_SHARED_LIBS ${BUILD_LGPL_SHARED_LIBS})
+-set(G2O_CXX_COMPILER "${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER}")
++set(G2O_CXX_COMPILER "${CMAKE_CXX_COMPILER_ID} unknown")
+ 
+ configure_file(config.h.in "${PROJECT_BINARY_DIR}/g2o/config.h")
+ install(FILES ${PROJECT_BINARY_DIR}/g2o/config.h DESTINATION ${INCLUDES_DESTINATION}/g2o)
+-- 
+2.21.0
+
diff --git a/nixpkgs/pkgs/development/libraries/gaia/default.nix b/nixpkgs/pkgs/development/libraries/gaia/default.nix
new file mode 100644
index 000000000000..47926e2ec0be
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gaia/default.nix
@@ -0,0 +1,87 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, libyaml
+, swig
+, eigen
+, pkg-config
+, python2
+, wafHook
+, makeWrapper
+, qt4
+, pythonPackages ? null
+, 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 = [
+    pkg-config
+    python2 # For wafHook
+    swig
+    wafHook
+  ]
+    # 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/galario/default.nix b/nixpkgs/pkgs/development/libraries/galario/default.nix
new file mode 100644
index 000000000000..7fb93a61a0fe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/galario/default.nix
@@ -0,0 +1,78 @@
+{ lib, stdenv
+, fetchzip
+, fetchFromGitHub
+, cmake
+, fftw
+, fftwFloat
+, enablePython ? false
+, pythonPackages ? null
+, llvmPackages
+}:
+let
+  # CMake recipes are needed to build galario
+  # Build process would usually download them
+  great-cmake-cookoff = fetchzip {
+    url = "https://github.com/UCL/GreatCMakeCookOff/archive/v2.1.9.tar.gz";
+    sha256 = "1yd53b5gx38g6f44jmjk4lc4igs3p25z6616hfb7aq79ly01q0w2";
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "galario";
+  version = "1.2.2";
+
+  src = fetchFromGitHub {
+    owner = "mtazzari";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0dw88ga50x3jwyfgcarn4azlhiarggvdg262hilm7rbrvlpyvha0";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ fftw fftwFloat ]
+  ++ lib.optional enablePython pythonPackages.python
+  ++ lib.optional stdenv.isDarwin llvmPackages.openmp
+  ;
+
+  propagatedBuildInputs = lib.optional enablePython [
+    pythonPackages.numpy
+    pythonPackages.cython
+    pythonPackages.pytest
+  ];
+
+  checkInputs = lib.optional enablePython [ pythonPackages.scipy pythonPackages.pytest-cov ];
+
+  preConfigure = ''
+    mkdir -p build/external/src
+    cp -r ${great-cmake-cookoff} build/external/src/GreatCMakeCookOff
+    chmod -R 777 build/external/src/GreatCMakeCookOff
+  '';
+
+  preCheck = ''
+    ${if stdenv.isDarwin then "export DYLD_LIBRARY_PATH=$(pwd)/src/" else "export LD_LIBRARY_PATH=$(pwd)/src/"}
+    ${if enablePython then "sed -i -e 's|^#!.*|#!${stdenv.shell}|' python/py.test.sh" else ""}
+  '';
+
+  doCheck = true;
+
+  postInstall = lib.optionalString (stdenv.isDarwin && enablePython) ''
+    install_name_tool -change libgalario.dylib $out/lib/libgalario.dylib $out/lib/python*/site-packages/galario/double/libcommon.so
+    install_name_tool -change libgalario_single.dylib $out/lib/libgalario_single.dylib $out/lib/python*/site-packages/galario/single/libcommon.so
+  '';
+
+  meta = with lib; {
+    description = "GPU Accelerated Library for Analysing Radio Interferometer Observations";
+    longDescription = ''
+      Galario is a library that exploits the computing power of modern
+      graphic cards (GPUs) to accelerate the comparison of model
+      predictions to radio interferometer observations. Namely, it
+      speeds up the computation of the synthetic visibilities given a
+      model image (or an axisymmetric brightness profile) and their
+      comparison to the observations.
+    '';
+    homepage = "https://mtazzari.github.io/galario/";
+    license = licenses.lgpl3;
+    maintainers = [ maintainers.smaret ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gamenetworkingsockets/default.nix b/nixpkgs/pkgs/development/libraries/gamenetworkingsockets/default.nix
new file mode 100644
index 000000000000..0546bfb8e08e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gamenetworkingsockets/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, cmake, ninja, go, protobuf, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "GameNetworkingSockets";
+  version = "1.2.0";
+
+  src = fetchFromGitHub {
+    owner = "ValveSoftware";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1zghyc4liml8gzxflyh5gp6zi11ny6ng5hv9wyqvp32rfx221gc6";
+  };
+
+  nativeBuildInputs = [ cmake ninja go ];
+
+  cmakeFlags = [ "-G Ninja" ];
+
+  # tmp home for go
+  preBuild = "export HOME=\"$TMPDIR\"";
+
+  buildInputs = [ protobuf openssl ];
+
+  meta = with lib; {
+    # build failure is resolved on master, remove at next release
+    broken = stdenv.isDarwin;
+    description = "GameNetworkingSockets is a basic transport layer for games";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    inherit (src.meta) homepage;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gamin/abstract-socket-namespace.patch b/nixpkgs/pkgs/development/libraries/gamin/abstract-socket-namespace.patch
new file mode 100644
index 000000000000..ff1610559721
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gamin/abstract-socket-namespace.patch
@@ -0,0 +1,73 @@
+From 737452159d521aef2041a2767f3ebf9f68f4b6a9 Mon Sep 17 00:00:00 2001
+From: Christian Kampka <christian@kampka.net>
+Date: Tue, 1 Sep 2020 13:54:35 +0200
+Subject: [PATCH] Pin abstract namespace sockets to host_os
+
+Running programs with AC_RUN_IFELSE fails when cross-compiling.
+Since abstract namespace sockets are linux feature, we can easily
+assume it is available for linux and not for darwin.
+---
+ configure.in | 47 ++++++-----------------------------------------
+ 1 file changed, 6 insertions(+), 41 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index eb129db..0ed82ba 100644
+--- a/configure.in
++++ b/configure.in
+@@ -387,47 +387,12 @@ fi
+ 
+ #### Abstract sockets
+ 
+-AC_MSG_CHECKING(abstract socket namespace)
+-AC_LANG_PUSH(C)
+-AC_RUN_IFELSE([AC_LANG_PROGRAM(
+-[[
+-#include <sys/types.h>
+-#include <stdlib.h>
+-#include <string.h>
+-#include <stdio.h>
+-#include <sys/socket.h>
+-#include <sys/un.h>
+-#include <errno.h>
+-]],
+-[[
+-  int listen_fd;
+-  struct sockaddr_un addr;
+-  
+-  listen_fd = socket (PF_UNIX, SOCK_STREAM, 0);
+-  
+-  if (listen_fd < 0)
+-    {
+-      fprintf (stderr, "socket() failed: %s\n", strerror (errno));
+-      exit (1);
+-    }
+-
+-  memset (&addr, '\0', sizeof (addr));
+-  addr.sun_family = AF_UNIX;
+-  strcpy (addr.sun_path, "X/tmp/dbus-fake-socket-path-used-in-configure-test");
+-  addr.sun_path[0] = '\0'; /* this is what makes it abstract */
+-  
+-  if (bind (listen_fd, (struct sockaddr*) &addr, SUN_LEN (&addr)) < 0)
+-    {
+-       fprintf (stderr, "Abstract socket namespace bind() failed: %s\n", 
+-                strerror (errno));
+-       exit (1);
+-    }
+-  else 
+-    exit (0);
+-]])],
+-              [have_abstract_sockets=yes],
+-              [have_abstract_sockets=no])
+-AC_LANG_POP(C)
++AC_MSG_CHECKING([whether target os has abstract socket namespace])
++if test x$target_os = xlinux-gnu ; then
++    have_abstract_sockets=yes
++else
++    have_abstract_sockets=no
++fi	
+ AC_MSG_RESULT($have_abstract_sockets)
+ 
+ if test x$enable_abstract_sockets = xyes; then
+-- 
+2.25.4
+
diff --git a/nixpkgs/pkgs/development/libraries/gamin/deadlock.patch b/nixpkgs/pkgs/development/libraries/gamin/deadlock.patch
new file mode 100644
index 000000000000..e2abc8ce2d97
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gamin/deadlock.patch
@@ -0,0 +1,68 @@
+Fix for a deadlock:
+https://bugzilla.gnome.org/show_bug.cgi?id=667230
+
+From cc14440eface093548cb3bc7814da11d9a99d283 Mon Sep 17 00:00:00 2001
+From: Anssi Hannula <anssi@mageia.org>
+Date: Wed, 4 Jan 2012 00:23:55 +0200
+Subject: [PATCH] fix possible server deadlock in ih_sub_cancel
+
+ih_sub_foreach() calls ih_sub_cancel() while inotify_lock is locked.
+However, ih_sub_cancel() locks it again, and locking GMutex recursively
+causes undefined behaviour.
+
+Fix that by removing locking from ih_sub_cancel() as ih_sub_foreach()
+is its only user. Also make the function static so that it won't
+accidentally get used by other files without locking (inotify-helper.h
+is an internal server header).
+
+This should fix the intermittent deadlocks I've been experiencing
+causing KDE applications to no longer start, and probably also
+http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=542361
+---
+ server/inotify-helper.c |    7 ++-----
+ server/inotify-helper.h |    1 -
+ 2 files changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/server/inotify-helper.c b/server/inotify-helper.c
+index d77203e..0789fa4 100644
+--- a/server/inotify-helper.c
++++ b/server/inotify-helper.c
+@@ -123,13 +123,11 @@ ih_sub_add (ih_sub_t * sub)
+ 
+ /**
+  * Cancels a subscription which was being monitored.
++ * inotify_lock must be held when calling.
+  */
+-gboolean
++static gboolean
+ ih_sub_cancel (ih_sub_t * sub)
+ {
+-	G_LOCK(inotify_lock);
+-
+-
+ 	if (!sub->cancelled)
+ 	{
+ 		IH_W("cancelling %s\n", sub->pathname);
+@@ -140,7 +138,6 @@ ih_sub_cancel (ih_sub_t * sub)
+ 		sub_list = g_list_remove (sub_list, sub);
+ 	}
+ 
+-	G_UNLOCK(inotify_lock);
+ 	return TRUE;
+ }
+ 
+diff --git a/server/inotify-helper.h b/server/inotify-helper.h
+index 5d3b6d0..d36b5fd 100644
+--- a/server/inotify-helper.h
++++ b/server/inotify-helper.h
+@@ -34,7 +34,6 @@ gboolean	 ih_startup		(event_callback_t ecb,
+ 					 found_callback_t fcb);
+ gboolean	 ih_running		(void);
+ gboolean	 ih_sub_add		(ih_sub_t *sub);
+-gboolean	 ih_sub_cancel		(ih_sub_t *sub);
+ 
+ /* Return FALSE from 'f' if the subscription should be cancelled */
+ void		 ih_sub_foreach		(void *callerdata, gboolean (*f)(ih_sub_t *sub, void *callerdata));
+-- 
+1.7.7.2
+
diff --git a/nixpkgs/pkgs/development/libraries/gamin/debian-patches.nix b/nixpkgs/pkgs/development/libraries/gamin/debian-patches.nix
new file mode 100644
index 000000000000..a8f334fb3c39
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gamin/debian-patches.nix
@@ -0,0 +1,10 @@
+# Generated by debian-patches.sh from debian-patches.txt
+let
+  prefix = "https://sources.debian.org/data/main/g/gamin/0.1.10-4.1/debian/patches";
+in
+[
+  {
+    url = "${prefix}/17_deprecated_const_return.patch";
+    sha256 = "0bssrqcmyivlpk2g0q71d1yavd4wv1lw34l8qipm0ndljjd6rbrk";
+  }
+]
diff --git a/nixpkgs/pkgs/development/libraries/gamin/debian-patches.txt b/nixpkgs/pkgs/development/libraries/gamin/debian-patches.txt
new file mode 100644
index 000000000000..46d2420b21ed
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gamin/debian-patches.txt
@@ -0,0 +1,2 @@
+gamin/0.1.10-4.1
+17_deprecated_const_return.patch
diff --git a/nixpkgs/pkgs/development/libraries/gamin/default.nix b/nixpkgs/pkgs/development/libraries/gamin/default.nix
new file mode 100644
index 000000000000..56de42d9dc5b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gamin/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, glib, autoreconfHook }:
+
+let
+  cross = stdenv.hostPlatform != stdenv.buildPlatform;
+in stdenv.mkDerivation (rec {
+  name = "gamin-0.1.10";
+
+  src = fetchurl {
+    url = "https://www.gnome.org/~veillard/gamin/sources/${name}.tar.gz";
+    sha256 = "18cr51y5qacvs2fc2p1bqv32rs8bzgs6l67zhasyl45yx055y218";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+
+  buildInputs = [ glib ];
+
+  # `_GNU_SOURCE' is needed, e.g., to get `struct ucred' from
+  # <sys/socket.h> with Glibc 2.9.
+  configureFlags = [
+    "--disable-debug"
+    "--without-python" # python3 not supported
+    "CPPFLAGS=-D_GNU_SOURCE"
+  ];
+
+  patches = [ ./deadlock.patch ]
+    ++ map fetchurl (import ./debian-patches.nix)
+    ++ lib.optional stdenv.cc.isClang ./returnval.patch
+    ++ lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
+      name = "fix-pthread-mutex.patch";
+      url = "https://git.alpinelinux.org/aports/plain/main/gamin/fix-pthread-mutex.patch?h=3.4-stable&id=a1a836b089573752c1b0da7d144c0948b04e8ea8";
+      sha256 = "13igdbqsxb3sz0h417k6ifmq2n4siwqspj6slhc7fdl5wd1fxmdz";
+    }) ++ lib.optional (cross) ./abstract-socket-namespace.patch ;
+
+
+  meta = with lib; {
+    homepage    = "https://people.gnome.org/~veillard/gamin/";
+    description = "A file and directory monitoring system";
+    maintainers = with maintainers; [ lovek323 ];
+    license = licenses.gpl2;
+    platforms   = platforms.unix;
+  };
+}
+
+// lib.optionalAttrs stdenv.isDarwin {
+  preBuild =  ''
+    sed -i 's/,--version-script=.*$/\\/' libgamin/Makefile
+  '';
+})
diff --git a/nixpkgs/pkgs/development/libraries/gamin/returnval.patch b/nixpkgs/pkgs/development/libraries/gamin/returnval.patch
new file mode 100644
index 000000000000..3944b14be64c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gamin/returnval.patch
@@ -0,0 +1,12 @@
+diff -rupN gamin-0.1.10-orig/server/gam_eq.c gamin-0.1.10/server/gam_eq.c
+--- gamin-0.1.10-orig/server/gam_eq.c	2015-04-05 19:25:54.000000000 -0400
++++ gamin-0.1.10/server/gam_eq.c	2015-04-05 19:26:00.000000000 -0400
+@@ -124,7 +124,7 @@ gam_eq_flush (gam_eq_t *eq, GamConnDataP
+ {
+ 	gboolean done_work = FALSE;
+ 	if (!eq)
+-		return;
++		return done_work;
+ 
+ #ifdef GAM_EQ_VERBOSE
+ 	GAM_DEBUG(DEBUG_INFO, "gam_eq: Flushing event queue for %s\n", gam_connection_get_pidname (conn));
diff --git a/nixpkgs/pkgs/development/libraries/ganv/default.nix b/nixpkgs/pkgs/development/libraries/ganv/default.nix
new file mode 100644
index 000000000000..d53206ca667b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ganv/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchgit, graphviz, gtk2, gtkmm2, pkg-config, python3, wafHook }:
+
+stdenv.mkDerivation rec {
+  pname = "ganv";
+  version = "unstable-2019-12-30";
+
+  src = fetchgit {
+    url = "https://gitlab.com/drobilla/${pname}.git";
+    fetchSubmodules = true;
+    rev = "90bd022f8909f92cc5290fdcfc76c626749e1186";
+    sha256 = "01znnalirbqxpz62fbw2c14c8xn117jc92xv6dhb3hln92k9x37f";
+  };
+
+  nativeBuildInputs = [ pkg-config wafHook python3 gtk2 ];
+  buildInputs = [ graphviz gtkmm2 ];
+
+  strictDeps = true;
+
+  meta = with lib; {
+    description = "An interactive Gtk canvas widget for graph-based interfaces";
+    homepage = "http://drobilla.net";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+  }
diff --git a/nixpkgs/pkgs/development/libraries/garmintools/default.nix b/nixpkgs/pkgs/development/libraries/garmintools/default.nix
new file mode 100644
index 000000000000..7ad5bc879261
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/garmintools/default.nix
@@ -0,0 +1,17 @@
+{ lib, stdenv, fetchurl, libusb-compat-0_1 }:
+stdenv.mkDerivation rec {
+  pname = "garmintools";
+  version = "0.10";
+  src = fetchurl {
+    url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/garmintools/${pname}-${version}.tar.gz";
+    sha256 = "1vjc8h0z4kx2h52yc3chxn3wh1krn234fg12sggbia9zjrzhpmgz";
+  };
+  buildInputs = [ libusb-compat-0_1 ];
+  meta = {
+    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 = lib.licenses.gpl2;
+    maintainers = [ ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gbenchmark/default.nix b/nixpkgs/pkgs/development/libraries/gbenchmark/default.nix
new file mode 100644
index 000000000000..70bd37e40d39
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gbenchmark/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, cmake, gtest }:
+
+stdenv.mkDerivation rec {
+  pname = "gbenchmark";
+  version = "1.5.6";
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "benchmark";
+    rev = "v${version}";
+    sha256 = "sha256-DFm5cQh1b2BX6qCDaQZ1/XBNDeIYXKWbIETYu1EjDww=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  postPatch = ''
+    cp -r ${gtest.src} googletest
+    chmod -R u+w googletest
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A microbenchmark support library";
+    homepage = "https://github.com/google/benchmark";
+    license = licenses.asl20;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gcab/default.nix b/nixpkgs/pkgs/development/libraries/gcab/default.nix
new file mode 100644
index 000000000000..d0d314037d28
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gcab/default.nix
@@ -0,0 +1,83 @@
+{ lib, stdenv
+, fetchurl
+, gettext
+, gobject-introspection
+, gtk-doc
+, docbook_xsl
+, docbook_xml_dtd_43
+, pkg-config
+, meson
+, ninja
+, git
+, vala
+, glib
+, zlib
+, gnome
+, nixosTests
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gcab";
+  version = "1.4";
+
+  outputs = [ "bin" "out" "dev" "devdoc" "installedTests" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "13q43iqld4l50yra45lhvkd376pn6qpk7rkx374zn8y9wsdzm9b7";
+  };
+
+  patches = [
+    # allow installing installed tests to a separate output
+    ./installed-tests-path.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    git
+    pkg-config
+    vala
+    gettext
+    gobject-introspection
+    gtk-doc
+    docbook_xsl
+    docbook_xml_dtd_43
+  ];
+
+  buildInputs = [
+    glib
+    zlib
+  ];
+
+  # required by libgcab-1.0.pc
+  propagatedBuildInputs = [
+    glib
+  ];
+
+  mesonFlags = [
+    "-Dinstalled_tests=true"
+    "-Dinstalled_test_prefix=${placeholder "installedTests"}"
+  ];
+
+  doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+
+    tests = {
+      installedTests = nixosTests.installed-tests.gcab;
+    };
+  };
+
+  meta = with lib; {
+    description = "GObject library to create cabinet files";
+    homepage = "https://gitlab.gnome.org/GNOME/gcab";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.unix;
+  };
+}
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/gcc/libgcc/default.nix b/nixpkgs/pkgs/development/libraries/gcc/libgcc/default.nix
new file mode 100644
index 000000000000..ab62fdf3fa20
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gcc/libgcc/default.nix
@@ -0,0 +1,152 @@
+{ lib, stdenvNoLibs, buildPackages
+, gcc, glibc
+, libiberty
+}:
+
+stdenvNoLibs.mkDerivation rec {
+  name = "libgcc-${version}";
+  inherit (gcc.cc) src version;
+
+  outputs = [ "out" "dev" ];
+
+  strictDeps = true;
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ libiberty ];
+
+  postUnpack = ''
+    mkdir -p ./build
+    buildRoot=$(readlink -e "./build")
+  '';
+
+  postPatch = ''
+    sourceRoot=$(readlink -e "./libgcc")
+  '';
+
+  preConfigure = ''
+    cd "$buildRoot"
+  ''
+
+  # Drop in libiberty, as external builds are not expected
+  + ''
+    (
+      mkdir -p build-${stdenvNoLibs.buildPlatform.config}/libiberty/
+      cd build-${stdenvNoLibs.buildPlatform.config}/libiberty/
+      ln -s ${buildPackages.libiberty}/lib/libiberty.a ./
+    )
+  ''
+  # A few misc bits of gcc need to be built.
+  #
+  #  - We "shift" the tools over to fake platforms perspective from the previous
+  #    stage.
+  #
+  #  - We define GENERATOR_FILE so nothing bothers looking for GNU GMP.
+  #
+  #  - We remove the `libgcc.mvar` deps so that the bootstrap xgcc isn't built.
+  + ''
+    mkdir -p "$buildRoot/gcc"
+    cd "$buildRoot/gcc"
+    (
+      export AS_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$AS_FOR_BUILD
+      export CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CC_FOR_BUILD
+      export CPP_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CPP_FOR_BUILD
+      export CXX_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CXX_FOR_BUILD
+      export LD_FOR_BUILD=${buildPackages.stdenv.cc.bintools}/bin/$LD_FOR_BUILD
+
+      export AS=$AS_FOR_BUILD
+      export CC=$CC_FOR_BUILD
+      export CPP=$CPP_FOR_BUILD
+      export CXX=$CXX_FOR_BUILD
+      export LD=$LD_FOR_BUILD
+
+      export AS_FOR_TARGET=${stdenvNoLibs.cc}/bin/$AS
+      export CC_FOR_TARGET=${stdenvNoLibs.cc}/bin/$CC
+      export CPP_FOR_TARGET=${stdenvNoLibs.cc}/bin/$CPP
+      export LD_FOR_TARGET=${stdenvNoLibs.cc.bintools}/bin/$LD
+
+      export NIX_CFLAGS_COMPILE_FOR_BUILD+=' -DGENERATOR_FILE=1'
+
+      "$sourceRoot/../gcc/configure" $gccConfigureFlags
+
+      sed -e 's,libgcc.mvars:.*$,libgcc.mvars:,' -i Makefile
+
+      make \
+        config.h \
+        libgcc.mvars \
+        tconfig.h \
+        tm.h \
+        options.h \
+        insn-constants.h \
+        insn-modes.h \
+        gcov-iov.h
+    )
+    mkdir -p "$buildRoot/gcc/include"
+  ''
+  # Preparing to configure + build libgcc itself
+  + ''
+    mkdir -p "$buildRoot/gcc/${stdenvNoLibs.hostPlatform.config}/libgcc"
+    cd "$buildRoot/gcc/${stdenvNoLibs.hostPlatform.config}/libgcc"
+    configureScript=$sourceRoot/configure
+    chmod +x "$configureScript"
+
+    export AS_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$AS_FOR_BUILD
+    export CC_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CC_FOR_BUILD
+    export CPP_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CPP_FOR_BUILD
+    export CXX_FOR_BUILD=${buildPackages.stdenv.cc}/bin/$CXX_FOR_BUILD
+    export LD_FOR_BUILD=${buildPackages.stdenv.cc.bintools}/bin/$LD_FOR_BUILD
+
+    export AS=${stdenvNoLibs.cc}/bin/$AS
+    export CC=${stdenvNoLibs.cc}/bin/$CC
+    export CPP=${stdenvNoLibs.cc}/bin/$CPP
+    export CXX=${stdenvNoLibs.cc}/bin/$CXX
+    export LD=${stdenvNoLibs.cc.bintools}/bin/$LD
+
+    export AS_FOR_TARGET=${stdenvNoLibs.cc}/bin/$AS_FOR_TARGET
+    export CC_FOR_TARGET=${stdenvNoLibs.cc}/bin/$CC_FOR_TARGET
+    export CPP_FOR_TARGET=${stdenvNoLibs.cc}/bin/$CPP_FOR_TARGET
+    export LD_FOR_TARGET=${stdenvNoLibs.cc.bintools}/bin/$LD_FOR_TARGET
+  '';
+
+  gccConfigureFlags = [
+    "--build=${stdenvNoLibs.buildPlatform.config}"
+    "--host=${stdenvNoLibs.buildPlatform.config}"
+    "--target=${stdenvNoLibs.hostPlatform.config}"
+
+    "--disable-bootstrap"
+    "--disable-multilib" "--with-multilib-list="
+    "--enable-languages=c"
+
+    "--disable-fixincludes"
+    "--disable-intl"
+    "--disable-lto"
+    "--disable-libatomic"
+    "--disable-libbacktrace"
+    "--disable-libcpp"
+    "--disable-libssp"
+    "--disable-libquadmath"
+    "--disable-libgomp"
+    "--disable-libvtv"
+    "--disable-vtable-verify"
+
+    "--with-system-zlib"
+  ] ++ lib.optional (stdenvNoLibs.hostPlatform.libc == "glibc")
+       "--with-glibc-version=${glibc.version}";
+
+  configurePlatforms = [ "build" "host" ];
+  configureFlags = [
+    "--disable-dependency-tracking"
+    # $CC cannot link binaries, let alone run then
+    "cross_compiling=true"
+    # Do not have dynamic linker without libc
+    "--enable-static"
+    "--disable-shared"
+  ];
+
+  makeFlags = [ "MULTIBUILDTOP:=../" ];
+
+  postInstall = ''
+    moveToOutput "lib/gcc/${stdenvNoLibs.hostPlatform.config}/${version}/include" "$dev"
+    mkdir -p "$out/lib" "$dev/include"
+    ln -s "$out/lib/gcc/${stdenvNoLibs.hostPlatform.config}/${version}"/* "$out/lib"
+    ln -s "$dev/lib/gcc/${stdenvNoLibs.hostPlatform.config}/${version}/include"/* "$dev/include/"
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/gcc/libstdc++/5.nix b/nixpkgs/pkgs/development/libraries/gcc/libstdc++/5.nix
new file mode 100644
index 000000000000..f963ae31e5c1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gcc/libstdc++/5.nix
@@ -0,0 +1,117 @@
+{ lib, stdenv, fetchurl, fetchpatch, flex, bison, file }:
+
+stdenv.mkDerivation rec {
+  pname = "libstdc++5";
+  version = "3.3.6";
+
+  src = [
+    (fetchurl {
+      url = "mirror://gcc/releases/gcc-${version}/gcc-core-${version}.tar.bz2";
+      sha256 = "1dpyrpsgakilz2rnh5f8gvrzq5pwzvndacc0df6m04bpqn5fx6sg";
+    })
+    (fetchurl {
+      url = "mirror://gcc/releases/gcc-${version}/gcc-g++-${version}.tar.bz2";
+      sha256 = "14lxl81f7adpc9jxfiwzdxsdzs5zv4piv8xh7f9w910hfzrgvsby";
+    })
+  ];
+
+  patches = [
+    ./no-sys-dirs.patch
+    (fetchpatch {
+      name = "siginfo.patch";
+      url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/e36ee8ed9bb5942db14cf6249a2ead14974a2bfa/trunk/siginfo.patch";
+      sha256 = "15zldbm33yba293dgrgsbv3j332hkc3iqpyc8fa7zl42mh9qk22j";
+      extraPrefix = "";
+    })
+    (fetchpatch {
+      name = "gcc-3.4.3-no_multilib_amd64.patch";
+      url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/e36ee8ed9bb5942db14cf6249a2ead14974a2bfa/trunk/gcc-3.4.3-no_multilib_amd64.patch";
+      sha256 = "11m5lc51b0addhc4yq4rz0dwpv6k73rrj73wya3lqdk8rly6cjpm";
+      extraPrefix = "";
+    })
+    # Required because of glibc 2.26
+    ./struct-ucontext.patch
+  ];
+
+  postPatch = ''
+    # fix build issue with recent gcc
+    sed -i "s#O_CREAT#O_CREAT, 0666#" gcc/collect2.c
+
+    # No fixincludes
+    sed -i -e 's@\./fixinc\.sh@-c true@' gcc/Makefile.in
+  '';
+
+  preConfigure = ''
+    mkdir ../build
+    cd ../build
+    configureScript=../$sourceRoot/configure
+  '';
+
+  preBuild = ''
+    # libstdc++ needs this; otherwise it will use /lib/cpp, which is a Bad
+    # Thing.
+    export CPP="gcc -E"
+
+    # Use *real* header files, otherwise a limits.h is generated
+    # that does not include Glibc's limits.h (notably missing
+    # SSIZE_MAX, which breaks the build).
+    export NIX_FIXINC_DUMMY="$(cat $NIX_CC/nix-support/orig-libc-dev)/include"
+
+    # The path to the Glibc binaries such as `crti.o'.
+    glibc_libdir="$(cat $NIX_CC/nix-support/orig-libc)/lib"
+
+    # Figure out what extra flags to pass to the gcc compilers
+    # being generated to make sure that they use our glibc.
+    EXTRA_FLAGS="-I$NIX_FIXINC_DUMMY $(cat $NIX_CC/nix-support/libc-crt1-cflags) $(cat $NIX_CC/nix-support/libc-cflags) -O2"
+
+    extraLDFlags="-L$glibc_libdir -rpath $glibc_libdir $(cat $NIX_BINTOOLS/nix-support/libc-ldflags) $(cat $NIX_BINTOOLS/nix-support/libc-ldflags-before)"
+    for i in $extraLDFlags; do
+      EXTRA_FLAGS="$EXTRA_FLAGS -Wl,$i"
+    done
+
+    # CFLAGS_FOR_TARGET are needed for the libstdc++ configure script to find
+    # the startfiles.
+    # FLAGS_FOR_TARGET are needed for the target libraries to receive the -Bxxx
+    # for the startfiles.
+    makeFlagsArray=( \
+      "''${makeFlagsArray[@]}" \
+      NATIVE_SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
+      SYSTEM_HEADER_DIR="$NIX_FIXINC_DUMMY" \
+      CFLAGS_FOR_BUILD="$EXTRA_FLAGS" \
+      CFLAGS_FOR_TARGET="$EXTRA_FLAGS" \
+      CXXFLAGS_FOR_BUILD="$EXTRA_FLAGS" \
+      CXXFLAGS_FOR_TARGET="$EXTRA_FLAGS" \
+      FLAGS_FOR_TARGET="$EXTRA_FLAGS" \
+      LDFLAGS_FOR_BUILD="$EXTRA_FLAGS" \
+      LDFLAGS_FOR_TARGET="$EXTRA_FLAGS" \
+      BOOT_CFLAGS="$EXTRA_FLAGS" \
+      BOOT_LDFLAGS="$EXTRA_FLAGS"
+      )
+  '';
+
+  hardeningDisable = [ "format" ];
+
+  nativeBuildInputs = [ flex bison file ];
+
+  configureFlags = [ "--disable-multilib" "--enable-__cxa-atexit" "--enable-threads=posix" "--enable-languages=c++" "--enable-clocale=gnu" ];
+
+  buildFLags = [ "all-target-libstdc++-v3" ];
+
+  installFlags = [ "install-target-libstdc++-v3" ];
+
+  postInstall = ''
+    # Remove includefiles and libs provided by gcc
+    shopt -s extglob
+    rm -rf $out/{bin,include,share,man,info}
+    rm -f $out/lib/*.a
+    rm -rf $out/lib/!(libstdc++*)
+  '';
+
+  meta = with lib; {
+    homepage = "https://gcc.gnu.org/";
+    license = licenses.lgpl3Plus;
+    description = "GNU Compiler Collection, version ${version} -- C++ standard library";
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gcc/libstdc++/no-sys-dirs.patch b/nixpkgs/pkgs/development/libraries/gcc/libstdc++/no-sys-dirs.patch
new file mode 100644
index 000000000000..8c91d75f2a53
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gcc/libstdc++/no-sys-dirs.patch
@@ -0,0 +1,53 @@
+diff -ru3 gcc-3.3.6-old/gcc/cppdefault.c gcc-3.3.6/gcc/cppdefault.c
+--- gcc-3.3.6-old/gcc/cppdefault.c	2003-11-07 02:13:31.000000000 +0300
++++ gcc-3.3.6/gcc/cppdefault.c	2016-09-02 16:00:03.492484016 +0300
+@@ -26,6 +26,10 @@
+ #include "system.h"
+ #include "cppdefault.h"
+ 
++#undef LOCAL_INCLUDE_DIR
++#undef SYSTEM_INCLUDE_DIR
++#undef STANDARD_INCLUDE_DIR
++
+ const struct default_include cpp_include_defaults[]
+ #ifdef INCLUDE_DEFAULTS
+ = INCLUDE_DEFAULTS;
+diff -ru3 gcc-3.3.6-old/gcc/gcc.c gcc-3.3.6/gcc/gcc.c
+--- gcc-3.3.6-old/gcc/gcc.c	2004-04-01 20:55:17.000000000 +0400
++++ gcc-3.3.6/gcc/gcc.c	2016-09-02 16:01:24.843520114 +0300
+@@ -6130,10 +6130,6 @@
+ 		      NULL, PREFIX_PRIORITY_LAST, 0, NULL, 1);
+ 	}
+ 
+-      add_sysrooted_prefix (&startfile_prefixes, standard_startfile_prefix_1,
+-			    "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
+-      add_sysrooted_prefix (&startfile_prefixes, standard_startfile_prefix_2,
+-			    "BINUTILS", PREFIX_PRIORITY_LAST, 0, NULL, 1);
+ #if 0 /* Can cause surprises, and one can use -B./ instead.  */
+       add_prefix (&startfile_prefixes, "./", NULL,
+ 		  PREFIX_PRIORITY_LAST, 1, NULL, 0);
+diff -ru3 gcc-3.3.6-old/gcc/Makefile.in gcc-3.3.6/gcc/Makefile.in
+--- gcc-3.3.6-old/gcc/Makefile.in	2004-04-01 20:55:23.000000000 +0400
++++ gcc-3.3.6/gcc/Makefile.in	2016-09-02 16:00:03.493484017 +0300
+@@ -260,7 +260,11 @@
+ PARTITION_H = $(srcdir)/../include/partition.h
+ 
+ # Default native SYSTEM_HEADER_DIR, to be overridden by targets.
+-NATIVE_SYSTEM_HEADER_DIR = /usr/include
++# Nix: we override NATIVE_SYSTEM_HEADER_DIR in order to prevent
++# `fixinc' from fixing header files in /usr/include.  However,
++# NATIVE_SYSTEM_HEADER_DIR must point to an existing directory, so set
++# it to some dummy directory.
++NATIVE_SYSTEM_HEADER_DIR = $(NIX_FIXINC_DUMMY)
+ # Default cross SYSTEM_HEADER_DIR, to be overridden by targets.
+ CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@
+ 
+@@ -2201,7 +2205,7 @@
+   -DGPLUSPLUS_INCLUDE_DIR=\"$(gcc_gxx_include_dir)\" \
+   -DGPLUSPLUS_TOOL_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/$(target_alias)\" \
+   -DGPLUSPLUS_BACKWARD_INCLUDE_DIR=\"$(gcc_gxx_include_dir)/backward\" \
+-  -DLOCAL_INCLUDE_DIR=\"$(local_includedir)\" \
++  -DLOCAL_INCLUDE_DIR=\"/no-such-dir\" \
+   -DCROSS_INCLUDE_DIR=\"$(CROSS_SYSTEM_HEADER_DIR)\" \
+   -DTOOL_INCLUDE_DIR=\"$(gcc_tooldir)/include\" \
+   @TARGET_SYSTEM_ROOT_DEFINE@
diff --git a/nixpkgs/pkgs/development/libraries/gcc/libstdc++/struct-ucontext.patch b/nixpkgs/pkgs/development/libraries/gcc/libstdc++/struct-ucontext.patch
new file mode 100644
index 000000000000..5462e0e33ecd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gcc/libstdc++/struct-ucontext.patch
@@ -0,0 +1,61 @@
+diff --git a/gcc/config/alpha/linux.h b/gcc/config/alpha/linux.h
+index 3a2940c..67f9899 100644
+--- a/gcc/config/alpha/linux.h
++++ b/gcc/config/alpha/linux.h
+@@ -89,7 +89,7 @@ Boston, MA 02111-1307, USA.  */
+       {									\
+ 	struct rt_sigframe {						\
+ 	  struct siginfo info;						\
+-	  struct ucontext uc;						\
++	  ucontext_t uc;						\
+ 	} *rt_ = (CONTEXT)->cfa;					\
+ 	sc_ = &rt_->uc.uc_mcontext;					\
+       }									\
+diff --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
+index e86ab3d..30797a7 100644
+--- a/gcc/config/i386/linux.h
++++ b/gcc/config/i386/linux.h
+@@ -260,7 +260,7 @@ Boston, MA 02111-1307, USA.  */
+ 	  siginfo_t *pinfo;					\
+ 	  void *puc;							\
+ 	  siginfo_t info;						\
+-	  struct ucontext uc;						\
++	  ucontext_t uc;						\
+ 	} *rt_ = (CONTEXT)->cfa;					\
+ 	sc_ = (struct sigcontext *) &rt_->uc.uc_mcontext;		\
+       }									\
+diff --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
+index fbfaa58..200c8dc 100644
+--- a/gcc/config/i386/linux64.h
++++ b/gcc/config/i386/linux64.h
+@@ -112,7 +112,7 @@ Boston, MA 02111-1307, USA.  */
+     if (*(unsigned char *)(pc_+0) == 0x48				\
+ 	&& *(unsigned long *)(pc_+1) == 0x050f0000000fc0c7)		\
+       {									\
+-	struct ucontext *uc_ = (CONTEXT)->cfa;				\
++	ucontext_t *uc_ = (CONTEXT)->cfa;				\
+ 	sc_ = (struct sigcontext *) &uc_->uc_mcontext;			\
+       }									\
+     else								\
+@@ -182,7 +182,7 @@ Boston, MA 02111-1307, USA.  */
+ 	  struct siginfo *pinfo;					\
+ 	  void *puc;							\
+ 	  struct siginfo info;						\
+-	  struct ucontext uc;						\
++	  ucontext_t uc;						\
+ 	} *rt_ = (CONTEXT)->cfa;					\
+ 	sc_ = (struct sigcontext *) &rt_->uc.uc_mcontext;		\
+       }									\
+diff --git a/gcc/config/rs6000/linux.h b/gcc/config/rs6000/linux.h
+index ba70ec1..0fff8b1 100644
+--- a/gcc/config/rs6000/linux.h
++++ b/gcc/config/rs6000/linux.h
+@@ -101,7 +101,7 @@ Boston, MA 02111-1307, USA.  */
+ 
+ struct kernel_old_ucontext {
+   unsigned long     uc_flags;
+-  struct ucontext  *uc_link;
++  ucontext_t       *uc_link;
+   stack_t           uc_stack;
+   struct sigcontext_struct uc_mcontext;
+   sigset_t          uc_sigmask;
diff --git a/nixpkgs/pkgs/development/libraries/gcr/default.nix b/nixpkgs/pkgs/development/libraries/gcr/default.nix
new file mode 100644
index 000000000000..37238a5f59ec
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gcr/default.nix
@@ -0,0 +1,105 @@
+{ lib, stdenv
+, fetchurl
+, pkg-config
+, meson
+, ninja
+, gettext
+, gnupg
+, p11-kit
+, glib
+, libgcrypt
+, libtasn1
+, gtk3
+, pango
+, gobject-introspection
+, makeWrapper
+, libxslt
+, vala
+, gnome
+, python3
+, shared-mime-info
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gcr";
+  version = "3.40.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "udNkWl/ZU6VChcxk1PwEZzZGPb1NzCXK9ce1m+0wJ/U=";
+  };
+
+  postPatch = ''
+    patchShebangs build/ gcr/fixtures/
+
+    chmod +x meson_post_install.py
+    patchShebangs meson_post_install.py
+  '';
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [
+    pkg-config
+    meson
+    python3
+    ninja
+    gettext
+    gobject-introspection
+    libxslt
+    makeWrapper
+    vala
+    shared-mime-info
+  ];
+
+  buildInputs = [
+    gnupg
+    libgcrypt
+    libtasn1
+    pango
+  ];
+
+  propagatedBuildInputs = [
+    glib
+    gtk3
+    p11-kit
+  ];
+
+  checkInputs = [
+    python3
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=false"
+  ];
+
+  doCheck = false; # fails 21 out of 603 tests, needs dbus daemon
+
+  preFixup = ''
+    wrapProgram "$out/bin/gcr-viewer" \
+      --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH"
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    platforms = platforms.unix;
+    maintainers = teams.gnome.members;
+    description = "GNOME crypto services (daemon and tools)";
+    homepage = "https://gitlab.gnome.org/GNOME/gcr";
+    license = licenses.lgpl2Plus;
+
+    longDescription = ''
+      GCR is a library for displaying certificates, and crypto UI, accessing
+      key stores. It also provides the viewer for crypto files on the GNOME
+      desktop.
+
+      GCK is a library for accessing PKCS#11 modules like smart cards, in a
+      (G)object oriented way.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gd/default.nix b/nixpkgs/pkgs/development/libraries/gd/default.nix
new file mode 100644
index 000000000000..36a930956033
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gd/default.nix
@@ -0,0 +1,61 @@
+{ lib, stdenv, fetchurl, fetchpatch
+, autoconf
+, automake
+, pkg-config
+, zlib
+, libpng
+, libjpeg ? null
+, libwebp ? null
+, libtiff ? null
+, libXpm ? null
+, fontconfig
+, freetype
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gd";
+  version = "2.3.0";
+
+  src = fetchurl {
+    url = "https://github.com/libgd/libgd/releases/download/${pname}-${version}/libgd-${version}.tar.xz";
+    sha256 = "0n5czhxzinvjvmhkf5l9fwjdx5ip69k5k7pj6zwb6zs1k9dibngc";
+  };
+
+  hardeningDisable = [ "format" ];
+  patches = [
+    # Fixes an issue where some other packages would fail to build
+    # their documentation with an error like:
+    # "Error: Problem doing text layout"
+    #
+    # Can be removed if Wayland can still be built successfully with
+    # documentation.
+    (fetchpatch {
+      url = "https://github.com/libgd/libgd/commit/3dd0e308cbd2c24fde2fc9e9b707181252a2de95.patch";
+      excludes = [ "tests/gdimagestringft/.gitignore" ];
+      sha256 = "12iqlanl9czig9d7c3rvizrigw2iacimnmimfcny392dv9iazhl1";
+    })
+  ];
+
+  # -pthread gets passed to clang, causing warnings
+  configureFlags = lib.optional stdenv.isDarwin "--enable-werror=no";
+
+  nativeBuildInputs = [ autoconf automake pkg-config ];
+
+  buildInputs = [ zlib fontconfig freetype ];
+  propagatedBuildInputs = [ libpng libjpeg libwebp libtiff libXpm ];
+
+  outputs = [ "bin" "dev" "out" ];
+
+  postFixup = ''moveToOutput "bin/gdlib-config" $dev'';
+
+  enableParallelBuilding = true;
+
+  doCheck = false; # fails 2 tests
+
+  meta = with lib; {
+    homepage = "https://libgd.github.io/";
+    description = "A dynamic image creation library";
+    license = licenses.free; # some custom license
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gdal/2.4.nix b/nixpkgs/pkgs/development/libraries/gdal/2.4.nix
new file mode 100644
index 000000000000..234d986b21fa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gdal/2.4.nix
@@ -0,0 +1,82 @@
+{ lib, stdenv, fetchurl, libjpeg, libtiff, zlib
+, postgresql, libmysqlclient, libgeotiff, python2Packages, proj, geos, openssl
+, libpng, sqlite, libspatialite, poppler, hdf4, qhull, giflib, expat
+, libiconv, libxml2
+, netcdfSupport ? true, netcdf, hdf5, curl
+}:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "gdal";
+  version = "2.4.4";
+
+  src = fetchurl {
+    url = "https://download.osgeo.org/gdal/${version}/${pname}-${version}.tar.xz";
+    sha256 = "1n6w0m2603q9cldlz0wyscp75ci561dipc36jqbf3mjmylybv0x3";
+  };
+
+  buildInputs = [ libjpeg libtiff libgeotiff libpng proj openssl sqlite
+    libspatialite poppler hdf4 qhull giflib expat libxml2 proj ]
+  ++ (with python2Packages; [ python numpy wrapPython ])
+  ++ lib.optional stdenv.isDarwin libiconv
+  ++ lib.optionals netcdfSupport [ netcdf hdf5 curl ];
+
+  configureFlags = [
+    "--with-expat=${expat.dev}"
+    "--with-jpeg=${libjpeg.dev}"
+    "--with-libtiff=${libtiff.dev}" # optional (without largetiff support)
+    "--with-png=${libpng.dev}"      # optional
+    "--with-poppler=${poppler.dev}" # optional
+    "--with-libz=${zlib.dev}"       # optional
+    "--with-pg=${postgresql}/bin/pg_config"
+    "--with-mysql=${getDev libmysqlclient}/bin/mysql_config"
+    "--with-geotiff=${libgeotiff.dev}"
+    "--with-sqlite3=${sqlite.dev}"
+    "--with-spatialite=${libspatialite}"
+    "--with-python"               # optional
+    "--with-proj=${proj.dev}" # optional
+    "--with-geos=${geos}/bin/geos-config"# optional
+    "--with-hdf4=${hdf4.dev}" # optional
+    "--with-xml2=${libxml2.dev}/bin/xml2-config" # optional
+    (if netcdfSupport then "--with-netcdf=${netcdf}" else "")
+  ];
+
+  hardeningDisable = [ "format" ];
+
+  CXXFLAGS = "-fpermissive";
+
+  postPatch = ''
+    sed -i '/ifdef bool/i\
+      #ifdef swap\
+      #undef swap\
+      #endif' ogr/ogrsf_frmts/mysql/ogr_mysql.h
+  '';
+
+  # - Unset CC and CXX as they confuse libtool.
+  # - teach gdal that libdf is the legacy name for libhdf
+  preConfigure = ''
+      unset CC CXX
+      substituteInPlace configure \
+      --replace "-lmfhdf -ldf" "-lmfhdf -lhdf"
+    '';
+
+  preBuild = ''
+    substituteInPlace swig/python/GNUmakefile \
+      --replace "ifeq (\$(STD_UNIX_LAYOUT),\"TRUE\")" "ifeq (1,1)"
+  '';
+
+  postInstall = ''
+    wrapPythonPrograms
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Translator library for raster geospatial data formats";
+    homepage = "https://www.gdal.org/";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.marcweber ];
+    platforms = with lib.platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gdal/default.nix b/nixpkgs/pkgs/development/libraries/gdal/default.nix
new file mode 100644
index 000000000000..ca5eabd65302
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gdal/default.nix
@@ -0,0 +1,92 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, unzip, libjpeg, libtiff, zlib, postgresql
+, libmysqlclient, libgeotiff, pythonPackages, proj, geos, openssl, libpng
+, sqlite, libspatialite, poppler, hdf4, qhull, giflib, expat, libiconv, libxml2
+, autoreconfHook, netcdfSupport ? true, netcdf, hdf5, curl, pkg-config }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "gdal";
+  version = "3.3.1";
+
+  src = fetchFromGitHub {
+    owner = "OSGeo";
+    repo = "gdal";
+    rev = "v${version}";
+    sha256 = "0832w40a92cl8ydkv0pk7nl1ivhfhbhqbhmpqmdjpi0126jlm2y0";
+  };
+
+  sourceRoot = "source/gdal";
+
+  nativeBuildInputs = [ autoreconfHook pkg-config unzip ];
+
+  buildInputs = [
+    libjpeg
+    libtiff
+    libpng
+    proj
+    openssl
+    sqlite
+    libspatialite
+    libgeotiff
+    poppler
+    hdf4
+    qhull
+    giflib
+    expat
+    libxml2
+    postgresql
+  ] ++ (with pythonPackages; [ python numpy wrapPython ])
+    ++ lib.optional stdenv.isDarwin libiconv
+    ++ lib.optionals netcdfSupport [ netcdf hdf5 curl ];
+
+  configureFlags = [
+    "--with-expat=${expat.dev}"
+    "--with-jpeg=${libjpeg.dev}"
+    "--with-libtiff=${libtiff.dev}" # optional (without largetiff support)
+    "--with-png=${libpng.dev}" # optional
+    "--with-poppler=${poppler.dev}" # optional
+    "--with-libz=${zlib.dev}" # optional
+    "--with-pg=yes" # since gdal 3.0 doesn't use ${postgresql}/bin/pg_config
+    "--with-mysql=${getDev libmysqlclient}/bin/mysql_config"
+    "--with-geotiff=${libgeotiff}"
+    "--with-sqlite3=${sqlite.dev}"
+    "--with-spatialite=${libspatialite}"
+    "--with-python" # optional
+    "--with-proj=${proj.dev}" # optional
+    "--with-geos=${geos}/bin/geos-config" # optional
+    "--with-hdf4=${hdf4.dev}" # optional
+    "--with-xml2=yes" # optional
+    (if netcdfSupport then "--with-netcdf=${netcdf}" else "")
+  ];
+
+  hardeningDisable = [ "format" ];
+
+  CXXFLAGS = "-fpermissive";
+
+  # - Unset CC and CXX as they confuse libtool.
+  # - teach gdal that libdf is the legacy name for libhdf
+  preConfigure = ''
+    substituteInPlace configure \
+      --replace "-lmfhdf -ldf" "-lmfhdf -lhdf"
+  '';
+
+  preBuild = ''
+    substituteInPlace swig/python/GNUmakefile \
+      --replace "ifeq (\$(STD_UNIX_LAYOUT),\"TRUE\")" "ifeq (1,1)"
+  '';
+
+  postInstall = ''
+    wrapPythonPrograms
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Translator library for raster geospatial data formats";
+    homepage = "https://www.gdal.org/";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.marcweber ];
+    platforms = with lib.platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gdata-sharp/default.nix b/nixpkgs/pkgs/development/libraries/gdata-sharp/default.nix
new file mode 100644
index 000000000000..21cb79ba8158
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gdata-sharp/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchsvn, pkg-config, mono, dotnetPackages }:
+
+let
+  newtonsoft-json = dotnetPackages.NewtonsoftJson;
+in stdenv.mkDerivation {
+  pname = "gdata-sharp";
+  version = "2.2.0.0";
+
+  src = fetchsvn {
+    url = "http://google-gdata.googlecode.com/svn/trunk/";
+    rev = "1217";
+    sha256 = "0b0rvgg3xsbbg2fdrpz0ywsy9rcahlyfskndaagd3yzm83gi6bhk";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ mono newtonsoft-json ];
+
+  sourceRoot = "svn-r1217/clients/cs";
+
+  dontStrip = true;
+
+  postPatch = ''
+    sed -i -e 's#^\(DEFINES=.*\)\(.\)#\1 /r:third_party/Newtonsoft.Json.dll\2#' Makefile
+    #             carriage return ^
+  '';
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = with lib; {
+    homepage = "https://code.google.com/archive/p/google-gdata/";
+
+    description = "The Google Data APIs";
+    longDescription = ''
+      The Google Data APIs provide a simple protocol for reading and writing
+      data on the web.
+    '';
+
+    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
new file mode 100644
index 000000000000..83df37f236be
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gdbm/default.nix
@@ -0,0 +1,67 @@
+{ stdenv, lib, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "gdbm";
+  version = "1.20";
+
+  src = fetchurl {
+    url = "mirror://gnu/gdbm/${pname}-${version}.tar.gz";
+    sha256 = "sha256-OurAVkizSCoQotqYa586OAoprWUL6AuYF6Q1+4EUopI=";
+  };
+
+  doCheck = true; # not cross;
+
+  # Linking static stubs on cygwin requires correct ordering.
+  # Consider upstreaming this.
+
+  # Disable dbmfetch03.at test because it depends on unlink()
+  # failing on a link in a chmod -w directory, which cygwin
+  # apparently allows.
+  postPatch = lib.optionalString stdenv.buildPlatform.isCygwin ''
+      substituteInPlace tests/Makefile.in --replace \
+        '_LDADD = ../src/libgdbm.la ../compat/libgdbm_compat.la' \
+        '_LDADD = ../compat/libgdbm_compat.la ../src/libgdbm.la'
+      substituteInPlace tests/testsuite.at --replace \
+        'm4_include([dbmfetch03.at])' ""
+  '';
+
+  enableParallelBuilding = true;
+  configureFlags = [ "--enable-libgdbm-compat" ];
+
+  # create symlinks for compatibility
+  postInstall = ''
+    install -dm755 $out/include/gdbm
+    (
+      cd $out/include/gdbm
+      ln -s ../gdbm.h gdbm.h
+      ln -s ../ndbm.h ndbm.h
+      ln -s ../dbm.h  dbm.h
+    )
+  '';
+
+  meta = with lib; {
+    description = "GNU dbm key/value database library";
+    longDescription = ''
+       GNU dbm (or GDBM, for short) is a library of database functions that
+       use extensible hashing and work similar to the standard UNIX dbm.
+       These routines are provided to a programmer needing to create and
+       manipulate a hashed database.
+
+       The basic use of GDBM is to store key/data pairs in a data file.
+       Each key must be unique and each key is paired with only one data
+       item.
+
+       The library provides primitives for storing key/data pairs,
+       searching and retrieving the data by its key and deleting a key
+       along with its data.  It also support sequential iteration over all
+       key/data pairs in a database.
+
+       For compatibility with programs using old UNIX dbm function, the
+       package also provides traditional dbm and ndbm interfaces.
+      '';
+    homepage = "https://www.gnu.org/software/gdbm/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+    maintainers = [ maintainers.vrthra ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gdcm/default.nix b/nixpkgs/pkgs/development/libraries/gdcm/default.nix
new file mode 100644
index 000000000000..af4a5a38f7eb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gdcm/default.nix
@@ -0,0 +1,54 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, enableVTK ? true
+, vtk
+, ApplicationServices
+, Cocoa
+, enablePython ? false
+, python ? null
+, swig
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gdcm";
+  version = "3.0.9";
+
+  src = fetchFromGitHub {
+    owner = "malaterre";
+    repo = "GDCM";
+    rev = "v${version}";
+    sha256 = "sha256-wqrM8lxJM8VL+1QEdu6Gr1XWT1j9pT6gGd3yn1yokIY=";
+  };
+
+  cmakeFlags = [
+    "-DGDCM_BUILD_APPLICATIONS=ON"
+    "-DGDCM_BUILD_SHARED_LIBS=ON"
+  ] ++ lib.optionals enableVTK [
+    "-DGDCM_USE_VTK=ON"
+  ] ++ lib.optionals enablePython [
+    "-DGDCM_WRAP_PYTHON:BOOL=ON"
+    "-DGDCM_INSTALL_PYTHONMODULE_DIR=${placeholder "out"}/${python.sitePackages}"
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = lib.optionals enableVTK [
+    vtk
+  ] ++ lib.optionals stdenv.isDarwin [
+    ApplicationServices
+    Cocoa
+  ] ++ lib.optionals enablePython [ swig python ];
+
+  meta = with lib; {
+    description = "The grassroots cross-platform DICOM implementation";
+    longDescription = ''
+      Grassroots DICOM (GDCM) is an implementation of the DICOM standard designed to be open source so that researchers may access clinical data directly.
+      GDCM includes a file format definition and a network communications protocol, both of which should be extended to provide a full set of tools for a researcher or small medical imaging vendor to interface with an existing medical database.
+    '';
+    homepage = "http://gdcm.sourceforge.net/";
+    license = with licenses; [ bsd3 asl20 ];
+    maintainers = with maintainers; [ tfmoraes ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gdk-pixbuf/default.nix b/nixpkgs/pkgs/development/libraries/gdk-pixbuf/default.nix
new file mode 100644
index 000000000000..7f63d5f67e78
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gdk-pixbuf/default.nix
@@ -0,0 +1,144 @@
+{ stdenv
+, fetchurl
+, nixosTests
+, fixDarwinDylibNames
+, meson
+, ninja
+, pkg-config
+, gettext
+, python3
+, libxslt
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+, gi-docgen
+, glib
+, libtiff
+, libjpeg
+, libpng
+, gnome
+, gobject-introspection
+, doCheck ? false
+, makeWrapper
+, lib
+}:
+
+let
+  withGtkDoc = stdenv.buildPlatform == stdenv.hostPlatform;
+in
+stdenv.mkDerivation rec {
+  pname = "gdk-pixbuf";
+  version = "2.42.6";
+
+  outputs = [ "out" "dev" "man" ]
+    ++ lib.optional withGtkDoc "devdoc"
+    ++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) "installedTests";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0zz7pmw2z46g7mr1yjxbsdldd5pd03xbjc58inj8rxfqgrdvg9n4";
+  };
+
+  patches = [
+    # Move installed tests to a separate output
+    ./installed-tests-path.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gettext
+    python3
+    gobject-introspection
+    makeWrapper
+    glib
+    gi-docgen
+
+    # for man pages
+    libxslt
+    docbook-xsl-nons
+    docbook_xml_dtd_43
+  ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
+
+  propagatedBuildInputs = [
+    glib
+    libtiff
+    libjpeg
+    libpng
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=${lib.boolToString withGtkDoc}"
+    "-Dintrospection=${if (stdenv.buildPlatform == stdenv.hostPlatform) then "enabled" else "disabled"}"
+    "-Dgio_sniffing=false"
+  ];
+
+  postPatch = ''
+    chmod +x build-aux/* # patchShebangs only applies to executables
+    patchShebangs build-aux
+
+    substituteInPlace tests/meson.build --subst-var-by installedtestsprefix "$installedTests"
+  '';
+
+  preInstall = ''
+    PATH=$PATH:$out/bin # for install script
+  '';
+
+  postInstall =
+    ''
+      # All except one utility seem to be only useful during building.
+      moveToOutput "bin" "$dev"
+      moveToOutput "bin/gdk-pixbuf-thumbnailer" "$out"
+
+    '' + lib.optionalString stdenv.isDarwin ''
+      # meson erroneously installs loaders with .dylib extension on Darwin.
+      # Their @rpath has to be replaced before gdk-pixbuf-query-loaders looks at them.
+      for f in $out/${passthru.moduleDir}/*.dylib; do
+          install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f
+          mv $f ''${f%.dylib}.so
+      done
+    '' + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
+      # We need to install 'loaders.cache' in lib/gdk-pixbuf-2.0/2.10.0/
+      $dev/bin/gdk-pixbuf-query-loaders --update-cache
+    '' + lib.optionalString withGtkDoc ''
+      # So that devhelp can find this.
+      mkdir -p "$devdoc/share/devhelp"
+      mv "$out/share/doc" "$devdoc/share/devhelp/books"
+    '';
+
+  # The fixDarwinDylibNames hook doesn't patch binaries.
+  preFixup = lib.optionalString stdenv.isDarwin ''
+    for f in $out/bin/* $dev/bin/*; do
+        install_name_tool -change @rpath/libgdk_pixbuf-2.0.0.dylib $out/lib/libgdk_pixbuf-2.0.0.dylib $f
+    done
+  '';
+
+  # The tests take an excessive amount of time (> 1.5 hours) and memory (> 6 GB).
+  inherit doCheck;
+
+  setupHook = ./setup-hook.sh;
+
+  separateDebugInfo = stdenv.isLinux;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+
+    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";
+  };
+
+  meta = with lib; {
+    description = "A library for image loading and manipulation";
+    homepage = "https://gitlab.gnome.org/GNOME/gdk-pixbuf";
+    maintainers = [ maintainers.eelco ] ++ teams.gnome.members;
+    license = licenses.lgpl21Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gdk-pixbuf/installed-tests-path.patch b/nixpkgs/pkgs/development/libraries/gdk-pixbuf/installed-tests-path.patch
new file mode 100644
index 000000000000..1da2b0a10dcd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gdk-pixbuf/installed-tests-path.patch
@@ -0,0 +1,13 @@
+--- a/tests/meson.build
++++ b/tests/meson.build
+@@ -85,8 +85,8 @@
+   'aero.gif',
+ ]
+ 
+-installed_test_bindir = join_paths(gdk_pixbuf_libexecdir, 'installed-tests', meson.project_name())
+-installed_test_datadir = join_paths(gdk_pixbuf_datadir, 'installed-tests', meson.project_name())
++installed_test_bindir = join_paths('@installedtestsprefix@', 'libexec', 'installed-tests', meson.project_name())
++installed_test_datadir = join_paths('@installedtestsprefix@', 'share', 'installed-tests', meson.project_name())
+ 
+ install_data(test_data, install_dir: installed_test_bindir)
+ install_subdir('test-images', install_dir: installed_test_bindir)
diff --git a/nixpkgs/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh b/nixpkgs/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
new file mode 100644
index 000000000000..bdfd00009dc5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gdk-pixbuf/setup-hook.sh
@@ -0,0 +1,17 @@
+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)" > "$(cat "$GDK_PIXBUF_MODULE_FILE" | wc -l)" )); then
+				export GDK_PIXBUF_MODULE_FILE="$loadersCache"
+			fi
+		else
+			export GDK_PIXBUF_MODULE_FILE="$loadersCache"
+		fi
+	fi
+
+}
+
+addEnvHooks "$targetOffset" findGdkPixbufLoaders
diff --git a/nixpkgs/pkgs/development/libraries/gdk-pixbuf/xlib.nix b/nixpkgs/pkgs/development/libraries/gdk-pixbuf/xlib.nix
new file mode 100644
index 000000000000..bc4c14beb458
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gdk-pixbuf/xlib.nix
@@ -0,0 +1,52 @@
+{ lib, stdenv
+, fetchFromGitLab
+, meson
+, ninja
+, pkg-config
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+, gtk-doc
+, gdk-pixbuf
+, libX11
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gdk-pixbuf-xlib";
+  version = "2020-06-11-unstable";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchFromGitLab {
+    domain = "gitlab.gnome.org";
+    owner = "Archive";
+    repo = "gdk-pixbuf-xlib";
+    rev = "3116b8ae55501cf48d16970aa2b50a5530e15223";
+    sha256 = "15wisf2xld3cr7lprnic8fvwpcmww4rydwc1bn2zilyi52vzl2zd";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    docbook-xsl-nons
+    docbook_xml_dtd_43
+    gtk-doc
+  ];
+
+  propagatedBuildInputs = [
+    gdk-pixbuf
+    libX11
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=true"
+  ];
+
+  meta = with lib; {
+    description = "Deprecated API for integrating GdkPixbuf with Xlib data types";
+    homepage = "https://gitlab.gnome.org/Archive/gdk-pixbuf-xlib";
+    maintainers = teams.gnome.members;
+    license = licenses.lgpl21Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gdl/default.nix b/nixpkgs/pkgs/development/libraries/gdl/default.nix
new file mode 100644
index 000000000000..5b73e3d7a139
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gdl/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, pkg-config, libxml2, gtk3, gnome, intltool }:
+
+stdenv.mkDerivation rec {
+  pname = "gdl";
+  version = "3.34.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gdl/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "00ldva6wg6s4wlxmisiqzyz8ihsprra7sninx2rlqk6frpq312w5";
+  };
+
+  nativeBuildInputs = [ pkg-config intltool ];
+  buildInputs = [ libxml2 gtk3 ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = "gdl";
+    };
+  };
+
+  meta = with lib; {
+    description = "Gnome docking library";
+    homepage = "https://developer.gnome.org/gdl/";
+    maintainers = teams.gnome.members;
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gdome2/default.nix b/nixpkgs/pkgs/development/libraries/gdome2/default.nix
new file mode 100644
index 000000000000..a7dd1f980138
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gdome2/default.nix
@@ -0,0 +1,30 @@
+{lib, stdenv, fetchurl, pkg-config, glib, libxml2, gtk-doc}:
+
+let
+  pname = "gdome2";
+  version = "0.8.1";
+in
+
+stdenv.mkDerivation {
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "http://gdome2.cs.unibo.it/tarball/${pname}-${version}.tar.gz";
+    sha256 = "0hyms5s3hziajp3qbwdwqjc2xcyhb783damqg8wxjpwfxyi81fzl";
+  };
+
+  hardeningDisable = [ "format" ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ glib libxml2 gtk-doc ];
+  propagatedBuildInputs = [glib libxml2];
+  patches = [ ./xml-document.patch ];
+
+  meta = with lib; {
+    homepage = "http://gdome2.cs.unibo.it/";
+    description = "DOM C library developed for the Gnome project";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ prikhi roconnor ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gdome2/xml-document.patch b/nixpkgs/pkgs/development/libraries/gdome2/xml-document.patch
new file mode 100644
index 000000000000..7567d1049fc0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gdome2/xml-document.patch
@@ -0,0 +1,11 @@
+--- a/libgdome/gdomecore/gdome-xml-documentt.c	2003-07-13 14:47:54.000000000 +0400
++++ b/libgdome/gdomecore/gdome-xml-documentt.c	2013-07-02 14:09:18.304613703 +0400
+@@ -342,7 +342,7 @@
+ 	}
+ 	xmlNodeDumpOutput (out_buff, NULL, (xmlNode *)is, 0, 0, NULL);
+ 	xmlOutputBufferFlush(out_buff);
+-	ret = g_strndup (out_buff->buffer->content, out_buff->buffer->use);
++	ret = g_strndup (xmlBufContent(out_buff), xmlBufUse(out_buff));
+ 	(void)xmlOutputBufferClose(out_buff);
+
+ 	return gdome_xml_str_mkref_own (ret);
diff --git a/nixpkgs/pkgs/development/libraries/gecode/3.nix b/nixpkgs/pkgs/development/libraries/gecode/3.nix
new file mode 100644
index 000000000000..5c660a99ef84
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gecode/3.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, bash, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "gecode";
+  version = "3.7.3";
+
+  src = fetchurl {
+    url = "http://www.gecode.org/download/${pname}-${version}.tar.gz";
+    sha256 = "0k45jas6p3cyldgyir1314ja3174sayn2h2ly3z9b4dl3368pk77";
+  };
+
+  nativeBuildInputs = [ bash perl ];
+
+  preConfigure = "patchShebangs configure";
+
+  meta = with lib; {
+    license = licenses.mit;
+    homepage = "https://www.gecode.org";
+    description = "Toolkit for developing constraint-based systems";
+    platforms = platforms.all;
+    maintainers = [ maintainers.manveru ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gecode/default.nix b/nixpkgs/pkgs/development/libraries/gecode/default.nix
new file mode 100644
index 000000000000..fc9835d85db5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gecode/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, bison, flex, perl, gmp, mpfr, enableGist ? true, qtbase }:
+
+stdenv.mkDerivation rec {
+  pname = "gecode";
+  version = "6.2.0";
+
+  src = fetchFromGitHub {
+    owner = "Gecode";
+    repo = "gecode";
+    rev = "release-${version}";
+    sha256 = "0b1cq0c810j1xr2x9y9996p894571sdxng5h74py17c6nr8c6dmk";
+  };
+
+  enableParallelBuilding = true;
+  dontWrapQtApps = true;
+  nativeBuildInputs = [ bison flex ];
+  buildInputs = [ perl gmp mpfr ]
+    ++ lib.optional enableGist qtbase;
+
+  meta = with lib; {
+    license = licenses.mit;
+    homepage = "https://www.gecode.org";
+    description = "Toolkit for developing constraint-based systems";
+    platforms = platforms.all;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gegl/default.nix b/nixpkgs/pkgs/development/libraries/gegl/default.nix
new file mode 100644
index 000000000000..11f4f070c08f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gegl/default.nix
@@ -0,0 +1,121 @@
+{ lib
+, stdenv
+, fetchurl
+, pkg-config
+, vala
+, gobject-introspection
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+, glib
+, babl
+, libpng
+, cairo
+, libjpeg
+, librsvg
+, lensfun
+, libspiro
+, maxflow
+, netsurf
+, pango
+, poly2tri-c
+, poppler
+, bzip2
+, json-glib
+, gettext
+, meson
+, ninja
+, libraw
+, gexiv2
+, libwebp
+, luajit
+, openexr
+, OpenCL
+, suitesparse
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gegl";
+  version = "0.4.30";
+
+  outputs = [ "out" "dev" "devdoc" ];
+  outputBin = "dev";
+
+  src = fetchurl {
+    url = "https://download.gimp.org/pub/gegl/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-wRJ4LPQJaWniMhfM36vkIoTjXVQ1/wxD1A5McPrsqN0=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    gettext
+    meson
+    ninja
+    vala
+    gobject-introspection
+    gtk-doc
+    docbook-xsl-nons
+    docbook_xml_dtd_43
+  ];
+
+  buildInputs = [
+    libpng
+    cairo
+    libjpeg
+    librsvg
+    lensfun
+    libspiro
+    maxflow
+    netsurf.libnsgif
+    pango
+    poly2tri-c
+    poppler
+    bzip2
+    libraw
+    libwebp
+    gexiv2
+    luajit
+    openexr
+    suitesparse
+  ] ++ 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"
+    # Disabled due to multiple vulnerabilities, see
+    # https://github.com/NixOS/nixpkgs/pull/73586
+    "-Djasper=disabled"
+  ];
+
+  # 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
+    patchShebangs tests/ff-load-save/tests_ff_load_save.sh tests/opencl/opencl_test.sh tools/xml_insert.sh
+  '';
+
+  # tests fail to connect to the com.apple.fonts daemon in sandboxed mode
+  doCheck = !stdenv.isDarwin;
+
+  meta = with lib; {
+    description = "Graph-based image processing framework";
+    homepage = "https://www.gegl.org";
+    license = licenses.lgpl3Plus;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/geis/default.nix b/nixpkgs/pkgs/development/libraries/geis/default.nix
new file mode 100644
index 000000000000..1c1d4cfe507b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/geis/default.nix
@@ -0,0 +1,60 @@
+{ lib, stdenv, fetchurl
+, pkg-config
+, python3Packages
+, wrapGAppsHook
+, atk
+, dbus
+, evemu
+, frame
+, gdk-pixbuf
+, gobject-introspection
+, grail
+, gtk3
+, libX11
+, libXext
+, libXi
+, libXtst
+, pango
+, xorgserver
+}:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "geis";
+  version = "2.2.17";
+
+  src = fetchurl {
+    url = "https://launchpad.net/geis/trunk/${version}/+download/${pname}-${version}.tar.xz";
+    sha256 = "1svhbjibm448ybq6gnjjzj0ak42srhihssafj0w402aj71lgaq4a";
+  };
+
+  NIX_CFLAGS_COMPILE = "-Wno-error=misleading-indentation -Wno-error=pointer-compare";
+
+  hardeningDisable = [ "format" ];
+
+  pythonPath = with python3Packages;
+    [ pygobject3  ];
+
+  nativeBuildInputs = [ pkg-config wrapGAppsHook python3Packages.wrapPython];
+  buildInputs = [ atk dbus evemu frame gdk-pixbuf gobject-introspection grail
+    gtk3 libX11 libXext libXi libXtst pango python3Packages.python xorgserver
+  ];
+
+  patchPhase = ''
+    substituteInPlace python/geis/geis_v2.py --replace \
+      "ctypes.util.find_library(\"geis\")" "'$out/lib/libgeis.so'"
+  '';
+
+  preFixup = ''
+    buildPythonPath "$out $pythonPath"
+    gappsWrapperArgs+=(--set PYTHONPATH "$program_PYTHONPATH")
+  '';
+
+  meta = {
+    description = "A library for input gesture recognition";
+    homepage = "https://launchpad.net/geis";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/genann/default.nix b/nixpkgs/pkgs/development/libraries/genann/default.nix
new file mode 100644
index 000000000000..f1d7373183ab
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/genann/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "genann";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "codeplea";
+    repo = "genann";
+    rev = "v${version}";
+    sha256 = "0z45ndpd4a64i6jayr4yxfcr5h87bsmhm7lfgnbp35pnfywiclmq";
+  };
+
+  dontBuild = true;
+  doCheck = true;
+
+  # Nix doesn't seem to recognize this by default.
+  checkPhase = ''
+    make check
+  '';
+
+  installPhase = ''
+    mkdir -p $out/include
+    cp ./genann.{h,c} $out/include
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/codeplea/genann";
+    description = "Simple neural network library in ANSI C";
+    license = licenses.zlib;
+    maintainers = [ maintainers.ivar ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gensio/default.nix b/nixpkgs/pkgs/development/libraries/gensio/default.nix
new file mode 100644
index 000000000000..0cd2f79ea552
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gensio/default.nix
@@ -0,0 +1,39 @@
+{ autoreconfHook
+, fetchFromGitHub
+, lib
+, nix-update-script
+, pkg-config
+, stdenv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gensio";
+  version = "2.2.8";
+
+  src = fetchFromGitHub {
+    owner = "cminyard";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-6+hYytLMg5E1KTBPWSteVu2VjF0APkcoOiigqzrBI+U=";
+  };
+
+  passthru = {
+    updateScript = nix-update-script {
+      attrPath = pname;
+    };
+  };
+
+  configureFlags = [
+    "--with-python=no"
+  ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  meta = with lib; {
+    description = "General Stream I/O";
+    homepage = "https://sourceforge.net/projects/ser2net/";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ emantor ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/geoclue/add-option-for-installation-sysconfdir.patch b/nixpkgs/pkgs/development/libraries/geoclue/add-option-for-installation-sysconfdir.patch
new file mode 100644
index 000000000000..63948ab4fad3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/geoclue/add-option-for-installation-sysconfdir.patch
@@ -0,0 +1,84 @@
+diff --git a/data/meson.build b/data/meson.build
+index c189753..12c10cb 100644
+--- a/data/meson.build
++++ b/data/meson.build
+@@ -7,7 +7,7 @@ if get_option('enable-backend')
+         conf.set('demo_agent', '')
+     endif
+ 
+-    conf_dir = join_paths(sysconfdir, 'geoclue')
++    conf_dir = join_paths(sysconfdir_install, 'geoclue')
+     configure_file(output: 'geoclue.conf',
+                    input: 'geoclue.conf.in',
+                    configuration: conf,
+@@ -16,7 +16,7 @@ if get_option('enable-backend')
+     conf = configuration_data()
+     conf.set('libexecdir', libexecdir)
+     conf.set('dbus_srv_user', get_option('dbus-srv-user'))
+-    conf.set('sysconfdir', sysconfdir)
++    conf.set('sysconfdir', sysconfdir_install)
+ 
+     service_dir = join_paths(datadir, 'dbus-1', 'system-services')
+     configure_file(output: 'org.freedesktop.GeoClue2.service',
+@@ -33,7 +33,7 @@ if get_option('enable-backend')
+     # DBus Service policy file
+     dbus_service_dir = get_option('dbus-sys-dir')
+     if dbus_service_dir == ''
+-        dbus_service_dir = join_paths(sysconfdir, 'dbus-1', 'system.d')
++        dbus_service_dir = join_paths(sysconfdir_install, 'dbus-1', 'system.d')
+     endif
+     configure_file(output: 'org.freedesktop.GeoClue2.conf',
+                    input: 'org.freedesktop.GeoClue2.conf.in',
+diff --git a/demo/meson.build b/demo/meson.build
+index 1427fbe..2623f16 100644
+--- a/demo/meson.build
++++ b/demo/meson.build
+@@ -54,7 +54,7 @@ if get_option('demo-agent')
+                                    install_dir: desktop_dir)
+ 
+     # Also install in the autostart directory.
+-    autostart_dir = join_paths(sysconfdir, 'xdg', 'autostart')
++    autostart_dir = join_paths(sysconfdir_install, 'xdg', 'autostart')
+     meson.add_install_script('install-file.py',
+                              desktop_file.full_path(),
+                              autostart_dir)
+diff --git a/meson.build b/meson.build
+index fde6fa3..39b7b0a 100644
+--- a/meson.build
++++ b/meson.build
+@@ -12,7 +12,11 @@ gclue_api_version='2.0'
+ datadir = join_paths(get_option('prefix'), get_option('datadir'))
+ includedir = join_paths(get_option('prefix'), get_option('includedir'))
+ libexecdir = join_paths(get_option('prefix'), get_option('libexecdir'))
+-sysconfdir = join_paths(get_option('prefix'), get_option('sysconfdir'))
++if get_option('sysconfdir_install') != ''
++  sysconfdir_install = join_paths(get_option('prefix'), get_option('sysconfdir_install'))
++else
++  sysconfdir_install = get_option('sysconfdir')
++endif
+ localedir = join_paths(datadir, 'locale')
+ 
+ header_dir = 'libgeoclue-' + gclue_api_version
+@@ -29,7 +33,7 @@ conf.set_quoted('PACKAGE_URL', 'https://gitlab.freedesktop.org/geoclue/geoclue/w
+ conf.set_quoted('PACKAGE_BUGREPORT', 'https://gitlab.freedesktop.org/geoclue/geoclue/issues/new')
+ conf.set_quoted('TEST_SRCDIR', meson.source_root() + '/data/')
+ conf.set_quoted('LOCALEDIR', localedir)
+-conf.set_quoted('SYSCONFDIR', sysconfdir)
++conf.set_quoted('SYSCONFDIR', get_option('sysconfdir'))
+ conf.set_quoted('MOZILLA_API_KEY', get_option('mozilla-api-key'))
+ conf.set10('GCLUE_USE_3G_SOURCE', get_option('3g-source'))
+ conf.set10('GCLUE_USE_CDMA_SOURCE', get_option('cdma-source'))
+diff --git a/meson_options.txt b/meson_options.txt
+index 83bc60e..b726329 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -34,6 +34,9 @@ option('systemd-system-unit-dir',
+ option('dbus-srv-user',
+        type: 'string', value: 'root',
+        description: 'The user (existing) as which the service will run')
++option('sysconfdir_install',
++       type: 'string', value: '',
++       description: 'sysconfdir to use during installation')
+ option('mozilla-api-key',
+        type: 'string', value: 'geoclue',
+        description: 'Your API key for Mozilla Location Service')
diff --git a/nixpkgs/pkgs/development/libraries/geoclue/default.nix b/nixpkgs/pkgs/development/libraries/geoclue/default.nix
new file mode 100644
index 000000000000..360094ea7655
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/geoclue/default.nix
@@ -0,0 +1,114 @@
+{ lib
+, stdenv
+, fetchFromGitLab
+, fetchpatch
+, intltool
+, meson
+, ninja
+, pkg-config
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_412
+, glib
+, json-glib
+, libsoup
+, libnotify
+, gdk-pixbuf
+, modemmanager
+, avahi
+, glib-networking
+, python3
+, wrapGAppsHook
+, gobject-introspection
+, vala
+, withDemoAgent ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "geoclue";
+  version = "2.5.7";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchFromGitLab {
+    domain = "gitlab.freedesktop.org";
+    owner = pname;
+    repo = pname;
+    rev = version;
+    sha256 = "1mv1vs4q94bqkmgkj53jcsw1x31kczwydyy3r27a7fycgzmii1pj";
+  };
+
+  patches = [
+    # Make the Mozilla API key configurable
+    # https://gitlab.freedesktop.org/geoclue/geoclue/merge_requests/54 (only partially backported)
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/geoclue/geoclue/commit/95c9ad4dc176860c85a07d0db4cb4179929bdb54.patch";
+      sha256 = "/lq/dLBJl2vf16tt7emYoTtXY6iUw+4s2XcABUHp3Kc=";
+    })
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/geoclue/geoclue/commit/1a00809a0d89b0849a57647c878d192354247a33.patch";
+      sha256 = "6FuiukgFWg2cEKt8LlKP4E0rfSH/ZQgk6Ip1mGJpNFQ=";
+    })
+
+    ./add-option-for-installation-sysconfdir.patch
+  ];
+
+  nativeBuildInputs = [
+    pkg-config
+    intltool
+    meson
+    ninja
+    wrapGAppsHook
+    python3
+    vala
+    gobject-introspection
+    # devdoc
+    gtk-doc
+    docbook-xsl-nons
+    docbook_xml_dtd_412
+  ];
+
+  buildInputs = [
+    glib
+    json-glib
+    libsoup
+    avahi
+  ] ++ lib.optionals withDemoAgent [
+    libnotify gdk-pixbuf
+  ] ++ lib.optionals (!stdenv.isDarwin) [
+    modemmanager
+  ];
+
+  propagatedBuildInputs = [
+    glib
+    glib-networking
+  ];
+
+  mesonFlags = [
+    "-Dsystemd-system-unit-dir=${placeholder "out"}/etc/systemd/system"
+    "-Ddemo-agent=${lib.boolToString withDemoAgent}"
+    "--sysconfdir=/etc"
+    "-Dsysconfdir_install=${placeholder "out"}/etc"
+    "-Dmozilla-api-key=5c28d1f4-9511-47ff-b11a-2bef80fc177c"
+    "-Ddbus-srv-user=geoclue"
+    "-Ddbus-sys-dir=${placeholder "out"}/share/dbus-1/system.d"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "-D3g-source=false"
+    "-Dcdma-source=false"
+    "-Dmodem-gps-source=false"
+    "-Dnmea-source=false"
+  ];
+
+  postPatch = ''
+    chmod +x demo/install-file.py
+    patchShebangs demo/install-file.py
+  '';
+
+  meta = with lib; {
+    description = "Geolocation framework and some data providers";
+    homepage = "https://gitlab.freedesktop.org/geoclue/geoclue/wikis/home";
+    maintainers = with maintainers; [ raskin ];
+    platforms = with platforms; linux ++ darwin;
+    license = licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/geocode-glib/default.nix b/nixpkgs/pkgs/development/libraries/geocode-glib/default.nix
new file mode 100644
index 000000000000..458e0d59a0d5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/geocode-glib/default.nix
@@ -0,0 +1,37 @@
+{ fetchurl, lib, stdenv, meson, ninja, pkg-config, gettext, gtk-doc, docbook_xsl, gobject-introspection, gnome, libsoup, json-glib, glib }:
+
+stdenv.mkDerivation rec {
+  pname = "geocode-glib";
+  version = "3.26.2";
+
+  outputs = [ "out" "dev" "devdoc" "installedTests" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/geocode-glib/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1l8g0f13xgkrk335afr9w8k46mziwb2jnyhl07jccl5yl37q9zh1";
+  };
+
+  nativeBuildInputs = [ meson ninja pkg-config gettext gtk-doc docbook_xsl gobject-introspection ];
+  buildInputs = [ glib libsoup json-glib ];
+
+  patches = [
+    ./installed-tests-path.patch
+  ];
+
+  postPatch = ''
+    substituteInPlace geocode-glib/tests/meson.build --subst-var-by "installedTests" "$installedTests"
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+    };
+  };
+
+  meta = with lib; {
+    description = "A convenience library for the geocoding and reverse geocoding using Nominatim service";
+    license = licenses.lgpl2Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/geocode-glib/installed-tests-path.patch b/nixpkgs/pkgs/development/libraries/geocode-glib/installed-tests-path.patch
new file mode 100644
index 000000000000..499c68008088
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/geocode-glib/installed-tests-path.patch
@@ -0,0 +1,8 @@
+--- a/geocode-glib/tests/meson.build
++++ b/geocode-glib/tests/meson.build
+@@ -1,4 +1,4 @@
+-install_dir = get_option('libexecdir') + '/installed-tests/geocode-glib'
++install_dir = '@installedTests@/libexec/installed-tests/geocode-glib'
+ 
+ e = executable('geo-uri',
+                'geo-uri.c',
diff --git a/nixpkgs/pkgs/development/libraries/geoip/default.nix b/nixpkgs/pkgs/development/libraries/geoip/default.nix
new file mode 100644
index 000000000000..8747433047c6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/geoip/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook
+, drvName ? "geoip"
+
+# in geoipDatabase, you can insert a package defining
+# "${geoipDatabase}/share/GeoIP" e.g. geolite-legacy
+, geoipDatabase ? "/var/lib/geoip-databases"
+}:
+
+let
+  dataDir = if 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}";
+    sha256 = "0ixyp3h51alnncr17hqp1p0rlqz9w69nlhm60rbzjjz3vjx52ajv";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  # Cross compilation shenanigans
+  configureFlags = 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 = with 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
new file mode 100644
index 000000000000..355e9e5f07ff
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/geos/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "geos";
+  version = "3.9.1";
+
+  src = fetchurl {
+    url = "https://download.osgeo.org/geos/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-fmMFB9ysncB1ZdJJom8GoVyfWwxS3SkSmg49OB1+OCo=";
+  };
+
+  enableParallelBuilding = true;
+
+  # https://trac.osgeo.org/geos/ticket/993
+  configureFlags = lib.optional stdenv.isAarch32 "--disable-inline";
+
+  meta = with lib; {
+    description = "C++ port of the Java Topology Suite (JTS)";
+    homepage = "https://trac.osgeo.org/geos";
+    license = licenses.lgpl21Only;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/getdata/default.nix b/nixpkgs/pkgs/development/libraries/getdata/default.nix
new file mode 100644
index 000000000000..25321c22434e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/getdata/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, fetchpatch, libtool }:
+stdenv.mkDerivation rec {
+  pname = "getdata";
+  version = "0.10.0";
+  src = fetchurl {
+    url = "mirror://sourceforge/getdata/${pname}-${version}.tar.xz";
+    sha256 = "18xbb32vygav9x6yz0gdklif4chjskmkgp06rwnjdf9myhia0iym";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://sources.debian.org/data/main/libg/libgetdata/0.10.0-10/debian/patches/CVE-2021-20204.patch";
+      sha256 = "1lvp1c2pkk9kxniwlvax6d8fsmjrkpxawf71c7j4rfjm6dgvivzm";
+    })
+  ];
+
+  buildInputs = [ libtool ];
+
+  meta = with lib; {
+    description = "Reference implementation of the Dirfile Standards";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.all;
+    maintainers = [ maintainers.vbgl ];
+    homepage = "http://getdata.sourceforge.net/";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/getdns/default.nix b/nixpkgs/pkgs/development/libraries/getdns/default.nix
new file mode 100644
index 000000000000..edf0ac27ea97
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/getdns/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, unbound, libidn2, openssl, doxygen, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "getdns";
+  version = "1.6.0";
+  versionRewrite = builtins.splitVersion version;
+
+  src = fetchurl {
+    url = "https://getdnsapi.net/releases/${pname}-${
+        builtins.concatStringsSep "-" versionRewrite
+      }/${pname}-${version}.tar.gz";
+    sha256 = "0jhg7258wz287kjymimvdvv04n69lwxdc3sb62l2p453f5s77ra0";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ unbound libidn2 openssl doxygen ];
+
+  meta = with lib; {
+    description = "A modern asynchronous DNS API";
+    longDescription = ''
+      getdns is an implementation of a modern asynchronous DNS API; the
+      specification was originally edited by Paul Hoffman. It is intended to make all
+      types of DNS information easily available to application developers and non-DNS
+      experts. DNSSEC offers a unique global infrastructure for establishing and
+      enhancing cryptographic trust relations. With the development of this API the
+      developers intend to offer application developers a modern and flexible
+      interface that enables end-to-end trust in the DNS architecture, and which will
+      inspire application developers to implement innovative security solutions in
+      their applications.
+    '';
+    homepage = "https://getdnsapi.net";
+    maintainers = with maintainers; [ leenaars ehmry ];
+    license = licenses.bsd3;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gettext/absolute-paths.diff b/nixpkgs/pkgs/development/libraries/gettext/absolute-paths.diff
new file mode 100644
index 000000000000..af37f61a9a41
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gettext/absolute-paths.diff
@@ -0,0 +1,21 @@
+diff --git a/gettext-runtime/src/gettext.sh.in b/gettext-runtime/src/gettext.sh.in
+index 1dfa3bb..d6ef8a8 100644
+--- a/gettext-runtime/src/gettext.sh.in
++++ b/gettext-runtime/src/gettext.sh.in
+@@ -86,14 +86,14 @@ fi
+ # looks up the translation of MSGID and substitutes shell variables in the
+ # result.
+ eval_gettext () {
+-  gettext "$1" | (export PATH `envsubst --variables "$1"`; envsubst "$1")
++  @out@/bin/gettext "$1" | (export PATH `@out@/bin/envsubst --variables "$1"`; @out@/bin/envsubst "$1")
+ }
+ 
+ # eval_ngettext MSGID MSGID-PLURAL COUNT
+ # looks up the translation of MSGID / MSGID-PLURAL for COUNT and substitutes
+ # shell variables in the result.
+ eval_ngettext () {
+-  ngettext "$1" "$2" "$3" | (export PATH `envsubst --variables "$1 $2"`; envsubst "$1 $2")
++  @out@/bin/ngettext "$1" "$2" "$3" | (export PATH `@out@/bin/envsubst --variables "$1 $2"`; @out@/bin/envsubst "$1 $2")
+ }
+ 
+ # Note: This use of envsubst is much safer than using the shell built-in 'eval'
diff --git a/nixpkgs/pkgs/development/libraries/gettext/default.nix b/nixpkgs/pkgs/development/libraries/gettext/default.nix
new file mode 100644
index 000000000000..c9ee5866f597
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gettext/default.nix
@@ -0,0 +1,99 @@
+{ stdenv, lib, fetchurl, libiconv, xz }:
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+stdenv.mkDerivation rec {
+  pname = "gettext";
+  version = "0.21";
+
+  src = fetchurl {
+    url = "mirror://gnu/gettext/${pname}-${version}.tar.gz";
+    sha256 = "04kbg1sx0ncfrsbr85ggjslqkzzb243fcw9nyh3rrv1a22ihszf7";
+  };
+  patches = [
+    ./absolute-paths.diff
+  ];
+
+  outputs = [ "out" "man" "doc" "info" ];
+
+  hardeningDisable = [ "format" ];
+
+  LDFLAGS = if stdenv.isSunOS then "-lm -lmd -lmp -luutil -lnvpair -lnsl -lidmap -lavl -lsec" else "";
+
+  configureFlags = [
+     "--disable-csharp" "--with-xz"
+  ] ++ 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
+    # own wchar.h file, which does not cope well with the system's
+    # wchar.h and stddef.h (gcc-4.3 - glibc-2.9)
+    "gl_cv_func_wcwidth_works=yes"
+  ];
+
+  postPatch = ''
+   substituteAllInPlace gettext-runtime/src/gettext.sh.in
+   substituteInPlace gettext-tools/projects/KDE/trigger --replace "/bin/pwd" pwd
+   substituteInPlace gettext-tools/projects/GNOME/trigger --replace "/bin/pwd" pwd
+   substituteInPlace gettext-tools/src/project-id --replace "/bin/pwd" pwd
+  '' + lib.optionalString stdenv.hostPlatform.isCygwin ''
+    sed -i -e "s/\(cldr_plurals_LDADD = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in
+    sed -i -e "s/\(libgettextsrc_la_LDFLAGS = \)/\\1..\/gnulib-lib\/libxml_rpl.la /" gettext-tools/src/Makefile.in
+  '';
+
+  nativeBuildInputs = [
+    xz
+    xz.bin
+  ];
+  # HACK, see #10874 (and 14664)
+  buildInputs = lib.optional (!stdenv.isLinux && !stdenv.hostPlatform.isCygwin) libiconv;
+
+  setupHooks = [
+    ../../../build-support/setup-hooks/role.bash
+    ./gettext-setup-hook.sh
+  ];
+  gettextNeedsLdflags = stdenv.hostPlatform.libc != "glibc" && !stdenv.hostPlatform.isMusl;
+
+  enableParallelBuilding = true;
+  enableParallelChecking = false; # fails sometimes
+
+  meta = with lib; {
+    description = "Well integrated set of translation tools and documentation";
+
+    longDescription = ''
+      Usually, programs are written and documented in English, and use
+      English at execution time for interacting with users.  Using a common
+      language is quite handy for communication between developers,
+      maintainers and users from all countries.  On the other hand, most
+      people are less comfortable with English than with their own native
+      language, and would rather be using their mother tongue for day to
+      day's work, as far as possible.  Many would simply love seeing their
+      computer screen showing a lot less of English, and far more of their
+      own language.
+
+      GNU `gettext' is an important step for the GNU Translation Project, as
+      it is an asset on which we may build many other steps. This package
+      offers to programmers, translators, and even users, a well integrated
+      set of tools and documentation. Specifically, the GNU `gettext'
+      utilities are a set of tools that provides a framework to help other
+      GNU packages produce multi-lingual messages.
+    '';
+
+    homepage = "https://www.gnu.org/software/gettext/";
+
+    maintainers = with maintainers; [ zimbatm vrthra ];
+    license = licenses.gpl2Plus;
+    platforms = platforms.all;
+  };
+}
+
+// lib.optionalAttrs stdenv.isDarwin {
+  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
new file mode 100644
index 000000000000..5cc9655a89bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gettext/gettext-setup-hook.sh
@@ -0,0 +1,17 @@
+gettextDataDirsHook() {
+    # See pkgs/build-support/setup-hooks/role.bash
+    getHostRoleEnvHook
+    if [ -d "$1/share/gettext" ]; then
+        addToSearchPath "GETTEXTDATADIRS${role_post}" "$1/share/gettext"
+    fi
+}
+
+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
+    # See pkgs/build-support/setup-hooks/role.bash
+    getHostRole
+    export NIX_LDFLAGS${role_post}+=" -lintl"
+fi
diff --git a/nixpkgs/pkgs/development/libraries/gexiv2/default.nix b/nixpkgs/pkgs/development/libraries/gexiv2/default.nix
new file mode 100644
index 000000000000..c46a42049bce
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gexiv2/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, exiv2, glib, gnome, gobject-introspection, vala, gtk-doc, docbook_xsl, docbook_xml_dtd_43 }:
+
+stdenv.mkDerivation rec {
+  pname = "gexiv2";
+  version = "0.12.2";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "IyK1UqyjMO73lySmmcUaMCNF1eB0c4V4s5i38v+XlEw=";
+  };
+
+  nativeBuildInputs = [ meson ninja pkg-config gobject-introspection vala gtk-doc docbook_xsl docbook_xml_dtd_43 ];
+  buildInputs = [ glib ];
+  propagatedBuildInputs = [ exiv2 ];
+
+  mesonFlags = [
+    "-Dgtk_doc=true"
+  ];
+
+  doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Projects/gexiv2";
+    description = "GObject wrapper around the Exiv2 photo metadata library";
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+    maintainers = teams.gnome.members;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gf2x/default.nix b/nixpkgs/pkgs/development/libraries/gf2x/default.nix
new file mode 100644
index 000000000000..3440697989ee
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gf2x/default.nix
@@ -0,0 +1,38 @@
+{ stdenv
+, lib
+, fetchgit
+, autoreconfHook
+, optimize ? false # impure hardware optimizations
+}:
+stdenv.mkDerivation rec {
+  pname = "gf2x";
+  version = "1.3.0";
+
+  # 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;
+
+  configureFlags = lib.optionals (!optimize) [
+    "--disable-hardware-specific-code"
+  ];
+
+  meta = with lib; {
+    description = "Routines for fast arithmetic in GF(2)[x]";
+    homepage = "http://gf2x.gforge.inria.fr";
+    license = licenses.gpl2Plus;
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gfbgraph/default.nix b/nixpkgs/pkgs/development/libraries/gfbgraph/default.nix
new file mode 100644
index 000000000000..7f4625b66512
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gfbgraph/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchurl, pkg-config, glib, librest, gnome-online-accounts
+, gnome, libsoup, json-glib, gobject-introspection
+, gtk-doc, pkgs, docbook-xsl-nons, autoconf, automake, libtool }:
+
+stdenv.mkDerivation rec {
+  pname = "gfbgraph";
+  version = "0.2.4";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0yck7dwvjk16a52nafjpi0a39rxwmg0w833brj45acz76lgkjrb0";
+  };
+
+  nativeBuildInputs = [
+    pkg-config gobject-introspection gtk-doc
+    docbook-xsl-nons autoconf automake libtool
+  ];
+  buildInputs = [ glib gnome-online-accounts ];
+  propagatedBuildInputs = [ libsoup json-glib librest ];
+
+  configureFlags = [ "--enable-introspection" "--enable-gtk-doc" ];
+
+  prePatch = ''
+    patchShebangs autogen.sh
+    substituteInPlace autogen.sh \
+      --replace "which" "${pkgs.which}/bin/which"
+  '';
+
+  preConfigure = ''
+    NOCONFIGURE=1 ./autogen.sh
+  '';
+
+  enableParallelBuilding = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Projects/GFBGraph";
+    description = "GLib/GObject wrapper for the Facebook Graph API";
+    maintainers = teams.gnome.members;
+    license = licenses.lgpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gflags/default.nix b/nixpkgs/pkgs/development/libraries/gflags/default.nix
new file mode 100644
index 000000000000..a690d8f2e154
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gflags/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchFromGitHub, cmake
+, enableShared ? !stdenv.hostPlatform.isStatic
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gflags";
+  version = "2.2.2";
+
+  src = fetchFromGitHub {
+    owner = "gflags";
+    repo = "gflags";
+    rev = "v${version}";
+    sha256 = "147i3md3nxkjlrccqg4mq1kyzc7yrhvqv5902iibc7znkvzdvlp0";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  # This isn't used by the build and breaks the CMake build on case-insensitive filesystems (e.g., on Darwin)
+  preConfigure = "rm BUILD";
+
+  cmakeFlags = [
+    "-DGFLAGS_BUILD_SHARED_LIBS=${if enableShared then "ON" else "OFF"}"
+    "-DGFLAGS_BUILD_STATIC_LIBS=ON"
+  ];
+
+  doCheck = false;
+
+  meta = with lib; {
+    description = "A C++ library that implements commandline flags processing";
+    longDescription = ''
+      The gflags package contains a C++ library that implements commandline flags processing.
+      As such it's a replacement for getopt().
+      It was owned by Google. google-gflags project has been renamed to gflags and maintained by new community.
+    '';
+    homepage = "https://gflags.github.io/gflags/";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.linquize ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ggz_base_libs/default.nix b/nixpkgs/pkgs/development/libraries/ggz_base_libs/default.nix
new file mode 100644
index 000000000000..025423ecd8a4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ggz_base_libs/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl, intltool, openssl, expat, libgcrypt }:
+
+stdenv.mkDerivation rec {
+  version = "0.99.5";
+  baseName = "ggz-base-libs";
+  name = "${baseName}-snapshot-${version}";
+
+  src = fetchurl {
+    url = "http://mirrors.ibiblio.org/pub/mirrors/ggzgamingzone/ggz/snapshots/${name}.tar.gz";
+    sha256 = "1cw1vg0fbj36zyggnzidx9cbjwfc1yr4zqmsipxnvns7xa2awbdk";
+  };
+
+  buildInputs = [ intltool openssl expat libgcrypt ];
+
+  patchPhase = ''
+    substituteInPlace configure \
+      --replace "/usr/local/ssl/include" "${openssl.dev}/include" \
+      --replace "/usr/local/ssl/lib" "${openssl.out}/lib"
+  '';
+
+  configureFlags = [
+    "--with-tls"
+  ];
+
+  meta = with lib; {
+    description = "GGZ Gaming zone libraries";
+    maintainers = with maintainers;
+    [
+      raskin
+    ];
+    platforms = platforms.linux;
+    license = licenses.gpl2;
+    downloadPage = "http://www.ggzgamingzone.org/releases/";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ghc_filesystem/default.nix b/nixpkgs/pkgs/development/libraries/ghc_filesystem/default.nix
new file mode 100644
index 000000000000..0ffad301a493
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ghc_filesystem/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, lib, cmake, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "filesystem";
+  version = "1.5.6";
+
+  src = fetchFromGitHub {
+    owner = "gulrak";
+    repo = "filesystem";
+    rev = "v${version}";
+    hash = "sha256-qnBZ9aCrCPOgxymjbzrRs0gssijo8MJOMiy7QWWMb5c=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "header-only single-file C++ std::filesystem compatible helper library";
+    homepage = "https://github.com/gulrak/filesystem";
+    license = licenses.mit;
+    maintainers = with maintainers; [ lourkeur ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/giblib/default.nix b/nixpkgs/pkgs/development/libraries/giblib/default.nix
new file mode 100644
index 000000000000..e66f7bfe2a8c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/giblib/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, xlibsWrapper, imlib2 }:
+
+stdenv.mkDerivation rec {
+  name = "giblib-1.2.4";
+
+  src = fetchurl {
+    url = "http://linuxbrit.co.uk/downloads/${name}.tar.gz";
+    sha256 = "1b4bmbmj52glq0s898lppkpzxlprq9aav49r06j2wx4dv3212rhp";
+  };
+
+  outputs = [ "out" "dev" ];
+  setOutputFlags = false;
+
+  preConfigure = ''
+    configureFlagsArray+=(
+      --includedir=$dev/include
+    )
+  '';
+
+  buildInputs = [ xlibsWrapper ];
+  propagatedBuildInputs = [ imlib2 ];
+
+  postFixup = ''
+    moveToOutput bin/giblib-config "$dev"
+
+    # Doesn't contain useful stuff
+    rm -rf $out/share/doc
+  '';
+
+  meta = {
+    homepage = "http://linuxbrit.co.uk/giblib/";
+    description = "wrapper library for imlib2, and other stuff";
+    platforms = lib.platforms.unix;
+    license = lib.licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/giflib/4.1.nix b/nixpkgs/pkgs/development/libraries/giflib/4.1.nix
new file mode 100644
index 000000000000..c0afe067c499
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/giflib/4.1.nix
@@ -0,0 +1,20 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation {
+  name = "giflib-4.1.6";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/giflib/giflib-4.1.6.tar.bz2";
+    sha256 = "1v9b7ywz7qg8hli0s9vv1b8q9xxb2xvqq2mg1zpr73xwqpcwxhg1";
+  };
+
+  hardeningDisable = [ "format" ];
+
+  meta = with lib; {
+    description = "A library for reading and writing gif images";
+    branch = "4.1";
+    license = licenses.mit;
+    platforms = platforms.unix;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/giflib/default.nix b/nixpkgs/pkgs/development/libraries/giflib/default.nix
new file mode 100644
index 000000000000..9eaf7b933d43
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/giflib/default.nix
@@ -0,0 +1,35 @@
+{ lib, 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 = 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 = 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 = lib.platforms.unix;
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ ];
+    branch = "5.2";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gio-sharp/default.nix b/nixpkgs/pkgs/development/libraries/gio-sharp/default.nix
new file mode 100644
index 000000000000..91fbb86bd669
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gio-sharp/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, which, pkg-config, mono, glib, gtk-sharp-2_0 }:
+
+stdenv.mkDerivation rec {
+  pname = "gio-sharp";
+  version = "0.3";
+
+  src = fetchFromGitHub {
+    owner = "mono";
+    repo = "gio-sharp";
+
+    rev = version;
+    sha256 = "13pc529pjabj7lq23dbndc26ssmg5wkhc7lfvwapm87j711m0zig";
+  };
+
+  nativeBuildInputs = [ pkg-config autoconf automake which ];
+  buildInputs = [ mono glib gtk-sharp-2_0 ];
+
+  dontStrip = true;
+
+  prePatch = ''
+    ./autogen-2.22.sh
+  '';
+
+  meta = with lib; {
+    description = "GIO API bindings";
+    homepage = "https://github.com/mono/gio-sharp";
+    license = licenses.mit;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/git2/default.nix b/nixpkgs/pkgs/development/libraries/git2/default.nix
new file mode 100644
index 000000000000..b02e1ecc6f7b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/git2/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, python3
+, zlib, libssh2, openssl, pcre, http-parser
+, libiconv, Security
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libgit2";
+  version = "1.1.1";
+  # keep the version in sync with python3.pkgs.pygit2 and libgit2-glib
+
+  src = fetchFromGitHub {
+    owner = "libgit2";
+    repo = "libgit2";
+    rev = "v${version}";
+    sha256 = "sha256-SxceIxT0aeiiiZCeSIe6EOa+MyVpQVaiv/ZZn6fkwIc=";
+  };
+
+  cmakeFlags = [
+    "-DTHREADSAFE=ON"
+    "-DUSE_HTTP_PARSER=system"
+  ];
+
+  nativeBuildInputs = [ cmake python3 pkg-config ];
+
+  buildInputs = [ zlib libssh2 openssl pcre http-parser ]
+    ++ lib.optional stdenv.isDarwin Security;
+
+  propagatedBuildInputs = lib.optional (!stdenv.isLinux) libiconv;
+
+  doCheck = false; # hangs. or very expensive?
+
+  meta = {
+    description = "The Git linkable library";
+    homepage = "https://libgit2.github.com/";
+    license = lib.licenses.gpl2;
+    platforms = with lib.platforms; all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/givaro/3.7.nix b/nixpkgs/pkgs/development/libraries/givaro/3.7.nix
new file mode 100644
index 000000000000..a9b6325c3d71
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/givaro/3.7.nix
@@ -0,0 +1,17 @@
+{lib, stdenv, fetchurl, automake, autoconf, libtool, autoreconfHook, gmpxx}:
+stdenv.mkDerivation rec {
+  pname = "givaro";
+  version = "3.7.2";
+  src = fetchurl {
+    url = "https://forge.imag.fr/frs/download.php/370/givaro-${version}.tar.gz";
+    sha256 = "0lf5cnbyr27fw7klc3zabkb1979dn67jmrjz6pa3jzw2ng74x9b3";
+  };
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [autoconf automake libtool gmpxx];
+  meta = {
+    description = "A C++ library for arithmetic and algebraic computations";
+    license = lib.licenses.cecill-b;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/givaro/3.nix b/nixpkgs/pkgs/development/libraries/givaro/3.nix
new file mode 100644
index 000000000000..1bfe7682ffa7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/givaro/3.nix
@@ -0,0 +1,17 @@
+{lib, stdenv, fetchurl, automake, autoconf, libtool, autoreconfHook, gmpxx}:
+stdenv.mkDerivation rec {
+  pname = "givaro";
+  version = "3.8.0";
+  src = fetchurl {
+    url = "https://forge.imag.fr/frs/download.php/592/givaro-${version}.tar.gz";
+    sha256 = "1822ksv8653a84hvcz0vxl3nk8dqz7d41ys8rplq0zjjmvb2i5yq";
+  };
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [autoconf automake libtool gmpxx];
+  meta = {
+    description = "A C++ library for arithmetic and algebraic computations";
+    license = lib.licenses.cecill-b;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/givaro/default.nix b/nixpkgs/pkgs/development/libraries/givaro/default.nix
new file mode 100644
index 000000000000..29674118dfee
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/givaro/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchFromGitHub, automake, autoconf, libtool, autoreconfHook, gmpxx }:
+stdenv.mkDerivation rec {
+  pname = "givaro";
+  version = "4.1.1";
+  src = fetchFromGitHub {
+    owner = "linbox-team";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "11wz57q6ijsvfs5r82masxgr319as92syi78lnl9lgdblpc6xigk";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [autoconf automake libtool];
+  propagatedBuildInputs = [ gmpxx ];
+
+  configureFlags = [
+    "--disable-optimization"
+  ] ++ lib.optionals stdenv.isx86_64 [
+    # disable SIMD instructions (which are enabled *when available* by default)
+    "--${if stdenv.hostPlatform.sse3Support   then "enable" else "disable"}-sse3"
+    "--${if stdenv.hostPlatform.ssse3Support  then "enable" else "disable"}-ssse3"
+    "--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41"
+    "--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42"
+    "--${if stdenv.hostPlatform.avxSupport    then "enable" else "disable"}-avx"
+    "--${if stdenv.hostPlatform.avx2Support   then "enable" else "disable"}-avx2"
+    "--${if stdenv.hostPlatform.fmaSupport    then "enable" else "disable"}-fma"
+    "--${if stdenv.hostPlatform.fma4Support   then "enable" else "disable"}-fma4"
+  ];
+
+  # On darwin, tests are linked to dylib in the nix store, so we need to make
+  # sure tests run after installPhase.
+  doInstallCheck = true;
+  installCheckTarget = "check";
+  doCheck = false;
+
+  meta = {
+    description = "A C++ library for arithmetic and algebraic computations";
+    license = lib.licenses.cecill-b;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gjs/default.nix b/nixpkgs/pkgs/development/libraries/gjs/default.nix
new file mode 100644
index 000000000000..e86775de623b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gjs/default.nix
@@ -0,0 +1,140 @@
+{ fetchurl
+, lib
+, stdenv
+, meson
+, ninja
+, pkg-config
+, gnome
+, gtk3
+, atk
+, gobject-introspection
+, spidermonkey_78
+, pango
+, cairo
+, readline
+, glib
+, libxml2
+, dbus
+, gdk-pixbuf
+, harfbuzz
+, makeWrapper
+, which
+, xvfb-run
+, nixosTests
+}:
+
+let
+  testDeps = [
+    gobject-introspection # for Gio and cairo typelibs
+    gtk3 atk pango.out gdk-pixbuf harfbuzz
+  ];
+in stdenv.mkDerivation rec {
+  pname = "gjs";
+  version = "1.68.2";
+
+  outputs = [ "out" "dev" "installedTests" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gjs/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-cP8CraaC8TAzjsXMTFEQPcDlyrjVN+t2sYHsUSpl7jA=";
+  };
+
+  patches = [
+    # Hard-code various paths
+    ./fix-paths.patch
+
+    # Allow installing installed tests to a separate output.
+    ./installed-tests-path.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    makeWrapper
+    which # for locale detection
+    libxml2 # for xml-stripblanks
+  ];
+
+  buildInputs = [
+    gobject-introspection
+    cairo
+    readline
+    spidermonkey_78
+    dbus # for dbus-run-session
+  ];
+
+  checkInputs = [
+    xvfb-run
+  ] ++ testDeps;
+
+  propagatedBuildInputs = [
+    glib
+  ];
+
+  mesonFlags = [
+    "-Dprofiler=disabled"
+    "-Dinstalled_test_prefix=${placeholder "installedTests"}"
+  ];
+
+  doCheck = true;
+
+  postPatch = ''
+    patchShebangs build/choose-tests-locale.sh
+    substituteInPlace installed-tests/debugger-test.sh --subst-var-by gjsConsole $out/bin/gjs-console
+  '';
+
+  preCheck = ''
+    # Our gobject-introspection patches make the shared library paths absolute
+    # in the GIR files. When running tests, the library is not yet installed,
+    # though, so we need to replace the absolute path with a local one during build.
+    # We are using a symlink that will be overridden during installation.
+    mkdir -p $out/lib $installedTests/libexec/installed-tests/gjs
+    ln -s $PWD/libgjs.so.0 $out/lib/libgjs.so.0
+    ln -s $PWD/installed-tests/js/libgimarshallingtests.so $installedTests/libexec/installed-tests/gjs/libgimarshallingtests.so
+    ln -s $PWD/installed-tests/js/libgjstesttools/libgjstesttools.so $installedTests/libexec/installed-tests/gjs/libgjstesttools.so
+    ln -s $PWD/installed-tests/js/libregress.so $installedTests/libexec/installed-tests/gjs/libregress.so
+    ln -s $PWD/installed-tests/js/libwarnlib.so $installedTests/libexec/installed-tests/gjs/libwarnlib.so
+  '';
+
+  postInstall = ''
+    # TODO: make the glib setup hook handle moving the schemas in other outputs.
+    installedTestsSchemaDatadir="$installedTests/share/gsettings-schemas/${pname}-${version}"
+    mkdir -p "$installedTestsSchemaDatadir"
+    mv "$installedTests/share/glib-2.0" "$installedTestsSchemaDatadir"
+  '';
+
+  postFixup = ''
+    wrapProgram "$installedTests/libexec/installed-tests/gjs/minijasmine" \
+      --prefix XDG_DATA_DIRS : "$installedTestsSchemaDatadir" \
+      --prefix GI_TYPELIB_PATH : "${lib.makeSearchPath "lib/girepository-1.0" testDeps}"
+  '';
+
+  checkPhase = ''
+    runHook preCheck
+    xvfb-run -s '-screen 0 800x600x24' \
+      meson test --print-errorlogs
+    runHook postCheck
+  '';
+
+  separateDebugInfo = stdenv.isLinux;
+
+  passthru = {
+    tests = {
+      installed-tests = nixosTests.installed-tests.gjs;
+    };
+
+    updateScript = gnome.updateScript {
+      packageName = "gjs";
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "JavaScript bindings for GNOME";
+    homepage = "https://gitlab.gnome.org/GNOME/gjs/blob/master/doc/Home.md";
+    license = licenses.lgpl2Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gjs/fix-paths.patch b/nixpkgs/pkgs/development/libraries/gjs/fix-paths.patch
new file mode 100644
index 000000000000..5ca5372ea947
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gjs/fix-paths.patch
@@ -0,0 +1,13 @@
+diff --git a/installed-tests/debugger-test.sh b/installed-tests/debugger-test.sh
+index 0d118490..54c5507e 100755
+--- a/installed-tests/debugger-test.sh
++++ b/installed-tests/debugger-test.sh
+@@ -3,7 +3,7 @@
+ if test "$GJS_USE_UNINSTALLED_FILES" = "1"; then
+     gjs="$TOP_BUILDDIR/gjs-console"
+ else
+-    gjs=gjs-console
++    gjs=@gjsConsole@
+ fi
+ 
+ echo 1..1
diff --git a/nixpkgs/pkgs/development/libraries/gjs/installed-tests-path.patch b/nixpkgs/pkgs/development/libraries/gjs/installed-tests-path.patch
new file mode 100644
index 000000000000..09cd8eaff434
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gjs/installed-tests-path.patch
@@ -0,0 +1,37 @@
+diff --git a/installed-tests/meson.build b/installed-tests/meson.build
+index 04c7910f..9647908c 100644
+--- a/installed-tests/meson.build
++++ b/installed-tests/meson.build
+@@ -1,7 +1,7 @@
+ ### Installed tests ############################################################
+ 
+-installed_tests_execdir = get_option('prefix') / get_option('libexecdir') / 'installed-tests' / meson.project_name()
+-installed_tests_metadir = abs_datadir / 'installed-tests' / meson.project_name()
++installed_tests_execdir = get_option('installed_test_prefix') / 'libexec' / 'installed-tests' / meson.project_name()
++installed_tests_metadir = get_option('installed_test_prefix') / 'share' / 'installed-tests' / meson.project_name()
+ 
+ # Simple shell script tests #
+ 
+diff --git a/meson.build b/meson.build
+index 9ab29475..42ffe07f 100644
+--- a/meson.build
++++ b/meson.build
+@@ -557,7 +557,7 @@ install_data('installed-tests/extra/lsan.supp',
+     install_dir: get_option('datadir') / api_name / 'lsan')
+ 
+ if get_option('installed_tests')
+-    schemadir = abs_datadir / 'glib-2.0' / 'schemas'
++    schemadir = get_option('installed_test_prefix') / 'share' / 'glib-2.0' / 'schemas'
+     install_data('installed-tests/js/org.gnome.GjsTest.gschema.xml', install_dir: schemadir)
+     meson.add_install_script('build/compile-gschemas.py', schemadir)
+ endif
+diff --git a/meson_options.txt b/meson_options.txt
+index 825ba77a..21f0323c 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -25,3 +25,5 @@ option('skip_gtk_tests', type: 'boolean', value: false,
+     description: 'Skip tests that need a display connection')
+ option('verbose_logs', type: 'boolean', value: false,
+     description: 'Enable extra log messages that may decrease performance (not allowed in release builds)')
++option('installed_test_prefix', type: 'string', value: '',
++    description: 'Prefix for installed tests')
diff --git a/nixpkgs/pkgs/development/libraries/gl2ps/default.nix b/nixpkgs/pkgs/development/libraries/gl2ps/default.nix
new file mode 100644
index 000000000000..0203e2fde93a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gl2ps/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv
+, fetchurl
+, cmake
+, zlib
+, libGL
+, libGLU
+, libpng
+, freeglut
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gl2ps";
+  version = "1.4.2";
+
+  src = fetchurl {
+    url = "http://geuz.org/gl2ps/src/${pname}-${version}.tgz";
+    sha256 = "1sgzv547h7hrskb9qd0x5yp45kmhvibjwj2mfswv95lg070h074d";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  buildInputs = [
+    zlib
+    libGL
+    libGLU
+    libpng
+    freeglut
+  ];
+
+  meta = with lib; {
+    homepage = "http://geuz.org/gl2ps";
+    description = "An OpenGL to PostScript printing library";
+    platforms = platforms.all;
+    license = licenses.lgpl2;
+    maintainers = with maintainers; [raskin twhitehead];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/glbinding/default.nix b/nixpkgs/pkgs/development/libraries/glbinding/default.nix
new file mode 100644
index 000000000000..1b36baa24e42
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glbinding/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, cmake, libGLU, xlibsWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "glbinding";
+  version = "3.1.0";
+
+  src = fetchFromGitHub {
+    owner = "cginternals";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1avd7ssms11xx7h0cm8h4pfpk55f07f1j1ybykxfgsym2chb2z08";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libGLU xlibsWrapper ];
+
+  meta = with lib; {
+    homepage = "https://github.com/cginternals/glbinding/";
+    description = "A C++ binding for the OpenGL API, generated using the gl.xml specification";
+    license = licenses.mit;
+    maintainers = [ maintainers.mt-caret ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gle/default.nix b/nixpkgs/pkgs/development/libraries/gle/default.nix
new file mode 100644
index 000000000000..b7a4f7f2fef1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gle/default.nix
@@ -0,0 +1,18 @@
+{lib, stdenv, fetchurl, freeglut, libX11, libXt, libXmu, libXi, libXext, libGL, libGLU}:
+stdenv.mkDerivation {
+  name = "gle-3.1.0";
+  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"
+      "https://www.linas.org/gle/pub/gle-3.1.0.tar.gz"
+      ];
+    sha256 = "09zs1di4dsssl9k322nzildvf41jwipbzhik9p43yb1bcfsp92nw";
+  };
+  meta = {
+    description = "Tubing and extrusion library";
+    license = lib.licenses.gpl2 ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/glew/1.10.nix b/nixpkgs/pkgs/development/libraries/glew/1.10.nix
new file mode 100644
index 000000000000..29376cb25672
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glew/1.10.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, fetchurl, libGLU, xlibsWrapper, libXmu, libXi
+, AGL, OpenGL
+}:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  name = "glew-1.10.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/glew/${name}.tgz";
+    sha256 = "01zki46dr5khzlyywr3cg615bcal32dazfazkf360s1znqh17i4r";
+  };
+
+  buildInputs = if stdenv.isDarwin then [ AGL ] else [ xlibsWrapper libXmu libXi ];
+  propagatedBuildInputs = if stdenv.isDarwin then [ OpenGL ] else [ libGLU ]; # GL/glew.h includes GL/glu.h
+
+  patchPhase = ''
+    sed -i 's|lib64|lib|' config/Makefile.linux
+    ${optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+    sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile
+    ''}
+  '';
+
+  buildFlags = [ "all" ];
+  installFlags = [ "install.all" ];
+
+  preInstall = ''
+    export GLEW_DEST="$out"
+  '';
+
+  postInstall = ''
+    mkdir -pv $out/share/doc/glew
+    mkdir -p $out/lib/pkgconfig
+    cp glew*.pc $out/lib/pkgconfig
+    cp -r README.txt LICENSE.txt doc $out/share/doc/glew
+  '';
+
+  makeFlags = [
+    "SYSTEM=${if stdenv.hostPlatform.isMinGW then "mingw" else stdenv.hostPlatform.parsed.kernel.name}"
+  ];
+
+  meta = with lib; {
+    description = "An OpenGL extension loading library for C(++)";
+    homepage = "http://glew.sourceforge.net/";
+    license = licenses.free; # different files under different licenses
+      #["BSD" "GLX" "SGI-B" "GPL2"]
+    platforms = platforms.mesaPlatforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/glew/default.nix b/nixpkgs/pkgs/development/libraries/glew/default.nix
new file mode 100644
index 000000000000..53c9b5a30dc9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glew/default.nix
@@ -0,0 +1,57 @@
+{ lib, stdenv, fetchurl, libGLU, xlibsWrapper, libXmu, libXi
+, OpenGL
+}:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "glew";
+  version = "2.2.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/glew/${pname}-${version}.tgz";
+    sha256 = "1qak8f7g1iswgswrgkzc7idk7jmqgwrs58fhg2ai007v7j4q5z6l";
+  };
+
+  outputs = [ "bin" "out" "dev" "doc" ];
+
+  buildInputs = optionals (!stdenv.isDarwin) [ xlibsWrapper libXmu libXi ];
+  propagatedBuildInputs = if stdenv.isDarwin then [ OpenGL ] else [ libGLU ]; # GL/glew.h includes GL/glu.h
+
+  patchPhase = ''
+    sed -i 's|lib64|lib|' config/Makefile.linux
+    substituteInPlace config/Makefile.darwin --replace /usr/local "$out"
+    ${optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+      sed -i -e 's/\(INSTALL.*\)-s/\1/' Makefile
+    ''}
+  '';
+
+  buildFlags = [ "all" ];
+  installFlags = [ "install.all" ];
+
+  preInstall = ''
+    makeFlagsArray+=(GLEW_DEST=$out BINDIR=$bin/bin INCDIR=$dev/include/GL)
+  '';
+
+  postInstall = ''
+    mkdir -pv $out/share/doc/glew
+    mkdir -p $out/lib/pkgconfig
+    cp glew*.pc $out/lib/pkgconfig
+    cp -r README.md LICENSE.txt doc $out/share/doc/glew
+    rm $out/lib/*.a
+  '';
+
+  makeFlags = [
+    "SYSTEM=${if stdenv.hostPlatform.isMinGW then "mingw" else stdenv.hostPlatform.parsed.kernel.name}"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "An OpenGL extension loading library for C(++)";
+    homepage = "http://glew.sourceforge.net/";
+    license = licenses.free; # different files under different licenses
+      #["BSD" "GLX" "SGI-B" "GPL2"]
+    platforms = platforms.mesaPlatforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/glfw/2.x.nix b/nixpkgs/pkgs/development/libraries/glfw/2.x.nix
new file mode 100644
index 000000000000..d05fa6e5f772
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glfw/2.x.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, libGLU, libGL, libX11, libXext }:
+
+stdenv.mkDerivation rec {
+  name = "glfw-2.7.9";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/glfw/${name}.tar.bz2";
+    sha256 = "17c2msdcb7pn3p8f83805h1c216bmdqnbn9hgzr1j8wnwjcpxx6i";
+  };
+
+  buildInputs = [ libGLU libGL libX11 libXext ];
+
+  buildPhase = ''
+    make x11
+  '';
+
+  installPhase = ''
+    mkdir -p $out
+    make x11-dist-install PREFIX=$out
+    mv $out/lib/libglfw.so $out/lib/libglfw.so.2
+    ln -s libglfw.so.2 $out/lib/libglfw.so
+  '';
+
+  meta = with lib; {
+    description = "Multi-platform library for creating OpenGL contexts and managing input, including keyboard, mouse, joystick and time";
+    homepage = "http://glfw.sourceforge.net/";
+    license = licenses.zlib;
+    maintainers = [ lib.maintainers.marcweber ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/glfw/3.x.nix b/nixpkgs/pkgs/development/libraries/glfw/3.x.nix
new file mode 100644
index 000000000000..f9089384a8a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glfw/3.x.nix
@@ -0,0 +1,54 @@
+{ stdenv, lib, fetchFromGitHub, cmake
+, libGL, libXrandr, libXinerama, libXcursor, libX11, libXi, libXext
+, Cocoa, Kernel, fixDarwinDylibNames
+, waylandSupport ? false, extra-cmake-modules, wayland
+, wayland-protocols, libxkbcommon
+}:
+
+stdenv.mkDerivation rec {
+  version = "3.3.4";
+  pname = "glfw";
+
+  src = fetchFromGitHub {
+    owner = "glfw";
+    repo = "GLFW";
+    rev = version;
+    sha256 = "sha256-BP4wxjgm0x0E68tNz5eudkVUyBnXkQlP7LY3ppZunhw=";
+  };
+
+  patches = lib.optional waylandSupport ./wayland.patch;
+
+  propagatedBuildInputs = [ libGL ];
+
+  nativeBuildInputs = [ cmake ]
+    ++ lib.optional stdenv.isDarwin fixDarwinDylibNames
+    ++ lib.optional waylandSupport extra-cmake-modules;
+
+  buildInputs =
+    if waylandSupport
+    then [ wayland wayland-protocols libxkbcommon ]
+    else [ libX11 libXrandr libXinerama libXcursor libXi libXext ]
+         ++ lib.optionals stdenv.isDarwin [ Cocoa Kernel ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+  ] ++ lib.optionals (!stdenv.isDarwin) [
+    "-DCMAKE_C_FLAGS=-D_GLFW_GLX_LIBRARY='\"${lib.getLib libGL}/lib/libGL.so.1\"'"
+  ] ++ lib.optionals waylandSupport [
+    "-DGLFW_USE_WAYLAND=ON"
+    "-DCMAKE_C_FLAGS=-D_GLFW_EGL_LIBRARY='\"${lib.getLib libGL}/lib/libEGL.so.1\"'"
+  ];
+
+  postPatch = lib.optionalString waylandSupport ''
+    substituteInPlace src/wl_init.c \
+      --replace "libxkbcommon.so.0" "${lib.getLib libxkbcommon}/lib/libxkbcommon.so.0"
+  '';
+
+  meta = with lib; {
+    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 twey ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/glfw/wayland.patch b/nixpkgs/pkgs/development/libraries/glfw/wayland.patch
new file mode 100644
index 000000000000..c0c338f845b3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glfw/wayland.patch
@@ -0,0 +1,25 @@
+From 46fb81c69e8acdb70907409f98dd01e387408414 Mon Sep 17 00:00:00 2001
+From: Stone Tickle <lattis@mochiro.moe>
+Date: Fri, 5 Jun 2020 12:51:25 +0900
+Subject: [PATCH] set O_NONBLOCK on repeat timerfd
+
+---
+ src/wl_init.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/wl_init.c b/src/wl_init.c
+index 49e7cc52..43569bef 100644
+--- a/src/wl_init.c
++++ b/src/wl_init.c
+@@ -1166,7 +1166,7 @@ int _glfwPlatformInit(void)
+ 
+     _glfw.wl.timerfd = -1;
+     if (_glfw.wl.seatVersion >= 4)
+-        _glfw.wl.timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC);
++        _glfw.wl.timerfd = timerfd_create(CLOCK_MONOTONIC, TFD_CLOEXEC | TFD_NONBLOCK);
+ 
+     if (_glfw.wl.pointer && _glfw.wl.shm)
+     {
+-- 
+2.31.1
+
diff --git a/nixpkgs/pkgs/development/libraries/glib-networking/default.nix b/nixpkgs/pkgs/development/libraries/glib-networking/default.nix
new file mode 100644
index 000000000000..690279fcf213
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glib-networking/default.nix
@@ -0,0 +1,94 @@
+{ lib, stdenv
+, fetchurl
+, substituteAll
+, meson
+, ninja
+, nixosTests
+, pkg-config
+, glib
+, gettext
+, makeWrapper
+, python3
+, gnutls
+, p11-kit
+, libproxy
+, gnome
+, gsettings-desktop-schemas
+}:
+
+stdenv.mkDerivation rec {
+  pname = "glib-networking";
+  version = "2.68.1";
+
+  outputs = [ "out" "installedTests" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0c1vylxly8k7g454g02spi44ybjidlwg461vp713zxd94k8qnpfh";
+  };
+
+  patches = [
+    (substituteAll {
+      src = ./hardcode-gsettings.patch;
+      gds_gsettings_path = glib.getSchemaPath gsettings-desktop-schemas;
+    })
+
+    ./installed-tests-path.patch
+  ];
+
+  postPatch = ''
+    chmod +x meson_post_install.py # patchShebangs requires executable file
+    patchShebangs meson_post_install.py
+  '';
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gettext
+    makeWrapper
+    python3 # for install_script
+  ];
+
+  buildInputs = [
+    glib
+    gnutls
+    p11-kit
+    libproxy
+    gsettings-desktop-schemas
+  ];
+
+  doCheck = false; # tests need to access the certificates (among other things)
+
+  mesonFlags = [
+    "-Dinstalled_tests=true"
+    "-Dinstalled_test_prefix=${placeholder "installedTests"}"
+  ];
+
+  postFixup = ''
+    find "$installedTests/libexec" "$out/libexec" -type f -executable -print0 \
+      | while IFS= read -r -d "" file; do
+      echo "Wrapping program '$file'"
+      wrapProgram "$file" --prefix GIO_EXTRA_MODULES : "$out/lib/gio/modules"
+    done
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+
+    tests = {
+      installedTests = nixosTests.installed-tests.glib-networking;
+    };
+  };
+
+  meta = with lib; {
+    description = "Network-related giomodules for glib";
+    homepage = "https://gitlab.gnome.org/GNOME/glib-networking";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/glib-networking/hardcode-gsettings.patch b/nixpkgs/pkgs/development/libraries/glib-networking/hardcode-gsettings.patch
new file mode 100644
index 000000000000..0a091b2344dc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glib-networking/hardcode-gsettings.patch
@@ -0,0 +1,341 @@
+diff --git a/proxy/gnome/gproxyresolvergnome.c b/proxy/gnome/gproxyresolvergnome.c
+index 50b63cd..4364116 100644
+--- a/proxy/gnome/gproxyresolvergnome.c
++++ b/proxy/gnome/gproxyresolvergnome.c
+@@ -156,23 +156,79 @@
+ 
+   resolver->base_resolver = g_simple_proxy_resolver_new (NULL, NULL);
+ 
+-  resolver->proxy_settings = g_settings_new (GNOME_PROXY_SETTINGS_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA,
++                                             FALSE);
++    resolver->proxy_settings = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_signal_connect (resolver->proxy_settings, "changed",
+                     G_CALLBACK (gsettings_changed), resolver);
+-  resolver->http_settings = g_settings_get_child (resolver->proxy_settings,
+-                                                  GNOME_PROXY_HTTP_CHILD_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTP_CHILD_SCHEMA,
++                                             FALSE);
++    resolver->http_settings = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_signal_connect (resolver->http_settings, "changed",
+                     G_CALLBACK (gsettings_changed), resolver);
+-  resolver->https_settings = g_settings_get_child (resolver->proxy_settings,
+-                                                   GNOME_PROXY_HTTPS_CHILD_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTPS_CHILD_SCHEMA,
++                                             FALSE);
++    resolver->https_settings = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_signal_connect (resolver->https_settings, "changed",
+                     G_CALLBACK (gsettings_changed), resolver);
+-  resolver->ftp_settings = g_settings_get_child (resolver->proxy_settings,
+-                                                 GNOME_PROXY_FTP_CHILD_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_FTP_CHILD_SCHEMA,
++                                             FALSE);
++    resolver->ftp_settings = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_signal_connect (resolver->ftp_settings, "changed",
+                     G_CALLBACK (gsettings_changed), resolver);
+-  resolver->socks_settings = g_settings_get_child (resolver->proxy_settings,
+-                                                   GNOME_PROXY_SOCKS_CHILD_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_SOCKS_CHILD_SCHEMA,
++                                             FALSE);
++    resolver->socks_settings = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_signal_connect (resolver->socks_settings, "changed",
+                     G_CALLBACK (gsettings_changed), resolver);
+ 
+diff --git a/proxy/tests/gnome.c b/proxy/tests/gnome.c
+index f76b094..54751e3 100644
+--- a/proxy/tests/gnome.c
++++ b/proxy/tests/gnome.c
+@@ -55,26 +55,86 @@
+ {
+   GSettings *settings, *child;
+ 
+-  settings = g_settings_new (GNOME_PROXY_SETTINGS_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA,
++                                             FALSE);
++    settings = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_settings_reset (settings, GNOME_PROXY_MODE_KEY);
+   g_settings_reset (settings, GNOME_PROXY_USE_SAME_PROXY_KEY);
+ 
+-  child = g_settings_get_child (settings, GNOME_PROXY_HTTP_CHILD_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTP_CHILD_SCHEMA,
++                                             FALSE);
++    child = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_settings_reset (child, GNOME_PROXY_HTTP_HOST_KEY);
+   g_settings_reset (child, GNOME_PROXY_HTTP_PORT_KEY);
+   g_object_unref (child);
+ 
+-  child = g_settings_get_child (settings, GNOME_PROXY_HTTPS_CHILD_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTPS_CHILD_SCHEMA,
++                                             FALSE);
++    child = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_settings_reset (child, GNOME_PROXY_HTTPS_HOST_KEY);
+   g_settings_reset (child, GNOME_PROXY_HTTPS_PORT_KEY);
+   g_object_unref (child);
+ 
+-  child = g_settings_get_child (settings, GNOME_PROXY_FTP_CHILD_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_FTP_CHILD_SCHEMA,
++                                             FALSE);
++    child = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_settings_reset (child, GNOME_PROXY_FTP_HOST_KEY);
+   g_settings_reset (child, GNOME_PROXY_FTP_PORT_KEY);
+   g_object_unref (child);
+ 
+-  child = g_settings_get_child (settings, GNOME_PROXY_SOCKS_CHILD_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_SOCKS_CHILD_SCHEMA,
++                                             FALSE);
++    child = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_settings_reset (child, GNOME_PROXY_SOCKS_HOST_KEY);
+   g_settings_reset (child, GNOME_PROXY_SOCKS_PORT_KEY);
+   g_object_unref (child);
+@@ -88,21 +148,69 @@
+ {
+   GSettings *settings, *child;
+ 
+-  settings = g_settings_new (GNOME_PROXY_SETTINGS_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA,
++                                             FALSE);
++    settings = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_settings_set_enum (settings, GNOME_PROXY_MODE_KEY, G_DESKTOP_PROXY_MODE_MANUAL);
+   g_settings_set_boolean (settings, GNOME_PROXY_USE_SAME_PROXY_KEY, TRUE);
+ 
+-  child = g_settings_get_child (settings, GNOME_PROXY_HTTP_CHILD_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTP_CHILD_SCHEMA,
++                                             FALSE);
++    child = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_settings_set_string (child, GNOME_PROXY_HTTP_HOST_KEY, "proxy.example.com");
+   g_settings_set_int (child, GNOME_PROXY_HTTP_PORT_KEY, 8080);
+   g_object_unref (child);
+ 
+-  child = g_settings_get_child (settings, GNOME_PROXY_HTTPS_CHILD_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTPS_CHILD_SCHEMA,
++                                             FALSE);
++    child = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_settings_set_string (child, GNOME_PROXY_HTTPS_HOST_KEY, "proxy-s.example.com");
+   g_settings_set_int (child, GNOME_PROXY_HTTPS_PORT_KEY, 7070);
+   g_object_unref (child);
+ 
+-  child = g_settings_get_child (settings, GNOME_PROXY_FTP_CHILD_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_FTP_CHILD_SCHEMA,
++                                             FALSE);
++    child = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_settings_set_string (child, GNOME_PROXY_FTP_HOST_KEY, "proxy-f.example.com");
+   g_settings_set_int (child, GNOME_PROXY_FTP_PORT_KEY, 6060);
+   g_object_unref (child);
+@@ -119,12 +227,36 @@
+   GSettings *settings, *child;
+   const gchar *ignore_hosts[2] = { "127.0.0.1", NULL };
+ 
+-  settings = g_settings_new (GNOME_PROXY_SETTINGS_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA,
++                                             FALSE);
++    settings = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_settings_set_enum (settings, GNOME_PROXY_MODE_KEY, G_DESKTOP_PROXY_MODE_MANUAL);
+   g_settings_set (settings, GNOME_PROXY_IGNORE_HOSTS_KEY,
+                   "@as", g_variant_new_strv (ignore_hosts, -1));
+ 
+-  child = g_settings_get_child (settings, GNOME_PROXY_SOCKS_CHILD_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_SOCKS_CHILD_SCHEMA,
++                                             FALSE);
++    child = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_settings_set_string (child, GNOME_PROXY_SOCKS_HOST_KEY, "proxy.example.com");
+   g_settings_set_int (child, GNOME_PROXY_SOCKS_PORT_KEY, 1234);
+   g_object_unref (child);
+@@ -139,12 +271,36 @@
+ {
+   GSettings *settings, *http;
+ 
+-  settings = g_settings_new (GNOME_PROXY_SETTINGS_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA,
++                                             FALSE);
++    settings = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_settings_set_enum (settings, GNOME_PROXY_MODE_KEY, G_DESKTOP_PROXY_MODE_MANUAL);
+   g_settings_set (settings, GNOME_PROXY_IGNORE_HOSTS_KEY,
+                   "@as", g_variant_new_strv (ignore_hosts, n_ignore_hosts));
+ 
+-  http = g_settings_get_child (settings, GNOME_PROXY_HTTP_CHILD_SCHEMA);
++  {
++    GSettingsSchemaSource *schema_source;
++    GSettingsSchema *schema;
++    schema_source = g_settings_schema_source_new_from_directory("@gds_gsettings_path@",
++                                                                g_settings_schema_source_get_default(),
++                                                                TRUE, NULL);
++    schema = g_settings_schema_source_lookup(schema_source,
++                                             GNOME_PROXY_SETTINGS_SCHEMA "." GNOME_PROXY_HTTP_CHILD_SCHEMA,
++                                             FALSE);
++    http = g_settings_new_full(schema, NULL, NULL);
++    g_settings_schema_source_unref(schema_source);
++    g_settings_schema_unref(schema);
++  }
+   g_settings_set_string (http, GNOME_PROXY_HTTP_HOST_KEY, "localhost");
+   g_settings_set_int (http, GNOME_PROXY_HTTP_PORT_KEY, 8080);
+ 
diff --git a/nixpkgs/pkgs/development/libraries/glib-networking/installed-tests-path.patch b/nixpkgs/pkgs/development/libraries/glib-networking/installed-tests-path.patch
new file mode 100644
index 000000000000..942ca053dd4f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glib-networking/installed-tests-path.patch
@@ -0,0 +1,25 @@
+diff --git a/meson.build b/meson.build
+index 4d91677..aaaeb2b 100644
+--- a/meson.build
++++ b/meson.build
+@@ -12,8 +12,8 @@
+ libexecdir = join_paths(prefix, get_option('libexecdir'))
+ localedir = join_paths(prefix, get_option('localedir'))
+ 
+-installed_tests_metadir = join_paths(datadir, 'installed-tests', meson.project_name())
+-installed_tests_execdir = join_paths(libexecdir, 'installed-tests', meson.project_name())
++installed_tests_metadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', meson.project_name())
++installed_tests_execdir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', meson.project_name())
+ 
+ cc = meson.get_compiler('c')
+ host_system = host_machine.system()
+diff --git a/meson_options.txt b/meson_options.txt
+index 3a525dd..fc86302 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -3,4 +3,5 @@
+ option('libproxy', type: 'feature', value: 'auto', description: 'support for libproxy proxy configration')
+ option('gnome_proxy', type: 'feature', value: 'auto', description: 'support for GNOME desktop proxy configuration')
+ option('installed_tests', type: 'boolean', value: false, description: 'enable installed tests')
++option('installed_test_prefix', type: 'string', value: '', description: 'Prefix for installed tests')
+ option('static_modules', type: 'boolean', value: false, description: 'build static modules')
diff --git a/nixpkgs/pkgs/development/libraries/glib-testing/default.nix b/nixpkgs/pkgs/development/libraries/glib-testing/default.nix
new file mode 100644
index 000000000000..bdbced24a10e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glib-testing/default.nix
@@ -0,0 +1,63 @@
+{ lib, stdenv
+, fetchFromGitLab
+, meson
+, ninja
+, pkg-config
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+, glib
+, nixosTests
+}:
+
+stdenv.mkDerivation rec {
+  pname = "glib-testing";
+  version = "0.1.0";
+
+  outputs = [ "out" "dev" "devdoc" "installedTests" ];
+
+  src = fetchFromGitLab {
+    domain = "gitlab.gnome.org";
+    owner = "pwithnall";
+    repo = "libglib-testing";
+    rev = version;
+    sha256 = "0xmycsrlqyji6sc2i4wvp2gxf3897z65a57ygihfnpjpyl7zlwkr";
+  };
+
+  patches = [
+    # allow installing installed tests to a separate output
+    ./installed-tests-path.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gtk-doc
+    docbook-xsl-nons
+    docbook_xml_dtd_43
+  ];
+
+  propagatedBuildInputs = [
+    glib
+  ];
+
+  mesonFlags = [
+    "-Dinstalled_tests=true"
+    "-Dinstalled_test_prefix=${placeholder "installedTests"}"
+  ];
+
+  passthru = {
+    tests = {
+      installedTests = nixosTests.installed-tests.glib-testing;
+    };
+  };
+
+  meta = with lib; {
+    description = "Test library providing test harnesses and mock classes complementing the classes provided by GLib";
+    homepage = "https://gitlab.gnome.org/pwithnall/libglib-testing";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/glib-testing/installed-tests-path.patch b/nixpkgs/pkgs/development/libraries/glib-testing/installed-tests-path.patch
new file mode 100644
index 000000000000..37ee2a988899
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glib-testing/installed-tests-path.patch
@@ -0,0 +1,32 @@
+diff --git a/libglib-testing/tests/meson.build b/libglib-testing/tests/meson.build
+index 4789c63..2b8525d 100644
+--- a/libglib-testing/tests/meson.build
++++ b/libglib-testing/tests/meson.build
+@@ -15,9 +15,9 @@ test_programs = [
+   ['signal-logger', [], deps],
+ ]
+ 
+-installed_tests_metadir = join_paths(datadir, 'installed-tests',
++installed_tests_metadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests',
+                                      'libglib-testing-' + libglib_testing_api_version)
+-installed_tests_execdir = join_paths(libexecdir, 'installed-tests',
++installed_tests_execdir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests',
+                                      'libglib-testing-' + libglib_testing_api_version)
+ 
+ foreach program: test_programs
+@@ -48,4 +48,4 @@ foreach program: test_programs
+     exe,
+     env: envs,
+   )
+-endforeach
+\ No newline at end of file
++endforeach
+diff --git a/meson_options.txt b/meson_options.txt
+index e69263e..7cb1ee8 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -4,3 +4,4 @@ option(
+   value: false,
+   description: 'enable installed tests'
+ )
++option('installed_test_prefix', type: 'string', value: '', description: 'Prefix for installed tests')
diff --git a/nixpkgs/pkgs/development/libraries/glib/darwin-compilation.patch b/nixpkgs/pkgs/development/libraries/glib/darwin-compilation.patch
new file mode 100644
index 000000000000..f215eef798af
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glib/darwin-compilation.patch
@@ -0,0 +1,24 @@
+Fix compilation on Mac OS X with gcc 4.8.
+
+diff -ru glib-2.40.0-orig/gio/gdummyfile.c glib-2.40.0/gio/gdummyfile.c
+--- glib-2.40.0-orig/gio/gdummyfile.c   2014-02-03 18:40:41.000000000 +0100
++++ glib-2.40.0/gio/gdummyfile.c        2014-07-15 10:58:31.000000000 +0200
+@@ -454,7 +454,8 @@
+   result = g_malloc (escaped_string_end - escaped_string + 1);
+        
+   out = result;
+-  for (in = escaped_string; in < escaped_string_end; in++) 
++  in = escaped_string;
++  for (; in < escaped_string_end; in++) 
+     {
+       character = *in;
+       if (*in == '%') 
+@@ -551,6 +552,7 @@
+   
+   decoded->scheme = g_malloc (p - uri);
+   out = decoded->scheme;
+-  for (in = uri; in < p - 1; in++)
++  in = uri;
++  for (; in < p - 1; in++)
+     *out++ = g_ascii_tolower (*in);
+   *out = 0;
diff --git a/nixpkgs/pkgs/development/libraries/glib/default.nix b/nixpkgs/pkgs/development/libraries/glib/default.nix
new file mode 100644
index 000000000000..3c8fe4d569fa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glib/default.nix
@@ -0,0 +1,215 @@
+{ config, lib, stdenv, fetchurl, gettext, meson, ninja, pkg-config, perl, python3
+, libiconv, zlib, libffi, pcre, libelf, gnome, libselinux, bash, gnum4, gtk-doc, docbook_xsl, docbook_xml_dtd_45
+# use util-linuxMinimal to avoid circular dependency (util-linux, systemd, glib)
+, util-linuxMinimal ? null
+, buildPackages
+
+# this is just for tests (not in the closure of any regular package)
+, doCheck ? config.doCheckByDefault or false
+, coreutils, dbus, libxml2, tzdata
+, desktop-file-utils, shared-mime-info
+, darwin, fetchpatch
+}:
+
+with lib;
+
+assert stdenv.isLinux -> util-linuxMinimal != null;
+
+# TODO:
+# * Make it build without python
+#     Problem: an example (test?) program needs it.
+#     Possible solution: disable compilation of this example somehow
+#     Reminder: add 'sed -e 's@python2\.[0-9]@python@' -i
+#       $out/bin/gtester-report' to postInstall if this is solved
+/*
+  * Use --enable-installed-tests for GNOME-related packages,
+      and use them as a separately installed tests runned by Hydra
+      (they should test an already installed package)
+      https://wiki.gnome.org/GnomeGoals/InstalledTests
+  * Support org.freedesktop.Application, including D-Bus activation from desktop files
+*/
+let
+  # Some packages don't get "Cflags" from pkg-config correctly
+  # and then fail to build when directly including like <glib/...>.
+  # This is intended to be run in postInstall of any package
+  # which has $out/include/ containing just some disjunct directories.
+  flattenInclude = ''
+    for dir in "''${!outputInclude}"/include/*; do
+      cp -r "$dir"/* "''${!outputInclude}/include/"
+      rm -r "$dir"
+      ln -s . "$dir"
+    done
+    ln -sr -t "''${!outputInclude}/include/" "''${!outputInclude}"/lib/*/include/* 2>/dev/null || true
+  '';
+in
+
+stdenv.mkDerivation rec {
+  pname = "glib";
+  version = "2.68.3";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/glib/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0f1iprj7v0b5wn9njj39dkl25g6filfs7i4ybk20jq821k1a7qg7";
+  };
+
+  patches = optionals stdenv.isDarwin [
+    ./darwin-compilation.patch
+    ./link-with-coreservices.patch
+  ] ++ optionals stdenv.hostPlatform.isMusl [
+    ./quark_init_on_demand.patch
+    ./gobject_init_on_demand.patch
+  ] ++ [
+    ./schema-override-variable.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" ];
+
+  setupHook = ./setup-hook.sh;
+
+  buildInputs = [
+    libelf setupHook pcre
+    bash gnum4 # install glib-gettextize and m4 macros for other apps to use
+  ] ++ optionals stdenv.isLinux [
+    libselinux
+    util-linuxMinimal # for libmount
+  ] ++ optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+    AppKit Carbon Cocoa CoreFoundation CoreServices Foundation
+  ]) ++ optionals (stdenv.hostPlatform == stdenv.buildPlatform) [
+    # Note: this needs to be both in buildInputs and nativeBuildInputs. The
+    # Meson gtkdoc module uses find_program to look it up (-> build dep), but
+    # glib's own Meson configuration uses the host pkg-config to find its
+    # version (-> host dep). We could technically go and fix this in glib, add
+    # pkg-config to depsBuildBuild, but this would be a futile exercise since
+    # Meson's gtkdoc integration does not support cross compilation[1] anyway
+    # and this derivation disables the docs build when cross compiling.
+    #
+    # [1] https://github.com/mesonbuild/meson/issues/2003
+    gtk-doc
+  ];
+
+  strictDeps = true;
+
+  nativeBuildInputs = [
+    meson ninja pkg-config perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45 libxml2
+  ];
+
+  propagatedBuildInputs = [ zlib libffi gettext libiconv ];
+
+  mesonFlags = [
+    # Avoid the need for gobject introspection binaries in PATH in cross-compiling case.
+    # Instead we just copy them over from the native output.
+    "-Dgtk_doc=${boolToString (stdenv.hostPlatform == stdenv.buildPlatform)}"
+    "-Dnls=enabled"
+    "-Ddevbindir=${placeholder "dev"}/bin"
+  ];
+
+  NIX_CFLAGS_COMPILE = toString [
+    "-Wno-error=nonnull"
+    # Default for release buildtype but passed manually because
+    # we're using plain
+    "-DG_DISABLE_CAST_CHECKS"
+  ];
+
+  hardeningDisable = [ "pie" ];
+
+  postPatch = ''
+    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
+  '';
+
+  DETERMINISTIC_BUILD = 1;
+
+  postInstall = ''
+    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|"
+
+    # 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.hostPlatform != stdenv.buildPlatform) ''
+    cp -r ${buildPackages.glib.devdoc} $devdoc
+  '';
+
+  checkInputs = [ tzdata desktop-file-utils shared-mime-info ];
+
+  preCheck = optionalString doCheck ''
+    export LD_LIBRARY_PATH="$NIX_BUILD_TOP/${pname}-${version}/glib/.libs''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
+    export TZDIR="${tzdata}/share/zoneinfo"
+    export XDG_CACHE_HOME="$TMP"
+    export XDG_RUNTIME_HOME="$TMP"
+    export HOME="$TMP"
+    export XDG_DATA_DIRS="${desktop-file-utils}/share:${shared-mime-info}/share"
+    export G_TEST_DBUS_DAEMON="${dbus.daemon}/bin/dbus-daemon"
+    export PATH="$PATH:$(pwd)/gobject"
+    echo "PATH=$PATH"
+
+    substituteInPlace gio/tests/desktop-files/home/applications/epiphany-weather-for-toronto-island-9c6a4e022b17686306243dada811d550d25eb1fb.desktop \
+      --replace "Exec=/bin/true" "Exec=${coreutils}/bin/true"
+    # Needs machine-id, comment the test
+    sed -e '/\/gdbus\/codegen-peer-to-peer/ s/^\/*/\/\//' -i gio/tests/gdbus-peer.c
+    sed -e '/g_test_add_func/ s/^\/*/\/\//' -i gio/tests/gdbus-unix-addresses.c
+    # All gschemas fail to pass the test, upstream bug?
+    sed -e '/g_test_add_data_func/ s/^\/*/\/\//' -i gio/tests/gschema-compile.c
+    # Cannot reproduce the failing test_associations on hydra
+    sed -e '/\/appinfo\/associations/d' -i gio/tests/appinfo.c
+    # Needed because of libtool wrappers
+    sed -e '/g_subprocess_launcher_set_environ (launcher, envp);/a g_subprocess_launcher_setenv (launcher, "PATH", g_getenv("PATH"), TRUE);' -i gio/tests/gsubprocess.c
+  '';
+
+  inherit doCheck;
+
+  separateDebugInfo = stdenv.isLinux;
+
+  passthru = rec {
+    gioModuleDir = "lib/gio/modules";
+    makeSchemaPath = dir: name: "${dir}/share/gsettings-schemas/${name}/glib-2.0/schemas";
+    getSchemaPath = pkg: makeSchemaPath pkg pkg.name;
+    inherit flattenInclude;
+    updateScript = gnome.updateScript { packageName = "glib"; };
+  };
+
+  meta = with lib; {
+    description = "C library of programming buildings blocks";
+    homepage    = "https://www.gtk.org/";
+    license     = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members ++ (with maintainers; [ lovek323 raskin ]);
+    platforms   = platforms.unix;
+
+    longDescription = ''
+      GLib provides the core application building blocks for libraries
+      and applications written in C.  It provides the core object
+      system used in GNOME, the main loop implementation, and a large
+      set of utility functions for strings and common data structures.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/glib/gobject_init_on_demand.patch b/nixpkgs/pkgs/development/libraries/glib/gobject_init_on_demand.patch
new file mode 100644
index 000000000000..d72d0b61dca2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glib/gobject_init_on_demand.patch
@@ -0,0 +1,87 @@
+--- glib-source/gobject/gtype.c	2016-08-17 17:20:47.000000000 +0200
++++ glib-source/gobject/gtype.c	2016-09-01 21:56:31.777406646 +0200
+@@ -209,6 +209,9 @@
+ static gboolean				type_node_is_a_L		(TypeNode		*node,
+ 									 TypeNode		*iface_node);
+ 
++#if !defined(__GLIBC__)
++static void gobject_init (void);
++#endif
+ 
+ /* --- enumeration --- */
+ 
+@@ -2631,7 +2634,10 @@
+ 			     GTypeFlags			 flags)
+ {
+   TypeNode *node;
+-  
++ 
++#if !defined(__GLIBC__)
++  gobject_init();
++#endif 
+   g_assert_type_system_initialized ();
+   g_return_val_if_fail (type_id > 0, 0);
+   g_return_val_if_fail (type_name != NULL, 0);
+@@ -2749,6 +2755,9 @@
+   TypeNode *pnode, *node;
+   GType type = 0;
+   
++#if !defined(__GLIBC__)
++  gobject_init();
++#endif 
+   g_assert_type_system_initialized ();
+   g_return_val_if_fail (parent_type > 0, 0);
+   g_return_val_if_fail (type_name != NULL, 0);
+@@ -2804,6 +2813,9 @@
+   TypeNode *pnode, *node;
+   GType type;
+   
++#if !defined(__GLIBC__)
++  gobject_init();
++#endif 
+   g_assert_type_system_initialized ();
+   g_return_val_if_fail (parent_type > 0, 0);
+   g_return_val_if_fail (type_name != NULL, 0);
+@@ -3319,6 +3331,9 @@
+ {
+   TypeNode *node;
+   
++#if !defined(__GLIBC__)
++  gobject_init();
++#endif 
+   g_assert_type_system_initialized ();
+   
+   node = lookup_type_node_I (type);
+@@ -4343,6 +4358,9 @@
+ void
+ g_type_init_with_debug_flags (GTypeDebugFlags debug_flags)
+ {
++#if !defined(__GLIBC__)
++  gobject_init();
++#endif 
+   g_assert_type_system_initialized ();
+ 
+   if (debug_flags)
+@@ -4361,6 +4379,9 @@
+ void
+ g_type_init (void)
+ {
++#if !defined(__GLIBC__)
++  gobject_init();
++#endif 
+   g_assert_type_system_initialized ();
+ }
+ 
+@@ -4372,6 +4393,12 @@
+   TypeNode *node;
+   GType type;
+ 
++#if !defined(__GLIBC__)
++  static int gobject_initialized = 0;
++  if (gobject_initialized)
++    return;
++  gobject_initialized = 1;
++#endif
+   /* Ensure GLib is initialized first, see
+    * https://bugzilla.gnome.org/show_bug.cgi?id=756139
+    */
diff --git a/nixpkgs/pkgs/development/libraries/glib/link-with-coreservices.patch b/nixpkgs/pkgs/development/libraries/glib/link-with-coreservices.patch
new file mode 100644
index 000000000000..dcc0a8998cc3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glib/link-with-coreservices.patch
@@ -0,0 +1,11 @@
+--- a/meson.build.orig	2020-11-25 13:47:38.499149252 +0900
++++ b/meson.build	2020-11-25 13:48:47.098444800 +0900
+@@ -742,7 +742,7 @@
+ 
+   if glib_have_carbon
+     glib_conf.set('HAVE_CARBON', true)
+-    osx_ldflags += '-Wl,-framework,Carbon'
++    osx_ldflags += ['-Wl,-framework,Carbon', '-Wl,-framework,CoreServices']
+     glib_have_os_x_9_or_later = objcc.compiles('''#include <AvailabilityMacros.h>
+                                                   #if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
+                                                   #error Compiling for minimum OS X version before 10.9
diff --git a/nixpkgs/pkgs/development/libraries/glib/quark_init_on_demand.patch b/nixpkgs/pkgs/development/libraries/glib/quark_init_on_demand.patch
new file mode 100644
index 000000000000..168086484314
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glib/quark_init_on_demand.patch
@@ -0,0 +1,33 @@
+--- glib-source/glib/gquark.c	2016-08-17 17:20:47.000000000 +0200
++++ glib-source/glib/gquark.c	2016-08-30 07:49:13.298234757 +0200
+@@ -57,6 +57,9 @@
+ void
+ g_quark_init (void)
+ {
++  if (quark_ht)
++    return;
++
+   g_assert (quark_seq_id == 0);
+   quark_ht = g_hash_table_new (g_str_hash, g_str_equal);
+   quarks = g_new (gchar*, QUARK_BLOCK_SIZE);
+@@ -138,9 +141,12 @@
+     return 0;
+ 
+   G_LOCK (quark_global);
++#if !defined(__GLIBC__)
++  g_quark_init ();
++#endif
+   quark = GPOINTER_TO_UINT (g_hash_table_lookup (quark_ht, string));
+   G_UNLOCK (quark_global);
+
+   return quark;
+ }
+ 
+@@ -280,6 +286,7 @@
+   GQuark quark;
+   gchar **quarks_new;
+ 
++  g_quark_init ();
+   if (quark_seq_id % QUARK_BLOCK_SIZE == 0)
+     {
+       quarks_new = g_new (gchar*, quark_seq_id + QUARK_BLOCK_SIZE);
diff --git a/nixpkgs/pkgs/development/libraries/glib/schema-override-variable.patch b/nixpkgs/pkgs/development/libraries/glib/schema-override-variable.patch
new file mode 100644
index 000000000000..f98af04a7f24
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glib/schema-override-variable.patch
@@ -0,0 +1,14 @@
+diff --git a/gio/gsettingsschema.c b/gio/gsettingsschema.c
+index 1282c10a1..feadfe3aa 100644
+--- a/gio/gsettingsschema.c
++++ b/gio/gsettingsschema.c
+@@ -360,6 +360,9 @@ initialise_schema_sources (void)
+ 
+       try_prepend_data_dir (g_get_user_data_dir ());
+ 
++      if (!is_setuid && (path = g_getenv ("NIX_GSETTINGS_OVERRIDES_DIR")) != NULL)
++        try_prepend_dir (path);
++
+       /* Disallow loading extra schemas if running as setuid, as that could
+        * allow reading privileged files. */
+       if (!is_setuid && (path = g_getenv ("GSETTINGS_SCHEMA_DIR")) != NULL)
diff --git a/nixpkgs/pkgs/development/libraries/glib/setup-hook.sh b/nixpkgs/pkgs/development/libraries/glib/setup-hook.sh
new file mode 100644
index 000000000000..8ead5510ec4f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glib/setup-hook.sh
@@ -0,0 +1,34 @@
+make_glib_find_gsettings_schemas() {
+    # For packages that need gschemas of other packages (e.g. empathy)
+    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 "$targetOffset" make_glib_find_gsettings_schemas
+
+# Install gschemas, if any, in a package-specific directory
+glibPreInstallPhase() {
+  makeFlagsArray+=("gsettingsschemadir=${!outputLib}/share/gsettings-schemas/$name/glib-2.0/schemas/")
+}
+preInstallPhases+=" glibPreInstallPhase"
+
+glibPreFixupPhase() {
+    # Move gschemas in case the install flag didn't help
+    if [ -d "$prefix/share/glib-2.0/schemas" ]; then
+        mkdir -p "${!outputLib}/share/gsettings-schemas/$name/glib-2.0"
+        mv "$prefix/share/glib-2.0/schemas" "${!outputLib}/share/gsettings-schemas/$name/glib-2.0/"
+    fi
+
+    addToSearchPath GSETTINGS_SCHEMAS_PATH "${!outputLib}/share/gsettings-schemas/$name"
+}
+
+# gappsWrapperArgsHook expects GSETTINGS_SCHEMAS_PATH variable to be set by this.
+# Until we have dependency mechanism in generic builder, we need to use this ugly hack.
+if [[ " ${preFixupPhases:-} " =~ " gappsWrapperArgsHook " ]]; then
+    preFixupPhases+=" "
+    preFixupPhases="${preFixupPhases/ gappsWrapperArgsHook / glibPreFixupPhase gappsWrapperArgsHook }"
+else
+    preFixupPhases+=" glibPreFixupPhase"
+fi
diff --git a/nixpkgs/pkgs/development/libraries/glib/skip-timer-test.patch b/nixpkgs/pkgs/development/libraries/glib/skip-timer-test.patch
new file mode 100644
index 000000000000..942f3e7864c4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glib/skip-timer-test.patch
@@ -0,0 +1,17 @@
+Description: Skip test which performs some unreliable floating point comparisons
+Forwarded: https://bugzilla.gnome.org/show_bug.cgi?id=722604
+
+Index: b/glib/tests/timer.c
+===================================================================
+--- a/glib/tests/timer.c
++++ b/glib/tests/timer.c
+@@ -203,7 +203,7 @@
+ {
+   g_test_init (&argc, &argv, NULL);
+ 
+-  g_test_add_func ("/timer/basic", test_timer_basic);
++/*  g_test_add_func ("/timer/basic", test_timer_basic);*/
+-  g_test_add_func ("/timer/stop", test_timer_stop);
++/*  g_test_add_func ("/timer/stop", test_timer_stop);*/
+   g_test_add_func ("/timer/continue", test_timer_continue);
+   g_test_add_func ("/timer/reset", test_timer_reset);
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..9a949ea1226c
--- /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 5ea6bae2f..e0b584a86 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 3535788ab..99c3b48d6 100644
+--- a/gio/meson.build
++++ b/gio/meson.build
+@@ -831,14 +831,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=' + pkgconfig_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,
+@@ -939,12 +940,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,
+@@ -953,6 +956,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])
+@@ -960,6 +964,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 aaf5f00f5..09edd291a 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 85e283bab..386ad5e4e 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 484f4c750..c7f9327d9 100644
+--- a/meson.build
++++ b/meson.build
+@@ -2122,7 +2122,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.33-master.patch.gz b/nixpkgs/pkgs/development/libraries/glibc/2.33-master.patch.gz
new file mode 100644
index 000000000000..59230761cd43
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/2.33-master.patch.gz
Binary files differdiff --git a/nixpkgs/pkgs/development/libraries/glibc/allow-kernel-2.6.32.patch b/nixpkgs/pkgs/development/libraries/glibc/allow-kernel-2.6.32.patch
new file mode 100644
index 000000000000..ce18b874c427
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/allow-kernel-2.6.32.patch
@@ -0,0 +1,39 @@
+diff --git a/sysdeps/unix/sysv/linux/configure b/sysdeps/unix/sysv/linux/configure
+index cace758c01..38fe7fe0b0 100644
+--- a/sysdeps/unix/sysv/linux/configure
++++ b/sysdeps/unix/sysv/linux/configure
+@@ -69,7 +69,7 @@ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kernel header at least $minimum_kernel" >&5
+ $as_echo_n "checking for kernel header at least $minimum_kernel... " >&6; }
+ decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
+-abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
++abinum=`echo "2.6.32.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ /* end confdefs.h.  */
+ #include <linux/version.h>
+diff --git a/sysdeps/unix/sysv/linux/configure.ac b/sysdeps/unix/sysv/linux/configure.ac
+index 13abda0a51..6abc12eaed 100644
+--- a/sysdeps/unix/sysv/linux/configure.ac
++++ b/sysdeps/unix/sysv/linux/configure.ac
+@@ -50,7 +50,7 @@ fi
+ AC_MSG_CHECKING(for kernel header at least $minimum_kernel)
+ changequote(,)dnl
+ decnum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/(\1 * 65536 + \2 * 256 + \3)/'`;
+-abinum=`echo "$minimum_kernel.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
++abinum=`echo "2.6.32.0.0.0" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1,\2,\3/'`;
+ changequote([,])dnl
+ AC_TRY_COMPILE([#include <linux/version.h>
+ #if LINUX_VERSION_CODE < $decnum
+diff --git a/sysdeps/unix/sysv/linux/dl-osinfo.h b/sysdeps/unix/sysv/linux/dl-osinfo.h
+index 823cd8224d..482caaeeec 100644
+--- a/sysdeps/unix/sysv/linux/dl-osinfo.h
++++ b/sysdeps/unix/sysv/linux/dl-osinfo.h
+@@ -39,7 +39,7 @@
+ 	  GLRO(dl_osversion) = version;					      \
+ 									      \
+ 	/* Now we can test with the required version.  */		      \
+-	if (__LINUX_KERNEL_VERSION > 0 && version < __LINUX_KERNEL_VERSION)   \
++	if (__LINUX_KERNEL_VERSION > 0 && version < __LINUX_KERNEL_VERSION && version != 0x020620)   \
+ 	  /* Not sufficent.  */						      \
+ 	  FATAL ("FATAL: kernel too old\n");				      \
+       }									      \
diff --git a/nixpkgs/pkgs/development/libraries/glibc/common.nix b/nixpkgs/pkgs/development/libraries/glibc/common.nix
new file mode 100644
index 000000000000..e651a8effac9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/common.nix
@@ -0,0 +1,291 @@
+/* Build configuration used to build glibc, Info files, and locale
+   information.
+
+   Note that this derivation has multiple outputs and does not respect the
+   standard convention of putting the executables into the first output. The
+   first output is `lib` so that the libraries provided by this derivation
+   can be accessed directly, e.g.
+
+     "${pkgs.glibc}/lib/ld-linux-x86_64.so.2"
+
+   The executables are put into `bin` output and need to be referenced via
+   the `bin` attribute of the main package, e.g.
+
+     "${pkgs.glibc.bin}/bin/ldd".
+
+  The executables provided by glibc typically include `ldd`, `locale`, `iconv`
+  but the exact set depends on the library version and the configuration.
+*/
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+{ stdenv, lib
+, buildPackages
+, fetchurl
+, linuxHeaders ? null
+, gd ? null, libpng ? null
+, libidn2
+, bison
+, python3Minimal
+}:
+
+{ pname
+, withLinuxHeaders ? false
+, profilingLibraries ? false
+, withGd ? false
+, meta
+, ...
+} @ args:
+
+let
+  version = "2.33";
+  patchSuffix = "-47";
+  sha256 = "sha256-LiVWAA4QXb1X8Layoy/yzxc73k8Nhd/8z9i35RoGd/8=";
+in
+
+assert withLinuxHeaders -> linuxHeaders != null;
+assert withGd -> gd != null && libpng != null;
+
+stdenv.mkDerivation ({
+  version = version + patchSuffix;
+  linuxHeaders = if withLinuxHeaders then linuxHeaders else null;
+
+  inherit (stdenv) is64bit;
+
+  enableParallelBuilding = true;
+
+  patches =
+    [
+      /* No tarballs for stable upstream branch, only https://sourceware.org/git/glibc.git and using git would complicate bootstrapping.
+          $ git fetch --all -p && git checkout origin/release/2.33/master && git describe
+          glibc-2.33-47-gb5711025bc
+          $ git show --minimal --reverse glibc-2.33.. | gzip -9n --rsyncable - > 2.33-master.patch.gz
+
+         To compare the archive contents zdiff can be used.
+          $ zdiff -u 2.33-master.patch.gz ../nixpkgs/pkgs/development/libraries/glibc/2.33-master.patch.gz
+       */
+      ./2.33-master.patch.gz
+
+      /* Allow NixOS and Nix to handle the locale-archive. */
+      ./nix-locale-archive.patch
+
+      /* Don't use /etc/ld.so.cache, for non-NixOS systems.  */
+      ./dont-use-system-ld-so-cache.patch
+
+      /* Don't use /etc/ld.so.preload, but /etc/ld-nix.so.preload.  */
+      ./dont-use-system-ld-so-preload.patch
+
+      /* The command "getconf CS_PATH" returns the default search path
+         "/bin:/usr/bin", which is inappropriate on NixOS machines. This
+         patch extends the search path by "/run/current-system/sw/bin". */
+      ./fix_path_attribute_in_getconf.patch
+
+      /* Allow running with RHEL 6 -like kernels.  The patch adds an exception
+        for glibc to accept 2.6.32 and to tag the ELFs as 2.6.32-compatible
+        (otherwise the loader would refuse libc).
+        Note that glibc will fully work only on their heavily patched kernels
+        and we lose early mismatch detection on 2.6.32.
+
+        On major glibc updates we should check that the patched kernel supports
+        all the required features.  ATM it's verified up to glibc-2.26-131.
+        # HOWTO: check glibc sources for changes in kernel requirements
+        git log -p glibc-2.25.. sysdeps/unix/sysv/linux/x86_64/kernel-features.h sysdeps/unix/sysv/linux/kernel-features.h
+        # get kernel sources (update the URL)
+        mkdir tmp && cd tmp
+        curl http://vault.centos.org/6.9/os/Source/SPackages/kernel-2.6.32-696.el6.src.rpm | rpm2cpio - | cpio -idmv
+        tar xf linux-*.bz2
+        # check syscall presence, for example
+        less linux-*?/arch/x86/kernel/syscall_table_32.S
+       */
+      ./allow-kernel-2.6.32.patch
+
+      /* Provide a fallback for missing prlimit64 syscall on RHEL 6 -like
+         kernels.
+
+         This patch is maintained by @veprbl. If it gives you trouble, feel
+         free to ping me, I'd be happy to help.
+       */
+      (fetchurl {
+        url = "https://git.savannah.gnu.org/cgit/guix.git/plain/gnu/packages/patches/glibc-reinstate-prlimit64-fallback.patch?id=eab07e78b691ae7866267fc04d31c7c3ad6b0eeb";
+        sha256 = "091bk3kyrx1gc380gryrxjzgcmh1ajcj8s2rjhp2d2yzd5mpd5ps";
+      })
+
+      /* Provide utf-8 locales by default, so we can use it in stdenv without depending on our large locale-archive. */
+      (fetchurl {
+        url = "https://salsa.debian.org/glibc-team/glibc/raw/49767c9f7de4828220b691b29de0baf60d8a54ec/debian/patches/localedata/locale-C.diff";
+        sha256 = "0irj60hs2i91ilwg5w7sqrxb695c93xg0ik7yhhq9irprd7fidn4";
+      })
+
+      ./fix-x64-abi.patch
+    ]
+    ++ lib.optional stdenv.hostPlatform.isMusl ./fix-rpc-types-musl-conflicts.patch
+    ++ lib.optional stdenv.buildPlatform.isDarwin ./darwin-cross-build.patch;
+
+  postPatch =
+    ''
+      # Needed for glibc to build with the gnumake 3.82
+      # http://comments.gmane.org/gmane.linux.lfs.support/31227
+      sed -i 's/ot \$/ot:\n\ttouch $@\n$/' manual/Makefile
+
+      # nscd needs libgcc, and we don't want it dynamically linked
+      # because we don't want it to depend on bootstrap-tools libs.
+      echo "LDFLAGS-nscd += -static-libgcc" >> nscd/Makefile
+    ''
+    # FIXME: find a solution for infinite recursion in cross builds.
+    # For now it's hopefully acceptable that IDN from libc doesn't reliably work.
+    + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
+
+      # Ensure that libidn2 is found.
+      patch -p 1 <<EOF
+      --- a/inet/idna.c
+      +++ b/inet/idna.c
+      @@ -25,1 +25,1 @@
+      -#define LIBIDN2_SONAME "libidn2.so.0"
+      +#define LIBIDN2_SONAME "${lib.getLib libidn2}/lib/libidn2.so.0"
+      EOF
+    '';
+
+  configureFlags =
+    [ "-C"
+      "--enable-add-ons"
+      "--sysconfdir=/etc"
+      "--enable-stackguard-randomization"
+      "--enable-bind-now"
+      (lib.withFeatureAs withLinuxHeaders "headers" "${linuxHeaders}/include")
+      (lib.enableFeature profilingLibraries "profile")
+    ] ++ lib.optionals (stdenv.hostPlatform.isx86_64 || stdenv.hostPlatform.isi686 || stdenv.hostPlatform.isAarch64) [
+      # This feature is currently supported on
+      # i386, x86_64 and x32 with binutils 2.29 or later,
+      # and on aarch64 with binutils 2.30 or later.
+      # https://sourceware.org/glibc/wiki/PortStatus
+      "--enable-static-pie"
+    ] ++ lib.optionals withLinuxHeaders [
+      "--enable-kernel=3.2.0" # can't get below with glibc >= 2.26
+    ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+      (lib.flip lib.withFeature "fp"
+         (stdenv.hostPlatform.gcc.float or (stdenv.hostPlatform.parsed.abi.float or "hard") == "soft"))
+      "--with-__thread"
+    ] ++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform && stdenv.hostPlatform.isAarch32) [
+      "--host=arm-linux-gnueabi"
+      "--build=arm-linux-gnueabi"
+
+      # To avoid linking with -lgcc_s (dynamic link)
+      # so the glibc does not depend on its compiler store path
+      "libc_cv_as_needed=no"
+    ] ++ lib.optional withGd "--with-gd";
+
+  makeFlags = [
+    "OBJCOPY=${stdenv.cc.targetPrefix}objcopy"
+  ];
+
+  installFlags = [ "sysconfdir=$(out)/etc" ];
+
+  outputs = [ "out" "bin" "dev" "static" ];
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ bison python3Minimal ];
+  buildInputs = [ linuxHeaders ] ++ lib.optionals withGd [ gd libpng ];
+
+  # Needed to install share/zoneinfo/zone.tab.  Set to impure /bin/sh to
+  # prevent a retained dependency on the bootstrap tools in the stdenv-linux
+  # bootstrap.
+  BASH_SHELL = "/bin/sh";
+
+  # Used by libgcc, elf-header, and others to determine ABI
+  passthru = { inherit version; };
+}
+
+// (removeAttrs args [ "withLinuxHeaders" "withGd" ]) //
+
+{
+  src = fetchurl {
+    url = "mirror://gnu/glibc/glibc-${version}.tar.xz";
+    inherit sha256;
+  };
+
+  # Remove absolute paths from `configure' & co.; build out-of-tree.
+  preConfigure = ''
+    export PWD_P=$(type -tP pwd)
+    for i in configure io/ftwtest-sh; do
+        # Can't use substituteInPlace here because replace hasn't been
+        # built yet in the bootstrap.
+        sed -i "$i" -e "s^/bin/pwd^$PWD_P^g"
+    done
+
+    mkdir ../build
+    cd ../build
+
+    configureScript="`pwd`/../$sourceRoot/configure"
+
+    ${lib.optionalString (stdenv.cc.libc != null)
+      ''makeFlags="$makeFlags BUILD_LDFLAGS=-Wl,-rpath,${stdenv.cc.libc}/lib OBJDUMP=${stdenv.cc.bintools.bintools}/bin/objdump"''
+    }
+
+
+  '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+    sed -i s/-lgcc_eh//g "../$sourceRoot/Makeconfig"
+
+    cat > config.cache << "EOF"
+    libc_cv_forced_unwind=yes
+    libc_cv_c_cleanup=yes
+    libc_cv_gnu89_inline=yes
+    EOF
+
+    # ./configure has logic like
+    #
+    #     AR=`$CC -print-prog-name=ar`
+    #
+    # This searches various directories in the gcc and its wrapper. In nixpkgs,
+    # this returns the bare string "ar", which is build ar. This can result as
+    # a build failure with the following message:
+    #
+    #     libc_pic.a: error adding symbols: archive has no index; run ranlib to add one
+    #
+    # (Observed cross compiling from aarch64-linux -> armv7l-linux).
+    #
+    # Nixpkgs passes a correct value for AR and friends, so to use the correct
+    # set of tools, we only need to delete this special handling.
+    sed -i \
+      -e '/^AR=/d' \
+      -e '/^AS=/d' \
+      -e '/^LD=/d' \
+      -e '/^OBJCOPY=/d' \
+      -e '/^OBJDUMP=/d' \
+      $configureScript
+  '';
+
+  preBuild = lib.optionalString withGd "unset NIX_DONT_SET_RPATH";
+
+  doCheck = false; # fails
+
+  meta = with lib; {
+    homepage = "https://www.gnu.org/software/libc/";
+    description = "The GNU C Library";
+
+    longDescription =
+      '' Any Unix-like operating system needs a C library: the library which
+         defines the "system calls" and other basic facilities such as
+         open, malloc, printf, exit...
+
+         The GNU C library is used as the C library in the GNU system and
+         most systems with the Linux kernel.
+      '';
+
+    license = licenses.lgpl2Plus;
+
+    maintainers = with maintainers; [ eelco ma27 ];
+    platforms = platforms.linux;
+  } // meta;
+}
+
+// lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
+  preInstall = null; # clobber the native hook
+
+  # To avoid a dependency on the build system 'bash'.
+  preFixup = ''
+    rm -f $bin/bin/{ldd,tzselect,catchsegv,xtrace}
+  '';
+})
diff --git a/nixpkgs/pkgs/development/libraries/glibc/darwin-cross-build.patch b/nixpkgs/pkgs/development/libraries/glibc/darwin-cross-build.patch
new file mode 100644
index 000000000000..b746e6369a07
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/darwin-cross-build.patch
@@ -0,0 +1,77 @@
+enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux)
+* increase ulimit for open files: macOS default of 256 is too low for glibc build system
+* use host version of ar, which is given by environment variable
+* build system uses stamp.os and stamp.oS files, which only differ in case;
+  this fails on macOS, so replace .oS with .o_S
+--- glibc-2.32/Makefile.in	2018-02-01 17:17:18.000000000 +0100
++++ glibc-2.32/Makefile.in	2020-12-27 18:21:30.000000000 +0100
+@@ -6,9 +6,11 @@
+ .PHONY: all install bench
+ 
+ all .DEFAULT:
+-	$(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@
++	ulimit -n 1024; \
++	$(MAKE) -r AR=$$AR PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@
+ 
+ install:
++	ulimit -n 1024; \
+ 	LC_ALL=C; export LC_ALL; \
+ 	$(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@
+ 
+--- glibc-2.32/Makerules	2018-02-01 17:17:18.000000000 +0100
++++ glibc-2.32/Makerules	2020-12-27 18:21:30.000000000 +0100
+@@ -847,8 +847,8 @@
+ ifndef objects
+ 
+ # Create the stamp$o files to keep the parent makefile happy.
+-subdir_lib: $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o)
+-$(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o):
++subdir_lib: $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$(subst .oS,.o_S,$o))
++$(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$(subst .oS,.o_S,$o)):
+ 	$(make-target-directory)
+ 	rm -f $@; > $@
+ else
+@@ -859,7 +859,7 @@
+ # The parent will then actually add them all to the archive in the
+ # archive rule, below.
+ define o-iterator-doit
+-$(objpfx)stamp$o: $(o-objects); $$(do-stamp)
++$(objpfx)stamp$(subst .oS,.o_S,$o): $(o-objects); $$(do-stamp)
+ endef
+ define do-stamp
+ $(make-target-directory)
+@@ -875,14 +875,14 @@
+ # on the stamp files built above.
+ define o-iterator-doit
+ $(common-objpfx)$(patsubst %,$(libtype$o),c): \
+-		$(subdirs-stamp-o) $(common-objpfx)stamp$o; $$(do-makelib)
++		$(subdirs-stamp-o) $(common-objpfx)stamp$(subst .oS,.o_S,$o); $$(do-makelib)
+ endef
+ define do-makelib
+ cd $(common-objdir) && \
+ $(AR) $(CREATE_ARFLAGS) $(@F) `cat $(patsubst $(common-objpfx)%,%,$^)`
+ endef
+ subdirs-stamps := $(foreach d,$(subdirs),$(common-objpfx)$d/stamp%)
+-subdirs-stamp-o = $(subst %,$o,$(subdirs-stamps))
++subdirs-stamp-o = $(subst %,$(subst .oS,.o_S,$o),$(subdirs-stamps))
+ ifndef subdir
+ $(subdirs-stamps): subdir_lib;
+ endif
+@@ -893,7 +893,7 @@
+ # This makes all the object files.
+ .PHONY: objects objs libobjs extra-objs
+ objects objs: libobjs extra-objs
+-libobjs: $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$o)
++libobjs: $(foreach o,$(object-suffixes-for-libc),$(objpfx)stamp$(subst .oS,.o_S,$o))
+ extra-objs: $(addprefix $(objpfx),$(extra-objs))
+ 
+ # Canned sequence for building an extra library archive.
+@@ -1499,7 +1499,7 @@
+ 	$(rmobjs)
+ define rmobjs
+ $(foreach o,$(object-suffixes-for-libc),
+--rm -f $(objpfx)stamp$o $(o-objects))
++-rm -f $(objpfx)stamp$(subst .oS,.o_S,$o) $(o-objects))
+ endef
+ 
+ # Also remove the dependencies and generated source files.
diff --git a/nixpkgs/pkgs/development/libraries/glibc/default.nix b/nixpkgs/pkgs/development/libraries/glibc/default.nix
new file mode 100644
index 000000000000..caaacfe4f436
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/default.nix
@@ -0,0 +1,150 @@
+{ lib, stdenv, callPackage
+, withLinuxHeaders ? true
+, profilingLibraries ? false
+, withGd ? false
+, buildPackages
+}:
+
+let
+  gdCflags = [
+    "-Wno-error=stringop-truncation"
+    "-Wno-error=missing-attributes"
+    "-Wno-error=array-bounds"
+  ];
+in
+
+callPackage ./common.nix { inherit stdenv; } {
+    pname = "glibc" + lib.optionalString withGd "-gd";
+
+    inherit withLinuxHeaders profilingLibraries withGd;
+
+    # Note:
+    # Things you write here override, and do not add to,
+    # the values in `common.nix`.
+    # (For example, if you define `patches = [...]` here, it will
+    # override the patches in `common.nix`.)
+
+    NIX_NO_SELF_RPATH = true;
+
+    postConfigure = ''
+      # Hack: get rid of the `-static' flag set by the bootstrap stdenv.
+      # This has to be done *after* `configure' because it builds some
+      # test binaries.
+      export NIX_CFLAGS_LINK=
+      export NIX_LDFLAGS_BEFORE=
+
+      export NIX_DONT_SET_RPATH=1
+      unset CFLAGS
+
+      # Apparently --bindir is not respected.
+      makeFlagsArray+=("bindir=$bin/bin" "sbindir=$bin/sbin" "rootsbindir=$bin/sbin")
+    '';
+
+    # The stackprotector and fortify hardening flags are autodetected by glibc
+    # and enabled by default if supported. Setting it for every gcc invocation
+    # does not work.
+    hardeningDisable = [ "stackprotector" "fortify" ]
+    # XXX: Not actually musl-speciic but since only musl enables pie by default,
+    #      limit rebuilds by only disabling pie w/musl
+      ++ lib.optional stdenv.hostPlatform.isMusl "pie";
+
+    NIX_CFLAGS_COMPILE = lib.concatStringsSep " "
+      (builtins.concatLists [
+        (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
+        (lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias")
+        (lib.optionals ((stdenv.hostPlatform != stdenv.buildPlatform) || stdenv.hostPlatform.isMusl) [
+          # Ignore "error: '__EI___errno_location' specifies less restrictive attributes than its target '__errno_location'"
+          # New warning as of GCC 9
+          # Same for musl: https://github.com/NixOS/nixpkgs/issues/78805
+          "-Wno-error=missing-attributes"
+        ])
+      ]);
+
+    # 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
+    # store path than that determined when built (as a source for the
+    # bootstrap-tools tarball)
+    # Building from a proper gcc staying in the path where it was installed,
+    # libgcc_s will not be at {gcc}/lib, and gcc's libgcc will be found without
+    # any special hack.
+    preInstall = ''
+      if [ -f ${stdenv.cc.cc}/lib/libgcc_s.so.1 ]; then
+          mkdir -p $out/lib
+          cp ${stdenv.cc.cc}/lib/libgcc_s.so.1 $out/lib/libgcc_s.so.1
+          # the .so It used to be a symlink, but now it is a script
+          cp -a ${stdenv.cc.cc}/lib/libgcc_s.so $out/lib/libgcc_s.so
+      fi
+    '';
+
+    postInstall = (if stdenv.hostPlatform == stdenv.buildPlatform then ''
+      echo SUPPORTED-LOCALES=C.UTF-8/UTF-8 > ../glibc-2*/localedata/SUPPORTED
+      make -j''${NIX_BUILD_CORES:-1} -l''${NIX_BUILD_CORES:-1} localedata/install-locales
+    '' else lib.optionalString stdenv.buildPlatform.isLinux ''
+      # This is based on http://www.linuxfromscratch.org/lfs/view/development/chapter06/glibc.html
+      # Instead of using their patch to build a build-native localedef,
+      # we simply use the one from buildPackages
+      pushd ../glibc-2*/localedata
+      export I18NPATH=$PWD GCONV_PATH=$PWD/../iconvdata
+      mkdir -p $NIX_BUILD_TOP/${buildPackages.glibc}/lib/locale
+      ${lib.getBin buildPackages.glibc}/bin/localedef \
+        --alias-file=../intl/locale.alias \
+        -i locales/C \
+        -f charmaps/UTF-8 \
+        --prefix $NIX_BUILD_TOP \
+        ${if stdenv.hostPlatform.parsed.cpu.significantByte.name == "littleEndian" then
+            "--little-endian"
+          else
+            "--big-endian"} \
+        C.UTF-8
+      cp -r $NIX_BUILD_TOP/${buildPackages.glibc}/lib/locale $out/lib
+      popd
+    '') + ''
+
+      test -f $out/etc/ld.so.cache && rm $out/etc/ld.so.cache
+
+      if test -n "$linuxHeaders"; then
+          # Include the Linux kernel headers in Glibc, except the `scsi'
+          # subdirectory, which Glibc provides itself.
+          (cd $dev/include && \
+           ln -sv $(ls -d $linuxHeaders/include/* | grep -v scsi\$) .)
+      fi
+
+      # Fix for NIXOS-54 (ldd not working on x86_64).  Make a symlink
+      # "lib64" to "lib".
+      if test -n "$is64bit"; then
+          ln -s lib $out/lib64
+      fi
+
+      # Get rid of more unnecessary stuff.
+      rm -rf $out/var $bin/bin/sln
+    ''
+      # For some reason these aren't stripped otherwise and retain reference
+      # to bootstrap-tools; on cross-arm this stripping would break objects.
+    + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
+
+      for i in "$out"/lib/*.a; do
+          [ "$i" = "$out/lib/libm.a" ] || $STRIP -S "$i"
+      done
+    '' + ''
+
+      # Put libraries for static linking in a separate output.  Note
+      # that libc_nonshared.a and libpthread_nonshared.a are required
+      # for dynamically-linked applications.
+      mkdir -p $static/lib
+      mv $out/lib/*.a $static/lib
+      mv $static/lib/lib*_nonshared.a $out/lib
+      # Some of *.a files are linker scripts where moving broke the paths.
+      sed "/^GROUP/s|$out/lib/lib|$static/lib/lib|g" \
+        -i "$static"/lib/*.a
+
+      # Work around a Nix bug: hard links across outputs cause a build failure.
+      cp $bin/bin/getconf $bin/bin/getconf_
+      mv $bin/bin/getconf_ $bin/bin/getconf
+    '';
+
+    separateDebugInfo = true;
+
+    meta.description = "The GNU C Library";
+  }
diff --git a/nixpkgs/pkgs/development/libraries/glibc/dont-use-system-ld-so-cache.patch b/nixpkgs/pkgs/development/libraries/glibc/dont-use-system-ld-so-cache.patch
new file mode 100644
index 000000000000..0e0315aca270
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/dont-use-system-ld-so-cache.patch
@@ -0,0 +1,64 @@
+diff --git a/elf/Makefile b/elf/Makefile
+index 5d666b1b..a5017e9c 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -669,14 +669,14 @@ $(objpfx)sln: $(sln-modules:%=$(objpfx)%.o)
+ 
+ $(objpfx)ldconfig: $(ldconfig-modules:%=$(objpfx)%.o)
+ 
+-SYSCONF-FLAGS := -D'SYSCONFDIR="$(sysconfdir)"'
+-CFLAGS-ldconfig.c += $(SYSCONF-FLAGS) -D'LIBDIR="$(libdir)"' \
++PREFIX-FLAGS := -D'PREFIX="$(prefix)"'
++CFLAGS-ldconfig.c += $(PREFIX-FLAGS) -D'LIBDIR="$(libdir)"' \
+ 		    -D'SLIBDIR="$(slibdir)"'
+ libof-ldconfig = ldconfig
+-CFLAGS-dl-cache.c += $(SYSCONF-FLAGS)
+-CFLAGS-cache.c += $(SYSCONF-FLAGS)
+-CFLAGS-rtld.c += $(SYSCONF-FLAGS)
+-CFLAGS-dl-usage.c += $(SYSCONF-FLAGS) \
++CFLAGS-dl-cache.c += $(PREFIX-FLAGS)
++CFLAGS-cache.c += $(PREFIX-FLAGS)
++CFLAGS-rtld.c += $(PREFIX-FLAGS)
++CFLAGS-dl-usage.c += $(PREFIX-FLAGS) \
+   -D'RTLD="$(rtlddir)/$(rtld-installed-name)"'
+ 
+ cpp-srcs-left := $(all-rtld-routines:=.os)
+diff --git a/elf/dl-diagnostics.c b/elf/dl-diagnostics.c
+index bef224b3..8e166b12 100644
+--- a/elf/dl-diagnostics.c
++++ b/elf/dl-diagnostics.c
+@@ -205,7 +205,7 @@ print_paths (void)
+ {
+   _dl_diagnostics_print_labeled_string ("path.prefix", PREFIX);
+   _dl_diagnostics_print_labeled_string ("path.rtld", RTLD);
+-  _dl_diagnostics_print_labeled_string ("path.sysconfdir", SYSCONFDIR);
++  _dl_diagnostics_print_labeled_string ("path.sysconfdir", PREFIX "/etc");
+
+   unsigned int index = 0;
+   static const char *system_dirs = SYSTEM_DIRS "\0";
+diff --git a/elf/ldconfig.c b/elf/ldconfig.c
+index 28ed637a..6f07b79a 100644
+--- a/elf/ldconfig.c
++++ b/elf/ldconfig.c
+@@ -57,7 +57,7 @@
+ #define TLS_HWCAP_BIT 63
+ 
+ #ifndef LD_SO_CONF
+-# define LD_SO_CONF SYSCONFDIR "/ld.so.conf"
++# define LD_SO_CONF PREFIX "/etc/ld.so.conf"
+ #endif
+ 
+ /* Get libc version number.  */
+diff --git a/sysdeps/generic/dl-cache.h b/sysdeps/generic/dl-cache.h
+index 964d50a4..2224d651 100644
+--- a/sysdeps/generic/dl-cache.h
++++ b/sysdeps/generic/dl-cache.h
+@@ -35,7 +35,7 @@
+ #endif
+ 
+ #ifndef LD_SO_CACHE
+-# define LD_SO_CACHE SYSCONFDIR "/ld.so.cache"
++# define LD_SO_CACHE PREFIX "/etc/ld.so.cache"
+ #endif
+ 
+ #ifndef add_system_dir
diff --git a/nixpkgs/pkgs/development/libraries/glibc/dont-use-system-ld-so-preload.patch b/nixpkgs/pkgs/development/libraries/glibc/dont-use-system-ld-so-preload.patch
new file mode 100644
index 000000000000..894e2a11cf87
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/dont-use-system-ld-so-preload.patch
@@ -0,0 +1,12 @@
+diff -ru glibc-2.20-orig/elf/rtld.c glibc-2.20/elf/rtld.c
+--- glibc-2.20-orig/elf/rtld.c	2014-09-07 10:09:09.000000000 +0200
++++ glibc-2.20/elf/rtld.c	2014-10-27 11:32:25.203043157 +0100
+@@ -1513,7 +1513,7 @@
+      open().  So we do this first.  If it succeeds we do almost twice
+      the work but this does not matter, since it is not for production
+      use.  */
+-  static const char preload_file[] = "/etc/ld.so.preload";
++  static const char preload_file[] = "/etc/ld-nix.so.preload";
+   if (__glibc_unlikely (__access (preload_file, R_OK) == 0))
+     {
+       /* Read the contents of the file.  */
diff --git a/nixpkgs/pkgs/development/libraries/glibc/fix-rpc-types-musl-conflicts.patch b/nixpkgs/pkgs/development/libraries/glibc/fix-rpc-types-musl-conflicts.patch
new file mode 100644
index 000000000000..19f8bfc7cce8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/fix-rpc-types-musl-conflicts.patch
@@ -0,0 +1,38 @@
+@@ -, +, @@ 
+---
+ sunrpc/rpc/types.h | 22 ++++++----------------
+ 1 file changed, 6 insertions(+), 16 deletions(-)
+--- a/sunrpc/rpc/types.h	
++++ a/sunrpc/rpc/types.h	
+@@ -69,24 +69,14 @@ typedef unsigned long rpcport_t;
+ #include <sys/types.h>
+ #endif
+ 
+-#if defined __APPLE_CC__ || defined __FreeBSD__
+-# define __u_char_defined
+-# define __daddr_t_defined
+-#endif
+-
+-#ifndef __u_char_defined
+-typedef __u_char u_char;
+-typedef __u_short u_short;
+-typedef __u_int u_int;
+-typedef __u_long u_long;
+-typedef __quad_t quad_t;
+-typedef __u_quad_t u_quad_t;
+-typedef __fsid_t fsid_t;
++/* IMPORTANT NOTE: This has been modified to build against the musl C
++ * library and it probably now ONLY builds with the musl C library.
++ *
++ * See: https://sourceware.org/bugzilla/show_bug.cgi?id=21604
++ */
+ # define __u_char_defined
+-#endif
+ #ifndef __daddr_t_defined
+-typedef __daddr_t daddr_t;
+-typedef __caddr_t caddr_t;
++typedef int daddr_t;
+ # define __daddr_t_defined
+ #endif
+ 
+-- 
diff --git a/nixpkgs/pkgs/development/libraries/glibc/fix-x64-abi.patch b/nixpkgs/pkgs/development/libraries/glibc/fix-x64-abi.patch
new file mode 100644
index 000000000000..1d60dcd7988b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/fix-x64-abi.patch
@@ -0,0 +1,35 @@
+From 3288c6da64add3b4561b8c10fff522027caea01c Mon Sep 17 00:00:00 2001
+From: Nicholas Miell <nmiell@gmail.com>
+Date: Sat, 17 Jun 2017 18:21:07 -0700
+Subject: [PATCH] Align the stack on entry to __tls_get_addr()
+
+Old versions of gcc (4 & 5) didn't align the stack according to the
+AMD64 psABI when calling __tls_get_addr(). Apparently new versions of
+gcc (7) got much more aggressive about vectorizing and generating MOVAPS
+instructions, which means old binaries built with the buggy versions of
+gcc are much more likely to crash when using versions of glibc built
+using gcc 7.
+
+For example, a large number of Linux games built using the Unity game
+engine and available for purchase on Steam.
+---
+ elf/dl-tls.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/elf/dl-tls.c b/elf/dl-tls.c
+index 5aba33b3fa..3f3cb917de 100644
+--- a/elf/dl-tls.c
++++ b/elf/dl-tls.c
+@@ -827,6 +827,10 @@ rtld_hidden_proto (__tls_get_addr)
+ rtld_hidden_def (__tls_get_addr)
+ #endif
+
++#ifdef __x86_64__
++/* Old versions of gcc didn't align the stack. */
++__attribute__((force_align_arg_pointer))
++#endif
+ /* The generic dynamic and local dynamic model cannot be used in
+    statically linked applications.  */
+ void *
+--
+2.13.0
diff --git a/nixpkgs/pkgs/development/libraries/glibc/fix_path_attribute_in_getconf.patch b/nixpkgs/pkgs/development/libraries/glibc/fix_path_attribute_in_getconf.patch
new file mode 100644
index 000000000000..714e49db5607
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/fix_path_attribute_in_getconf.patch
@@ -0,0 +1,6 @@
+diff -ubr glibc-2.17-orig/sysdeps/unix/confstr.h glibc-2.17/sysdeps/unix/confstr.h
+--- glibc-2.17-orig/sysdeps/unix/confstr.h	2013-06-03 22:01:44.829726968 +0200
++++ glibc-2.17/sysdeps/unix/confstr.h	2013-06-03 22:04:39.469376740 +0200
+@@ -1 +1 @@
+-#define	CS_PATH	"/bin:/usr/bin"
++#define	CS_PATH	"/run/current-system/sw/bin:/bin:/usr/bin"
diff --git a/nixpkgs/pkgs/development/libraries/glibc/info.nix b/nixpkgs/pkgs/development/libraries/glibc/info.nix
new file mode 100644
index 000000000000..7c4f3f63bf1c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/info.nix
@@ -0,0 +1,23 @@
+{ callPackage, texinfo, perl }:
+
+callPackage ./common.nix {} {
+  pname = "glibc-info";
+
+  outputs = [ "out" ];
+
+  configureFlags = [ "--enable-add-ons" ];
+
+  buildInputs = [ texinfo perl ];
+
+  buildPhase = "make info";
+
+  # I don't know why the info is not generated in 'build'
+  # Somehow building the info still does not work, because the final
+  # libc.info hasn't a Top node.
+  installPhase = ''
+    mkdir -p "$out/share/info"
+    cp -v "manual/"*.info* "$out/share/info"
+  '';
+
+  meta.description = "GNU Info manual of the GNU C Library";
+}
diff --git a/nixpkgs/pkgs/development/libraries/glibc/locales-builder.sh b/nixpkgs/pkgs/development/libraries/glibc/locales-builder.sh
new file mode 100644
index 000000000000..d732e208fa22
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/locales-builder.sh
@@ -0,0 +1,17 @@
+# Glibc cannot have itself in its RPATH.
+export NIX_NO_SELF_RPATH=1
+
+source $stdenv/setup
+
+postConfigure() {
+    # Hack: get rid of the `-static' flag set by the bootstrap stdenv.
+    # This has to be done *after* `configure' because it builds some
+    # test binaries.
+    export NIX_CFLAGS_LINK=
+    export NIX_LDFLAGS_BEFORE=
+
+    export NIX_DONT_SET_RPATH=1
+    unset CFLAGS
+}
+
+genericBuild
diff --git a/nixpkgs/pkgs/development/libraries/glibc/locales.nix b/nixpkgs/pkgs/development/libraries/glibc/locales.nix
new file mode 100644
index 000000000000..325e0d09936b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/locales.nix
@@ -0,0 +1,68 @@
+/* This function builds just the `lib/locale/locale-archive' file from
+   Glibc and nothing else.  If `allLocales' is true, all supported
+   locales are included; otherwise, just the locales listed in
+   `locales'.  See localedata/SUPPORTED in the Glibc source tree for
+   the list of all supported locales:
+   https://sourceware.org/git/?p=glibc.git;a=blob;f=localedata/SUPPORTED
+*/
+
+{ lib, stdenv, buildPackages, callPackage, writeText
+, allLocales ? true, locales ? [ "en_US.UTF-8/UTF-8" ]
+}:
+
+callPackage ./common.nix { inherit stdenv; } {
+  pname = "glibc-locales";
+
+  builder = ./locales-builder.sh;
+
+  outputs = [ "out" ];
+
+  # Awful hack: `localedef' doesn't allow the path to `locale-archive'
+  # to be overriden, but you *can* specify a prefix, i.e. it will use
+  # <prefix>/<path-to-glibc>/lib/locale/locale-archive.  So we use
+  # $TMPDIR as a prefix, meaning that the locale-archive is placed in
+  # $TMPDIR/nix/store/...-glibc-.../lib/locale/locale-archive.
+  buildPhase =
+    ''
+      mkdir -p $TMPDIR/"${buildPackages.stdenv.cc.libc.out}/lib/locale"
+
+      echo 'C.UTF-8/UTF-8 \' >> ../glibc-2*/localedata/SUPPORTED
+
+      # Hack to allow building of the locales (needed since glibc-2.12)
+      sed -i -e 's,^$(rtld-prefix) $(common-objpfx)locale/localedef,localedef --prefix='$TMPDIR',' ../glibc-2*/localedata/Makefile
+    ''
+      + lib.optionalString (!allLocales) ''
+      # Check that all locales to be built are supported
+      echo -n '${lib.concatMapStrings (s: s + " \\\n") locales}' \
+        | sort > locales-to-build.txt
+      cat ../glibc-2*/localedata/SUPPORTED | grep ' \\' \
+        | sort > locales-supported.txt
+      comm -13 locales-supported.txt locales-to-build.txt \
+        > locales-unsupported.txt
+      if [[ $(wc -c locales-unsupported.txt) != "0 locales-unsupported.txt" ]]; then
+        cat locales-supported.txt
+        echo "Error: unsupported locales detected:"
+        cat locales-unsupported.txt
+        echo "You should choose from the list above the error."
+        false
+      fi
+
+      echo SUPPORTED-LOCALES='${toString locales}' > ../glibc-2*/localedata/SUPPORTED
+    '' + ''
+      make localedata/install-locales \
+          localedir=$out/lib/locale \
+    '';
+
+  installPhase =
+    ''
+      mkdir -p "$out/lib/locale"
+      cp -v "$TMPDIR/$NIX_STORE/"*"/lib/locale/locale-archive" "$out/lib/locale"
+    '';
+
+  setupHook = writeText "locales-setup-hook.sh"
+    ''
+      export LOCALE_ARCHIVE=@out@/lib/locale/locale-archive
+    '';
+
+  meta.description = "Locale information for the GNU C Library";
+}
diff --git a/nixpkgs/pkgs/development/libraries/glibc/multi.nix b/nixpkgs/pkgs/development/libraries/glibc/multi.nix
new file mode 100644
index 000000000000..5d3626b95cc0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/multi.nix
@@ -0,0 +1,28 @@
+{ runCommand, glibc, glibc32
+}:
+
+let
+  nameVersion = builtins.parseDrvName glibc.name;
+  glibc64 = glibc;
+in
+runCommand "${nameVersion.name}-multi-${nameVersion.version}"
+  { outputs = [ "bin" "dev" "out"]; } # TODO: no static version here (yet)
+  ''
+    mkdir -p "$out/lib"
+    ln -s '${glibc64.out}'/lib/* "$out/lib"
+    ln -s '${glibc32.out}/lib' "$out/lib/32"
+    ln -s lib "$out/lib64"
+
+    # fixing ldd RLTDLIST
+    mkdir -p "$bin/bin"
+    cp -s '${glibc64.bin}'/bin/* "$bin/bin/"
+    rm "$bin/bin/ldd"
+    sed -e "s|^RTLDLIST=.*$|RTLDLIST=\"$out/lib/ld-linux-x86-64.so.2 $out/lib/32/ld-linux.so.2\"|g" \
+        '${glibc64.bin}/bin/ldd' > "$bin/bin/ldd"
+    chmod +x "$bin/bin/ldd"
+
+    mkdir "$dev"
+    cp -rs '${glibc32.dev}'/include "$dev/"
+    chmod +w -R "$dev"
+    cp -rsf '${glibc64.dev}'/include "$dev/"
+  ''
diff --git a/nixpkgs/pkgs/development/libraries/glibc/nix-locale-archive.patch b/nixpkgs/pkgs/development/libraries/glibc/nix-locale-archive.patch
new file mode 100644
index 000000000000..39312951fcf9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/nix-locale-archive.patch
@@ -0,0 +1,118 @@
+diff -Naur glibc-2.27-orig/locale/loadarchive.c glibc-2.27/locale/loadarchive.c
+--- glibc-2.27-orig/locale/loadarchive.c	2018-02-01 11:17:18.000000000 -0500
++++ glibc-2.27/locale/loadarchive.c	2018-02-17 22:32:25.680169462 -0500
+@@ -123,6 +123,23 @@
+   return MAX (namehash_end, MAX (string_end, locrectab_end));
+ }
+ 
++static int
++open_locale_archive (void)
++{
++  int fd = -1;
++  char *versioned_path = getenv ("LOCALE_ARCHIVE_2_27");
++  char *path = getenv ("LOCALE_ARCHIVE");
++  if (versioned_path)
++    fd = __open_nocancel (versioned_path, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
++  if (path && fd < 0)
++    fd = __open_nocancel (path, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
++  if (fd < 0)
++    fd = __open_nocancel (archfname, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
++  if (fd < 0)
++    fd = __open_nocancel ("/usr/lib/locale/locale-archive", O_RDONLY|O_LARGEFILE|O_CLOEXEC);
++  return fd;
++}
++
+ 
+ /* Find the locale *NAMEP in the locale archive, and return the
+    internalized data structure for its CATEGORY data.  If this locale has
+@@ -202,7 +219,7 @@
+       archmapped = &headmap;
+ 
+       /* The archive has never been opened.  */
+-      fd = __open_nocancel (archfname, O_RDONLY|O_LARGEFILE|O_CLOEXEC);
++      fd = open_locale_archive ();
+       if (fd < 0)
+ 	/* Cannot open the archive, for whatever reason.  */
+ 	return NULL;
+@@ -397,8 +414,7 @@
+ 	  if (fd == -1)
+ 	    {
+ 	      struct stat64 st;
+-	      fd = __open_nocancel (archfname,
+-				    O_RDONLY|O_LARGEFILE|O_CLOEXEC);
++	      fd = open_locale_archive ();
+ 	      if (fd == -1)
+ 		/* Cannot open the archive, for whatever reason.  */
+ 		return NULL;
+diff -Naur glibc-2.27-orig/locale/programs/locale.c glibc-2.27/locale/programs/locale.c
+--- glibc-2.27-orig/locale/programs/locale.c	2018-02-01 11:17:18.000000000 -0500
++++ glibc-2.27/locale/programs/locale.c	2018-02-17 22:36:39.726293213 -0500
+@@ -633,6 +633,24 @@
+ 
+ 
+ static int
++open_locale_archive (void)
++{
++  int fd = -1;
++  char *versioned_path = getenv ("LOCALE_ARCHIVE_2_27");
++  char *path = getenv ("LOCALE_ARCHIVE");
++  if (versioned_path)
++    fd = open64 (versioned_path, O_RDONLY);
++  if (path && fd < 0)
++    fd = open64 (path, O_RDONLY);
++  if (fd < 0)
++    fd = open64 (ARCHIVE_NAME, O_RDONLY);
++  if (fd < 0)
++    fd = open64 ("/usr/lib/locale/locale-archive", O_RDONLY);
++  return fd;
++}
++
++
++static int
+ write_archive_locales (void **all_datap, char *linebuf)
+ {
+   struct stat64 st;
+@@ -644,7 +662,7 @@
+   int fd, ret = 0;
+   uint32_t cnt;
+ 
+-  fd = open64 (ARCHIVE_NAME, O_RDONLY);
++  fd = open_locale_archive ();
+   if (fd < 0)
+     return 0;
+ 
+diff -Naur glibc-2.27-orig/locale/programs/locarchive.c glibc-2.27/locale/programs/locarchive.c
+--- glibc-2.27-orig/locale/programs/locarchive.c	2018-02-01 11:17:18.000000000 -0500
++++ glibc-2.27/locale/programs/locarchive.c	2018-02-17 22:40:51.245293975 -0500
+@@ -117,6 +117,22 @@
+ }
+ 
+ 
++static int
++open_locale_archive (const char * archivefname, int flags)
++{
++  int fd = -1;
++  char *versioned_path = getenv ("LOCALE_ARCHIVE_2_27");
++  char *path = getenv ("LOCALE_ARCHIVE");
++  if (versioned_path)
++    fd = open64 (versioned_path, flags);
++  if (path && fd < 0)
++    fd = open64 (path, flags);
++  if (fd < 0)
++    fd = open64 (archivefname, flags);
++  return fd;
++}
++
++
+ static void
+ create_archive (const char *archivefname, struct locarhandle *ah)
+ {
+@@ -578,7 +594,7 @@
+   while (1)
+     {
+       /* Open the archive.  We must have exclusive write access.  */
+-      fd = open64 (archivefname, readonly ? O_RDONLY : O_RDWR);
++      fd = open_locale_archive (archivefname, readonly ? O_RDONLY : O_RDWR);
+       if (fd == -1)
+ 	{
+ 	  /* Maybe the file does not yet exist? If we are opening
diff --git a/nixpkgs/pkgs/development/libraries/glibc/rpcgen-path.patch b/nixpkgs/pkgs/development/libraries/glibc/rpcgen-path.patch
new file mode 100644
index 000000000000..3349449d9163
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibc/rpcgen-path.patch
@@ -0,0 +1,54 @@
+diff -ru glibc-2.18-orig/sunrpc/rpc_main.c glibc-2.18/sunrpc/rpc_main.c
+--- glibc-2.18-orig/sunrpc/rpc_main.c	2013-08-11 00:52:55.000000000 +0200
++++ glibc-2.18/sunrpc/rpc_main.c	2013-11-15 12:04:48.041006977 +0100
+@@ -78,7 +78,7 @@
+ 
+ static const char *svcclosetime = "120";
+ static int cppDefined;	/* explicit path for C preprocessor */
+-static const char *CPP = "/lib/cpp";
++static const char *CPP = "cpp";
+ static const char CPPFLAGS[] = "-C";
+ static char *pathbuf;
+ static int cpp_pid;
+@@ -107,7 +107,6 @@
+ static void open_output (const char *infile, const char *outfile);
+ static void add_warning (void);
+ static void clear_args (void);
+-static void find_cpp (void);
+ static void open_input (const char *infile, const char *define);
+ static int check_nettype (const char *name, const char *list_to_check[]);
+ static void c_output (const char *infile, const char *define,
+@@ -322,25 +321,6 @@
+   argcount = FIXEDARGS;
+ }
+ 
+-/* make sure that a CPP exists */
+-static void
+-find_cpp (void)
+-{
+-  struct stat64 buf;
+-
+-  if (stat64 (CPP, &buf) == 0)
+-    return;
+-
+-  if (cppDefined) /* user specified cpp but it does not exist */
+-    {
+-      fprintf (stderr, _ ("cannot find C preprocessor: %s\n"), CPP);
+-      crash ();
+-    }
+-
+-  /* fall back to system CPP */
+-  CPP = "cpp";
+-}
+-
+ /*
+  * Open input file with given define for C-preprocessor
+  */
+@@ -359,7 +339,6 @@
+   switch (cpp_pid)
+     {
+     case 0:
+-      find_cpp ();
+       putarg (0, CPP);
+       putarg (1, CPPFLAGS);
+       addarg (define);
diff --git a/nixpkgs/pkgs/development/libraries/glibmm/2.68.nix b/nixpkgs/pkgs/development/libraries/glibmm/2.68.nix
new file mode 100644
index 000000000000..db713cf9ea5f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibmm/2.68.nix
@@ -0,0 +1,59 @@
+{ lib
+, stdenv
+, fetchurl
+, pkg-config
+, gnum4
+, glib
+, libsigcxx30
+, gnome
+, Cocoa
+, meson
+, ninja
+}:
+
+stdenv.mkDerivation rec {
+  pname = "glibmm";
+  version = "2.68.1";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-ZmTifJqcyoHCnjVof0ny4NFzovyemMNCgxH3B9tTL4w=";
+  };
+
+  nativeBuildInputs = [
+    meson
+    pkg-config
+    ninja
+    gnum4
+    glib # for glib-compile-schemas
+  ];
+
+  buildInputs = lib.optionals stdenv.isDarwin [
+    Cocoa
+  ];
+
+  propagatedBuildInputs = [
+    glib
+    libsigcxx30
+  ];
+
+  doCheck = false; # fails. one test needs the net, another /etc/fstab
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      attrPath = "glibmm_2_68";
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "C++ interface to the GLib library";
+    homepage = "https://gtkmm.org/";
+    license = licenses.lgpl2Plus;
+    maintainers = teams.gnome.members ++ (with maintainers; [ raskin ]);
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/glibmm/default.nix b/nixpkgs/pkgs/development/libraries/glibmm/default.nix
new file mode 100644
index 000000000000..344fcb43eba0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glibmm/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchurl, pkg-config, gnum4, glib, libsigcxx, gnome, darwin, meson, ninja }:
+
+stdenv.mkDerivation rec {
+  pname = "glibmm";
+  version = "2.64.5";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-UI/IbiyRQRmKoWwiWxb9a5EZF8DTgXYCZShE0Jc+o4Y=";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [
+    meson
+    pkg-config
+    ninja
+    gnum4
+    glib # for glib-compile-schemas
+  ];
+
+  buildInputs = lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+    Cocoa
+  ]);
+  propagatedBuildInputs = [ glib libsigcxx ];
+
+  doCheck = false; # fails. one test needs the net, another /etc/fstab
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "C++ interface to the GLib library";
+
+    homepage = "https://gtkmm.org/";
+
+    license = licenses.lgpl2Plus;
+
+    maintainers = with maintainers; [raskin];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/glm/default.nix b/nixpkgs/pkgs/development/libraries/glm/default.nix
new file mode 100644
index 000000000000..f5652a61c1de
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glm/default.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, fetchurl, fetchzip, cmake }:
+
+stdenv.mkDerivation rec {
+  version = "0.9.8.5";
+  pname = "glm";
+
+  src = fetchzip {
+    url = "https://github.com/g-truc/glm/releases/download/${version}/${pname}-${version}.zip";
+    sha256 = "0dkfj4hin3am9fxgcvwr5gj0h9y52x7wa03lfwb3q0bvaj1rsly2";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  outputs = [ "out" "doc" ];
+
+  cmakeConfigureFlags = [ "-DGLM_INSTALL_ENABLE=off" ];
+
+  # fetch newer version of platform.h which correctly supports gcc 7.3
+  gcc7PlatformPatch = fetchurl {
+    url = "https://raw.githubusercontent.com/g-truc/glm/384dab02e45a8ad3c1a3fa0906e0d5682c5b27b9/glm/simd/platform.h";
+    sha256 = "0ym0sgwznxhfyi014xs55x3ql7r65fjs34sqb5jiaffkdhkqgzia";
+  };
+
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace '"''${CMAKE_CURRENT_BINARY_DIR}/''${GLM_INSTALL_CONFIGDIR}' '"''${GLM_INSTALL_CONFIGDIR}'
+    cp ${gcc7PlatformPatch} glm/simd/platform.h
+  '';
+
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-DGLM_COMPILER=0";
+
+  postInstall = ''
+    mkdir -p $doc/share/doc/glm
+    cp -rv $NIX_BUILD_TOP/$sourceRoot/doc/* $doc/share/doc/glm
+  '';
+
+  meta = with lib; {
+    description = "OpenGL Mathematics library for C++";
+    longDescription = ''
+      OpenGL Mathematics (GLM) is a header only C++ mathematics library for
+      graphics software based on the OpenGL Shading Language (GLSL)
+      specification and released under the MIT license.
+    '';
+    homepage = "http://glm.g-truc.net/";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with lib.maintainers; [ ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/globalarrays/default.nix b/nixpkgs/pkgs/development/libraries/globalarrays/default.nix
new file mode 100644
index 000000000000..8b01f9f68146
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/globalarrays/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchpatch, fetchFromGitHub, autoreconfHook
+, blas, gfortran, openssh, mpi
+} :
+
+stdenv.mkDerivation rec {
+  pname = "globalarrays";
+  version = "5.8";
+
+  src = fetchFromGitHub {
+    owner = "GlobalArrays";
+    repo = "ga";
+    rev = "v${version}";
+    sha256 = "0bky91ncz6vy0011ps9prsnq9f4a5s5xwr23kkmi39xzg0417mnd";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ mpi blas gfortran openssh ];
+
+  preConfigure = ''
+    configureFlagsArray+=( "--enable-i8" \
+                           "--with-mpi" \
+                           "--with-mpi3" \
+                           "--enable-eispack" \
+                           "--enable-underscoring" \
+                           "--with-blas8=${blas}/lib -lblas" )
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Global Arrays Programming Models";
+    homepage = "http://hpc.pnl.gov/globalarrays/";
+    maintainers = [ maintainers.markuskowa ];
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/globalplatform/default.nix b/nixpkgs/pkgs/development/libraries/globalplatform/default.nix
new file mode 100644
index 000000000000..a8dfa430f599
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/globalplatform/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, pkg-config, zlib, openssl_1_0_2, pcsclite }:
+
+stdenv.mkDerivation rec {
+  pname = "globalplatform";
+  version  = "6.0.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/globalplatform/${pname}-${version}.tar.gz";
+    sha256 = "191s9005xbc7i90bzjk4rlw15licd6m0rls9fxli8jyymz2021zy";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ zlib openssl_1_0_2 pcsclite ];
+
+  meta = with lib; {
+    homepage = "https://sourceforge.net/p/globalplatform/wiki/Home/";
+    description = "Library for interacting with smart card devices";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/globalplatform/gppcscconnectionplugin.nix b/nixpkgs/pkgs/development/libraries/globalplatform/gppcscconnectionplugin.nix
new file mode 100644
index 000000000000..a3ea4305bea7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/globalplatform/gppcscconnectionplugin.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, pkg-config, globalplatform, openssl_1_0_2, pcsclite }:
+
+stdenv.mkDerivation rec {
+  pname = "gppcscconnectionplugin";
+  version  = "1.1.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/globalplatform/${pname}-${version}.tar.gz";
+    sha256 = "0d3vcrh9z55rbal0dchmj661pqqrav9c400bx1c46grcl1q022ad";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ globalplatform openssl_1_0_2 pcsclite ];
+
+  meta = with lib; {
+    homepage = "https://sourceforge.net/p/globalplatform/wiki/Home/";
+    description = "GlobalPlatform pcsc connection plugin";
+    license = [ licenses.lgpl3 licenses.gpl3 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/glog/default.nix b/nixpkgs/pkgs/development/libraries/glog/default.nix
new file mode 100644
index 000000000000..4bb20ebfd93e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glog/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, lib, fetchFromGitHub, fetchpatch, cmake, gflags, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "glog";
+  version = "0.4.0";
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "glog";
+    rev = "v${version}";
+    sha256 = "1xd3maiipfbxmhc9rrblc5x52nxvkwxp14npg31y5njqvkvzax9b";
+  };
+
+  patches = lib.optionals stdenv.hostPlatform.isMusl [
+    # TODO: Remove at next release that includes this commit.
+    (fetchpatch {
+      name = "glog-Fix-symbolize_unittest-for-musl-builds.patch";
+      url = "https://github.com/google/glog/commit/834dd780bf1fe0704b8ed0350ca355a55f711a9f.patch";
+      sha256 = "0k4lanxg85anyvjsj3mh93bcgds8gizpiamcy2zvs3yyfjl40awn";
+    })
+  ];
+
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    # A path clash on case-insensitive file systems blocks creation of the build directory.
+    # The file in question is specific to bazel and does not influence the build result.
+    rm BUILD
+  '';
+
+  nativeBuildInputs = [ cmake ];
+
+  propagatedBuildInputs = [ gflags ];
+
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
+
+  checkInputs = [ perl ];
+  doCheck = false; # fails with "Mangled symbols (28 out of 380) found in demangle.dm"
+
+  meta = with lib; {
+    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
new file mode 100644
index 000000000000..82429add2619
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gloox/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl
+, zlibSupport ? true, zlib ? null
+, sslSupport ? true, openssl ? null
+, idnSupport ? true, libidn ? null
+}:
+
+assert zlibSupport -> zlib != null;
+assert sslSupport -> openssl != null;
+assert idnSupport -> libidn != null;
+
+with lib;
+
+stdenv.mkDerivation rec{
+  pname = "gloox";
+  version = "1.0.24";
+
+  src = fetchurl {
+    url = "https://camaya.net/download/gloox-${version}.tar.bz2";
+    sha256 = "1jgrd07qr9jvbb5hcmhrqz4w4lvwc51m30jls1fgxf1f5az6455f";
+  };
+
+  buildInputs = [ ]
+    ++ optional zlibSupport zlib
+    ++ optional sslSupport openssl
+    ++ optional idnSupport libidn;
+
+  meta = {
+    description = "A portable high-level Jabber/XMPP library for C++";
+    homepage = "http://camaya.net/gloox";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/glpk/default.nix b/nixpkgs/pkgs/development/libraries/glpk/default.nix
new file mode 100644
index 000000000000..a46c84844e89
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glpk/default.nix
@@ -0,0 +1,78 @@
+{ lib, stdenv
+, fetchurl
+, fetchpatch
+, libmysqlclient
+# Excerpt from glpk's INSTALL file:
+# This feature allows the exact simplex solver to use the GNU MP
+# bignum library. If it is disabled, the exact simplex solver uses the
+# GLPK bignum module, which provides the same functionality as GNU MP,
+# however, it is much less efficient.
+, withGmp ? true
+, gmp
+}:
+
+assert withGmp -> gmp != null;
+
+stdenv.mkDerivation rec {
+  version = "4.65";
+  pname = "glpk";
+
+  src = fetchurl {
+    url = "mirror://gnu/glpk/${pname}-${version}.tar.gz";
+    sha256 = "040sfaa9jclg2nqdh83w71sv9rc1sznpnfiripjdyr48cady50a2";
+  };
+
+  buildInputs =
+    [ libmysqlclient
+    ] ++ lib.optionals withGmp [
+      gmp
+    ];
+
+  configureFlags = lib.optionals withGmp [
+    "--with-gmp"
+  ];
+
+  patches = [
+    # GLPK makes it possible to customize its message printing behaviour. Sage
+    # does that and needs to differentiate between printing regular messages and
+    # printing errors. Unfortunately there is no way to tell and glpk upstream
+    # rejected this patch. All it does is set the variable pointing to the error
+    # file back to NULL before glpk calls abort(). In sage's case, abort won't
+    # actually be called because the error handler jumps out of the function.
+    # This shouldn't affect everybody else, since glpk just calls abort()
+    # immediately afterwards anyways.
+    # See the sage trac ticket for more details:
+    # https://trac.sagemath.org/ticket/20710#comment:18
+    (fetchpatch {
+      name = "error_recovery.patch";
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/glpk/patches/error_recovery.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "0z99z9gd31apb6x5n5n26411qzx0ma3s6dnznc4x61x86bhq31qf";
+    })
+  ];
+
+  postPatch =
+    # Do not hardcode the include path for libmysqlclient.
+    ''
+      substituteInPlace configure \
+        --replace '-I/usr/include/mysql' '$(mysql_config --include)'
+    '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "The GNU Linear Programming Kit";
+
+    longDescription =
+      '' The GNU Linear Programming Kit is intended for solving large
+         scale linear programming problems by means of the revised
+         simplex method.  It is a set of routines written in the ANSI C
+         programming language and organized in the form of a library.
+      '';
+
+    homepage = "https://www.gnu.org/software/glpk/";
+    license = licenses.gpl3Plus;
+
+    maintainers = with maintainers; [ bjg ] ++ teams.sage.members;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/glpng/default.nix b/nixpkgs/pkgs/development/libraries/glpng/default.nix
new file mode 100644
index 000000000000..1194d988c073
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glpng/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, stdenv
+, fetchFromRepoOrCz
+, cmake
+, libGL
+, libpng
+, pkg-config
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "glpng";
+  version = "1.46";
+
+  src = fetchFromRepoOrCz {
+    repo = "glpng";
+    rev = "v${version}";
+    hash = "sha256-C7EHaBN0PE/HJB6zcIaYU63+o7/MEz4WU1xr/kIOanM=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+  buildInputs = [
+    libGL
+    libpng
+    zlib
+  ];
+
+  meta = with lib; {
+    homepage = "https://repo.or.cz/glpng.git/blob_plain/HEAD:/glpng.htm";
+    description = "PNG loader for OpenGL";
+    license = licenses.mit;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/glui/default.nix b/nixpkgs/pkgs/development/libraries/glui/default.nix
new file mode 100644
index 000000000000..511ec60db2fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/glui/default.nix
@@ -0,0 +1,40 @@
+{ lib, 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"
+    cp -rT lib "$out/lib"
+    cp -rT include "$out/include"
+    cp -rT doc "$out/share/glui/doc"
+    cp LICENSE.txt "$out/share/glui/doc"
+  '';
+
+  meta = with lib; {
+    description = "A user interface library using OpenGL";
+    license = licenses.zlib ;
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gmime/2.nix b/nixpkgs/pkgs/development/libraries/gmime/2.nix
new file mode 100644
index 000000000000..0e10d12ed1f1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gmime/2.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, pkg-config, glib, zlib, gnupg, libgpgerror, gobject-introspection }:
+
+stdenv.mkDerivation rec {
+  version = "2.6.23";
+  pname = "gmime";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gmime/2.6/${pname}-${version}.tar.xz";
+    sha256 = "0slzlzcr3h8jikpz5a5amqd0csqh2m40gdk910ws2hnaf5m6hjbi";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ pkg-config gobject-introspection ];
+  propagatedBuildInputs = [ glib zlib libgpgerror ];
+  configureFlags = [ "--enable-introspection=yes" ];
+
+  postPatch = ''
+    substituteInPlace tests/testsuite.c \
+      --replace /bin/rm rm \
+      --replace /bin/mkdir mkdir
+
+    substituteInPlace tests/test-pkcs7.c \
+      --replace /bin/mkdir mkdir
+  '';
+
+  checkInputs = [ gnupg ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/jstedfast/gmime/";
+    description = "A C/C++ library for creating, editing and parsing MIME messages and structures";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gmime/3.nix b/nixpkgs/pkgs/development/libraries/gmime/3.nix
new file mode 100644
index 000000000000..a8e39047256c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gmime/3.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, pkg-config, glib, zlib, gnupg, gpgme, libidn2, libunistring, gobject-introspection
+, vala }:
+
+stdenv.mkDerivation rec {
+  version = "3.2.7";
+  pname = "gmime";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gmime/3.2/${pname}-${version}.tar.xz";
+    sha256 = "0i3xfc84qn1z99i70q68kbnp9rmgqrnprqb418ba52s6g9j9dsia";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  buildInputs = [ vala gobject-introspection zlib gpgme libidn2 libunistring ];
+  nativeBuildInputs = [ pkg-config ];
+  propagatedBuildInputs = [ glib ];
+  configureFlags = [
+    "--enable-introspection=yes"
+    "--enable-vala=yes"
+  ];
+
+  postPatch = ''
+    substituteInPlace tests/testsuite.c \
+      --replace /bin/rm rm
+  '';
+
+  checkInputs = [ gnupg ];
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/jstedfast/gmime/";
+    description = "A C/C++ library for creating, editing and parsing MIME messages and structures";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gmm/default.nix b/nixpkgs/pkgs/development/libraries/gmm/default.nix
new file mode 100644
index 000000000000..3c145b3c1e38
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gmm/default.nix
@@ -0,0 +1,18 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "gmm";
+  version = "5.4";
+
+  src = fetchurl {
+    url = "mirror://savannah/getfem/stable/${pname}-${version}.tar.gz";
+    sha256 = "0mhygfpsdyr0d4h3sn6g7nxn149yrlqv7r2h34yqkrpv1q4daqvi";
+  };
+
+  meta = with lib; {
+    description = "Generic C++ template library for sparse, dense and skyline matrices";
+    homepage = "http://getfem.org/gmm.html";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gmp/4.3.2.nix b/nixpkgs/pkgs/development/libraries/gmp/4.3.2.nix
new file mode 100644
index 000000000000..ce870581f5e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gmp/4.3.2.nix
@@ -0,0 +1,75 @@
+{ lib, stdenv, fetchurl, m4, cxx ? true }:
+
+let self = stdenv.mkDerivation rec {
+  name = "gmp-4.3.2";
+
+  src = fetchurl {
+    url = "mirror://gnu/gmp/${name}.tar.bz2";
+    sha256 = "0x8prpqi9amfcmi7r4zrza609ai9529pjaq0h4aw51i867064qck";
+  };
+
+  #outputs TODO: split $cxx due to libstdc++ dependency
+  # maybe let ghc use a version with *.so shared with rest of nixpkgs and *.a added
+  # - see #5855 for related discussion
+  outputs = [ "out" "dev" "info" ];
+  passthru.static = self.out;
+
+  nativeBuildInputs = [ m4 ];
+
+  # Prevent the build system from using sub-architecture-specific
+  # instructions (e.g., SSE2 on i686).
+  #
+  # This is not a problem for Apple machines, which are all alike.  In
+  # addition, `configfsf.guess' would return `i386-apple-darwin10.2.0' on
+  # `x86_64-darwin', leading to a 32-bit ABI build, which is undesirable.
+  preConfigure =
+    if !stdenv.isDarwin
+    then "ln -sf configfsf.guess config.guess"
+    else ''echo "Darwin host is `./config.guess`."'';
+
+  configureFlags = [
+    (lib.enableFeature cxx "cxx")
+  ] ++ lib.optionals stdenv.isDarwin [
+    "ac_cv_build=x86_64-apple-darwin13.4.0"
+    "ac_cv_host=x86_64-apple-darwin13.4.0"
+  ];
+
+  # The test t-lucnum_ui fails (on Linux/x86_64) when built with GCC 4.8.
+  # Newer versions of GMP don't have that issue anymore.
+  doCheck = false;
+
+  meta = {
+    branch = "4";
+    description = "GNU multiple precision arithmetic library";
+
+    longDescription =
+      '' GMP is a free library for arbitrary precision arithmetic, operating
+         on signed integers, rational numbers, and floating point numbers.
+         There is no practical limit to the precision except the ones implied
+         by the available memory in the machine GMP runs on.  GMP has a rich
+         set of functions, and the functions have a regular interface.
+
+         The main target applications for GMP are cryptography applications
+         and research, Internet security applications, algebra systems,
+         computational algebra research, etc.
+
+         GMP is carefully designed to be as fast as possible, both for small
+         operands and for huge operands.  The speed is achieved by using
+         fullwords as the basic arithmetic type, by using fast algorithms,
+         with highly optimised assembly code for the most common inner loops
+         for a lot of CPUs, and by a general emphasis on speed.
+
+         GMP is faster than any other bignum library.  The advantage for GMP
+         increases with the operand sizes for many operations, since GMP uses
+         asymptotically faster algorithms.
+      '';
+
+    homepage = "https://gmplib.org/";
+    license = lib.licenses.lgpl3Plus;
+
+    maintainers = [ ];
+    platforms = lib.platforms.all;
+    badPlatforms = [ "x86_64-darwin" ];
+  };
+};
+  in self
diff --git a/nixpkgs/pkgs/development/libraries/gmp/5.1.x.nix b/nixpkgs/pkgs/development/libraries/gmp/5.1.x.nix
new file mode 100644
index 000000000000..73061a3d2efd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gmp/5.1.x.nix
@@ -0,0 +1,81 @@
+{ lib, stdenv, fetchurl, m4
+, cxx ? true
+, withStatic ? stdenv.hostPlatform.isStatic
+}:
+
+let inherit (lib) optional; in
+
+let self = stdenv.mkDerivation rec {
+  name = "gmp-5.1.3";
+
+  src = fetchurl { # we need to use bz2, others aren't in bootstrapping stdenv
+    urls = [ "mirror://gnu/gmp/${name}.tar.bz2" "ftp://ftp.gmplib.org/pub/${name}/${name}.tar.bz2" ];
+    sha256 = "0q5i39pxrasgn9qdxzpfbwhh11ph80p57x6hf48m74261d97j83m";
+  };
+
+  #outputs TODO: split $cxx due to libstdc++ dependency
+  # maybe let ghc use a version with *.so shared with rest of nixpkgs and *.a added
+  # - see #5855 for related discussion
+  outputs = [ "out" "dev" "info" ];
+  passthru.static = self.out;
+
+  nativeBuildInputs = [ m4 ];
+
+  patches = if stdenv.isDarwin then [ ./need-size-t.patch ] else null;
+
+  configureFlags = [
+    "--with-pic"
+    (lib.enableFeature cxx "cxx")
+    # Build a "fat binary", with routines for several sub-architectures
+    # (x86), except on Solaris where some tests crash with "Memory fault".
+    # See <https://hydra.nixos.org/build/2760931>, for instance.
+    #
+    # no darwin because gmp uses ASM that clang doesn't like
+    (lib.enableFeature (!stdenv.isSunOS && stdenv.hostPlatform.isx86) "fat")
+    # The config.guess in GMP tries to runtime-detect various
+    # ARM optimization flags via /proc/cpuinfo (and is also
+    # broken on multicore CPUs). Avoid this impurity.
+    "--build=${stdenv.buildPlatform.config}"
+  ] ++ optional (cxx && stdenv.isDarwin) "CPPFLAGS=-fexceptions"
+    ++ optional (stdenv.isDarwin && stdenv.is64bit) "ABI=64"
+    ;
+
+  doCheck = true;
+
+  dontDisableStatic = withStatic;
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://gmplib.org/";
+    description = "GNU multiple precision arithmetic library";
+    license = licenses.gpl3Plus;
+
+    longDescription =
+      '' GMP is a free library for arbitrary precision arithmetic, operating
+         on signed integers, rational numbers, and floating point numbers.
+         There is no practical limit to the precision except the ones implied
+         by the available memory in the machine GMP runs on.  GMP has a rich
+         set of functions, and the functions have a regular interface.
+
+         The main target applications for GMP are cryptography applications
+         and research, Internet security applications, algebra systems,
+         computational algebra research, etc.
+
+         GMP is carefully designed to be as fast as possible, both for small
+         operands and for huge operands.  The speed is achieved by using
+         fullwords as the basic arithmetic type, by using fast algorithms,
+         with highly optimised assembly code for the most common inner loops
+         for a lot of CPUs, and by a general emphasis on speed.
+
+         GMP is faster than any other bignum library.  The advantage for GMP
+         increases with the operand sizes for many operations, since GMP uses
+         asymptotically faster algorithms.
+      '';
+
+    platforms = platforms.all;
+    badPlatforms = [ "x86_64-darwin" ];
+    maintainers = [ maintainers.peti ];
+  };
+};
+  in self
diff --git a/nixpkgs/pkgs/development/libraries/gmp/6.x.nix b/nixpkgs/pkgs/development/libraries/gmp/6.x.nix
new file mode 100644
index 000000000000..177c15670526
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gmp/6.x.nix
@@ -0,0 +1,88 @@
+{ lib, stdenv, fetchurl, m4
+, cxx ? !stdenv.hostPlatform.useAndroidPrebuilt && !stdenv.hostPlatform.isWasm
+, buildPackages
+, withStatic ? stdenv.hostPlatform.isStatic
+}:
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+let inherit (lib) optional; in
+
+let self = stdenv.mkDerivation rec {
+  name = "gmp-6.2.1";
+
+  src = fetchurl { # we need to use bz2, others aren't in bootstrapping stdenv
+    urls = [ "mirror://gnu/gmp/${name}.tar.bz2" "ftp://ftp.gmplib.org/pub/${name}/${name}.tar.bz2" ];
+    sha256 = "0z2ddfiwgi0xbf65z4fg4hqqzlhv0cc6hdcswf3c6n21xdmk5sga";
+  };
+
+  #outputs TODO: split $cxx due to libstdc++ dependency
+  # maybe let ghc use a version with *.so shared with rest of nixpkgs and *.a added
+  # - see #5855 for related discussion
+  outputs = [ "out" "dev" "info" ];
+  passthru.static = self.out;
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ m4 ];
+
+  configureFlags = [
+    "--with-pic"
+    (lib.enableFeature cxx "cxx")
+    # Build a "fat binary", with routines for several sub-architectures
+    # (x86), except on Solaris where some tests crash with "Memory fault".
+    # See <https://hydra.nixos.org/build/2760931>, for instance.
+    #
+    # no darwin because gmp uses ASM that clang doesn't like
+    (lib.enableFeature (!stdenv.isSunOS && stdenv.hostPlatform.isx86) "fat")
+    # The config.guess in GMP tries to runtime-detect various
+    # ARM optimization flags via /proc/cpuinfo (and is also
+    # broken on multicore CPUs). Avoid this impurity.
+    "--build=${stdenv.buildPlatform.config}"
+  ] ++ optional (cxx && stdenv.isDarwin) "CPPFLAGS=-fexceptions"
+    ++ optional (stdenv.isDarwin && stdenv.is64bit) "ABI=64"
+    # 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"
+    ++ optional (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) "--disable-assembly";
+
+  doCheck = true; # not cross;
+
+  dontDisableStatic = withStatic;
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://gmplib.org/";
+    description = "GNU multiple precision arithmetic library";
+    license = licenses.gpl3Plus;
+
+    longDescription =
+      '' GMP is a free library for arbitrary precision arithmetic, operating
+         on signed integers, rational numbers, and floating point numbers.
+         There is no practical limit to the precision except the ones implied
+         by the available memory in the machine GMP runs on.  GMP has a rich
+         set of functions, and the functions have a regular interface.
+
+         The main target applications for GMP are cryptography applications
+         and research, Internet security applications, algebra systems,
+         computational algebra research, etc.
+
+         GMP is carefully designed to be as fast as possible, both for small
+         operands and for huge operands.  The speed is achieved by using
+         fullwords as the basic arithmetic type, by using fast algorithms,
+         with highly optimised assembly code for the most common inner loops
+         for a lot of CPUs, and by a general emphasis on speed.
+
+         GMP is faster than any other bignum library.  The advantage for GMP
+         increases with the operand sizes for many operations, since GMP uses
+         asymptotically faster algorithms.
+      '';
+
+    platforms = platforms.all;
+    maintainers = [ maintainers.peti maintainers.vrthra ];
+  };
+};
+  in self
diff --git a/nixpkgs/pkgs/development/libraries/gmp/need-size-t.patch b/nixpkgs/pkgs/development/libraries/gmp/need-size-t.patch
new file mode 100644
index 000000000000..c4ba086182a9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gmp/need-size-t.patch
@@ -0,0 +1,18 @@
+diff --git a/gmp-h.in b/gmp-h.in
+index 7deb67a..240d663 100644
+--- a/gmp-h.in
++++ b/gmp-h.in
+@@ -46,13 +46,11 @@ along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.  */
+ #ifndef __GNU_MP__
+ #define __GNU_MP__ 5
+ 
+-#define __need_size_t  /* tell gcc stddef.h we only want size_t */
+ #if defined (__cplusplus)
+ #include <cstddef>     /* for size_t */
+ #else
+ #include <stddef.h>    /* for size_t */
+ #endif
+-#undef __need_size_t
+ 
+ /* Instantiated by configure. */
+ #if ! defined (__GMP_WITHIN_CONFIGURE)
diff --git a/nixpkgs/pkgs/development/libraries/gmtk/default.nix b/nixpkgs/pkgs/development/libraries/gmtk/default.nix
new file mode 100644
index 000000000000..6f2906a8234e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gmtk/default.nix
@@ -0,0 +1,32 @@
+{lib, stdenv, substituteAll, fetchFromGitHub, libtool, pkg-config, intltool, glib, gtk3
+, libpulseaudio, mplayer, gnome_mplayer }:
+
+stdenv.mkDerivation rec {
+  pname = "gmtk";
+  version = "1.0.9";
+
+  src = fetchFromGitHub {
+    owner = "kdekorte";
+    repo = "gmtk";
+    rev = "v${version}";
+    sha256 = "1zb5m1y1gckal3140gvx31572a6xpccwfmdwa1w5lx2wdq1pwk1i";
+  };
+
+  nativeBuildInputs = [ libtool pkg-config intltool ];
+  buildInputs = [ glib gtk3 libpulseaudio ];
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      mplayer = "${mplayer}/bin/mplayer";
+    })
+  ];
+
+  meta = with lib; {
+    description = "Common functions for gnome-mplayer and gecko-mediaplayer";
+    homepage = "https://sites.google.com/site/kdekorte2/gnomemplayer";
+    license = licenses.gpl2;
+    maintainers = gnome_mplayer.meta.maintainers;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gmtk/fix-paths.patch b/nixpkgs/pkgs/development/libraries/gmtk/fix-paths.patch
new file mode 100644
index 000000000000..64738300aba4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gmtk/fix-paths.patch
@@ -0,0 +1,20 @@
+--- a/src/gmtk_media_player.c
++++ b/src/gmtk_media_player.c
+@@ -2449,7 +2449,7 @@
+         player->minimum_mplayer = detect_mplayer_features(player);
+ 
+         if (player->mplayer_binary == NULL || !g_file_test(player->mplayer_binary, G_FILE_TEST_EXISTS)) {
+-            argv[argn++] = g_strdup_printf("mplayer");
++            argv[argn++] = g_strdup_printf("@mplayer@");
+         } else {
+             argv[argn++] = g_strdup_printf("%s", player->mplayer_binary);
+         }
+@@ -4135,7 +4135,7 @@
+         return ret;
+ 
+     if (player->mplayer_binary == NULL || !g_file_test(player->mplayer_binary, G_FILE_TEST_EXISTS)) {
+-        av[ac++] = g_strdup_printf("mplayer");
++        av[ac++] = g_strdup_printf("@mplayer@");
+     } else {
+         av[ac++] = g_strdup_printf("%s", player->mplayer_binary);
+     }
diff --git a/nixpkgs/pkgs/development/libraries/gnet/default.nix b/nixpkgs/pkgs/development/libraries/gnet/default.nix
new file mode 100644
index 000000000000..debf3eb59264
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gnet/default.nix
@@ -0,0 +1,25 @@
+{lib, stdenv, fetchFromGitHub, pkg-config, autoconf, automake, glib, libtool }:
+
+stdenv.mkDerivation rec {
+  pname = "gnet";
+  version = "2.0.8";
+  src = fetchFromGitHub {
+    owner = "GNOME";
+    repo = "gnet";
+    rev = "GNET_${lib.replaceStrings ["."] ["_"] version}";
+    sha256 = "1cy78kglzi235md964ikvm0rg801bx0yk9ya8zavndjnaarzqq87";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ autoconf automake glib libtool ];
+
+  preConfigure = "./autogen.sh";
+
+  meta = with lib; {
+    description = "A network library, written in C, object-oriented, and built upon GLib";
+    homepage = "https://developer.gnome.org/gnet/";
+    license = licenses.lgpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ pSub ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gnome-menus/default.nix b/nixpkgs/pkgs/development/libraries/gnome-menus/default.nix
new file mode 100644
index 000000000000..0b3d6689cb0b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gnome-menus/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, pkg-config, gettext, glib, gobject-introspection, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "gnome-menus";
+  version = "3.36.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "07xvaf8s0fiv0035nk8zpzymn5www76w2a1vflrgqmp9plw8yd6r";
+  };
+
+  makeFlags = [
+    "INTROSPECTION_GIRDIR=${placeholder "out"}/share/gir-1.0/"
+    "INTROSPECTION_TYPELIBDIR=${placeholder "out"}/lib/girepository-1.0"
+  ];
+
+  nativeBuildInputs = [ pkg-config gettext ];
+  buildInputs = [ glib gobject-introspection ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://gitlab.gnome.org/GNOME/gnome-menus";
+    description = "Library that implements freedesktops's Desktop Menu Specification in GNOME";
+    license = with licenses; [ gpl2 lgpl2 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gnome-online-accounts/default.nix b/nixpkgs/pkgs/development/libraries/gnome-online-accounts/default.nix
new file mode 100644
index 000000000000..2d349181deed
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gnome-online-accounts/default.nix
@@ -0,0 +1,104 @@
+{ lib, stdenv
+, fetchFromGitLab
+, pkg-config
+, vala
+, glib
+, meson
+, ninja
+, python3
+, libxslt
+, gtk3
+, webkitgtk
+, json-glib
+, librest
+, libsecret
+, gtk-doc
+, gobject-introspection
+, gettext
+, icu
+, glib-networking
+, libsoup
+, docbook-xsl-nons
+, docbook_xml_dtd_412
+, gnome
+, gcr
+, libkrb5
+, gvfs
+, dbus
+, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gnome-online-accounts";
+  version = "3.40.0";
+
+  # 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 = "sha256-GuUWypfmfbovpDKnj6wSBuNeKJIfIyipY+01u/p4znU=";
+  };
+
+  outputs = [ "out" "man" "dev" "devdoc" ];
+
+  mesonFlags = [
+    "-Dfedora=false" # not useful in NixOS or for NixOS users.
+    "-Dgtk_doc=true"
+    "-Dman=true"
+    "-Dmedia_server=true"
+  ];
+
+  nativeBuildInputs = [
+    dbus # used for checks and pkg-config to install dbus service/s
+    docbook_xml_dtd_412
+    docbook-xsl-nons
+    gettext
+    gobject-introspection
+    gtk-doc
+    libxslt
+    meson
+    ninja
+    pkg-config
+    python3
+    vala
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    gcr
+    glib
+    glib-networking
+    gtk3
+    gvfs # OwnCloud, Google Drive
+    icu
+    json-glib
+    libkrb5
+    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 = gnome.updateScript {
+      packageName = pname;
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Projects/GnomeOnlineAccounts";
+    description = "Single sign-on framework for GNOME";
+    platforms = platforms.linux;
+    license = licenses.lgpl2Plus;
+    maintainers = teams.gnome.members;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gnome-sharp/default.nix b/nixpkgs/pkgs/development/libraries/gnome-sharp/default.nix
new file mode 100644
index 000000000000..4aa510f36068
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gnome-sharp/default.nix
@@ -0,0 +1,45 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, pkg-config
+, gtk2
+, mono
+, gtk-sharp-2_0
+, gnome2
+, autoconf
+, automake
+, libtool
+, which
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gnome-sharp";
+  version = "2.24.4";
+
+  src = fetchFromGitHub {
+    owner = "mono";
+    repo = "gnome-sharp";
+    rev = version;
+    sha256 = "15jsm6n0sih0nf3w8vmvik97q7l3imz4vkdzmp9k7bssiz4glj1z";
+  };
+
+  nativeBuildInputs = [ pkg-config autoconf automake libtool which ];
+  buildInputs = [ gtk2 mono gtk-sharp-2_0 ]
+  ++ (with gnome2; [ libart_lgpl gnome_vfs libgnome libgnomecanvas libgnomeui ]);
+
+  patches = [ ./fix-mono-path.patch ];
+
+  preConfigure = ''
+    ./bootstrap-${lib.versions.majorMinor version}
+  '';
+
+  dontStrip = true;
+
+  meta = with lib; {
+    homepage = "https://www.mono-project.com/docs/gui/gtksharp/";
+    description = "A .NET language binding for assorted GNOME libraries";
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gnome-sharp/fix-mono-path.patch b/nixpkgs/pkgs/development/libraries/gnome-sharp/fix-mono-path.patch
new file mode 100644
index 000000000000..706f119c8baa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gnome-sharp/fix-mono-path.patch
@@ -0,0 +1,13 @@
+diff --git a/sample/gconf/Makefile.am b/sample/gconf/Makefile.am
+index a0ee802..8260694 100644
+--- a/sample/gconf/Makefile.am
++++ b/sample/gconf/Makefile.am
+@@ -22,7 +22,7 @@ sample.exe: $(SCHEMA) $(srcdir)/sample.glade $(FILES) $(ASSEMBLIES)
+	$(CSC) /out:sample.exe $(FILES) $(REFERENCES) $(RESOURCES)
+ 
+ Settings.cs: $(SCHEMA)
+-	MONO_PATH=$(top_builddir)/gconf/GConf/gconf-sharp.dll:${MONO_PATH} $(RUNTIME) $(GCONFDIR)/tools/gconfsharp-schemagen.exe Sample $(SCHEMA) > Settings.cs
++	MONO_PATH=$(top_builddir)/gconf/GConf/:${MONO_PATH} $(RUNTIME) $(GCONFDIR)/tools/gconfsharp-schemagen.exe Sample $(SCHEMA) > Settings.cs
+ 
+ CLEANFILES = sample.exe Settings.cs
+
diff --git a/nixpkgs/pkgs/development/libraries/gnome-video-effects/default.nix b/nixpkgs/pkgs/development/libraries/gnome-video-effects/default.nix
new file mode 100644
index 000000000000..e8fd3ca7e2c2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gnome-video-effects/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv
+, fetchurl
+, pkg-config
+, meson
+, ninja
+, gettext
+, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gnome-video-effects";
+  version = "0.5.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1j6h98whgkcxrh30bwvnxvyqxrxchgpdgqhl0j71xz7x72dqxijd";
+  };
+
+  patches = [
+    # Fix effectsdir in .pc file
+    # https://gitlab.gnome.org/GNOME/gnome-video-effects/commit/955404195ada606819974dd63c48956f25611e14
+    ./fix-pc-file.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gettext
+  ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    description = "A collection of GStreamer effects to be used in different GNOME Modules";
+    homepage = "https://wiki.gnome.org/Projects/GnomeVideoEffects";
+    platforms = platforms.linux;
+    maintainers = teams.gnome.members;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gnome-video-effects/fix-pc-file.patch b/nixpkgs/pkgs/development/libraries/gnome-video-effects/fix-pc-file.patch
new file mode 100644
index 000000000000..62b29e7d025a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gnome-video-effects/fix-pc-file.patch
@@ -0,0 +1,11 @@
+--- a/meson.build
++++ b/meson.build
+@@ -17,7 +17,7 @@
+ # Can't use pkgconfig helper https://github.com/mesonbuild/meson/issues/2253
+ conf = configuration_data()
+ conf.set('prefix', prefix)
+-conf.set('datarootdir', pkgdatadir)
++conf.set('datarootdir', datadir)
+ conf.set('VERSION', meson.project_version())
+ 
+ pkg = configure_file(configuration: conf,
diff --git a/nixpkgs/pkgs/development/libraries/gnu-config/default.nix b/nixpkgs/pkgs/development/libraries/gnu-config/default.nix
new file mode 100644
index 000000000000..a08997ea2cdb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gnu-config/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl }:
+
+let
+  rev = "6faca61810d335c7837f320733fe8e15a1431fc2";
+
+  # Don't use fetchgit as this is needed during Aarch64 bootstrapping
+  configGuess = fetchurl {
+    url = "https://git.savannah.gnu.org/cgit/config.git/plain/config.guess?id=${rev}";
+    sha256 = "06wkkhpbx9slmknr2g7mcd8x3zsdhnmmay25l31h3rkdp1wkq7kx";
+  };
+  configSub = fetchurl {
+    url = "https://git.savannah.gnu.org/cgit/config.git/plain/config.sub?id=${rev}";
+    sha256 = "1qkph8cqanmgy3s4a18bm1a4vk62i8pf8cy5pc1hkpqwn4g6l0di";
+  };
+in stdenv.mkDerivation {
+  pname = "gnu-config";
+  version = "2021-01-25";
+
+  buildCommand = ''
+    mkdir -p $out
+    cp ${configGuess} $out/config.guess
+    cp ${configSub} $out/config.sub
+  '';
+
+  meta = with lib; {
+    description = "Attempt to guess a canonical system name";
+    homepage = "https://savannah.gnu.org/projects/config";
+    license = licenses.gpl3;
+    # In addition to GPLv3:
+    #   As a special exception to the GNU General Public License, if you
+    #   distribute this file as part of a program that contains a
+    #   configuration script generated by Autoconf, you may include it under
+    #   the same distribution terms that you use for the rest of that
+    #   program.
+    maintainers = [ maintainers.dezgeg ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gnu-efi/default.nix b/nixpkgs/pkgs/development/libraries/gnu-efi/default.nix
new file mode 100644
index 000000000000..ef8ef7648ebd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gnu-efi/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, buildPackages, fetchurl, fetchpatch, pciutils }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "gnu-efi";
+  version = "3.0.11";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/gnu-efi/${pname}-${version}.tar.bz2";
+    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}"
+    "HOSTCC=${buildPackages.stdenv.cc.targetPrefix}cc"
+    "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
+  ];
+
+  meta = with lib; {
+    description = "GNU EFI development toolchain";
+    homepage = "https://sourceforge.net/projects/gnu-efi/";
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gnutls-kdh/3.5.nix b/nixpkgs/pkgs/development/libraries/gnutls-kdh/3.5.nix
new file mode 100644
index 000000000000..015163b32931
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gnutls-kdh/3.5.nix
@@ -0,0 +1,12 @@
+{ callPackage, fetchFromGitHub, autoreconfHook, ... } @ args:
+
+callPackage ./generic.nix (args // {
+  version = "1.0";
+
+  src = fetchFromGitHub {
+    owner = "arpa2";
+    repo = "gnutls-kdh";
+    rev = "ff3bb36f70a746f28554641d466e124098dfcb25";
+    sha256 = "1rr3p4r145lnprxn8hqyyzh3qkj3idsbqp08g07ndrhqnxq0k0sw";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/gnutls-kdh/generic.nix b/nixpkgs/pkgs/development/libraries/gnutls-kdh/generic.nix
new file mode 100644
index 000000000000..7b3b4561efb1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gnutls-kdh/generic.nix
@@ -0,0 +1,95 @@
+{ config, lib, stdenv, zlib, lzo, libtasn1, nettle, pkg-config, lzip
+, perl, gmp, autogen, libidn, p11-kit, unbound, libiconv
+, guileBindings ? config.gnutls.guile or false, guile
+, tpmSupport ? true, trousers, nettools, gperftools, gperf, gettext, automake
+, bison, texinfo
+
+# Version dependent args
+, version, src, patches ? [], postPatch ? "", nativeBuildInputs ? []
+, ...}:
+
+assert guileBindings -> guile != null;
+let
+  # XXX: Gnulib's `test-select' fails on FreeBSD:
+  # https://hydra.nixos.org/build/2962084/nixlog/1/raw .
+  doCheck = !stdenv.isFreeBSD && !stdenv.isDarwin && lib.versionAtLeast version "3.4";
+in
+stdenv.mkDerivation {
+  pname = "gnutls-kdh";
+  inherit version;
+
+  inherit src patches;
+
+  outputs = [ "bin" "dev" "out" ];
+
+  patchPhase = ''
+      # rm -fR ./po
+      # substituteInPlace configure "po/Makefile.in" " "
+      substituteInPlace doc/manpages/Makefile.in  --replace "gnutls_cipher_list.3" " "
+      substituteInPlace doc/manpages/Makefile.in  --replace "gnutls_cipher_self_test.3" " "
+      substituteInPlace doc/manpages/Makefile.in  --replace "gnutls_digest_self_test.3" " "
+      substituteInPlace doc/manpages/Makefile.in  --replace "gnutls_mac_self_test.3" " "
+      substituteInPlace doc/manpages/Makefile.in  --replace "gnutls_pk_self_test.3" " "
+      printf "all: ;\n\ninstall: ;" > "po/Makefile.in"
+      printf "all: ;\n\ninstall: ;" > "po/Makefile.in.in"
+      '';
+
+  postPatch = lib.optionalString (lib.versionAtLeast version "3.4") ''
+    sed '2iecho "name constraints tests skipped due to datefudge problems"\nexit 0' \
+      -i tests/cert-tests/name-constraints
+  '' + postPatch;
+
+  preConfigure = "patchShebangs .";
+  configureFlags =
+    lib.optional stdenv.isLinux "--with-default-trust-store-file=/etc/ssl/certs/ca-certificates.crt"
+  ++ [
+    "--disable-dependency-tracking"
+    "--enable-fast-install"
+  ] ++ lib.optional guileBindings
+    [ "--enable-guile" "--with-guile-site-dir=\${out}/share/guile/site" ];
+
+  # Build of the Guile bindings is not parallel-safe.  See
+  # <https://github.com/arpa2/gnutls-kdh/commit/330995a920037b6030ec0282b51dde3f8b493cad>
+  # for the actual fix.  Also an apparent race in the generation of
+  # systemkey-args.h.
+  enableParallelBuilding = false;
+
+  buildInputs = [ lzo lzip nettle libtasn1 libidn p11-kit zlib gmp
+  autogen gperftools gperf gettext automake bison texinfo ]
+    ++ lib.optional doCheck nettools
+    ++ lib.optional (stdenv.isFreeBSD || stdenv.isDarwin) libiconv
+    ++ lib.optional (tpmSupport && stdenv.isLinux) trousers
+    ++ [ unbound ]
+    ++ lib.optional guileBindings guile;
+
+  nativeBuildInputs = [ perl pkg-config ] ++ nativeBuildInputs;
+
+  #inherit doCheck;
+  doCheck = false;
+
+  # Fixup broken libtool and pkg-config files
+  preFixup = lib.optionalString (!stdenv.isDarwin) ''
+    sed ${lib.optionalString tpmSupport "-e 's,-ltspi,-L${trousers}/lib -ltspi,'"} \
+        -e 's,-lz,-L${zlib.out}/lib -lz,' \
+        -e 's,-L${gmp.dev}/lib,-L${gmp.out}/lib,' \
+        -e 's,-lgmp,-L${gmp.out}/lib -lgmp,' \
+        -i $out/lib/*.la "$dev/lib/pkgconfig/gnutls.pc"
+  '';
+
+  meta = with lib; {
+    description = "GnuTLS with additional TLS-KDH ciphers: Kerberos + Diffie-Hellman";
+
+    longDescription = ''
+       The ARPA2 project aims to add security. This is an enhanced
+       version of GnuTLS,  a project that aims to develop a library which
+       provides a secure layer, over a reliable transport
+       layer. It adds TLS-KDH ciphers: Kerberos + Diffie-Hellman.
+    '';
+
+    homepage = "https://github.com/arpa2/gnutls-kdh";
+    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
new file mode 100644
index 000000000000..4c4094987dde
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gnutls/default.nix
@@ -0,0 +1,119 @@
+{ config, lib, stdenv, fetchurl, zlib, lzo, libtasn1, nettle, pkg-config, lzip
+, perl, gmp, autoconf, automake, libidn, p11-kit, libiconv
+, unbound, dns-root-data, gettext, cacert, util-linux
+, guileBindings ? config.gnutls.guile or false, guile
+, tpmSupport ? false, trousers, which, nettools, libunistring
+, withSecurity ? false, Security  # darwin Security.framework
+}:
+
+assert guileBindings -> guile != null;
+let
+
+  # XXX: Gnulib's `test-select' fails on FreeBSD:
+  # https://hydra.nixos.org/build/2962084/nixlog/1/raw .
+  doCheck = !stdenv.isFreeBSD && !stdenv.isDarwin
+      && stdenv.buildPlatform == stdenv.hostPlatform;
+
+  inherit (stdenv.hostPlatform) isDarwin;
+in
+
+stdenv.mkDerivation rec {
+  pname = "gnutls";
+  version = "3.7.2";
+
+  src = fetchurl {
+    url = "mirror://gnupg/gnutls/v${lib.versions.majorMinor version}/gnutls-${version}.tar.xz";
+    sha256 = "646e6c5a9a185faa4cea796d378a1ba8e1148dbb197ca6605f95986a25af2752";
+  };
+
+  outputs = [ "bin" "dev" "out" "man" "devdoc" ];
+  # Not normally useful docs.
+  outputInfo = "devdoc";
+  outputDoc  = "devdoc";
+
+  patches = [ ./nix-ssl-cert-file.patch ]
+    # Disable native add_system_trust.
+    ++ lib.optional (isDarwin && !withSecurity) ./no-security-framework.patch;
+
+  # Skip some tests:
+  #  - pkg-config: building against the result won't work before installing (3.5.11)
+  #  - fastopen: no idea; it broke between 3.6.2 and 3.6.3 (3437fdde6 in particular)
+  #  - trust-store: default trust store path (/etc/ssl/...) is missing in sandbox (3.5.11)
+  #  - psk-file: no idea; it broke between 3.6.3 and 3.6.4
+  # Change p11-kit test to use pkg-config to find p11-kit
+  postPatch = ''
+    sed '2iexit 77' -i tests/{pkgconfig,fastopen}.sh
+    sed '/^void doit(void)/,/^{/ s/{/{ exit(77);/' -i tests/{trust-store,psk-file}.c
+    sed 's:/usr/lib64/pkcs11/ /usr/lib/pkcs11/ /usr/lib/x86_64-linux-gnu/pkcs11/:`pkg-config --variable=p11_module_path p11-kit-1`:' -i tests/p11-kit-trust.sh
+  '' + lib.optionalString stdenv.hostPlatform.isMusl '' # See https://gitlab.com/gnutls/gnutls/-/issues/945
+    sed '2iecho "certtool tests skipped in musl build"\nexit 0' -i tests/cert-tests/certtool.sh
+  '';
+
+  preConfigure = "patchShebangs .";
+  configureFlags =
+    lib.optional stdenv.isLinux "--with-default-trust-store-file=/etc/ssl/certs/ca-certificates.crt"
+  ++ [
+    "--disable-dependency-tracking"
+    "--enable-fast-install"
+    "--with-unbound-root-key-file=${dns-root-data}/root.key"
+  ] ++ lib.optional guileBindings [
+    "--enable-guile"
+    "--with-guile-site-dir=\${out}/share/guile/site"
+    "--with-guile-site-ccache-dir=\${out}/share/guile/site"
+    "--with-guile-extension-dir=\${out}/share/guile/site"
+  ];
+
+  enableParallelBuilding = true;
+
+  buildInputs = [ lzo lzip libtasn1 libidn p11-kit zlib gmp libunistring unbound gettext libiconv ]
+    ++ lib.optional (isDarwin && withSecurity) Security
+    ++ lib.optional (tpmSupport && stdenv.isLinux) trousers
+    ++ lib.optional guileBindings guile;
+
+  nativeBuildInputs = [ perl pkg-config ]
+    ++ lib.optionals (isDarwin && !withSecurity) [ autoconf automake ]
+    ++ lib.optionals doCheck [ which nettools util-linux ];
+
+  propagatedBuildInputs = [ nettle ];
+
+  inherit doCheck;
+  # stdenv's `NIX_SSL_CERT_FILE=/no-cert-file.crt` broke tests with:
+  #   Error setting the x509 trust file: Error while reading file.
+  checkInputs = [ cacert ];
+
+  # Fixup broken libtool and pkg-config files
+  preFixup = lib.optionalString (!isDarwin) ''
+    sed ${lib.optionalString tpmSupport "-e 's,-ltspi,-L${trousers}/lib -ltspi,'"} \
+        -e 's,-lz,-L${zlib.out}/lib -lz,' \
+        -e 's,-L${gmp.dev}/lib,-L${gmp.out}/lib,' \
+        -e 's,-lgmp,-L${gmp.out}/lib -lgmp,' \
+        -i $out/lib/*.la "$dev/lib/pkgconfig/gnutls.pc"
+  '' + ''
+    # It seems only useful for static linking but basically noone does that.
+    substituteInPlace "$out/lib/libgnutls.la" \
+      --replace "-lunistring" ""
+  '';
+
+  meta = with lib; {
+    description = "The GNU Transport Layer Security Library";
+
+    longDescription = ''
+       GnuTLS is a project that aims to develop a library which
+       provides a secure layer, over a reliable transport
+       layer. Currently the GnuTLS library implements the proposed standards by
+       the IETF's TLS working group.
+
+       Quoting from the TLS protocol specification:
+
+       "The TLS protocol provides communications privacy over the
+       Internet. The protocol allows client/server applications to
+       communicate in a way that is designed to prevent eavesdropping,
+       tampering, or message forgery."
+    '';
+
+    homepage = "https://gnutls.org/";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ eelco fpletz ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gnutls/nix-ssl-cert-file.patch b/nixpkgs/pkgs/development/libraries/gnutls/nix-ssl-cert-file.patch
new file mode 100644
index 000000000000..90d1e85ee8c0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gnutls/nix-ssl-cert-file.patch
@@ -0,0 +1,19 @@
+allow overriding system trust store location via $NIX_SSL_CERT_FILE
+
+diff --git a/lib/system/certs.c b/lib/system/certs.c
+index 611c645..6ef6edb 100644
+--- a/lib/system/certs.c
++++ b/lib/system/certs.c
+@@ -369,6 +369,11 @@ gnutls_x509_trust_list_add_system_trust(gnutls_x509_trust_list_t list,
+ 					unsigned int tl_flags,
+ 					unsigned int tl_vflags)
+ {
+-	return add_system_trust(list, tl_flags|GNUTLS_TL_NO_DUPLICATES, tl_vflags);
++	tl_flags = tl_flags|GNUTLS_TL_NO_DUPLICATES;
++	const char *file = secure_getenv("NIX_SSL_CERT_FILE");
++	return file
++		? gnutls_x509_trust_list_add_trust_file(
++			list, file, NULL/*CRL*/, GNUTLS_X509_FMT_PEM, tl_flags, tl_vflags)
++		: add_system_trust(list, tl_flags, tl_vflags);
+ }
+ 
diff --git a/nixpkgs/pkgs/development/libraries/gnutls/no-security-framework.patch b/nixpkgs/pkgs/development/libraries/gnutls/no-security-framework.patch
new file mode 100644
index 000000000000..7f5808e50535
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gnutls/no-security-framework.patch
@@ -0,0 +1,126 @@
+commit 9bcdde1ab9cdff6a4471f9a926dd488ab70c7247
+Author: Daiderd Jordan <daiderd@gmail.com>
+Date:   Mon Apr 22 16:38:27 2019 +0200
+
+    Revert "gnutls_x509_trust_list_add_system_trust: Add macOS keychain support"
+    
+    This reverts commit c0eb46d3463cd21b3f822ac377ff37f067f66b8d.
+
+diff --git a/configure.ac b/configure.ac
+index 8ad597bfd..8d14f26cd 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -781,7 +781,7 @@ dnl auto detect https://lists.gnu.org/archive/html/help-gnutls/2012-05/msg00004.
+ AC_ARG_WITH([default-trust-store-file],
+   [AS_HELP_STRING([--with-default-trust-store-file=FILE],
+     [use the given file default trust store])], with_default_trust_store_file="$withval",
+-  [if test "$build" = "$host" && test x$with_default_trust_store_pkcs11 = x && test x$with_default_trust_store_dir = x && test x$have_macosx = x;then
++  [if test "$build" = "$host" && test x$with_default_trust_store_pkcs11 = x && test x$with_default_trust_store_dir = x;then
+   for i in \
+     /etc/ssl/ca-bundle.pem \
+     /etc/ssl/certs/ca-certificates.crt \
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+index fe9cf63a2..745695f7e 100644
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -203,10 +203,6 @@ if WINDOWS
+ thirdparty_libadd += -lcrypt32
+ endif
+ 
+-if MACOSX
+-libgnutls_la_LDFLAGS += -framework Security -framework CoreFoundation
+-endif
+-
+ libgnutls_la_LIBADD += $(thirdparty_libadd)
+ 
+ # C++ library
+diff --git a/lib/system/certs.c b/lib/system/certs.c
+index 611c645e0..912b0aa5e 100644
+--- a/lib/system/certs.c
++++ b/lib/system/certs.c
+@@ -44,12 +44,6 @@
+ # endif
+ #endif
+ 
+-#ifdef __APPLE__
+-# include <CoreFoundation/CoreFoundation.h>
+-# include <Security/Security.h>
+-# include <Availability.h>
+-#endif
+-
+ /* System specific function wrappers for certificate stores.
+  */
+ 
+@@ -276,72 +270,6 @@ int add_system_trust(gnutls_x509_trust_list_t list, unsigned int tl_flags,
+ 
+ 	return r;
+ }
+-#elif defined(__APPLE__) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
+-static
+-int osstatus_error(status)
+-{
+-	CFStringRef err_str = SecCopyErrorMessageString(status, NULL);
+-	_gnutls_debug_log("Error loading system root certificates: %s\n",
+-			  CFStringGetCStringPtr(err_str, kCFStringEncodingUTF8));
+-	CFRelease(err_str);
+-	return GNUTLS_E_FILE_ERROR;
+-}
+-
+-static
+-int add_system_trust(gnutls_x509_trust_list_t list, unsigned int tl_flags,
+-		     unsigned int tl_vflags)
+-{
+-	int r=0;
+-
+-	SecTrustSettingsDomain domain[] = { kSecTrustSettingsDomainUser,
+-					    kSecTrustSettingsDomainAdmin,
+-					    kSecTrustSettingsDomainSystem };
+-	for (size_t d=0; d<sizeof(domain)/sizeof(*domain); d++) {
+-		CFArrayRef certs = NULL;
+-		OSStatus status = SecTrustSettingsCopyCertificates(domain[d],
+-								   &certs);
+-		if (status == errSecNoTrustSettings)
+-			continue;
+-		if (status != errSecSuccess)
+-			return osstatus_error(status);
+-
+-		int cert_count = CFArrayGetCount(certs);
+-		for (int i=0; i<cert_count; i++) {
+-			SecCertificateRef cert =
+-				(void*)CFArrayGetValueAtIndex(certs, i);
+-			CFDataRef der;
+-			status = SecItemExport(cert, kSecFormatX509Cert, 0,
+-					       NULL, &der);
+-			if (status != errSecSuccess) {
+-				CFRelease(der);
+-				CFRelease(certs);
+-				return osstatus_error(status);
+-			}
+-
+-			if (gnutls_x509_trust_list_add_trust_mem(list,
+-								 &(gnutls_datum_t) {
+-									.data = (void*)CFDataGetBytePtr(der),
+-									.size = CFDataGetLength(der),
+-								 },
+-								 NULL,
+-			                                         GNUTLS_X509_FMT_DER,
+-								 tl_flags,
+-								 tl_vflags) > 0)
+-				r++;
+-			CFRelease(der);
+-		}
+-		CFRelease(certs);
+-	}
+-
+-#ifdef DEFAULT_BLACKLIST_FILE
+-	ret = gnutls_x509_trust_list_remove_trust_file(list, DEFAULT_BLACKLIST_FILE, GNUTLS_X509_FMT_PEM);
+-	if (ret < 0) {
+-		_gnutls_debug_log("Could not load blacklist file '%s'\n", DEFAULT_BLACKLIST_FILE);
+-	}
+-#endif
+-
+-	return r;
+-}
+ #else
+ 
+ #define add_system_trust(x,y,z) GNUTLS_E_UNIMPLEMENTED_FEATURE
diff --git a/nixpkgs/pkgs/development/libraries/gobject-introspection/absolute_gir_path.patch b/nixpkgs/pkgs/development/libraries/gobject-introspection/absolute_gir_path.patch
new file mode 100644
index 000000000000..f74a7af1cff4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gobject-introspection/absolute_gir_path.patch
@@ -0,0 +1,13 @@
+diff --git a/gir/cairo-1.0.gir.in b/gir/cairo-1.0.gir.in
+index e4c9fb3d..3351b184 100644
+--- a/gir/cairo-1.0.gir.in
++++ b/gir/cairo-1.0.gir.in
+@@ -6,7 +6,7 @@
+   <package name="@CAIRO_GIR_PACKAGE@"/>
+   <c:include name="cairo-gobject.h"/>
+   <namespace name="cairo" version="1.0"
+-	     shared-library="@CAIRO_SHARED_LIBRARY@"
++	     shared-library="@cairoLib@/@CAIRO_SHARED_LIBRARY@"
+ 	     c:identifier-prefixes="cairo"
+ 	     c:symbol-prefixes="cairo">
+     <record name="Context" c:type="cairo_t" foreign="1"
diff --git a/nixpkgs/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch b/nixpkgs/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch
new file mode 100644
index 000000000000..c02330adf6d1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gobject-introspection/absolute_shlib_path.patch
@@ -0,0 +1,184 @@
+--- a/giscanner/scannermain.py
++++ b/giscanner/scannermain.py
+@@ -95,6 +95,39 @@ def get_windows_option_group(parser):
+     return group
+ 
+ 
++def _get_default_fallback_libpath():
++    # Newer multiple-output-optimized stdenv has an environment variable
++    # $outputLib which in turn specifies another variable which then is used as
++    # the destination for the library contents (${!outputLib}/lib).
++    store_path = os.environ.get(os.environ.get("outputLib")) if "outputLib" in os.environ else None
++    if store_path is None:
++        outputs = os.environ.get("outputs", "out").split()
++        if "lib" in outputs:
++            # For multiple output derivations let's try whether there is a $lib
++            # environment variable and use that as the base store path.
++            store_path = os.environ.get("lib")
++        elif "out" in outputs:
++            # Otherwise we have a single output derivation, so the libraries
++            # most certainly will end up in "$out/lib".
++            store_path = os.environ.get("out")
++
++    if store_path is not None:
++        # Even if we have a $lib as output, there still should be a $lib/lib
++        # directory.
++        return os.path.join(store_path, 'lib')
++    else:
++        # If we haven't found a possible scenario, let's return an empty string
++        # so that the shared library won't be prepended with a path.
++        #
++        # Note that this doesn't mean that all hope is lost, because after all
++        # we can still use --fallback-library-path to set one.
++        #
++        # Also, we're not returning None, because that would make it very
++        # difficult to disable adding fallback paths altogether using something
++        # like: --fallback-library-path=""
++        return ""
++
++
+ def _get_option_parser():
+     parser = optparse.OptionParser('%prog [options] sources',
+                                    version='%prog ' + giscanner.__version__)
+@@ -214,6 +247,10 @@ match the namespace prefix.""")
+     parser.add_option("", "--filelist",
+                       action="store", dest="filelist", default=[],
+                       help="file containing headers and sources to be scanned")
++    parser.add_option("", "--fallback-library-path",
++                      action="store", dest="fallback_libpath",
++                      default=_get_default_fallback_libpath(),
++                      help="Path to prepend to unknown shared libraries")
+ 
+     group = get_preprocessor_option_group(parser)
+     parser.add_option_group(group)
+--- a/giscanner/shlibs.py
++++ b/giscanner/shlibs.py
+@@ -57,6 +57,12 @@ def _ldd_library_pattern(library_name):
+     $""" % re.escape(library_name), re.VERBOSE)
+ 
+ 
++def _ldd_library_nix_pattern(library_name):
++    nix_store_dir = re.escape('@nixStoreDir@'.rstrip('/'))
++    pattern = r'(%s(?:/[^/]*)+lib%s[^A-Za-z0-9_-][^\s\(\)]*)'
++    return re.compile(pattern % (nix_store_dir, re.escape(library_name)))
++
++
+ # This is a what we do for non-la files. We assume that we are on an
+ # ELF-like system where ldd exists and the soname extracted with ldd is
+ # a filename that can be opened with dlopen().
+@@ -108,7 +114,8 @@ def _resolve_non_libtool(options, binary, libraries):
+             output = output.decode("utf-8", "replace")
+ 
+         shlibs = resolve_from_ldd_output(libraries, output)
+-        return list(map(sanitize_shlib_path, shlibs))
++        fallback_libpath = options.fallback_libpath or "";
++        return list(map(lambda p: os.path.join(fallback_libpath, p), map(sanitize_shlib_path, shlibs)))
+ 
+ 
+ def sanitize_shlib_path(lib):
+@@ -117,19 +124,18 @@ def sanitize_shlib_path(lib):
+     # In case we get relative paths on macOS (like @rpath) then we fall
+     # back to the basename as well:
+     # https://gitlab.gnome.org/GNOME/gobject-introspection/issues/222
+-    if sys.platform == "darwin":
+-        if not os.path.isabs(lib):
+-            return os.path.basename(lib)
+-        return lib
+-    else:
++
++    # Always use absolute paths if available
++    if not os.path.isabs(lib):
+         return os.path.basename(lib)
++    return lib
+ 
+ 
+ def resolve_from_ldd_output(libraries, output):
+     patterns = {}
+     for library in libraries:
+         if not os.path.isfile(library):
+-            patterns[library] = _ldd_library_pattern(library)
++            patterns[library] = (_ldd_library_pattern(library), _ldd_library_nix_pattern(library))
+     if len(patterns) == 0:
+         return []
+ 
+@@ -141,8 +147,11 @@ def resolve_from_ldd_output(libraries, output):
+         if line.endswith(':'):
+             continue
+         for word in line.split():
+-            for library, pattern in patterns.items():
+-                m = pattern.match(word)
++            for library, (pattern, nix_pattern) in patterns.items():
++                if line.find('@nixStoreDir@') != -1:
++                    m = nix_pattern.match(word)
++                else:
++                    m = pattern.match(word)
+                 if m:
+                     del patterns[library]
+                     shlibs.append(m.group())
+--- a/giscanner/utils.py
++++ b/giscanner/utils.py
+@@ -113,16 +113,11 @@ def extract_libtool_shlib(la_file):
+     if dlname is None:
+         return None
+ 
+-    # Darwin uses absolute paths where possible; since the libtool files never
+-    # contain absolute paths, use the libdir field
+-    if platform.system() == 'Darwin':
+-        dlbasename = os.path.basename(dlname)
+-        libdir = _extract_libdir_field(la_file)
+-        if libdir is None:
+-            return dlbasename
+-        return libdir + '/' + dlbasename
+-    # Older libtools had a path rather than the raw dlname
+-    return os.path.basename(dlname)
++    dlbasename = os.path.basename(dlname)
++    libdir = _extract_libdir_field(la_file)
++    if libdir is None:
++        return dlbasename
++    return libdir + '/' + dlbasename
+ 
+ 
+ # Returns arguments for invoking libtool, if applicable, otherwise None
+--- a/tests/scanner/test_shlibs.py
++++ b/tests/scanner/test_shlibs.py
+@@ -7,6 +7,30 @@ from giscanner.shlibs import resolve_from_ldd_output, sanitize_shlib_path
+ 
+ class TestLddParser(unittest.TestCase):
+ 
++    def test_resolve_from_ldd_output_nix(self):
++        output = '''\
++            libglib-2.0.so.0 => @nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libglib-2.0.so.0 (0x00007f0ee1b28000)
++            libgobject-2.0.so.0 => @nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libgobject-2.0.so.0 (0x00007f0ee18cf000)
++            libgio-2.0.so.0 => @nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libgio-2.0.so.0 (0x00007f0ee1502000)
++            libxml2.so.2 => @nixStoreDir@/72mxkk74cv266snkjpz1kwl1i2rg8rpc-libxml2-2.9.8/lib/libxml2.so.2 (0x00007f0ee119c000)
++            libsqlite3.so.0 => @nixStoreDir@/ck5ay23hsmlc67pg3m34kzd1k2hhvww0-sqlite-3.24.0/lib/libsqlite3.so.0 (0x00007f0ee0e98000)
++            libpsl.so.5 => @nixStoreDir@/qn3l2gn7m76f318676wflrs2z6d4rrkj-libpsl-0.20.2-list-2017-02-03/lib/libpsl.so.5 (0x00007f0ee0c88000)
++            libc.so.6 => @nixStoreDir@/g2yk54hifqlsjiha3szr4q3ccmdzyrdv-glibc-2.27/lib/libc.so.6 (0x00007f0ee08d4000)
++            libpcre.so.1 => @nixStoreDir@/hxbq8lpc53qsf1bc0dfcsm47wmcxzjvh-pcre-8.42/lib/libpcre.so.1 (0x00007f0ee0662000)
++            @nixStoreDir@/g2yk54hifqlsjiha3szr4q3ccmdzyrdv-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007f0ee20ff000)
++            libblkid.so.1 => @nixStoreDir@/q0kgnq21j0l2yd77gdlld371246cwghh-util-linux-2.32.1/lib/libblkid.so.1 (0x00007f0edd0cd000)
++            libuuid.so.1 => @nixStoreDir@/q0kgnq21j0l2yd77gdlld371246cwghh-util-linux-2.32.1/lib/libuuid.so.1 (0x00007f0edcec5000)
++            librt.so.1 => @nixStoreDir@/g2yk54hifqlsjiha3szr4q3ccmdzyrdv-glibc-2.27/lib/librt.so.1 (0x00007f0edccbd000)
++            libstdc++.so.6 => @nixStoreDir@/3v5r7fkrbkw2qajadvjbf6p6qriz9p1i-gcc-7.3.0-lib/lib/libstdc++.so.6 (0x00007f0edc936000)
++            libgcc_s.so.1 => @nixStoreDir@/g2yk54hifqlsjiha3szr4q3ccmdzyrdv-glibc-2.27/lib/libgcc_s.so.1 (0x00007f0edc720000)
++        '''
++        libraries = ['glib-2.0', 'gio-2.0']
++
++        self.assertEqual(
++            ['@nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libglib-2.0.so.0',
++             '@nixStoreDir@/gmrf09y7sfxrr0mcx90dba7w41jj2kzk-glib-2.58.1/lib/libgio-2.0.so.0'],
++            resolve_from_ldd_output(libraries, output))
++
+     def test_resolve_from_ldd_output(self):
+         output = '''\
+             libglib-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fbe12d68000)
+@@ -40,7 +64,8 @@ class TestLddParser(unittest.TestCase):
+ 
+         self.assertEqual(
+             sanitize_shlib_path('/foo/bar'),
+-            '/foo/bar' if sys.platform == 'darwin' else 'bar')
++            # NixOS always want the absolute path
++            '/foo/bar')
+ 
+     def test_unresolved_library(self):
+         output = ''
diff --git a/nixpkgs/pkgs/development/libraries/gobject-introspection/default.nix b/nixpkgs/pkgs/development/libraries/gobject-introspection/default.nix
new file mode 100644
index 000000000000..e6a1ad979b91
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gobject-introspection/default.nix
@@ -0,0 +1,136 @@
+{ lib, stdenv
+, fetchurl
+, glib
+, flex
+, bison
+, meson
+, ninja
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+, docbook_xml_dtd_45
+, pkg-config
+, libffi
+, python3
+, cctools
+, cairo
+, gnome
+, substituteAll
+, nixStoreDir ? builtins.storeDir
+, x11Support ? true
+}:
+
+# now that gobject-introspection creates large .gir files (eg gtk3 case)
+# it may be worth thinking about using multiple derivation outputs
+# In that case its about 6MB which could be separated
+
+stdenv.mkDerivation rec {
+  pname = "gobject-introspection";
+  version = "1.68.0";
+
+  # outputs TODO: share/gobject-introspection-1.0/tests is needed during build
+  # by pygobject3 (and maybe others), but it's only searched in $out
+  outputs = [ "out" "dev" "devdoc" "man" ];
+  outputBin = "dev";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "09sawnv3xj9pzgy2qrrk87dl3jibfphnswb61i5bh0d2h4j28afj";
+  };
+
+  patches = [
+    # Make g-ir-scanner put absolute path to GIR files it generates
+    # so that programs can just dlopen them without having to muck
+    # with LD_LIBRARY_PATH environment variable.
+    (substituteAll {
+      src = ./absolute_shlib_path.patch;
+      inherit nixStoreDir;
+    })
+  ] ++ lib.optionals x11Support [
+    # Hardcode the cairo shared library path in the Cairo gir shipped with this package.
+    # https://github.com/NixOS/nixpkgs/issues/34080
+    (substituteAll {
+      src = ./absolute_gir_path.patch;
+      cairoLib = "${lib.getLib cairo}/lib";
+    })
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    flex
+    bison
+    gtk-doc
+    docbook-xsl-nons
+    docbook_xml_dtd_45
+    python3
+    setupHook # move .gir files
+  ];
+
+  buildInputs = [
+    python3
+  ];
+
+  checkInputs = lib.optionals stdenv.isDarwin [
+    cctools # for otool
+  ];
+
+  propagatedBuildInputs = [
+    libffi
+    glib
+  ];
+
+  mesonFlags = [
+    "--datadir=${placeholder "dev"}/share"
+    "-Ddoctool=disabled"
+    "-Dcairo=disabled"
+    "-Dgtk_doc=true"
+  ];
+
+  doCheck = !stdenv.isAarch64;
+
+  # During configurePhase, two python scripts are generated and need this. See
+  # https://github.com/NixOS/nixpkgs/pull/98316#issuecomment-695785692
+  postConfigure = ''
+    patchShebangs tools/*
+  '';
+
+  preCheck = ''
+    # Our gobject-introspection patches make the shared library paths absolute
+    # in the GIR files. When running tests, the library is not yet installed,
+    # though, so we need to replace the absolute path with a local one during build.
+    # We are using a symlink that we will delete before installation.
+    mkdir -p $out/lib
+    ln -s $PWD/tests/scanner/libregress-1.0${stdenv.targetPlatform.extensions.sharedLibrary} $out/lib/libregress-1.0${stdenv.targetPlatform.extensions.sharedLibrary}
+  '';
+
+  postCheck = ''
+    rm $out/lib/libregress-1.0${stdenv.targetPlatform.extensions.sharedLibrary}
+  '';
+
+  setupHook = ./setup-hook.sh;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "A middleware layer between C libraries and language bindings";
+    homepage = "https://gi.readthedocs.io/";
+    maintainers = teams.gnome.members ++ (with maintainers; [ lovek323 ]);
+    platforms = platforms.unix;
+    license = with licenses; [ gpl2 lgpl2 ];
+
+    longDescription = ''
+      GObject introspection is a middleware layer between C libraries (using
+      GObject) and language bindings. The C library can be scanned at compile
+      time and generate a metadata file, in addition to the actual native C
+      library. Then at runtime, language bindings can read this metadata and
+      automatically provide bindings to call into the C library.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gobject-introspection/setup-hook.sh b/nixpkgs/pkgs/development/libraries/gobject-introspection/setup-hook.sh
new file mode 100644
index 000000000000..6bee47aeb096
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gobject-introspection/setup-hook.sh
@@ -0,0 +1,34 @@
+make_gobject_introspection_find_gir_files() {
+    # required for .typelib files, eg mypaint git version
+    if [ -d "$1/lib/girepository-1.0" ]; then
+      addToSearchPath GI_TYPELIB_PATH $1/lib/girepository-1.0
+    fi
+
+    # XDG_DATA_DIRS: required for finding .gir files
+    if [ -d "$1/share/gir-1.0" ]; then
+      addToSearchPath XDG_DATA_DIRS $1/share
+    fi
+}
+
+addEnvHooks "$hostOffset" make_gobject_introspection_find_gir_files
+
+giDiscoverSelf() {
+    if [ -d "$prefix/lib/girepository-1.0" ]; then
+      addToSearchPath GI_TYPELIB_PATH $prefix/lib/girepository-1.0
+    fi
+}
+
+# gappsWrapperArgsHook expects GI_TYPELIB_PATH variable to be set by this.
+# Until we have dependency mechanism in generic builder, we need to use this ugly hack.
+if [[ " ${preFixupPhases:-} " =~ " gappsWrapperArgsHook " ]]; then
+    preFixupPhases+=" "
+    preFixupPhases="${preFixupPhases/ gappsWrapperArgsHook / giDiscoverSelf gappsWrapperArgsHook }"
+else
+    preFixupPhases+=" giDiscoverSelf"
+fi
+
+_multioutMoveGlibGir() {
+  moveToOutput share/gir-1.0 "${!outputDev}"
+}
+
+preFixupHooks+=(_multioutMoveGlibGir)
diff --git a/nixpkgs/pkgs/development/libraries/goffice/default.nix b/nixpkgs/pkgs/development/libraries/goffice/default.nix
new file mode 100644
index 000000000000..85c9b77c6bdc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/goffice/default.nix
@@ -0,0 +1,46 @@
+{ fetchurl, lib, stdenv, pkg-config, intltool, glib, gtk3, lasem
+, libgsf, libxml2, libxslt, cairo, pango, librsvg, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "goffice";
+  version = "0.10.50";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "LFw93HsIs0UkCMgbEhxfASpzSYHXXkRN68yxxY5cv9w=";
+  };
+
+  nativeBuildInputs = [ pkg-config intltool ];
+
+  propagatedBuildInputs = [
+    glib gtk3 libxml2 cairo pango libgsf lasem
+  ];
+
+  buildInputs = [ libxslt librsvg ];
+
+  enableParallelBuilding = true;
+  doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = {
+    description = "A Glib/GTK set of document centric objects and utilities";
+
+    longDescription = ''
+      There are common operations for document centric applications that are
+      conceptually simple, but complex to implement fully: plugins, load/save
+      documents, undo/redo.
+    '';
+
+    license = lib.licenses.gpl2Plus;
+
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gom/default.nix b/nixpkgs/pkgs/development/libraries/gom/default.nix
new file mode 100644
index 000000000000..d11ecc6a29a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gom/default.nix
@@ -0,0 +1,64 @@
+{ lib, stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, glib
+, python3
+, sqlite
+, gdk-pixbuf
+, gnome
+, gobject-introspection
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gom";
+  version = "0.4";
+
+  outputs = [ "out" "py" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "17ca07hpg7dqxjn0jpqim3xqcmplk2a87wbwrrlq3dd3m8381l38";
+  };
+
+  patches = [
+    ./longer-stress-timeout.patch
+  ];
+
+  nativeBuildInputs = [
+    gobject-introspection
+    meson
+    ninja
+    pkg-config
+  ];
+
+  buildInputs = [
+    gdk-pixbuf
+    glib
+    sqlite
+    python3.pkgs.pygobject3
+  ];
+
+  mesonFlags = [
+    "-Dpygobject-override-dir=${placeholder "py"}/${python3.sitePackages}/gi/overrides"
+  ];
+
+  # Success is more likely on x86_64
+  doCheck = stdenv.isx86_64;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "A GObject to SQLite object mapper";
+    homepage = "https://wiki.gnome.org/Projects/Gom";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+    maintainers = teams.gnome.members;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gom/longer-stress-timeout.patch b/nixpkgs/pkgs/development/libraries/gom/longer-stress-timeout.patch
new file mode 100644
index 000000000000..3dcd1d0a107f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gom/longer-stress-timeout.patch
@@ -0,0 +1,13 @@
+diff --git a/tests/meson.build b/tests/meson.build
+index 1df4884..d7a6f5d 100644
+--- a/tests/meson.build
++++ b/tests/meson.build
+@@ -25,7 +25,7 @@ test('test-gom-find', test_find)
+ 
+ test_stress = executable('test-gom-stress', 'test-gom-stress.c',
+   dependencies: [libgom_dep])
+-test('test-gom-stress', test_stress, timeout: 300)
++test('test-gom-stress', test_stress, timeout: 500)
+ 
+ test_transform = executable('test-gom-transform', 'test-gom-transform.c',
+   c_args: '-DIMAGE="@0@/gnome.png"'.format(meson.current_source_dir()),
diff --git a/nixpkgs/pkgs/development/libraries/goocanvas/2.x.nix b/nixpkgs/pkgs/development/libraries/goocanvas/2.x.nix
new file mode 100644
index 000000000000..4194064a5a29
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/goocanvas/2.x.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, pkg-config, gettext, gtk-doc, gobject-introspection, python2, gtk3, cairo, glib }:
+
+stdenv.mkDerivation rec {
+  pname = "goocanvas";
+  version = "2.0.4";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/goocanvas/2.0/${pname}-${version}.tar.xz";
+    sha256 = "141fm7mbqib0011zmkv3g8vxcjwa7hypmq71ahdyhnj2sjvy4a67";
+  };
+
+  nativeBuildInputs = [ pkg-config gettext gtk-doc python2 ];
+  buildInputs = [ gtk3 cairo glib gobject-introspection ];
+
+  configureFlags = [
+    "--disable-python"
+  ];
+  PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "$(dev)/share/gir-1.0";
+  PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_TYPELIBDIR = "$(out)/lib/girepository-1.0";
+
+  meta = with lib; {
+    description = "Canvas widget for GTK based on the the Cairo 2D library";
+    homepage = "https://wiki.gnome.org/Projects/GooCanvas";
+    license = licenses.lgpl2;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/goocanvas/3.x.nix b/nixpkgs/pkgs/development/libraries/goocanvas/3.x.nix
new file mode 100644
index 000000000000..c5decffe74e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/goocanvas/3.x.nix
@@ -0,0 +1,49 @@
+{ lib
+, stdenv
+, fetchurl
+, pkg-config
+, gettext
+, gobject-introspection
+, gtk-doc
+, python3
+, cairo
+, gtk3
+, glib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "goocanvas";
+  version = "3.0.0";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/goocanvas/${lib.versions.majorMinor version}/goocanvas-${version}.tar.xz";
+    sha256 = "06j05g2lmwvklmv51xsb7gm7rszcarhm01sal41jfp0qzrbpa2k7";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    gettext
+    gobject-introspection
+    gtk-doc
+    python3
+  ];
+
+  buildInputs = [
+    cairo
+    gtk3
+    glib
+  ];
+
+  PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "$(dev)/share/gir-1.0";
+  PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_TYPELIBDIR = "$(out)/lib/girepository-1.0";
+
+  meta = with lib; {
+    description = "Canvas widget for GTK based on the the Cairo 2D library";
+    homepage = "https://wiki.gnome.org/Projects/GooCanvas";
+    license = licenses.lgpl2; # https://gitlab.gnome.org/GNOME/goocanvas/-/issues/12
+    maintainers = with maintainers; [ bobby285271 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/goocanvas/default.nix b/nixpkgs/pkgs/development/libraries/goocanvas/default.nix
new file mode 100644
index 000000000000..1bc763349a86
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/goocanvas/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, gtk2, cairo, glib, pkg-config, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "goocanvas";
+  version = "1.0.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
+    sha256 = "07kicpcacbqm3inp7zq32ldp95mxx4kfxpaazd0x5jk7hpw2w1qw";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ gtk2 cairo glib ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    description = "Canvas widget for GTK based on the the Cairo 2D library";
+    homepage = "https://wiki.gnome.org/Projects/GooCanvas";
+    license = licenses.lgpl2;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/goocanvasmm/default.nix b/nixpkgs/pkgs/development/libraries/goocanvasmm/default.nix
new file mode 100644
index 000000000000..4e706f409870
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/goocanvasmm/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, pkg-config, goocanvas2, gtkmm3, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "goocanvasmm";
+  version = "1.90.11";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0vpdfrj59nwzwj8bk4s0h05iyql62pxjzsxh72g3vry07s3i3zw0";
+  };
+  nativeBuildInputs = [ pkg-config ];
+  propagatedBuildInputs = [ gtkmm3 goocanvas2 ];
+
+  enableParallelBuilding = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      attrPath = "goocanvasmm2";
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "C++ bindings for GooCanvas";
+    homepage = "https://wiki.gnome.org/Projects/GooCanvas";
+    license = licenses.lgpl2;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix b/nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix
new file mode 100644
index 000000000000..d493f31d3750
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix
@@ -0,0 +1,76 @@
+{ lib
+, stdenv
+, clang-tools
+, grpc
+, curl
+, cmake
+, pkg-config
+, fetchFromGitHub
+, doxygen
+, protobuf
+, crc32c
+, fetchurl
+, openssl
+, libnsl
+}:
+let
+  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 pkg-config ];
+    buildInputs = [ grpc openssl protobuf ];
+
+    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.14.0";
+
+  src = fetchFromGitHub {
+    owner = "googleapis";
+    repo = "google-cloud-cpp";
+    rev = "v${version}";
+    sha256 = "15wci4m8h6py7fqfziq8mp5m6pxp2h1cbh5rp2k90mk5js4jb9pa";
+  };
+
+  buildInputs = [ curl crc32c googleapis-cpp-cmakefiles grpc protobuf libnsl ];
+  nativeBuildInputs = [ clang-tools cmake pkg-config doxygen ];
+
+  outputs = [ "out" "dev" ];
+
+  postPatch = ''
+    sed -e 's,https://github.com/nlohmann/json/releases/download/v3.4.0/json.hpp,file://${_nlohmann_json},' \
+    -i cmake/DownloadNlohmannJson.cmake
+  '';
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS:BOOL=ON"
+  ];
+
+  meta = with 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; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gperftools/default.nix b/nixpkgs/pkgs/development/libraries/gperftools/default.nix
new file mode 100644
index 000000000000..bdb4e67f85fe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gperftools/default.nix
@@ -0,0 +1,59 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, fetchpatch
+, autoreconfHook
+, libunwind
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gperftools";
+  version = "2.8.1";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "${pname}-${version}";
+    sha256 = "19bj2vlsbfwq7m826v2ccqg47kd7cb5vcz1yw2x0v5qzhaxbakk1";
+  };
+
+  patches = [
+    # Add the --disable-general-dynamic-tls configure option:
+    # https://bugzilla.redhat.com/show_bug.cgi?id=1483558
+    (fetchpatch {
+      url = "https://src.fedoraproject.org/rpms/gperftools/raw/f62d87a34f56f64fb8eb86727e34fbc2d3f5294a/f/gperftools-2.7.90-disable-generic-dynamic-tls.patch";
+      sha256 = "02falhpaqkl27hl1dib4yvmhwsddmgbw0krb46w31fyf3awb2ydv";
+    })
+  ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  # tcmalloc uses libunwind in a way that works correctly only on non-ARM linux
+  buildInputs = lib.optional (stdenv.isLinux && !(stdenv.isAarch64 || stdenv.isAarch32)) libunwind;
+
+  # Disable general dynamic TLS on AArch to support dlopen()'ing the library:
+  # https://bugzilla.redhat.com/show_bug.cgi?id=1483558
+  configureFlags = lib.optional (stdenv.isAarch32 || stdenv.isAarch64)
+    "--disable-general-dynamic-tls";
+
+  prePatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace Makefile.am --replace stdc++ c++
+  '';
+
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin
+    "-D_XOPEN_SOURCE";
+
+  # some packages want to link to the static tcmalloc_minimal
+  # to drop the runtime dependency on gperftools
+  dontDisableStatic = true;
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/gperftools/gperftools";
+    description = "Fast, multi-threaded malloc() and nifty performance analysis tools";
+    platforms = with platforms; linux ++ darwin;
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ vcunat ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gpgme/default.nix b/nixpkgs/pkgs/development/libraries/gpgme/default.nix
new file mode 100644
index 000000000000..9cbf5c39a7e7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gpgme/default.nix
@@ -0,0 +1,101 @@
+{ lib, stdenv, fetchurl, fetchpatch
+, autoreconfHook, libgpgerror, gnupg, pkg-config, glib, pth, libassuan
+, file, which, ncurses
+, texinfo
+, buildPackages
+, qtbase ? null
+, pythonSupport ? false, swig2 ? null, python ? null
+}:
+
+let
+  inherit (stdenv.hostPlatform) system;
+in
+
+stdenv.mkDerivation rec {
+  pname = "gpgme";
+  version = "1.16.0";
+
+  src = fetchurl {
+    url = "mirror://gnupg/gpgme/${pname}-${version}.tar.bz2";
+    sha256 = "1l4yw9fqc1blvx1sq1jnfvp1jijla3ca2jw90p4x9m8hvfpc933c";
+  };
+
+  patches = [
+    (fetchpatch { # probably included in > 1.16.0
+      name = "test_t-edit-sign.diff"; # we experienced segmentation fault in this test
+      urls = [
+        "https://files.gnupg.net/file/data/w43xz2zf73pnyqk5mm5l/PHID-FILE-hm2x5mjntsdyxrxve5tb/file"
+        "https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgme.git;a=patch;h=81a33ea5e1b86d586b956e893a5b25c4cd41c969"
+      ];
+      sha256 = "1xxvv0kc9wdj5hzpddzs3cn8dhmm2cb29224a7h9vairraq5272h";
+    })
+    (fetchpatch { # gpg: Send --with-keygrip when listing keys
+      name = "c4cf527ea227edb468a84bf9b8ce996807bd6992.patch";
+      urls = [
+        "https://files.gnupg.net/file/data/2ufcg7ny5jdnv7hmewb4/PHID-FILE-7iwvryn2btti6txr3bsz/file"
+        "http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgme.git;a=patch;h=c4cf527ea227edb468a84bf9b8ce996807bd6992"
+      ];
+      sha256 = "0y0b0lb2nq5p9kx13b59b2jaz157mvflliw1qdvg1v1hynvgb8m4";
+    })
+    # https://lists.gnupg.org/pipermail/gnupg-devel/2020-April/034591.html
+    (fetchpatch {
+      name = "0001-Fix-python-tests-on-non-Linux.patch";
+      url = "https://lists.gnupg.org/pipermail/gnupg-devel/attachments/20200415/f7be62d1/attachment.obj";
+      sha256 = "00d4sxq63601lzdp2ha1i8fvybh7dzih4531jh8bx07fab3sw65g";
+    })
+    # Disable python tests on Darwin as they use gpg (see configureFlags below)
+  ] ++ lib.optional stdenv.isDarwin ./disable-python-tests.patch
+  # Fix _AC_UNDECLARED_WARNING for autoconf≥2.70. See https://lists.gnupg.org/pipermail/gnupg-devel/2020-November/034643.html
+  ++ lib.optional stdenv.cc.isClang ./fix-clang-autoconf-undeclared-warning.patch;
+
+  outputs = [ "out" "dev" "info" ];
+  outputBin = "dev"; # gpgme-config; not so sure about gpgme-tool
+
+  propagatedBuildInputs =
+    [ libgpgerror glib libassuan pth ]
+    ++ lib.optional (qtbase != null) qtbase;
+
+  nativeBuildInputs = [ pkg-config gnupg texinfo autoreconfHook ]
+  ++ lib.optionals pythonSupport [ python swig2 which ncurses ];
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+
+  dontWrapQtApps = true;
+
+  configureFlags = [
+    "--enable-fixed-path=${gnupg}/bin"
+    "--with-libgpg-error-prefix=${libgpgerror.dev}"
+    "--with-libassuan-prefix=${libassuan.dev}"
+  ] ++ lib.optional pythonSupport "--enable-languages=python"
+  # Tests will try to communicate with gpg-agent instance via a UNIX socket
+  # which has a path length limit. Nix on darwin is using a build directory
+  # that already has quite a long path and the resulting socket path doesn't
+  # fit in the limit. https://github.com/NixOS/nix/pull/1085
+    ++ lib.optionals stdenv.isDarwin [ "--disable-gpg-test" ];
+
+  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");
+
+  checkInputs = [ which ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://gnupg.org/software/gpgme/index.html";
+    changelog = "https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gpgme.git;a=blob;f=NEWS;hb=refs/tags/gpgme-${version}";
+    description = "Library for making GnuPG easier to use";
+    longDescription = ''
+      GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG
+      easier for applications. It provides a High-Level Crypto API for
+      encryption, decryption, signing, signature verification and key
+      management.
+    '';
+    license = with licenses; [ lgpl21Plus gpl3Plus ];
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gpgme/disable-python-tests.patch b/nixpkgs/pkgs/development/libraries/gpgme/disable-python-tests.patch
new file mode 100644
index 000000000000..285af14fcc3e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gpgme/disable-python-tests.patch
@@ -0,0 +1,12 @@
+diff -Naur --strip-trailing-cr gpgme-1.13.1.org/lang/python/Makefile.am gpgme-1.13.1/lang/python/Makefile.am
+--- gpgme-1.13.1.org/lang/python/Makefile.am	2019-06-04 07:27:49.000000000 +0100
++++ gpgme-1.13.1/lang/python/Makefile.am	2020-04-15 14:27:34.810172944 +0100
+@@ -23,7 +23,7 @@
+ 	gpgme.i \
+ 	helpers.c helpers.h private.h
+ 
+-SUBDIRS = . tests examples doc src
++SUBDIRS = . examples doc src
+ 
+ .PHONY: prepare
+ prepare: copystamp
diff --git a/nixpkgs/pkgs/development/libraries/gpgme/fix-clang-autoconf-undeclared-warning.patch b/nixpkgs/pkgs/development/libraries/gpgme/fix-clang-autoconf-undeclared-warning.patch
new file mode 100644
index 000000000000..2d08f982ce6f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gpgme/fix-clang-autoconf-undeclared-warning.patch
@@ -0,0 +1,36 @@
+diff -Naur gpgme.old/configure.ac gpgme.new/configure.ac
+--- gpgme.old/configure.ac	2020-11-12 04:19:50.000000000 -0500
++++ gpgme.new/configure.ac	2021-01-08 03:04:38.000000000 -0500
+@@ -166,6 +166,16 @@
+                           mym4_minor mym4_micro)
+ AC_SUBST(VERSION_NUMBER)
+ 
++# Try to find a thread-safe version of ttyname().
++gnupg_REPLACE_TTYNAME_R
++if test "$ac_cv_func_ttyname_r" != yes; then
++  AC_MSG_WARN([
++***
++*** ttyname() is not thread-safe and ttyname_r() does not exist
++***])
++fi
++
++
+ # We need to compile and run a program on the build machine.  A
+ # comment in libgpg-error says that the AC_PROG_CC_FOR_BUILD macro in
+ # the AC archive is broken for autoconf 2.57.  Given that there is no
+@@ -658,15 +668,6 @@
+ 
+ AC_FUNC_FSEEKO
+ 
+-# Try to find a thread-safe version of ttyname().
+-gnupg_REPLACE_TTYNAME_R
+-if test "$ac_cv_func_ttyname_r" != yes; then
+-  AC_MSG_WARN([
+-***
+-*** ttyname() is not thread-safe and ttyname_r() does not exist
+-***])
+-fi
+-
+ # Try to find a thread-safe version of getenv().
+ have_thread_safe_getenv=no
+ jm_GLIBC21
diff --git a/nixpkgs/pkgs/development/libraries/grail/default.nix b/nixpkgs/pkgs/development/libraries/grail/default.nix
new file mode 100644
index 000000000000..b11ec3a9f5c3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/grail/default.nix
@@ -0,0 +1,25 @@
+{ enableX11 ? true,
+  lib, stdenv, fetchurl, pkg-config, xorg, python3, frame }:
+
+stdenv.mkDerivation rec {
+  pname = "grail";
+  version = "3.1.1";
+
+  src = fetchurl {
+    url = "https://launchpad.net/grail/trunk/${version}/+download/${pname}-${version}.tar.bz2";
+    sha256 = "1wwx5ibjdz5pyd0f5cd1n91y67r68dymxpm2lgd829041xjizvay";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ python3 frame ]
+  ++ lib.optionals enableX11 [xorg.libX11 xorg.libXtst xorg.libXext xorg.libXi xorg.libXfixes];
+
+  configureFlags = lib.optional enableX11 "--with-x11";
+
+  meta = {
+    homepage = "https://launchpad.net/canonical-multitouch/grail";
+    description = "Gesture Recognition And Instantiation Library";
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/grantlee/5/default.nix b/nixpkgs/pkgs/development/libraries/grantlee/5/default.nix
new file mode 100644
index 000000000000..4eef2d407d8e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/grantlee/5/default.nix
@@ -0,0 +1,54 @@
+{ mkDerivation, lib, fetchurl, qtbase, qtscript, cmake }:
+
+mkDerivation rec {
+  pname = "grantlee";
+  version = "5.2.0";
+  grantleePluginPrefix = "lib/grantlee/${lib.versions.majorMinor version}";
+
+  src = fetchurl {
+    url = "https://github.com/steveire/grantlee/archive/v${version}.tar.gz";
+    sha256 = "02lrdbnvaz19hkawbbj2psww1m04qsbhvv172ggpp5bbfkjwx6hk";
+    name = "${pname}-${version}.tar.gz";
+  };
+
+  buildInputs = [ qtbase qtscript ];
+  nativeBuildInputs = [ cmake ];
+
+  patches = [
+    ./grantlee-nix-profiles.patch
+    ./grantlee-no-canonicalize-filepath.patch
+  ];
+
+  outputs = [ "out" "dev" ];
+  postFixup =
+    # Disabuse CMake of the notion that libraries are in $dev
+    ''
+      for way in release debug; do
+          cmake="$dev/lib/cmake/Grantlee5/GrantleeTargets-$way.cmake"
+          if [ -f "$cmake" ]; then
+              sed -i "$cmake" -e "s|\''${_IMPORT_PREFIX}|$out|"
+          fi
+      done
+    '';
+
+  setupHook = ./setup-hook.sh;
+
+  doCheck = false; # fails all the tests (ctest)
+
+  meta = with lib; {
+    description = "Qt5 port of Django template system";
+    longDescription = ''
+      Grantlee is a plugin based String Template system written using the Qt
+      framework. The goals of the project are to make it easier for application
+      developers to separate the structure of documents from the data they
+      contain, opening the door for theming.
+
+      The syntax is intended to follow the syntax of the Django template system,
+      and the design of Django is reused in Grantlee.'';
+
+    homepage = "http://gitorious.org/grantlee";
+    maintainers = [ maintainers.ttuegel ];
+    license = licenses.lgpl21;
+    inherit (qtbase.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/grantlee/5/grantlee-nix-profiles.patch b/nixpkgs/pkgs/development/libraries/grantlee/5/grantlee-nix-profiles.patch
new file mode 100644
index 000000000000..f6c13dbd6d55
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/grantlee/5/grantlee-nix-profiles.patch
@@ -0,0 +1,19 @@
+Index: grantlee-5.1.0/templates/lib/engine.cpp
+===================================================================
+--- grantlee-5.1.0.orig/templates/lib/engine.cpp
++++ grantlee-5.1.0/templates/lib/engine.cpp
+@@ -48,6 +48,14 @@ Engine::Engine(QObject *parent)
+ 
+   d_ptr->m_pluginDirs = QCoreApplication::instance()->libraryPaths();
+   d_ptr->m_pluginDirs << QString::fromLocal8Bit(GRANTLEE_PLUGIN_PATH);
++
++  // Add library paths derived from NIX_PROFILES.
++  const QByteArrayList profiles = qgetenv("NIX_PROFILES").split(' ');
++  for (const QByteArray &profile: profiles) {
++    if (!profile.isEmpty()) {
++      d_ptr->m_pluginDirs << (QFile::decodeName(profile) + QStringLiteral("/lib"));
++    }
++  }
+ }
+ 
+ Engine::~Engine()
diff --git a/nixpkgs/pkgs/development/libraries/grantlee/5/grantlee-no-canonicalize-filepath.patch b/nixpkgs/pkgs/development/libraries/grantlee/5/grantlee-no-canonicalize-filepath.patch
new file mode 100644
index 000000000000..64eb11c3f156
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/grantlee/5/grantlee-no-canonicalize-filepath.patch
@@ -0,0 +1,27 @@
+Index: grantlee-5.1.0/templates/lib/templateloader.cpp
+===================================================================
+--- grantlee-5.1.0.orig/templates/lib/templateloader.cpp
++++ grantlee-5.1.0/templates/lib/templateloader.cpp
+@@ -142,10 +142,6 @@ Template FileSystemTemplateLoader::loadByName(const QString &fileName,
+                      + QLatin1Char('/') + fileName);
+     const QFileInfo fi(file);
+
+-    if (file.exists()
+-        && !fi.canonicalFilePath().contains(
+-            QDir(d->m_templateDirs.at(i)).canonicalPath()))
+-      return Template();
+     ++i;
+   }
+
+@@ -173,11 +169,6 @@ FileSystemTemplateLoader::getMediaUri(co
+                      + QLatin1Char('/') + fileName);
+ 
+     const QFileInfo fi(file);
+-    if (!fi.canonicalFilePath().contains(
+-            QDir(d->m_templateDirs.at(i)).canonicalPath())) {
+-      ++i;
+-      continue;
+-    }
+ 
+     if (file.exists()) {
+       auto path = fi.absoluteFilePath();
diff --git a/nixpkgs/pkgs/development/libraries/grantlee/5/setup-hook.sh b/nixpkgs/pkgs/development/libraries/grantlee/5/setup-hook.sh
new file mode 100644
index 000000000000..b51cb4a31909
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/grantlee/5/setup-hook.sh
@@ -0,0 +1,13 @@
+grantleePluginPrefix=@grantleePluginPrefix@
+
+providesGrantleeRuntime() {
+    [ -d "$1/$grantleePluginPrefix" ]
+}
+
+_grantleeEnvHook() {
+    if providesGrantleeRuntime "$1"; then
+        propagatedBuildInputs+=" $1"
+        propagatedUserEnvPkgs+=" $1"
+    fi
+}
+addEnvHooks "$hostOffset" _grantleeEnvHook
diff --git a/nixpkgs/pkgs/development/libraries/grantlee/default.nix b/nixpkgs/pkgs/development/libraries/grantlee/default.nix
new file mode 100644
index 000000000000..869430538e89
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/grantlee/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, qt4, cmake }:
+
+stdenv.mkDerivation rec {
+  name = "grantlee-0.5.1";
+
+# Upstream download server has country code firewall, so I made a mirror.
+  src = fetchurl {
+    urls = [
+      "http://downloads.grantlee.org/${name}.tar.gz"
+      "http://www.loegria.net/grantlee/${name}.tar.gz"
+    ];
+    sha256 = "1b501xbimizmbmysl1j5zgnp48qw0r2r7lhgmxvzhzlv9jzhj60r";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ qt4 ];
+
+  meta = {
+    description = "Qt4 port of Django template system";
+    longDescription = ''
+      Grantlee is a plugin based String Template system written using the Qt
+      framework. The goals of the project are to make it easier for application
+      developers to separate the structure of documents from the data they
+      contain, opening the door for theming.
+
+      The syntax is intended to follow the syntax of the Django template system,
+      and the design of Django is reused in Grantlee.'';
+
+    homepage = "http://gitorious.org/grantlee";
+    license = lib.licenses.lgpl21;
+    inherit (qt4.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/graphene-hardened-malloc/default.nix b/nixpkgs/pkgs/development/libraries/graphene-hardened-malloc/default.nix
new file mode 100644
index 000000000000..35a4d9362680
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/graphene-hardened-malloc/default.nix
@@ -0,0 +1,88 @@
+{ lib, stdenv, fetchurl, python3, runCommand, makeWrapper, stress-ng }:
+
+lib.fix (self: stdenv.mkDerivation rec {
+  pname = "graphene-hardened-malloc";
+  version = "8";
+
+  src = fetchurl {
+    url = "https://github.com/GrapheneOS/hardened_malloc/archive/${version}.tar.gz";
+    sha256 = "0lipyd2pb1bmghkyv9zmg25jwcglj7m281f01zlh3ghz3xlfh0ym";
+  };
+
+  doCheck = true;
+  checkInputs = [ python3 ];
+  # these tests cover use as a build-time-linked library
+  checkPhase = ''
+    make test
+  '';
+
+  installPhase = ''
+    install -Dm444 -t $out/include include/*
+    install -Dm444 -t $out/lib libhardened_malloc.so
+
+    mkdir -p $out/bin
+    substitute preload.sh $out/bin/preload-hardened-malloc --replace "\$dir" $out/lib
+    chmod 0555 $out/bin/preload-hardened-malloc
+  '';
+
+  separateDebugInfo = true;
+
+  passthru = {
+    ld-preload-tests = stdenv.mkDerivation {
+      name = "${self.name}-ld-preload-tests";
+      src = self.src;
+
+      nativeBuildInputs = [ makeWrapper ];
+
+      # reuse the projects tests to cover use with LD_PRELOAD. we have
+      # to convince the test programs to build as though they're naive
+      # standalone executables. this includes disabling tests for
+      # malloc_object_size, which doesn't make sense to use via LD_PRELOAD.
+      buildPhase = ''
+        pushd test/simple-memory-corruption
+        make LDLIBS= LDFLAGS=-Wl,--unresolved-symbols=ignore-all CXXFLAGS=-lstdc++
+        substituteInPlace test_smc.py \
+          --replace 'test_malloc_object_size' 'dont_test_malloc_object_size' \
+          --replace 'test_invalid_malloc_object_size' 'dont_test_invalid_malloc_object_size'
+        popd # test/simple-memory-corruption
+      '';
+
+      installPhase = ''
+        mkdir -p $out/test
+        cp -r test/simple-memory-corruption $out/test/simple-memory-corruption
+
+        mkdir -p $out/bin
+        makeWrapper ${python3.interpreter} $out/bin/run-tests \
+          --add-flags "-I -m unittest discover --start-directory $out/test/simple-memory-corruption"
+      '';
+    };
+    tests = {
+      ld-preload = runCommand "ld-preload-test-run" {} ''
+        ${self}/bin/preload-hardened-malloc ${self.ld-preload-tests}/bin/run-tests
+        touch $out
+      '';
+      # to compensate for the lack of tests of correct normal malloc operation
+      stress = runCommand "stress-test-run" {} ''
+        ${self}/bin/preload-hardened-malloc ${stress-ng}/bin/stress-ng \
+          --no-rand-seed \
+          --malloc 8 \
+          --malloc-ops 1000000 \
+          --verify
+        touch $out
+      '';
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://github.com/GrapheneOS/hardened_malloc";
+    description = "Hardened allocator designed for modern systems";
+    longDescription = ''
+      This is a security-focused general purpose memory allocator providing the malloc API
+      along with various extensions. It provides substantial hardening against heap
+      corruption vulnerabilities yet aims to provide decent overall performance.
+    '';
+    license = licenses.mit;
+    maintainers = with maintainers; [ ris ];
+    platforms = [ "x86_64-linux" "aarch64-linux" ];
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/graphene/0001-meson-add-options-for-tests-installation-dirs.patch b/nixpkgs/pkgs/development/libraries/graphene/0001-meson-add-options-for-tests-installation-dirs.patch
new file mode 100644
index 000000000000..9111217ea08e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/graphene/0001-meson-add-options-for-tests-installation-dirs.patch
@@ -0,0 +1,97 @@
+From 57bed86429db9d871f1442c94f14e94e38972ca3 Mon Sep 17 00:00:00 2001
+From: worldofpeace <worldofpeace@protonmail.ch>
+Date: Thu, 16 May 2019 21:15:15 -0400
+Subject: [PATCH] meson: add options for tests installation dirs
+
+---
+ meson_options.txt |  6 ++++++
+ tests/meson.build | 23 ++++++++++++++++-------
+ 2 files changed, 22 insertions(+), 7 deletions(-)
+
+diff --git a/meson_options.txt b/meson_options.txt
+index b9a2fb5..4b8629f 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -23,3 +23,9 @@ option('tests', type: 'boolean',
+ option('installed_tests', type: 'boolean',
+        value: true,
+        description: 'Install tests')
++option('installed_test_datadir', type: 'string',
++       value: '',
++       description: 'Installation directory for data files in tests')
++option('installed_test_bindir', type: 'string',
++       value: '',
++       description: 'Installation directory for binary files in tests')
+diff --git a/tests/meson.build b/tests/meson.build
+index 77281f5..7522456 100644
+--- a/tests/meson.build
++++ b/tests/meson.build
+@@ -21,8 +21,17 @@ unit_tests = [
+ 
+ gen_installed_test = find_program('gen-installed-test.py')
+ 
+-installed_test_datadir = join_paths(get_option('prefix'), get_option('datadir'), 'installed-tests', graphene_api_path)
+-installed_test_bindir = join_paths(get_option('prefix'), get_option('libexecdir'), 'installed-tests', graphene_api_path)
++test_suffix = join_paths('installed-tests', graphene_api_path)
++
++test_datadir = join_paths(get_option('installed_test_datadir'), test_suffix)
++if test_datadir == ''
++    test_datadir = join_paths(get_option('prefix'), get_option('datadir'), test_suffix)
++endif
++
++test_bindir = join_paths(get_option('installed_test_bindir'), test_suffix)
++if test_bindir == ''
++    test_bindir = join_paths(get_option('prefix'), get_option('libexecdir'), test_suffix)
++endif
+ 
+ # Make tests conditional on having mutest-1 installed system-wide, or
+ # available as a subproject
+@@ -40,13 +49,13 @@ if mutest_dep.found()
+       output: wrapper,
+       command: [
+         gen_installed_test,
+-        '--testdir=@0@'.format(installed_test_bindir),
++        '--testdir=@0@'.format(test_bindir),
+         '--testname=@0@'.format(unit),
+         '--outdir=@OUTDIR@',
+         '--outfile=@0@'.format(wrapper),
+       ],
+       install: get_option('installed_tests'),
+-      install_dir: installed_test_datadir,
++      install_dir: test_datadir,
+     )
+ 
+     test(unit,
+@@ -55,7 +64,7 @@ if mutest_dep.found()
+         include_directories: graphene_inc,
+         c_args: common_cflags,
+         install: get_option('installed_tests'),
+-        install_dir: installed_test_bindir,
++        install_dir: test_bindir,
+       ),
+       env: ['MUTEST_OUTPUT=tap'],
+       protocol: 'tap',
+@@ -66,17 +75,18 @@ endif
+ if build_gir and host_system == 'linux' and not meson.is_cross_build()
+   foreach unit: ['introspection.py']
+     wrapper = '@0@.test'.format(unit)
++    install_data(unit, install_dir: test_bindir)
+     custom_target(wrapper,
+       output: wrapper,
+       command: [
+         gen_installed_test,
+-        '--testdir=@0@'.format(installed_test_bindir),
++        '--testdir=@0@'.format(test_bindir),
+         '--testname=@0@'.format(unit),
+         '--outdir=@OUTDIR@',
+         '--outfile=@0@'.format(wrapper),
+       ],
+       install: get_option('installed_tests'),
+-      install_dir: installed_test_datadir,
++      install_dir: test_datadir,
+     )
+ 
+     test(unit,
+-- 
+2.31.1
+
diff --git a/nixpkgs/pkgs/development/libraries/graphene/default.nix b/nixpkgs/pkgs/development/libraries/graphene/default.nix
new file mode 100644
index 000000000000..a8e0d1179826
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/graphene/default.nix
@@ -0,0 +1,92 @@
+{ lib, stdenv
+, fetchFromGitHub
+, nix-update-script
+, pkg-config
+, meson
+, ninja
+, python3
+, mutest
+, nixosTests
+, glib
+, gtk-doc
+, docbook_xsl
+, docbook_xml_dtd_43
+, gobject-introspection
+, makeWrapper
+}:
+
+stdenv.mkDerivation rec {
+  pname = "graphene";
+  version = "1.10.6";
+
+  outputs = [ "out" "devdoc" "installedTests" ];
+
+  src = fetchFromGitHub {
+    owner = "ebassi";
+    repo = pname;
+    rev = version;
+    sha256 = "v6YH3fRMTzhp7wmU8in9ukcavzHmOAW54EK9ZwQyFxc=";
+  };
+
+  patches = [
+    # Add option for changing installation path of installed tests.
+    ./0001-meson-add-options-for-tests-installation-dirs.patch
+  ];
+
+  nativeBuildInputs = [
+    docbook_xml_dtd_43
+    docbook_xsl
+    gtk-doc
+    meson
+    ninja
+    pkg-config
+    gobject-introspection
+    python3
+    makeWrapper
+  ];
+
+  buildInputs = [
+    glib
+    gobject-introspection
+  ];
+
+  checkInputs = [
+    mutest
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=true"
+    "-Dinstalled_test_datadir=${placeholder "installedTests"}/share"
+    "-Dinstalled_test_bindir=${placeholder "installedTests"}/libexec"
+  ];
+
+  doCheck = true;
+
+  postPatch = ''
+    patchShebangs tests/gen-installed-test.py
+    PATH=${python3.withPackages (pp: [ pp.pygobject3 pp.tappy ])}/bin:$PATH patchShebangs tests/introspection.py
+  '';
+
+  postFixup = ''
+    wrapProgram "${placeholder "installedTests"}/libexec/installed-tests/graphene-1.0/introspection.py" \
+      --prefix GI_TYPELIB_PATH : "$out/lib/girepository-1.0"
+  '';
+
+  passthru = {
+    tests = {
+      installedTests = nixosTests.installed-tests.graphene;
+    };
+
+    updateScript = nix-update-script {
+      attrPath = pname;
+    };
+  };
+
+  meta = with lib; {
+    description = "A thin layer of graphic data types";
+    homepage = "https://ebassi.github.com/graphene";
+    license = licenses.mit;
+    maintainers = teams.gnome.members ++ (with maintainers; [ ]);
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/grib-api/default.nix b/nixpkgs/pkgs/development/libraries/grib-api/default.nix
new file mode 100644
index 000000000000..1f7097dc4a3f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/grib-api/default.nix
@@ -0,0 +1,71 @@
+{ fetchurl, fetchpatch, lib, stdenv,
+  cmake, netcdf, gfortran, libpng, openjpeg,
+  enablePython ? false, pythonPackages ? null }:
+
+stdenv.mkDerivation rec {
+  pname = "grib-api";
+  version = "1.28.0";
+
+  src = fetchurl {
+    url = "https://software.ecmwf.int/wiki/download/attachments/3473437/grib_api-${version}-Source.tar.gz";
+    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;" ""
+  '';
+
+  nativeBuildInputs = [ cmake gfortran ];
+  buildInputs = [ netcdf
+                  libpng
+                  openjpeg
+                ] ++ lib.optionals enablePython [
+                  pythonPackages.python
+                ];
+
+  propagatedBuildInputs = lib.optionals enablePython [
+                  pythonPackages.numpy
+                ];
+
+  cmakeFlags = [ "-DENABLE_PYTHON=${if enablePython then "ON" else "OFF"}"
+                 "-DENABLE_PNG=ON"
+                 "-DENABLE_FORTRAN=ON"
+                 "-DOPENJPEG_INCLUDE_DIR=${openjpeg.dev}/include/${openjpeg.incDir}"
+               ];
+
+  doCheck = true;
+
+  # Only do tests that don't require downloading 120MB of testdata
+  # We fix the darwin checkPhase, which searches for libgrib_api.dylib
+  # in /nix/store by setting DYLD_LIBRARY_PATH
+  checkPhase = lib.optionalString (stdenv.isDarwin) ''
+    substituteInPlace "tests/include.sh" --replace "set -ea" "set -ea; export DYLD_LIBRARY_PATH=$(pwd)/lib"
+  '' + ''
+    ctest -R "t_definitions|t_calendar|t_unit_tests" -VV
+  '';
+
+
+  meta = with lib; {
+    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 -- 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
new file mode 100644
index 000000000000..13ec503fae0e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/grilo-plugins/default.nix
@@ -0,0 +1,101 @@
+{ lib, stdenv
+, fetchurl
+, substituteAll
+, meson
+, ninja
+, pkg-config
+, gettext
+, gperf
+, sqlite
+, librest
+, libarchive
+, libsoup
+, gnome
+, libxml2
+, lua5_3
+, liboauth
+, libgdata
+, libmediaart
+, grilo
+, gst_all_1
+, gnome-online-accounts
+, gmime
+, gom
+, json-glib
+, avahi
+, tracker
+, dleyna-server
+, itstool
+, totem-pl-parser
+}:
+
+stdenv.mkDerivation rec {
+  pname = "grilo-plugins";
+  version = "0.3.13";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "HEMF1nNkqTBUODbMGYLzDpRpc7j/avPv4x2HcJq1IPg=";
+  };
+
+  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 = 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
+    pkg-config
+    gettext
+    itstool
+    gperf # for lua-factory
+  ];
+
+  buildInputs = [
+    grilo
+    libxml2
+    libgdata
+    lua5_3
+    liboauth
+    sqlite
+    gnome-online-accounts
+    totem-pl-parser
+    librest
+    libarchive
+    libsoup
+    gmime
+    gom
+    json-glib
+    avahi
+    libmediaart
+    tracker
+    dleyna-server
+    gst_all_1.gstreamer
+  ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Projects/Grilo";
+    description = "A collection of plugins for the Grilo framework";
+    maintainers = teams.gnome.members;
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/grilo/default.nix b/nixpkgs/pkgs/development/libraries/grilo/default.nix
new file mode 100644
index 000000000000..172ae39536e6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/grilo/default.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv, fetchurl, fetchpatch, meson, ninja, pkg-config, gettext, vala, glib, liboauth, gtk3
+, gtk-doc, docbook_xsl, docbook_xml_dtd_43
+, libxml2, gnome, gobject-introspection, libsoup, totem-pl-parser }:
+
+let
+  pname = "grilo";
+  version = "0.3.13"; # if you change minor, also change ./setup-hook.sh
+in stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+
+  outputs = [ "out" "dev" "man" "devdoc" ];
+  outputBin = "dev";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz";
+    sha256 = "0ywjvh7xw4ql1q4fvl0q5n06n08pga1g1nc9l7c3x5214gr3fj6i";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "CVE-2021-39365.patch";
+      url = "https://gitlab.gnome.org/GNOME/grilo/-/commit/cd2472e506dafb1bb8ae510e34ad4797f63e263e.patch";
+      sha256 = "1i1p21vlms43iawg4dl1dibnpsbnkx27kcfvllnx76q07bfrpwzm";
+    })
+  ];
+
+  setupHook = ./setup-hook.sh;
+
+  mesonFlags = [
+    "-Denable-gtk-doc=true"
+  ];
+
+  nativeBuildInputs = [
+    meson ninja pkg-config gettext gobject-introspection vala
+    gtk-doc docbook_xsl docbook_xml_dtd_43
+  ];
+  buildInputs = [ glib liboauth gtk3 libxml2 libsoup totem-pl-parser ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Projects/Grilo";
+    description = "Framework that provides access to various sources of multimedia content, using a pluggable system";
+    maintainers = teams.gnome.members;
+    license = licenses.lgpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/grilo/setup-hook.sh b/nixpkgs/pkgs/development/libraries/grilo/setup-hook.sh
new file mode 100644
index 000000000000..9337c520a207
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/grilo/setup-hook.sh
@@ -0,0 +1,7 @@
+make_grilo_find_plugins() {
+    if [ -d "$1"/lib/grilo-0.3 ]; then
+        addToSearchPath GRL_PLUGIN_PATH "$1/lib/grilo-0.3"
+    fi
+}
+
+addEnvHooks "$hostOffset" make_grilo_find_plugins
diff --git a/nixpkgs/pkgs/development/libraries/grpc/default.nix b/nixpkgs/pkgs/development/libraries/grpc/default.nix
new file mode 100644
index 000000000000..f015773e2041
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/grpc/default.nix
@@ -0,0 +1,80 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, buildPackages
+, cmake
+, zlib
+, c-ares
+, pkg-config
+, re2
+, openssl
+, protobuf
+, grpc
+, abseil-cpp
+, libnsl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "grpc";
+  version = "1.39.1"; # N.B: if you change this, change pythonPackages.grpcio-tools to a matching version too
+
+  src = fetchFromGitHub {
+    owner = "grpc";
+    repo = "grpc";
+    rev = "v${version}";
+    sha256 = "1yrr04g6faphh4hwzryqrwzgcr0hqqh05x9mc3vhpzmdkrrbz4zn";
+    fetchSubmodules = true;
+  };
+
+  patches = [
+    # Fix build on armv6l (https://github.com/grpc/grpc/pull/21341)
+    (fetchpatch {
+      url = "https://github.com/grpc/grpc/commit/2f4cf1d9265c8e10fb834f0794d0e4f3ec5ae10e.patch";
+      sha256 = "0ams3jmgh9yzwmxcg4ifb34znamr7pb4qm0609kvil9xqvkqz963";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config ]
+    ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) grpc;
+  propagatedBuildInputs = [ c-ares re2 zlib abseil-cpp ];
+  buildInputs = [ c-ares.cmake-config openssl protobuf ]
+    ++ lib.optionals stdenv.isLinux [ libnsl ];
+
+  cmakeFlags = [
+    "-DgRPC_ZLIB_PROVIDER=package"
+    "-DgRPC_CARES_PROVIDER=package"
+    "-DgRPC_RE2_PROVIDER=package"
+    "-DgRPC_SSL_PROVIDER=package"
+    "-DgRPC_PROTOBUF_PROVIDER=package"
+    "-DgRPC_ABSL_PROVIDER=package"
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DCMAKE_SKIP_BUILD_RPATH=OFF"
+    "-DCMAKE_CXX_STANDARD=17"
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "-D_gRPC_PROTOBUF_PROTOC_EXECUTABLE=${buildPackages.protobuf}/bin/protoc"
+  ];
+
+  # CMake creates a build directory by default, this conflicts with the
+  # basel BUILD file on case-insensitive filesystems.
+  preConfigure = ''
+    rm -vf BUILD
+  '';
+
+  preBuild = ''
+    export LD_LIBRARY_PATH=$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
+  '';
+
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=unknown-warning-option";
+
+  enableParallelBuilds = true;
+
+  meta = with lib; {
+    description = "The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ lnl7 marsam ];
+    homepage = "https://grpc.io/";
+    platforms = platforms.all;
+    changelog = "https://github.com/grpc/grpc/releases/tag/v${version}";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gsasl/default.nix b/nixpkgs/pkgs/development/libraries/gsasl/default.nix
new file mode 100644
index 000000000000..5dcc24cc8bc2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsasl/default.nix
@@ -0,0 +1,37 @@
+{ fetchurl, lib, stdenv, libidn, libkrb5 }:
+
+stdenv.mkDerivation rec {
+  pname = "gsasl";
+  version = "1.10.0";
+
+  src = fetchurl {
+    url = "mirror://gnu/gsasl/${pname}-${version}.tar.gz";
+    sha256 = "sha256-hby9juYJWt54cCY6KOvLiDL1Qepzk5dUlJJgFcB1aNM=";
+  };
+
+  buildInputs = [ libidn libkrb5 ];
+
+  configureFlags = [ "--with-gssapi-impl=mit" ];
+
+  preCheck = ''
+    export LOCALDOMAIN="dummydomain"
+  '';
+  doCheck = !stdenv.hostPlatform.isDarwin;
+
+  meta = {
+    description = "GNU SASL, Simple Authentication and Security Layer library";
+
+    longDescription =
+      '' GNU SASL is a library that implements the IETF Simple
+         Authentication and Security Layer (SASL) framework and
+         some SASL mechanisms. SASL is used in network servers
+         (e.g. IMAP, SMTP, etc.) to authenticate peers.
+       '';
+
+    homepage = "https://www.gnu.org/software/gsasl/";
+    license = lib.licenses.gpl3Plus;
+
+    maintainers = with lib.maintainers; [ shlevy ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gsettings-desktop-schemas/default.nix b/nixpkgs/pkgs/development/libraries/gsettings-desktop-schemas/default.nix
new file mode 100644
index 000000000000..b4dc200f980a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsettings-desktop-schemas/default.nix
@@ -0,0 +1,67 @@
+{ lib, stdenv
+, fetchurl
+, pkg-config
+, glib
+, gobject-introspection
+, meson
+, ninja
+, python3
+  # just for passthru
+, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gsettings-desktop-schemas";
+  version = "40.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.major version}/${pname}-${version}.tar.xz";
+    sha256 = "11an29br55dp0b26kfqlrfxj19glfrmhcdpds2n1w9n04gq3pf7i";
+  };
+
+  strictDeps = true;
+  depsBuildBuild = [ pkg-config ];
+  nativeBuildInputs = [
+    glib
+    meson
+    ninja
+    pkg-config
+    python3
+    gobject-introspection
+  ];
+
+  mesonFlags = [
+    "-Dintrospection=${lib.boolToString (stdenv.buildPlatform == stdenv.hostPlatform)}"
+  ];
+
+  postPatch = ''
+    chmod +x build-aux/meson/post-install.py
+    patchShebangs build-aux/meson/post-install.py
+  '';
+
+  # meson installs the schemas to share/glib-2.0/schemas
+  # We add the override file there too so it will be compiled and later moved by
+  # glib's setup hook.
+  preInstall = ''
+    mkdir -p $out/share/glib-2.0/schemas
+    cat - > $out/share/glib-2.0/schemas/remove-backgrounds.gschema.override <<- EOF
+      [org.gnome.desktop.background]
+      picture-uri='''
+
+      [org.gnome.desktop.screensaver]
+      picture-uri='''
+    EOF
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+    };
+  };
+
+  meta = with lib; {
+    description = "Collection of GSettings schemas for settings shared by various components of a desktop";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gsettings-qt/default.nix b/nixpkgs/pkgs/development/libraries/gsettings-qt/default.nix
new file mode 100644
index 000000000000..21b63875db6c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsettings-qt/default.nix
@@ -0,0 +1,71 @@
+{ lib, stdenv, fetchFromGitLab, pkg-config
+, qmake, qtbase, qtdeclarative, wrapQtAppsHook
+, glib, gobject-introspection
+, genericUpdater, common-updater-scripts
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gsettings-qt";
+  version = "0.2";
+
+  src = fetchFromGitLab {
+    group = "ubports";
+    owner = "core";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "14l8xphw4jd9ckqba13cyxq0i362x8lfsd0zlfawwi2z1q1vqm92";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    qmake
+    gobject-introspection
+    wrapQtAppsHook
+  ];
+
+  buildInputs = [
+    glib
+    qtdeclarative
+  ];
+
+  patchPhase = ''
+    # force ordered build of subdirs
+    sed -i -e "\$aCONFIG += ordered" gsettings-qt.pro
+
+    # It seems that there is a bug in qtdeclarative: qmlplugindump fails
+    # because it can not find or load the Qt platform plugin "minimal".
+    # A workaround is to set QT_PLUGIN_PATH and QML2_IMPORT_PATH explicitly.
+    export QT_PLUGIN_PATH=${qtbase.bin}/${qtbase.qtPluginPrefix}
+    export QML2_IMPORT_PATH=${qtdeclarative.bin}/${qtbase.qtQmlPrefix}
+
+    substituteInPlace GSettings/gsettings-qt.pro \
+      --replace '$$[QT_INSTALL_QML]' "$out/$qtQmlPrefix" \
+      --replace '$$[QT_INSTALL_BINS]/qmlplugindump' "qmlplugindump"
+
+    substituteInPlace src/gsettings-qt.pro \
+      --replace '$$[QT_INSTALL_LIBS]' "$out/lib" \
+      --replace '$$[QT_INSTALL_HEADERS]' "$out/include"
+  '';
+
+  preInstall = ''
+    # do not install tests
+    for f in tests/Makefile{,.cpptest}; do
+      substituteInPlace $f \
+        --replace "install: install_target" "install: "
+    done
+  '';
+
+  passthru.updateScript = genericUpdater {
+    inherit pname version;
+    rev-prefix = "v";
+    versionLister = "${common-updater-scripts}/bin/list-git-tags ${src.meta.homepage}";
+  };
+
+  meta = with lib; {
+    description = "Library to access GSettings from Qt";
+    homepage = "https://gitlab.com/ubports/core/gsettings-qt";
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gsignond/conf.patch b/nixpkgs/pkgs/development/libraries/gsignond/conf.patch
new file mode 100644
index 000000000000..0aa2034e3996
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsignond/conf.patch
@@ -0,0 +1,12 @@
+diff --git a/meson.build b/meson.build
+index cb1e0df..d90c85c 100644
+--- a/meson.build
++++ b/meson.build
+@@ -95,6 +95,6 @@ endif
+ configure_file(
+     input: 'gsignond.conf.in',
+     configuration: conf_data,
+-    install_dir: sysconf_dir,
++    install_dir: 'etc/',
+     output: 'gsignond.conf'
+ )
diff --git a/nixpkgs/pkgs/development/libraries/gsignond/default.nix b/nixpkgs/pkgs/development/libraries/gsignond/default.nix
new file mode 100644
index 000000000000..912054eb85c3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsignond/default.nix
@@ -0,0 +1,67 @@
+{ lib, stdenv, fetchFromGitLab, pkg-config, meson, ninja, glib, glib-networking
+, sqlite, gobject-introspection, vala, gtk-doc, libsecret, docbook_xsl
+, docbook_xml_dtd_43, docbook_xml_dtd_45, glibcLocales, makeWrapper
+, symlinkJoin, gsignondPlugins, plugins }:
+
+let
+unwrapped = stdenv.mkDerivation rec {
+  pname = "gsignond";
+  version = "1.2.0";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchFromGitLab {
+    owner = "accounts-sso";
+    repo = pname;
+    rev = version;
+    sha256 = "17cpil3lpijgyj2z5c41vhb7fpk17038k5ggyw9p6049jrlf423m";
+  };
+
+  nativeBuildInputs = [
+    docbook_xml_dtd_43
+    docbook_xml_dtd_45
+    docbook_xsl
+    glibcLocales
+    gobject-introspection
+    gtk-doc
+    meson
+    ninja
+    pkg-config
+    vala
+  ];
+
+  buildInputs = [
+    glib
+    glib-networking
+    libsecret
+  ];
+
+  propagatedBuildInputs = [ sqlite ];
+
+  mesonFlags = [
+    "-Dbus_type=session"
+    "-Dextension=desktop"
+  ];
+
+  LC_ALL = "en_US.UTF-8";
+
+  patches = [
+    ./conf.patch
+    ./plugin-load-env.patch
+  ];
+
+  meta = with lib; {
+    description = "D-Bus service which performs user authentication on behalf of its clients";
+    homepage = "https://gitlab.com/accounts-sso/gsignond";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.linux;
+  };
+};
+
+in if plugins == [] then unwrapped
+    else import ./wrapper.nix {
+      inherit makeWrapper symlinkJoin plugins;
+      gsignond = unwrapped;
+    }
+
diff --git a/nixpkgs/pkgs/development/libraries/gsignond/plugin-load-env.patch b/nixpkgs/pkgs/development/libraries/gsignond/plugin-load-env.patch
new file mode 100644
index 000000000000..5da2b4c157e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsignond/plugin-load-env.patch
@@ -0,0 +1,35 @@
+diff --git a/src/gplugind/gsignond-plugin-loader.c b/src/gplugind/gsignond-plugin-loader.c
+index 5497b32..979e1b4 100644
+--- a/src/gplugind/gsignond-plugin-loader.c
++++ b/src/gplugind/gsignond-plugin-loader.c
+@@ -38,11 +38,10 @@ gsignond_load_plugin (
+     gchar *plugin_filename;
+     GSignondPlugin *plugin;
+ 
+-#   ifdef ENABLE_DEBUG
+     const gchar *env_val = g_getenv("SSO_GPLUGINS_DIR");
+     if (env_val)
+         plugin_path = env_val;
+-#   endif
++
+     plugin_filename = g_module_build_path (plugin_path, plugin_type);
+     plugin = gsignond_load_plugin_with_filename (plugin_type,
+                                                  plugin_filename);
+diff --git a/src/gplugind/main.c b/src/gplugind/main.c
+index 1c6cdb6..c85c623 100644
+--- a/src/gplugind/main.c
++++ b/src/gplugind/main.c
+@@ -93,11 +93,11 @@ _install_sighandlers (GMainLoop *main_loop)
+ static const gchar* _plugin_path(void)
+ {
+     const gchar *plugin_path = GSIGNOND_GPLUGINS_DIR;
+-#   ifdef ENABLE_DEBUG
++
+     const gchar *env_val = g_getenv("SSO_GPLUGINS_DIR");
+     if (env_val)
+         plugin_path = env_val;
+-#   endif
++
+     return plugin_path;
+ }
+ 
diff --git a/nixpkgs/pkgs/development/libraries/gsignond/plugins/lastfm.nix b/nixpkgs/pkgs/development/libraries/gsignond/plugins/lastfm.nix
new file mode 100644
index 000000000000..6141528a9fe6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsignond/plugins/lastfm.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitLab, pkg-config, meson, ninja, vala, glib, gsignond, json-glib, libsoup, gobject-introspection }:
+
+stdenv.mkDerivation {
+  pname = "gsignond-plugin-lastfm";
+  version = "2018-05-07";
+
+  src = fetchFromGitLab {
+    owner = "accounts-sso";
+    repo = "gsignond-plugin-lastfm";
+    rev = "0a7a5f8511282e45cfe35987b81f27f158f0648c";
+    sha256 = "0ay6ir9zg9l0264x5xwd7c6j8qmwlhrifkkkjd1yrjh9sqxyfj7f";
+  };
+
+  nativeBuildInputs = [
+    gobject-introspection
+    meson
+    ninja
+    pkg-config
+    vala
+  ];
+
+  buildInputs = [
+    glib
+    gsignond
+    json-glib
+    libsoup
+  ];
+
+  PKG_CONFIG_GSIGNOND_GPLUGINSDIR = "${placeholder "out"}/lib/gsignond/gplugins";
+
+  meta = with lib; {
+    description = "Plugin for the Accounts-SSO gSignOn daemon that handles Last.FM credentials";
+    homepage = "https://gitlab.com/accounts-sso/gsignond-plugin-lastfm";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gsignond/plugins/mail.nix b/nixpkgs/pkgs/development/libraries/gsignond/plugins/mail.nix
new file mode 100644
index 000000000000..977bc1489420
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsignond/plugins/mail.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitLab, pkg-config, meson, ninja, vala, glib, gsignond, gobject-introspection }:
+
+stdenv.mkDerivation rec {
+  pname = "gsignond-plugin-mail";
+  version = "0.3.0";
+
+  src = fetchFromGitLab {
+    owner = "accounts-sso";
+    repo = "gsignond-plugin-mail";
+    rev = version;
+    sha256 = "0x8jcl0ra9kacm80f1im5wpxp9r9wxayjwnk6dkv7fhjbl2p4nh0";
+  };
+
+  nativeBuildInputs = [
+    gobject-introspection
+    meson
+    ninja
+    pkg-config
+    vala
+  ];
+
+  buildInputs = [
+    glib
+    gsignond
+  ];
+
+  PKG_CONFIG_GSIGNOND_GPLUGINSDIR = "${placeholder "out"}/lib/gsignond/gplugins";
+
+  meta = with lib; {
+    description = "Plugin for the Accounts-SSO gSignOn daemon that handles E-Mail credentials";
+    homepage = "https://gitlab.com/accounts-sso/gsignond-plugin-mail";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gsignond/plugins/oauth.nix b/nixpkgs/pkgs/development/libraries/gsignond/plugins/oauth.nix
new file mode 100644
index 000000000000..bc496e8ac2cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsignond/plugins/oauth.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchFromGitLab, pkg-config, meson, ninja, glib, gsignond, check
+, json-glib, libsoup, gnutls, gtk-doc, docbook_xml_dtd_43, docbook_xml_dtd_45
+, docbook_xsl, glibcLocales, gobject-introspection }:
+
+stdenv.mkDerivation {
+  pname = "gsignond-plugin-oauth";
+  version = "2018-10-15";
+
+  src = fetchFromGitLab {
+    owner = "accounts-sso";
+    repo = "gsignond-plugin-oa";
+    rev = "d471cebfd7c50567b1244277a9559f18f8d58691";
+    sha256 = "00axl8wwp2arc6h4bpr4m3ik2hy8an0lbm48q2a9r94krmq56hnx";
+  };
+
+  nativeBuildInputs = [
+    check
+    docbook_xml_dtd_43
+    docbook_xml_dtd_45
+    docbook_xsl
+    glibcLocales
+    gobject-introspection
+    gtk-doc
+    meson
+    ninja
+    pkg-config
+  ];
+
+  buildInputs = [
+    glib
+    gnutls
+    gsignond
+    json-glib
+    libsoup
+  ];
+
+  LC_ALL = "en_US.UTF-8";
+
+  PKG_CONFIG_GSIGNOND_GPLUGINSDIR = "${placeholder "out"}/lib/gsignond/gplugins";
+
+  meta = with lib; {
+    description = "Plugin for the Accounts-SSO gSignOn daemon that handles the OAuth 1.0 and 2.0 authentication protocols";
+    homepage = "https://gitlab.com/accounts-sso/gsignond-plugin-oa";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gsignond/plugins/sasl.nix b/nixpkgs/pkgs/development/libraries/gsignond/plugins/sasl.nix
new file mode 100644
index 000000000000..bd87d4f72bb5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsignond/plugins/sasl.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchFromGitLab, pkg-config, meson, ninja, glib, gsignond, gsasl, check
+, gtk-doc, docbook_xml_dtd_43, docbook_xml_dtd_45, docbook_xsl, glibcLocales, gobject-introspection }:
+
+stdenv.mkDerivation {
+  pname = "gsignond-plugin-sasl";
+  version = "2018-10-15";
+
+  src = fetchFromGitLab {
+    owner = "accounts-sso";
+    repo = "gsignond-plugin-sasl";
+    rev = "b304c70b7dad9368b23b1205122d10de684c896a";
+    sha256 = "0knzw7c2fm2kzs1gxbrm4kk67522w9cpwqj7xvn86473068k90va";
+  };
+
+  nativeBuildInputs = [
+    check
+    docbook_xml_dtd_43
+    docbook_xml_dtd_45
+    docbook_xsl
+    glibcLocales
+    gobject-introspection
+    gtk-doc
+    meson
+    ninja
+    pkg-config
+  ];
+
+  buildInputs = [
+    glib
+    gsasl
+    gsignond
+  ];
+
+  LC_ALL = "en_US.UTF-8";
+
+  PKG_CONFIG_GSIGNOND_GPLUGINSDIR = "${placeholder "out"}/lib/gsignond/gplugins";
+
+  meta = with lib; {
+    description = "Plugin for the Accounts-SSO gSignOn daemon that handles the SASL authentication protocol";
+    homepage = "https://gitlab.com/accounts-sso/gsignond-plugin-sasl";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gsignond/wrapper.nix b/nixpkgs/pkgs/development/libraries/gsignond/wrapper.nix
new file mode 100644
index 000000000000..a4738e4b6a73
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsignond/wrapper.nix
@@ -0,0 +1,25 @@
+{ makeWrapper, symlinkJoin, gsignond, plugins }:
+
+symlinkJoin {
+  name = "gsignond-with-plugins-${gsignond.version}";
+
+  paths = [ gsignond ] ++ plugins;
+
+  buildInputs = [ makeWrapper ];
+
+  postBuild = ''
+    wrapProgram $out/bin/gsignond \
+      --set SSO_GPLUGINS_DIR "$out/lib/gsignond/gplugins"
+
+    rm $out/share/dbus-1/services/com.google.code.AccountsSSO.gSingleSignOn.service
+    rm $out/share/dbus-1/services/com.google.code.AccountsSSO.SingleSignOn.service
+
+    substitute ${gsignond}/share/dbus-1/services/com.google.code.AccountsSSO.gSingleSignOn.service $out/share/dbus-1/services/com.google.code.AccountsSSO.gSingleSignOn.service \
+      --replace ${gsignond} $out
+
+    substitute ${gsignond}/share/dbus-1/services/com.google.code.AccountsSSO.SingleSignOn.service $out/share/dbus-1/services/com.google.code.AccountsSSO.SingleSignOn.service \
+      --replace ${gsignond} $out
+  '';
+
+  inherit (gsignond) meta;
+}
diff --git a/nixpkgs/pkgs/development/libraries/gsl/default.nix b/nixpkgs/pkgs/development/libraries/gsl/default.nix
new file mode 100644
index 000000000000..dec2125974d7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsl/default.nix
@@ -0,0 +1,39 @@
+{ fetchurl, lib, stdenv }:
+
+stdenv.mkDerivation rec {
+  pname = "gsl";
+  version = "2.7";
+
+  src = fetchurl {
+    url = "mirror://gnu/gsl/${pname}-${version}.tar.gz";
+    sha256 = "sha256-77vzeF2g5TA4vnkHUAYotGYVLbw8FzqH3hteui4jYCs=";
+  };
+
+  preConfigure = if (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11" && stdenv.isDarwin) then ''
+    MACOSX_DEPLOYMENT_TARGET=10.16
+  '' else null;
+
+  # do not let -march=skylake to enable FMA (https://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html)
+  NIX_CFLAGS_COMPILE = 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";
+
+  meta = {
+    description = "The GNU Scientific Library, a large numerical library";
+    homepage = "https://www.gnu.org/software/gsl/";
+    license = lib.licenses.gpl3Plus;
+
+    longDescription = ''
+      The GNU Scientific Library (GSL) is a numerical library for C
+      and C++ programmers.  It is free software under the GNU General
+      Public License.
+
+      The library provides a wide range of mathematical routines such
+      as random number generators, special functions and least-squares
+      fitting.  There are over 1000 functions in total with an
+      extensive test suite.
+    '';
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gsl/gsl-1_16.nix b/nixpkgs/pkgs/development/libraries/gsl/gsl-1_16.nix
new file mode 100644
index 000000000000..d26651875756
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsl/gsl-1_16.nix
@@ -0,0 +1,43 @@
+{ fetchurl, fetchpatch, lib, stdenv }:
+
+stdenv.mkDerivation rec {
+  name = "gsl-1.16";
+
+  src = fetchurl {
+    url = "mirror://gnu/gsl/${name}.tar.gz";
+    sha256 = "0lrgipi0z6559jqh82yx8n4xgnxkhzj46v96dl77hahdp58jzg3k";
+  };
+
+  # do not let -march=skylake to enable FMA (https://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html)
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isx86_64 "-mno-fma";
+
+  patches = [
+    (fetchpatch {
+      name = "bug-39055.patch";
+      url = "https://git.savannah.gnu.org/cgit/gsl.git/patch/?id=9cc12d";
+      sha256 = "1bmrmihi28cly9g9pq54kkix2jy59y7cd7h5fw4v1c7h5rc2qvs8";
+    })
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "The GNU Scientific Library, a large numerical library";
+    homepage = "https://www.gnu.org/software/gsl/";
+    license = lib.licenses.gpl3Plus;
+
+    longDescription = ''
+      The GNU Scientific Library (GSL) is a numerical library for C
+      and C++ programmers.  It is free software under the GNU General
+      Public License.
+
+      The library provides a wide range of mathematical routines such
+      as random number generators, special functions and least-squares
+      fitting.  There are over 1000 functions in total with an
+      extensive test suite.
+    '';
+    platforms = lib.platforms.unix;
+    # Failing "eigen" tests on aarch64.
+    badPlatforms = [ "aarch64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gsm/default.nix b/nixpkgs/pkgs/development/libraries/gsm/default.nix
new file mode 100644
index 000000000000..f70a748a20e7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsm/default.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv, fetchurl
+, # Compile statically (support for packages that look for the static object)
+  staticSupport ? stdenv.hostPlatform.isStatic
+}:
+
+let
+  inherit (stdenv) isDarwin;
+  inherit (lib) optional optionalString;
+in
+
+stdenv.mkDerivation rec {
+  pname = "gsm";
+  version = "1.0.19";
+
+  src = fetchurl {
+    url = "http://www.quut.com/gsm/${pname}-${version}.tar.gz";
+    sha256 = "1xkha9ss5g5qnfaybi8il0mcvp8knwg9plgh8404vh58d0pna0s9";
+  };
+
+  patchPhase = ''
+    substituteInPlace Makefile \
+      --replace "= gcc " "?= gcc "
+    # Fix include directory
+    sed -e 's,$(GSM_INSTALL_ROOT)/inc,$(GSM_INSTALL_ROOT)/include/gsm,' -i Makefile
+  '' + optionalString (!staticSupport) (
+    (if isDarwin then  ''
+      # Build dylib on Darwin
+      sed -e 's,libgsm.a,libgsm.dylib,' -i Makefile
+      sed -e 's,$(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS),$(LD) -o $(LIBGSM) -dynamiclib -install_name $(GSM_INSTALL_ROOT)/$(LIBGSM) $(GSM_OBJECTS) -lc,' -i Makefile
+    '' else ''
+      # Build ELF shared object by default
+      sed -e 's,libgsm.a,libgsm.so,' -i Makefile
+      sed -e 's/$(AR) $(ARFLAGS) $(LIBGSM) $(GSM_OBJECTS)/$(LD) -shared -Wl,-soname,libgsm.so -o $(LIBGSM) $(GSM_OBJECTS) -lc/' -i Makefile
+    '') + ''
+      # Remove line that is unused when building shared libraries
+      sed -e 's,$(RANLIB) $(LIBGSM),,' -i Makefile
+    ''
+  );
+
+  makeFlags = [
+    "SHELL=${stdenv.shell}"
+    "INSTALL_ROOT=$(out)"
+  ] ++ optional stdenv.cc.isClang "CC=clang";
+
+  preInstall = "mkdir -p $out/{bin,lib,man/man1,man/man3,include/gsm}";
+
+  parallelBuild = false;
+
+  meta = with lib; {
+    description = "Lossy speech compression codec";
+    homepage    = "http://www.quut.com/gsm/";
+    license     = licenses.bsd2;
+    maintainers = with maintainers; [ codyopel raskin ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gsmlib/default.nix b/nixpkgs/pkgs/development/libraries/gsmlib/default.nix
new file mode 100644
index 000000000000..ec6646d98f57
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsmlib/default.nix
@@ -0,0 +1,19 @@
+{ lib, 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 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/gsoap/default.nix b/nixpkgs/pkgs/development/libraries/gsoap/default.nix
new file mode 100644
index 000000000000..08b8146ac0a8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsoap/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchurl, autoreconfHook, unzip, m4, bison, flex, openssl, zlib }:
+
+let
+  majorVersion = "2.8";
+
+in stdenv.mkDerivation rec {
+  pname = "gsoap";
+  version = "${majorVersion}.108";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/gsoap2/gsoap-${majorVersion}/gsoap_${version}.zip";
+    sha256 = "0x58bwlclk7frv03kg8bp0pm7zl784samvbzskrnr7dl5v866nvl";
+  };
+
+  buildInputs = [ openssl zlib ];
+  nativeBuildInputs = [ autoreconfHook bison flex m4 unzip ];
+  # Parallel building doesn't work as of 2.8.49
+  enableParallelBuilding = false;
+
+  # Future versions of automake require subdir-objects if the source is structured this way
+  # As of 2.8.49 (maybe earlier) this is needed to silence warnings
+  prePatch = ''
+    substituteInPlace configure.ac \
+      --replace 'AM_INIT_AUTOMAKE([foreign])' 'AM_INIT_AUTOMAKE([foreign subdir-objects])'
+  '';
+
+  meta = with lib; {
+    description = "C/C++ toolkit for SOAP web services and XML-based applications";
+    homepage = "http://www.cs.fsu.edu/~engelen/soap.html";
+    # gsoap is dual/triple licensed (see homepage for details):
+    # 1. gSOAP Public License 1.3 (based on Mozilla Public License 1.1).
+    #    Components NOT covered by the gSOAP Public License are:
+    #     - wsdl2h tool and its source code output,
+    #     - soapcpp2 tool and its source code output,
+    #     - UDDI code,
+    #     - the webserver example code in gsoap/samples/webserver,
+    #     - and several example applications in the gsoap/samples directory.
+    # 2. GPLv2 covers all of the software
+    # 3. Proprietary commercial software development license (removes GPL
+    #    restrictions)
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gsound/default.nix b/nixpkgs/pkgs/development/libraries/gsound/default.nix
new file mode 100644
index 000000000000..bcd39ce22733
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gsound/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, pkg-config, glib, vala, libcanberra, gobject-introspection, libtool, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "gsound";
+  version = "1.0.2";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "bba8ff30eea815037e53bee727bbd5f0b6a2e74d452a7711b819a7c444e78e53";
+  };
+
+  nativeBuildInputs = [ pkg-config gobject-introspection libtool vala ];
+  buildInputs = [ glib libcanberra ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Projects/GSound";
+    description = "Small library for playing system sounds";
+    maintainers = teams.gnome.members;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gspell/0001-Darwin-build-fix.patch b/nixpkgs/pkgs/development/libraries/gspell/0001-Darwin-build-fix.patch
new file mode 100644
index 000000000000..b2e71fe3aed1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gspell/0001-Darwin-build-fix.patch
@@ -0,0 +1,37 @@
+From 2d6dd1c286eb57fbf968510318cafc94888b98de Mon Sep 17 00:00:00 2001
+From: OPNA2608 <christoph.neidahl@gmail.com>
+Date: Sun, 13 Jun 2021 21:56:03 +0200
+Subject: [PATCH] Darwin build fix
+
+---
+ gspell/Makefile.am | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/gspell/Makefile.am b/gspell/Makefile.am
+index 69ee421..7c58973 100644
+--- a/gspell/Makefile.am
++++ b/gspell/Makefile.am
+@@ -95,6 +95,7 @@ nodist_libgspell_core_la_SOURCES = \
+ 	$(BUILT_SOURCES)
+ 
+ libgspell_core_la_LIBADD =	\
++	$(GTK_MAC_LIBS)           \
+ 	$(CODE_COVERAGE_LIBS)
+ 
+ libgspell_core_la_CFLAGS =			\
+@@ -161,6 +162,12 @@ gspell_private_headers += \
+ gspell_private_c_files += \
+ 	gspell-osx.c
+ 
++libgspell_core_la_CFLAGS += \
++	-xobjective-c
++
++libgspell_core_la_LDFLAGS += \
++	-framework Cocoa
++
+ endif # OS_OSX
+ 
+ if HAVE_INTROSPECTION
+-- 
+2.29.3
+
diff --git a/nixpkgs/pkgs/development/libraries/gspell/default.nix b/nixpkgs/pkgs/development/libraries/gspell/default.nix
new file mode 100644
index 000000000000..be45a48090ff
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gspell/default.nix
@@ -0,0 +1,70 @@
+{ lib, stdenv
+, fetchurl
+, pkg-config
+, libxml2
+, autoreconfHook
+, gtk-doc
+, glib
+, gtk3
+, enchant2
+, icu
+, vala
+, gobject-introspection
+, gnome
+, gtk-mac-integration
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gspell";
+  version = "1.9.1";
+
+  outputs = [ "out" "dev" ];
+  outputBin = "dev";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1pdb4gbjrs8mk6r0ipw5vxyvzav1wvkjq46kiq53r3nyznfpdfyw";
+  };
+
+  patches = [
+    # Extracted from: https://github.com/Homebrew/homebrew-core/blob/2a27fb86b08afc7ae6dff79cf64aafb8ecc93275/Formula/gspell.rb#L125-L149
+    ./0001-Darwin-build-fix.patch
+  ];
+
+  nativeBuildInputs = [
+    pkg-config
+    vala
+    gobject-introspection
+    libxml2
+    autoreconfHook
+    gtk-doc
+  ];
+
+  buildInputs = [
+    glib
+    gtk3
+    icu
+  ] ++ lib.optionals stdenv.hostPlatform.isDarwin [
+    gtk-mac-integration
+  ];
+
+  propagatedBuildInputs = [
+    # required for pkg-config
+    enchant2
+  ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    description = "A spell-checking library for GTK applications";
+    homepage = "https://wiki.gnome.org/Projects/gspell";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gss/default.nix b/nixpkgs/pkgs/development/libraries/gss/default.nix
new file mode 100644
index 000000000000..ec4e54c339b0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gss/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl
+, withShishi ? !stdenv.isDarwin, shishi ? null
+}:
+
+assert withShishi -> shishi != null;
+
+stdenv.mkDerivation rec {
+  name = "gss-1.0.3";
+
+  src = fetchurl {
+    url = "mirror://gnu/gss/${name}.tar.gz";
+    sha256 = "1syyvh3k659xf1hdv9pilnnhbbhs6vfapayp4xgdcc8mfgf9v4gz";
+  };
+
+  buildInputs = lib.optional withShishi shishi;
+
+  configureFlags = [
+    "--${if withShishi != null then "enable" else "disable"}-kereberos5"
+  ];
+
+  doCheck = true;
+
+  # Fixup .la files
+  postInstall = lib.optionalString withShishi ''
+    sed -i 's,\(-lshishi\),-L${shishi}/lib \1,' $out/lib/libgss.la
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.gnu.org/software/gss/";
+    description = "Generic Security Service";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ bjg ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gssdp/default.nix b/nixpkgs/pkgs/development/libraries/gssdp/default.nix
new file mode 100644
index 000000000000..6a76c07fec7b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gssdp/default.nix
@@ -0,0 +1,66 @@
+{ lib, stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, gobject-introspection
+, vala
+, gtk-doc
+, docbook_xsl
+, docbook_xml_dtd_412
+, libsoup
+, gtk3
+, glib
+, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gssdp";
+  version = "1.2.3";
+
+  outputs = [ "out" "bin" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gssdp/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1s57i8a8wnnxnsfl27cq4503dkdlzbrhry5zpg23sfqfffvdqqx2";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gobject-introspection
+    vala
+    gtk-doc
+    docbook_xsl
+    docbook_xml_dtd_412
+  ];
+
+  buildInputs = [
+    libsoup
+    gtk3
+  ];
+
+  propagatedBuildInputs = [
+    glib
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=true"
+  ];
+
+  doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+    };
+  };
+
+  meta = with lib; {
+    description = "GObject-based API for handling resource discovery and announcement over SSDP";
+    homepage = "http://www.gupnp.org/";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix
new file mode 100644
index 000000000000..5723323defd6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix
@@ -0,0 +1,326 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchpatch
+, meson
+, ninja
+, gettext
+, pkg-config
+, python3
+, gst-plugins-base
+, orc
+, gobject-introspection
+, enableZbar ? false
+, faacSupport ? false
+, faac
+, faad2
+, libass
+, libkate
+, libmms
+, lrdf
+, ladspaH
+, libnice
+, webrtc-audio-processing
+, lilv
+, lv2
+, serd
+, sord
+, sratom
+, libbs2b
+, libmodplug
+, mpeg2dec
+, libmicrodns
+, openjpeg
+, libopus
+, librsvg
+, bluez
+, chromaprint
+, curl
+, directfb
+, fdk_aac
+, flite
+, gsm
+, libaom
+, libdc1394
+, libde265
+, libdrm
+, libdvdnav
+, libdvdread
+, libgudev
+, libofa
+, libsndfile
+, libusb1
+, neon
+, openal
+, opencv4
+, openexr
+, openh264
+, pango
+, rtmpdump
+, sbc
+, soundtouch
+, spandsp
+, srtp
+, zbar
+, wayland-protocols
+, wildmidi
+, fluidsynth
+, libva
+, libvdpau
+, wayland
+, libwebp
+, xvidcore
+, gnutls
+, mjpegtools
+, libGLU
+, libGL
+, libintl
+, libgme
+, openssl
+, x265
+, libxml2
+, srt
+, vo-aacenc
+, VideoToolbox
+, AudioToolbox
+, AVFoundation
+, CoreMedia
+, CoreVideo
+, Foundation
+, MediaToolbox
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gst-plugins-bad";
+  version = "1.18.2";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "06ildd4rl6cynirv3p00d2ddf5is9svj4i7mkahldzhq24pq5mca";
+  };
+
+  patches = [
+    # Use pkgconfig to inject the includedirs
+    ./fix_pkgconfig_includedir.patch
+  ] ++ lib.optionals stdenv.isDarwin [
+    # Fix “error: cannot initialize a parameter of type 'unsigned long *' with an rvalue of type 'typename std::remove_reference<decltype(*(&opencv_dilate_erode_type))>::type *' (aka 'volatile unsigned long *')” on Darwin.
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/commit/640a65bf966df065d41a511e2d76d1f26a2e770c.patch";
+      sha256 = "E5pig+qEfR58Jticr6ydFxZOhM3ZJ8zgrf5K4BdiB/Y=";
+      includes = [
+        "ext/opencv/gstcvdilateerode.cpp"
+      ];
+    })
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    orc # for orcc
+    python3
+    gettext
+    gobject-introspection
+  ] ++ lib.optionals stdenv.isLinux [
+    wayland # for wayland-scanner
+  ];
+
+  buildInputs = [
+    gst-plugins-base
+    orc
+    # gobject-introspection has to be in both nativeBuildInputs and
+    # buildInputs. The build tries to link against libgirepository-1.0.so
+    gobject-introspection
+    faad2
+    libass
+    libkate
+    libmms
+    webrtc-audio-processing # webrtc
+    libbs2b
+    libmodplug
+    mpeg2dec
+    libmicrodns
+    openjpeg
+    libopus
+    librsvg
+    curl.dev
+    fdk_aac
+    gsm
+    libaom
+    libdc1394
+    libde265
+    libdvdnav
+    libdvdread
+    libsndfile
+    libusb1
+    mjpegtools
+    neon
+    openal
+    opencv4
+    openexr
+    openh264
+    rtmpdump
+    pango
+    soundtouch
+    srtp
+    fluidsynth
+    libvdpau
+    libwebp
+    xvidcore
+    gnutls
+    libGL
+    libGLU
+    libgme
+    openssl
+    x265
+    libxml2
+    libintl
+    srt
+    vo-aacenc
+  ] ++ lib.optionals enableZbar [
+    zbar
+  ] ++ lib.optionals faacSupport [
+    faac
+  ] ++ lib.optionals stdenv.isLinux [
+    bluez
+    libva # vaapi requires libva -> libdrm -> libpciaccess, which is Linux-only in nixpkgs
+    wayland
+    wayland-protocols
+  ] ++ lib.optionals (!stdenv.isDarwin) [
+    # wildmidi requires apple's OpenAL
+    # TODO: package apple's OpenAL, fix wildmidi, include on Darwin
+    wildmidi
+    # TODO: mjpegtools uint64_t is not compatible with guint64 on Darwin
+    mjpegtools
+
+    chromaprint
+    directfb
+    flite
+    libdrm
+    libgudev
+    libnice
+    libofa
+    sbc
+    spandsp
+
+    # ladspa plug-in
+    ladspaH
+    lrdf # TODO: make build on Darwin
+
+    # lv2 plug-in
+    lilv
+    lv2
+    serd
+    sord
+    sratom
+  ] ++ lib.optionals stdenv.isDarwin [
+    # 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
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+
+    "-Davtp=disabled"
+    "-Ddts=disabled" # required `libdca` library not packaged in nixpkgs as of writing, and marked as "BIG FAT WARNING: libdca is still in early development"
+    "-Dzbar=${if enableZbar then "enabled" else "disabled"}"
+    "-Dfaac=${if faacSupport then "enabled" else "disabled"}"
+    "-Diqa=disabled" # required `dssim` library not packaging in nixpkgs as of writing
+    "-Dmagicleap=disabled" # required `ml_audio` library not packaged in nixpkgs as of writing
+    "-Dmsdk=disabled" # not packaged in nixpkgs as of writing / no Windows support
+    # As of writing, with `libmpcdec` in `buildInputs` we get
+    #   "Could not find libmpcdec header files, but Musepack was enabled via options"
+    # This is likely because nixpkgs has the header in libmpc/mpcdec.h
+    # instead of mpc/mpcdec.h, like Arch does. The situation is not trivial.
+    # There are apparently 2 things called `libmpcdec` from the same author:
+    #   * http://svn.musepack.net/libmpcdec/trunk/src/
+    #   * http://svn.musepack.net/libmpc/trunk/include/mpc/
+    # Fixing it likely requires to first figure out with upstream which one
+    # is needed, and then patching upstream to find it (though it probably
+    # already works on Arch?).
+    "-Dmusepack=disabled"
+    "-Dopenmpt=disabled" # `libopenmpt` not packaged in nixpkgs as of writing
+    "-Dopenni2=disabled" # not packaged in nixpkgs as of writing
+    "-Dopensles=disabled" # not packaged in nixpkgs as of writing
+    "-Dsctp=disabled" # required `usrsctp` library not packaged in nixpkgs as of writing
+    "-Dsvthevcenc=disabled" # required `SvtHevcEnc` library not packaged in nixpkgs as of writing
+    "-Dteletext=disabled" # required `zvbi` library not packaged in nixpkgs as of writing
+    "-Dtinyalsa=disabled" # not packaged in nixpkgs as of writing
+    "-Dvoamrwbenc=disabled" # required `vo-amrwbenc` library not packaged in nixpkgs as of writing
+    "-Dvulkan=disabled" # Linux-only, and we haven't figured out yet which of the vulkan nixpkgs it needs
+    "-Dwasapi=disabled" # not packaged in nixpkgs as of writing / no Windows support
+    "-Dwasapi2=disabled" # not packaged in nixpkgs as of writing / no Windows support
+    "-Dwpe=disabled" # required `wpe-webkit` library not packaged in nixpkgs as of writing
+    "-Dzxing=disabled" # required `zxing-cpp` library not packaged in nixpkgs as of writing
+  ]
+  ++ lib.optionals (!stdenv.isLinux) [
+    "-Dva=disabled" # see comment on `libva` in `buildInputs`
+  ]
+  ++ lib.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
+    "-Dv4l2codecs=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
+  ] ++ lib.optionals (!gst-plugins-base.glEnabled) [
+    "-Dgl=disabled"
+  ] ++ lib.optionals (!gst-plugins-base.waylandEnabled) [
+    "-Dwayland=disabled"
+  ] ++ lib.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"
+  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+    "-Dintrospection=disabled"
+  ];
+
+  # Argument list too long
+  strictDeps = true;
+
+  postPatch = ''
+    patchShebangs \
+      scripts/extract-release-date-from-doap-file.py
+  '';
+
+  # 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 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/bad/fix_pkgconfig_includedir.patch b/nixpkgs/pkgs/development/libraries/gstreamer/bad/fix_pkgconfig_includedir.patch
new file mode 100644
index 000000000000..c687fffc9c08
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/bad/fix_pkgconfig_includedir.patch
@@ -0,0 +1,15 @@
+diff --git a/pkgconfig/meson.build b/pkgconfig/meson.build
+index 271f327f3..7e2afa754 100644
+--- a/pkgconfig/meson.build
++++ b/pkgconfig/meson.build
+@@ -2,8 +2,8 @@ pkgconf = configuration_data()
+ 
+ pkgconf.set('prefix', join_paths(get_option('prefix')))
+ pkgconf.set('exec_prefix', '${prefix}')
+-pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
+-pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
++pkgconf.set('libdir', join_paths(get_option('prefix'), get_option('libdir')))
++pkgconf.set('includedir', join_paths(get_option('prefix'), get_option('includedir')))
+ pkgconf.set('GST_API_VERSION', api_version)
+ pkgconf.set('VERSION', gst_version)
+ 
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix
new file mode 100644
index 000000000000..3e00050ada2f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix
@@ -0,0 +1,156 @@
+{ stdenv
+, fetchurl
+, lib
+, pkg-config
+, meson
+, ninja
+, gettext
+, gobject-introspection
+, python3
+, gstreamer
+, orc
+, pango
+, libtheora
+, libintl
+, libopus
+, isocodes
+, libjpeg
+, libpng
+, libvisual
+, tremor # provides 'virbisidec'
+, libGL
+, enableX11 ? stdenv.isLinux
+, libXv
+, libXext
+, enableWayland ? stdenv.isLinux
+, wayland
+, wayland-protocols
+, enableAlsa ? stdenv.isLinux
+, alsa-lib
+# 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
+, Cocoa
+, OpenGL
+, enableGl ? (enableX11 || enableWayland || enableCocoa)
+, enableCdparanoia ? (!stdenv.isDarwin)
+, cdparanoia
+, glib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gst-plugins-base";
+  version = "1.18.4";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "08w3ivbc6n4vdds2ap6q7l8zdk9if8417nznyqidf0adm0lk5r99";
+  };
+
+  patches = [
+    ./fix_pkgconfig_includedir.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    python3
+    gettext
+    orc
+    glib
+    gobject-introspection
+
+    # docs
+    # TODO add hotdoc here
+  ] ++ lib.optional enableWayland wayland;
+
+  buildInputs = [
+    orc
+    libtheora
+    libintl
+    libopus
+    isocodes
+    libpng
+    libjpeg
+    tremor
+    libGL
+  ] ++ lib.optional (!stdenv.isDarwin) [
+    libvisual
+  ] ++ lib.optionals stdenv.isDarwin [
+    pango
+    OpenGL
+  ] ++ lib.optionals enableAlsa [
+    alsa-lib
+  ] ++ lib.optionals enableX11 [
+    libXext
+    libXv
+    pango
+  ] ++ lib.optionals enableWayland [
+    wayland
+    wayland-protocols
+  ] ++ lib.optional enableCocoa Cocoa
+    ++ lib.optional enableCdparanoia cdparanoia;
+
+  propagatedBuildInputs = [
+    gstreamer
+  ];
+
+  mesonFlags = [
+    "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+    "-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")}"
+  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+    "-Dintrospection=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"
+  ++ lib.optionals stdenv.isDarwin [
+    "-Dlibvisual=disabled"
+  ];
+
+  postPatch = ''
+    patchShebangs \
+      common/scangobj-merge.py \
+      scripts/extract-release-date-from-doap-file.py
+  '';
+
+  # 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
+
+  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/base/fix_pkgconfig_includedir.patch b/nixpkgs/pkgs/development/libraries/gstreamer/base/fix_pkgconfig_includedir.patch
new file mode 100644
index 000000000000..04486a4647f9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/base/fix_pkgconfig_includedir.patch
@@ -0,0 +1,15 @@
+diff --git a/pkgconfig/meson.build b/pkgconfig/meson.build
+index 04abfbee5..88c86b431 100644
+--- a/pkgconfig/meson.build
++++ b/pkgconfig/meson.build
+@@ -2,8 +2,8 @@ pkgconf = configuration_data()
+ 
+ pkgconf.set('prefix', get_option('prefix'))
+ pkgconf.set('exec_prefix', '${prefix}')
+-pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
+-pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
++pkgconf.set('libdir', join_paths(get_option('prefix'), get_option('libdir')))
++pkgconf.set('includedir', join_paths(get_option('prefix'), get_option('includedir')))
+ pkgconf.set('GST_API_VERSION', api_version)
+ pkgconf.set('VERSION', gst_version)
+ pkgconf.set('LIBM', libm.found() ? '-lm' : '')
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix
new file mode 100644
index 000000000000..9cc1675de3ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix
@@ -0,0 +1,116 @@
+{ stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, gettext
+, gobject-introspection
+, bison
+, flex
+, python3
+, glib
+, makeWrapper
+, libcap
+, libunwind
+, darwin
+, elfutils # for libdw
+, bash-completion
+, lib
+, CoreServices
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gstreamer";
+  version = "1.18.4";
+
+  outputs = [
+    "out"
+    "dev"
+    # "devdoc" # disabled until `hotdoc` is packaged in nixpkgs, see:
+    # - https://github.com/NixOS/nixpkgs/pull/98767
+    # - https://github.com/NixOS/nixpkgs/issues/98769#issuecomment-702296551
+  ];
+  outputBin = "dev";
+
+  src = fetchurl {
+    url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "1igv9l4hm21kp1jmlwlagzs7ly1vaxv1sbda29q8247372dwkvls";
+  };
+
+  patches = [
+    ./fix_pkgconfig_includedir.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gettext
+    bison
+    flex
+    python3
+    makeWrapper
+    glib
+    gobject-introspection
+    bash-completion
+
+    # documentation
+    # TODO add hotdoc here
+  ];
+
+  buildInputs = [
+    bash-completion
+  ] ++ lib.optionals stdenv.isLinux [
+    libcap
+    libunwind
+    elfutils
+  ] ++ lib.optionals stdenv.isDarwin [
+    CoreServices
+  ];
+
+  propagatedBuildInputs = [
+    glib
+  ];
+
+  mesonFlags = [
+    "-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
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+    "-Dintrospection=disabled"
+  ] ++ lib.optionals stdenv.isDarwin [
+    # darwin.libunwind doesn't have pkg-config definitions so meson doesn't detect it.
+    "-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 \
+      scripts/extract-release-date-from-doap-file.py
+  '';
+
+  postInstall = ''
+    for prog in "$dev/bin/"*; do
+        # We can't use --suffix here due to quoting so we craft the export command by hand
+        wrapProgram "$prog" --run 'export GST_PLUGIN_SYSTEM_PATH_1_0=$GST_PLUGIN_SYSTEM_PATH_1_0''${GST_PLUGIN_SYSTEM_PATH_1_0:+:}$(unset _tmp; for profile in $NIX_PROFILES; do _tmp="$profile/lib/gstreamer-1.0''${_tmp:+:}$_tmp"; done; printf '%s' "$_tmp")'
+    done
+  '';
+
+  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/fix_pkgconfig_includedir.patch b/nixpkgs/pkgs/development/libraries/gstreamer/core/fix_pkgconfig_includedir.patch
new file mode 100644
index 000000000000..db1684269350
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/core/fix_pkgconfig_includedir.patch
@@ -0,0 +1,17 @@
+diff --git a/pkgconfig/meson.build b/pkgconfig/meson.build
+index edb0586c2..7ed46dfce 100644
+--- a/pkgconfig/meson.build
++++ b/pkgconfig/meson.build
+@@ -2,8 +2,8 @@ pkgconf = configuration_data()
+ 
+ pkgconf.set('prefix', join_paths(get_option('prefix')))
+ pkgconf.set('exec_prefix', '${prefix}')
+-pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
+-pkgconf.set('libexecdir', '${prefix}/@0@'.format(get_option('libexecdir')))
+-pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
++pkgconf.set('libdir', join_paths(get_option('prefix'), get_option('libdir')))
++pkgconf.set('libexecdir', join_paths(get_option('prefix'), get_option('libexecdir')))
++pkgconf.set('includedir', join_paths(get_option('prefix'), get_option('includedir')))
+ pkgconf.set('GST_API_VERSION', apiversion)
+ pkgconf.set('VERSION', gst_version)
+ pkgconf.set('LIBM', mathlib.found() ? '-lm' : '')
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/core/setup-hook.sh b/nixpkgs/pkgs/development/libraries/gstreamer/core/setup-hook.sh
new file mode 100644
index 000000000000..026a4e5f55a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/core/setup-hook.sh
@@ -0,0 +1,9 @@
+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"
+    fi
+}
+
+addEnvHooks "$hostOffset" addGstreamer1LibPath
+
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/default.nix
new file mode 100644
index 000000000000..d1c7233f0d48
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/default.nix
@@ -0,0 +1,27 @@
+{ callPackage, AudioToolbox, AVFoundation, Cocoa, CoreFoundation, CoreMedia, CoreServices, CoreVideo, DiskArbitration, Foundation, IOKit, MediaToolbox, OpenGL, VideoToolbox }:
+
+{
+  gstreamer = callPackage ./core { inherit CoreServices; };
+
+  gstreamermm = callPackage ./gstreamermm { };
+
+  gst-plugins-base = callPackage ./base { inherit Cocoa OpenGL; };
+
+  gst-plugins-good = callPackage ./good { inherit Cocoa; };
+
+  gst-plugins-bad = callPackage ./bad { inherit AudioToolbox AVFoundation CoreMedia CoreVideo Foundation MediaToolbox VideoToolbox; };
+
+  gst-plugins-ugly = callPackage ./ugly { inherit CoreFoundation DiskArbitration IOKit; };
+
+  gst-rtsp-server = callPackage ./rtsp-server { };
+
+  gst-libav = callPackage ./libav { };
+
+  gst-devtools = callPackage ./devtools { };
+
+  gst-editing-services = callPackage ./ges { };
+
+  gst-vaapi = callPackage ./vaapi { };
+
+  # note: gst-python is in ./python/default.nix - called under pythonPackages
+}
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/devtools/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/devtools/default.nix
new file mode 100644
index 000000000000..12cb6dac6f31
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/devtools/default.nix
@@ -0,0 +1,64 @@
+{ lib, stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, gstreamer
+, gst-plugins-base
+, python3
+, gobject-introspection
+, json-glib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gst-devtools";
+  version = "1.18.4";
+
+  src = fetchurl {
+    url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "1kvcabcfzm7wqih3lzgrg9xjbn4xpx43d1m2zkkvab4i8161kggz";
+  };
+
+  patches = [
+    ./fix_pkgconfig_includedir.patch
+  ];
+
+  outputs = [
+    "out"
+    "dev"
+    # "devdoc" # disabled until `hotdoc` is packaged in nixpkgs
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gobject-introspection
+
+    # documentation
+    # TODO add hotdoc here
+  ];
+
+  buildInputs = [
+    python3
+    json-glib
+  ];
+
+  propagatedBuildInputs = [
+    gstreamer
+    gst-plugins-base
+  ];
+
+  mesonFlags = [
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+    "-Dintrospection=disabled"
+  ];
+
+  meta = with 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/gstreamer/devtools/fix_pkgconfig_includedir.patch b/nixpkgs/pkgs/development/libraries/gstreamer/devtools/fix_pkgconfig_includedir.patch
new file mode 100644
index 000000000000..ff19c7cbf6f8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/devtools/fix_pkgconfig_includedir.patch
@@ -0,0 +1,15 @@
+diff --git a/validate/pkgconfig/meson.build b/validate/pkgconfig/meson.build
+index a612b21b..c017eaff 100644
+--- a/validate/pkgconfig/meson.build
++++ b/validate/pkgconfig/meson.build
+@@ -2,8 +2,8 @@ pkgconf = configuration_data()
+
+ pkgconf.set('prefix', get_option('prefix'))
+ pkgconf.set('exec_prefix', '${prefix}')
+-pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
+-pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
++pkgconf.set('libdir', join_paths(get_option('prefix'), get_option('libdir')))
++pkgconf.set('includedir', join_paths(get_option('prefix'), get_option('includedir')))
+ pkgconf.set('GST_API_VERSION', apiversion)
+ pkgconf.set('VERSION', gst_version)
+
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix
new file mode 100644
index 000000000000..840b0f252857
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix
@@ -0,0 +1,77 @@
+{ lib, stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, python3
+, bash-completion
+, gst-plugins-base
+, gst-plugins-bad
+, gst-devtools
+, libxml2
+, flex
+, gettext
+, gobject-introspection
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gst-editing-services";
+  version = "1.18.4";
+
+  outputs = [
+    "out"
+    "dev"
+    # "devdoc" # disabled until `hotdoc` is packaged in nixpkgs
+  ];
+
+  src = fetchurl {
+    url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "010xg960qsh5dwmf0y9l1q13h0cymmrgapzla2zsw66ylxqbi1s6";
+  };
+
+  patches = [
+    ./fix_pkgconfig_includedir.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gettext
+    gobject-introspection
+    gst-devtools
+    python3
+    flex
+
+    # documentation
+    # TODO add hotdoc here
+  ];
+
+  buildInputs = [
+    bash-completion
+    libxml2
+  ];
+
+  propagatedBuildInputs = [
+    gst-plugins-base
+    gst-plugins-bad
+  ];
+
+  mesonFlags = [
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+    "-Dintrospection=disabled"
+  ];
+
+  postPatch = ''
+    patchShebangs \
+      scripts/extract-release-date-from-doap-file.py
+  '';
+
+  meta = with 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/ges/fix_pkgconfig_includedir.patch b/nixpkgs/pkgs/development/libraries/gstreamer/ges/fix_pkgconfig_includedir.patch
new file mode 100644
index 000000000000..1e12f3bbfbea
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/ges/fix_pkgconfig_includedir.patch
@@ -0,0 +1,15 @@
+diff --git a/pkgconfig/meson.build b/pkgconfig/meson.build
+index a612b21b..c017eaff 100644
+--- a/pkgconfig/meson.build
++++ b/pkgconfig/meson.build
+@@ -2,8 +2,8 @@ pkgconf = configuration_data()
+ 
+ pkgconf.set('prefix', get_option('prefix'))
+ pkgconf.set('exec_prefix', '${prefix}')
+-pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
+-pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
++pkgconf.set('libdir', join_paths(get_option('prefix'), get_option('libdir')))
++pkgconf.set('includedir', join_paths(get_option('prefix'), get_option('includedir')))
+ pkgconf.set('GST_API_VERSION', apiversion)
+ pkgconf.set('VERSION', gst_version)
+ 
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix
new file mode 100644
index 000000000000..86684893efd3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix
@@ -0,0 +1,170 @@
+{ lib, stdenv
+, fetchurl
+, meson
+, nasm
+, ninja
+, pkg-config
+, python3
+, gst-plugins-base
+, orc
+, bzip2
+, gettext
+, libv4l
+, libdv
+, libavc1394
+, libiec61883
+, libvpx
+, speex
+, flac
+, taglib
+, libshout
+, cairo
+, gdk-pixbuf
+, aalib
+, libcaca
+, libsoup
+, libpulseaudio
+, libintl
+, Cocoa
+, lame
+, mpg123
+, twolame
+, gtkSupport ? false, gtk3
+, qt5Support ? false, qt5
+, raspiCameraSupport ? false, libraspberrypi
+, enableJack ? true, libjack2
+, libXdamage
+, libXext
+, libXfixes
+, ncurses
+, wayland
+, wayland-protocols
+, xorg
+, libgudev
+, wavpack
+}:
+
+assert raspiCameraSupport -> (stdenv.isLinux && stdenv.isAarch64);
+
+stdenv.mkDerivation rec {
+  pname = "gst-plugins-good";
+  version = "1.18.4";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "1c1rpq709cy8maaykyn1n0kckj9c6fl3mhvixkk6xmdwkcx0xrdn";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    python3
+    meson
+    ninja
+    gettext
+    nasm
+  ] ++ lib.optionals stdenv.isLinux [
+    wayland-protocols
+  ];
+
+  buildInputs = [
+    gst-plugins-base
+    orc
+    bzip2
+    libdv
+    libvpx
+    speex
+    flac
+    taglib
+    cairo
+    gdk-pixbuf
+    aalib
+    libcaca
+    libsoup
+    libshout
+    lame
+    mpg123
+    twolame
+    libintl
+    libXdamage
+    libXext
+    libXfixes
+    ncurses
+    xorg.libXfixes
+    xorg.libXdamage
+    wavpack
+  ] ++ lib.optionals raspiCameraSupport [
+    libraspberrypi
+  ] ++ lib.optionals gtkSupport [
+    # for gtksink
+    gtk3
+  ] ++ lib.optionals qt5Support (with qt5; [
+    qtbase
+    qtdeclarative
+    qtwayland
+    qtx11extras
+  ]) ++ lib.optionals stdenv.isDarwin [
+    Cocoa
+  ] ++ lib.optionals stdenv.isLinux [
+    libv4l
+    libpulseaudio
+    libavc1394
+    libiec61883
+    libgudev
+    wayland
+  ] ++ lib.optionals enableJack [
+    libjack2
+  ];
+
+  mesonFlags = [
+    "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+  ] ++ lib.optionals (!qt5Support) [
+    "-Dqt5=disabled"
+  ] ++ lib.optionals (!gtkSupport) [
+    "-Dgtk3=disabled"
+  ] ++ lib.optionals (!enableJack) [
+    "-Djack=disabled"
+  ] ++ lib.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
+  ] ++ lib.optionals (!raspiCameraSupport) [
+    "-Drpicamsrc=disabled"
+  ];
+
+  postPatch = ''
+    patchShebangs \
+      scripts/extract-release-date-from-doap-file.py
+  '';
+
+  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;
+
+  # must be explicitely set since 5590e365
+  dontWrapQtApps = true;
+
+  meta = with 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/gstreamermm/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/gstreamermm/default.nix
new file mode 100644
index 000000000000..7123aa0d3ac1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/gstreamermm/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, pkg-config, file, glibmm, gst_all_1, gnome }:
+stdenv.mkDerivation rec {
+  pname = "gstreamermm";
+  version = "1.10.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0q4dx9sncqbwgpzma0zvj6zssc279yl80pn8irb95qypyyggwn5y";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ pkg-config file ];
+
+  propagatedBuildInputs = [ glibmm gst_all_1.gst-plugins-base ];
+
+  enableParallelBuilding = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = "gst_all_1.gstreamermm";
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "C++ interface for GStreamer";
+    homepage = "https://gstreamer.freedesktop.org/bindings/cplusplus.html";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ romildo ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix
new file mode 100644
index 000000000000..009a1555f770
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix
@@ -0,0 +1,55 @@
+{ stdenv
+, lib
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, 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.
+
+stdenv.mkDerivation rec {
+  pname = "gst-libav";
+  version = "1.18.4";
+
+  src = fetchurl {
+    url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "15n3x3vhshqa3icw93g4vqmqd46122anzqvfxwn6q8famlxlcjil";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    gettext
+    pkg-config
+    python3
+  ];
+
+  buildInputs = [
+    gst-plugins-base
+    libav
+  ];
+
+  mesonFlags = [
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+  ];
+
+  postPatch = ''
+    patchShebangs \
+      scripts/extract-release-date-from-doap-file.py
+  '';
+
+  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
new file mode 100644
index 000000000000..d66376b64996
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/default.nix
@@ -0,0 +1,76 @@
+{ lib, stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, python3
+, gettext
+, gobject-introspection
+, gst-plugins-base
+, gst-plugins-bad
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gst-rtsp-server";
+  version = "1.18.4";
+
+  src = fetchurl {
+    url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "153c78klvzlmi86d0gmdf7w9crv11rkd4y82b14a0wdr83gbhsx4";
+  };
+
+  outputs = [
+    "out"
+    "dev"
+    # "devdoc" # disabled until `hotdoc` is packaged in nixpkgs
+  ];
+
+  patches = [
+    # To use split outputs, we need this so double prefix won't be used in the
+    # pkg-config files. Hopefully, this won't be needed on the next release,
+    # _if_
+    # https://gitlab.freedesktop.org/gstreamer/gst-rtsp-server/merge_requests/1
+    # will be merged. For the current release, this merge request won't apply.
+    ./fix_pkgconfig_includedir.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    gettext
+    gobject-introspection
+    pkg-config
+    python3
+
+    # documentation
+    # TODO add hotdoc here
+  ];
+
+  buildInputs = [
+    gst-plugins-base
+    gst-plugins-bad
+  ];
+
+  mesonFlags = [
+    "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+    "-Dintrospection=disabled"
+  ];
+
+  postPatch = ''
+    patchShebangs \
+      scripts/extract-release-date-from-doap-file.py
+  '';
+
+  meta = with 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/rtsp-server/fix_pkgconfig_includedir.patch b/nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/fix_pkgconfig_includedir.patch
new file mode 100644
index 000000000000..d31fe19fb0fe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/fix_pkgconfig_includedir.patch
@@ -0,0 +1,15 @@
+diff --git i/pkgconfig/meson.build w/pkgconfig/meson.build
+index 8ed8299..594cbfe 100644
+--- i/pkgconfig/meson.build
++++ w/pkgconfig/meson.build
+@@ -2,8 +2,8 @@ pkgconf = configuration_data()
+ 
+ pkgconf.set('prefix', get_option('prefix'))
+ pkgconf.set('exec_prefix', '${prefix}')
+-pkgconf.set('libdir', '${prefix}/@0@'.format(get_option('libdir')))
+-pkgconf.set('includedir', '${prefix}/@0@'.format(get_option('includedir')))
++pkgconf.set('libdir', join_paths(get_option('prefix'), get_option('libdir')))
++pkgconf.set('includedir', join_paths(get_option('prefix'), get_option('includedir')))
+ pkgconf.set('GST_API_VERSION', api_version)
+ pkgconf.set('VERSION', gst_version)
+ 
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix
new file mode 100644
index 000000000000..049e8a99f095
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix
@@ -0,0 +1,83 @@
+{ stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, python3
+, gst-plugins-base
+, orc
+, gettext
+, a52dec
+, libcdio
+, libdvdread
+, libmad
+, libmpeg2
+, x264
+, libintl
+, lib
+, opencore-amr
+, IOKit
+, CoreFoundation
+, DiskArbitration
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gst-plugins-ugly";
+  version = "1.18.4";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "0g6i4db1883q3j0l2gdv46fcqwiiaw63n6mhvsfcms1i1p7g1391";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    gettext
+    pkg-config
+    python3
+  ];
+
+  buildInputs = [
+    gst-plugins-base
+    orc
+    a52dec
+    libcdio
+    libdvdread
+    libmad
+    libmpeg2
+    x264
+    libintl
+    opencore-amr
+  ] ++ lib.optionals stdenv.isDarwin [
+    IOKit
+    CoreFoundation
+    DiskArbitration
+  ];
+
+  mesonFlags = [
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+    "-Dsidplay=disabled" # sidplay / sidplay/player.h isn't packaged in nixpkgs as of writing
+  ];
+
+  postPatch = ''
+    patchShebangs \
+      scripts/extract-release-date-from-doap-file.py
+  '';
+
+  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
new file mode 100644
index 000000000000..19e65c5a75eb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/vaapi/default.nix
@@ -0,0 +1,85 @@
+{ lib, stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, gst-plugins-base
+, bzip2
+, libva
+, wayland
+, libdrm
+, udev
+, xorg
+, libGLU
+, libGL
+, gstreamer
+, gst-plugins-bad
+, nasm
+, libvpx
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gstreamer-vaapi";
+  version = "1.18.4";
+
+  src = fetchurl {
+    url = "https://gstreamer.freedesktop.org/src/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "1sia4l88z7kkxm2z9j20l43rqkrnsa47xccski10s5gkhsprinwj";
+  };
+
+  outputs = [
+    "out"
+    "dev"
+    # "devdoc" # disabled until `hotdoc` is packaged in nixpkgs
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    bzip2
+
+    # documentation
+    # TODO add hotdoc here
+  ];
+
+  buildInputs = [
+    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
+    python3
+  ];
+
+  mesonFlags = [
+    "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
+    "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
+  ];
+
+  postPatch = ''
+    patchShebangs \
+      scripts/extract-release-date-from-doap-file.py
+  '';
+
+  meta = with 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/gtdialog/default.nix b/nixpkgs/pkgs/development/libraries/gtdialog/default.nix
new file mode 100644
index 000000000000..ac925477adb3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtdialog/default.nix
@@ -0,0 +1,33 @@
+{lib, stdenv, fetchurl, cdk, unzip, gtk2, glib, ncurses, pkg-config}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="gtdialog";
+    version="1.4";
+    name="${baseName}-${version}";
+    hash="1lhsaz56s8m838fi6vnfcd2r6djymvy3n2pbqhii88hraapq3rfk";
+    url="https://foicica.com/gtdialog/download/gtdialog_1.4.zip";
+    sha256="1lhsaz56s8m838fi6vnfcd2r6djymvy3n2pbqhii88hraapq3rfk";
+  };
+  nativeBuildInputs = [ pkg-config unzip ];
+  buildInputs = [
+    cdk gtk2 glib ncurses
+  ];
+in
+stdenv.mkDerivation {
+  inherit (s) name version;
+  inherit nativeBuildInputs buildInputs;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+  makeFlags = ["PREFIX=$(out)"];
+  meta = {
+    inherit (s) version;
+    description = "Cross-platform helper for creating interactive dialogs";
+    license = lib.licenses.mit ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
+    homepage = "http://foicica.com/gtdialog";
+    downloadPage = "http://foicica.com/gtdialog/download";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtdialog/default.upstream b/nixpkgs/pkgs/development/libraries/gtdialog/default.upstream
new file mode 100644
index 000000000000..b9cbcf4c5c75
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtdialog/default.upstream
@@ -0,0 +1,3 @@
+url http://foicica.com/gtdialog/download
+version_link '[.]zip$'
+version '.*_([0-9.]*)[.]zip' '\1'
diff --git a/nixpkgs/pkgs/development/libraries/gtest/default.nix b/nixpkgs/pkgs/development/libraries/gtest/default.nix
new file mode 100644
index 000000000000..ffe85538684d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtest/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, cmake, ninja, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "gtest";
+  version = "1.11.0";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "googletest";
+    rev = "release-${version}";
+    hash = "sha256-SjlJxushfry13RGA7BCjYC9oZqV4z6x8dOiHfl/wpF0=";
+  };
+
+  patches = [
+    ./fix-cmake-config-includedir.patch
+  ];
+
+  nativeBuildInputs = [ cmake ninja ];
+
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
+
+  meta = with lib; {
+    description = "Google's framework for writing C++ tests";
+    homepage = "https://github.com/google/googletest";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ zoomulator ivan-tkatchev ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtest/fix-cmake-config-includedir.patch b/nixpkgs/pkgs/development/libraries/gtest/fix-cmake-config-includedir.patch
new file mode 100644
index 000000000000..c05e3a9326ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtest/fix-cmake-config-includedir.patch
@@ -0,0 +1,30 @@
+--- a/googlemock/CMakeLists.txt
++++ b/googlemock/CMakeLists.txt
+@@ -106,10 +106,10 @@
+ if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
+   target_include_directories(gmock SYSTEM INTERFACE
+     "$<BUILD_INTERFACE:${gmock_build_include_dirs}>"
+-    "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
++    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
+   target_include_directories(gmock_main SYSTEM INTERFACE
+     "$<BUILD_INTERFACE:${gmock_build_include_dirs}>"
+-    "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
++    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
+ endif()
+ 
+ ########################################################################
+--- a/googletest/CMakeLists.txt
++++ b/googletest/CMakeLists.txt
+@@ -126,10 +126,10 @@
+ if (DEFINED CMAKE_VERSION AND NOT "${CMAKE_VERSION}" VERSION_LESS "2.8.11")
+   target_include_directories(gtest SYSTEM INTERFACE
+     "$<BUILD_INTERFACE:${gtest_build_include_dirs}>"
+-    "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
++    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
+   target_include_directories(gtest_main SYSTEM INTERFACE
+     "$<BUILD_INTERFACE:${gtest_build_include_dirs}>"
+-    "$<INSTALL_INTERFACE:$<INSTALL_PREFIX>/${CMAKE_INSTALL_INCLUDEDIR}>")
++    "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
+ endif()
+ target_link_libraries(gtest_main PUBLIC gtest)
+ 
diff --git a/nixpkgs/pkgs/development/libraries/gthree/default.nix b/nixpkgs/pkgs/development/libraries/gthree/default.nix
new file mode 100644
index 000000000000..990e151efe44
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gthree/default.nix
@@ -0,0 +1,73 @@
+{ lib, stdenv
+, fetchFromGitHub
+, fetchpatch
+, ninja
+, meson
+, pkg-config
+, gobject-introspection
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+, glib
+, gtk3
+, graphene
+, epoxy
+, json-glib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gthree";
+  version = "0.9.0";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchFromGitHub {
+    owner = "alexlarsson";
+    repo = "gthree";
+    rev = version;
+    sha256 = "09fcnjc3j21lh5fjf067wm35sb4qni4vgzing61kixnn2shy79iy";
+  };
+
+  patches = [
+    # Add option for disabling examples
+    (fetchpatch {
+      url = "https://github.com/alexlarsson/gthree/commit/75f05c40aba9d5f603d8a3c490c3406c1fe06776.patch";
+      sha256 = "PBwLz4DLhC+7BtypVTFMFiF3hKAJeskU3XBKFHa3a84=";
+    })
+  ];
+
+  nativeBuildInputs = [
+    ninja
+    meson
+    pkg-config
+    gtk-doc
+    docbook-xsl-nons
+    docbook_xml_dtd_43
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    epoxy
+    json-glib
+  ];
+
+  propagatedBuildInputs = [
+    glib
+    gtk3
+    graphene
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=${if stdenv.isDarwin then "false" else "true"}"
+    # Data for examples is useless when the example programs are not installed.
+    "-Dexamples=false"
+  ];
+
+  meta = with lib; {
+    description = "GObject/GTK port of three.js";
+    homepage = "https://github.com/alexlarsson/gthree";
+    license = licenses.mit;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.unix;
+  };
+}
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..918e1679eba2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk-engine-bluecurve/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, pkg-config, 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 = [ pkg-config intltool ];
+
+  buildInputs = [ gtk2 ];
+
+  meta = {
+    description = "Original Bluecurve engine from Red Hat's artwork package";
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
+    maintainers = [ ];
+  };
+}
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..8d40499fb626
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk-engine-murrine/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, pkg-config, intltool, gtk2 }:
+
+stdenv.mkDerivation rec {
+  pname = "gtk-engine-murrine";
+  version = "0.98.2";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "129cs5bqw23i76h3nmc29c9mqkm9460iwc8vkl7hs4xr07h8mip9";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ intltool gtk2 ];
+
+  meta = {
+    description = "A very flexible theme engine";
+    homepage = "https://gitlab.gnome.org/Archive/murrine";
+    license = lib.licenses.lgpl3;
+    platforms = 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..70b2c4d1e229
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk-engines/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, fetchurl, pkg-config, intltool, gtk2 }:
+
+stdenv.mkDerivation {
+  name = "gtk-engines-2.20.2";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gtk-engines/2.20/gtk-engines-2.20.2.tar.bz2";
+    sha256 = "1db65pb0j0mijmswrvpgkdabilqd23x22d95hp5kwxvcramq1dhm";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ intltool gtk2 ];
+
+  meta = {
+    description = "Theme engines for GTK 2";
+    license = lib.licenses.lgpl21Plus;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtk-frdp/default.nix b/nixpkgs/pkgs/development/libraries/gtk-frdp/default.nix
new file mode 100644
index 000000000000..e6c6d9391933
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk-frdp/default.nix
@@ -0,0 +1,54 @@
+{ lib
+, stdenv
+, fetchFromGitLab
+, meson
+, ninja
+, pkg-config
+, vala
+, gobject-introspection
+, glib
+, gtk3
+, freerdp
+, nix-update-script
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gtk-frdp";
+  version = "3.37.1-unstable-2020-10-26";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.gnome.org";
+    owner = "GNOME";
+    repo = pname;
+    rev = "805721e82ca1df6a50da3b5bd3b75d6747016482";
+    sha256 = "q/UFKYj3LUkAzll3KeKd6oec0GJnDtTuFMTTatKFlcs=";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    vala
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    glib
+    gtk3
+    freerdp
+  ];
+
+  passthru = {
+    updateScript = nix-update-script {
+      attrPath = pname;
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://gitlab.gnome.org/GNOME/gtk-frdp";
+    description = "RDP viewer widget for GTK";
+    maintainers = teams.gnome.members;
+    license = licenses.lgpl3Plus;
+    platforms = platforms.unix;
+  };
+}
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..d8010cdc63b4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk-layer-shell/default.nix
@@ -0,0 +1,52 @@
+{ lib, stdenv
+, fetchFromGitHub
+, meson
+, ninja
+, pkg-config
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+, wayland
+, gtk3
+, gobject-introspection
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gtk-layer-shell";
+  version = "0.6.0";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchFromGitHub {
+    owner = "wmww";
+    repo = "gtk-layer-shell";
+    rev = "v${version}";
+    sha256 = "sha256-jLWXBoYcVoUSzw4OIYVM5iPvsmpy+Wg5TbDpo8cll80=";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gobject-introspection
+    gtk-doc
+    docbook-xsl-nons
+    docbook_xml_dtd_43
+  ];
+
+  buildInputs = [
+    wayland
+    gtk3
+  ];
+
+  mesonFlags = [
+    "-Ddocs=true"
+  ];
+
+  meta = with lib; {
+    description = "A library to create panels and other desktop components for Wayland using the Layer Shell protocol";
+    license = licenses.lgpl3Plus;
+    maintainers = with maintainers; [ eonpatapon ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtk-mac-integration/default.nix b/nixpkgs/pkgs/development/libraries/gtk-mac-integration/default.nix
new file mode 100644
index 000000000000..f244a97edf24
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk-mac-integration/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitLab, autoreconfHook, pkg-config, glib, gtk-doc, gtk, gobject-introspection }:
+
+stdenv.mkDerivation rec {
+  pname = "gtk-mac-integration";
+  version = "2.1.3";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.gnome.org";
+    owner = "GNOME";
+    repo = pname;
+    rev = "${pname}-${version}";
+    sha256 = "1w0agv4r0daklv5d2f3l0c10krravjq8bj9hsdsrpka48dbnqmap";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config gtk-doc gobject-introspection ];
+  buildInputs = [ glib ];
+  propagatedBuildInputs = [ gtk ];
+
+  preAutoreconf = ''
+    gtkdocize
+  '';
+
+  meta = with lib; {
+    description = "Provides integration for GTK applications into the Mac desktop";
+    license = licenses.lgpl21;
+    homepage = "https://wiki.gnome.org/Projects/GTK/OSX/Integration";
+    maintainers = with maintainers; [ matthewbauer ];
+    platforms = platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtk-sharp-beans/default.nix b/nixpkgs/pkgs/development/libraries/gtk-sharp-beans/default.nix
new file mode 100644
index 000000000000..69ef71f1506f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk-sharp-beans/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, which, pkg-config, mono, gtk-sharp-2_0, gio-sharp }:
+
+stdenv.mkDerivation rec {
+  pname = "gtk-sharp-beans";
+  version = "2.14.0";
+
+  src = fetchFromGitHub {
+    owner = "mono";
+    repo = "gtk-sharp-beans";
+
+    rev = version;
+    sha256 = "04sylwdllb6gazzs2m4jjfn14mil9l3cny2q0xf0zkhczzih6ah1";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook which ];
+  buildInputs = [ mono gtk-sharp-2_0 gio-sharp ];
+
+  dontStrip = true;
+
+  meta = with lib; {
+    description = "Binds some API from GTK that isn't in GTK# 2.12.x";
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtk-sharp/2.0.nix b/nixpkgs/pkgs/development/libraries/gtk-sharp/2.0.nix
new file mode 100644
index 000000000000..f35f5e0552c4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk-sharp/2.0.nix
@@ -0,0 +1,79 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, pkg-config
+, mono
+, glib
+, pango
+, gtk2
+, GConf ? null
+, libglade ? null
+, libgtkhtml ? null
+, gtkhtml ? null
+, libgnomecanvas ? null
+, libgnomeui ? null
+, libgnomeprint ? null
+, libgnomeprintui ? null
+, libxml2
+, monoDLLFixer
+, autoconf
+, automake
+, libtool
+, which
+, fetchpatch
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gtk-sharp";
+  version = "2.12.45";
+
+  builder = ./builder.sh;
+  src = fetchFromGitHub {
+    owner = "mono";
+    repo = "gtk-sharp";
+    rev = version;
+    sha256 = "1vy6yfwkfv6bb45bzf4g6dayiqkvqqvlr02rsnhd10793hlpqlgg";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://projects.archlinux.de/svntogit/packages.git/plain/trunk/gtk-sharp2-2.12.12-gtkrange.patch?h=packages/gtk-sharp-2";
+      sha256 = "bjx+OfgWnN8SO82p8G7pbGuxJ9EeQxMLeHnrtEm8RV8=";
+    })
+  ];
+
+  postInstall = ''
+    pushd $out/bin
+    for f in gapi2-*
+    do
+      substituteInPlace $f --replace mono ${mono}/bin/mono
+    done
+    popd
+  '';
+
+  nativeBuildInputs = [ pkg-config autoconf automake libtool which ];
+
+  buildInputs = [
+    mono glib pango gtk2 GConf libglade libgnomecanvas
+    libgtkhtml libgnomeui libgnomeprint libgnomeprintui gtkhtml libxml2
+  ];
+
+  preConfigure = ''
+    ./bootstrap-${lib.versions.majorMinor version}
+  '';
+
+  dontStrip = true;
+
+  inherit monoDLLFixer;
+
+  passthru = {
+    gtk = gtk2;
+  };
+
+  meta = with lib; {
+    description = "Graphical User Interface Toolkit for mono and .Net";
+    homepage = "https://www.mono-project.com/docs/gui/gtksharp";
+    platforms = platforms.linux;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtk-sharp/3.0.nix b/nixpkgs/pkgs/development/libraries/gtk-sharp/3.0.nix
new file mode 100644
index 000000000000..6b996244a9f3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk-sharp/3.0.nix
@@ -0,0 +1,64 @@
+{ lib, stdenv
+, fetchurl
+, fetchpatch
+, pkg-config
+, mono
+, glib
+, pango
+, gtk3
+, GConf ? null
+, libglade ? null
+, libgtkhtml ? null
+, gtkhtml ? null
+, libgnomecanvas ? null
+, libgnomeui ? null
+, libgnomeprint ? null
+, libgnomeprintui ? null
+, libxml2
+, monoDLLFixer
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gtk-sharp";
+  version = "2.99.3";
+
+  builder = ./builder.sh;
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "18n3l9zcldyvn4lwi8izd62307mkhz873039nl6awrv285qzah34";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    mono glib pango gtk3 GConf libglade libgnomecanvas
+    libgtkhtml libgnomeui libgnomeprint libgnomeprintui gtkhtml libxml2
+  ];
+
+  patches = [
+    # Fixes MONO_PROFILE_ENTER_LEAVE undeclared when compiling against newer versions of mono.
+    # @see https://github.com/mono/gtk-sharp/pull/266
+    (fetchpatch {
+      name = "MONO_PROFILE_ENTER_LEAVE.patch";
+      url = "https://github.com/mono/gtk-sharp/commit/401df51bc461de93c1a78b6a7a0d5adc63cf186c.patch";
+      sha256 = "0hrkcr5a7wkixnyp60v4d6j3arsb63h54rd30lc5ajfjb3p92kcf";
+    })
+    # @see https://github.com/mono/gtk-sharp/pull/263
+    (fetchpatch {
+      name = "disambiguate_Gtk.Range.patch";
+      url = "https://github.com/mono/gtk-sharp/commit/a00552ad68ae349e89e440dca21b86dbd6bccd30.patch";
+      sha256 = "1ylplr9g9x7ybsgrydsgr6p3g7w6i46yng1hnl3afgn4vj45rag2";
+    })
+  ];
+
+  dontStrip = true;
+
+  inherit monoDLLFixer;
+
+  passthru = {
+    inherit gtk3;
+  };
+
+  meta = {
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtk-sharp/builder.sh b/nixpkgs/pkgs/development/libraries/gtk-sharp/builder.sh
new file mode 100644
index 000000000000..4b8f757540b5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk-sharp/builder.sh
@@ -0,0 +1,11 @@
+source $stdenv/setup
+
+genericBuild
+
+# !!! hack
+export ALL_INPUTS="$out $pkgs"
+
+find $out -name "*.dll.config" | while read configFile; do
+    echo "modifying config file $configFile"
+    $monoDLLFixer "$configFile"
+done
diff --git a/nixpkgs/pkgs/development/libraries/gtk/2.x.nix b/nixpkgs/pkgs/development/libraries/gtk/2.x.nix
new file mode 100644
index 000000000000..1a7cc57fbeaf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk/2.x.nix
@@ -0,0 +1,112 @@
+{ config, lib, substituteAll, stdenv, fetchurl, pkg-config, gettext, glib, atk, pango, cairo, perl, xorg
+, gdk-pixbuf, xlibsWrapper, gobject-introspection
+, xineramaSupport ? stdenv.isLinux
+, cupsSupport ? config.gtk2.cups or stdenv.isLinux, cups
+, gdktarget ? if stdenv.isDarwin then "quartz" else "x11"
+, AppKit, Cocoa
+, fetchpatch
+}:
+
+with lib;
+
+let
+
+  gtkCleanImmodulesCache = substituteAll {
+    src = ./hooks/clean-immodules-cache.sh;
+    gtk_module_path = "gtk-2.0";
+    gtk_binary_version = "2.10.0";
+  };
+
+in
+
+stdenv.mkDerivation rec {
+  pname = "gtk+";
+  version = "2.24.32";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gtk+/2.24/${pname}-${version}.tar.xz";
+    sha256 = "b6c8a93ddda5eabe3bfee1eb39636c9a03d2a56c7b62828b359bf197943c582e";
+  };
+
+  outputs = [ "out" "dev" "devdoc" ];
+  outputBin = "dev";
+
+  enableParallelBuilding = true;
+
+  setupHooks =  [
+    ./hooks/drop-icon-theme-cache.sh
+    gtkCleanImmodulesCache
+  ];
+
+  nativeBuildInputs = setupHooks ++ [ perl pkg-config gettext gobject-introspection ];
+
+  patches = [
+    ./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";
+    })
+    ./patches/2.0-darwin-x11.patch
+  ];
+
+  propagatedBuildInputs = with xorg;
+    [ glib cairo pango gdk-pixbuf atk ]
+    ++ optionals (stdenv.isLinux || stdenv.isDarwin) [
+         libXrandr libXrender libXcomposite libXi libXcursor
+       ]
+    ++ optionals stdenv.isDarwin [ xlibsWrapper libXdamage ]
+    ++ optional xineramaSupport libXinerama
+    ++ optionals cupsSupport [ cups ]
+    ++ optionals stdenv.isDarwin [ AppKit Cocoa ];
+
+  preConfigure = if (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11" && stdenv.isDarwin) then ''
+    MACOSX_DEPLOYMENT_TARGET=10.16
+  '' else null;
+
+  configureFlags = [
+    "--with-gdktarget=${gdktarget}"
+    "--with-xinput=yes"
+  ] ++ optionals stdenv.isDarwin [
+    "--disable-glibtest"
+    "--disable-introspection"
+    "--disable-visibility"
+  ];
+
+  doCheck = false; # needs X11
+
+  postInstall = ''
+    moveToOutput share/gtk-2.0/demo "$devdoc"
+    # The updater is needed for nixos env and it's tiny.
+    moveToOutput bin/gtk-update-icon-cache "$out"
+  '';
+
+  passthru = {
+    gtkExeEnvPostBuild = ''
+      rm $out/lib/gtk-2.0/2.10.0/immodules.cache
+      $out/bin/gtk-query-immodules-2.0 $out/lib/gtk-2.0/2.10.0/immodules/*.so > $out/lib/gtk-2.0/2.10.0/immodules.cache
+    ''; # workaround for bug of nix-mode for Emacs */ '';
+    inherit gdktarget;
+  };
+
+  meta = {
+    description = "A multi-platform toolkit for creating graphical user interfaces";
+    homepage    = "https://www.gtk.org/";
+    license     = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ lovek323 raskin ];
+    platforms   = platforms.all;
+
+    longDescription = ''
+      GTK is a highly usable, feature rich toolkit for creating
+      graphical user interfaces which boasts cross platform
+      compatibility and an easy to use API.  GTK it is written in C,
+      but has bindings to many other popular programming languages
+      such as C++, Python and C# among others.  GTK is licensed
+      under the GNU LGPL 2.1 allowing development of both free and
+      proprietary software with GTK without any license fees or
+      royalties.
+    '';
+    changelog = "https://gitlab.gnome.org/GNOME/gtk/-/raw/${version}/NEWS";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtk/3.x.nix b/nixpkgs/pkgs/development/libraries/gtk/3.x.nix
new file mode 100644
index 000000000000..01b98d06bf30
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk/3.x.nix
@@ -0,0 +1,231 @@
+{ lib
+, stdenv
+, substituteAll
+, fetchurl
+, fetchpatch
+, pkg-config
+, gettext
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+, gtk-doc
+, meson
+, ninja
+, python3
+, makeWrapper
+, shared-mime-info
+, isocodes
+, expat
+, glib
+, cairo
+, pango
+, gdk-pixbuf
+, atk
+, at-spi2-atk
+, gobject-introspection
+, fribidi
+, xorg
+, epoxy
+, libxkbcommon
+, libxml2
+, gmp
+, gnome
+, gsettings-desktop-schemas
+, sassc
+, trackerSupport ? stdenv.isLinux
+, tracker
+, x11Support ? stdenv.isLinux
+, waylandSupport ? stdenv.isLinux
+, libGL
+, wayland
+, wayland-protocols
+, xineramaSupport ? stdenv.isLinux
+, cupsSupport ? stdenv.isLinux
+, withGtkDoc ? stdenv.isLinux
+, cups
+, AppKit
+, Cocoa
+, broadwaySupport ? true
+}:
+
+let
+
+  gtkCleanImmodulesCache = substituteAll {
+    src = ./hooks/clean-immodules-cache.sh;
+    gtk_module_path = "gtk-3.0";
+    gtk_binary_version = "3.0.0";
+  };
+
+in
+
+stdenv.mkDerivation rec {
+  pname = "gtk+3";
+  version = "3.24.30";
+
+  outputs = [ "out" "dev" ] ++ lib.optional withGtkDoc "devdoc";
+  outputBin = "dev";
+
+  setupHooks = [
+    ./hooks/drop-icon-theme-cache.sh
+    gtkCleanImmodulesCache
+  ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gtk+/${lib.versions.majorMinor version}/gtk+-${version}.tar.xz";
+    sha256 = "sha256-unW//zIK0fTPvukrqBPsM2MizDxmDUBqrQFLBwh6O6k=";
+  };
+
+  patches = [
+    ./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";
+    })
+  ] ++ lib.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
+    # https://gitlab.gnome.org/GNOME/gtk/merge_requests/536
+    ./patches/3.0-darwin-x11.patch
+  ];
+
+  nativeBuildInputs = [
+    gettext
+    gobject-introspection
+    makeWrapper
+    meson
+    ninja
+    pkg-config
+    python3
+    sassc
+  ] ++ setupHooks ++ lib.optionals withGtkDoc [
+    docbook_xml_dtd_43
+    docbook-xsl-nons
+    gtk-doc
+    # For xmllint
+    libxml2
+  ];
+
+  buildInputs = [
+    libxkbcommon
+    epoxy
+    isocodes
+  ] ++ lib.optionals stdenv.isDarwin [
+    AppKit
+  ] ++ lib.optionals trackerSupport [
+    tracker
+  ];
+  #TODO: colord?
+
+  propagatedBuildInputs = with xorg; [
+    at-spi2-atk
+    atk
+    cairo
+    expat
+    fribidi
+    gdk-pixbuf
+    glib
+    gsettings-desktop-schemas
+    libICE
+    libSM
+    libXcomposite
+    libXcursor
+    libXi
+    libXrandr
+    libXrender
+    pango
+  ] ++ lib.optionals stdenv.isDarwin [
+    # explicitly propagated, always needed
+    Cocoa
+  ] ++ lib.optionals waylandSupport [
+    libGL
+    wayland
+    wayland-protocols
+  ] ++ lib.optionals xineramaSupport [
+    libXinerama
+  ] ++ lib.optionals cupsSupport [
+    cups
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=${lib.boolToString withGtkDoc}"
+    "-Dtests=false"
+    "-Dtracker3=${lib.boolToString trackerSupport}"
+    "-Dbroadway_backend=${lib.boolToString broadwaySupport}"
+  ];
+
+  doCheck = false; # needs X11
+
+  separateDebugInfo = stdenv.isLinux;
+
+  # 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";
+
+  postPatch = ''
+    files=(
+      build-aux/meson/post-install.py
+      demos/gtk-demo/geninclude.py
+      gdk/broadway/gen-c-array.py
+      gdk/gen-gdk-gresources-xml.py
+      gtk/cursor/dnd-copy.png
+      gtk/gen-gtk-gresources-xml.py
+      gtk/gen-rc.py
+      gtk/gentypefuncs.py
+    )
+
+    chmod +x ''${files[@]}
+    patchShebangs ''${files[@]}
+  '';
+
+  postInstall = lib.optionalString (!stdenv.isDarwin) ''
+    # The updater is needed for nixos env and it's tiny.
+    moveToOutput bin/gtk-update-icon-cache "$out"
+    # Launcher
+    moveToOutput bin/gtk-launch "$out"
+    # Broadway daemon
+    moveToOutput bin/broadwayd "$out"
+
+    # TODO: patch glib directly
+    for f in $dev/bin/gtk-encode-symbolic-svg; do
+      wrapProgram $f --prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
+    done
+  '';
+
+  # Wrap demos
+  postFixup =  lib.optionalString (!stdenv.isDarwin) ''
+    demos=(gtk3-demo gtk3-demo-application gtk3-icon-browser gtk3-widget-factory)
+
+    for program in ''${demos[@]}; do
+      wrapProgram $dev/bin/$program \
+        --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share/gsettings-schemas/${pname}-${version}"
+    done
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = "gtk+";
+      attrPath = "gtk3";
+    };
+  };
+
+  meta = with lib; {
+    description = "A multi-platform toolkit for creating graphical user interfaces";
+    longDescription = ''
+      GTK is a highly usable, feature rich toolkit for creating
+      graphical user interfaces which boasts cross platform
+      compatibility and an easy to use API.  GTK it is written in C,
+      but has bindings to many other popular programming languages
+      such as C++, Python and C# among others.  GTK is licensed
+      under the GNU LGPL 2.1 allowing development of both free and
+      proprietary software with GTK without any license fees or
+      royalties.
+    '';
+    homepage = "https://www.gtk.org/";
+    license = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ raskin ] ++ teams.gnome.members;
+    platforms = platforms.all;
+    changelog = "https://gitlab.gnome.org/GNOME/gtk/-/raw/${version}/NEWS";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtk/4.x.nix b/nixpkgs/pkgs/development/libraries/gtk/4.x.nix
new file mode 100644
index 000000000000..8791d24ad361
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk/4.x.nix
@@ -0,0 +1,243 @@
+{ lib
+, stdenv
+, substituteAll
+, fetchurl
+, pkg-config
+, gettext
+, graphene
+, gi-docgen
+, meson
+, ninja
+, python3
+, makeWrapper
+, shared-mime-info
+, isocodes
+, glib
+, cairo
+, pango
+, pandoc
+, gdk-pixbuf
+, gobject-introspection
+, fribidi
+, xorg
+, epoxy
+, json-glib
+, libxkbcommon
+, libxml2
+, librest
+, libsoup
+, ffmpeg
+, gmp
+, gnome
+, gsettings-desktop-schemas
+, gst_all_1
+, sassc
+, trackerSupport ? stdenv.isLinux
+, tracker
+, x11Support ? stdenv.isLinux
+, waylandSupport ? stdenv.isLinux
+, libGL
+, vulkan-loader
+, vulkan-headers
+, wayland
+, wayland-protocols
+, xineramaSupport ? stdenv.isLinux
+, cupsSupport ? stdenv.isLinux
+, cups
+, AppKit
+, Cocoa
+, broadwaySupport ? true
+}:
+
+let
+
+  gtkCleanImmodulesCache = substituteAll {
+    src = ./hooks/clean-immodules-cache.sh;
+    gtk_module_path = "gtk-4.0";
+    gtk_binary_version = "4.0.0";
+  };
+
+in
+
+stdenv.mkDerivation rec {
+  pname = "gtk4";
+  version = "4.2.1";
+
+  outputs = [ "out" "dev" ] ++ lib.optionals x11Support [ "devdoc" ];
+  outputBin = "dev";
+
+  setupHooks = [
+    ./hooks/drop-icon-theme-cache.sh
+    gtkCleanImmodulesCache
+  ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gtk/${lib.versions.majorMinor version}/gtk-${version}.tar.xz";
+    sha256 = "AjFpd13kPwof3gZvvBnXhUXqanViwZFavem4rkpzCeY=";
+  };
+
+  nativeBuildInputs = [
+    gettext
+    gobject-introspection
+    makeWrapper
+    meson
+    ninja
+    pkg-config
+    python3
+    sassc
+    gi-docgen
+  ] ++ setupHooks;
+
+  buildInputs = [
+    libxkbcommon
+    epoxy
+    json-glib
+    isocodes
+  ] ++ lib.optionals (!stdenv.isDarwin) [
+    vulkan-headers
+  ] ++ [
+    librest
+    libsoup
+    ffmpeg
+    gst_all_1.gst-plugins-base
+    gst_all_1.gst-plugins-bad
+    fribidi
+  ] ++ (with xorg; [
+    libICE
+    libSM
+    libXcomposite
+    libXcursor
+    libXi
+    libXrandr
+    libXrender
+  ]) ++ lib.optionals stdenv.isDarwin [
+    AppKit
+  ] ++ lib.optionals trackerSupport [
+    tracker
+  ] ++ lib.optionals waylandSupport [
+    libGL
+    wayland
+    wayland-protocols
+  ] ++ lib.optionals xineramaSupport [
+    xorg.libXinerama
+  ] ++ lib.optionals cupsSupport [
+    cups
+  ] ++ lib.optionals stdenv.isDarwin [
+    Cocoa
+  ];
+  #TODO: colord?
+
+  propagatedBuildInputs = [
+    # Required by pkg-config files.
+    cairo
+    gdk-pixbuf
+    glib
+    graphene
+    pango
+  ] ++ lib.optionals (!stdenv.isDarwin) [
+    vulkan-loader
+  ] ++ [
+    # Required for GSettings schemas at runtime.
+    # Will be picked up by wrapGAppsHook.
+    gsettings-desktop-schemas
+  ];
+
+  mesonFlags = [
+    # ../docs/tools/shooter.c:4:10: fatal error: 'cairo-xlib.h' file not found
+    "-Dgtk_doc=${lib.boolToString x11Support}"
+    "-Dbuild-tests=false"
+    "-Dtracker=${if trackerSupport then "enabled" else "disabled"}"
+    "-Dbroadway-backend=${lib.boolToString broadwaySupport}"
+  ] ++ lib.optionals (!cupsSupport) [
+    "-Dprint-cups=disabled"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "-Dvulkan=disabled"
+    "-Dmedia-gstreamer=disabled" # requires gstreamer-gl
+  ] ++ lib.optionals (!x11Support) [
+    "-Dx11-backend=false"
+  ];
+
+  doCheck = false; # needs X11
+
+  separateDebugInfo = stdenv.isLinux;
+
+  # 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";
+
+  postPatch = ''
+    files=(
+      build-aux/meson/post-install.py
+      demos/gtk-demo/geninclude.py
+      gdk/broadway/gen-c-array.py
+      gdk/gen-gdk-gresources-xml.py
+      gtk/gen-gtk-gresources-xml.py
+      gtk/gentypefuncs.py
+    )
+
+    chmod +x ''${files[@]}
+    patchShebangs ''${files[@]}
+  '';
+
+  preInstall = ''
+    OLD_PATH="$PATH"
+    PATH="$PATH:$dev/bin" # so the install script finds gtk4-update-icon-cache
+  '';
+
+  postInstall = ''
+    PATH="$OLD_PATH"
+  '' + lib.optionalString (!stdenv.isDarwin) ''
+    # The updater is needed for nixos env and it's tiny.
+    moveToOutput bin/gtk4-update-icon-cache "$out"
+    # Launcher
+    moveToOutput bin/gtk-launch "$out"
+
+    # TODO: patch glib directly
+    for f in $dev/bin/gtk4-encode-symbolic-svg; do
+      wrapProgram $f --prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
+    done
+
+  '' + lib.optionalString x11Support ''
+    # So that DevHelp can find this.
+    # TODO: Remove this with DevHelp 41.
+    mkdir -p "$devdoc/share/devhelp/books"
+    mv "$out/share/doc/"* "$devdoc/share/devhelp/books"
+    rmdir -p --ignore-fail-on-non-empty "$out/share/doc"
+  '';
+
+  # Wrap demos
+  postFixup =  lib.optionalString (!stdenv.isDarwin) ''
+    demos=(gtk4-demo gtk4-demo-application gtk4-icon-browser gtk4-widget-factory)
+
+    for program in ''${demos[@]}; do
+      wrapProgram $dev/bin/$program \
+        --prefix XDG_DATA_DIRS : "$GSETTINGS_SCHEMAS_PATH:$out/share/gsettings-schemas/${pname}-${version}"
+    done
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = "gtk";
+      attrPath = "gtk4";
+    };
+  };
+
+  meta = with lib; {
+    description = "A multi-platform toolkit for creating graphical user interfaces";
+    longDescription = ''
+      GTK is a highly usable, feature rich toolkit for creating
+      graphical user interfaces which boasts cross platform
+      compatibility and an easy to use API.  GTK it is written in C,
+      but has bindings to many other popular programming languages
+      such as C++, Python and C# among others.  GTK is licensed
+      under the GNU LGPL 2.1 allowing development of both free and
+      proprietary software with GTK without any license fees or
+      royalties.
+    '';
+    homepage = "https://www.gtk.org/";
+    license = licenses.lgpl2Plus;
+    maintainers = teams.gnome.members ++ (with maintainers; [ raskin ]);
+    platforms = platforms.all;
+    changelog = "https://gitlab.gnome.org/GNOME/gtk/-/raw/${version}/NEWS";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtk/hooks/clean-immodules-cache.sh b/nixpkgs/pkgs/development/libraries/gtk/hooks/clean-immodules-cache.sh
new file mode 100644
index 000000000000..0868a4a39101
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk/hooks/clean-immodules-cache.sh
@@ -0,0 +1,15 @@
+# shellcheck shell=bash
+
+fixupOutputHooks+=(_gtkCleanImmodulesCache)
+
+# Clean comments that link to generator of the file
+_gtkCleanImmodulesCache() {
+    # gtk_module_path is where the modules are installed
+    # https://gitlab.gnome.org/GNOME/gtk/-/blob/3.24.24/gtk/gtkmodules.c#L68
+    # gtk_binary_version can be retrived with:
+    # pkg-config --variable=gtk_binary_version gtk+-3.0
+    local f="${prefix:?}/lib/@gtk_module_path@/@gtk_binary_version@/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/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/patches/2.0-darwin-x11.patch b/nixpkgs/pkgs/development/libraries/gtk/patches/2.0-darwin-x11.patch
new file mode 100644
index 000000000000..9725cfb84260
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk/patches/2.0-darwin-x11.patch
@@ -0,0 +1,22 @@
+--- a/gdk/x11/gdkapplaunchcontext-x11.c
++++ b/gdk/x11/gdkapplaunchcontext-x11.c
+@@ -26,7 +26,6 @@
+ #include <unistd.h>
+ 
+ #include <glib.h>
+-#include <gio/gdesktopappinfo.h>
+ 
+ #include "gdkx.h"
+ #include "gdkapplaunchcontext.h"
+@@ -363,10 +362,7 @@
+   else
+     workspace_str = NULL;
+ 
+-  if (G_IS_DESKTOP_APP_INFO (info))
+-    application_id = g_desktop_app_info_get_filename (G_DESKTOP_APP_INFO (info));
+-  else
+-    application_id = NULL;
++  application_id = NULL;
+ 
+   startup_id = g_strdup_printf ("%s-%lu-%s-%s-%d_TIME%lu",
+                                 g_get_prgname (),
diff --git a/nixpkgs/pkgs/development/libraries/gtk/patches/2.0-immodules.cache.patch b/nixpkgs/pkgs/development/libraries/gtk/patches/2.0-immodules.cache.patch
new file mode 100644
index 000000000000..1b8231756e71
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk/patches/2.0-immodules.cache.patch
@@ -0,0 +1,27 @@
+--- a/gtk/gtkrc.c	2014-09-30 05:02:17.000000000 +0900
++++ b/gtk/gtkrc.c	2016-04-09 17:39:51.363288355 +0900
+@@ -445,5 +445,23 @@
+   if (var)
+     result = g_strdup (var);
+ 
++  // check NIX_PROFILES paths.
++  const gchar *nixProfilesEnv = g_getenv ("NIX_PROFILES");
++  gchar *cachePath;
++  guint i;
++
++  if(nixProfilesEnv && !result){
++    gchar **paths = g_strsplit(nixProfilesEnv, " ", -1);
++    for (i = 0; paths[i] != NULL; i++){
++      cachePath = g_build_filename(paths[i], "etc", "gtk-2.0", "immodules.cache", NULL);
++      if( g_file_test( cachePath, G_FILE_TEST_EXISTS) ){
++        if(result) g_free(result);
++        result = g_strdup(cachePath);
++      }
++      g_free(cachePath);
++    }
++    g_strfreev(paths);
++  }
++
+   if (!result)
+     {
+
diff --git a/nixpkgs/pkgs/development/libraries/gtk/patches/3.0-darwin-x11.patch b/nixpkgs/pkgs/development/libraries/gtk/patches/3.0-darwin-x11.patch
new file mode 100644
index 000000000000..86631634b5bd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk/patches/3.0-darwin-x11.patch
@@ -0,0 +1,28 @@
+--- a/gdk/x11/gdkapplaunchcontext-x11.c
++++ b/gdk/x11/gdkapplaunchcontext-x11.c
+@@ -27,7 +27,9 @@
+ #include "gdkprivate-x11.h"
+ 
+ #include <glib.h>
++#if defined(HAVE_GIO_UNIX) && !defined(__APPLE__)
+ #include <gio/gdesktopappinfo.h>
++#endif
+ 
+ #include <string.h>
+ #include <unistd.h>
+@@ -352,10 +354,15 @@
+   else
+     workspace_str = NULL;
+ 
++#if defined(HAVE_GIO_UNIX) && !defined(__APPLE__)
+   if (G_IS_DESKTOP_APP_INFO (info))
+     application_id = g_desktop_app_info_get_filename (G_DESKTOP_APP_INFO (info));
+   else
+     application_id = NULL;
++#else
++  application_id = NULL;
++#warning Please add support for creating AppInfo from id for your OS
++#endif
+ 
+   startup_id = g_strdup_printf ("%s-%lu-%s-%s-%d_TIME%lu",
+                                 g_get_prgname (),
diff --git a/nixpkgs/pkgs/development/libraries/gtk/patches/3.0-immodules.cache.patch b/nixpkgs/pkgs/development/libraries/gtk/patches/3.0-immodules.cache.patch
new file mode 100644
index 000000000000..bbe5f28dbd3e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk/patches/3.0-immodules.cache.patch
@@ -0,0 +1,27 @@
+--- a/gtk/deprecated/gtkrc.c	2016-04-02 18:43:08.401663112 +0900
++++ b/gtk/deprecated/gtkrc.c	2016-04-02 18:29:19.927608592 +0900
+@@ -774,5 +774,23 @@
+   if (var)
+     result = g_strdup (var);
+ 
++  // check NIX_PROFILES paths.
++  const gchar *nixProfilesEnv = g_getenv ("NIX_PROFILES");
++  gchar *cachePath;
++  guint i;
++
++  if(nixProfilesEnv && !result){
++    gchar **paths = g_strsplit(nixProfilesEnv, " ", -1);
++    for (i = 0; paths[i] != NULL; i++){
++      cachePath = g_build_filename(paths[i], "etc", "gtk-3.0", "immodules.cache", NULL);
++      if( g_file_test( cachePath, G_FILE_TEST_EXISTS) ){
++        if(result) g_free(result);
++        result = g_strdup(cachePath);
++      }
++      g_free(cachePath);
++    }
++    g_strfreev(paths);
++  }
++
+   if (!result)
+     {
+ 
diff --git a/nixpkgs/pkgs/development/libraries/gtk/patches/gtk2-theme-paths.patch b/nixpkgs/pkgs/development/libraries/gtk/patches/gtk2-theme-paths.patch
new file mode 100644
index 000000000000..edd69b078076
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtk/patches/gtk2-theme-paths.patch
@@ -0,0 +1,40 @@
+Subject: [PATCHv2] gtk: Patch GTK+ to look for themes in profiles.
+To: guix-devel@gnu.org
+Date: Sun, 13 Mar 2016 15:17:37 +1100
+Url: https://lists.gnu.org/archive/html/guix-devel/2016-03/msg00492.html
+
+diff -Naur gtk+-2.24.28.new/gtk/gtkrc.c gtk+-2.24.28/gtk/gtkrc.c
+--- gtk+-2.24.28.new/gtk/gtkrc.c	2016-03-13 10:31:14.413644362 +1100
++++ gtk+-2.24.28/gtk/gtkrc.c	2016-03-13 12:51:34.723398423 +1100
+@@ -808,6 +808,8 @@
+   gchar *path = NULL;
+   const gchar *home_dir;
+   gchar *subpath;
++  const gchar * const *xdg_data_dirs;
++  gint i;
+ 
+   if (type)
+     subpath = g_strconcat ("gtk-2.0-", type,
+@@ -830,6 +832,22 @@
+     }
+ 
+   if (!path)
++    {
++      xdg_data_dirs = g_get_system_data_dirs ();
++      for (i = 0; xdg_data_dirs[i]; i++)
++        {
++          path = g_build_filename (xdg_data_dirs[i], "themes", name, subpath, NULL);
++          if (g_file_test (path, G_FILE_TEST_EXISTS))
++            break;
++          else
++            {
++              g_free (path);
++              path = NULL;
++            }
++        }
++    }
++
++  if (!path)
+     {
+       gchar *theme_dir = gtk_rc_get_theme_dir ();
+       path = g_build_filename (theme_dir, name, subpath, NULL);
diff --git a/nixpkgs/pkgs/development/libraries/gtkd/default.nix b/nixpkgs/pkgs/development/libraries/gtkd/default.nix
new file mode 100644
index 000000000000..eaf8a94d137e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtkd/default.nix
@@ -0,0 +1,138 @@
+{ lib, stdenv, fetchzip, fetchpatch, atk, cairo, ldc, gdk-pixbuf, gnome, gst_all_1, librsvg
+, glib, gtk3, gtksourceview4, libgda, libpeas, pango, pkg-config, which, vte }:
+
+let
+  inherit (gst_all_1) gstreamer gst-plugins-base gst-plugins-bad;
+in stdenv.mkDerivation rec {
+  pname = "gtkd";
+  version = "3.9.0";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchzip {
+    url = "https://gtkd.org/Downloads/sources/GtkD-${version}.zip";
+    sha256 = "12kc4s5gp6gn456d8pzhww1ggi9qbxldmcpp6855297g2x8xxy5p";
+    stripRoot = false;
+  };
+
+  nativeBuildInputs = [ ldc pkg-config which ];
+  propagatedBuildInputs = [
+    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 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/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/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 \
+      --replace libgobject-2.0.so.0 ${glib.out}/lib/libgobject-2.0.so.0 \
+      --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/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
+  '';
+
+  makeFlags  = [
+    "prefix=${placeholder "out"}"
+    "PKG_CONFIG=${pkg-config}/bin/${pkg-config.targetPrefix}pkg-config"
+  ];
+
+  # The .pc files does not declare an `includedir=`, so the multiple
+  # outputs setup hook misses this.
+  postFixup = ''
+    for pc in $dev/lib/pkgconfig/*; do
+      substituteInPlace $pc \
+        --replace "$out/include" "$dev/include"
+    done
+  '';
+
+  meta = with lib; {
+    description = "D binding and OO wrapper for GTK";
+    homepage = "https://gtkd.org";
+    license = licenses.lgpl3Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtkd/paths.d b/nixpkgs/pkgs/development/libraries/gtkd/paths.d
new file mode 100644
index 000000000000..8793da440690
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtkd/paths.d
@@ -0,0 +1,142 @@
+/*
+ * gtkD 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 3
+ * of the License, or (at your option) any later version, with
+ * some exceptions, please read the COPYING file.
+ *
+ * gtkD 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 gtkD; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA
+ *
+ * paths.d  -- list of libraries that will be dynamically linked with gtkD
+ *
+ * Added:	John Reimer	-- 2004-12-20
+ * Updated: 2005-02-21 changed names; added version(linux)
+ * Updated: 2005-05-05 updated Linux support
+ * Updated: 2008-02-16 Tango support
+ */
+
+module gtkd.paths;
+
+/*
+ * Define the Libraries that gtkD will be using.
+ *   This is a growable list, as long as the programmer
+ *   also adds to the importLibs list.
+ */
+
+enum LIBRARY
+{
+	ATK,
+	CAIRO,
+	GDK,
+	GDKPIXBUF,
+	GLIB,
+	GMODULE,
+	GOBJECT,
+	GIO,
+	GTHREAD,
+	GTK,
+	PANGO,
+	PANGOCAIRO,
+	GLGDK,
+	GLGTK,
+	GDA,
+	GSV,
+	GSV1,
+	GSTREAMER,
+	GSTINTERFACES,
+	VTE,
+	PEAS,
+	RSVG,
+}
+
+version (Windows)
+{
+	const string[LIBRARY.max+1] importLibs =
+	[
+		LIBRARY.ATK:           "libatk-1.0-0.dll",
+		LIBRARY.CAIRO:         "libcairo-2.dll",
+		LIBRARY.GDK:           "libgdk-3-0.dll",
+		LIBRARY.GDKPIXBUF:     "libgdk_pixbuf-2.0-0.dll",
+		LIBRARY.GLIB:          "libglib-2.0-0.dll",
+		LIBRARY.GMODULE:       "libgmodule-2.0-0.dll",
+		LIBRARY.GOBJECT:       "libgobject-2.0-0.dll",
+		LIBRARY.GIO:           "libgio-2.0-0.dll",
+		LIBRARY.GTHREAD:       "libgthread-2.0-0.dll",
+		LIBRARY.GTK:           "libgtk-3-0.dll",
+		LIBRARY.PANGO:         "libpango-1.0-0.dll",
+		LIBRARY.PANGOCAIRO:    "libpangocairo-1.0-0.dll",
+		LIBRARY.GLGDK:         "libgdkglext-3.0-0.dll",
+		LIBRARY.GLGTK:         "libgtkglext-3.0-0.dll",
+		LIBRARY.GDA:           "libgda-4.0-4.dll",
+		LIBRARY.GSV:           "libgtksourceview-3.0-0.dll",
+		LIBRARY.GSV1:          "libgtksourceview-3.0-1.dll",
+		LIBRARY.GSTREAMER:     "libgstreamer-1.0.dll",
+		LIBRARY.GSTINTERFACES: "libgstvideo-1.0.dll",
+		LIBRARY.VTE:           "libvte-2.91.dll",
+		LIBRARY.PEAS:          "libpeas-1.0.dll",
+		LIBRARY.RSVG:          "librsvg-2-2.dll",
+	];
+}
+else version(darwin)
+{
+	const string[LIBRARY.max+1] importLibs =
+	[
+		LIBRARY.ATK:           "@atk@/lib/libatk-1.0.dylib",
+		LIBRARY.CAIRO:         "@cairo@/lib/libcairo.dylib",
+		LIBRARY.GDK:           "@gtk3@/lib/libgdk-3.0.dylib",
+		LIBRARY.GDKPIXBUF:     "@gdk_pixbuf@/lib/libgdk_pixbuf-2.0.dylib",
+		LIBRARY.GLIB:          "@glib@/lib/libglib-2.0.dylib",
+		LIBRARY.GMODULE:       "@glib@/lib/libgmodule-2.0.dylib",
+		LIBRARY.GOBJECT:       "@glib@/lib/libgobject-2.0.dylib",
+		LIBRARY.GIO:           "@glib@/lib/libgio-2.0.dylib",
+		LIBRARY.GTHREAD:       "@glib@/lib/libgthread-2.0.dylib",
+		LIBRARY.GTK:           "@gtk3@/lib/libgtk-3.0.dylib",
+		LIBRARY.PANGO:         "@pango@/lib/libpango-1.0.dylib",
+		LIBRARY.PANGOCAIRO:    "@pango@/lib/libpangocairo-1.0.dylib",
+		LIBRARY.GLGDK:         "libgdkglext-3.0.dylib",
+		LIBRARY.GLGTK:         "libgtkglext-3.0.dylib",
+		LIBRARY.GDA:           "@libgda@/lib/libgda-2.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",
+		LIBRARY.PEAS:          "@libpeas@/lib/libpeas-1.0.dylib",
+		LIBRARY.RSVG:          "@librsvg@/lib/librsvg-2.dylib",
+	];
+}
+else
+{
+	const string[LIBRARY.max+1] importLibs =
+	[
+		LIBRARY.ATK:           "@atk@/lib/libatk-1.0.so.0",
+		LIBRARY.CAIRO:         "@cairo@/lib/libcairo.so.2",
+		LIBRARY.GDK:           "@gtk3@/lib/libgdk-3.so.0",
+		LIBRARY.GDKPIXBUF:     "@gdk_pixbuf@/lib/libgdk_pixbuf-2.0.so.0",
+		LIBRARY.GLIB:          "@glib@/lib/libglib-2.0.so.0",
+		LIBRARY.GMODULE:       "@glib@/lib/libgmodule-2.0.so.0",
+		LIBRARY.GOBJECT:       "@glib@/lib/libgobject-2.0.so.0",
+		LIBRARY.GIO:           "@glib@/lib/libgio-2.0.so.0",
+		LIBRARY.GTHREAD:       "@glib@/lib/libgthread-2.0.so.0",
+		LIBRARY.GTK:           "@gtk3@/lib/libgtk-3.so.0",
+		LIBRARY.PANGO:         "@pango@/lib/libpango-1.0.so.0",
+		LIBRARY.PANGOCAIRO:    "@pango@/lib/libpangocairo-1.0.so.0",
+		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:           "@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",
+		LIBRARY.PEAS:          "@libpeas@/lib/libpeas-1.0.so.0",
+		LIBRARY.RSVG:          "@librsvg@/lib/librsvg-2.so.2",
+	];
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtkdatabox/default.nix b/nixpkgs/pkgs/development/libraries/gtkdatabox/default.nix
new file mode 100644
index 000000000000..ddab0046b660
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtkdatabox/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, pkg-config, gtk2 }:
+
+stdenv.mkDerivation rec {
+  name = "gtkdatabox-0.9.3.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/gtkdatabox/${name}.tar.gz";
+    sha256 = "1rdxnjgh6v3yjqgsfmamyzpfxckzchps4kqvvz88nifmd7ckhjfh";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  propagatedBuildInputs = [ gtk2 ];
+
+  meta = {
+    description = "GTK widget for displaying large amounts of numerical data";
+
+    license = lib.licenses.lgpl2;
+
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtkextra/default.nix b/nixpkgs/pkgs/development/libraries/gtkextra/default.nix
new file mode 100644
index 000000000000..4c2f739cd965
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtkextra/default.nix
@@ -0,0 +1,42 @@
+{ stdenv
+, lib
+, fetchurl
+, pkg-config
+, gobject-introspection
+, file
+, gtk2
+, glib
+, cairo
+, atk
+, pango
+, libtiff
+, libpng
+, libjpeg
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gtkextra";
+  version = "3.3.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/gtkextra/${lib.versions.majorMinor version}/${pname}-${version}.tar.gz";
+    sha256 = "1mpihbyzhv3ymfim93l9xnxmzhwyqdba5xb4rdn5vggdg25766v5";
+  };
+
+  postPatch = ''
+    substituteInPlace configure \
+      --replace "/usr/bin/file" "${file}/bin/file"
+  '';
+
+  nativeBuildInputs = [ gobject-introspection pkg-config ];
+
+  buildInputs = [ gtk2 glib cairo atk pango libtiff libpng libjpeg ];
+
+  meta = with lib; {
+    homepage = "http://gtkextra.sourceforge.net/";
+    description = "GtkExtra is a useful set of widgets for creating GUI's for GTK+.";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ tesq0 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtkimageview/default.nix b/nixpkgs/pkgs/development/libraries/gtkimageview/default.nix
new file mode 100644
index 000000000000..1e910e3bcf40
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtkimageview/default.nix
@@ -0,0 +1,40 @@
+{ fetchurl, lib, stdenv, pkg-config, gtk2 }:
+
+stdenv.mkDerivation rec {
+  pname = "gtkimageview";
+  version = "1.6.4";
+
+  src = fetchurl {
+    url = "https://sources.archlinux.org/other/packages/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "1wj63af9j9p5i067lpwi9lxvwalamakrmklvl983kvi7s4w1ss2c";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ gtk2 ];
+
+  preConfigure = ''
+    sed '/DEPRECATED_FLAGS/d' -i configure
+    sed 's/-Wall -Werror//' -i configure
+  '';
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://wiki.gnome.org/Projects/GTK%2B/GtkImageView";
+
+    description = "Image viewer widget for GTK";
+
+    longDescription =
+      '' GtkImageView is a simple image viewer widget for GTK.  Similar to
+         the image viewer panes in gThumb or Eye of Gnome.  It makes writing
+         image viewing and editing applications easy.  Among its features
+         are: mouse and keyboard zooming; scrolling and dragging; adjustable
+         interpolation; GIF animation support.
+       '';
+
+    license = lib.licenses.lgpl2Plus;
+
+    maintainers = [ ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtkmathview/default.nix b/nixpkgs/pkgs/development/libraries/gtkmathview/default.nix
new file mode 100644
index 000000000000..b5399553f960
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtkmathview/default.nix
@@ -0,0 +1,29 @@
+{lib, stdenv, fetchurl, pkg-config, gtk2, t1lib, glib, libxml2, popt, gmetadom ? null }:
+
+let
+  pname = "gtkmathview";
+  version = "0.8.0";
+in
+
+stdenv.mkDerivation {
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "http://helm.cs.unibo.it/mml-widget/sources/${pname}-${version}.tar.gz";
+    sha256 = "0hwcamf5fi35frg7q6kgisc9v0prqbhsplb2gl55cg3av9sh3hqx";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ t1lib glib gmetadom libxml2 popt];
+  propagatedBuildInputs = [gtk2 t1lib];
+
+  patches = [ ./gcc-4.3-build-fixes.patch ./gcc-4.4-build-fixes.patch ];
+
+  meta = {
+    homepage = "http://helm.cs.unibo.it/mml-widget/";
+    description = "C++ rendering engine for MathML documents";
+    license = lib.licenses.lgpl3Plus;
+    maintainers = [ lib.maintainers.roconnor ];
+    broken = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtkmathview/gcc-4.3-build-fixes.patch b/nixpkgs/pkgs/development/libraries/gtkmathview/gcc-4.3-build-fixes.patch
new file mode 100644
index 000000000000..14ad594b38b8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtkmathview/gcc-4.3-build-fixes.patch
@@ -0,0 +1,74 @@
+From: Stefano Zacchiroli <zack@upsilon.cc>
+Date: Fri, 11 Dec 2009 12:58:56 +0100
+Subject: [PATCH] gcc 4.3 build fixes
+
+---
+ mathmlps/main.cc                    |    1 +
+ mathmlsvg/SMS.cc                    |    1 +
+ mathmlsvg/main.cc                   |    1 +
+ src/backend/ps/T1_FontDataBase.cc   |    2 +-
+ src/engine/mathml/mathVariantAux.cc |    1 +
+ 5 files changed, 5 insertions(+), 1 deletions(-)
+
+diff --git a/mathmlps/main.cc b/mathmlps/main.cc
+index cc6cd1c..48339af 100644
+--- a/mathmlps/main.cc
++++ b/mathmlps/main.cc
+@@ -19,6 +19,7 @@
+ #include <config.h>
+ 
+ #include <cassert>
++#include <cstring>
+ #include <fstream>
+ 
+ #include <popt.h>
+diff --git a/mathmlsvg/SMS.cc b/mathmlsvg/SMS.cc
+index a76266e..be7add8 100644
+--- a/mathmlsvg/SMS.cc
++++ b/mathmlsvg/SMS.cc
+@@ -18,6 +18,7 @@
+ 
+ #include <config.h>
+ 
++#include <cstring>
+ #include <sstream>
+ #include "defs.h"
+ #include "AbstractLogger.hh"
+diff --git a/mathmlsvg/main.cc b/mathmlsvg/main.cc
+index 259d67e..c49e8ac 100644
+--- a/mathmlsvg/main.cc
++++ b/mathmlsvg/main.cc
+@@ -19,6 +19,7 @@
+ #include <config.h>
+ 
+ #include <cassert>
++#include <cstring>
+ #include <fstream>
+ 
+ #include <popt.h>
+diff --git a/src/backend/ps/T1_FontDataBase.cc b/src/backend/ps/T1_FontDataBase.cc
+index b6490eb..3dd436c 100644
+--- a/src/backend/ps/T1_FontDataBase.cc
++++ b/src/backend/ps/T1_FontDataBase.cc
+@@ -19,7 +19,7 @@
+ #include <t1lib.h>
+ #include <config.h>
+ #include <map>
+-#include <string>
++#include <cstring>
+ #include <stdlib.h>
+ #include <iostream>
+ #include <list>
+diff --git a/src/engine/mathml/mathVariantAux.cc b/src/engine/mathml/mathVariantAux.cc
+index 736acc1..dcf1826 100644
+--- a/src/engine/mathml/mathVariantAux.cc
++++ b/src/engine/mathml/mathVariantAux.cc
+@@ -19,6 +19,7 @@
+ #include <config.h>
+ 
+ #include <cassert>
++#include <cstring>
+ 
+ #include "mathVariantAux.hh"
+ 
+-- 
diff --git a/nixpkgs/pkgs/development/libraries/gtkmathview/gcc-4.4-build-fixes.patch b/nixpkgs/pkgs/development/libraries/gtkmathview/gcc-4.4-build-fixes.patch
new file mode 100644
index 000000000000..0ebd31ef2a78
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtkmathview/gcc-4.4-build-fixes.patch
@@ -0,0 +1,21 @@
+From: Stefano Zacchiroli <zack@upsilon.cc>
+Date: Fri, 11 Dec 2009 13:26:26 +0100
+Subject: [PATCH] gcc 4.4 build fixes
+
+---
+ src/common/AbstractLogger.cc |    1 +
+ 1 files changed, 1 insertions(+), 0 deletions(-)
+
+diff --git a/src/common/AbstractLogger.cc b/src/common/AbstractLogger.cc
+index 6f638fb..c5b7e3d 100644
+--- a/src/common/AbstractLogger.cc
++++ b/src/common/AbstractLogger.cc
+@@ -19,6 +19,7 @@
+ #include <config.h>
+ 
+ #include <stdarg.h>
++#include <stdio.h>
+ 
+ #include "AbstractLogger.hh"
+ 
+-- 
diff --git a/nixpkgs/pkgs/development/libraries/gtkmm/2.x.nix b/nixpkgs/pkgs/development/libraries/gtkmm/2.x.nix
new file mode 100644
index 000000000000..cf26e22da5bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtkmm/2.x.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchurl, pkg-config, gtk2, glibmm, cairomm, pangomm, atkmm }:
+
+stdenv.mkDerivation rec {
+  name = "gtkmm-${minVer}.5";
+  minVer = "2.24";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gtkmm/${minVer}/${name}.tar.xz";
+    sha256 = "0680a53b7bf90b4e4bf444d1d89e6df41c777e0bacc96e9c09fc4dd2f5fe6b72";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  propagatedBuildInputs = [ glibmm gtk2 atkmm cairomm pangomm ];
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "C++ interface to the GTK graphical user interface library";
+
+    longDescription = ''
+      gtkmm is the official C++ interface for the popular GUI library
+      GTK.  Highlights include typesafe callbacks, and a
+      comprehensive set of widgets that are easily extensible via
+      inheritance.  You can create user interfaces either in code or
+      with the Glade User Interface designer, using libglademm.
+      There's extensive documentation, including API reference and a
+      tutorial.
+    '';
+
+    homepage = "https://gtkmm.org/";
+
+    license = lib.licenses.lgpl2Plus;
+
+    maintainers = with lib.maintainers; [ raskin ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtkmm/3.x.nix b/nixpkgs/pkgs/development/libraries/gtkmm/3.x.nix
new file mode 100644
index 000000000000..2e43e58db42d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtkmm/3.x.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, fetchurl, pkg-config, meson, ninja, python3, gtk3, glibmm, cairomm, pangomm, atkmm, epoxy, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "gtkmm";
+  version = "3.24.5";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1ri2msp3cmzi6r65ghwb8gfavfaxv0axpwi3q60nm7v8hvg36qw5";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ pkg-config meson ninja python3 ];
+  buildInputs = [ epoxy ];
+
+  propagatedBuildInputs = [ glibmm gtk3 atkmm cairomm pangomm ];
+
+  # https://bugzilla.gnome.org/show_bug.cgi?id=764521
+  doCheck = false;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      attrPath = "${pname}3";
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "C++ interface to the GTK graphical user interface library";
+
+    longDescription = ''
+      gtkmm is the official C++ interface for the popular GUI library
+      GTK.  Highlights include typesafe callbacks, and a
+      comprehensive set of widgets that are easily extensible via
+      inheritance.  You can create user interfaces either in code or
+      with the Glade User Interface designer, using libglademm.
+      There's extensive documentation, including API reference and a
+      tutorial.
+    '';
+
+    homepage = "https://gtkmm.org/";
+
+    license = licenses.lgpl2Plus;
+
+    maintainers = with maintainers; [ raskin ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtkmm/4.x.nix b/nixpkgs/pkgs/development/libraries/gtkmm/4.x.nix
new file mode 100644
index 000000000000..0a654d9518dc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtkmm/4.x.nix
@@ -0,0 +1,91 @@
+{ stdenv
+, lib
+, fetchurl
+, pkg-config
+, meson
+, ninja
+, python3
+, gtk4
+, glibmm_2_68
+, cairomm_1_16
+, pangomm_2_48
+, epoxy
+, gnome
+, makeFontsConf
+, xvfb-run
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gtkmm";
+  version = "4.2.0";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "12x9j82y37r4v0ngs22rzp4wmw7k2bbb9d3bymcczzz7y8w4q328";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    meson
+    ninja
+    python3
+  ];
+
+  buildInputs = [
+    epoxy
+  ];
+
+  propagatedBuildInputs = [
+    glibmm_2_68
+    gtk4
+    cairomm_1_16
+    pangomm_2_48
+  ];
+
+  checkInputs = [
+    xvfb-run
+  ];
+
+  # Tests require fontconfig.
+  FONTCONFIG_FILE = makeFontsConf {
+    fontDirectories = [ ];
+  };
+
+  doCheck = true;
+
+  checkPhase = ''
+    runHook preCheck
+
+    xvfb-run -s '-screen 0 800x600x24' \
+      meson test --print-errorlogs
+
+    runHook postCheck
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      attrPath = "${pname}4";
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "C++ interface to the GTK graphical user interface library";
+    longDescription = ''
+      gtkmm is the official C++ interface for the popular GUI library
+      GTK.  Highlights include typesafe callbacks, and a
+      comprehensive set of widgets that are easily extensible via
+      inheritance.  You can create user interfaces either in code or
+      with the Glade User Interface designer, using libglademm.
+      There's extensive documentation, including API reference and a
+      tutorial.
+    '';
+    homepage = "https://gtkmm.org/";
+    license = licenses.lgpl2Plus;
+    maintainers = teams.gnome.members ++ (with maintainers; [ raskin ]);
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtksourceview/3.x-nix_share_path.patch b/nixpkgs/pkgs/development/libraries/gtksourceview/3.x-nix_share_path.patch
new file mode 100644
index 000000000000..c87350167c25
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtksourceview/3.x-nix_share_path.patch
@@ -0,0 +1,11 @@
+--- a/gtksourceview/gtksourceview-utils.c	2014-07-13 16:13:57.418687726 +0200
++++ b/gtksourceview/gtksourceview-utils.c	2014-07-13 16:14:20.550847767 +0200
+@@ -68,6 +68,8 @@
+ 							 basename,
+ 							 NULL));
+ 
++        g_ptr_array_add (dirs, g_build_filename ("@NIX_SHARE_PATH@", SOURCEVIEW_DIR, basename, NULL));
++
+ 	g_ptr_array_add (dirs, NULL);
+ 
+ 	return (gchar**) g_ptr_array_free (dirs, FALSE);
diff --git a/nixpkgs/pkgs/development/libraries/gtksourceview/3.x.nix b/nixpkgs/pkgs/development/libraries/gtksourceview/3.x.nix
new file mode 100644
index 000000000000..dce589dd6474
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtksourceview/3.x.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchurl, pkg-config, atk, cairo, glib, gtk3, pango, vala
+, libxml2, perl, intltool, gettext, gobject-introspection, dbus, xvfb-run, shared-mime-info }:
+
+stdenv.mkDerivation rec {
+  pname = "gtksourceview";
+  version = "3.24.11";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gtksourceview/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1zbpj283b5ycz767hqz5kdq02wzsga65pp4fykvhg8xj6x50f6v9";
+  };
+
+  propagatedBuildInputs = [
+    # Required by gtksourceview-3.0.pc
+    gtk3
+    # Used by gtk_source_language_manager_guess_language
+    shared-mime-info
+  ];
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ pkg-config intltool perl gobject-introspection vala ];
+
+  checkInputs = [ xvfb-run dbus ];
+
+  buildInputs = [ atk cairo glib pango libxml2 gettext ];
+
+  preBuild = ''
+    substituteInPlace gtksourceview/gtksourceview-utils.c --replace "@NIX_SHARE_PATH@" "$out/share"
+  '';
+
+  patches = [ ./3.x-nix_share_path.patch ];
+
+  enableParallelBuilding = true;
+
+  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
+  '';
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Projects/GtkSourceView";
+    platforms = with platforms; linux ++ darwin;
+    license = licenses.lgpl21;
+    maintainers = teams.gnome.members;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtksourceview/4.x-nix_share_path.patch b/nixpkgs/pkgs/development/libraries/gtksourceview/4.x-nix_share_path.patch
new file mode 100644
index 000000000000..a35d9a88d0df
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtksourceview/4.x-nix_share_path.patch
@@ -0,0 +1,11 @@
+--- a/gtksourceview/gtksourceutils.c
++++ b/gtksourceview/gtksourceutils.c
+@@ -232,6 +232,8 @@
+ 							 NULL));
+ 	}
+ 
++	g_ptr_array_add (dirs, g_build_filename (DATADIR, GSV_DATA_SUBDIR, basename, NULL));
++
+ 	g_ptr_array_add (dirs, NULL);
+ 
+ 	return (gchar **) g_ptr_array_free (dirs, FALSE);
diff --git a/nixpkgs/pkgs/development/libraries/gtksourceview/4.x.nix b/nixpkgs/pkgs/development/libraries/gtksourceview/4.x.nix
new file mode 100644
index 000000000000..eb92586ce84a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtksourceview/4.x.nix
@@ -0,0 +1,109 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchpatch
+, meson
+, ninja
+, pkg-config
+, atk
+, cairo
+, glib
+, gtk3
+, pango
+, fribidi
+, vala
+, libxml2
+, perl
+, gettext
+, gnome
+, gobject-introspection
+, dbus
+, xvfb-run
+, shared-mime-info
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gtksourceview";
+  version = "4.8.1";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0WPXG1/K+8Wx7sbdhB7b283dOnURzV/c/9hri7/mmsE=";
+  };
+
+  patches = [
+    # By default, the library loads syntaxes from XDG_DATA_DIRS and user directory
+    # but not from its own datadr (it assumes it will be in XDG_DATA_DIRS).
+    # Since this is not generally true with Nix, let’s add $out/share unconditionally.
+    ./4.x-nix_share_path.patch
+
+    # fixes intermittent "gtksourceview-gresources.h: no such file" errors
+    (fetchpatch {
+      name = "ensure-access-to-resources-in-corelib-build.patch";
+      url = "https://gitlab.gnome.org/GNOME/gtksourceview/-/commit/9bea9d1c4a56310701717bb106c52a5324ee392a.patch";
+      sha256 = "sha256-rSB6lOFEyz58HfOSj7ZM48/tHxhqbtWWbh60JuySAZ0=";
+    })
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gettext
+    perl
+    gobject-introspection
+    vala
+  ];
+
+  buildInputs = [
+    atk
+    cairo
+    glib
+    pango
+    fribidi
+    libxml2
+  ];
+
+  propagatedBuildInputs = [
+    # Required by gtksourceview-4.0.pc
+    gtk3
+    # Used by gtk_source_language_manager_guess_language
+    shared-mime-info
+  ];
+
+  checkInputs = [
+    xvfb-run
+    dbus
+  ];
+
+  doCheck = stdenv.isLinux;
+
+  checkPhase = ''
+    runHook preCheck
+
+    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 \
+      meson test --no-rebuild --print-errorlogs
+
+    runHook postCheck
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = "gtksourceview";
+      attrPath = "gtksourceview4";
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "Source code editing widget for GTK";
+    homepage = "https://wiki.gnome.org/Projects/GtkSourceView";
+    platforms = platforms.unix;
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtksourceview/5.x.nix b/nixpkgs/pkgs/development/libraries/gtksourceview/5.x.nix
new file mode 100644
index 000000000000..fd4a420012c3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtksourceview/5.x.nix
@@ -0,0 +1,99 @@
+{ lib
+, stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, glib
+, pcre2
+, gtk4
+, pango
+, fribidi
+, vala
+, libxml2
+, perl
+, gettext
+, gnome
+, gobject-introspection
+, dbus
+, xvfb-run
+, shared-mime-info
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gtksourceview";
+  version = "5.0.0";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1hyrmh9r1zd5kjh5ch9d7bhk2kphbqhm7ijfxfkcdln8q0rnd0k4";
+  };
+
+  patches = [
+    # By default, the library loads syntaxes from XDG_DATA_DIRS and user directory
+    # but not from its own datadr (it assumes it will be in XDG_DATA_DIRS).
+    # Since this is not generally true with Nix, let’s add $out/share unconditionally.
+    ./4.x-nix_share_path.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gettext
+    perl
+    gobject-introspection
+    vala
+  ];
+
+  buildInputs = [
+    glib
+    pcre2
+    pango
+    fribidi
+    libxml2
+  ];
+
+  propagatedBuildInputs = [
+    # Required by gtksourceview-5.0.pc
+    gtk4
+    # Used by gtk_source_language_manager_guess_language
+    shared-mime-info
+  ];
+
+  checkInputs = [
+    xvfb-run
+    dbus
+  ];
+
+  doCheck = stdenv.isLinux;
+
+  checkPhase = ''
+    runHook preCheck
+
+    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 \
+      meson test --no-rebuild --print-errorlogs
+
+    runHook postCheck
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = "gtksourceview";
+      attrPath = "gtksourceview5";
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "Source code editing widget for GTK";
+    homepage = "https://wiki.gnome.org/Projects/GtkSourceView";
+    platforms = platforms.unix;
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtksourceviewmm/4.x.nix b/nixpkgs/pkgs/development/libraries/gtksourceviewmm/4.x.nix
new file mode 100644
index 000000000000..3011a126c10d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtksourceviewmm/4.x.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, pkg-config, gtkmm3, glibmm, gtksourceview4, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "gtksourceviewmm";
+  version = "3.91.1";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "088p2ch1b4fvzl9416nw3waj0pqgp31cd5zj4lx5hzzrq2afgapy";
+  };
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  propagatedBuildInputs = [ glibmm gtkmm3 gtksourceview4 ];
+
+  meta = with lib; {
+    platforms = platforms.linux;
+    homepage = "https://developer.gnome.org/gtksourceviewmm/";
+    description = "C++ wrapper for gtksourceview";
+    license = licenses.lgpl2;
+    maintainers = teams.gnome.members;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/gtksourceviewmm/default.nix b/nixpkgs/pkgs/development/libraries/gtksourceviewmm/default.nix
new file mode 100644
index 000000000000..2b9124032590
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtksourceviewmm/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, pkg-config, gtkmm3, glibmm, gtksourceview3, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "gtksourceviewmm";
+  version = "3.21.3";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gtksourceviewmm/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1danc9mp5mnb65j01qxkwj92z8jf1gns41wbgp17qh7050f0pc6v";
+  };
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = "gtksourceviewmm";
+      versionPolicy = "none";
+    };
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ glibmm gtkmm3 gtksourceview3 ];
+
+  meta = with lib; {
+    platforms = platforms.unix;
+    homepage = "https://developer.gnome.org/gtksourceviewmm/";
+    description = "C++ wrapper for gtksourceview";
+    license = licenses.lgpl2;
+    maintainers = [ maintainers.juliendehos ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/gtkspell/3.nix b/nixpkgs/pkgs/development/libraries/gtkspell/3.nix
new file mode 100644
index 000000000000..d3a1a178856b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtkspell/3.nix
@@ -0,0 +1,30 @@
+{lib, stdenv, fetchurl, gtk3, aspell, pkg-config, enchant, isocodes, intltool, gobject-introspection, vala}:
+
+stdenv.mkDerivation rec {
+  pname = "gtkspell";
+  version = "3.0.10";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "mirror://sourceforge/gtkspell/gtkspell3-${version}.tar.xz";
+    sha256 = "0cjp6xdcnzh6kka42w9g0w2ihqjlq8yl8hjm9wsfnixk6qwgch5h";
+  };
+
+  nativeBuildInputs = [ pkg-config intltool gobject-introspection vala ];
+  buildInputs = [ aspell gtk3 enchant isocodes ];
+  propagatedBuildInputs = [ enchant ];
+
+  configureFlags = [
+    "--enable-introspection"
+    "--enable-vala"
+  ];
+
+  meta = with lib; {
+    homepage = "http://gtkspell.sourceforge.net/";
+    description = "Word-processor-style highlighting GtkTextView widget";
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtkspell/default.nix b/nixpkgs/pkgs/development/libraries/gtkspell/default.nix
new file mode 100644
index 000000000000..aca6ccdcccbc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtkspell/default.nix
@@ -0,0 +1,21 @@
+{lib, stdenv, fetchurl, gtk2, aspell, pkg-config, enchant, intltool}:
+
+stdenv.mkDerivation rec {
+  pname = "gtkspell";
+  version = "2.0.16";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/gtkspell/${pname}-${version}.tar.gz";
+    sha256 = "00hdv28bp72kg1mq2jdz1sdw2b8mb9iclsp7jdqwpck705bdriwg";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [aspell gtk2 enchant intltool];
+
+  meta = with lib; {
+    description = "Word-processor-style highlighting and replacement of misspelled words";
+    homepage = "http://gtkspell.sourceforge.net";
+    platforms = platforms.unix;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gtkspellmm/default.nix b/nixpkgs/pkgs/development/libraries/gtkspellmm/default.nix
new file mode 100644
index 000000000000..31380b5ab793
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gtkspellmm/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl
+, pkg-config
+, gtk3, glib, glibmm, gtkmm3, gtkspell3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gtkspellmm";
+  version = "3.0.5";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/gtkspell/gtkspellmm/" +
+          "${pname}-${version}.tar.xz";
+    sha256 = "0i8mxwyfv5mskachafa4qlh315q0cfph7s66s1s34nffadbmm1sv";
+  };
+
+  propagatedBuildInputs = [
+    gtkspell3
+  ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    gtk3 glib glibmm gtkmm3
+  ];
+
+  meta = with lib; {
+    description = "C++ binding for the gtkspell library";
+    homepage = "http://gtkspell.sourceforge.net/";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gts/default.nix b/nixpkgs/pkgs/development/libraries/gts/default.nix
new file mode 100644
index 000000000000..815dfb634c9f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gts/default.nix
@@ -0,0 +1,48 @@
+{ fetchurl, lib, stdenv, pkg-config, autoreconfHook, gettext, glib, buildPackages }:
+
+
+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 = [
+    pkg-config
+    autoreconfHook
+    glib  # required to satisfy AM_PATH_GLIB_2_0
+  ];
+  buildInputs = [ gettext ];
+  propagatedBuildInputs = [ glib ];
+
+  doCheck = false; # fails with "permission denied"
+
+  preBuild = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+    pushd src
+    make CC=${buildPackages.stdenv.cc}/bin/cc predicates_init
+    mv predicates_init predicates_init_build
+    make clean
+    popd
+
+    substituteInPlace src/Makefile --replace "./predicates_init" "./predicates_init_build"
+  '';
+
+  meta = {
+    homepage = "http://gts.sourceforge.net/";
+    license = lib.licenses.lgpl2Plus;
+    description = "GNU Triangulated Surface Library";
+
+    longDescription = ''
+      Library intended to provide a set of useful functions to deal with
+      3D surfaces meshed with interconnected triangles.
+    '';
+
+    maintainers = [ lib.maintainers.viric ];
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gumbo/default.nix b/nixpkgs/pkgs/development/libraries/gumbo/default.nix
new file mode 100644
index 000000000000..91053828b586
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gumbo/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool }:
+
+stdenv.mkDerivation rec {
+  pname = "gumbo";
+  version = "0.10.1";
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "gumbo-parser";
+    rev = "v${version}";
+    sha256 = "0xslckwdh2i0g2qjsb6rnm8mjmbagvziz0hjlf7d1lbljfms1iw1";
+  };
+
+  buildInputs = [ autoconf automake libtool ];
+
+  preConfigure = "./autogen.sh";
+
+  meta = with lib; {
+    description = "C99 HTML parsing algorithm";
+    homepage = "https://github.com/google/gumbo-parser";
+    maintainers = [ maintainers.nico202 ];
+    platforms = with platforms; linux ++ darwin;
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gupnp-av/default.nix b/nixpkgs/pkgs/development/libraries/gupnp-av/default.nix
new file mode 100644
index 000000000000..8d800f979402
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gupnp-av/default.nix
@@ -0,0 +1,58 @@
+{ lib, stdenv
+, fetchurl
+, pkg-config
+, gobject-introspection
+, vala
+, gtk-doc
+, docbook_xsl
+, docbook_xml_dtd_412
+, glib
+, libxml2
+, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gupnp-av";
+  version = "0.12.11";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1p3grslwqm9bc8rmpn4l48d7v9s84nina4r9xbd932dbj8acz7b8";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    gobject-introspection
+    vala
+    gtk-doc
+    docbook_xsl
+    docbook_xml_dtd_412
+  ];
+
+  buildInputs = [
+    glib
+    libxml2
+  ];
+
+  configureFlags = [
+    "--enable-gtk-doc"
+  ];
+
+  doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "http://gupnp.org/";
+    description = "A collection of helpers for building AV (audio/video) applications using GUPnP";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gupnp-dlna/default.nix b/nixpkgs/pkgs/development/libraries/gupnp-dlna/default.nix
new file mode 100644
index 000000000000..f9efe352a84b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gupnp-dlna/default.nix
@@ -0,0 +1,63 @@
+{ lib, stdenv
+, fetchurl
+, pkg-config
+, gobject-introspection
+, vala
+, gtk-doc
+, docbook_xsl
+, docbook_xml_dtd_412
+, libxml2
+, gst_all_1
+, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gupnp-dlna";
+  version = "0.10.5";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0spzd2saax7w776p5laixdam6d7smyynr9qszhbmq7f14y13cghj";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    gobject-introspection
+    vala
+    gtk-doc
+    docbook_xsl
+    docbook_xml_dtd_412
+  ];
+
+  buildInputs = [
+    libxml2
+    gst_all_1.gst-plugins-base
+  ];
+
+  configureFlags = [
+    "--enable-gtk-doc"
+  ];
+
+  doCheck = true;
+
+  postPatch = ''
+    chmod +x tests/test-discoverer.sh.in
+    patchShebangs tests/test-discoverer.sh.in
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Projects/GUPnP/";
+    description = "Library to ease DLNA-related bits for applications using GUPnP";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gupnp-igd/default.nix b/nixpkgs/pkgs/development/libraries/gupnp-igd/default.nix
new file mode 100644
index 000000000000..6eb44b9172ab
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gupnp-igd/default.nix
@@ -0,0 +1,64 @@
+{ lib, stdenv
+, fetchurl
+, pkg-config
+, meson
+, ninja
+, gettext
+, gobject-introspection
+, gtk-doc
+, docbook_xsl
+, docbook_xml_dtd_412
+, glib
+, gupnp
+, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gupnp-igd";
+  version = "1.2.0";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-S1EgCYqhPt0ngYup7k1/6WG/VAv1DQVv9wPGFUXgK+E=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    meson
+    ninja
+    gettext
+    gobject-introspection
+    gtk-doc
+    docbook_xsl
+    docbook_xml_dtd_412
+  ];
+
+  propagatedBuildInputs = [
+    glib
+    gupnp
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=true"
+  ];
+
+  # Seems to get stuck sometimes.
+  # https://github.com/NixOS/nixpkgs/issues/119288
+  #doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "Library to handle UPnP IGD port mapping";
+    homepage = "http://www.gupnp.org/";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gupnp/default.nix b/nixpkgs/pkgs/development/libraries/gupnp/default.nix
new file mode 100644
index 000000000000..c91d25123f61
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gupnp/default.nix
@@ -0,0 +1,81 @@
+{ lib, stdenv
+, fetchurl
+, fetchpatch
+, meson
+, ninja
+, pkg-config
+, gobject-introspection
+, vala
+, gtk-doc
+, docbook_xsl
+, docbook_xml_dtd_412
+, docbook_xml_dtd_44
+, glib
+, gssdp
+, libsoup
+, libxml2
+, libuuid
+, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gupnp";
+  version = "1.2.4";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/gupnp/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-96AwfqUfXkTRuDL0k92QRURKOk4hHvhd/Zql3W6up9E=";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "CVE-2021-33516.patch";
+      url = "https://gitlab.gnome.org/GNOME/gupnp/-/commit/ca6ec9dcb26fd7a2a630eb6a68118659b589afac.patch";
+      sha256 = "sha256-G7e/xNQB7Kp2fPzqVeD/cH3h1co9hZXh55QOUBnAnvU=";
+    })
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gobject-introspection
+    vala
+    gtk-doc
+    docbook_xsl
+    docbook_xml_dtd_412
+    docbook_xml_dtd_44
+  ];
+
+  buildInputs = [
+    libuuid
+  ];
+
+  propagatedBuildInputs = [
+    glib
+    gssdp
+    libsoup
+    libxml2
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=true"
+  ];
+
+  doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+    };
+  };
+
+  meta = with lib; {
+    homepage = "http://www.gupnp.org/";
+    description = "An implementation of the UPnP specification";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gusb/default.nix b/nixpkgs/pkgs/development/libraries/gusb/default.nix
new file mode 100644
index 000000000000..449a7a17623b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gusb/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchurl, substituteAll, meson, ninja, pkg-config, gettext, gobject-introspection
+, gtk-doc, docbook_xsl, docbook_xml_dtd_412, docbook_xml_dtd_44, python3
+, glib, systemd, libusb1, vala, hwdata
+}:
+
+let
+  pythonEnv = python3.withPackages(ps: with ps; [
+    setuptools
+  ]);
+in
+stdenv.mkDerivation rec {
+  pname = "gusb";
+  version = "0.3.7";
+
+  outputs = [ "bin" "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "https://people.freedesktop.org/~hughsient/releases/libgusb-${version}.tar.xz";
+    sha256 = "sha256-2l8l1oc2ImibM1FIbL4CjvwlRAP2Rt2BIl3+hULYxn0=";
+  };
+
+  patches = [
+    (substituteAll {
+      src = ./fix-python-path.patch;
+      python = "${pythonEnv}/bin/python3";
+    })
+  ];
+
+  nativeBuildInputs = [
+    meson ninja pkg-config gettext pythonEnv
+    gtk-doc docbook_xsl docbook_xml_dtd_412 docbook_xml_dtd_44
+    gobject-introspection vala
+  ];
+  buildInputs = [ systemd glib ];
+
+  propagatedBuildInputs = [ libusb1 ];
+
+  mesonFlags = [
+    "-Dusb_ids=${hwdata}/share/hwdata/usb.ids"
+  ];
+
+  doCheck = false; # tests try to access USB
+
+  meta = with lib; {
+    description = "GLib libusb wrapper";
+    homepage = "https://github.com/hughsie/libgusb";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.marcweber ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/gusb/fix-python-path.patch b/nixpkgs/pkgs/development/libraries/gusb/fix-python-path.patch
new file mode 100644
index 000000000000..5f04387a537e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gusb/fix-python-path.patch
@@ -0,0 +1,14 @@
+diff --git a/gusb/meson.build b/gusb/meson.build
+index 8236a2b..282aa48 100644
+--- a/gusb/meson.build
++++ b/gusb/meson.build
+@@ -147,7 +147,7 @@ libgusb_gir = libgusb_girtarget[0]
+ libgusb_typelib = libgusb_girtarget[1]
+ 
+ pymod = import('python')
+-py_installation = pymod.find_installation()
++py_installation = pymod.find_installation('@python@')
+ 
+ # Verify the map file is correct -- note we can't actually use the generated
+ # file for two reasons:
+
diff --git a/nixpkgs/pkgs/development/libraries/gvfs/default.nix b/nixpkgs/pkgs/development/libraries/gvfs/default.nix
new file mode 100644
index 000000000000..547c35e66eca
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/gvfs/default.nix
@@ -0,0 +1,132 @@
+{ lib, stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, gettext
+, dbus
+, glib
+, libgudev
+, udisks2
+, libgcrypt
+, libcap
+, polkit
+, libgphoto2
+, avahi
+, libarchive
+, fuse3
+, libcdio
+, libxml2
+, libxslt
+, docbook_xsl
+, docbook_xml_dtd_42
+, samba
+, libmtp
+, gnomeSupport ? false
+, gnome
+, gcr
+, glib-networking
+, gnome-online-accounts
+, wrapGAppsHook
+, libimobiledevice
+, libbluray
+, libcdio-paranoia
+, libnfs
+, openssh
+, libsecret
+, libgdata
+, python3
+, gsettings-desktop-schemas
+}:
+
+stdenv.mkDerivation rec {
+  pname = "gvfs";
+  version = "1.48.1";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1hlxl6368h6nyqp1888szxs9hnpcw98k3h23dgqi29xd38klzsmj";
+  };
+
+  postPatch = ''
+    # patchShebangs requires executable file
+    chmod +x meson_post_install.py
+    patchShebangs meson_post_install.py
+    patchShebangs test test-driver
+  '';
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    python3
+    pkg-config
+    gettext
+    wrapGAppsHook
+    libxml2
+    libxslt
+    docbook_xsl
+    docbook_xml_dtd_42
+  ];
+
+  buildInputs = [
+    glib
+    libgudev
+    udisks2
+    libgcrypt
+    dbus
+    libgphoto2
+    avahi
+    libarchive
+    fuse3
+    libcdio
+    samba
+    libmtp
+    libcap
+    polkit
+    libimobiledevice
+    libbluray
+    libcdio-paranoia
+    libnfs
+    openssh
+    gsettings-desktop-schemas
+    # TODO: a ligther version of libsoup to have FTP/HTTP support?
+  ] ++ lib.optionals gnomeSupport [
+    gnome.libsoup
+    gcr
+    glib-networking # TLS support
+    gnome-online-accounts
+    libsecret
+    libgdata
+  ];
+
+  mesonFlags = [
+    "-Dsystemduserunitdir=${placeholder "out"}/lib/systemd/user"
+    "-Dtmpfilesdir=no"
+  ] ++ lib.optionals (!gnomeSupport) [
+    "-Dgcr=false"
+    "-Dgoa=false"
+    "-Dkeyring=false"
+    "-Dhttp=false"
+    "-Dgoogle=false"
+  ] ++ lib.optionals (samba == null) [
+    # Xfce don't want samba
+    "-Dsmb=false"
+  ];
+
+  doCheck = false; # fails with "ModuleNotFoundError: No module named 'gi'"
+  doInstallCheck = doCheck;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "Virtual Filesystem support library" + optionalString gnomeSupport " (full GNOME support)";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ ] ++ teams.gnome.members;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/half/default.nix b/nixpkgs/pkgs/development/libraries/half/default.nix
new file mode 100644
index 000000000000..c0d11e9ce773
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/half/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchzip }:
+
+stdenv.mkDerivation rec {
+  version = "2.2.0";
+  pname = "half";
+
+  src = fetchzip {
+    url = "mirror://sourceforge/half/${version}/half-${version}.zip";
+    sha256 = "sha256-ZdGgBMZylFgkvs/XVBnvgBY2EYSHRLY3S4YwXjshpOY=";
+    stripRoot = false;
+  };
+
+  buildCommand = ''
+    mkdir -p $out/include $out/share/doc
+    cp $src/include/half.hpp               $out/include/
+    cp $src/{ChangeLog,LICENSE,README}.txt $out/share/doc/
+  '';
+
+  meta = with lib; {
+    description = "C++ library for half precision floating point arithmetics";
+    platforms = platforms.all;
+    license = licenses.mit;
+    maintainers = [ maintainers.volth ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/hamlib/4.nix b/nixpkgs/pkgs/development/libraries/hamlib/4.nix
new file mode 100644
index 000000000000..cad69e8b4187
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hamlib/4.nix
@@ -0,0 +1,64 @@
+{ lib
+, stdenv
+, fetchurl
+, perl
+, swig
+, gd
+, ncurses
+, python3
+, libxml2
+, tcl
+, libusb-compat-0_1
+, pkg-config
+, boost
+, libtool
+, perlPackages
+, pythonBindings ? true
+, tclBindings ? true
+, perlBindings ? true
+}:
+
+stdenv.mkDerivation rec {
+  pname = "hamlib";
+  version = "4.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "1m8gb20i8ga6ndnnw187ry1h4z8wx27v1hl7c610r6ky60pv4072";
+  };
+
+  nativeBuildInputs = [
+    swig
+    pkg-config
+    libtool
+  ];
+
+  buildInputs = [
+    gd
+    libxml2
+    libusb-compat-0_1
+    boost
+  ] ++ lib.optionals pythonBindings [ python3 ncurses ]
+    ++ lib.optionals tclBindings [ tcl ]
+    ++ lib.optionals perlBindings [ perl perlPackages.ExtUtilsMakeMaker ];
+
+  configureFlags = lib.optionals perlBindings [ "--with-perl-binding" ]
+    ++ lib.optionals tclBindings [ "--with-tcl-binding" "--with-tcl=${tcl}/lib/" ]
+    ++ lib.optionals pythonBindings [ "--with-python-binding" ];
+
+  meta = with lib; {
+    description = "Runtime library to control radio transceivers and receivers";
+    longDescription = ''
+    Hamlib provides a standardized programming interface that applications
+    can use to send the appropriate commands to a radio.
+
+    Also included in the package is a simple radio control program 'rigctl',
+    which lets one control a radio transceiver or receiver, either from
+    command line interface or in a text-oriented interactive interface.
+    '';
+    license = with licenses; [ gpl2Plus lgpl2Plus ];
+    homepage = "http://hamlib.sourceforge.net";
+    maintainers = with maintainers; [ relrod ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/hamlib/default.nix b/nixpkgs/pkgs/development/libraries/hamlib/default.nix
new file mode 100644
index 000000000000..cd56b04c0346
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hamlib/default.nix
@@ -0,0 +1,64 @@
+{ lib
+, stdenv
+, fetchurl
+, perl
+, swig
+, gd
+, ncurses
+, python3
+, libxml2
+, tcl
+, libusb-compat-0_1
+, pkg-config
+, boost
+, libtool
+, perlPackages
+, pythonBindings ? true
+, tclBindings ? true
+, perlBindings ? true
+}:
+
+stdenv.mkDerivation rec {
+  pname = "hamlib";
+  version = "3.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "10788mgrhbc57zpzakcxv5aqnr2819pcshml6fbh8zvnkja562y9";
+  };
+
+  nativeBuildInputs = [
+    swig
+    pkg-config
+    libtool
+  ];
+
+  buildInputs = [
+    gd
+    libxml2
+    libusb-compat-0_1
+    boost
+  ] ++ lib.optionals pythonBindings [ python3 ncurses ]
+    ++ lib.optionals tclBindings [ tcl ]
+    ++ lib.optionals perlBindings [ perl perlPackages.ExtUtilsMakeMaker ];
+
+  configureFlags = lib.optionals perlBindings [ "--with-perl-binding" ]
+    ++ lib.optionals tclBindings [ "--with-tcl-binding" "--with-tcl=${tcl}/lib/" ]
+    ++ lib.optionals pythonBindings [ "--with-python-binding" ];
+
+  meta = with lib; {
+    description = "Runtime library to control radio transceivers and receivers";
+    longDescription = ''
+    Hamlib provides a standardized programming interface that applications
+    can use to send the appropriate commands to a radio.
+
+    Also included in the package is a simple radio control program 'rigctl',
+    which lets one control a radio transceiver or receiver, either from
+    command line interface or in a text-oriented interactive interface.
+    '';
+    license = with licenses; [ gpl2Plus lgpl2Plus ];
+    homepage = "http://hamlib.sourceforge.net";
+    maintainers = with maintainers; [ relrod ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/harfbuzz/default.nix b/nixpkgs/pkgs/development/libraries/harfbuzz/default.nix
new file mode 100644
index 000000000000..4a12c5bcc225
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/harfbuzz/default.nix
@@ -0,0 +1,109 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, pkg-config
+, glib
+, freetype
+, fontconfig
+, libintl
+, meson
+, ninja
+, gobject-introspection
+, icu
+, graphite2
+, harfbuzz # The icu variant uses and propagates the non-icu one.
+, ApplicationServices
+, CoreText
+, withCoreText ? false
+, withIcu ? false # recommended by upstream as default, but most don't needed and it's big
+, withGraphite2 ? true # it is small and major distros do include it
+, python3
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+}:
+
+let
+  version = "2.8.2";
+  inherit (lib) optional optionals optionalString;
+  mesonFeatureFlag = opt: b:
+    "-D${opt}=${if b then "enabled" else "disabled"}";
+  isNativeCompilation = stdenv.buildPlatform == stdenv.hostPlatform;
+in
+
+stdenv.mkDerivation {
+  name = "harfbuzz${optionalString withIcu "-icu"}-${version}";
+
+  src = fetchFromGitHub {
+    owner = "harfbuzz";
+    repo = "harfbuzz";
+    rev = version;
+    sha256 = "sha256-uqcwfe5Oa3S0tyZDzqhIQfRFEv/HaiVWzVvwjqpLo5g=";
+  };
+
+  postPatch = ''
+    patchShebangs src/*.py
+    patchShebangs test
+  '' + lib.optionalString stdenv.isDarwin ''
+    # ApplicationServices.framework headers have cast-align warnings.
+    substituteInPlace src/hb.hh \
+      --replace '#pragma GCC diagnostic error   "-Wcast-align"' ""
+  '';
+
+  outputs = [ "out" "dev" "devdoc" ];
+  outputBin = "dev";
+
+  mesonFlags = [
+    # upstream recommends cairo, but it is only used for development purposes
+    # and is not part of the library.
+    # Cairo causes transitive (build) dependencies on various X11 or other
+    # GUI-related libraries, so it shouldn't be re-added lightly.
+    (mesonFeatureFlag "cairo" false)
+    # chafa is only used in a development utility, not in the library
+    (mesonFeatureFlag "chafa" false)
+    (mesonFeatureFlag "coretext" withCoreText)
+    (mesonFeatureFlag "graphite" withGraphite2)
+    (mesonFeatureFlag "icu" withIcu)
+    (mesonFeatureFlag "introspection" isNativeCompilation)
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    gobject-introspection
+    libintl
+    pkg-config
+    python3
+    gtk-doc
+    docbook-xsl-nons
+    docbook_xml_dtd_43
+  ];
+
+  buildInputs = [ glib freetype ]
+    ++ lib.optionals withCoreText [ ApplicationServices CoreText ]
+    ++ lib.optionals isNativeCompilation [ gobject-introspection ];
+
+  propagatedBuildInputs = optional withGraphite2 graphite2
+    ++ optionals withIcu [ icu harfbuzz ];
+
+  doCheck = true;
+
+  # Slightly hacky; some pkgs expect them in a single directory.
+  postFixup = optionalString withIcu ''
+    rm "$out"/lib/libharfbuzz.* "$dev/lib/pkgconfig/harfbuzz.pc"
+    ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.la
+    ln -s {'${harfbuzz.dev}',"$dev"}/lib/pkgconfig/harfbuzz.pc
+    ${optionalString stdenv.isDarwin ''
+      ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.dylib
+      ln -s {'${harfbuzz.out}',"$out"}/lib/libharfbuzz.0.dylib
+    ''}
+  '';
+
+  meta = with lib; {
+    description = "An OpenType text shaping engine";
+    homepage = "https://harfbuzz.github.io/";
+    maintainers = [ maintainers.eelco ];
+    license = licenses.mit;
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/hawknl/default.nix b/nixpkgs/pkgs/development/libraries/hawknl/default.nix
new file mode 100644
index 000000000000..6d60d62fcce7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hawknl/default.nix
@@ -0,0 +1,31 @@
+{lib, stdenv, fetchurl, unzip}:
+
+stdenv.mkDerivation rec {
+  pname = "hawknl";
+  version = "1.68";
+
+  src = fetchurl {
+    url = "http://urchlay.naptime.net/~urchlay/src/HawkNL${lib.replaceStrings ["."] [""] version}src.zip";
+    sha256 = "11shn2fbxj3w0j77w0234pqyj1368x686kkgv09q5yqhi1cdp028";
+  };
+
+  nativeBuildInputs = [ unzip ];
+
+  makefile = "makefile.linux";
+
+  patchPhase = ''
+    sed -i s/soname,NL/soname,libNL/ src/makefile.linux
+  '';
+
+  preInstall = ''
+    sed -i s,/usr/local,$out, src/makefile.linux
+    mkdir -p $out/lib $out/include
+  '';
+
+  meta = {
+    homepage = "http://hawksoft.com/hawknl/";
+    description = "Free, open source, game oriented network API";
+    license = lib.licenses.lgpl2Plus;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/hdf5-blosc/blosc_filter.pc.in b/nixpkgs/pkgs/development/libraries/hdf5-blosc/blosc_filter.pc.in
new file mode 100644
index 000000000000..04e29515d9b1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hdf5-blosc/blosc_filter.pc.in
@@ -0,0 +1,13 @@
+prefix=@out@
+includedir=${prefix}/include
+libdir=${prefix}/lib
+
+Name: blosc_filter
+Description: Blosc Filter
+URL: http://blosc.org/
+Version: @version@
+Requires: \
+  blosc \
+  hdf5
+Cflags: -isystem${includedir}
+Libs: -L${libdir} -Wl,-rpath,${libdir} -lblosc_filter
diff --git a/nixpkgs/pkgs/development/libraries/hdf5-blosc/default.nix b/nixpkgs/pkgs/development/libraries/hdf5-blosc/default.nix
new file mode 100644
index 000000000000..985660ff9073
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hdf5-blosc/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, c-blosc, cmake, hdf5, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "hdf5-blosc";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "Blosc";
+    repo = pname;
+    rev =  "v${version}";
+    sha256 = "1nj2bm1v6ymm3fmyvhbn6ih5fgdiapavlfghh1pvbmhw71cysyqs";
+  };
+
+  patches = [ ./no-external-blosc.patch ];
+
+  outputs = [ "out" "dev" "plugin" ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ c-blosc hdf5 ];
+
+  preConfigure = ''
+    substituteInPlace CMakeLists.txt --replace 'set(BLOSC_INSTALL_DIR "''${CMAKE_CURRENT_BINARY_DIR}/blosc")' 'set(BLOSC_INSTALL_DIR "${c-blosc}")'
+  '';
+
+  cmakeFlags = [
+    "-DPLUGIN_INSTALL_PATH=${placeholder "plugin"}/hdf5/lib/plugin"
+  ];
+
+  postInstall = ''
+    mkdir -p $out/lib/pkgconfig
+    substituteAll ${./blosc_filter.pc.in} $out/lib/pkgconfig/blosc_filter.pc
+  '';
+
+  meta = with lib; {
+    description = "Filter for HDF5 that uses the Blosc compressor";
+    homepage = "https://github.com/Blosc/hdf5-blosc";
+    license = licenses.mit;
+    maintainers = with maintainers; [ bhipple ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/hdf5-blosc/no-external-blosc.patch b/nixpkgs/pkgs/development/libraries/hdf5-blosc/no-external-blosc.patch
new file mode 100644
index 000000000000..8f2bd8579ed8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hdf5-blosc/no-external-blosc.patch
@@ -0,0 +1,26 @@
+--- a/CMakeLists.txt      2019-10-11 12:12:27.445417039 -0400
++++ b/CMakeLists.txt      2019-10-11 12:27:26.630691742 -0400
+@@ -22,14 +22,6 @@
+ message("BLOSC_CMAKE_ARGS='${BLOSC_CMAKE_ARGS}'")
+ message("GIT_EXECUTABLE='${GIT_EXECUTABLE}'")
+
+-ExternalProject_Add(project_blosc
+-  PREFIX ${BLOSC_PREFIX}
+-  GIT_REPOSITORY https://github.com/Blosc/c-blosc.git
+-  INSTALL_DIR ${BLOSC_INSTALL_DIR}
+-  CMAKE_ARGS ${BLOSC_CMAKE_ARGS}
+-)
+-
+-
+ # sources
+ set(SOURCES src/blosc_filter.c)
+ set(PLUGIN_SOURCES src/blosc_filter.c src/blosc_plugin.c )
+@@ -53,7 +45,6 @@
+ # add blosc libraries
+ add_library(blosc_shared SHARED IMPORTED)
+ set_property(TARGET blosc_shared PROPERTY IMPORTED_LOCATION ${BLOSC_INSTALL_DIR}/lib/${CMAKE_SHARED_LIBRARY_PREFIX}blosc${CMAKE_SHARED_LIBRARY_SUFFIX})
+-add_dependencies(blosc_shared project_blosc)
+ include_directories(${BLOSC_INSTALL_DIR}/include)
+
+ add_library(blosc_filter_shared SHARED ${SOURCES})
+
diff --git a/nixpkgs/pkgs/development/libraries/herqq/default.nix b/nixpkgs/pkgs/development/libraries/herqq/default.nix
new file mode 100644
index 000000000000..65eacd7fffe3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/herqq/default.nix
@@ -0,0 +1,26 @@
+{ lib, mkDerivation, fetchFromGitHub, qmake, qtmultimedia, qtbase }:
+
+mkDerivation rec {
+  version = "unstable-20-06-26";
+  pname = "herqq";
+
+  nativeBuildInputs = [ qmake ];
+  buildInputs = [ qtbase qtmultimedia ];
+
+  outputs = [ "out" "dev" ];
+
+  sourceRoot = "source/herqq";
+  src = fetchFromGitHub {
+    owner = "ThomArmax";
+    repo = "HUPnP";
+    rev = "c8385a8846b52def7058ae3794249d6b566a41fc";
+    sha256 = "FxN/QlLB3sZ6Vn/9VIKNUntX/B4+crQZ7t760pwFqY8=";
+  };
+
+  meta = with lib; {
+    homepage = "http://herqq.org";
+    description = "A software library for building UPnP devices and control points";
+    platforms = platforms.linux;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/hidapi/default.nix b/nixpkgs/pkgs/development/libraries/hidapi/default.nix
new file mode 100644
index 000000000000..6a3665809b4a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hidapi/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, udev, libusb1
+, darwin }:
+
+stdenv.mkDerivation rec {
+  pname = "hidapi";
+  version = "0.10.1";
+
+  src = fetchFromGitHub {
+    owner = "libusb";
+    repo = "hidapi";
+    rev = "${pname}-${version}";
+    sha256 = "1nr4z4b10vpbh3ss525r7spz4i43zim2ba5qzfl15dgdxshxxivb";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  buildInputs = [ ]
+    ++ lib.optionals stdenv.isLinux [ libusb1 udev ];
+
+  enableParallelBuilding = true;
+
+  propagatedBuildInputs = lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ IOKit Cocoa ]);
+
+  meta = with lib; {
+    description = "Library for communicating with USB and Bluetooth HID devices";
+    homepage = "https://github.com/libusb/hidapi";
+    maintainers = with maintainers; [ prusnak ];
+    # Actually, you can chose between GPLv3, BSD or HIDAPI license (more liberal)
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/highfive/default.nix b/nixpkgs/pkgs/development/libraries/highfive/default.nix
new file mode 100644
index 000000000000..015147d70bc3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/highfive/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, boost
+, eigen
+, hdf5
+, mpiSupport ? hdf5.mpiSupport
+, mpi ? hdf5.mpi
+}:
+
+assert mpiSupport -> mpi != null;
+
+stdenv.mkDerivation rec {
+  pname = "highfive";
+  version = "2.2";
+
+  src = fetchFromGitHub {
+    owner = "BlueBrain";
+    repo = "HighFive";
+    rev = "4c70d818ed18231563fe49ff197d1c41054be592";
+    sha256 = "02xy3c2ix3nw8109aw75ixj651knzc5rjqwqrxximm4hzwx09frk";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ boost eigen hdf5 ];
+
+  passthru = {
+    inherit mpiSupport mpi;
+  };
+
+  cmakeFlags = [
+    "-DHIGHFIVE_USE_BOOST=ON"
+    "-DHIGHFIVE_USE_EIGEN=ON"
+    "-DHIGHFIVE_EXAMPLES=OFF"
+    "-DHIGHFIVE_UNIT_TESTS=OFF"
+    "-DHIGHFIVE_USE_INSTALL_DEPS=ON"
+  ]
+  ++ (lib.optionals mpiSupport [ "-DHIGHFIVE_PARALLEL_HDF5=ON" ]);
+
+  meta = with lib; {
+    description = "Header-only C++ HDF5 interface";
+    license = licenses.boost;
+    homepage = "https://bluebrain.github.io/HighFive/";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ robertodr ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/hiredis-vip/default.nix b/nixpkgs/pkgs/development/libraries/hiredis-vip/default.nix
new file mode 100644
index 000000000000..a4c7575ac041
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hiredis-vip/default.nix
@@ -0,0 +1,25 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+}:
+
+stdenv.mkDerivation rec {
+  pname = "hiredis-vip";
+  version = "0.3.0";
+
+  src = fetchFromGitHub {
+    owner = "vipshop";
+    repo = "hiredis-vip";
+    rev = version;
+    sha256 = "1z9zry635pxqv6d2cgk3dghb5qfpg9m7dz34ld4djw9b53hjr2z2";
+  };
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = {
+    description = "A C client library for the Redis database";
+    homepage = "https://github.com/vipshop/hiredis-vip";
+    license = lib.licenses.bsd3;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/hiredis/default.nix b/nixpkgs/pkgs/development/libraries/hiredis/default.nix
new file mode 100644
index 000000000000..d4998b51592f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hiredis/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "hiredis";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "redis";
+    repo = "hiredis";
+    rev = "v${version}";
+    sha256 = "01xnynm9d56a0alb5wxbfayakybm5pnr12icj9mqkn4xxihbnbgr";
+  };
+
+  PREFIX = "\${out}";
+
+  meta = with lib; {
+    homepage = "https://github.com/redis/hiredis";
+    description = "Minimalistic C client for Redis >= 1.2";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/hivex/default.nix b/nixpkgs/pkgs/development/libraries/hivex/default.nix
new file mode 100644
index 000000000000..204af0a92b57
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hivex/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, pkg-config, autoreconfHook, makeWrapper
+, perlPackages, libxml2, libiconv }:
+
+stdenv.mkDerivation rec {
+  pname = "hivex";
+  version = "1.3.21";
+
+  src = fetchurl {
+    url = "https://libguestfs.org/download/hivex/${pname}-${version}.tar.gz";
+    sha256 = "sha256-ms4+9KL/LKUKmb4Gi2D7H9vJ6rivU+NF6XznW6S2O1Y=";
+  };
+
+  patches = [ ./hivex-syms.patch ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    autoreconfHook makeWrapper libxml2
+  ]
+  ++ (with perlPackages; [ perl IOStringy ])
+  ++ lib.optionals stdenv.isDarwin [ libiconv ];
+
+  postInstall = ''
+    wrapProgram $out/bin/hivexregedit \
+        --set PERL5LIB "$out/${perlPackages.perl.libPrefix}" \
+        --prefix "PATH" : "$out/bin"
+
+    wrapProgram $out/bin/hivexml \
+        --prefix "PATH" : "$out/bin"
+  '';
+
+  meta = with lib; {
+    description = "Windows registry hive extraction library";
+    license = licenses.lgpl2;
+    homepage = "https://github.com/libguestfs/hivex";
+    maintainers = with maintainers; [offline];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/hivex/hivex-syms.patch b/nixpkgs/pkgs/development/libraries/hivex/hivex-syms.patch
new file mode 100644
index 000000000000..bacd34e8515d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hivex/hivex-syms.patch
@@ -0,0 +1,13 @@
+diff -rupN hivex-1.3.14/lib/Makefile.am hivex-1.3.14-new/lib/Makefile.am
+--- hivex-1.3.14/lib/Makefile.am	2013-09-10 13:04:12.000000000 +0200
++++ hivex-1.3.14-new/lib/Makefile.am	2014-11-06 01:31:05.956106861 +0100
+@@ -40,8 +40,7 @@ libhivex_la_SOURCES = \
+ 
+ libhivex_la_LIBADD =  ../gnulib/lib/libgnu.la $(LTLIBOBJS)
+ libhivex_la_LDFLAGS = \
+-	-version-info 0:0:0 \
+-	$(VERSION_SCRIPT_FLAGS)$(srcdir)/hivex.syms \
++	-version-info 0:0:0
+ 	$(LTLIBICONV) \
+ 	$(LTLIBINTL) \
+ 	$(LTLIBTHREAD)
diff --git a/nixpkgs/pkgs/development/libraries/hotpatch/default.nix b/nixpkgs/pkgs/development/libraries/hotpatch/default.nix
new file mode 100644
index 000000000000..2dd894ff4a36
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hotpatch/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  name = "hotpatch-0.2";
+
+  src = fetchFromGitHub {
+    owner = "vikasnkumar";
+    repo = "hotpatch";
+    rev = "4b65e3f275739ea5aa798d4ad083c4cb10e29149";
+    sha256 = "169vdh55wsbn6fl58lpzqx64v6ifzh7krykav33x1d9hsk98qjqh";
+  };
+
+  doCheck = true;
+
+  nativeBuildInputs = [ cmake ];
+
+  preConfigure = ''
+    substituteInPlace test/loader.c \
+      --replace \"/lib64/ld-linux-x86-64.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --replace \"/lib/ld-linux-x86-64.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --replace \"/lib/ld-linux.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)" \
+      --replace \"/lib32/ld-linux.so.2 \""$(cat $NIX_CC/nix-support/dynamic-linker)"
+  '';
+
+  checkPhase = ''
+    LD_LIBRARY_PATH=$(pwd)/src make test
+  '';
+
+  meta = with lib; {
+    description = "Hot patching executables on Linux using .so file injection";
+    homepage = src.meta.homepage;
+    license = licenses.bsd3;
+    maintainers = [ ];
+    platforms = ["i686-linux" "x86_64-linux"];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/howard-hinnant-date/default.nix b/nixpkgs/pkgs/development/libraries/howard-hinnant-date/default.nix
new file mode 100644
index 000000000000..fe807d3dfb44
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/howard-hinnant-date/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchFromGitHub, cmake, curl, tzdata, fetchpatch, substituteAll }:
+
+stdenv.mkDerivation rec {
+  pname = "howard-hinnant-date-unstable";
+  version = "2020-03-09";
+
+  src = fetchFromGitHub {
+    owner = "HowardHinnant";
+    repo = "date";
+    rev = "4c1968b8f038483037cadfdbad3215ce21d934bb";
+    sha256 = "0dywrf18v1znfnz0gdxgi2ydax466zq34gc1vvg2k7vq17a30wq3";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/HowardHinnant/date/commit/e56b2dce7e89a92e1b9b35caa13b3e938c4cedea.patch";
+      sha256 = "0m3qbhq7kmm9qa3jm6d2px7c1dxdj5k9lffgdvqnrwmhxwj1p9n2";
+    })
+    # Without this patch, this library will drop a `tzdata` directory into
+    # `~/Downloads` if it cannot find `/usr/share/zoneinfo`. Make the path it
+    # searches for `zoneinfo` be the one from the `tzdata` package.
+    (substituteAll {
+      src = ./make-zoneinfo-available.diff;
+      inherit tzdata;
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ curl ];
+
+  cmakeFlags = [
+    "-DBUILD_TZ_LIB=true"
+    "-DBUILD_SHARED_LIBS=true"
+    "-DUSE_SYSTEM_TZ_DB=true"
+  ];
+
+  outputs = [ "out" "dev" ];
+
+  meta = with lib; {
+    license = licenses.mit;
+    description = "A date and time library based on the C++11/14/17 <chrono> header";
+    homepage = "https://github.com/HowardHinnant/date";
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/howard-hinnant-date/make-zoneinfo-available.diff b/nixpkgs/pkgs/development/libraries/howard-hinnant-date/make-zoneinfo-available.diff
new file mode 100644
index 000000000000..f9e69ff38cbb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/howard-hinnant-date/make-zoneinfo-available.diff
@@ -0,0 +1,13 @@
+diff --git a/src/tz.cpp b/src/tz.cpp
+index 68436c3..2bfe19e 100644
+--- a/src/tz.cpp
++++ b/src/tz.cpp
+@@ -349,7 +349,7 @@ discover_tz_dir()
+     struct stat sb;
+     using namespace std;
+ #  ifndef __APPLE__
+-    CONSTDATA auto tz_dir_default = "/usr/share/zoneinfo";
++    CONSTDATA auto tz_dir_default = "@tzdata@/share/zoneinfo";
+     CONSTDATA auto tz_dir_buildroot = "/usr/share/zoneinfo/uclibc";
+ 
+     // Check special path which is valid for buildroot with uclibc builds
diff --git a/nixpkgs/pkgs/development/libraries/hpx/default.nix b/nixpkgs/pkgs/development/libraries/hpx/default.nix
new file mode 100644
index 000000000000..73d1eea988de
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hpx/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, boost, cmake, hwloc, gperftools, pkg-config, python3 }:
+
+stdenv.mkDerivation rec {
+  pname = "hpx";
+  version = "1.6.0";
+
+  src = fetchFromGitHub {
+    owner = "STEllAR-GROUP";
+    repo = "hpx";
+    rev = version;
+    sha256 = "sha256-Fkntfk5AaWtS1x0fXfLSWW/9tvKcCBi1COqgNxurPmk=";
+  };
+
+  buildInputs = [ boost hwloc gperftools ];
+  nativeBuildInputs = [ cmake pkg-config python3 ];
+
+  strictDeps = true;
+
+  meta = {
+    description = "C++ standard library for concurrency and parallelism";
+    homepage = "https://github.com/STEllAR-GROUP/hpx";
+    license = lib.licenses.boost;
+    platforms = [ "x86_64-linux" ]; # lib.platforms.linux;
+    maintainers = with lib.maintainers; [ bobakker ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/hspell/default.nix b/nixpkgs/pkgs/development/libraries/hspell/default.nix
new file mode 100644
index 000000000000..2a65afad809a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hspell/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, perl, zlib, buildPackages }:
+
+stdenv.mkDerivation rec {
+  name = "${passthru.pname}-${passthru.version}";
+
+  passthru = {
+    pname = "hspell";
+    version = "1.1";
+  };
+
+  PERL_USE_UNSAFE_INC = "1";
+
+  src = fetchurl {
+    url = "${meta.homepage}${name}.tar.gz";
+    sha256 = "08x7rigq5pa1pfpl30qp353hbdkpadr1zc49slpczhsn0sg36pd6";
+  };
+
+  patchPhase = "patchShebangs .";
+  preBuild = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+    make CC=${buildPackages.stdenv.cc}/bin/cc find_sizes
+    mv find_sizes find_sizes_build
+    make clean
+
+    substituteInPlace Makefile --replace "./find_sizes" "./find_sizes_build"
+    substituteInPlace Makefile --replace "ar cr" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar cr"
+    substituteInPlace Makefile --replace "ranlib" "${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib"
+    substituteInPlace Makefile --replace "STRIP=strip" "STRIP=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}strip"
+  '';
+  nativeBuildInputs = [ perl zlib ];
+#  buildInputs = [ zlib ];
+
+  meta = with lib; {
+    description = "Hebrew spell checker";
+    homepage = "http://hspell.ivrix.org.il/";
+    platforms = platforms.all;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/hspell/dicts.nix b/nixpkgs/pkgs/development/libraries/hspell/dicts.nix
new file mode 100644
index 000000000000..83942c2c1dde
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hspell/dicts.nix
@@ -0,0 +1,40 @@
+{ stdenv, hspell }:
+
+let
+  dict = variant: a: stdenv.mkDerivation ({
+    inherit (hspell) src patchPhase nativeBuildInputs;
+    buildFlags = [ variant ];
+
+    meta = hspell.meta // {
+      broken = true;
+      description = "${variant} Hebrew dictionary";
+    } // (if a ? meta then a.meta else {});
+  } // (removeAttrs a ["meta"]));
+in
+{
+  recurseForDerivations = true;
+
+  aspell = dict "aspell" {
+    name = "aspell-dict-he-${hspell.version}";
+
+    installPhase = ''
+      mkdir -p $out/lib/aspell
+      cp -v he_affix.dat he.wl $out/lib/aspell'';
+  };
+
+  myspell = dict "myspell" {
+    name = "myspell-dict-he-${hspell.version}";
+
+    installPhase = ''
+      mkdir -p $out/lib/myspell
+      cp -v he.dic he.aff $out/lib/myspell'';
+  };
+
+  hunspell = dict "hunspell" {
+    name = "hunspell-dict-he-${hspell.version}";
+
+    installPhase = ''
+      mkdir -p $out/lib
+      cp -rv hunspell $out/lib'';
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/htmlcxx/default.nix b/nixpkgs/pkgs/development/libraries/htmlcxx/default.nix
new file mode 100644
index 000000000000..d9072e46e407
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/htmlcxx/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, libiconv }:
+
+stdenv.mkDerivation rec {
+  pname = "htmlcxx";
+  version = "0.86";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/htmlcxx/htmlcxx/${version}/${pname}-${version}.tar.gz";
+    sha256 = "1hgmyiad3qgbpf2dvv2jygzj6jpz4dl3n8ds4nql68a4l9g2nm07";
+  };
+
+  buildInputs = [ libiconv ];
+  patches = [ ./ptrdiff.patch ];
+
+  meta = with lib; {
+    homepage = "http://htmlcxx.sourceforge.net/";
+    description = "A simple non-validating css1 and html parser for C++";
+    license = licenses.lgpl2;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/htmlcxx/ptrdiff.patch b/nixpkgs/pkgs/development/libraries/htmlcxx/ptrdiff.patch
new file mode 100644
index 000000000000..6348ba24f8da
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/htmlcxx/ptrdiff.patch
@@ -0,0 +1,13 @@
+diff -rc htmlcxx-orig-0.85/html/tree.h htmlcxx-0.85/html/tree.h
+*** htmlcxx-orig-0.85/html/tree.h	2015-09-02 13:57:17.988688798 +0200
+--- htmlcxx-0.85/html/tree.h	2015-09-02 13:57:52.737768811 +0200
+***************
+*** 45,50 ****
+--- 45,51 ----
+  #ifndef tree_hh_
+  #define tree_hh_
+  
++ #include <cstddef>
+  #include <cassert>
+  #include <memory>
+  #include <stdexcept>
diff --git a/nixpkgs/pkgs/development/libraries/http-parser/build-shared.patch b/nixpkgs/pkgs/development/libraries/http-parser/build-shared.patch
new file mode 100644
index 000000000000..5922cdfb5848
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/http-parser/build-shared.patch
@@ -0,0 +1,30 @@
+diff -Naur http-parser-2.1-orig/http_parser.gyp http-parser-2.1/http_parser.gyp
+--- http-parser-2.1-orig/http_parser.gyp	2013-03-26 18:35:20.000000000 -0400
++++ http-parser-2.1/http_parser.gyp	2013-05-23 16:47:49.280488341 -0400
+@@ -21,7 +21,7 @@
+       },
+       'Release': {
+         'defines': [ 'NDEBUG' ],
+-        'cflags': [ '-Wall', '-Wextra', '-O3' ],
++        'cflags': [ '-Wall', '-Wextra', '-O3', '-fPIC' ],
+         'msvs_settings': {
+           'VCCLCompilerTool': {
+             'RuntimeLibrary': 0, # static release
+@@ -50,7 +50,7 @@
+   'targets': [
+     {
+       'target_name': 'http_parser',
+-      'type': 'static_library',
++      'type': 'shared_library',
+       'include_dirs': [ '.' ],
+       'direct_dependent_settings': {
+         'defines': [ 'HTTP_PARSER_STRICT=0' ],
+@@ -73,7 +73,7 @@
+ 
+     {
+       'target_name': 'http_parser_strict',
+-      'type': 'static_library',
++      'type': 'shared_library',
+       'include_dirs': [ '.' ],
+       'direct_dependent_settings': {
+         'defines': [ 'HTTP_PARSER_STRICT=1' ],
diff --git a/nixpkgs/pkgs/development/libraries/http-parser/default.nix b/nixpkgs/pkgs/development/libraries/http-parser/default.nix
new file mode 100644
index 000000000000..36ca0b0ca0b7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/http-parser/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "http-parser";
+  version = "2.9.4";
+
+  src = fetchFromGitHub {
+    owner = "nodejs";
+    repo = "http-parser";
+    rev = "v${version}";
+    sha256 = "1vda4dp75pjf5fcph73sy0ifm3xrssrmf927qd1x8g3q46z0cv6c";
+  };
+
+  NIX_CFLAGS_COMPILE = "-Wno-error";
+  patches = [ ./build-shared.patch ];
+  makeFlags = [ "DESTDIR=" "PREFIX=$(out)" ];
+  buildFlags = [ "library" ];
+  doCheck = true;
+  checkTarget = "test";
+
+  meta = with lib; {
+    description = "An HTTP message parser written in C";
+    homepage = "https://github.com/nodejs/http-parser";
+    maintainers = with maintainers; [ matthewbauer ];
+    license = licenses.mit;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/hunspell/0001-Make-hunspell-look-in-XDG_DATA_DIRS-for-dictionaries.patch b/nixpkgs/pkgs/development/libraries/hunspell/0001-Make-hunspell-look-in-XDG_DATA_DIRS-for-dictionaries.patch
new file mode 100644
index 000000000000..4607f8b8ee09
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hunspell/0001-Make-hunspell-look-in-XDG_DATA_DIRS-for-dictionaries.patch
@@ -0,0 +1,37 @@
+From 8c67f314de2684d77315eecd99ef091d441f17dd Mon Sep 17 00:00:00 2001
+From: Matthew Bauer <mjbauer95@gmail.com>
+Date: Wed, 24 Jul 2019 15:35:18 -0400
+Subject: [PATCH] Make hunspell look in XDG_DATA_DIRS for dictionaries
+
+Some dictionaries may exist but only show up under XDG_DATA_DIRS. For
+instance, $HOME/.local/share/hunspell could contain some dictionaries.
+
+This patch adds each directory in the hunspell subdir of each
+XDG_DATA_DIRS to the lookup path.
+
+Upstream pr is available at: https://github.com/hunspell/hunspell/pull/637
+---
+ src/tools/hunspell.cxx | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/tools/hunspell.cxx b/src/tools/hunspell.cxx
+index 690e34a..6cd127e 100644
+--- a/src/tools/hunspell.cxx
++++ b/src/tools/hunspell.cxx
+@@ -2044,6 +2044,13 @@ int main(int argc, char** argv) {
+     if (getenv("DICPATH")) {
+       path_std_str.append(getenv("DICPATH")).append(PATHSEP);
+     }
++    if (getenv("XDG_DATA_DIRS")) {
++      char* dir = strtok(getenv("XDG_DATA_DIRS"), ":");
++      while (dir != NULL) {
++        path_std_str.append(dir).append("/hunspell:");
++        dir = strtok(NULL, ":");
++      }
++    }
+     path_std_str.append(LIBDIR).append(PATHSEP);
+     if (HOME) {
+       const char * userooodir[] = USEROOODIR;
+-- 
+2.22.0
+
diff --git a/nixpkgs/pkgs/development/libraries/hunspell/default.nix b/nixpkgs/pkgs/development/libraries/hunspell/default.nix
new file mode 100644
index 000000000000..fe4fc1e6d338
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hunspell/default.nix
@@ -0,0 +1,63 @@
+{ lib, stdenv, fetchurl, fetchpatch, ncurses, readline, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  version = "1.7.0";
+  pname = "hunspell";
+
+  src = fetchurl {
+    url = "https://github.com/hunspell/hunspell/archive/v${version}.tar.gz";
+    sha256 = "12mwwqz6qkx7q1lg9vpjiiwh4fk4c8xs6g6g0xa2ia0hp5pbh9xv";
+  };
+
+  outputs = [ "bin" "dev" "out" "man" ];
+
+  buildInputs = [ ncurses readline ];
+  nativeBuildInputs = [ autoreconfHook ];
+
+  patches = [
+    ./0001-Make-hunspell-look-in-XDG_DATA_DIRS-for-dictionaries.patch
+    (fetchpatch {
+      name = "CVE-2019-16707.patch";
+      url = "https://github.com/hunspell/hunspell/commit/ac938e2ecb48ab4dd21298126c7921689d60571b.patch";
+      sha256 = "0bwfksz87iy7ikx3fb54zd5ww169qfm9kl076hsch3cs8p30s8az";
+    })
+  ];
+
+  postPatch = ''
+    patchShebangs tests
+  '';
+
+  autoreconfFlags = "-vfi";
+
+  configureFlags = [ "--with-ui" "--with-readline" ];
+
+  hardeningDisable = [ "format" ];
+
+  meta = with lib; {
+    homepage = "http://hunspell.sourceforge.net";
+    description = "Spell checker";
+    longDescription = ''
+      Hunspell is the spell checker of LibreOffice, OpenOffice.org, Mozilla
+      Firefox 3 & Thunderbird, Google Chrome, and it is also used by
+      proprietary software packages, like macOS, InDesign, memoQ, Opera and
+      SDL Trados.
+
+      Main features:
+
+      * Extended support for language peculiarities; Unicode character encoding, compounding and complex morphology.
+      * Improved suggestion using n-gram similarity, rule and dictionary based pronunciation data.
+      * Morphological analysis, stemming and generation.
+      * Hunspell is based on MySpell and works also with MySpell dictionaries.
+      * C++ library under GPL/LGPL/MPL tri-license.
+      * Interfaces and ports:
+        * Enchant (Generic spelling library from the Abiword project),
+        * XSpell (macOS port, but Hunspell is part of the macOS from version 10.6 (Snow Leopard), and
+            now it is enough to place Hunspell dictionary files into
+            ~/Library/Spelling or /Library/Spelling for spell checking),
+        * Delphi, Java (JNA, JNI), Perl, .NET, Python, Ruby ([1], [2]), UNO.
+    '';
+    platforms = platforms.all;
+    license = with licenses; [ gpl2 lgpl21 mpl11 ];
+    maintainers = with lib.maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/hunspell/dictionaries.nix b/nixpkgs/pkgs/development/libraries/hunspell/dictionaries.nix
new file mode 100644
index 000000000000..f1a2aa0c6c60
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hunspell/dictionaries.nix
@@ -0,0 +1,824 @@
+/* hunspell dictionaries */
+
+{ lib, stdenv, fetchurl, fetchFromGitHub, unzip, coreutils, bash, which, zip, ispell, perl, hunspell }:
+
+
+let
+  mkDict =
+  { pname, readmeFile, dictFileName, ... }@args:
+  stdenv.mkDerivation ({
+    inherit pname;
+    installPhase = ''
+      runHook preInstall
+      # hunspell dicts
+      install -dm755 "$out/share/hunspell"
+      install -m644 ${dictFileName}.dic "$out/share/hunspell/"
+      install -m644 ${dictFileName}.aff "$out/share/hunspell/"
+      # myspell dicts symlinks
+      install -dm755 "$out/share/myspell/dicts"
+      ln -sv "$out/share/hunspell/${dictFileName}.dic" "$out/share/myspell/dicts/"
+      ln -sv "$out/share/hunspell/${dictFileName}.aff" "$out/share/myspell/dicts/"
+      # docs
+      install -dm755 "$out/share/doc"
+      install -m644 ${readmeFile} $out/share/doc/${pname}.txt
+      runHook postInstall
+    '';
+  } // args);
+
+  mkDictFromRla =
+    { shortName, shortDescription, dictFileName }:
+    mkDict rec {
+      inherit dictFileName;
+      version = "2.2";
+      pname = "hunspell-dict-${shortName}-rla";
+      readmeFile = "README.txt";
+      src = fetchFromGitHub {
+        owner = "sbosio";
+        repo = "rla-es";
+        rev = "v${version}";
+        sha256 = "0n9ms092k7vg7xpd3ksadxydbrizkb7js7dfxr08nbnnb9fgy0i8";
+      };
+      meta = with lib; {
+        description = "Hunspell dictionary for ${shortDescription} from rla";
+        homepage = "https://github.com/sbosio/rla-es";
+        license = with licenses; [ gpl3 lgpl3 mpl11 ];
+        maintainers = with maintainers; [ renzo ];
+        platforms = platforms.all;
+      };
+      nativeBuildInputs = [ unzip ];
+      buildInputs = [ bash coreutils which zip ];
+      patchPhase = ''
+        substituteInPlace ortograf/herramientas/make_dict.sh \
+           --replace /bin/bash bash \
+           --replace /dev/stderr stderr.log
+
+        substituteInPlace ortograf/herramientas/remover_comentarios.sh \
+           --replace /bin/bash bash \
+      '';
+      buildPhase = ''
+        cd ortograf/herramientas
+        bash -x ./make_dict.sh -l ${dictFileName} -2
+        unzip ${dictFileName}.zip \
+          ${dictFileName}.dic ${dictFileName}.aff ${readmeFile}
+      '';
+    };
+
+  mkDictFromDSSO =
+    { shortName, shortDescription, dictFileName }:
+    mkDict rec {
+      inherit dictFileName;
+      version = "2.40";
+      # Should really use a string function or something
+      _version = "2-40";
+      pname = "hunspell-dict-${shortName}-dsso";
+      _name = "ooo_swedish_dict_${_version}";
+      readmeFile = "LICENSE_en_US.txt";
+      src = fetchurl {
+        url = "https://extensions.libreoffice.org/extensions/swedish-spelling-dictionary-den-stora-svenska-ordlistan/${version}/@@download/file/${_name}.oxt";
+        sha256 = "b982881cc75f5c4af1199535bd4735ee476bdc48edf63e3f05fb4f715654a7bc";
+      };
+      meta = with lib; {
+        longDescription = ''
+        Svensk ordlista baserad på DSSO (den stora svenska ordlistan) och Göran
+        Anderssons (goran@init.se) arbete med denna. Ordlistan hämtas från
+        LibreOffice då dsso.se inte längre verkar vara med oss.
+        '';
+        description = "Hunspell dictionary for ${shortDescription} from LibreOffice";
+        license = licenses.lgpl3;
+        platforms = platforms.all;
+      };
+      nativeBuildInputs = [ unzip ];
+      sourceRoot = ".";
+      unpackCmd = ''
+      unzip $src dictionaries/${dictFileName}.dic dictionaries/${dictFileName}.aff $readmeFile
+      '';
+      installPhase = ''
+        # hunspell dicts
+        install -dm755 "$out/share/hunspell"
+        install -m644 dictionaries/${dictFileName}.dic "$out/share/hunspell/"
+        install -m644 dictionaries/${dictFileName}.aff "$out/share/hunspell/"
+        # myspell dicts symlinks
+        install -dm755 "$out/share/myspell/dicts"
+        ln -sv "$out/share/hunspell/${dictFileName}.dic" "$out/share/myspell/dicts/"
+        ln -sv "$out/share/hunspell/${dictFileName}.aff" "$out/share/myspell/dicts/"
+        # docs
+        install -dm755 "$out/share/doc"
+        install -m644 ${readmeFile} $out/share/doc/${pname}.txt
+      '';
+    };
+
+  mkDictFromDicollecte =
+    { shortName, shortDescription, longDescription, dictFileName, isDefault ? false }:
+    mkDict rec {
+      inherit dictFileName;
+      version = "5.3";
+      pname = "hunspell-dict-${shortName}-dicollecte";
+      readmeFile = "README_dict_fr.txt";
+      src = fetchurl {
+         url = "http://www.dicollecte.org/download/fr/hunspell-french-dictionaries-v${version}.zip";
+         sha256 = "0ca7084jm7zb1ikwzh1frvpb97jn27i7a5d48288h2qlfp068ik0";
+      };
+      meta = with lib; {
+        inherit longDescription;
+        description = "Hunspell dictionary for ${shortDescription} from Dicollecte";
+        homepage = "https://www.dicollecte.org/home.php?prj=fr";
+        license = licenses.mpl20;
+        maintainers = with maintainers; [ renzo ];
+        platforms = platforms.all;
+      };
+      nativeBuildInputs = [ unzip ];
+      sourceRoot = ".";
+      unpackCmd = ''
+        unzip $src ${dictFileName}.dic ${dictFileName}.aff ${readmeFile}
+      '';
+      postInstall = lib.optionalString isDefault ''
+        for ext in aff dic; do
+          ln -sv $out/share/hunspell/${dictFileName}.$ext $out/share/hunspell/fr_FR.$ext
+          ln -sv $out/share/myspell/dicts/${dictFileName}.$ext $out/share/myspell/dicts/fr_FR.$ext
+        done
+      '';
+    };
+
+  mkDictFromWordlist =
+    { shortName, shortDescription, srcFileName, dictFileName, src }:
+    mkDict rec {
+      inherit src srcFileName dictFileName;
+      version = "2018.04.16";
+      pname = "hunspell-dict-${shortName}-wordlist";
+      srcReadmeFile = "README_" + srcFileName + ".txt";
+      readmeFile = "README_" + dictFileName + ".txt";
+      meta = with lib; {
+        description = "Hunspell dictionary for ${shortDescription} from Wordlist";
+        homepage = "http://wordlist.aspell.net/";
+        license = licenses.bsd3;
+        maintainers = with maintainers; [ renzo ];
+        platforms = platforms.all;
+      };
+      nativeBuildInputs = [ unzip ];
+      sourceRoot = ".";
+      unpackCmd = ''
+        unzip $src ${srcFileName}.dic ${srcFileName}.aff ${srcReadmeFile}
+      '';
+      postUnpack = ''
+        mv ${srcFileName}.dic ${dictFileName}.dic || true
+        mv ${srcFileName}.aff ${dictFileName}.aff || true
+        mv ${srcReadmeFile} ${readmeFile}         || true
+      '';
+    };
+
+  mkDictFromLinguistico =
+    { shortName, shortDescription, dictFileName, src }:
+    mkDict rec {
+      inherit src dictFileName;
+      version = "2.4";
+      pname = "hunspell-dict-${shortName}-linguistico";
+      readmeFile = dictFileName + "_README.txt";
+      meta = with lib; {
+        description = "Hunspell dictionary for ${shortDescription}";
+        homepage = "https://sourceforge.net/projects/linguistico/";
+        license = licenses.gpl3;
+        maintainers = with maintainers; [ renzo ];
+        platforms = platforms.all;
+      };
+      nativeBuildInputs = [ unzip ];
+      sourceRoot = ".";
+      prePatch = ''
+        # Fix dic file empty lines (FS#22275)
+        sed '/^\/$/d' -i ${dictFileName}.dic
+      '';
+      unpackCmd = ''
+        unzip $src ${dictFileName}.dic ${dictFileName}.aff ${readmeFile}
+      '';
+    };
+
+  mkDictFromXuxen =
+    { shortName, srcs, shortDescription, longDescription, dictFileName }:
+    stdenv.mkDerivation rec {
+      pname = "hunspell-dict-${shortName}-xuxen";
+      version = "5-2015.11.10";
+
+      inherit srcs;
+
+      sourceRoot = ".";
+      # Copy files stripping until first dash (path and hash)
+      unpackCmd = "cp $curSrc \${curSrc##*-}";
+      installPhase = ''
+        # hunspell dicts
+        install -dm755 "$out/share/hunspell"
+        install -m644 ${dictFileName}.dic "$out/share/hunspell/"
+        install -m644 ${dictFileName}.aff "$out/share/hunspell/"
+        # myspell dicts symlinks
+        install -dm755 "$out/share/myspell/dicts"
+        ln -sv "$out/share/hunspell/${dictFileName}.dic" "$out/share/myspell/dicts/"
+        ln -sv "$out/share/hunspell/${dictFileName}.aff" "$out/share/myspell/dicts/"
+      '';
+
+      meta = with lib; {
+        homepage = "http://xuxen.eus/";
+        description = shortDescription;
+        longDescription = longDescription;
+        license = licenses.gpl2;
+        maintainers = with maintainers; [ zalakain ];
+        platforms = platforms.all;
+      };
+    };
+
+  mkDictFromJ3e =
+    { shortName, shortDescription, dictFileName }:
+    stdenv.mkDerivation rec {
+      pname = "hunspell-dict-${shortName}-j3e";
+      version = "20161207";
+
+      src = fetchurl {
+        url = "https://j3e.de/ispell/igerman98/dict/igerman98-${version}.tar.bz2";
+        sha256 = "1a3055hp2bc4q4nlg3gmg0147p3a1zlfnc65xiv2v9pyql1nya8p";
+      };
+
+      buildInputs = [ ispell perl hunspell ];
+
+      dontBuild = true;
+
+      installPhase = ''
+        patchShebangs bin
+        make hunspell/${dictFileName}.aff hunspell/${dictFileName}.dic
+        # hunspell dicts
+        install -dm755 "$out/share/hunspell"
+        install -m644 hunspell/${dictFileName}.dic "$out/share/hunspell/"
+        install -m644 hunspell/${dictFileName}.aff "$out/share/hunspell/"
+        # myspell dicts symlinks
+        install -dm755 "$out/share/myspell/dicts"
+        ln -sv "$out/share/hunspell/${dictFileName}.dic" "$out/share/myspell/dicts/"
+        ln -sv "$out/share/hunspell/${dictFileName}.aff" "$out/share/myspell/dicts/"
+      '';
+
+      meta = with lib; {
+        homepage = "https://www.j3e.de/ispell/igerman98/index_en.html";
+        description = shortDescription;
+        license = with licenses; [ gpl2 gpl3 ];
+        maintainers = with maintainers; [ timor ];
+        platforms = platforms.all;
+      };
+    };
+
+  mkDictFromLibreOffice =
+    { shortName
+    , shortDescription
+    , dictFileName
+    , license
+    , readmeFile ? "README_${dictFileName}.txt"
+    , sourceRoot ? dictFileName }:
+    mkDict rec {
+      pname = "hunspell-dict-${shortName}-libreoffice";
+      version = "6.3.0.4";
+      inherit dictFileName readmeFile;
+      src = fetchFromGitHub {
+        owner = "LibreOffice";
+        repo = "dictionaries";
+        rev = "libreoffice-${version}";
+        sha256 = "14z4b0grn7cw8l9s7sl6cgapbpwhn1b3gwc3kn6b0k4zl3dq7y63";
+      };
+      buildPhase = ''
+        cp -a ${sourceRoot}/* .
+      '';
+      meta = with lib; {
+        homepage = "https://wiki.documentfoundation.org/Development/Dictionaries";
+        description = "Hunspell dictionary for ${shortDescription} from LibreOffice";
+        license = license;
+        maintainers = with maintainers; [ vlaci ];
+        platforms = platforms.all;
+      };
+    };
+
+in rec {
+
+  /* ENGLISH */
+
+  en_US = en-us;
+  en-us = mkDictFromWordlist {
+    shortName = "en-us";
+    shortDescription = "English (United States)";
+    srcFileName = "en_US";
+    dictFileName = "en_US";
+    src = fetchurl {
+      url = "mirror://sourceforge/wordlist/speller/2018.04.16/hunspell-en_US-2018.04.16.zip";
+      sha256 = "18hbncvqnckzqarrmnzk58plymjqyi93k4qj98fac5mr71jbmzaf";
+    };
+  };
+
+  en_US-large = en-us-large;
+  en-us-large = mkDictFromWordlist {
+    shortName = "en-us-large";
+    shortDescription = "English (United States) Large";
+    srcFileName = "en_US-large";
+    dictFileName = "en_US";
+    src = fetchurl {
+      url = "mirror://sourceforge/wordlist/speller/2018.04.16/hunspell-en_US-large-2018.04.16.zip";
+      sha256 = "1xm9jgqbivp5cb78ykjxg47vzq1yqj82l7r4q5cjpivrv99s49qc";
+    };
+  };
+
+  en_CA = en-ca;
+  en-ca = mkDictFromWordlist {
+    shortName = "en-ca";
+    shortDescription = "English (Canada)";
+    srcFileName = "en_CA";
+    dictFileName = "en_CA";
+    src = fetchurl {
+      url = "mirror://sourceforge/wordlist/speller/2018.04.16/hunspell-en_CA-2018.04.16.zip";
+      sha256 = "06yf3s7y1215jmikbs18cn4j8a13csp4763w3jfgah8zlim6vc47";
+    };
+  };
+
+  en_CA-large = en-ca-large;
+  en-ca-large = mkDictFromWordlist {
+    shortName = "en-ca-large";
+    shortDescription = "English (Canada) Large";
+    srcFileName = "en_CA-large";
+    dictFileName = "en_CA";
+    src = fetchurl {
+      url = "mirror://sourceforge/wordlist/speller/2018.04.16/hunspell-en_CA-large-2018.04.16.zip";
+      sha256 = "1200xxyvv6ni8nk52v3059c367817vnrkm0cdh38rhiigb5flfha";
+    };
+  };
+
+  en_AU = en-au;
+  en-au = mkDictFromWordlist {
+    shortName = "en-au";
+    shortDescription = "English (Australia)";
+    srcFileName = "en_AU";
+    dictFileName = "en_AU";
+    src = fetchurl {
+      url = "mirror://sourceforge/wordlist/speller/2018.04.16/hunspell-en_AU-2018.04.16.zip";
+      sha256 = "1kp06npl1kd05mm9r52cg2iwc13x02zwqgpibdw15b6x43agg6f5";
+    };
+  };
+
+  en_AU-large = en-au-large;
+  en-au-large = mkDictFromWordlist {
+    shortName = "en-au-large";
+    shortDescription = "English (Australia) Large";
+    srcFileName = "en_AU-large";
+    dictFileName = "en_AU";
+    src = fetchurl {
+      url = "mirror://sourceforge/wordlist/speller/2018.04.16/hunspell-en_AU-large-2018.04.16.zip";
+      sha256 = "14l1w4dpk0k1js2wwq5ilfil89ni8cigph95n1rh6xi4lzxj7h6g";
+    };
+  };
+
+  en_GB-ise = en-gb-ise;
+  en-gb-ise = mkDictFromWordlist {
+    shortName = "en-gb-ise";
+    shortDescription = "English (United Kingdom, 'ise' ending)";
+    srcFileName = "en_GB-ise";
+    dictFileName = "en_GB";
+    src = fetchurl {
+      url = "mirror://sourceforge/wordlist/speller/2018.04.16/hunspell-en_GB-ise-2018.04.16.zip";
+      sha256 = "0ylg1zvfvsawamymcc9ivrqcb9qhlpgpnizm076xc56jz554xc2l";
+    };
+  };
+
+  en_GB-ize = en-gb-ize;
+  en-gb-ize = mkDictFromWordlist {
+    shortName = "en-gb-ize";
+    shortDescription = "English (United Kingdom, 'ize' ending)";
+    srcFileName = "en_GB-ize";
+    dictFileName = "en_GB";
+    src = fetchurl {
+      url = "mirror://sourceforge/wordlist/speller/2018.04.16/hunspell-en_GB-ize-2018.04.16.zip";
+      sha256 = "1rmwy6sxmd400cwjf58az6g14sq28p18f5mlq8ybg8y33q9m42ps";
+    };
+  };
+
+  en_GB-large = en-gb-large;
+  en-gb-large = mkDictFromWordlist {
+    shortName = "en-gb-large";
+    shortDescription = "English (United Kingdom) Large";
+    srcFileName = "en_GB-large";
+    dictFileName = "en_GB";
+    src = fetchurl {
+      url = "mirror://sourceforge/wordlist/speller/2018.04.16/hunspell-en_GB-large-2018.04.16.zip";
+      sha256 = "1y4d7x5vvi1qh1s3i09m0vvqrpdzzqhsdngr8nsh7hc5bnlm37mi";
+    };
+  };
+
+  /* SPANISH */
+
+  es_ANY = es-any;
+  es-any = mkDictFromRla {
+    shortName = "es-any";
+    shortDescription = "Spanish (any variant)";
+    dictFileName = "es_ANY";
+  };
+
+  es_AR = es-ar;
+  es-ar = mkDictFromRla {
+    shortName = "es-ar";
+    shortDescription = "Spanish (Argentina)";
+    dictFileName = "es_AR";
+  };
+
+  es_BO = es-bo;
+  es-bo = mkDictFromRla {
+    shortName = "es-bo";
+    shortDescription = "Spanish (Bolivia)";
+    dictFileName = "es_BO";
+  };
+
+  es_CL = es-cl;
+  es-cl = mkDictFromRla {
+    shortName = "es-cl";
+    shortDescription = "Spanish (Chile)";
+    dictFileName = "es_CL";
+  };
+
+  es_CO = es-co;
+  es-co = mkDictFromRla {
+    shortName = "es-co";
+    shortDescription = "Spanish (Colombia)";
+    dictFileName = "es_CO";
+  };
+
+  es_CR = es-cr;
+  es-cr = mkDictFromRla {
+    shortName = "es-cr";
+    shortDescription = "Spanish (Costra Rica)";
+    dictFileName = "es_CR";
+  };
+
+  es_CU = es-cu;
+  es-cu = mkDictFromRla {
+    shortName = "es-cu";
+    shortDescription = "Spanish (Cuba)";
+    dictFileName = "es_CU";
+  };
+
+  es_DO = es-do;
+  es-do = mkDictFromRla {
+    shortName = "es-do";
+    shortDescription = "Spanish (Dominican Republic)";
+    dictFileName = "es_DO";
+  };
+
+  es_EC = es-ec;
+  es-ec = mkDictFromRla {
+    shortName = "es-ec";
+    shortDescription = "Spanish (Ecuador)";
+    dictFileName = "es_EC";
+  };
+
+  es_ES = es-es;
+  es-es = mkDictFromRla {
+    shortName = "es-es";
+    shortDescription = "Spanish (Spain)";
+    dictFileName = "es_ES";
+  };
+
+  es_GT = es-gt;
+  es-gt = mkDictFromRla {
+    shortName = "es-gt";
+    shortDescription = "Spanish (Guatemala)";
+    dictFileName = "es_GT";
+  };
+
+  es_HN = es-hn;
+  es-hn = mkDictFromRla {
+    shortName = "es-hn";
+    shortDescription = "Spanish (Honduras)";
+    dictFileName = "es_HN";
+  };
+
+  es_MX = es-mx;
+  es-mx = mkDictFromRla {
+    shortName = "es-mx";
+    shortDescription = "Spanish (Mexico)";
+    dictFileName = "es_MX";
+  };
+
+  es_NI = es-ni;
+  es-ni = mkDictFromRla {
+    shortName = "es-ni";
+    shortDescription = "Spanish (Nicaragua)";
+    dictFileName = "es_NI";
+  };
+
+  es_PA = es-pa;
+  es-pa = mkDictFromRla {
+    shortName = "es-pa";
+    shortDescription = "Spanish (Panama)";
+    dictFileName = "es_PA";
+  };
+
+  es_PE = es-pe;
+  es-pe = mkDictFromRla {
+    shortName = "es-pe";
+    shortDescription = "Spanish (Peru)";
+    dictFileName = "es_PE";
+  };
+
+  es_PR = es-pr;
+  es-pr = mkDictFromRla {
+    shortName = "es-pr";
+    shortDescription = "Spanish (Puerto Rico)";
+    dictFileName = "es_PR";
+  };
+
+  es_PY = es-py;
+  es-py = mkDictFromRla {
+    shortName = "es-py";
+    shortDescription = "Spanish (Paraguay)";
+    dictFileName = "es_PY";
+  };
+
+  es_SV = es-sv;
+  es-sv = mkDictFromRla {
+    shortName = "es-sv";
+    shortDescription = "Spanish (El Salvador)";
+    dictFileName = "es_SV";
+  };
+
+  es_UY = es-uy;
+  es-uy = mkDictFromRla {
+    shortName = "es-uy";
+    shortDescription = "Spanish (Uruguay)";
+    dictFileName = "es_UY";
+  };
+
+  es_VE = es-ve;
+  es-ve = mkDictFromRla {
+    shortName = "es-ve";
+    shortDescription = "Spanish (Venezuela)";
+    dictFileName = "es_VE";
+  };
+
+  /* FRENCH */
+
+  fr-any = mkDictFromDicollecte {
+    shortName = "fr-any";
+    dictFileName = "fr-toutesvariantes";
+    shortDescription = "French (any variant)";
+    longDescription = ''
+      Ce dictionnaire contient les nouvelles et les anciennes graphies des
+      mots concernés par la réforme de 1990.
+    '';
+  };
+
+  fr-classique = mkDictFromDicollecte {
+    shortName = "fr-classique";
+    dictFileName = "fr-classique";
+    shortDescription = "French (classic)";
+    longDescription = ''
+      Ce dictionnaire est une extension du dictionnaire «Moderne» et propose
+      en sus des graphies alternatives, parfois encore très usitées, parfois
+      tombées en désuétude.
+    '';
+  };
+
+  fr-moderne = mkDictFromDicollecte {
+    shortName = "fr-moderne";
+    dictFileName = "fr-moderne";
+    shortDescription = "French (modern)";
+    longDescription = ''
+      Ce dictionnaire propose une sélection des graphies classiques et
+      réformées, suivant la lente évolution de l’orthographe actuelle. Ce
+      dictionnaire contient les graphies les moins polémiques de la réforme.
+    '';
+    isDefault = true;
+  };
+
+  fr-reforme1990 = mkDictFromDicollecte {
+    shortName = "fr-reforme1990";
+    dictFileName = "fr-reforme1990";
+    shortDescription = "French (1990 reform)";
+    longDescription = ''
+      Ce dictionnaire ne connaît que les graphies nouvelles des mots concernés
+      par la réforme de 1990.
+    '';
+  };
+
+  /* ITALIAN */
+
+  it_IT = it-it;
+  it-it =  mkDictFromLinguistico {
+    shortName = "it-it";
+    dictFileName = "it_IT";
+    shortDescription = "Hunspell dictionary for 'Italian (Italy)' from Linguistico";
+    src = fetchurl {
+      url = "mirror://sourceforge/linguistico/italiano_2_4_2007_09_01.zip";
+      sha256 = "0m9frz75fx456bczknay5i446gdcp1smm48lc0qfwzhz0j3zcdrd";
+    };
+  };
+
+  /* BASQUE */
+
+  eu_ES = eu-es;
+  eu-es = mkDictFromXuxen {
+    shortName = "eu-es";
+    dictFileName = "eu_ES";
+    shortDescription = "Basque (Xuxen 5)";
+    longDescription = ''
+      Itxura berritzeaz gain, testuak zuzentzen laguntzeko zenbait hobekuntza
+      egin dira Xuxen.eus-en. Lexikoari dagokionez, 18645 sarrera berri erantsi
+      ditugu, eta proposamenak egiteko sistema ere aldatu dugu. Esate baterako,
+      gaizki idatzitako hitz baten inguruko proposamenak eskuratzeko, euskaraz
+      idaztean egiten ditugun akats arruntenak hartu dira kontuan. Sistemak
+      ematen dituen proposamenak ordenatzeko, berriz, aipatutako irizpidea
+      erabiltzeaz gain, Internetetik automatikoki eskuratutako euskarazko corpus
+      bateko datuen arabera ordenatu daitezke emaitzak. Erabiltzaileak horrela
+      ordenatu nahi baditu proposamenak, hautatu egin behar du aukera hori
+      testu-kutxaren azpian dituen aukeren artean. Interesgarria da proposamenak
+      ordenatzeko irizpide hori, hala sistemak formarik erabilienak proposatuko
+      baitizkigu gutxiago erabiltzen direnen aurretik.
+    '';
+    srcs = [
+      (fetchurl {
+        url = "http://xuxen.eus/static/hunspell/eu_ES.aff";
+        sha256 = "12w2j6phzas2rdzc7f20jnk93sm59m2zzfdgxv6p8nvcvbrkmc02";
+      })
+      (fetchurl {
+        url = "http://xuxen.eus/static/hunspell/eu_ES.dic";
+        sha256 = "0lw193jr7ldvln5x5z9p21rz1by46h0say9whfcw2kxs9vprd5b3";
+      })
+    ];
+  };
+
+  /* HUNGARIAN */
+
+  hu_HU = hu-hu;
+  hu-hu = mkDictFromLibreOffice {
+    shortName = "hu-hu";
+    dictFileName = "hu_HU";
+    shortDescription = "Hungarian (Hungary)";
+    license = with lib.licenses; [ mpl20 lgpl3 ];
+  };
+
+  /* SWEDISH */
+
+  sv_SE = sv-se;
+  sv-se = mkDictFromDSSO {
+    shortName = "sv-se";
+    dictFileName = "sv_SE";
+    shortDescription = "Swedish (Sweden)";
+  };
+
+  # Finlandian Swedish (hello Linus Torvalds)
+  sv_FI = sv-fi;
+  sv-fi = mkDictFromDSSO {
+    shortName = "sv-fi";
+    dictFileName = "sv_FI";
+    shortDescription = "Swedish (Finland)";
+  };
+
+  /* GERMAN */
+
+  de_DE = de-de;
+  de-de = mkDictFromJ3e {
+    shortName = "de-de";
+    shortDescription = "German (Germany)";
+    dictFileName = "de_DE";
+  };
+
+  de_AT = de-at;
+  de-at = mkDictFromJ3e {
+    shortName = "de-at";
+    shortDescription = "German (Austria)";
+    dictFileName = "de_AT";
+  };
+
+  de_CH = de-ch;
+  de-ch = mkDictFromJ3e {
+    shortName = "de-ch";
+    shortDescription = "German (Switzerland)";
+    dictFileName = "de_CH";
+  };
+
+  /* UKRAINIAN */
+
+  uk_UA = uk-ua;
+  uk-ua = mkDict rec {
+    pname = "hunspell-dict-uk-ua";
+    version = "4.6.3";
+    _version = "4-6.3";
+
+    src = fetchurl {
+      url = "https://extensions.libreoffice.org/extensions/ukrainian-spelling-dictionary-and-thesaurus/${_version}/@@download/file/dict-uk_UA-${version}.oxt";
+      sha256 = "14rd07yx4fx2qxjr5xqc8qy151idd8k2hr5yi18d9r8gccnm9w50";
+    };
+
+    dictFileName = "uk_UA";
+    readmeFile = "README_uk_UA.txt";
+    nativeBuildInputs = [ unzip ];
+    unpackCmd = ''
+      unzip $src ${dictFileName}/{${dictFileName}.dic,${dictFileName}.aff,${readmeFile}}
+    '';
+
+    meta = with lib; {
+      description = "Hunspell dictionary for Ukrainian (Ukraine) from LibreOffice";
+      homepage = "https://extensions.libreoffice.org/extensions/ukrainian-spelling-dictionary-and-thesaurus/";
+      license = licenses.mpl20;
+      maintainers = with maintainers; [ dywedir ];
+      platforms = platforms.all;
+    };
+  };
+
+  /* RUSSIAN */
+
+  ru_RU = ru-ru;
+  ru-ru = mkDictFromLibreOffice {
+    shortName = "ru-ru";
+    dictFileName = "ru_RU";
+    shortDescription = "Russian (Russian)";
+    license = with lib.licenses; [ mpl20 lgpl3 ];
+  };
+
+  /* CZECH */
+
+  cs_CZ = cs-cz;
+  cs-cz = mkDictFromLibreOffice {
+    shortName = "cs-cz";
+    dictFileName = "cs_CZ";
+    shortDescription = "Czech (Czechia)";
+    readmeFile = "README_cs.txt";
+    license = with lib.licenses; [ gpl2 ];
+  };
+
+  /* SLOVAK */
+
+  sk_SK = sk-sk;
+  sk-sk = mkDictFromLibreOffice {
+    shortName = "sk-sk";
+    dictFileName = "sk_SK";
+    shortDescription = "Slovak (Slovakia)";
+    readmeFile = "README_sk.txt";
+    license = with lib.licenses; [ gpl2 lgpl21 mpl11 ];
+  };
+
+  /* DANISH */
+
+  da_DK = da-dk;
+  da-dk = mkDict rec {
+    pname = "hunspell-dict-da-dk";
+    version = "2.5.189";
+
+    src = fetchurl {
+      url = "https://stavekontrolden.dk/dictionaries/da_DK/da_DK-${version}.oxt";
+      sha256 = "sha256:0i1cw0nfg24b0sg2yc3q7315ng5vc5245nvh0l1cndkn2c9z4978";
+    };
+
+    shortName = "da-dk";
+    shortDescription = "Danish (Danmark)";
+    dictFileName = "da_DK";
+    readmeFile = "README_da_DK.txt";
+    nativeBuildInputs = [ unzip ];
+    unpackCmd = ''
+      unzip $src ${dictFileName}.dic ${dictFileName}.aff ${readmeFile} -d ${dictFileName}
+    '';
+
+    meta = with lib; {
+      description = "Hunspell dictionary for Danish (Denmark) from Stavekontrolden";
+      homepage = "https://github.com/jeppebundsgaard/stavekontrolden";
+      license = with lib.licenses; [ gpl2Only lgpl21Only mpl11 ];
+      maintainers = with maintainers; [ louisdk1 ];
+    };
+  };
+
+  /* DUTCH */
+
+  nl_NL = nl_nl;
+  nl_nl = mkDict rec {
+    pname = "hunspell-dict-nl-nl";
+    version = "2.20.19";
+
+    src = fetchFromGitHub {
+      owner = "OpenTaal";
+      repo = "opentaal-hunspell";
+      rev = version;
+      sha256 = "0jma8mmrncyzd77kxliyngs4z6z4769g3nh0a7xn2pd4s5y2xdpy";
+    };
+
+    preInstall = ''
+      mv nl.aff nl_NL.aff
+      mv nl.dic nl_NL.dic
+    '';
+
+    dictFileName = "nl_NL";
+    readmeFile = "README.md";
+
+    meta = with lib; {
+      description = "Hunspell dictionary for Dutch (Netherlands) from OpenTaal";
+      homepage = "https://www.opentaal.org/";
+      license = with licenses; [ bsd3 cc-by-nc-30 ];
+      maintainers = with maintainers; [ artturin ];
+    };
+  };
+
+  /* HEBREW */
+
+  he_IL = he-il;
+  he-il = mkDictFromLibreOffice {
+    shortName = "he-il";
+    dictFileName = "he_IL";
+    shortDescription = "Hebrew (Israel)";
+    readmeFile = "README_he_IL.txt";
+    license = with lib.licenses; [ agpl3Plus ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/hunspell/wrapper.nix b/nixpkgs/pkgs/development/libraries/hunspell/wrapper.nix
new file mode 100644
index 000000000000..4ae177232751
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hunspell/wrapper.nix
@@ -0,0 +1,13 @@
+{ stdenv, lib, hunspell, makeWrapper, dicts ? [] }:
+with lib;
+let
+  searchPath = makeSearchPath "share/hunspell" dicts;
+in
+stdenv.mkDerivation {
+  name = (appendToName "with-dicts" hunspell).name;
+  nativeBuildInputs = [ makeWrapper ];
+  buildCommand = ''
+    makeWrapper ${hunspell.bin}/bin/hunspell $out/bin/hunspell --prefix DICPATH : ${searchPath}
+  '';
+  meta = removeAttrs hunspell.meta ["outputsToInstall"];
+}
diff --git a/nixpkgs/pkgs/development/libraries/hwloc/default.nix b/nixpkgs/pkgs/development/libraries/hwloc/default.nix
new file mode 100644
index 000000000000..9692ac531517
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hwloc/default.nix
@@ -0,0 +1,83 @@
+{ lib, stdenv, fetchurl, pkg-config, expat, ncurses, pciutils, numactl
+, x11Support ? false, libX11 ? null, cairo ? null
+}:
+
+assert x11Support -> libX11 != null && cairo != null;
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "hwloc";
+  version = "2.5.0";
+
+  src = fetchurl {
+    url = "https://www.open-mpi.org/software/hwloc/v${versions.majorMinor version}/downloads/hwloc-${version}.tar.bz2";
+    sha256 = "1j2j9wn39a8v91r23xncm1rzls6rjkgkvdvqghbdsnq8ps491kx9";
+  };
+
+  configureFlags = [
+    "--localstatedir=/var"
+    "--enable-netloc"
+  ];
+
+  # XXX: libX11 is not directly needed, but needed as a propagated dep of Cairo.
+  nativeBuildInputs = [ pkg-config ];
+
+  # Filter out `null' inputs.  This allows users to `.override' the
+  # derivation and set optional dependencies to `null'.
+  buildInputs = lib.filter (x: x != null)
+   ([ expat ncurses ]
+     ++  (optionals x11Support [ cairo libX11 ])
+     ++  (optionals stdenv.isLinux [ numactl ]));
+
+  propagatedBuildInputs =
+    # Since `libpci' appears in `hwloc.pc', it must be propagated.
+    optional stdenv.isLinux pciutils;
+
+  enableParallelBuilding = true;
+
+  postInstall =
+    optionalString (stdenv.isLinux && numactl != null)
+      '' if [ -d "${numactl}/lib64" ]
+         then
+             numalibdir="${numactl}/lib64"
+         else
+             numalibdir="${numactl}/lib"
+             test -d "$numalibdir"
+         fi
+
+         sed -i "$lib/lib/libhwloc.la" \
+             -e "s|-lnuma|-L$numalibdir -lnuma|g"
+      '';
+
+  # Checks disabled because they're impure (hardware dependent) and
+  # fail on some build machines.
+  doCheck = false;
+
+  outputs = [ "out" "lib" "dev" "doc" "man" ];
+
+  meta = {
+    description = "Portable abstraction of hierarchical architectures for high-performance computing";
+    longDescription = ''
+       hwloc provides a portable abstraction (across OS,
+       versions, architectures, ...) of the hierarchical topology of
+       modern architectures, including NUMA memory nodes, sockets,
+       shared caches, cores and simultaneous multithreading.  It also
+       gathers various attributes such as cache and memory
+       information.  It primarily aims at helping high-performance
+       computing applications with gathering information about the
+       hardware so as to exploit it accordingly and efficiently.
+
+       hwloc may display the topology in multiple convenient
+       formats.  It also offers a powerful programming interface to
+       gather information about the hardware, bind processes, and much
+       more.
+    '';
+
+    # https://www.open-mpi.org/projects/hwloc/license.php
+    license = licenses.bsd3;
+    homepage = "https://www.open-mpi.org/projects/hwloc/";
+    maintainers = with maintainers; [ fpletz markuskowa ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/hyena/default.nix b/nixpkgs/pkgs/development/libraries/hyena/default.nix
new file mode 100644
index 000000000000..177f6fe7909d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hyena/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, pkg-config, mono, gtk-sharp-2_0, monoDLLFixer }:
+
+stdenv.mkDerivation rec {
+  pname = "hyena";
+  version = "0.5";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
+    sha256 = "eb7154a42b6529bb9746c39272719f3168d6363ed4bad305a916ed7d90bc8de9";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    mono gtk-sharp-2_0
+  ];
+
+  postPatch = ''
+    patchShebangs build/dll-map-makefile-verifier
+    patchShebangs build/private-icon-theme-installer
+    substituteInPlace configure --replace lib/mono/2.0/ lib/mono/2.0-api/
+    find -name Makefile.in | xargs -n 1 -d '\n' sed -e 's/^dnl/#/' -i
+  '';
+
+  dontStrip = true;
+
+  inherit monoDLLFixer;
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Attic/Hyena";
+    description = "A C# library which contains a hodge-podge of random stuff";
+    longDescription = ''
+      Hyena is a C# library used to make awesome applications. It contains a lot of random things,
+      including useful data structures, a Sqlite-based db layer, cool widgets, a JSON library,
+      a smart job/task scheduler, a user-query/search parser, and much more. It's particularly
+      useful for Gtk# applications, though only the Hyena.Gui assembly requires Gtk#.
+    '';
+    platforms = platforms.all;
+    maintainers = with maintainers; [ obadz ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/hyperscan/default.nix b/nixpkgs/pkgs/development/libraries/hyperscan/default.nix
new file mode 100644
index 000000000000..4093578156a6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hyperscan/default.nix
@@ -0,0 +1,67 @@
+{ lib, stdenv, fetchFromGitHub, cmake, ragel, python3
+, coreutils, gnused, util-linux
+, boost
+, withStatic ? false # build only shared libs by default, build static+shared if true
+}:
+
+# NOTICE: pkg-config, pcap and pcre intentionally omitted from build inputs
+#         pcap used only in examples, pkg-config used only to check for pcre
+#         which is fixed 8.41 version requirement (nixpkgs have 8.42+, and
+#         I not see any reason (for now) to backport 8.41.
+
+stdenv.mkDerivation rec {
+  pname = "hyperscan";
+  version = "5.4.0";
+
+  src = fetchFromGitHub {
+    owner = "intel";
+    repo = pname;
+    sha256 = "sha256-AJAjaXVnGqIlMk+gb6lpTLUdZr8nxn2XSW4fj6j/cmk=";
+    rev = "v${version}";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  buildInputs = [ boost ];
+  nativeBuildInputs = [
+    cmake ragel python3
+    # Consider simply using busybox for these
+    # Need at least: rev, sed, cut, nm
+    coreutils gnused util-linux
+  ];
+
+  cmakeFlags = [
+    "-DFAT_RUNTIME=ON"
+    "-DBUILD_AVX512=ON"
+  ]
+  ++ lib.optional (withStatic) "-DBUILD_STATIC_AND_SHARED=ON"
+  ++ lib.optional (!withStatic) "-DBUILD_SHARED_LIBS=ON";
+
+  postPatch = ''
+    sed -i '/examples/d' CMakeLists.txt
+    substituteInPlace libhs.pc.in \
+      --replace "libdir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBDIR@" "libdir=@CMAKE_INSTALL_LIBDIR@" \
+      --replace "includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@" "includedir=@CMAKE_INSTALL_INCLUDEDIR@"
+  '';
+
+  meta = with lib; {
+    description = "High-performance multiple regex matching library";
+    longDescription = ''
+      Hyperscan is a high-performance multiple regex matching library.
+      It follows the regular expression syntax of the commonly-used
+      libpcre library, but is a standalone library with its own C API.
+
+      Hyperscan uses hybrid automata techniques to allow simultaneous
+      matching of large numbers (up to tens of thousands) of regular
+      expressions and for the matching of regular expressions across
+      streams of data.
+
+      Hyperscan is typically used in a DPI library stack.
+    '';
+
+    homepage = "https://www.hyperscan.io/";
+    maintainers = with maintainers; [ avnik ];
+    platforms = [ "x86_64-linux" ]; # can't find nm on darwin ; might build on aarch64 but untested
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/hyphen/default.nix b/nixpkgs/pkgs/development/libraries/hyphen/default.nix
new file mode 100644
index 000000000000..ed3980f7a90d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/hyphen/default.nix
@@ -0,0 +1,27 @@
+{ lib, 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 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; [ Br1ght0ne ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/icu/58.nix b/nixpkgs/pkgs/development/libraries/icu/58.nix
new file mode 100644
index 000000000000..e53e4e3737ed
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/icu/58.nix
@@ -0,0 +1,14 @@
+fetchurl:
+let
+  keywordFix = fetchurl {
+    url = "http://bugs.icu-project.org/trac/changeset/39484?format=diff";
+    name = "icu-changeset-39484.diff";
+    sha256 = "0hxhpgydalyxacaaxlmaddc1sjwh65rsnpmg0j414mnblq74vmm8";
+  };
+in
+import ./base.nix {
+  version = "58.2";
+  sha256 = "036shcb3f8bm1lynhlsb4kpjm9s9c2vdiir01vg216rs2l8482ib";
+  patches = [ keywordFix ];
+  patchFlags = [ "-p4" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/icu/59.nix b/nixpkgs/pkgs/development/libraries/icu/59.nix
new file mode 100644
index 000000000000..9ca66ca525fd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/icu/59.nix
@@ -0,0 +1,4 @@
+import ./base.nix {
+  version = "59.1";
+  sha256 = "1zkmbg2932ggvpgjp8pys0cj6z8bw087y8858009shkrjfpzscki";
+}
diff --git a/nixpkgs/pkgs/development/libraries/icu/60.nix b/nixpkgs/pkgs/development/libraries/icu/60.nix
new file mode 100644
index 000000000000..e56135b15c62
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/icu/60.nix
@@ -0,0 +1,4 @@
+import ./base.nix {
+  version = "60.2";
+  sha256 = "065l3n0q9wqaw8dz20x82srshhm6i987fr9ync5xf9mr6n7ylwzh";
+}
diff --git a/nixpkgs/pkgs/development/libraries/icu/63.nix b/nixpkgs/pkgs/development/libraries/icu/63.nix
new file mode 100644
index 000000000000..07684d8db818
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/icu/63.nix
@@ -0,0 +1,14 @@
+{ stdenv, lib, fetchurl, fetchpatch, fixDarwinDylibNames, nativeBuildRoot }:
+
+import ./base.nix {
+  version = "63.1";
+  sha256 = "17fbk0lm2clsxbmjzvyp245ayx0n4chji3ky1f3fbz2ljjv91i05";
+  patches = [
+    # https://bugzilla.mozilla.org/show_bug.cgi?id=1499398
+    (fetchpatch {
+      url = "https://github.com/unicode-org/icu/commit/8baff8f03e07d8e02304d0c888d0bb21ad2eeb01.patch";
+      sha256 = "1awfa98ljcf95a85cssahw6bvdnpbq5brf1kgspy14w4mlmhd0jb";
+    })
+  ];
+  patchFlags = [ "-p3" ];
+} { inherit stdenv lib fetchurl fixDarwinDylibNames nativeBuildRoot; }
diff --git a/nixpkgs/pkgs/development/libraries/icu/64.nix b/nixpkgs/pkgs/development/libraries/icu/64.nix
new file mode 100644
index 000000000000..c7bdd22c1793
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/icu/64.nix
@@ -0,0 +1,4 @@
+import ./base.nix {
+  version = "64.2";
+  sha256 = "0v0xsf14xwlj125y9fd8lrhsaych4d8liv8gr746zng6g225szb2";
+}
diff --git a/nixpkgs/pkgs/development/libraries/icu/65.nix b/nixpkgs/pkgs/development/libraries/icu/65.nix
new file mode 100644
index 000000000000..c5074eea114d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/icu/65.nix
@@ -0,0 +1,4 @@
+import ./base.nix {
+  version = "65.1";
+  sha256 = "0j6r6qqnhfr5iqkx53k63ifkm93kv1kkb7h2mlgd1mnnndk79qsk";
+}
diff --git a/nixpkgs/pkgs/development/libraries/icu/66.nix b/nixpkgs/pkgs/development/libraries/icu/66.nix
new file mode 100644
index 000000000000..5dfad945d291
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/icu/66.nix
@@ -0,0 +1,4 @@
+import ./base.nix {
+  version = "66.1";
+  sha256 = "0bharwzc9nzkbrcf405z2nb3h7q0711z450arz0mjmdrk8hg58sj";
+}
diff --git a/nixpkgs/pkgs/development/libraries/icu/67.nix b/nixpkgs/pkgs/development/libraries/icu/67.nix
new file mode 100644
index 000000000000..23a1069ea14f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/icu/67.nix
@@ -0,0 +1,4 @@
+import ./base.nix {
+  version = "67.1";
+  sha256 = "1p6mhvxl0xr2n0g6xdps3mwzwlv6mjsz3xlpm793p9aiybb0ra4l";
+}
diff --git a/nixpkgs/pkgs/development/libraries/icu/68.nix b/nixpkgs/pkgs/development/libraries/icu/68.nix
new file mode 100644
index 000000000000..5aeba0f2628c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/icu/68.nix
@@ -0,0 +1,4 @@
+import ./base.nix {
+  version = "68.2";
+  sha256 = "09fng7a80xj8d5r1cgbgq8r47dsw5jsr6si9p2cj2ylhwgg974f7";
+}
diff --git a/nixpkgs/pkgs/development/libraries/icu/69.nix b/nixpkgs/pkgs/development/libraries/icu/69.nix
new file mode 100644
index 000000000000..8cea41daadb9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/icu/69.nix
@@ -0,0 +1,4 @@
+import ./base.nix {
+  version = "69.1";
+  sha256 = "0icps0avkwy5df3wwc5kybxcg63hcgk4phdh9g244g0xrmx7pfjc";
+}
diff --git a/nixpkgs/pkgs/development/libraries/icu/base.nix b/nixpkgs/pkgs/development/libraries/icu/base.nix
new file mode 100644
index 000000000000..47eea8ba1af1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/icu/base.nix
@@ -0,0 +1,100 @@
+{ version, sha256, patches ? [], patchFlags ? [] }:
+{ stdenv, lib, fetchurl, fixDarwinDylibNames
+  # Cross-compiled icu4c requires a build-root of a native compile
+, buildRootOnly ? false, nativeBuildRoot
+}:
+
+let
+  pname = "icu4c";
+
+  baseAttrs = {
+    src = fetchurl {
+      url = "https://github.com/unicode-org/icu/releases/download/release-${lib.replaceChars [ "." ] [ "-" ] version}/icu4c-${lib.replaceChars [ "." ] [ "_" ] version}-src.tgz";
+      inherit sha256;
+    };
+
+    postUnpack = ''
+      sourceRoot=''${sourceRoot}/source
+      echo Source root reset to ''${sourceRoot}
+    '';
+
+    # https://sourceware.org/glibc/wiki/Release/2.26#Removal_of_.27xlocale.h.27
+    postPatch = if (stdenv.hostPlatform.libc == "glibc" || stdenv.hostPlatform.libc == "musl") && lib.versionOlder version "62.1"
+      then "substituteInPlace i18n/digitlst.cpp --replace '<xlocale.h>' '<locale.h>'"
+      else null; # won't find locale_t on darwin
+
+    inherit patchFlags patches;
+
+    preConfigure = ''
+      sed -i -e "s|/bin/sh|${stdenv.shell}|" configure
+
+      # $(includedir) is different from $(prefix)/include due to multiple outputs
+      sed -i -e 's|^\(CPPFLAGS = .*\) -I\$(prefix)/include|\1 -I$(includedir)|' config/Makefile.inc.in
+    '' + lib.optionalString stdenv.isAarch32 ''
+      # From https://archlinuxarm.org/packages/armv7h/icu/files/icudata-stdlibs.patch
+      sed -e 's/LDFLAGSICUDT=-nodefaultlibs -nostdlib/LDFLAGSICUDT=/' -i config/mh-linux
+    '';
+
+    configureFlags = [ "--disable-debug" ]
+      ++ lib.optional (stdenv.isFreeBSD || stdenv.isDarwin) "--enable-rpath"
+      ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--with-cross-build=${nativeBuildRoot}";
+
+    enableParallelBuilding = true;
+
+    meta = with lib; {
+      description = "Unicode and globalization support library";
+      homepage = "http://site.icu-project.org/";
+      maintainers = with maintainers; [ raskin ];
+      platforms = platforms.all;
+    };
+  };
+
+  realAttrs = baseAttrs // {
+    name = pname + "-" + version;
+
+    outputs = [ "out" "dev" ];
+    outputBin = "dev";
+
+    # FIXME: This fixes dylib references in the dylibs themselves, but
+    # not in the programs in $out/bin.
+    nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+
+    # remove dependency on bootstrap-tools in early stdenv build
+    postInstall = 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" \
+        ${lib.concatMapStringsSep " " (r: "--replace '${r.from}' '${r.to}'") replacements}
+    '');
+
+    postFixup = ''moveToOutput lib/icu "$dev" '';
+  };
+
+  buildRootOnlyAttrs = baseAttrs // {
+    name = pname + "-build-root-" + version;
+
+    preConfigure = baseAttrs.preConfigure + ''
+      mkdir build
+      cd build
+      configureScript=../configure
+    '';
+
+    postBuild = ''
+      cd ..
+      mv build $out
+      echo "Doing build-root only, exiting now" >&2
+      exit 0
+    '';
+  };
+
+  attrs = if buildRootOnly
+            then buildRootOnlyAttrs
+          else realAttrs;
+in
+stdenv.mkDerivation attrs
diff --git a/nixpkgs/pkgs/development/libraries/id3lib/default.nix b/nixpkgs/pkgs/development/libraries/id3lib/default.nix
new file mode 100644
index 000000000000..141be2092a50
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/id3lib/default.nix
@@ -0,0 +1,27 @@
+{lib, stdenv, fetchurl, zlib}:
+
+stdenv.mkDerivation rec {
+  pname = "id3lib";
+  version = "3.8.3";
+
+  patches = [
+    ./id3lib-3.8.3-gcc43-1.patch
+    ./patch_id3lib_3.8.3_UTF16_writing_bug.diff
+  ];
+
+  buildInputs = [ zlib ];
+
+  src = fetchurl {
+    url = "mirror://sourceforge/id3lib/${pname}-${version}.tar.gz";
+    sha256 = "0yfhqwk0w8q2hyv1jib1008jvzmwlpsxvc8qjllhna6p1hycqj97";
+  };
+
+  doCheck = false; # fails to compile
+
+  meta = with lib; {
+    description = "Library for reading, writing, and manipulating ID3v1 and ID3v2 tags";
+    homepage = "http://id3lib.sourceforge.net";
+    platforms = platforms.unix;
+    license = licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/id3lib/id3lib-3.8.3-gcc43-1.patch b/nixpkgs/pkgs/development/libraries/id3lib/id3lib-3.8.3-gcc43-1.patch
new file mode 100644
index 000000000000..2b7457d54c79
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/id3lib/id3lib-3.8.3-gcc43-1.patch
@@ -0,0 +1,104 @@
+http://www.linuxfromscratch.org/patches/downloads/id3lib/id3lib-3.8.3-gcc43-1.patch 
+
+Submitted By: Ken Moffat <ken at linuxfromscratch dot org>
+Date: 2008-11-21
+Initial Package Version: 3.8.3
+Upstream Status: unknown
+Origin: fedora
+Description: Allows it to compile with gcc-4.3.
+
+diff -up id3lib-3.8.3/include/id3/id3lib_strings.h~ id3lib-3.8.3/include/id3/id3lib_strings.h
+--- id3lib-3.8.3/include/id3/id3lib_strings.h~	2003-03-02 02:23:00.000000000 +0200
++++ id3lib-3.8.3/include/id3/id3lib_strings.h	2008-01-04 01:30:52.000000000 +0200
+@@ -29,6 +29,7 @@
+ #ifndef _ID3LIB_STRINGS_H_
+ #define _ID3LIB_STRINGS_H_
+ 
++#include <cstring>
+ #include <string>
+ 
+ #if (defined(__GNUC__) && (__GNUC__ >= 3) || (defined(_MSC_VER) && _MSC_VER > 1000))
+diff -up id3lib-3.8.3/configure.in~ id3lib-3.8.3/configure.in
+--- id3lib-3.8.3/configure.in~	2008-01-04 11:39:01.000000000 +0100
++++ id3lib-3.8.3/configure.in	2008-01-04 11:39:01.000000000 +0100
+@@ -227,7 +227,6 @@ AC_CHECK_HEADERS(fstream iostream iomani
+ )
+ AC_CHECK_HEADERS(               \
+   string                        \
+-  iomanip.h                     \
+   ,,AC_MSG_ERROR([Missing a vital header file for id3lib])
+ )
+ 
+diff -up id3lib-3.8.3/configure~ id3lib-3.8.3/configure
+--- id3lib-3.8.3/configure~	2008-01-04 11:39:10.000000000 +0100
++++ id3lib-3.8.3/configure	2008-01-04 11:39:10.000000000 +0100
+@@ -22976,7 +22976,6 @@ done
+ 
+ for ac_header in \
+   string                        \
+-  iomanip.h                     \
+ 
+ do
+ as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+diff -up id3lib-3.8.3/include/id3/writers.h~ id3lib-3.8.3/include/id3/writers.h
+--- id3lib-3.8.3/include/id3/writers.h~	2008-01-04 11:59:39.000000000 +0100
++++ id3lib-3.8.3/include/id3/writers.h	2008-01-04 11:59:39.000000000 +0100
+@@ -28,9 +28,9 @@
+ #ifndef _ID3LIB_WRITERS_H_
+ #define _ID3LIB_WRITERS_H_
+ 
++#include <cstring>
+ #include "id3/writer.h"
+ #include "id3/id3lib_streams.h"
+-//#include <string.h>
+ 
+ class ID3_CPP_EXPORT ID3_OStreamWriter : public ID3_Writer
+ {
+diff -up id3lib-3.8.3/examples/demo_info.cpp~ id3lib-3.8.3/examples/demo_info.cpp
+--- id3lib-3.8.3/examples/demo_info.cpp~	2008-01-04 12:00:56.000000000 +0100
++++ id3lib-3.8.3/examples/demo_info.cpp	2008-01-04 12:00:56.000000000 +0100
+@@ -309,7 +309,7 @@ void PrintInformation(const ID3_Tag &myT
+ 
+ #define DEBUG
+ 
+-int main( unsigned int argc, char * const argv[])
++int main(int argc, char * const argv[])
+ {
+   ID3D_INIT_DOUT();
+ 
+diff -up id3lib-3.8.3/examples/demo_copy.cpp~ id3lib-3.8.3/examples/demo_copy.cpp
+--- id3lib-3.8.3/examples/demo_copy.cpp~	2008-01-04 12:01:26.000000000 +0100
++++ id3lib-3.8.3/examples/demo_copy.cpp	2008-01-04 12:01:26.000000000 +0100
+@@ -81,7 +81,7 @@ void DisplayTags(ostream &os, luint nTag
+   }
+ }
+ 
+-int main( unsigned int argc, char * const argv[])
++int main(int argc, char * const argv[])
+ {
+   int ulFlag = ID3TT_ID3;
+   ID3D_INIT_DOUT();
+diff -up id3lib-3.8.3/examples/demo_convert.cpp~ id3lib-3.8.3/examples/demo_convert.cpp
+--- id3lib-3.8.3/examples/demo_convert.cpp~	2008-01-04 12:01:20.000000000 +0100
++++ id3lib-3.8.3/examples/demo_convert.cpp	2008-01-04 12:01:20.000000000 +0100
+@@ -84,7 +84,7 @@ void DisplayTags(ostream &os, luint nTag
+   }
+ }
+ 
+-int main( unsigned int argc, char * const argv[])
++int main(int argc, char * const argv[])
+ {
+   flags_t ulFlag = ID3TT_ALL;
+   gengetopt_args_info args;
+diff -up id3lib-3.8.3/examples/demo_tag.cpp~ id3lib-3.8.3/examples/demo_tag.cpp
+--- id3lib-3.8.3/examples/demo_tag.cpp~	2008-01-04 12:01:41.000000000 +0100
++++ id3lib-3.8.3/examples/demo_tag.cpp	2008-01-04 12:01:41.000000000 +0100
+@@ -46,7 +46,7 @@ void DisplayTags(ostream &os, luint nTag
+     os << "v2";
+ }
+ 
+-int main( unsigned int argc, char * const argv[])
++int main(int argc, char * const argv[])
+ {
+   int ulFlag = ID3TT_ID3;
+   ID3D_INIT_DOUT();
diff --git a/nixpkgs/pkgs/development/libraries/id3lib/patch_id3lib_3.8.3_UTF16_writing_bug.diff b/nixpkgs/pkgs/development/libraries/id3lib/patch_id3lib_3.8.3_UTF16_writing_bug.diff
new file mode 100644
index 000000000000..b05d2cf298d3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/id3lib/patch_id3lib_3.8.3_UTF16_writing_bug.diff
@@ -0,0 +1,39 @@
+diff -ruN id3lib-3.8.3.orig/ChangeLog id3lib-3.8.3/ChangeLog
+--- id3lib-3.8.3.orig/ChangeLog	2003-03-02 01:23:00.000000000 +0100
++++ id3lib-3.8.3/ChangeLog	2006-02-22 00:33:59.946214472 +0100
+@@ -1,3 +1,8 @@
++2006-02-17  Jerome Couderc
++
++    * Patch from Spoon to fix UTF-16 writing bug
++      http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
++
+ 2003-03-02 Sunday 17:38   Thijmen Klok <thijmen@id3lib.org>
+ 
+ 	* THANKS (1.20): added more people 
+diff -ruN id3lib-3.8.3.orig/src/io_helpers.cpp id3lib-3.8.3/src/io_helpers.cpp
+--- id3lib-3.8.3.orig/src/io_helpers.cpp	2003-03-02 01:23:00.000000000 +0100
++++ id3lib-3.8.3/src/io_helpers.cpp	2006-02-22 00:35:02.926639992 +0100
+@@ -363,11 +363,22 @@
+     // Write the BOM: 0xFEFF
+     unicode_t BOM = 0xFEFF;
+     writer.writeChars((const unsigned char*) &BOM, 2);
++    // Patch from Spoon : 2004-08-25 14:17
++    //   http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
++    // Wrong code
++    //for (size_t i = 0; i < size; i += 2)
++    //{
++    //  unicode_t ch = (data[i] << 8) | data[i+1];
++    //  writer.writeChars((const unsigned char*) &ch, 2);
++    //}
++    // Right code
++    unsigned char *pdata = (unsigned char *) data.c_str();
+     for (size_t i = 0; i < size; i += 2)
+     {
+-      unicode_t ch = (data[i] << 8) | data[i+1];
++      unicode_t ch = (pdata[i] << 8) | pdata[i+1];
+       writer.writeChars((const unsigned char*) &ch, 2);
+     }
++    // End patch
+   }
+   return writer.getCur() - beg;
+ }
diff --git a/nixpkgs/pkgs/development/libraries/idnkit/default.nix b/nixpkgs/pkgs/development/libraries/idnkit/default.nix
new file mode 100644
index 000000000000..472a23a2b74e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/idnkit/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl, libiconv }:
+
+stdenv.mkDerivation rec {
+  pname = "idnkit";
+  version = "2.3";
+
+  src = fetchurl {
+    url = "https://jprs.co.jp/idn/${pname}-${version}.tar.bz2";
+    sha256 = "0zp9yc84ff5s0g2i6v9yfyza2n2x4xh0kq7hjd3anhh0clbp3l16";
+  };
+
+  buildInputs = [ libiconv ];
+
+  meta = with lib; {
+    homepage = "https://www.nic.ad.jp/ja/idn/idnkit";
+    description = "Provides functionalities about i18n domain name processing";
+    license = "idnkit-2 license";
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/igraph/default.nix b/nixpkgs/pkgs/development/libraries/igraph/default.nix
new file mode 100644
index 000000000000..03573716fa35
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/igraph/default.nix
@@ -0,0 +1,110 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, arpack
+, bison
+, blas
+, cmake
+, flex
+, fop
+, glpk
+, gmp
+, lapack
+, libxml2
+, libxslt
+, pkg-config
+, python3
+, sourceHighlight
+, suitesparse
+, xmlto
+}:
+
+stdenv.mkDerivation rec {
+  pname = "igraph";
+  version = "0.9.4";
+
+  src = fetchFromGitHub {
+    owner = "igraph";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-tF+cnJRv125bSpZIpABTIHAfJO4TNfSBHjnzpNTbFgk=";
+  };
+
+  # Normally, igraph wants us to call bootstrap.sh, which will call
+  # tools/getversion.sh. Instead, we're going to put the version directly
+  # where igraph wants, and then let autoreconfHook do the rest of the
+  # bootstrap. ~ C.
+  postPatch = ''
+    echo "${version}" > IGRAPH_VERSION
+  '' + lib.optionalString stdenv.isAarch64 ''
+    # https://github.com/igraph/igraph/issues/1694
+    substituteInPlace tests/CMakeLists.txt \
+      --replace "igraph_scg_grouping3" "" \
+      --replace "igraph_scg_semiprojectors2" ""
+  '';
+
+  outputs = [ "out" "dev" "doc" ];
+
+  nativeBuildInputs = [
+    bison
+    cmake
+    flex
+    fop
+    libxml2
+    libxslt
+    pkg-config
+    python3
+    sourceHighlight
+    xmlto
+  ];
+
+  buildInputs = [
+    arpack
+    blas
+    glpk
+    gmp
+    lapack
+    libxml2
+    suitesparse
+  ];
+
+  cmakeFlags = [
+    "-DIGRAPH_USE_INTERNAL_BLAS=OFF"
+    "-DIGRAPH_USE_INTERNAL_LAPACK=OFF"
+    "-DIGRAPH_USE_INTERNAL_ARPACK=OFF"
+    "-DIGRAPH_USE_INTERNAL_GLPK=OFF"
+    "-DIGRAPH_USE_INTERNAL_CXSPARSE=OFF"
+    "-DIGRAPH_USE_INTERNAL_GMP=OFF"
+    "-DIGRAPH_GLPK_SUPPORT=ON"
+    "-DIGRAPH_GRAPHML_SUPPORT=ON"
+    "-DIGRAPH_ENABLE_LTO=AUTO"
+    "-DIGRAPH_ENABLE_TLS=ON"
+    "-DBUILD_SHARED_LIBS=ON"
+  ];
+
+  doCheck = true;
+
+  # needed to find libigraph, and liblas on darwin
+  preCheck = if stdenv.isDarwin then ''
+    export DYLD_LIBRARY_PATH="${lib.makeLibraryPath [ blas ]}:$PWD/src"
+  '' else ''
+    export LD_LIBRARY_PATH="$PWD/src"
+  '';
+
+  postInstall = ''
+    mkdir -p "$out/share"
+    cp -r doc "$out/share"
+  '';
+
+  postFixup = lib.optionalString stdenv.isDarwin ''
+    install_name_tool -change libblas.dylib ${blas}/lib/libblas.dylib $out/lib/libigraph.dylib
+  '';
+
+  meta = with lib; {
+    description = "The network analysis package";
+    homepage = "https://igraph.org/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ MostAwesomeDude dotlambda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ijs/default.nix b/nixpkgs/pkgs/development/libraries/ijs/default.nix
new file mode 100644
index 000000000000..b300731ce440
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ijs/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, autoreconfHook, ghostscript }:
+
+stdenv.mkDerivation {
+  name = "ijs-${ghostscript.version}";
+
+  inherit (ghostscript) src;
+
+  postPatch = "cd ijs";
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  configureFlags = [ "--enable-shared" ];
+
+  meta = with lib; {
+    homepage = "https://www.openprinting.org/download/ijs/";
+    description = "Raster printer driver architecture";
+
+    license = licenses.gpl3Plus;
+
+    platforms = platforms.all;
+    maintainers = [ maintainers.abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/iksemel/default.nix b/nixpkgs/pkgs/development/libraries/iksemel/default.nix
new file mode 100644
index 000000000000..6ba64dcaa588
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/iksemel/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, autoreconfHook, libtool, pkg-config, gnutls, fetchFromGitHub, texinfo }:
+
+stdenv.mkDerivation rec {
+  pname = "iksemel";
+  version = "1.4.2";
+
+  src = fetchFromGitHub {
+    owner = "timothytylee";
+    repo = "iksemel-1.4";
+    rev = "v${version}";
+    sha256 = "1xv302p344hnpxqcgs3z6wwxhrik39ckgfw5cjyrw0dkf316z9yh";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook libtool texinfo ];
+  buildInputs = [ gnutls ];
+
+  meta = with lib; {
+    description = "XML parser for jabber";
+
+    homepage = "https://github.com/timothytylee/iksemel-1.4";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ disassembler ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ilbc/CMakeLists.txt b/nixpkgs/pkgs/development/libraries/ilbc/CMakeLists.txt
new file mode 100644
index 000000000000..edd8e7a32797
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ilbc/CMakeLists.txt
@@ -0,0 +1,11 @@
+cmake_minimum_required(VERSION 2.6)
+
+project(ilbc)
+
+file(GLOB ilbc_SRCS *.c)
+file(GLOB ilbc_HDRS *.h)
+
+add_library(ilbc SHARED ${ilbc_SRCS})
+
+install(TARGETS ilbc DESTINATION lib)
+install(FILES ${ilbc_HDRS} DESTINATION include/ilbc)
diff --git a/nixpkgs/pkgs/development/libraries/ilbc/default.nix b/nixpkgs/pkgs/development/libraries/ilbc/default.nix
new file mode 100644
index 000000000000..39d7b7b61b04
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ilbc/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, gawk, cmake }:
+
+stdenv.mkDerivation rec {
+  name = "ilbc-rfc3951";
+
+  script = ./extract-cfile.awk;
+
+  rfc3951 = fetchurl {
+    url = "http://www.ietf.org/rfc/rfc3951.txt";
+    sha256 = "0zf4mvi3jzx6zjrfl2rbhl2m68pzbzpf1vbdmn7dqbfpcb67jpdy";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  unpackPhase = ''
+    mkdir -v ${name}
+    cd ${name}
+    ${gawk}/bin/gawk -f ${script} ${rfc3951}
+    cp -v ${./CMakeLists.txt} CMakeLists.txt
+    '';
+
+  meta = {
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ilbc/extract-cfile.awk b/nixpkgs/pkgs/development/libraries/ilbc/extract-cfile.awk
new file mode 100644
index 000000000000..e4b07bc08963
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ilbc/extract-cfile.awk
@@ -0,0 +1,24 @@
+BEGIN { srcname = "nothing"; }
+{ if (/^A\.[0-9][0-9]*\.* *[a-zA-Z][a-zA-Z_0-9]*\.[ch]/) {
+    if (srcname != "nothing")
+      close(srcname);
+    srcname = $2;
+    printf("creating source file %s\n", srcname);
+  }else if (srcname != "nothing") {
+    if (/Andersen,* *et* *al\./) 
+      printf("skipping %s\n", $0);
+    else if (//)
+      printf("skipping2 %s\n", $0);
+    else if (/Internet Low Bit Rate Codec *December 2004/)
+      printf("skipping3 %s\n", $0);
+    else if (/Authors' *Addresses/){
+      close(srcname);
+      exit;}
+    else
+      print $0 >> srcname;
+  }
+}
+END {
+  printf("ending file %s\n", srcname);
+  close(srcname);
+}
diff --git a/nixpkgs/pkgs/development/libraries/ilixi/default.nix b/nixpkgs/pkgs/development/libraries/ilixi/default.nix
new file mode 100644
index 000000000000..385baaaf10df
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ilixi/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, directfb, libsigcxx, libxml2, fontconfig }:
+
+# TODO: optional deps: baresip, FusionDale, FusionSound, SaWMan, doxygen,
+# Reflex, Wnn, NLS
+
+stdenv.mkDerivation rec {
+  pname = "ilixi";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "ilixi";
+    repo = "ilixi";
+    rev = version;
+    sha256 = "05h862r9mhis26v8yf967n86qf8y1gdgfzhbqfsr6pjw1k3v3wdr";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ directfb libsigcxx libxml2 fontconfig ];
+
+  configureFlags = [
+    "--enable-log-debug"
+    "--enable-debug"
+    "--enable-trace"
+    "--with-examples"
+  ];
+
+  meta = with lib; {
+    description = "Lightweight C++ GUI toolkit for embedded Linux systems";
+    homepage = "https://github.com/ilixi/ilixi";
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+    broken = true; # broken by the directfb 1.6.3 -> 1.7.6 update
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ilmbase/default.nix b/nixpkgs/pkgs/development/libraries/ilmbase/default.nix
new file mode 100644
index 000000000000..219d961f9f96
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ilmbase/default.nix
@@ -0,0 +1,37 @@
+{ stdenv
+, lib
+, buildPackages
+, cmake
+, openexr
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ilmbase";
+  version = lib.getVersion openexr;
+
+  # the project no longer provides separate tarballs. We may even want to merge
+  # the ilmbase package into openexr in the future.
+  inherit (openexr) src patches;
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ cmake ];
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+
+  # fails 1 out of 1 tests with
+  # "lt-ImathTest: testBoxAlgo.cpp:892: void {anonymous}::boxMatrixTransform(): Assertion `b21 == b2' failed"
+  # at least on i686. spooky!
+  doCheck = stdenv.isx86_64;
+
+  preConfigure = ''
+    # Need to cd after patches for openexr patches to apply.
+    cd IlmBase
+  '';
+
+  meta = with 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/imath/default.nix b/nixpkgs/pkgs/development/libraries/imath/default.nix
new file mode 100644
index 000000000000..f3678064f3c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/imath/default.nix
@@ -0,0 +1,27 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "imath";
+  version = "3.1.2";
+
+  src = fetchFromGitHub {
+    owner = "AcademySoftwareFoundation";
+    repo = "imath";
+    rev = "v${version}";
+    sha256 = "sha256-X+LY1xtMeYMO6Ri6fmBF2JEDuY6MF7j5XO5YhWMuffM=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Imath is a C++ and python library of 2D and 3D vector, matrix, and math operations for computer graphics";
+    homepage = "https://github.com/AcademySoftwareFoundation/Imath";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ paperdigits ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/iml/default.nix b/nixpkgs/pkgs/development/libraries/iml/default.nix
new file mode 100644
index 000000000000..474605fe7696
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/iml/default.nix
@@ -0,0 +1,29 @@
+{lib, stdenv, autoreconfHook, fetchurl, gmp, blas}:
+stdenv.mkDerivation rec {
+  pname = "iml";
+  version = "1.0.5";
+  src = fetchurl {
+    url = "http://www.cs.uwaterloo.ca/~astorjoh/iml-${version}.tar.bz2";
+    sha256 = "0akwhhz9b40bz6lrfxpamp7r7wkk48p455qbn04mfnl9a1l6db8x";
+  };
+  buildInputs = [
+    gmp
+    blas
+  ];
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+  configureFlags = [
+    "--with-gmp-include=${gmp.dev}/include"
+    "--with-gmp-lib=${gmp}/lib"
+    "--with-cblas=-lblas"
+  ];
+  meta = {
+    description = "Algorithms for computing exact solutions to dense systems of linear equations over the integers";
+    license = lib.licenses.gpl2Plus;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.unix;
+    homepage = "https://cs.uwaterloo.ca/~astorjoh/iml.html";
+    updateWalker = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/imlib/default.nix b/nixpkgs/pkgs/development/libraries/imlib/default.nix
new file mode 100644
index 000000000000..4bc06a97a7b2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/imlib/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchurl, fetchpatch
+, libX11, libXext, xorgproto, libjpeg, giflib, libtiff, libpng
+}:
+
+stdenv.mkDerivation rec {
+  pname = "imlib";
+  version = "1.9.15";
+  src = fetchurl {
+    url = "https://tarballs.nixos.org/imlib-${version}.tar.gz";
+    sha256 = "0ggjxyvgp4pxc0b88v40xj9daz90518ydnycw7qax011gxpr12d3";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "CVE-2007-3568.patch";
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/imlib/files/imlib-1.9.15-bpp16-CVE-2007-3568.patch";
+      sha256 = "0lxfibi094gki39sq1w4p0hcx25xlk0875agbhjkjngzx862wvbg";
+    })
+
+    # The following two patches fix the build with recent giflib.
+    (fetchpatch {
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/imlib/files/imlib-1.9.15-giflib51-1.patch?id=c6d0ed89ad5653421f21cbf3b3d40fd9a1361828";
+      sha256 = "0jynlhxcyjiwnz1m8j48xwz4z5csgyg03jfjc8xgpvvcyid4m65l";
+    })
+    (fetchpatch {
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/imlib/files/imlib-1.9.15-giflib51-2.patch?id=c6d0ed89ad5653421f21cbf3b3d40fd9a1361828";
+      sha256 = "164x7rd992930rqllmr89p5ahfmbz37ipi8x0igd8gkvc8a4fd5x";
+    })
+  ];
+
+  configureFlags = [
+    "--disable-shm"
+    "--x-includes=${libX11.dev}/include"
+    "--x-libraries=${libX11.out}/lib"
+  ];
+
+  buildInputs = [ libjpeg libXext libX11 xorgproto libtiff giflib libpng ];
+
+  meta = with lib; {
+    description = "An image loading and rendering library for X11";
+    platforms = platforms.unix;
+    license = with licenses; [ gpl2Only lgpl2Only ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/imlib2/default.nix b/nixpkgs/pkgs/development/libraries/imlib2/default.nix
new file mode 100644
index 000000000000..6be73c8da4b3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/imlib2/default.nix
@@ -0,0 +1,63 @@
+{ lib, stdenv, fetchurl
+# Image file formats
+, libjpeg, libtiff, giflib, libpng, libwebp
+# imlib2 can load images from ID3 tags.
+, libid3tag
+, freetype , bzip2, pkg-config
+, x11Support ? true, xlibsWrapper ? null
+}:
+
+let
+  inherit (lib) optional;
+in
+stdenv.mkDerivation rec {
+  pname = "imlib2";
+  version = "1.7.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/enlightenment/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-Ul1OMYknRxveRSB4bcJVC1mriFM4SNstdcYPW05YIaE=";
+  };
+
+  buildInputs = [
+    libjpeg libtiff giflib libpng libwebp
+    bzip2 freetype libid3tag
+  ] ++ optional x11Support xlibsWrapper;
+
+  nativeBuildInputs = [ pkg-config ];
+
+  enableParallelBuilding = true;
+
+  preConfigure = ''
+    substituteInPlace imlib2-config.in \
+      --replace "@my_libs@" ""
+  '';
+
+  # Do not build amd64 assembly code on Darwin, because it fails to compile
+  # with unknow directive errors
+  configureFlags = optional stdenv.isDarwin "--enable-amd64=no"
+    ++ optional (!x11Support) "--without-x";
+
+  outputs = [ "bin" "out" "dev" ];
+
+  postInstall = ''
+    moveToOutput bin/imlib2-config "$dev"
+  '';
+
+  meta = with lib; {
+    description = "Image manipulation library";
+
+    longDescription = ''
+      This is the Imlib 2 library - a library that does image file loading and
+      saving as well as rendering, manipulation, arbitrary polygon support, etc.
+      It does ALL of these operations FAST. Imlib2 also tries to be highly
+      intelligent about doing them, so writing naive programs can be done
+      easily, without sacrificing speed.
+    '';
+
+    homepage = "https://docs.enlightenment.org/api/imlib2/html";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ spwhitt ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/impy/default.nix b/nixpkgs/pkgs/development/libraries/impy/default.nix
new file mode 100644
index 000000000000..1f5d9070dd37
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/impy/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+, libpng
+, zlib
+, giflib
+, libjpeg
+, SDL2
+}:
+
+stdenv.mkDerivation rec {
+  pname = "impy";
+  version = "0.1";
+
+  src = fetchFromGitHub {
+    owner = "bcampbell";
+    repo = "impy";
+    rev = "v${version}";
+    sha256 = "1h45xjms56radhknspyx17a12dpnm7xgqm1x1chy42aw5ic8b5qf";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  buildInputs = [
+    libpng
+    zlib
+    giflib
+    libjpeg
+    SDL2
+  ];
+
+  meta = with lib; {
+    description = "A simple library for loading/saving images and animations, written in C";
+    homepage = "https://github.com/bcampbell/impy";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ fgaz ];
+    platforms = platforms.all;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/inchi/default.nix b/nixpkgs/pkgs/development/libraries/inchi/default.nix
new file mode 100644
index 000000000000..f74cfdec9305
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/inchi/default.nix
@@ -0,0 +1,74 @@
+{ fetchurl
+, lib
+, stdenv
+, unzip
+, fixDarwinDylibNames
+}:
+
+let
+  versionMajor = "1";
+  versionMinor = "0.6";
+  version = versionMajor + "." + versionMinor;
+  removeDots = lib.replaceStrings [ "." ] [ "" ];
+  src-doc = fetchurl {
+    url = "http://www.inchi-trust.org/download/${removeDots version}/INCHI-1-DOC.zip";
+    sha256 = "1kyda09i9p89xfq90ninwi7w13k1w3ljpl4gqdhpfhi5g8fgxx7f";
+   };
+in
+  stdenv.mkDerivation rec {
+    pname = "inchi";
+    inherit version;
+
+    src = fetchurl {
+      url = "http://www.inchi-trust.org/download/${removeDots version}/INCHI-1-SRC.zip";
+      sha256 = "1zbygqn0443p0gxwr4kx3m1bkqaj8x9hrpch3s41py7jq08f6x28";
+    };
+
+    nativeBuildInputs = [ unzip ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
+    outputs = [ "out" "doc" ];
+
+    enableParallelBuilding = true;
+
+    preConfigure = ''
+      cd ./INCHI_API/libinchi/gcc
+    '' + lib.optionalString stdenv.isDarwin ''
+      substituteInPlace makefile \
+        --replace ",--version-script=libinchi.map" "" \
+        --replace "LINUX_Z_RELRO = ,-z,relro" "" \
+        --replace "-soname" "-install_name" \
+        --replace "gcc" $CC
+    '';
+    installPhase = let
+      versionOneDot = versionMajor + "." + removeDots versionMinor;
+    in ''
+      runHook preInstall
+
+      cd ../../..
+      mkdir -p $out/lib
+      mkdir -p $out/include/inchi
+      mkdir -p $doc/share/
+
+      install -m 755 INCHI_API/bin/Linux/libinchi.so.${versionOneDot}.00 $out/lib
+      ln -s $out/lib/libinchi.so.${versionOneDot}.00 $out/lib/libinchi.so.1
+      ln -s $out/lib/libinchi.so.${versionOneDot}.00 $out/lib/libinchi.so
+      install -m 644 INCHI_BASE/src/*.h $out/include/inchi
+
+      runHook postInstall
+    '';
+
+    preFixup = lib.optionalString stdenv.isDarwin ''
+      fixDarwinDylibNames $(find "$out" -name "*.so.*")
+    '';
+
+    postInstall = ''
+      unzip '${src-doc}'
+      install -m 644 INCHI-1-DOC/*.pdf $doc/share
+    '';
+
+    meta = with lib; {
+      homepage = "https://www.inchi-trust.org/";
+      description = "IUPAC International Chemical Identifier library";
+      license = licenses.lgpl2Plus;
+      maintainers = with maintainers; [ rmcgibbo ];
+    };
+  }
diff --git a/nixpkgs/pkgs/development/libraries/incrtcl/default.nix b/nixpkgs/pkgs/development/libraries/incrtcl/default.nix
new file mode 100644
index 000000000000..dae01961a10c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/incrtcl/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchurl, writeText, tcl }:
+
+tcl.mkTclDerivation rec {
+  pname = "incrtcl";
+  version = "4.2.0";
+
+  src = fetchurl {
+    url    = "mirror://sourceforge/incrtcl/%5BIncr%20Tcl_Tk%5D-source/3.4/itcl${version}.tar.gz";
+    sha256 = "0w28v0zaraxcq1s9pa6cihqqwqvvwfgz275lks7w4gl7hxjxmasw";
+  };
+
+  enableParallelBuilding = true;
+
+  patchPhase = ''
+    substituteInPlace configure --replace "\''${TCL_SRC_DIR}/generic" "${tcl}/include"
+  '';
+
+  postInstall = ''
+    rmdir $out/bin
+    mv $out/lib/itcl${version}/* $out/lib
+    ln -s libitcl${version}${stdenv.hostPlatform.extensions.sharedLibrary} \
+      $out/lib/libitcl${lib.versions.major version}${stdenv.hostPlatform.extensions.sharedLibrary}
+    rmdir $out/lib/itcl${version}
+  '';
+
+  setupHook = writeText "setup-hook.sh" ''
+    export ITCL_LIBRARY=@out@/lib
+  '';
+
+  outputs = [ "out" "dev" "man" ];
+
+  meta = with lib; {
+    homepage    = "http://incrtcl.sourceforge.net/";
+    description = "Object Oriented Enhancements for Tcl/Tk";
+    license     = licenses.tcltk;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/indicator-application/gtk2.nix b/nixpkgs/pkgs/development/libraries/indicator-application/gtk2.nix
new file mode 100644
index 000000000000..f75ade98c6d8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/indicator-application/gtk2.nix
@@ -0,0 +1,55 @@
+{ stdenv, fetchurl, lib, file
+, pkg-config, autoconf
+, glib, dbus-glib, json-glib
+, gtk2, libindicator-gtk2, libdbusmenu-gtk2, libappindicator-gtk2 }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "indicator-application-gtk2";
+  version = "12.10.0.1";
+
+  src = fetchurl {
+    url = "${meta.homepage}/indicator-application-gtk2/i-a-${version}/+download/indicator-application-${version}.tar.gz";
+    sha256 = "1xqsb6c1pwawabw854f7aybjrgyhc2r1316i9lyjspci51zk5m7v";
+  };
+
+  nativeBuildInputs = [ pkg-config autoconf ];
+
+  buildInputs = [
+    glib dbus-glib json-glib
+    gtk2 libindicator-gtk2 libdbusmenu-gtk2 libappindicator-gtk2
+  ];
+
+  postPatch = ''
+    substituteInPlace configure.ac \
+      --replace 'DBUSSERVICEDIR=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1`' \
+                "DBUSSERVICEDIR=$out/share/dbus-1/services"
+    autoconf
+    for f in {configure,ltmain.sh,m4/libtool.m4}; do
+      substituteInPlace $f \
+        --replace /usr/bin/file ${file}/bin/file
+    done
+    substituteInPlace src/Makefile.in \
+      --replace 'applicationlibdir = $(INDICATORDIR)' "applicationlibdir = $out/lib"
+  '';
+
+  configureFlags = [
+    "CFLAGS=-Wno-error"
+    "--sysconfdir=/etc"
+    "--localstatedir=/var"
+  ];
+
+  installFlags = [
+    "sysconfdir=\${out}/etc"
+    "localstatedir=\${TMPDIR}"
+  ];
+
+  meta = {
+    description = "Indicator to take menus from applications and place them in the panel (GTK 2 library for Xfce/LXDE)";
+    homepage = "https://launchpad.net/indicators-gtk2";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.msteen ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/indicator-application/gtk3.nix b/nixpkgs/pkgs/development/libraries/indicator-application/gtk3.nix
new file mode 100644
index 000000000000..8947e33e9001
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/indicator-application/gtk3.nix
@@ -0,0 +1,57 @@
+{ lib, stdenv, fetchbzr
+, pkg-config, systemd, autoreconfHook
+, glib, dbus-glib, json-glib
+, gtk3, libindicator-gtk3, libdbusmenu-gtk3, libappindicator-gtk3 }:
+
+stdenv.mkDerivation rec {
+  pname = "indicator-application";
+  version = "12.10.1";
+
+  name = "${pname}-gtk3-${version}";
+
+  src = fetchbzr {
+    url = "https://code.launchpad.net/~indicator-applet-developers/${pname}/trunk.17.04";
+    rev = "260";
+    sha256 = "1f0jdyqqb5g86zdpbcyn16x94yjigsfiv2kf73dvni5rp1vafbq1";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+
+  buildInputs = [
+    glib dbus-glib json-glib systemd
+    gtk3 libindicator-gtk3 libdbusmenu-gtk3 libappindicator-gtk3
+  ];
+
+  postPatch = ''
+    substituteInPlace data/Makefile.am \
+      --replace "/etc/xdg/autostart" "$out/etc/xdg/autostart"
+  '';
+
+  configureFlags = [
+    "CFLAGS=-Wno-error"
+    "--sysconfdir=/etc"
+    "--localstatedir=/var"
+  ];
+
+  installFlags = [
+    "sysconfdir=\${out}/etc"
+    "localstatedir=\${TMPDIR}"
+  ];
+
+  PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "$(out)/lib/systemd/user";
+  PKG_CONFIG_INDICATOR3_0_4_INDICATORDIR = "$(out)/lib/indicators3/7/";
+
+  # Upstart is not used in NixOS
+  postFixup = ''
+    rm -rf $out/share/indicator-application/upstart
+    rm -rf $out/share/upstart
+  '';
+
+  meta = with lib; {
+    description = "Indicator to take menus from applications and place them in the panel";
+    homepage = "https://launchpad.net/indicator-application";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.msteen ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/inih/default.nix b/nixpkgs/pkgs/development/libraries/inih/default.nix
new file mode 100644
index 000000000000..cc979732787b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/inih/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, meson, ninja }:
+
+stdenv.mkDerivation rec {
+  pname = "inih";
+  version = "r53";
+
+  src = fetchFromGitHub {
+    owner = "benhoyt";
+    repo = pname;
+    rev = version;
+    sha256 = "0dqf5j2sw4hq68rqvxbrsf44ygfzx9ypiyzipk4cvp9aimbvsbc6";
+  };
+
+  nativeBuildInputs = [ meson ninja ];
+
+  meta = with lib; {
+    description = "Simple .INI file parser in C, good for embedded systems";
+    homepage = "https://github.com/benhoyt/inih";
+    changelog = "https://github.com/benhoyt/inih/releases/tag/${version}";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ TredwellGit ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/iniparser/default.nix b/nixpkgs/pkgs/development/libraries/iniparser/default.nix
new file mode 100644
index 000000000000..62deaeb1c281
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/iniparser/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "iniparser";
+  version = "4.1";
+
+  src = fetchFromGitHub {
+    owner = "ndevilla";
+    repo = "iniparser";
+    rev = "v${version}";
+    sha256 = "0dhab6pad6wh816lr7r3jb6z273njlgw2vpw8kcfnmi7ijaqhnr5";
+  };
+
+  patches = ./no-usr.patch;
+
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace Makefile \
+        --replace -Wl,-soname= -Wl,-install_name,
+  '';
+
+  doCheck = true;
+  preCheck = "patchShebangs test/make-tests.sh";
+
+  installPhase = ''
+    mkdir -p $out/lib
+
+    mkdir -p $out/include
+    cp src/*.h $out/include
+
+    mkdir -p $out/share/doc/${pname}-${version}
+    for i in AUTHORS INSTALL LICENSE README.md; do
+      bzip2 -c -9 $i > $out/share/doc/${pname}-${version}/$i.bz2;
+    done;
+    cp -r html $out/share/doc/${pname}-${version}
+
+    cp libiniparser.a $out/lib
+    cp libiniparser.so.1 $out/lib
+    ln -s libiniparser.so.1 $out/lib/libiniparser.so
+
+    mkdir -p $out/lib/pkgconfig
+    substituteAll ${./iniparser.pc.in} $out/lib/pkgconfig/iniparser.pc
+  '';
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "Free standalone ini file parsing library";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.primeos ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/iniparser/iniparser.pc.in b/nixpkgs/pkgs/development/libraries/iniparser/iniparser.pc.in
new file mode 100644
index 000000000000..fb94188fff71
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/iniparser/iniparser.pc.in
@@ -0,0 +1,12 @@
+prefix=@out@
+exec_prefix=@out@
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include
+datarootdir=${prefix}/share
+datadir=${datarootdir}
+
+Name: libiniparser
+Description: Iniparser library
+Version: @version@
+Libs: -L${libdir} -liniparser
+Cflags: -I${includedir}
diff --git a/nixpkgs/pkgs/development/libraries/iniparser/no-usr.patch b/nixpkgs/pkgs/development/libraries/iniparser/no-usr.patch
new file mode 100644
index 000000000000..a3c568cdde43
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/iniparser/no-usr.patch
@@ -0,0 +1,13 @@
+--- a/Makefile	2017-10-20 20:30:41.494608284 +0200
++++ b/Makefile	2017-10-20 20:33:22.279212026 +0200
+@@ -20,8 +20,8 @@
+ ARFLAGS = rcv
+ 
+ SHLD = ${CC} ${CFLAGS}
+-LDSHFLAGS = -shared -Wl,-Bsymbolic
+-LDFLAGS += -Wl,-rpath -Wl,/usr/lib -Wl,-rpath,/usr/lib
++LDSHFLAGS = -shared
++LDFLAGS =
+ 
+ # .so.0 is for version 3.x, .so.1 is 4.x
+ SO_TARGET ?= libiniparser.so.1
diff --git a/nixpkgs/pkgs/development/libraries/intel-gmmlib/default.nix b/nixpkgs/pkgs/development/libraries/intel-gmmlib/default.nix
new file mode 100644
index 000000000000..23e4b2b3508d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/intel-gmmlib/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "intel-gmmlib";
+  version = "21.2.2";
+
+  src = fetchFromGitHub {
+    owner  = "intel";
+    repo   = "gmmlib";
+    rev    = "${pname}-${version}";
+    sha256 = "134l0d74ai4mqlp244nvkvg3mgzbzy20mjd274yay8g8hvb1g90v";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://github.com/intel/gmmlib";
+    license = licenses.mit;
+    description = "Intel Graphics Memory Management Library";
+    longDescription = ''
+      The Intel(R) Graphics Memory Management Library provides device specific
+      and buffer management for the Intel(R) Graphics Compute Runtime for
+      OpenCL(TM) and the Intel(R) Media Driver for VAAPI.
+    '';
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ primeos ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/intel-media-driver/default.nix b/nixpkgs/pkgs/development/libraries/intel-media-driver/default.nix
new file mode 100644
index 000000000000..5f3488a8ab11
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/intel-media-driver/default.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, fetchFromGitHub
+, cmake, pkg-config
+, libva, libpciaccess, intel-gmmlib
+, enableX11 ? stdenv.isLinux, libX11
+}:
+
+stdenv.mkDerivation rec {
+  pname = "intel-media-driver";
+  version = "21.3.3";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner  = "intel";
+    repo   = "media-driver";
+    rev    = "intel-media-${version}";
+    sha256 = "1j33qq53jjmcvpr9w1xlyl5bpmq4rmshrd123l9alc2ddqbngrf7";
+  };
+
+  cmakeFlags = [
+    "-DINSTALL_DRIVER_SYSCONF=OFF"
+    "-DLIBVA_DRIVERS_PATH=${placeholder "out"}/lib/dri"
+    # Works only on hosts with suitable CPUs.
+    "-DMEDIA_RUN_TEST_SUITE=OFF"
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [ libva libpciaccess intel-gmmlib ]
+    ++ lib.optional enableX11 libX11;
+
+  postFixup = lib.optionalString enableX11 ''
+    patchelf --set-rpath "$(patchelf --print-rpath $out/lib/dri/iHD_drv_video.so):${lib.makeLibraryPath [ libX11 ]}" \
+      $out/lib/dri/iHD_drv_video.so
+  '';
+
+  meta = with lib; {
+    description = "Intel Media Driver for VAAPI — Broadwell+ iGPUs";
+    longDescription = ''
+      The Intel Media Driver for VAAPI is a new VA-API (Video Acceleration API)
+      user mode driver supporting hardware accelerated decoding, encoding, and
+      video post processing for GEN based graphics hardware.
+    '';
+    homepage = "https://github.com/intel/media-driver";
+    changelog = "https://github.com/intel/media-driver/releases/tag/intel-media-${version}";
+    license = with licenses; [ bsd3 mit ];
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ primeos jfrankenau ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/intel-media-sdk/default.nix b/nixpkgs/pkgs/development/libraries/intel-media-sdk/default.nix
new file mode 100644
index 000000000000..c0bac7e5466d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/intel-media-sdk/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, gtest, libdrm, libpciaccess, libva, libX11
+, libXau, libXdmcp, libpthreadstubs }:
+
+stdenv.mkDerivation rec {
+  pname = "intel-media-sdk";
+  version = "21.3.1";
+
+  src = fetchFromGitHub {
+    owner = "Intel-Media-SDK";
+    repo = "MediaSDK";
+    rev = "intel-mediasdk-${version}";
+    sha256 = "sha256-Ki+gTDL6gj+f3wjhVp4EIVvrPn6NRmCCkCj5g//kAW8=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [
+    libdrm libva libpciaccess libX11 libXau libXdmcp libpthreadstubs
+  ];
+  checkInputs = [ gtest ];
+
+  cmakeFlags = [
+    "-DBUILD_SAMPLES=OFF"
+    "-DBUILD_TESTS=${if doCheck then "ON" else "OFF"}"
+    "-DUSE_SYSTEM_GTEST=ON"
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Intel Media SDK";
+    license = licenses.mit;
+    maintainers = with maintainers; [ midchildan ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/iodash/0001-Add-cmake-install-directives.patch b/nixpkgs/pkgs/development/libraries/iodash/0001-Add-cmake-install-directives.patch
new file mode 100644
index 000000000000..1868a7419208
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/iodash/0001-Add-cmake-install-directives.patch
@@ -0,0 +1,44 @@
+From 89c7c160f897f64e17fb74efffccfd1fc16f8b7d Mon Sep 17 00:00:00 2001
+From: Jappie Klooster <jappieklooster@hotmail.com>
+Date: Fri, 2 Apr 2021 14:22:02 -0400
+Subject: [PATCH] Add cmake install directives.
+
+To make nix builds work, it expect a `make install` command to
+be available.
+Adding these directives seems to fix the build.
+
+If it's no trouble to you, please add them.
+
+Maybe don't need endian
+---
+ CMakeLists.txt | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 06e416f..8d6f489 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -6,6 +6,8 @@ set(CMAKE_CXX_STANDARD 17)
+ add_library(IODash INTERFACE)
+ target_include_directories(IODash INTERFACE .)
+ 
++include(GNUInstallDirs)
++
+ add_executable(IODash_Test test.cpp)
+ target_link_libraries(IODash_Test IODash)
+ 
+@@ -20,3 +22,11 @@ if (DEFINED BUILD_BENCHMARKS AND (${BUILD_BENCHMARKS}))
+     target_link_libraries(boost_Benchmark_HTTP boost_system pthread)
+ endif()
+ 
++install(TARGETS IODash
++        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
++install(FILES IODash.hpp
++        DESTINATION include/)
++
++install(FILES
++        IODash/Buffer.hpp IODash/SocketAddress.hpp IODash/File.hpp IODash/Socket.hpp IODash/EventLoop.hpp IODash/Serial.hpp IODash/Timer.hpp
++        DESTINATION include/IODash)
+-- 
+2.29.2
+
diff --git a/nixpkgs/pkgs/development/libraries/iodash/default.nix b/nixpkgs/pkgs/development/libraries/iodash/default.nix
new file mode 100644
index 000000000000..d8982f0f8c04
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/iodash/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "iodash";
+  version = "0.1.7";
+
+  src  = fetchFromGitHub {
+    owner  = "YukiWorkshop";
+    repo   = "IODash";
+    rev    = "9dcb26621a9c17dbab704b5bab0c3a5fc72624cb";
+    sha256 = "0db5y2206fwh3h1pzjm9hy3m76inm0xpm1c5gvrladz6hiqfp7bx";
+    fetchSubmodules = true;
+  };
+  # adds missing cmake install directives
+  # https://github.com/YukiWorkshop/IODash/pull/2
+  patches = [ ./0001-Add-cmake-install-directives.patch];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  meta = with lib; {
+    homepage = "https://github.com/YukiWorkshop/IODash";
+    description = "Lightweight C++ I/O library for POSIX operation systems";
+    license = licenses.mit;
+    maintainers = with maintainers; [ jappie ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ip2location-c/default.nix b/nixpkgs/pkgs/development/libraries/ip2location-c/default.nix
new file mode 100644
index 000000000000..23801d3436da
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ip2location-c/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "ip2location-c";
+  version = "7.0.2"; # meta.homepage might change after a major update
+
+  src = fetchurl {
+    sha256 = "1gs43qgcyfn83abrkhvvw1s67d1sbkbj3hab9m17ysn6swafiycx";
+    url = "https://www.ip2location.com/downloads/ip2location-c-${version}.tar.gz";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  enableParallelBuilding = true;
+
+  # Checks require a database, which require registration (although sample
+  # databases are available, downloading them for just 1 test seems excessive):
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Library to look up locations of host names and IP addresses";
+    longDescription = ''
+      A C library to find the country, region, city,coordinates,
+      zip code, time zone, ISP, domain name, connection type, area code,
+      weather, MCC, MNC, mobile brand name, elevation and usage type of
+      any IP address or host name in the IP2Location databases.
+    '';
+    homepage = "http://www.ip2location.com/developers/c-7";
+    license = with licenses; [ gpl3Plus lgpl3Plus ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/irrlicht/common.nix b/nixpkgs/pkgs/development/libraries/irrlicht/common.nix
new file mode 100644
index 000000000000..f330c30fda11
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/irrlicht/common.nix
@@ -0,0 +1,11 @@
+{ fetchzip }:
+
+rec {
+  pname = "irrlicht";
+  version = "1.8.4";
+
+  src = fetchzip {
+    url = "mirror://sourceforge/irrlicht/${pname}-${version}.zip";
+    sha256 = "02sq067fn4xpf0lcyb4vqxmm43qg2nxx770bgrl799yymqbvih5f";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/irrlicht/default.nix b/nixpkgs/pkgs/development/libraries/irrlicht/default.nix
new file mode 100644
index 000000000000..260be948ce1d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/irrlicht/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchzip, libGLU, libGL, libXrandr, libX11, libXxf86vm }:
+
+let
+  common = import ./common.nix { inherit fetchzip; };
+in
+
+stdenv.mkDerivation rec {
+  pname = common.pname;
+  version = common.version;
+
+  src = common.src;
+
+  postPatch = ''
+    sed -ie '/sys\/sysctl.h/d' source/Irrlicht/COSOperator.cpp
+  '';
+
+  preConfigure = ''
+    cd source/Irrlicht
+  '';
+
+  buildPhase = ''
+    make sharedlib NDEBUG=1 "LDFLAGS=-lX11 -lGL -lXxf86vm"
+  '';
+
+  preInstall = ''
+    sed -i s,/usr/local/lib,$out/lib, Makefile
+    mkdir -p $out/lib
+  '';
+
+  buildInputs = [ libGLU libGL libXrandr libX11 libXxf86vm ];
+
+  meta = {
+    homepage = "http://irrlicht.sourceforge.net/";
+    license = lib.licenses.zlib;
+    description = "Open source high performance realtime 3D engine written in C++";
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/irrlicht/mac.nix b/nixpkgs/pkgs/development/libraries/irrlicht/mac.nix
new file mode 100644
index 000000000000..a7901466081b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/irrlicht/mac.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchzip, libGLU, libGL, fetchFromGitHub, cmake, Cocoa, OpenGL, IOKit }:
+
+let
+  common = import ./common.nix { inherit fetchzip; };
+in
+
+stdenv.mkDerivation rec {
+  pname = "irrlicht-mac";
+  version = common.version;
+
+  src = fetchFromGitHub {
+    owner = "quiark";
+    repo = "IrrlichtCMake";
+    rev = "523a5e6ef84be67c3014f7b822b97acfced536ce";
+    sha256 = "10ahnry2zl64wphs233gxhvs6c0345pyf5nwa29mc6yn49x7bidi";
+  };
+
+  postUnpack = ''
+    cp -r ${common.src}/* $sourceRoot/
+    chmod -R 777 $sourceRoot
+  '';
+
+  patches = [ ./mac_device.patch ];
+  dontFixCmake = true;
+
+  cmakeFlags = [
+    "-DIRRLICHT_STATIC_LIBRARY=ON"
+    "-DIRRLICHT_BUILD_EXAMPLES=OFF"
+    "-DIRRLICHT_INSTALL_MEDIA_FILES=OFF"
+    "-DIRRLICHT_ENABLE_X11_SUPPORT=OFF"
+    "-DIRRLICHT_BUILD_TOOLS=OFF"
+  ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ OpenGL Cocoa IOKit ];
+
+  meta = {
+    homepage = "http://irrlicht.sourceforge.net/";
+    license = lib.licenses.zlib;
+    description = "Open source high performance realtime 3D engine written in C++";
+    platforms = lib.platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/irrlicht/mac_device.patch b/nixpkgs/pkgs/development/libraries/irrlicht/mac_device.patch
new file mode 100644
index 000000000000..dc68c509975c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/irrlicht/mac_device.patch
@@ -0,0 +1,20 @@
+--- a/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm
++++ b/source/Irrlicht/MacOSX/CIrrDeviceMacOSX.mm
+@@ -39,7 +39,7 @@
+ #include <IOKit/hidsystem/IOHIDUsageTables.h>

+ #else

+ /* The header was moved here in Mac OS X 10.1 */

+-#include <Kernel/IOKit/hidsystem/IOHIDUsageTables.h>

++#include <IOKit/hid/IOHIDUsageTables.h>

+ #endif

+ #include <IOKit/hid/IOHIDLib.h>

+ #include <IOKit/hid/IOHIDKeys.h>

+@@ -496,7 +496,7 @@
+ 		{

+ 			[[NSAutoreleasePool alloc] init];

+ 			[NSApplication sharedApplication];

+-			[NSApp setDelegate:(id<NSFileManagerDelegate>)[[[AppDelegate alloc] initWithDevice:this] autorelease]];

++			[NSApp setDelegate:(id<NSApplicationDelegate>)[[[AppDelegate alloc] initWithDevice:this] autorelease]];

+ 			[NSBundle loadNibNamed:@"MainMenu" owner:[NSApp delegate]];

+ 			[NSApp finishLaunching];

+ 		}

diff --git a/nixpkgs/pkgs/development/libraries/isl/0.11.1.nix b/nixpkgs/pkgs/development/libraries/isl/0.11.1.nix
new file mode 100644
index 000000000000..5beffd1f0d2e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/isl/0.11.1.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, gmp }:
+
+stdenv.mkDerivation {
+  name = "isl-0.11.1"; # CLooG 0.16.3 fails to build with ISL 0.08.
+
+  src = fetchurl {
+    url = "https://src.fedoraproject.org/repo/pkgs/gcc/isl-0.11.1.tar.bz2/bce1586384d8635a76d2f017fb067cd2/isl-0.11.1.tar.bz2";
+    sha256 = "13d9cqa5rzhbjq0xf0b2dyxag7pqa72xj9dhsa03m8ccr1a4npq9";
+  };
+
+  buildInputs = [ gmp ];
+  patches = [ ./fix-gcc-build.diff ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "https://www.kotnet.org/~skimo/isl/";
+    license = lib.licenses.lgpl21;
+    description = "A library for manipulating sets and relations of integer points bounded by linear constraints";
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/isl/0.14.1.nix b/nixpkgs/pkgs/development/libraries/isl/0.14.1.nix
new file mode 100644
index 000000000000..8936d6c5f3be
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/isl/0.14.1.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, gmp }:
+
+stdenv.mkDerivation rec {
+  name = "isl-0.14.1";
+
+  src = fetchurl {
+    url = "http://isl.gforge.inria.fr/${name}.tar.xz";
+    sha256 = "0xa6xagah5rywkywn19rzvbvhfvkmylhcxr6z9z7bz29cpiwk0l8";
+  };
+
+  buildInputs = [ gmp ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "https://www.kotnet.org/~skimo/isl/";
+    license = lib.licenses.lgpl21;
+    description = "A library for manipulating sets and relations of integer points bounded by linear constraints";
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/isl/0.17.1.nix b/nixpkgs/pkgs/development/libraries/isl/0.17.1.nix
new file mode 100644
index 000000000000..a823b69fa27b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/isl/0.17.1.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, gmp }:
+
+stdenv.mkDerivation rec {
+  name = "isl-0.17.1";
+
+  src = fetchurl {
+    url = "http://isl.gforge.inria.fr/${name}.tar.xz";
+    sha256 = "be152e5c816b477594f4c6194b5666d8129f3a27702756ae9ff60346a8731647";
+  };
+
+  buildInputs = [ gmp ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "https://www.kotnet.org/~skimo/isl/";
+    license = lib.licenses.lgpl21;
+    description = "A library for manipulating sets and relations of integer points bounded by linear constraints";
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/isl/0.20.0.nix b/nixpkgs/pkgs/development/libraries/isl/0.20.0.nix
new file mode 100644
index 000000000000..c40b3d7be0b4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/isl/0.20.0.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, gmp }:
+
+stdenv.mkDerivation rec {
+  name = "isl-0.20";
+
+  src = fetchurl {
+    url = "http://isl.gforge.inria.fr/${name}.tar.xz";
+    sha256 = "1akpgq0rbqbah5517blg2zlnfvjxfcl9cjrfc75nbcx5p2gnlnd5";
+  };
+
+  buildInputs = [ gmp ];
+
+  configureFlags = [
+    "--with-gcc-arch=generic" # don't guess -march=/mtune=
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "http://isl.gforge.inria.fr/";
+    license = lib.licenses.lgpl21;
+    description = "A library for manipulating sets and relations of integer points bounded by linear constraints";
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/isl/fix-gcc-build.diff b/nixpkgs/pkgs/development/libraries/isl/fix-gcc-build.diff
new file mode 100644
index 000000000000..6fbd1f9d478b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/isl/fix-gcc-build.diff
@@ -0,0 +1,12 @@
+diff -ru isl-0.11.1/include/isl/int.h isl-0.11.1.new/include/isl/int.h
+--- isl-0.11.1/include/isl/int.h        2012-11-29 09:47:32.000000000 +0100
++++ isl-0.11.1.new/include/isl/int.h    2013-10-27 15:35:31.348553812 +0100
+@@ -14,7 +14,7 @@
+ #include <string.h>
+ #include <gmp.h>
+ #if defined(__cplusplus)
+-#include <iostream>
++#include <ostream>
+ #endif
+ 
+ #if defined(__cplusplus)
diff --git a/nixpkgs/pkgs/development/libraries/iso-codes/default.nix b/nixpkgs/pkgs/development/libraries/iso-codes/default.nix
new file mode 100644
index 000000000000..75ace8097c9b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/iso-codes/default.nix
@@ -0,0 +1,27 @@
+{lib, stdenv, fetchurl, gettext, python3}:
+
+stdenv.mkDerivation rec {
+  pname = "iso-codes";
+  version = "4.6.0";
+
+  src = fetchurl {
+    url = "https://salsa.debian.org/iso-codes-team/iso-codes/-/archive/${pname}-${version}/${pname}-${pname}-${version}.tar.bz2";
+    sha256 = "sha256-Ivd5538QpTFXP2r6ca/g12IZ0ZW1nduu0z4kiSb9Mxs=";
+  };
+
+  patchPhase = ''
+    for i in `find . -name \*.py`
+    do
+        sed -i -e "s|#!/usr/bin/env python|#!${python3}/bin/python|" $i
+    done
+  '';
+
+  nativeBuildInputs = [ gettext python3 ];
+
+  meta = with lib; {
+    homepage = "https://salsa.debian.org/iso-codes-team/iso-codes";
+    description = "Various ISO codes packaged as XML files";
+    license = licenses.lgpl21;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/itk/4.x.nix b/nixpkgs/pkgs/development/libraries/itk/4.x.nix
new file mode 100644
index 000000000000..54a3c33cd017
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/itk/4.x.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, cmake, libX11, libuuid, xz, vtk_7, Cocoa }:
+
+stdenv.mkDerivation rec {
+  pname = "itk";
+  version = "4.13.3";
+
+  src = fetchFromGitHub {
+    owner = "InsightSoftwareConsortium";
+    repo = "ITK";
+    rev = "v${version}";
+    sha256 = "067vkh39jxcvyvn69qjh4vi3wa7vdvm9m6qsg3jmnmm7gzw0kjlm";
+  };
+
+  cmakeFlags = [
+    "-DBUILD_TESTING=OFF"
+    "-DBUILD_EXAMPLES=OFF"
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DModule_ITKMINC=ON"
+    "-DModule_ITKIOMINC=ON"
+    "-DModule_ITKIOTransformMINC=ON"
+    "-DModule_ITKVtkGlue=ON"
+    "-DModule_ITKReview=ON"
+  ];
+
+  nativeBuildInputs = [ cmake xz ];
+  buildInputs = [ libX11 libuuid vtk_7 ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
+
+  meta = {
+    description = "Insight Segmentation and Registration Toolkit";
+    homepage = "https://www.itk.org/";
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [viric];
+    platforms = with lib.platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/itk/default.nix b/nixpkgs/pkgs/development/libraries/itk/default.nix
new file mode 100644
index 000000000000..967910e2a117
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/itk/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper
+, pkg-config, libX11, libuuid, xz, vtk_7, Cocoa }:
+
+stdenv.mkDerivation rec {
+  pname = "itk";
+  version = "5.2.1";
+
+  src = fetchFromGitHub {
+    owner = "InsightSoftwareConsortium";
+    repo = "ITK";
+    rev = "v${version}";
+    sha256 = "sha256-KaVe9FMGm4ZVMpwAT12fA67T0qZS3ZueiI8z85+xSwE=";
+  };
+
+  postPatch = ''
+    substituteInPlace CMake/ITKSetStandardCompilerFlags.cmake  \
+      --replace "-march=corei7" ""  \
+      --replace "-mtune=native" ""
+  '';
+
+  cmakeFlags = [
+    "-DBUILD_EXAMPLES=OFF"
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DModule_ITKMINC=ON"
+    "-DModule_ITKIOMINC=ON"
+    "-DModule_ITKIOTransformMINC=ON"
+    "-DModule_ITKVtkGlue=ON"
+    "-DModule_ITKReview=ON"
+  ];
+
+  nativeBuildInputs = [ cmake xz makeWrapper ];
+  buildInputs = [ libX11 libuuid vtk_7 ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
+
+  postInstall = ''
+    wrapProgram "$out/bin/h5c++" --prefix PATH ":" "${pkg-config}/bin"
+  '';
+
+  meta = {
+    description = "Insight Segmentation and Registration Toolkit";
+    homepage = "https://www.itk.org/";
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [viric];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/itktcl/default.nix b/nixpkgs/pkgs/development/libraries/itktcl/default.nix
new file mode 100644
index 000000000000..66039c61b4d5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/itktcl/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, tcl, tk, incrtcl }:
+
+tcl.mkTclDerivation rec {
+  pname = "itk-tcl";
+  version = "4.1.0";
+
+  src = fetchurl {
+    url    = "mirror://sourceforge/incrtcl/%5BIncr%20Tcl_Tk%5D-source/3.4/itk${version}.tar.gz";
+    sha256 = "1iy964jfgsfnc1agk1w6bbm44x18ily8d4wmr7cc9z9f4acn2r6s";
+  };
+
+  buildInputs = [ tk incrtcl ];
+  enableParallelBuilding = true;
+
+  configureFlags = [
+    "--with-tk=${tk}/lib"
+    "--with-itcl=${incrtcl}/lib"
+    "--with-tkinclude=${tk.dev}/include"
+  ];
+
+  postInstall = ''
+    rmdir $out/bin
+    mv $out/lib/itk${version}/* $out/lib
+    ln -s libitk${version}${stdenv.hostPlatform.extensions.sharedLibrary} \
+      $out/lib/libitk${lib.versions.major version}${stdenv.hostPlatform.extensions.sharedLibrary}
+    rmdir $out/lib/itk${version}
+  '';
+
+  outputs = [ "out" "dev" "man" ];
+
+  meta = with lib; {
+    homepage    = "http://incrtcl.sourceforge.net/";
+    description = "Mega-widget toolkit for incr Tk";
+    license     = licenses.tcltk;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/jabcode/default.nix b/nixpkgs/pkgs/development/libraries/jabcode/default.nix
new file mode 100644
index 000000000000..36c4c8c61c53
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jabcode/default.nix
@@ -0,0 +1,46 @@
+{ stdenv
+, fetchFromGitHub
+, lib
+, subproject ? "library" # one of "library", "reader" or  "writer"
+, zlib, libpng, libtiff
+, jabcode
+}:
+let
+  subdir = lib.getAttr subproject {
+    "library" = "jabcode";
+    "reader" = "jabcodeReader";
+    "writer" = "jabcodeWriter";
+  };
+in stdenv.mkDerivation rec {
+  pname = "jabcode-${subproject}";
+  version = "git-2020-05-13";
+  src = fetchFromGitHub {
+    repo = "jabcode";
+    owner = "jabcode";
+    rev = "a7c25d4f248078f257b014e31c791bfcfcd083e1";
+    sha256 = "1c4cv9b0d7r4bxzkwzdv9h651ziq822iya6fbyizm57n1nzdkk4s";
+  };
+
+  nativeBuildInputs =
+    [ zlib libpng libtiff ]
+    ++ lib.optionals (subproject != "library") [ jabcode ];
+
+  preConfigure = "cd src/${subdir}";
+
+  installPhase = if subproject == "library" then ''
+    mkdir -p $out/lib
+    cp build/* $out/lib
+  '' else ''
+    mkdir -p $out/bin
+    cp -RT bin $out/bin
+  '';
+
+  meta = with lib; {
+    description = "A high-capacity 2D color bar code (${subproject})";
+    longDescription = "JAB Code (Just Another Bar Code) is a high-capacity 2D color bar code, which can encode more data than traditional black/white (QR) codes. This is the ${subproject} part.";
+    homepage = "https://jabcode.org/";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.xaverdh ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/jama/default.nix b/nixpkgs/pkgs/development/libraries/jama/default.nix
new file mode 100644
index 000000000000..30044eb2cc05
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jama/default.nix
@@ -0,0 +1,30 @@
+{lib, stdenv, fetchurl, unzip, tnt}:
+
+stdenv.mkDerivation rec {
+  pname = "jama";
+  version = "1.2.5";
+
+  src = fetchurl {
+    url = "https://math.nist.gov/tnt/jama125.zip";
+    sha256 = "031ns526fvi2nv7jzzv02i7i5sjcyr0gj884i3an67qhsx8vyckl";
+  };
+
+  nativeBuildInputs = [ unzip ];
+  propagatedBuildInputs = [ tnt ];
+
+  unpackPhase = ''
+      mkdir "${pname}-${version}"
+      unzip "$src"
+  '';
+  installPhase = ''
+      mkdir -p $out/include
+      cp *.h $out/include
+  '';
+
+  meta = with lib; {
+    homepage = "https://math.nist.gov/tnt/";
+    description = "JAMA/C++ Linear Algebra Package: Java-like matrix C++ templates";
+    platforms = platforms.unix;
+    license = licenses.publicDomain;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/jansson/default.nix b/nixpkgs/pkgs/development/libraries/jansson/default.nix
new file mode 100644
index 000000000000..21a697f1e3ab
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jansson/default.nix
@@ -0,0 +1,18 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "jansson";
+  version = "2.13.1";
+
+  src = fetchurl {
+    url = "https://digip.org/jansson/releases/${pname}-${version}.tar.gz";
+    sha256 = "0ks7gbs0j8p4dmmi2sq129mxy5gfg0z6220i1jk020mi2zd7gwzl";
+  };
+
+  meta = with lib; {
+    homepage = "http://www.digip.org/jansson/";
+    description = "C library for encoding, decoding and manipulating JSON data";
+    license = licenses.mit;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/jasper/default.nix b/nixpkgs/pkgs/development/libraries/jasper/default.nix
new file mode 100644
index 000000000000..2df3e554c9b6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jasper/default.nix
@@ -0,0 +1,48 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "jasper";
+  version = "2.0.32";
+
+  src = fetchFromGitHub {
+    owner = "jasper-software";
+    repo = pname;
+    rev = "version-${version}";
+    hash = "sha256-Uwgtex0MWC/pOmEr8itHMIa4wxd97c/tsTzcLgV8D0I=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  meta = with lib; {
+    homepage = "https://jasper-software.github.io/jasper/";
+    description = "Image processing/coding toolkit";
+    longDescription = ''
+      JasPer is a software toolkit for the handling of image data. The software
+      provides a means for representing images, and facilitates the manipulation
+      of image data, as well as the import/export of such data in numerous
+      formats (e.g., JPEG-2000 JP2, JPEG, PNM, BMP, Sun Rasterfile, and
+      PGX). The import functionality supports the auto-detection (i.e.,
+      automatic determination) of the image format, eliminating the need to
+      explicitly identify the format of coded input data. A simple color
+      management engine is also provided in order to allow the accurate
+      representation of color. Partial support is included for the ICC color
+      profile file format, an industry standard for specifying color.
+
+      The JasPer software consists of a library and several application
+      programs. The code is written in the C programming language. This language
+      was chosen primarily due to the availability of C development environments
+      for most computing platforms when JasPer was first developed, circa 1999.
+    '';
+    license = licenses.free; # MIT-like
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/commons/bcel/default.nix b/nixpkgs/pkgs/development/libraries/java/commons/bcel/default.nix
new file mode 100644
index 000000000000..9d34aaf6c8e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/commons/bcel/default.nix
@@ -0,0 +1,25 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  version = "5.2";
+  pname = "commons-bcel";
+
+  src = fetchurl {
+    url    = "mirror://apache/commons/bcel/binaries/bcel-${version}.tar.gz";
+    sha256 = "13ppnd6afljdjq21jpn4ik2h1yxq8k2kg21ghi0lyb1yap1rd7k6";
+  };
+
+  installPhase = ''
+    tar xf ${src}
+    mkdir -p $out/share/java
+    cp bcel-5.2.jar $out/share/java/
+  '';
+
+  meta = {
+    homepage    = "http://commons.apache.org/proper/commons-bcel/";
+    description = "Gives users a convenient way to analyze, create, and manipulate (binary) Java class files";
+    maintainers = with lib.maintainers; [ copumpkin ];
+    license     = lib.licenses.asl20;
+    platforms = with lib.platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/commons/bsf/default.nix b/nixpkgs/pkgs/development/libraries/java/commons/bsf/default.nix
new file mode 100644
index 000000000000..629ab7ec131a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/commons/bsf/default.nix
@@ -0,0 +1,23 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation {
+  name = "commons-bsf-1.2";
+
+  src = fetchurl {
+    url = "mirror://apache/commons/bsf/binaries/bsf-bin-2.4.0.tar.gz";
+    sha256 = "1my3hv4y8cvrd1kr315wvbjqsamzlzswnbqcmsa2m4hqcafddfr8";
+  };
+
+  installPhase = ''
+    mkdir -p $out/share/java
+    cp lib/bsf.jar $out/share/java/
+  '';
+
+  meta = {
+    description = "Interface to scripting languages, including JSR-223";
+    homepage = "http://commons.apache.org/proper/commons-bsf/";
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.unix;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/java/commons/compress/default.nix b/nixpkgs/pkgs/development/libraries/java/commons/compress/default.nix
new file mode 100644
index 000000000000..3bbedde2e954
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/commons/compress/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  version = "1.21";
+  pname = "commons-compress";
+
+  src = fetchurl {
+    url    = "mirror://apache/commons/compress/binaries/${pname}-${version}-bin.tar.gz";
+    sha256 = "sha256-sWF0K5MSOSXUxBLC9+1/RF5ST4tIzVKGnKQvStuVLvM=";
+  };
+
+  installPhase = ''
+    tar xf ${src}
+    mkdir -p $out/share/java
+    cp *.jar $out/share/java/
+  '';
+
+  meta = {
+    homepage    = "http://commons.apache.org/proper/commons-compress";
+    description = "Allows manipulation of ar, cpio, Unix dump, tar, zip, gzip, XZ, Pack200, bzip2, 7z, arj, lzma, snappy, DEFLATE and Z files";
+    maintainers = with lib.maintainers; [ copumpkin ];
+    license     = lib.licenses.asl20;
+    platforms = with lib.platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/commons/daemon/default.nix b/nixpkgs/pkgs/development/libraries/java/commons/daemon/default.nix
new file mode 100644
index 000000000000..f6f909904cf5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/commons/daemon/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  version = "1.2.4";
+  pname = "commons-daemon";
+
+  src = fetchurl {
+    url    = "mirror://apache/commons/daemon/binaries/commons-daemon-${version}-bin.tar.gz";
+    sha256 = "0bsy4xn3gncgrxj3vkpplvyhx06c1470kycj0j5gwq46ylgady9s";
+  };
+
+  installPhase = ''
+    tar xf ${src}
+    mkdir -p $out/share/java
+    cp *.jar $out/share/java/
+  '';
+
+  meta = {
+    homepage    = "https://commons.apache.org/proper/commons-daemon";
+    description = "Apache Commons Daemon software is a set of utilities and Java support classes for running Java applications as server processes.";
+    maintainers = with lib.maintainers; [ rsynnest ];
+    license     = lib.licenses.asl20;
+    platforms = with lib.platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/commons/fileupload/default.nix b/nixpkgs/pkgs/development/libraries/java/commons/fileupload/default.nix
new file mode 100644
index 000000000000..868f2da4e537
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/commons/fileupload/default.nix
@@ -0,0 +1,24 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  version = "1.3.1";
+  pname = "commons-fileupload";
+
+  src = fetchurl {
+    url    = "mirror://apache/commons/fileupload/binaries/${pname}-${version}-bin.tar.gz";
+    sha256 = "1jy7w2j2ay56mpq4ij3331cf9zgpkm832ydr63svb35j0ymnky72";
+  };
+  installPhase = ''
+    tar xf ${src}
+    mkdir -p $out/share/java
+    cp lib/*.jar $out/share/java/
+  '';
+
+  meta = {
+    homepage    = "http://commons.apache.org/proper/commons-fileupload";
+    description = "Makes it easy to add robust, high-performance, file upload capability to your servlets and web applications";
+    maintainers = with lib.maintainers; [ copumpkin ];
+    license     = lib.licenses.asl20;
+    platforms = with lib.platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/commons/io/default.nix b/nixpkgs/pkgs/development/libraries/java/commons/io/default.nix
new file mode 100644
index 000000000000..0c5ac8f4dded
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/commons/io/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  version = "2.8.0";
+  pname = "commons-io";
+
+  src = fetchurl {
+    url    = "mirror://apache/commons/io/binaries/${pname}-${version}-bin.tar.gz";
+    sha256 = "02c54cjf3sdwbc9rcgg3xkx1f3yk8p5iv3iwvq78f5vfxsj53lkk";
+  };
+
+  installPhase = ''
+    tar xf ${src}
+    mkdir -p $out/share/java
+    cp *.jar $out/share/java/
+  '';
+
+  meta = {
+    homepage    = "http://commons.apache.org/proper/commons-io";
+    description = "A library of utilities to assist with developing IO functionality";
+    maintainers = with lib.maintainers; [ copumpkin ];
+    license     = lib.licenses.asl20;
+    platforms = with lib.platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/commons/lang/default.nix b/nixpkgs/pkgs/development/libraries/java/commons/lang/default.nix
new file mode 100644
index 000000000000..974f7bf9a1cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/commons/lang/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  version = "3.12.0";
+  pname = "commons-lang";
+
+  src = fetchurl {
+    url    = "mirror://apache/commons/lang/binaries/commons-lang3-${version}-bin.tar.gz";
+    sha256 = "sha256-MwEkZd/Lf3kKyjM+CevxBeKl+5XCxjiz33kNPvqQjig=";
+  };
+
+  installPhase = ''
+    tar xf ${src}
+    mkdir -p $out/share/java
+    cp *.jar $out/share/java/
+  '';
+
+  meta = {
+    homepage    = "http://commons.apache.org/proper/commons-lang";
+    description = "Provides additional methods to manipulate standard Java library classes";
+    maintainers = with lib.maintainers; [ copumpkin ];
+    license     = lib.licenses.asl20;
+    platforms = with lib.platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/commons/logging/default.nix b/nixpkgs/pkgs/development/libraries/java/commons/logging/default.nix
new file mode 100644
index 000000000000..d63a214e2ad7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/commons/logging/default.nix
@@ -0,0 +1,23 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation {
+  name = "commons-logging-1.2";
+
+  src = fetchurl {
+    url    = "mirror://apache/commons/logging/binaries/commons-logging-1.2-bin.tar.gz";
+    sha256 = "1gc70pmcv0x6ibl89jglmr22f8zpr63iaifi49nrq399qw2qhx9z";
+  };
+
+  installPhase = ''
+    mkdir -p $out/share/java
+    cp commons-logging-*.jar $out/share/java/
+  '';
+
+  meta = {
+    description = "Wrapper around a variety of logging API implementations";
+    homepage = "http://commons.apache.org/proper/commons-logging";
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.unix;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/java/commons/math/default.nix b/nixpkgs/pkgs/development/libraries/java/commons/math/default.nix
new file mode 100644
index 000000000000..960f12fb8bfb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/commons/math/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  version = "3.6.1";
+  pname = "commons-math";
+
+  src = fetchurl {
+    url    = "mirror://apache/commons/math/binaries/commons-math3-${version}-bin.tar.gz";
+    sha256 = "0x4nx5pngv2n4ga11c1s4w2mf6cwydwkgs7da6wwvcjraw57bhkz";
+  };
+
+  installPhase = ''
+    tar xf ${src}
+    mkdir -p $out/share/java
+    cp *.jar $out/share/java/
+  '';
+
+  meta = {
+    homepage    = "http://commons.apache.org/proper/commons-math/";
+    description = "A library of lightweight, self-contained mathematics and statistics components";
+    maintainers = with lib.maintainers; [ copumpkin ];
+    license     = lib.licenses.asl20;
+    platforms = with lib.platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/cup/default.nix b/nixpkgs/pkgs/development/libraries/java/cup/default.nix
new file mode 100644
index 000000000000..f7732ff637af
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/cup/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, jdk, ant } :
+
+stdenv.mkDerivation rec {
+  pname = "java-cup";
+  version = "11b-20160615";
+
+  src = fetchurl {
+    url = "http://www2.cs.tum.edu/projects/cup/releases/java-cup-src-${version}.tar.gz";
+    sha256 = "1ymz3plngxclh7x3xr31537rvvak7lwyd0qkmnl1mkj5drh77rz0";
+  };
+
+  sourceRoot = ".";
+
+  nativeBuildInputs = [ jdk ant ];
+
+  patches = [ ./javacup-0.11b_beta20160615-build-xml-git.patch ];
+
+  buildPhase = "ant";
+
+  installPhase = ''
+    mkdir -p $out/{bin,share/{java,java-cup}}
+    cp dist/java-cup-11b.jar $out/share/java-cup/
+    cp dist/java-cup-11b-runtime.jar $out/share/java/
+    cat > $out/bin/javacup <<EOF
+    #! $shell
+    exec ${jdk.jre}/bin/java -jar $out/share/java-cup/java-cup-11b.jar "\$@"
+    EOF
+    chmod a+x $out/bin/javacup
+  '';
+
+  meta = {
+    homepage = "http://www2.cs.tum.edu/projects/cup/";
+    description = "LALR parser generator for Java";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.all;
+    maintainers = [ lib.maintainers.romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/cup/javacup-0.11b_beta20160615-build-xml-git.patch b/nixpkgs/pkgs/development/libraries/java/cup/javacup-0.11b_beta20160615-build-xml-git.patch
new file mode 100644
index 000000000000..f2054ee9d4d3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/cup/javacup-0.11b_beta20160615-build-xml-git.patch
@@ -0,0 +1,38 @@
+--- javacup/build.xml.orig	2016-06-15 07:10:15.000000000 -0300
++++ javacup/build.xml	2016-07-17 08:46:46.632722844 -0300
+@@ -21,26 +21,6 @@
+     <mkdir dir="${dist}" />
+     <loadfile property="cupversion" srcFile="version.txt" failonerror="false" />
+     <property name="cupversion" value="custombuild" unless:set="cupversion"/>
+-    <exec executable="git" outputproperty="gitversion">
+-      <arg value="log"/>
+-      <arg value="-1"/>
+-      <arg value="--format=%h"/>
+-    </exec>
+-    <exec executable="git" outputproperty="changed">
+-      <arg value="status"/>
+-      <arg value="--porcelain"/>
+-      <redirector>
+-	<outputfilterchain>
+-	<linecontainsregexp>
+-	  <regexp pattern='^M.*'/>
+-	</linecontainsregexp>
+-	<tokenfilter>
+-	  <replaceregex pattern=".*" replace="modifications based on "/>
+-	</tokenfilter>
+-	</outputfilterchain>
+-	</redirector>
+-    </exec>
+-    <property name="svnversion">${changed}${gitversion}</property>
+   </target>
+ 
+   <property environment="env" />
+@@ -79,7 +59,7 @@
+     <copy todir="${java}"><fileset dir="${src}"></fileset></copy>
+     <replace file="${java}/java_cup/version.java"
+        token="+ version_str"
+-       value='+ "v0.11b ${cupversion} (GIT ${svnversion})"'>
++       value='+ "v0.11b ${cupversion}"'>
+     </replace>
+     <javac srcdir="${java}" destdir="${classes}" verbose="off" listfiles="off" debug="on" source="1.8" target="1.8">
+       <classpath refid="libraries"/>
diff --git a/nixpkgs/pkgs/development/libraries/java/dbus-java/default.nix b/nixpkgs/pkgs/development/libraries/java/dbus-java/default.nix
new file mode 100644
index 000000000000..9fbcf8b020ce
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/dbus-java/default.nix
@@ -0,0 +1,27 @@
+{lib, stdenv, fetchurl, gettext, jdk8, libmatthew_java}:
+
+let jdk = jdk8; in
+stdenv.mkDerivation {
+  name = "dbus-java-2.7";
+  src = fetchurl {
+    url = "https://dbus.freedesktop.org/releases/dbus-java/dbus-java-2.7.tar.gz";
+    sha256 = "0cyaxd8x6sxmi6pklkkx45j311a6w51fxl4jc5j3inc4cailwh5y";
+  };
+  JAVA_HOME=jdk;
+  JAVA="${jdk}/bin/java";
+  PREFIX="\${out}";
+  JAVAUNIXLIBDIR="${libmatthew_java}/lib/jni";
+  JAVAUNIXJARDIR="${libmatthew_java}/share/java";
+  buildInputs = [ gettext jdk ];
+  # I'm too lazy to build the documentation
+  preBuild = ''
+    sed -i -e "s|all: bin doc man|all: bin|" \
+           -e "s|install: install-bin install-man install-doc|install: install-bin|" Makefile
+  '';
+
+  meta = with lib; {
+    platforms = platforms.linux;
+    maintainers = [ maintainers.sander ];
+    license = licenses.afl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/geoipjava/default.nix b/nixpkgs/pkgs/development/libraries/java/geoipjava/default.nix
new file mode 100644
index 000000000000..0e5b1084b49c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/geoipjava/default.nix
@@ -0,0 +1,28 @@
+{lib, stdenv, fetchurl, jdk, unzip}:
+
+stdenv.mkDerivation {
+  name = "GeoIPJava-1.2.5";
+  src = fetchurl {
+    url = "https://geolite.maxmind.com/download/geoip/api/java/GeoIPJava-1.2.5.zip";
+    sha256 = "1gb2d0qvvq7xankz7l7ymbr3qprwk9bifpy4hlgw0sq4i6a55ypd";
+  };
+  nativeBuildInputs = [ unzip ];
+  buildInputs = [ jdk ];
+  buildPhase =
+    ''
+      cd source
+      javac $(find . -name \*.java)
+      jar cfv maxmindgeoip.jar $(find . -name \*.class)
+    '';
+  installPhase =
+    ''
+      mkdir -p $out/share/java
+      cp maxmindgeoip.jar $out/share/java
+    '';
+  meta = {
+    description = "GeoIP Java API";
+    license = lib.licenses.lgpl21Plus;
+    maintainers = [ lib.maintainers.sander ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/gwt-dragdrop/builder.sh b/nixpkgs/pkgs/development/libraries/java/gwt-dragdrop/builder.sh
new file mode 100644
index 000000000000..d37e110011e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/gwt-dragdrop/builder.sh
@@ -0,0 +1,4 @@
+source $stdenv/setup
+
+mkdir -p $out/share/java
+cp $src $out/share/java/$name.jar
diff --git a/nixpkgs/pkgs/development/libraries/java/gwt-dragdrop/default.nix b/nixpkgs/pkgs/development/libraries/java/gwt-dragdrop/default.nix
new file mode 100644
index 000000000000..34a0e8c530a4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/gwt-dragdrop/default.nix
@@ -0,0 +1,16 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation {
+  name = "gwt-dnd-2.6.5";
+  builder = ./builder.sh;
+
+  src = fetchurl {
+    url = "http://gwt-dnd.googlecode.com/files/gwt-dnd-2.6.5.jar";
+    sha256 = "07zdlr8afs499asnw0dcjmw1cnjc646v91lflx5dv4qj374c97fw";
+  };
+
+  meta = with lib; {
+    platforms = platforms.unix;
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/gwt-widgets/builder.sh b/nixpkgs/pkgs/development/libraries/java/gwt-widgets/builder.sh
new file mode 100644
index 000000000000..8c2502385f2b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/gwt-widgets/builder.sh
@@ -0,0 +1,6 @@
+source $stdenv/setup
+
+tar xfvz $src
+cd gwt-widgets-*
+mkdir -p $out/share/java
+cp gwt-widgets-*.jar $out/share/java
diff --git a/nixpkgs/pkgs/development/libraries/java/gwt-widgets/default.nix b/nixpkgs/pkgs/development/libraries/java/gwt-widgets/default.nix
new file mode 100644
index 000000000000..692326a21895
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/gwt-widgets/default.nix
@@ -0,0 +1,16 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation {
+  name = "gwt-widgets-0.2.0";
+  builder = ./builder.sh;
+
+  src = fetchurl {
+    url = "mirror://sourceforge/gwt-widget/gwt-widgets-0.2.0-bin.tar.gz";
+    sha256 = "09isj4j6842rj13nv8264irkjjhvmgihmi170ciabc98911bakxb";
+  };
+
+  meta = with lib; {
+    platforms = platforms.unix;
+    license = with licenses; [ afl21 lgpl2 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/hsqldb/default.nix b/nixpkgs/pkgs/development/libraries/java/hsqldb/default.nix
new file mode 100644
index 000000000000..19c8833db728
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/hsqldb/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, unzip, makeWrapper, jre }:
+
+stdenv.mkDerivation rec {
+  pname = "hsqldb";
+  version = "2.6.0";
+  underscoreMajMin = lib.strings.replaceChars ["."] ["_"] (lib.versions.majorMinor version);
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/hsqldb/hsqldb/hsqldb_${underscoreMajMin}/hsqldb-${version}.zip";
+    sha256 = "sha256-GhuTBJl1E+aoWa8pTWEqzghHDXXiCQFIt++8pjCQYik=";
+  };
+
+  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 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/httpunit/builder.sh b/nixpkgs/pkgs/development/libraries/java/httpunit/builder.sh
new file mode 100755
index 000000000000..273850082958
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/httpunit/builder.sh
@@ -0,0 +1,5 @@
+source $stdenv/setup
+
+$unzip/bin/unzip $src
+mkdir $out
+mv $name/* $out/
diff --git a/nixpkgs/pkgs/development/libraries/java/httpunit/default.nix b/nixpkgs/pkgs/development/libraries/java/httpunit/default.nix
new file mode 100644
index 000000000000..ad276fcdd636
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/httpunit/default.nix
@@ -0,0 +1,19 @@
+{lib, stdenv, fetchurl, unzip} :
+
+stdenv.mkDerivation {
+  name = "httpunit-1.7";
+  builder = ./builder.sh;
+
+  src = fetchurl {
+    url = "mirror://sourceforge/httpunit/httpunit-1.7.zip";
+    sha256 = "09gnayqgizd8cjqayvdpkxrc69ipyxawc96aznfrgdhdiwv8l5zf";
+  };
+
+  inherit unzip;
+
+  meta = with lib; {
+    homepage = "http://httpunit.sourceforge.net";
+    platforms = platforms.unix;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/hydra-ant-logger/default.nix b/nixpkgs/pkgs/development/libraries/java/hydra-ant-logger/default.nix
new file mode 100644
index 000000000000..19bc3524c590
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/hydra-ant-logger/default.nix
@@ -0,0 +1,25 @@
+{ fetchgit, lib, stdenv, ant, jdk }:
+
+stdenv.mkDerivation {
+  pname = "hydra-ant-logger";
+  version = "2010.2";
+
+  src = fetchgit {
+    url = "https://github.com/NixOS/hydra-ant-logger.git";
+    rev = "dae3224f4ed42418d3492bdf5bee4f825819006f";
+    sha256 = "01s7m6007rn9107rw5wcgna7i20x6p6kfzl4f79jrvpkjy6kz176";
+  };
+
+  buildInputs = [ ant jdk ];
+
+  buildPhase = "mkdir lib; ant";
+
+  installPhase = ''
+    mkdir -p $out/share/java
+    cp -v *.jar $out/share/java
+  '';
+
+  meta = {
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/jdom/builder.sh b/nixpkgs/pkgs/development/libraries/java/jdom/builder.sh
new file mode 100755
index 000000000000..dbec4b6f3e0e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/jdom/builder.sh
@@ -0,0 +1,6 @@
+set -e
+source $stdenv/setup
+
+tar zxvf $src
+mkdir -p $out
+mv * $out
diff --git a/nixpkgs/pkgs/development/libraries/java/jdom/default.nix b/nixpkgs/pkgs/development/libraries/java/jdom/default.nix
new file mode 100644
index 000000000000..4bb90dd98874
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/jdom/default.nix
@@ -0,0 +1,18 @@
+{lib, stdenv, fetchurl} :
+
+stdenv.mkDerivation {
+  name = "jdom-1.0";
+  builder = ./builder.sh;
+
+  src = fetchurl {
+    url = "http://www.jdom.org/dist/binary/jdom-1.0.tar.gz";
+    sha256 = "1igmxzcy0s25zcy9vmcw0kd13lh60r0b4qg8lnp1jic33f427pxf";
+  };
+
+  meta = with lib; {
+    description = "Java-based solution for accessing, manipulating, and outputting XML data from Java code";
+    homepage = "http://www.jdom.org";
+    platforms = platforms.unix;
+    license = licenses.bsdOriginal;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/jflex/default.nix b/nixpkgs/pkgs/development/libraries/java/jflex/default.nix
new file mode 100644
index 000000000000..cf5b42a0ac21
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/jflex/default.nix
@@ -0,0 +1,37 @@
+{lib, stdenv, fetchurl, jre} :
+
+stdenv.mkDerivation rec {
+  name = "jflex-1.8.2";
+
+  src = fetchurl {
+    url = "http://jflex.de/release/${name}.tar.gz";
+    sha256 = "1ar7g6zb2xjgnws3j4cqcp86jplhc9av8cpcjdmxw08x6igd5q51";
+  };
+
+  sourceRoot = name;
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out
+    cp -a * $out
+    rm -f $out/bin/jflex.bat
+
+    patchShebangs $out
+    sed -i -e '/^JAVA=java/ s#java#${jre}/bin/java#' $out/bin/jflex
+    runHook postInstall
+  '';
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    runHook preInstallCheck
+    $out/bin/jflex --version
+    runHook postInstallCheck
+  '';
+
+  meta = {
+    homepage = "https://www.jflex.de/";
+    description = "Lexical analyzer generator for Java, written in Java";
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/junit/default.nix b/nixpkgs/pkgs/development/libraries/java/junit/default.nix
new file mode 100644
index 000000000000..5a1079851772
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/junit/default.nix
@@ -0,0 +1,28 @@
+{ lib, antBuild, fetchgit, perl }:
+
+let
+  version = "4.11";
+in antBuild {
+  name = "junit-${version}";
+
+  # I think this is only used to generate the docs, and will likely disappear
+  # with the next release of junit since its build system completely changes.
+  buildInputs = [perl];
+
+  src = fetchgit {
+    url = "https://github.com/junit-team/junit.git";
+    sha256 = "1cn5dhs6vpbfbcmnm2vb1212n0kblv8cxrvnwmksjxd6bzlkac1k";
+    rev = "c2e4d911fadfbd64444fb285342a8f1b72336169";
+  };
+
+  antProperties = [
+    { name = "version"; value = version; }
+  ];
+
+  meta = {
+    homepage = "http://www.junit.org/";
+    description = "A framework for repeatable tests in Java";
+    license = lib.licenses.epl10;
+    broken = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/junixsocket/darwin.patch b/nixpkgs/pkgs/development/libraries/java/junixsocket/darwin.patch
new file mode 100644
index 000000000000..97fd42d0b81b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/junixsocket/darwin.patch
@@ -0,0 +1,20 @@
+diff -rc junixsocket-1.3/src/main/org/newsclub/net/unix/NativeUnixSocket.java junixsocket-1.3-new/src/main/org/newsclub/net/unix/NativeUnixSocket.java
+*** junixsocket-1.3/src/main/org/newsclub/net/unix/NativeUnixSocket.java        Tue Jul 20 14:59:41 2010
+--- junixsocket-1.3-new/src/main/org/newsclub/net/unix/NativeUnixSocket.java    Sun May 27 22:26:15 2012
+***************
+*** 43,49 ****
+              String prefix = "lib";
+              String suffix = ".so";
+              String os = osName.replaceAll("[^A-Za-z0-9]", "").toLowerCase();
+!             if ("macosx".equals(os)) {
+                  suffix = ".dylib";
+              } else if ("linux".equals(os) || "freebsd".equals(os)
+                      || "sunos".equals(os)) {
+--- 43,49 ----
+              String prefix = "lib";
+              String suffix = ".so";
+              String os = osName.replaceAll("[^A-Za-z0-9]", "").toLowerCase();
+!             if ("macosx".equals(os) || "darwin".equals(os)) {
+                  suffix = ".dylib";
+              } else if ("linux".equals(os) || "freebsd".equals(os)
+                      || "sunos".equals(os)) {
diff --git a/nixpkgs/pkgs/development/libraries/java/junixsocket/default.nix b/nixpkgs/pkgs/development/libraries/java/junixsocket/default.nix
new file mode 100644
index 000000000000..0484f4c59ba6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/junixsocket/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchurl, ant, jdk, junit }:
+
+stdenv.mkDerivation rec {
+  name = "junixsocket-1.3";
+
+  src = fetchurl {
+    url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/junixsocket/${name}-src.tar.bz2";
+    sha256 = "0c6p8vmiv5nk8i6g1hgivnl3mpb2k3lhjjz0ss9dlirisfrxf1ym";
+  };
+
+  patches = [ ./darwin.patch ];
+
+  buildInputs = [ ant jdk junit ];
+
+  preConfigure =
+    ''
+      substituteInPlace src/main/org/newsclub/net/unix/NativeUnixSocketConfig.java \
+        --replace /opt/newsclub/lib-native $out/lib
+    '';
+
+  buildPhase = "ant";
+
+  ANT_ARGS =
+    # Note that our OpenJDK on Darwin is currently 32-bit, so we have to build a 32-bit dylib.
+    (if stdenv.is64bit then [ "-Dskip32=true" ] else [ "-Dskip64=true" ])
+    ++ [ "-Dgcc=${stdenv.cc.targetPrefix}cc" "-Dant.build.javac.source=1.6" ]
+    ++ lib.optional stdenv.isDarwin "-DisMac=true";
+
+  installPhase =
+    ''
+      mkdir -p $out/share/java $out/lib
+      cp -v dist/*.jar $out/share/java
+      cp -v lib-native/*.so lib-native/*.dylib $out/lib/
+    '';
+
+  meta = {
+    description = "A Java/JNI library for using Unix Domain Sockets from Java";
+    homepage = "https://github.com/kohlschutter/junixsocket";
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/libmatthew-java/default.nix b/nixpkgs/pkgs/development/libraries/java/libmatthew-java/default.nix
new file mode 100644
index 000000000000..a3cdaa37ed06
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/libmatthew-java/default.nix
@@ -0,0 +1,18 @@
+{lib, stdenv, fetchurl, jdk}:
+
+stdenv.mkDerivation {
+  name = "libmatthew-java-0.8";
+  src = fetchurl {
+    url = "https://src.fedoraproject.org/repo/pkgs/libmatthew-java/libmatthew-java-0.8.tar.gz/8455b8751083ce25c99c2840609271f5/libmatthew-java-0.8.tar.gz";
+    sha256 = "1yldkhsdzm0a41a0i881bin2jklhp85y3ah245jd6fz3npcx7l85";
+  };
+  JAVA_HOME=jdk;
+  PREFIX="\${out}";
+  buildInputs = [ jdk ];
+
+  meta = with lib; {
+    platforms = platforms.linux;
+    maintainers = [ maintainers.sander ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/lombok/default.nix b/nixpkgs/pkgs/development/libraries/java/lombok/default.nix
new file mode 100644
index 000000000000..b4f0f4525f79
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/lombok/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, makeWrapper, jdk }:
+
+stdenv.mkDerivation rec {
+  name = "lombok-1.18.20";
+
+  src = fetchurl {
+    url = "https://projectlombok.org/downloads/${name}.jar";
+    sha256 = "sha256-zpR75sL751n7vo7ztCtoJfgUyYyIU/EBPy2WMM7fdLA=";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+
+  outputs = [ "out" "bin" ];
+
+  buildCommand = ''
+    mkdir -p $out/share/java
+    cp $src $out/share/java/lombok.jar
+
+    makeWrapper ${jdk}/bin/java $bin/bin/lombok \
+      --add-flags "-cp ${jdk}/lib/openjdk/lib/tools.jar:$out/share/java/lombok.jar" \
+      --add-flags lombok.launch.Main
+  '';
+
+  meta = {
+    description = "A library that can write a lot of boilerplate for your Java project";
+    platforms = lib.platforms.all;
+    license = lib.licenses.mit;
+    homepage = "https://projectlombok.org/";
+    maintainers = [ lib.maintainers.CrystalGamma ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/lucene/builder.sh b/nixpkgs/pkgs/development/libraries/java/lucene/builder.sh
new file mode 100755
index 000000000000..d95feb5eeb44
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/lucene/builder.sh
@@ -0,0 +1,6 @@
+set -e
+source $stdenv/setup
+
+tar zxvf $src
+mkdir -p $out
+mv $name/* $out
diff --git a/nixpkgs/pkgs/development/libraries/java/lucene/default.nix b/nixpkgs/pkgs/development/libraries/java/lucene/default.nix
new file mode 100644
index 000000000000..417c7b969000
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/lucene/default.nix
@@ -0,0 +1,19 @@
+{lib, stdenv, fetchurl} :
+
+stdenv.mkDerivation rec {
+  pname = "lucene";
+  version = "1.4.3";
+
+  builder = ./builder.sh;
+
+  src = fetchurl {
+    url = "https://archive.apache.org/dist/jakarta/lucene/${pname}-${version}.tar.gz";
+    sha256 = "1mxaxg65f7v8n60irjwm24v7hcisbl0srmpvcy1l4scs6rjj1awh";
+  };
+
+  meta = with lib; {
+    description = "Java full-text search engine";
+    platforms = platforms.unix;
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/mockobjects/builder.sh b/nixpkgs/pkgs/development/libraries/java/mockobjects/builder.sh
new file mode 100755
index 000000000000..fd5d1a20869c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/mockobjects/builder.sh
@@ -0,0 +1,6 @@
+set -e
+source $stdenv/setup
+
+tar xvf $src
+mkdir -p $out
+mv * $out
diff --git a/nixpkgs/pkgs/development/libraries/java/mockobjects/default.nix b/nixpkgs/pkgs/development/libraries/java/mockobjects/default.nix
new file mode 100644
index 000000000000..e20d7e707e71
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/mockobjects/default.nix
@@ -0,0 +1,17 @@
+{lib, stdenv, fetchurl} :
+
+stdenv.mkDerivation {
+  name = "mockobjects-0.09";
+  builder = ./builder.sh;
+
+  src = fetchurl {
+    url = "mirror://sourceforge/mockobjects/mockobjects-bin-0.09.tar";
+    sha256 = "18rnyqfcyh0s3dwkkaszdd50ssyjx5fa1y3ii309ldqg693lfgnz";
+  };
+
+  meta = with lib; {
+    description = "Generic unit testing framework and methodology for testing any kind of code";
+    platforms = platforms.unix;
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/rhino/default.nix b/nixpkgs/pkgs/development/libraries/java/rhino/default.nix
new file mode 100644
index 000000000000..e67425208657
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/rhino/default.nix
@@ -0,0 +1,58 @@
+{ fetchurl, lib, stdenv, unzip, ant, javac, jvm }:
+
+let
+  xbeans  = fetchurl {
+    url = "http://archive.apache.org/dist/xmlbeans/binaries/xmlbeans-2.2.0.zip";
+    sha256 = "1pb08d9j81d0wz5wj31idz198iwhqb7mch872n08jh1354rjlqwk";
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "rhino";
+  version = "1.7R2";
+
+  src = fetchurl {
+    url = "mirror://mozilla/js/rhino1_7R2.zip";
+    sha256 = "1p32hkghi6bkc3cf2dcqyaw5cjj7403mykcp0fy8f5bsnv0pszv7";
+  };
+
+  patches = [ ./gcj-type-mismatch.patch ];
+
+  hardeningDisable = [ "fortify" "format" ];
+
+  preConfigure =
+    ''
+      find -name \*.jar -or -name \*.class -exec rm -v {} \;
+
+      # The build process tries to download it by itself.
+      mkdir -p "build/tmp-xbean"
+      ln -sv "${xbeans}" "build/tmp-xbean/xbean.zip"
+    '';
+
+  nativeBuildInputs = [ unzip ];
+  buildInputs = [ ant javac jvm ];
+
+  buildPhase = "ant jar";
+  doCheck    = false;
+
+  # FIXME: Install javadoc as well.
+  installPhase =
+    ''
+      mkdir -p "$out/share/java"
+      cp -v *.jar "$out/share/java"
+    '';
+
+  meta = with lib; {
+    description = "An implementation of JavaScript written in Java";
+
+    longDescription =
+      '' Rhino is an open-source implementation of JavaScript written
+         entirely in Java.  It is typically embedded into Java applications
+         to provide scripting to end users.
+      '';
+
+    homepage = "http://www.mozilla.org/rhino/";
+
+    license = with licenses; [ mpl11 /* or */ gpl2Plus ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/rhino/gcj-type-mismatch.patch b/nixpkgs/pkgs/development/libraries/java/rhino/gcj-type-mismatch.patch
new file mode 100644
index 000000000000..dac7b209069a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/rhino/gcj-type-mismatch.patch
@@ -0,0 +1,103 @@
+Work around GCJ bug #35410:
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35410 .
+
+diff --git a/src/org/mozilla/javascript/Arguments.java b/src/org/mozilla/javascript/Arguments.java
+index d914294..d658f12 100644
+--- a/src/org/mozilla/javascript/Arguments.java
++++ b/src/org/mozilla/javascript/Arguments.java
+@@ -144,7 +144,7 @@ final class Arguments extends IdScriptableObject
+                 synchronized (this) {
+                     if (args[index] != NOT_FOUND) {
+                         if (args == activation.originalArgs) {
+-                            args = args.clone();
++                            args = (Object[]) args.clone();
+                         }
+                         args[index] = value;
+                         return;
+@@ -162,7 +162,7 @@ final class Arguments extends IdScriptableObject
+             synchronized (this) {
+                 if (args[index] != NOT_FOUND) {
+                     if (args == activation.originalArgs) {
+-                        args = args.clone();
++                        args = (Object[]) args.clone();
+                     }
+                     args[index] = NOT_FOUND;
+                     return;
+diff --git a/src/org/mozilla/javascript/FunctionObject.java b/src/org/mozilla/javascript/FunctionObject.java
+index 1d6c752..3adc100 100644
+--- a/src/org/mozilla/javascript/FunctionObject.java
++++ b/src/org/mozilla/javascript/FunctionObject.java
+@@ -455,7 +455,7 @@ public class FunctionObject extends BaseFunction
+                     Object converted = convertArg(cx, scope, arg, typeTags[i]);
+                     if (arg != converted) {
+                         if (invokeArgs == args) {
+-                            invokeArgs = args.clone();
++                            invokeArgs = (Object[]) args.clone();
+                         }
+                         invokeArgs[i] = converted;
+                     }
+diff --git a/src/org/mozilla/javascript/Interpreter.java b/src/org/mozilla/javascript/Interpreter.java
+index f7f544d..e125e2f 100644
+--- a/src/org/mozilla/javascript/Interpreter.java
++++ b/src/org/mozilla/javascript/Interpreter.java
+@@ -285,9 +285,9 @@ public class Interpreter implements Evaluator
+             // clone stack but keep varSource to point to values
+             // from this frame to share variables.
+ 
+-            copy.stack = stack.clone();
+-            copy.stackAttributes = stackAttributes.clone();
+-            copy.sDbl = sDbl.clone();
++            copy.stack = (Object[]) stack.clone();
++            copy.stackAttributes = (int[]) stackAttributes.clone();
++            copy.sDbl = (double[]) sDbl.clone();
+ 
+             copy.frozen = false;
+             return copy;
+diff --git a/src/org/mozilla/javascript/NativeJavaClass.java b/src/org/mozilla/javascript/NativeJavaClass.java
+index f72f9e7..25c6757 100644
+--- a/src/org/mozilla/javascript/NativeJavaClass.java
++++ b/src/org/mozilla/javascript/NativeJavaClass.java
+@@ -271,7 +271,7 @@ public class NativeJavaClass extends NativeJavaObject implements Function
+                 Object x = Context.jsToJava(arg, argTypes[i]);
+                 if (x != arg) {
+                     if (args == origArgs) {
+-                        args = origArgs.clone();
++                        args = (Object[]) origArgs.clone();
+                     }
+                     args[i] = x;
+                 }
+diff --git a/src/org/mozilla/javascript/NativeJavaMethod.java b/src/org/mozilla/javascript/NativeJavaMethod.java
+index b6eaf8b..dc699a0 100644
+--- a/src/org/mozilla/javascript/NativeJavaMethod.java
++++ b/src/org/mozilla/javascript/NativeJavaMethod.java
+@@ -213,7 +213,7 @@ public class NativeJavaMethod extends BaseFunction
+                 Object coerced = Context.jsToJava(arg, argTypes[i]);
+                 if (coerced != arg) {
+                     if (origArgs == args) {
+-                        args = args.clone();
++                        args = (Object[]) args.clone();
+                     }
+                     args[i] = coerced;
+                 }
+diff --git a/src/org/mozilla/javascript/regexp/NativeRegExp.java b/src/org/mozilla/javascript/regexp/NativeRegExp.java
+index 0bae489..f7124bf 100644
+--- a/src/org/mozilla/javascript/regexp/NativeRegExp.java
++++ b/src/org/mozilla/javascript/regexp/NativeRegExp.java
+@@ -2168,7 +2168,7 @@ System.out.println("Testing at " + gData.cp + ", op = " + op);
+                     // XXX: If backTrackData will no longer be used, then
+                     // there is no need to clone backTrackData.parens
+                     if (backTrackData.parens != null) {
+-                        gData.parens = backTrackData.parens.clone();
++                        gData.parens = (long[]) backTrackData.parens.clone();
+                     }
+ 
+                     gData.cp = backTrackData.cp;
+@@ -2708,7 +2708,7 @@ class REBackTrackData {
+         continuation_pc = pc;
+         lastParen = gData.lastParen;
+         if (gData.parens != null) {
+-            parens = gData.parens.clone();
++            parens = (long[]) gData.parens.clone();
+         }
+         cp = gData.cp;
+         stateStackTop = gData.stateStackTop;
diff --git a/nixpkgs/pkgs/development/libraries/java/saxon/default.nix b/nixpkgs/pkgs/development/libraries/java/saxon/default.nix
new file mode 100644
index 000000000000..da1e6120da63
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/saxon/default.nix
@@ -0,0 +1,85 @@
+{ lib, stdenv, fetchurl, unzip, jre, jre8 }:
+
+let
+  common = { pname, version, src, description, java ? jre
+           , prog ? null, jar ? null, license ? lib.licenses.mpl20 }:
+    stdenv.mkDerivation {
+      name = "${pname}-${version}";
+      inherit pname version src;
+
+      nativeBuildInputs = [ unzip ];
+
+      buildCommand = let
+        prog' = if prog == null then pname else prog;
+        jar' = if jar == null then pname else jar;
+      in ''
+        unzip $src -d $out
+        mkdir -p $out/bin $out/share $out/share/java
+        cp -s "$out"/*.jar "$out/share/java/"  # */
+        rm -rf $out/notices
+        mv $out/doc $out/share
+        cat > $out/bin/${prog'} <<EOF
+        #! $shell
+        export JAVA_HOME=${jre}
+        exec ${jre}/bin/java -jar $out/${jar'}.jar "\$@"
+        EOF
+        chmod a+x $out/bin/${prog'}
+      '';
+
+      meta = with lib; {
+        inherit description license;
+        homepage = "http://saxon.sourceforge.net/";
+        maintainers = with maintainers; [ rvl ];
+        platforms = platforms.all;
+      };
+    };
+
+in {
+  saxon = common {
+    pname = "saxon";
+    version = "6.5.3";
+    src = fetchurl {
+      url = "mirror://sourceforge/saxon/saxon6_5_3.zip";
+      sha256 = "0l5y3y2z4wqgh80f26dwwxwncs8v3nkz3nidv14z024lmk730vs3";
+    };
+    description = "XSLT 1.0 processor";
+    # http://saxon.sourceforge.net/saxon6.5.3/conditions.html
+    license = lib.licenses.mpl10;
+    java = jre8;
+  };
+
+  saxonb_8_8 = common {
+    pname = "saxonb";
+    version = "8.8";
+    jar = "saxon8";
+    src = fetchurl {
+      url = "mirror://sourceforge/saxon/saxonb8-8j.zip";
+      sha256 = "15bzrfyd2f1045rsp9dp4znyhmizh1pm97q8ji2bc0b43q23xsb8";
+    };
+    description = "Complete and conformant processor of XSLT 2.0, XQuery 1.0, and XPath 2.0";
+    java = jre8;
+  };
+
+  saxonb_9_1 = common {
+    pname = "saxonb";
+    version = "9.1.0.8";
+    jar = "saxon9";
+    src = fetchurl {
+      url = "mirror://sourceforge/saxon/Saxon-B/9.1.0.8/saxonb9-1-0-8j.zip";
+      sha256 = "1d39jdnwr3v3pzswm81zry6yikqlqy9dp2l2wmpqdiw00r5drg4j";
+    };
+    description = "Complete and conformant processor of XSLT 2.0, XQuery 1.0, and XPath 2.0";
+  };
+
+  saxon-he = common {
+    pname = "saxon-he";
+    version = "9.9.0.1";
+    prog = "saxon-he";
+    jar = "saxon9he";
+    src = fetchurl {
+      url = "mirror://sourceforge/saxon/Saxon-HE/9.9/SaxonHE9-9-0-1J.zip";
+      sha256 = "1inxd7ia7rl9fxfrw8dy9sb7rqv76ipblaki5262688wf2dscs60";
+    };
+    description = "Processor for XSLT 3.0, XPath 2.0 and 3.1, and XQuery 3.1";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/smack/builder.sh b/nixpkgs/pkgs/development/libraries/java/smack/builder.sh
new file mode 100644
index 000000000000..c97259e6a17e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/smack/builder.sh
@@ -0,0 +1,7 @@
+source $stdenv/setup
+
+mkdir smack
+cd smack
+tar xfvz $src
+mkdir -p $out/share/java
+cp libs/smack-*.jar $out/share/java
diff --git a/nixpkgs/pkgs/development/libraries/java/smack/default.nix b/nixpkgs/pkgs/development/libraries/java/smack/default.nix
new file mode 100644
index 000000000000..f831bfc8b933
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/smack/default.nix
@@ -0,0 +1,18 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation {
+  name = "smack-4.1.9";
+  builder = ./builder.sh;
+
+  src = fetchurl {
+    url = "http://www.igniterealtime.org/downloadServlet?filename=smack/smack_4_1_9.tar.gz";
+    sha256 = "009x0qcxd4dkvwcjz2nla470pwbabwvg37wc21pslpw42ldi0bzp";
+  };
+
+  meta = {
+    description = "A XMPP (Jabber) client library for instant messaging and presence";
+    homepage = "http://www.igniterealtime.org/projects/smack/";
+    platforms = lib.platforms.unix;
+    license = lib.licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/java/swt/default.nix b/nixpkgs/pkgs/development/libraries/java/swt/default.nix
new file mode 100644
index 000000000000..bf35490f9a88
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/java/swt/default.nix
@@ -0,0 +1,73 @@
+{ stdenv, lib, fetchurl, unzip, jdk, pkg-config, gtk2
+, libXt, libXtst, libXi, libGLU, libGL, webkitgtk, libsoup, xorg
+, pango, gdk-pixbuf, glib
+}:
+
+let
+  platformMap = {
+    x86_64-linux =
+      { platform = "gtk-linux-x86_64";
+        sha256 = "1qq0pjll6030v4ml0hifcaaik7sx3fl7ghybfdw95vsvxafwp2ff"; };
+    i686-linux =
+      { platform = "gtk-linux-x86";
+        sha256 = "03mhzraikcs4fsz7d3h5af9pw1bbcfd6dglsvbk2ciwimy9zj30q"; };
+    x86_64-darwin =
+      { platform = "cocoa-macosx-x86_64";
+        sha256 = "00k1mfbncvyh8klgmk0891w8jwnd5niqb16j1j8yacrm2smmlb05"; };
+  };
+
+  metadata = assert platformMap ? ${stdenv.hostPlatform.system}; platformMap.${stdenv.hostPlatform.system};
+
+in stdenv.mkDerivation rec {
+  version = "4.5";
+  fullVersion = "${version}-201506032000";
+  pname = "swt";
+
+  hardeningDisable = [ "format" ];
+
+  # Alas, the Eclipse Project apparently doesn't produce source-only
+  # releases of SWT.  So we just grab a binary release and extract
+  # "src.zip" from that.
+  src = fetchurl {
+    url = "http://archive.eclipse.org/eclipse/downloads/drops4/R-${fullVersion}/${pname}-${version}-${metadata.platform}.zip";
+    sha256 = metadata.sha256;
+  };
+
+  sourceRoot = ".";
+
+  nativeBuildInputs = [ unzip pkg-config ];
+  buildInputs = [ jdk gtk2 libXt libXtst libXi libGLU libGL webkitgtk libsoup ];
+
+  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
+
+    cd src
+    sed -i "s#^LFLAGS =#LFLAGS = $NIX_LFLAGS #g"  *.mak
+    export JAVA_HOME=${jdk}
+
+    sh ./build.sh
+
+    mkdir out
+    javac -d out/ $(find org/ -name "*.java")
+  '';
+
+  installPhase = ''
+    mkdir -p $out/lib
+    cp *.so $out/lib
+
+    mkdir -p $out/jars
+    cp version.txt out/
+    cd out && jar -c * > $out/jars/swt.jar
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.eclipse.org/swt/";
+    description = "An widget toolkit for Java to access the user-interface facilities of the operating systems on which it is implemented";
+    license = licenses.epl10;
+    maintainers = with maintainers; [ pSub ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/jbig2dec/default.nix b/nixpkgs/pkgs/development/libraries/jbig2dec/default.nix
new file mode 100644
index 000000000000..6f9d88d63666
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jbig2dec/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, python3, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "jbig2dec";
+  version = "0.19";
+
+  src = fetchurl {
+    url = "https://github.com/ArtifexSoftware/ghostpdl-downloads/releases/download/gs9533/${pname}-${version}.tar.gz";
+    sha256 = "0dwa24kjqyg9hmm40fh048sdxfpnasz43l2rm8wlkw1qbdlpd517";
+  };
+
+  postPatch = ''
+    patchShebangs test_jbig2dec.py
+  '';
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  checkInputs = [ python3 ];
+  doCheck = true;
+
+  meta = {
+    homepage = "https://www.jbig2dec.com/";
+    description = "Decoder implementation of the JBIG2 image compression format";
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/jbigkit/default.nix b/nixpkgs/pkgs/development/libraries/jbigkit/default.nix
new file mode 100644
index 000000000000..40a46041caa2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jbigkit/default.nix
@@ -0,0 +1,52 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "jbigkit";
+  version = "2.1";
+
+  src = fetchurl {
+    url = "https://www.cl.cam.ac.uk/~mgk25/jbigkit/download/${pname}-${version}.tar.gz";
+    sha256 = "0cnrcdr1dwp7h7m0a56qw09bv08krb37mpf7cml5sjdgpyv0cwfy";
+  };
+
+  makeFlags = [
+    "CC=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
+    "AR=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar"
+    "RANLIB=${lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib"
+  ];
+
+  postPatch = ''
+    sed -i 's/^\(CFLAGS.*\)$/\1 -fPIC/' Makefile
+
+    for f in Makefile libjbig/Makefile pbmtools/Makefile; do
+        sed -i -E 's/\bar /$(AR) /g;s/\branlib /$(RANLIB) /g' "$f"
+    done
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    install -D -m644 libjbig/libjbig.a $out/lib/libjbig.a
+    install -D -m644 libjbig/libjbig85.a $out/lib/libjbig85.a
+    install -D -m644 libjbig/jbig.h $out/include/jbig.h
+    install -D -m644 libjbig/jbig_ar.h $out/include/jbig_ar.h
+    install -D -m644 libjbig/jbig85.h $out/include/jbig85.h
+
+    install -d -m755 $out/share/man/man1
+    install -m644 pbmtools/*.1* $out/share/man/man1
+
+    install -D -m755 pbmtools/jbgtopbm $out/bin/jbgtopbm
+    install -D -m755 pbmtools/pbmtojbg $out/bin/pbmtojbg
+    install -D -m755 pbmtools/jbgtopbm85 $out/bin/jbgtopbm85
+    install -D -m755 pbmtools/pbmtojbg85 $out/bin/pbmtojbg85
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.cl.cam.ac.uk/~mgk25/jbigkit/";
+    description = "A software implementation of the JBIG1 data compression standard";
+    license = licenses.gpl2Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/jcal/default.nix b/nixpkgs/pkgs/development/libraries/jcal/default.nix
new file mode 100644
index 000000000000..2b57bd4064b7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jcal/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook
+, readline
+}:
+
+stdenv.mkDerivation rec {
+  name = "jcal";
+  version = "0.4.1";
+
+  src = fetchFromGitHub {
+    owner = "fzerorubigd";
+    repo = "jcal";
+    rev = "v${version}";
+    sha256 = "0m3g3rf0ycv2dsfn9y2472fa3r0yla8pfqk6gq00nrscsc3pp4zf";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ readline ];
+
+  preAutoreconf = "cd sources/";
+
+  meta = with lib; {
+    description = "Jalali calendar is a small and portable free software library to manipulate date and time in Jalali calendar system";
+    homepage =  "http://nongnu.org/jcal/";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.linarcx ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/jemalloc/common.nix b/nixpkgs/pkgs/development/libraries/jemalloc/common.nix
new file mode 100644
index 000000000000..d5fe07b00f2a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jemalloc/common.nix
@@ -0,0 +1,50 @@
+{ version, sha256 }:
+{ lib, stdenv, fetchurl
+# By default, jemalloc puts a je_ prefix onto all its symbols on OSX, which
+# then stops downstream builds (mariadb in particular) from detecting it. This
+# option should remove the prefix and give us a working jemalloc.
+# Causes segfaults with some software (ex. rustc), but defaults to true for backward
+# compatibility.
+, stripPrefix ? stdenv.hostPlatform.isDarwin
+, disableInitExecTls ? false
+}:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "jemalloc";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://github.com/jemalloc/jemalloc/releases/download/${version}/${pname}-${version}.tar.bz2";
+    inherit sha256;
+  };
+
+  # see the comment on stripPrefix
+  configureFlags = []
+    ++ optional stripPrefix "--with-jemalloc-prefix="
+    ++ optional disableInitExecTls "--disable-initial-exec-tls"
+    # jemalloc is unable to correctly detect transparent hugepage support on
+    # ARM (https://github.com/jemalloc/jemalloc/issues/526), and the default
+    # kernel ARMv6/7 kernel does not enable it, so we explicitly disable support
+    ++ optionals (stdenv.isAarch32 && versionOlder version "5") [
+      "--disable-thp"
+      "je_cv_thp=no"
+    ]
+  ;
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "http://jemalloc.net";
+    description = "General purpose malloc(3) implementation";
+    longDescription = ''
+      malloc(3)-compatible memory allocator that emphasizes fragmentation
+      avoidance and scalable concurrency support.
+    '';
+    license = licenses.bsd2;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/jemalloc/default.nix b/nixpkgs/pkgs/development/libraries/jemalloc/default.nix
new file mode 100644
index 000000000000..9324279ed100
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jemalloc/default.nix
@@ -0,0 +1,4 @@
+import ./common.nix {
+  version = "5.2.1";
+  sha256 = "1xl7z0vwbn5iycg7amka9jd6hxd8nmfk7nahi4p9w2bnw9f0wcrl";
+}
diff --git a/nixpkgs/pkgs/development/libraries/jemalloc/jemalloc450.nix b/nixpkgs/pkgs/development/libraries/jemalloc/jemalloc450.nix
new file mode 100644
index 000000000000..85b4fb100f74
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jemalloc/jemalloc450.nix
@@ -0,0 +1,4 @@
+import ./common.nix {
+  version = "4.5.0";
+  sha256 = "10373xhpc10pgmai9fkc1z0rs029qlcb3c0qfnvkbwdlcibdh2cl";
+}
diff --git a/nixpkgs/pkgs/development/libraries/jitterentropy/default.nix b/nixpkgs/pkgs/development/libraries/jitterentropy/default.nix
new file mode 100644
index 000000000000..11f6141872db
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jitterentropy/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub }:
+stdenv.mkDerivation rec {
+  pname = "jitterentropy";
+  version = "2.2.0";
+
+  src = fetchFromGitHub {
+    owner = "smuellerDD";
+    repo = "jitterentropy-library";
+    rev = "v${version}";
+    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 = [
+    "PREFIX=$(out)"
+  ];
+
+  meta = {
+    description = "Provides a noise source using the CPU execution timing jitter";
+    homepage = "https://github.com/smuellerDD/jitterentropy-library";
+    license = with lib.licenses; [ gpl2 bsd3 ];
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ johnazoidberg ];
+  };
+}
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/jose/default.nix b/nixpkgs/pkgs/development/libraries/jose/default.nix
new file mode 100644
index 000000000000..b15fead62699
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jose/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config
+, zlib, jansson, openssl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "jose";
+  version = "10";
+
+  src = fetchFromGitHub {
+    owner = "latchset";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "15ac8a656m66rd9qg4dj53smykwaagqv606h18w7fiqn0ykxl4vi";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ zlib jansson openssl ];
+
+  outputs = [ "out" "dev" "man" ];
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "C-language implementation of Javascript Object Signing and Encryption";
+    homepage = "https://github.com/latchset/jose";
+    maintainers = with lib.maintainers; [ fpletz ];
+    license = lib.licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/json-c/default.nix b/nixpkgs/pkgs/development/libraries/json-c/default.nix
new file mode 100644
index 000000000000..5a77ea789afe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/json-c/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "json-c";
+  version = "0.15";
+
+  src = fetchurl {
+    url    = "https://s3.amazonaws.com/json-c_releases/releases/${pname}-${version}.tar.gz";
+    sha256 = "1im484iz08j3gmzpw07v16brwq46pxxj65i996kkp2vivcfhmn5q";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "A JSON implementation in C";
+    homepage    = "https://github.com/json-c/json-c/wiki";
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.unix;
+    license = licenses.mit;
+
+    longDescription = ''
+      JSON-C implements a reference counting object model that allows you to
+      easily construct JSON objects in C, output them as JSON formatted strings
+      and parse JSON formatted strings back into the C representation of JSON
+      objects.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/json-glib/default.nix b/nixpkgs/pkgs/development/libraries/json-glib/default.nix
new file mode 100644
index 000000000000..9ef66fd2ce69
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/json-glib/default.nix
@@ -0,0 +1,77 @@
+{ lib
+, stdenv
+, fetchurl
+, glib
+, meson
+, ninja
+, pkg-config
+, gettext
+, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform
+, gobject-introspection
+, fixDarwinDylibNames
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "json-glib";
+  version = "1.6.2";
+
+  outputs = [ "out" "dev" ]
+    ++ lib.optional withIntrospection "devdoc";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "092g2dyy1hhl0ix9kp33wcab0pg1qicnsv0cj5ms9g9qs336cgd3";
+  };
+
+  strictDeps = true;
+
+  depsBuildBuild = [
+    pkg-config
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gettext
+    glib
+    docbook-xsl-nons
+    docbook_xml_dtd_43
+  ] ++ lib.optional stdenv.hostPlatform.isDarwin [
+    fixDarwinDylibNames
+  ] ++ lib.optionals withIntrospection [
+    gobject-introspection
+    gtk-doc
+  ];
+
+  propagatedBuildInputs = [
+    glib
+  ];
+
+  mesonFlags = lib.optionals (!withIntrospection) [
+    "-Dintrospection=disabled"
+    # doc gen uses introspection, doesn't work properly
+    "-Dgtk_doc=disabled"
+  ];
+
+  doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "A library providing (de)serialization support for the JavaScript Object Notation (JSON) format";
+    homepage = "https://wiki.gnome.org/Projects/JsonGlib";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/jsoncpp/default.nix b/nixpkgs/pkgs/development/libraries/jsoncpp/default.nix
new file mode 100644
index 000000000000..6c162c381ac6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jsoncpp/default.nix
@@ -0,0 +1,57 @@
+{ lib, stdenv, fetchFromGitHub, cmake, python3, validatePkgConfig, fetchpatch }:
+
+stdenv.mkDerivation rec {
+  pname = "jsoncpp";
+  version = "1.9.4";
+
+  outputs = ["out" "dev"];
+
+  src = fetchFromGitHub {
+    owner = "open-source-parsers";
+    repo = "jsoncpp";
+    rev = version;
+    sha256 = "0qnx5y6c90fphl9mj9d20j2dfgy6s5yr5l0xnzid0vh71zrp6jwv";
+  };
+
+  patches = [
+    # Fix for https://github.com/open-source-parsers/jsoncpp/issues/1235.
+    (fetchpatch {
+      url = "https://github.com/open-source-parsers/jsoncpp/commit/ac2870298ed5b5a96a688d9df07461b31f83e906.patch";
+      sha256 = "02wswhiwypmf1jn3rj9q1fw164kljiv4l8h0q6wyijzr77hq4wsg";
+    })
+  ];
+
+  /* During darwin bootstrap, we have a cp that doesn't understand the
+   * --reflink=auto flag, which is used in the default unpackPhase for dirs
+   */
+  unpackPhase = ''
+    cp -a ${src} ${src.name}
+    chmod -R +w ${src.name}
+    export sourceRoot=${src.name}
+  '';
+
+  # Hack to be able to run the test, broken because we use
+  # CMAKE_SKIP_BUILD_RPATH to avoid cmake resetting rpath on install
+  preBuild = if stdenv.isDarwin then ''
+    export DYLD_LIBRARY_PATH="$PWD/lib''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
+  '' else ''
+    export LD_LIBRARY_PATH="$PWD/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
+  '';
+
+  nativeBuildInputs = [ cmake python3 validatePkgConfig ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DBUILD_STATIC_LIBS=OFF"
+    "-DBUILD_OBJECT_LIBS=OFF"
+    "-DJSONCPP_WITH_CMAKE_PACKAGE=ON"
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/open-source-parsers/jsoncpp";
+    description = "A C++ library for interacting with JSON";
+    maintainers = with maintainers; [ ttuegel cpages ];
+    license = licenses.mit;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/jsonrpc-glib/default.nix b/nixpkgs/pkgs/development/libraries/jsonrpc-glib/default.nix
new file mode 100644
index 000000000000..b43bcd07ca6b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jsonrpc-glib/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, meson, ninja, glib, json-glib, pkg-config, gobject-introspection, vala, gtk-doc, docbook_xsl, docbook_xml_dtd_43, gnome }:
+stdenv.mkDerivation rec {
+  pname = "jsonrpc-glib";
+  version = "3.38.0";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  nativeBuildInputs = [ meson ninja pkg-config gobject-introspection vala gtk-doc docbook_xsl docbook_xml_dtd_43 ];
+  buildInputs = [ glib json-glib ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "3F8ZFKkRUrcPqPyaEe3hMUirSvZE2yejZjI4jJJ6ioI=";
+  };
+
+  mesonFlags = [
+    "-Denable_gtk_doc=true"
+  ];
+
+  # Tests fail non-deterministically
+  # https://gitlab.gnome.org/GNOME/jsonrpc-glib/issues/2
+  doCheck = false;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "A library to communicate using the JSON-RPC 2.0 specification";
+    homepage = "https://gitlab.gnome.org/GNOME/jsonrpc-glib";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/judy/default.nix b/nixpkgs/pkgs/development/libraries/judy/default.nix
new file mode 100644
index 000000000000..077c4fe90fdb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/judy/default.nix
@@ -0,0 +1,24 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "judy";
+  version = "1.0.5";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/judy/Judy-${version}.tar.gz";
+    sha256 = "1sv3990vsx8hrza1mvq3bhvv9m6ff08y4yz7swn6znszz24l0w6j";
+  };
+
+  # gcc 4.8 optimisations break judy.
+  # https://sourceforge.net/p/judy/mailman/message/31995144/
+  preConfigure = lib.optionalString stdenv.cc.isGNU ''
+    configureFlagsArray+=("CFLAGS=-fno-strict-aliasing -fno-aggressive-loop-optimizations")
+  '';
+
+  meta = {
+    homepage = "http://judy.sourceforge.net/";
+    license = lib.licenses.lgpl21Plus;
+    description = "State-of-the-art C library that implements a sparse dynamic array";
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/jxrlib/default.nix b/nixpkgs/pkgs/development/libraries/jxrlib/default.nix
new file mode 100644
index 000000000000..06499e151ba1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jxrlib/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, python3, fixDarwinDylibNames }:
+
+stdenv.mkDerivation rec {
+  pname = "jxrlib";
+  version = "1.1";
+
+  # Use the source from a fork on github because CodePlex does not
+  # deliver an easily downloadable tarball.
+  src = fetchFromGitHub {
+    owner = "4creators";
+    repo = pname;
+    rev = "f7521879862b9085318e814c6157490dd9dbbdb4";
+    sha256 = "0rk3hbh00nw0wgbfbqk1szrlfg3yq7w6ar16napww3nrlm9cj65w";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace "cc" "$CC"
+  '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace Makefile \
+      --replace '-shared' '-dynamiclib -undefined dynamic_lookup' \
+      --replace '.so' '.dylib'
+  '';
+
+  nativeBuildInputs = [ python3 ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
+
+  strictDeps = true;
+
+  makeFlags = [ "DIR_INSTALL=$(out)" "SHARED=1" ];
+
+  meta = with lib; {
+    description = "Implementation of the JPEG XR image codec standard";
+    homepage = "https://jxrlib.codeplex.com";
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/kcolorpicker/default.nix b/nixpkgs/pkgs/development/libraries/kcolorpicker/default.nix
new file mode 100644
index 000000000000..75a07b17a7ee
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kcolorpicker/default.nix
@@ -0,0 +1,24 @@
+{ lib, mkDerivation, fetchFromGitHub, cmake, qtbase }:
+
+mkDerivation rec {
+  pname = "kcolorpicker";
+  version = "0.1.6";
+
+  src = fetchFromGitHub {
+    owner = "ksnip";
+    repo = "kColorPicker";
+    rev = "v${version}";
+    sha256 = "1167xwk75yiz697vddbz3lq42l7ckhyl2cvigy4m05qgg9693ksd";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ qtbase ];
+
+  meta = with lib; {
+    description = "Qt based Color Picker with popup menu";
+    homepage = "https://github.com/ksnip/kColorPicker";
+    license = licenses.lgpl3Plus;
+    maintainers = with maintainers; [ fliegendewurst ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/kdb/default.nix b/nixpkgs/pkgs/development/libraries/kdb/default.nix
new file mode 100644
index 000000000000..03eabc6447b4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kdb/default.nix
@@ -0,0 +1,28 @@
+{
+  mkDerivation, lib, fetchurl,
+  extra-cmake-modules,
+  qtbase, qttranslations, kcoreaddons, python2, sqlite, postgresql, libmysqlclient
+}:
+
+mkDerivation rec {
+  pname = "kdb";
+  version = "3.2.0";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/${pname}/src/${pname}-${version}.tar.xz";
+    sha256 = "0s909x34a56n3xwhqz27irl2gbzidax0685w2kf34f0liny872cg";
+  };
+
+  nativeBuildInputs = [ extra-cmake-modules ];
+
+  buildInputs = [ qttranslations kcoreaddons python2 sqlite postgresql libmysqlclient ];
+
+  propagatedBuildInputs = [ qtbase ];
+
+  meta = with lib; {
+    description = "A database connectivity and creation framework for various database vendors";
+    license = licenses.lgpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ zraexy ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/kddockwidgets/default.nix b/nixpkgs/pkgs/development/libraries/kddockwidgets/default.nix
new file mode 100644
index 000000000000..b63bdc979c42
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kddockwidgets/default.nix
@@ -0,0 +1,29 @@
+{ lib
+, mkDerivation
+, fetchFromGitHub
+, cmake
+, qtbase
+, qtx11extras
+}:
+
+mkDerivation rec {
+  pname = "KDDockWidgets";
+  version = "1.4.0";
+
+  src = fetchFromGitHub {
+    owner = "KDAB";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-lgNRuRoJhBw0n/Hb58uxpa+4aXoOrK4bRldtIXYIKLI=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ qtbase qtx11extras ];
+
+  meta = with lib; {
+    description = "KDAB's Dock Widget Framework for Qt";
+    homepage = "https://www.kdab.com/development-resources/qt-tools/kddockwidgets";
+    license = with licenses; [ gpl2Only gpl3Only ];
+    maintainers = with maintainers; [ _1000teslas ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/attica.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/attica.nix
new file mode 100644
index 000000000000..8c71afd5dcf7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/attica.nix
@@ -0,0 +1,8 @@
+{ mkDerivation, extra-cmake-modules, qtbase }:
+
+mkDerivation {
+  name = "attica";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/baloo.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/baloo.nix
new file mode 100644
index 000000000000..7b092653a327
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/baloo.nix
@@ -0,0 +1,17 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  kauth, kconfig, kcoreaddons, kcrash, kdbusaddons, kfilemetadata, ki18n,
+  kidletime, kio, lmdb, qtbase, qtdeclarative, solid,
+}:
+
+mkDerivation {
+  name = "baloo";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [
+    kauth kconfig kcrash kdbusaddons ki18n kio kidletime lmdb qtdeclarative
+    solid
+  ];
+  outputs = [ "dev" "out" ];
+  propagatedBuildInputs = [ kcoreaddons kfilemetadata qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/bluez-qt.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/bluez-qt.nix
new file mode 100644
index 000000000000..c5764b4915ed
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/bluez-qt.nix
@@ -0,0 +1,15 @@
+{ mkDerivation
+, extra-cmake-modules
+, qtbase, qtdeclarative
+}:
+
+mkDerivation {
+  name = "bluez-qt";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ qtdeclarative ];
+  propagatedBuildInputs = [ qtbase ];
+  preConfigure = ''
+    substituteInPlace CMakeLists.txt \
+      --replace /lib/udev/rules.d "$bin/lib/udev/rules.d"
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/breeze-icons.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/breeze-icons.nix
new file mode 100644
index 000000000000..6e79a45ea921
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/breeze-icons.nix
@@ -0,0 +1,16 @@
+{ mkDerivation, extra-cmake-modules, gtk3, qtsvg, hicolor-icon-theme }:
+
+mkDerivation {
+  name = "breeze-icons";
+  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"
+    gtk-update-icon-cache "''${out:?}/share/icons/breeze-dark"
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/default.nix
new file mode 100644
index 000000000000..a5b0bfdae8de
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/default.nix
@@ -0,0 +1,196 @@
+/*
+
+# New packages
+
+READ THIS FIRST
+
+This module is for official packages in KDE Frameworks 5. All available packages
+are listed in `./srcs.nix`, although a few are not yet packaged in Nixpkgs (see
+below).
+
+IF YOUR PACKAGE IS NOT LISTED IN `./srcs.nix`, IT DOES NOT GO HERE.
+
+Many of the packages released upstream are not yet built in Nixpkgs due to lack
+of demand. To add a Nixpkgs build for an upstream package, copy one of the
+existing packages here and modify it as necessary.
+
+# Updates
+
+1. Update the URL in `./fetch.sh`.
+2. Run `./maintainers/scripts/fetch-kde-qt.sh pkgs/development/libraries/kde-frameworks`
+   from the top of the Nixpkgs tree.
+3. Use `nox-review wip` to check that everything builds.
+4. Commit the changes and open a pull request.
+
+*/
+
+{ libsForQt5, lib, fetchurl }:
+
+let
+
+  minQtVersion = "5.15";
+  broken = lib.versionOlder libsForQt5.qtbase.version minQtVersion;
+  maintainers = with lib.maintainers; [ ttuegel nyanloutre ];
+  license = with lib.licenses; [
+    lgpl21Plus lgpl3Plus bsd2 mit gpl2Plus gpl3Plus fdl12
+  ];
+
+  srcs = import ./srcs.nix {
+    inherit fetchurl;
+    mirror = "mirror://kde";
+  };
+
+  mkDerivation = libsForQt5.callPackage ({ mkDerivation }: mkDerivation) {};
+
+  packages = self: with self;
+    # SUPPORT
+    let
+
+      propagate = out:
+        let setupHook = { writeScript }:
+              writeScript "setup-hook" ''
+                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@"
+                    fi
+                fi
+              '';
+        in callPackage setupHook {};
+
+      propagateBin = propagate "bin";
+
+      callPackage = self.newScope {
+
+        inherit propagate propagateBin;
+
+        mkDerivation = args:
+          let
+
+            inherit (args) name;
+            inherit (srcs.${name}) src version;
+
+            outputs = args.outputs or [ "bin" "dev" "out" ];
+            hasSeparateDev = lib.elem "dev" outputs;
+
+            defaultSetupHook = if hasSeparateDev then propagateBin else null;
+            setupHook = args.setupHook or defaultSetupHook;
+
+            meta =
+              let meta = args.meta or {}; in
+              meta // {
+                homepage = meta.homepage or "http://www.kde.org";
+                license = meta.license or license;
+                maintainers = (meta.maintainers or []) ++ maintainers;
+                platforms = meta.platforms or lib.platforms.linux;
+                broken = meta.broken or broken;
+              };
+
+          in mkDerivation (args // {
+            name = "${name}-${version}";
+            inherit meta outputs setupHook src version;
+          });
+
+      };
+
+    in {
+      extra-cmake-modules = callPackage ./extra-cmake-modules {};
+
+    # TIER 1
+      attica = callPackage ./attica.nix {};
+      bluez-qt = callPackage ./bluez-qt.nix {};
+      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 {};
+      kcontacts = callPackage ./kcontacts.nix {};
+      kcoreaddons = callPackage ./kcoreaddons.nix {};
+      kdbusaddons = callPackage ./kdbusaddons.nix {};
+      kdnssd = callPackage ./kdnssd.nix {};
+      kguiaddons = callPackage ./kguiaddons.nix {};
+      kholidays = callPackage ./kholidays.nix {};
+      ki18n = callPackage ./ki18n.nix {};
+      kidletime = callPackage ./kidletime.nix {};
+      kirigami2 = callPackage ./kirigami2.nix {};
+      kitemmodels = callPackage ./kitemmodels.nix {};
+      kitemviews = callPackage ./kitemviews.nix {};
+      kplotting = callPackage ./kplotting.nix {};
+      kquickcharts = callPackage ./kquickcharts.nix {};
+      kwayland = callPackage ./kwayland.nix {};
+      kwidgetsaddons = callPackage ./kwidgetsaddons.nix {};
+      kwindowsystem = callPackage ./kwindowsystem {};
+      modemmanager-qt = callPackage ./modemmanager-qt.nix {};
+      networkmanager-qt = callPackage ./networkmanager-qt.nix {};
+      oxygen-icons5 = callPackage ./oxygen-icons5.nix {};
+      prison = callPackage ./prison.nix {};
+      qqc2-desktop-style = callPackage ./qqc2-desktop-style.nix {};
+      solid = callPackage ./solid.nix {};
+      sonnet = callPackage ./sonnet.nix {};
+      syntax-highlighting = callPackage ./syntax-highlighting.nix {};
+      threadweaver = callPackage ./threadweaver.nix {};
+
+    # TIER 2
+      kactivities = callPackage ./kactivities.nix {};
+      kactivities-stats = callPackage ./kactivities-stats.nix {};
+      kauth = callPackage ./kauth {};
+      kcompletion = callPackage ./kcompletion.nix {};
+      kcrash = callPackage ./kcrash.nix {};
+      kdoctools = callPackage ./kdoctools {};
+      kfilemetadata = callPackage ./kfilemetadata {};
+      kimageformats = callPackage ./kimageformats.nix {};
+      kjobwidgets = callPackage ./kjobwidgets.nix {};
+      knotifications = callPackage ./knotifications.nix {};
+      kpackage = callPackage ./kpackage {};
+      kpty = callPackage ./kpty.nix {};
+      kunitconversion = callPackage ./kunitconversion.nix {};
+      syndication = callPackage ./syndication.nix {};
+
+    # TIER 3
+      baloo = callPackage ./baloo.nix {};
+      kbookmarks = callPackage ./kbookmarks.nix {};
+      kcmutils = callPackage ./kcmutils {};
+      kconfigwidgets = callPackage ./kconfigwidgets {};
+      kdav = callPackage ./kdav.nix {};
+      kdeclarative = callPackage ./kdeclarative.nix {};
+      kded = callPackage ./kded.nix {};
+      kdesignerplugin = callPackage ./kdesignerplugin.nix {};
+      kdesu = callPackage ./kdesu {};
+      kdewebkit = callPackage ./kdewebkit.nix {};
+      kemoticons = callPackage ./kemoticons.nix {};
+      kglobalaccel = callPackage ./kglobalaccel.nix {};
+      kiconthemes = callPackage ./kiconthemes {};
+      kinit = callPackage ./kinit {};
+      kio = callPackage ./kio {};
+      knewstuff = callPackage ./knewstuff {};
+      knotifyconfig = callPackage ./knotifyconfig.nix {};
+      kparts = callPackage ./kparts.nix {};
+      kpeople = callPackage ./kpeople.nix {};
+      krunner = callPackage ./krunner.nix {};
+      kservice = callPackage ./kservice {};
+      ktexteditor = callPackage ./ktexteditor.nix {};
+      ktextwidgets = callPackage ./ktextwidgets.nix {};
+      kwallet = callPackage ./kwallet.nix {};
+      kxmlgui = callPackage ./kxmlgui.nix {};
+      kxmlrpcclient = callPackage ./kxmlrpcclient.nix {};
+      plasma-framework = callPackage ./plasma-framework.nix {};
+      kpurpose = callPackage ./purpose.nix {};
+
+    # TIER 4
+      frameworkintegration = callPackage ./frameworkintegration.nix {};
+
+    # PORTING AIDS
+      kdelibs4support = callPackage ./kdelibs4support {};
+      khtml = callPackage ./khtml.nix {};
+      kjs = callPackage ./kjs.nix {};
+      kjsembed = callPackage ./kjsembed.nix {};
+      kmediaplayer = callPackage ./kmediaplayer.nix {};
+      kross = callPackage ./kross.nix {};
+
+    };
+
+in lib.makeScope libsForQt5.newScope packages
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix
new file mode 100644
index 000000000000..b74fb29e5f2a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix
@@ -0,0 +1,21 @@
+{ mkDerivation, lib, cmake, pkg-config }:
+
+mkDerivation {
+  name = "extra-cmake-modules";
+
+  patches = [
+    ./nix-lib-path.patch
+  ];
+
+  outputs = [ "out" ];  # this package has no runtime components
+
+  propagatedBuildInputs = [ cmake pkg-config ];
+
+  setupHook = ./setup-hook.sh;
+
+  meta = with lib; {
+    platforms = platforms.linux ++ platforms.darwin;
+    homepage = "http://www.kde.org";
+    license = licenses.bsd2;
+  };
+}
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
new file mode 100644
index 000000000000..804fffc8fdcb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/nix-lib-path.patch
@@ -0,0 +1,40 @@
+diff --git a/kde-modules/KDEInstallDirs.cmake b/kde-modules/KDEInstallDirs.cmake
+index c1d056b..d9e19f0 100644
+--- a/kde-modules/KDEInstallDirs.cmake
++++ b/kde-modules/KDEInstallDirs.cmake
+@@ -242,35 +242,6 @@
+ # GNUInstallDirs code deals with re-configuring, but that is dealt with
+ # by the _define_* macros in this module).
+ set(_LIBDIR_DEFAULT "lib")
+-# Override this default 'lib' with 'lib64' if:
+-#  - we are on a Linux, kFreeBSD or Hurd system but NOT cross-compiling
+-#  - we are NOT on debian
+-#  - we are NOT on flatpak
+-#  - we are on a 64 bits system
+-# reason is: amd64 ABI: http://www.x86-64.org/documentation/abi.pdf
+-# For Debian with multiarch, use 'lib/${CMAKE_LIBRARY_ARCHITECTURE}' if
+-# CMAKE_LIBRARY_ARCHITECTURE is set (which contains e.g. "i386-linux-gnu"
+-# 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)
+-      set(_LIBDIR_DEFAULT "lib/${CMAKE_LIBRARY_ARCHITECTURE}")
+-    endif()
+-  else() # not debian, rely on CMAKE_SIZEOF_VOID_P:
+-    if(NOT DEFINED CMAKE_SIZEOF_VOID_P)
+-      message(AUTHOR_WARNING
+-        "Unable to determine default LIB_INSTALL_LIBDIR directory because no target architecture is known. "
+-        "Please enable at least one language before including KDEInstallDirs.")
+-    else()
+-      if("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
+-        set(_LIBDIR_DEFAULT "lib64")
+-      endif()
+-    endif()
+-  endif()
+-endif()
+ 
+ set(_gnu_install_dirs_vars
+     BINDIR
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
new file mode 100644
index 000000000000..4135f6bfd7aa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/setup-hook.sh
@@ -0,0 +1,112 @@
+ecmEnvHook() {
+    addToSearchPath XDG_DATA_DIRS "$1/share"
+    addToSearchPath XDG_CONFIG_DIRS "$1/etc/xdg"
+}
+addEnvHooks "$targetOffset" ecmEnvHook
+
+ecmPostHook() {
+    # Because we need to use absolute paths here, we must set *all* the paths.
+    cmakeFlags+=" -DKDE_INSTALL_EXECROOTDIR=${!outputBin}"
+    cmakeFlags+=" -DKDE_INSTALL_BINDIR=${!outputBin}/bin"
+    cmakeFlags+=" -DKDE_INSTALL_SBINDIR=${!outputBin}/sbin"
+    cmakeFlags+=" -DKDE_INSTALL_LIBDIR=${!outputLib}/lib"
+    cmakeFlags+=" -DKDE_INSTALL_LIBEXECDIR=${!outputLib}/libexec"
+    cmakeFlags+=" -DKDE_INSTALL_CMAKEPACKAGEDIR=${!outputDev}/lib/cmake"
+    cmakeFlags+=" -DKDE_INSTALL_INCLUDEDIR=${!outputInclude}/include"
+    cmakeFlags+=" -DKDE_INSTALL_LOCALSTATEDIR=/var"
+    cmakeFlags+=" -DKDE_INSTALL_DATAROOTDIR=${!outputBin}/share"
+    cmakeFlags+=" -DKDE_INSTALL_DATADIR=${!outputBin}/share"
+    cmakeFlags+=" -DKDE_INSTALL_DOCBUNDLEDIR=${!outputBin}/share/doc/HTML"
+    cmakeFlags+=" -DKDE_INSTALL_KCFGDIR=${!outputBin}/share/config.kcfg"
+    cmakeFlags+=" -DKDE_INSTALL_KCONFUPDATEDIR=${!outputBin}/share/kconf_update"
+    cmakeFlags+=" -DKDE_INSTALL_KSERVICES5DIR=${!outputBin}/share/kservices5"
+    cmakeFlags+=" -DKDE_INSTALL_KSERVICETYPES5DIR=${!outputBin}/share/kservicetypes5"
+    cmakeFlags+=" -DKDE_INSTALL_KXMLGUI5DIR=${!outputBin}/share/kxmlgui5"
+    cmakeFlags+=" -DKDE_INSTALL_KNOTIFY5RCDIR=${!outputBin}/share/knotifications5"
+    cmakeFlags+=" -DKDE_INSTALL_ICONDIR=${!outputBin}/share/icons"
+    cmakeFlags+=" -DKDE_INSTALL_LOCALEDIR=${!outputLib}/share/locale"
+    cmakeFlags+=" -DKDE_INSTALL_SOUNDDIR=${!outputBin}/share/sounds"
+    cmakeFlags+=" -DKDE_INSTALL_TEMPLATEDIR=${!outputBin}/share/templates"
+    cmakeFlags+=" -DKDE_INSTALL_WALLPAPERDIR=${!outputBin}/share/wallpapers"
+    cmakeFlags+=" -DKDE_INSTALL_APPDIR=${!outputBin}/share/applications"
+    cmakeFlags+=" -DKDE_INSTALL_DESKTOPDIR=${!outputBin}/share/desktop-directories"
+    cmakeFlags+=" -DKDE_INSTALL_MIMEDIR=${!outputBin}/share/mime/packages"
+    cmakeFlags+=" -DKDE_INSTALL_METAINFODIR=${!outputBin}/share/appdata"
+    cmakeFlags+=" -DKDE_INSTALL_MANDIR=${!outputBin}/share/man"
+    cmakeFlags+=" -DKDE_INSTALL_INFODIR=${!outputBin}/share/info"
+    cmakeFlags+=" -DKDE_INSTALL_DBUSDIR=${!outputBin}/share/dbus-1"
+    cmakeFlags+=" -DKDE_INSTALL_DBUSINTERFACEDIR=${!outputBin}/share/dbus-1/interfaces"
+    cmakeFlags+=" -DKDE_INSTALL_DBUSSERVICEDIR=${!outputBin}/share/dbus-1/services"
+    cmakeFlags+=" -DKDE_INSTALL_DBUSSYSTEMSERVICEDIR=${!outputBin}/share/dbus-1/system-services"
+    cmakeFlags+=" -DKDE_INSTALL_SYSCONFDIR=${!outputBin}/etc"
+    cmakeFlags+=" -DKDE_INSTALL_CONFDIR=${!outputBin}/etc/xdg"
+    cmakeFlags+=" -DKDE_INSTALL_AUTOSTARTDIR=${!outputBin}/etc/xdg/autostart"
+
+    if [ -n "${qtPluginPrefix-}" ]; then
+        cmakeFlags+=" -DKDE_INSTALL_QTPLUGINDIR=${!outputBin}/$qtPluginPrefix"
+        cmakeFlags+=" -DKDE_INSTALL_PLUGINDIR=${!outputBin}/$qtPluginPrefix"
+    fi
+
+    if [ -n "${qtQmlPrefix-}" ]; then
+        cmakeFlags+=" -DKDE_INSTALL_QMLDIR=${!outputBin}/$qtQmlPrefix"
+    fi
+}
+postHooks+=(ecmPostHook)
+
+xdgDataSubdirs=( \
+    "config.kcfg" "kconf_update" "kservices5" "kservicetypes5" \
+    "kxmlgui5" "knotifications5" "icons" "locale" "sounds" "templates" \
+    "wallpapers" "applications" "desktop-directories" "mime" "appdata" "dbus-1" \
+)
+
+ecmHostPathSeen=( )
+
+ecmUnseenHostPath() {
+    for pkg in "${ecmHostPathSeen[@]}"
+    do
+        if [ "${pkg:?}" == "$1" ]
+        then
+            return 1
+        fi
+    done
+
+    ecmHostPathSeen+=("$1")
+    return 0
+}
+
+ecmHostPathHook() {
+    ecmUnseenHostPath "$1" || return 0
+
+    local xdgConfigDir="$1/etc/xdg"
+    if [ -d "$xdgConfigDir" ]
+    then
+        qtWrapperArgs+=(--prefix XDG_CONFIG_DIRS : "$xdgConfigDir")
+    fi
+
+    for xdgDataSubdir in "${xdgDataSubdirs[@]}"
+    do
+        if [ -d "$1/share/$xdgDataSubdir" ]
+        then
+            qtWrapperArgs+=(--prefix XDG_DATA_DIRS : "$1/share")
+            break
+        fi
+    done
+
+    local manDir="$1/man"
+    if [ -d "$manDir" ]
+    then
+        qtWrapperArgs+=(--prefix MANPATH : "$manDir")
+    fi
+
+    local infoDir="$1/info"
+    if [ -d "$infoDir" ]
+    then
+        qtWrapperArgs+=(--prefix INFOPATH : "$infoDir")
+    fi
+
+    if [ -d "$1/dbus-1" ]
+    then
+        propagatedUserEnvPkgs+=" $1"
+    fi
+}
+addEnvHooks "$targetOffset" ecmHostPathHook
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/fetch.sh b/nixpkgs/pkgs/development/libraries/kde-frameworks/fetch.sh
new file mode 100644
index 000000000000..93d7cbef74c3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/fetch.sh
@@ -0,0 +1 @@
+WGET_ARGS=( https://download.kde.org/stable/frameworks/5.84/ -A '*.tar.xz' )
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/frameworkintegration.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/frameworkintegration.nix
new file mode 100644
index 000000000000..c49eab2763c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/frameworkintegration.nix
@@ -0,0 +1,16 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  kbookmarks, kcompletion, kconfig, kconfigwidgets, ki18n, kiconthemes, kio,
+  knewstuff, knotifications, kpackage, kwidgetsaddons, libXcursor, qtx11extras
+}:
+
+mkDerivation {
+  name = "frameworkintegration";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [
+    kbookmarks kcompletion kconfig ki18n kio knewstuff knotifications kpackage
+    kwidgetsaddons libXcursor qtx11extras
+  ];
+  propagatedBuildInputs = [ kconfigwidgets kiconthemes ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kactivities-stats.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kactivities-stats.nix
new file mode 100644
index 000000000000..88fde8c5fd6d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kactivities-stats.nix
@@ -0,0 +1,13 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  boost, kactivities, kconfig, qtbase,
+}:
+
+mkDerivation {
+  name = "kactivities-stats";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ boost kactivities kconfig ];
+  propagatedBuildInputs = [ qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kactivities.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kactivities.nix
new file mode 100644
index 000000000000..b53de41455ad
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kactivities.nix
@@ -0,0 +1,14 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  boost, kconfig, kcoreaddons, kio, kwindowsystem, qtbase, qtdeclarative,
+}:
+
+mkDerivation {
+  name = "kactivities";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [
+    boost kconfig kcoreaddons kio kwindowsystem qtdeclarative
+  ];
+  propagatedBuildInputs = [ qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kapidox.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kapidox.nix
new file mode 100644
index 000000000000..381dacaf4961
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kapidox.nix
@@ -0,0 +1,9 @@
+{ mkDerivation, lib, extra-cmake-modules, python3 }:
+
+mkDerivation {
+  name = "kapidox";
+  nativeBuildInputs = [ extra-cmake-modules python3 python3.pkgs.setuptools ];
+  postFixup = ''
+    moveToOutput bin $bin
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/karchive.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/karchive.nix
new file mode 100644
index 000000000000..3602cb7b0617
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/karchive.nix
@@ -0,0 +1,13 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  bzip2, xz, qtbase, zlib,
+}:
+
+mkDerivation {
+  name = "karchive";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ bzip2 xz zlib ];
+  propagatedBuildInputs = [ qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kauth/cmake-install-paths.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kauth/cmake-install-paths.patch
new file mode 100644
index 000000000000..c66f5ecd008f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kauth/cmake-install-paths.patch
@@ -0,0 +1,17 @@
+Index: kauth-5.18.0/KF5AuthConfig.cmake.in
+===================================================================
+--- kauth-5.18.0.orig/KF5AuthConfig.cmake.in
++++ kauth-5.18.0/KF5AuthConfig.cmake.in
+@@ -4,9 +4,9 @@ set(KAUTH_STUB_FILES_DIR "@PACKAGE_KDE_I
+ 
+ set(KAUTH_BACKEND_NAME "@KAUTH_BACKEND_NAME@")
+ set(KAUTH_HELPER_BACKEND_NAME "@KAUTH_HELPER_BACKEND_NAME@")
+-set(KAUTH_POLICY_FILES_INSTALL_DIR "@KAUTH_POLICY_FILES_INSTALL_DIR@")
+-set(KAUTH_HELPER_INSTALL_DIR "@KAUTH_HELPER_INSTALL_DIR@")
+-set(KAUTH_HELPER_INSTALL_ABSOLUTE_DIR "@KAUTH_HELPER_INSTALL_ABSOLUTE_DIR@")
++set(KAUTH_POLICY_FILES_INSTALL_DIR "${KDE_INSTALL_DATADIR}/polkit-1/actions")
++set(KAUTH_HELPER_INSTALL_DIR "${KDE_INSTALL_LIBEXECDIR}")
++set(KAUTH_HELPER_INSTALL_ABSOLUTE_DIR "${KDE_INSTALL_LIBEXECDIR}")
+ 
+ find_dependency(KF5CoreAddons "@KF5_DEP_VERSION@")
+ 
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kauth/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kauth/default.nix
new file mode 100644
index 000000000000..630b51bf46ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kauth/default.nix
@@ -0,0 +1,18 @@
+{
+  mkDerivation, propagate,
+  extra-cmake-modules, kcoreaddons, polkit-qt, qttools
+}:
+
+mkDerivation {
+  name = "kauth";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ polkit-qt qttools ];
+  propagatedBuildInputs = [ kcoreaddons ];
+  patches = [
+    ./cmake-install-paths.patch
+  ];
+  # library stores reference to plugin path,
+  # separating $out from $bin would create a reference cycle
+  outputs = [ "out" "dev" ];
+  setupHook = propagate "out";
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kbookmarks.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kbookmarks.nix
new file mode 100644
index 000000000000..4d68c3694bd3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kbookmarks.nix
@@ -0,0 +1,16 @@
+{
+  mkDerivation,
+  extra-cmake-modules, qttools,
+  kcodecs, kconfig, kconfigwidgets, kcoreaddons, kiconthemes, kwidgetsaddons,
+  kxmlgui, qtbase,
+}:
+
+mkDerivation {
+  name = "kbookmarks";
+  nativeBuildInputs = [ extra-cmake-modules qttools ];
+  buildInputs = [
+    kcodecs kconfig kconfigwidgets kcoreaddons kiconthemes kxmlgui
+  ];
+  propagatedBuildInputs = [ kwidgetsaddons qtbase ];
+  outputs = [ "out" "dev" ];
+}
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..f4f2b05ad736
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kcalendarcore.nix
@@ -0,0 +1,13 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  libical,
+  qtbase
+}:
+
+mkDerivation {
+  name = "kcalendarcore";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  propagatedBuildInputs = [ libical ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kcmutils/0001-kcmutils-follow-symlinks.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kcmutils/0001-kcmutils-follow-symlinks.patch
new file mode 100644
index 000000000000..32adca6d2e05
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kcmutils/0001-kcmutils-follow-symlinks.patch
@@ -0,0 +1,25 @@
+From 4d5dcc309fba688aa1db8dd915a0abdf07f61e81 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Mon, 13 Jul 2020 11:23:36 -0500
+Subject: [PATCH] kcmutils follow symlinks
+
+---
+ src/kpluginselector.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/kpluginselector.cpp b/src/kpluginselector.cpp
+index 46deef5..2eacb9f 100644
+--- a/src/kpluginselector.cpp
++++ b/src/kpluginselector.cpp
+@@ -309,7 +309,7 @@ void KPluginSelector::addPlugins(const QString &componentName,
+     QStringList desktopFileNames;
+     const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, componentName + QStringLiteral("/kpartplugins"), QStandardPaths::LocateDirectory);
+     for (const QString &dir : dirs) {
+-        QDirIterator it(dir, QStringList() << QStringLiteral("*.desktop"), QDir::NoFilter, QDirIterator::Subdirectories);
++        QDirIterator it(dir, QStringList() << QStringLiteral("*.desktop"), QDir::NoFilter, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks);
+         while (it.hasNext()) {
+             desktopFileNames.append(it.next());
+         }
+-- 
+2.25.4
+
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kcmutils/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kcmutils/default.nix
new file mode 100644
index 000000000000..22e2929ae0cb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kcmutils/default.nix
@@ -0,0 +1,19 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  kconfigwidgets, kcoreaddons, kdeclarative, ki18n, kiconthemes, kitemviews,
+  kpackage, kservice, kxmlgui, qtdeclarative,
+}:
+
+mkDerivation {
+  name = "kcmutils";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [
+    kcoreaddons kdeclarative ki18n kiconthemes kitemviews kpackage kxmlgui
+    qtdeclarative
+  ];
+  propagatedBuildInputs = [ kconfigwidgets kservice ];
+  patches = [
+    ./0001-kcmutils-follow-symlinks.patch
+  ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kcodecs.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kcodecs.nix
new file mode 100644
index 000000000000..a62135150a0f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kcodecs.nix
@@ -0,0 +1,9 @@
+{ mkDerivation, extra-cmake-modules, qtbase, qttools, gperf }:
+
+mkDerivation {
+  name = "kcodecs";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ qttools gperf ];
+  propagatedBuildInputs = [ qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kcompletion.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kcompletion.nix
new file mode 100644
index 000000000000..ffa612ffaa19
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kcompletion.nix
@@ -0,0 +1,13 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  kconfig, kwidgetsaddons, qtbase, qttools
+}:
+
+mkDerivation {
+  name = "kcompletion";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ kconfig kwidgetsaddons qttools ];
+  propagatedBuildInputs = [ qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kconfig.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kconfig.nix
new file mode 100644
index 000000000000..ba16e97ef3a6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kconfig.nix
@@ -0,0 +1,8 @@
+{ mkDerivation, extra-cmake-modules, qtbase, qttools }:
+
+mkDerivation {
+  name = "kconfig";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ qttools ];
+  propagatedBuildInputs = [ qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kconfigwidgets/0001-QDirIterator-follow-symlinks.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kconfigwidgets/0001-QDirIterator-follow-symlinks.patch
new file mode 100644
index 000000000000..30cfafafab97
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kconfigwidgets/0001-QDirIterator-follow-symlinks.patch
@@ -0,0 +1,25 @@
+From 05c0eb5d803ac52c0dd97a98f6d2821650c3c14c Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Sun, 28 Mar 2021 06:09:47 -0500
+Subject: [PATCH] QDirIterator follow symlinks
+
+---
+ src/khelpclient.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/khelpclient.cpp b/src/khelpclient.cpp
+index a053cd7..787d375 100644
+--- a/src/khelpclient.cpp
++++ b/src/khelpclient.cpp
+@@ -34,7 +34,7 @@ void KHelpClient::invokeHelp(const QString &anchor, const QString &_appname)
+     QString docPath;
+     const QStringList desktopDirs = QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation);
+     for (const QString &dir : desktopDirs) {
+-        QDirIterator it(dir, QStringList() << appname + QLatin1String(".desktop"), QDir::NoFilter, QDirIterator::Subdirectories);
++        QDirIterator it(dir, QStringList() << appname + QLatin1String(".desktop"), QDir::NoFilter, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks);
+         while (it.hasNext()) {
+             const QString desktopPath(it.next());
+             KDesktopFile desktopFile(desktopPath);
+-- 
+2.30.1
+
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kconfigwidgets/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kconfigwidgets/default.nix
new file mode 100644
index 000000000000..fc10f3070b64
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kconfigwidgets/default.nix
@@ -0,0 +1,17 @@
+{
+  mkDerivation, extra-cmake-modules,
+  kauth, kcodecs, kconfig, kdoctools, kguiaddons, ki18n, kwidgetsaddons, qttools, qtbase,
+}:
+
+mkDerivation {
+  name = "kconfigwidgets";
+  nativeBuildInputs = [ extra-cmake-modules kdoctools ];
+  buildInputs = [ kguiaddons ki18n qtbase qttools ];
+  propagatedBuildInputs = [ kauth kcodecs kconfig kwidgetsaddons ];
+  patches = [ ./0001-QDirIterator-follow-symlinks.patch ];
+  outputs = [ "out" "dev" ];
+  outputBin = "dev";
+  postInstall = ''
+    moveToOutput ''${qtPluginPrefix:?}/designer/kconfigwidgets5widgets.so "$out"
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kcontacts.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kcontacts.nix
new file mode 100644
index 000000000000..74b6652aee2a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kcontacts.nix
@@ -0,0 +1,15 @@
+{
+  mkDerivation, lib,
+  extra-cmake-modules,
+  kcoreaddons, kconfig, kcodecs, ki18n, qtbase,
+}:
+
+mkDerivation {
+  name = "kcontacts";
+  meta = {
+    license = [ lib.licenses.lgpl21 ];
+  };
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ kcoreaddons kconfig kcodecs ki18n qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kcoreaddons.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kcoreaddons.nix
new file mode 100644
index 000000000000..a2102c7d7323
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kcoreaddons.nix
@@ -0,0 +1,12 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  qtbase, qttools, shared-mime-info
+}:
+
+mkDerivation {
+  name = "kcoreaddons";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ qttools shared-mime-info ];
+  propagatedBuildInputs = [ qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kcrash.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kcrash.nix
new file mode 100644
index 000000000000..27dc6d65edff
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kcrash.nix
@@ -0,0 +1,13 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  kcoreaddons, kwindowsystem, qtbase, qtx11extras,
+}:
+
+mkDerivation {
+  name = "kcrash";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ kcoreaddons kwindowsystem qtx11extras ];
+  propagatedBuildInputs = [ qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kdav.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdav.nix
new file mode 100644
index 000000000000..a03cca3fdf26
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdav.nix
@@ -0,0 +1,15 @@
+{
+  mkDerivation, lib,
+  extra-cmake-modules, kdoctools,
+  kcoreaddons, kio, qtxmlpatterns,
+}:
+
+mkDerivation {
+  name = "kdav";
+  meta = {
+    license = with lib.licenses; [ gpl2 lgpl21 fdl12 ];
+  };
+  nativeBuildInputs = [ extra-cmake-modules kdoctools ];
+  buildInputs = [ kcoreaddons kio qtxmlpatterns ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kdbusaddons.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdbusaddons.nix
new file mode 100644
index 000000000000..5c435b445414
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdbusaddons.nix
@@ -0,0 +1,12 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  qtbase, qttools, qtx11extras
+}:
+
+mkDerivation {
+  name = "kdbusaddons";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ qttools qtx11extras ];
+  propagatedBuildInputs = [ qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kdeclarative.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdeclarative.nix
new file mode 100644
index 000000000000..cc4e26998212
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdeclarative.nix
@@ -0,0 +1,15 @@
+{
+  mkDerivation, extra-cmake-modules,
+  epoxy, kconfig, kglobalaccel, kguiaddons, ki18n, kiconthemes, kio, kpackage,
+  kwidgetsaddons, kwindowsystem, qtdeclarative
+}:
+
+mkDerivation {
+  name = "kdeclarative";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [
+    epoxy kglobalaccel kguiaddons ki18n kiconthemes kio kwidgetsaddons
+    kwindowsystem
+  ];
+  propagatedBuildInputs = [ kconfig kpackage qtdeclarative ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kded.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kded.nix
new file mode 100644
index 000000000000..936119ab7f5c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kded.nix
@@ -0,0 +1,21 @@
+{
+  mkDerivation, propagate, wrapGAppsHook,
+  extra-cmake-modules, kdoctools,
+  gsettings-desktop-schemas, kconfig, kcoreaddons, kcrash, kdbusaddons, kinit,
+  kservice, qtbase,
+}:
+
+mkDerivation {
+  name = "kded";
+  nativeBuildInputs = [ extra-cmake-modules kdoctools wrapGAppsHook ];
+  buildInputs = [
+    gsettings-desktop-schemas kconfig kcoreaddons kcrash kdbusaddons kinit
+    kservice qtbase
+  ];
+  outputs = [ "out" "dev" ];
+  setupHook = propagate "out";
+  dontWrapGApps = true;
+  preFixup = ''
+    qtWrapperArgs+=("''${gappsWrapperArgs[@]}")
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kdelibs4support/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdelibs4support/default.nix
new file mode 100644
index 000000000000..392aa9ea9025
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdelibs4support/default.nix
@@ -0,0 +1,33 @@
+{
+  mkDerivation,
+  docbook_xml_dtd_45, extra-cmake-modules, kdoctools,
+  kauth, karchive, kcompletion, kconfig, kconfigwidgets, kcoreaddons, kcrash,
+  kdbusaddons, kded, kdesignerplugin, kemoticons, kglobalaccel, kguiaddons,
+  ki18n, kiconthemes, kio, kitemmodels, kinit, knotifications, kparts, kservice,
+  ktextwidgets, kunitconversion, kwidgetsaddons, kwindowsystem, kxmlgui,
+  networkmanager, qtbase, qtsvg, qttools, qtx11extras, xorg
+}:
+
+mkDerivation {
+  name = "kdelibs4support";
+  patches = [
+    ./nix-kde-include-dir.patch
+  ];
+  setupHook = ./setup-hook.sh;
+  nativeBuildInputs = [ extra-cmake-modules qttools ];
+  propagatedNativeBuildInputs = [ kdoctools ];
+  buildInputs = [
+    kcompletion kconfig kded kglobalaccel ki18n kio kservice kwidgetsaddons
+    kxmlgui networkmanager qtsvg qtx11extras xorg.libSM
+  ];
+  propagatedBuildInputs = [
+    kauth karchive kconfigwidgets kcoreaddons kcrash kdbusaddons kdesignerplugin
+    kemoticons kguiaddons kiconthemes kitemmodels kinit knotifications kparts
+    ktextwidgets kunitconversion kwindowsystem qtbase
+  ];
+  cmakeFlags = [
+    "-DDocBookXML4_DTD_DIR=${docbook_xml_dtd_45}/xml/dtd/docbook"
+    "-DDocBookXML4_DTD_VERSION=4.5"
+  ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kdelibs4support/nix-kde-include-dir.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdelibs4support/nix-kde-include-dir.patch
new file mode 100644
index 000000000000..eabb70254483
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdelibs4support/nix-kde-include-dir.patch
@@ -0,0 +1,13 @@
+Index: kdelibs4support-5.18.0/src/kdecore/kstandarddirs.cpp
+===================================================================
+--- kdelibs4support-5.18.0.orig/src/kdecore/kstandarddirs.cpp
++++ kdelibs4support-5.18.0/src/kdecore/kstandarddirs.cpp
+@@ -292,7 +292,7 @@ static QString relativeInstallPath(const
+             return QFile::decodeName(ICON_INSTALL_DIR "/");
+         }
+         if (strcmp("include", type) == 0) {
+-            return QFile::decodeName(INCLUDE_INSTALL_DIR "/");
++            return QFile::decodeName(qgetenv("NIX_KDE_INCLUDE_DIR"));
+         }
+         break;
+     case 'l':
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kdelibs4support/setup-hook.sh b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdelibs4support/setup-hook.sh
new file mode 100644
index 000000000000..21ac2e83b5da
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdelibs4support/setup-hook.sh
@@ -0,0 +1 @@
+export NIX_KDE_INCLUDE_DIR="@dev@/include/"  # trailing slash is required!
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kdesignerplugin.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdesignerplugin.nix
new file mode 100644
index 000000000000..f1305274070f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdesignerplugin.nix
@@ -0,0 +1,16 @@
+{
+  mkDerivation,
+  extra-cmake-modules, kdoctools,
+  kcompletion, kconfig, kconfigwidgets, kcoreaddons, kiconthemes, kio,
+  kitemviews, kplotting, ktextwidgets, kwidgetsaddons, kxmlgui, qttools, sonnet,
+}:
+
+mkDerivation {
+  name = "kdesignerplugin";
+  nativeBuildInputs = [ extra-cmake-modules kdoctools ];
+  buildInputs = [
+    kcompletion kconfig kconfigwidgets kcoreaddons kiconthemes kio kitemviews
+    kplotting ktextwidgets kwidgetsaddons kxmlgui sonnet
+  ];
+  propagatedBuildInputs = [ qttools ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kdesu/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdesu/default.nix
new file mode 100644
index 000000000000..9a5f5a6942a8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdesu/default.nix
@@ -0,0 +1,14 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  kcoreaddons, ki18n, kpty, kservice, qtbase,
+}:
+
+mkDerivation {
+  name = "kdesu";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ kcoreaddons ki18n kpty kservice qtbase ];
+  propagatedBuildInputs = [ kpty ];
+  outputs = [ "out" "dev" ];
+  patches = [ ./kdesu-search-for-wrapped-daemon-first.patch ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kdesu/kdesu-search-for-wrapped-daemon-first.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdesu/kdesu-search-for-wrapped-daemon-first.patch
new file mode 100644
index 000000000000..07da70092dc6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdesu/kdesu-search-for-wrapped-daemon-first.patch
@@ -0,0 +1,38 @@
+From 01af4d2a098e5819c09bca37568941dcd4b89d0b Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Jos=C3=A9=20Romildo=20Malaquias?= <malaquias@gmail.com>
+Date: Thu, 16 Jul 2020 13:21:42 -0300
+Subject: [PATCH] Search for the daemon first in /run/wrappers/bin
+
+If looking first in libexec, the eventually wrapped one in
+/run/wrappers/bin can not be found.
+---
+ src/client.cpp | 13 ++++++++-----
+ 1 file changed, 8 insertions(+), 5 deletions(-)
+
+diff --git a/src/client.cpp b/src/client.cpp
+index 44fbacd..6b5abf5 100644
+--- a/src/client.cpp
++++ b/src/client.cpp
+@@ -378,11 +378,14 @@ int KDEsuClient::stopServer()
+ 
+ static QString findDaemon()
+ {
+-    QString daemon = QFile::decodeName(KDE_INSTALL_FULL_LIBEXECDIR_KF5 "/kdesud");
+-    if (!QFile::exists(daemon)) { // if not in libexec, find it in PATH
+-        daemon = QStandardPaths::findExecutable(QStringLiteral("kdesud"));
+-        if (daemon.isEmpty()) {
+-            qCWarning(KSU_LOG) << "kdesud daemon not found.";
++    QString daemon = QFile::decodeName("/run/wrappers/bin/kdesud");
++    if (!QFile::exists(daemon)) { // if not in wrappers
++        daemon = QFile::decodeName(KDE_INSTALL_FULL_LIBEXECDIR_KF5 "/kdesud");
++        if (!QFile::exists(daemon)) { // if not in libexec, find it in PATH
++            daemon = QStandardPaths::findExecutable(QStringLiteral("kdesud"));
++            if (daemon.isEmpty()) {
++                qCWarning(KSU_LOG) << "kdesud daemon not found.";
++            }
+         }
+     }
+     return daemon;
+-- 
+2.27.0
+
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kdewebkit.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdewebkit.nix
new file mode 100644
index 000000000000..9f682b449752
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdewebkit.nix
@@ -0,0 +1,14 @@
+{ mkDerivation, extra-cmake-modules
+, kconfig, kcoreaddons, kio, kparts, qtwebkit
+}:
+
+mkDerivation {
+  name = "kdewebkit";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ kconfig kcoreaddons kio kparts ];
+  propagatedBuildInputs = [ qtwebkit ];
+  outputs = [ "out" "dev" ];
+  cmakeFlags = [
+    "-DBUILD_DESIGNERPLUGIN=OFF"
+  ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kdnssd.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdnssd.nix
new file mode 100644
index 000000000000..8bb59bb36dba
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdnssd.nix
@@ -0,0 +1,13 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  avahi, qtbase, qttools,
+}:
+
+mkDerivation {
+  name = "kdnssd";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ avahi qttools ];
+  propagatedBuildInputs = [ qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kdoctools/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdoctools/default.nix
new file mode 100644
index 000000000000..a87bef40b1e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdoctools/default.nix
@@ -0,0 +1,32 @@
+{
+  mkDerivation,
+  extra-cmake-modules, docbook_xml_dtd_45, docbook_xsl_ns,
+  karchive, ki18n, qtbase,
+  perl, perlPackages
+}:
+
+mkDerivation {
+  name = "kdoctools";
+  nativeBuildInputs = [
+    extra-cmake-modules
+    # The build system insists on having native Perl.
+    perl perlPackages.URI
+  ];
+  propagatedBuildInputs = [
+    # kdoctools at runtime actually needs Perl for the platform kdoctools is
+    # running on, not necessarily native perl.
+    perl perlPackages.URI
+    qtbase
+  ];
+  buildInputs = [ karchive ki18n ];
+  outputs = [ "out" "dev" ];
+  patches = [ ./kdoctools-no-find-docbook-xml.patch ];
+  cmakeFlags = [
+    "-DDocBookXML4_DTD_DIR=${docbook_xml_dtd_45}/xml/dtd/docbook"
+    "-DDocBookXSL_DIR=${docbook_xsl_ns}/xml/xsl/docbook"
+  ];
+  postFixup = ''
+    moveToOutput "share/doc" "$dev"
+    moveToOutput "share/man" "$dev"
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kdoctools/kdoctools-no-find-docbook-xml.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdoctools/kdoctools-no-find-docbook-xml.patch
new file mode 100644
index 000000000000..4e3a33efab32
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdoctools/kdoctools-no-find-docbook-xml.patch
@@ -0,0 +1,12 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 5c4863c..f731775 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -46,7 +46,6 @@ set_package_properties(LibXml2 PROPERTIES
+                       )
+ 
+ 
+-find_package(DocBookXML4 "4.5")
+ 
+ set_package_properties(DocBookXML4 PROPERTIES
+                        TYPE REQUIRED
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh
new file mode 100644
index 000000000000..2928d9b34dbe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kdoctools/setup-hook.sh
@@ -0,0 +1,5 @@
+addXdgData() {
+    addToSearchPath XDG_DATA_DIRS "$1/share"
+}
+
+addEnvHooks "$targetOffset" addXdgData
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kemoticons.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kemoticons.nix
new file mode 100644
index 000000000000..66a0889b13d2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kemoticons.nix
@@ -0,0 +1,12 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  karchive, kcoreaddons, kservice, qtbase,
+}:
+
+mkDerivation {
+  name = "kemoticons";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ karchive kcoreaddons ];
+  propagatedBuildInputs = [ kservice qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kfilemetadata/cmake-install-paths.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kfilemetadata/cmake-install-paths.patch
new file mode 100644
index 000000000000..daeaf222b630
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kfilemetadata/cmake-install-paths.patch
@@ -0,0 +1,13 @@
+Index: kfilemetadata-5.18.0/src/CMakeLists.txt
+===================================================================
+--- kfilemetadata-5.18.0.orig/src/CMakeLists.txt
++++ kfilemetadata-5.18.0/src/CMakeLists.txt
+@@ -49,7 +49,7 @@ install(TARGETS KF5FileMetaData EXPORT K
+ 
+ install(EXPORT KF5FileMetaDataTargets
+         NAMESPACE KF5::
+-        DESTINATION ${KDE_INSTALL_LIBDIR}/cmake/KF5FileMetaData
++        DESTINATION ${KDE_INSTALL_FULL_CMAKEPACKAGEDIR}/KF5FileMetaData
+         FILE KF5FileMetaDataTargets.cmake)
+ 
+ install(FILES
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kfilemetadata/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kfilemetadata/default.nix
new file mode 100644
index 000000000000..7c16dcf46507
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kfilemetadata/default.nix
@@ -0,0 +1,36 @@
+{ mkDerivation
+, lib
+, extra-cmake-modules
+, attr
+, ebook_tools
+, exiv2
+, ffmpeg
+, karchive
+, kcoreaddons
+, ki18n
+, poppler
+, qtbase
+, qtmultimedia
+, taglib
+}:
+
+mkDerivation {
+  name = "kfilemetadata";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [
+    attr
+    ebook_tools
+    exiv2
+    ffmpeg
+    karchive
+    kcoreaddons
+    ki18n
+    poppler
+    qtbase
+    qtmultimedia
+    taglib
+  ];
+  patches = [
+    ./cmake-install-paths.patch
+  ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kglobalaccel.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kglobalaccel.nix
new file mode 100644
index 000000000000..7001c98ee00f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kglobalaccel.nix
@@ -0,0 +1,17 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  kconfig, kcoreaddons, kcrash, kdbusaddons, kservice, kwindowsystem,
+  qtbase, qttools, qtx11extras, libXdmcp,
+}:
+
+mkDerivation {
+  name = "kglobalaccel";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [
+    kconfig kcoreaddons kcrash kdbusaddons kservice kwindowsystem qttools
+    qtx11extras libXdmcp
+  ];
+  outputs = [ "out" "dev" ];
+  propagatedBuildInputs = [ qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kguiaddons.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kguiaddons.nix
new file mode 100644
index 000000000000..bcd18ab614b6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kguiaddons.nix
@@ -0,0 +1,14 @@
+{ mkDerivation
+, extra-cmake-modules
+, qtbase, qtx11extras, wayland
+}:
+
+mkDerivation {
+  name = "kguiaddons";
+
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ qtx11extras wayland ];
+  propagatedBuildInputs = [ qtbase ];
+
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kholidays.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kholidays.nix
new file mode 100644
index 000000000000..2ede69e74953
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kholidays.nix
@@ -0,0 +1,16 @@
+{
+  mkDerivation, lib,
+  extra-cmake-modules, kdoctools,
+  qtbase, qtdeclarative, qttools,
+}:
+
+mkDerivation {
+  name = "kholidays";
+  meta = {
+    license = with lib.licenses; [ gpl2 lgpl21 fdl12 ];
+    maintainers = with lib.maintainers; [ bkchr ];
+  };
+  nativeBuildInputs = [ extra-cmake-modules kdoctools ];
+  buildInputs = [ qtbase qtdeclarative qttools ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/khtml.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/khtml.nix
new file mode 100644
index 000000000000..3ef3a043c4e1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/khtml.nix
@@ -0,0 +1,18 @@
+{
+  mkDerivation,
+  extra-cmake-modules, perl,
+  giflib, karchive, kcodecs, kglobalaccel, ki18n, kiconthemes, kio, kjs,
+  knotifications, kparts, ktextwidgets, kwallet, kwidgetsaddons, kwindowsystem,
+  kxmlgui, phonon, qtx11extras, sonnet, gperf
+}:
+
+mkDerivation {
+  name = "khtml";
+  nativeBuildInputs = [ extra-cmake-modules perl ];
+  buildInputs = [
+    giflib karchive kcodecs kglobalaccel ki18n kiconthemes kio knotifications
+    kparts ktextwidgets kwallet kwidgetsaddons kwindowsystem kxmlgui phonon
+    qtx11extras sonnet gperf
+  ];
+  propagatedBuildInputs = [ kjs ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/ki18n.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/ki18n.nix
new file mode 100644
index 000000000000..46f502d06bb4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/ki18n.nix
@@ -0,0 +1,12 @@
+{
+  mkDerivation,
+  extra-cmake-modules, gettext, python3,
+  qtbase, qtdeclarative, qtscript,
+}:
+
+mkDerivation {
+  name = "ki18n";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  propagatedNativeBuildInputs = [ gettext python3 ];
+  buildInputs = [ qtdeclarative qtscript ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kiconthemes/default-theme-breeze.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kiconthemes/default-theme-breeze.patch
new file mode 100644
index 000000000000..f7cb0ea3aacc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kiconthemes/default-theme-breeze.patch
@@ -0,0 +1,13 @@
+Index: kiconthemes-5.17.0/src/kicontheme.cpp
+===================================================================
+--- kiconthemes-5.17.0.orig/src/kicontheme.cpp
++++ kiconthemes-5.17.0/src/kicontheme.cpp
+@@ -557,7 +557,7 @@ void KIconTheme::reconfigure()
+ // static
+ QString KIconTheme::defaultThemeName()
+ {
+-    return QStringLiteral("hicolor");
++    return QStringLiteral("breeze");
+ }
+ 
+ void KIconTheme::assignIconsToContextMenu(ContextMenus type,
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kiconthemes/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kiconthemes/default.nix
new file mode 100644
index 000000000000..122f3108da44
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kiconthemes/default.nix
@@ -0,0 +1,18 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  breeze-icons, karchive, kcoreaddons, kconfigwidgets, ki18n, kitemviews,
+  qtbase, qtsvg, qttools,
+}:
+
+mkDerivation {
+  name = "kiconthemes";
+  patches = [
+    ./default-theme-breeze.patch
+  ];
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [
+    breeze-icons karchive kcoreaddons kconfigwidgets ki18n kitemviews
+  ];
+  propagatedBuildInputs = [ qtbase qtsvg qttools ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kidletime.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kidletime.nix
new file mode 100644
index 000000000000..2678cf0804eb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kidletime.nix
@@ -0,0 +1,12 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  qtbase, qtx11extras
+}:
+
+mkDerivation {
+  name = "kidletime";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ qtx11extras ];
+  propagatedBuildInputs = [ qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kimageformats.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kimageformats.nix
new file mode 100644
index 000000000000..97b413e805c6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kimageformats.nix
@@ -0,0 +1,20 @@
+{
+  mkDerivation, lib,
+  extra-cmake-modules,
+  ilmbase, karchive, openexr, libavif, qtbase
+}:
+
+let inherit (lib) getDev; in
+
+mkDerivation {
+  name = "kimageformats";
+
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ karchive openexr libavif qtbase ];
+  outputs = [ "out" ]; # plugins only
+  CXXFLAGS = "-I${getDev ilmbase}/include/OpenEXR";
+
+  meta = with lib; {
+    broken = versionOlder qtbase.version "5.14";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/0001-kinit-libpath.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/0001-kinit-libpath.patch
new file mode 100644
index 000000000000..a3e4014df509
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/0001-kinit-libpath.patch
@@ -0,0 +1,45 @@
+From 715c5f461b4992dac066601202a673bc551a5e33 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Sun, 16 Feb 2020 14:23:31 -0600
+Subject: [PATCH 1/4] kinit-libpath
+
+---
+ src/kdeinit/kinit.cpp | 22 +++++++++-------------
+ 1 file changed, 9 insertions(+), 13 deletions(-)
+
+diff --git a/src/kdeinit/kinit.cpp b/src/kdeinit/kinit.cpp
+index 8fff17a..0801b75 100644
+--- a/src/kdeinit/kinit.cpp
++++ b/src/kdeinit/kinit.cpp
+@@ -622,19 +622,15 @@ static pid_t launch(int argc, const char *_name, const char *args,
+ 
+         if (!libpath.isEmpty()) {
+             if (libpath_relative) {
+-                // NB: Because Qt makes the actual dlopen() call, the
+-                //     RUNPATH of kdeinit is *not* respected - see
+-                //     https://sourceware.org/bugzilla/show_bug.cgi?id=13945
+-                //     - so we try hacking it in ourselves
+-                QString install_lib_dir = QFile::decodeName(
+-                        CMAKE_INSTALL_PREFIX "/" KDE_INSTALL_LIBDIR "/");
+-                QString orig_libpath = libpath;
+-                libpath = install_lib_dir + libpath;
+-                l.setFileName(libpath);
+-                if (!l.load()) {
+-                    libpath = orig_libpath;
+-                    l.setFileName(libpath);
+-                    l.load();
++                // Try to load the library relative to the active profiles.
++                QByteArrayList profiles = qgetenv("NIX_PROFILES").split(' ');
++                // Reverse the profile list.
++                std::reverse(profiles.begin(), profiles.end());
++                for (const QByteArray &profile: profiles) {
++                    if (!profile.isEmpty()) {
++                        l.setFileName(QFile::decodeName(profile) + QStringLiteral("/lib/") + libpath);
++                        if (l.load()) break;
++                    }
+                 }
+             } else {
+                 l.load();
+-- 
+2.23.1
+
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/0002-start_kdeinit-path.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/0002-start_kdeinit-path.patch
new file mode 100644
index 000000000000..3728c3c58b83
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/0002-start_kdeinit-path.patch
@@ -0,0 +1,25 @@
+From 129cd0ae1e983adc10dbe84e87bcc6f31cb13db8 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Sun, 16 Feb 2020 14:23:44 -0600
+Subject: [PATCH 2/4] start_kdeinit-path
+
+---
+ src/start_kdeinit/start_kdeinit_wrapper.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/start_kdeinit/start_kdeinit_wrapper.c b/src/start_kdeinit/start_kdeinit_wrapper.c
+index 891f50c..ef664ad 100644
+--- a/src/start_kdeinit/start_kdeinit_wrapper.c
++++ b/src/start_kdeinit/start_kdeinit_wrapper.c
+@@ -23,7 +23,7 @@
+ #include <string.h>
+ #include <unistd.h>
+ 
+-#define EXECUTE KDE_INSTALL_FULL_LIBEXECDIR_KF5 "/start_kdeinit"
++#define EXECUTE "/run/wrappers/bin/start_kdeinit"
+ 
+ #if KDEINIT_OOM_PROTECT
+ 
+-- 
+2.23.1
+
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/0003-kdeinit-extra-libs.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/0003-kdeinit-extra-libs.patch
new file mode 100644
index 000000000000..499c975a9e2d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/0003-kdeinit-extra-libs.patch
@@ -0,0 +1,59 @@
+From 4f5d0de7e35744cdbfa9e280ee7e15a54cf21abb Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Sun, 16 Feb 2020 14:24:07 -0600
+Subject: [PATCH 3/4] kdeinit-extra-libs
+
+---
+ src/kdeinit/kinit.cpp | 22 ++++------------------
+ 1 file changed, 4 insertions(+), 18 deletions(-)
+
+diff --git a/src/kdeinit/kinit.cpp b/src/kdeinit/kinit.cpp
+index 0801b75..622dd5f 100644
+--- a/src/kdeinit/kinit.cpp
++++ b/src/kdeinit/kinit.cpp
+@@ -96,9 +96,9 @@ static const char *extra_libs[] = {
+     "libKF5Parts.5.dylib",
+     "libKF5Plasma.5.dylib"
+ #else
+-    "libKF5KIOCore.so.5",
+-    "libKF5Parts.so.5",
+-    "libKF5Plasma.so.5"
++    NIXPKGS_KF5_KIOCORE,
++    NIXPKGS_KF5_PARTS,
++    NIXPKGS_KF5_PLASMA
+ #endif
+ };
+ #endif
+@@ -1524,20 +1524,6 @@ static int initXconnection()
+ }
+ #endif
+ 
+-#ifndef Q_OS_OSX
+-// Find a shared lib in the lib dir, e.g. libkio.so.
+-// Completely unrelated to plugins.
+-static QString findSharedLib(const QString &lib)
+-{
+-    QString path = QFile::decodeName(CMAKE_INSTALL_PREFIX "/" KDE_INSTALL_LIBDIR "/") + lib;
+-    if (QFile::exists(path)) {
+-        return path;
+-    }
+-    // We could also look in LD_LIBRARY_PATH, but really, who installs the main libs in different prefixes?
+-    return QString();
+-}
+-#endif
+-
+ extern "C" {
+ 
+     static void secondary_child_handler(int)
+@@ -1679,7 +1665,7 @@ int main(int argc, char **argv)
+ #if defined(Q_OS_UNIX) && !defined(Q_OS_OSX)
+     if (!d.suicide && qEnvironmentVariableIsEmpty("KDE_IS_PRELINKED")) {
+         for (const char *extra_lib : extra_libs) {
+-            const QString extra = findSharedLib(QString::fromLatin1(extra_lib));
++            const QString extra = QString::fromLatin1(extra_lib);
+             if (!extra.isEmpty()) {
+                 QLibrary l(extra);
+                 l.setLoadHints(QLibrary::ExportExternalSymbolsHint);
+-- 
+2.23.1
+
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/0004-start_kdeinit-environ-hard-limit.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/0004-start_kdeinit-environ-hard-limit.patch
new file mode 100644
index 000000000000..2996342deadb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/0004-start_kdeinit-environ-hard-limit.patch
@@ -0,0 +1,29 @@
+From 41e94983dcfbc1667f1b18c5b566aa5c5975edcb Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Mon, 17 Feb 2020 04:45:03 -0600
+Subject: [PATCH 4/4] start_kdeinit-environ-hard-limit
+
+---
+ src/start_kdeinit/start_kdeinit.c | 6 +++++-
+ 1 file changed, 5 insertions(+), 1 deletion(-)
+
+diff --git a/src/start_kdeinit/start_kdeinit.c b/src/start_kdeinit/start_kdeinit.c
+index f2db3e9..4ff2602 100644
+--- a/src/start_kdeinit/start_kdeinit.c
++++ b/src/start_kdeinit/start_kdeinit.c
+@@ -148,7 +148,11 @@ int main(int argc, char **argv)
+                         ++i) {
+                     unsigned len;
+                     if (read(0, &len, sizeof(unsigned)) == sizeof(unsigned)
+-                            && len && len < (1 << 12)) {
++                            && len) {
++                        if (len >= (1 << 20)) {
++                            fprintf(stderr, "%s: exceeded environment length limit", argv[0]);
++                            return 1;
++                        }
+                         env[ i ] = malloc(len + 1);
+                         if ((unsigned) read(0, env[ i ], len) == len) {
+                             env[ i ][ len ] = '\0';
+-- 
+2.23.1
+
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/default.nix
new file mode 100644
index 000000000000..2a3a3dd5d1f0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kinit/default.nix
@@ -0,0 +1,38 @@
+{
+  mkDerivation, lib, writeScript,
+  extra-cmake-modules, kdoctools,
+  kconfig, kcrash, ki18n, kio, kparts, kservice, kwindowsystem, plasma-framework
+}:
+
+let inherit (lib) getLib; in
+
+mkDerivation {
+  name = "kinit";
+  outputs = [ "out" "dev" ];
+  nativeBuildInputs = [ extra-cmake-modules kdoctools ];
+  buildInputs = [
+    kconfig kcrash ki18n kio kservice kwindowsystem
+  ];
+  patches = [
+    ./0001-kinit-libpath.patch
+    ./0002-start_kdeinit-path.patch
+    ./0003-kdeinit-extra-libs.patch
+    ./0004-start_kdeinit-environ-hard-limit.patch
+  ];
+  CXXFLAGS = [
+    ''-DNIXPKGS_KF5_KIOCORE=\"${getLib kio}/lib/libKF5KIOCore.so.5\"''
+    ''-DNIXPKGS_KF5_PARTS=\"${getLib kparts}/lib/libKF5Parts.so.5\"''
+    ''-DNIXPKGS_KF5_PLASMA=\"${getLib plasma-framework}/lib/libKF5Plasma.so.5\"''
+  ];
+  setupHook = writeScript "setup-hook.sh" ''
+    kinitFixupOutputHook() {
+        if [ $prefix != ''${!outputBin} ] && [ -d $prefix/lib ]; then
+            mkdir -p ''${!outputBin}/lib
+            find $prefix/lib -maxdepth 1 -name 'libkdeinit5_*.so' -exec ln -s \{\} ''${!outputBin}/lib \;
+            rmdir --ignore-fail-on-non-empty ''${!outputBin}/lib
+        fi
+    }
+
+    fixupOutputHooks+=(kinitFixupOutputHook)
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kio/0001-Remove-impure-smbd-search-path.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kio/0001-Remove-impure-smbd-search-path.patch
new file mode 100644
index 000000000000..e541f7a05e8d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kio/0001-Remove-impure-smbd-search-path.patch
@@ -0,0 +1,25 @@
+From af54a2a37655df26a33bc6783cb472c38f65322f Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Sun, 28 Mar 2021 10:31:12 -0500
+Subject: [PATCH 1/2] Remove impure smbd search path
+
+---
+ src/core/ksambashare.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/core/ksambashare.cpp b/src/core/ksambashare.cpp
+index e810ce4..7cfb4e6 100644
+--- a/src/core/ksambashare.cpp
++++ b/src/core/ksambashare.cpp
+@@ -61,7 +61,7 @@ KSambaSharePrivate::~KSambaSharePrivate()
+ bool KSambaSharePrivate::isSambaInstalled()
+ {
+     const bool daemonExists =
+-        !QStandardPaths::findExecutable(QStringLiteral("smbd"), {QStringLiteral("/usr/sbin/"), QStringLiteral("/usr/local/sbin/")}).isEmpty();
++        !QStandardPaths::findExecutable(QStringLiteral("smbd")).isEmpty();
+     if (!daemonExists) {
+         qCDebug(KIO_CORE_SAMBASHARE) << "KSambaShare: Could not find smbd";
+     }
+-- 
+2.30.1
+
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kio/0002-Debug-module-loader.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kio/0002-Debug-module-loader.patch
new file mode 100644
index 000000000000..d0bad0caf4ab
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kio/0002-Debug-module-loader.patch
@@ -0,0 +1,25 @@
+From 59d26b68704373d405b70806f890ddd545cc976a Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Sun, 28 Mar 2021 10:31:48 -0500
+Subject: [PATCH 2/2] Debug module loader
+
+---
+ src/kiod/kiod_main.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/kiod/kiod_main.cpp b/src/kiod/kiod_main.cpp
+index 1976ee1..eb402bf 100644
+--- a/src/kiod/kiod_main.cpp
++++ b/src/kiod/kiod_main.cpp
+@@ -50,7 +50,7 @@ void KIOD::loadModule(const QString &name)
+         module = factory->create<KDEDModule>();
+     }
+     if (!module) {
+-        qCWarning(KIOD_CATEGORY) << "Error loading plugin:" << loader.errorString();
++        qCWarning(KIOD_CATEGORY) << "Error loading plugin" << name << loader.errorString();
+         return;
+     }
+     module->setModuleName(name); // makes it register to DBus
+-- 
+2.30.1
+
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kio/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kio/default.nix
new file mode 100644
index 000000000000..47b958ea0b32
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kio/default.nix
@@ -0,0 +1,27 @@
+{
+  mkDerivation, fetchpatch,
+  extra-cmake-modules, kdoctools, qttools,
+  karchive, kbookmarks, kcompletion, kconfig, kconfigwidgets, kcoreaddons,
+  kdbusaddons, ki18n, kiconthemes, kitemviews, kjobwidgets, knotifications,
+  kservice, ktextwidgets, kwallet, kwidgetsaddons, kwindowsystem, kxmlgui,
+  qtbase, qtscript, qtx11extras, solid, kcrash
+}:
+
+mkDerivation {
+  name = "kio";
+  nativeBuildInputs = [ extra-cmake-modules kdoctools ];
+  buildInputs = [
+    karchive kconfigwidgets kdbusaddons ki18n kiconthemes knotifications
+    ktextwidgets kwallet kwidgetsaddons kwindowsystem qtscript qtx11extras
+    kcrash
+  ];
+  propagatedBuildInputs = [
+    kbookmarks kcompletion kconfig kcoreaddons kitemviews kjobwidgets kservice
+    kxmlgui qtbase qttools solid
+  ];
+  outputs = [ "out" "dev" ];
+  patches = [
+    ./0001-Remove-impure-smbd-search-path.patch
+    ./0002-Debug-module-loader.patch
+ ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kirigami2.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kirigami2.nix
new file mode 100644
index 000000000000..bb5a5a3fc80f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kirigami2.nix
@@ -0,0 +1,8 @@
+{ mkDerivation, extra-cmake-modules, qtbase, qtquickcontrols2, qttranslations, qtgraphicaleffects }:
+
+mkDerivation {
+  name = "kirigami2";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ qtbase qtquickcontrols2 qttranslations qtgraphicaleffects ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kitemmodels.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kitemmodels.nix
new file mode 100644
index 000000000000..0f398b0f57d1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kitemmodels.nix
@@ -0,0 +1,12 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  qtbase
+}:
+
+mkDerivation {
+  name = "kitemmodels";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  propagatedBuildInputs = [ qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kitemviews.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kitemviews.nix
new file mode 100644
index 000000000000..0e772978e191
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kitemviews.nix
@@ -0,0 +1,13 @@
+{
+  mkDerivation, lib,
+  extra-cmake-modules,
+  qtbase, qttools
+}:
+
+mkDerivation {
+  name = "kitemviews";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ qttools ];
+  propagatedBuildInputs = [ qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kjobwidgets.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kjobwidgets.nix
new file mode 100644
index 000000000000..2e116b7bb793
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kjobwidgets.nix
@@ -0,0 +1,11 @@
+{
+  mkDerivation,
+  extra-cmake-modules, qttools,
+  kcoreaddons, kwidgetsaddons, qtx11extras
+}:
+
+mkDerivation {
+  name = "kjobwidgets";
+  nativeBuildInputs = [ extra-cmake-modules qttools ];
+  buildInputs = [ kcoreaddons kwidgetsaddons qtx11extras ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kjs.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kjs.nix
new file mode 100644
index 000000000000..33aeb284e167
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kjs.nix
@@ -0,0 +1,11 @@
+{
+  mkDerivation,
+  extra-cmake-modules, kdoctools,
+  pcre, qtbase,
+}:
+
+mkDerivation {
+  name = "kjs";
+  nativeBuildInputs = [ extra-cmake-modules kdoctools ];
+  buildInputs = [ pcre qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kjsembed.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kjsembed.nix
new file mode 100644
index 000000000000..f552f963513d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kjsembed.nix
@@ -0,0 +1,12 @@
+{
+  mkDerivation,
+  extra-cmake-modules, kdoctools, qttools,
+  ki18n, kjs, qtsvg,
+}:
+
+mkDerivation {
+  name = "kjsembed";
+  nativeBuildInputs = [ extra-cmake-modules kdoctools qttools ];
+  buildInputs = [ ki18n qtsvg ];
+  propagatedBuildInputs = [ kjs ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kmediaplayer.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kmediaplayer.nix
new file mode 100644
index 000000000000..5de26e0c8dcb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kmediaplayer.nix
@@ -0,0 +1,11 @@
+{ mkDerivation
+, extra-cmake-modules
+, kparts
+, kxmlgui
+}:
+
+mkDerivation {
+  name = "kmediaplayer";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ kparts kxmlgui ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/knewstuff/0001-Delay-resolving-knsrcdir.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/knewstuff/0001-Delay-resolving-knsrcdir.patch
new file mode 100644
index 000000000000..b42e75267f9f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/knewstuff/0001-Delay-resolving-knsrcdir.patch
@@ -0,0 +1,25 @@
+From 09b5063e115c36b75e291230175b449a0f6d0c29 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Sun, 28 Mar 2021 13:34:33 -0500
+Subject: [PATCH] Delay resolving knsrcdir
+
+---
+ KF5NewStuffCoreConfig.cmake.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/KF5NewStuffCoreConfig.cmake.in b/KF5NewStuffCoreConfig.cmake.in
+index c65c7c4..3275627 100644
+--- a/KF5NewStuffCoreConfig.cmake.in
++++ b/KF5NewStuffCoreConfig.cmake.in
+@@ -3,7 +3,7 @@
+ include(CMakeFindDependencyMacro)
+ find_dependency(KF5Attica "@KF_DEP_VERSION@")
+ 
+-set(KDE_INSTALL_KNSRCDIR "@KDE_INSTALL_DATADIR@/knsrcfiles")
++set(KDE_INSTALL_KNSRCDIR "${KDE_INSTALL_DATADIR}/knsrcfiles")
+ 
+ include("${CMAKE_CURRENT_LIST_DIR}/KF5NewStuffCoreTargets.cmake")
+ @PACKAGE_INCLUDE_CORE_QCHTARGETS@
+-- 
+2.30.1
+
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/knewstuff/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/knewstuff/default.nix
new file mode 100644
index 000000000000..b775fcbef8f6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/knewstuff/default.nix
@@ -0,0 +1,21 @@
+{
+  mkDerivation, fetchpatch,
+  extra-cmake-modules,
+  attica, karchive, kcompletion, kconfig, kcoreaddons, ki18n, kiconthemes,
+  kio, kitemviews, kpackage, kservice, ktextwidgets, kwidgetsaddons, kxmlgui, qtbase,
+  qtdeclarative, kirigami2,
+}:
+
+mkDerivation {
+  name = "knewstuff";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [
+    karchive kcompletion kconfig kcoreaddons ki18n kiconthemes kio kitemviews
+    kpackage
+    ktextwidgets kwidgetsaddons qtbase qtdeclarative kirigami2
+  ];
+  propagatedBuildInputs = [ attica kservice kxmlgui ];
+  patches = [
+    ./0001-Delay-resolving-knsrcdir.patch
+  ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/knotifications.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/knotifications.nix
new file mode 100644
index 000000000000..d1a809d9f516
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/knotifications.nix
@@ -0,0 +1,15 @@
+{ mkDerivation
+, extra-cmake-modules
+, kcodecs, kconfig, kcoreaddons, kwindowsystem
+, libdbusmenu
+, phonon
+, qttools, qtx11extras
+}:
+
+mkDerivation {
+  name = "knotifications";
+  nativeBuildInputs = [ extra-cmake-modules qttools ];
+  buildInputs = [
+    kcodecs kconfig kcoreaddons kwindowsystem libdbusmenu phonon qtx11extras
+  ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/knotifyconfig.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/knotifyconfig.nix
new file mode 100644
index 000000000000..1971e3e8039b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/knotifyconfig.nix
@@ -0,0 +1,13 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  kcompletion, kconfig, ki18n, kio, phonon, qtbase,
+}:
+
+mkDerivation {
+  name = "knotifyconfig";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ kcompletion kconfig ki18n kio phonon ];
+  propagatedBuildInputs = [ qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kpackage/0001-Allow-external-paths-default.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kpackage/0001-Allow-external-paths-default.patch
new file mode 100644
index 000000000000..dbcdac463c9c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kpackage/0001-Allow-external-paths-default.patch
@@ -0,0 +1,25 @@
+From c134a83d226fc6b92412ee714bb6c7ab7e3a800f Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Sun, 28 Mar 2021 10:25:18 -0500
+Subject: [PATCH 1/2] Allow external paths default
+
+---
+ src/kpackage/package.cpp | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/kpackage/package.cpp b/src/kpackage/package.cpp
+index 36f5600..881f176 100644
+--- a/src/kpackage/package.cpp
++++ b/src/kpackage/package.cpp
+@@ -858,7 +858,7 @@ PackagePrivate::PackagePrivate()
+     : QSharedData()
+     , fallbackPackage(nullptr)
+     , metadata(nullptr)
+-    , externalPaths(false)
++    , externalPaths(true)
+     , valid(false)
+     , checkedValid(false)
+ {
+-- 
+2.30.1
+
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kpackage/0002-QDirIterator-follow-symlinks.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kpackage/0002-QDirIterator-follow-symlinks.patch
new file mode 100644
index 000000000000..1edf2a1c63c8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kpackage/0002-QDirIterator-follow-symlinks.patch
@@ -0,0 +1,26 @@
+From b1c0d2542234247a5051df015d70347597dfe8d8 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Sun, 28 Mar 2021 10:26:40 -0500
+Subject: [PATCH 2/2] QDirIterator follow symlinks
+
+---
+ src/kpackage/packageloader.cpp            | 2 +-
+ src/kpackage/private/packagejobthread.cpp | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/kpackage/packageloader.cpp b/src/kpackage/packageloader.cpp
+index f03d882..d5aee56 100644
+--- a/src/kpackage/packageloader.cpp
++++ b/src/kpackage/packageloader.cpp
+@@ -210,7 +210,7 @@ QList<KPluginMetaData> PackageLoader::listPackages(const QString &packageFormat,
+     }
+
+     for (auto const &plugindir : qAsConst(paths)) {
+-        const QDirIterator::IteratorFlags flags = QDirIterator::Subdirectories;
++        const QDirIterator::IteratorFlags flags = QDirIterator::Subdirectories | QDirIterator::FollowSymlinks;
+         const QStringList nameFilters = {QStringLiteral("metadata.json"), QStringLiteral("metadata.desktop")};
+
+         QDirIterator it(plugindir, nameFilters, QDir::Files, flags);
+-- 
+2.30.1
+
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kpackage/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kpackage/default.nix
new file mode 100644
index 000000000000..d4edc09b2f00
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kpackage/default.nix
@@ -0,0 +1,15 @@
+{
+  mkDerivation,
+  extra-cmake-modules, kdoctools,
+  karchive, kconfig, kcoreaddons, ki18n, qtbase,
+}:
+
+mkDerivation {
+  name = "kpackage";
+  nativeBuildInputs = [ extra-cmake-modules kdoctools ];
+  buildInputs = [ karchive kconfig kcoreaddons ki18n qtbase ];
+  patches = [
+    ./0001-Allow-external-paths-default.patch
+    ./0002-QDirIterator-follow-symlinks.patch
+  ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kparts.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kparts.nix
new file mode 100644
index 000000000000..e1d2a156160d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kparts.nix
@@ -0,0 +1,16 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  kconfig, kcoreaddons, ki18n, kiconthemes, kio, kjobwidgets, knotifications,
+  kservice, ktextwidgets, kwidgetsaddons, kxmlgui
+}:
+
+mkDerivation {
+  name = "kparts";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [
+    kconfig kcoreaddons ki18n kiconthemes kjobwidgets knotifications kservice
+    kwidgetsaddons
+  ];
+  propagatedBuildInputs = [ kio ktextwidgets kxmlgui ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kpeople.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kpeople.nix
new file mode 100644
index 000000000000..52c16ea2b9c2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kpeople.nix
@@ -0,0 +1,15 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  kcoreaddons, ki18n, kitemviews, kservice, kwidgetsaddons, qtbase,
+  qtdeclarative,
+}:
+
+mkDerivation {
+  name = "kpeople";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [
+    kcoreaddons ki18n kitemviews kservice kwidgetsaddons qtdeclarative
+  ];
+  propagatedBuildInputs = [ qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kplotting.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kplotting.nix
new file mode 100644
index 000000000000..68df24d0087b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kplotting.nix
@@ -0,0 +1,10 @@
+{ mkDerivation
+, extra-cmake-modules, qttools, qtbase
+}:
+
+mkDerivation {
+  name = "kplotting";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  propagatedBuildInputs = [ qtbase qttools ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kpty.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kpty.nix
new file mode 100644
index 000000000000..2456f4e22fab
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kpty.nix
@@ -0,0 +1,8 @@
+{ mkDerivation, extra-cmake-modules, kcoreaddons, ki18n, qtbase, }:
+
+mkDerivation {
+  name = "kpty";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ kcoreaddons ki18n qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kquickcharts.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kquickcharts.nix
new file mode 100644
index 000000000000..0ae30be653d4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kquickcharts.nix
@@ -0,0 +1,12 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  qtquickcontrols2, qtbase,
+}:
+
+mkDerivation {
+  name = "kquickcharts";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  propagatedBuildInputs = [ qtquickcontrols2 ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kross.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kross.nix
new file mode 100644
index 000000000000..189e100aa70c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kross.nix
@@ -0,0 +1,13 @@
+{ mkDerivation, extra-cmake-modules, kcompletion, kcoreaddons
+, kdoctools, ki18n, kiconthemes, kio, kparts, kwidgetsaddons
+, kxmlgui, qtbase, qtscript, qtxmlpatterns,
+}:
+
+mkDerivation {
+  name = "kross";
+  nativeBuildInputs = [ extra-cmake-modules kdoctools ];
+  buildInputs = [ kcompletion kcoreaddons kxmlgui ];
+  propagatedBuildInputs = [
+    ki18n kiconthemes kio kparts kwidgetsaddons qtbase qtscript qtxmlpatterns
+  ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/krunner.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/krunner.nix
new file mode 100644
index 000000000000..7db7c61db466
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/krunner.nix
@@ -0,0 +1,18 @@
+{
+  mkDerivation, fetchpatch,
+  extra-cmake-modules,
+  kconfig, kcoreaddons, ki18n, kio, kservice, plasma-framework, qtbase,
+  qtdeclarative, solid, threadweaver, kwindowsystem
+}:
+
+let
+  self = mkDerivation {
+    name = "krunner";
+    nativeBuildInputs = [ extra-cmake-modules ];
+    buildInputs = [
+      kconfig kcoreaddons ki18n kio kservice qtdeclarative solid
+      threadweaver
+    ];
+    propagatedBuildInputs = [ plasma-framework qtbase kwindowsystem ];
+  };
+in self
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kservice/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kservice/default.nix
new file mode 100644
index 000000000000..c1488f728dd6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kservice/default.nix
@@ -0,0 +1,21 @@
+{
+  mkDerivation,
+  bison, extra-cmake-modules, flex,
+  kconfig, kcoreaddons, kcrash, kdbusaddons, kdoctools, ki18n, kwindowsystem,
+  qtbase, shared-mime-info,
+}:
+
+mkDerivation {
+  name = "kservice";
+  nativeBuildInputs = [ extra-cmake-modules kdoctools ];
+  propagatedNativeBuildInputs = [ bison flex ];
+  buildInputs = [
+    kcrash kdbusaddons ki18n kwindowsystem qtbase
+  ];
+  propagatedBuildInputs = [ kconfig kcoreaddons ];
+  propagatedUserEnvPkgs = [ shared-mime-info ]; # for kbuildsycoca5
+  patches = [
+    ./qdiriterator-follow-symlinks.patch
+    ./no-canonicalize-path.patch
+  ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kservice/no-canonicalize-path.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kservice/no-canonicalize-path.patch
new file mode 100644
index 000000000000..cf98ffb9067f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kservice/no-canonicalize-path.patch
@@ -0,0 +1,13 @@
+Index: kservice-5.21.0/src/sycoca/vfolder_menu.cpp
+===================================================================
+--- kservice-5.21.0.orig/src/sycoca/vfolder_menu.cpp
++++ kservice-5.21.0/src/sycoca/vfolder_menu.cpp
+@@ -415,7 +415,7 @@ VFolderMenu::absoluteDir(const QString &
+     }
+ 
+     if (!relative) {
+-        QString resolved = QDir(dir).canonicalPath();
++      QString resolved = QDir::cleanPath(dir);
+         if (!resolved.isEmpty()) {
+             dir = resolved;
+         }
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kservice/qdiriterator-follow-symlinks.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kservice/qdiriterator-follow-symlinks.patch
new file mode 100644
index 000000000000..fdd8b4d81a18
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kservice/qdiriterator-follow-symlinks.patch
@@ -0,0 +1,13 @@
+diff --git a/src/sycoca/kbuildsycoca.cpp b/src/sycoca/kbuildsycoca.cpp
+index b125299..0682b90 100644
+--- a/src/sycoca/kbuildsycoca.cpp
++++ b/src/sycoca/kbuildsycoca.cpp
+@@ -207,7 +207,7 @@ bool KBuildSycoca::build()
+         const QStringList dirs = QStandardPaths::locateAll(QStandardPaths::GenericDataLocation, m_resourceSubdir, QStandardPaths::LocateDirectory);
+         qCDebug(SYCOCA) << "Looking for subdir" << m_resourceSubdir << "=>" << dirs;
+         for (const QString &dir : dirs) {
+-            QDirIterator it(dir, QDirIterator::Subdirectories);
++            QDirIterator it(dir, QDirIterator::Subdirectories | QDirIterator::FollowSymlinks);
+             while (it.hasNext()) {
+                 const QString filePath = it.next();
+                 Q_ASSERT(filePath.startsWith(dir)); // due to the line below...
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/ktexteditor.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/ktexteditor.nix
new file mode 100644
index 000000000000..6a74dca7b4bd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/ktexteditor.nix
@@ -0,0 +1,18 @@
+{
+  mkDerivation,
+  extra-cmake-modules, perl,
+  karchive, kconfig, kguiaddons, ki18n, kiconthemes, kio, kparts, libgit2,
+  qtscript, qtxmlpatterns, sonnet, syntax-highlighting, qtquickcontrols,
+  editorconfig-core-c
+}:
+
+mkDerivation {
+  name = "ktexteditor";
+  nativeBuildInputs = [ extra-cmake-modules perl ];
+  buildInputs = [
+    karchive kconfig kguiaddons ki18n kiconthemes kio libgit2 qtscript
+    qtxmlpatterns sonnet syntax-highlighting qtquickcontrols
+    editorconfig-core-c
+  ];
+  propagatedBuildInputs = [ kparts ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/ktextwidgets.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/ktextwidgets.nix
new file mode 100644
index 000000000000..653d0ac8899b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/ktextwidgets.nix
@@ -0,0 +1,15 @@
+{
+  mkDerivation,
+  extra-cmake-modules, qttools,
+  kcompletion, kconfig, kconfigwidgets, ki18n, kiconthemes, kservice,
+  kwindowsystem, qtbase, sonnet,
+}:
+
+mkDerivation {
+  name = "ktextwidgets";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [
+    kcompletion kconfig kconfigwidgets kiconthemes kservice kwindowsystem
+  ];
+  propagatedBuildInputs = [ ki18n qtbase qttools sonnet ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kunitconversion.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kunitconversion.nix
new file mode 100644
index 000000000000..de0d9aab922e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kunitconversion.nix
@@ -0,0 +1,8 @@
+{ mkDerivation, extra-cmake-modules, ki18n, qtbase, }:
+
+mkDerivation {
+  name = "kunitconversion";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ ki18n qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kwallet.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kwallet.nix
new file mode 100644
index 000000000000..f93f0437dbd1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kwallet.nix
@@ -0,0 +1,17 @@
+{
+  mkDerivation,
+  extra-cmake-modules, kdoctools,
+  kconfig, kconfigwidgets, kcoreaddons , kdbusaddons, ki18n,
+  kiconthemes, knotifications, kservice, kwidgetsaddons, kwindowsystem,
+  libgcrypt, qgpgme, qtbase,
+}:
+
+mkDerivation {
+  name = "kwallet";
+  nativeBuildInputs = [ extra-cmake-modules kdoctools ];
+  buildInputs = [
+    kconfig kconfigwidgets kcoreaddons kdbusaddons ki18n kiconthemes
+    knotifications kservice kwidgetsaddons kwindowsystem libgcrypt qgpgme
+  ];
+  propagatedBuildInputs = [ qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kwayland.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kwayland.nix
new file mode 100644
index 000000000000..749735c4ad58
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kwayland.nix
@@ -0,0 +1,13 @@
+{
+  mkDerivation, propagateBin,
+  extra-cmake-modules,
+  plasma-wayland-protocols, qtbase, wayland, wayland-protocols
+}:
+
+mkDerivation {
+  name = "kwayland";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ plasma-wayland-protocols wayland wayland-protocols ];
+  propagatedBuildInputs = [ qtbase ];
+  setupHook = propagateBin; # XDG_CONFIG_DIRS
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kwidgetsaddons.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kwidgetsaddons.nix
new file mode 100644
index 000000000000..ee347df18ab8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kwidgetsaddons.nix
@@ -0,0 +1,13 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  qtbase, qttools
+}:
+
+mkDerivation {
+  name = "kwidgetsaddons";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ qttools ];
+  propagatedBuildInputs = [ qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kwindowsystem/0001-platform-plugins-path.patch b/nixpkgs/pkgs/development/libraries/kde-frameworks/kwindowsystem/0001-platform-plugins-path.patch
new file mode 100644
index 000000000000..0093eb556bfd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kwindowsystem/0001-platform-plugins-path.patch
@@ -0,0 +1,50 @@
+From 291f691400d4e85c57b57ec75482d2c6078ce26e Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Wed, 9 Dec 2020 10:01:59 -0600
+Subject: [PATCH] platform plugins path
+
+---
+ src/pluginwrapper.cpp | 27 +++++++++++++--------------
+ 1 file changed, 13 insertions(+), 14 deletions(-)
+
+diff --git a/src/pluginwrapper.cpp b/src/pluginwrapper.cpp
+index a255d83..9699b08 100644
+--- a/src/pluginwrapper.cpp
++++ b/src/pluginwrapper.cpp
+@@ -25,20 +25,19 @@ static QStringList pluginCandidates()
+ {
+     QStringList ret;
+     const auto paths = QCoreApplication::libraryPaths();
+-    for (const QString &path : paths) {
+-        static const QStringList searchFolders{
+-            QStringLiteral("/kf5/org.kde.kwindowsystem.platforms"),
+-            QStringLiteral("/kf5/kwindowsystem"),
+-        };
+-        for (const QString &searchFolder : searchFolders) {
+-            QDir pluginDir(path + searchFolder);
+-            if (!pluginDir.exists()) {
+-                continue;
+-            }
+-            const auto entries = pluginDir.entryList(QDir::Files | QDir::NoDotAndDotDot);
+-            for (const QString &entry : entries) {
+-                ret << pluginDir.absoluteFilePath(entry);
+-            }
++    const QString path = QStringLiteral(NIXPKGS_QT_PLUGIN_PATH);
++    static const QStringList searchFolders {
++        QStringLiteral("/kf5/org.kde.kwindowsystem.platforms"),
++        QStringLiteral("/kf5/kwindowsystem"),
++    };
++    for (const QString &searchFolder : searchFolders) {
++        QDir pluginDir(path + searchFolder);
++        if (!pluginDir.exists()) {
++            continue;
++        }
++        const auto entries = pluginDir.entryList(QDir::Files | QDir::NoDotAndDotDot);
++        for (const QString &entry : entries) {
++            ret << pluginDir.absoluteFilePath(entry);
+         }
+     }
+     return ret;
+-- 
+2.28.0
+
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kwindowsystem/default.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kwindowsystem/default.nix
new file mode 100644
index 000000000000..409293093382
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kwindowsystem/default.nix
@@ -0,0 +1,20 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  libpthreadstubs, libXdmcp,
+  qtbase, qttools, qtx11extras
+}:
+
+mkDerivation {
+  name = "kwindowsystem";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ libpthreadstubs libXdmcp qttools qtx11extras ];
+  propagatedBuildInputs = [ qtbase ];
+  patches = [
+    ./0001-platform-plugins-path.patch
+  ];
+  preConfigure = ''
+    NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PATH=\"''${!outputBin}/$qtPluginPrefix\""
+  '';
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kxmlgui.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kxmlgui.nix
new file mode 100644
index 000000000000..0b29158e4b06
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kxmlgui.nix
@@ -0,0 +1,16 @@
+{
+  mkDerivation,
+  extra-cmake-modules, qttools,
+  attica, kconfig, kconfigwidgets, kglobalaccel, ki18n, kiconthemes, kitemviews,
+  ktextwidgets, kwindowsystem, qtbase, sonnet,
+}:
+
+mkDerivation {
+  name = "kxmlgui";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [
+    attica kglobalaccel ki18n kiconthemes kitemviews ktextwidgets kwindowsystem
+    sonnet
+  ];
+  propagatedBuildInputs = [ kconfig kconfigwidgets qtbase qttools ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kxmlrpcclient.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kxmlrpcclient.nix
new file mode 100644
index 000000000000..aa334d69ef1d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kxmlrpcclient.nix
@@ -0,0 +1,9 @@
+{ mkDerivation, extra-cmake-modules, ki18n, kio }:
+
+mkDerivation {
+  name = "kxmlrpcclient";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ ki18n ];
+  propagatedBuildInputs = [ kio ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/modemmanager-qt.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/modemmanager-qt.nix
new file mode 100644
index 000000000000..5ecb5317cfcc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/modemmanager-qt.nix
@@ -0,0 +1,12 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  modemmanager, qtbase
+}:
+
+mkDerivation {
+  name = "modemmanager-qt";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  propagatedBuildInputs = [ modemmanager qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/networkmanager-qt.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/networkmanager-qt.nix
new file mode 100644
index 000000000000..2ff4b2c2b408
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/networkmanager-qt.nix
@@ -0,0 +1,12 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  networkmanager, qtbase,
+}:
+
+mkDerivation {
+  name = "networkmanager-qt";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  propagatedBuildInputs = [ networkmanager qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/oxygen-icons5.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/oxygen-icons5.nix
new file mode 100644
index 000000000000..32b219ab7e1c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/oxygen-icons5.nix
@@ -0,0 +1,13 @@
+{ mkDerivation
+, lib
+, extra-cmake-modules
+, qtbase
+}:
+
+mkDerivation {
+  name = "oxygen-icons5";
+  meta.license = lib.licenses.lgpl3Plus;
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ qtbase ];
+  outputs = [ "out" ]; # only runtime outputs
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/plasma-framework.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/plasma-framework.nix
new file mode 100644
index 000000000000..12540b07007c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/plasma-framework.nix
@@ -0,0 +1,20 @@
+{
+  mkDerivation,
+  extra-cmake-modules, kdoctools,
+  kactivities, karchive, kconfig, kconfigwidgets, kcoreaddons, kdbusaddons,
+  kdeclarative, kglobalaccel, kguiaddons, ki18n, kiconthemes, kio,
+  knotifications, kpackage, kservice, kwayland, kwindowsystem, kxmlgui,
+  qtbase, qtdeclarative, qtscript, qtx11extras, kirigami2, qtquickcontrols2
+}:
+
+mkDerivation {
+  name = "plasma-framework";
+  nativeBuildInputs = [ extra-cmake-modules kdoctools ];
+  buildInputs = [
+    kactivities karchive kconfig kconfigwidgets kcoreaddons kdbusaddons
+    kdeclarative kglobalaccel kguiaddons ki18n kiconthemes kio knotifications
+    kwayland kwindowsystem kxmlgui qtdeclarative qtscript qtx11extras kirigami2
+    qtquickcontrols2
+  ];
+  propagatedBuildInputs = [ kpackage kservice qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/prison.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/prison.nix
new file mode 100644
index 000000000000..670fd02d6161
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/prison.nix
@@ -0,0 +1,13 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  libdmtx, qrencode, qtbase,
+}:
+
+mkDerivation {
+  name = "prison";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ libdmtx qrencode ];
+  propagatedBuildInputs = [ qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/purpose.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/purpose.nix
new file mode 100644
index 000000000000..7e4d002e2a1e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/purpose.nix
@@ -0,0 +1,14 @@
+{
+  mkDerivation, extra-cmake-modules, qtbase
+, qtdeclarative, kconfig, kcoreaddons, ki18n, kio, kirigami2
+, fetchpatch
+}:
+
+mkDerivation {
+  name = "purpose";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [
+    qtbase qtdeclarative kconfig kcoreaddons
+    ki18n kio kirigami2
+  ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/qqc2-desktop-style.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/qqc2-desktop-style.nix
new file mode 100644
index 000000000000..e400967407c6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/qqc2-desktop-style.nix
@@ -0,0 +1,14 @@
+{ mkDerivation
+, extra-cmake-modules
+, qtquickcontrols2
+, qtx11extras
+, kconfig
+, kiconthemes
+, kirigami2
+}:
+
+mkDerivation {
+  name = "qqc2-desktop-style";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ qtx11extras qtquickcontrols2 kconfig kiconthemes kirigami2 ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/solid.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/solid.nix
new file mode 100644
index 000000000000..aa1b1ebe3458
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/solid.nix
@@ -0,0 +1,13 @@
+{
+  mkDerivation,
+  bison, extra-cmake-modules, flex,
+  media-player-info, qtbase, qtdeclarative, qttools
+}:
+
+mkDerivation {
+  name = "solid";
+  nativeBuildInputs = [ bison extra-cmake-modules flex media-player-info ];
+  buildInputs = [ qtdeclarative qttools ];
+  propagatedBuildInputs = [ qtbase ];
+  propagatedUserEnvPkgs = [ media-player-info ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/sonnet.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/sonnet.nix
new file mode 100644
index 000000000000..2eff7bad2402
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/sonnet.nix
@@ -0,0 +1,11 @@
+{ mkDerivation
+, extra-cmake-modules
+, aspell, qtbase, qttools
+}:
+
+mkDerivation {
+  name = "sonnet";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ aspell qttools ];
+  propagatedBuildInputs = [ qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/srcs.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/srcs.nix
new file mode 100644
index 000000000000..34792d254e72
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/srcs.nix
@@ -0,0 +1,670 @@
+# DO NOT EDIT! This file is generated automatically.
+# Command: ./maintainers/scripts/fetch-kde-qt.sh pkgs/development/libraries/kde-frameworks
+{ fetchurl, mirror }:
+
+{
+  attica = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/attica-5.84.0.tar.xz";
+      sha256 = "1q5imda1p26rw3lzz7p6wlg63d2kjl6yx93pxryy129xwyxszf5d";
+      name = "attica-5.84.0.tar.xz";
+    };
+  };
+  baloo = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/baloo-5.84.0.tar.xz";
+      sha256 = "15ldfq9qryw2xna6kr316fqldrfd2r09qj9ig8i2x391x18dzhg4";
+      name = "baloo-5.84.0.tar.xz";
+    };
+  };
+  bluez-qt = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/bluez-qt-5.84.0.tar.xz";
+      sha256 = "0pg6zj0b7j9v339g1q5a9dm1l0a7n1c388n26x6k2s1q785vk6lh";
+      name = "bluez-qt-5.84.0.tar.xz";
+    };
+  };
+  breeze-icons = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/breeze-icons-5.84.0.tar.xz";
+      sha256 = "1320c84pr39541lb4zk33brxx593dbvvnij5x8as4rp99mcjd6h4";
+      name = "breeze-icons-5.84.0.tar.xz";
+    };
+  };
+  extra-cmake-modules = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/extra-cmake-modules-5.84.0.tar.xz";
+      sha256 = "0h8w5ahjpbb524qgabzbgd4x2j8qnfv1d1cq8vzq5hbpw7r5w25v";
+      name = "extra-cmake-modules-5.84.0.tar.xz";
+    };
+  };
+  frameworkintegration = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/frameworkintegration-5.84.0.tar.xz";
+      sha256 = "0jzrsw5fkbgk8xpdjfjprqm1vpa61x32zikyj370shcg3qsaiyir";
+      name = "frameworkintegration-5.84.0.tar.xz";
+    };
+  };
+  kactivities = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kactivities-5.84.0.tar.xz";
+      sha256 = "0lihxr9jvmg2h7k36djdfvsz5slxzzgxpxmv9745ynvc92fr1c46";
+      name = "kactivities-5.84.0.tar.xz";
+    };
+  };
+  kactivities-stats = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kactivities-stats-5.84.0.tar.xz";
+      sha256 = "1mb80jzccvha6rnd9q0xych1k4p0nfdyh7s9ryafv9fqqhzr5fh4";
+      name = "kactivities-stats-5.84.0.tar.xz";
+    };
+  };
+  kapidox = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kapidox-5.84.0.tar.xz";
+      sha256 = "0h8isigbgc02df3kb875p7yzy04i41lss2r5awlh5b1np89l5g51";
+      name = "kapidox-5.84.0.tar.xz";
+    };
+  };
+  karchive = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/karchive-5.84.0.tar.xz";
+      sha256 = "1xjykx94xn0p1926my4f82dn9bsv2b2mv1l4pjpzzfwyn26df34s";
+      name = "karchive-5.84.0.tar.xz";
+    };
+  };
+  kauth = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kauth-5.84.0.tar.xz";
+      sha256 = "1jwynarchwbgdnfzpp3r8ggr8mz2gwgwiv9j2kxmh0m607sqzj04";
+      name = "kauth-5.84.0.tar.xz";
+    };
+  };
+  kbookmarks = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kbookmarks-5.84.0.tar.xz";
+      sha256 = "1k3mamhd55j3hvkw7h0gfizy5hg37d57h26xz9hbxrw1lb1p9gyc";
+      name = "kbookmarks-5.84.0.tar.xz";
+    };
+  };
+  kcalendarcore = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kcalendarcore-5.84.0.tar.xz";
+      sha256 = "06asygdsk4bnn29cc8khpzy68fiyrqwajl55fixmja7kvzsnq4cb";
+      name = "kcalendarcore-5.84.0.tar.xz";
+    };
+  };
+  kcmutils = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kcmutils-5.84.0.tar.xz";
+      sha256 = "1ackicsg2xnjl8gid9v4a72vvqhn7536s0w1g50hss142hp0b9zf";
+      name = "kcmutils-5.84.0.tar.xz";
+    };
+  };
+  kcodecs = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kcodecs-5.84.0.tar.xz";
+      sha256 = "0fjjz40kchw38p74zvgrcfsgclg54w6b8bl6ly72qmj5n0ip2gr3";
+      name = "kcodecs-5.84.0.tar.xz";
+    };
+  };
+  kcompletion = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kcompletion-5.84.0.tar.xz";
+      sha256 = "1kbj1f3c3qpfxn4jyldhzlmgxfxn0af5rbs0irzwd9wqgk9i94vs";
+      name = "kcompletion-5.84.0.tar.xz";
+    };
+  };
+  kconfig = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kconfig-5.84.0.tar.xz";
+      sha256 = "0wshg4hx4d6m1r17mc7l9ivhx6mw0h1qx8fd46hmydmbjp030jma";
+      name = "kconfig-5.84.0.tar.xz";
+    };
+  };
+  kconfigwidgets = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kconfigwidgets-5.84.0.tar.xz";
+      sha256 = "17hyf495wlm5jqc0qxxymy1kcjybbihg8093kf59hvvpcci5xsin";
+      name = "kconfigwidgets-5.84.0.tar.xz";
+    };
+  };
+  kcontacts = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kcontacts-5.84.0.tar.xz";
+      sha256 = "0gvskvfwfmrs884fkfl0gvmnic4hhymffs7jhq6yaixbsjl2mznl";
+      name = "kcontacts-5.84.0.tar.xz";
+    };
+  };
+  kcoreaddons = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kcoreaddons-5.84.0.tar.xz";
+      sha256 = "1c0z2cn02jqanisq5rr6iry1hx9p5ffm59353mknyyg5xyk3qkbm";
+      name = "kcoreaddons-5.84.0.tar.xz";
+    };
+  };
+  kcrash = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kcrash-5.84.0.tar.xz";
+      sha256 = "0asr7llkdbr6wzq31vnmga7haxddz1b6xqp3smw7hvgzs0f8vrv5";
+      name = "kcrash-5.84.0.tar.xz";
+    };
+  };
+  kdav = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kdav-5.84.0.tar.xz";
+      sha256 = "09wly717cp86b3gahj79nfplx71f78zyb5mhpw9xm0dkdf1qf56q";
+      name = "kdav-5.84.0.tar.xz";
+    };
+  };
+  kdbusaddons = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kdbusaddons-5.84.0.tar.xz";
+      sha256 = "0a4v2g86lss1wq359mssg142dp1qccn17yrdhbgy55qi6id6pvl5";
+      name = "kdbusaddons-5.84.0.tar.xz";
+    };
+  };
+  kdeclarative = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kdeclarative-5.84.0.tar.xz";
+      sha256 = "0ygp3jwz0fjixiq7bkjchsxzvg6fn50qw7si9nil5hkkg6lwxir6";
+      name = "kdeclarative-5.84.0.tar.xz";
+    };
+  };
+  kded = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kded-5.84.0.tar.xz";
+      sha256 = "0c6klrchbxy57f7hjvsk640bg6s8gp1ilrzvzg7f8m825yg1b5jc";
+      name = "kded-5.84.0.tar.xz";
+    };
+  };
+  kdelibs4support = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/portingAids/kdelibs4support-5.84.0.tar.xz";
+      sha256 = "1qkiqv0fq8q6i18mi7gm58qhnqra8xkslzjprap6zjq49g9lcgrp";
+      name = "kdelibs4support-5.84.0.tar.xz";
+    };
+  };
+  kdesignerplugin = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/portingAids/kdesignerplugin-5.84.0.tar.xz";
+      sha256 = "0k51pjkh4dfc8bkw0pbsa260fifvcm0wrbpckvd1xd32b0r1n2ax";
+      name = "kdesignerplugin-5.84.0.tar.xz";
+    };
+  };
+  kdesu = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kdesu-5.84.0.tar.xz";
+      sha256 = "0b3ljqj86crccyqzlqg0fkjryi654pi5q84c11zywmws72bjjx9d";
+      name = "kdesu-5.84.0.tar.xz";
+    };
+  };
+  kdewebkit = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/portingAids/kdewebkit-5.84.0.tar.xz";
+      sha256 = "0rhjdqr5g4gphszz70nhvv9wgr0g048pnc36w4w2jpzyy75nwjq2";
+      name = "kdewebkit-5.84.0.tar.xz";
+    };
+  };
+  kdnssd = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kdnssd-5.84.0.tar.xz";
+      sha256 = "1ayscd05m20i4nldidxdx83xsa66ybsyrf3f8sm3h99hgwb1yxm9";
+      name = "kdnssd-5.84.0.tar.xz";
+    };
+  };
+  kdoctools = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kdoctools-5.84.0.tar.xz";
+      sha256 = "1x0dimayl1pj6r4cjwsvzvyc5j79308bcdi27bn0lq1769wm7rlp";
+      name = "kdoctools-5.84.0.tar.xz";
+    };
+  };
+  kemoticons = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kemoticons-5.84.0.tar.xz";
+      sha256 = "0h8ilgwd5y8mbmvr89qkq81km216gs2lx7ln4rijamv2380gwcq7";
+      name = "kemoticons-5.84.0.tar.xz";
+    };
+  };
+  kfilemetadata = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kfilemetadata-5.84.0.tar.xz";
+      sha256 = "19a6lsnh7vxjgvy780bgispgxycj2838gyak6ivd9lxzn6d9jw6i";
+      name = "kfilemetadata-5.84.0.tar.xz";
+    };
+  };
+  kglobalaccel = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kglobalaccel-5.84.0.tar.xz";
+      sha256 = "0v3j4zx6p45lwd7jpbc9y43l5fh247dm6g21w5r56cq6asapx3k5";
+      name = "kglobalaccel-5.84.0.tar.xz";
+    };
+  };
+  kguiaddons = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kguiaddons-5.84.0.tar.xz";
+      sha256 = "0p98xzml58fv2cv8x382bmcrbk39q89mrxy52hkqy759g4ffj919";
+      name = "kguiaddons-5.84.0.tar.xz";
+    };
+  };
+  kholidays = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kholidays-5.84.0.tar.xz";
+      sha256 = "0fzcdlvai0p3l58wbs8ia7vmd9ll2akzzab12ask8kkaz7iwaqqs";
+      name = "kholidays-5.84.0.tar.xz";
+    };
+  };
+  khtml = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/portingAids/khtml-5.84.0.tar.xz";
+      sha256 = "13j2plfgx4zx99i3s70424v8b7qj2xf6gndp7hhmdka0vjhm5bv9";
+      name = "khtml-5.84.0.tar.xz";
+    };
+  };
+  ki18n = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/ki18n-5.84.0.tar.xz";
+      sha256 = "1530jxpbfky3mhr1dv3pr7lrvi96q4ai8fn85h5gnjp7s7h1wgv0";
+      name = "ki18n-5.84.0.tar.xz";
+    };
+  };
+  kiconthemes = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kiconthemes-5.84.0.tar.xz";
+      sha256 = "0r90cdxs6x9bnqb6qb7p2szavqw2lfk9khhxhzgp2z9121smxpgn";
+      name = "kiconthemes-5.84.0.tar.xz";
+    };
+  };
+  kidletime = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kidletime-5.84.0.tar.xz";
+      sha256 = "0akkzj05399f72klr8qf5q0w9v8x1jw2961m3h4hcg1zfsmb6pv4";
+      name = "kidletime-5.84.0.tar.xz";
+    };
+  };
+  kimageformats = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kimageformats-5.84.0.tar.xz";
+      sha256 = "1xzddqc6wj188dhwcw1haa2a28r2d8c4aqhmgymwdwhs7k4ibpds";
+      name = "kimageformats-5.84.0.tar.xz";
+    };
+  };
+  kinit = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kinit-5.84.0.tar.xz";
+      sha256 = "0a5i2rvamw95y9bqscdg6fk1fjsib7rcis9fbk504qk4n7jdp9gw";
+      name = "kinit-5.84.0.tar.xz";
+    };
+  };
+  kio = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kio-5.84.0.tar.xz";
+      sha256 = "1lz07745w3549n7lc174p4rz5w12mm4q08y5xn2a95xg5xrjpgln";
+      name = "kio-5.84.0.tar.xz";
+    };
+  };
+  kirigami2 = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kirigami2-5.84.0.tar.xz";
+      sha256 = "05hpw2ba7g5kzg6z0slngrfz45kih8w1zmahbjhss9i7blj9x32r";
+      name = "kirigami2-5.84.0.tar.xz";
+    };
+  };
+  kitemmodels = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kitemmodels-5.84.0.tar.xz";
+      sha256 = "1v19vc155jh421z8djhrigc83ajz9qvb6qz9cpscdzrcimhaarns";
+      name = "kitemmodels-5.84.0.tar.xz";
+    };
+  };
+  kitemviews = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kitemviews-5.84.0.tar.xz";
+      sha256 = "14rammhm5zp8h37a794z3pmgkpnb606izqy1zlk8lwvnw6aj0kwb";
+      name = "kitemviews-5.84.0.tar.xz";
+    };
+  };
+  kjobwidgets = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kjobwidgets-5.84.0.tar.xz";
+      sha256 = "0gcdd07ma7wg6rqygfhmq2nc3cq78zcxbd7mx0fgirdns5fbp8p5";
+      name = "kjobwidgets-5.84.0.tar.xz";
+    };
+  };
+  kjs = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/portingAids/kjs-5.84.0.tar.xz";
+      sha256 = "0qi1xk6pq7nyzkh6jlp4l1v1b5gq9hryq2a81hgfl7q9xgrx00qy";
+      name = "kjs-5.84.0.tar.xz";
+    };
+  };
+  kjsembed = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/portingAids/kjsembed-5.84.0.tar.xz";
+      sha256 = "1av326byza162ds5vn54nmpd9ndr7yb0cpl8hxmwzfbym1favhvb";
+      name = "kjsembed-5.84.0.tar.xz";
+    };
+  };
+  kmediaplayer = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/portingAids/kmediaplayer-5.84.0.tar.xz";
+      sha256 = "1zzx7d9wcc1qh9zg83c2ihid0c2f5p23gpc475ql056ny71fdvv3";
+      name = "kmediaplayer-5.84.0.tar.xz";
+    };
+  };
+  knewstuff = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/knewstuff-5.84.0.tar.xz";
+      sha256 = "1y1b7704xlf7kmw7c41b3ngsmi5304mvdgphcqsinav6bq48ka5f";
+      name = "knewstuff-5.84.0.tar.xz";
+    };
+  };
+  knotifications = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/knotifications-5.84.0.tar.xz";
+      sha256 = "02az98aqk8alq1cqrxym5idnlzvl6i4jvgnv34q6g4x7j5h4v75h";
+      name = "knotifications-5.84.0.tar.xz";
+    };
+  };
+  knotifyconfig = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/knotifyconfig-5.84.0.tar.xz";
+      sha256 = "1x7jp2c2a1bawl3nl46zfnp8d5al1z19za58g76wn40jy9ksnpy2";
+      name = "knotifyconfig-5.84.0.tar.xz";
+    };
+  };
+  kpackage = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kpackage-5.84.0.tar.xz";
+      sha256 = "166cc85y49xqk4r8k6003rlwphxxx2rmik24d7yhmq8p1qig4qb7";
+      name = "kpackage-5.84.0.tar.xz";
+    };
+  };
+  kparts = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kparts-5.84.0.tar.xz";
+      sha256 = "1fbmywx1fvv9hnznpiy8cp27dfn2ysskymyppqi1hsw01gqs7vfy";
+      name = "kparts-5.84.0.tar.xz";
+    };
+  };
+  kpeople = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kpeople-5.84.0.tar.xz";
+      sha256 = "0llggx56xb3y10j0avm4vdmjfl4pwqbvpb5w7kk1gb43nxpz7h3p";
+      name = "kpeople-5.84.0.tar.xz";
+    };
+  };
+  kplotting = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kplotting-5.84.0.tar.xz";
+      sha256 = "007cvy57ck2frnr5dvs80k3n7lv1q2xw1zadmw13wwdqqsl0kzag";
+      name = "kplotting-5.84.0.tar.xz";
+    };
+  };
+  kpty = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kpty-5.84.0.tar.xz";
+      sha256 = "04q6qz62vwywzaxxmsq0g28k036ljrcyvn5hywdns58zi5d7nab2";
+      name = "kpty-5.84.0.tar.xz";
+    };
+  };
+  kquickcharts = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kquickcharts-5.84.0.tar.xz";
+      sha256 = "01q1ncvk8dc9jkm9x6q7wkcnj1z1377824gj7m83pzgy3g51vcdg";
+      name = "kquickcharts-5.84.0.tar.xz";
+    };
+  };
+  kross = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/portingAids/kross-5.84.0.tar.xz";
+      sha256 = "0fz4q2m16f4zy6pajcrmhm5a9fjrfjfqyns1lm6aimdsrvkwpc93";
+      name = "kross-5.84.0.tar.xz";
+    };
+  };
+  krunner = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/krunner-5.84.0.tar.xz";
+      sha256 = "15ai1x9v5hm5vj7qhh7c4ajiiaf56h3yy3qnb4kamkv146g09a1p";
+      name = "krunner-5.84.0.tar.xz";
+    };
+  };
+  kservice = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kservice-5.84.0.tar.xz";
+      sha256 = "1lbx51wpsc7qdp480yl08wsp6lb1lww5ix5hpxxmv0x7galcgsf2";
+      name = "kservice-5.84.0.tar.xz";
+    };
+  };
+  ktexteditor = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/ktexteditor-5.84.0.tar.xz";
+      sha256 = "0znpls5ap33yjcjw1ayl6zja8qnqx5glk2bvig5aajriqbpw8irk";
+      name = "ktexteditor-5.84.0.tar.xz";
+    };
+  };
+  ktextwidgets = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/ktextwidgets-5.84.0.tar.xz";
+      sha256 = "069qk1frsfa9iqgchpvkq4sgh973fc2fy1hjymc2zv3mahz23qfl";
+      name = "ktextwidgets-5.84.0.tar.xz";
+    };
+  };
+  kunitconversion = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kunitconversion-5.84.0.tar.xz";
+      sha256 = "0a8jc3vw4ydsfff1qis9323vcd7nhigwyjxqa57qzvswrk7wmlxf";
+      name = "kunitconversion-5.84.0.tar.xz";
+    };
+  };
+  kwallet = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kwallet-5.84.0.tar.xz";
+      sha256 = "1m08q820zl9wrc04i0inb7n0r35p0lzcv3hiwvzxmgdcm9zm2n3c";
+      name = "kwallet-5.84.0.tar.xz";
+    };
+  };
+  kwayland = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kwayland-5.84.0.tar.xz";
+      sha256 = "1lpmbqkfbjq3445lj42zqc90wk437kzyjlpzji0wh4p9nqa4a27s";
+      name = "kwayland-5.84.0.tar.xz";
+    };
+  };
+  kwidgetsaddons = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kwidgetsaddons-5.84.0.tar.xz";
+      sha256 = "1xffbmi3a3qp781aay964b30l9y170imxaa05r3xpj77saq673kp";
+      name = "kwidgetsaddons-5.84.0.tar.xz";
+    };
+  };
+  kwindowsystem = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kwindowsystem-5.84.0.tar.xz";
+      sha256 = "19fa8j4paq245rwvnmnz2mnwgh8y6c26wbw25v8kgd7a33ryg0fg";
+      name = "kwindowsystem-5.84.0.tar.xz";
+    };
+  };
+  kxmlgui = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/kxmlgui-5.84.0.tar.xz";
+      sha256 = "1ddfvjwww2270zx4f86w0xmd45pyir95llhc4x2ixicx94jvsg1c";
+      name = "kxmlgui-5.84.0.tar.xz";
+    };
+  };
+  kxmlrpcclient = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/portingAids/kxmlrpcclient-5.84.0.tar.xz";
+      sha256 = "10jddyak99wd4x3vm9d6xzh45pl1lhhfw9isrdkgzcixip2s4p6i";
+      name = "kxmlrpcclient-5.84.0.tar.xz";
+    };
+  };
+  modemmanager-qt = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/modemmanager-qt-5.84.0.tar.xz";
+      sha256 = "1k0dbgq3zbg1rhy775vbxwqssbdin4wm7rw4fkcdra4z9hf39xin";
+      name = "modemmanager-qt-5.84.0.tar.xz";
+    };
+  };
+  networkmanager-qt = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/networkmanager-qt-5.84.0.tar.xz";
+      sha256 = "1qd58p2hj1rnzjvd6sskmry7gq7gp9fvp115ihc8dkaq8xvwah77";
+      name = "networkmanager-qt-5.84.0.tar.xz";
+    };
+  };
+  oxygen-icons5 = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/oxygen-icons5-5.84.0.tar.xz";
+      sha256 = "06h1c2lvvs41lcibgv5iz31g7j1x7fdyi7lnh21hkgd7747vk42l";
+      name = "oxygen-icons5-5.84.0.tar.xz";
+    };
+  };
+  plasma-framework = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/plasma-framework-5.84.0.tar.xz";
+      sha256 = "0chmmb04m1bq4d1w67bw3ppc2iycw7wzsdpams6c4y9f59iwrd8r";
+      name = "plasma-framework-5.84.0.tar.xz";
+    };
+  };
+  prison = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/prison-5.84.0.tar.xz";
+      sha256 = "17bd40fqp88j5dwxixrhf1d4xwri574l4593rdhzg8qgi9jm2ypj";
+      name = "prison-5.84.0.tar.xz";
+    };
+  };
+  purpose = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/purpose-5.84.0.tar.xz";
+      sha256 = "01rh85fc4c4gl0lxw2rbcrh001akggnz7aahkc2spsgd64m7vfv7";
+      name = "purpose-5.84.0.tar.xz";
+    };
+  };
+  qqc2-desktop-style = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/qqc2-desktop-style-5.84.0.tar.xz";
+      sha256 = "0vz68nh6iy92whjlkgf1jmmlhr5261rgsy1r7k3bfd91a41qh2qw";
+      name = "qqc2-desktop-style-5.84.0.tar.xz";
+    };
+  };
+  solid = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/solid-5.84.0.tar.xz";
+      sha256 = "0lrims7zfr5xr5y25v63d08m6cm27z6mxbdg9j06xsrqf93vyz4s";
+      name = "solid-5.84.0.tar.xz";
+    };
+  };
+  sonnet = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/sonnet-5.84.0.tar.xz";
+      sha256 = "0xnbi1rbb2awl5bvyjxjvzq5a8n9xpmiqvlzcgprmqgmsygzlnnq";
+      name = "sonnet-5.84.0.tar.xz";
+    };
+  };
+  syndication = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/syndication-5.84.0.tar.xz";
+      sha256 = "0m245vp5dkw88rz9kgym4ka729p688wspm8mv6zzsfffggvfkwrc";
+      name = "syndication-5.84.0.tar.xz";
+    };
+  };
+  syntax-highlighting = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/syntax-highlighting-5.84.0.tar.xz";
+      sha256 = "1mb4di9k2rxf6f7n53z94q5awmwzfd516kv757ifd323w9xkmyxa";
+      name = "syntax-highlighting-5.84.0.tar.xz";
+    };
+  };
+  threadweaver = {
+    version = "5.84.0";
+    src = fetchurl {
+      url = "${mirror}/stable/frameworks/5.84/threadweaver-5.84.0.tar.xz";
+      sha256 = "0hmxkqwxjvk6m3h3l12bw01xgwqxzja5cismqrwcc3yxf8fyd572";
+      name = "threadweaver-5.84.0.tar.xz";
+    };
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/syndication.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/syndication.nix
new file mode 100644
index 000000000000..fd5a9b9db846
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/syndication.nix
@@ -0,0 +1,11 @@
+{ mkDerivation, lib
+, extra-cmake-modules
+, kcodecs
+}:
+
+mkDerivation {
+  name = "syndication";
+  meta.maintainers = [ lib.maintainers.bkchr ];
+  nativeBuildInputs = [ extra-cmake-modules ];
+  buildInputs = [ kcodecs ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/syntax-highlighting.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/syntax-highlighting.nix
new file mode 100644
index 000000000000..a295b23f3210
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/syntax-highlighting.nix
@@ -0,0 +1,10 @@
+{ mkDerivation
+, extra-cmake-modules, perl, qtbase, qttools
+}:
+
+mkDerivation {
+  name = "syntax-highlighting";
+  nativeBuildInputs = [ extra-cmake-modules perl ];
+  buildInputs = [ qttools ];
+  propagatedBuildInputs = [ qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/threadweaver.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/threadweaver.nix
new file mode 100644
index 000000000000..bfa529c9267a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/threadweaver.nix
@@ -0,0 +1,12 @@
+{
+  mkDerivation,
+  extra-cmake-modules,
+  qtbase
+}:
+
+mkDerivation {
+  name = "threadweaver";
+  nativeBuildInputs = [ extra-cmake-modules ];
+  propagatedBuildInputs = [ qtbase ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kdiagram/default.nix b/nixpkgs/pkgs/development/libraries/kdiagram/default.nix
new file mode 100644
index 000000000000..3cebc05f3d8b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kdiagram/default.nix
@@ -0,0 +1,25 @@
+{
+  mkDerivation, fetchFromGitLab, lib,
+  extra-cmake-modules, qttools,
+  qtbase, qtsvg,
+}:
+
+mkDerivation rec {
+  pname = "kdiagram";
+  version = "2.8.0";
+  src = fetchFromGitLab {
+    domain = "invent.kde.org";
+    owner = "graphics";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-Se131GZE12wqdfN/V4id1pphUvteSrmMaKZ0+lqg1z8=";
+  };
+  nativeBuildInputs = [ extra-cmake-modules qttools ];
+  propagatedBuildInputs = [ qtbase qtsvg ];
+  meta = {
+    description = "Libraries for creating business diagrams";
+    license = lib.licenses.gpl2;
+    platforms = qtbase.meta.platforms;
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/kdsoap/default.nix b/nixpkgs/pkgs/development/libraries/kdsoap/default.nix
new file mode 100644
index 000000000000..0d3c20651c75
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kdsoap/default.nix
@@ -0,0 +1,43 @@
+{ mkDerivation
+, lib
+, fetchurl
+, cmake
+, qtbase
+}:
+
+mkDerivation rec {
+  pname = "kdsoap";
+  version = "2.0.0";
+
+  src = fetchurl {
+    url = "https://github.com/KDAB/KDSoap/releases/download/kdsoap-${version}/kdsoap-${version}.tar.gz";
+    sha256 = "sha256-0YljEE+m99ArBEYxzdvnjxj3DgbGB69oDHrOBNbPBO4=";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ qtbase ];
+
+  postInstall = ''
+    moveToOutput bin/kdwsdl2cpp "$dev"
+    sed -i "$out/lib/cmake/KDSoap/KDSoapTargets.cmake" \
+        -e "/^  INTERFACE_INCLUDE_DIRECTORIES/ c   INTERFACE_INCLUDE_DIRECTORIES \"$dev/include\""
+    sed -i "$out/lib/cmake/KDSoap/KDSoapTargets-release.cmake" \
+        -e "s@$out/bin@$dev/bin@"
+  '';
+
+  meta = with lib; {
+    description = "A Qt-based client-side and server-side SOAP component";
+    longDescription = ''
+      KD Soap is a Qt-based client-side and server-side SOAP component.
+
+      It can be used to create client applications for web services and also
+      provides the means to create web services without the need for any further
+      component such as a dedicated web server.
+    '';
+    license = with licenses; [ gpl2 gpl3 lgpl21 ];
+    maintainers = [ maintainers.ttuegel ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/kerberos/heimdal-make-missing-headers.patch b/nixpkgs/pkgs/development/libraries/kerberos/heimdal-make-missing-headers.patch
new file mode 100644
index 000000000000..a0fa625538b7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kerberos/heimdal-make-missing-headers.patch
@@ -0,0 +1,10 @@
+--- a/lib/hx509/Makefile.am 2018-03-21 15:41:38.622968809 +0100
++++ b/lib/hx509/Makefile.am 2018-03-21 15:41:32.655162197 +0100
+@@ -9,6 +9,8 @@
+	sel-gram.h			\
+	$(gen_files_ocsp:.x=.c)		\
+	$(gen_files_pkcs10:.x=.c)	\
++	ocsp_asn1.h			\
++	pkcs10_asn1.h			\
+	hx509_err.c			\
+	hx509_err.h
diff --git a/nixpkgs/pkgs/development/libraries/kerberos/heimdal.nix b/nixpkgs/pkgs/development/libraries/kerberos/heimdal.nix
new file mode 100644
index 000000000000..c426ec922ae4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kerberos/heimdal.nix
@@ -0,0 +1,101 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, python3, perl, bison, flex
+, texinfo, perlPackages
+, openldap, libcap_ng, sqlite, openssl, db, libedit, pam
+, CoreFoundation, Security, SystemConfiguration
+}:
+
+with lib;
+stdenv.mkDerivation rec {
+  pname = "heimdal";
+  version = "7.7.0";
+
+  src = fetchFromGitHub {
+    owner = "heimdal";
+    repo = "heimdal";
+    rev = "heimdal-${version}";
+    sha256 = "099qn9b8q20invvi5r8d8q9rnwpcm3nr89hx5rj7gj2ah2x5vgxs";
+  };
+
+  outputs = [ "out" "dev" "man" "info" ];
+
+  patches = [ ./heimdal-make-missing-headers.patch ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config python3 perl bison flex texinfo ]
+    ++ (with perlPackages; [ JSON ]);
+  buildInputs = optionals (stdenv.isLinux) [ libcap_ng ]
+    ++ [ db sqlite openssl libedit openldap pam]
+    ++ optionals (stdenv.isDarwin) [ CoreFoundation Security SystemConfiguration ];
+
+  ## ugly, X should be made an option
+  configureFlags = [
+    "--sysconfdir=/etc"
+    "--localstatedir=/var"
+    "--infodir=$info/share/info"
+    "--enable-hdb-openldap-module"
+    "--with-sqlite3=${sqlite.dev}"
+
+  # ugly, --with-libedit is not enought, it fall back to bundled libedit
+    "--with-libedit-include=${libedit.dev}/include"
+    "--with-libedit-lib=${libedit}/lib"
+    "--with-openssl=${openssl.dev}"
+    "--without-x"
+    "--with-berkeley-db"
+    "--with-berkeley-db-include=${db.dev}/include"
+    "--with-openldap=${openldap.dev}"
+  ] ++ optionals (stdenv.isLinux) [
+    "--with-capng"
+  ];
+
+  postUnpack = ''
+    sed -i '/^DEFAULT_INCLUDES/ s,$, -I..,' source/cf/Makefile.am.common
+    sed -i -e 's/date/date --date="@$SOURCE_DATE_EPOCH"/' source/configure.ac
+  '';
+
+  preConfigure = ''
+    configureFlagsArray+=(
+      "--bindir=$out/bin"
+      "--sbindir=$out/sbin"
+      "--libexecdir=$out/libexec/heimdal"
+      "--mandir=$man/share/man"
+      "--infodir=$man/share/info"
+      "--includedir=$dev/include")
+  '';
+
+  # We need to build hcrypt for applications like samba
+  postBuild = ''
+    (cd include/hcrypto; make -j $NIX_BUILD_CORES)
+    (cd lib/hcrypto; make -j $NIX_BUILD_CORES)
+  '';
+
+  postInstall = ''
+    # Install hcrypto
+    (cd include/hcrypto; make -j $NIX_BUILD_CORES install)
+    (cd lib/hcrypto; make -j $NIX_BUILD_CORES install)
+
+    # Do we need it?
+    rm $out/bin/su
+
+    mkdir -p $dev/bin
+    mv $out/bin/krb5-config $dev/bin/
+
+    # asn1 compilers, move them to $dev
+    mv $out/libexec/heimdal/heimdal/* $dev/bin
+    rmdir $out/libexec/heimdal/heimdal
+
+    # compile_et is needed for cross-compiling this package and samba
+    mv lib/com_err/.libs/compile_et $dev/bin
+  '';
+
+  # Issues with hydra
+  #  In file included from hxtool.c:34:0:
+  #  hx_locl.h:67:25: fatal error: pkcs10_asn1.h: No such file or directory
+  #enableParallelBuilding = true;
+
+  meta = {
+    description = "An implementation of Kerberos 5 (and some more stuff)";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+  };
+
+  passthru.implementation = "heimdal";
+}
diff --git a/nixpkgs/pkgs/development/libraries/kerberos/krb5-Fix-Linux-build-error-with-musl-libc.patch b/nixpkgs/pkgs/development/libraries/kerberos/krb5-Fix-Linux-build-error-with-musl-libc.patch
new file mode 100644
index 000000000000..0f33815b6e91
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kerberos/krb5-Fix-Linux-build-error-with-musl-libc.patch
@@ -0,0 +1,32 @@
+From cbdbc8d00d31344fafe00e0fdf984e04e631f7c4 Mon Sep 17 00:00:00 2001
+From: TBK <tbk@jjtc.eu>
+Date: Wed, 26 Feb 2020 21:12:45 +0100
+Subject: [PATCH] Fix Linux build error with musl libc
+
+Commit bf5953c549a6d279977df69ffe89b2ba51460eaf caused a build failure
+on non-glibc Linux build environments.  Change the conditionalization
+so that __GLIBC_PREREQ will only be used if it is defined.
+
+[ghudson@mit.edu: simplified conditionals; rewrote commit message]
+
+ticket: 8880 (new)
+tags: pullup
+target_version: 1.18-next
+---
+ src/util/support/plugins.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+diff --git a/src/util/support/plugins.c b/src/util/support/plugins.c
+index 3329db7dc3..1644d16fd0 100644
+--- a/src/util/support/plugins.c
++++ b/src/util/support/plugins.c
+@@ -62,8 +62,7 @@
+  * dlopen() with RTLD_NODELETE, we weren't going to unload the plugin objects
+  * anyway.
+  */
+-#ifdef __linux__
+-#include <features.h>
++#ifdef __GLIBC__PREREQ
+ #if ! __GLIBC_PREREQ(2, 25)
+ #define dlclose(x)
+ #endif
diff --git a/nixpkgs/pkgs/development/libraries/kerberos/krb5-Fix-typo-in-musl-build-fix.patch b/nixpkgs/pkgs/development/libraries/kerberos/krb5-Fix-typo-in-musl-build-fix.patch
new file mode 100644
index 000000000000..f8718606a7f8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kerberos/krb5-Fix-typo-in-musl-build-fix.patch
@@ -0,0 +1,28 @@
+From b009cca2026b615ef5386faa4c0230bc27c4161d Mon Sep 17 00:00:00 2001
+From: Greg Hudson <ghudson@mit.edu>
+Date: Thu, 12 Mar 2020 00:44:10 -0400
+Subject: [PATCH] Fix typo in musl build fix
+
+Commit cbdbc8d00d31344fafe00e0fdf984e04e631f7c4 checked for
+__GLIBC__PREREQ instead of __GLIBC_PREREQ, thus accidentally reverting
+the workaround introduced in commit
+bf5953c549a6d279977df69ffe89b2ba51460eaf.  Fix the typo.
+
+ticket: 8880
+---
+ src/util/support/plugins.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/util/support/plugins.c b/src/util/support/plugins.c
+index 1644d16fd0..1ff10c354d 100644
+--- a/src/util/support/plugins.c
++++ b/src/util/support/plugins.c
+@@ -62,7 +62,7 @@
+  * dlopen() with RTLD_NODELETE, we weren't going to unload the plugin objects
+  * anyway.
+  */
+-#ifdef __GLIBC__PREREQ
++#ifdef __GLIBC_PREREQ
+ #if ! __GLIBC_PREREQ(2, 25)
+ #define dlclose(x)
+ #endif
diff --git a/nixpkgs/pkgs/development/libraries/kerberos/krb5.nix b/nixpkgs/pkgs/development/libraries/kerberos/krb5.nix
new file mode 100644
index 000000000000..ebec5936b541
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kerberos/krb5.nix
@@ -0,0 +1,97 @@
+{ lib, stdenv, fetchurl, pkg-config, perl, bison, bootstrap_cmds
+, openssl, openldap, libedit, keyutils
+
+# Extra Arguments
+, type ? ""
+# This is called "staticOnly" because krb5 does not support
+# builting both static and shared, see below.
+, staticOnly ? false
+}:
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+let
+  libOnly = type == "lib";
+in
+with lib;
+stdenv.mkDerivation rec {
+  name = "${type}krb5-${version}";
+  majorVersion = "1.18"; # remove patches below with next upgrade
+  version = majorVersion;
+
+  src = fetchurl {
+    url = "https://kerberos.org/dist/krb5/${majorVersion}/krb5-${version}.tar.gz";
+    sha256 = "121c5xsy3x0i4wdkrpw62yhvji6virbh6n30ypazkp0isws3k4bk";
+  };
+
+  patches = optionals stdenv.hostPlatform.isMusl [
+    # TODO: Remove with next release > 1.18
+    # Patches to fix musl build with 1.18.
+    # Not using `fetchpatch` for these for now to avoid infinite recursion
+    # errors in downstream projects (unclear if it's a nixpkgs issue so far).
+    ./krb5-Fix-Linux-build-error-with-musl-libc.patch
+    ./krb5-Fix-typo-in-musl-build-fix.patch
+  ];
+
+  outputs = [ "out" "dev" ];
+
+  configureFlags = [ "--with-tcl=no" "--localstatedir=/var/lib"]
+    # krb5's ./configure does not allow passing --enable-shared and --enable-static at the same time.
+    # See https://bbs.archlinux.org/viewtopic.php?pid=1576737#p1576737
+    ++ optional staticOnly [ "--enable-static" "--disable-shared" ]
+    ++ optional stdenv.isFreeBSD ''WARN_CFLAGS=""''
+    ++ optionals (stdenv.buildPlatform != stdenv.hostPlatform)
+       [ "krb5_cv_attr_constructor_destructor=yes,yes"
+         "ac_cv_func_regcomp=yes"
+         "ac_cv_printf_positional=yes"
+       ];
+
+  nativeBuildInputs = [ pkg-config perl ]
+    ++ optional (!libOnly) bison
+    # Provides the mig command used by the build scripts
+    ++ optional stdenv.isDarwin bootstrap_cmds;
+
+  buildInputs = [ openssl ]
+    ++ optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.libc != "bionic" && !(stdenv.hostPlatform.useLLVM or false)) [ keyutils ]
+    ++ optionals (!libOnly) [ openldap libedit ];
+
+  preConfigure = "cd ./src";
+
+  buildPhase = optionalString libOnly ''
+    MAKE="make -j $NIX_BUILD_CORES -l $NIX_BUILD_CORES"
+    (cd util; $MAKE)
+    (cd include; $MAKE)
+    (cd lib; $MAKE)
+    (cd build-tools; $MAKE)
+  '';
+
+  installPhase = optionalString libOnly ''
+    mkdir -p "$out"/{bin,sbin,lib/pkgconfig,share/{et,man/man1}} \
+      "$dev"/include/{gssapi,gssrpc,kadm5,krb5}
+    (cd util; $MAKE install)
+    (cd include; $MAKE install)
+    (cd lib; $MAKE install)
+    (cd build-tools; $MAKE install)
+    ${postInstall}
+  '';
+
+  # not via outputBin, due to reference from libkrb5.so
+  postInstall = ''
+    moveToOutput bin/krb5-config "$dev"
+  '';
+
+  enableParallelBuilding = true;
+  doCheck = false; # fails with "No suitable file for testing purposes"
+
+  meta = {
+    description = "MIT Kerberos 5";
+    homepage = "http://web.mit.edu/kerberos/";
+    license = licenses.mit;
+    platforms = platforms.unix ++ platforms.windows;
+  };
+
+  passthru.implementation = "krb5";
+}
diff --git a/nixpkgs/pkgs/development/libraries/keybinder/default.nix b/nixpkgs/pkgs/development/libraries/keybinder/default.nix
new file mode 100644
index 000000000000..fb481c19d05f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/keybinder/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchurl, autoconf, automake, libtool, pkg-config, gnome
+, gtk-doc, gtk2, python2Packages, lua, gobject-introspection
+}:
+
+let
+  inherit (python2Packages) python pygtk;
+in stdenv.mkDerivation rec {
+  pname = "keybinder";
+  version = "0.3.0";
+
+  src = fetchurl {
+    name = "${pname}-${version}.tar.gz";
+    url = "https://github.com/engla/keybinder/archive/v${version}.tar.gz";
+    sha256 = "0kkplz5snycik5xknwq1s8rnmls3qsp32z09mdpmaacydcw7g3cf";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    autoconf automake libtool gnome.gnome-common gtk-doc gtk2
+    python pygtk lua gobject-introspection
+  ];
+
+  preConfigure = ''
+    ./autogen.sh --prefix="$out"
+  '';
+
+  meta = with lib; {
+    description = "Library for registering global key bindings";
+    longDescription = ''
+      keybinder is a library for registering global keyboard shortcuts.
+      Keybinder works with GTK-based applications using the X Window System.
+
+      The library contains:
+
+      * A C library, ``libkeybinder``
+      * Gobject-Introspection (gir)  generated bindings
+      * Lua bindings, ``lua-keybinder``
+      * Python bindings, ``python-keybinder``
+      * An ``examples`` directory with programs in C, Lua, Python and Vala.
+    '';
+    homepage = "https://github.com/engla/keybinder/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/keybinder3/default.nix b/nixpkgs/pkgs/development/libraries/keybinder3/default.nix
new file mode 100644
index 000000000000..78755a87919d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/keybinder3/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, pkg-config, gnome
+, gtk-doc, gtk3, libX11, libXext, libXrender, gobject-introspection
+}:
+
+stdenv.mkDerivation rec {
+  pname = "keybinder3";
+  version = "0.3.2";
+
+  src = fetchFromGitHub {
+    owner = "kupferlauncher";
+    repo = "keybinder";
+    rev = "keybinder-3.0-v${version}";
+    sha256 = "196ibn86j54fywfwwgyh89i9wygm4vh7ls19fn20vrnm6ijlzh9r";
+  };
+
+  nativeBuildInputs = [ autoconf automake libtool pkg-config ];
+  buildInputs = [
+    gnome.gnome-common gtk-doc gtk3
+    libX11 libXext libXrender gobject-introspection
+  ];
+
+  preConfigure = ''
+    ./autogen.sh --prefix="$out"
+  '';
+
+  meta = with lib; {
+    description = "Library for registering global key bindings";
+    homepage = "https://github.com/kupferlauncher/keybinder/";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.cstrahan ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/keystone/default.nix b/nixpkgs/pkgs/development/libraries/keystone/default.nix
new file mode 100644
index 000000000000..70864bcf24a9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/keystone/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv
+, fetchFromGitHub
+, pkg-config
+, cmake
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "keystone";
+  version = "0.9.2";
+
+  src = fetchFromGitHub {
+    owner = "keystone-engine";
+    repo = pname;
+    rev = version;
+    sha256 = "020d1l1aqb82g36l8lyfn2j8c660mm6sh1nl4haiykwgdl9xnxfa";
+  };
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DCMAKE_INSTALL_LIBDIR=lib"
+  ];
+
+  nativeBuildInputs = [
+    pkg-config
+    cmake
+    python3
+  ];
+
+  meta = with lib; {
+    description = "Lightweight multi-platform, multi-architecture assembler framework";
+    homepage = "https://www.keystone-engine.org";
+    license = licenses.gpl2Only;
+    maintainers = with maintainers; [ luc65r ];
+    platforms = platforms.unix;
+  };
+}
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..b0f1f0eae257
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/khronos-ocl-icd-loader/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, opencl-headers, cmake, withTracing ? false }:
+
+stdenv.mkDerivation rec {
+  name = "khronos-ocl-icd-loader-${version}";
+  version = "2020.06.16";
+
+  src = fetchFromGitHub {
+    owner = "KhronosGroup";
+    repo = "OpenCL-ICD-Loader";
+    rev = "v${version}";
+    sha256 = "0v2yi6d3g5qshzy6pjic09c5irwgds106yvr93q62f32psfblnmy";
+  };
+
+  patches = lib.optional withTracing ./tracing.patch;
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ opencl-headers ];
+
+  meta = with 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..cef22457e5a1
--- /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 34751e9..01a33fd 100644
+--- a/loader/icd.h
++++ b/loader/icd.h
+@@ -123,7 +123,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/kimageannotator/default.nix b/nixpkgs/pkgs/development/libraries/kimageannotator/default.nix
new file mode 100644
index 000000000000..3188415ea045
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kimageannotator/default.nix
@@ -0,0 +1,24 @@
+{ lib, mkDerivation, fetchFromGitHub, cmake, qtbase, kcolorpicker, qttools }:
+
+mkDerivation rec {
+  pname = "kimageannotator";
+  version = "0.5.1";
+
+  src = fetchFromGitHub {
+    owner = "ksnip";
+    repo = "kImageAnnotator";
+    rev = "v${version}";
+    sha256 = "0hfvrd78lgwd7bccz0fx2pr7g0v3s401y5plra63rxwk55ffkxf8";
+  };
+
+  nativeBuildInputs = [ cmake qttools ];
+  buildInputs = [ qtbase kcolorpicker ];
+
+  meta = with lib; {
+    description = "Tool for annotating images";
+    homepage = "https://github.com/ksnip/kImageAnnotator";
+    license = licenses.lgpl3Plus;
+    maintainers = with maintainers; [ fliegendewurst ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/kissfft/0001-pkgconfig-darwin.patch b/nixpkgs/pkgs/development/libraries/kissfft/0001-pkgconfig-darwin.patch
new file mode 100644
index 000000000000..534d46f0c8ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kissfft/0001-pkgconfig-darwin.patch
@@ -0,0 +1,48 @@
+From c0dc376be9154d143574a818417ceed23308b5f2 Mon Sep 17 00:00:00 2001
+From: OPNA2608 <christoph.neidahl@gmail.com>
+Date: Sun, 18 Apr 2021 01:45:20 +0200
+Subject: [PATCH] pkgconfig darwin
+
+---
+ Makefile | 4 ----
+ 1 file changed, 4 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 971c6d6..0f4be0c 100644
+--- a/Makefile
++++ b/Makefile
+@@ -153,7 +153,6 @@ endif
+ # -DKISS_FFT_BUILD to TYPEFLAGS
+ #
+ 
+-ifneq ($(shell uname -s),Darwin)
+ 	PKGCONFIG_KISSFFT_VERSION = $(KFVER_MAJOR).$(KFVER_MINOR).$(KFVER_PATCH)
+ 	PKGCONFIG_KISSFFT_OUTPUT_NAME = $(KISSFFTLIB_SHORTNAME)
+ 	PKGCONFIG_PKG_KISSFFT_DEFS = $(TYPEFLAGS)
+@@ -170,7 +169,6 @@ ifneq ($(shell uname -s),Darwin)
+ 	PKGCONFIG_KISSFFT_LIBDIR = $(ABS_LIBDIR)
+   endif
+ 	PKGCONFIG_KISSFFT_PKGINCLUDEDIR = $${includedir}/kissfft
+-endif
+ 
+ export TYPEFLAGS
+ 
+@@ -226,7 +224,6 @@ ifneq ($(KISSFFT_STATIC), 1)
+ 	ln -sf $(KISSFFTLIB_NAME) $(KISSFFTLIB_SODEVELNAME)
+   endif
+ endif
+-ifneq ($(shell uname -s),Darwin)
+ 	mkdir "$(ABS_LIBDIR)/pkgconfig"
+ 	sed \
+ 		-e 's+@PKGCONFIG_KISSFFT_VERSION@+$(PKGCONFIG_KISSFFT_VERSION)+' \
+@@ -238,7 +235,6 @@ ifneq ($(shell uname -s),Darwin)
+ 		-e 's+@PKGCONFIG_KISSFFT_LIBDIR@+$(PKGCONFIG_KISSFFT_LIBDIR)+' \
+ 		-e 's+@PKGCONFIG_KISSFFT_PKGINCLUDEDIR@+$(PKGCONFIG_KISSFFT_PKGINCLUDEDIR)+' \
+ 		kissfft.pc.in 1>"$(ABS_LIBDIR)/pkgconfig/$(KISSFFT_PKGCONFIG)"
+-endif
+ ifneq ($(KISSFFT_TOOLS), 0)
+ 	make -C tools install
+ endif
+-- 
+2.29.3
+
diff --git a/nixpkgs/pkgs/development/libraries/kissfft/default.nix b/nixpkgs/pkgs/development/libraries/kissfft/default.nix
new file mode 100644
index 000000000000..abc96a40a970
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kissfft/default.nix
@@ -0,0 +1,85 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fftw
+, fftwFloat
+, python3
+, datatype ? "double"
+, withTools ? false
+, libpng
+, enableStatic ? stdenv.hostPlatform.isStatic
+, enableOpenmp ? false
+, llvmPackages
+}:
+let
+  py = python3.withPackages (ps: with ps; [ numpy ]);
+  option = cond: if cond then "1" else "0";
+in
+stdenv.mkDerivation rec {
+  pname = "kissfft-${datatype}${lib.optionalString enableOpenmp "-openmp"}";
+  version = "131.1.0";
+
+  src = fetchFromGitHub {
+    owner = "mborgerding";
+    repo = "kissfft";
+    rev = version;
+    sha256 = "1yfws5bn4kh62yk6hdyp9h9775l6iz7wsfisbn58jap6b56s8j5s";
+  };
+
+  patches = [
+    ./0001-pkgconfig-darwin.patch
+  ];
+
+  # https://bugs.llvm.org/show_bug.cgi?id=45034
+  postPatch = lib.optionalString (stdenv.hostPlatform.isLinux && stdenv.cc.isClang && lib.versionOlder stdenv.cc.version "10") ''
+    substituteInPlace test/Makefile \
+      --replace "-ffast-math" ""
+  ''
+  + lib.optionalString (stdenv.hostPlatform.isDarwin) ''
+    substituteInPlace test/Makefile \
+      --replace "LD_LIBRARY_PATH" "DYLD_LIBRARY_PATH"
+    # Don't know how to make math.h's double long constants available
+    substituteInPlace test/testcpp.cc \
+      --replace "M_PIl" "M_PI"
+  '';
+
+  makeFlags = [
+    "PREFIX=${placeholder "out"}"
+    "KISSFFT_DATATYPE=${datatype}"
+    "KISSFFT_TOOLS=${option withTools}"
+    "KISSFFT_STATIC=${option enableStatic}"
+    "KISSFFT_OPENMP=${option enableOpenmp}"
+  ];
+
+  buildInputs = lib.optionals (withTools && datatype != "simd") [ libpng ]
+    # TODO: This may mismatch the LLVM version in the stdenv, see #79818.
+    ++ lib.optional (enableOpenmp && stdenv.cc.isClang) llvmPackages.openmp;
+
+  doCheck = true;
+
+  checkInputs = [
+    py
+    (if datatype == "float" then fftwFloat else fftw)
+  ];
+
+  checkFlags = [ "testsingle" ];
+
+  postInstall = ''
+    ln -s ${pname}.pc $out/lib/pkgconfig/kissfft.pc
+  '';
+
+  # Tools can't find kissfft libs on Darwin
+  postFixup = lib.optionalString (withTools && stdenv.hostPlatform.isDarwin) ''
+    for bin in $out/bin/*; do
+      install_name_tool -change lib${pname}.dylib $out/lib/lib${pname}.dylib $bin
+    done
+  '';
+
+  meta = with lib; {
+    description = "A mixed-radix Fast Fourier Transform based up on the KISS principle";
+    homepage = "https://github.com/mborgerding/kissfft";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/kmsxx/default.nix b/nixpkgs/pkgs/development/libraries/kmsxx/default.nix
new file mode 100644
index 000000000000..a07bc73a64ce
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kmsxx/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, meson
+, ninja
+, cmake
+, pkg-config
+, libdrm
+, fmt
+, libevdev
+, withPython ? false
+, python3Packages
+}:
+
+stdenv.mkDerivation {
+  pname = "kmsxx";
+  version = "2021-07-26";
+
+  src = fetchFromGitHub {
+    owner = "tomba";
+    repo = "kmsxx";
+    fetchSubmodules = true;
+    rev = "54f591ec0de61dd192baf781c9b2ec87d5b461f7";
+    sha256 = "sha256-j+20WY4a2iTKZnYjXhxbNnZZ53K3dHpDMTp+ZulS+7c=";
+  };
+
+  # Didn't detect pybind11 without cmake
+  nativeBuildInputs = [ meson ninja pkg-config ] ++ lib.optionals withPython [ cmake ];
+  buildInputs = [ libdrm fmt libevdev ]
+    ++ lib.optionals withPython (with python3Packages; [ python pybind11 ]);
+
+  dontUseCmakeConfigure = true;
+
+  mesonFlags = lib.optional (!withPython) "-Dpykms=disabled";
+
+  meta = with lib; {
+    description = "C++11 library, utilities and python bindings for Linux kernel mode setting";
+    homepage = "https://github.com/tomba/kmsxx";
+    license = licenses.mpl20;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/kpeoplevcard/default.nix b/nixpkgs/pkgs/development/libraries/kpeoplevcard/default.nix
new file mode 100644
index 000000000000..d2244a252347
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kpeoplevcard/default.nix
@@ -0,0 +1,40 @@
+{ mkDerivation
+, lib
+, fetchurl
+, cmake
+, extra-cmake-modules
+, pkg-config
+, kcoreaddons
+, kpeople
+, kcontacts
+}:
+
+mkDerivation rec {
+  pname = "kpeoplevcard";
+  version = "0.1";
+
+  src = fetchurl {
+    url = "https://download.kde.org/stable/${pname}/${version}/${pname}-${version}.tar.xz";
+    sha256 = "1hv3fq5k0pps1wdvq9r1zjnr0nxf8qc3vwsnzh9jpvdy79ddzrcd";
+  };
+
+  buildInputs = [
+    kcoreaddons
+    kpeople
+    kcontacts
+  ];
+
+  nativeBuildInputs = [
+    pkg-config
+    cmake
+    extra-cmake-modules
+  ];
+
+  meta = with lib; {
+    description = "Pulseaudio bindings for Qt";
+    homepage    = "https://github.com/KDE/kpeoplevcard";
+    license     = with licenses; [ lgpl2 ];
+    maintainers = with maintainers; [ doronbehar ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/kpmcore/default.nix b/nixpkgs/pkgs/development/libraries/kpmcore/default.nix
new file mode 100644
index 000000000000..c3621d375870
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kpmcore/default.nix
@@ -0,0 +1,50 @@
+{ stdenv, lib, fetchurl, fetchpatch, extra-cmake-modules
+, qca-qt5, kauth, kio, polkit-qt, qtbase
+, util-linux
+}:
+
+stdenv.mkDerivation rec {
+  pname = "kpmcore";
+  # NOTE: When changing this version, also change the version of `partition-manager`.
+  version = "4.2.0";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/${pname}/${version}/src/${pname}-${version}.tar.xz";
+    hash = "sha256-MvW0CqvFZtzcJlya6DIpzorPbKJai6fxt7nKsKpJn54=";
+  };
+
+  patches = [
+    # Fix build with `kcoreaddons` >= 5.77.0
+    (fetchpatch {
+      url = "https://github.com/KDE/kpmcore/commit/07e5a3ac2858e6d38cc698e0f740e7a693e9f302.patch";
+      sha256 = "sha256-LYzea888euo2HXM+acWaylSw28iwzOdZBvPBt/gjP1s=";
+    })
+    # Fix crash when `fstab` omits mount options.
+    (fetchpatch {
+      url = "https://github.com/KDE/kpmcore/commit/eea84fb60525803a789e55bb168afb968464c130.patch";
+      sha256 = "sha256-NJ3PvyRC6SKNSOlhJPrDDjepuw7IlAoufPgvml3fap0=";
+    })
+  ];
+
+  buildInputs = [
+    qca-qt5
+    kauth
+    kio
+    polkit-qt
+
+    util-linux # Needs blkid in configure script (note that this is not provided by util-linux-compat)
+  ];
+
+  nativeBuildInputs = [ extra-cmake-modules ];
+
+  dontWrapQtApps = true;
+
+  meta = with lib; {
+    description = "KDE Partition Manager core library";
+    homepage = "https://invent.kde.org/system/kpmcore";
+    license = with licenses; [ cc-by-40 cc0 gpl3Plus mit ];
+    maintainers = with maintainers; [ peterhoeg oxalica ];
+    # The build requires at least Qt 5.14:
+    broken = versionOlder qtbase.version "5.14";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/kproperty/default.nix b/nixpkgs/pkgs/development/libraries/kproperty/default.nix
new file mode 100644
index 000000000000..991fd4d27a74
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kproperty/default.nix
@@ -0,0 +1,29 @@
+{
+  mkDerivation, lib, fetchurl,
+  extra-cmake-modules,
+  qtbase, kconfig, kcoreaddons, kwidgetsaddons, kguiaddons,
+  qttools
+}:
+
+mkDerivation rec {
+  pname = "kproperty";
+  version = "3.2.0";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/${pname}/src/${pname}-${version}.tar.xz";
+    sha256 = "1yldfsdamk4dag8dyryjn5n9j2pzi42s79kkafymfnbifhnhrbv7";
+  };
+
+  nativeBuildInputs = [ extra-cmake-modules ];
+
+  buildInputs = [ kconfig kcoreaddons kwidgetsaddons kguiaddons qttools ];
+
+  propagatedBuildInputs = [ qtbase ];
+
+  meta = with lib; {
+    description = "A property editing framework with editor widget similar to what is known from Qt Designer";
+    license = licenses.lgpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ zraexy ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/kquickimageedit/default.nix b/nixpkgs/pkgs/development/libraries/kquickimageedit/default.nix
new file mode 100644
index 000000000000..ca0afe103b71
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kquickimageedit/default.nix
@@ -0,0 +1,19 @@
+{ mkDerivation
+, fetchFromGitLab
+, extra-cmake-modules
+}:
+
+mkDerivation rec {
+  pname = "kquickimageeditor";
+  version = "0.1.3";
+
+  src = fetchFromGitLab {
+    domain = "invent.kde.org";
+    owner = "libraries";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-p2uOssS5MQSkmppNKOjTxp866Qx1rIB6ZPhcmVvfBxs=";
+  };
+
+  nativeBuildInputs = [ extra-cmake-modules ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/kreport/default.nix b/nixpkgs/pkgs/development/libraries/kreport/default.nix
new file mode 100644
index 000000000000..46d55b1f550d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kreport/default.nix
@@ -0,0 +1,26 @@
+{
+  mkDerivation, lib, fetchurl,
+  extra-cmake-modules,
+  qtdeclarative, qtwebkit, kconfig, kcoreaddons, kwidgetsaddons, kguiaddons, kproperty, marble, python2
+}:
+
+mkDerivation rec {
+  pname = "kreport";
+  version = "3.2.0";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/${pname}/src/${pname}-${version}.tar.xz";
+    sha256 = "1mycsvkz5rphi9df2i4ch4ykvprd4m76acsdzs3zis2ljrqnsw92";
+  };
+
+  nativeBuildInputs = [ extra-cmake-modules ];
+
+  buildInputs = [ qtdeclarative qtwebkit kconfig kcoreaddons kwidgetsaddons kguiaddons kproperty marble python2 ];
+
+  meta = with lib; {
+    description = "A framework for creation and generation of reports in multiple formats";
+    license = licenses.lgpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ zraexy ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/kronosnet/default.nix b/nixpkgs/pkgs/development/libraries/kronosnet/default.nix
new file mode 100644
index 000000000000..cc282d9abc9c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kronosnet/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub
+, autoreconfHook, pkg-config
+, libqb, libxml2, libnl, lksctp-tools
+, nss, openssl, bzip2, lzo, lz4, xz, zlib, zstd
+, doxygen
+}:
+
+stdenv.mkDerivation rec {
+  pname = "kronosnet";
+  version = "1.21";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "14i4fl3g60gn5ay3dbwjcay3dnmnqr16zcp3g0wv9a3hjwh1if28";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config doxygen ];
+
+  buildInputs = [
+    libqb libxml2 libnl lksctp-tools
+    nss openssl
+    bzip2 lzo lz4 xz zlib zstd
+  ];
+
+  meta = with lib; {
+    description = "VPN on steroids";
+    homepage = "https://kronosnet.org/";
+    license = with licenses; [ lgpl21Plus gpl2Plus ];
+    maintainers = with maintainers; [ ryantm ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/kyotocabinet/default.nix b/nixpkgs/pkgs/development/libraries/kyotocabinet/default.nix
new file mode 100644
index 000000000000..153892304e9c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/kyotocabinet/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "kyotocabinet";
+  version = "1.2.79";
+
+  src = fetchurl {
+    url = "https://dbmx.net/kyotocabinet/pkg/kyotocabinet-${version}.tar.gz";
+    sha256 = "079ymsahlrijswgwfr2la9yw5h57l752cprhp5dz31iamsj1vyv7";
+  };
+
+  prePatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace kccommon.h \
+      --replace tr1/unordered_map unordered_map \
+      --replace tr1/unordered_set unordered_set \
+      --replace tr1::hash std::hash \
+      --replace tr1::unordered_map std::unordered_map \
+      --replace tr1::unordered_set std::unordered_set
+
+    substituteInPlace lab/kcdict/Makefile --replace stdc++ c++
+    substituteInPlace configure \
+        --replace /usr/local/bin:/usr/local/sbin: "" \
+        --replace /usr/bin:/usr/sbin: "" \
+        --replace /bin:/sbin: "" \
+        --replace stdc++ c++
+  '';
+
+  buildInputs = [ zlib ];
+
+  meta = with lib; {
+    homepage = "https://dbmx.net/kyotocabinet";
+    description = "A library of routines for managing a database";
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/l-smash/default.nix b/nixpkgs/pkgs/development/libraries/l-smash/default.nix
new file mode 100644
index 000000000000..40eb4bd10d36
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/l-smash/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, which }:
+
+stdenv.mkDerivation rec {
+  pname = "l-smash";
+  version = "2.14.5";
+
+  src = fetchFromGitHub {
+    owner = "l-smash";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0rcq9727im6kd8da8b7kzzbzxdldvmh5nsljj9pvr4m3lj484b02";
+  };
+
+  nativeBuildInputs = [ which ];
+
+  configureFlags = [
+    "--cc=cc"
+    "--cross-prefix=${stdenv.cc.targetPrefix}"
+  ];
+
+  meta = with lib; {
+    homepage = "http://l-smash.github.io/l-smash/";
+    description = "MP4 container utilities";
+    license = licenses.isc;
+    maintainers = with maintainers; [ tadeokondrak ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/lame/default.nix b/nixpkgs/pkgs/development/libraries/lame/default.nix
new file mode 100644
index 000000000000..8ed0962bece8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lame/default.nix
@@ -0,0 +1,71 @@
+{ lib, stdenv, fetchurl
+, nasmSupport ? true, nasm ? null # Assembly optimizations
+, cpmlSupport ? true # Compaq's fast math library
+#, efenceSupport ? false, libefence ? null # Use ElectricFence for malloc debugging
+, sndfileFileIOSupport ? false, libsndfile ? null # Use libsndfile, instead of lame's internal routines
+, analyzerHooksSupport ? true # Use analyzer hooks
+, decoderSupport ? true # mpg123 decoder
+, frontendSupport ? true # Build the lame executable
+#, mp3xSupport ? false, gtk1 ? null # Build GTK frame analyzer
+, mp3rtpSupport ? false # Build mp3rtp
+, debugSupport ? false # Debugging (disables optimizations)
+}:
+
+assert nasmSupport -> (nasm != null);
+#assert efenceSupport -> (libefence != null);
+assert sndfileFileIOSupport -> (libsndfile != null);
+#assert mp3xSupport -> (analyzerHooksSupport && (gtk1 != null));
+
+let
+  mkFlag = optSet: flag: if optSet then "--enable-${flag}" else "--disable-${flag}";
+in
+
+with lib;
+stdenv.mkDerivation rec {
+  pname = "lame";
+  version = "3.100";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/lame/${pname}-${version}.tar.gz";
+    sha256 = "07nsn5sy3a8xbmw1bidxnsj5fj6kg9ai04icmqw40ybkp353dznx";
+  };
+
+  outputs = [ "out" "lib" "doc" ]; # a small single header
+  outputMan = "out";
+
+  nativeBuildInputs = [ ]
+    ++ optional nasmSupport nasm;
+
+  buildInputs = [ ]
+    #++ optional efenceSupport libefence
+    #++ optional mp3xSupport gtk1
+    ++ optional sndfileFileIOSupport libsndfile;
+
+  configureFlags = [
+    (mkFlag nasmSupport "nasm")
+    (mkFlag cpmlSupport "cpml")
+    #(mkFlag efenceSupport "efence")
+    (if sndfileFileIOSupport then "--with-fileio=sndfile" else "--with-fileio=lame")
+    (mkFlag analyzerHooksSupport "analyzer-hooks")
+    (mkFlag decoderSupport "decoder")
+    (mkFlag frontendSupport "frontend")
+    (mkFlag frontendSupport "dynamic-frontends")
+    #(mkFlag mp3xSupport "mp3x")
+    (mkFlag mp3rtpSupport "mp3rtp")
+    (if debugSupport then "--enable-debug=alot" else "")
+  ];
+
+  preConfigure = ''
+    # Prevent a build failure for 3.100 due to using outdated symbol list
+    # https://hydrogenaud.io/index.php/topic,114777.msg946373.html#msg946373
+    sed -i '/lame_init_old/d' include/libmp3lame.sym
+  '';
+
+  meta = {
+    description = "A high quality MPEG Audio Layer III (MP3) encoder";
+    homepage    = "http://lame.sourceforge.net";
+    license     = licenses.lgpl2;
+    maintainers = with maintainers; [ codyopel fpletz ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/frog.nix b/nixpkgs/pkgs/development/libraries/languagemachines/frog.nix
new file mode 100644
index 000000000000..a44535fbf90e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/frog.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv, fetchurl
+, automake, autoconf, bzip2, libtar, libtool, pkg-config, autoconf-archive
+, libxml2, icu
+, languageMachines
+}:
+
+let
+  release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-frog.json);
+in
+
+stdenv.mkDerivation {
+  name = "frog-${release.version}";
+  version = release.version;
+  src = fetchurl { inherit (release) url sha256;
+                   name = "frog-v${release.version}.tar.gz"; };
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ automake autoconf bzip2 libtar libtool autoconf-archive
+                  libxml2 icu
+                  languageMachines.ticcutils
+                  languageMachines.timbl
+                  languageMachines.mbt
+                  languageMachines.libfolia
+                  languageMachines.ucto
+                  languageMachines.frogdata
+                ];
+
+  preConfigure = ''
+    sh bootstrap.sh
+  '';
+  postInstall = ''
+    # frog expects the data files installed in the same prefix
+    mkdir -p $out/share/frog/;
+    for f in ${languageMachines.frogdata}/share/frog/*; do
+      ln -s $f $out/share/frog/;
+    done;
+
+    make check
+  '';
+
+  meta = with lib; {
+    description = "A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch";
+    homepage    = "https://languagemachines.github.io/frog";
+    license     = licenses.gpl3;
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ roberth ];
+
+    longDescription = ''
+      Frog is an integration of memory-based natural language processing (NLP) modules developed for Dutch. All NLP modules are based on Timbl, the Tilburg memory-based learning software package. Most modules were created in the 1990s at the ILK Research Group (Tilburg University, the Netherlands) and the CLiPS Research Centre (University of Antwerp, Belgium). Over the years they have been integrated into a single text processing tool, which is currently maintained and developed by the Language Machines Research Group and the Centre for Language and Speech Technology at Radboud University Nijmegen. A dependency parser, a base phrase chunker, and a named-entity recognizer module were added more recently. Where possible, Frog makes use of multi-processor support to run subtasks in parallel.
+
+      Various (re)programming rounds have been made possible through funding by NWO, the Netherlands Organisation for Scientific Research, particularly under the CGN project, the IMIX programme, the Implicit Linguistics project, the CLARIN-NL programme and the CLARIAH programme.
+    '';
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/frogdata.nix b/nixpkgs/pkgs/development/libraries/languagemachines/frogdata.nix
new file mode 100644
index 000000000000..7e890a8d09c9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/frogdata.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl
+, automake, autoconf, libtool, pkg-config, autoconf-archive
+}:
+
+let
+  release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-frogdata.json);
+in
+
+stdenv.mkDerivation {
+  name = "frogdata-${release.version}";
+  version = release.version;
+  src = fetchurl { inherit (release) url sha256;
+                   name = "frogdata-${release.version}.tar.gz"; };
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ automake autoconf libtool autoconf-archive
+                ];
+
+  preConfigure = ''
+    sh bootstrap.sh
+  '';
+
+  meta = with lib; {
+    description = "Data for Frog, a Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch";
+    homepage    = "https://languagemachines.github.io/frog";
+    license     = licenses.gpl3;
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ roberth ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/libfolia.nix b/nixpkgs/pkgs/development/libraries/languagemachines/libfolia.nix
new file mode 100644
index 000000000000..fc5e622bcf4f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/libfolia.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl
+, automake, autoconf, libtool, pkg-config, autoconf-archive
+, libxml2, icu, bzip2, libtar
+, languageMachines }:
+
+let
+  release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-libfolia.json);
+in
+
+stdenv.mkDerivation {
+  name = "libfolia-${release.version}";
+  version = release.version;
+  src = fetchurl { inherit (release) url sha256;
+                   name = "libfolia-${release.version}.tar.gz"; };
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ automake autoconf bzip2 libtool autoconf-archive libtar libxml2 icu languageMachines.ticcutils ];
+  preConfigure = "sh bootstrap.sh";
+
+  # compat with icu61+ https://github.com/unicode-org/icu/blob/release-64-2/icu4c/readme.html#L554
+  CXXFLAGS = [ "-DU_USING_ICU_NAMESPACE=1" ];
+
+  meta = with lib; {
+    description = "A C++ API for FoLiA documents; an XML-based linguistic annotation format.";
+    homepage    = "https://proycon.github.io/folia/";
+    license     = licenses.gpl3;
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ roberth ];
+
+    longDescription = ''
+      A high-level C++ API to read, manipulate, and create FoLiA documents. FoLiA is an XML-based annotation format, suitable for the representation of linguistically annotated language resources. FoLiA’s intended use is as a format for storing and/or exchanging language resources, including corpora.
+    '';
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/mbt-add-libxml2-dep.patch b/nixpkgs/pkgs/development/libraries/languagemachines/mbt-add-libxml2-dep.patch
new file mode 100644
index 000000000000..9037f1093bb9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/mbt-add-libxml2-dep.patch
@@ -0,0 +1,13 @@
+--- a/configure.ac	2017-06-12 06:48:15.000000000 +0200
++++ b/configure.ac	2017-06-12 06:50:06.000000000 +0200
+@@ -76,6 +76,10 @@
+ CXXFLAGS="$CXXFLAGS $ticcutils_CFLAGS"
+ LIBS="$LIBS $ticcutils_LIBS"
+ 
++PKG_CHECK_MODULES([libxml2], [libxml-2.0 >= 2.6.16] )
++CXXFLAGS="$CXXFLAGS $libxml2_CFLAGS"
++LIBS="$LIBS $libxml2_LIBS"
++
+ AC_CONFIG_FILES([
+   Makefile
+   mbt.pc
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/mbt.nix b/nixpkgs/pkgs/development/libraries/languagemachines/mbt.nix
new file mode 100644
index 000000000000..efa9ada7d56c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/mbt.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl
+, automake, autoconf, bzip2, libtar, libtool, pkg-config, autoconf-archive
+, libxml2
+, languageMachines
+}:
+
+let
+  release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-mbt.json);
+in
+
+stdenv.mkDerivation {
+  name = "mbt-${release.version}";
+  version = release.version;
+  src = fetchurl { inherit (release) url sha256;
+                   name = "mbt-${release.version}.tar.gz"; };
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ automake autoconf bzip2 libtar libtool autoconf-archive
+                  libxml2
+                  languageMachines.ticcutils
+                  languageMachines.timbl
+                ];
+  patches = [ ./mbt-add-libxml2-dep.patch ];
+  preConfigure = ''
+    sh bootstrap.sh
+  '';
+
+  meta = with lib; {
+    description = "Memory Based Tagger";
+    homepage    = "https://languagemachines.github.io/mbt/";
+    license     = licenses.gpl3;
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ roberth ];
+
+    longDescription = ''
+      MBT is a memory-based tagger-generator and tagger in one. The tagger-generator part can generate a sequence tagger on the basis of a training set of tagged sequences; the tagger part can tag new sequences. MBT can, for instance, be used to generate part-of-speech taggers or chunkers for natural language processing. It has also been used for named-entity recognition, information extraction in domain-specific texts, and disfluency chunking in transcribed speech.
+
+      Mbt is used by Frog for Dutch tagging.
+    '';
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/packages.nix b/nixpkgs/pkgs/development/libraries/languagemachines/packages.nix
new file mode 100644
index 000000000000..8a490bbc9867
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/packages.nix
@@ -0,0 +1,18 @@
+{ pkgs }:
+let
+  inherit (pkgs) callPackage;
+  icu = pkgs.icu60;
+in
+{
+  ticcutils = callPackage ./ticcutils.nix { };
+  libfolia = callPackage ./libfolia.nix { inherit icu; };
+  ucto = callPackage ./ucto.nix { inherit icu; };
+  uctodata = callPackage ./uctodata.nix { };
+  timbl = callPackage ./timbl.nix { };
+  timblserver = callPackage ./timblserver.nix { };
+  mbt = callPackage ./mbt.nix { };
+  frog = callPackage ./frog.nix { inherit icu; };
+  frogdata = callPackage ./frogdata.nix { };
+
+  test = callPackage ./test.nix { };
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-frog.json b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-frog.json
new file mode 100644
index 000000000000..55c2ec20a312
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-frog.json
@@ -0,0 +1,5 @@
+{
+  "version": "v0.13.7",
+  "url": "https://api.github.com/repos/LanguageMachines/frog/tarball/v0.13.7",
+  "sha256": "0swyfi3g862n888qj8v8kd18745hasy0vnc70i9qlv0ji0321bnf"
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-frogdata.json b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-frogdata.json
new file mode 100644
index 000000000000..6ea449387172
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-frogdata.json
@@ -0,0 +1,5 @@
+{
+  "version": "0.13",
+  "url": "https://api.github.com/repos/LanguageMachines/frogdata/tarball/v0.13",
+  "sha256": "13mhv8qacl0n20ddl1ay49xi6h2m0a149ya3rrsmaah3x4adb4sg"
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-libfolia.json b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-libfolia.json
new file mode 100644
index 000000000000..792d958213fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-libfolia.json
@@ -0,0 +1,5 @@
+{
+  "version": "v1.7",
+  "url": "https://api.github.com/repos/LanguageMachines/libfolia/tarball/v1.7",
+  "sha256": "0hpxdry7n2887klryc587xv46p6z6jp6hz9x7k2pk5v7jb0z4s65"
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-mbt.json b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-mbt.json
new file mode 100644
index 000000000000..f1bbff47a28e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-mbt.json
@@ -0,0 +1,5 @@
+{
+  "version": "v3.2.16",
+  "url": "https://api.github.com/repos/LanguageMachines/mbt/tarball/v3.2.16",
+  "sha256": "0f9f5l84m0lmmv4km9myn3yhy67jbmk3qn2fi40dy025gx4l0x3x"
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-ticcutils.json b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-ticcutils.json
new file mode 100644
index 000000000000..11069c6b02c7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-ticcutils.json
@@ -0,0 +1,5 @@
+{
+  "version": "v0.15",
+  "url": "https://api.github.com/repos/LanguageMachines/ticcutils/tarball/v0.15",
+  "sha256": "0lssb1klx2flmr6fy78j37i5lbq3gfhzjx24j6n72ndm2rvprvcn"
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-timbl.json b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-timbl.json
new file mode 100644
index 000000000000..d35f2c8333aa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-timbl.json
@@ -0,0 +1,5 @@
+{
+  "version": "v6.4.9",
+  "url": "https://api.github.com/repos/LanguageMachines/timbl/tarball/v6.4.9",
+  "sha256": "1279npc3xlq05hnkylpbkgg941gjhvl6sd5fw4vgwcx2rwmmlaay"
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-timblserver.json b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-timblserver.json
new file mode 100644
index 000000000000..d588da3f8b6e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-timblserver.json
@@ -0,0 +1,5 @@
+{
+  "version": "v1.11",
+  "url": "https://api.github.com/repos/LanguageMachines/timblserver/tarball/v1.11",
+  "sha256": "02k8c704wr5miy82w6zj0imm7sdfnxf3db34qiaa8l3myhn17qlw"
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-ucto.json b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-ucto.json
new file mode 100644
index 000000000000..9b05cf3e1393
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-ucto.json
@@ -0,0 +1,5 @@
+{
+  "version": "v0.9.6",
+  "url": "https://api.github.com/repos/LanguageMachines/ucto/tarball/v0.9.6",
+  "sha256": "0fxq4j32g7kp6789xz23651c4v2j7zlz87cshfv9g1xjs7jxns3f"
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-uctodata.json b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-uctodata.json
new file mode 100644
index 000000000000..08069bb333bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/release-info/LanguageMachines-uctodata.json
@@ -0,0 +1,5 @@
+{
+  "version": "v0.4",
+  "url": "https://api.github.com/repos/LanguageMachines/uctodata/tarball/v0.4",
+  "sha256": "02c78qmwi9ijpk5wila3p62fmfdy1rpmlvvzbxs3wg0rdb0nwvd2"
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/test.nix b/nixpkgs/pkgs/development/libraries/languagemachines/test.nix
new file mode 100644
index 000000000000..48c41ac52f22
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/test.nix
@@ -0,0 +1,25 @@
+{ runCommand
+, languageMachines
+}:
+
+runCommand "frog-test" {} ''
+  ${languageMachines.frog}/bin/frog >$out <<EOF
+  Dit is een test
+  
+  EOF
+  echo "Frog output:"
+  cat $out
+
+  expected () {
+    echo "Test expectation failed: $@"
+    exit 1
+  }
+
+  lines="$(wc -l $out | awk '{print $1}')"
+  test 5 = $lines || expected "Five lines of output"
+  grep "is" $out | grep "zijn" >/dev/null || expected "Stemming works"
+  grep "een" $out | grep "onbep" >/dev/null || expected "Tagging works"
+
+  deps="$(echo $(awk 'BEGIN { FS = "\t*" } ; {print $1 " -> " $9 "; "}' <$out))"
+  test "1 -> 2; 2 -> 0; 3 -> 4; 4 -> 2; -> ;" = "$deps" || expected "Dependency parsing works"
+''
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/ticcutils.nix b/nixpkgs/pkgs/development/libraries/languagemachines/ticcutils.nix
new file mode 100644
index 000000000000..c09f00b1160b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/ticcutils.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl
+, automake, autoconf, libtool, pkg-config, autoconf-archive
+, libxml2, zlib, bzip2, libtar }:
+
+let
+  release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-ticcutils.json);
+in
+
+stdenv.mkDerivation {
+  name = "ticcutils-${release.version}";
+  version = release.version;
+  src = fetchurl { inherit (release) url sha256;
+                   name = "ticcutils-${release.version}.tar.gz"; };
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ automake autoconf libtool autoconf-archive libxml2
+                  # optional:
+                  zlib bzip2 libtar
+                  # broken but optional: boost
+                ];
+  preConfigure = "sh bootstrap.sh";
+
+  meta = with lib; {
+    description = "This module contains useful functions for general use in the TiCC software stack and beyond.";
+    homepage    = "https://github.com/LanguageMachines/ticcutils";
+    license     = licenses.gpl3;
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ roberth ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/timbl.nix b/nixpkgs/pkgs/development/libraries/languagemachines/timbl.nix
new file mode 100644
index 000000000000..de22c41ec497
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/timbl.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl
+, automake, autoconf, libtool, pkg-config, autoconf-archive
+, libxml2, bzip2, libtar
+, languageMachines
+}:
+
+let
+  release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-timbl.json);
+in
+
+stdenv.mkDerivation {
+  name = "timbl-${release.version}";
+  version = release.version;
+  src = fetchurl { inherit (release) url sha256;
+                   name = "timbl-${release.version}.tar.gz"; };
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ automake autoconf bzip2 libtar libtool autoconf-archive
+                  libxml2
+                  languageMachines.ticcutils
+                ];
+  preConfigure = "sh bootstrap.sh";
+
+  meta = with lib; {
+    description = "TiMBL implements several memory-based learning algorithms";
+    homepage    = "https://github.com/LanguageMachines/timbl/";
+    license     = licenses.gpl3;
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ roberth ];
+
+    longDescription = ''
+      TiMBL is an open source software package implementing several memory-based learning algorithms, among which IB1-IG, an implementation of k-nearest neighbor classification with feature weighting suitable for symbolic feature spaces, and IGTree, a decision-tree approximation of IB1-IG. All implemented algorithms have in common that they store some representation of the training set explicitly in memory. During testing, new cases are classified by extrapolation from the most similar stored cases.
+
+      For over fifteen years TiMBL has been mostly used in natural language processing as a machine learning classifier component, but its use extends to virtually any supervised machine learning domain. Due to its particular decision-tree-based implementation, TiMBL is in many cases far more efficient in classification than a standard k-nearest neighbor algorithm would be.
+    '';
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/timblserver.nix b/nixpkgs/pkgs/development/libraries/languagemachines/timblserver.nix
new file mode 100644
index 000000000000..27812e8b3f05
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/timblserver.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl
+, automake, autoconf, bzip2, libtar, libtool, pkg-config, autoconf-archive
+, libxml2
+, languageMachines
+}:
+
+let
+  release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-timblserver.json);
+in
+
+stdenv.mkDerivation {
+  name = "timblserver-${release.version}";
+  version = release.version;
+  src = fetchurl { inherit (release) url sha256;
+                   name = "timblserver-${release.version}.tar.gz"; };
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ automake autoconf bzip2 libtar libtool autoconf-archive
+                  libxml2
+                  languageMachines.ticcutils
+                  languageMachines.timbl
+                ];
+  preConfigure = "sh bootstrap.sh";
+
+  meta = with lib; {
+    description = "This server for TiMBL implements several memory-based learning algorithms";
+    homepage    = "https://github.com/LanguageMachines/timblserver/";
+    license     = licenses.gpl3;
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ roberth ];
+
+    longDescription = ''
+      This implements a server for TiMBL. TiMBL is an open source software package implementing several memory-based learning algorithms, among which IB1-IG, an implementation of k-nearest neighbor classification with feature weighting suitable for symbolic feature spaces, and IGTree, a decision-tree approximation of IB1-IG. All implemented algorithms have in common that they store some representation of the training set explicitly in memory. During testing, new cases are classified by extrapolation from the most similar stored cases.
+
+      For over fifteen years TiMBL has been mostly used in natural language processing as a machine learning classifier component, but its use extends to virtually any supervised machine learning domain. Due to its particular decision-tree-based implementation, TiMBL is in many cases far more efficient in classification than a standard k-nearest neighbor algorithm would be.
+    '';
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/ucto.nix b/nixpkgs/pkgs/development/libraries/languagemachines/ucto.nix
new file mode 100644
index 000000000000..d8c8d99552c8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/ucto.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchurl
+, automake, autoconf, libtool, pkg-config, autoconf-archive
+, libxml2, icu, bzip2, libtar
+, languageMachines
+}:
+
+let
+  release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-ucto.json);
+in
+
+stdenv.mkDerivation {
+  name = "ucto-${release.version}";
+  version = release.version;
+  src = fetchurl { inherit (release) url sha256;
+                   name = "ucto-${release.version}.tar.gz"; };
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ automake autoconf bzip2 libtool autoconf-archive
+                  icu libtar libxml2
+                  languageMachines.ticcutils
+                  languageMachines.libfolia
+                  languageMachines.uctodata
+                  # TODO textcat from libreoffice? Pulls in X11 dependencies?
+                ];
+  preConfigure = "sh bootstrap.sh;";
+
+  postInstall = ''
+    # ucto expects the data files installed in the same prefix
+    mkdir -p $out/share/ucto/;
+    for f in ${languageMachines.uctodata}/share/ucto/*; do
+      echo "Linking $f"
+      ln -s $f $out/share/ucto/;
+    done;
+  '';
+
+  meta = with lib; {
+    description = "A rule-based tokenizer for natural language";
+    homepage    = "https://languagemachines.github.io/ucto/";
+    license     = licenses.gpl3;
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ roberth ];
+
+    longDescription = ''
+      Ucto tokenizes text files: it separates words from punctuation, and splits sentences. It offers several other basic preprocessing steps such as changing case that you can all use to make your text suited for further processing such as indexing, part-of-speech tagging, or machine translation.
+
+      Ucto comes with tokenisation rules for several languages and can be easily extended to suit other languages. It has been incorporated for tokenizing Dutch text in Frog, a Dutch morpho-syntactic processor.
+    '';
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/uctodata.nix b/nixpkgs/pkgs/development/libraries/languagemachines/uctodata.nix
new file mode 100644
index 000000000000..cad636227249
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/uctodata.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl
+, automake, autoconf, libtool, pkg-config, autoconf-archive
+ }:
+
+let
+  release = builtins.fromJSON (builtins.readFile ./release-info/LanguageMachines-uctodata.json);
+in
+
+stdenv.mkDerivation {
+  name = "uctodata-${release.version}";
+  version = release.version;
+  src = fetchurl { inherit (release) url sha256;
+                   name = "uctodata-${release.version}.tar.gz"; };
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ automake autoconf libtool autoconf-archive ];
+  preConfigure = "sh bootstrap.sh";
+
+  meta = with lib; {
+    description = "A rule-based tokenizer for natural language";
+    homepage    = "https://languagemachines.github.io/ucto/";
+    license     = licenses.gpl3;
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ roberth ];
+
+    longDescription = ''
+      Ucto tokenizes text files: it separates words from punctuation, and splits sentences. It offers several other basic preprocessing steps such as changing case that you can all use to make your text suited for further processing such as indexing, part-of-speech tagging, or machine translation.
+
+      Ucto comes with tokenisation rules for several languages and can be easily extended to suit other languages. It has been incorporated for tokenizing Dutch text in Frog, a Dutch morpho-syntactic processor.
+    '';
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/update b/nixpkgs/pkgs/development/libraries/languagemachines/update
new file mode 100755
index 000000000000..3189637df746
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/update
@@ -0,0 +1,79 @@
+#!/usr/bin/env nix-shell
+#!nix-shell --packages curl
+#!nix-shell --packages jq
+#!nix-shell --packages parallel
+#!nix-shell -i bash
+
+# Exit immediately if a command exits with a non-zero status.
+# Exit when a producer fails in a pipe
+# Treat undefined variable references as errors
+set -e -o pipefail -u
+
+# Check if working directory is (probably) right
+test "./update" = $0 || {
+    echo "The working directory ought to be the same is the update script location. Please invoke as ./update" 1>&2
+    exit 1
+}
+
+# Create temporary directory with automatic cleanup
+readonly MY_TMP="$(mktemp -d)"
+cleanup () {
+    rm -rf "$MY_TMP"
+}
+trap cleanup EXIT
+
+# stdout: file containing release info and a convenient placeholder
+# for the sha256 attribute
+getRelease () {
+    local owner="$1"
+    local repo="$2"
+    local out="$MY_TMP/$owner--$repo-release"
+    curl -fSs https://api.github.com/repos/"$owner"/"$repo"/releases/latest \
+        | jq '{ version: .name, url: .tarball_url, sha256: "__SHA256__" }' \
+             > "$out"
+    echo "$out"
+}
+
+# 'getters' for the release info file
+
+# stdout: unquoted tarball url
+releaseUrl () {
+    local file="$1"
+    jq -r '.url' <"$file"
+}
+
+# stdout: unquoted version
+releaseVersion () {
+    local file="$1"
+    jq -r '.version' <"$file"
+}
+
+# Fetch release tarball and compute hash
+# stdout: base32 sha256 to be used in fetchurl
+getReleaseHash () {
+    local file="$1"
+    local name="$2"
+    nix-prefetch-url "$(releaseUrl "$file")" --name "$name-$(releaseVersion "$file").tar.gz"
+}
+
+# Write a release info file to release-info/$owner-$repo.json
+updateRelease () {
+    local owner="$1"
+    local repo="$2"
+    local r="$(getRelease "$owner" "$repo")"
+    local hash="$(getReleaseHash "$r" "$repo")"
+    sed \
+      -e s/__SHA256__/"$hash"/\
+      <"$r" \
+      >"release-info/$owner-$repo.json"
+}
+
+updateRelease LanguageMachines frogdata
+updateRelease LanguageMachines frog
+updateRelease LanguageMachines libfolia
+updateRelease LanguageMachines mbt
+updateRelease LanguageMachines ticcutils
+updateRelease LanguageMachines timbl
+updateRelease LanguageMachines timblserver
+updateRelease LanguageMachines ucto
+updateRelease LanguageMachines uctodata
diff --git a/nixpkgs/pkgs/development/libraries/lasem/default.nix b/nixpkgs/pkgs/development/libraries/lasem/default.nix
new file mode 100644
index 000000000000..9c49429ece45
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lasem/default.nix
@@ -0,0 +1,39 @@
+{ fetchurl, lib, stdenv, pkg-config, intltool, gobject-introspection, glib, gdk-pixbuf
+, libxml2, cairo, pango, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "lasem";
+  version = "0.4.4";
+
+  outputs = [ "bin" "out" "dev" "man" "doc" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0fds3fsx84ylsfvf55zp65y8xqjj5n8gbhcsk02vqglivk7izw4v";
+  };
+
+  nativeBuildInputs = [ pkg-config intltool gobject-introspection ];
+
+  propagatedBuildInputs = [
+    glib gdk-pixbuf libxml2 cairo pango
+  ];
+
+  enableParallelBuilding = true;
+  doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = {
+    description = "SVG and MathML rendering library";
+
+    homepage = "https://wiki.gnome.org/Projects/Lasem";
+    license = lib.licenses.gpl2Plus;
+
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/lasso/default.nix b/nixpkgs/pkgs/development/libraries/lasso/default.nix
new file mode 100644
index 000000000000..e5503169fd5f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lasso/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, autoconf, automake, autoreconfHook, fetchurl, glib, gobject-introspection, gtk-doc, libtool, libxml2, libxslt, openssl, pkg-config, python27Packages, xmlsec, zlib }:
+
+stdenv.mkDerivation rec {
+
+  pname = "lasso";
+  version = "2.7.0";
+
+  src = fetchurl {
+    url = "https://dev.entrouvert.org/lasso/lasso-${version}.tar.gz";
+    sha256 = "138x8pmj4k1pbah32z14rd8ylyx4lgz70s93m39vd17f8sjz50lj";
+
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ autoconf automake glib gobject-introspection gtk-doc libtool libxml2 libxslt openssl python27Packages.six xmlsec zlib ];
+
+  configurePhase = ''
+    ./configure --with-pkg-config=$PKG_CONFIG_PATH \
+                --disable-python \
+                --disable-perl \
+                --prefix=$out
+  '';
+
+  meta = with lib; {
+    homepage = "https://lasso.entrouvert.org/";
+    description = "Liberty Alliance Single Sign-On library";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ womfoo ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/lcms/cve-2013-4276.patch b/nixpkgs/pkgs/development/libraries/lcms/cve-2013-4276.patch
new file mode 100644
index 000000000000..8f2f32297828
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lcms/cve-2013-4276.patch
@@ -0,0 +1,62 @@
+diff -ur lcms-1.19.dfsg/samples/icctrans.c lcms-1.19.dfsg-patched/samples/icctrans.c
+--- lcms-1.19.dfsg/samples/icctrans.c	2009-10-30 15:57:45.000000000 +0000
++++ lcms-1.19.dfsg-patched/samples/icctrans.c	2013-08-06 11:53:14.385266647 +0100
+@@ -86,6 +86,8 @@
+ static LPcmsNAMEDCOLORLIST InputColorant = NULL;
+ static LPcmsNAMEDCOLORLIST OutputColorant = NULL;
+ 
++unsigned int Buffer_size = 4096;
++
+ 
+ // isatty replacement
+ 
+@@ -500,7 +502,7 @@
+ 
+     Prefix[0] = 0;
+     if (!lTerse)
+-        sprintf(Prefix, "%s=", C);
++        snprintf(Prefix, 20, "%s=", C);
+ 
+     if (InHexa)
+     {
+@@ -648,7 +650,9 @@
+ static
+ void GetLine(char* Buffer)
+ {    
+-    scanf("%s", Buffer);
++    char User_buffer[Buffer_size];
++    fgets(User_buffer, (Buffer_size - 1), stdin);
++    sscanf(User_buffer,"%s", Buffer);
+     
+     if (toupper(Buffer[0]) == 'Q') { // Quit?
+ 
+@@ -668,7 +672,7 @@
+ static
+ double GetAnswer(const char* Prompt, double Range)
+ {
+-    char Buffer[4096];
++    char Buffer[Buffer_size];
+     double val = 0.0;
+ 	       
+     if (Range == 0.0) {              // Range 0 means double value
+@@ -738,7 +742,7 @@
+ static
+ WORD GetIndex(void)
+ {
+-    char Buffer[4096], Name[40], Prefix[40], Suffix[40];
++    char Buffer[Buffer_size], Name[40], Prefix[40], Suffix[40];
+     int index, max;
+ 
+     max = cmsNamedColorCount(hTrans)-1;
+diff -ur lcms-1.19.dfsg/tifficc/tiffdiff.c lcms-1.19.dfsg-patched/tifficc/tiffdiff.c
+--- lcms-1.19.dfsg/tifficc/tiffdiff.c	2009-10-30 15:57:46.000000000 +0000
++++ lcms-1.19.dfsg-patched/tifficc/tiffdiff.c	2013-08-06 11:49:06.698951157 +0100
+@@ -633,7 +633,7 @@
+     cmsIT8SetSheetType(hIT8, "TIFFDIFF");
+     
+    
+-    sprintf(Buffer, "Differences between %s and %s", TiffName1, TiffName2);
++    snprintf(Buffer, 256, "Differences between %s and %s", TiffName1, TiffName2);
+   
+     cmsIT8SetComment(hIT8, Buffer);
+ 
diff --git a/nixpkgs/pkgs/development/libraries/lcms/default.nix b/nixpkgs/pkgs/development/libraries/lcms/default.nix
new file mode 100644
index 000000000000..9a957a119243
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lcms/default.nix
@@ -0,0 +1,24 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "lcms";
+  version = "1.19";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/lcms/${pname}-${version}.tar.gz";
+    sha256 = "1abkf8iphwyfs3z305z3qczm3z1i9idc1lz4gvfg92jnkz5k5bl0";
+  };
+
+  patches = [ ./cve-2013-4276.patch ];
+
+  outputs = [ "bin" "dev" "out" "man" ];
+
+  doCheck = false; # fails with "Error in Linear interpolation (2p): Must be i=8000, But is n=8001"
+
+  meta = {
+    description = "Color management engine";
+    homepage = "http://www.littlecms.com/";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/lcms2/default.nix b/nixpkgs/pkgs/development/libraries/lcms2/default.nix
new file mode 100644
index 000000000000..b600a2ca4c3d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lcms2/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, libtiff, libjpeg, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "lcms2";
+  version = "2.12";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/lcms/${pname}-${version}.tar.gz";
+    sha256 = "sha256-GGY5hehkEARVrD5QdiXEOMNxA1TYXly7fNQEPhH+EPU=";
+  };
+
+  outputs = [ "bin" "dev" "out" ];
+
+  propagatedBuildInputs = [ libtiff libjpeg zlib ];
+
+  # See https://trac.macports.org/ticket/60656
+  LDFLAGS = if stdenv.hostPlatform.isDarwin then "-Wl,-w" else null;
+
+  meta = with lib; {
+    description = "Color management engine";
+    homepage = "http://www.littlecms.com/";
+    license = licenses.mit;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ldacbt/default.nix b/nixpkgs/pkgs/development/libraries/ldacbt/default.nix
new file mode 100644
index 000000000000..36092507b8ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ldacbt/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ldacBT";
+  version = "2.0.2.3";
+
+  src = fetchFromGitHub {
+    repo = "ldacBT";
+    owner = "ehfive";
+    rev = "v${version}";
+    sha256 = "09dalysx4fgrgpfdm9a51x6slnf4iik1sqba4xjgabpvq91bnb63";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  meta = with lib; {
+    description = "AOSP libldac dispatcher";
+    homepage    = "https://github.com/EHfive/ldacBT";
+    license     = licenses.asl20;
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ adisbladis ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ldb/default.nix b/nixpkgs/pkgs/development/libraries/ldb/default.nix
new file mode 100644
index 000000000000..961760753abd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ldb/default.nix
@@ -0,0 +1,63 @@
+{ lib, stdenv
+, fetchurl
+, python3
+, pkg-config
+, readline
+, tdb
+, talloc
+, tevent
+, popt
+, libxslt
+, docbook-xsl-nons
+, docbook_xml_dtd_42
+, cmocka
+, wafHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ldb";
+  version = "2.3.0";
+
+  src = fetchurl {
+    url = "mirror://samba/ldb/${pname}-${version}.tar.gz";
+    sha256 = "0bcjj4gv48ddg44wyxpsvrs26xry6yy9x9k16qgz0bljs2rhilx4";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [
+    pkg-config
+    python3
+    wafHook
+    libxslt
+    docbook-xsl-nons
+    docbook_xml_dtd_42
+  ];
+
+  buildInputs = [
+    python3
+    readline # required to build python
+    tdb
+    talloc
+    tevent
+    popt
+    cmocka
+  ];
+
+  wafPath = "buildtools/bin/waf";
+
+  wafConfigureFlags = [
+    "--bundled-libraries=NONE"
+    "--builtin-libraries=replace"
+    "--without-ldb-lmdb"
+  ];
+
+  stripDebugList = [ "bin" "lib" "modules" ];
+
+  meta = with lib; {
+    description = "A LDAP-like embedded database";
+    homepage = "https://ldb.samba.org/";
+    license = licenses.lgpl3Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ldns/default.nix b/nixpkgs/pkgs/development/libraries/ldns/default.nix
new file mode 100644
index 000000000000..5873e707e7cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ldns/default.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, fetchurl, openssl, perl, which, dns-root-data }:
+
+stdenv.mkDerivation rec {
+  pname = "ldns";
+  version = "1.7.1";
+
+  src = fetchurl {
+    url = "https://www.nlnetlabs.nl/downloads/ldns/${pname}-${version}.tar.gz";
+    sha256 = "0ac242n7996fswq1a3nlh1bbbhrsdwsq4mx7xq8ffq6aplb4rj4a";
+  };
+
+  postPatch = ''
+    patchShebangs doc/doxyparse.pl
+  '';
+
+  outputs = [ "out" "dev" "man" "examples" ];
+
+  nativeBuildInputs = [ perl ];
+  buildInputs = [ openssl ];
+
+  configureFlags = [
+    "--with-ssl=${openssl.dev}"
+    "--with-trust-anchor=${dns-root-data}/root.key"
+    "--with-drill"
+    "--disable-gost"
+    "--with-examples"
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "ac_cv_func_malloc_0_nonnull=yes"
+    "ac_cv_func_realloc_0_nonnull=yes"
+  ];
+
+  checkInputs = [ which ];
+  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"
+  '';
+
+  meta = with lib; {
+    description = "Library with the aim of simplifying DNS programming in C";
+    license = licenses.bsd3;
+    homepage = "http://www.nlnetlabs.nl/projects/ldns/";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ldutils/default.nix b/nixpkgs/pkgs/development/libraries/ldutils/default.nix
new file mode 100644
index 000000000000..5f09c08d4d1e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ldutils/default.nix
@@ -0,0 +1,39 @@
+{ mkDerivation
+, lib
+, fetchFromGitLab
+, qtcharts
+, qtsvg
+, qmake
+}:
+
+mkDerivation rec {
+  pname = "ldutils";
+  version = "1.03";
+
+  src = fetchFromGitLab {
+    owner = "ldutils-projects";
+    repo = pname;
+    rev = "v_${version}";
+    sha256 = "0pi05py71hh5vlhl0kjh9wxmd7yixw10s0kr2wb4l4c0abqxr82j";
+  };
+
+  buildInputs = [
+    qtcharts
+    qtsvg
+  ];
+
+  nativeBuildInputs = [
+    qmake
+  ];
+
+  LDUTILS_LIB=placeholder "out";
+  LDUTILS_INCLUDE=placeholder "out";
+
+  meta = with lib; {
+    description = "Headers and link library for other ldutils projects";
+    homepage = "https://gitlab.com/ldutils-projects/ldutils";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ sohalt ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/leatherman/default.nix b/nixpkgs/pkgs/development/libraries/leatherman/default.nix
new file mode 100644
index 000000000000..24bec8ec350f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/leatherman/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, boost, cmake, curl, ruby }:
+
+stdenv.mkDerivation rec {
+  pname = "leatherman";
+  version = "1.12.6";
+
+  src = fetchFromGitHub {
+    sha256 = "sha256-k5Lt/NCSlBaTGhpR4T3Q4Ih+RR1xKROxz+RNYor7zaQ=";
+    rev = version;
+    repo = "leatherman";
+    owner = "puppetlabs";
+  };
+
+  NIX_CFLAGS_COMPILE = "-Wno-error";
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost curl ruby ];
+
+  meta = with lib; {
+    homepage = "https://github.com/puppetlabs/leatherman/";
+    description = "A collection of C++ and CMake utility libraries";
+    license = licenses.asl20;
+    maintainers = [ maintainers.womfoo ];
+    platforms = platforms.unix;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/lemon-graph/default.nix b/nixpkgs/pkgs/development/libraries/lemon-graph/default.nix
new file mode 100644
index 000000000000..04f0514781bf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lemon-graph/default.nix
@@ -0,0 +1,28 @@
+{ lib
+, stdenv
+, fetchurl
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "lemon-graph";
+  version = "1.3.1";
+
+  src = fetchurl {
+    url = "https://lemon.cs.elte.hu/pub/sources/lemon-${version}.tar.gz";
+    sha256 = "1j6kp9axhgna47cfnmk1m7vnqn01hwh7pf1fp76aid60yhjwgdvi";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://lemon.cs.elte.hu/trac/lemon";
+    description = "Efficient library for combinatorial optimization tasks on graphs and networks";
+    license = licenses.boost;
+    maintainers = with maintainers; [ trepetti ];
+    platforms = platforms.all;
+    broken = stdenv.isAarch64 || stdenv.isDarwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/lensfun/default.nix b/nixpkgs/pkgs/development/libraries/lensfun/default.nix
new file mode 100644
index 000000000000..23675c9f9f89
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lensfun/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, glib, zlib, libpng, cmake }:
+
+let
+  version = "0.3.95";
+  pname = "lensfun";
+
+  # Fetch a more recent version of the repo containing a more recent lens
+  # database
+  lensfunDatabase = fetchFromGitHub {
+    owner = "lensfun";
+    repo = "lensfun";
+    rev = "4672d765a17bfef7bc994ca7008cb717c61045d5";
+    sha256 = "00x35xhpn55j7f8qzakb6wl1ccbljg1gqjb93jl9w3mha2bzsr41";
+  };
+
+in
+stdenv.mkDerivation {
+  inherit pname version;
+
+  src = fetchFromGitHub {
+    owner = "lensfun";
+    repo = "lensfun";
+    rev = "v${version}";
+    sha256 = "0isli0arns8bmxqpbr1jnbnqh5wvspixdi51adm671f9ngng7x5r";
+  };
+
+  # replace database with a more recent snapshot
+  postUnpack = ''
+    rm -R source/data/db
+    cp -R ${lensfunDatabase}/data/db source/data
+  '';
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ glib zlib libpng ];
+
+  cmakeFlags = [ "-DINSTALL_HELPER_SCRIPTS=OFF" ];
+
+  meta = with lib; {
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ flokli ];
+    license = lib.licenses.lgpl3;
+    description = "An opensource database of photographic lenses and their characteristics";
+    homepage = "https://lensfun.github.io";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/leptonica/default.nix b/nixpkgs/pkgs/development/libraries/leptonica/default.nix
new file mode 100644
index 000000000000..723b5a0ec1ff
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/leptonica/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, which, gnuplot
+, giflib, libjpeg, libpng, libtiff, libwebp, openjpeg, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "leptonica";
+  version = "1.81.1";
+
+  src = fetchurl {
+    url = "http://www.leptonica.org/source/${pname}-${version}.tar.gz";
+    sha256 = "sha256-D06zFem93deX9MVf3qTh9F/Kfjs1ii/Gk/2VfOLEPKk=";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ giflib libjpeg libpng libtiff libwebp openjpeg zlib ];
+  enableParallelBuilding = true;
+
+  checkInputs = [ which gnuplot ];
+
+  # Fails on pngio_reg for unknown reason
+  doCheck = false; # !stdenv.isDarwin;
+
+  meta = {
+    description = "Image processing and analysis library";
+    homepage = "http://www.leptonica.org/";
+    license = lib.licenses.bsd2; # http://www.leptonica.org/about-the-license.html
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/lesstif/c-missing_xm_h.patch b/nixpkgs/pkgs/development/libraries/lesstif/c-missing_xm_h.patch
new file mode 100644
index 000000000000..2d298d5f4c4e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lesstif/c-missing_xm_h.patch
@@ -0,0 +1,11 @@
+--- lesstif2-0.94.4.orig/include/Motif-2.1/Xm/XmStrDefs.h
++++ lesstif2-0.94.4/include/Motif-2.1/Xm/XmStrDefs.h
+@@ -28,6 +28,8 @@
+ 
+ #include <X11/StringDefs.h>
+ 
++#include <Xm/Xm.h>
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
diff --git a/nixpkgs/pkgs/development/libraries/lesstif/c-render_table_crash.patch b/nixpkgs/pkgs/development/libraries/lesstif/c-render_table_crash.patch
new file mode 100644
index 000000000000..1699dbe19084
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lesstif/c-render_table_crash.patch
@@ -0,0 +1,11 @@
+--- lesstif2-0.95.0.orig/lib/Xm-2.1/RenderTable.c
++++ lesstif2-0.95.0/lib/Xm-2.1/RenderTable.c
+@@ -465,7 +465,7 @@
+ 	DEBUGOUT(_LtDebug(__FILE__, w, "_XmRenderTableFinaliseTag(%s)\n", tag));
+ #if 1
+ 	/* Experimental start */
+-	if (r->dpy == 0)
++	if (r->dpy == 0  &&  w)
+ 		r->dpy = XtDisplay(w);
+ 	/* Experimental end */
+ #endif
diff --git a/nixpkgs/pkgs/development/libraries/lesstif/c-xpmpipethrough.patch b/nixpkgs/pkgs/development/libraries/lesstif/c-xpmpipethrough.patch
new file mode 100644
index 000000000000..69f9a2464c6d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lesstif/c-xpmpipethrough.patch
@@ -0,0 +1,381 @@
+Index: lesstif2-0.95.0/lib/Xm-2.1/XpmRdFToI.c
+===================================================================
+--- lesstif2-0.95.0.orig/lib/Xm-2.1/XpmRdFToI.c	2004-11-18 22:00:58.000000000 +0100
++++ lesstif2-0.95.0/lib/Xm-2.1/XpmRdFToI.c	2006-07-11 11:13:29.000000000 +0200
+@@ -44,11 +44,15 @@
+    DebugUtil.h! */
+ #include <stdio.h>
+ #include <string.h>
++#include <errno.h>
+ 
+ #include <ctype.h>
+ #ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
++#ifdef HAVE_SYS_WAIT_H
++#include <sys/wait.h>
++#endif
+ #ifdef HAVE_SYS_STAT_H
+ #include <sys/stat.h>
+ #endif
+@@ -87,16 +91,6 @@
+  	    strcpy(dst, src); \
+ 	else return (XpmFileInvalid); }
+ #endif
+-#include <sys/stat.h>
+-#if !defined(NO_ZPIPE) && defined(WIN32)
+-# define popen _popen
+-# define pclose _pclose
+-# if defined(STAT_ZFILE)
+-#  include <io.h>
+-#  define stat _stat
+-#  define fstat _fstat
+-# endif
+-#endif
+ 
+ LFUNC(OpenReadFile, int, (char *filename, xpmData *mdata));
+ LFUNC(xpmDataClose, void, (xpmData *mdata));
+@@ -173,90 +167,131 @@
+ }
+ #endif /* CXPMPROG */
+ 
+-/*
+- * open the given file to be read as an xpmData which is returned.
+- */
+ #ifndef NO_ZPIPE
+-	FILE *s_popen(char *cmd, const char *type);
+-#else
+-#	define s_popen popen
++/* Do not depend on errno after read_through */
++FILE*
++xpmPipeThrough(fd, cmd, arg1, mode)
++    int fd;
++    const char* cmd;
++    const char* arg1;
++    const char* mode;
++{
++    FILE* fp;
++    int status, fds[2], in = 0, out = 1;
++    pid_t pid;
++    if ( 'w' == *mode )
++	out = 0, in = 1;
++    if ( pipe(fds) < 0 )
++	return NULL;
++    pid = fork();
++    if ( pid < 0 )
++	goto fail1;
++    if ( 0 == pid )
++    {
++	close(fds[in]);
++	if ( dup2(fds[out], out) < 0 )
++	    goto err;
++	close(fds[out]);
++	if ( dup2(fd, in) < 0 )
++	    goto err;
++	close(fd);
++	pid = fork();
++	if ( pid < 0 )
++	    goto err;
++	if ( 0 == pid )
++	{
++	    execlp(cmd, cmd, arg1, NULL);
++	    perror(cmd);
++	    goto err;
++	}
++	_exit(0);
++    err:
++	_exit(1);
++    }
++    close(fds[out]);
++    /* calling process: wait for first child */
++    while ( waitpid(pid, &status, 0) < 0 && EINTR == errno )
++	;
++    if ( WIFSIGNALED(status) ||
++	 (WIFEXITED(status) && WEXITSTATUS(status) != 0) )
++	goto fail2;
++    fp = fdopen(fds[in], mode);
++    if ( !fp )
++	goto fail2;
++    close(fd); /* still open in 2nd child */
++    return fp;
++fail1:
++    close(fds[out]);
++fail2:
++    close(fds[in]);
++    return NULL;
++}
+ #endif
+ 
++/*
++ * open the given file to be read as an xpmData which is returned.
++ */
+ static int
+ OpenReadFile(filename, mdata)
+     char *filename;
+     xpmData *mdata;
+ {
+-#ifndef NO_ZPIPE
+-    char buf[BUFSIZ];
+-# ifdef STAT_ZFILE
+-    char *compressfile;
+-    struct stat status;
+-# endif
+-#endif
+-
+     if (!filename) {
+ 	mdata->stream.file = (stdin);
+ 	mdata->type = XPMFILE;
+     } else {
+-#ifndef NO_ZPIPE
+-	size_t len = strlen(filename);
+-
+-	if(len == 0                        ||
+-	   filename[len-1] == '/')
+-		return(XpmOpenFailed);
+-	if ((len > 2) && !strcmp(".Z", filename + (len - 2))) {
+-	    mdata->type = XPMPIPE;
+-	    snprintf(buf, sizeof(buf), "uncompress -c \"%s\"", filename);
+-	    if (!(mdata->stream.file = s_popen(buf, "r")))
+-		return (XpmOpenFailed);
+-
+-	} else if ((len > 3) && !strcmp(".gz", filename + (len - 3))) {
+-	    mdata->type = XPMPIPE;
+-	    snprintf(buf, sizeof(buf), "gunzip -qc \"%s\"", filename);
+-	    if (!(mdata->stream.file = s_popen(buf, "r")))
+-		return (XpmOpenFailed);
+-
+-	} else {
+-# ifdef STAT_ZFILE
+-	    if (!(compressfile = (char *) XpmMalloc(len + 4)))
++	int fd = open(filename, O_RDONLY);
++#if defined(NO_ZPIPE)
++	if ( fd < 0 )
++	    return XpmOpenFailed;
++#else
++	const char* ext = NULL;
++	if ( fd >= 0 )
++	    ext = strrchr(filename, '.');
++#ifdef STAT_ZFILE /* searching for z-files if the given name not found */
++	else
++	{
++	    size_t len = strlen(filename);
++	    char *compressfile = (char *) XpmMalloc(len + 4);
++	    if ( !compressfile )
+ 		return (XpmNoMemory);
+-
+-	    snprintf(compressfile, len+4, "%s.Z", filename);
+-	    if (!stat(compressfile, &status)) {
+-		snprintf(buf, sizeof(buf), "uncompress -c \"%s\"", compressfile);
+-		if (!(mdata->stream.file = s_popen(buf, "r"))) {
++	    strcpy(compressfile, filename);
++	    strcpy(compressfile + len, ext = ".Z");
++	    fd = open(compressfile, O_RDONLY);
++	    if ( fd < 0 )
++	    {
++		strcpy(compressfile + len, ext = ".gz");
++		fd = open(compressfile, O_RDONLY);
++		if ( fd < 0 )
++		{
+ 		    XpmFree(compressfile);
+-		    return (XpmOpenFailed);
+-		}
+-		mdata->type = XPMPIPE;
+-	    } else {
+-		snprintf(compressfile, len+4, "%s.gz", filename);
+-		if (!stat(compressfile, &status)) {
+-		    snprintf(buf, sizeof(buf), "gunzip -c \"%s\"", compressfile);
+-		    if (!(mdata->stream.file = s_popen(buf, "r"))) {
+-			XpmFree(compressfile);
+-			return (XpmOpenFailed);
+-		    }
+-		    mdata->type = XPMPIPE;
+-		} else {
+-# endif
+-#endif
+-		    if (!(mdata->stream.file = fopen(filename, "r"))) {
+-#if !defined(NO_ZPIPE) && defined(STAT_ZFILE)
+-			XpmFree(compressfile);
+-#endif
+-			return (XpmOpenFailed);
+-		    }
+-		    mdata->type = XPMFILE;
+-#ifndef NO_ZPIPE
+-# ifdef STAT_ZFILE
++		    return XpmOpenFailed;
+ 		}
+ 	    }
+ 	    XpmFree(compressfile);
+-# endif
+ 	}
+ #endif
++	if ( ext && !strcmp(ext, ".Z") )
++	{
++	    mdata->type = XPMPIPE;
++	    mdata->stream.file = xpmPipeThrough(fd, "uncompress", "-c", "r");
++	}
++	else if ( ext && !strcmp(ext, ".gz") )
++	{
++	    mdata->type = XPMPIPE;
++	    mdata->stream.file = xpmPipeThrough(fd, "gunzip", "-qc", "r");
++	}
++	else
++#endif /* z-files */
++	{
++	    mdata->type = XPMFILE;
++	    mdata->stream.file = fdopen(fd, "r");
++	}
++	if (!mdata->stream.file)
++	{
++	    close(fd);
++	    return (XpmOpenFailed);
++	}
+     }
+     mdata->CommentLength = 0;
+ #ifdef CXPMPROG
+@@ -273,15 +308,6 @@
+ xpmDataClose(mdata)
+     xpmData *mdata;
+ {
+-    switch (mdata->type) {
+-    case XPMFILE:
+-	if (mdata->stream.file != (stdin))
+-	    fclose(mdata->stream.file);
+-	break;
+-#ifndef NO_ZPIPE
+-    case XPMPIPE:
++    if (mdata->stream.file != (stdin))
+ 	fclose(mdata->stream.file);
+-	break;
+-#endif
+-    }
+ }
+Index: lesstif2-0.95.0/lib/Xm-2.1/XpmWrFFrI.c
+===================================================================
+--- lesstif2-0.95.0.orig/lib/Xm-2.1/XpmWrFFrI.c	2005-04-13 20:03:27.000000000 +0200
++++ lesstif2-0.95.0/lib/Xm-2.1/XpmWrFFrI.c	2006-07-11 11:13:29.000000000 +0200
+@@ -50,11 +50,15 @@
+    DebugUtil.h! */
+ #include <stdio.h>
+ #include <string.h>
++#include <errno.h>
+ 
+ #include <ctype.h>
+ #ifdef HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
++#ifdef HAVE_SYS_WAIT_H
++#include <sys/wait.h>
++#endif
+ #ifdef HAVE_SYS_STAT_H
+ #include <sys/stat.h>
+ #endif
+@@ -94,11 +98,6 @@
+ 	else return (XpmFileInvalid); }
+ #endif
+ 
+-#if !defined(NO_ZPIPE) && defined(WIN32)
+-# define popen _popen
+-# define pclose _pclose
+-#endif
+-
+ /* MS Windows define a function called WriteFile @#%#&!!! */
+ LFUNC(xpmWriteFile, int, (FILE *file, XpmImage *image, char *name,
+ 			  XpmInfo *info));
+@@ -354,58 +353,48 @@
+     fprintf(file, ",\n\"XPMENDEXT\"");
+ }
+ 
++
++#ifndef NO_ZPIPE
++FUNC(xpmPipeThrough, FILE*, (int fd,
++			     const char* cmd,
++			     const char* arg1,
++			     const char* mode));
++#endif
++
+ /*
+  * open the given file to be written as an xpmData which is returned
+  */
+-#ifndef NO_ZPIPE
+-	FILE *s_popen(char *cmd, const char *type);
+-#else
+-#	define s_popen popen
+-#endif
+ static int
+ OpenWriteFile(filename, mdata)
+     char *filename;
+     xpmData *mdata;
+ {
+-#ifndef NO_ZPIPE
+-    char buf[BUFSIZ];
+-
+-#endif
+-
+     if (!filename) {
+ 	mdata->stream.file = (stdout);
+ 	mdata->type = XPMFILE;
+     } else {
+ #ifndef NO_ZPIPE
+-	size_t len = strlen(filename);
+-
+-	if(len == 0                        ||
+-	   filename[0] == '/'              ||
+-	   strstr(filename, "../") != NULL ||
+-	   filename[len-1] == '/')
+-		return(XpmOpenFailed);
+-
++	size_t len;
++#endif
++	int fd = open(filename, O_WRONLY|O_CREAT|O_TRUNC, 0644);
++	if ( fd < 0 )
++	    return(XpmOpenFailed);
++#ifndef NO_ZPIPE
++	len = strlen(filename);
+ 	if (len > 2 && !strcmp(".Z", filename + (len - 2))) {
+-	    snprintf(buf, sizeof(buf), "compress > \"%s\"", filename);
+-	    if (!(mdata->stream.file = s_popen(buf, "w")))
+-		return (XpmOpenFailed);
+-
++	    mdata->stream.file = xpmPipeThrough(fd, "compress", NULL, "w");
+ 	    mdata->type = XPMPIPE;
+ 	} else if (len > 3 && !strcmp(".gz", filename + (len - 3))) {
+-	    snprintf(buf, sizeof(buf), "gzip -q > \"%s\"", filename);
+-	    if (!(mdata->stream.file = s_popen(buf, "w")))
+-		return (XpmOpenFailed);
+-
++	    mdata->stream.file = xpmPipeThrough(fd, "gzip", "-q", "w");
+ 	    mdata->type = XPMPIPE;
+-	} else {
++	} else
+ #endif
+-	    if (!(mdata->stream.file = fopen(filename, "w")))
+-		return (XpmOpenFailed);
+-
++	{
++	    mdata->stream.file = fdopen(fd, "w");
+ 	    mdata->type = XPMFILE;
+-#ifndef NO_ZPIPE
+ 	}
+-#endif
++	if (!mdata->stream.file)
++	    return (XpmOpenFailed);
+     }
+     return (XpmSuccess);
+ }
+@@ -417,15 +406,6 @@
+ xpmDataClose(mdata)
+     xpmData *mdata;
+ {
+-    switch (mdata->type) {
+-    case XPMFILE:
+-	if (mdata->stream.file != (stdout))
+-	    fclose(mdata->stream.file);
+-	break;
+-#ifndef NO_ZPIPE
+-    case XPMPIPE:
++    if (mdata->stream.file != (stdout))
+ 	fclose(mdata->stream.file);
+-	break;
+-#endif
+-    }
+ }
diff --git a/nixpkgs/pkgs/development/libraries/lesstif/default.nix b/nixpkgs/pkgs/development/libraries/lesstif/default.nix
new file mode 100644
index 000000000000..dc0c8c0ed741
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lesstif/default.nix
@@ -0,0 +1,29 @@
+{lib, stdenv, fetchurl, xlibsWrapper, libXp, libXau}:
+
+stdenv.mkDerivation rec {
+  pname = "lesstif";
+  version = "0.95.2";
+  src = fetchurl {
+    url = "mirror://sourceforge/lesstif/${pname}-${version}.tar.bz2";
+    sha256 = "1qzpxjjf7ri1jzv71mvq5m9g8hfaj5yzwp30rwxlm6n2b24a6jpb";
+  };
+  buildInputs = [xlibsWrapper];
+  propagatedBuildInputs = [libXp libXau];
+
+  # These patches fix a number of later issues - in particular the
+  # render_table_crash shows up in 'arb'. The same patches appear
+  # in Debian, so we assume they have been sent upstream.
+  #
+  patches = [
+    ./c-missing_xm_h.patch
+    ./c-render_table_crash.patch
+    ./c-xpmpipethrough.patch
+    ];
+
+  meta = with lib; {
+    description = "An open source clone of the Motif widget set";
+    homepage = "http://lesstif.sourceforge.net";
+    platforms = platforms.unix;
+    license = with licenses; [ gpl2 lgpl2 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/leveldb/default.nix b/nixpkgs/pkgs/development/libraries/leveldb/default.nix
new file mode 100644
index 000000000000..2a7fb196ea68
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/leveldb/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchFromGitHub, fixDarwinDylibNames, snappy }:
+
+stdenv.mkDerivation rec {
+  pname = "leveldb";
+  version = "1.20";
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "leveldb";
+    rev = "v${version}";
+    sha256 = "01kxga1hv4wp94agx5vl3ybxfw5klqrdsrb6p6ywvnjmjxm8322y";
+  };
+
+  buildInputs = [ snappy ];
+
+  nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames;
+
+  doCheck = true;
+
+  buildFlags = [ "all" ];
+
+  postPatch = lib.optionalString stdenv.hostPlatform.isStatic ''
+    # remove shared objects from "all" target
+    sed -i '/^all:/ s/$(SHARED_LIBS) $(SHARED_PROGRAMS)//' Makefile
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    install -D -t $out/include/leveldb include/leveldb/*
+    install -D helpers/memenv/memenv.h $out/include/leveldb/helpers
+
+    install -D -t $out/lib out-{static,shared}/lib*
+    install -D -t $out/bin out-static/{leveldbutil,db_bench}
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/google/leveldb";
+    description = "Fast and lightweight key/value database library by Google";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/levmar/default.nix b/nixpkgs/pkgs/development/libraries/levmar/default.nix
new file mode 100644
index 000000000000..f1ba199fc8e0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/levmar/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "levmar";
+  version = "2.6";
+
+  src = fetchurl {
+    url = "https://www.ics.forth.gr/~lourakis/levmar/${pname}-${version}.tgz";
+    sha256 = "1mxsjip9x782z6qa6k5781wjwpvj5aczrn782m9yspa7lhgfzx1v";
+  };
+
+  patchPhase = ''
+    substituteInPlace levmar.h --replace "define HAVE_LAPACK" "undef HAVE_LAPACK"
+    sed -i 's/LAPACKLIBS=.*/LAPACKLIBS=/' Makefile
+    substituteInPlace Makefile --replace "gcc" "${stdenv.cc.targetPrefix}cc"
+  '';
+
+  installPhase = ''
+    mkdir -p $out/include $out/lib
+    cp lm.h $out/include
+    cp liblevmar.a $out/lib
+  '';
+
+  meta = {
+    description = "ANSI C implementations of Levenberg-Marquardt, usable also from C++";
+    homepage = "https://www.ics.forth.gr/~lourakis/levmar/";
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/lib2geom/default.nix b/nixpkgs/pkgs/development/libraries/lib2geom/default.nix
new file mode 100644
index 000000000000..755ed6b814e6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lib2geom/default.nix
@@ -0,0 +1,60 @@
+{ stdenv
+, fetchFromGitLab
+, cmake
+, ninja
+, pkg-config
+, boost
+, glib
+, gsl
+, cairo
+, double-conversion
+, gtest
+, lib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "lib2geom";
+  version = "1.1";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitLab {
+    owner = "inkscape";
+    repo = "lib2geom";
+    rev = "refs/tags/${version}";
+    sha256 = "sha256-u9pbpwVzAXzrM2/tQnd1B6Jo9Fzg6UZBr9AtUsNMfQ0=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    ninja
+    pkg-config
+  ];
+
+  buildInputs = [
+    boost
+    glib
+    gsl
+    cairo
+    double-conversion
+  ];
+
+  checkInputs = [
+    gtest
+  ];
+
+  cmakeFlags = [
+    "-DCMAKE_SKIP_BUILD_RPATH=OFF" # for tests
+    "-D2GEOM_BUILD_SHARED=ON"
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Easy to use 2D geometry library in C++";
+    homepage = "https://gitlab.com/inkscape/lib2geom";
+    license = [ licenses.lgpl21Only licenses.mpl11 ];
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/lib3ds/default.nix b/nixpkgs/pkgs/development/libraries/lib3ds/default.nix
new file mode 100644
index 000000000000..6e926dfb421c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lib3ds/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl, unzip }:
+
+stdenv.mkDerivation rec {
+  name = "lib3ds-1.3.0";
+
+  src = fetchurl {
+    url = "http://lib3ds.googlecode.com/files/${name}.zip";
+    sha256 = "1qr9arfdkjf7q11xhvxwzmhxqz3nhcjkyb8zzfjpz9jm54q0rc7m";
+  };
+
+  nativeBuildInputs = [ unzip ];
+
+  meta = {
+    description = "Library for managing 3D-Studio Release 3 and 4 \".3DS\" files";
+    homepage = "http://lib3ds.sourceforge.net/";
+    license = "LGPL";
+    platforms = lib.platforms.unix;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/lib3mf/default.nix b/nixpkgs/pkgs/development/libraries/lib3mf/default.nix
new file mode 100644
index 000000000000..b301ac13c2d8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lib3mf/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchFromGitHub, cmake, ninja, automaticcomponenttoolkit
+, pkg-config, libzip, gtest, openssl, libuuid, libossp_uuid }:
+
+stdenv.mkDerivation rec {
+  pname = "lib3mf";
+  version = "2.2.0";
+
+  src = fetchFromGitHub {
+    owner = "3MFConsortium";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-WMTTYYgpCIM86a6Jw8iah/YVXN9T5youzEieWL/d+Bc=";
+  };
+
+  nativeBuildInputs = [ cmake ninja pkg-config ];
+
+  outputs = [ "out" "dev" ];
+
+  cmakeFlags = [
+    "-DCMAKE_INSTALL_INCLUDEDIR=${placeholder "out"}/include/lib3mf"
+    "-DUSE_INCLUDED_ZLIB=OFF"
+    "-DUSE_INCLUDED_LIBZIP=OFF"
+    "-DUSE_INCLUDED_GTEST=OFF"
+    "-DUSE_INCLUDED_SSL=OFF"
+  ];
+
+  buildInputs = [
+    libzip gtest openssl
+  ] ++ (if stdenv.isDarwin then [ libossp_uuid ] else [ libuuid ]);
+
+  postPatch = ''
+    # fix libdir=''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+    sed -i 's,=''${\(exec_\)\?prefix}/,=,' lib3mf.pc.in
+
+    # replace bundled binaries
+    for i in AutomaticComponentToolkit/bin/act.*; do
+      ln -sf ${automaticcomponenttoolkit}/bin/act $i
+    done
+  '';
+
+  meta = with lib; {
+    description = "Reference implementation of the 3D Manufacturing Format file standard";
+    homepage = "https://3mf.io/";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ gebner ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libAfterImage/default.nix b/nixpkgs/pkgs/development/libraries/libAfterImage/default.nix
new file mode 100644
index 000000000000..de463cdf42cb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libAfterImage/default.nix
@@ -0,0 +1,76 @@
+{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, giflib, libjpeg, libpng, libX11, zlib
+, static ? stdenv.hostPlatform.isStatic
+, withX ? !stdenv.isDarwin }:
+
+stdenv.mkDerivation {
+  pname = "libAfterImage";
+  version = "1.20";
+
+  src = fetchurl {
+    name = "libAfterImage-1.20.tar.bz2";
+    urls = [
+      "https://sourceforge.net/projects/afterstep/files/libAfterImage/1.20/libAfterImage-1.20.tar.bz2/download"
+      "ftp://ftp.afterstep.org/stable/libAfterImage/libAfterImage-1.20.tar.bz2"
+    ];
+    sha256 = "0n74rxidwig3yhr6fzxsk7y19n1nq1f296lzrvgj5pfiyi9k48vf";
+  };
+
+  patches = [
+    # add back --with-gif option
+    (fetchpatch {
+      name = "libafterimage-gif.patch";
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/libafterimage/files/libafterimage-gif.patch?id=4aa4fca00611b0b3a4007870da43cc5fd63f76c4";
+      sha256 = "16pa94wlqpd7h6mzs4f0qm794yk1xczrwsgf93kdd3g0zbjq3rnr";
+    })
+
+    # fix build with newer giflib
+    (fetchpatch {
+      name = "libafterimage-giflib5-v2.patch";
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/libafterimage/files/libafterimage-giflib5-v2.patch?id=4aa4fca00611b0b3a4007870da43cc5fd63f76c4";
+      sha256 = "0qwydqy9bm73cg5n3vm97aj4jfi70p7fxqmfbi54vi78z593brln";
+      stripLen = 1;
+    })
+
+    # fix build with newer libpng
+    (fetchpatch {
+      name = "libafterimage-libpng15.patch";
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/libafterimage/files/libafterimage-libpng15.patch?id=4aa4fca00611b0b3a4007870da43cc5fd63f76c4";
+      sha256 = "1qyvf7786hayasfnnilfbri3p99cfz5wjpbli3gdqj2cvk6mpydv";
+    })
+
+    # fix an ldconfig problem
+    (fetchpatch {
+      name = "libafterimage-makefile.patch";
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/libafterimage/files/libafterimage-makefile.in.patch?id=4aa4fca00611b0b3a4007870da43cc5fd63f76c4";
+      sha256 = "1n6fniz6dldms615046yhc4mlg9gb53y4yfia8wfz6szgq5zicj4";
+    })
+  ];
+  patchFlags = [ "-p0" ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ giflib libjpeg libpng zlib ] ++ lib.optional withX libX11;
+
+  preConfigure = ''
+    rm -rf {libjpeg,libpng,libungif,zlib}/
+    substituteInPlace Makefile.in \
+      --replace "include .depend" ""
+  '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace Makefile.in \
+      --replace "-soname," "-install_name,$out/lib/"
+  '';
+
+  configureFlags = [
+    "--with-gif"
+    "--disable-mmx-optimization"
+    "--${if static then "enable" else "disable"}-staticlibs"
+    "--${if !static then "enable" else "disable"}-sharedlibs"
+  ] ++ lib.optional withX "--with-x";
+
+  meta = with lib; {
+    homepage = "http://www.afterstep.org/afterimage/";
+    description = "A generic image manipulation library";
+    platforms = platforms.unix;
+    maintainers = [ maintainers.veprbl ];
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libHX/default.nix b/nixpkgs/pkgs/development/libraries/libHX/default.nix
new file mode 100644
index 000000000000..8761ac1e5ef8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libHX/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, autoconf, automake, libtool }:
+
+stdenv.mkDerivation rec {
+  pname = "libHX";
+  version = "3.22";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libhx/libHX/${version}/${pname}-${version}.tar.xz";
+    sha256 = "18w39j528lyg2026dr11f2xxxphy91cg870nx182wbd8cjlqf86c";
+  };
+
+  patches = [];
+
+  buildInputs = [ autoconf automake libtool ];
+
+  preConfigure = ''
+    sh autogen.sh
+    '';
+
+  meta = with lib; {
+    homepage = "http://libhx.sourceforge.net/";
+    longDescription = ''
+      libHX is a C library (with some C++ bindings available) that provides data structures
+      and functions commonly needed, such as maps, deques, linked lists, string formatting
+      and autoresizing, option and config file parsing, type checking casts and more.
+      '';
+    maintainers = [ maintainers.tstrobel ];
+    platforms = platforms.linux;
+    license = with licenses; [ gpl3 lgpl21Plus wtfpl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libLAS/default.nix b/nixpkgs/pkgs/development/libraries/libLAS/default.nix
new file mode 100644
index 000000000000..7d762fc80775
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libLAS/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, boost, cmake, gdal, libgeotiff, libtiff, LASzip2, fixDarwinDylibNames }:
+
+stdenv.mkDerivation rec {
+  name = "libLAS-1.8.1";
+
+  src = fetchurl {
+    url = "https://download.osgeo.org/liblas/${name}.tar.bz2";
+    sha256 = "0xjfxb3ydvr2258ji3spzyf81g9caap19ql2pk91wiivqsc4mnws";
+  };
+
+  nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+  buildInputs = [ boost gdal libgeotiff libtiff LASzip2 ];
+
+  cmakeFlags = [
+    "-DGDAL_CONFIG=${gdal}/bin/gdal-config"
+    "-DWITH_LASZIP=ON"
+    # libLAS is currently not compatible with LASzip 3,
+    # see https://github.com/libLAS/libLAS/issues/144.
+    "-DLASZIP_INCLUDE_DIR=${LASzip2}/include"
+    "-DCMAKE_EXE_LINKER_FLAGS=-pthread"
+  ];
+
+  postFixup = lib.optionalString stdenv.isDarwin ''
+    install_name_tool -change "@rpath/liblas.3.dylib" "$out/lib/liblas.3.dylib" $out/lib/liblas_c.dylib
+  '';
+
+  meta = {
+    description = "LAS 1.0/1.1/1.2 ASPRS LiDAR data translation toolset";
+    homepage = "https://liblas.org";
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.unix;
+    maintainers = [ lib.maintainers.michelk ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libaacs/default.nix b/nixpkgs/pkgs/development/libraries/libaacs/default.nix
new file mode 100644
index 000000000000..c291c07abad3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libaacs/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, libgcrypt, libgpgerror, bison, flex }:
+
+# library that allows libbluray to play AACS protected bluray disks
+# libaacs does not infringe DRM's right or copyright. See the legal page of the website for more info.
+
+# Info on how to use / obtain aacs keys:
+# http://vlc-bluray.whoknowsmy.name/
+# https://wiki.archlinux.org/index.php/BluRay
+
+stdenv.mkDerivation rec {
+  pname = "libaacs";
+  version  = "0.11.0";
+
+  src = fetchurl {
+    url = "http://get.videolan.org/libaacs/${version}/${pname}-${version}.tar.bz2";
+    sha256 = "11skjqjlldmbjkyxdcz4fmcn6y4p95r1xagbcnjy4ndnzf0l723d";
+  };
+
+  buildInputs = [ libgcrypt libgpgerror ];
+
+  nativeBuildInputs = [ bison flex ];
+
+  meta = with lib; {
+    homepage = "https://www.videolan.org/developers/libaacs.html";
+    description = "Library to access AACS protected Blu-Ray disks";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ abbradar ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libaal/default.nix b/nixpkgs/pkgs/development/libraries/libaal/default.nix
new file mode 100644
index 000000000000..e3c960681c5f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libaal/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  version = "1.0.6";
+  pname = "libaal";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/reiser4/${pname}-${version}.tar.gz";
+    sha256 = "176f2sns6iyxv3h9zyirdinjwi05gdak48zqarhib2s38rvm98di";
+  };
+
+  patches = [ ./libaal-1.0.6-glibc-2.26.patch ];
+
+  preInstall = ''
+    substituteInPlace Makefile --replace ./run-ldconfig true
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "http://www.namesys.com/";
+    description = "Support library for Reiser4";
+    license = lib.licenses.gpl2;
+    maintainers = with lib.maintainers; [ ];
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libaal/libaal-1.0.6-glibc-2.26.patch b/nixpkgs/pkgs/development/libraries/libaal/libaal-1.0.6-glibc-2.26.patch
new file mode 100644
index 000000000000..6d49682f03ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libaal/libaal-1.0.6-glibc-2.26.patch
@@ -0,0 +1,89 @@
+Date: 2017-09-02 13:03:15.353403096 +0200
+From: Jan Engelhardt <jengelh@inai.de>
+
+Stop redefining libc definitions that cause build failures under glibc-2.26.
+
+[   46s] In file included from /usr/include/sys/types.h:156:0,
+[   46s]                  from /usr/include/stdlib.h:279,
+[   46s]                  from malloc.c:15:
+[   46s] /usr/include/bits/stdint-intn.h:27:19: error: conflicting types for 'int64_t'
+[   46s]  typedef __int64_t int64_t;
+[   46s]                    ^~~~~~~
+[   46s] In file included from ../include/aal/libaal.h:17:0,
+[   46s]                  from malloc.c:6:
+[   46s] ../include/aal/types.h:35:33: note: previous declaration of 'int64_t' was here
+[   46s]  typedef long long int           int64_t;
+
+
+---
+ include/aal/types.h |   48 ++----------------------------------------------
+ 1 file changed, 2 insertions(+), 46 deletions(-)
+
+Index: libaal-1.0.6/include/aal/types.h
+===================================================================
+--- libaal-1.0.6.orig/include/aal/types.h
++++ libaal-1.0.6/include/aal/types.h
+@@ -26,24 +26,7 @@
+ #undef ESTRUCT
+ #define ESTRUCT                 50
+ 
+-#ifndef __int8_t_defined
+-#define __int8_t_defined
+-typedef signed char             int8_t;
+-typedef short int               int16_t;
+-typedef int                     int32_t;
+-__extension__
+-typedef long long int           int64_t;
+-#endif
+- 
+-typedef unsigned char           uint8_t;
+-typedef unsigned short int      uint16_t;
+-#ifndef __uint32_t_defined
+-#define __uint32_t_defined
+-typedef unsigned int            uint32_t;
+-__extension__
+-typedef unsigned long long int  uint64_t;
+-#endif
+-
++#include <stdint.h>
+ #define MAX_UINT8  ((uint8_t)~0)
+ #define MAX_UINT16 ((uint16_t)~0)
+ #define MAX_UINT32 ((uint32_t)~0)
+@@ -53,36 +36,9 @@ typedef unsigned long long int  uint64_t
+    because we don't want use gcc builtins in minimal mode for achive as small
+    binary size as possible. */
+ 
+-#ifndef ENABLE_MINIMAL
+ #  include <stdarg.h>
+-#else
+-#ifndef _VA_LIST_
+-#define _VA_LIST_
+-typedef char *va_list;
+-#endif
+-#undef va_arg
+-#undef va_end
+-#undef va_start
+-
+-#define va_end(ap)       \
+-        do {} while(0);
+-
+-#define va_start(ap, p)  \
+-        (ap = (char *)(&(p)+1))
+-
+-#define va_arg(ap, type) \
+-        ((type *)(ap += sizeof(type)))[-1]
+-#endif
+-
+-/* As libaal may be used without any standard headers, we need to declare NULL
+-   macro here in order to avoid compilation errors. */
+-#undef NULL
+ 
+-#if defined(__cplusplus)
+-#  define NULL 0
+-#else
+-#  define NULL ((void *)0)
+-#endif
++#include <stdio.h>
+ 
+ /* Simple type for direction denoting */
+ enum aal_dir {
diff --git a/nixpkgs/pkgs/development/libraries/libabigail/default.nix b/nixpkgs/pkgs/development/libraries/libabigail/default.nix
new file mode 100644
index 000000000000..49d84c1b5c79
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libabigail/default.nix
@@ -0,0 +1,59 @@
+{ lib, stdenv
+, fetchurl
+, autoreconfHook
+, elfutils
+, libxml2
+, pkg-config
+, strace
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libabigail";
+  version = "1.8.2";
+
+  outputs = [ "bin" "out" "dev" ];
+
+  src = fetchurl {
+    url = "https://mirrors.kernel.org/sourceware/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "sha256-hjR8nwqGZvJj/WP4w/5MT5yxvbPsQmDsuvEX0Tfol4c=";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+    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 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
new file mode 100644
index 000000000000..f1c4f49adc67
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libabw/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, boost, doxygen, gperf, pkg-config, librevenge, libxml2, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "libabw";
+  version = "0.1.3";
+
+  src = fetchurl {
+    url = "https://dev-www.libreoffice.org/src/libabw/${pname}-${version}.tar.xz";
+    sha256 = "1vbfrmnvib3cym0yyyabnd8xpx4f7wp20vnn09s6dln347fajqz7";
+  };
+
+  # Boost 1.59 compatability fix
+  # Attempt removing when updating
+  postPatch = ''
+    sed -i 's,^CPPFLAGS.*,\0 -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED,' src/lib/Makefile.in
+  '';
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ boost doxygen gperf librevenge libxml2 perl ];
+
+  meta = with lib; {
+    homepage = "https://wiki.documentfoundation.org/DLP/Libraries/libabw";
+    description = "Library parsing abiword documents";
+    platforms = platforms.unix;
+    license = licenses.mpl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libaccounts-glib/default.nix b/nixpkgs/pkgs/development/libraries/libaccounts-glib/default.nix
new file mode 100644
index 000000000000..8dfc222f36ac
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libaccounts-glib/default.nix
@@ -0,0 +1,52 @@
+{ lib, stdenv, fetchFromGitLab, meson, ninja, glib, check, python3, vala, gtk-doc, glibcLocales
+, libxml2, libxslt, pkg-config, sqlite, docbook_xsl, docbook_xml_dtd_43, gobject-introspection }:
+
+stdenv.mkDerivation rec {
+  pname = "libaccounts-glib";
+  version = "1.24";
+
+  outputs = [ "out" "dev" "devdoc" "py" ];
+
+  src = fetchFromGitLab {
+    owner = "accounts-sso";
+    repo = "libaccounts-glib";
+    rev = version;
+    sha256 = "0y8smg1rd279lrr9ad8b499i8pbkajmwd4xn41rdh9h93hs9apn7";
+  };
+
+  # See: https://gitlab.com/accounts-sso/libaccounts-glib/merge_requests/22
+  patches = [ ./py-override.patch ];
+
+  nativeBuildInputs = [
+    check
+    docbook_xml_dtd_43
+    docbook_xsl
+    glibcLocales
+    gobject-introspection
+    gtk-doc
+    meson
+    ninja
+    pkg-config
+    vala
+  ];
+
+  buildInputs = [
+    glib
+    libxml2
+    libxslt
+    python3.pkgs.pygobject3
+    sqlite
+  ];
+
+  LC_ALL = "en_US.UTF-8";
+
+  mesonFlags = [
+    "-Dpy-overrides-dir=${placeholder "py"}/${python3.sitePackages}/gi/overrides"
+  ];
+
+  meta = with lib; {
+    description = "Library for managing accounts which can be used from GLib applications";
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libaccounts-glib/py-override.patch b/nixpkgs/pkgs/development/libraries/libaccounts-glib/py-override.patch
new file mode 100644
index 000000000000..4179f4fa0af0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libaccounts-glib/py-override.patch
@@ -0,0 +1,38 @@
+diff --git a/libaccounts-glib/pygobject/meson.build b/libaccounts-glib/pygobject/meson.build
+index fa1f4a0..588c4ce 100644
+--- a/libaccounts-glib/pygobject/meson.build
++++ b/libaccounts-glib/pygobject/meson.build
+@@ -1,11 +1,19 @@
+-python3 = import('python3')
+-python_exec = python3.find_python()
+-python_exec_result = run_command(python_exec, ['-c', 'import gi; from os.path import abspath; print(abspath(gi._overridesdir))'])
++py_override = get_option('py-overrides-dir')
+ 
+-if python_exec_result.returncode() != 0
+-    error('Failed to retreive the python GObject override directory')
++if py_override == ''
++    python3 = import('python3')
++    python_exec = python3.find_python()
++    
++    python_exec_result = run_command(python_exec, ['-c', 'import gi; from os.path import abspath; print(abspath(gi._overridesdir))'])
++
++    if python_exec_result.returncode() != 0
++        error('Failed to retreive the python GObject override directory')
++    endif
++
++    py_override = python_exec_result.stdout().strip()
+ endif
+ 
+-install_data('Accounts.py',
+-    install_dir: join_paths(python_exec_result.stdout().strip())
++install_data(
++    'Accounts.py',
++    install_dir: py_override
+ )
+diff --git a/meson_options.txt  b/meson_options.txt 
+new file mode 100644
+index 0000000..2c33804
+--- /dev/null
++++ b/meson_options.txt 	
+@@ -0,0 +1 @@
++option('py-overrides-dir', type : 'string', value : '', description: 'Path to pygobject overrides directory')
diff --git a/nixpkgs/pkgs/development/libraries/libadwaita/default.nix b/nixpkgs/pkgs/development/libraries/libadwaita/default.nix
new file mode 100644
index 000000000000..d6cffcab7fed
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libadwaita/default.nix
@@ -0,0 +1,77 @@
+{ lib
+, stdenv
+, fetchFromGitLab
+, docbook-xsl-nons
+, gi-docgen
+, gtk-doc
+, libxml2
+, meson
+, ninja
+, pkg-config
+, sassc
+, vala
+, gobject-introspection
+, fribidi
+, gtk4
+, xvfb-run
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libadwaita";
+  version = "1.0.0-alpha.1";
+
+  outputs = [ "out" "dev" "devdoc" ];
+  outputBin = "devdoc"; # demo app
+
+  src = fetchFromGitLab {
+    domain = "gitlab.gnome.org";
+    owner = "GNOME";
+    repo = "libadwaita";
+    rev = version;
+    sha256 = "1v52md62kaqykv8b6kxxbxwnbdzlda4ir7n5wh2iizadcailyw7p";
+  };
+
+  nativeBuildInputs = [
+    docbook-xsl-nons
+    gi-docgen
+    gtk-doc
+    libxml2 # for xmllint
+    meson
+    ninja
+    pkg-config
+    sassc
+    vala
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=true"
+  ];
+
+  buildInputs = [
+    fribidi
+    gobject-introspection
+    gtk4
+  ];
+
+  checkInputs = [
+    xvfb-run
+  ];
+
+  doCheck = true;
+
+  checkPhase = ''
+    xvfb-run meson test
+  '';
+
+  postInstall = ''
+    mv $out/share/{doc,gtk-doc}
+  '';
+
+  meta = with lib; {
+    description = "Library to help with developing UI for mobile devices using GTK/GNOME";
+    homepage = "https://gitlab.gnome.org/GNOME/libadwaita";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ dotlambda ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libaec/default.nix b/nixpkgs/pkgs/development/libraries/libaec/default.nix
new file mode 100644
index 000000000000..aa146ca24133
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libaec/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitLab
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libaec";
+  version  = "1.0.5";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.dkrz.de";
+    owner = "k202009";
+    repo = "libaec";
+    rev = "v${version}";
+    sha256 = "sha256-Vi0fCd9V/EH+PcD+e6RZK2/isR1xGX25POhm1Xen5ak=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  meta = with lib; {
+    homepage = "https://gitlab.dkrz.de/k202009/libaec";
+    description = "Adaptive Entropy Coding library";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ tbenst ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libagar/default.nix b/nixpkgs/pkgs/development/libraries/libagar/default.nix
new file mode 100644
index 000000000000..7aeccdf583e0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libagar/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchurl, pkg-config, libtool, perl, bsdbuild, gettext, mandoc
+, libpng, libjpeg, xlibsWrapper, libXinerama, freetype, SDL, libGLU, libGL
+, libsndfile, portaudio, libmysqlclient, fontconfig
+}:
+
+let srcs = import ./srcs.nix { inherit fetchurl; }; in
+stdenv.mkDerivation {
+  pname = "libagar";
+  inherit (srcs) version src;
+
+  preConfigure = ''
+    substituteInPlace configure.in \
+      --replace '_BSD_SOURCE' '_DEFAULT_SOURCE'
+    cat configure.in | ${bsdbuild}/bin/mkconfigure > configure
+  '';
+
+  configureFlags = [
+    "--with-libtool=${libtool}/bin/libtool"
+    "--enable-nls=yes"
+    "--with-gettext=${gettext}"
+    "--with-jpeg=${libjpeg.dev}"
+    "--with-gl=${libGL}"
+    "--with-mysql=${libmysqlclient}"
+    "--with-manpages=yes"
+  ];
+
+  outputs = [ "out" "devdoc" ];
+
+  nativeBuildInputs = [ pkg-config libtool gettext ];
+
+  buildInputs = [
+    bsdbuild perl xlibsWrapper libXinerama SDL libGL libmysqlclient mandoc
+    freetype.dev libpng libjpeg.dev fontconfig portaudio libsndfile
+  ];
+
+  meta = with lib; {
+    description = "Cross-platform GUI toolkit";
+    homepage = "http://libagar.org/index.html";
+    license = with licenses; bsd3;
+    maintainers = with maintainers; [ ramkromberg ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libagar/libagar_test.nix b/nixpkgs/pkgs/development/libraries/libagar/libagar_test.nix
new file mode 100644
index 000000000000..2b31da7aa535
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libagar/libagar_test.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, bsdbuild, libagar, perl, libjpeg, libpng, openssl }:
+
+let srcs = import ./srcs.nix { inherit fetchurl; }; in
+stdenv.mkDerivation {
+  pname = "libagar-test";
+  inherit (srcs) version src;
+
+  sourceRoot = "agar-1.5.0/tests";
+
+  preConfigure = ''
+    substituteInPlace configure.in \
+      --replace '_BSD_SOURCE' '_DEFAULT_SOURCE'
+    cat configure.in | ${bsdbuild}/bin/mkconfigure > configure
+  '';
+
+  configureFlags = [ "--with-agar=${libagar}" ];
+
+  buildInputs = [ perl bsdbuild libagar libjpeg libpng openssl ];
+
+  meta = with lib; {
+    description = "Tests for libagar";
+    homepage = "http://libagar.org/index.html";
+    license = with licenses; bsd3;
+    maintainers = with maintainers; [ ramkromberg ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libagar/srcs.nix b/nixpkgs/pkgs/development/libraries/libagar/srcs.nix
new file mode 100644
index 000000000000..53c6a5b89dad
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libagar/srcs.nix
@@ -0,0 +1,10 @@
+{ fetchurl }:
+rec {
+  version = "1.5.0";
+
+  src = fetchurl {
+    url = "http://stable.hypertriton.com/agar/agar-${version}.tar.gz";
+    sha256 = "001wcqk5z67qg0raw9zlwmv62drxiwqykvsbk10q2mrc6knjsd42";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/libamqpcpp/default.nix b/nixpkgs/pkgs/development/libraries/libamqpcpp/default.nix
new file mode 100644
index 000000000000..ee34afad4f74
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libamqpcpp/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "libamqpcpp";
+  version = "4.3.12";
+
+  src = fetchFromGitHub {
+    owner = "CopernicaMarketingSoftware";
+    repo = "AMQP-CPP";
+    rev = "v${version}";
+    sha256 = "sha256-veiD2RrJ08HYZ1Jy8EUe6ct2qh7a2xZCn3TTM+Hvu+0=";
+  };
+
+  buildInputs = [ openssl ];
+
+  patches = [ ./libamqpcpp-darwin.patch ];
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Library for communicating with a RabbitMQ server";
+    homepage = "https://github.com/CopernicaMarketingSoftware/AMQP-CPP";
+    license = licenses.asl20;
+    maintainers = [ maintainers.mjp ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libamqpcpp/libamqpcpp-darwin.patch b/nixpkgs/pkgs/development/libraries/libamqpcpp/libamqpcpp-darwin.patch
new file mode 100644
index 000000000000..9f8d700929b4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libamqpcpp/libamqpcpp-darwin.patch
@@ -0,0 +1,13 @@
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -0,0 +1 @@
++CXX ?= g++
+@@ -43 +44 @@ ${SHARED_LIB}: ${SHARED_OBJECTS}
+-	${LD} ${LD_FLAGS} -Wl,${SONAMEPARAMETER},lib$(LIBRARY_NAME).so.$(SONAME) -o $@ ${SHARED_OBJECTS}
++	${CXX} ${LD_FLAGS} -Wl,${SONAMEPARAMETER},lib$(LIBRARY_NAME).so.$(SONAME) -o $@ ${SHARED_OBJECTS}
+@@ -52 +53 @@ ${SHARED_OBJECTS}:
+-	${CPP} ${CPPFLAGS} -fpic -o $@ ${@:%.o=%.cpp}
++	${CXX} ${CPPFLAGS} -fpic -o $@ ${@:%.o=%.cpp}
+@@ -55 +56 @@ ${STATIC_OBJECTS}:
+-	${CPP} ${CPPFLAGS} -o $@ ${@:%.s.o=%.cpp}
++	${CXX} ${CPPFLAGS} -o $@ ${@:%.s.o=%.cpp}
diff --git a/nixpkgs/pkgs/development/libraries/libantlr3c/default.nix b/nixpkgs/pkgs/development/libraries/libantlr3c/default.nix
new file mode 100644
index 000000000000..f61c0bfafc7b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libantlr3c/default.nix
@@ -0,0 +1,23 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "libantlr3c";
+  version = "3.4";
+  src = fetchurl {
+    url = "https://www.antlr3.org/download/C/libantlr3c-${version}.tar.gz";
+    sha256 ="0lpbnb4dq4azmsvlhp6khq1gy42kyqyjv8gww74g5lm2y6blm4fa";
+  };
+
+  configureFlags = lib.optional stdenv.is64bit "--enable-64bit"
+    # libantlr3c wrongly emits the abi flags -m64 and -m32 which imply x86 archs
+    # https://github.com/antlr/antlr3/issues/205
+    ++ lib.optional (!stdenv.hostPlatform.isx86) "--disable-abiflags";
+
+  meta = with lib; {
+    description = "C runtime libraries of ANTLR v3";
+    homepage = "https://www.antlr3.org/";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ vbgl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libao/default.nix b/nixpkgs/pkgs/development/libraries/libao/default.nix
new file mode 100644
index 000000000000..4a07ba9da7d8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libao/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkg-config, libpulseaudio, alsa-lib, libcap
+, CoreAudio, CoreServices, AudioUnit
+, usePulseAudio }:
+
+stdenv.mkDerivation rec {
+  version = "1.2.2";
+  pname = "libao";
+
+  # the github mirror is more up to date than downloads.xiph.org
+  src = fetchFromGitHub {
+    owner  = "xiph";
+    repo   = "libao";
+    rev    = version;
+    sha256 = "0svgk4sc9kdhcsfyvbvgm5vpbg3sfr6z5rliflrw49v3x2i4vxq5";
+  };
+
+  configureFlags = [
+    "--disable-broken-oss"
+    "--enable-alsa-mmap"
+  ];
+
+  outputs = [ "out" "dev" "man" "doc" ];
+
+  buildInputs = [ ] ++
+    lib.optional  usePulseAudio   libpulseaudio ++
+    lib.optionals stdenv.isLinux  [ alsa-lib libcap ] ++
+    lib.optionals stdenv.isDarwin [ CoreAudio CoreServices AudioUnit ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  meta = with lib; {
+    longDescription = ''
+      Libao is Xiph.org's cross-platform audio library that allows
+      programs to output audio using a simple API on a wide variety of
+      platforms.
+    '';
+    homepage = "https://xiph.org/ao/";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libaom/default.nix b/nixpkgs/pkgs/development/libraries/libaom/default.nix
new file mode 100644
index 000000000000..4a78f3c5e51d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libaom/default.nix
@@ -0,0 +1,59 @@
+{ lib, stdenv, fetchzip, yasm, perl, cmake, pkg-config, python3 }:
+
+stdenv.mkDerivation rec {
+  pname = "libaom";
+  version = "3.1.2";
+
+  src = fetchzip {
+    url = "https://aomedia.googlesource.com/aom/+archive/v${version}.tar.gz";
+    sha256 = "1c7yrhb56qj5c3lz54n1f9cbrvdr32g2yrrdiiy72sib8ycq9hz2";
+    stripRoot = false;
+  };
+
+  patches = [ ./outputs.patch ];
+
+  nativeBuildInputs = [
+    yasm perl cmake pkg-config python3
+  ];
+
+  preConfigure = ''
+    # build uses `git describe` to set the build version
+    cat > $NIX_BUILD_TOP/git << "EOF"
+    #!${stdenv.shell}
+    echo v${version}
+    EOF
+    chmod +x $NIX_BUILD_TOP/git
+    export PATH=$NIX_BUILD_TOP:$PATH
+  '';
+
+  # Configuration options:
+  # https://aomedia.googlesource.com/aom/+/refs/heads/master/build/cmake/aom_config_defaults.cmake
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DENABLE_TESTS=OFF"
+  ] ++ lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [
+    # CPU detection isn't supported on Darwin and breaks the aarch64-darwin build:
+    "-DCONFIG_RUNTIME_CPU_DETECT=0"
+  ];
+
+  postFixup = ''
+    moveToOutput lib/libaom.a "$static"
+  '';
+
+  outputs = [ "out" "bin" "dev" "static" ];
+
+  meta = with lib; {
+    description = "Alliance for Open Media AV1 codec library";
+    longDescription = ''
+      Libaom is the reference implementation of the AV1 codec from the Alliance
+      for Open Media. It contains an AV1 library as well as applications like
+      an encoder (aomenc) and a decoder (aomdec).
+    '';
+    homepage    = "https://aomedia.org/av1-features/get-started/";
+    changelog   = "https://aomedia.googlesource.com/aom/+/refs/tags/v${version}/CHANGELOG";
+    maintainers = with maintainers; [ primeos kiloreux ];
+    platforms   = platforms.all;
+    license = licenses.bsd2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libaom/outputs.patch b/nixpkgs/pkgs/development/libraries/libaom/outputs.patch
new file mode 100644
index 000000000000..7c0ff397dfee
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libaom/outputs.patch
@@ -0,0 +1,45 @@
+--- a/build/cmake/aom_install.cmake
++++ b/build/cmake/aom_install.cmake
+@@ -45,2 +45,2 @@ macro(setup_aom_install_targets)
+-              -DCMAKE_INSTALL_INCLUDEDIR=${CMAKE_INSTALL_INCLUDEDIR}
+-              -DCMAKE_INSTALL_LIBDIR=${CMAKE_INSTALL_LIBDIR}
++              -DCMAKE_INSTALL_FULL_INCLUDEDIR=${CMAKE_INSTALL_FULL_INCLUDEDIR}
++              -DCMAKE_INSTALL_FULL_LIBDIR=${CMAKE_INSTALL_FULL_LIBDIR}
+@@ -82,14 +82,14 @@ macro(setup_aom_install_targets)
+     install(
+       FILES ${AOM_INSTALL_INCS}
+-      DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_INCLUDEDIR}/aom")
++      DESTINATION "${CMAKE_INSTALL_FULL_INCLUDEDIR}/aom")
+     install(
+       FILES "${AOM_PKG_CONFIG_FILE}"
+-      DESTINATION "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}/pkgconfig")
++      DESTINATION "${CMAKE_INSTALL_FULL_LIBDIR}/pkgconfig")
+     install(TARGETS ${AOM_INSTALL_LIBS} DESTINATION
+-                    "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}")
++                    "${CMAKE_INSTALL_FULL_LIBDIR}")
+ 
+     if(ENABLE_EXAMPLES)
+       install(TARGETS ${AOM_INSTALL_BINS} DESTINATION
+-                      "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}")
++                      "${CMAKE_INSTALL_FULL_BINDIR}")
+     endif()
+   endif()
+--- a/build/cmake/pkg_config.cmake
++++ b/build/cmake/pkg_config.cmake
+@@ -14,2 +14,2 @@
+-                  "CMAKE_INSTALL_BINDIR" "CMAKE_INSTALL_INCLUDEDIR"
+-                  "CMAKE_INSTALL_LIBDIR" "CMAKE_PROJECT_NAME"
++                  "CMAKE_INSTALL_BINDIR" "CMAKE_INSTALL_FULL_INCLUDEDIR"
++                  "CMAKE_INSTALL_FULL_LIBDIR" "CMAKE_PROJECT_NAME"
+@@ -38,4 +38,4 @@ endif()
+-set(prefix "${CMAKE_INSTALL_PREFIX}")
+-set(bindir "${CMAKE_INSTALL_BINDIR}")
+-set(includedir "${CMAKE_INSTALL_INCLUDEDIR}")
+-set(libdir "${CMAKE_INSTALL_LIBDIR}")
++get_filename_component(prefix "${CMAKE_INSTALL_FULL_INCLUDEDIR}" DIRECTORY)
++get_filename_component(exec_prefix "${CMAKE_INSTALL_FULL_LIBDIR}" DIRECTORY)
++get_filename_component(includedir "${CMAKE_INSTALL_FULL_INCLUDEDIR}" NAME)
++get_filename_component(libdir "${CMAKE_INSTALL_FULL_LIBDIR}" NAME)
+@@ -46 +46 @@ file(APPEND "${pkgconfig_file}" "prefix=${prefix}\n")
+-file(APPEND "${pkgconfig_file}" "exec_prefix=\${prefix}\n")
++file(APPEND "${pkgconfig_file}" "exec_prefix=${exec_prefix}\n")
diff --git a/nixpkgs/pkgs/development/libraries/libaosd/default.nix b/nixpkgs/pkgs/development/libraries/libaosd/default.nix
new file mode 100644
index 000000000000..a6b9d531abf6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libaosd/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, cairo, pango,
+  libX11, libXcomposite, autoconf, automake }:
+
+stdenv.mkDerivation rec {
+  version = "0.2.7-9-g177589f";
+  pname = "libaosd";
+
+  src = fetchFromGitHub {
+    owner  = "atheme-legacy";
+    repo   = "libaosd";
+    rev    = version;
+    sha256 = "1cn7k0n74p6jp25kxwcyblhmbdvgw3mikvj0m2jh4c6xccfrgb9a";
+  };
+
+  nativeBuildInputs = [ autoconf automake pkg-config ];
+  buildInputs = [ cairo pango libX11 libXcomposite ];
+  enableParallelBuilding = true;
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  meta = with lib; {
+    longDescription = ''
+      libaosd is an advanced on screen display library.
+
+      It supports many modern features like anti-aliased text and
+      composited rendering via XComposite, as well as support for
+      rendering Cairo and Pango layouts.
+    '';
+    homepage = "https://github.com/atheme-legacy/libaosd";
+    license = licenses.mit;
+    maintainers = with maintainers; [ unode ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libappindicator/default.nix b/nixpkgs/pkgs/development/libraries/libappindicator/default.nix
new file mode 100644
index 000000000000..469235e2e6af
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libappindicator/default.nix
@@ -0,0 +1,66 @@
+# TODO: Resolve the issues with the Mono bindings.
+
+{ stdenv, fetchgit, lib
+, pkg-config, autoreconfHook
+, glib, dbus-glib, gtkVersion ? "3"
+, gtk2 ? null, libindicator-gtk2 ? null, libdbusmenu-gtk2 ? null
+, gtk3 ? null, libindicator-gtk3 ? null, libdbusmenu-gtk3 ? null
+, gtk-doc, vala, gobject-introspection
+, monoSupport ? false, mono ? null, gtk-sharp-2_0 ? null
+ }:
+
+with lib;
+
+
+stdenv.mkDerivation rec {
+  name = let postfix = if gtkVersion == "2" && monoSupport then "sharp" else "gtk${gtkVersion}";
+          in "libappindicator-${postfix}-${version}";
+  version = "12.10.1+20.10.20200706.1";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchgit {
+    url = "https://git.launchpad.net/ubuntu/+source/libappindicator";
+    rev = "fe25e53bc7e39cd59ad6b3270cd7a6a9c78c4f44";
+    sha256 = "0xjvbl4gn7ra2fs6gn2g9s787kzb5cg9hv79iqsz949rxh4iw32d";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook vala gobject-introspection gtk-doc ];
+
+  propagatedBuildInputs =
+    if gtkVersion == "2"
+    then [ gtk2 libdbusmenu-gtk2 ]
+    else [ gtk3 libdbusmenu-gtk3 ];
+
+  buildInputs = [
+    glib dbus-glib
+  ] ++ (if gtkVersion == "2"
+    then [ libindicator-gtk2 ] ++ optionals monoSupport [ mono gtk-sharp-2_0 ]
+    else [ libindicator-gtk3 ]);
+
+  preAutoreconf = ''
+    gtkdocize
+  '';
+
+  configureFlags = [
+    "CFLAGS=-Wno-error"
+    "--sysconfdir=/etc"
+    "--localstatedir=/var"
+    "--with-gtk=${gtkVersion}"
+  ];
+
+  doCheck = false; # generates shebangs in check phase, too lazy to fix
+
+  installFlags = [
+    "sysconfdir=${placeholder "out"}/etc"
+    "localstatedir=\${TMPDIR}"
+  ];
+
+  meta = {
+    description = "A library to allow applications to export a menu into the Unity Menu bar";
+    homepage = "https://launchpad.net/libappindicator";
+    license = with licenses; [ lgpl21 lgpl3 ];
+    platforms = platforms.linux;
+    maintainers = [ maintainers.msteen ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libarchive-qt/default.nix b/nixpkgs/pkgs/development/libraries/libarchive-qt/default.nix
new file mode 100644
index 000000000000..920cc7efa081
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libarchive-qt/default.nix
@@ -0,0 +1,33 @@
+{ mkDerivation, lib, fetchFromGitLab, libarchive, xz, zlib, bzip2, cmake, ninja }:
+
+mkDerivation rec {
+  pname = "libarchive-qt";
+  version = "2.0.4";
+
+  src = fetchFromGitLab {
+    owner = "marcusbritanicus";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-onTV9dgk6Yl9H35EvA6/8vk1IrYH8vg9OQNVgzkt4q4";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    ninja
+  ];
+
+  buildInputs = [
+    libarchive
+    bzip2
+    zlib
+    xz
+  ];
+
+  meta = with lib; {
+    description = "A Qt based archiving solution with libarchive backend";
+    homepage = "https://gitlab.com/marcusbritanicus/libarchive-qt";
+    license = licenses.lgpl3Plus;
+    maintainers = with maintainers; [ dan4ik605743 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libarchive/default.nix b/nixpkgs/pkgs/development/libraries/libarchive/default.nix
new file mode 100644
index 000000000000..f53d1b1a12f7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libarchive/default.nix
@@ -0,0 +1,65 @@
+{
+  fetchFromGitHub, lib, stdenv, pkg-config, autoreconfHook,
+  acl, attr, bzip2, e2fsprogs, libxml2, lzo, openssl, sharutils, xz, zlib, zstd,
+
+  # Optional but increases closure only negligibly. Also, while libxml2
+  # builds fine on windows, but libarchive has trouble linking windows
+  # things it depends on for some reason.
+  xarSupport ? stdenv.hostPlatform.isUnix,
+}:
+
+assert xarSupport -> libxml2 != null;
+
+stdenv.mkDerivation rec {
+  pname = "libarchive";
+  version = "3.5.1";
+
+  src = fetchFromGitHub {
+    owner = "libarchive";
+    repo = "libarchive";
+    rev = "v${version}";
+    sha256 = "sha256-RFPhe4PCq8OLwa6c7ir+5u9jBsUxS5M/fcZYAG9W6R0=";
+  };
+
+  outputs = [ "out" "lib" "dev" ];
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+  buildInputs =
+    lib.optional stdenv.hostPlatform.isUnix sharutils
+    ++ [ zlib bzip2 openssl xz lzo zstd ]
+    ++ lib.optionals stdenv.isLinux [ e2fsprogs attr acl ]
+    ++ lib.optional xarSupport libxml2;
+
+  # Without this, pkg-config-based dependencies are unhappy
+  propagatedBuildInputs = lib.optionals stdenv.isLinux [ attr acl ];
+
+  configureFlags = lib.optional (!xarSupport) "--without-xml2";
+
+  preBuild = if stdenv.isCygwin then ''
+    echo "#include <windows.h>" >> config.h
+  '' else null;
+
+  doCheck = false; # fails
+
+  preFixup = ''
+    sed -i $lib/lib/libarchive.la \
+      -e 's|-lcrypto|-L${openssl.out}/lib -lcrypto|' \
+      -e 's|-llzo2|-L${lzo}/lib -llzo2|'
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Multi-format archive and compression library";
+    longDescription = ''
+      This library has code for detecting and reading many archive formats and
+      compressions formats including (but not limited to) tar, shar, cpio, zip, and
+      compressed with gzip, bzip2, lzma, xz, ...
+    '';
+    homepage = "http://libarchive.org";
+    changelog = "https://github.com/libarchive/libarchive/releases/tag/v${version}";
+    license = lib.licenses.bsd3;
+    platforms = with lib.platforms; all;
+    maintainers = with lib.maintainers; [ jcumming ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libargon2/default.nix b/nixpkgs/pkgs/development/libraries/libargon2/default.nix
new file mode 100644
index 000000000000..2003c8957ffa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libargon2/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, fixDarwinDylibNames }:
+
+stdenv.mkDerivation rec {
+  pname = "libargon2";
+  version = "20190702";
+
+  src = fetchFromGitHub {
+    owner = "P-H-C";
+    repo = "phc-winner-argon2";
+    rev = version;
+    sha256 = "0p4ry9dn0mi9js0byijxdyiwx74p1nr8zj7wjpd1fjgqva4sk23i";
+  };
+
+  nativeBuildInputs = [ fixDarwinDylibNames ];
+
+  patches = [
+    # TODO: remove when https://github.com/P-H-C/phc-winner-argon2/pull/277 is merged + released
+    (fetchpatch {
+      url = "https://github.com/P-H-C/phc-winner-argon2/commit/cd1c1d8d204e4ec4557e358013567c097cb70562.patch";
+      sha256 = "0whqv8b6q9602n7vxpzbd8bk8wz22r1jz9x5lrm9z7ib3wz81c8a";
+    })
+  ];
+
+  makeFlags = [
+    "AR=${stdenv.cc.targetPrefix}ar" # Fix cross-compilation
+    "PREFIX=${placeholder "out"}"
+    "ARGON2_VERSION=${version}"
+    "LIBRARY_REL=lib"
+    "PKGCONFIG_REL=lib"
+  ];
+
+  meta = with lib; {
+    description = "A key derivation function that was selected as the winner of the Password Hashing Competition in July 2015";
+    longDescription = ''
+      A password-hashing function created by by Alex Biryukov, Daniel Dinu, and
+      Dmitry Khovratovich. Argon2 was declared the winner of the Password
+      Hashing Competition (PHC). There were 24 submissions and 9 finalists.
+      Catena, Lyra2, Makwa and yescrypt were given special recognition. The PHC
+      recommends using Argon2 rather than legacy algorithms.
+    '';
+    homepage = "https://www.argon2.com/";
+    license = with licenses; [ asl20 cc0 ];
+    maintainers = with maintainers; [ taeer olynch ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libargs/default.nix b/nixpkgs/pkgs/development/libraries/libargs/default.nix
new file mode 100644
index 000000000000..f4395d134bc9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libargs/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "args";
+  version = "6.2.6";
+
+  src = fetchFromGitHub {
+    owner = "Taywee";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-g5OXuZNi5bkWuSg7SNmhA6vyHUOFU8suYkH8nGx6tvg=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "A simple header-only C++ argument parser library";
+    homepage = "https://github.com/Taywee/args";
+    license = licenses.mit;
+    maintainers = with maintainers; [ SuperSandro2000 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libasr/default.nix b/nixpkgs/pkgs/development/libraries/libasr/default.nix
new file mode 100644
index 000000000000..8d5b6d128ddf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libasr/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, libevent, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "libasr";
+  version=  "1.0.4";
+
+  src = fetchurl {
+    url = "https://www.opensmtpd.org/archives/${pname}-${version}.tar.gz";
+    sha256 = "1d6s8njqhvayx2gp47409sp1fn8m608ws26hr1srfp6i23nnpyqr";
+  };
+
+  buildInputs = [ libevent openssl ];
+
+  meta = with lib; {
+    homepage = "https://github.com/OpenSMTPD/libasr";
+    description = "Free, simple and portable asynchronous resolver library";
+    license = licenses.isc;
+    maintainers = [ maintainers.koral ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libass/default.nix b/nixpkgs/pkgs/development/libraries/libass/default.nix
new file mode 100644
index 000000000000..afc99220534f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libass/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchurl, pkg-config, yasm
+, freetype, fribidi, harfbuzz
+, fontconfigSupport ? true, fontconfig ? null # fontconfig support
+, rasterizerSupport ? false # Internal rasterizer
+, largeTilesSupport ? false # Use larger tiles in the rasterizer
+, libiconv
+}:
+
+assert fontconfigSupport -> fontconfig != null;
+
+let
+  mkFlag = optSet: flag: if optSet then "--enable-${flag}" else "--disable-${flag}";
+in
+
+with lib;
+stdenv.mkDerivation rec {
+  pname = "libass";
+  version = "0.15.1";
+
+  src = fetchurl {
+    url = "https://github.com/libass/libass/releases/download/${version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-HN05ydAHsG5zfnc4AE1/OM+bHpKEPzcweyTn/2OrjlM=";
+  };
+
+  configureFlags = [
+    (mkFlag fontconfigSupport "fontconfig")
+    (mkFlag rasterizerSupport "rasterizer")
+    (mkFlag largeTilesSupport "large-tiles")
+  ];
+
+  nativeBuildInputs = [ pkg-config yasm ];
+
+  buildInputs = [ freetype fribidi harfbuzz ]
+    ++ optional fontconfigSupport fontconfig
+    ++ optional stdenv.isDarwin libiconv;
+
+  meta = {
+    description = "Portable ASS/SSA subtitle renderer";
+    homepage    = "https://github.com/libass/libass";
+    license     = licenses.isc;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ codyopel ];
+    repositories.git = "git://github.com/libass/libass.git";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libassuan/default.nix b/nixpkgs/pkgs/development/libraries/libassuan/default.nix
new file mode 100644
index 000000000000..5e966d9c35b7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libassuan/default.nix
@@ -0,0 +1,42 @@
+{ fetchurl, lib, stdenv, gettext, npth, libgpgerror, buildPackages }:
+
+stdenv.mkDerivation rec {
+  pname = "libassuan";
+  version = "2.5.5";
+
+  src = fetchurl {
+    url = "mirror://gnupg/${pname}/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-jowvzJgvnKZ9y7HZXi3HRrFzmkZovCCzo8W+Yy7bNOQ=";
+  };
+
+  outputs = [ "out" "dev" "info" ];
+  outputBin = "dev"; # libassuan-config
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  buildInputs = [ npth gettext ];
+
+  configureFlags = [
+    "--with-libgpg-error-prefix=${libgpgerror.dev}"
+  ];
+
+  doCheck = true;
+
+  # Make sure includes are fixed for callers who don't use libassuan-config
+  postInstall = ''
+    sed -i 's,#include <gpg-error.h>,#include "${libgpgerror.dev}/include/gpg-error.h",g' $dev/include/assuan.h
+  '';
+
+  meta = with lib; {
+    description = "IPC library used by GnuPG and related software";
+    longDescription = ''
+      Libassuan is a small library implementing the so-called Assuan
+      protocol.  This protocol is used for IPC between most newer
+      GnuPG components.  Both, server and client side functions are
+      provided.
+    '';
+    homepage = "http://gnupg.org";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.all;
+    maintainers = [ maintainers.erictapen ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libast/default.nix b/nixpkgs/pkgs/development/libraries/libast/default.nix
new file mode 100644
index 000000000000..b48971bc4313
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libast/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl
+, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "libast";
+  version = "0.7.1";
+
+  src = fetchurl {
+    url = "http://www.eterm.org/download/${pname}-${version}.tar.gz";
+    sha256 = "1w7bs46r4lykfd83kc3bg9i1rxzzlb4ydk23ikf8mx8avz05q1aj";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  meta = with lib; {
+    description = "Library of Assorted Spiffy Things";
+    homepage = "https://www.eterm.org";
+    license = licenses.bsd2;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libasyncns/default.nix b/nixpkgs/pkgs/development/libraries/libasyncns/default.nix
new file mode 100644
index 000000000000..c94e1c04e0ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libasyncns/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libasyncns";
+  version = "0.8";
+
+  src = fetchurl {
+    url = "http://0pointer.de/lennart/projects/libasyncns/${pname}-${version}.tar.gz";
+    sha256 = "0x5b6lcic4cd7q0bx00x93kvpyzl7n2abbgvqbrlzrfb8vknc6jg";
+  };
+
+  configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "ac_cv_func_malloc_0_nonnull=yes"
+    "ac_cv_func_realloc_0_nonnull=yes"
+  ];
+
+  meta = with lib; {
+    homepage = "http://0pointer.de/lennart/projects/libasyncns/";
+    description = "A C library for Linux/Unix for executing name service queries asynchronously";
+    license = licenses.lgpl21;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libatomic_ops/default.nix b/nixpkgs/pkgs/development/libraries/libatomic_ops/default.nix
new file mode 100644
index 000000000000..f9e850f91ffa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libatomic_ops/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, autoconf, automake, libtool }:
+
+stdenv.mkDerivation rec {
+  pname = "libatomic_ops";
+  version = "7.6.10";
+
+  src = fetchurl {
+    urls = [
+      "http://www.ivmaisoft.com/_bin/atomic_ops/libatomic_ops-${version}.tar.gz"
+      "https://github.com/ivmai/libatomic_ops/releases/download/v${version}/libatomic_ops-${version}.tar.gz"
+    ];
+    sha256 = "1bwry043f62pc4mgdd37zx3fif19qyrs8f5bw7qxlmkzh5hdyzjq";
+  };
+
+  outputs = [ "out" "dev" "doc" ];
+
+  nativeBuildInputs = lib.optionals stdenv.isCygwin [ autoconf automake libtool ];
+
+  preConfigure = lib.optionalString stdenv.isCygwin ''
+    sed -i -e "/libatomic_ops_gpl_la_SOURCES/a libatomic_ops_gpl_la_LIBADD = libatomic_ops.la" src/Makefile.am
+    ./autogen.sh
+  '';
+
+  meta = {
+    description = "A library for semi-portable access to hardware-provided atomic memory update operations";
+    license = lib.licenses.gpl2Plus ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = with lib.platforms; unix ++ windows;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libaudclient/default.nix b/nixpkgs/pkgs/development/libraries/libaudclient/default.nix
new file mode 100644
index 000000000000..9c790172039b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libaudclient/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, pkg-config, glib, dbus-glib }:
+
+stdenv.mkDerivation rec {
+  pname = "libaudclient";
+  version = "3.5-rc2";
+
+  src = fetchurl {
+    url = "https://distfiles.audacious-media-player.org/${pname}-${version}.tar.bz2";
+    sha256 = "0nhpgz0kg8r00z54q5i96pjk7s57krq3fvdypq496c7fmlv9kdap";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ glib dbus-glib ];
+
+  meta = with lib; {
+    description = "Legacy D-Bus client library for Audacious";
+    homepage = "https://audacious-media-player.org/";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ pSub ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libaudec/default.nix b/nixpkgs/pkgs/development/libraries/libaudec/default.nix
new file mode 100644
index 000000000000..78e4b5cfa404
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libaudec/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub
+, libsndfile, libsamplerate
+, meson, ninja, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libaudec";
+  version = "0.3.4";
+
+  src = fetchFromGitHub {
+    owner = "zrythm";
+    repo = "libaudec";
+    rev = "v${version}";
+    sha256 = "sha256-8morbrq8zG+2N3ruMeJa85ci9P0wPQOfZ5H56diFEAo=";
+  };
+
+  buildInputs = [ libsndfile libsamplerate ];
+  nativeBuildInputs = [ meson ninja pkg-config ];
+
+  meta = with lib; {
+    homepage = "https://www.zrythm.org";
+    description = "A library for reading and resampling audio files";
+    license = licenses.agpl3Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libav/default.nix b/nixpkgs/pkgs/development/libraries/libav/default.nix
new file mode 100644
index 000000000000..a3de9225d1ce
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libav/default.nix
@@ -0,0 +1,137 @@
+{ lib, stdenv, fetchurl, pkg-config, yasm, bzip2, zlib, perl, bash
+, mp3Support    ? true,   lame      ? null
+, speexSupport  ? true,   speex     ? null
+, theoraSupport ? true,   libtheora ? null
+, vorbisSupport ? true,   libvorbis ? null
+, vpxSupport    ? true,   libvpx    ? null
+, x264Support   ? false,  x264      ? null
+, xvidSupport   ? true,   xvidcore  ? null
+, faacSupport   ? false,  faac      ? null
+, vaapiSupport  ? true,   libva     ? null
+, vdpauSupport  ? true,   libvdpau  ? null
+, freetypeSupport ? true, freetype  ? null # it's small and almost everywhere
+, SDL # only for avplay in $bin, adds nontrivial closure to it
+, enableGPL ? true # ToDo: some additional default stuff may need GPL
+, enableUnfree ? faacSupport
+}:
+
+assert faacSupport -> enableUnfree;
+
+let inherit (lib) optional hasPrefix enableFeature; in
+
+/* ToDo:
+    - more deps, inspiration: https://packages.ubuntu.com/raring/libav-tools
+    - maybe do some more splitting into outputs
+*/
+
+let
+  result = {
+    # e.g. https://libav.org/releases/libav-11.11.tar.xz.sha1
+    libav_0_8 = libavFun "0.8.21" "d858f65128dad0bac1a8c3a51e5cbb27a7c79b3f";
+    libav_11  = libavFun "11.12"  "61d5dcab5fde349834af193a572b12a5fd6a4d42";
+    libav_12  = libavFun "12.3"   "386c18c8b857f23dfcf456ce40370716130211d9";
+  };
+
+  libavFun = version : sha1 : stdenv.mkDerivation rec {
+    pname = "libav";
+    inherit version;
+
+    src = fetchurl {
+      url = "${meta.homepage}/releases/${pname}-${version}.tar.xz";
+      inherit sha1; # upstream directly provides sha1 of releases over https
+    };
+
+    patches = []
+      ++ optional (vpxSupport && hasPrefix "0.8." version) ./vpxenc-0.8.17-libvpx-1.5.patch
+      ++ optional (vpxSupport && hasPrefix "12." version) ./vpx-12.3-libvpx-1.8.patch
+      ;
+
+    postPatch = ''
+      patchShebangs .
+      # another shebang was hidden in a here document text
+      substituteInPlace ./configure --replace "#! /bin/sh" "#!${bash}/bin/sh"
+    '';
+
+    configurePlatforms = [];
+    configureFlags = assert lib.all (x: x!=null) buildInputs; [
+      "--arch=${stdenv.hostPlatform.parsed.cpu.name}"
+      "--target_os=${stdenv.hostPlatform.parsed.kernel.name}"
+      #"--enable-postproc" # it's now a separate package in upstream
+      "--disable-avserver" # upstream says it's in a bad state
+      "--enable-avplay"
+      "--enable-shared"
+      "--enable-runtime-cpudetect"
+      "--cc=${stdenv.cc.targetPrefix}cc"
+      (enableFeature enableGPL "gpl")
+      (enableFeature enableGPL "swscale")
+      (enableFeature mp3Support "libmp3lame")
+      (enableFeature mp3Support "libmp3lame")
+      (enableFeature speexSupport "libspeex")
+      (enableFeature theoraSupport "libtheora")
+      (enableFeature vorbisSupport "libvorbis")
+      (enableFeature vpxSupport "libvpx")
+      (enableFeature x264Support "libx264")
+      (enableFeature xvidSupport "libxvid")
+      (enableFeature faacSupport "libfaac")
+      (enableFeature faacSupport "nonfree")
+      (enableFeature vaapiSupport "vaapi")
+      (enableFeature vdpauSupport "vdpau")
+      (enableFeature freetypeSupport "libfreetype")
+    ] ++ optional (stdenv.hostPlatform != stdenv.buildPlatform) [
+      "--cross-prefix=${stdenv.cc.targetPrefix}"
+      "--enable-cross-compile"
+    ];
+
+  nativeBuildInputs = [ pkg-config perl ];
+    buildInputs = [ lame yasm zlib bzip2 SDL bash ]
+      ++ [ perl ] # for install-man target
+      ++ optional mp3Support lame
+      ++ optional speexSupport speex
+      ++ optional theoraSupport libtheora
+      ++ optional vorbisSupport libvorbis
+      ++ optional vpxSupport libvpx
+      ++ optional x264Support x264
+      ++ optional xvidSupport xvidcore
+      ++ optional faacSupport faac
+      ++ optional vaapiSupport libva
+      ++ optional vdpauSupport libvdpau
+      ++ optional freetypeSupport freetype
+      ;
+
+    enableParallelBuilding = true;
+
+    outputs = [ "bin" "dev" "out" ];
+    setOutputFlags = false;
+
+    # alltools to build smaller tools, incl. aviocat, ismindex, qt-faststart, etc.
+    buildFlags = [ "all" "alltools" "install-man" ];
+
+
+    postInstall = ''
+      moveToOutput bin "$bin"
+      # alltools target compiles an executable in tools/ for every C
+      # source file in tools/, so move those to $out
+      for tool in $(find tools -type f -executable); do
+        mv "$tool" "$bin/bin/"
+      done
+    '';
+
+    doInstallCheck = false; # fails randomly
+    installCheckTarget = "check"; # tests need to be run *after* installation
+
+    passthru = { inherit vdpauSupport; };
+
+    meta = with lib; {
+      homepage = "https://libav.org/";
+      description = "A complete, cross-platform solution to record, convert and stream audio and video (fork of ffmpeg)";
+      license = with licenses; if enableUnfree then unfree #ToDo: redistributable or not?
+        else if enableGPL then gpl2Plus else lgpl21Plus;
+      platforms = with platforms; linux ++ darwin;
+      knownVulnerabilities =
+        lib.optional (lib.versionOlder version "12.1") "CVE-2017-9051"
+        ++ lib.optionals (lib.versionOlder version "12.3") [ "CVE-2018-5684" "CVE-2018-5766" ]
+        ++ lib.optionals (lib.versionOlder version "12.4") [ "CVE-2019-9717" "CVE-2019-9720" ];
+    };
+  }; # libavFun
+
+in result
diff --git a/nixpkgs/pkgs/development/libraries/libav/vpx-12.3-libvpx-1.8.patch b/nixpkgs/pkgs/development/libraries/libav/vpx-12.3-libvpx-1.8.patch
new file mode 100644
index 000000000000..8f8e5003284f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libav/vpx-12.3-libvpx-1.8.patch
@@ -0,0 +1,46 @@
+--- libav/libavcodec/libvpx.c.orig	2018-02-12 21:25:59 UTC
++++ libav/libavcodec/libvpx.c
+@@ -25,6 +25,7 @@
+ enum AVPixelFormat ff_vpx_imgfmt_to_pixfmt(vpx_img_fmt_t img)
+ {
+     switch (img) {
++#if VPX_IMAGE_ABI_VERSION < 5
+     case VPX_IMG_FMT_RGB24:     return AV_PIX_FMT_RGB24;
+     case VPX_IMG_FMT_RGB565:    return AV_PIX_FMT_RGB565BE;
+     case VPX_IMG_FMT_RGB555:    return AV_PIX_FMT_RGB555BE;
+@@ -36,10 +37,13 @@ enum AVPixelFormat ff_vpx_imgfmt_to_pixfmt(vpx_img_fmt
+     case VPX_IMG_FMT_ARGB_LE:   return AV_PIX_FMT_BGRA;
+     case VPX_IMG_FMT_RGB565_LE: return AV_PIX_FMT_RGB565LE;
+     case VPX_IMG_FMT_RGB555_LE: return AV_PIX_FMT_RGB555LE;
++#endif
+     case VPX_IMG_FMT_I420:      return AV_PIX_FMT_YUV420P;
+     case VPX_IMG_FMT_I422:      return AV_PIX_FMT_YUV422P;
+     case VPX_IMG_FMT_I444:      return AV_PIX_FMT_YUV444P;
++#if VPX_IMAGE_ABI_VERSION < 5
+     case VPX_IMG_FMT_444A:      return AV_PIX_FMT_YUVA444P;
++#endif
+ #if VPX_IMAGE_ABI_VERSION >= 3
+     case VPX_IMG_FMT_I440:      return AV_PIX_FMT_YUV440P;
+     case VPX_IMG_FMT_I42016:    return AV_PIX_FMT_YUV420P16BE;
+@@ -53,6 +57,7 @@ enum AVPixelFormat ff_vpx_imgfmt_to_pixfmt(vpx_img_fmt
+ vpx_img_fmt_t ff_vpx_pixfmt_to_imgfmt(enum AVPixelFormat pix)
+ {
+     switch (pix) {
++#if VPX_IMAGE_ABI_VERSION < 5
+     case AV_PIX_FMT_RGB24:        return VPX_IMG_FMT_RGB24;
+     case AV_PIX_FMT_RGB565BE:     return VPX_IMG_FMT_RGB565;
+     case AV_PIX_FMT_RGB555BE:     return VPX_IMG_FMT_RGB555;
+@@ -64,10 +69,13 @@ vpx_img_fmt_t ff_vpx_pixfmt_to_imgfmt(enum AVPixelForm
+     case AV_PIX_FMT_BGRA:         return VPX_IMG_FMT_ARGB_LE;
+     case AV_PIX_FMT_RGB565LE:     return VPX_IMG_FMT_RGB565_LE;
+     case AV_PIX_FMT_RGB555LE:     return VPX_IMG_FMT_RGB555_LE;
++#endif
+     case AV_PIX_FMT_YUV420P:      return VPX_IMG_FMT_I420;
+     case AV_PIX_FMT_YUV422P:      return VPX_IMG_FMT_I422;
+     case AV_PIX_FMT_YUV444P:      return VPX_IMG_FMT_I444;
++#if VPX_IMAGE_ABI_VERSION < 5
+     case AV_PIX_FMT_YUVA444P:     return VPX_IMG_FMT_444A;
++#endif
+ #if VPX_IMAGE_ABI_VERSION >= 3
+     case AV_PIX_FMT_YUV440P:      return VPX_IMG_FMT_I440;
+     case AV_PIX_FMT_YUV420P16BE:  return VPX_IMG_FMT_I42016;
diff --git a/nixpkgs/pkgs/development/libraries/libav/vpxenc-0.8.17-libvpx-1.5.patch b/nixpkgs/pkgs/development/libraries/libav/vpxenc-0.8.17-libvpx-1.5.patch
new file mode 100644
index 000000000000..456828c025ef
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libav/vpxenc-0.8.17-libvpx-1.5.patch
@@ -0,0 +1,22 @@
+--- a/libavcodec/libvpxenc.c	2016-05-01 17:57:16.753852614 +0200
++++ b/libavcodec/libvpxenc.c	2016-05-01 18:01:08.252147138 +0200
+@@ -67,19 +67,11 @@
+ 
+ /** String mappings for enum vp8e_enc_control_id */
+ static const char *ctlidstr[] = {
+-    [VP8E_UPD_ENTROPY]           = "VP8E_UPD_ENTROPY",
+-    [VP8E_UPD_REFERENCE]         = "VP8E_UPD_REFERENCE",
+-    [VP8E_USE_REFERENCE]         = "VP8E_USE_REFERENCE",
+-    [VP8E_SET_ROI_MAP]           = "VP8E_SET_ROI_MAP",
+-    [VP8E_SET_ACTIVEMAP]         = "VP8E_SET_ACTIVEMAP",
+-    [VP8E_SET_SCALEMODE]         = "VP8E_SET_SCALEMODE",
+     [VP8E_SET_CPUUSED]           = "VP8E_SET_CPUUSED",
+     [VP8E_SET_ENABLEAUTOALTREF]  = "VP8E_SET_ENABLEAUTOALTREF",
+     [VP8E_SET_NOISE_SENSITIVITY] = "VP8E_SET_NOISE_SENSITIVITY",
+-    [VP8E_SET_SHARPNESS]         = "VP8E_SET_SHARPNESS",
+     [VP8E_SET_STATIC_THRESHOLD]  = "VP8E_SET_STATIC_THRESHOLD",
+     [VP8E_SET_TOKEN_PARTITIONS]  = "VP8E_SET_TOKEN_PARTITIONS",
+-    [VP8E_GET_LAST_QUANTIZER]    = "VP8E_GET_LAST_QUANTIZER",
+     [VP8E_SET_ARNR_MAXFRAMES]    = "VP8E_SET_ARNR_MAXFRAMES",
+     [VP8E_SET_ARNR_STRENGTH]     = "VP8E_SET_ARNR_STRENGTH",
+     [VP8E_SET_ARNR_TYPE]         = "VP8E_SET_ARNR_TYPE",
diff --git a/nixpkgs/pkgs/development/libraries/libavc1394/default.nix b/nixpkgs/pkgs/development/libraries/libavc1394/default.nix
new file mode 100644
index 000000000000..2ac90a11f086
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libavc1394/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, pkg-config, libraw1394 }:
+
+stdenv.mkDerivation rec {
+  pname = "libavc1394";
+  version = "0.5.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libavc1394/${pname}-${version}.tar.gz";
+    sha256 = "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  propagatedBuildInputs = [ libraw1394 ];
+
+  meta = {
+    description = "Programming interface for the 1394 Trade Association AV/C (Audio/Video Control) Digital Interface Command Set";
+    homepage = "https://sourceforge.net/projects/libavc1394/";
+    license = lib.licenses.lgpl21Plus;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libavif/default.nix b/nixpkgs/pkgs/development/libraries/libavif/default.nix
new file mode 100644
index 000000000000..81f07703c942
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libavif/default.nix
@@ -0,0 +1,61 @@
+{ lib, stdenv
+, fetchFromGitHub
+, libaom
+, cmake
+, pkg-config
+, zlib
+, libpng
+, libjpeg
+, dav1d
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libavif";
+  version = "0.9.2";
+
+  src = fetchFromGitHub {
+    owner = "AOMediaCodec";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-0/5JLynYzr7ZewBbrNoxr26UkVzpSP9RqlmH2ql8tfs=";
+  };
+
+  # reco: encode libaom slowest but best, decode dav1d fastest
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DAVIF_CODEC_AOM=ON" # best encoder (slow but small)
+    "-DAVIF_CODEC_DAV1D=ON" # best decoder (fast)
+    "-DAVIF_CODEC_AOM_DECODE=OFF"
+    "-DAVIF_BUILD_APPS=ON"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  buildInputs = [
+    libaom
+    zlib
+    libpng
+    libjpeg
+    dav1d
+  ];
+
+  meta = with lib; {
+    description  = "C implementation of the AV1 Image File Format";
+    longDescription = ''
+      Libavif aims to be a friendly, portable C implementation of the
+      AV1 Image File Format. It is a work-in-progress, but can already
+      encode and decode all AOM supported YUV formats and bit depths
+      (with alpha). It also features an encoder and a decoder
+      (avifenc/avifdec).
+    '';
+    homepage    = "https://github.com/AOMediaCodec/libavif";
+    changelog   = "https://github.com/AOMediaCodec/libavif/blob/v${version}/CHANGELOG.md";
+    maintainers = with maintainers; [ mkg20001 ];
+    platforms   = platforms.all;
+    license     = licenses.bsd2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libayatana-appindicator/default.nix b/nixpkgs/pkgs/development/libraries/libayatana-appindicator/default.nix
new file mode 100644
index 000000000000..df1c6683fbcf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libayatana-appindicator/default.nix
@@ -0,0 +1,47 @@
+{ stdenv, fetchFromGitHub, lib
+, pkg-config, autoreconfHook , gtk-doc
+, gobject-introspection
+, gtkVersion ? "3"
+, gtk2, libayatana-indicator-gtk2, libdbusmenu-gtk2
+, gtk3, libayatana-indicator-gtk3, libdbusmenu-gtk3
+, dbus-glib,
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libayatana-appindicator-gtk${gtkVersion}";
+  version = "0.5.5";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "AyatanaIndicators";
+    repo = "libayatana-appindicator";
+    rev = version;
+    sha256 = "1sba0w455rdkadkhxrx4fr63m0d9blsbb1q1hcshxw1k1z2nh1gk";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook gtk-doc gobject-introspection dbus-glib ];
+
+  buildInputs =
+    lib.optional (gtkVersion == "2") libayatana-indicator-gtk2
+    ++ lib.optional (gtkVersion == "3") libayatana-indicator-gtk3;
+
+  propagatedBuildInputs =
+    lib.optionals (gtkVersion == "2") [ gtk2 libdbusmenu-gtk2 ]
+    ++ lib.optionals (gtkVersion == "3") [ gtk3 libdbusmenu-gtk3 ];
+
+  preAutoreconf = ''
+    gtkdocize
+  '';
+
+  configureFlags = [ "--with-gtk=${gtkVersion}" ];
+
+  meta = with lib; {
+    description = "Ayatana Application Indicators Shared Library";
+    homepage = "https://github.com/AyatanaIndicators/libayatana-appindicator";
+    changelog = "https://github.com/AyatanaIndicators/libayatana-appindicator/blob/${version}/ChangeLog";
+    license = [ licenses.lgpl3Plus licenses.lgpl21Plus ];
+    maintainers = [ maintainers.nickhu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libayatana-indicator/default.nix b/nixpkgs/pkgs/development/libraries/libayatana-indicator/default.nix
new file mode 100644
index 000000000000..f4871538effe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libayatana-indicator/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, fetchFromGitHub, lib
+, pkg-config, autoreconfHook
+, gtkVersion ? "3"
+, gtk2
+, gtk3
+, ayatana-ido
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libayatana-indicator-gtk${gtkVersion}";
+  version = "0.8.2";
+
+  src = fetchFromGitHub {
+    owner = "AyatanaIndicators";
+    repo = "libayatana-indicator";
+    rev = version;
+    sha256 = "1wlqm3pj12vgz587a72widbg0vcmm1klsd2lh3mpzfy20m3vjxhj";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+
+  buildInputs = [ ayatana-ido ]
+    ++ lib.optionals (gtkVersion == "2") [ gtk2 ]
+    ++ lib.optionals (gtkVersion == "3") [ gtk3 ];
+
+  configureFlags = [ "--with-gtk=${gtkVersion}" ];
+
+  meta = with lib; {
+    description = "Ayatana Indicators Shared Library";
+    homepage = "https://github.com/AyatanaIndicators/libayatana-indicator";
+    changelog = "https://github.com/AyatanaIndicators/libayatana-indicator/blob/${version}/ChangeLog";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.nickhu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libb2/default.nix b/nixpkgs/pkgs/development/libraries/libb2/default.nix
new file mode 100644
index 000000000000..b142a0a41565
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libb2/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "libb2";
+  version = "0.98.1";
+
+  src = fetchFromGitHub {
+    owner = "BLAKE2";
+    repo = "libb2";
+    rev = "v${version}";
+    sha256 = "0qj8aaqvfcavj1vj5asm4pqm03ap7q8x4c2fy83cqggvky0frgya";
+  };
+
+  preConfigure = ''
+    patchShebangs autogen.sh
+    ./autogen.sh
+  '';
+
+  configureFlags = lib.optional stdenv.hostPlatform.isx86 "--enable-fat=yes";
+
+  nativeBuildInputs = [ autoconf automake libtool pkg-config ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "The BLAKE2 family of cryptographic hash functions";
+    homepage = "https://blake2.net/";
+    platforms = platforms.all;
+    maintainers = with maintainers; [ dfoxfranke dotlambda ];
+    license = licenses.cc0;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libb64/default.nix b/nixpkgs/pkgs/development/libraries/libb64/default.nix
new file mode 100644
index 000000000000..d1f942a3498b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libb64/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, unzip }:
+
+stdenv.mkDerivation rec {
+  pname = "libb64";
+  version = "1.2";
+
+  src = fetchurl {
+    url = "http://download.draios.com/dependencies/libb64-1.2.src.zip";
+    sha256 = "1lxzi6v10qsl2r6633dx0zwqyvy0j19nmwclfd0d7qybqmhqsg9l";
+  };
+
+  nativeBuildInputs = [ unzip ];
+
+  installPhase = ''
+    mkdir -p $out $out/lib $out/bin $out/include
+    cp -r include/* $out/include/
+    cp base64/base64 $out/bin/
+    cp src/libb64.a src/cencode.o src/cdecode.o $out/lib/
+  '';
+
+  meta = {
+    description = "ANSI C routines for fast base64 encoding/decoding";
+    license = lib.licenses.publicDomain;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libbacktrace/default.nix b/nixpkgs/pkgs/development/libraries/libbacktrace/default.nix
new file mode 100644
index 000000000000..93927807af85
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libbacktrace/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, callPackage, fetchFromGitHub
+, enableStatic ? stdenv.hostPlatform.isStatic
+, enableShared ? !stdenv.hostPlatform.isStatic
+}:
+let
+  yesno = b: if b then "yes" else "no";
+in stdenv.mkDerivation rec {
+  pname = "libbacktrace";
+  version = "2020-05-13";
+  src = fetchFromGitHub {
+    owner = "ianlancetaylor";
+    repo = pname;
+    rev = "9b7f216e867916594d81e8b6118f092ac3fcf704";
+    sha256 = "0qr624v954gnfkmpdlfk66sxz3acyfmv805rybsaggw5gz5sd1nh";
+  };
+  configureFlags = [
+    "--enable-static=${yesno enableStatic}"
+    "--enable-shared=${yesno enableShared}"
+  ];
+  meta = with lib; {
+    description = "A C library that may be linked into a C/C++ program to produce symbolic backtraces";
+    homepage = https://github.com/ianlancetaylor/libbacktrace;
+    maintainers = with maintainers; [ twey ];
+    license = with licenses; [ bsd3 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libbap/default.nix b/nixpkgs/pkgs/development/libraries/libbap/default.nix
new file mode 100644
index 000000000000..c15de88f6a76
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libbap/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, bap, ocaml, findlib, ctypes, autoreconfHook,
+  which }:
+
+stdenv.mkDerivation {
+  pname = "libbap";
+  version = "master-2020-11-25";
+
+  src = fetchFromGitHub {
+    owner = "BinaryAnalysisPlatform";
+    repo = "bap-bindings";
+    rev = "3193cb31e1b1f2455406ea0c819dad9dfa2ba10d";
+    sha256 = "0m4spva3z6fgbwlg4zq53l5p227dic893q2qq65pvzxyf7k7nmil";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile.in \
+      --replace "-linkpkg" "-thread -linkpkg"
+  '';
+
+  nativeBuildInputs = [ autoreconfHook which ];
+  buildInputs = [ ocaml bap findlib ctypes ];
+
+  preInstall = ''
+    mkdir -p $out/lib
+    mkdir -p $out/include
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/binaryanalysisplatform/bap-bindings";
+    description = "A C library for interacting with BAP";
+    maintainers = [ maintainers.maurer ];
+    platforms = platforms.unix;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libbaseencode/default.nix b/nixpkgs/pkgs/development/libraries/libbaseencode/default.nix
new file mode 100644
index 000000000000..c40f9bafb476
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libbaseencode/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, lib, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "libbaseencode";
+  version = "1.0.11";
+
+  src = fetchFromGitHub {
+    owner = "paolostivanin";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1f52yh052z8k90d1ag6nk01p1gf4i1zxp1daw8mashs8avqr2m7g";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Library written in C for encoding and decoding data using base32 or base64 (RFC-4648)";
+    homepage = "https://github.com/paolostivanin/libbaseencode";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ alexbakker ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libbdplus/default.nix b/nixpkgs/pkgs/development/libraries/libbdplus/default.nix
new file mode 100644
index 000000000000..ca7b305122e3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libbdplus/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, libgcrypt, libgpgerror, gettext }:
+
+# library that allows libbluray to play BDplus protected bluray disks
+# libaacs does not infringe DRM's right or copyright. See the legal page of the website for more info.
+
+# Info on how to use / obtain aacs keys:
+# http://vlc-bluray.whoknowsmy.name/
+# https://wiki.archlinux.org/index.php/BluRay
+
+stdenv.mkDerivation rec {
+  pname = "libbdplus";
+  version  = "0.1.2";
+
+  src = fetchurl {
+    url = "http://get.videolan.org/libbdplus/${version}/${pname}-${version}.tar.bz2";
+    sha256 = "02n87lysqn4kg2qk7d1ffrp96c44zkdlxdj0n16hbgrlrpiwlcd6";
+  };
+
+  buildInputs = [ libgcrypt libgpgerror gettext ];
+
+  nativeBuildInputs = [ ];
+
+  meta = with lib; {
+    homepage = "http://www.videolan.org/developers/libbdplus.html";
+    description = "Library to access BD+ protected Blu-Ray disks";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ abbradar ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libbencodetools/default.nix b/nixpkgs/pkgs/development/libraries/libbencodetools/default.nix
new file mode 100644
index 000000000000..b8150a90f683
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libbencodetools/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, lib, fetchFromGitLab
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libbencodetools";
+  version = "unstable-2021-04-15";
+
+  src = fetchFromGitLab {
+    owner = "heikkiorsila";
+    repo = "bencodetools";
+    rev = "1ab11f6509a348975e8aec829d7abbf2f8e9b7d1";
+    sha256 = "1i2dgvxxwj844yn45hnfx3785ljbvbkri0nv0jx51z4i08w7cz0h";
+  };
+
+  postPatch = ''
+    patchShebangs .
+  '';
+
+  configureFlags = [
+    "--without-python"
+  ];
+
+  meta = with lib; {
+    description = "Collection of tools for manipulating bencoded data";
+    homepage = "https://gitlab.com/heikkiorsila/bencodetools";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ OPNA2608 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libbfd/default.nix b/nixpkgs/pkgs/development/libraries/libbfd/default.nix
new file mode 100644
index 000000000000..499f04349b5d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libbfd/default.nix
@@ -0,0 +1,59 @@
+{ lib, stdenv
+, fetchpatch, gnu-config, autoreconfHook, bison, binutils-unwrapped
+, libiberty, zlib
+}:
+
+stdenv.mkDerivation {
+  pname = "libbfd";
+  inherit (binutils-unwrapped) version src;
+
+  outputs = [ "out" "dev" ];
+
+  patches = binutils-unwrapped.patches ++ [
+    ../../tools/misc/binutils/build-components-separately.patch
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/mxe/mxe/e1d4c144ee1994f70f86cf7fd8168fe69bd629c6/src/bfd-1-disable-subdir-doc.patch";
+      sha256 = "0pzb3i74d1r7lhjan376h59a7kirw15j7swwm8pz3zy9lkdqkj6q";
+    })
+  ];
+
+  # We just want to build libbfd
+  postPatch = ''
+    cd bfd
+  '';
+
+  postAutoreconf = ''
+    echo "Updating config.guess and config.sub from ${gnu-config}"
+    cp -f ${gnu-config}/config.{guess,sub} ../
+  '';
+
+  # We update these ourselves
+  dontUpdateAutotoolsGnuConfigScripts = true;
+
+  nativeBuildInputs = [ autoreconfHook bison ];
+  buildInputs = [ libiberty zlib.dev ];
+
+  configurePlatforms = [ "build" "host" ];
+  configureFlags = [
+    "--enable-targets=all" "--enable-64-bit-bfd"
+    "--enable-install-libbfd"
+    "--enable-shared"
+    "--with-system-zlib"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A library for manipulating containers of machine code";
+    longDescription = ''
+      BFD is a library which provides a single interface to read and write
+      object files, executables, archive files, and core files in any format.
+      It is associated with GNU Binutils, and elsewhere often distributed with
+      it.
+    '';
+    homepage = "https://www.gnu.org/software/binutils/";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ ericson2314 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libbladeRF/default.nix b/nixpkgs/pkgs/development/libraries/libbladeRF/default.nix
new file mode 100644
index 000000000000..e8b550e06c2a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libbladeRF/default.nix
@@ -0,0 +1,67 @@
+{ stdenv, lib, fetchFromGitHub, fetchpatch, pkg-config, cmake, git, doxygen, help2man, ncurses, tecla
+, libusb1, udev }:
+let
+  # fetch submodule
+  noos = fetchFromGitHub {
+    owner = "analogdevicesinc";
+    repo = "no-OS";
+    rev = "0bba46e6f6f75785a65d425ece37d0a04daf6157";
+    sha256 = "0is79dhsyp9xmlnfdr1i5s1c22ipjafk9d35jpn5dynpvj86m99c";
+  };
+in stdenv.mkDerivation rec {
+  pname = "libbladeRF";
+  version = "2.2.1";
+
+  src = fetchFromGitHub {
+    owner = "Nuand";
+    repo = "bladeRF";
+    rev = "libbladeRF_v${version}";
+    sha256 = "0g89al4kwfbx1l3zjddgb9ay4mhr7zk0ndchca3sm1vq2j47nf4l";
+  };
+
+  # This patch is required for version 2.2.1. As the patch is already part of
+  # upstream master, it will be incorporated into the next release. The patch
+  # fixes a (well-justified) compiler warning which breaks the build because
+  # we compile with -Werror.
+  patches = [ (fetchpatch {
+    url = "https://github.com/Nuand/bladeRF/commit/163425d48a3b7d8c100d7295220d3648c050d0dd.patch";
+    sha256 = "1swsymlyxm3yk2k8l71z1fv0a5k2rmab02f0c7xkrvk683mq6yxw";
+  }) ];
+
+  nativeBuildInputs = [ cmake pkg-config git doxygen help2man ];
+  # ncurses used due to https://github.com/Nuand/bladeRF/blob/ab4fc672c8bab4f8be34e8917d3f241b1d52d0b8/host/utilities/bladeRF-cli/CMakeLists.txt#L208
+  buildInputs = [ tecla libusb1 ]
+    ++ lib.optionals stdenv.isLinux [ udev ]
+    ++ lib.optionals stdenv.isDarwin [ ncurses ];
+
+
+  postUnpack = ''
+    cp -r ${noos}/* source/thirdparty/analogdevicesinc/no-OS/
+  '';
+
+  # Fixup shebang
+  prePatch = "patchShebangs host/utilities/bladeRF-cli/src/cmd/doc/generate.bash";
+
+  # Let us avoid nettools as a dependency.
+  postPatch = ''
+    sed -i 's/$(hostname)/hostname/' host/utilities/bladeRF-cli/src/cmd/doc/generate.bash
+  '';
+
+  cmakeFlags = [
+    "-DBUILD_DOCUMENTATION=ON"
+  ] ++ lib.optionals stdenv.isLinux [
+    "-DUDEV_RULES_PATH=etc/udev/rules.d"
+    "-DINSTALL_UDEV_RULES=ON"
+    "-DBLADERF_GROUP=bladerf"
+  ];
+
+  hardeningDisable = [ "fortify" ];
+
+  meta = with lib; {
+    homepage = "https://nuand.com/libbladeRF-doc";
+    description = "Supporting library of the BladeRF SDR opensource hardware";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ funfunctor ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libblockdev/default.nix b/nixpkgs/pkgs/development/libraries/libblockdev/default.nix
new file mode 100644
index 000000000000..9b1654420e74
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libblockdev/default.nix
@@ -0,0 +1,60 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, substituteAll, autoreconfHook, pkg-config, gtk-doc
+, docbook_xml_dtd_43, python3, gobject-introspection, glib, udev, kmod, parted
+, cryptsetup, lvm2, dmraid, util-linux, libbytesize, libndctl, nss, volume_key
+, libxslt, docbook_xsl, gptfdisk, libyaml, autoconf-archive
+, thin-provisioning-tools, makeWrapper
+}:
+stdenv.mkDerivation rec {
+  pname = "libblockdev";
+  version = "2.25";
+
+  src = fetchFromGitHub {
+    owner = "storaged-project";
+    repo = "libblockdev";
+    rev = "${version}-1";
+    sha256 = "sha256-eHUHTogKoNrnwwSo6JaI7NMxVt9JeMqfWyhR62bDMuQ=";
+  };
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      sgdisk = "${gptfdisk}/bin/sgdisk";
+    })
+
+    # fix build with glib 2.68 (g_memdup is deprecated)
+    # https://github.com/storaged-project/libblockdev/pull/623
+    (fetchpatch {
+      url = "https://github.com/storaged-project/libblockdev/commit/5528baef6ccc835a06c45f9db34a2c9c3f2dd940.patch";
+      sha256 = "jxq4BLeyTMeNvBvY8k8QXIvYSJ2Gah0J75pq6FpG7PM=";
+    })
+  ];
+
+  postPatch = ''
+    patchShebangs scripts
+  '';
+
+  nativeBuildInputs = [
+    autoreconfHook pkg-config gtk-doc libxslt docbook_xsl docbook_xml_dtd_43
+    python3 gobject-introspection autoconf-archive makeWrapper
+  ];
+
+  buildInputs = [
+    glib udev kmod parted gptfdisk cryptsetup lvm2 dmraid util-linux libbytesize
+    libndctl nss volume_key libyaml
+  ];
+
+  postInstall = ''
+    wrapProgram $out/bin/lvm-cache-stats --prefix PATH : \
+      ${lib.makeBinPath [ thin-provisioning-tools ]}
+  '';
+
+  meta = with lib; {
+    description = "A library for manipulating block devices";
+    homepage = "http://storaged.org/libblockdev/";
+    license = with licenses; [ lgpl2Plus gpl2Plus ]; # lgpl2Plus for the library, gpl2Plus for the utils
+    maintainers = with maintainers; [ johnazoidberg ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libblockdev/fix-paths.patch b/nixpkgs/pkgs/development/libraries/libblockdev/fix-paths.patch
new file mode 100644
index 000000000000..85822165d8c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libblockdev/fix-paths.patch
@@ -0,0 +1,47 @@
+--- a/src/plugins/part.c
++++ b/src/plugins/part.c
+@@ -146,7 +146,7 @@ static GMutex deps_check_lock;
+ #define DEPS_LAST 2
+ 
+ static const UtilDep deps[DEPS_LAST] = {
+-    {"sgdisk", "0.8.6", NULL, "GPT fdisk \\(sgdisk\\) version ([\\d\\.]+)"},
++    {"@sgdisk@", "0.8.6", NULL, "GPT fdisk \\(sgdisk\\) version ([\\d\\.]+)"},
+     {"sfdisk", NULL, NULL, NULL},
+ };
+ 
+@@ -355,7 +355,7 @@ gboolean bd_part_create_table (const gchar *disk, BDPartTableType type, gboolean
+ }
+ 
+ static gchar* get_part_type_guid_and_gpt_flags (const gchar *device, int part_num, guint64 *flags, GError **error) {
+-    const gchar *args[4] = {"sgdisk", NULL, device, NULL};
++    const gchar *args[4] = {"@sgdisk@", NULL, device, NULL};
+     gchar *output = NULL;
+     gchar **lines = NULL;
+     gchar **line_p = NULL;
+@@ -1325,7 +1325,7 @@ gboolean bd_part_resize_part (const gchar *disk, const gchar *part, guint64 size
+ 
+ 
+ static gboolean set_gpt_flag (const gchar *device, int part_num, BDPartFlag flag, gboolean state, GError **error) {
+-    const gchar *args[5] = {"sgdisk", "--attributes", NULL, device, NULL};
++    const gchar *args[5] = {"@sgdisk@", "--attributes", NULL, device, NULL};
+     int bit_num = 0;
+     gboolean success = FALSE;
+ 
+@@ -1351,7 +1351,7 @@ static gboolean set_gpt_flag (const gchar *device, int part_num, BDPartFlag flag
+ }
+ 
+ static gboolean set_gpt_flags (const gchar *device, int part_num, guint64 flags, GError **error) {
+-    const gchar *args[5] = {"sgdisk", "--attributes", NULL, device, NULL};
++    const gchar *args[5] = {"@sgdisk@", "--attributes", NULL, device, NULL};
+     guint64 real_flags = 0;
+     gchar *mask_str = NULL;
+     gboolean success = FALSE;
+@@ -1791,7 +1791,7 @@ gboolean bd_part_set_part_name (const gchar *disk, const gchar *part, const gcha
+  * Tech category: %BD_PART_TECH_GPT-%BD_PART_TECH_MODE_MODIFY_PART
+  */
+ gboolean bd_part_set_part_type (const gchar *disk, const gchar *part, const gchar *type_guid, GError **error) {
+-    const gchar *args[5] = {"sgdisk", "--typecode", NULL, disk, NULL};
++    const gchar *args[5] = {"@sgdisk@", "--typecode", NULL, disk, NULL};
+     const gchar *part_num_str = NULL;
+     gboolean success = FALSE;
+     guint64 progress_id = 0;
diff --git a/nixpkgs/pkgs/development/libraries/libblocksruntime/default.nix b/nixpkgs/pkgs/development/libraries/libblocksruntime/default.nix
new file mode 100644
index 000000000000..0ab380064429
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libblocksruntime/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, clang }:
+
+stdenv.mkDerivation {
+  pname = "blocksruntime";
+  version = "unstable-2014-06-24";
+
+  src = fetchFromGitHub {
+    owner = "mackyle";
+    repo = "blocksruntime";
+    rev = "b5c5274daf1e0e46ecc9ad8f6f69889bce0a0a5d";
+    sha256 = "0ic4lagagkylcvwgf10mg0s1i57h4i25ds2fzvms22xj4zwzk1sd";
+  };
+
+  buildInputs = [ clang ];
+
+  configurePhase = ''
+    export CC=clang
+    export CXX=clang++
+  '';
+
+  buildPhase = "./buildlib";
+
+  checkPhase = "./checktests";
+
+  doCheck = false; # hasdescriptor.c test fails, hrm.
+
+  installPhase = ''prefix="/" DESTDIR=$out ./installlib'';
+
+  meta = with lib; {
+    description = "Installs the BlocksRuntime library from the compiler-rt";
+    homepage = "https://github.com/mackyle/blocksruntime";
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libbluedevil/default.nix b/nixpkgs/pkgs/development/libraries/libbluedevil/default.nix
new file mode 100644
index 000000000000..7cb4c9e2b32c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libbluedevil/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, cmake, qt4 }:
+
+stdenv.mkDerivation rec {
+  pname = "libbluedevil";
+  # bluedevil must have the same major version (x.y) as libbluedevil!
+  # do not update this package without checking bluedevil
+  version = "2.1";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/${pname}/${version}/src/${pname}-${version}.tar.xz";
+    sha256 = "0p4f0brhcz9gfxfd6114fa5x6swfdmgzv350xwncdr0s1qnamk8c";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ qt4 ];
+
+  meta = {
+    platforms = lib.platforms.unix;
+    license = lib.licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libbluray/BDJ-JARFILE-path.patch b/nixpkgs/pkgs/development/libraries/libbluray/BDJ-JARFILE-path.patch
new file mode 100644
index 000000000000..8d9c5d0fbba7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libbluray/BDJ-JARFILE-path.patch
@@ -0,0 +1,27 @@
+diff --git a/configure.ac b/configure.ac
+index 5fd3c8de..7ae343e0 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -228,6 +228,10 @@ if test "x$use_bdjava_jar" = "xyes" && test "x$HAVE_ANT" = "xno"; then
+     AC_MSG_ERROR([BD-J requires ANT, but ant was not found. Please install it.])
+ fi
+ 
++if test "x$use_bdjava_jar" = "xyes"; then
++  CPPFLAGS="${CPPFLAGS} -DJARDIR='\"\$(datadir)/java\"'"
++fi
++
+ AC_DEFINE_UNQUOTED([JAVA_ARCH], ["$java_arch"], ["Defines the architecture of the java vm."])
+ AC_DEFINE_UNQUOTED([JDK_HOME], ["$JDK_HOME"], [""])
+ AM_CONDITIONAL([USING_BDJAVA_BUILD_JAR], [ test $use_bdjava_jar = "yes" ])
+diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
+index 511ad533..e273b9e0 100644
+--- a/src/libbluray/bdj/bdj.c
++++ b/src/libbluray/bdj/bdj.c
+@@ -478,6 +478,7 @@ static const char *_find_libbluray_jar(BDJ_STORAGE *storage)
+     // pre-defined search paths for libbluray.jar
+     static const char * const jar_paths[] = {
+ #ifndef _WIN32
++        JARDIR "/" BDJ_JARFILE,
+         "/usr/share/java/" BDJ_JARFILE,
+         "/usr/share/libbluray/lib/" BDJ_JARFILE,
+ #endif
diff --git a/nixpkgs/pkgs/development/libraries/libbluray/default.nix b/nixpkgs/pkgs/development/libraries/libbluray/default.nix
new file mode 100644
index 000000000000..8fd680683dd8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libbluray/default.nix
@@ -0,0 +1,66 @@
+{ lib, stdenv, fetchurl, pkg-config, fontconfig, autoreconfHook, DiskArbitration
+, withJava ? false, jdk ? null, ant ? null
+, withAACS ? false, libaacs ? null
+, withBDplus ? false, libbdplus ? null
+, withMetadata ? true, libxml2 ? null
+, withFonts ? true, freetype ? null
+}:
+
+with lib;
+
+assert withJava -> jdk != null && ant != null;
+assert withAACS -> libaacs != null;
+assert withBDplus -> libbdplus != null;
+assert withMetadata -> libxml2 != null;
+assert withFonts -> freetype != null;
+
+# Info on how to use:
+# https://wiki.archlinux.org/index.php/BluRay
+
+stdenv.mkDerivation rec {
+  pname = "libbluray";
+  version  = "1.3.0";
+
+  src = fetchurl {
+    url = "http://get.videolan.org/libbluray/${version}/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-4tuvmehOCpcl9Jhby4XUHlLCJhzGUdiISxt5C17wFvk=";
+  };
+
+  patches = optional withJava ./BDJ-JARFILE-path.patch;
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ]
+                      ++ optionals withJava [ ant ]
+                      ;
+
+  buildInputs = [ fontconfig ]
+                ++ optional withJava jdk
+                ++ optional withMetadata libxml2
+                ++ optional withFonts freetype
+                ++ optional stdenv.isDarwin DiskArbitration
+                ;
+
+  propagatedBuildInputs = optional withAACS libaacs;
+
+  NIX_LDFLAGS = toString [
+    (optionalString withAACS   "-L${libaacs}/lib -laacs")
+    (optionalString withBDplus "-L${libbdplus}/lib -lbdplus")
+  ];
+
+  preConfigure = ''
+    ${optionalString withJava ''export JDK_HOME="${jdk.home}"''}
+  '';
+
+  configureFlags =  with lib;
+                    optional (! withJava) "--disable-bdjava-jar"
+                 ++ optional (! withMetadata) "--without-libxml2"
+                 ++ optional (! withFonts) "--without-freetype"
+                 ;
+
+  meta = with lib; {
+    homepage = "http://www.videolan.org/developers/libbluray.html";
+    description = "Library to access Blu-Ray disks for video playback";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ abbradar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libbsd/darwin.patch b/nixpkgs/pkgs/development/libraries/libbsd/darwin.patch
new file mode 100644
index 000000000000..340eb47a6301
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libbsd/darwin.patch
@@ -0,0 +1,454 @@
+diff --git a/configure.ac b/configure.ac
+index 6e9496d..60b6e4c 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -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 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
+@@ -169,7 +171,8 @@ AC_LINK_IFELSE(
+ 
+ AC_CHECK_FUNCS([clearenv dirfd fopencookie __fpurge \
+                 getauxval getentropy getexecname getline \
+-                pstat_getproc sysconf])
++                pstat_getproc sysconf \
++		strlcpy strlcat strnstr strmode fpurge])
+ AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xtrue"])
+ 
+ AC_CONFIG_FILES([
+diff --git a/include/bsd/string.h b/include/bsd/string.h
+index f987fee..a1e17ed 100644
+--- a/include/bsd/string.h
++++ b/include/bsd/string.h
+@@ -41,10 +41,21 @@
+ #include <sys/types.h>
+ 
+ __BEGIN_DECLS
++#if !HAVE_STRLCPY
+ size_t strlcpy(char *dst, const char *src, size_t siz);
++#endif
++
++#if !HAVE_STRLCAT
+ size_t strlcat(char *dst, const char *src, size_t siz);
++#endif
++
++#if !HAVE_STRNSTR
+ char *strnstr(const char *str, const char *find, size_t str_len);
++#endif
++
++#if !HAVE_STRMODE
+ void strmode(mode_t mode, char *str);
++#endif
+ 
+ #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 8384b92..e2c8e15 100644
+--- a/src/Makefile.am
++++ b/src/Makefile.am
+@@ -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 HAVE_VSCRIPT
++libbsd_la_LDFLAGS += $(VSCRIPT_LDFLAGS),@srcdir@/libbsd.map
++endif
++
+ libbsd_la_SOURCES = \
+ 	arc4random.c \
+ 	arc4random.h \
+diff --git a/src/fpurge.c b/src/fpurge.c
+index 462535a..a8941db 100644
+--- a/src/fpurge.c
++++ b/src/fpurge.c
+@@ -26,9 +26,10 @@
+ 
+ #include <errno.h>
+ #include <stdio.h>
+-#include <stdio_ext.h>
+ 
+ #ifdef HAVE___FPURGE
++#include <stdio_ext.h>
++
+ int
+ fpurge(FILE *fp)
+ {
+@@ -41,6 +42,36 @@ fpurge(FILE *fp)
+ 
+ 	return 0;
+ }
++/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin 1.7 */
++#elif HAVE_FPURGE
++int
++fpurge(FILE *fp)
++{
++	if (fp == NULL || fileno(fp) < 0) {
++		errno = EBADF;
++		return EOF;
++	}
++
++  /* Call the system's fpurge function.  */
++#undef fpurge
++#if !HAVE_DECL_FPURGE
++  extern int fpurge (FILE *);
++#endif
++  int result = fpurge (fp);
++/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
++#if defined(__sferror) || defined(__DragonFly__)
++  if (result == 0)
++    /* Correct the invariants that fpurge broke.
++       <stdio.h> on BSD systems says:
++         "The following always hold: if _flags & __SRD, _w is 0."
++       If this invariant is not fulfilled and the stream is read-write but
++       currently reading, subsequent putc or fputc calls will write directly
++       into the buffer, although they shouldn't be allowed to.  */
++    if ((fp->_flags & __SRD) != 0)
++      fp->_w = 0;
++#endif
++  return result;
++}
+ #else
+ #error "Function fpurge() needs to be ported."
+ #endif
+diff --git a/src/funopen.c b/src/funopen.c
+index 1e05c7e..65ba5a8 100644
+--- a/src/funopen.c
++++ b/src/funopen.c
+@@ -143,6 +143,7 @@ funopen(const void *cookie,
+  * they will not add the needed support to implement it. Just ignore this
+  * interface there, as it has never been provided anyway.
+  */
++#elif defined(__MACH__)
+ #else
+ #error "Function funopen() needs to be ported or disabled."
+ #endif
+diff --git a/src/hash/sha512.h b/src/hash/sha512.h
+index 4f368a1..7632e25 100644
+--- a/src/hash/sha512.h
++++ b/src/hash/sha512.h
+@@ -29,7 +29,11 @@
+ #ifndef _SHA512_H_
+ #define _SHA512_H_
+ 
++#ifdef __MACH__
++#include <stdint.h>
++#else
+ #include <sys/types.h>
++#endif
+ 
+ #define SHA512_DIGEST_LENGTH		64
+ 
+diff --git a/src/hash/sha512c.c b/src/hash/sha512c.c
+index b3c8d5e..602f54e 100644
+--- a/src/hash/sha512c.c
++++ b/src/hash/sha512c.c
+@@ -25,7 +25,12 @@
+  */
+ 
+ #include <sys/cdefs.h>
++
++#ifdef __MACH__
++#include <machine/endian.h>
++#else
+ #include <sys/endian.h>
++#endif
+ #include <sys/types.h>
+ 
+ #include <string.h>
+diff --git a/src/local-link.h b/src/local-link.h
+index 0d4351a..fc520af 100644
+--- a/src/local-link.h
++++ b/src/local-link.h
+@@ -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;
+@@ -45,3 +50,4 @@
+ #endif
+ 
+ #endif
++#endif
+diff --git a/src/nlist.c b/src/nlist.c
+index 228c220..46c2d77 100644
+--- a/src/nlist.c
++++ b/src/nlist.c
+@@ -41,6 +41,7 @@
+ #include <unistd.h>
+ #include <nlist.h>
+ 
++#if !HAVE_NLIST_H
+ #include "local-elf.h"
+ 
+ #define SIZE_T_MAX 0xffffffffU
+@@ -280,3 +281,4 @@ nlist(const char *name, struct nlist *list)
+ 	(void)close(fd);
+ 	return (n);
+ }
++#endif
+diff --git a/src/readpassphrase.c b/src/readpassphrase.c
+index f9f6195..2bc5fb4 100644
+--- a/src/readpassphrase.c
++++ b/src/readpassphrase.c
+@@ -36,6 +36,14 @@
+ #define TCSASOFT 0
+ #endif
+ 
++#ifndef _SIGMAX
++#define	_SIGMAX	64
++#endif
++
++#ifndef _NSIG
++#define _NSIG (_SIGMAX + 1)
++#endif
++
+ static volatile sig_atomic_t signo[_NSIG];
+ 
+ static void handler(int);
+diff --git a/src/setproctitle.c b/src/setproctitle.c
+index ff32aa3..51ed833 100644
+--- a/src/setproctitle.c
++++ b/src/setproctitle.c
+@@ -33,6 +33,10 @@
+ #include <string.h>
+ #include "local-link.h"
+ 
++#ifdef __MACH__
++extern char **environ;
++#endif
++
+ static struct {
+ 	/* Original value. */
+ 	const char *arg0;
+@@ -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__
++#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
++++ b/src/strlcat.c
+@@ -26,6 +26,7 @@
+  * Returns strlen(src) + MIN(dsize, strlen(initial dst)).
+  * If retval >= dsize, truncation occurred.
+  */
++#if !HAVE_STRLCAT
+ size_t
+ strlcat(char *dst, const char *src, size_t dsize)
+ {
+@@ -53,3 +54,4 @@ strlcat(char *dst, const char *src, size_t dsize)
+ 
+ 	return(dlen + (src - osrc));	/* count does not include NUL */
+ }
++#endif
+diff --git a/src/strlcpy.c b/src/strlcpy.c
+index e9a7fe4..5137acb 100644
+--- a/src/strlcpy.c
++++ b/src/strlcpy.c
+@@ -24,6 +24,7 @@
+  * chars will be copied.  Always NUL terminates (unless dsize == 0).
+  * Returns strlen(src); if retval >= dsize, truncation occurred.
+  */
++#if !HAVE_STRLCPY
+ size_t
+ strlcpy(char *dst, const char *src, size_t dsize)
+ {
+@@ -48,3 +49,4 @@ strlcpy(char *dst, const char *src, size_t dsize)
+ 
+ 	return(src - osrc - 1);	/* count does not include NUL */
+ }
++#endif
+diff --git a/src/strmode.c b/src/strmode.c
+index e6afde5..da680c9 100644
+--- a/src/strmode.c
++++ b/src/strmode.c
+@@ -32,6 +32,7 @@
+ #include <sys/stat.h>
+ #include <string.h>
+ 
++#if !HAVE_STRMODE
+ void
+ strmode(mode_t mode, char *p)
+ {
+@@ -141,3 +142,4 @@ strmode(mode_t mode, char *p)
+ 	*p++ = ' ';		/* will be a '+' if ACL's implemented */
+ 	*p = '\0';
+ }
++#endif
diff --git a/nixpkgs/pkgs/development/libraries/libbsd/default.nix b/nixpkgs/pkgs/development/libraries/libbsd/default.nix
new file mode 100644
index 000000000000..8754dd5f65d2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libbsd/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "libbsd";
+  version = "0.10.0";
+
+  src = fetchurl {
+    url = "https://libbsd.freedesktop.org/releases/${pname}-${version}.tar.xz";
+    sha256 = "11x8q45jvjvf2dvgclds64mscyg10lva33qinf2hwgc84v3svf1l";
+  };
+
+  outputs = [ "out" "dev" "man" ];
+
+  # darwin changes configure.ac which means we need to regenerate
+  # the configure scripts
+  nativeBuildInputs = [ autoreconfHook ];
+
+  patches = [ ./darwin.patch ];
+
+  meta = with lib; {
+    description = "Common functions found on BSD systems";
+    homepage = "https://libbsd.freedesktop.org/";
+    license = licenses.bsd3;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ matthewbauer ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libbson/default.nix b/nixpkgs/pkgs/development/libraries/libbson/default.nix
new file mode 100644
index 000000000000..e03d7c194847
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libbson/default.nix
@@ -0,0 +1,23 @@
+{ fetchFromGitHub, perl, lib, stdenv, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "libbson";
+  version = "1.9.5";
+
+  src = fetchFromGitHub {
+    owner = "mongodb";
+    repo = "libbson";
+    rev = version;
+    sha256 = "16rmzxhhmbvhp4q6qac5j9c74z2pcg5raag5w16mynzikdd2l05b";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ perl ];
+
+  meta = with lib; {
+    description = "A C Library for parsing, editing, and creating BSON documents";
+    homepage = "https://github.com/mongodb/libbson";
+    license = licenses.asl20;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libbtbb/default.nix b/nixpkgs/pkgs/development/libraries/libbtbb/default.nix
new file mode 100644
index 000000000000..15047f6e8f2f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libbtbb/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, lib, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "libbtbb";
+  version = "2020-12-R1";
+
+  src = fetchFromGitHub {
+    owner = "greatscottgadgets";
+    repo = pname;
+    rev = version;
+    sha256 = "1byv8174xam7siakr1p0523x97wkh0fmwmq341sd3g70qr2g767d";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Bluetooth baseband decoding library";
+    homepage = "https://github.com/greatscottgadgets/libbtbb";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ oxzi ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libburn/default.nix b/nixpkgs/pkgs/development/libraries/libburn/default.nix
new file mode 100644
index 000000000000..f9b6538027d6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libburn/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libburn";
+  version = "1.5.4";
+
+  src = fetchurl {
+    url = "http://files.libburnia-project.org/releases/${pname}-${version}.tar.gz";
+    sha256 = "sha256-UlBZ0QdZxcuBSO68hju1EOMRxmNgPae9LSHEa3z2O1Q=";
+  };
+
+  meta = with lib; {
+    homepage = "http://libburnia-project.org/";
+    description = "A library by which preformatted data get onto optical media: CD, DVD, BD (Blu-Ray)";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ abbradar vrthra ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libbytesize/default.nix b/nixpkgs/pkgs/development/libraries/libbytesize/default.nix
new file mode 100644
index 000000000000..eda85e286b4c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libbytesize/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, gettext
+, gtk-doc, libxslt, docbook_xml_dtd_43, docbook_xsl
+, python3, pcre2, gmp, mpfr
+}:
+
+let
+  version = "2.6";
+in stdenv.mkDerivation rec {
+  pname = "libbytesize";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "storaged-project";
+    repo = "libbytesize";
+    rev = version;
+    sha256 = "sha256-akZFd7rUjBQ/yj79NHWTNUro3wKu81F0Y1GX8gMdJ5Y=";
+  };
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config gettext gtk-doc libxslt docbook_xml_dtd_43 docbook_xsl python3 ];
+
+  buildInputs = [ pcre2 gmp mpfr ];
+
+  meta = with lib; {
+    description = "A tiny library providing a C “class” for working with arbitrary big sizes in bytes";
+    homepage = src.meta.homepage;
+    license = licenses.lgpl2Plus;
+    maintainers = with maintainers; [];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcaca/default.nix b/nixpkgs/pkgs/development/libraries/libcaca/default.nix
new file mode 100644
index 000000000000..f12409f271f9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcaca/default.nix
@@ -0,0 +1,75 @@
+{ lib
+, stdenv
+, fetchurl
+, imlib2
+, libX11
+, libXext
+, ncurses
+, pkg-config
+, x11Support ? !stdenv.isDarwin
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libcaca";
+  version = "0.99.beta19";
+
+  src = fetchurl {
+    urls = [
+      "http://fossies.org/linux/privat/${pname}-${version}.tar.gz"
+      "http://caca.zoy.org/files/libcaca/${pname}-${version}.tar.gz"
+    ];
+    hash = "sha256-EotGfE7QMmTBh0BRcqToMEk0LMjML2VfU6LQ7p03cvQ=";
+  };
+
+  outputs = [ "bin" "dev" "out" "man" ];
+
+  configureFlags = [
+    (if x11Support then "--enable-x11" else "--disable-x11")
+  ];
+
+  NIX_CFLAGS_COMPILE = lib.optionalString (!x11Support) "-DX_DISPLAY_MISSING";
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+  buildInputs = [
+    ncurses
+    zlib
+    (imlib2.override { inherit x11Support; })
+  ] ++ lib.optionals x11Support [
+    libX11
+    libXext
+  ];
+
+  postInstall = ''
+    mkdir -p $dev/bin
+    mv $bin/bin/caca-config $dev/bin/caca-config
+  '';
+
+  meta = with lib; {
+    homepage = "http://caca.zoy.org/wiki/libcaca";
+    description = "A graphics library that outputs text instead of pixels";
+    longDescription = ''
+      libcaca is a graphics library that outputs text instead of pixels, so that
+      it can work on older video cards or text terminals. It is not unlike the
+      famous ​AAlib library, with the following improvements:
+
+      - Unicode support
+      - 2048 available colours (some devices can only handle 16)
+      - dithering of colour images
+      - advanced text canvas operations (blitting, rotations)
+
+      Libcaca works in a text terminal (and should thus work on all Unix systems
+      including Mac OS X) using the S-Lang or ncurses libraries. It also works
+      natively on DOS and Windows.
+
+      Libcaca was written by Sam Hocevar and Jean-Yves Lamoureux.
+    '';
+    license = licenses.wtfpl;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcacard/default.nix b/nixpkgs/pkgs/development/libraries/libcacard/default.nix
new file mode 100644
index 000000000000..c484a49b1a2b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcacard/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, pkg-config, glib, nss }:
+
+stdenv.mkDerivation rec {
+  pname = "libcacard";
+  version = "2.7.0";
+
+  src = fetchurl {
+    url = "https://www.spice-space.org/download/libcacard/${pname}-${version}.tar.xz";
+    sha256 = "0vyvkk4b6xjwq1ccggql13c1x7g4y90clpkqw28257azgn2a1c8n";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ glib nss ];
+
+  meta = with lib; {
+    description = "Smart card emulation library";
+    homepage = "https://gitlab.freedesktop.org/spice/libcacard";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ yegortimoshenko ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcamera/default.nix b/nixpkgs/pkgs/development/libraries/libcamera/default.nix
new file mode 100644
index 000000000000..90a946597e77
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcamera/default.nix
@@ -0,0 +1,76 @@
+{ stdenv
+, fetchgit
+, lib
+, meson
+, ninja
+, pkg-config
+, boost
+, gnutls
+, openssl
+, libevent
+, lttng-ust
+, gst_all_1
+, gtest
+, graphviz
+, doxygen
+, python3
+, python3Packages
+}:
+
+stdenv.mkDerivation {
+  pname = "libcamera";
+  version = "unstable-2021-06-02";
+
+  src = fetchgit {
+    url = "git://linuxtv.org/libcamera.git";
+    rev = "143b252462b9b795a1286a30349348642fcb87f5";
+    sha256 = "0mlwgd3rxagzhmc94lnn6snriyqvfdpz8r8f58blcf16859galyl";
+  };
+
+  postPatch = ''
+    patchShebangs utils/
+  '';
+
+  buildInputs = [
+    # IPA and signing
+    gnutls
+    openssl
+    boost
+
+    # gstreamer integration
+    gst_all_1.gstreamer
+    gst_all_1.gst-plugins-base
+
+    # cam integration
+    libevent
+
+    # lttng tracing
+    lttng-ust
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    python3
+    python3Packages.jinja2
+    python3Packages.pyyaml
+    python3Packages.ply
+    python3Packages.sphinx
+    gtest
+    graphviz
+    doxygen
+  ];
+
+  mesonFlags = [ "-Dv4l2=true" "-Dqcam=disabled" ];
+
+  # Fixes error on a deprecated declaration
+  NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
+
+  meta = with lib; {
+    description = "An open source camera stack and framework for Linux, Android, and ChromeOS";
+    homepage = "https://libcamera.org";
+    license = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ citadelcore ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcanberra/default.nix b/nixpkgs/pkgs/development/libraries/libcanberra/default.nix
new file mode 100644
index 000000000000..92f05b8cd303
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcanberra/default.nix
@@ -0,0 +1,70 @@
+{ stdenv, lib, fetchurl, fetchpatch, pkg-config, libtool
+, gtk2-x11, gtk3-x11 , gtkSupport ? null
+, libpulseaudio, gst_all_1, libvorbis, libcap
+, Carbon, CoreServices
+, withAlsa ? stdenv.isLinux, alsa-lib }:
+
+stdenv.mkDerivation rec {
+  pname = "libcanberra";
+  version = "0.30";
+
+  src = fetchurl {
+    url = "http://0pointer.de/lennart/projects/libcanberra/${pname}-${version}.tar.xz";
+    sha256 = "0wps39h8rx2b00vyvkia5j40fkak3dpipp1kzilqla0cgvk73dn2";
+  };
+
+  nativeBuildInputs = [ pkg-config libtool ];
+  buildInputs = [
+    libpulseaudio libvorbis
+  ] ++ (with gst_all_1; [ gstreamer gst-plugins-base ])
+    ++ lib.optional (gtkSupport == "gtk2") gtk2-x11
+    ++ lib.optional (gtkSupport == "gtk3") gtk3-x11
+    ++ lib.optionals stdenv.isDarwin [Carbon CoreServices]
+    ++ lib.optional stdenv.isLinux libcap
+    ++ lib.optional withAlsa alsa-lib;
+
+  configureFlags = [ "--disable-oss" ];
+
+  patches = [
+    (fetchpatch {
+      name = "0001-gtk-Don-t-assume-all-GdkDisplays-are-GdkX11Displays-.patch";
+      url = "http://git.0pointer.net/libcanberra.git/patch/?id=c0620e432650e81062c1967cc669829dbd29b310";
+      sha256 = "0rc7zwn39yxzxp37qh329g7375r5ywcqcaak8ryd0dgvg8m5hcx9";
+    })
+  ];
+
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    patch -p0 < ${fetchpatch {
+      url = "https://raw.githubusercontent.com/macports/macports-ports/master/audio/libcanberra/files/patch-configure.diff";
+      sha256 = "1f7h7ifpqvbfhqygn1b7klvwi80zmpv3538vbmq7ql7bkf1q8h31";
+    }}
+  '';
+
+  postInstall = ''
+    for f in $out/lib/*.la; do
+      sed 's|-lltdl|-L${libtool.lib}/lib -lltdl|' -i $f
+    done
+  '';
+
+  passthru = lib.optionalAttrs (gtkSupport != null) {
+    gtkModule = if gtkSupport == "gtk2" then "/lib/gtk-2.0" else "/lib/gtk-3.0/";
+  };
+
+  meta = with lib; {
+    description = "An implementation of the XDG Sound Theme and Name Specifications";
+    longDescription = ''
+      libcanberra is an implementation of the XDG Sound Theme and Name
+      Specifications, for generating event sounds on free desktops
+      such as GNOME.  It comes with several backends (ALSA,
+      PulseAudio, OSS, GStreamer, null) and is designed to be
+      portable.
+    '';
+    homepage = "http://0pointer.de/lennart/projects/libcanberra/";
+    license = licenses.lgpl2Plus;
+    maintainers = [ ];
+    platforms = platforms.unix;
+    # canberra-gtk-module.c:28:10: fatal error: 'gdk/gdkx.h' file not found
+    # #include <gdk/gdkx.h>
+    broken = stdenv.isDarwin && (gtkSupport == "gtk3");
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcangjie/default.nix b/nixpkgs/pkgs/development/libraries/libcangjie/default.nix
new file mode 100644
index 000000000000..c6bbbcdb61ab
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcangjie/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, autoconf, automake, libtool, m4, fetchurl, bash, pkg-config, sqlite }:
+
+stdenv.mkDerivation rec {
+  pname = "libcangjie";
+  version = "1.4_rev_${rev}";
+  rev = "a73c1d8783f7b6526fd9b2cc44a669ffa5518d3d";
+
+  src = fetchurl {
+    url = "https://github.com/Cangjians/libcangjie/archive/${rev}.tar.gz";
+    sha256 = "0i5svvcx099fc9hh5dvr3gpb1041v6vn5fnylxy82zjy239114lg";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ automake autoconf libtool m4 sqlite ];
+
+  configureScript = "./autogen.sh";
+
+  preConfigure = ''
+    find . -name '*.sh' -exec sed -e 's@#!/bin/bash@${bash}/bin/bash@' -i '{}' ';'
+  '';
+
+  doCheck = true;
+
+  meta = {
+    description = "A C library implementing the Cangjie input method";
+    longDescription = ''
+      libcangjie is a library implementing the Cangjie input method.
+    '';
+    homepage = "http://cangjians.github.io/projects/libcangjie/";
+    license = lib.licenses.lgpl3Plus;
+
+    maintainers = [ lib.maintainers.linquize ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcbor/default.nix b/nixpkgs/pkgs/development/libraries/libcbor/default.nix
new file mode 100644
index 000000000000..349b715d8520
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcbor/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, cmake, cmocka }:
+
+stdenv.mkDerivation rec {
+  pname = "libcbor";
+  version = "0.8.0";
+
+  src = fetchFromGitHub {
+    owner = "PJK";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "01dv4vxcmbvpphqy16vqiwh25wx11x630js5wfnx7cryarsh9ld7";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  checkInputs = [ cmocka ];
+
+  doCheck = false; # needs "-DWITH_TESTS=ON", but fails w/compilation error
+
+  cmakeFlags = [ "-DCMAKE_INSTALL_LIBDIR=lib" "-DBUILD_SHARED_LIBS=on" ];
+
+  meta = with lib; {
+    description = "CBOR protocol implementation for C and others";
+    homepage = "https://github.com/PJK/libcbor";
+    license = licenses.mit;
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libccd/default.nix b/nixpkgs/pkgs/development/libraries/libccd/default.nix
new file mode 100644
index 000000000000..c8e7c8af2104
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libccd/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "libccd";
+  version = "2.1";
+
+  src = fetchFromGitHub {
+    owner = "danfis";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0sfmn5pd7k5kyhbxnd689xmsa5v843r7sska96dlysqpljd691jc";
+  };
+
+  patches = [
+    # Fix pkgconfig file with absolute CMAKE_INSTALL_*DIR
+    # https://github.com/danfis/libccd/pull/76
+    (fetchpatch {
+      url = "https://github.com/danfis/libccd/commit/cd16c4f168ae308e4c77db66ac97a2eaf47e059e.patch";
+      sha256 = "02wj21c185kwf8bn4qi4cnna0ypzqm481xw9rr8jy1i0cb1r9idg";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Library for collision detection between two convex shapes";
+    homepage = "https://github.com/danfis/libccd";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ lopsided98 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcdaudio/default.nix b/nixpkgs/pkgs/development/libraries/libcdaudio/default.nix
new file mode 100644
index 000000000000..e5f6324e261c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcdaudio/default.nix
@@ -0,0 +1,16 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation {
+  name = "libcdaudio-0.99.12p2";
+  src = fetchurl {
+    url = "mirror://sourceforge/libcdaudio/libcdaudio-0.99.12p2.tar.gz";
+    sha256 = "1fsy6dlzxrx177qc877qhajm9l4g28mvh06h2l15rxy4bapzknjz" ;
+  };
+
+  meta = {
+    description = "A portable library for controlling audio CDs";
+    homepage = "http://libcdaudio.sourceforge.net";
+    platforms = lib.platforms.linux;
+    license = lib.licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcddb/default.nix b/nixpkgs/pkgs/development/libraries/libcddb/default.nix
new file mode 100644
index 000000000000..bf20211ee60a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcddb/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, libiconv }:
+
+stdenv.mkDerivation rec {
+  pname = "libcddb";
+  version = "1.3.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libcddb/${pname}-${version}.tar.bz2";
+    sha256 = "0fr21a7vprdyy1bq6s99m0x420c9jm5fipsd63pqv8qyfkhhxkim";
+  };
+
+  buildInputs = lib.optional stdenv.isDarwin libiconv;
+
+  configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "ac_cv_func_malloc_0_nonnull=yes"
+    "ac_cv_func_realloc_0_nonnull=yes"
+  ];
+
+  doCheck = false; # fails 3 of 5 tests with locale errors
+
+  meta = with lib; {
+    description = "C library to access data on a CDDB server (freedb.org)";
+    homepage = "http://libcddb.sourceforge.net/";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcdio-paranoia/default.nix b/nixpkgs/pkgs/development/libraries/libcdio-paranoia/default.nix
new file mode 100644
index 000000000000..905d39dbd8ea
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcdio-paranoia/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, libcdio, pkg-config,
+  libiconv, IOKit, DiskArbitration}:
+
+stdenv.mkDerivation {
+  name = "libcdio-paranoia-0.94+2";
+
+  src = fetchFromGitHub {
+    owner = "rocky";
+    repo = "libcdio-paranoia";
+    rev = "release-10.2+0.94+2";
+    sha256 = "1wjgmmaca4baw7k5c3vdap9hnjc49ciagi5kvpvync3aqfmdvkha";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ libcdio ] ++
+    lib.optionals stdenv.isDarwin [ libiconv IOKit DiskArbitration ];
+
+  propagatedBuildInputs = lib.optional stdenv.isDarwin DiskArbitration;
+
+  configureFlags = lib.optionals stdenv.isDarwin [
+    "--disable-ld-version-script"
+  ];
+
+  meta = with lib; {
+    description = "CD paranoia on top of libcdio";
+    longDescription = ''
+      This is a port of xiph.org's cdda paranoia to use libcdio for CDROM
+      access. By doing this, cdparanoia runs on platforms other than GNU/Linux.
+    '';
+    license = licenses.gpl3;
+    homepage = "https://github.com/rocky/libcdio-paranoia";
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcdio/default.nix b/nixpkgs/pkgs/development/libraries/libcdio/default.nix
new file mode 100644
index 000000000000..cfe796b14d06
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcdio/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, libcddb, pkg-config, ncurses, help2man, libiconv, Carbon, IOKit }:
+
+stdenv.mkDerivation rec {
+  name = "libcdio-2.1.0";
+
+  src = fetchurl {
+    url = "mirror://gnu/libcdio/${name}.tar.bz2";
+    sha256 = "0avi6apv5ydjy6b9c3z9a46rvp5i57qyr09vr7x4nndxkmcfjl45";
+  };
+
+  postPatch = ''
+    patchShebangs .
+  '';
+
+  nativeBuildInputs = [ pkg-config help2man ];
+  buildInputs = [ libcddb ncurses ]
+    ++ lib.optionals stdenv.isDarwin [ libiconv Carbon IOKit ];
+
+  doCheck = !stdenv.isDarwin;
+
+  meta = with lib; {
+    description = "A library for OS-independent CD-ROM and CD image access";
+    longDescription = ''
+      GNU libcdio is a library for OS-independent CD-ROM and
+      CD image access.  It includes a library for working with
+      ISO-9660 filesystems (libiso9660), as well as utility
+      programs such as an audio CD player and an extractor.
+    '';
+    homepage = "https://www.gnu.org/software/libcdio/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcdr/default.nix b/nixpkgs/pkgs/development/libraries/libcdr/default.nix
new file mode 100644
index 000000000000..a8208820dff4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcdr/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, fetchpatch, libwpg, libwpd, lcms, pkg-config, librevenge, icu, boost, cppunit }:
+
+stdenv.mkDerivation rec {
+  pname = "libcdr";
+  version = "0.1.6";
+
+  src = fetchurl {
+    url = "https://dev-www.libreoffice.org/src/${pname}-${version}.tar.xz";
+    sha256 = "0qgqlw6i25zfq1gf7f6r5hrhawlrgh92sg238kjpf2839aq01k81";
+  };
+
+  patches = [
+    # Fix build with icu 68
+    # Remove in next release
+    (fetchpatch {
+      name = "libcdr-fix-icu-68";
+      url = "https://cgit.freedesktop.org/libreoffice/libcdr/patch/?id=bf3e7f3bbc414d4341cf1420c99293debf1bd894";
+      sha256 = "0cgra10p8ibgwn8y5q31jrpan317qj0ribzjs4jq0bwavjq92w2k";
+    })
+  ];
+
+  buildInputs = [ libwpg libwpd lcms librevenge icu boost cppunit ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  CXXFLAGS="--std=gnu++0x"; # For c++11 constants in lcms2.h
+
+  meta = {
+    description = "A library providing ability to interpret and import Corel Draw drawings into various applications";
+    homepage = "http://www.freedesktop.org/wiki/Software/libcdr";
+    platforms = lib.platforms.all;
+    license = lib.licenses.mpl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcec/default.nix b/nixpkgs/pkgs/development/libraries/libcec/default.nix
new file mode 100644
index 000000000000..b0de95923477
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcec/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, cmake, pkg-config, udev, libcec_platform, libraspberrypi ? null }:
+
+stdenv.mkDerivation rec {
+  pname = "libcec";
+  version = "6.0.2";
+
+  src = fetchurl {
+    url = "https://github.com/Pulse-Eight/libcec/archive/libcec-${version}.tar.gz";
+    sha256 = "0xrkrcgfgr5r8r0854bw3i9jbq4jmf8nzc5vrrx2sxzvlkbrc1h9";
+  };
+
+  nativeBuildInputs = [ pkg-config cmake ];
+  buildInputs = [ udev libcec_platform ] ++
+    lib.optional (libraspberrypi != null) libraspberrypi;
+
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=1" ];
+
+  # Fix dlopen path
+  patchPhase = ''
+    substituteInPlace include/cecloader.h --replace "libcec.so" "$out/lib/libcec.so"
+  '';
+
+  meta = with lib; {
+    description = "Allows you (with the right hardware) to control your device with your TV remote control using existing HDMI cabling";
+    homepage = "http://libcec.pulse-eight.com";
+    repositories.git = "https://github.com/Pulse-Eight/libcec.git";
+    license = lib.licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.titanous ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcec/platform.nix b/nixpkgs/pkgs/development/libraries/libcec/platform.nix
new file mode 100644
index 000000000000..45c34b53cd77
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcec/platform.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "p8-platform";
+  version = "2.1.0.1";
+
+  src = fetchurl {
+    url = "https://github.com/Pulse-Eight/platform/archive/p8-platform-${version}.tar.gz";
+    sha256 = "18381y54f7d18ckpzf9cfxbz1ws6imprbbm9pvhcg5c86ln8skq6";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Platform library for libcec and Kodi addons";
+    homepage = "https://github.com/Pulse-Eight/platform";
+    repositories.git = "https://github.com/Pulse-Eight/platform.git";
+    license = lib.licenses.gpl2Plus;
+    platforms = platforms.all;
+    maintainers = [ maintainers.titanous ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcef/default.nix b/nixpkgs/pkgs/development/libraries/libcef/default.nix
new file mode 100644
index 000000000000..85163daad0a1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcef/default.nix
@@ -0,0 +1,112 @@
+{ lib
+, stdenv
+, fetchurl
+, cmake
+, glib
+, nss
+, nspr
+, atk
+, at-spi2-atk
+, libdrm
+, expat
+, libxcb
+, libxkbcommon
+, libX11
+, libXcomposite
+, libXdamage
+, libXext
+, libXfixes
+, libXrandr
+, mesa
+, gtk3
+, pango
+, cairo
+, alsa-lib
+, dbus
+, at-spi2-core
+, cups
+, libxshmfence
+}:
+
+let
+  rpath = lib.makeLibraryPath [
+    glib
+    nss
+    nspr
+    atk
+    at-spi2-atk
+    libdrm
+    expat
+    libxcb
+    libxkbcommon
+    libX11
+    libXcomposite
+    libXdamage
+    libXext
+    libXfixes
+    libXrandr
+    mesa
+    gtk3
+    pango
+    cairo
+    alsa-lib
+    dbus
+    at-spi2-core
+    cups
+    libxshmfence
+  ];
+  platforms = {
+    "aarch64-linux" = {
+      platformStr = "linuxarm64";
+      projectArch = "arm64";
+      sha256 = "1j93qawh9h6k2ic70i10npppv5f9dch961lc1wxwsi68daq8r081";
+    };
+    "i686-linux" = {
+      platformStr = "linux32";
+      projectArch = "x86";
+      sha256 = "0ki4zr8ih06kirgbpxbinv4baw3qvacx208q6qy1cvpfh6ll4fwb";
+    };
+    "x86_64-linux" = {
+      platformStr = "linux64";
+      projectArch = "x86_64";
+      sha256 = "1ja711x9fdlf21qw1k9xn3lvjc5zsfgnjga1w1r8sysam73jk7xj";
+    };
+  };
+
+  platformInfo = builtins.getAttr stdenv.targetPlatform.system platforms;
+in
+stdenv.mkDerivation rec {
+  pname = "cef-binary";
+  version = "90.6.7";
+  gitRevision = "19ba721";
+  chromiumVersion = "90.0.4430.212";
+
+  src = fetchurl {
+    url = "https://cef-builds.spotifycdn.com/cef_binary_${version}+g${gitRevision}+chromium-${chromiumVersion}_${platformInfo.platformStr}_minimal.tar.bz2";
+    inherit (platformInfo) sha256;
+  };
+
+  nativeBuildInputs = [ cmake ];
+  cmakeFlags = "-DPROJECT_ARCH=${platformInfo.projectArch}";
+  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/
+    cp ../Release/libcef.so $out/lib/
+    patchelf --set-rpath "${rpath}" $out/lib/libcef.so
+    cp ../Release/*.bin $out/share/cef/
+    cp -r ../Resources/* $out/share/cef/
+    cp -r ../include $out/
+  '';
+
+  meta = with lib; {
+    description = "Simple framework for embedding Chromium-based browsers in other applications";
+    homepage = "https://cef-builds.spotifycdn.com/index.html";
+    maintainers = with maintainers; [ puffnfresh ];
+    license = licenses.bsd3;
+    platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcello/default.nix b/nixpkgs/pkgs/development/libraries/libcello/default.nix
new file mode 100644
index 000000000000..100077bcc706
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcello/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libcello";
+  version = "2.1.0";
+
+  src = fetchurl {
+    url = "http://libcello.org/static/libCello-${version}.tar.gz";
+    sha256 = "0a1b2x5ni07vd9ridnl7zv7h2s32070wsphjy94qr066b99gdb29";
+  };
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = {
+    homepage = "http://libcello.org/";
+    description = "Higher level programming in C";
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.MostAwesomeDude ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcerf/default.nix b/nixpkgs/pkgs/development/libraries/libcerf/default.nix
new file mode 100644
index 000000000000..287c9a61b9c7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcerf/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, lib, fetchurl, cmake, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "libcerf";
+  version = "2.0";
+
+  src = fetchurl {
+    url = "https://jugit.fz-juelich.de/mlz/libcerf/-/archive/v${version}/libcerf-v${version}.tar.gz";
+    sha256 = "05lpaxmy6275nbzvf1ahxcfymyph89pvlgg8h9sp9iwal4g8nvn8";
+  };
+
+  nativeBuildInputs = [ cmake perl ];
+
+  meta = with lib; {
+    description = "Complex error (erf), Dawson, Faddeeva, and Voigt function library";
+    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
new file mode 100644
index 000000000000..20609509b66d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libchamplain/default.nix
@@ -0,0 +1,50 @@
+{ fetchurl, lib, stdenv, meson, ninja, vala, gtk-doc, docbook_xsl, docbook_xml_dtd_412, pkg-config, glib, gtk3, cairo, sqlite, gnome
+, clutter-gtk, libsoup, gobject-introspection /*, libmemphis */ }:
+
+stdenv.mkDerivation rec {
+  pname = "libchamplain";
+  version = "0.12.20";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0rihpb0npqpihqcdz4w03rq6xl7jdckfqskvv9diq2hkrnzv8ch2";
+  };
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  nativeBuildInputs = [ meson ninja pkg-config gobject-introspection vala gtk-doc docbook_xsl docbook_xml_dtd_412 ];
+
+  buildInputs = [ sqlite libsoup ];
+
+  propagatedBuildInputs = [ glib gtk3 cairo clutter-gtk ];
+
+  mesonFlags = [
+    "-Dgtk_doc=true"
+    "-Dvapi=true"
+  ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Projects/libchamplain";
+    license = licenses.lgpl2Plus;
+
+    description = "C library providing a ClutterActor to display maps";
+
+    longDescription = ''
+      libchamplain is a C library providing a ClutterActor to display
+       maps.  It also provides a GTK widget to display maps in GTK
+       applications.  Python and Perl bindings are also available.  It
+       supports numerous free map sources such as OpenStreetMap,
+       OpenCycleMap, OpenAerialMap, and Maps for free.
+    '';
+
+     maintainers = teams.gnome.members;
+     platforms = platforms.gnu ++ platforms.linux;  # arbitrary choice
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libchardet/default.nix b/nixpkgs/pkgs/development/libraries/libchardet/default.nix
new file mode 100644
index 000000000000..47ce911a6951
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libchardet/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "libchardet";
+  version = "1.0.6";
+
+  src = fetchFromGitHub {
+    owner = "Joungkyun";
+    repo = "libchardet";
+    rev = version;
+    sha256 = "sha256-JhEiWM3q8X+eEBHxv8k9yYOaTGoJOzI+/iFYC0gZJJs=";
+  };
+
+  nativeBuildInputs = [ perl ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Mozilla's Universal Charset Detector C/C++ API";
+    homepage = "ftp://ftp.oops.org/pub/oops/libchardet/index.html";
+    license = licenses.mpl11;
+    maintainers = [ maintainers.abbradar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libchewing/default.nix b/nixpkgs/pkgs/development/libraries/libchewing/default.nix
new file mode 100644
index 000000000000..c6b7841ca400
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libchewing/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, sqlite, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "libchewing";
+  version = "unstable-2020-06-27";
+
+  src = fetchFromGitHub {
+    owner = "chewing";
+    repo = "libchewing";
+    rev = "452f6221fbad90c0706a3963b17e226216e40dd7";
+    sha256 = "sha256-w3/K2O/CU+XVzqzVCYJyq1vLgToN6iIUhJ9J7ia4p9E=";
+  };
+
+  buildInputs = [ sqlite ];
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Intelligent Chinese phonetic input method";
+    homepage = "http://chewing.im/";
+    license = licenses.lgpl21Only;
+    maintainers = [ maintainers.ericsagnes ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libchop/0001-Fix-RPC-compilation-when-using-libtirpc-rather-than-.patch b/nixpkgs/pkgs/development/libraries/libchop/0001-Fix-RPC-compilation-when-using-libtirpc-rather-than-.patch
new file mode 100644
index 000000000000..f5a016f63ac3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libchop/0001-Fix-RPC-compilation-when-using-libtirpc-rather-than-.patch
@@ -0,0 +1,41 @@
+From 86fd3be1d31d2e7c09603aa3a8966537ac01bb07 Mon Sep 17 00:00:00 2001
+From: Maximilian Bosch <maximilian@mbosch.me>
+Date: Tue, 11 Aug 2020 20:30:16 +0200
+Subject: [PATCH] Fix RPC compilation when using libtirpc rather than glibc
+
+---
+ src/block-server.c        | 3 +++
+ utils/chop-block-server.c | 3 +++
+ 2 files changed, 6 insertions(+)
+
+diff --git a/src/block-server.c b/src/block-server.c
+index 3f97417..29b299e 100644
+--- a/src/block-server.c
++++ b/src/block-server.c
+@@ -18,6 +18,9 @@
+ 
+ /* Server-side stubs.  */
+ 
++#include <rpc/types.h>
++#include <rpc/xdr.h>
++#include <rpc/auth.h>
+ #include <rpc/svc.h>
+ #include <chop/block-server.h>
+ 
+diff --git a/utils/chop-block-server.c b/utils/chop-block-server.c
+index a2076c0..9462f5d 100644
+--- a/utils/chop-block-server.c
++++ b/utils/chop-block-server.c
+@@ -19,6 +19,9 @@
+    store, e.g. a GDBM block store, and serves it remotely.  A lot of code is
+    borrowed from `chop-archiver.c'.  */
+ 
++#include <rpc/types.h>
++#include <rpc/xdr.h>
++#include <rpc/auth.h>
+ #include <chop/chop-config.h>
+ 
+ #include <alloca.h>
+-- 
+2.25.4
+
diff --git a/nixpkgs/pkgs/development/libraries/libchop/default.nix b/nixpkgs/pkgs/development/libraries/libchop/default.nix
new file mode 100644
index 000000000000..f02ac04621fc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libchop/default.nix
@@ -0,0 +1,58 @@
+{ fetchurl, lib, stdenv, zlib, bzip2, libgcrypt
+, gdbm, gperf, tdb, gnutls, db, libuuid
+, lzo, pkg-config, guile, rpcsvc-proto, libtirpc
+}:
+
+stdenv.mkDerivation rec {
+  name = "libchop-0.5.2";
+
+  src = fetchurl {
+    url = "mirror://savannah/libchop/${name}.tar.gz";
+    sha256 = "0fpdyxww41ba52d98blvnf543xvirq1v9xz1i3x1gm9lzlzpmc2g";
+  };
+
+  patches = [ ./gets-undeclared.patch ./size_t.patch ./0001-Fix-RPC-compilation-when-using-libtirpc-rather-than-.patch ];
+
+  nativeBuildInputs = [ pkg-config gperf rpcsvc-proto ];
+
+  NIX_CFLAGS_COMPILE = [ "-I${libtirpc.dev}/include/tirpc" ];
+  NIX_LDFLAGS = [ "-ltirpc" ];
+
+  buildInputs =
+    [ zlib bzip2 lzo
+      libgcrypt
+      gdbm db tdb
+      gnutls libuuid
+      guile libtirpc
+    ];
+
+  doCheck = false;
+
+  preConfigure = ''
+    sed -re 's%@GUILE@%&/guile%' -i */Makefile.* Makefile.*
+  '';
+
+  meta = with lib; {
+    description = "Tools & library for data backup and distributed storage";
+
+    longDescription =
+      '' Libchop is a set of utilities and library for data backup and
+         distributed storage.  Its main application is chop-backup, an
+         encrypted backup program that supports data integrity checks,
+         versioning at little cost, distribution among several sites,
+         selective sharing of stored data, adaptive compression, and more.
+         The library itself, which chop-backup builds upon, implements
+         storage techniques such as content-based addressing, content hash
+         keys, Merkle trees, similarity detection, and lossless compression.
+         It makes it easy to combine them in different ways.  The
+         ‘chop-archiver’ and ‘chop-block-server’ tools, illustrated in the
+         manual, provide direct access to these facilities from the command
+         line.  It is written in C and has Guile (Scheme) bindings.
+      '';
+
+    homepage = "https://www.nongnu.org/libchop/";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.gnu ++ platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libchop/gets-undeclared.patch b/nixpkgs/pkgs/development/libraries/libchop/gets-undeclared.patch
new file mode 100644
index 000000000000..b6cdc77caa84
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libchop/gets-undeclared.patch
@@ -0,0 +1,71 @@
+This patch is needed to allow builds with newer versions of
+the GNU libc (2.16+).
+
+
+commit 66712c23388e93e5c518ebc8515140fa0c807348
+Author: Eric Blake <eblake@redhat.com>
+Date:   Thu Mar 29 13:30:41 2012 -0600
+
+    stdio: don't assume gets any more
+    
+    Gnulib intentionally does not have a gets module, and now that C11
+    and glibc have dropped it, we should be more proactive about warning
+    any user on a platform that still has a declaration of this dangerous
+    interface.
+    
+    * m4/stdio_h.m4 (gl_STDIO_H, gl_STDIO_H_DEFAULTS): Drop gets
+    support.
+    * modules/stdio (Makefile.am): Likewise.
+    * lib/stdio-read.c (gets): Likewise.
+    * tests/test-stdio-c++.cc: Likewise.
+    * m4/warn-on-use.m4 (gl_WARN_ON_USE_PREPARE): Fix comment.
+    * lib/stdio.in.h (gets): Make warning occur in more places.
+    * doc/posix-functions/gets.texi (gets): Update documentation.
+    Reported by Christer Solskogen.
+    
+    Signed-off-by: Eric Blake <eblake@redhat.com>
+
+diff --git a/lib/stdio.in.h b/lib/stdio.in.h
+index aa7b599..c377b6e 100644
+--- a/lib/stdio.in.h
++++ b/lib/stdio.in.h
+@@ -698,22 +698,11 @@ _GL_WARN_ON_USE (getline, "getline is unportable - "
+ # endif
+ #endif
+ 
+-#if @GNULIB_GETS@
+-# if @REPLACE_STDIO_READ_FUNCS@ && @GNULIB_STDIO_H_NONBLOCKING@
+-#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+-#   undef gets
+-#   define gets rpl_gets
+-#  endif
+-_GL_FUNCDECL_RPL (gets, char *, (char *s) _GL_ARG_NONNULL ((1)));
+-_GL_CXXALIAS_RPL (gets, char *, (char *s));
+-# else
+-_GL_CXXALIAS_SYS (gets, char *, (char *s));
+-#  undef gets
+-# endif
+-_GL_CXXALIASWARN (gets);
+ /* It is very rare that the developer ever has full control of stdin,
+-   so any use of gets warrants an unconditional warning.  Assume it is
+-   always declared, since it is required by C89.  */
++   so any use of gets warrants an unconditional warning; besides, C11
++   removed it.  */
++#undef gets
++#if HAVE_RAW_DECL_GETS
+ _GL_WARN_ON_USE (gets, "gets is a security hole - use fgets instead");
+ #endif
+ 
+@@ -1053,9 +1042,9 @@ _GL_WARN_ON_USE (snprintf, "snprintf is unportable - "
+ # endif
+ #endif
+ 
+-/* Some people would argue that sprintf should be handled like gets
+-   (for example, OpenBSD issues a link warning for both functions),
+-   since both can cause security holes due to buffer overruns.
++/* Some people would argue that all sprintf uses should be warned about
++   (for example, OpenBSD issues a link warning for it),
++   since it can cause security holes due to buffer overruns.
+    However, we believe that sprintf can be used safely, and is more
+    efficient than snprintf in those safe cases; and as proof of our
+    belief, we use sprintf in several gnulib modules.  So this header
diff --git a/nixpkgs/pkgs/development/libraries/libchop/size_t.patch b/nixpkgs/pkgs/development/libraries/libchop/size_t.patch
new file mode 100644
index 000000000000..82b6cb995ef3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libchop/size_t.patch
@@ -0,0 +1,11 @@
+--- a/src/chop.c
++++ b/src/chop.c
+@@ -539,7 +539,7 @@ extern const chop_class_t chop_gdbm_bloc
+   chop_qdbm_block_iterator_class;
+ 
+ const struct chop_class_entry *
+-chop_lookup_class_entry (const char *str, unsigned int len);
++chop_lookup_class_entry (const char *str, size_t len);
+ 
+ /* Include the gperf-generated perfect hash table.  */
+ #include "class-lookup.c"
diff --git a/nixpkgs/pkgs/development/libraries/libcint/default.nix b/nixpkgs/pkgs/development/libraries/libcint/default.nix
new file mode 100644
index 000000000000..a6f2e05d7361
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcint/default.nix
@@ -0,0 +1,47 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, cmake
+, blas
+  # Check Inputs
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libcint";
+  version = "4.4.0";
+
+  src = fetchFromGitHub {
+    owner = "sunqm";
+    repo = "libcint";
+    rev = "v${version}";
+    hash = "sha256-nsIyosn8dBf217UmjXSKLTM2RhIQHCSvPlrvlqo5KLc=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ blas ];
+  cmakeFlags = [
+    "-DENABLE_TEST=1"
+    "-DQUICK_TEST=1"
+    "-DCMAKE_INSTALL_PREFIX=" # ends up double-adding /nix/store/... prefix, this avoids issue
+  ];
+
+  strictDeps = true;
+
+  doCheck = true;
+  checkInputs = [ python3.pkgs.numpy ];
+
+  meta = with lib; {
+    description = "General GTO integrals for quantum chemistry";
+    longDescription = ''
+      libcint is an open source library for analytical Gaussian integrals.
+      It provides C/Fortran API to evaluate one-electron / two-electron
+      integrals for Cartesian / real-spheric / spinor Gaussian type functions.
+    '';
+    homepage = "http://wiki.sunqm.net/libcint";
+    downloadPage = "https://github.com/sunqm/libcint";
+    changelog = "https://github.com/sunqm/libcint/blob/master/ChangeLog";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ drewrisinger ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libck/default.nix b/nixpkgs/pkgs/development/libraries/libck/default.nix
new file mode 100644
index 000000000000..35a5541bc368
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libck/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "ck";
+  version = "0.7.1";
+
+  src = fetchFromGitHub {
+    owner = "concurrencykit";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-HUC+8Vd0koAmumRZ8gS5u6LVa7fUfkIYRaxVv6/7Hgg=";
+  };
+
+  dontDisableStatic = true;
+
+  meta = with 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.unix;
+    maintainers = with maintainers; [ chessai thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libclc/default.nix b/nixpkgs/pkgs/development/libraries/libclc/default.nix
new file mode 100644
index 000000000000..fdcc2ae0081b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libclc/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, ninja, cmake, python3, llvmPackages }:
+
+let
+  llvm = llvmPackages.llvm;
+  clang-unwrapped = llvmPackages.clang-unwrapped;
+in
+
+stdenv.mkDerivation rec {
+  pname = "libclc";
+  version = "11.0.1";
+
+  src = fetchFromGitHub {
+    owner = "llvm";
+    repo = "llvm-project";
+    rev = "llvmorg-${version}";
+    sha256 = "0bxh43hp1vl4axl3s9n2nb2ii8x1cbq98xz9c996f8rl5jy84ags";
+  };
+  sourceRoot = "source/libclc";
+
+  # cmake expects all required binaries to be in the same place, so it will not be able to find clang without the patch
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace 'find_program( LLVM_CLANG clang PATHS ''${LLVM_BINDIR} NO_DEFAULT_PATH )' \
+                'find_program( LLVM_CLANG clang PATHS "${clang-unwrapped}/bin" NO_DEFAULT_PATH )'
+  '';
+
+  nativeBuildInputs = [ cmake ninja python3 ];
+  buildInputs = [ llvm clang-unwrapped ];
+  strictDeps = true;
+
+  meta = with lib; {
+    homepage = "http://libclc.llvm.org/";
+    description = "Implementation of the library requirements of the OpenCL C programming language";
+    license = licenses.mit;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcli/default.nix b/nixpkgs/pkgs/development/libraries/libcli/default.nix
new file mode 100644
index 000000000000..8aa06bfb19bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcli/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libcli";
+  version = "1.9.7";
+
+  src = fetchFromGitHub {
+    sha256 = "08pmjhqkwldhmcwjhi2l27slf1fk6nxxfaihnk2637pqkycy8z0c";
+    rev = "v${version}";
+    repo = "libcli";
+    owner = "dparrish";
+  };
+
+  patches =
+    [ (fetchurl {
+        url = "https://github.com/dparrish/libcli/commit/ebc5a09db457ee1be9996711463cbbafe5ea72d5.patch";
+        sha256 = "0szjiw3gd7by1sv924shnngfxvc98xvaqvx228b575xq93xxjcwl";
+      })
+    ];
+
+  enableParallelBuilding = true;
+
+  makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" "AR=${stdenv.cc.targetPrefix}ar" "PREFIX=$(out)" ];
+
+  meta = with lib; {
+    description = "Emulate a Cisco-style telnet command-line interface";
+    homepage = "http://sites.dparrish.com/libcli";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcloudproviders/default.nix b/nixpkgs/pkgs/development/libraries/libcloudproviders/default.nix
new file mode 100644
index 000000000000..08601db08342
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcloudproviders/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, gobject-introspection, vala, gtk-doc, docbook_xsl, glib }:
+
+# TODO: Add installed tests once https://gitlab.gnome.org/World/libcloudproviders/issues/4 is fixed
+
+stdenv.mkDerivation rec {
+  pname = "libcloudproviders";
+  version = "0.3.1";
+
+  src = fetchurl {
+    url = "https://gitlab.gnome.org/World/${pname}/repository/archive.tar.gz?ref=${version}";
+    sha256 = "0zazjhj3xbwxyzi2b2aws7qdnwn092zg9yrk9v3wd19m3mxq5na3";
+  };
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  mesonFlags = [
+    "-Denable-gtk-doc=true"
+  ];
+
+  nativeBuildInputs = [ meson ninja pkg-config gobject-introspection vala gtk-doc docbook_xsl ];
+
+  buildInputs = [ glib ];
+
+  meta = with lib; {
+    description = "DBus API that allows cloud storage sync clients to expose their services";
+    homepage = "https://gitlab.gnome.org/World/libcloudproviders";
+    license = licenses.lgpl3Plus;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libclthreads/default.nix b/nixpkgs/pkgs/development/libraries/libclthreads/default.nix
new file mode 100644
index 000000000000..e4548420a057
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libclthreads/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libclthreads";
+  version = "2.4.2";
+
+  src = fetchurl {
+    url = "https://kokkinizita.linuxaudio.org/linuxaudio/downloads/clthreads-${version}.tar.bz2";
+    sha256 = "0cbs1w89q8wfjrrhvxf6xk0y02nkjl5hd0yb692c8ma01i6b2nf6";
+  };
+
+  patchPhase = ''
+    cd source
+    # don't run ldconfig:
+    sed -e "/ldconfig/d" -i ./Makefile
+  '';
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "SUFFIX=''"
+  ];
+
+  preInstall = ''
+    # The Makefile does not create the include and lib directories
+    mkdir -p $out/include
+    mkdir -p $out/lib
+  '';
+
+  postInstall = ''
+    ln $out/lib/libclthreads.so $out/lib/libclthreads.so.2
+  '';
+
+  meta = with lib; {
+    description = "Zita thread library";
+    homepage = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ magnetophon ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libclxclient/default.nix b/nixpkgs/pkgs/development/libraries/libclxclient/default.nix
new file mode 100644
index 000000000000..0d39a5e55b26
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libclxclient/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchurl, libclthreads, libX11, libXft, xorg, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "libclxclient";
+  version = "3.9.2";
+
+  src = fetchurl {
+    url = "https://kokkinizita.linuxaudio.org/linuxaudio/downloads/clxclient-${version}.tar.bz2";
+    sha256 = "10bq6fy8d3pr1x2x3xx9qhf2hdxrwdgvg843a2y6lx70y1jfj0c5";
+  };
+
+  buildInputs = [ libclthreads libX11 libXft xorg.xorgproto ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  NIX_CFLAGS_COMPILE = "-I${xorg.xorgproto}/include -I${libXft.dev}/include";
+
+  patchPhase = ''
+    cd source
+    # use pkg-config instead of pkgcon:
+    sed -e 's/pkgconf/pkg-config/g' -i ./Makefile
+    # don't run ldconfig:
+    sed -e "/ldconfig/d" -i ./Makefile
+    # make sure it can find clxclient.h:
+    sed -e 's/<clxclient.h>/"clxclient.h"/' -i ./enumip.cc
+  '';
+
+  makeFlags = [
+    "PREFIX=$(out)"
+    "SUFFIX=''"
+  ];
+
+  preInstall = ''
+    # The Makefile does not create the include directory
+    mkdir -p $out/include
+  '';
+
+  postInstall = ''
+    ln $out/lib/libclxclient.so $out/lib/libclxclient.so.3
+  '';
+
+  meta = with lib; {
+    description = "Zita X11 library";
+    homepage = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ magnetophon ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcmis/default.nix b/nixpkgs/pkgs/development/libraries/libcmis/default.nix
new file mode 100644
index 000000000000..2898c9a1c835
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcmis/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, boost, libxml2, pkg-config, docbook2x, curl, autoreconfHook, cppunit }:
+
+stdenv.mkDerivation rec {
+  pname = "libcmis";
+  version = "0.5.2";
+
+  src = fetchFromGitHub {
+    owner = "tdf";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0s6prfh55hn11vrs72ph1gs01v0vngly81pvyjm5v1sgwymdxx57";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config docbook2x ];
+  buildInputs = [ boost libxml2 curl cppunit ];
+
+  configureFlags = [
+    "--disable-werror"
+    "DOCBOOK2MAN=${docbook2x}/bin/docbook2man"
+  ];
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "C++ client library for the CMIS interface";
+    homepage = "https://sourceforge.net/projects/libcmis/";
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcollectdclient/default.nix b/nixpkgs/pkgs/development/libraries/libcollectdclient/default.nix
new file mode 100644
index 000000000000..0bf654ee963c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcollectdclient/default.nix
@@ -0,0 +1,22 @@
+{ lib, collectd }:
+with lib;
+
+collectd.overrideAttrs (oldAttrs: {
+  name = "libcollectdclient-${collectd.version}";
+  buildInputs = [ ];
+
+  configureFlags = (oldAttrs.configureFlags or []) ++ [
+    "--disable-daemon"
+    "--disable-all-plugins"
+  ];
+
+  postInstall = "rm -rf $out/{bin,etc,sbin,share}";
+
+  meta = with lib; {
+    description = "C Library for collectd, a daemon which collects system performance statistics periodically";
+    homepage = "http://collectd.org";
+    license = licenses.gpl2;
+    platforms = platforms.linux; # TODO: collectd may be linux but the C client may be more portable?
+    maintainers = [ maintainers.sheenobu maintainers.bjornfor ];
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/libcommuni/default.nix b/nixpkgs/pkgs/development/libraries/libcommuni/default.nix
new file mode 100644
index 000000000000..3e2c0daf0b46
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcommuni/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchFromGitHub
+, qtbase, qtdeclarative, qmake, which
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libcommuni";
+  version = "3.6.0";
+
+  src = fetchFromGitHub {
+    owner = "communi";
+    repo = "libcommuni";
+    rev = "v${version}";
+    sha256 = "sha256-ABvrMoOVSycbQ8iRDzi7zkFnuSgHMMBgm9cDUWlD4uc=";
+  };
+
+  buildInputs = [ qtbase qtdeclarative ];
+  nativeBuildInputs = [ qmake which ];
+
+  enableParallelBuilding = true;
+
+  dontUseQmakeConfigure = true;
+  configureFlags = [ "-config" "release" ]
+    # Build mixes up dylibs/frameworks if one is not explicitely specified.
+    ++ lib.optionals stdenv.isDarwin [ "-config" "qt_framework" ];
+
+  dontWrapQtApps = true;
+
+  preConfigure = ''
+    sed -i -e 's|/bin/pwd|pwd|g' configure
+  '';
+
+  # The tests fail on darwin because of install_name if they run
+  # before the frameworks are installed.
+  doCheck = false;
+  doInstallCheck = true;
+  installCheckTarget = "check";
+
+  # Hack to avoid TMPDIR in RPATHs.
+  preFixup = "rm -rf lib";
+
+  meta = with lib; {
+    description = "A cross-platform IRC framework written with Qt";
+    homepage = "https://communi.github.io";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ hrdinka ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libconfig/default.nix b/nixpkgs/pkgs/development/libraries/libconfig/default.nix
new file mode 100644
index 000000000000..d94a0e1d78bd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libconfig/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libconfig";
+  version = "1.7.3";
+
+  src = fetchurl {
+    url = "https://hyperrealm.github.io/${pname}/dist/${pname}-${version}.tar.gz";
+    sha256 = "sha256-VFFm1srAN3RDgdHpzFpUBQlOe/rRakEWmbz/QLuzHuc=";
+  };
+
+  doCheck = true;
+
+  configureFlags = lib.optional (stdenv.targetPlatform.isWindows || stdenv.hostPlatform.isStatic) "--disable-examples";
+
+  meta = with lib; {
+    homepage = "http://www.hyperrealm.com/libconfig";
+    description = "A simple library for processing structured configuration files";
+    license = licenses.lgpl3;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = with platforms; linux ++ darwin ++ windows;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libconfuse/default.nix b/nixpkgs/pkgs/development/libraries/libconfuse/default.nix
new file mode 100644
index 000000000000..7545fe9617cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libconfuse/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, flex }:
+
+stdenv.mkDerivation rec {
+  pname = "libconfuse";
+  version = "3.3";
+
+  src = fetchFromGitHub {
+    sha256 = "1npfk5jv59kk4n8pkyx89fn9s6p8x3gbffs42jaw24frgxfgp8ca";
+    rev = "v${version}";
+    repo = "libconfuse";
+    owner = "martinh";
+  };
+
+  postPatch = ''
+    substituteInPlace tests/Makefile.am \
+      --replace 'TESTS            += empty_string' "" \
+      --replace 'TESTS            += print_filter' ""
+  '';
+
+  nativeBuildInputs = [ autoreconfHook flex ];
+
+  enableParallelBuilding = true;
+
+  # On darwin the tests depend on the installed libraries because of install_name.
+  doInstallCheck = true;
+  installCheckTarget = "check";
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "Small configuration file parser library for C";
+    longDescription = ''
+      libConfuse (previously libcfg) is a configuration file parser library
+      written in C. It supports sections and (lists of) values, as well as
+      some other features. It makes it very easy to add configuration file
+      capability to a program using a simple API.
+
+      The goal of libConfuse is not to be the configuration file parser library
+      with a gazillion of features. Instead, it aims to be easy to use and
+      quick to integrate with your code.
+    '';
+    license = licenses.isc;
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcork/default.nix b/nixpkgs/pkgs/development/libraries/libcork/default.nix
new file mode 100644
index 000000000000..3875ff91185a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcork/default.nix
@@ -0,0 +1,45 @@
+{ stdenv
+, fetchFromGitHub
+, cmake
+, lib
+, pkg-config
+, check
+}:
+stdenv.mkDerivation rec {
+  pname = "libcork";
+  version = "1.0.0--rc3";
+
+  src = fetchFromGitHub {
+    owner = "dcreager";
+    repo = pname;
+    rev = version;
+    sha256 = "152gqnmr6wfmflf5l6447am4clmg3p69pvy3iw7yhaawjqa797sk";
+  };
+
+  # N.B. We need to create this file, otherwise it tries to use git to
+  # determine the package version, which we do not want.
+  #
+  # N.B. We disable tests by force, since their build is broken.
+  postPatch = ''
+    echo "${version}" > .version-stamp
+    echo "${version}" > .commit-stamp
+    sed -i '/add_subdirectory(tests)/d' ./CMakeLists.txt
+  '';
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ check ];
+
+  doCheck = false;
+
+  postInstall = ''
+    ln -s $out/lib/libcork.so $out/lib/libcork.so.1
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/dcreager/libcork";
+    description = "A simple, easily embeddable cross-platform C library";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ lovesegfault ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcotp/default.nix b/nixpkgs/pkgs/development/libraries/libcotp/default.nix
new file mode 100644
index 000000000000..986890102dc6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcotp/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, libgcrypt, libbaseencode }:
+
+stdenv.mkDerivation rec {
+  pname = "libcotp";
+  version = "1.2.3";
+
+  src = fetchFromGitHub {
+    owner = "paolostivanin";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1qq4shwiz1if9vys052dnsbm4dfw1ynlj6nsb0v4zjly3ndspfsk";
+  };
+
+  buildInputs = [ libbaseencode libgcrypt ];
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  meta = with lib; {
+    description = "C library that generates TOTP and HOTP";
+    homepage = "https://github.com/paolostivanin/libcotp";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ alexbakker ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcouchbase/default.nix b/nixpkgs/pkgs/development/libraries/libcouchbase/default.nix
new file mode 100644
index 000000000000..face30c1e0cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcouchbase/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libevent, openssl}:
+
+stdenv.mkDerivation rec {
+  pname = "libcouchbase";
+  version = "3.2.1";
+
+  src = fetchFromGitHub {
+    owner = "couchbase";
+    repo = "libcouchbase";
+    rev = version;
+    sha256 = "sha256-6TMWWXAgt4e+De1ebmqQhaqcia1ZXT8IXn9fTGsr3qY=";
+  };
+
+  cmakeFlags = [ "-DLCB_NO_MOCK=ON" ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ libevent openssl ];
+
+  # Running tests in parallel does not work
+  enableParallelChecking = false;
+
+  doCheck = !stdenv.isDarwin;
+
+  meta = with lib; {
+    description = "C client library for Couchbase";
+    homepage = "https://github.com/couchbase/libcouchbase";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcprime/0001-fix-application-dirs.patch b/nixpkgs/pkgs/development/libraries/libcprime/0001-fix-application-dirs.patch
new file mode 100644
index 000000000000..b454abb188bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcprime/0001-fix-application-dirs.patch
@@ -0,0 +1,29 @@
+From 8e6328e932ab2739f075e8e8d602c2370a2a8ce8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Mustafa=20=C3=87al=C4=B1=C5=9Fkan?= <musfay@protonmail.com>
+Date: Wed, 28 Jul 2021 02:26:39 +0300
+Subject: [PATCH] fix application dirs
+
+---
+ cprime/systemxdg.cpp | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/cprime/systemxdg.cpp b/cprime/systemxdg.cpp
+index f9eee66..ea0553d 100644
+--- a/cprime/systemxdg.cpp
++++ b/cprime/systemxdg.cpp
+@@ -233,8 +233,10 @@ void SystemXdgMime::setApplicationAsDefault( QString appFileName, QString mimety
+ SystemXdgMime::SystemXdgMime() {
+ 
+ 	appsDirs << QDir::home().filePath( ".local/share/applications/" );
+-	appsDirs << "/usr/local/share/applications/" << "/usr/share/applications/";
+-	appsDirs << "/usr/share/applications/kde4/" << "/usr/share/gnome/applications/";
++	appsDirs << QDir::home().filePath( ".nix-profile/share/applications/" );
++	appsDirs << "/run/current-system/sw/share/applications/";
++	appsDirs << "/run/current-system/sw/share/applications/kde4/";
++	appsDirs << "/run/current-system/sw/share/gnome/applications/";
+ };
+ 
+ DesktopFile SystemXdgMime::xdgDefaultApp( QMimeType mimeType ) {
+-- 
+2.32.0
+
diff --git a/nixpkgs/pkgs/development/libraries/libcprime/default.nix b/nixpkgs/pkgs/development/libraries/libcprime/default.nix
new file mode 100644
index 000000000000..d312c832243a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcprime/default.nix
@@ -0,0 +1,42 @@
+{ mkDerivation
+, lib
+, fetchFromGitLab
+, libnotify
+, cmake
+, ninja
+, qtbase
+, qtconnectivity
+}:
+
+mkDerivation rec {
+  pname = "libcprime";
+  version = "4.2.2";
+
+  src = fetchFromGitLab {
+    owner = "cubocore";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-RywvFATA/+fDP/TR5QRWaJlDgy3EID//iVmrJcj3GXI=";
+  };
+
+  patches = [ ./0001-fix-application-dirs.patch ];
+
+  nativeBuildInputs = [
+    cmake
+    ninja
+  ];
+
+  buildInputs = [
+    qtbase
+    qtconnectivity
+    libnotify
+  ];
+
+  meta = with lib; {
+    description = "A library for bookmarking, saving recent activites, managing settings of C-Suite";
+    homepage = "https://gitlab.com/cubocore/coreapps/libcprime";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ dan4ik605743 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcrafter/default.nix b/nixpkgs/pkgs/development/libraries/libcrafter/default.nix
new file mode 100644
index 000000000000..37ac9bf7f171
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcrafter/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchzip, autoconf, automake, libtool, libpcap }:
+
+stdenv.mkDerivation rec {
+  pname = "libcrafter";
+  version = "1.0";
+
+  src = fetchzip {
+    url = "https://github.com/pellegre/libcrafter/archive/version-${version}.zip";
+    sha256 = "1d2vgxawdwk2zg3scxclxdby1rhghmivly8azdjja89kw7gls9xl";
+  };
+
+  preConfigure = "cd libcrafter";
+
+  configureScript = "./autogen.sh";
+
+  configureFlags = [ "--with-libpcap=yes" ];
+
+  buildInputs = [ autoconf automake libtool ];
+
+  propagatedBuildInputs = [ libpcap ];
+
+  meta = {
+    homepage = "https://github.com/pellegre/libcrafter";
+    description = "High level C++ network packet sniffing and crafting library";
+    license = lib.licenses.bsd3;
+    maintainers = [ ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcredis/default.nix b/nixpkgs/pkgs/development/libraries/libcredis/default.nix
new file mode 100644
index 000000000000..e0224d865d55
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcredis/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libcredis";
+  version = "0.2.3";
+
+  src = fetchurl {
+    url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/credis/credis-${version}.tar.gz";
+    sha256 = "1l3hlw9rrc11qggbg9a2303p3bhxxx2vqkmlk8avsrbqw15r1ayr";
+  };
+
+  # credis build system has no install actions, provide our own.
+  installPhase = ''
+    mkdir -p "$out/bin"
+    mkdir -p "$out/lib"
+    mkdir -p "$out/include"
+
+    cp -v credis-test "$out/bin/"
+    cp -v *.a *.so "$out/lib/"
+    cp -v *.h "$out/include/"
+  '';
+
+  meta = with lib; {
+    description = "C client library for Redis (key-value database)";
+    homepage = "https://code.google.com/archive/p/credis/";
+    license = licenses.bsd3; # from homepage
+    platforms = platforms.all;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcrossguid/default.nix b/nixpkgs/pkgs/development/libraries/libcrossguid/default.nix
new file mode 100644
index 000000000000..c81dbb86f6a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcrossguid/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, libuuid }:
+
+stdenv.mkDerivation rec {
+  name = "lib" + pname + "-" + version;
+  pname = "crossguid";
+  version = "2016-02-21";
+
+  src = fetchFromGitHub {
+    owner = "graeme-hill";
+    repo = pname;
+    rev = "8f399e8bd4252be9952f3dfa8199924cc8487ca4";
+    sha256 = "1i29y207qqddvaxbn39pk2fbh3gx8zvdprfp35wasj9rw2wjk3s9";
+  };
+
+  buildInputs = [ libuuid ];
+
+  buildPhase = ''
+    $CXX -c guid.cpp -o guid.o $CXXFLAGS -std=c++11 -DGUID_LIBUUID
+    $AR rvs libcrossguid.a guid.o
+  '';
+  installPhase = ''
+    mkdir -p $out/{lib,include}
+    install -D -m644 libcrossguid.a "$out/lib/libcrossguid.a"
+    install -D -m644 guid.h "$out/include/guid.h"
+  '';
+
+  meta = with lib; {
+    description = "Lightweight cross platform C++ GUID/UUID library";
+    license = licenses.mit;
+    maintainers = with maintainers; [ edwtjo ];
+    homepage = "https://github.com/graeme-hill/crossguid";
+    platforms = with platforms; linux;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcryptui/default.nix b/nixpkgs/pkgs/development/libraries/libcryptui/default.nix
new file mode 100644
index 000000000000..e816846842f1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcryptui/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, intltool, glib, gnome, gtk3, gnupg22, gpgme, dbus-glib, libgnome-keyring }:
+
+stdenv.mkDerivation rec {
+  pname = "libcryptui";
+  version = "3.12.2";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0rh8wa5k2iwbwppyvij2jdxmnlfjbna7kbh2a5n7zw4nnjkx3ski";
+  };
+
+  patches = [
+    ./fix-gnupg-2.2.patch # based on https://gitlab.gnome.org/GNOME/libcryptui/-/commit/b05e301d1b264a5d8f07cb96e5edc243d99bff79.patch
+  ];
+
+  nativeBuildInputs = [ pkg-config intltool autoreconfHook ];
+  buildInputs = [ glib gtk3 gnupg22 gpgme dbus-glib libgnome-keyring ];
+  propagatedBuildInputs = [ dbus-glib ];
+
+  enableParallelBuilding = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "Interface components for OpenPGP";
+    homepage = "https://gitlab.gnome.org/GNOME/libcryptui";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcryptui/fix-gnupg-2.2.patch b/nixpkgs/pkgs/development/libraries/libcryptui/fix-gnupg-2.2.patch
new file mode 100644
index 000000000000..50d5e0c82c1c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcryptui/fix-gnupg-2.2.patch
@@ -0,0 +1,26 @@
+From b05e301d1b264a5d8f07cb96e5edc243d99bff79 Mon Sep 17 00:00:00 2001
+From: Antoine Jacoutot <ajacoutot@gnome.org>
+Date: Fri, 10 Nov 2017 08:55:55 +0100
+Subject: [PATCH] Accept GnuPG 2.2.x as supported version
+
+https://bugzilla.gnome.org/show_bug.cgi?id=790152
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 4486e7b2..be5b28b4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -95,7 +95,7 @@ AC_ARG_ENABLE(gpg-check,
+ 	DO_CHECK=$enableval, DO_CHECK=yes)
+ 
+ if test	"$DO_CHECK" = "yes"; then
+-	accepted_versions="1.2 1.4 2.0"
++	accepted_versions="1.2 1.4 2.0 2.2"
+ 	AC_PATH_PROGS(GNUPG, [gpg gpg2], no)
+ 	AC_DEFINE_UNQUOTED(GNUPG, "$GNUPG", [Path to gpg executable.])
+ 	ok="no"
+-- 
+GitLab
+
diff --git a/nixpkgs/pkgs/development/libraries/libcsptr/default.nix b/nixpkgs/pkgs/development/libraries/libcsptr/default.nix
new file mode 100644
index 000000000000..a8f33deda36c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcsptr/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "libcsptr";
+  version = "2.0.4";
+
+  src = fetchFromGitHub {
+    owner = "Snaipe";
+    repo = "libcsptr";
+    rev = "v${version}";
+    sha256 = "0i1498h2i6zq3fn3zf3iw7glv6brn597165hnibgwccqa8sh3ich";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Smart pointer constructs for the (GNU) C programming language";
+    homepage = "https://github.com/Snaipe/libcsptr";
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = [ maintainers.fragamus ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcsys/default.nix b/nixpkgs/pkgs/development/libraries/libcsys/default.nix
new file mode 100644
index 000000000000..cec6e501bb5b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcsys/default.nix
@@ -0,0 +1,31 @@
+{ mkDerivation, lib, fetchFromGitLab, udisks2, qtbase, cmake, ninja, }:
+
+mkDerivation rec {
+  pname = "libcsys";
+  version = "4.2.0";
+
+  src = fetchFromGitLab {
+    owner = "cubocore";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-9LH95uJJIn4FHfnikGi5UCI6nUNW+1cSZnJ/KpZDI5Y=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    ninja
+  ];
+
+  buildInputs = [
+    qtbase
+    udisks2
+  ];
+
+  meta = with lib; {
+    description = "Library for managing drive and getting system resource information in real time";
+    homepage = "https://gitlab.com/cubocore/libcsys";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ dan4ik605743 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libctb/default.nix b/nixpkgs/pkgs/development/libraries/libctb/default.nix
new file mode 100644
index 000000000000..d52adac556d8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libctb/default.nix
@@ -0,0 +1,23 @@
+{ lib, 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 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/libctemplate/default.nix b/nixpkgs/pkgs/development/libraries/libctemplate/default.nix
new file mode 100644
index 000000000000..2aa36bfe9914
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libctemplate/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, python3, autoconf, automake, libtool }:
+
+stdenv.mkDerivation rec {
+  pname = "ctemplate";
+  version = "2.4";
+
+  src = fetchFromGitHub {
+    owner = "OlafvdSpek";
+    repo = "ctemplate";
+    rev = "ctemplate-${version}";
+    sha256 = "1x0p5yym6vvcx70pm8ihnbxxrl2wnblfp72ih5vjyg8mzkc8cxrr";
+  };
+
+  nativeBuildInputs = [ python3 autoconf automake libtool ];
+
+  postPatch = ''
+    patchShebangs .
+  '';
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  meta = {
+    description = "A simple but powerful template language for C++";
+    longDescription = ''
+      CTemplate is a simple but powerful template language for C++. It
+      emphasizes separating logic from presentation: it is impossible to
+      embed application logic in this template language.
+    '';
+    homepage = "https://github.com/OlafvdSpek/ctemplate";
+    license = lib.licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcue/default.nix b/nixpkgs/pkgs/development/libraries/libcue/default.nix
new file mode 100644
index 000000000000..227dfd77f463
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcue/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, cmake, bison, flex }:
+
+stdenv.mkDerivation rec {
+  pname = "libcue";
+  version = "2.2.1";
+
+  src = fetchFromGitHub {
+    owner = "lipnitsk";
+    repo = "libcue";
+    rev = "v${version}";
+    sha256 = "1iqw4n01rv2jyk9lksagyxj8ml0kcfwk67n79zy1r6zv1xfp5ywm";
+  };
+
+  nativeBuildInputs = [ cmake bison flex ];
+
+  doCheck = false; # fails all the tests (ctest)
+
+  meta = with lib; {
+    description = "CUE Sheet Parser Library";
+    longDescription = ''
+      libcue is intended to parse a so called cue sheet from a char string or
+      a file pointer. For handling of the parsed data a convenient API is
+      available.
+    '';
+    homepage = "https://sourceforge.net/projects/libcue/";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ astsmtl ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcutl/default.nix b/nixpkgs/pkgs/development/libraries/libcutl/default.nix
new file mode 100644
index 000000000000..ed6aae0f3083
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcutl/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, xercesc }:
+
+stdenv.mkDerivation rec {
+  pname = "libcutl";
+  version = "1.10.0";
+
+  meta = with 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/${pname}/${majmin}/${pname}-${version}.tar.bz2";
+    sha256 = "070j2x02m4gm1fn7gnymrkbdxflgzxwl7m96aryv8wp3f3366l8j";
+  };
+
+  buildInputs = [ xercesc ];
+  enableParallelBuilding = true;
+}
diff --git a/nixpkgs/pkgs/development/libraries/libcyaml/default.nix b/nixpkgs/pkgs/development/libraries/libcyaml/default.nix
new file mode 100644
index 000000000000..0fabdb49ca11
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libcyaml/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, lib, fetchFromGitHub
+, libyaml
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libcyaml";
+  version = "1.2.0";
+
+  src = fetchFromGitHub {
+    owner = "tlsa";
+    repo = "libcyaml";
+    rev = "v${version}";
+    sha256 = "sha256-LtU1r95YoLuQ2JCphxbMojxKyXnt50XEARGUPftLgsU=";
+  };
+
+  buildInputs = [ libyaml ];
+
+  makeFlags = [ "VARIANT=release" "PREFIX=$(out)" ];
+
+  meta = with lib; {
+    homepage = "https://github.com/tlsa/libcyaml";
+    description = "C library for reading and writing YAML";
+    license = licenses.isc;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdaemon/default.nix b/nixpkgs/pkgs/development/libraries/libdaemon/default.nix
new file mode 100644
index 000000000000..51df45809789
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdaemon/default.nix
@@ -0,0 +1,26 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "libdaemon";
+  version = "0.14";
+
+  src = fetchurl {
+    url = "http://0pointer.de/lennart/projects/libdaemon/${pname}-${version}.tar.gz";
+    sha256 = "0d5qlq5ab95wh1xc87rqrh1vx6i8lddka1w3f1zcqvcqdxgyn8zx";
+  };
+
+  patches = [ ./fix-includes.patch ];
+
+  configureFlags = [ "--disable-lynx" ]
+    ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
+    [ # Can't run this test while cross-compiling
+      "ac_cv_func_setpgrp_void=yes"
+    ];
+
+  meta = {
+    description = "Lightweight C library that eases the writing of UNIX daemons";
+    homepage = "http://0pointer.de/lennart/projects/libdaemon/";
+    license = lib.licenses.lgpl2Plus;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdaemon/fix-includes.patch b/nixpkgs/pkgs/development/libraries/libdaemon/fix-includes.patch
new file mode 100644
index 000000000000..51c5133afede
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdaemon/fix-includes.patch
@@ -0,0 +1,13 @@
+--- libdaemon-0.14.orig/examples/testd.c
++++ libdaemon-0.14/examples/testd.c
+@@ -21,9 +21,9 @@
+ #include <signal.h>
+ #include <errno.h>
+ #include <string.h>
++#include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/time.h>
+-#include <sys/unistd.h>
+ #include <sys/select.h>
+ 
+ #include <libdaemon/dfork.h>
diff --git a/nixpkgs/pkgs/development/libraries/libdap/default.nix b/nixpkgs/pkgs/development/libraries/libdap/default.nix
new file mode 100644
index 000000000000..8eacd9706a88
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdap/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, bison, libuuid, curl, libxml2, flex }:
+
+stdenv.mkDerivation rec {
+  version = "3.20.6";
+  pname = "libdap";
+
+  nativeBuildInputs = [ bison flex ];
+  buildInputs = [ libuuid curl libxml2 ];
+
+  src = fetchurl {
+    url = "https://www.opendap.org/pub/source/${pname}-${version}.tar.gz";
+    sha256 = "0jn5bi8k2lq6mmrsw7r1r5aviyf8gb39b2iy20v4kpkj5napzk1m";
+  };
+
+  meta = with lib; {
+    description = "A C++ SDK which contains an implementation of DAP";
+    homepage = "https://www.opendap.org/software/libdap";
+    license = licenses.lgpl2;
+    maintainers = [ maintainers.bzizou ];
+    platforms = platforms.linux;
+    broken = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdatrie/default.nix b/nixpkgs/pkgs/development/libraries/libdatrie/default.nix
new file mode 100644
index 000000000000..257673b1a96d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdatrie/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchFromGitHub, makeWrapper
+, autoreconfHook, autoconf-archive
+, installShellFiles, libiconv }:
+
+stdenv.mkDerivation rec {
+
+  pname = "libdatrie";
+  version = "2019-12-20";
+
+  outputs = [ "bin" "out" "lib" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "tlwg";
+    repo = "libdatrie";
+    rev = "d1db08ac1c76f54ba23d63665437473788c999f3";
+    sha256 = "03dc363259iyiidrgadzc7i03mmfdj8h78j82vk6z53w6fxq5zxc";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    autoconf-archive
+    installShellFiles
+  ];
+
+  buildInputs = lib.optional stdenv.isDarwin libiconv;
+
+  preAutoreconf = let
+    reports = "https://github.com/tlwg/libdatrie/issues";
+  in
+  ''
+    sed -i -e "/AC_INIT/,+3d" configure.ac
+    sed -i "5iAC_INIT(${pname},${version},[${reports}])" configure.ac
+  '';
+
+  postInstall = ''
+    installManPage man/trietool.1
+  '';
+
+  meta = with lib; {
+    homepage = "https://linux.thai.net/~thep/datrie/datrie.html";
+    description = "This is an implementation of double-array structure for representing trie";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ SuperSandro2000 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdazzle/default.nix b/nixpkgs/pkgs/development/libraries/libdazzle/default.nix
new file mode 100644
index 000000000000..d62614c56c76
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdazzle/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchurl, ninja, meson, pkg-config, vala, gobject-introspection, libxml2
+, gtk-doc, docbook_xsl, docbook_xml_dtd_43, dbus, xvfb-run, glib, gtk3, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "libdazzle";
+  version = "3.40.0";
+
+  outputs = [ "out" "dev" "devdoc" ];
+  outputBin = "dev";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/libdazzle/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "19abrrjsyjhhl1xflnb0likb9wwzz78fa1mk2b064rpscmz9mafv";
+  };
+
+  nativeBuildInputs = [ ninja meson pkg-config vala gobject-introspection libxml2 gtk-doc docbook_xsl docbook_xml_dtd_43 dbus xvfb-run glib ];
+  buildInputs = [ glib gtk3 ];
+
+  mesonFlags = [
+    "-Denable_gtk_doc=true"
+  ];
+
+  doCheck = true;
+
+  checkPhase = ''
+    xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
+      --config-file=${dbus.daemon}/share/dbus-1/session.conf \
+      meson test --print-errorlogs
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+    };
+  };
+
+  meta = with lib; {
+    description = "A library to delight your users with fancy features";
+    longDescription = ''
+      The libdazzle library is a companion library to GObject and GTK. It
+      provides various features that we wish were in the underlying library but
+      cannot for various reasons. In most cases, they are wildly out of scope
+      for those libraries. In other cases, our design isn't quite generic
+      enough to work for everyone.
+    '';
+    homepage = "https://wiki.gnome.org/Apps/Builder";
+    license = licenses.gpl3Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdbi-drivers/default.nix b/nixpkgs/pkgs/development/libraries/libdbi-drivers/default.nix
new file mode 100644
index 000000000000..6a86d4941bff
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdbi-drivers/default.nix
@@ -0,0 +1,62 @@
+{ lib, stdenv, fetchurl, libdbi
+, libmysqlclient ? null
+, sqlite ? null
+, postgresql ? null
+}:
+
+with lib;
+stdenv.mkDerivation rec {
+  name = "libdbi-drivers-0.9.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libdbi-drivers/${name}.tar.gz";
+    sha256 = "0m680h8cc4428xin4p733azysamzgzcmv4psjvraykrsaz6ymlj3";
+  };
+
+  buildInputs = [ libdbi sqlite postgresql ] ++ optional (libmysqlclient != null) libmysqlclient;
+
+  postPatch = ''
+    sed -i '/SQLITE3_LIBS/ s/-lsqlite/-lsqlite3/' configure;
+  '';
+
+  configureFlags = [
+    "--sysconfdir=/etc"
+    "--localstatedir=/var"
+    "--disable-docs"
+    "--enable-libdbi"
+    "--with-dbi-incdir=${libdbi}/include"
+    "--with-dbi-libdir=${libdbi}/lib"
+  ] ++ optionals (libmysqlclient != null) [
+    "--with-mysql"
+    "--with-mysql-incdir=${getDev libmysqlclient}/include/mysql"
+    "--with-mysql-libdir=${libmysqlclient}/lib/mysql"
+  ] ++ optionals (sqlite != null) [
+    "--with-sqlite3"
+    "--with-sqlite3-incdir=${sqlite.dev}/include/sqlite"
+    "--with-sqlite3-libdir=${sqlite.out}/lib/sqlite"
+  ] ++ optionals (postgresql != null) [
+    "--with-pgsql"
+    "--with-pgsql_incdir=${postgresql}/include"
+    "--with-pgsql_libdir=${postgresql.lib}/lib"
+  ];
+
+  installFlags = [ "DESTDIR=\${out}" ];
+
+  postInstall = ''
+    mv $out/$out/* $out
+    DIR=$out/$out
+    while rmdir $DIR 2>/dev/null; do
+      DIR="$(dirname "$DIR")"
+    done
+
+    # Remove the unneeded var/lib directories
+    rm -rf $out/var
+  '';
+
+  meta = {
+    homepage = "http://libdbi-drivers.sourceforge.net/";
+    description = "Database drivers for libdbi";
+    platforms = platforms.all;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdbi/default.nix b/nixpkgs/pkgs/development/libraries/libdbi/default.nix
new file mode 100644
index 000000000000..ffbc3f671007
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdbi/default.nix
@@ -0,0 +1,18 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libdbi";
+  version = "0.9.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libdbi/${pname}-${version}.tar.gz";
+    sha256 = "00s5ra7hdlq25iv23nwf4h1v3kmbiyzx0v9bhggjiii4lpf6ryys";
+  };
+
+  meta = with lib; {
+    homepage = "http://libdbi.sourceforge.net/";
+    description = "DB independent interface to DB";
+    license = licenses.lgpl21;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/default.nix b/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/default.nix
new file mode 100644
index 000000000000..75d4f76b31ff
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, qt4, cmake }:
+
+let
+  baseName = "libdbusmenu-qt";
+  v = "0.9.2";
+  homepage = "https://launchpad.net/${baseName}";
+  name = "${baseName}-${v}";
+in
+
+stdenv.mkDerivation {
+  inherit name;
+
+  src = fetchurl {
+    url = "${homepage}/trunk/${v}/+download/${name}.tar.bz2";
+    sha256 = "1v0ri5g9xw2z64ik0kx0ra01v8rpjn2kxprrxppkls1wvav1qv5f";
+  };
+
+  buildInputs = [ qt4 ];
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [ "-DWITH_DOC=OFF" ];
+
+  dontWrapQtApps = true;
+
+  meta = with lib; {
+    description = "Provides a Qt implementation of the DBusMenu spec";
+    inherit homepage;
+    inherit (qt4.meta) platforms;
+    license = licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix b/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix
new file mode 100644
index 000000000000..7219bcbdeb5a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchgit, cmake, qtbase }:
+
+stdenv.mkDerivation rec {
+  pname = "libdbusmenu-qt";
+  version = "0.9.3+16";
+
+  src = fetchgit {
+    url = "https://git.launchpad.net/ubuntu/+source/libdbusmenu-qt";
+    rev = "import/${version}.04.20160218-1";
+    sha256 = "039yvklhbmfbcynrbqq9n5ywmj8bjfslnkzcnwpzyhnxdzb6yxlx";
+  };
+
+  buildInputs = [ qtbase ];
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [ "-DWITH_DOC=OFF" ];
+
+  dontWrapQtApps = true;
+
+  meta = with lib; {
+    homepage = "https://launchpad.net/libdbusmenu-qt";
+    description = "Provides a Qt implementation of the DBusMenu spec";
+    maintainers = [ maintainers.ttuegel ];
+    inherit (qtbase.meta) platforms;
+    license = licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdbusmenu/default.nix b/nixpkgs/pkgs/development/libraries/libdbusmenu/default.nix
new file mode 100644
index 000000000000..8e9fe4de88ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdbusmenu/default.nix
@@ -0,0 +1,63 @@
+{ stdenv, fetchurl, lib, file
+, pkg-config, intltool
+, glib, dbus-glib, json-glib
+, gobject-introspection, vala
+, gtkVersion ? null, gtk2 ? null, gtk3 ? null }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  name = let postfix = if gtkVersion == null then "glib" else "gtk${gtkVersion}";
+          in "libdbusmenu-${postfix}-${version}";
+  version = "${versionMajor}.${versionMinor}";
+  versionMajor = "16.04";
+  versionMinor = "0";
+
+  src = fetchurl {
+    url = "${meta.homepage}/${versionMajor}/${version}/+download/libdbusmenu-${version}.tar.gz";
+    sha256 = "12l7z8dhl917iy9h02sxmpclnhkdjryn08r8i4sr8l3lrlm4mk5r";
+  };
+
+  nativeBuildInputs = [ vala pkg-config intltool gobject-introspection ];
+
+  buildInputs = [
+    glib dbus-glib json-glib
+  ] ++ optional (gtkVersion != null) (if gtkVersion == "2" then gtk2 else gtk3);
+
+  postPatch = ''
+    for f in {configure,ltmain.sh,m4/libtool.m4}; do
+      substituteInPlace $f \
+        --replace /usr/bin/file ${file}/bin/file
+    done
+  '';
+
+  # https://projects.archlinux.org/svntogit/community.git/tree/trunk/PKGBUILD?h=packages/libdbusmenu
+  preConfigure = ''
+    export HAVE_VALGRIND_TRUE="#"
+    export HAVE_VALGRIND_FALSE=""
+  '';
+
+  configureFlags = [
+    "CFLAGS=-Wno-error"
+    "--sysconfdir=/etc"
+    "--localstatedir=/var"
+    (if gtkVersion == null then "--disable-gtk" else "--with-gtk=${gtkVersion}")
+    "--disable-scrollkeeper"
+  ] ++ optional (gtkVersion != "2") "--disable-dumper";
+
+  doCheck = false; # generates shebangs in check phase, too lazy to fix
+
+  installFlags = [
+    "sysconfdir=${placeholder "out"}/etc"
+    "localstatedir=\${TMPDIR}"
+    "typelibdir=${placeholder "out"}/lib/girepository-1.0"
+  ];
+
+  meta = {
+    description = "Library for passing menu structures across DBus";
+    homepage = "https://launchpad.net/dbusmenu";
+    license = with licenses; [ gpl3 lgpl21 lgpl3 ];
+    platforms = platforms.linux;
+    maintainers = [ maintainers.msteen ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdc1394/default.nix b/nixpkgs/pkgs/development/libraries/libdc1394/default.nix
new file mode 100644
index 000000000000..a666eb3a650b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdc1394/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, libraw1394
+, libusb1, CoreServices }:
+
+stdenv.mkDerivation rec {
+  pname = "libdc1394";
+  version = "2.2.6";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libdc1394/${pname}-${version}.tar.gz";
+    sha256 = "1v8gq54n1pg8izn7s15yylwjf8r1l1dmzbm2yvf6pv2fmb4mz41b";
+  };
+
+  buildInputs = [ libusb1 ]
+    ++ lib.optional stdenv.isLinux libraw1394
+    ++ lib.optional stdenv.isDarwin CoreServices;
+
+  meta = with lib; {
+    homepage = "https://sourceforge.net/projects/libdc1394/";
+    description = "Capture and control API for IIDC compliant cameras";
+    license = licenses.lgpl21Plus;
+    maintainers = [ maintainers.viric ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libde265/default.nix b/nixpkgs/pkgs/development/libraries/libde265/default.nix
new file mode 100644
index 000000000000..bbbcdc3f0544
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libde265/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config }:
+
+stdenv.mkDerivation rec {
+  version = "1.0.8";
+  pname = "libde265";
+
+  src = fetchFromGitHub {
+    owner = "strukturag";
+    repo = "libde265";
+    rev = "v${version}";
+    sha256 = "1dzflqbk248lz5ws0ni5acmf32b3rmnq5gsfaz7691qqjxkl1zml";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "https://github.com/strukturag/libde265";
+    description = "Open h.265 video codec implementation";
+    license = lib.licenses.lgpl3;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ gebner ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdeflate/default.nix b/nixpkgs/pkgs/development/libraries/libdeflate/default.nix
new file mode 100644
index 000000000000..d7a4aa91fb54
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdeflate/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, lib, fetchFromGitHub, fixDarwinDylibNames }:
+
+stdenv.mkDerivation rec {
+  pname = "libdeflate";
+  version = "1.7";
+
+  src = fetchFromGitHub {
+    owner = "ebiggers";
+    repo = "libdeflate";
+    rev = "v${version}";
+    sha256 = "1hnn1yd9s5h92xs72y73izak47kdz070kxkw3kyz2d3az6brfdgh";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile --replace /usr/local $out
+  '';
+
+  nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+
+  configurePhase = ''
+    make programs/config.h
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Fast DEFLATE/zlib/gzip compressor and decompressor";
+    license = licenses.mit;
+    homepage = "https://github.com/ebiggers/libdeflate";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ orivej ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdeltachat/default.nix b/nixpkgs/pkgs/development/libraries/libdeltachat/default.nix
new file mode 100644
index 000000000000..e8fdad61b2af
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdeltachat/default.nix
@@ -0,0 +1,75 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, openssl
+, perl
+, pkg-config
+, rustPlatform
+, sqlite
+, fixDarwinDylibNames
+, CoreFoundation
+, Security
+, libiconv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libdeltachat";
+  version = "1.60.0";
+
+  src = fetchFromGitHub {
+    owner = "deltachat";
+    repo = "deltachat-core-rust";
+    rev = version;
+    sha256 = "1agm5xyaib4ynmw4mhgmkhh4lnxs91wv0q9i1zfihv2vkckfm2s2";
+  };
+
+  patches = [
+    # https://github.com/deltachat/deltachat-core-rust/pull/2589
+    (fetchpatch {
+      url = "https://github.com/deltachat/deltachat-core-rust/commit/408467e85d04fbbfd6bed5908d84d9e995943487.patch";
+      sha256 = "1j2ywaazglgl6370js34acrg0wrh0b7krqg05dfjf65n527lzn59";
+    })
+    ./no-static-lib.patch
+  ];
+
+  cargoDeps = rustPlatform.fetchCargoTarball {
+    inherit src;
+    name = "${pname}-${version}";
+    sha256 = "09d3mw2hb1gmqg7smaqwnfm7izw40znl0h1dz7s2imms2cnkjws1";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    perl
+    pkg-config
+  ] ++ (with rustPlatform; [
+    cargoSetupHook
+    rust.cargo
+  ]) ++ lib.optionals stdenv.isDarwin [
+    fixDarwinDylibNames
+  ];
+
+  buildInputs = [
+    openssl
+    sqlite
+  ] ++ lib.optionals stdenv.isDarwin [
+    CoreFoundation
+    Security
+    libiconv
+  ];
+
+  checkInputs = with rustPlatform; [
+    cargoCheckHook
+  ];
+
+  meta = with lib; {
+    description = "Delta Chat Rust Core library";
+    homepage = "https://github.com/deltachat/deltachat-core-rust/";
+    changelog = "https://github.com/deltachat/deltachat-core-rust/blob/${version}/CHANGELOG.md";
+    license = licenses.mpl20;
+    maintainers = with maintainers; [ dotlambda ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdeltachat/no-static-lib.patch b/nixpkgs/pkgs/development/libraries/libdeltachat/no-static-lib.patch
new file mode 100644
index 000000000000..95238cf88524
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdeltachat/no-static-lib.patch
@@ -0,0 +1,39 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index fe7abe08..acdbe0d6 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -13,7 +13,6 @@ find_program(CARGO cargo)
+ 
+ add_custom_command(
+ 	OUTPUT
+-	"target/release/libdeltachat.a"
+ 	"target/release/libdeltachat.${DYNAMIC_EXT}"
+ 	"target/release/pkgconfig/deltachat.pc"
+         COMMAND
+@@ -38,13 +37,11 @@ add_custom_target(
+ 	lib_deltachat
+ 	ALL
+ 	DEPENDS
+-	"target/release/libdeltachat.a"
+ 	"target/release/libdeltachat.${DYNAMIC_EXT}"
+ 	"target/release/pkgconfig/deltachat.pc"
+ )
+ 
+ include(GNUInstallDirs)
+ install(FILES "deltachat-ffi/deltachat.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+-install(FILES "target/release/libdeltachat.a" DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(FILES "target/release/libdeltachat.${DYNAMIC_EXT}" DESTINATION ${CMAKE_INSTALL_LIBDIR})
+ install(FILES "target/release/pkgconfig/deltachat.pc" DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
+diff --git a/deltachat-ffi/Cargo.toml b/deltachat-ffi/Cargo.toml
+index a34a27ba..cf354abb 100644
+--- a/deltachat-ffi/Cargo.toml
++++ b/deltachat-ffi/Cargo.toml
+@@ -12,7 +12,7 @@ categories = ["cryptography", "std", "email"]
+ 
+ [lib]
+ name = "deltachat"
+-crate-type = ["cdylib", "staticlib"]
++crate-type = ["cdylib"]
+ 
+ [dependencies]
+ deltachat = { path = "../", default-features = false }
diff --git a/nixpkgs/pkgs/development/libraries/libdevil/default.nix b/nixpkgs/pkgs/development/libraries/libdevil/default.nix
new file mode 100644
index 000000000000..fa48c773dfc9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdevil/default.nix
@@ -0,0 +1,59 @@
+{ lib, stdenv, fetchurl, libjpeg, libpng, libmng, lcms1, libtiff, openexr, libGL
+, libX11, pkg-config, OpenGL
+}:
+
+stdenv.mkDerivation rec {
+
+  pname = "libdevil";
+  version = "1.7.8";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/openil/DevIL-${version}.tar.gz";
+    sha256 = "1zd850nn7nvkkhasrv7kn17kzgslr5ry933v6db62s4lr0zzlbv8";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  buildInputs = [ libjpeg libpng libmng lcms1 libtiff openexr libGL libX11 ]
+    ++ lib.optionals stdenv.isDarwin [ OpenGL ];
+  nativeBuildInputs = [ pkg-config ];
+
+  configureFlags = [ "--enable-ILU" "--enable-ILUT" ];
+
+  preConfigure = ''
+    sed -i 's, -std=gnu99,,g' configure
+    sed -i 's,malloc.h,stdlib.h,g' src-ILU/ilur/ilur.c
+  '' + lib.optionalString stdenv.cc.isClang ''
+    sed -i 's/libIL_la_CXXFLAGS = $(AM_CFLAGS)/libIL_la_CXXFLAGS =/g' lib/Makefile.in
+  '';
+
+  postConfigure = ''
+    sed -i '/RESTRICT_KEYWORD/d' include/IL/config.h
+  '';
+
+  patches =
+    [ ( fetchurl {
+        url = "https://sources.debian.org/data/main/d/devil/1.7.8-10/debian/patches/03_CVE-2009-3994.diff";
+        sha256 = "0qkx2qfv02igbrmsn6z5a3lbrbwjfh3rb0c2sj54wy0j1f775hbc";
+      } )
+      ./ftbfs-libpng15.patch
+      ./il_endian.h.patch
+    ];
+
+  enableParallelBuilding = true;
+
+  postPatch = ''
+    for a in test/Makefile.in test/format_test/format_checks.sh.in ; do
+      substituteInPlace $a \
+        --replace /bin/bash ${stdenv.shell}
+    done
+  '';
+
+  meta = with lib; {
+    homepage = "http://openil.sourceforge.net/";
+    description = "An image library which can can load, save, convert, manipulate, filter and display a wide variety of image formats";
+    license = licenses.lgpl2;
+    platforms = platforms.mesaPlatforms;
+    maintainers = [ maintainers.phreedom ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdevil/ftbfs-libpng15.patch b/nixpkgs/pkgs/development/libraries/libdevil/ftbfs-libpng15.patch
new file mode 100644
index 000000000000..5fc53c2dc6a7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdevil/ftbfs-libpng15.patch
@@ -0,0 +1,31 @@
+Source: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=649554
+--- devil-1.7.8.orig/src-IL/src/il_icon.c
++++ devil-1.7.8/src-IL/src/il_icon.c
+@@ -525,7 +525,11 @@
+ 
+ 	// Expand low-bit-depth grayscale images to 8 bits
+ 	if (ico_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
++		png_set_expand_gray_1_2_4_to_8(ico_png_ptr);
++#else
+ 		png_set_gray_1_2_4_to_8(ico_png_ptr);
++#endif
+ 	}
+ 
+ 	// Expand RGB images with transparency to full alpha channels
+only in patch2:
+unchanged:
+--- devil-1.7.8.orig/src-IL/src/il_png.c
++++ devil-1.7.8/src-IL/src/il_png.c
+@@ -278,7 +278,11 @@
+ 
+ 	// Expand low-bit-depth grayscale images to 8 bits
+ 	if (png_color_type == PNG_COLOR_TYPE_GRAY && bit_depth < 8) {
++#if PNG_LIBPNG_VER_MAJOR >= 1 && PNG_LIBPNG_VER_MINOR >= 4
++		png_set_expand_gray_1_2_4_to_8(png_ptr);
++#else
+ 		png_set_gray_1_2_4_to_8(png_ptr);
++#endif
+ 	}
+ 
+ 	// Expand RGB images with transparency to full alpha channels
diff --git a/nixpkgs/pkgs/development/libraries/libdevil/il_endian.h.patch b/nixpkgs/pkgs/development/libraries/libdevil/il_endian.h.patch
new file mode 100644
index 000000000000..c220e6802fd9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdevil/il_endian.h.patch
@@ -0,0 +1,27 @@
+Source: http://sourceforge.net/p/resil/tickets/8/
+--- devil-1.7.8.orig/src-IL/include/il_endian.h.orig	2009-03-08 01:10:08.000000000 -0600
++++ devil-1.7.8/src-IL/include/il_endian.h	2013-11-03 01:52:37.000000000 -0600
+@@ -19,9 +19,13 @@
+ 	#ifndef __BIG_ENDIAN__
+ 	#define __BIG_ENDIAN__ 1
+ 	#endif
++#else
++	#ifndef __LITTLE_ENDIAN__
++	#define __LITTLE_ENDIAN__ 1
++	#endif
+ #endif
+ 
+-#if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __BIG_ENDIAN__) \
++#if (defined(__BYTE_ORDER__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) \
+   || (defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__))
+  	#undef __LITTLE_ENDIAN__
+ 	#define Short(s) iSwapShort(s)
+@@ -39,8 +43,6 @@
+ 	#define BigDouble(d)  
+ #else
+ 	#undef __BIG_ENDIAN__
+-	#undef __LITTLE_ENDIAN__  // Not sure if it's defined by any compiler...
+-	#define __LITTLE_ENDIAN__
+ 	#define Short(s)  
+ 	#define UShort(s)  
+ 	#define Int(i)  
diff --git a/nixpkgs/pkgs/development/libraries/libdigidoc/default.nix b/nixpkgs/pkgs/development/libraries/libdigidoc/default.nix
new file mode 100644
index 000000000000..7ee268e4e7d9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdigidoc/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, cmake, openssl, pcsclite, opensc, libxml2, Security }:
+
+stdenv.mkDerivation rec {
+
+  version = "3.10.5";
+  pname = "libdigidoc";
+
+  src = fetchurl {
+    url = "https://github.com/open-eid/libdigidoc/releases/download/v${version}/libdigidoc-${version}.tar.gz";
+    sha256 = "0nw36a4i6rcq7z6jqz5h2ln9hmmsfhw65jga3rymlswk2k7bndgn";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ openssl pcsclite opensc libxml2 ]
+    ++ lib.optionals stdenv.isDarwin [ Security ];
+
+  cmakeFlags = lib.optionals stdenv.isDarwin [ "-DFRAMEWORK=OFF" ];
+
+  meta = with lib; {
+    description = "Library for creating DigiDoc signature files";
+    homepage = "https://github.com/open-eid/libdigidoc";
+    license = licenses.lgpl2;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.jagajaga ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdigidocpp/default.nix b/nixpkgs/pkgs/development/libraries/libdigidocpp/default.nix
new file mode 100644
index 000000000000..c7a7673dc1b3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdigidocpp/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, cmake, libdigidoc, minizip, pcsclite, opensc, openssl
+, xercesc, xml-security-c, pkg-config, xsd, zlib, xalanc, xxd }:
+
+stdenv.mkDerivation rec {
+  version = "3.14.6";
+  pname = "libdigidocpp";
+
+  src = fetchurl {
+     url = "https://github.com/open-eid/libdigidocpp/releases/download/v${version}/libdigidocpp-${version}.tar.gz";
+     sha256 = "sha256-zDMxJyL/T3cXrqgMT15yZlCozgyOt5nNreottuuiGHk=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config xxd ];
+
+  buildInputs = [
+    libdigidoc minizip pcsclite opensc openssl xercesc
+    xml-security-c xsd zlib xalanc
+  ];
+
+  meta = with lib; {
+    description = "Library for creating DigiDoc signature files";
+    homepage = "http://www.id.ee/";
+    license = licenses.lgpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.jagajaga ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdiscid/default.nix b/nixpkgs/pkgs/development/libraries/libdiscid/default.nix
new file mode 100644
index 000000000000..3021aced93f6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdiscid/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, cmake, pkg-config, darwin }:
+
+stdenv.mkDerivation rec {
+  pname = "libdiscid";
+  version = "0.6.2";
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.IOKit ];
+
+  src = fetchurl {
+    url = "http://ftp.musicbrainz.org/pub/musicbrainz/libdiscid/${pname}-${version}.tar.gz";
+    sha256 = "1f9irlj3dpb5gyfdnb1m4skbjvx4d4hwiz2152f83m0d9jn47r7r";
+  };
+
+  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework CoreFoundation -framework IOKit";
+
+  meta = with lib; {
+    description = "A C library for creating MusicBrainz DiscIDs from audio CDs";
+    homepage = "http://musicbrainz.org/doc/libdiscid";
+    maintainers = with maintainers; [ ehmry ];
+    license = licenses.lgpl21;
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdivecomputer/default.nix b/nixpkgs/pkgs/development/libraries/libdivecomputer/default.nix
new file mode 100644
index 000000000000..4a9a4b0980e3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdivecomputer/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libdivecomputer";
+  version = "0.7.0";
+
+  src = fetchurl {
+    url = "https://www.libdivecomputer.org/releases/${pname}-${version}.tar.gz";
+    sha256 = "sha256-gNnxlOokUCA535hZhILgr8aw4zPeeds0wpstaJNNJbk=";
+  };
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "http://www.libdivecomputer.org";
+    description = "A cross-platform and open source library for communication with dive computers from various manufacturers";
+    maintainers = [ maintainers.mguentner ];
+    license = licenses.lgpl21;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdivsufsort/default.nix b/nixpkgs/pkgs/development/libraries/libdivsufsort/default.nix
new file mode 100644
index 000000000000..91b320826606
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdivsufsort/default.nix
@@ -0,0 +1,18 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "libdivsufsort";
+  version = "2.0.1";
+
+  src = fetchurl {
+    url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/libdivsufsort/libdivsufsort-${version}.tar.bz2";
+    sha256 = "1g0q40vb2k689bpasa914yi8sjsmih04017mw20zaqqpxa32rh2m";
+  };
+
+  meta = {
+    homepage = "https://github.com/y-256/libdivsufsort";
+    license = lib.licenses.mit;
+    description = "Library to construct the suffix array and the BW transformed string";
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdmapsharing/default.nix b/nixpkgs/pkgs/development/libraries/libdmapsharing/default.nix
new file mode 100644
index 000000000000..c9759d76246e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdmapsharing/default.nix
@@ -0,0 +1,95 @@
+{ stdenv
+, lib
+, fetchFromGitLab
+, autoconf
+, automake
+, libtool
+, which
+, pkg-config
+, python3
+, vala
+, avahi
+, gdk-pixbuf
+, gst_all_1
+, glib
+, gtk3
+, libgee
+, check
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+, gobject-introspection
+, libsoup
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libdmapsharing";
+  version = "3.9.10";
+
+  outputs = [ "out" "dev" "devdoc" ];
+  outputBin = "dev";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.gnome.org";
+    owner = "GNOME";
+    repo = pname;
+    rev = "${lib.toUpper pname}_${lib.replaceStrings ["."] ["_"] version}";
+    sha256 = "04y1wjwnbw4pzg05h383d83p6an6ylwy4b4g32jmjxpfi388x33g";
+  };
+
+  nativeBuildInputs = [
+    autoconf
+    automake
+    libtool
+    which
+    pkg-config
+    python3
+    gobject-introspection
+    vala
+    gtk-doc
+    docbook-xsl-nons
+    docbook_xml_dtd_43
+  ];
+
+  buildInputs = [
+    avahi
+    gdk-pixbuf
+    gst_all_1.gstreamer
+    gst_all_1.gst-plugins-base
+  ];
+
+  propagatedBuildInputs = [
+    glib
+    libsoup
+  ];
+
+  checkInputs = [
+    libgee
+    check
+    gtk3
+  ];
+
+  configureFlags = [
+    "--enable-gtk-doc"
+  ];
+
+  # Cannot disable tests here or `check` from checkInputs would not be included.
+  # Cannot disable building the tests or docs will not build:
+  # https://gitlab.gnome.org/GNOME/libdmapsharing/-/issues/49
+  doCheck = true;
+
+  preConfigure = ''
+    NOCONFIGURE=1 ./autogen.sh
+  '';
+
+  # Tests require mDNS server.
+  checkPhase = ":";
+
+  meta = with lib; {
+    homepage = "https://www.flyn.org/projects/libdmapsharing/";
+    description = "Library that implements the DMAP family of protocols";
+    maintainers = teams.gnome.members;
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdmtx/default.nix b/nixpkgs/pkgs/development/libraries/libdmtx/default.nix
new file mode 100644
index 000000000000..c26ccc347f9a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdmtx/default.nix
@@ -0,0 +1,29 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libdmtx";
+  version = "0.7.5";
+
+  src = fetchFromGitHub {
+    owner = "dmtx";
+    repo = "libdmtx";
+    rev = "v${version}";
+    sha256 = "0wk3fkxzf9ip75v8ia54v6ywx72ajp5s6777j4ay8barpbv869rj";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  meta = {
+    description = "An open source software for reading and writing Data Matrix barcodes";
+    homepage = "https://github.com/dmtx/libdmtx";
+    changelog = "https://github.com/dmtx/libdmtx/blob/v${version}/ChangeLog";
+    platforms = lib.platforms.all;
+    maintainers = [ ];
+    license = lib.licenses.bsd2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdnet/default.nix b/nixpkgs/pkgs/development/libraries/libdnet/default.nix
new file mode 100644
index 000000000000..43d9d2077fe3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdnet/default.nix
@@ -0,0 +1,29 @@
+{lib, stdenv, fetchurl, automake, autoconf, libtool}:
+
+stdenv.mkDerivation {
+  name = "libdnet-1.12";
+
+  enableParallelBuilding = true;
+
+  src = fetchurl {
+    url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/libdnet/libdnet-1.12.tgz";
+    sha256 = "09mhbr8x66ykhf5581a5zjpplpjxibqzgkkpx689kybwg0wk1cw3";
+  };
+
+  buildInputs = [ automake autoconf libtool ];
+
+  # .so endings are missing (quick and dirty fix)
+  postInstall = ''
+    for i in $out/lib/*; do
+      ln -s $i $i.so
+    done
+  '';
+
+  meta = {
+    description = "Provides a simplified, portable interface to several low-level networking routines";
+    homepage = "https://github.com/dugsong/libdnet";
+    license = lib.licenses.bsd3;
+    maintainers = [lib.maintainers.marcweber];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdrm/cross-build-nm-path.patch b/nixpkgs/pkgs/development/libraries/libdrm/cross-build-nm-path.patch
new file mode 100644
index 000000000000..547ef0d09691
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdrm/cross-build-nm-path.patch
@@ -0,0 +1,47 @@
+From 9e05fece7918edce9c6aa5a1f1ea375108e5b2be Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
+Date: Fri, 2 Aug 2019 10:26:37 +0100
+Subject: [PATCH] meson: support for custom nm path
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+When cross-compiling target toolchains i.e. binutils are often
+prefixed by its target architecture. This patch gives the user
+to option to specify the nm used during the build process.
+
+Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
+---
+ meson.build       | 2 +-
+ meson_options.txt | 6 ++++++
+ 2 files changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/meson.build b/meson.build
+--- meson.build.orig	2020-06-18 11:13:57.716321962 +0200
++++ meson.build	2020-06-18 11:19:50.456861311 +0200
+@@ -45,7 +45,7 @@
+ cc = meson.get_compiler('c')
+
+ symbols_check = find_program('symbols-check.py')
+-prog_nm = find_program('nm')
++prog_nm = find_program(get_option('nm-path'))
+
+ # Check for atomics
+ intel_atomics = false
+diff --git a/meson_options.txt b/meson_options.txt
+index 8af33f1c..b4f46a52 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -141,3 +141,9 @@ option(
+   value : false,
+   description : 'Enable support for using udev instead of mknod.',
+ )
++option(
++  'nm-path',
++  type : 'string',
++  description : 'path to nm',
++  value : 'nm'
++)
+-- 
+2.22.0
+
diff --git a/nixpkgs/pkgs/development/libraries/libdrm/default.nix b/nixpkgs/pkgs/development/libraries/libdrm/default.nix
new file mode 100644
index 000000000000..c5bf352ff578
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdrm/default.nix
@@ -0,0 +1,52 @@
+{ stdenv, lib, fetchurl, pkg-config, meson, ninja, docutils
+, libpthreadstubs, libpciaccess
+, withValgrind ? valgrind-light.meta.available, valgrind-light
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libdrm";
+  version = "2.4.107";
+
+  src = fetchurl {
+    url = "https://dri.freedesktop.org/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "127qf1rzhaf13vdd75a58v5q34617hvangjlfnlkcdh37gqcwm65";
+  };
+
+  outputs = [ "out" "dev" "bin" ];
+
+  nativeBuildInputs = [ pkg-config meson ninja docutils ];
+  buildInputs = [ libpthreadstubs libpciaccess ]
+    ++ lib.optional withValgrind valgrind-light;
+
+  patches = [ ./cross-build-nm-path.patch ];
+
+  mesonFlags = [
+    "-Dnm-path=${stdenv.cc.targetPrefix}nm"
+    "-Dinstall-test-programs=true"
+    "-Domap=true"
+  ] ++ lib.optionals (stdenv.isAarch32 || stdenv.isAarch64) [
+    "-Dtegra=true"
+    "-Detnaviv=true"
+  ];
+
+  meta = with lib; {
+    homepage = "https://gitlab.freedesktop.org/mesa/drm";
+    downloadPage = "https://dri.freedesktop.org/libdrm/";
+    description = "Direct Rendering Manager library and headers";
+    longDescription = ''
+      A userspace library for accessing the DRM (Direct Rendering Manager) on
+      Linux, BSD and other operating systems that support the ioctl interface.
+      The library provides wrapper functions for the ioctls to avoid exposing
+      the kernel interface directly, and for chipsets with drm memory manager,
+      support for tracking relocations and buffers.
+      New functionality in the kernel DRM drivers typically requires a new
+      libdrm, but a new libdrm will always work with an older kernel.
+
+      libdrm is a low-level library, typically used by graphics drivers such as
+      the Mesa drivers, the X drivers, libva and similar projects.
+    '';
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ primeos ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdv/default.nix b/nixpkgs/pkgs/development/libraries/libdv/default.nix
new file mode 100644
index 000000000000..ff3c7f6f8631
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdv/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, popt }:
+
+stdenv.mkDerivation rec {
+  name = "libdv-1.0.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libdv/${name}.tar.gz";
+    sha256 = "1fl96f2xh2slkv1i1ix7kqk576a0ak1d33cylm0mbhm96d0761d3";
+  };
+
+  # This fixes an undefined symbol: _sched_setscheduler error on compile.
+  # See the apple docs: http://cl.ly/2HeF bottom of the "Finding Imported Symbols" section
+  LDFLAGS = lib.optionalString stdenv.isDarwin "-undefined dynamic_lookup";
+
+  configureFlags = [
+    "--disable-asm"
+    "--disable-sdl"
+    "--disable-gtk"
+    "--disable-xv"
+    "--disable-gprof"
+  ];
+
+  buildInputs = [ popt ];
+
+  meta = with lib; {
+    description = "Software decoder for DV format video, as defined by the IEC 61834 and SMPTE 314M standards";
+    homepage = "https://sourceforge.net/projects/libdv/";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdvbpsi/default.nix b/nixpkgs/pkgs/development/libraries/libdvbpsi/default.nix
new file mode 100644
index 000000000000..5d539a7a4882
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdvbpsi/default.nix
@@ -0,0 +1,19 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "libdvbpsi";
+  version = "1.3.3";
+
+  src = fetchurl {
+    url = "http://get.videolan.org/libdvbpsi/${version}/${pname}-${version}.tar.bz2";
+    sha256 = "04h1l3vrkrdsrvkgzcr51adk10g6hxcxvgjphyyxz718ry5rkd82";
+  };
+
+  meta = {
+    description = "A simple library designed for decoding and generation of MPEG TS and DVB PSI tables according to standards ISO/IEC 13818 and ITU-T H.222.0";
+    homepage = "http://www.videolan.org/developers/libdvbpsi.html";
+    platforms = lib.platforms.unix;
+    license = lib.licenses.lgpl21;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdvdcss/default.nix b/nixpkgs/pkgs/development/libraries/libdvdcss/default.nix
new file mode 100644
index 000000000000..b43c0ccdd0fe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdvdcss/default.nix
@@ -0,0 +1,20 @@
+{lib, stdenv, fetchurl, IOKit}:
+
+stdenv.mkDerivation rec {
+  pname = "libdvdcss";
+  version = "1.4.3";
+
+  buildInputs = lib.optional stdenv.isDarwin IOKit;
+
+  src = fetchurl {
+    url = "http://get.videolan.org/libdvdcss/${version}/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-IzzJL13AHF06lvWzWCvn1c7lo1pS06CBWHRdPYYHAHk=";
+  };
+
+  meta = with lib; {
+    homepage = "http://www.videolan.org/developers/libdvdcss.html";
+    description = "A library for decrypting DVDs";
+    license = licenses.gpl2;
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdvdnav/4.2.1.nix b/nixpkgs/pkgs/development/libraries/libdvdnav/4.2.1.nix
new file mode 100644
index 000000000000..1f832de5bb3b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdvdnav/4.2.1.nix
@@ -0,0 +1,29 @@
+{lib, stdenv, fetchurl, pkg-config, libdvdread}:
+
+stdenv.mkDerivation {
+  name = "libdvdnav-4.2.1";
+
+  src = fetchurl {
+    url = "http://dvdnav.mplayerhq.hu/releases/libdvdnav-4.2.1.tar.xz";
+    sha256 = "7fca272ecc3241b6de41bbbf7ac9a303ba25cb9e0c82aa23901d3104887f2372";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [libdvdread];
+
+  configureScript = "./configure2"; # wtf?
+
+  preConfigure = ''
+    mkdir -p $out
+  '';
+
+  meta = {
+    homepage = "http://dvdnav.mplayerhq.hu/";
+    description = "A library that implements DVD navigation features such as DVD menus";
+    license = lib.licenses.gpl2;
+    maintainers = [ lib.maintainers.wmertens ];
+    platforms = lib.platforms.linux;
+  };
+
+  passthru = { inherit libdvdread; };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdvdnav/default.nix b/nixpkgs/pkgs/development/libraries/libdvdnav/default.nix
new file mode 100644
index 000000000000..8414605593de
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdvdnav/default.nix
@@ -0,0 +1,24 @@
+{lib, stdenv, fetchurl, pkg-config, libdvdread}:
+
+stdenv.mkDerivation rec {
+  pname = "libdvdnav";
+  version = "6.1.1";
+
+  src = fetchurl {
+    url = "http://get.videolan.org/libdvdnav/${version}/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-wZGnR1lH0yP/doDPksD7G+gjdwGIXzdlbGTQTpjRjUg=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [libdvdread];
+
+  meta = {
+    homepage = "http://dvdnav.mplayerhq.hu/";
+    description = "A library that implements DVD navigation features such as DVD menus";
+    license = lib.licenses.gpl2;
+    maintainers = [ lib.maintainers.wmertens ];
+    platforms = lib.platforms.unix;
+  };
+
+  passthru = { inherit libdvdread; };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdvdread/4.9.9.nix b/nixpkgs/pkgs/development/libraries/libdvdread/4.9.9.nix
new file mode 100644
index 000000000000..7049e1dd9935
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdvdread/4.9.9.nix
@@ -0,0 +1,26 @@
+{lib, stdenv, fetchurl, libdvdcss}:
+
+stdenv.mkDerivation {
+  name = "libdvdread-4.9.9";
+
+  src = fetchurl {
+    url = "http://dvdnav.mplayerhq.hu/releases/libdvdread-4.9.9.tar.xz";
+    sha256 = "d91275471ef69d488b05cf15c60e1cd65e17648bfc692b405787419f47ca424a";
+  };
+
+  buildInputs = [libdvdcss];
+
+  NIX_LDFLAGS = "-ldvdcss";
+
+  postInstall = ''
+    ln -s dvdread $out/include/libdvdread
+  '';
+
+  meta = {
+    homepage = "http://dvdnav.mplayerhq.hu/";
+    description = "A library for reading DVDs";
+    license = lib.licenses.gpl2;
+    maintainers = [ lib.maintainers.wmertens ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdvdread/default.nix b/nixpkgs/pkgs/development/libraries/libdvdread/default.nix
new file mode 100644
index 000000000000..ac94dcbcb8f7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdvdread/default.nix
@@ -0,0 +1,27 @@
+{lib, stdenv, fetchurl, libdvdcss}:
+
+stdenv.mkDerivation rec {
+  pname = "libdvdread";
+  version = "6.1.2";
+
+  src = fetchurl {
+    url = "http://get.videolan.org/libdvdread/${version}/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-zBkPVTdYztdXGFnjAfgCy0gh8WTQK/rP0yDBSk4Np2M=";
+  };
+
+  buildInputs = [libdvdcss];
+
+  NIX_LDFLAGS = "-ldvdcss";
+
+  postInstall = ''
+    ln -s dvdread $out/include/libdvdread
+  '';
+
+  meta = {
+    homepage = "http://dvdnav.mplayerhq.hu/";
+    description = "A library for reading DVDs";
+    license = lib.licenses.gpl2;
+    maintainers = [ lib.maintainers.wmertens ];
+    platforms = with lib.platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdwarf/default.nix b/nixpkgs/pkgs/development/libraries/libdwarf/default.nix
new file mode 100644
index 000000000000..0d512b04201a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdwarf/default.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv, fetchurl, libelf, zlib }:
+
+let
+  version = "20181024";
+  src = fetchurl {
+    url = "https://www.prevanders.net/libdwarf-${version}.tar.gz";
+    # Upstream displays this hash broken into three parts:
+    sha512 = "02f8024bb9959c91a1fe322459f7587a589d096595"
+           + "6d643921a173e6f9e0a184db7aef66f0fd2548d669"
+           + "5be7f9ee368f1cc8940cea4ddda01ff99d28bbf1fe58";
+  };
+  meta = {
+    homepage = "https://www.prevanders.net/dwarf.html";
+    platforms = lib.platforms.linux;
+    license = lib.licenses.lgpl21Plus;
+  };
+
+in rec {
+  libdwarf = stdenv.mkDerivation {
+    pname = "libdwarf";
+    inherit version;
+
+    configureFlags = [ "--enable-shared" "--disable-nonshared" ];
+
+    preConfigure = ''
+      cd libdwarf
+    '';
+    buildInputs = [ libelf zlib ];
+
+    installPhase = ''
+      mkdir -p $out/lib $out/include
+      cp libdwarf.so.1 $out/lib
+      ln -s libdwarf.so.1 $out/lib/libdwarf.so
+      cp libdwarf.h dwarf.h $out/include
+    '';
+
+    inherit meta src;
+  };
+
+  dwarfdump = stdenv.mkDerivation {
+    pname = "dwarfdump";
+    inherit version;
+
+    preConfigure = ''
+      cd dwarfdump
+    '';
+
+    buildInputs = [ libelf libdwarf ];
+
+    installPhase = ''
+      install -m755 -D dwarfdump $out/bin/dwarfdump
+    '';
+
+    inherit meta src;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdwg/default.nix b/nixpkgs/pkgs/development/libraries/libdwg/default.nix
new file mode 100644
index 000000000000..5a0347e59542
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdwg/default.nix
@@ -0,0 +1,25 @@
+{lib, stdenv, fetchurl, indent}:
+
+stdenv.mkDerivation {
+  name = "libdwg-0.6";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libdwg/libdwg-0.6.tar.bz2";
+    sha256 = "0l8ks1x70mkna1q7mzy1fxplinz141bd24qhrm1zkdil74mcsryc";
+  };
+
+  nativeBuildInputs = [ indent ];
+
+  hardeningDisable = [ "format" ];
+
+  # Hack to avoid TMPDIR in RPATHs.
+  preFixup = ''rm -rf "$(pwd)" '';
+
+  meta = {
+    description = "Library reading dwg files";
+    homepage = "http://libdwg.sourceforge.net/en/";
+    license = lib.licenses.gpl3;
+    maintainers = [lib.maintainers.marcweber];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libdynd/default.nix b/nixpkgs/pkgs/development/libraries/libdynd/default.nix
new file mode 100644
index 000000000000..b418279e477b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libdynd/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "libdynd";
+  version = "0.7.2";
+
+  src = fetchFromGitHub {
+    owner = "libdynd";
+    repo = "libdynd";
+    rev = "v${version}";
+    sha256 = "0fkd5rawqni1cq51fmr76iw7ll4fmbahfwv4rglnsabbkylf73pr";
+  };
+
+  cmakeFlags = [
+    "-DDYND_BUILD_BENCHMARKS=OFF"
+  ];
+
+  # 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"
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  outputs = [ "out" "dev" ];
+  outputDoc = "dev";
+
+  meta = with lib; {
+    description = "C++ dynamic ndarray library, with Python exposure";
+    homepage = "http://libdynd.org";
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libe-book/default.nix b/nixpkgs/pkgs/development/libraries/libe-book/default.nix
new file mode 100644
index 000000000000..f467a01ea7ab
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libe-book/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, gperf, pkg-config, librevenge, libxml2, boost, icu
+, cppunit, zlib, liblangtag
+}:
+
+let
+  s = # Generated upstream information
+  rec {
+    baseName="libe-book";
+    version="0.1.3";
+    name="${baseName}-${version}";
+    hash="1yg1vws1wggzhjw672bpgh2x541g5i9wryf67g51m0r79zrqz3by";
+    url="https://kent.dl.sourceforge.net/project/libebook/libe-book-0.1.3/libe-book-0.1.3.tar.xz";
+    sha256="1yg1vws1wggzhjw672bpgh2x541g5i9wryf67g51m0r79zrqz3by";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    gperf librevenge libxml2 boost icu cppunit zlib liblangtag
+  ];
+
+  # Boost 1.59 compatability fix
+  # Attempt removing when updating
+  postPatch = ''
+    sed -i 's,^CPPFLAGS.*,\0 -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED,' src/lib/Makefile.in
+  '';
+in
+stdenv.mkDerivation {
+  inherit (s) name version;
+  inherit nativeBuildInputs buildInputs postPatch;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+  NIX_CFLAGS_COMPILE = "-Wno-error=unused-function";
+  meta = {
+    inherit (s) version;
+    description = "Library for import of reflowable e-book formats";
+    license = lib.licenses.lgpl21Plus ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libe-book/default.upstream b/nixpkgs/pkgs/development/libraries/libe-book/default.upstream
new file mode 100644
index 000000000000..a06a9af99bb4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libe-book/default.upstream
@@ -0,0 +1,4 @@
+url https://sourceforge.net/projects/libebook/files/
+SF_version_dir libe-book-
+version_link '[.]tar.xz/download$'
+SF_redirect
diff --git a/nixpkgs/pkgs/development/libraries/libe57format/default.nix b/nixpkgs/pkgs/development/libraries/libe57format/default.nix
new file mode 100644
index 000000000000..2ad8573ecb30
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libe57format/default.nix
@@ -0,0 +1,60 @@
+{
+  lib, stdenv,
+  cmake,
+  fetchFromGitHub,
+  boost,
+  xercesc,
+  icu,
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libe57format";
+  version = "2.2.0";
+
+  src = fetchFromGitHub {
+    owner = "asmaloney";
+    repo = "libE57Format";
+    rev = "v${version}";
+    sha256 = "15l23spjvak5h3n7aj3ggy0c3cwcg8mvnc9jlbd9yc2ra43bx7bp";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  buildInputs = [
+    boost
+    icu
+  ];
+
+  propagatedBuildInputs = [
+    # Necessary for projects that try to find libE57Format via CMake
+    # due to the way that libe57format's CMake config is written.
+    xercesc
+  ];
+
+  # The build system by default builds ONLY static libraries, and with
+  # `-DE57_BUILD_SHARED=ON` builds ONLY shared libraries, see:
+  #     https://github.com/asmaloney/libE57Format/issues/48
+  #     https://github.com/asmaloney/libE57Format/blob/f657d470da5f0d185fe371c4c011683f6e30f0cb/CMakeLists.txt#L82-L89
+  # We support building both by building statically and then
+  # building an .so file here manually.
+  # The way this is written makes this Linux-only for now.
+  postInstall = ''
+    cd $out/lib
+    g++ -Wl,--no-undefined -shared -o libE57FormatShared.so -L. -Wl,-whole-archive -lE57Format -Wl,-no-whole-archive -lxerces-c
+    mv libE57FormatShared.so libE57Format.so
+
+    if [ "$dontDisableStatic" -ne "1" ]; then
+      rm libE57Format.a
+    fi
+  '';
+
+  meta = with lib; {
+    description = "Library for reading & writing the E57 file format";
+    homepage = "https://github.com/asmaloney/libE57Format";
+    license = licenses.boost;
+    maintainers = with maintainers; [ chpatrick nh2 ];
+    platforms = platforms.linux; # because of the .so buiding in `postInstall` above
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libeatmydata/default.nix b/nixpkgs/pkgs/development/libraries/libeatmydata/default.nix
new file mode 100644
index 000000000000..70fab2da5688
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libeatmydata/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, strace, which }:
+
+stdenv.mkDerivation rec {
+  pname = "libeatmydata";
+  version = "105";
+
+  src = fetchFromGitHub {
+    owner = "stewartsmith";
+    repo = pname;
+    rev = "${pname}-${version}";
+    sha256 = "0sx803h46i81h67xbpd3c7ky0nhaw4gij214nsx4lqig70223v9r";
+  };
+
+  patches = [ ./find-shell-lib.patch ];
+
+  patchFlags = "-p0";
+
+  postPatch = ''
+    substituteInPlace eatmydata.in \
+      --replace NIX_OUT_DIR $out
+
+    patchShebangs .
+  '';
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ] ++ lib.optionals doCheck [ strace which ];
+
+  # while we can *build* in parallel, the tests also run in parallel which does
+  # not work with v105. Later versions (unreleased) have a fix for that. The
+  # problem is that on hydra we cannot use strace, so the tests don't run there.
+  enableParallelBuilding = true;
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Small LD_PRELOAD library to disable fsync and friends";
+    homepage = "https://www.flamingspork.com/projects/libeatmydata/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libeatmydata/find-shell-lib.patch b/nixpkgs/pkgs/development/libraries/libeatmydata/find-shell-lib.patch
new file mode 100644
index 000000000000..a6320edda29d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libeatmydata/find-shell-lib.patch
@@ -0,0 +1,20 @@
+--- eatmydata.in	2020-02-01 18:10:59.618679823 -0800
++++ eatmydata.in.new	2020-02-01 18:08:25.092620247 -0800
+@@ -15,15 +15,8 @@
+ # You should have received a copy of the GNU General Public License
+ # along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ 
+-export `dpkg-architecture|grep DEB_BUILD_MULTIARCH`
+-
+-shlib="/usr/lib/$DEB_BUILD_MULTIARCH/eatmydata.sh"
+-if [ -f "$shlib" ]; then
+-    . "$shlib"
+-else
+-    echo "Unable to locate eatmydata shell library, it was not enabled" >&2
+-    exec "$@"
+-fi
++shlib="NIX_OUT_DIR/libexec/eatmydata.sh"
++. "$shlib"
+ 
+ usage()
+ {
diff --git a/nixpkgs/pkgs/development/libraries/libeb/default.nix b/nixpkgs/pkgs/development/libraries/libeb/default.nix
new file mode 100644
index 000000000000..fe0011f9c997
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libeb/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, perl, zlib }:
+stdenv.mkDerivation rec {
+  pname = "libeb";
+  version = "4.4.3";
+
+  src = fetchurl {
+    url = "ftp://ftp.sra.co.jp/pub/misc/eb/eb-${version}.tar.bz2";
+    sha256 = "0psbdzirazfnn02hp3gsx7xxss9f1brv4ywp6a15ihvggjki1rxb";
+  };
+
+  nativeBuildInputs = [ perl ];
+  buildInputs = [ zlib ];
+
+  meta = with lib; {
+    description = "C library for accessing Japanese CD-ROM books";
+    longDescription = ''
+      The EB library is a library for accessing CD-ROM books, which are a
+      common way to distribute electronic dictionaries in Japan.  It supports
+      the EB, EBG, EBXA, EBXA-C, S-EBXA and EPWING formats.
+    '';
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ gebner ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libebml/default.nix b/nixpkgs/pkgs/development/libraries/libebml/default.nix
new file mode 100644
index 000000000000..6a042012132e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libebml/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "libebml";
+  version = "1.4.2";
+
+  src = fetchFromGitHub {
+    owner  = "Matroska-Org";
+    repo   = "libebml";
+    rev    = "release-${version}";
+    sha256 = "1hiilnabar826lfxsaflqjhgsdli6hzzhjv8q2nmw36fvvlyks25";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=YES"
+    "-DCMAKE_INSTALL_PREFIX="
+  ];
+
+  meta = with lib; {
+    description = "Extensible Binary Meta Language library";
+    homepage = "https://dl.matroska.org/downloads/libebml/";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ spwhitt ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libebur128/default.nix b/nixpkgs/pkgs/development/libraries/libebur128/default.nix
new file mode 100644
index 000000000000..656923da3d15
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libebur128/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, cmake, speexdsp, pkg-config }:
+
+stdenv.mkDerivation rec {
+  version = "1.2.6";
+  pname = "libebur128";
+
+  src = fetchFromGitHub {
+    owner = "jiixyj";
+    repo = "libebur128";
+    rev = "v${version}";
+    sha256 = "sha256-UKO2k+kKH/dwt2xfaYMrH/GXjEkIrnxh1kGG/3P5d3Y=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ speexdsp ];
+
+  meta = with lib; {
+    description = "Implementation of the EBU R128 loudness standard";
+    homepage = "https://github.com/jiixyj/libebur128";
+    license = licenses.mit;
+    maintainers = [ maintainers.andrewrk ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libechonest/default.nix b/nixpkgs/pkgs/development/libraries/libechonest/default.nix
new file mode 100644
index 000000000000..29a0a63a03e7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libechonest/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, doxygen, qt4, qjson }:
+
+stdenv.mkDerivation rec {
+  pname = "libechonest";
+  version = "2.3.1";
+
+  src = fetchFromGitHub {
+    owner = "lfranchi";
+    repo = pname;
+    rev = version;
+    sha256 = "0xbavf9f355dl1d3qv59x4ryypqrdanh9xdvw2d0q66l008crdkq";
+  };
+
+  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 ];
+
+  doCheck = false; # requires network access
+
+  meta = {
+    description = "A C++/Qt wrapper around the Echo Nest API";
+    homepage = "https://projects.kde.org/projects/playground/libs/libechonest";
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libedit/01-cygwin.patch b/nixpkgs/pkgs/development/libraries/libedit/01-cygwin.patch
new file mode 100644
index 000000000000..33bd39ed61e5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libedit/01-cygwin.patch
@@ -0,0 +1,25 @@
+--- libedit-20120311-3.0/src/chartype.h	2012-03-11 10:54:58.000000000 +0100
++++ libedit-20120311-3.0/src/chartype.h	2012-05-03 19:00:20.651847423 +0200
+@@ -56,9 +56,11 @@
+ /* Oh for a <uchar.h> with char32_t and __STDC_UTF_32__ in it...
+  * ref: ISO/IEC DTR 19769
+  */
++#ifndef __CYGWIN__
+ #if WCHAR_MAX < INT32_MAX
+ #warning Build environment does not support non-BMP characters
+ #endif
++#endif
+ 
+ #ifndef HAVE_WCSDUP
+ wchar_t *wcsdup(const wchar_t *s);
+--- libedit-20120311-3.0/src/editline/readline.h	2011-02-26 23:42:59.000000000 +0100
++++ libedit-20120311-3.0/src/editline/readline.h	2012-05-03 19:00:49.211244803 +0200
+@@ -75,7 +75,7 @@ typedef KEYMAP_ENTRY *Keymap;
+ 
+ #ifndef CTRL
+ #include <sys/ioctl.h>
+-#if !defined(__sun) && !defined(__hpux) && !defined(_AIX)
++#if !defined(__sun) && !defined(__hpux) && !defined(_AIX) && !defined(__CYGWIN__)
+ #include <sys/ttydefaults.h>
+ #endif
+ #ifndef CTRL
diff --git a/nixpkgs/pkgs/development/libraries/libedit/default.nix b/nixpkgs/pkgs/development/libraries/libedit/default.nix
new file mode 100644
index 000000000000..35efdc781d46
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libedit/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, ncurses }:
+
+stdenv.mkDerivation rec {
+  pname = "libedit";
+  version = "20210714-3.1";
+
+  src = fetchurl {
+    url = "https://thrysoee.dk/editline/${pname}-${version}.tar.gz";
+    sha256 = "sha256-MCO0mK1ZP9d0WuOyCrrVRt5Qa2e4+7VXljfKaauC28k=";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  # Have `configure' avoid `/usr/bin/nroff' in non-chroot builds.
+  # NROFF = "${groff}/bin/nroff";
+
+  patches = [ ./01-cygwin.patch ];
+
+  propagatedBuildInputs = [ ncurses ];
+
+  postInstall = ''
+    find $out/lib -type f | grep '\.\(la\|pc\)''$' | xargs sed -i \
+      -e 's,-lncurses[a-z]*,-L${ncurses.out}/lib -lncursesw,g'
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.thrysoee.dk/editline/";
+    description = "A port of the NetBSD Editline library (libedit)";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libee/default.nix b/nixpkgs/pkgs/development/libraries/libee/default.nix
new file mode 100644
index 000000000000..7172df01e223
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libee/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, fetchurl, pkg-config, libestr }:
+stdenv.mkDerivation {
+  name = "libee-0.4.1";
+
+  src = fetchurl {
+    url = "http://www.libee.org/download/files/download/libee-0.4.1.tar.gz";
+    sha256 = "09xhgzmsq0g3jsyj24vy67bhzk2fv971w5ixdkhfwgar70cw1nn0";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libestr];
+
+  meta = {
+    homepage = "http://www.libee.org/";
+    description = "An Event Expression Library inspired by CEE";
+    platforms = lib.platforms.unix;
+    license = lib.licenses.lgpl21Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libelf-freebsd/default.nix b/nixpkgs/pkgs/development/libraries/libelf-freebsd/default.nix
new file mode 100644
index 000000000000..d4a8b8f6f219
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libelf-freebsd/default.nix
@@ -0,0 +1,38 @@
+{ lib, fetchsvn, stdenv, gnum4, tet }:
+
+stdenv.mkDerivation (rec {
+  version = "3258";
+  pname = "libelf-freebsd";
+
+  src = fetchsvn {
+    url = "svn://svn.code.sf.net/p/elftoolchain/code/trunk";
+    rev = (lib.strings.toInt version);
+    name = "elftoolchain-${version}";
+    sha256 = "1rcmddjanlsik0b055x8k914r9rxs8yjsvslia2nh1bhzf1lxmqz";
+  };
+
+  buildInputs = [ gnum4 tet ];
+
+  buildPhase = ''
+    PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/bin:$PATH # use BSD install(1) instead of coreutils and make(1) instead of GNU Make
+    cp -vr ${tet} test/tet/tet3.8
+    chmod -R a+w test/tet/tet3.8
+    make libelf
+  '';
+
+  installPhase = ''
+    cp -vr libelf $out
+    cp -vr common/. $out/
+  '';
+
+  meta = {
+    description = "Essential compilation tools and libraries for building and analyzing ELF based program images";
+
+    homepage = "https://sourceforge.net/p/elftoolchain/wiki/Home/";
+
+    license = lib.licenses.bsd2;
+
+    platforms = lib.platforms.freebsd;
+    maintainers = [ ];
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/libelf/default.nix b/nixpkgs/pkgs/development/libraries/libelf/default.nix
new file mode 100644
index 000000000000..47cd849f92c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libelf/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv
+, fetchurl, autoreconfHook, gettext, netbsd
+}:
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+stdenv.mkDerivation rec {
+  pname = "libelf";
+  version = "0.8.13";
+
+  src = fetchurl {
+    url = "https://fossies.org/linux/misc/old/${pname}-${version}.tar.gz";
+    sha256 = "0vf7s9dwk2xkmhb79aigqm0x0yfbw1j0b9ksm51207qwr179n6jr";
+  };
+
+  patches = [
+    ./dont-hardcode-ar.patch
+    # Fix warnings from preprocessor instructions.
+    # https://github.com/NixOS/nixpkgs/issues/59929
+    ./preprocessor-warnings.patch
+  ];
+
+  doCheck = true;
+
+  configureFlags = []
+       # Configure check for dynamic lib support is broken, see
+       # http://lists.uclibc.org/pipermail/uclibc-cvs/2005-August/019383.html
+    ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "mr_cv_target_elf=yes"
+       # Libelf's custom NLS macros fail to determine the catalog file extension
+       # on Darwin, so disable NLS for now.
+    ++ lib.optional stdenv.hostPlatform.isDarwin "--disable-nls";
+
+  nativeBuildInputs =
+    if stdenv.hostPlatform.isNetBSD then [ netbsd.gencat ] else [ gettext ]
+       # Need to regenerate configure script with newer version in order to pass
+       # "mr_cv_target_elf=yes", but `autoreconfHook` brings in `makeWrapper`
+       # which doesn't work with the bootstrapTools bash, so can only do this
+       # for cross builds when `stdenv.shell` is a newer bash.
+    ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) autoreconfHook;
+
+  meta = {
+    description = "ELF object file access library";
+
+    homepage = "https://github.com/Distrotech/libelf";
+
+    license = lib.licenses.lgpl2Plus;
+
+    platforms = lib.platforms.all;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libelf/dont-hardcode-ar.patch b/nixpkgs/pkgs/development/libraries/libelf/dont-hardcode-ar.patch
new file mode 100644
index 000000000000..e282d9005dbb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libelf/dont-hardcode-ar.patch
@@ -0,0 +1,11 @@
+--- a/lib/Makefile.in
++++ b/lib/Makefile.in
+@@ -27,7 +27,7 @@ installdirs = $(libdir) $(includedir) $(includedir)/libelf
+ 
+ CC = @CC@
+ LD = @LD@
+-AR = ar
++AR ?= ar
+ MV = mv -f
+ RM = rm -f
+ LN_S = @LN_S@
diff --git a/nixpkgs/pkgs/development/libraries/libelf/preprocessor-warnings.patch b/nixpkgs/pkgs/development/libraries/libelf/preprocessor-warnings.patch
new file mode 100644
index 000000000000..e04c8ee202a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libelf/preprocessor-warnings.patch
@@ -0,0 +1,264 @@
+diff --git a/lib/elf_repl.h b/lib/elf_repl.h
+index c5cf90f..7e1e8df 100644
+--- a/lib/elf_repl.h
++++ b/lib/elf_repl.h
+@@ -45,7 +45,7 @@ typedef __libelf_u32_t		Elf32_Word;
+ #define ELF32_FSZ_SWORD		4
+ #define ELF32_FSZ_WORD		4
+ 
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ 
+ typedef __libelf_u64_t		Elf64_Addr;
+ typedef __libelf_u16_t		Elf64_Half;
+@@ -93,7 +93,7 @@ typedef struct {
+     Elf32_Half		e_shstrndx;
+ } Elf32_Ehdr;
+ 
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ typedef struct {
+     unsigned char	e_ident[EI_NIDENT];
+     Elf64_Half		e_type;
+@@ -307,7 +307,7 @@ typedef struct {
+     Elf32_Word		sh_entsize;
+ } Elf32_Shdr;
+ 
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ typedef struct {
+     Elf64_Word		sh_name;
+     Elf64_Word		sh_type;
+@@ -434,7 +434,7 @@ typedef struct {
+     Elf32_Half		st_shndx;
+ } Elf32_Sym;
+ 
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ typedef struct {
+     Elf64_Word		st_name;
+     unsigned char	st_info;
+@@ -457,7 +457,7 @@ typedef struct {
+ #define ELF32_ST_TYPE(i)	((i)&0xf)
+ #define ELF32_ST_INFO(b,t)	(((b)<<4)+((t)&0xf))
+ 
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ #define ELF64_ST_BIND(i)	((i)>>4)
+ #define ELF64_ST_TYPE(i)	((i)&0xf)
+ #define ELF64_ST_INFO(b,t)	(((b)<<4)+((t)&0xf))
+@@ -495,7 +495,7 @@ typedef struct {
+  * Macros for manipulating st_other
+  */
+ #define ELF32_ST_VISIBILITY(o)	((o)&0x3)
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ #define ELF64_ST_VISIBILITY(o)	((o)&0x3)
+ #endif /* __LIBELF64 */
+ 
+@@ -521,7 +521,7 @@ typedef struct {
+     Elf32_Sword		r_addend;
+ } Elf32_Rela;
+ 
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ typedef struct {
+     Elf64_Addr		r_offset;
+     Elf64_Xword		r_info;
+@@ -541,7 +541,7 @@ typedef struct {
+ #define ELF32_R_TYPE(i)		((unsigned char)(i))
+ #define ELF32_R_INFO(s,t)	(((s)<<8)+(unsigned char)(t))
+ 
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ #define ELF64_R_SYM(i)		((Elf64_Xword)(i)>>32)
+ #define ELF64_R_TYPE(i)		((i)&0xffffffffL)
+ #define ELF64_R_INFO(s,t)	(((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
+@@ -556,7 +556,7 @@ typedef struct {
+     Elf32_Word		n_type;		/* descriptor type */
+ } Elf32_Nhdr;
+ 
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ /* Solaris and GNU use this layout.  Be compatible. */
+ /* XXX: Latest ELF specs say it's 64-bit!!! */
+ typedef struct {
+@@ -587,7 +587,7 @@ typedef struct {
+     Elf32_Word		p_align;
+ } Elf32_Phdr;
+ 
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ typedef struct {
+     Elf64_Word		p_type;
+     Elf64_Word		p_flags;
+@@ -654,7 +654,7 @@ typedef struct {
+     } d_un;
+ } Elf32_Dyn;
+ 
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ typedef struct {
+     Elf64_Sxword	d_tag;
+     union {
+@@ -798,7 +798,7 @@ typedef struct {
+     Elf32_Half		si_flags;
+ } Elf32_Syminfo;
+ 
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ typedef struct {
+     Elf64_Half		si_boundto;
+     Elf64_Half		si_flags;
+@@ -863,7 +863,7 @@ typedef struct {
+ 
+ typedef Elf32_Half	Elf32_Versym;
+ 
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ 
+ typedef struct {
+     Elf64_Half		vd_version;
+@@ -933,7 +933,7 @@ typedef Elf64_Half	Elf64_Versym;
+ /*
+  * Move section
+  */
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ 
+ typedef struct {
+     Elf32_Lword		m_value;
+@@ -973,7 +973,7 @@ typedef struct {
+     } c_un;
+ } Elf32_Cap;
+ 
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ 
+ typedef struct {
+     Elf64_Xword     	c_tag;
+diff --git a/lib/gelf.h b/lib/gelf.h
+index 5af0558..98a759c 100644
+--- a/lib/gelf.h
++++ b/lib/gelf.h
+@@ -22,15 +22,15 @@
+ #ifndef _GELF_H
+ #define _GELF_H
+ 
+-#if __LIBELF_INTERNAL__
++#if defined(__LIBELF_INTERNAL__)
+ #include <libelf.h>
+ #else /* __LIBELF_INTERNAL__ */
+ #include <libelf/libelf.h>
+ #endif /* __LIBELF_INTERNAL__ */
+ 
+-#if __LIBELF_NEED_LINK_H
++#if defined(__LIBELF_NEED_LINK_H)
+ #include <link.h>
+-#elif __LIBELF_NEED_SYS_LINK_H
++#elif defined(__LIBELF_NEED_SYS_LINK_H)
+ #include <sys/link.h>
+ #endif /* __LIBELF_NEED_LINK_H */
+ 
+@@ -46,7 +46,7 @@ extern "C" {
+ # endif /* __STDC__ || defined(__cplusplus) */
+ #endif /* __P */
+ 
+-#if !__LIBELF64
++#if !defined(__LIBELF64)
+ 
+ #error "GElf is not supported on this system."
+ 
+@@ -71,7 +71,7 @@ typedef Elf64_Sym	GElf_Sym;
+ /*
+  * Symbol versioning
+  */
+-#if __LIBELF_SYMBOL_VERSIONS
++#if defined(__LIBELF_SYMBOL_VERSIONS)
+ typedef Elf64_Verdef	GElf_Verdef;
+ typedef Elf64_Verneed	GElf_Verneed;
+ typedef Elf64_Verdaux	GElf_Verdaux;
+diff --git a/lib/libelf.h b/lib/libelf.h
+index 3ebd0f3..788482d 100644
+--- a/lib/libelf.h
++++ b/lib/libelf.h
+@@ -25,7 +25,7 @@
+ #include <stddef.h>	/* for size_t */
+ #include <sys/types.h>
+ 
+-#if __LIBELF_INTERNAL__
++#if defined(__LIBELF_INTERNAL__)
+ #include <sys_elf.h>
+ #else /* __LIBELF_INTERNAL__ */
+ #include <libelf/sys_elf.h>
+@@ -224,7 +224,7 @@ extern Elf_Data *elf32_xlatetom __P((Elf_Data *__dst, const Elf_Data *__src,
+  */
+ extern long elf32_checksum __P((Elf *__elf));
+ 
+-#if __LIBELF64
++#if defined(__LIBELF64)
+ /*
+  * 64-bit ELF functions
+  * Not available on all platforms
+diff --git a/lib/sys_elf.h.in b/lib/sys_elf.h.in
+index b71a20d..722051b 100644
+--- a/lib/sys_elf.h.in
++++ b/lib/sys_elf.h.in
+@@ -68,7 +68,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ #ifdef __LIBELF_HEADER_ELF_H
+ # include __LIBELF_HEADER_ELF_H
+ #else /* __LIBELF_HEADER_ELF_H */
+-# if __LIBELF_INTERNAL__
++# if defined(__LIBELF_INTERNAL__)
+ #  include <elf_repl.h>
+ # else /* __LIBELF_INTERNAL__ */
+ #  include <libelf/elf_repl.h>
+@@ -92,7 +92,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ #  define STN_UNDEF	0
+ # endif /* STN_UNDEF */
+ 
+-# if __LIBELF64
++# if defined(__LIBELF64)
+ 
+ #  ifndef ELF64_FSZ_ADDR
+ #   define ELF64_FSZ_ADDR	8
+@@ -116,7 +116,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
+ #   define ELF64_R_INFO(s,t)	(((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))
+ #  endif /* ELF64_R_SYM */
+ 
+-#  if __LIBELF64_LINUX
++#  if defined(__LIBELF64_LINUX)
+ typedef __libelf_u64_t	Elf64_Addr;
+ typedef __libelf_u16_t	Elf64_Half;
+ typedef __libelf_u64_t	Elf64_Off;
+diff --git a/lib/sys_elf.h.w32 b/lib/sys_elf.h.w32
+index 0f93c55..7360104 100644
+--- a/lib/sys_elf.h.w32
++++ b/lib/sys_elf.h.w32
+@@ -68,7 +68,7 @@
+ #ifdef __LIBELF_HEADER_ELF_H

+ # include __LIBELF_HEADER_ELF_H

+ #else /* __LIBELF_HEADER_ELF_H */

+-# if __LIBELF_INTERNAL__

++# if defined(__LIBELF_INTERNAL__)

+ #  include <elf_repl.h>

+ # else /* __LIBELF_INTERNAL__ */

+ #  include <libelf/elf_repl.h>

+@@ -92,7 +92,7 @@
+ #  define STN_UNDEF	0

+ # endif /* STN_UNDEF */

+ 

+-# if __LIBELF64

++# if defined(__LIBELF64)

+ 

+ #  ifndef ELF64_FSZ_ADDR

+ #   define ELF64_FSZ_ADDR	8

+@@ -116,7 +116,7 @@
+ #   define ELF64_R_INFO(s,t)	(((Elf64_Xword)(s)<<32)+((t)&0xffffffffL))

+ #  endif /* ELF64_R_SYM */

+ 

+-#  if __LIBELF64_LINUX

++#  if defined(__LIBELF64_LINUX)

+ typedef __libelf_u64_t	Elf64_Addr;

+ typedef __libelf_u16_t	Elf64_Half;

+ typedef __libelf_u64_t	Elf64_Off;

diff --git a/nixpkgs/pkgs/development/libraries/libelfin/0001-Don-t-detect-package-version-with-Git.patch b/nixpkgs/pkgs/development/libraries/libelfin/0001-Don-t-detect-package-version-with-Git.patch
new file mode 100644
index 000000000000..e4b4e592b7a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libelfin/0001-Don-t-detect-package-version-with-Git.patch
@@ -0,0 +1,72 @@
+From 77a34d31695e02bc3d06b68c7ca3ff9c3cb67844 Mon Sep 17 00:00:00 2001
+From: Maximilian Bosch <maximilian@mbosch.me>
+Date: Sun, 26 May 2019 19:46:27 +0200
+Subject: [PATCH] Don't detect package version with Git
+
+This will build in a Nix-based build environment. Instead we ismply
+replace `@version@` using `substituteAll`.
+---
+ dwarf/Makefile | 19 +++++++++----------
+ elf/Makefile   | 15 +++++++--------
+ 2 files changed, 16 insertions(+), 18 deletions(-)
+
+diff --git a/dwarf/Makefile b/dwarf/Makefile
+index 71456bd..f871227 100644
+--- a/dwarf/Makefile
++++ b/dwarf/Makefile
+@@ -43,16 +43,15 @@ CLEAN += libdwarf++.so
+ # Create pkg-config for local library and headers. This will be
+ # transformed in to the correct global pkg-config by install.
+ libdwarf++.pc: always
+-	@(VER=$$(git describe --match 'v*' | sed -e s/^v//); \
+-	  echo "libdir=$$PWD"; \
+-	  echo "includedir=$$PWD"; \
+-	  echo ""; \
+-	  echo "Name: libdwarf++"; \
+-	  echo "Description: C++11 DWARF library"; \
+-	  echo "Version: $$VER"; \
+-	  echo "Requires: libelf++ = $$VER"; \
+-	  echo "Libs: -L\$${libdir} -ldwarf++"; \
+-	  echo "Cflags: -I\$${includedir}") > $@
++	@(echo "libdir=$$PWD"; \
++		echo "includedir=$$PWD"; \
++		echo ""; \
++		echo "Name: libdwarf++"; \
++		echo "Description: C++11 DWARF library"; \
++		echo "Version: @version@"; \
++		echo "Requires: libelf++ = @version@"; \
++		echo "Libs: -L\$${libdir} -ldwarf++"; \
++		echo "Cflags: -I\$${includedir}") > $@
+ CLEAN += libdwarf++.pc
+ 
+ .PHONY: always
+diff --git a/elf/Makefile b/elf/Makefile
+index 9c7c224..50630a7 100644
+--- a/elf/Makefile
++++ b/elf/Makefile
+@@ -42,15 +42,14 @@ CLEAN += libelf++.so
+ # Create pkg-config for local library and headers. This will be
+ # transformed in to the correct global pkg-config by install.
+ libelf++.pc: always
+-	@(VER=$$(git describe --match 'v*' | sed -e s/^v//); \
+-	  echo "libdir=$$PWD"; \
++	@(echo "libdir=$$PWD"; \
+ 	  echo "includedir=$$PWD"; \
+-	  echo ""; \
+-	  echo "Name: libelf++"; \
+-	  echo "Description: C++11 ELF library"; \
+-	  echo "Version: $$VER"; \
+-	  echo "Libs: -L\$${libdir} -lelf++"; \
+-	  echo "Cflags: -I\$${includedir}") > $@
++		echo ""; \
++		echo "Name: libelf++"; \
++		echo "Description: C++11 ELF library"; \
++		echo "Version: @version@"; \
++		echo "Libs: -L\$${libdir} -lelf++"; \
++		echo "Cflags: -I\$${includedir}") > $@
+ CLEAN += libelf++.pc
+ 
+ .PHONY: always
+-- 
+2.19.2
+
diff --git a/nixpkgs/pkgs/development/libraries/libelfin/default.nix b/nixpkgs/pkgs/development/libraries/libelfin/default.nix
new file mode 100644
index 000000000000..7d5a928aa2f4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libelfin/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, python3, substituteAll }:
+
+stdenv.mkDerivation rec {
+  pname = "libelfin";
+  version = "unstable-2018-08-25";
+
+  src = fetchFromGitHub {
+    owner = "aclements";
+    repo = pname;
+    rev = "ac45a094fadba77ad840063fb7aab82571546be0";
+    sha256 = "143x680c6hsy51kngs04ypg4ql3lp498llcwj4lh1v0qp5qvjhyz";
+  };
+
+  patches = [
+    (substituteAll {
+      src = ./0001-Don-t-detect-package-version-with-Git.patch;
+      inherit version;
+    })
+  ];
+
+  nativeBuildInputs = [ python3 ];
+
+  makeFlags = [ "PREFIX=${placeholder "out"}" ];
+
+  meta = with lib; {
+    homepage = "https://github.com/aclements/libelfin/";
+    license = licenses.mit;
+    description = "C++11 ELF/DWARF parser";
+    maintainers = with maintainers; [ ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libemf2svg/default.nix b/nixpkgs/pkgs/development/libraries/libemf2svg/default.nix
new file mode 100644
index 000000000000..4bb7caa02615
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libemf2svg/default.nix
@@ -0,0 +1,31 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, fontconfig
+, freetype
+, libpng
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libemf2svg";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "kakwa";
+    repo = pname;
+    rev = version;
+    sha256 = "04g6dp5xadszqjyjl162x26mfhhwinia65hbkl3mv70bs4an9898";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ fontconfig freetype libpng ];
+
+  meta = with lib; {
+    description = "Microsoft EMF to SVG conversion library";
+    homepage = "https://github.com/kakwa/libemf2svg";
+    maintainers = with maintainers; [ erdnaxe ];
+    license = licenses.gpl2Only;
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libepc/default.nix b/nixpkgs/pkgs/development/libraries/libepc/default.nix
new file mode 100644
index 000000000000..9755d0977c85
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libepc/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchurl, pkg-config, intltool, gtk-doc, glib, avahi, gnutls, libuuid, libsoup, gtk3, gnome }:
+
+let
+  avahiWithGtk = avahi.override { gtk3Support = true; };
+in stdenv.mkDerivation rec {
+  pname = "libepc";
+  version = "0.4.6";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1s3svb2slqjsrqfv50c2ymnqcijcxb5gnx6bfibwh9l5ga290n91";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    intltool
+    gtk-doc
+  ];
+  buildInputs = [
+    glib
+    libuuid
+    gtk3
+  ];
+  propagatedBuildInputs = [
+    avahiWithGtk
+    gnutls
+    libsoup
+  ];
+
+  enableParallelBuilding = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "Easy Publish and Consume Library";
+    homepage = "https://wiki.gnome.org/Projects/libepc";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liberfa/default.nix b/nixpkgs/pkgs/development/libraries/liberfa/default.nix
new file mode 100644
index 000000000000..8edc3d7b5a52
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liberfa/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "erfa";
+  version = "2.0.0";
+
+  buildInputs = [ autoreconfHook ];
+
+  src = fetchFromGitHub {
+    owner = "liberfa";
+    repo = "erfa";
+    rev = "v${version}";
+    sha256 = "sha256-xBE8mWwmvlu0v3Up5y6J8jMhToMSACdKeQzPJoG8LWk=";
+  };
+
+  configureFlags = [ "--enable-shared" ];
+
+  meta = with lib; {
+    description = "Essential Routines for Fundamental Astronomy";
+    homepage = "https://github.com/liberfa/erfa";
+    maintainers = with maintainers; [ mir06 ];
+    license = {
+      url = "https://github.com/liberfa/erfa/blob/master/LICENSE";
+      free = true;
+    };
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liberio/default.nix b/nixpkgs/pkgs/development/libraries/liberio/default.nix
new file mode 100644
index 000000000000..743455b836d5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liberio/default.nix
@@ -0,0 +1,38 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, autoreconfHook
+, systemd
+, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "liberio";
+  version = "unstable-2019-12-11";
+
+  src = fetchFromGitHub {
+    owner = "EttusResearch";
+    repo = "liberio";
+    rev = "81777e500d1c3b88d5048d46643fb5553eb5f786";
+    sha256 = "1n40lj5g497mmqh14vahdhy3jwvcry2pkc670p4c9f1pggp6ysgk";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    autoreconfHook
+  ];
+
+  buildInputs = [
+    systemd
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Ettus Research DMA I/O Library";
+    homepage = "https://github.com/EttusResearch/liberio";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.doronbehar ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libesmtp/default.nix b/nixpkgs/pkgs/development/libraries/libesmtp/default.nix
new file mode 100644
index 000000000000..542cff712c82
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libesmtp/default.nix
@@ -0,0 +1,18 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  pname = "libESMTP";
+  version = "1.0.6";
+
+  src = fetchurl {
+    url = "http://brianstafford.info/libesmtp/libesmtp-1.0.6.tar.bz2";
+    sha256 = "02zbniyz7qys1jmx3ghx21kxmns1wc3hmv80gp7ag7yra9f1m9nh";
+  };
+
+  meta = with lib; {
+    homepage = "http://brianstafford.info/libesmtp/index.html";
+    description = "A Library for Posting Electronic Mail";
+    license = licenses.lgpl21;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/libestr/default.nix b/nixpkgs/pkgs/development/libraries/libestr/default.nix
new file mode 100644
index 000000000000..5630047eed7f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libestr/default.nix
@@ -0,0 +1,18 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libestr";
+  version = "0.1.11";
+
+  src = fetchurl {
+    url = "http://libestr.adiscon.com/files/download/${pname}-${version}.tar.gz";
+    sha256 = "0910ifzcs8kpd3srrr4fvbacgh2zrc6yn7i4rwfj6jpzhlkjnqs6";
+  };
+
+  meta = with lib; {
+    homepage = "https://libestr.adiscon.com/";
+    description = "Some essentials for string handling";
+    license = licenses.lgpl21;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libetpan/default.nix b/nixpkgs/pkgs/development/libraries/libetpan/default.nix
new file mode 100644
index 000000000000..572c90b27b47
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libetpan/default.nix
@@ -0,0 +1,51 @@
+{ stdenv, lib, fetchFromGitHub, fetchpatch
+, autoconf, automake, libtool, openssl, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libetpan";
+  version = "1.9.4";
+
+  src = fetchFromGitHub {
+    owner = "dinhviethoa";
+    repo = "libetpan";
+    rev = version;
+    sha256 = "0g7an003simfdn7ihg9yjv7hl2czsmjsndjrp39i7cad8icixscn";
+  };
+
+  patches = [
+    # The following two patches are fixing CVE-2020-15953, as reported in the
+    # issue tracker: https://github.com/dinhvh/libetpan/issues/386
+    # They might be removed for the next version bump.
+
+    # CVE-2020-15953: Detect extra data after STARTTLS response and exit
+    # https://github.com/dinhvh/libetpan/pull/387
+    (fetchpatch {
+      name = "cve-2020-15953-imap.patch";
+      url = "https://github.com/dinhvh/libetpan/commit/1002a0121a8f5a9aee25357769807f2c519fa50b.patch";
+      sha256 = "1h9ds2z4jii40a0i3z6hsnzx1ldmd2jqidsxp2y2ksyp1ijcgabn";
+    })
+
+    # CVE-2020-15953: Detect extra data after STARTTLS responses in SMTP and POP3 and exit
+    # https://github.com/dinhvh/libetpan/pull/388
+    (fetchpatch {
+      name = "cve-2020-15953-pop3-smtp.patch";
+      url = "https://github.com/dinhvh/libetpan/commit/298460a2adaabd2f28f417a0f106cb3b68d27df9.patch";
+      sha256 = "0lq829djar7nb3fai3vdzirmks3w2lfagzqc809lx2lln6y213a0";
+    })
+  ];
+
+  nativeBuildInputs = [ autoconf automake libtool pkg-config ];
+
+  buildInputs = [ openssl ];
+
+  configureScript = "./autogen.sh";
+
+  meta = with lib; {
+    description = "Mail Framework for the C Language";
+    homepage = "http://www.etpan.org/libetpan.html";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ oxzi ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libev/default.nix b/nixpkgs/pkgs/development/libraries/libev/default.nix
new file mode 100644
index 000000000000..750cb3974cf7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libev/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl
+, # Note: -static hasn’t work on darwin
+  static ? with stdenv.hostPlatform; isStatic && !isDarwin
+}:
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+stdenv.mkDerivation rec {
+  pname = "libev";
+  version="4.33";
+
+  src = fetchurl {
+    url = "http://dist.schmorp.de/libev/Attic/${pname}-${version}.tar.gz";
+    sha256 = "1sjs4324is7fp21an4aas2z4dwsvs6z4xwrmp72vwpq1s6wbfzjh";
+  };
+
+  configureFlags = lib.optional (static) "LDFLAGS=-static";
+
+  meta = {
+    description = "A high-performance event loop/event model with lots of features";
+    maintainers = [ lib.maintainers.raskin ];
+    platforms = lib.platforms.all;
+    license = lib.licenses.bsd2; # or GPL2+
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libevdev/default.nix b/nixpkgs/pkgs/development/libraries/libevdev/default.nix
new file mode 100644
index 000000000000..33b3f0b32e1d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libevdev/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, fetchpatch, python3 }:
+
+stdenv.mkDerivation rec {
+  pname = "libevdev";
+  version = "1.11.0";
+
+  src = fetchurl {
+    url = "https://www.freedesktop.org/software/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-Y/TqFImFihCQgOC0C9Q+TgkDoeEuqIjVgduMSVdHwtA=";
+  };
+
+  nativeBuildInputs = [ python3 ];
+
+  meta = with lib; {
+    description = "Wrapper library for evdev devices";
+    homepage = "http://www.freedesktop.org/software/libevdev/doc/latest/index.html";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.amorsillo ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libevdevplus/0001-Add-cmake-install-directives.patch b/nixpkgs/pkgs/development/libraries/libevdevplus/0001-Add-cmake-install-directives.patch
new file mode 100644
index 000000000000..2635d6ab829e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libevdevplus/0001-Add-cmake-install-directives.patch
@@ -0,0 +1,41 @@
+From 7f208aaf21aa468013fc41e67c32f6a6c8c08249 Mon Sep 17 00:00:00 2001
+From: Jappie Klooster <jappieklooster@hotmail.com>
+Date: Fri, 2 Apr 2021 16:01:05 -0400
+Subject: [PATCH] Add cmake install directives
+
+To make nix builds work, it expect a make install command to
+be available.
+Adding these directives seems to fix the build.
+
+If it's no trouble to you, please add them.
+---
+ CMakeLists.txt | 9 ++++++++-
+ 1 file changed, 8 insertions(+), 1 deletion(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index f9db618..425d391 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -4,10 +4,17 @@ project(libevdevPlus)
+ set(SOURCE_FILES
+         evdevPlus.cpp evdevPlus.hpp CommonIncludes.hpp InputEvent.hpp Resource.cpp)
+ 
++include(GNUInstallDirs)
++
+ add_library(evdevPlus ${SOURCE_FILES})
+ target_include_directories(evdevPlus PUBLIC .)
+ 
+ add_executable(evdevPlus_test test.cpp)
+ target_link_libraries(evdevPlus_test evdevPlus)
+ 
+-configure_file(evdevPlus.pc.in evdevPlus.pc @ONLY)
+\ No newline at end of file
++configure_file(evdevPlus.pc.in evdevPlus.pc @ONLY)
++
++install(TARGETS evdevPlus
++        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
++install(FILES evdevPlus.hpp CommonIncludes.hpp InputEvent.hpp
++        DESTINATION include/)
+-- 
+2.29.2
+
diff --git a/nixpkgs/pkgs/development/libraries/libevdevplus/default.nix b/nixpkgs/pkgs/development/libraries/libevdevplus/default.nix
new file mode 100644
index 000000000000..11d644cd90df
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libevdevplus/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "libevdevplus";
+  version = "unstable-2021-04-02";
+
+  # adds missing cmake install directives
+  # https://github.com/YukiWorkshop/libevdevPlus/pull/10
+  patches = [ ./0001-Add-cmake-install-directives.patch];
+
+  src  = fetchFromGitHub {
+    owner  = "YukiWorkshop";
+    repo   = "libevdevPlus";
+    rev    = "b4d4b3143056424a3da9f0516ca02a47209ef757";
+    sha256 = "09y65s16gch0w7fy1s9yjk9gz3bjzxix36h5wmwww6lkj2i1z3rj";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  meta = with 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/libevent/default.nix b/nixpkgs/pkgs/development/libraries/libevent/default.nix
new file mode 100644
index 000000000000..24ded54d8e97
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libevent/default.nix
@@ -0,0 +1,67 @@
+{ lib, stdenv, fetchurl, findutils, fixDarwinDylibNames
+, sslSupport? true, openssl
+}:
+
+assert sslSupport -> openssl != null;
+
+stdenv.mkDerivation rec {
+  pname = "libevent";
+  version = "2.1.12";
+
+  src = fetchurl {
+    url = "https://github.com/libevent/libevent/releases/download/release-${version}-stable/libevent-${version}-stable.tar.gz";
+    sha256 = "1fq30imk8zd26x8066di3kpc5zyfc5z6frr3zll685zcx4dxxrlj";
+  };
+
+  preConfigure = lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") ''
+    MACOSX_DEPLOYMENT_TARGET=10.16
+  '';
+
+  # libevent_openssl is moved into its own output, so that openssl isn't present
+  # in the default closure.
+  outputs = [ "out" "dev" ]
+    ++ lib.optional sslSupport "openssl"
+    ;
+  outputBin = "dev";
+  propagatedBuildOutputs = [ "out" ]
+    ++ lib.optional sslSupport "openssl"
+    ;
+
+  nativeBuildInputs = []
+    ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames
+    ;
+
+  buildInputs = []
+    ++ lib.optional sslSupport openssl
+    ++ lib.optional stdenv.isCygwin findutils
+    ;
+
+  doCheck = false; # needs the net
+
+  postInstall = lib.optionalString sslSupport ''
+    moveToOutput "lib/libevent_openssl*" "$openssl"
+    substituteInPlace "$dev/lib/pkgconfig/libevent_openssl.pc" \
+      --replace "$out" "$openssl"
+    sed "/^libdir=/s|$out|$openssl|" -i "$openssl"/lib/libevent_openssl.la
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Event notification library";
+    longDescription = ''
+      The libevent API provides a mechanism to execute a callback function
+      when a specific event occurs on a file descriptor or after a timeout
+      has been reached.  Furthermore, libevent also support callbacks due
+      to signals or regular timeouts.
+
+      libevent is meant to replace the event loop found in event driven
+      network servers.  An application just needs to call event_dispatch()
+      and then add or remove events dynamically without having to change
+      the event loop.
+    '';
+    homepage = "https://libevent.org/";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libewf/default.nix b/nixpkgs/pkgs/development/libraries/libewf/default.nix
new file mode 100644
index 000000000000..5d86dd12246b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libewf/default.nix
@@ -0,0 +1,22 @@
+{ fetchurl, lib, stdenv, zlib, openssl, libuuid, pkg-config }:
+
+stdenv.mkDerivation rec {
+  version = "20201230";
+  pname = "libewf";
+
+  src = fetchurl {
+    url = "https://github.com/libyal/libewf/releases/download/${version}/libewf-experimental-${version}.tar.gz";
+    sha256 = "sha256-10r4jPzsA30nHQzjdg/VkwTG1PwOskwv8Bra34ZPMgc=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ zlib openssl libuuid ];
+
+  meta = {
+    description = "Library for support of the Expert Witness Compression Format";
+    homepage = "https://sourceforge.net/projects/libewf/";
+    license = lib.licenses.lgpl3;
+    maintainers = [ lib.maintainers.raskin ] ;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libexecinfo/30-linux-makefile.patch b/nixpkgs/pkgs/development/libraries/libexecinfo/30-linux-makefile.patch
new file mode 100644
index 000000000000..134c64441d36
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libexecinfo/30-linux-makefile.patch
@@ -0,0 +1,44 @@
+--- Makefile.orig
++++ Makefile
+@@ -23,24 +23,25 @@
+ # SUCH DAMAGE.
+ #
+ # $Id: Makefile,v 1.3 2004/07/19 05:19:55 sobomax Exp $
++#
++# Linux Makefile by Matt Smith <mcs@darkregion.net>, 2011/01/04
+ 
+-LIB=	execinfo
++CC=cc
++AR=ar
++EXECINFO_CFLAGS=$(CFLAGS) -O2 -pipe -fno-strict-aliasing -std=gnu99 -c
++EXECINFO_LDFLAGS=$(LDFLAGS)
+ 
+-SRCS=	stacktraverse.c stacktraverse.h execinfo.c execinfo.h
++all: static dynamic
+ 
+-INCS=	execinfo.h
++static:
++	$(CC) $(EXECINFO_CFLAGS) $(EXECINFO_LDFLAGS) stacktraverse.c
++	$(CC) $(EXECINFO_CFLAGS) $(EXECINFO_LDFLAGS) execinfo.c
++	$(AR) rcs libexecinfo.a stacktraverse.o execinfo.o
+ 
+-SHLIB_MAJOR=	1
+-SHLIB_MINOR=	0
++dynamic:
++	$(CC) -fpic -DPIC $(EXECINFO_CFLAGS) $(EXECINFO_LDFLAGS) stacktraverse.c -o stacktraverse.So
++	$(CC) -fpic -DPIC $(EXECINFO_CFLAGS) $(EXECINFO_LDFLAGS) execinfo.c -o execinfo.So
++	$(CC) -shared -Wl,-soname,libexecinfo.so.1 -o libexecinfo.so.1 stacktraverse.So execinfo.So
+ 
+-NOPROFILE=	yes
+-
+-DPADD=		${LIBM}
+-LDADD=		-lm
+-
+-#WARNS?=	4
+-
+-#stacktraverse.c: gen.py
+-#	./gen.py > stacktraverse.c
+-
+-.include <bsd.lib.mk>
++clean:
++	rm -rf *.o *.So *.a *.so
diff --git a/nixpkgs/pkgs/development/libraries/libexecinfo/default.nix b/nixpkgs/pkgs/development/libraries/libexecinfo/default.nix
new file mode 100644
index 000000000000..36f956e77724
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libexecinfo/default.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv, fetchurl, fetchpatch
+, enableStatic ? true
+, enableShared ? !stdenv.hostPlatform.isStatic
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libexecinfo";
+  version = "1.1";
+
+  src = fetchurl {
+    url = "http://distcache.freebsd.org/local-distfiles/itetcu/${pname}-${version}.tar.bz2";
+    sha256 = "07wvlpc1jk1sj4k5w53ml6wagh0zm9kv2l1jngv8xb7xww9ik8n9";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "10-execinfo.patch";
+      url = "https://git.alpinelinux.org/aports/plain/main/libexecinfo/10-execinfo.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1";
+      sha256 = "0lnphrad4vspyljnvmm62dyxj98vgp3wabj4w3vfzfph7j8piw7g";
+    })
+    (fetchpatch {
+      name = "20-define-gnu-source.patch";
+      url = "https://git.alpinelinux.org/aports/plain/main/libexecinfo/20-define-gnu-source.patch?id=730cdcef6901750f4029d4c3b8639ce02ee3ead1";
+      sha256 = "1mp8mc639b0h2s69m5z6s2h3q3n1zl298j9j0plzj7f979j76302";
+    })
+    ./30-linux-makefile.patch
+  ];
+
+  makeFlags = [ "CC:=$(CC)" "AR:=$(AR)" ];
+  hardeningEnable = [ "stackprotector" ];
+
+  buildFlags =
+      lib.optional enableStatic "static"
+   ++ lib.optional enableShared "dynamic";
+
+  patchFlags = [ "-p0" ];
+
+  installPhase = ''
+    install -Dm644 execinfo.h stacktraverse.h -t $out/include
+  '' + lib.optionalString enableShared ''
+    install -Dm755 libexecinfo.so.1 -t $out/lib
+    ln -s $out/lib/libexecinfo.so{.1,}
+  '' + lib.optionalString enableStatic ''
+    install -Dm755 libexecinfo.a -t $out/lib
+  '';
+
+  meta = with lib; {
+    description = "Quick-n-dirty BSD licensed clone of the GNU libc backtrace facility";
+    license = licenses.bsd2;
+    homepage = "https://www.freshports.org/devel/libexecinfo";
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libexif/default.nix b/nixpkgs/pkgs/development/libraries/libexif/default.nix
new file mode 100644
index 000000000000..20e69c4ad664
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libexif/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, gettext }:
+
+stdenv.mkDerivation rec {
+  pname = "libexif";
+  version = "0.6.22";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "${pname}-${builtins.replaceStrings ["."] ["_"] version}-release";
+    sha256 = "0mzndakdi816zcs13z7yzp7hj031p2dcyfq2p391r63d9z21jmy1";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "CVE-2020-0198.patch";
+      url = "https://github.com/libexif/libexif/commit/ce03ad7ef4e8aeefce79192bf5b6f69fae396f0c.patch";
+      sha256 = "1040278g5dbq3vvlyk8cmzb7flpi9bfsp99268hw69i6ilwbdf2k";
+    })
+    (fetchpatch {
+      name = "CVE-2020-0452.patch";
+      url = "https://github.com/libexif/libexif/commit/9266d14b5ca4e29b970fa03272318e5f99386e06.patch";
+      excludes = [ "NEWS" ];
+      sha256 = "0k4z1gbbkli6wwyy9qm2qvn0h00qda6wqym61nmmbys7yc2zryj6";
+    })
+  ];
+
+  nativeBuildInputs = [ autoreconfHook gettext ];
+
+  meta = with lib; {
+    homepage = "https://libexif.github.io/";
+    description = "A library to read and manipulate EXIF data in digital photographs";
+    license = licenses.lgpl21;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ erictapen ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/libexsid/default.nix b/nixpkgs/pkgs/development/libraries/libexsid/default.nix
new file mode 100644
index 000000000000..38cdfc84d4e4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libexsid/default.nix
@@ -0,0 +1,47 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, autoreconfHook
+, pkg-config
+, docSupport ? true
+, doxygen
+, libftdi1
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libexsid";
+  version = "2.1";
+
+  src = fetchFromGitHub {
+    owner = "libsidplayfp";
+    repo = "exsid-driver";
+    rev = version;
+    sha256 = "1qbiri549fma8c72nmj3cpz3sn1vc256kfafnygkmkzg7wdmgi7r";
+  };
+
+  outputs = [ "out" ]
+    ++ lib.optional docSupport "doc";
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ]
+    ++ lib.optional docSupport doxygen;
+
+  buildInputs = [ libftdi1 ];
+
+  enableParallelBuilding = true;
+
+  installTargets = [ "install" ]
+    ++ lib.optional docSupport "doc";
+
+  postInstall = lib.optionalString docSupport ''
+    mkdir -p $doc/share/libexsid/doc
+    cp -r docs/html $doc/share/libexsid/doc/
+  '';
+
+  meta = with lib; {
+    description = "Driver for exSID USB";
+    homepage = "http://hacks.slashdirt.org/hw/exsid/";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ OPNA2608 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libextractor/default.nix b/nixpkgs/pkgs/development/libraries/libextractor/default.nix
new file mode 100644
index 000000000000..cef1fbc512ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libextractor/default.nix
@@ -0,0 +1,99 @@
+{ fetchurl, lib, stdenv, substituteAll
+, libtool, gettext, zlib, bzip2, flac, libvorbis
+, exiv2, libgsf, rpm, pkg-config
+, gstreamerSupport ? true, gst_all_1 ? null
+# ^ Needed e.g. for proper id3 and FLAC support.
+#   Set to `false` to decrease package closure size by about 87 MB (53%).
+, gstPlugins ? (gst: [ gst.gst-plugins-base gst.gst-plugins-good ])
+# If an application needs additional gstreamer plugins it can also make them
+# available by adding them to the environment variable
+# GST_PLUGIN_SYSTEM_PATH_1_0, e.g. like this:
+# postInstall = ''
+#   wrapProgram $out/bin/extract --prefix GST_PLUGIN_SYSTEM_PATH_1_0 : "$GST_PLUGIN_SYSTEM_PATH_1_0"
+# '';
+# See also <https://nixos.org/nixpkgs/manual/#sec-language-gnome>.
+, gtkSupport ? true, glib ? null, gtk3 ? null
+, videoSupport ? true, ffmpeg ? null, libmpeg2 ? null}:
+
+assert gstreamerSupport -> gst_all_1 != null && builtins.isList (gstPlugins gst_all_1);
+assert gtkSupport -> glib != null && gtk3 != null;
+assert videoSupport -> ffmpeg != null && libmpeg2 != null;
+
+stdenv.mkDerivation rec {
+  pname = "libextractor";
+  version = "1.11";
+
+  src = fetchurl {
+    url = "mirror://gnu/libextractor/${pname}-${version}.tar.gz";
+    sha256 = "sha256-FvYzq4dGo4VHxKHaP0WRGSsIJa2DxDNvBXW4WEPYvY8=";
+  };
+
+  patches = lib.optionals gstreamerSupport [
+
+    # Libraries cannot be wrapped so we need to hardcode the plug-in paths.
+    (substituteAll {
+      src = ./gst-hardcode-plugins.patch;
+      load_gst_plugins = lib.concatMapStrings
+        (plugin: ''gst_registry_scan_path(gst_registry_get(), "${plugin}/lib/gstreamer-1.0");'')
+        (gstPlugins gst_all_1);
+    })
+  ];
+
+  preConfigure =
+    '' echo "patching installation directory in \`extractor.c'..."
+       sed -i "src/main/extractor.c" \
+           -e "s|pexe[[:blank:]]*=.*$|pexe = strdup(\"$out/lib/\");|g"
+    '';
+
+  buildInputs =
+   [ libtool gettext zlib bzip2 flac libvorbis exiv2
+     libgsf rpm
+     pkg-config
+   ] ++ lib.optionals gstreamerSupport
+          ([ gst_all_1.gstreamer ] ++ gstPlugins gst_all_1)
+     ++ lib.optionals gtkSupport [ glib gtk3 ]
+     ++ lib.optionals videoSupport [ ffmpeg libmpeg2 ];
+
+  configureFlags = [
+    "--disable-ltdl-install"
+    "--with-ltdl-include=${libtool}/include"
+    "--with-ltdl-lib=${libtool.lib}/lib"
+    "--enable-xpdf"
+  ];
+
+  # Checks need to be run after "make install", otherwise plug-ins are not in
+  # the search path, etc.
+  doCheck = false;
+  doInstallCheck = true;
+  installCheckPhase = "make check";
+
+  meta = with lib; {
+    description = "Simple library for keyword extraction";
+
+    longDescription =
+      '' GNU libextractor is a library used to extract meta-data from files
+         of arbitrary type.  It is designed to use helper-libraries to perform
+         the actual extraction, and to be trivially extendable by linking
+         against external extractors for additional file types.
+
+         The goal is to provide developers of file-sharing networks or
+         WWW-indexing bots with a universal library to obtain simple keywords
+         to match against queries.  libextractor contains a shell-command
+         extract that, similar to the well-known file command, can extract
+         meta-data from a file an print the results to stdout.
+
+         Currently, libextractor supports the following formats: HTML, PDF,
+         PS, OLE2 (DOC, XLS, PPT), OpenOffice (sxw), StarOffice (sdw), DVI,
+         MAN, FLAC, MP3 (ID3v1 and ID3v2), NSF(E) (NES music), SID (C64
+         music), OGG, WAV, EXIV2, JPEG, GIF, PNG, TIFF, DEB, RPM, TAR(.GZ),
+         ZIP, ELF, S3M (Scream Tracker 3), XM (eXtended Module), IT (Impulse
+         Tracker), FLV, REAL, RIFF (AVI), MPEG, QT and ASF.  Also, various
+         additional MIME types are detected.
+      '';
+
+    license = licenses.gpl3Plus;
+
+    maintainers = [ maintainers.jorsn ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libextractor/gst-hardcode-plugins.patch b/nixpkgs/pkgs/development/libraries/libextractor/gst-hardcode-plugins.patch
new file mode 100644
index 000000000000..73ecf5f252f6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libextractor/gst-hardcode-plugins.patch
@@ -0,0 +1,11 @@
+--- a/src/plugins/gstreamer_extractor.c
++++ b/src/plugins/gstreamer_extractor.c
+@@ -2215,6 +2215,7 @@ void __attribute__ ((constructor))
+ gstreamer_init ()
+ {
+   gst_init (NULL, NULL);
++  @load_gst_plugins@
+   g_log_set_default_handler (&log_handler, NULL);
+   g_log_set_handler (NULL, G_LOG_LEVEL_MASK | G_LOG_FLAG_FATAL | G_LOG_FLAG_RECURSION,
+                     &log_handler, NULL);
+
diff --git a/nixpkgs/pkgs/development/libraries/libexttextcat/default.nix b/nixpkgs/pkgs/development/libraries/libexttextcat/default.nix
new file mode 100644
index 000000000000..8efdb1bee02d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libexttextcat/default.nix
@@ -0,0 +1,18 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libexttextcat";
+  version = "3.4.5";
+
+  src = fetchurl {
+    url = "https://dev-www.libreoffice.org/src/libexttextcat/${pname}-${version}.tar.xz";
+    sha256 = "1j6sjwkyhqvsgyw938bxxfwkzzi1mahk66g5342lv6j89jfvrz8k";
+  };
+
+  meta = with lib; {
+    description = "An N-Gram-Based Text Categorization library primarily intended for language guessing";
+    homepage = "https://wiki.documentfoundation.org/Libexttextcat";
+    platforms = platforms.all;
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libf2c/default.nix b/nixpkgs/pkgs/development/libraries/libf2c/default.nix
new file mode 100644
index 000000000000..5a5d8b93057a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libf2c/default.nix
@@ -0,0 +1,36 @@
+{lib, stdenv, fetchurl, unzip}:
+
+stdenv.mkDerivation rec {
+  pname = "libf2c";
+  version = "20160102";
+
+  src = fetchurl {
+    url = "http://www.netlib.org/f2c/libf2c.zip";
+    sha256 = "1q78y8j8xpl8zdzdxmn5ablss56hi5a7vz3idam9l2nfx5q40h6a";
+  };
+
+  unpackPhase = ''
+    mkdir build
+    cd build
+    unzip ${src}
+  '';
+
+  makeFlags = [ "-f" "makefile.u" ];
+
+  installPhase = ''
+    mkdir -p $out/include $out/lib
+    cp libf2c.a $out/lib
+    cp f2c.h $out/include
+  '';
+
+  nativeBuildInputs = [ unzip ];
+
+  hardeningDisable = [ "format" ];
+
+  meta = {
+    description = "F2c converts Fortran 77 source code to C";
+    homepage = "http://www.netlib.org/f2c/";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libfakekey/default.nix b/nixpkgs/pkgs/development/libraries/libfakekey/default.nix
new file mode 100644
index 000000000000..3e568759c1bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfakekey/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, libX11, libXi, libXtst, pkg-config, xorgproto }:
+
+stdenv.mkDerivation rec {
+  pname = "libfakekey";
+  version = "0.1";
+
+  src = fetchurl {
+    url = "https://downloads.yoctoproject.org/releases/matchbox/libfakekey/0.1/${pname}-${version}.tar.gz";
+    sha256 = "10msplyn535hmzbmbdnx4zc20hkaw6d81if5lzxs82k8sq2mkx9k";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libX11 libXi libXtst xorgproto ];
+  NIX_LDFLAGS = "-lX11";
+
+  meta = with lib; {
+    description = "X virtual keyboard library";
+    homepage = "https://www.yoctoproject.org/tools-resources/projects/matchbox";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libfaketime/0001-Remove-unsupported-clang-flags.patch b/nixpkgs/pkgs/development/libraries/libfaketime/0001-Remove-unsupported-clang-flags.patch
new file mode 100644
index 000000000000..7dfad4978005
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfaketime/0001-Remove-unsupported-clang-flags.patch
@@ -0,0 +1,13 @@
+diff --git a/src/Makefile b/src/Makefile
+index 2af4804..bcff809 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -80,7 +80,7 @@ PREFIX ?= /usr/local
+ LIBDIRNAME ?= /lib/faketime
+ PLATFORM ?=$(shell uname)
+ 
+-CFLAGS += -std=gnu99 -Wall -Wextra -Werror -Wno-nonnull-compare -DFAKE_PTHREAD -DFAKE_STAT -DFAKE_UTIME -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS -fPIC -DPREFIX='"'$(PREFIX)'"' -DLIBDIRNAME='"'$(LIBDIRNAME)'"' $(FAKETIME_COMPILE_CFLAGS)
++CFLAGS += -std=gnu99 -Wall -Wextra -DFAKE_PTHREAD -DFAKE_STAT -DFAKE_UTIME -DFAKE_SLEEP -DFAKE_TIMERS -DFAKE_INTERNAL_CALLS -fPIC -DPREFIX='"'$(PREFIX)'"' -DLIBDIRNAME='"'$(LIBDIRNAME)'"' $(FAKETIME_COMPILE_CFLAGS)
+ ifeq ($(PLATFORM),SunOS)
+ CFLAGS += -D__EXTENSIONS__ -D_XOPEN_SOURCE=600
+ endif
diff --git a/nixpkgs/pkgs/development/libraries/libfaketime/default.nix b/nixpkgs/pkgs/development/libraries/libfaketime/default.nix
new file mode 100644
index 000000000000..34c957715dde
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfaketime/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchurl, perl, coreutils }:
+
+stdenv.mkDerivation rec {
+  pname = "libfaketime";
+  version = "0.9.9";
+
+  src = fetchurl {
+    url = "https://github.com/wolfcw/libfaketime/archive/v${version}.tar.gz";
+    sha256 = "sha256-V9AYEVA2HAqbXI7vBbETkvYTStosLZmOkuY9rtY5ZHw=";
+  };
+
+  patches = [
+    ./no-date-in-gzip-man-page.patch
+    ./nix-store-date.patch
+  ] ++ (lib.optionals stdenv.cc.isClang [
+    # https://github.com/wolfcw/libfaketime/issues/277
+    ./0001-Remove-unsupported-clang-flags.patch
+  ]);
+
+  postPatch = ''
+    patchShebangs test src
+    for a in test/functests/test_exclude_mono.sh src/faketime.c ; do
+      substituteInPlace $a \
+        --replace /bin/bash ${stdenv.shell}
+    done
+    substituteInPlace src/faketime.c --replace @DATE_CMD@ ${coreutils}/bin/date
+  '';
+
+  PREFIX = placeholder "out";
+  LIBDIRNAME = "/lib";
+
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=cast-function-type -Wno-error=format-truncation";
+
+  checkInputs = [ perl ];
+
+  meta = with lib; {
+    description = "Report faked system time to programs without having to change the system-wide time";
+    homepage = "https://github.com/wolfcw/libfaketime/";
+    license = licenses.gpl2;
+    platforms = platforms.all;
+    maintainers = [ maintainers.bjornfor ];
+    mainProgram = "faketime";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libfaketime/nix-store-date.patch b/nixpkgs/pkgs/development/libraries/libfaketime/nix-store-date.patch
new file mode 100644
index 000000000000..b88245dfe8fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfaketime/nix-store-date.patch
@@ -0,0 +1,29 @@
+From abd7dd05b440e3dc9621a1579e4afb0267897d9c Mon Sep 17 00:00:00 2001
+From: Finn Behrens <me@kloenk.de>
+Date: Fri, 5 Mar 2021 21:58:57 +0100
+Subject: [PATCH] use nix date path
+
+---
+ src/faketime.c | 6 +-----
+ 1 file changed, 1 insertion(+), 5 deletions(-)
+
+diff --git a/src/faketime.c b/src/faketime.c
+index af618f2..48e47da 100644
+--- a/src/faketime.c
++++ b/src/faketime.c
+@@ -50,11 +50,7 @@
+ 
+ const char version[] = "0.9.9";
+ 
+-#ifdef __APPLE__
+-static const char *date_cmd = "gdate";
+-#else
+-static const char *date_cmd = "date";
+-#endif
++static const char *date_cmd = "@DATE_CMD@";
+ 
+ #define PATH_BUFSIZE 4096
+ 
+-- 
+2.24.3 (Apple Git-128)
+
diff --git a/nixpkgs/pkgs/development/libraries/libfaketime/no-date-in-gzip-man-page.patch b/nixpkgs/pkgs/development/libraries/libfaketime/no-date-in-gzip-man-page.patch
new file mode 100644
index 000000000000..7b7e362fbf0f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfaketime/no-date-in-gzip-man-page.patch
@@ -0,0 +1,12 @@
+diff -ur libfaketime-0.9.5.orig/man/Makefile libfaketime-0.9.5/man/Makefile
+--- libfaketime-0.9.5.orig/man/Makefile	2013-10-13 11:19:30.000000000 +0200
++++ libfaketime-0.9.5/man/Makefile	2014-04-13 01:22:14.362296519 +0200
+@@ -6,7 +6,7 @@
+ 
+ install:
+ 	$(INSTALL) -Dm0644 faketime.1 "${DESTDIR}${PREFIX}/share/man/man1/faketime.1"
+-	gzip -f "${DESTDIR}${PREFIX}/share/man/man1/faketime.1"
++	gzip -9nf "${DESTDIR}${PREFIX}/share/man/man1/faketime.1"
+ 
+ uninstall:
+ 	rm -f "${DESTDIR}${PREFIX}/share/man/man1/faketime.1.gz"
diff --git a/nixpkgs/pkgs/development/libraries/libfann/default.nix b/nixpkgs/pkgs/development/libraries/libfann/default.nix
new file mode 100644
index 000000000000..590755c3a0fa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfann/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, lib, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "libfann";
+  version = "2.2.0";
+
+  src = fetchFromGitHub {
+    owner = "libfann";
+    repo = "fann";
+    rev = version;
+    sha256 = "0awbs0vjsrdglqiaybb0ln13ciizmyrw9ahllahvgbq4nr0nvf6y";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  outputs = [ "out" "dev" ];
+
+  meta = {
+    homepage = "http://leenissen.dk/fann/wp/";
+    description = "Fast Artificial Neural Network Library";
+    maintainers = with lib.maintainers; [ fpletz ];
+    license = lib.licenses.lgpl21;
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libff/default.nix b/nixpkgs/pkgs/development/libraries/libff/default.nix
new file mode 100644
index 000000000000..72d2406aa82b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libff/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, cmake, boost, gmp, openssl, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "libff";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "scipr-lab";
+    repo = "libff";
+    rev = "v${version}";
+    sha256 = "0dczi829497vqlmn6n4fgi89bc2h9f13gx30av5z2h6ikik7crgn";
+    fetchSubmodules = true;
+  };
+
+  cmakeFlags = [ "-DWITH_PROCPS=Off" ];
+
+  # CMake is hardcoded to always build static library which causes linker
+  # failure for Haskell applications depending on haskellPackages.hevm on macOS.
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace libff/CMakeLists.txt --replace "STATIC" "SHARED"
+  '';
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ boost gmp openssl ];
+
+  meta = with lib; {
+    description = "C++ library for Finite Fields and Elliptic Curves";
+    changelog = "https://github.com/scipr-lab/libff/blob/develop/CHANGELOG.md";
+    homepage = "https://github.com/scipr-lab/libff";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ arturcygan ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libffcall/default.nix b/nixpkgs/pkgs/development/libraries/libffcall/default.nix
new file mode 100644
index 000000000000..30e5aa0cfa91
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libffcall/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libffcall";
+  version = "2.2";
+
+  src = fetchurl {
+    url = "mirror://gnu/libffcall/libffcall-${version}.tar.gz";
+    sha256 = "sha256-6/o3+XtslPrCTs8xk/n8gpUXz4Gu6awtGRr5k9c8t0c=";
+  };
+
+  enableParallelBuilding = false;
+
+  outputs = [ "dev" "out" "doc" "man" ];
+
+  postInstall = ''
+    mkdir -p $doc/share/doc/libffcall
+    mv $out/share/html $doc/share/doc/libffcall
+    rm -rf $out/share
+  '';
+
+  meta = with lib; {
+    description = "Foreign function call library";
+    homepage = "https://www.gnu.org/software/libffcall/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libffi/default.nix b/nixpkgs/pkgs/development/libraries/libffi/default.nix
new file mode 100644
index 000000000000..4332f43c5afb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libffi/default.nix
@@ -0,0 +1,63 @@
+{ lib, stdenv, fetchurl, fetchpatch
+, autoreconfHook
+
+}:
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+stdenv.mkDerivation rec {
+  pname = "libffi";
+  version = "3.4.2";
+
+  src = fetchurl {
+    url = "https://github.com/libffi/libffi/releases/download/v${version}/${pname}-${version}.tar.gz";
+    sha256 = "081nx7wpzds168jbr59m34n6s3lyiq6r8zggvqxvlslsc4hvf3sl";
+  };
+
+  patches = [];
+
+  outputs = [ "out" "dev" "man" "info" ];
+
+  configureFlags = [
+    "--with-gcc-arch=generic" # no detection of -march= or -mtune=
+    "--enable-pax_emutramp"
+
+    # Causes issues in downstream packages which misuse ffi_closure_alloc
+    # Reenable once these issues are fixed and merged:
+    # https://gitlab.haskell.org/ghc/ghc/-/merge_requests/6155
+    # https://gitlab.gnome.org/GNOME/gobject-introspection/-/merge_requests/283
+    "--disable-exec-static-tramp"
+  ];
+
+  preCheck = ''
+    # The tests use -O0 which is not compatible with -D_FORTIFY_SOURCE.
+    NIX_HARDENING_ENABLE=''${NIX_HARDENING_ENABLE/fortify/}
+  '';
+
+  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform; # Don't run the native `strip' when cross-compiling.
+
+  meta = with lib; {
+    description = "A foreign function call interface library";
+    longDescription = ''
+      The libffi library provides a portable, high level programming
+      interface to various calling conventions.  This allows a
+      programmer to call any function specified by a call interface
+      description at run-time.
+
+      FFI stands for Foreign Function Interface.  A foreign function
+      interface is the popular name for the interface that allows code
+      written in one language to call code written in another
+      language.  The libffi library really only provides the lowest,
+      machine dependent layer of a fully featured foreign function
+      interface.  A layer must exist above libffi that handles type
+      conversions for values passed between the two languages.
+    '';
+    homepage = "http://sourceware.org/libffi/";
+    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
new file mode 100644
index 000000000000..64c16e92c44b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfido2/default.nix
@@ -0,0 +1,58 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchpatch
+, cmake
+, pkg-config
+, hidapi
+, libcbor
+, openssl
+, udev
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libfido2";
+  version = "1.7.0";
+
+  # releases on https://developers.yubico.com/libfido2/Releases/ are signed
+  src = fetchurl {
+    url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.gz";
+    sha256 = "13khkp2q8g447797l09p83qxy0z8vgmzr54l8dcnapy9lsr4jrqi";
+  };
+
+  patches = [
+    # fix log truncation
+    # https://github.com/Yubico/libfido2/issues/318
+    # https://github.com/Yubico/libfido2/pull/319
+    (fetchpatch {
+      url = "https://github.com/Yubico/libfido2/commit/8edb9a204b2f4aeb487e282908c3187f1d02d606.patch";
+      sha256 = "1i360bghwbdccgkzjfzvhilscnwsj9lhfiviy000n928698l4wan";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [ libcbor openssl zlib ]
+    ++ lib.optionals stdenv.isDarwin [ hidapi ]
+    ++ lib.optionals stdenv.isLinux [ udev ];
+
+  cmakeFlags = [
+    "-DUDEV_RULES_DIR=${placeholder "out"}/etc/udev/rules.d"
+    "-DCMAKE_INSTALL_LIBDIR=lib"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "-DUSE_HIDAPI=1"
+  ] ++ lib.optionals stdenv.isLinux [
+    "-DNFC_LINUX=1"
+  ];
+
+  meta = with lib; {
+    description = ''
+      Provides library functionality for FIDO 2.0, including communication with a device over USB.
+    '';
+    homepage = "https://github.com/Yubico/libfido2";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ dtzWill prusnak ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libfilezilla/default.nix b/nixpkgs/pkgs/development/libraries/libfilezilla/default.nix
new file mode 100644
index 000000000000..2e0b77d812fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfilezilla/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv
+, fetchurl
+, autoreconfHook
+, gettext
+, gnutls
+, nettle
+, pkg-config
+, libiconv
+, ApplicationServices
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libfilezilla";
+  version = "0.31.1";
+
+  src = fetchurl {
+    url = "https://download.filezilla-project.org/${pname}/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-mX1Yh7YBXzhp03Wwy8S0lC/LJNvktDRohclGz+czFm8=";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  buildInputs = [ gettext gnutls nettle ]
+    ++ lib.optionals stdenv.isDarwin [ libiconv ApplicationServices ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://lib.filezilla-project.org/";
+    description = "A modern C++ library, offering some basic functionality to build high-performing, platform-independent programs";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ pSub ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libfishsound/default.nix b/nixpkgs/pkgs/development/libraries/libfishsound/default.nix
new file mode 100644
index 000000000000..bf578b969eff
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfishsound/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, libvorbis, speex, flac, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "libfishsound";
+  version = "1.0.0";
+
+  src = fetchurl {
+    url = "https://downloads.xiph.org/releases/libfishsound/${pname}-${version}.tar.gz";
+    sha256 = "1iz7mn6hw2wg8ljaw74f4g2zdj68ib88x4vjxxg3gjgc5z75f2rf";
+  };
+
+  propagatedBuildInputs = [ libvorbis speex flac ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  meta = with lib; {
+    homepage = "https://xiph.org/fishsound/";
+    description = "A simple programming interface for decoding and encoding audio data using Xiph.org codecs (FLAC, Speex and Vorbis)";
+    longDescription = ''libfishsound by itself is designed to handle raw codec streams from a lower level layer such as UDP datagrams. When these codecs are used in files, they are commonly encapsulated in Ogg to produce Ogg FLAC, Speex and Ogg Vorbis files.
+
+libfishsound is a wrapper around the existing codec libraries and provides a consistent, higher-level programming interface. It has been designed for use in a wide variety of applications; it has no direct dependencies on Ogg encapsulation, though it is most commonly used in conjunction with liboggz to decode or encode FLAC, Speex or Vorbis audio tracks in Ogg files, including Ogg Theora and Annodex.
+
+FishSound has been developed and tested on GNU/Linux, Darwin/MacOSX and Win32. It probably also works on other Unix-like systems via GNU autoconf. For Win32: nmake Makefiles, Visual Studio .NET 2003 solution files and Visual C++ 6.0 workspace files are all provided in the source distribution.'';
+    platforms = platforms.unix;
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libfive/default.nix b/nixpkgs/pkgs/development/libraries/libfive/default.nix
new file mode 100644
index 000000000000..3833a7fe880a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfive/default.nix
@@ -0,0 +1,53 @@
+{ lib
+, mkDerivation
+, wrapQtAppsHook
+, fetchFromGitHub
+, cmake
+, ninja
+, pkg-config
+, eigen
+, zlib
+, libpng
+, boost
+, guile
+, stdenv
+}:
+
+mkDerivation {
+  pname = "libfive-unstable";
+  version = "2020-02-15";
+
+  src = fetchFromGitHub {
+    owner = "libfive";
+    repo = "libfive";
+    rev = "5b7717a25064478cd6bdb190683566eaf4c7afdd";
+    sha256 = "102zw2n3vzv84i323is4qrwwqqha8v1cniw54ss8f4bq6dmic0bg";
+  };
+
+  nativeBuildInputs = [ wrapQtAppsHook cmake ninja pkg-config ];
+  buildInputs = [ eigen zlib libpng boost guile ];
+
+  postInstall = if stdenv.isDarwin then ''
+    # No rules to install the mac app, so do it manually.
+    mkdir -p $out/Applications
+    cp -r studio/Studio.app $out/Applications/Studio.app
+
+    install_name_tool \
+      -change libfive.dylib $out/lib/libfive.dylib \
+      -change libfive-guile.dylib $out/lib/libfive-guile.dylib \
+      $out/Applications/Studio.app/Contents/MacOS/Studio
+
+    wrapQtApp $out/Applications/Studio.app/Contents/MacOS/Studio
+  '' else ''
+    # Link "Studio" binary to "libfive-studio" to be more obvious:
+    ln -s "$out/bin/Studio" "$out/bin/libfive-studio"
+  '';
+
+  meta = with lib; {
+    description = "Infrastructure for solid modeling with F-Reps in C, C++, and Guile";
+    homepage = "https://libfive.com/";
+    maintainers = with maintainers; [ hodapp kovirobi ];
+    license = with licenses; [ mpl20 gpl2Plus ];
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libfixposix/default.nix b/nixpkgs/pkgs/development/libraries/libfixposix/default.nix
new file mode 100644
index 000000000000..4c7680f70469
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfixposix/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, getconf }:
+
+stdenv.mkDerivation rec {
+  pname = "libfixposix";
+  version="0.4.3";
+
+  src = fetchFromGitHub {
+    owner = "sionescu";
+    repo = "libfixposix";
+    rev = "v${version}";
+    sha256 = "1x4q6yspi5g2s98vq4qszw4z3zjgk9l5zs8471w4d4cs6l97w08j";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ] ++ lib.optionals stdenv.isDarwin [ getconf ];
+
+  meta = with lib; {
+    homepage = "https://github.com/sionescu/libfixposix";
+    description = "Thin wrapper over POSIX syscalls and some replacement functionality";
+    license = licenses.boost;
+    maintainers = with maintainers; [ orivej raskin ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libfm/default.nix b/nixpkgs/pkgs/development/libraries/libfm/default.nix
new file mode 100644
index 000000000000..5d7389b6d188
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfm/default.nix
@@ -0,0 +1,53 @@
+{ lib
+, stdenv
+, fetchurl
+, glib
+, intltool
+, menu-cache
+, pango
+, pkg-config
+, vala
+, extraOnly ? false
+, withGtk3 ? false, gtk2, gtk3
+}:
+
+let
+    gtk = if withGtk3 then gtk3 else gtk2;
+    inherit (lib) optional optionalString;
+in
+stdenv.mkDerivation rec {
+  pname = if extraOnly
+          then "libfm-extra"
+          else "libfm";
+  version = "1.3.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/pcmanfm/libfm-${version}.tar.xz";
+    sha256 = "sha256-pQQmMDBM+OXYz/nVZca9VG8ii0jJYBU+02ajTofK0eU=";
+  };
+
+  nativeBuildInputs = [ vala pkg-config intltool ];
+  buildInputs = [ glib gtk pango ]
+                ++ optional (!extraOnly) menu-cache;
+
+  configureFlags = [ "--sysconfdir=/etc" ]
+                   ++ optional extraOnly "--with-extra-only"
+                   ++ optional withGtk3 "--with-gtk=3";
+
+  installFlags = [ "sysconfdir=${placeholder "out"}/etc" ];
+
+  # libfm-extra is pulled in by menu-cache and thus leads to a collision for libfm
+  postInstall = optionalString (!extraOnly) ''
+     rm $out/lib/libfm-extra.so $out/lib/libfm-extra.so.* $out/lib/libfm-extra.la $out/lib/pkgconfig/libfm-extra.pc
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://blog.lxde.org/category/pcmanfm/";
+    license = licenses.lgpl21Plus;
+    description = "A glib-based library for file management";
+    maintainers = [ maintainers.ttuegel ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libfprint-2-tod1-goodix/default.nix b/nixpkgs/pkgs/development/libraries/libfprint-2-tod1-goodix/default.nix
new file mode 100644
index 000000000000..e4121bc9e908
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfprint-2-tod1-goodix/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, lib, fetchgit, libfprint-tod }:
+stdenv.mkDerivation {
+  pname = "libfprint-2-tod1-goodix";
+  version = "0.0.6";
+
+  src = fetchgit {
+    url = "https://git.launchpad.net/~oem-solutions-engineers/libfprint-2-tod1-goodix/+git/libfprint-2-tod1-goodix";
+    rev = "882735c6366fbe30149eea5cfd6d0ddff880f0e4"; # droped-lp1880058 on 2020-11-25
+    sha256 = "sha256-Uv+Rr4V31DyaZFOj79Lpyfl3G6zVWShh20roI0AvMPU=";
+  };
+
+  buildPhase = ''
+    patchelf \
+      --set-rpath ${lib.makeLibraryPath [ libfprint-tod ]} \
+      usr/lib/x86_64-linux-gnu/libfprint-2/tod-1/libfprint-tod-goodix-53xc-0.0.6.so
+
+    ldd usr/lib/x86_64-linux-gnu/libfprint-2/tod-1/libfprint-tod-goodix-53xc-0.0.6.so
+  '';
+
+  installPhase = ''
+    mkdir -p "$out/lib/libfprint-2/tod-1/"
+    mkdir -p "$out/lib/udev/rules.d/"
+
+    cp usr/lib/x86_64-linux-gnu/libfprint-2/tod-1/libfprint-tod-goodix-53xc-$version.so "$out/lib/libfprint-2/tod-1/"
+    cp lib/udev/rules.d/60-libfprint-2-tod1-goodix.rules "$out/lib/udev/rules.d/"
+  '';
+
+  passthru.driverPath = "/lib/libfprint-2/tod-1";
+
+  meta = with lib; {
+    description = "Goodix driver module for libfprint-2-tod Touch OEM Driver";
+    homepage = "https://git.launchpad.net/~oem-solutions-engineers/libfprint-2-tod1-goodix/+git/libfprint-2-tod1-goodix/";
+    license = licenses.unfree;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ grahamc ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libfprint-2-tod1-vfs0090/0001-vfs0090-add-missing-explicit-dependencies-in-meson.b.patch b/nixpkgs/pkgs/development/libraries/libfprint-2-tod1-vfs0090/0001-vfs0090-add-missing-explicit-dependencies-in-meson.b.patch
new file mode 100644
index 000000000000..ac06e83ab938
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfprint-2-tod1-vfs0090/0001-vfs0090-add-missing-explicit-dependencies-in-meson.b.patch
@@ -0,0 +1,28 @@
+From c02f2e040dd1e7664777c5a705272e4eb7bfb569 Mon Sep 17 00:00:00 2001
+From: Vincent Breitmoser <look@my.amazin.horse>
+Date: Thu, 10 Jun 2021 14:09:19 +0200
+Subject: [PATCH] vfs0090: add missing explicit dependencies in meson.build
+
+Make all dependencies explicit, so they can be found when building with Nix.
+
+---
+ meson.build | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/meson.build b/meson.build
+index 54a7ca4..88f8793 100644
+--- a/meson.build
++++ b/meson.build
+@@ -17,6 +17,9 @@ udev_dep = dependency('udev')
+ vfs009x_deps += libfprint_tod_dep
+ vfs009x_deps += dependency('nss')
+ vfs009x_deps += dependency('openssl')
++vfs009x_deps += dependency('gusb')
++vfs009x_deps += dependency('libfprint-2')
++vfs009x_deps += dependency('glib-2.0')
+ 
+ vfs0090_deps += dependency('pixman-1')
+ 
+-- 
+2.31.1
+
diff --git a/nixpkgs/pkgs/development/libraries/libfprint-2-tod1-vfs0090/0002-vfs0090-add-missing-linux-limits.h-include.patch b/nixpkgs/pkgs/development/libraries/libfprint-2-tod1-vfs0090/0002-vfs0090-add-missing-linux-limits.h-include.patch
new file mode 100644
index 000000000000..6111cf0ad294
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfprint-2-tod1-vfs0090/0002-vfs0090-add-missing-linux-limits.h-include.patch
@@ -0,0 +1,26 @@
+From 5405e02c629e689449e852424aed8cca217ed309 Mon Sep 17 00:00:00 2001
+From: Vincent Breitmoser <look@my.amazin.horse>
+Date: Thu, 10 Jun 2021 14:10:52 +0200
+Subject: [PATCH] vfs0090: add missing <linux/limits.h> include
+
+This header is needed for the NAME_MAX constant used in this file.
+
+---
+ vfs0090.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/vfs0090.c b/vfs0090.c
+index 8034faf..6070df7 100644
+--- a/vfs0090.c
++++ b/vfs0090.c
+@@ -24,6 +24,7 @@
+ 
+ #include <errno.h>
+ #include <ctype.h>
++#include <linux/limits.h>
+ #include <nss.h>
+ #include <pk11pub.h>
+ #include <sechash.h>
+-- 
+2.31.1
+
diff --git a/nixpkgs/pkgs/development/libraries/libfprint-2-tod1-vfs0090/default.nix b/nixpkgs/pkgs/development/libraries/libfprint-2-tod1-vfs0090/default.nix
new file mode 100644
index 000000000000..840f8e227153
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfprint-2-tod1-vfs0090/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, lib, fetchFromGitLab, pkg-config, libfprint, libfprint-tod, gusb, udev, nss, openssl, meson, pixman, ninja, glib }:
+stdenv.mkDerivation {
+  pname = "libfprint-2-tod1-vfs0090";
+  version = "0.8.5";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.freedesktop.org";
+    owner = "3v1n0";
+    repo = "libfprint-tod-vfs0090";
+    rev = "6084a1545589beec0c741200b18b0902cca225ba";
+    sha256 = "sha256-tSML/8USd/LuHF/YGLvNgykixF6VYtfE4SXzeV47840=";
+  };
+
+  patches = [
+    # TODO remove once https://gitlab.freedesktop.org/3v1n0/libfprint-tod-vfs0090/-/merge_requests/1 is merged
+    ./0001-vfs0090-add-missing-explicit-dependencies-in-meson.b.patch
+    # TODO remove once https://gitlab.freedesktop.org/3v1n0/libfprint-tod-vfs0090/-/merge_requests/2 is merged
+    ./0002-vfs0090-add-missing-linux-limits.h-include.patch
+  ];
+
+  nativeBuildInputs = [ pkg-config meson ninja ];
+  buildInputs = [ libfprint libfprint-tod glib gusb udev nss openssl pixman ];
+
+  installPhase = ''
+    runHook preInstall
+
+    install -D -t "$out/lib/libfprint-2/tod-1/" libfprint-tod-vfs009x.so
+    install -D -t "$out/lib/udev/rules.d/" $src/60-libfprint-2-tod-vfs0090.rules
+
+    runHook postInstall
+  '';
+
+  passthru.driverPath = "/lib/libfprint-2/tod-1";
+
+  meta = with lib; {
+    description = "A libfprint-2-tod Touch OEM Driver for 2016 ThinkPad's fingerprint readers";
+    homepage = "https://gitlab.freedesktop.org/3v1n0/libfprint-tod-vfs0090";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ valodim ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libfprint-tod/default.nix b/nixpkgs/pkgs/development/libraries/libfprint-tod/default.nix
new file mode 100644
index 000000000000..8d7df57896d4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfprint-tod/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, libfprint
+, fetchFromGitLab
+}:
+
+# for the curious, "tod" means "Touch OEM Drivers" meaning it can load
+# external .so's.
+libfprint.overrideAttrs ({ postPatch ? "", mesonFlags ? [], ... }: let
+  version = "1.90.7+git20210222+tod1";
+in  {
+  pname = "libfprint-tod";
+  inherit version;
+
+  src = fetchFromGitLab {
+    domain = "gitlab.freedesktop.org";
+    owner = "3v1n0";
+    repo = "libfprint";
+    rev = "v${version}";
+    sha256 = "0cj7iy5799pchyzqqncpkhibkq012g3bdpn18pfb19nm43svhn4j";
+  };
+
+  mesonFlags = mesonFlags ++ [
+    "-Dudev_hwdb_dir=${placeholder "out"}/lib/udev/hwdb.d"
+  ];
+
+
+  postPatch = ''
+    ${postPatch}
+    patchShebangs ./tests/*.py ./tests/*.sh
+  '';
+
+
+  meta = with lib; {
+    homepage = "https://gitlab.freedesktop.org/3v1n0/libfprint";
+    description = "A library designed to make it easy to add support for consumer fingerprint readers, with support for loaded drivers";
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ grahamc ];
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/libfprint/default.nix b/nixpkgs/pkgs/development/libraries/libfprint/default.nix
new file mode 100644
index 000000000000..42e308f41a9e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfprint/default.nix
@@ -0,0 +1,81 @@
+{ lib, stdenv
+, fetchFromGitLab
+, pkg-config
+, meson
+, python3
+, ninja
+, gusb
+, pixman
+, glib
+, nss
+, gobject-introspection
+, coreutils
+, cairo
+, libgudev
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libfprint";
+  version = "1.92.1";
+  outputs = [ "out" "devdoc" ];
+
+  src = fetchFromGitLab {
+    domain = "gitlab.freedesktop.org";
+    owner = "libfprint";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0dpwzmwl9jjpaz44znvy3v8s9sln0c71b756rs1knk0zx8sa1qbc";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    meson
+    ninja
+    gtk-doc
+    docbook-xsl-nons
+    docbook_xml_dtd_43
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    gusb
+    pixman
+    glib
+    nss
+    cairo
+    libgudev
+  ];
+
+  checkInputs = [
+    python3
+  ];
+
+  mesonFlags = [
+    "-Dudev_rules_dir=${placeholder "out"}/lib/udev/rules.d"
+    # Include virtual drivers for fprintd tests
+    "-Ddrivers=all"
+    "-Dudev_hwdb_dir=${placeholder "out"}/lib/udev/hwdb.d"
+  ];
+
+  doCheck = true;
+
+  postPatch = ''
+    patchShebangs \
+      tests/test-runner.sh \
+      tests/unittest_inspector.py \
+      tests/virtual-image.py \
+      tests/umockdev-test.py \
+      tests/test-generated-hwdb.sh
+  '';
+
+  meta = with lib; {
+    homepage = "https://fprint.freedesktop.org/";
+    description = "A library designed to make it easy to add support for consumer fingerprint readers";
+    license = licenses.lgpl21Only;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libfpx/default.nix b/nixpkgs/pkgs/development/libraries/libfpx/default.nix
new file mode 100644
index 000000000000..589c08399a70
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfpx/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, fetchpatch }:
+
+stdenv.mkDerivation rec {
+  pname = "libfpx";
+  version = "1.3.1-7";
+
+  src = fetchurl {
+    url = "mirror://imagemagick/delegates/${pname}-${version}.tar.xz";
+    sha256 = "1s28mwb06w6dj0zl6ashpj8m1qiyadawzl7cvbw7dmj1w39ipghh";
+  };
+
+  # Darwin gets misdetected as Windows without this
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-D__unix";
+
+  patches = [
+    (fetchpatch {
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-libs/libfpx/files/libfpx-1.3.1_p6-gcc6.patch?id=f28a947813dbc0a1fd1a8d4a712d58a64c48ca01";
+      sha256 = "032y8110zgnkdhkdq3745zk53am1x34d912rai8q70k3sskyq22p";
+    })
+  ];
+
+  # This dead code causes a duplicate symbol error in Clang so just remove it
+  postPatch = if stdenv.cc.isClang then ''
+    substituteInPlace jpeg/ejpeg.h --replace "int No_JPEG_Header_Flag" ""
+  '' else null;
+
+  meta = with lib; {
+    homepage = "http://www.imagemagick.org";
+    description = "A library for manipulating FlashPIX images";
+    license = "Flashpix";
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libfreeaptx/default.nix b/nixpkgs/pkgs/development/libraries/libfreeaptx/default.nix
new file mode 100644
index 000000000000..9e30973f199e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfreeaptx/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "libfreeaptx";
+  version = "0.1.1";
+
+  src = fetchFromGitHub {
+    owner = "iamthehorker";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-eEUhOrKqb2hHWanY+knpY9FBEnjkkFTB+x6BZgMBpbo=";
+  };
+
+  makeFlags = [
+    "PREFIX=${placeholder "out"}"
+    # disable static builds
+    "ANAME="
+    "AOBJECTS="
+    "STATIC_UTILITIES="
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Free Implementation of Audio Processing Technology codec (aptX)";
+    license = licenses.lgpl21Plus;
+    homepage = "https://github.com/iamthehorker/libfreeaptx";
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ kranzes ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libfreefare/default.nix b/nixpkgs/pkgs/development/libraries/libfreefare/default.nix
new file mode 100644
index 000000000000..9fd8c1e6b613
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfreefare/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, pkg-config, libnfc, openssl
+, libobjc ? null }:
+
+stdenv.mkDerivation {
+  pname = "libfreefare";
+  version = "0.4.0";
+
+  src = fetchurl {
+    url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/libfreefare/libfreefare-0.4.0.tar.bz2";
+    sha256 = "0r5wfvwgf35lb1v65wavnwz2wlfyfdims6a9xpslf4lsm4a1v8xz";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libnfc openssl ] ++ lib.optional stdenv.isDarwin libobjc;
+
+  meta = with lib; {
+    description = "The libfreefare project aims to provide a convenient API for MIFARE card manipulations";
+    license = licenses.lgpl3;
+    homepage = "https://github.com/nfc-tools/libfreefare";
+    maintainers = with maintainers; [bobvanderlinden];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libfsm/default.nix b/nixpkgs/pkgs/development/libraries/libfsm/default.nix
new file mode 100644
index 000000000000..f1e704448de8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfsm/default.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv, fetchFromGitHub
+, bmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libfsm";
+  version = "0.1pre2442_${builtins.substring 0 8 src.rev}";
+
+  src = fetchFromGitHub {
+    owner  = "katef";
+    repo   = pname;
+    rev    = "9c5095f7364fa464efff6c81fad9b60b19dfcc99";
+    sha256 = "1bs51agvrrwqid0slq2svj2yj7kkjdsnv3xsrk8zmf1jbgza6jrm";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ bmake ];
+  enableParallelBuilding = true;
+
+  # note: build checks value of '$CC' to add some extra cflags, but we don't
+  # necessarily know which 'stdenv' someone chose, so we leave it alone (e.g.
+  # 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.
+  makeFlags = [ "-r" "PREFIX=$(out)" ];
+
+  # fix up multi-output install. we also have to fix the pkg-config libdir
+  # file; it uses prefix=$out; libdir=${prefix}/lib, which is wrong in
+  # our case; libdir should really be set to the $lib output.
+  postInstall = ''
+    mkdir -p $lib $dev/lib
+
+    mv $out/lib             $lib/lib
+    mv $out/include         $dev/include
+    mv $out/share/pkgconfig $dev/lib/pkgconfig
+    rmdir $out/share
+
+    for x in libfsm.pc libre.pc; do
+      substituteInPlace "$dev/lib/pkgconfig/$x" \
+        --replace 'libdir=''${prefix}/lib' "libdir=$lib/lib"
+    done
+  '';
+
+  outputs = [ "out" "lib" "dev" ];
+
+  meta = with lib; {
+    description = "DFA regular expression library & friends";
+    homepage    = "https://github.com/katef/libfsm";
+    license     = licenses.bsd2;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libftdi/1.x.nix b/nixpkgs/pkgs/development/libraries/libftdi/1.x.nix
new file mode 100644
index 000000000000..30c9e294ecc8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libftdi/1.x.nix
@@ -0,0 +1,73 @@
+{ lib
+, stdenv
+, fetchgit
+, cmake
+, pkg-config
+, libusb1
+, libconfuse
+, cppSupport ? true
+, boost
+, pythonSupport ? true
+, python3
+, swig
+, docSupport ? true
+, doxygen
+, graphviz
+}:
+
+let
+  inherit (lib) optionals optionalString;
+  onOff = a: if a then "ON" else "OFF";
+in
+stdenv.mkDerivation rec {
+  pname = "libftdi";
+  version = "1.5";
+
+  src = fetchgit {
+    url = "git://developer.intra2net.com/libftdi";
+    rev = "v${version}";
+    sha256 = "0vipg3y0kbbzjhxky6hfyxy42mpqhvwn1r010zr5givcfp8ghq26";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ]
+    ++ optionals docSupport [ doxygen graphviz ]
+    ++ optionals pythonSupport [ swig ];
+
+  buildInputs = [ libconfuse ]
+    ++ optionals cppSupport [ boost ]
+    ++ optionals pythonSupport [ python3 ];
+
+  cmakeFlags = [
+    "-DFTDIPP=${onOff cppSupport}"
+    "-DBUILD_TESTS=${onOff cppSupport}"
+    "-DLINK_PYTHON_LIBRARY=${onOff pythonSupport}"
+    "-DPYTHON_BINDINGS=${onOff pythonSupport}"
+    "-DDOCUMENTATION=${onOff docSupport}"
+  ];
+
+  propagatedBuildInputs = [ libusb1 ];
+
+  postInstall = ''
+    mkdir -p "$out/etc/udev/rules.d/"
+    cp ../packages/99-libftdi.rules "$out/etc/udev/rules.d/"
+  '' + optionalString docSupport ''
+    cp -r doc/man "$out/share/"
+    cp -r doc/html "$out/share/doc/libftdi1/"
+  '';
+
+  postFixup = optionalString cppSupport ''
+    # This gets misassigned to the C++ version's path for some reason
+    for fileToFix in $out/{bin/libftdi1-config,lib/pkgconfig/libftdi1.pc}; do
+      substituteInPlace $fileToFix \
+        --replace "$out/include/libftdipp1" "$out/include/libftdi1"
+    done
+  '';
+
+  meta = with lib; {
+    description = "A library to talk to FTDI chips using libusb";
+    homepage = "https://www.intra2net.com/en/developer/libftdi/";
+    license = with licenses; [ lgpl2Only gpl2Only ];
+    platforms = platforms.all;
+    maintainers = with maintainers; [ bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libftdi/default.nix b/nixpkgs/pkgs/development/libraries/libftdi/default.nix
new file mode 100644
index 000000000000..68801883df9d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libftdi/default.nix
@@ -0,0 +1,33 @@
+{lib, stdenv, fetchurl, libusb-compat-0_1}:
+
+stdenv.mkDerivation rec {
+  pname = "libftdi";
+  version = "0.20";
+
+  src = fetchurl {
+    url = "https://www.intra2net.com/en/developer/libftdi/download/${pname}-${version}.tar.gz";
+    sha256 = "13l39f6k6gff30hsgh0wa2z422g9pyl91rh8a8zz6f34k2sxaxii";
+  };
+
+  buildInputs = [ libusb-compat-0_1 ];
+
+  propagatedBuildInputs = [ libusb-compat-0_1 ];
+
+  # Hack to avoid TMPDIR in RPATHs.
+  preFixup = ''rm -rf "$(pwd)" '';
+  configureFlags = lib.optional (!stdenv.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
+  patchPhase = ''
+    substituteInPlace ./src/ftdi.c \
+      --replace "ifdef USB_CLASS_PTP" "if 0"
+  '';
+
+  meta = {
+    description = "A library to talk to FTDI chips using libusb";
+    homepage = "https://www.intra2net.com/en/developer/libftdi/";
+    license = lib.licenses.lgpl21;
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libfyaml/default.nix b/nixpkgs/pkgs/development/libraries/libfyaml/default.nix
new file mode 100644
index 000000000000..dfb540b0bd29
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libfyaml/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "libfyaml";
+  version = "0.7";
+
+  src = fetchFromGitHub {
+    owner = "pantoniou";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "10w1n4zzgw33j755pkv73fxdn93kwbzg486b5m9i0bh5d76jp4ax";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  doCheck = true;
+
+  preCheck = ''
+    patchShebangs test
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/pantoniou/libfyaml";
+    description = "Fully feature complete YAML parser and emitter, supporting the latest YAML spec and passing the full YAML testsuite";
+    license = licenses.mit;
+    maintainers = [ maintainers.marsam ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgadu/default.nix b/nixpkgs/pkgs/development/libraries/libgadu/default.nix
new file mode 100644
index 000000000000..72bf067b2db4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgadu/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, zlib, protobufc, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "libgadu";
+  version = "1.12.2";
+
+  src = fetchFromGitHub {
+    owner = "wojtekka";
+    repo = pname;
+    rev = version;
+    sha256 = "1s16cripy5w9k12534qb012iwc5m9qcjyrywgsziyn3kl3i0aa8h";
+  };
+
+  propagatedBuildInputs = [ zlib ];
+  buildInputs = [ protobufc ];
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = {
+    description = "A library to deal with gadu-gadu protocol (most popular polish IM protocol)";
+    homepage = "https://libgadu.net/index.en.html";
+    platforms = lib.platforms.linux;
+    license = lib.licenses.lgpl21;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgaminggear/default.nix b/nixpkgs/pkgs/development/libraries/libgaminggear/default.nix
new file mode 100644
index 000000000000..f059d6c73a2f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgaminggear/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchurl, cmake, pkg-config, gettext
+, gtk2, libcanberra, libnotify, pcre, sqlite, xorg
+, harfbuzz
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libgaminggear";
+  version = "0.15.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libgaminggear/${pname}-${version}.tar.bz2";
+    sha256 = "0jf5i1iv8j842imgiixbhwcr6qcwa93m27lzr6gb01ri5v35kggz";
+  };
+
+  outputs = [ "dev" "out" "bin" ];
+
+  nativeBuildInputs = [ cmake pkg-config gettext ];
+
+  propagatedBuildInputs = [
+    gtk2 libcanberra libnotify pcre sqlite xorg.libXdmcp xorg.libpthreadstubs
+  ];
+
+  cmakeFlags = [
+    "-DINSTALL_CMAKE_MODULESDIR=lib/cmake"
+    "-DINSTALL_PKGCONFIGDIR=lib/pkgconfig"
+    "-DINSTALL_LIBDIR=lib"
+  ];
+
+  # https://sourceforge.net/p/libgaminggear/discussion/general/thread/b43a776b3a/
+  NIX_CFLAGS_COMPILE = [ "-I${harfbuzz.dev}/include/harfbuzz" ];
+
+  postFixup = ''
+    moveToOutput bin "$bin"
+  '';
+
+  meta = {
+    description = "Provides functionality for gaming input devices";
+    homepage = "https://sourceforge.net/projects/libgaminggear/";
+    platforms = lib.platforms.linux;
+    license = lib.licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgcrypt/1.5.nix b/nixpkgs/pkgs/development/libraries/libgcrypt/1.5.nix
new file mode 100644
index 000000000000..b6968ff2d4e5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgcrypt/1.5.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv, fetchpatch, fetchurl, libgpgerror, enableCapabilities ? false, libcap }:
+
+assert enableCapabilities -> stdenv.isLinux;
+
+stdenv.mkDerivation rec {
+  name = "libgcrypt-1.5.6";
+
+  src = fetchurl {
+    url = "mirror://gnupg/libgcrypt/${name}.tar.bz2";
+    sha256 = "0ydy7bgra5jbq9mxl5x031nif3m6y3balc6ndw2ngj11wnsjc61h";
+  };
+
+  patches = lib.optionals stdenv.isDarwin [
+    (fetchpatch {
+      name = "fix-x86_64-apple-darwin.patch";
+      sha256 = "138sfwl1avpy19320dbd63mskspc1khlc93j1f1zmylxx3w19csi";
+      url = "https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=patch;h=71939faa7c54e7b4b28d115e748a85f134876a02";
+    })
+  ];
+
+  buildInputs =
+    [ libgpgerror ]
+    ++ lib.optional enableCapabilities libcap;
+
+  # Make sure libraries are correct for .pc and .la files
+  # Also make sure includes are fixed for callers who don't use libgpgcrypt-config
+  postInstall = ''
+    sed -i 's,#include <gpg-error.h>,#include "${libgpgerror.dev}/include/gpg-error.h",g' $out/include/gcrypt.h
+  '' + lib.optionalString enableCapabilities ''
+    sed -i 's,\(-lcap\),-L${libcap.lib}/lib \1,' $out/lib/libgcrypt.la
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://www.gnu.org/software/libgcrypt/";
+    description = "General-pupose cryptographic library";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.all;
+    repositories.git = "git://git.gnupg.org/libgcrypt.git";
+    knownVulnerabilities = [
+      "CVE-2014-3591"
+      "CVE-2015-0837"
+      "CVE-2015-7511"
+      "CVE-2017-0379"
+      "CVE-2017-7526"
+      "CVE-2017-9526"
+      "CVE-2018-0495"
+      "CVE-2018-6829"
+      "CVE-2018-12437"
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgcrypt/default.nix b/nixpkgs/pkgs/development/libraries/libgcrypt/default.nix
new file mode 100644
index 000000000000..506b1a5b25fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgcrypt/default.nix
@@ -0,0 +1,68 @@
+{ lib, stdenv, fetchurl, gettext, libgpgerror, enableCapabilities ? false, libcap, buildPackages }:
+
+assert enableCapabilities -> stdenv.isLinux;
+
+stdenv.mkDerivation rec {
+  pname = "libgcrypt";
+  version = "1.9.3";
+
+  src = fetchurl {
+    url = "mirror://gnupg/libgcrypt/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-l+vk+U4vfjW3UhlM4VoPPGYyTg/2ryZlm7+1/y7DKP0=";
+  };
+
+  outputs = [ "out" "dev" "info" ];
+  outputBin = "dev";
+
+  # The CPU Jitter random number generator must not be compiled with
+  # optimizations and the optimize -O0 pragma only works for gcc.
+  # The build enables -O2 by default for everything else.
+  hardeningDisable = lib.optional stdenv.cc.isClang "fortify";
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+
+  buildInputs = [ libgpgerror ]
+    ++ lib.optional stdenv.isDarwin gettext
+    ++ lib.optional enableCapabilities libcap;
+
+  strictDeps = true;
+
+  configureFlags = [ "--with-libgpg-error-prefix=${libgpgerror.dev}" ]
+      ++ lib.optional (stdenv.hostPlatform.isMusl || (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)) "--disable-asm"; # for darwin see https://dev.gnupg.org/T5157
+
+  # Necessary to generate correct assembly when compiling for aarch32 on
+  # aarch64
+  configurePlatforms = [ "host" "build" ];
+
+  postConfigure = ''
+    sed -i configure \
+        -e 's/NOEXECSTACK_FLAGS=$/NOEXECSTACK_FLAGS="-Wa,--noexecstack"/'
+  '';
+
+  # Make sure libraries are correct for .pc and .la files
+  # Also make sure includes are fixed for callers who don't use libgpgcrypt-config
+  postFixup = ''
+    sed -i 's,#include <gpg-error.h>,#include "${libgpgerror.dev}/include/gpg-error.h",g' "$dev/include/gcrypt.h"
+  '' + lib.optionalString enableCapabilities ''
+    sed -i 's,\(-lcap\),-L${libcap.lib}/lib \1,' $out/lib/libgcrypt.la
+  '';
+
+  # TODO: figure out why this is even necessary and why the missing dylib only crashes
+  # random instead of every test
+  preCheck = lib.optionalString stdenv.isDarwin ''
+    mkdir -p $out/lib
+    cp src/.libs/libgcrypt.20.dylib $out/lib
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://www.gnu.org/software/libgcrypt/";
+    changelog = "https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgcrypt.git;a=blob;f=NEWS;hb=refs/tags/${pname}-${version}";
+    description = "General-purpose cryptographic library";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ vrthra ];
+    repositories.git = "git://git.gnupg.org/libgcrypt.git";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgda/6.x.nix b/nixpkgs/pkgs/development/libraries/libgda/6.x.nix
new file mode 100644
index 000000000000..28235d65d98a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgda/6.x.nix
@@ -0,0 +1,93 @@
+{ lib
+, stdenv
+, fetchurl
+, pkg-config
+, intltool
+, meson
+, ninja
+, itstool
+, libxml2
+, python3
+, gtk3
+, json-glib
+, isocodes
+, openssl
+, gnome
+, gobject-introspection
+, vala
+, libgee
+, sqlite
+, gtk-doc
+, yelp-tools
+, mysqlSupport ? false
+, libmysqlclient ? null
+, postgresSupport ? false
+, postgresql ? null
+}:
+
+assert mysqlSupport -> libmysqlclient != null;
+assert postgresSupport -> postgresql != null;
+
+stdenv.mkDerivation rec {
+  pname = "libgda";
+  version = "6.0.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0w564z7krgjk19r39mi5qn4kggpdg9ggbyn9pb4aavb61r14npwr";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    intltool
+    meson
+    ninja
+    itstool
+    libxml2
+    python3
+    gobject-introspection
+    vala
+    gtk-doc
+    yelp-tools
+  ];
+
+  buildInputs = [
+    gtk3
+    json-glib
+    isocodes
+    openssl
+    libgee
+    sqlite
+  ] ++ lib.optionals mysqlSupport [
+    libmysqlclient
+  ] ++ lib.optionals postgresSupport [
+    postgresql
+  ];
+
+  postPatch = ''
+    patchShebangs \
+      providers/raw_spec.py \
+      providers/mysql/gen_bin.py
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      attrPath = "libgda6";
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "Database access library";
+    homepage = "https://www.gnome-db.org/";
+    license = with licenses; [
+      # library
+      lgpl2Plus
+      # CLI tools
+      gpl2Plus
+    ];
+    maintainers = teams.gnome.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgda/default.nix b/nixpkgs/pkgs/development/libraries/libgda/default.nix
new file mode 100644
index 000000000000..b3f6e1a7cdd9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgda/default.nix
@@ -0,0 +1,105 @@
+{ lib
+, stdenv
+, fetchurl
+, pkg-config
+, intltool
+, itstool
+, libxml2
+, gtk3
+, openssl
+, gnome
+, gobject-introspection
+, vala
+, libgee
+, overrideCC
+, gcc6
+, fetchpatch
+, autoreconfHook
+, gtk-doc
+, autoconf-archive
+, yelp-tools
+, mysqlSupport ? false
+, libmysqlclient ? null
+, postgresSupport ? false
+, postgresql ? null
+}:
+
+assert mysqlSupport -> libmysqlclient != null;
+assert postgresSupport -> postgresql != null;
+
+(if stdenv.isAarch64 then overrideCC stdenv gcc6 else stdenv).mkDerivation rec {
+  pname = "libgda";
+  version = "5.2.10";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1j1l4dwjgw6w4d1v4bl5a4kwyj7bcih8mj700ywm7xakh1xxyv3g";
+  };
+
+  patches = [
+    # fix compile error with mysql
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/libgda/-/commit/9859479884fad5f39e6c37e8995e57c28b11b1b9.diff";
+      sha256 = "158sncc5bg9lkri1wb0i1ri1nhx4c34rzi47gbfkwphlp7qd4qqv";
+    })
+  ];
+
+  nativeBuildInputs = [
+    pkg-config
+    intltool
+    itstool
+    libxml2
+    gobject-introspection
+    vala
+    autoreconfHook
+    gtk-doc
+    autoconf-archive
+    yelp-tools
+  ];
+
+  buildInputs = [
+    gtk3
+    openssl
+    libgee
+  ] ++ lib.optionals mysqlSupport [
+    libmysqlclient
+  ] ++ lib.optionals postgresSupport [
+    postgresql
+  ];
+
+  configureFlags = [
+    "--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;
+
+  hardeningDisable = [ "format" ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "Database access library";
+    homepage = "https://www.gnome-db.org/";
+    license = with licenses; [
+      # library
+      lgpl2Plus
+      # CLI tools
+      gpl2Plus
+    ];
+    maintainers = teams.gnome.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgdamm/default.nix b/nixpkgs/pkgs/development/libraries/libgdamm/default.nix
new file mode 100644
index 000000000000..ad5e0cbecd6e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgdamm/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl, pkg-config, glibmm, libgda, libxml2, gnome
+, mysqlSupport ? false
+, postgresSupport ? false }:
+
+let
+  gda = libgda.override {
+    inherit mysqlSupport postgresSupport;
+  };
+in stdenv.mkDerivation rec {
+  pname = "libgdamm";
+  version = "4.99.11";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1fyh15b3f8hmwbswalxk1g4l04yvvybksn5nm7gznn5jl5q010p9";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ glibmm libxml2 ];
+  propagatedBuildInputs = [ gda ];
+
+  enableParallelBuilding = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "C++ bindings for libgda";
+    homepage = "https://www.gnome-db.org/";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgdata/default.nix b/nixpkgs/pkgs/development/libraries/libgdata/default.nix
new file mode 100644
index 000000000000..f85dbea54d9d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgdata/default.nix
@@ -0,0 +1,86 @@
+{ lib, stdenv
+, fetchurl
+, pkg-config
+, meson
+, ninja
+, nixosTests
+, vala
+, gettext
+, libxml2
+, glib
+, json-glib
+, gcr
+, gnome-online-accounts
+, gobject-introspection
+, gnome
+, p11-kit
+, openssl
+, uhttpmock
+, libsoup
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libgdata";
+  version = "0.18.1";
+
+  outputs = [ "out" "dev" "installedTests" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "3YWS7rZRKtCoz1yL6McudvdL/msj5N2T8HVu4HFoBMc=";
+  };
+
+  patches = [
+    ./installed-tests-path.patch
+  ];
+
+  nativeBuildInputs = [
+    gettext
+    gobject-introspection
+    meson
+    ninja
+    pkg-config
+    vala
+  ];
+
+  buildInputs = [
+    gcr
+    glib
+    libsoup
+    libxml2
+    openssl
+    p11-kit
+    uhttpmock
+  ];
+
+  propagatedBuildInputs = [
+    gnome-online-accounts
+    json-glib
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=false"
+    "-Dinstalled_test_bindir=${placeholder "installedTests"}/libexec"
+    "-Dinstalled_test_datadir=${placeholder "installedTests"}/share"
+    "-Dinstalled_tests=true"
+  ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none"; # Stable version has not been updated for a long time.
+    };
+
+    tests = {
+      installedTests = nixosTests.installed-tests.libgdata;
+    };
+  };
+
+  meta = with lib; {
+    description = "GData API library";
+    homepage = "https://wiki.gnome.org/Projects/libgdata";
+    maintainers = with maintainers; [ raskin ] ++ teams.gnome.members;
+    platforms = platforms.linux;
+    license = licenses.lgpl21Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgdata/installed-tests-path.patch b/nixpkgs/pkgs/development/libraries/libgdata/installed-tests-path.patch
new file mode 100644
index 000000000000..f8c0a1293a1f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgdata/installed-tests-path.patch
@@ -0,0 +1,94 @@
+diff --git a/gdata/tests/meson.build b/gdata/tests/meson.build
+index 05184deb..3a9392d4 100644
+--- a/gdata/tests/meson.build
++++ b/gdata/tests/meson.build
+@@ -1,5 +1,12 @@
+-tests_execdir = gdata_libexecdir / 'installed-tests' / gdata_name
+-tests_metadir = gdata_datadir / 'installed-tests' / gdata_name
++tests_bindir = get_option('installed_test_bindir') / 'installed-tests' / gdata_name
++if tests_bindir == ''
++    test_bindir = gdata_libexecdir / 'installed-tests' / gdata_name
++endif
++
++tests_datadir = get_option('installed_test_datadir') / 'installed-tests' / gdata_name
++if tests_datadir == ''
++    tests_datadir = gdata_datadir / 'installed-tests' / gdata_name
++endif
+ 
+ tests_sources = files(
+   'common.c',
+@@ -49,7 +56,7 @@ foreach test_name, extra_args: tests
+     dependencies: common_deps + extra_args.get('dependencies', []),
+     sources: tests_sources,
+     install: install_tests and not should_fail,
+-    install_dir: tests_execdir,
++    install_dir: tests_bindir,
+   )
+ 
+   test(
+@@ -65,7 +72,7 @@ if install_tests
+     should_fail = extra_args.get('should_fail', false)
+     tests_conf = {
+       'TEST_TYPE': 'session',
+-      'TEST_ABS_PATH': gdata_prefix / tests_execdir / test_name,
++      'TEST_ABS_PATH': tests_bindir / test_name,
+     }
+ 
+     configure_file (
+@@ -73,13 +80,13 @@ if install_tests
+       output: test_name + '.test',
+       configuration: tests_conf,
+       install: not should_fail,
+-      install_dir: tests_metadir,
++      install_dir: tests_datadir,
+     )
+   endforeach
+ 
+   install_subdir(
+     'traces',
+-    install_dir: tests_execdir,
++    install_dir: tests_bindir,
+   )
+ 
+   test_data = [
+@@ -98,6 +105,6 @@ if install_tests
+ 
+   install_data(
+     test_data,
+-    install_dir: tests_execdir,
++    install_dir: tests_bindir,
+   )
+ endif
+diff --git a/meson.build b/meson.build
+index 50441abb..5fc773b1 100644
+--- a/meson.build
++++ b/meson.build
+@@ -20,9 +20,9 @@ gdata_api_version_minor = 0
+ 
+ # Define the install directories
+ gdata_prefix = get_option('prefix')
+-gdata_datadir = get_option('datadir')
+-gdata_libexecdir = get_option('libexecdir')
+-gdata_includedir = get_option('includedir')
++gdata_datadir = gdata_prefix / get_option('datadir')
++gdata_libexecdir = gdata_prefix / get_option('libexecdir')
++gdata_includedir = gdata_prefix / get_option('includedir')
+ 
+ gdata_include_subdir = gdata_name / 'gdata'
+ 
+diff --git a/meson_options.txt b/meson_options.txt
+index 25cc6b55..6fc2cfa3 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -43,3 +43,11 @@ option('vapi',
+   type: 'boolean',
+   value: true,
+   description: 'Enable creation of vapi files')
++
++option('installed_test_datadir', type: 'string',
++  value: '',
++  description: 'Installation directory for data files in tests')
++
++option('installed_test_bindir', type: 'string',
++  value: '',
++  description: 'Installation directory for binary files in tests')
diff --git a/nixpkgs/pkgs/development/libraries/libgdiplus/default.nix b/nixpkgs/pkgs/development/libraries/libgdiplus/default.nix
new file mode 100644
index 000000000000..705205df396c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgdiplus/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, glib, cairo, Carbon, fontconfig
+, libtiff, giflib, libjpeg, libpng
+, libXrender, libexif, autoreconfHook, fetchpatch }:
+
+stdenv.mkDerivation rec {
+  pname = "libgdiplus";
+  version = "6.0.5";
+
+  src = fetchFromGitHub {
+    owner = "mono";
+    repo = "libgdiplus";
+    rev = version;
+    sha256 = "1387lgph5r17viv3rkf5hbksdn435njzmra7s17q0nzk2mkkm68c";
+  };
+
+  NIX_LDFLAGS = "-lgif";
+
+  outputs = [ "out" "dev" ];
+
+  hardeningDisable = [ "format" ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  configureFlags = lib.optional stdenv.cc.isClang "--host=${stdenv.hostPlatform.system}";
+
+  enableParallelBuilding = true;
+
+  buildInputs =
+    [ glib cairo fontconfig libtiff giflib
+      libjpeg libpng libXrender libexif
+    ]
+    ++ lib.optional stdenv.isDarwin Carbon;
+
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    ln -s $out/lib/libgdiplus.0.dylib $out/lib/libgdiplus.so
+  '';
+
+  checkPhase = ''
+    make check -w
+  '';
+
+  meta = with lib; {
+    description = "Mono library that provides a GDI+-compatible API on non-Windows operating systems";
+    homepage = "https://www.mono-project.com/docs/gui/libgdiplus/";
+    platforms = platforms.unix;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgee/default.nix b/nixpkgs/pkgs/development/libraries/libgee/default.nix
new file mode 100644
index 000000000000..1a40d1f17b41
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgee/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, autoconf, vala, pkg-config, glib, gobject-introspection, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "libgee";
+  version = "0.20.4";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "03nyf8n7i7f67fsh220g52slmihdk1lv4iwspm7xmkgrj3rink2j";
+  };
+
+  doCheck = true;
+
+  nativeBuildInputs = [ pkg-config autoconf vala gobject-introspection ];
+  buildInputs = [ glib ];
+
+  PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "${placeholder "dev"}/share/gir-1.0";
+  PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_TYPELIBDIR = "${placeholder "out"}/lib/girepository-1.0";
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "Utility library providing GObject-based interfaces and classes for commonly used data structures";
+    homepage = "https://wiki.gnome.org/Projects/Libgee";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.unix;
+    maintainers = teams.gnome.members;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgeotiff/default.nix b/nixpkgs/pkgs/development/libraries/libgeotiff/default.nix
new file mode 100644
index 000000000000..eb35d5316c0e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgeotiff/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, libtiff, libjpeg, proj, zlib, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  version = "1.5.1";
+  pname = "libgeotiff";
+
+  src = fetchFromGitHub {
+    owner = "OSGeo";
+    repo = "libgeotiff";
+    rev = version;
+    sha256 = "081ag23pn2n5y4fkb2rnh4hmcnq92siqiqv0s20jmx0j3s2nvfxy";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  sourceRoot = "source/libgeotiff";
+
+  configureFlags = [
+    "--with-jpeg=${libjpeg.dev}"
+    "--with-zlib=${zlib.dev}"
+  ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  buildInputs = [ libtiff proj ];
+
+  hardeningDisable = [ "format" ];
+
+  meta = {
+    description = "Library implementing attempt to create a tiff based interchange format for georeferenced raster imagery";
+    homepage = "https://github.com/OSGeo/libgeotiff";
+    license = lib.licenses.mit;
+    maintainers = [lib.maintainers.marcweber];
+    platforms = with lib.platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgepub/default.nix b/nixpkgs/pkgs/development/libraries/libgepub/default.nix
new file mode 100644
index 000000000000..7ae7bff50efa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgepub/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, glib, gobject-introspection, gnome
+, webkitgtk, libsoup, libxml2, libarchive }:
+
+stdenv.mkDerivation rec {
+  pname = "libgepub";
+  version = "0.6.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "16dkyywqdnfngmwsgbyga0kl9vcnzczxi3lmhm27pifrq5f3k2n7";
+  };
+
+  doCheck = true;
+
+  nativeBuildInputs = [ meson ninja pkg-config gobject-introspection ];
+  buildInputs = [ glib webkitgtk libsoup libxml2 libarchive ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    description = "GObject based library for handling and rendering epub documents";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+    maintainers = teams.gnome.members;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgig/default.nix b/nixpkgs/pkgs/development/libraries/libgig/default.nix
new file mode 100644
index 000000000000..26e3b46d5510
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgig/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, autoconf, automake, libsndfile, libtool, pkg-config, libuuid }:
+
+stdenv.mkDerivation rec {
+  pname = "libgig";
+  version = "4.3.0";
+
+  src = fetchurl {
+    url = "https://download.linuxsampler.org/packages/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-oG0Jh4eAxsGd2NucM1RNU6kzV/niexSpg6qrpo//p5Q=";
+  };
+
+  nativeBuildInputs = [ autoconf automake libtool pkg-config ];
+
+  buildInputs = [ libsndfile libuuid ];
+
+  preConfigure = "make -f Makefile.svn";
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "http://www.linuxsampler.org";
+    description = "Gigasampler file access library";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgit2-glib/default.nix b/nixpkgs/pkgs/development/libraries/libgit2-glib/default.nix
new file mode 100644
index 000000000000..56259814d8a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgit2-glib/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchurl, gnome, meson, ninja, pkg-config, vala, libssh2
+, gtk-doc, gobject-introspection, libgit2, glib, python3 }:
+
+stdenv.mkDerivation rec {
+  pname = "libgit2-glib";
+  version = "0.99.0.1";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1pmrcnsa7qdda73c3dxf47733mwprmj5ljpw3acxbj6r8k27anp0";
+  };
+
+  postPatch = ''
+    for f in meson_vapi_link.py meson_python_compile.py; do
+      chmod +x $f
+      patchShebangs $f
+    done
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  nativeBuildInputs = [
+    meson ninja pkg-config vala gtk-doc gobject-introspection
+  ];
+
+  propagatedBuildInputs = [
+    # Required by libgit2-glib-1.0.pc
+    libgit2 glib
+  ];
+
+  buildInputs = [
+    libssh2
+    python3.pkgs.pygobject3 # this should really be a propagated input of python output
+  ];
+
+  meta = with lib; {
+    description = "A glib wrapper library around the libgit2 git access library";
+    homepage = "https://wiki.gnome.org/Projects/Libgit2-glib";
+    license = licenses.lgpl21;
+    maintainers = teams.gnome.members;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgksu/default.nix b/nixpkgs/pkgs/development/libraries/libgksu/default.nix
new file mode 100644
index 000000000000..b00e7b324518
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgksu/default.nix
@@ -0,0 +1,86 @@
+{ lib, stdenv, fetchurl, pkg-config, wrapGAppsHook, gtk2, gnome2, gnome,
+  libstartup_notification, libgtop, perlPackages,
+  autoreconfHook, intltool, docbook_xsl, xauth
+}:
+
+stdenv.mkDerivation rec {
+  version = "2.0.12";
+  pname = "libgksu";
+
+  src = fetchurl {
+    url = "http://people.debian.org/~kov/gksu/${pname}-${version}.tar.gz";
+    sha256 = "1brz9j3nf7l2gd3a5grbp0s3nksmlrp6rxmgp5s6gjvxcb1wzy92";
+  };
+
+  nativeBuildInputs = [
+    pkg-config autoreconfHook intltool docbook_xsl wrapGAppsHook
+  ];
+
+  buildInputs = [
+    gtk2 gnome2.GConf libstartup_notification
+    gnome.libgnome-keyring libgtop gnome2.libglade
+  ] ++ (with perlPackages; [ perl XMLParser ]);
+
+  enableParallelBuilding = true;
+
+  hardeningDisable = [ "format" ];
+
+  patches = [
+        # Patches from the gentoo ebuild
+
+        # Fix compilation on bsdc
+        ./libgksu-2.0.0-fbsd.patch
+
+        # Fix wrong usage of LDFLAGS, gentoo bug #226837
+        ./libgksu-2.0.7-libs.patch
+
+        # Use po/LINGUAS
+        ./libgksu-2.0.7-polinguas.patch
+
+        # Don't forkpty; gentoo bug #298289
+        ./libgksu-2.0.12-revert-forkpty.patch
+
+        # Make this gmake-3.82 compliant, gentoo bug #333961
+        ./libgksu-2.0.12-fix-make-3.82.patch
+
+        # Do not build test programs that are never executed; also fixes gentoo bug #367397 (underlinking issues).
+        ./libgksu-2.0.12-notests.patch
+
+        # Fix automake-1.11.2 compatibility, gentoo bug #397411
+        ./libgksu-2.0.12-automake-1.11.2.patch
+  ];
+
+  postPatch = ''
+    # gentoo bug #467026
+    sed -i -e 's:AM_CONFIG_HEADER:AC_CONFIG_HEADERS:' configure.ac
+
+    # Fix some binary paths
+    sed -i -e 's|/usr/bin/xauth|${xauth}/bin/xauth|g' libgksu/gksu-run-helper.c libgksu/libgksu.c
+    sed -i -e 's|/usr/bin/sudo|/run/wrappers/bin/sudo|g' libgksu/libgksu.c
+    sed -i -e 's|/bin/su\([^d]\)|/run/wrappers/bin/su\1|g' libgksu/libgksu.c
+
+    touch NEWS README
+  '';
+
+  preConfigure = ''
+    intltoolize --force --copy --automake
+  '';
+
+  configureFlags = [
+    "--disable-gtk-doc"
+  ];
+
+  meta = {
+    description = "A library for integration of su into applications";
+    longDescription = ''
+      This library comes from the gksu program. It provides a simple API
+      to use su and sudo in programs that need to execute tasks as other
+      user.  It provides X authentication facilities for running
+      programs in an X session.
+    '';
+    homepage = "https://www.nongnu.org/gksu/";
+    license = lib.licenses.lgpl2;
+    maintainers = [ lib.maintainers.romildo ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.0-fbsd.patch b/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.0-fbsd.patch
new file mode 100644
index 000000000000..5c007be5b4b4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.0-fbsd.patch
@@ -0,0 +1,60 @@
+diff --exclude-from=/home/dang/.diffrc -up -ruN libgksu-2.0.0.orig/libgksu/libgksu.c libgksu-2.0.0/libgksu/libgksu.c
+--- libgksu-2.0.0.orig/libgksu/libgksu.c	2006-09-14 22:35:51.000000000 -0400
++++ libgksu-2.0.0/libgksu/libgksu.c	2006-12-12 11:28:01.000000000 -0500
+@@ -23,7 +23,12 @@
+ #include <unistd.h>
+ #include <string.h>
+ #include <fcntl.h>
++#ifdef __FreeBSD__
++#include <libutil.h>
++#include <termios.h>
++#else
+ #include <pty.h>
++#endif
+ #include <pwd.h>
+ #include <sys/types.h>
+ #include <sys/wait.h>
+diff --exclude-from=/home/dang/.diffrc -up -ruN libgksu-2.0.0.orig/libgksu/Makefile.am libgksu-2.0.0/libgksu/Makefile.am
+--- libgksu-2.0.0.orig/libgksu/Makefile.am	2006-09-14 22:35:52.000000000 -0400
++++ libgksu-2.0.0/libgksu/Makefile.am	2006-12-12 11:28:01.000000000 -0500
+@@ -30,6 +30,6 @@ gksu_run_helper_SOURCES = gksu-run-helpe
+ noinst_PROGRAMS = test-gksu
+ test_gksu_SOURCES = test-gksu.c
+ test_gksu_LDADD = libgksu2.la
+-test_gksu_LDFLAGS = `pkg-config --libs glib-2.0`
++test_gksu_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0`
+ 
+ EXTRA_DIST = libgksu.ver
+diff --exclude-from=/home/dang/.diffrc -up -ruN libgksu-2.0.0.orig/libgksu/Makefile.in libgksu-2.0.0/libgksu/Makefile.in
+--- libgksu-2.0.0.orig/libgksu/Makefile.in	2006-09-23 15:37:44.000000000 -0400
++++ libgksu-2.0.0/libgksu/Makefile.in	2006-12-12 11:30:09.000000000 -0500
+@@ -283,7 +283,7 @@ gksu_run_helper_LDFLAGS = `pkg-config --
+ gksu_run_helper_SOURCES = gksu-run-helper.c
+ test_gksu_SOURCES = test-gksu.c
+ test_gksu_LDADD = libgksu2.la
+-test_gksu_LDFLAGS = `pkg-config --libs glib-2.0`
++test_gksu_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0`
+ EXTRA_DIST = libgksu.ver
+ all: all-am
+ 
+diff --exclude-from=/home/dang/.diffrc -up -ruN libgksu-2.0.0.orig/libgksuui/Makefile.am libgksu-2.0.0/libgksuui/Makefile.am
+--- libgksu-2.0.0.orig/libgksuui/Makefile.am	2006-09-14 22:35:31.000000000 -0400
++++ libgksu-2.0.0/libgksuui/Makefile.am	2006-12-12 11:28:01.000000000 -0500
+@@ -12,4 +12,4 @@ includedir = ${prefix}/include/$(PACKAGE
+ noinst_PROGRAMS = test-gksuui
+ test_gksuui_SOURCES = test-gksuui.c
+ test_gksuui_LDADD = libgksuui1.0.la
+-test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0`
++test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0`
+diff --exclude-from=/home/dang/.diffrc -up -ruN libgksu-2.0.0.orig/libgksuui/Makefile.in libgksu-2.0.0/libgksuui/Makefile.in
+--- libgksu-2.0.0.orig/libgksuui/Makefile.in	2006-09-23 15:37:44.000000000 -0400
++++ libgksu-2.0.0/libgksuui/Makefile.in	2006-12-12 11:30:22.000000000 -0500
+@@ -250,7 +250,7 @@ libgksuui1_0_la_LDFLAGS = -Wl,-O1 `pkg-c
+ noinst_HEADERS = defines.h gksuui.h gksuui-dialog.h
+ test_gksuui_SOURCES = test-gksuui.c
+ test_gksuui_LDADD = libgksuui1.0.la
+-test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0`
++test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0`
+ all: all-am
+ 
+ .SUFFIXES:
diff --git a/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.12-automake-1.11.2.patch b/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.12-automake-1.11.2.patch
new file mode 100644
index 000000000000..0f22166fb8b7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.12-automake-1.11.2.patch
@@ -0,0 +1,25 @@
+Due to the following change, pkglib_PROGRAMS is invalid:
+    http://git.savannah.gnu.org/cgit/automake.git/commit/?id=9ca632642b006ac6b0fc4ce0ae5b34023faa8cbf
+
+https://savannah.nongnu.org/bugs/index.php?35241
+https://bugs.gentoo.org/show_bug.cgi?id=397411
+
+---
+ libgksu/Makefile.am |    4 ++--
+ 1 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/libgksu/Makefile.am b/libgksu/Makefile.am
+index 49362f9..3cb1090 100644
+--- a/libgksu/Makefile.am
++++ b/libgksu/Makefile.am
+@@ -22,8 +22,8 @@ includedir = ${prefix}/include/${PACKAGE}
+ pkgconfigdir = ${libdir}/pkgconfig
+ pkgconfig_DATA = libgksu2.pc
+ 
+-pkglibdir = ${libdir}/${PACKAGE}
+-pkglib_PROGRAMS = gksu-run-helper
++gksulibdir = ${libdir}/${PACKAGE}
++gksulib_PROGRAMS = gksu-run-helper
+ gksu_run_helper_LDADD = ${GLIB_LIBS} 
+ gksu_run_helper_SOURCES = gksu-run-helper.c
+ 
diff --git a/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.12-fix-make-3.82.patch b/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.12-fix-make-3.82.patch
new file mode 100644
index 000000000000..dd52b8247fa4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.12-fix-make-3.82.patch
@@ -0,0 +1,19 @@
+--- libgksu/Makefile.am-orig	2010-08-22 16:11:19.872577459 -0500
++++ libgksu/Makefile.am	2010-08-22 16:11:55.289599110 -0500
+@@ -17,11 +17,11 @@
+ 
+ if GCONF_SCHEMAS_INSTALL
+ install-data-local:
+-        if test -z "$(DESTDIR)" ; then \
+-          for p in $(schemas_DATA) ; do \
+-            GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$$p ; \
+-          done \
+-        fi
++	if test -z "$(DESTDIR)" ; then \
++		for p in $(schemas_DATA) ; do \
++			GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(srcdir)/$$p ; \
++		done \
++	fi
+ else
+ install-data-local:
+ endif
diff --git a/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.12-notests.patch b/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.12-notests.patch
new file mode 100644
index 000000000000..3787ef6bfc13
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.12-notests.patch
@@ -0,0 +1,26 @@
+Index: libgksu-2.0.12/libgksu/Makefile.am
+===================================================================
+--- libgksu-2.0.12.orig/libgksu/Makefile.am
++++ libgksu-2.0.12/libgksu/Makefile.am
+@@ -27,7 +27,7 @@ pkglib_PROGRAMS = gksu-run-helper
+ gksu_run_helper_LDFLAGS = `pkg-config --libs glib-2.0`
+ gksu_run_helper_SOURCES = gksu-run-helper.c
+ 
+-noinst_PROGRAMS = test-gksu
++EXTRA_PROGRAMS = test-gksu
+ test_gksu_SOURCES = test-gksu.c
+ test_gksu_LDADD = libgksu2.la
+ test_gksu_LDFLAGS = `pkg-config --libs glib-2.0`
+Index: libgksu-2.0.12/libgksuui/Makefile.am
+===================================================================
+--- libgksu-2.0.12.orig/libgksuui/Makefile.am
++++ libgksu-2.0.12/libgksuui/Makefile.am
+@@ -9,7 +9,7 @@ libgksuui1_0_la_LDFLAGS = -Wl,-O1 `pkg-c
+ noinst_HEADERS = defines.h gksuui.h gksuui-dialog.h
+ includedir = ${prefix}/include/$(PACKAGE)
+ 
+-noinst_PROGRAMS = test-gksuui
++EXTRA_PROGRAMS = test-gksuui
+ test_gksuui_SOURCES = test-gksuui.c
+ test_gksuui_LDADD = libgksuui1.0.la
+ test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0`
diff --git a/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.12-revert-forkpty.patch b/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.12-revert-forkpty.patch
new file mode 100644
index 000000000000..2c3a8cc786bb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.12-revert-forkpty.patch
@@ -0,0 +1,359 @@
+diff --exclude-from=/home/dang/.scripts/diffrc -up -ruN libgksu-2.0.12.orig/libgksu/libgksu.c libgksu-2.0.12/libgksu/libgksu.c
+--- libgksu-2.0.12.orig/libgksu/libgksu.c	2009-06-29 13:48:24.000000000 -0400
++++ libgksu-2.0.12/libgksu/libgksu.c	2010-01-12 07:32:10.450657456 -0500
+@@ -1,7 +1,6 @@
+ /*
+  * Gksu -- a library providing access to su functionality
+  * Copyright (C) 2004-2009 Gustavo Noronha Silva
+- * Portions Copyright (C) 2009 VMware, Inc.
+  *
+  * This library is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU Lesser General Public
+@@ -56,9 +55,6 @@
+ static void
+ gksu_context_launch_complete (GksuContext *context);
+ 
+-static void
+-read_line (int fd, gchar *buffer, int n);
+-
+ GType
+ gksu_error_get_type (void)
+ {
+@@ -2009,8 +2005,6 @@ gksu_su_fuller (GksuContext *context,
+       for (i = 0 ; cmd[i] != NULL ; i++)
+ 	g_free (cmd[i]);
+       g_free(cmd);
+-
+-      _exit(1);
+     }
+   else if (pid == -1)
+     {
+@@ -2125,10 +2119,10 @@ gksu_su_fuller (GksuContext *context,
+ 	  /* drop the \n echoed on password entry if su did request
+ 	     a password */
+ 	  if (password_needed)
+-	    read_line (fdpty, buf, 255);
++	    read (fdpty, buf, 255);
+ 	  if (context->debug)
+ 	    fprintf (stderr, "DEBUG (run:post-after-pass) buf: -%s-\n", buf);
+-	  read_line (fdpty, buf, 255);
++	  read (fdpty, buf, 255);
+ 	  if (context->debug)
+ 	    fprintf (stderr, "DEBUG (run:post-after-pass) buf: -%s-\n", buf);
+ 	}
+@@ -2142,9 +2136,7 @@ gksu_su_fuller (GksuContext *context,
+ 	{
+ 	  int retval = 0;
+ 
+-	  /* Red Hat's su shows the full path to su in its error messages. */
+-	  if (!strncmp (buf, "su:", 3) ||
+-	      !strncmp (buf, "/bin/su:", 7))
++	  if (!strncmp (buf, "su", 2))
+ 	    {
+ 	      gchar **strings;
+ 
+@@ -2155,11 +2147,7 @@ gksu_su_fuller (GksuContext *context,
+ 		}
+ 
+ 	      strings = g_strsplit (buf, ":", 2);
+-
+-	      /* Red Hat and Fedora use 'incorrect password'. */
+-	      if (strings[1] &&
+-	          (g_str_has_prefix(strings[1], " Authentication failure") ||
+-	           g_str_has_prefix(strings[1], " incorrect password")))
++	      if (strings[1] && !strncmp (strings[1], " Authentication failure", 23))
+ 		{
+ 		  if (used_gnome_keyring)
+ 		    g_set_error (error, gksu_quark,
+@@ -2473,12 +2461,6 @@ gksu_sudo_fuller (GksuContext *context,
+ {
+   char **cmd;
+   char buffer[256] = {0};
+-  char *child_stderr = NULL;
+-  /* This command is used to gain a token */
+-  char *const verifycmd[] =
+-    {
+-      "/usr/bin/sudo", "-p", "GNOME_SUDO_PASS", "-v", NULL
+-    };
+   int argcount = 8;
+   int i, j;
+ 
+@@ -2489,8 +2471,9 @@ gksu_sudo_fuller (GksuContext *context,
+ 
+   pid_t pid;
+   int status;
+-  FILE *fdfile = NULL;
+-  int fdpty = -1;
++  FILE *infile, *outfile;
++  int parent_pipe[2];	/* For talking to the parent */
++  int child_pipe[2];	/* For talking to the child */
+ 
+   context->sudo_mode = TRUE;
+ 
+@@ -2565,10 +2548,6 @@ gksu_sudo_fuller (GksuContext *context,
+   cmd[argcount] = g_strdup("-S");
+   argcount++;
+ 
+-  /* Make sudo noninteractive (we should already have a token) */
+-  cmd[argcount] = g_strdup("-n");
+-  argcount++;
+-
+   /* Make sudo use next arg as prompt */
+   cmd[argcount] = g_strdup("-p");
+   argcount++;
+@@ -2647,21 +2626,26 @@ gksu_sudo_fuller (GksuContext *context,
+ 	fprintf (stderr, "cmd[%d]: %s\n", i, cmd[i]);
+     }
+ 
+-  pid = forkpty(&fdpty, NULL, NULL, NULL);
+-  if (pid == 0)
++  if ((pipe(parent_pipe)) == -1)
+     {
+-      // Child
+-      setsid();   // make us session leader
+-
+-      execv(verifycmd[0], verifycmd);
++      g_set_error (error, gksu_quark, GKSU_ERROR_PIPE,
++		   _("Error creating pipe: %s"),
++		   strerror(errno));
++      sudo_reset_xauth (context, xauth, xauth_env);
++      return FALSE;
++    }
+ 
+-      g_set_error (error, gksu_quark, GKSU_ERROR_EXEC,
+-		   _("Failed to exec new process: %s"),
++  if ((pipe(child_pipe)) == -1)
++    {
++      g_set_error (error, gksu_quark, GKSU_ERROR_PIPE,
++		   _("Error creating pipe: %s"),
+ 		   strerror(errno));
+       sudo_reset_xauth (context, xauth, xauth_env);
+       return FALSE;
+     }
+-  else if (pid == -1)
++
++  pid = fork();
++  if (pid == -1)
+     {
+       g_set_error (error, gksu_quark, GKSU_ERROR_FORK,
+ 		   _("Failed to fork new process: %s"),
+@@ -2669,26 +2653,56 @@ gksu_sudo_fuller (GksuContext *context,
+       sudo_reset_xauth (context, xauth, xauth_env);
+       return FALSE;
+     }
++  else if (pid == 0)
++    {
++      // Child
++      setsid();   // make us session leader
++      close(child_pipe[1]);
++      dup2(child_pipe[0], STDIN_FILENO);
++      dup2(parent_pipe[1], STDERR_FILENO);
+ 
++      execv(cmd[0], cmd);
++
++      g_set_error (error, gksu_quark, GKSU_ERROR_EXEC,
++		   _("Failed to exec new process: %s"),
++		   strerror(errno));
++      sudo_reset_xauth (context, xauth, xauth_env);
++      return FALSE;
++    }
+   else
+     {
+       gint counter = 0;
+       gchar *cmdline = NULL;
+-      struct termios tio;
+ 
+       // Parent
+-      fdfile = fdopen(fdpty, "w+");
++      close(parent_pipe[1]);
+ 
+-      /* make sure we notice that ECHO is turned off, if it gets
+-         turned off */
+-      tcgetattr (fdpty, &tio);
+-      for (counter = 0; (tio.c_lflag & ECHO) && counter < 15; counter++)
+-      {
+-        usleep (1000);
+-        tcgetattr (fdpty, &tio);
+-      }
++      infile = fdopen(parent_pipe[0], "r");
++      if (!infile)
++	{
++	  g_set_error (error, gksu_quark, GKSU_ERROR_PIPE,
++		       _("Error opening pipe: %s"),
++		       strerror(errno));
++	  sudo_reset_xauth (context, xauth, xauth_env);
++	  return FALSE;
++	}
+ 
+-      fcntl (fdpty, F_SETFL, O_NONBLOCK);
++      outfile = fdopen(child_pipe[1], "w");
++      if (!outfile)
++	{
++	  g_set_error (error, gksu_quark, GKSU_ERROR_PIPE,
++		       _("Error opening pipe: %s"),
++		       strerror(errno));
++	  sudo_reset_xauth (context, xauth, xauth_env);
++	  return FALSE;
++	}
++
++      /*
++	we are expecting to receive a GNOME_SUDO_PASS
++	if we don't there are two possibilities: an error
++	or a password is not needed
++      */
++      fcntl (parent_pipe[0], F_SETFL, O_NONBLOCK);
+ 
+       { /* no matter if we can read, since we're using
+ 	   O_NONBLOCK; this is just to avoid the prompt
+@@ -2697,11 +2711,11 @@ gksu_sudo_fuller (GksuContext *context,
+ 	struct timeval tv;
+ 
+ 	FD_ZERO(&rfds);
+-	FD_SET(fdpty, &rfds);
++	FD_SET(parent_pipe[0], &rfds);
+ 	tv.tv_sec = 1;
+ 	tv.tv_usec = 0;
+ 
+-	select (fdpty + 1, &rfds, NULL, NULL, &tv);
++	select (parent_pipe[0] + 1, &rfds, NULL, NULL, &tv);
+       }
+ 
+       /* Try hard to find the prompt; it may happen that we're
+@@ -2713,7 +2727,7 @@ gksu_sudo_fuller (GksuContext *context,
+ 	  if (strncmp (buffer, "GNOME_SUDO_PASS", 15) == 0)
+ 	    break;
+ 
+-	  read_line (fdpty, buffer, 256);
++	  read_line (parent_pipe[0], buffer, 256);
+ 
+ 	  if (context->debug)
+ 	    fprintf (stderr, "buffer: -%s-\n", buffer);
+@@ -2747,17 +2761,18 @@ gksu_sudo_fuller (GksuContext *context,
+ 
+ 	  usleep (1000);
+ 
+-	  write (fdpty, password, strlen(password) + 1);
+-	  write (fdpty, "\n", 1);
++	  fprintf (outfile, "%s\n", password);
++	  fclose (outfile);
+ 
+ 	  nullify_password (password);
+ 
+-	  fcntl(fdpty, F_SETFL, fcntl(fdpty, F_GETFL) & ~O_NONBLOCK);
++	  /* turn NONBLOCK off */
++	  fcntl(parent_pipe[0], F_SETFL, fcntl(parent_pipe[0], F_GETFL) & ~O_NONBLOCK);
+ 	  /* ignore the first newline that comes right after sudo receives
+ 	     the password */
+-	  fgets (buffer, 255, fdfile);
+-	  /* this is the status we are interested in */
+-	  fgets (buffer, 255, fdfile);
++	  fgets (buffer, 255, infile);
++	  /* this is the status we are interessted in */
++	  fgets (buffer, 255, infile);
+ 	}
+       else
+ 	{
+@@ -2766,7 +2781,7 @@ gksu_sudo_fuller (GksuContext *context,
+ 	    fprintf (stderr, "No password prompt found; we'll assume we don't need a password.\n");
+ 
+           /* turn NONBLOCK off, also if have no prompt */
+-          fcntl(fdpty, F_SETFL, fcntl(fdpty, F_GETFL) & ~O_NONBLOCK);
++          fcntl(parent_pipe[0], F_SETFL, fcntl(parent_pipe[0], F_GETFL) & ~O_NONBLOCK);
+ 
+ 	  should_display = gconf_client_get_bool (context->gconf_client,
+ 						  BASE_PATH "display-no-pass-info", NULL);
+@@ -2785,9 +2800,14 @@ gksu_sudo_fuller (GksuContext *context,
+ 	  fprintf (stderr, "%s", buffer);
+ 	}
+ 
+-      if (g_str_has_prefix (buffer, "Sorry, try again."))
++      if (!strcmp (buffer, "Sorry, try again.\n"))
+ 	g_set_error (error, gksu_quark, GKSU_ERROR_WRONGPASS,
+ 		     _("Wrong password."));
++      else if (!strncmp (buffer, "Sorry, user ", 12))
++	g_set_error (error, gksu_quark, GKSU_ERROR_NOT_ALLOWED,
++		     _("The underlying authorization mechanism (sudo) "
++		       "does not allow you to run this program. Contact "
++		       "the system administrator."));
+       else
+ 	{
+ 	  gchar *haystack = buffer;
+@@ -2805,10 +2825,6 @@ gksu_sudo_fuller (GksuContext *context,
+ 	    }
+ 	}
+ 
+-      /* If we have an error, let's just stop sudo right there. */
+-      if (error)
+-        close(fdpty);
+-
+       cmdline = g_strdup("sudo");
+       /* wait for the child process to end or become something other
+ 	 than sudo */
+@@ -2825,23 +2841,17 @@ gksu_sudo_fuller (GksuContext *context,
+       if (context->sn_context)
+ 	gksu_context_launch_complete (context);
+ 
++      while (read (parent_pipe[0], buffer, 255) > 0)
++	{
++	  fprintf (stderr, "%s", buffer);
++	  bzero(buffer, 256);
++	}
++
+       /* if the process is still active waitpid() on it */
+       if (pid_exited != pid)
+ 	waitpid(pid, &status, 0);
+       sudo_reset_xauth (context, xauth, xauth_env);
+ 
+-      /*
+-       * Did token acquisition succeed? If so, spawn sudo in
+-       * non-interactive mode. It should either succeed or die
+-       * immediately if you're not allowed to run the command.
+-       */
+-      if (WEXITSTATUS(status) == 0)
+-        {
+-          g_spawn_sync(NULL, cmd, NULL, 0, NULL, NULL,
+-                       NULL, &child_stderr, &status,
+-                       error);
+-        }
+-
+       if (exit_status)
+       {
+       	if (WIFEXITED(status)) {
+@@ -2853,13 +2863,6 @@ gksu_sudo_fuller (GksuContext *context,
+ 
+       if (WEXITSTATUS(status))
+ 	{
+-          if (g_str_has_prefix(child_stderr, "Sorry, user "))
+-            {
+-              g_set_error (error, gksu_quark, GKSU_ERROR_NOT_ALLOWED,
+-                           _("The underlying authorization mechanism (sudo) "
+-                             "does not allow you to run this program. Contact "
+-                             "the system administrator."));
+-            }
+ 	  if(cmdline)
+ 	    {
+ 	      /* sudo already exec()ed something else, don't report
+@@ -2868,7 +2871,6 @@ gksu_sudo_fuller (GksuContext *context,
+ 	      if (!g_str_has_suffix (cmdline, "sudo"))
+ 		{
+ 		  g_free (cmdline);
+-		  g_free (child_stderr);
+ 		  return FALSE;
+ 		}
+ 	      g_free (cmdline);
+@@ -2881,11 +2883,11 @@ gksu_sudo_fuller (GksuContext *context,
+ 	}
+     }
+ 
+-  fprintf(stderr, child_stderr);
+-  g_free(child_stderr);
+-
+   /* if error is set we have found an error condition */
+-  return (error == NULL);
++  if (error)
++    return FALSE;
++
++  return TRUE;
+ }
+ 
+ /**
diff --git a/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.7-libs.patch b/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.7-libs.patch
new file mode 100644
index 000000000000..b9fb77f27147
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.7-libs.patch
@@ -0,0 +1,76 @@
+# https://savannah.nongnu.org/bugs/?25362
+# https://bugs.gentoo.org/show_bug.cgi?id=226837
+diff -Nura a/configure.ac b/configure.ac
+--- a/configure.ac	2009-01-19 22:15:30.000000000 +0100
++++ b/configure.ac	2009-01-19 22:18:10.000000000 +0100
+@@ -43,6 +43,9 @@
+ PKG_CHECK_MODULES(LIBGKSU, [gtk+-2.0 >= 2.4.0, gconf-2.0, libstartup-notification-1.0, gnome-keyring-1, libgtop-2.0])
+ PKG_CHECK_MODULES(GKSU_PROPERTIES, [gtk+-2.0 >= 2.4.0, gconf-2.0, libglade-2.0])
+ 
++PKG_CHECK_MODULES(GLIB, [glib-2.0 gthread-2.0])
++PKG_CHECK_MODULES(GTK, [gtk+-2.0 gconf-2.0])
++
+ # Checks for library functions.
+ ALL_LINGUAS="ca cs da de es eu fr hu it ko lt pl pt_BR ro ru sk sv nb nl zh_CN"
+ 
+diff -Nura a/gksu-properties/Makefile.am b/gksu-properties/Makefile.am
+--- a/gksu-properties/Makefile.am	2009-01-19 22:15:59.000000000 +0100
++++ b/gksu-properties/Makefile.am	2009-01-19 22:19:13.000000000 +0100
+@@ -3,7 +3,7 @@
+ AM_CPPFLAGS = -DLOCALEDIR=\"$(datadir)/locale\" -DDATA_DIR=\"$(datadir)\" -DPREFIX=\"$(prefix)\"
+ 
+ bin_PROGRAMS = gksu-properties
+-gksu_properties_LDFLAGS = ${GKSU_PROPERTIES_LIBS}
++gksu_properties_LDADD = ${GKSU_PROPERTIES_LIBS}
+ gksu_properties_SOURCES = gksu-properties.c
+ 
+ gladedir = ${prefix}/share/${PACKAGE}
+diff -Nura a/libgksu/Makefile.am b/libgksu/Makefile.am
+--- a/libgksu/Makefile.am	2009-01-19 22:15:59.000000000 +0100
++++ b/libgksu/Makefile.am	2009-01-19 22:18:25.000000000 +0100
+@@ -8,8 +8,8 @@
+ # major -> breaks backward compatibility (changes to existing ABI)
+ # minor -> keeps compatibility (additions to the API)
+ # micro -> no change to the API/ABI
+-libgksu2_la_LIBADD = ../libgksuui/libgksuui1.0.la
+-libgksu2_la_LDFLAGS = -version-info 0:2:0 -Wl,-O1 -lutil ${LIBGKSU_LIBS}
++libgksu2_la_LIBADD = ../libgksuui/libgksuui1.0.la -lutil ${LIBGKSU_LIBS}
++libgksu2_la_LDFLAGS = -version-info 0:2:0 -Wl,-O1
+ if USE_VERSION_SCRIPT
+ libgksu2_la_LDFLAGS += -Wl,--version-script=libgksu.ver
+ endif
+@@ -24,12 +24,11 @@
+ 
+ pkglibdir = ${libdir}/${PACKAGE}
+ pkglib_PROGRAMS = gksu-run-helper
+-gksu_run_helper_LDFLAGS = `pkg-config --libs glib-2.0`
++gksu_run_helper_LDADD = ${GLIB_LIBS} 
+ gksu_run_helper_SOURCES = gksu-run-helper.c
+ 
+ noinst_PROGRAMS = test-gksu
+ test_gksu_SOURCES = test-gksu.c
+-test_gksu_LDADD = libgksu2.la
+-test_gksu_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0`
++test_gksu_LDADD = libgksu2.la ${GLIB_LIBS}
+ 
+ EXTRA_DIST = libgksu.ver
+diff -Nura a/libgksuui/Makefile.am b/libgksuui/Makefile.am
+--- a/libgksuui/Makefile.am	2009-01-19 22:15:59.000000000 +0100
++++ b/libgksuui/Makefile.am	2009-01-19 22:18:54.000000000 +0100
+@@ -4,12 +4,13 @@
+ 
+ noinst_LTLIBRARIES = libgksuui1.0.la
+ libgksuui1_0_la_SOURCES = gksuui-dialog.c
+-libgksuui1_0_la_LDFLAGS = -Wl,-O1 `pkg-config --libs gtk+-2.0 gconf-2.0`
++libgksuui1_0_la_LDFLAGS = -Wl,-O1
++libgksuui1_0_la_LIBADD = ${GTK_LIBS}
+ 
+ noinst_HEADERS = defines.h gksuui.h gksuui-dialog.h
+ includedir = ${prefix}/include/$(PACKAGE)
+ 
+ noinst_PROGRAMS = test-gksuui
+ test_gksuui_SOURCES = test-gksuui.c
+-test_gksuui_LDADD = libgksuui1.0.la
+-test_gksuui_LDFLAGS = `pkg-config --libs glib-2.0 gthread-2.0`
++test_gksuui_LDADD = libgksuui1.0.la ${GLIB_LIBS}
++
diff --git a/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.7-polinguas.patch b/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.7-polinguas.patch
new file mode 100644
index 000000000000..e423af16b44c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgksu/libgksu-2.0.7-polinguas.patch
@@ -0,0 +1,40 @@
+# https://savannah.nongnu.org/bugs/?25360
+diff -Nura a/configure.ac b/configure.ac
+--- a/configure.ac	2009-01-19 21:50:57.000000000 +0100
++++ b/configure.ac	2009-01-19 21:53:21.000000000 +0100
+@@ -50,7 +50,7 @@
+ GETTEXT_PACKAGE=AC_PACKAGE_NAME
+ AC_SUBST(GETTEXT_PACKAGE)
+ 
+-IT_PROG_INTLTOOL
++IT_PROG_INTLTOOL([0.35.5])
+ AM_GLIB_GNU_GETTEXT
+ 
+ ##################################################
+diff -Nura a/po/LINGUAS b/po/LINGUAS
+--- a/po/LINGUAS	1970-01-01 01:00:00.000000000 +0100
++++ b/po/LINGUAS	2009-01-19 21:54:24.000000000 +0100
+@@ -0,0 +1,23 @@
++# please keep this list sorted alphabetically
++# http://live.gnome.org/GnomeGoals/PoLinguas
++#
++ca
++cs
++da
++de
++es
++eu
++fr
++hu
++it
++ko
++lt
++pl
++pt_BR
++ro
++ru
++sk
++sv
++nb
++nl
++zh_CN
diff --git a/nixpkgs/pkgs/development/libraries/libglvnd/default.nix b/nixpkgs/pkgs/development/libraries/libglvnd/default.nix
new file mode 100644
index 000000000000..65d0651ed415
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libglvnd/default.nix
@@ -0,0 +1,70 @@
+{ stdenv, lib, fetchFromGitLab
+, autoreconfHook, pkg-config, python3, addOpenGLRunpath
+, libX11, libXext, xorgproto
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libglvnd";
+  version = "1.3.3";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.freedesktop.org";
+    owner = "glvnd";
+    repo = "libglvnd";
+    rev = "v${version}";
+    sha256 = "0gjk6m3gkdm12bmih2jflp0v5s1ibkixk7mrzrk0cj884m3hy1z6";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config python3 addOpenGLRunpath ];
+  buildInputs = [ libX11 libXext xorgproto ];
+
+  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 = 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");
+
+  configureFlags  = []
+    # Indirectly: https://bugs.freedesktop.org/show_bug.cgi?id=35268
+    ++ lib.optional stdenv.hostPlatform.isMusl "--disable-tls"
+    # Remove when aarch64-darwin asm support is upstream: https://gitlab.freedesktop.org/glvnd/libglvnd/-/issues/216
+    ++ lib.optional (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) "--disable-asm";
+
+  outputs = [ "out" "dev" ];
+
+  # Set RUNPATH so that libGLX can find driver libraries in /run/opengl-driver(-32)/lib.
+  # Note that libEGL does not need it because it uses driver config files which should
+  # contain absolute paths to libraries.
+  postFixup = ''
+    addOpenGLRunpath $out/lib/libGLX.so
+  '';
+
+  passthru = { inherit (addOpenGLRunpath) driverLink; };
+
+  meta = with lib; {
+    description = "The GL Vendor-Neutral Dispatch library";
+    longDescription = ''
+      libglvnd is a vendor-neutral dispatch layer for arbitrating OpenGL API
+      calls between multiple vendors. It allows multiple drivers from different
+      vendors to coexist on the same filesystem, and determines which vendor to
+      dispatch each API call to at runtime.
+      Both GLX and EGL are supported, in any combination with OpenGL and OpenGL ES.
+    '';
+    inherit (src.meta) homepage;
+    # https://gitlab.freedesktop.org/glvnd/libglvnd#libglvnd:
+    license = with licenses; [ mit bsd1 bsd3 gpl3Only asl20 ];
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ primeos ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgmpris/default.nix b/nixpkgs/pkgs/development/libraries/libgmpris/default.nix
new file mode 100644
index 000000000000..a7826fabd134
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgmpris/default.nix
@@ -0,0 +1,34 @@
+{ stdenv
+, lib
+, fetchurl
+, pkg-config
+, glib
+, gobject-introspection
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libgmpris";
+  version = "2.2.1-8";
+
+  src = fetchurl {
+    url = "https://www.sonarnerd.net/src/focal/src/${pname}_${version}.tar.gz";
+    sha256 = "sha256-iyKNmg6sf+mxlY/4vt5lKdrKfJzkoCYU2j1O8uwk8K4=";
+  };
+
+  nativeBuildInputs = [ pkg-config gobject-introspection ];
+
+  buildInputs = [ glib ];
+
+  postInstall = ''
+    mkdir -p $out/share/doc/${pname}
+    cp ./AUTHORS $out/share/doc/${pname}
+    cp ./README $out/share/doc/${pname}
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.sonarnerd.net/src/";
+    description = "GMPRIS GDBus bindings GDBus bindings generated from the GMPRIS XML spec files";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ lovesegfault ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgnome-keyring/default.nix b/nixpkgs/pkgs/development/libraries/libgnome-keyring/default.nix
new file mode 100644
index 000000000000..3f5a5961ba0f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgnome-keyring/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, glib, dbus, libgcrypt, pkg-config, intltool }:
+
+stdenv.mkDerivation rec {
+  pname = "libgnome-keyring";
+  version = "2.32.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
+    sha256 = "030gka96kzqg1r19b4xrmac89hf1xj1kr5p461yvbzfxh46qqf2n";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  propagatedBuildInputs = [ glib dbus libgcrypt ];
+  nativeBuildInputs = [ pkg-config intltool ];
+
+  meta = {
+    inherit (glib.meta) platforms maintainers;
+    homepage = "https://wiki.gnome.org/Projects/GnomeKeyring";
+    license = with lib.licenses; [ gpl2 lgpl2 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgnomekbd/default.nix b/nixpkgs/pkgs/development/libraries/libgnomekbd/default.nix
new file mode 100644
index 000000000000..957c21342524
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgnomekbd/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, pkg-config, file, intltool, glib, gtk3, libxklavier, wrapGAppsHook, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "libgnomekbd";
+  version = "3.26.1";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0y962ykn3rr9gylj0pwpww7bi20lmhvsw6qvxs5bisbn2mih5jpp";
+  };
+
+  nativeBuildInputs = [
+    file
+    intltool
+    pkg-config
+    wrapGAppsHook
+  ];
+
+  # Requires in libgnomekbd.pc
+  propagatedBuildInputs = [
+    gtk3
+    libxklavier
+    glib
+  ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "Keyboard management library";
+    maintainers = teams.gnome.members;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgnt/default.nix b/nixpkgs/pkgs/development/libraries/libgnt/default.nix
new file mode 100644
index 000000000000..33ce7fbaa113
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgnt/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, lib, fetchurl, meson, ninja, pkg-config
+, gtk-doc, docbook-xsl-nons
+, glib, ncurses, libxml2
+, buildDocs ? true
+}:
+stdenv.mkDerivation rec {
+  pname = "libgnt";
+  version = "2.14.1";
+
+  outputs = [ "out" "dev" ] ++ lib.optional buildDocs "devdoc";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/pidgin/${pname}-${version}.tar.xz";
+    sha256 = "1n2bxg0ignn53c08cp69pj4sdg53kwlqn23rincyjmpr327fdhsy";
+  };
+
+  nativeBuildInputs = [ meson ninja pkg-config ]
+    ++ lib.optionals buildDocs [ gtk-doc docbook-xsl-nons ];
+
+  buildInputs = [ glib ncurses libxml2 ];
+
+  postPatch = ''
+    substituteInPlace meson.build --replace \
+      "ncurses_sys_prefix = '/usr'" \
+      "ncurses_sys_prefix = '${lib.getDev ncurses}'"
+  '' + lib.optionalString (!buildDocs) ''
+    sed "/^subdir('doc')$/d" -i meson.build
+  '';
+
+  meta = with lib; {
+    description = "An ncurses toolkit for creating text-mode graphical user interfaces";
+    homepage = "https://keep.imfreedom.org/libgnt/libgnt/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+    maintainers = with lib.maintainers; [ ony ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgnurl/default.nix b/nixpkgs/pkgs/development/libraries/libgnurl/default.nix
new file mode 100644
index 000000000000..bc9a09ab9262
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgnurl/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchurl, libtool, perl, pkg-config, python3, zlib, gnutls
+, libidn2, libunistring }:
+
+stdenv.mkDerivation rec {
+  pname = "libgnurl";
+  version = "7.72.0";
+
+  src = fetchurl {
+    url = "mirror://gnu/gnunet/gnurl-${version}.tar.gz";
+    sha256 = "1y4laraq37kw8hc8jlzgcw7y37bfd0n71q0sy3d3z6yg7zh2prxi";
+  };
+
+  nativeBuildInputs = [ libtool perl pkg-config python3 ];
+
+  buildInputs = [ gnutls zlib libidn2 libunistring ];
+
+  configureFlags = [
+    "--disable-ntlm-wb"
+    "--without-ca-bundle"
+    "--with-ca-fallback"
+    # below options will cause errors if enabled
+    "--disable-ftp"
+    "--disable-tftp"
+    "--disable-file"
+    "--disable-ldap"
+    "--disable-dict"
+    "--disable-rtsp"
+    "--disable-telnet"
+    "--disable-pop3"
+    "--disable-imap"
+    "--disable-smb"
+    "--disable-smtp"
+    "--disable-gopher"
+    "--without-ssl" # disables only openssl, not ssl in general
+    "--without-libpsl"
+    "--without-librtmp"
+  ];
+
+  meta = with lib; {
+    description = "A fork of libcurl used by GNUnet";
+    homepage    = "https://gnunet.org/en/gnurl.html";
+    maintainers = with maintainers; [ 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
new file mode 100644
index 000000000000..e46e25593365
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgpg-error/default.nix
@@ -0,0 +1,78 @@
+{ stdenv, lib, buildPackages, fetchurl, gettext
+, genPosixLockObjOnly ? false
+}: let
+  genPosixLockObjOnlyAttrs = lib.optionalAttrs genPosixLockObjOnly {
+    buildPhase = ''
+      cd src
+      make gen-posix-lock-obj
+    '';
+
+    installPhase = ''
+      mkdir -p $out/bin
+      install -m755 gen-posix-lock-obj $out/bin
+    '';
+
+    outputs = [ "out" ];
+    outputBin = "out";
+  };
+in stdenv.mkDerivation (rec {
+  pname = "libgpg-error";
+  version = "1.42";
+
+  src = fetchurl {
+    url = "mirror://gnupg/${pname}/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-/AfnD2xhX4xPWQqON6m43S4soelAj45gRZxnRSuSXiM=";
+  };
+
+  # 1.42 breaks (some?) cross-compilation (e.g. x86_64 -> aarch64).
+  # Backporting this fix (merged in upstream master but no release cut) by David Michael <fedora.dm0@gmail.com> https://dev.gnupg.org/rE33593864cd54143db594c4237bba41e14179061c
+  patches = [ ./fix-1.42-cross-compilation.patch ];
+
+  postPatch = ''
+    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) ''
+    ln -s src/syscfg/lock-obj-pub.arm-unknown-linux-gnueabi.h src/syscfg/lock-obj-pub.arm-unknown-linux-musleabihf.h
+    ln -s src/syscfg/lock-obj-pub.arm-unknown-linux-gnueabi.h src/syscfg/lock-obj-pub.linux-musleabihf.h
+  '';
+
+  outputs = [ "out" "dev" "info" ];
+  outputBin = "dev"; # deps want just the lib, most likely
+
+  # If architecture-dependent MO files aren't available, they're generated
+  # during build, so we need gettext for cross-builds.
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ gettext ];
+
+  postConfigure =
+    lib.optionalString stdenv.isSunOS
+    # For some reason, /bin/sh on OpenIndiana leads to this at the end of the
+    # `config.status' run:
+    #   ./config.status[1401]: shift: (null): bad number
+    # (See <https://hydra.nixos.org/build/2931046/nixlog/1/raw>.)
+    # Thus, re-run it with Bash.
+      "${stdenv.shell} config.status";
+
+  doCheck = true; # not cross
+
+  meta = with lib; {
+    homepage = "https://www.gnupg.org/software/libgpg-error/index.html";
+    changelog = "https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgpg-error.git;a=blob;f=NEWS;hb=refs/tags/libgpg-error-${version}";
+    description = "A small library that defines common error values for all GnuPG components";
+
+    longDescription = ''
+      Libgpg-error is a small library that defines common error values
+      for all GnuPG components.  Among these are GPG, GPGSM, GPGME,
+      GPG-Agent, libgcrypt, Libksba, DirMngr, Pinentry, SmartCard
+      Daemon and possibly more in the future.
+    '';
+
+    license = licenses.lgpl2Plus;
+    platforms = platforms.all;
+    maintainers = [ maintainers.vrthra ];
+  };
+} // genPosixLockObjOnlyAttrs)
diff --git a/nixpkgs/pkgs/development/libraries/libgpg-error/fix-1.42-cross-compilation.patch b/nixpkgs/pkgs/development/libraries/libgpg-error/fix-1.42-cross-compilation.patch
new file mode 100644
index 000000000000..6c3099f72144
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgpg-error/fix-1.42-cross-compilation.patch
@@ -0,0 +1,142 @@
+diff --git a/src/gen-lock-obj.sh b/src/gen-lock-obj.sh
+index a710f0c..258eec6 100755
+--- a/src/gen-lock-obj.sh
++++ b/src/gen-lock-obj.sh
+@@ -1,136 +1,136 @@
+ #! /bin/sh
+ #
+ # gen-lock-obj.sh - Build tool to construct the lock object.
+ #
+ # Copyright (C) 2020, 2021  g10 Code GmbH
+ #
+ # This file is part of libgpg-error.
+ #
+ # libgpg-error 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.
+ #
+ # libgpg-error 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 this program; if not, see <https://www.gnu.org/licenses/>.
+ #
+ 
+ #
+ # Following variables should be defined to invoke this script
+ #
+ #   CC
+ #   OBJDUMP
+ #   AWK
+ #   ac_ext
+ #   ac_object
+ #   host
+ #   LOCK_ABI_VERSION
+ #
+ # An example:
+ #
+ # LOCK_ABI_VERSION=1 host=x86_64-pc-linux-gnu host_alias=x86_64-linux-gnu \
+ #     CC=$host_alias-gcc OBJDUMP=$host_alias-objdump ac_ext=c ac_objext=o \
+ #     AWK=gawk ./gen-lock-obj.sh
+ #
+ 
+-if test -n `echo -n`; then
++if test -n "`echo -n`"; then
+     ECHO_C='\c'
+     ECHO_N=''
+ else
+     ECHO_C=''
+     ECHO_N='-n'
+ fi
+ 
+ if test "$1" = --disable-threads; then
+     cat <<EOF
+ ## lock-obj-pub.$host.h - NO LOCK SUPPORT
+ ## File created by gen-lock-obj.sh - DO NOT EDIT
+ ## To be included by mkheader into gpg-error.h
+ 
+ /* Dummy object - no locking available.  */
+ typedef struct
+ {
+   long _vers;
+ } gpgrt_lock_t;
+ 
+ #define GPGRT_LOCK_INITIALIZER {-1}
+ EOF
+ else
+ AWK_VERSION_OUTPUT=$($AWK 'BEGIN { print PROCINFO["version"] }')
+ if test -n "$AWK_VERSION_OUTPUT"; then
+     # It's GNU awk, which supports PROCINFO.
+     AWK_OPTION=--non-decimal-data
+ fi
+ 
+ cat <<'EOF' >conftest.$ac_ext
+ #include <pthread.h>
+ pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
+ EOF
+ 
+ if $CC -c conftest.$ac_ext; then :
+   ac_mtx_size=$($OBJDUMP -j .bss -t conftest.$ac_objext \
+          | $AWK $AWK_OPTION '
+ /mtx$/ { mtx_size = int("0x" $5) }
+ END { print mtx_size }')
+ else
+     echo "Can't determine mutex size"
+     exit 1
+ fi
+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ 
+ cat <<EOF
+ ## lock-obj-pub.$host.h
+ ## File created by gen-lock-obj.sh - DO NOT EDIT
+ ## To be included by mkheader into gpg-error.h
+ 
+ typedef struct
+ {
+   long _vers;
+   union {
+     volatile char _priv[$ac_mtx_size];
+     long _x_align;
+     long *_xp_align;
+   } u;
+ } gpgrt_lock_t;
+ 
+ EOF
+ 
+ # FIXME: Support different alignment conditions of:
+ #
+ #     USE_16BYTE_ALIGNMENT
+ #     USE_DOUBLE_FOR_ALIGNMENT
+ #     USE_LONG_DOUBLE_FOR_ALIGNMENT
+ #
+ 
+ echo ${ECHO_N} "#define GPGRT_LOCK_INITIALIZER {$LOCK_ABI_VERSION,{{${ECHO_C}"
+ 
+ i=0
+ while test "$i" -lt $ac_mtx_size; do
+     if test "$i" -ne 0 -a "$(( $i % 8 ))" -eq 0; then
+         echo ' \'
+         echo ${ECHO_N} "                                    ${ECHO_C}"
+     fi
+     echo ${ECHO_N} "0${ECHO_C}"
+     if test "$i" -lt $(($ac_mtx_size - 1)); then
+         echo ${ECHO_N} ",${ECHO_C}"
+     fi
+     i=$(( i + 1 ))
+ done
+ fi
+ 
+ cat <<'EOF'
+ }}}
+ ##
+ ## Local Variables:
+ ## mode: c
+ ## buffer-read-only: t
+ ## End:
+ ##
+ EOF
+ 
+ exit 0
diff --git a/nixpkgs/pkgs/development/libraries/libgphoto2/default.nix b/nixpkgs/pkgs/development/libraries/libgphoto2/default.nix
new file mode 100644
index 000000000000..3e3fa1a725bf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgphoto2/default.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, gettext
+, libusb1
+, libtool
+, libexif
+, libjpeg
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libgphoto2";
+  version = "2.5.27";
+
+  src = fetchFromGitHub {
+    owner = "gphoto";
+    repo = "libgphoto2";
+    rev = "libgphoto2-${builtins.replaceStrings [ "." ] [ "_" ] version}-release";
+    sha256 = "sha256-c7fBl6GBLAU+RL5WFC4PL+n/nEHZUfqIJ9qq1+qNNCg=";
+  };
+
+  patches = [];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+    gettext
+    libtool
+  ];
+
+  buildInputs = [
+    libjpeg
+    libusb1
+  ];
+
+  # These are mentioned in the Requires line of libgphoto's pkg-config file.
+  propagatedBuildInputs = [ libexif ];
+
+  hardeningDisable = [ "format" ];
+
+  postInstall = ''
+    mkdir -p $out/lib/udev/rules.d
+    $out/lib/libgphoto2/print-camera-list udev-rules version 175 group camera >$out/lib/udev/rules.d/40-gphoto2.rules
+  '';
+
+  meta = {
+    homepage = "http://www.gphoto.org/proj/libgphoto2/";
+    description = "A library for accessing digital cameras";
+    longDescription = ''
+      This is the library backend for gphoto2. It contains the code for PTP,
+      MTP, and other vendor specific protocols for controlling and transferring data
+      from digital cameras.
+    '';
+    # XXX: the homepage claims LGPL, but several src files are lgpl21Plus
+    license = lib.licenses.lgpl21Plus;
+    platforms = with lib.platforms; unix;
+    maintainers = with lib.maintainers; [ jcumming ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgpiod/0001-Drop-AC_FUNC_MALLOC-and-_REALLOC-and-check-for-them-.patch b/nixpkgs/pkgs/development/libraries/libgpiod/0001-Drop-AC_FUNC_MALLOC-and-_REALLOC-and-check-for-them-.patch
new file mode 100644
index 000000000000..f2ee8e8d3d73
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgpiod/0001-Drop-AC_FUNC_MALLOC-and-_REALLOC-and-check-for-them-.patch
@@ -0,0 +1,31 @@
+From 2cc80dc06ea42087788cf27b31821ffa99a22f89 Mon Sep 17 00:00:00 2001
+From: Johannes Lode <johannes.lode@dynainstruments.com>
+Date: Thu, 14 Nov 2019 10:44:00 +0100
+Subject: [PATCH] Drop AC_FUNC_MALLOC and _REALLOC and check for them as
+ regular functions.
+
+While cross-compiling there occurred "undefined reference to
+`rpl_malloc'", the suggested change fixes the problem.
+
+Tested for native X86_64 and armv7a-unknown-linux-gnueabihf.
+---
+ configure.ac | 3 ++-
+ 1 file changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 008499d..b492dc4 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -81,7 +81,8 @@ AC_DEFUN([HEADER_NOT_FOUND_CXX],
+ 
+ # This is always checked (library needs this)
+ AC_HEADER_STDC
+-AC_FUNC_MALLOC
++# AC_FUNC_MALLOC -- does not work while cross-compiling
++AC_CHECK_FUNC([malloc realloc])
+ AC_CHECK_FUNC([ioctl], [], [FUNC_NOT_FOUND_LIB([ioctl])])
+ AC_CHECK_FUNC([asprintf], [], [FUNC_NOT_FOUND_LIB([asprintf])])
+ AC_CHECK_FUNC([scandir], [], [FUNC_NOT_FOUND_LIB([scandir])])
+-- 
+2.25.1
+
diff --git a/nixpkgs/pkgs/development/libraries/libgpiod/default.nix b/nixpkgs/pkgs/development/libraries/libgpiod/default.nix
new file mode 100644
index 000000000000..ccf1c4703647
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgpiod/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchurl, autoreconfHook, autoconf-archive, pkg-config, kmod
+, enable-tools ? true
+, enablePython ? false, python3, ncurses }:
+
+stdenv.mkDerivation rec {
+  pname = "libgpiod";
+  version = "1.6.3";
+
+  src = fetchurl {
+    url = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/snapshot/libgpiod-${version}.tar.gz";
+    sha256 = "sha256-60RgcL4URP19MtMrvKU8Lzu7CiEZPbhhmM9gULeihEE=";
+  };
+
+  patches = [
+    # cross compiling fix
+    # https://github.com/brgl/libgpiod/pull/45
+    ./0001-Drop-AC_FUNC_MALLOC-and-_REALLOC-and-check-for-them-.patch
+  ];
+
+  buildInputs = [ kmod ] ++ lib.optionals enablePython [ python3 ncurses ];
+  nativeBuildInputs = [
+    autoconf-archive
+    pkg-config
+    autoreconfHook
+  ];
+
+  configureFlags = [
+    "--enable-tools=${if enable-tools then "yes" else "no"}"
+    "--enable-bindings-cxx"
+    "--prefix=${placeholder "out"}"
+  ] ++ lib.optional enablePython "--enable-bindings-python";
+
+  meta = with lib; {
+    description = "C library and tools for interacting with the linux GPIO character device";
+    longDescription = ''
+      Since linux 4.8 the GPIO sysfs interface is deprecated. User space should use
+      the character device instead. This library encapsulates the ioctl calls and
+      data structures behind a straightforward API.
+    '';
+    homepage = "https://git.kernel.org/pub/scm/libs/libgpiod/libgpiod.git/about/";
+    license = licenses.lgpl2;
+    maintainers = [ maintainers.expipiplus1 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgpod/default.nix b/nixpkgs/pkgs/development/libraries/libgpod/default.nix
new file mode 100644
index 000000000000..49dcec3ee781
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgpod/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, lib, fetchurl, perlPackages, intltool, autoreconfHook,
+  pkg-config, glib, libxml2, sqlite, zlib, sg3_utils, gdk-pixbuf, taglib,
+  libimobiledevice,
+  monoSupport ? false, mono, gtk-sharp-2_0
+}:
+
+
+stdenv.mkDerivation rec {
+  name = "libgpod-0.8.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/gtkpod/${name}.tar.bz2";
+    sha256 = "0pcmgv1ra0ymv73mlj4qxzgyir026z9jpl5s5bkg35afs1cpk2k3";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  postPatch = ''
+    # support libplist 2.2
+    substituteInPlace configure.ac --replace 'libplist >= 1.0' 'libplist-2.0 >= 2.2'
+  '';
+
+  configureFlags = [
+    "--without-hal"
+    "--enable-udev"
+    "--with-udev-dir=${placeholder "out"}/lib/udev"
+  ] ++ lib.optionals monoSupport [ "--with-mono" ];
+
+  dontStrip = true;
+
+  propagatedBuildInputs = [ glib libxml2 sqlite zlib sg3_utils
+    gdk-pixbuf taglib libimobiledevice ];
+
+  nativeBuildInputs = [ autoreconfHook intltool pkg-config ]
+    ++ (with perlPackages; [ perl XMLParser ])
+    ++ lib.optionals monoSupport [ mono gtk-sharp-2_0 ];
+
+  meta = {
+    homepage = "https://gtkpod.sourceforge.net/";
+    description = "Library used by gtkpod to access the contents of an ipod";
+    license = "LGPL";
+    platforms = lib.platforms.gnu ++ lib.platforms.linux;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgringotts/default.nix b/nixpkgs/pkgs/development/libraries/libgringotts/default.nix
new file mode 100644
index 000000000000..16595a12eb50
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgringotts/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, pkg-config, zlib, bzip2, libmcrypt, libmhash }:
+
+stdenv.mkDerivation rec {
+  pname = "libgringotts";
+  version = "1.2.1";
+
+  src = fetchurl {
+    url = "https://sourceforge.net/projects/gringotts.berlios/files/${pname}-${version}.tar.bz2";
+    sha256 = "1ldz1lyl1aml5ci1mpnys8dg6n7khpcs4zpycak3spcpgdsnypm7";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ zlib bzip2 libmcrypt libmhash ];
+
+  meta = with lib; {
+    description = "A small library to encapsulate data in an encrypted structure";
+    homepage = "http://libgringotts.sourceforge.net/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ pSub ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgroove/default.nix b/nixpkgs/pkgs/development/libraries/libgroove/default.nix
new file mode 100644
index 000000000000..f14524df0dc5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgroove/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, ffmpeg_3, SDL2, chromaprint, libebur128 }:
+
+stdenv.mkDerivation rec {
+  version = "4.3.0";
+  pname = "libgroove";
+
+  src = fetchFromGitHub {
+    owner = "andrewrk";
+    repo = "libgroove";
+    rev = version;
+    sha256 = "1la9d9kig50mc74bxvhx6hzqv0nrci9aqdm4k2j4q0s1nlfgxipd";
+  };
+
+  patches = [
+    ./no-warnings-as-errors.patch
+    (fetchpatch {
+      name = "update-for-ffmpeg-3.0.patch";
+      url = "https://aur.archlinux.org/cgit/aur.git/plain/0001-update-for-ffmpeg-3.0.patch?h=libgroove&id=a9f3bd2a5afd3227733414a5d54c7a2aa0a1249e";
+      sha256 = "0800drk9df1kwbv80f2ffv77xk888249fk0d961rp2a305hvyrk0";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ ffmpeg_3 SDL2 chromaprint libebur128 ];
+
+  meta = with lib; {
+    description = "Streaming audio processing library";
+    homepage = "https://github.com/andrewrk/libgroove";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ andrewrk ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgroove/no-warnings-as-errors.patch b/nixpkgs/pkgs/development/libraries/libgroove/no-warnings-as-errors.patch
new file mode 100644
index 000000000000..86a8a935769c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgroove/no-warnings-as-errors.patch
@@ -0,0 +1,15 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index a1e8541..6bc9c30 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -135,8 +135,8 @@ configure_file (
+   "${PROJECT_BINARY_DIR}/config.h"
+   )
+ 
+-set(LIB_CFLAGS "${C99_C_FLAGS} -pedantic -Werror -Wall -Werror=strict-prototypes -Werror=old-style-definition -Werror=missing-prototypes -D_REENTRANT -D_POSIX_C_SOURCE=200809L")
+-set(EXAMPLE_CFLAGS "${C99_C_FLAGS} -pedantic -Werror -Wall -g")
++set(LIB_CFLAGS "${C99_C_FLAGS} -pedantic -Wall -Werror=strict-prototypes -Werror=old-style-definition -Werror=missing-prototypes -D_REENTRANT -D_POSIX_C_SOURCE=200809L")
++set(EXAMPLE_CFLAGS "${C99_C_FLAGS} -pedantic -Wall -g")
+ set(EXAMPLE_INCLUDES "${PROJECT_SOURCE_DIR}")
+ 
+ add_library(groove SHARED ${LIBGROOVE_SOURCES} ${LIBGROOVE_HEADERS})
diff --git a/nixpkgs/pkgs/development/libraries/libgrss/default.nix b/nixpkgs/pkgs/development/libraries/libgrss/default.nix
new file mode 100644
index 000000000000..ab8346990feb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgrss/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, vala, gobject-introspection, gtk-doc, docbook_xsl, docbook_xml_dtd_412, glib, libxml2, libsoup, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "libgrss";
+  version = "0.7.0";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1nalslgyglvhpva3px06fj6lv5zgfg0qmj0sbxyyl5d963vc02b7";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "CVE-2016-20011.patch";
+      # https://gitlab.gnome.org/GNOME/libgrss/-/merge_requests/7, not yet merged!
+      url = "https://gitlab.gnome.org/GNOME/libgrss/-/commit/2c6ea642663e2a44efc8583fae7c54b7b98f72b3.patch";
+      sha256 = "1ijvq2jl97vphcvrbrqxvszdmv6yyjfygdca9vyaijpafwyzzb18";
+    })
+  ];
+
+  nativeBuildInputs = [ pkg-config vala gobject-introspection gtk-doc docbook_xsl docbook_xml_dtd_412 ];
+  buildInputs = [ glib libxml2 libsoup ];
+
+  configureFlags = [
+    "--enable-gtk-doc"
+  ];
+
+  doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    description = "Glib abstaction to handle feeds in RSS, Atom and other formats";
+    homepage = "https://wiki.gnome.org/Projects/Libgrss";
+    license = licenses.lgpl3Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgsf/default.nix b/nixpkgs/pkgs/development/libraries/libgsf/default.nix
new file mode 100644
index 000000000000..1ccc5d778967
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgsf/default.nix
@@ -0,0 +1,44 @@
+{ fetchurl, lib, stdenv, pkg-config, intltool, gettext, glib, libxml2, zlib, bzip2
+, perl, gdk-pixbuf, libiconv, libintl, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "libgsf";
+  version = "1.14.47";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0kbpp9ksl7977xiga37sk1gdw1r039v6zviqznl7alvvg39yp26i";
+  };
+
+  nativeBuildInputs = [ pkg-config intltool libintl ];
+
+  buildInputs = [ gettext bzip2 zlib ];
+  checkInputs = [ perl ];
+
+  propagatedBuildInputs = [ libxml2 glib gdk-pixbuf libiconv ];
+
+  outputs = [ "out" "dev" ];
+
+  doCheck = true;
+  preCheck = "patchShebangs ./tests/";
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "GNOME's Structured File Library";
+    homepage    = "https://www.gnome.org/projects/libgsf";
+    license     = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = lib.platforms.unix;
+
+    longDescription = ''
+      Libgsf aims to provide an efficient extensible I/O abstraction for
+      dealing with different structured file formats.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgssglue/default.nix b/nixpkgs/pkgs/development/libraries/libgssglue/default.nix
new file mode 100644
index 000000000000..0d01b05e223b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgssglue/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, libkrb5 }:
+
+stdenv.mkDerivation rec {
+  pname = "libgssglue";
+  version = "0.4";
+
+  src = fetchurl {
+    url = "http://www.citi.umich.edu/projects/nfsv4/linux/libgssglue/${pname}-${version}.tar.gz";
+    sha256 = "0fh475kxzlabwz30wz3bf7i8kfqiqzhfahayx3jj79rba1sily9z";
+  };
+
+  postPatch = ''
+    sed s:/etc/gssapi_mech.conf:$out/etc/gssapi_mech.conf: -i src/g_initialize.c
+  '';
+
+  postInstall = ''
+    mkdir -p $out/etc
+    cat <<EOF > $out/etc/gssapi_mech.conf
+    ${libkrb5}/lib/libgssapi_krb5.so mechglue_internal_krb5_init
+    EOF
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.citi.umich.edu/projects/nfsv4/linux/";
+    description = "Exports a gssapi interface which calls other random gssapi libraries";
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ corngood ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgtop/default.nix b/nixpkgs/pkgs/development/libraries/libgtop/default.nix
new file mode 100644
index 000000000000..98b0dc89fee8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgtop/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv
+, fetchurl
+, glib
+, pkg-config
+, perl
+, gettext
+, gobject-introspection
+, gnome
+, gtk-doc
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libgtop";
+  version = "2.40.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1m6jbqk8maa52gxrf223442fr5bvvxgb7ham6v039i3r1i62gwvq";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    gtk-doc
+    perl
+    gettext
+    gobject-introspection
+  ];
+
+  propagatedBuildInputs = [
+    glib
+  ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "A library that reads information about processes and the running system";
+    license = licenses.gpl2Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgudev/default.nix b/nixpkgs/pkgs/development/libraries/libgudev/default.nix
new file mode 100644
index 000000000000..6fd108b3b7a6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgudev/default.nix
@@ -0,0 +1,59 @@
+{ lib, stdenv
+, fetchurl
+, pkg-config
+, meson
+, ninja
+, udev
+, glib
+, gobject-introspection
+, gnome
+, vala
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libgudev";
+  version = "236";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "094mgjmwgsgqrr1i0vd20ynvlkihvs3vgbmpbrhswjsrdp86j0z5";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    gobject-introspection
+    meson
+    ninja
+    vala
+  ];
+
+  buildInputs = [
+    udev
+    glib
+  ];
+
+  mesonFlags = [
+    # There's a dependency cycle with umockdev and the tests fail to LD_PRELOAD anyway
+    "-Dtests=disabled"
+  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+    "-Dintrospection=disabled"
+    "-Dvapi=disabled"
+  ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    description = "A library that provides GObject bindings for libudev";
+    homepage = "https://wiki.gnome.org/Projects/libgudev";
+    maintainers = [ maintainers.eelco ] ++ teams.gnome.members;
+    platforms = platforms.linux;
+    license = licenses.lgpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libguestfs/appliance.nix b/nixpkgs/pkgs/development/libraries/libguestfs/appliance.nix
new file mode 100644
index 000000000000..ad4a93517e92
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libguestfs/appliance.nix
@@ -0,0 +1,11 @@
+{ fetchzip }:
+
+fetchzip {
+  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
new file mode 100644
index 000000000000..ebb431ae199a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libguestfs/default.nix
@@ -0,0 +1,109 @@
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, autoreconfHook, makeWrapper
+, ncurses, cpio, gperf, cdrkit, flex, bison, qemu, pcre, augeas, libxml2
+, acl, libcap, libcap_ng, libconfig, systemd, fuse, yajl, libvirt, hivex, db
+, gmp, readline, file, numactl, libapparmor, jansson
+, getopt, perlPackages, ocamlPackages
+, libtirpc
+, appliance ? null
+, javaSupport ? false, jdk ? null }:
+
+assert appliance == null || lib.isDerivation appliance;
+assert javaSupport -> jdk != null;
+
+stdenv.mkDerivation rec {
+  pname = "libguestfs";
+  version = "1.44.1";
+
+  src = fetchurl {
+    url = "https://libguestfs.org/download/${lib.versions.majorMinor version}-stable/${pname}-${version}.tar.gz";
+    sha256 = "09dhmlbfdwirlmkasa28x69vqs5xndq0lnng6b4if76s6bfxrdvj";
+  };
+
+  strictDeps = true;
+  nativeBuildInputs = [
+    autoreconfHook bison cdrkit cpio flex getopt gperf makeWrapper pkg-config qemu
+  ] ++ (with perlPackages; [ perl libintl_perl GetoptLong SysVirt ])
+    ++ (with ocamlPackages; [ ocaml findlib ]);
+  buildInputs = [
+    ncurses jansson
+    pcre augeas libxml2 acl libcap libcap_ng libconfig
+    systemd fuse yajl libvirt gmp readline file hivex db
+    numactl libapparmor perlPackages.ModuleBuild
+    libtirpc
+  ] ++ (with ocamlPackages; [ ocamlbuild ocaml_libvirt gettext-stub ounit ])
+    ++ lib.optional javaSupport jdk;
+
+  prePatch = ''
+    # build-time scripts
+    substituteInPlace run.in        --replace '#!/bin/bash' '#!${stdenv.shell}'
+    substituteInPlace ocaml-link.sh.in --replace '#!/bin/bash' '#!${stdenv.shell}'
+
+    # $(OCAMLLIB) is read-only "${ocamlPackages.ocaml}/lib/ocaml"
+    substituteInPlace ocaml/Makefile.am            --replace '$(DESTDIR)$(OCAMLLIB)' '$(out)/lib/ocaml'
+    substituteInPlace ocaml/Makefile.in            --replace '$(DESTDIR)$(OCAMLLIB)' '$(out)/lib/ocaml'
+
+    # some scripts hardcore /usr/bin/env which is not available in the build env
+    patchShebangs .
+  '';
+  configureFlags = [
+    "--disable-appliance"
+    "--disable-daemon"
+    "--with-distro=NixOS"
+    "--with-guestfs-path=${placeholder "out"}/lib/guestfs"
+  ] ++ lib.optionals (!javaSupport) [ "--without-java" ];
+  patches = [
+    ./libguestfs-syms.patch
+    # Set HAVE_RPM, HAVE_DPKG, HAVE_PACMAN
+    (fetchpatch {
+      url = "https://github.com/libguestfs/libguestfs/commit/210959cc344d6a4a1e3afa26d276b130651def74.patch";
+      sha256 = "121l58mk2mwhhqc3rcisdw3di7y729b30hyffc8a50mq5k7fvsdb";
+     })
+  ];
+  NIX_CFLAGS_COMPILE="-I${libxml2.dev}/include/libxml2/";
+  installFlags = [ "REALLY_INSTALL=yes" ];
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    for bin in $out/bin/*; do
+      wrapProgram "$bin" \
+        --prefix PATH     : "$out/bin:${hivex}/bin:${qemu}/bin" \
+        --prefix PERL5LIB : "$out/${perlPackages.perl.libPrefix}"
+    done
+  '';
+
+  postFixup = lib.optionalString (appliance != null) ''
+    mkdir -p $out/{lib,lib64}
+    ln -s ${appliance} $out/lib64/guestfs
+    ln -s ${appliance} $out/lib/guestfs
+  '';
+
+  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
+
+    $out/bin/guestfish <<'EOF'
+    add-drive disk1.img
+    run
+    list-filesystems
+    part-disk /dev/sda mbr
+    mkfs ext2 /dev/sda1
+    list-filesystems
+    EOF
+
+    runHook postInstallCheck
+  '';
+
+  meta = with lib; {
+    description = "Tools for accessing and modifying virtual machine disk images";
+    license = with licenses; [ gpl2Plus lgpl21Plus ];
+    homepage = "https://libguestfs.org/";
+    maintainers = with maintainers; [offline];
+    platforms = platforms.linux;
+    # this is to avoid "output size exceeded"
+    hydraPlatforms = if appliance != null then appliance.meta.hydraPlatforms else platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libguestfs/libguestfs-syms.patch b/nixpkgs/pkgs/development/libraries/libguestfs/libguestfs-syms.patch
new file mode 100644
index 000000000000..09c4b1393ce7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libguestfs/libguestfs-syms.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/Makefile.am b/lib/Makefile.am
+--- a/lib/Makefile.am
++++ b/lib/Makefile.am
+@@ -168,8 +168,7 @@ libguestfs_la_LIBADD = \
+ # Force libtool to name the library 'libguestfs.so.0.$(MAX_PROC_NR).0'.
+ # Include the version script to limit which symbols are exported.
+ libguestfs_la_LDFLAGS = \
+-	-version-info $(MAX_PROC_NR):0:$(MAX_PROC_NR) \
+-	$(VERSION_SCRIPT_FLAGS)$(srcdir)/libguestfs.syms
++	-version-info $(MAX_PROC_NR):0:$(MAX_PROC_NR)
+ 
+ if HAVE_FUSE
+ # XXX Unfortunately FUSE_CFLAGS defines _FILE_OFFSET_BITS=64.
diff --git a/nixpkgs/pkgs/development/libraries/libgumath/default.nix b/nixpkgs/pkgs/development/libraries/libgumath/default.nix
new file mode 100644
index 000000000000..f82401f524fa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgumath/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv
+, fetchFromGitHub
+, libndtypes
+, libxnd
+}:
+
+stdenv.mkDerivation {
+  pname = "libgumath";
+  version = "unstable-2019-08-01";
+
+  src = fetchFromGitHub {
+    owner = "xnd-project";
+    repo = "gumath";
+    rev = "360ed454105ac5615a7cb7d216ad25bc4181b876";
+    sha256 = "1wprkxpmjrk369fpw8rbq51r7jvqkcndqs209y7p560cnagmsxc6";
+  };
+
+  buildInputs = [ libndtypes libxnd ];
+
+  # Override linker with cc (symlink to either gcc or clang)
+  # Library expects to use cc for linking
+  configureFlags = [
+    "LD=${stdenv.cc.targetPrefix}cc"
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Library supporting function dispatch on general data containers. C base and Python wrapper";
+    homepage = "https://xnd.io/";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.costrouc ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgweather/default.nix b/nixpkgs/pkgs/development/libraries/libgweather/default.nix
new file mode 100644
index 000000000000..fbab67e08652
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgweather/default.nix
@@ -0,0 +1,82 @@
+{ lib
+, stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, libxml2
+, glib
+, gtk3
+, gettext
+, libsoup
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+, gobject-introspection
+, python3
+, tzdata
+, geocode-glib
+, vala
+, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libgweather";
+  version = "40.0";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.major version}/${pname}-${version}.tar.xz";
+    sha256 = "1rkf4yv43qcahyx7bismdv6z2vh5azdnm1fqfmnzrada9cm8ykna";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gettext
+    vala
+    gtk-doc
+    docbook-xsl-nons
+    docbook_xml_dtd_43
+    gobject-introspection
+    python3
+    python3.pkgs.pygobject3
+  ];
+
+  buildInputs = [
+    glib
+    gtk3
+    libsoup
+    libxml2
+    geocode-glib
+  ];
+
+  mesonFlags = [
+    "-Dzoneinfo_dir=${tzdata}/share/zoneinfo"
+    "-Denable_vala=true"
+    "-Dgtk_doc=true"
+  ];
+
+  postPatch = ''
+    chmod +x meson/meson_post_install.py
+    patchShebangs meson/meson_post_install.py
+    patchShebangs data/gen_locations_variant.py
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "A library to access weather information from online services for numerous locations";
+    homepage = "https://wiki.gnome.org/Projects/LibGWeather";
+    license = licenses.gpl2Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libgxps/default.nix b/nixpkgs/pkgs/development/libraries/libgxps/default.nix
new file mode 100644
index 000000000000..df05754da589
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libgxps/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, glib, gobject-introspection, cairo
+, libarchive, freetype, libjpeg, libtiff, gnome, lcms2
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libgxps";
+  version = "0.3.2";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "bSeGclajXM+baSU+sqiKMrrKO5fV9O9/guNmf6Q1JRw=";
+  };
+
+  nativeBuildInputs = [ meson ninja pkg-config gobject-introspection ];
+  buildInputs = [ glib cairo freetype libjpeg libtiff lcms2 ];
+  propagatedBuildInputs = [ libarchive ];
+
+  mesonFlags = [
+    "-Denable-test=false"
+  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+    "-Ddisable-introspection=true"
+  ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    description = "A GObject based library for handling and rendering XPS documents";
+    homepage = "https://wiki.gnome.org/Projects/libgxps";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libhandy/0.x.nix b/nixpkgs/pkgs/development/libraries/libhandy/0.x.nix
new file mode 100644
index 000000000000..7597aee697a8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libhandy/0.x.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv, fetchFromGitLab, meson, ninja, pkg-config, gobject-introspection, vala
+, gtk-doc, docbook_xsl, docbook_xml_dtd_43
+, gtk3, gnome
+, dbus, xvfb-run, libxml2
+, hicolor-icon-theme
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libhandy";
+  version = "0.0.13";
+
+  outputs = [ "out" "dev" "devdoc" ];
+  outputBin = "dev";
+
+  src = fetchFromGitLab {
+    domain = "source.puri.sm";
+    owner = "Librem5";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1y23k623sjkldfrdiwfarpchg5mg58smcy1pkgnwfwca15wm1ra5";
+  };
+
+  nativeBuildInputs = [
+    meson ninja pkg-config gobject-introspection vala libxml2
+    gtk-doc docbook_xsl docbook_xml_dtd_43
+  ];
+  buildInputs = [ gnome.gnome-desktop gtk3 libxml2 ];
+  checkInputs = [ dbus xvfb-run hicolor-icon-theme ];
+
+  mesonFlags = [
+    "-Dgtk_doc=true"
+    "-Dglade_catalog=disabled"
+    "-Dintrospection=enabled"
+  ];
+
+  doCheck = true;
+
+  checkPhase = ''
+    NO_AT_BRIDGE=1 \
+    XDG_DATA_DIRS="$XDG_DATA_DIRS:${hicolor-icon-theme}/share" \
+    xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
+      --config-file=${dbus.daemon}/share/dbus-1/session.conf \
+      meson test --print-errorlogs
+  '';
+
+  meta = with lib; {
+    description = "A library full of GTK widgets for mobile phones";
+    homepage = "https://source.puri.sm/Librem5/libhandy";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libhandy/default.nix b/nixpkgs/pkgs/development/libraries/libhandy/default.nix
new file mode 100644
index 000000000000..0d69a5b93e1e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libhandy/default.nix
@@ -0,0 +1,120 @@
+{ lib
+, stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, gobject-introspection
+, vala
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+, gtk3
+, enableGlade ? false
+, glade
+, dbus
+, xvfb-run
+, libxml2
+, gdk-pixbuf
+, librsvg
+, hicolor-icon-theme
+, at-spi2-atk
+, at-spi2-core
+, gnome
+, libhandy
+, runCommand
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libhandy";
+  version = "1.2.3";
+
+  outputs = [
+    "out"
+    "dev"
+    "devdoc"
+  ] ++ lib.optionals enableGlade [
+    "glade"
+  ];
+  outputBin = "dev";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-kuxKWB7BtB3Qek6PqvXVKuN8q7fh+n+UTWyvvllrbWE=";
+  };
+
+  nativeBuildInputs = [
+    docbook_xml_dtd_43
+    docbook-xsl-nons
+    gobject-introspection
+    gtk-doc
+    libxml2
+    meson
+    ninja
+    pkg-config
+    vala
+  ];
+
+  buildInputs = [
+    gdk-pixbuf
+    gtk3
+    libxml2
+  ] ++ lib.optionals enableGlade [
+    glade
+  ];
+
+  checkInputs = [
+    dbus
+    xvfb-run
+    at-spi2-atk
+    at-spi2-core
+    librsvg
+    hicolor-icon-theme
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=true"
+    "-Dglade_catalog=${if enableGlade then "enabled" else "disabled"}"
+  ];
+
+  # Uses define_variable in pkg-config, but we still need it to use the glade output
+  PKG_CONFIG_GLADEUI_2_0_MODULEDIR = "${placeholder "glade"}/lib/glade/modules";
+  PKG_CONFIG_GLADEUI_2_0_CATALOGDIR = "${placeholder "glade"}/share/glade/catalogs";
+
+  doCheck = true;
+
+  checkPhase = ''
+    NO_AT_BRIDGE=1 \
+    XDG_DATA_DIRS="$XDG_DATA_DIRS:${hicolor-icon-theme}/share" \
+    GDK_PIXBUF_MODULE_FILE="${librsvg.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache" \
+    xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
+      --config-file=${dbus.daemon}/share/dbus-1/session.conf \
+      meson test --print-errorlogs
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+    };
+  } // lib.optionalAttrs (!enableGlade) {
+    glade =
+      let
+        libhandyWithGlade = libhandy.override {
+          enableGlade = true;
+        };
+      in runCommand "${libhandy.name}-glade" {} ''
+        cp -r "${libhandyWithGlade.glade}" "$out"
+        chmod -R +w "$out"
+        sed -e "s#${libhandyWithGlade.out}#${libhandy.out}#g" -e "s#${libhandyWithGlade.glade}#$out#g" -i $(find "$out" -type f)
+      '';
+  };
+
+  meta = with lib; {
+    changelog = "https://gitlab.gnome.org/GNOME/libhandy/-/tags/${version}";
+    description = "Building blocks for modern adaptive GNOME apps";
+    homepage = "https://gitlab.gnome.org/GNOME/libhandy";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libhangul/default.nix b/nixpkgs/pkgs/development/libraries/libhangul/default.nix
new file mode 100644
index 000000000000..295ed9bf3054
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libhangul/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libhangul";
+  version = "0.1.0";
+
+  src = fetchurl {
+    url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/libhangul/libhangul-${version}.tar.gz";
+    sha256 = "0ni9b0v70wkm0116na7ghv03pgxsfpfszhgyj3hld3bxamfal1ar";
+  };
+
+  meta = with lib; {
+    description = "Core algorithm library for Korean input routines";
+    homepage = "https://github.com/choehwanjin/libhangul";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.ianwookim ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libharu/default.nix b/nixpkgs/pkgs/development/libraries/libharu/default.nix
new file mode 100644
index 000000000000..7b8a5ac02c89
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libharu/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, cmake, zlib, libpng }:
+
+stdenv.mkDerivation rec {
+  pname = "libharu";
+  version = "2.3.0";
+
+  src = fetchFromGitHub {
+    owner = "libharu";
+    repo = pname;
+    rev = "RELEASE_${lib.replaceStrings ["."] ["_"] version}";
+    sha256 = "15s9hswnl3qqi7yh29jyrg0hma2n99haxznvcywmsp8kjqlyg75q";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zlib libpng ];
+
+  meta = {
+    description = "Cross platform, open source library for generating PDF files";
+    homepage = "http://libharu.org/";
+    license = lib.licenses.zlib;
+    maintainers = [ lib.maintainers.marcweber ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libhdhomerun/default.nix b/nixpkgs/pkgs/development/libraries/libhdhomerun/default.nix
new file mode 100644
index 000000000000..187382e1f3e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libhdhomerun/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl }:
+
+# libhdhomerun requires UDP port 65001 to be open in order to detect and communicate with tuners.
+# If your firewall is enabled, make sure to have something like:
+#   networking.firewall.allowedUDPPorts = [ 65001 ];
+
+stdenv.mkDerivation rec {
+  pname = "libhdhomerun";
+  version = "20210624";
+
+  src = fetchurl {
+    url = "https://download.silicondust.com/hdhomerun/libhdhomerun_${version}.tgz";
+    sha256 = "sha256-3q9GO7zD7vpy+XGZ77YhP3sOLI6R8bPSy/UgVqhxXRU=";
+  };
+
+  patchPhase = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace Makefile --replace "gcc" "cc"
+    substituteInPlace Makefile --replace "-arch i386" ""
+  '';
+
+  installPhase = ''
+    mkdir -p $out/{bin,lib,include/hdhomerun}
+    install -Dm444 libhdhomerun${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib
+    install -Dm555 hdhomerun_config $out/bin
+    cp *.h $out/include/hdhomerun
+  '';
+
+  meta = with lib; {
+    description = "Implements the libhdhomerun protocol for use with Silicondust HDHomeRun TV tuners";
+    homepage = "https://www.silicondust.com/support/linux";
+    license = licenses.lgpl21Only;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.titanous ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libheif/default.nix b/nixpkgs/pkgs/development/libraries/libheif/default.nix
new file mode 100644
index 000000000000..d445a7c3867e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libheif/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, dav1d, rav1e, libde265, x265, libpng,
+  libjpeg, libaom }:
+
+stdenv.mkDerivation rec {
+  pname = "libheif";
+  version = "1.12.0";
+
+  outputs = [ "bin" "out" "dev" "man" ];
+
+  src = fetchFromGitHub {
+    owner = "strukturag";
+    repo = "libheif";
+    rev = "v${version}";
+    sha256 = "sha256-RjGLaDSBO8T7ijRb5a16aUlkCy5vdFPs4O9caIJo4jI=";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ dav1d rav1e libde265 x265 libpng libjpeg libaom ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "http://www.libheif.org/";
+    description = "ISO/IEC 23008-12:2017 HEIF image file format decoder and encoder";
+    license = lib.licenses.lgpl3Plus;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ gebner ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libhsts/default.nix b/nixpkgs/pkgs/development/libraries/libhsts/default.nix
new file mode 100644
index 000000000000..df53e7d294f2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libhsts/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchFromGitLab, fetchurl, autoconf-archive, autoreconfHook, pkg-config, python3 }:
+let
+  chromium_version = "90.0.4417.1";
+
+  hsts_list = fetchurl {
+    url = "https://raw.github.com/chromium/chromium/${chromium_version}/net/http/transport_security_state_static.json";
+    sha256 = "09f24n30x5dmqk8zk7k2glcilgr27832a3304wj1yp97158sqsfx";
+  };
+
+in
+stdenv.mkDerivation rec {
+  pname = "libhsts";
+  version = "0.1.0";
+
+  src = fetchFromGitLab {
+    owner = "rockdaboot";
+    repo = pname;
+    rev = "libhsts-${version}";
+    sha256 = "0gbchzf0f4xzb6zjc56dk74hqrmdgyirmgxvvsqp9vqn9wb5kkx4";
+  };
+
+  postPatch = ''
+    pushd tests
+    cp ${hsts_list} transport_security_state_static.json
+    sed 's/^ *\/\/.*$//g' transport_security_state_static.json >hsts.json
+    popd
+    patchShebangs src/hsts-make-dafsa
+  '';
+
+  nativeBuildInputs = [ autoconf-archive autoreconfHook pkg-config python3 ];
+
+  outputs = [ "out" "dev" ];
+
+  meta = with lib; {
+    description = "Library to easily check a domain against the Chromium HSTS Preload list";
+    homepage = "https://gitlab.com/rockdaboot/libhsts";
+    license = with licenses; [ mit bsd3 ];
+    maintainers = with maintainers; [ SuperSandro2000 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libhsts/update.sh b/nixpkgs/pkgs/development/libraries/libhsts/update.sh
new file mode 100755
index 000000000000..f80966e08c9a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libhsts/update.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -i bash -p curl jq
+
+set -euo pipefail -x
+
+cd "$(dirname "$0")"
+
+chromium_version=$(curl -s "https://api.github.com/repos/chromium/chromium/tags" | jq -r 'map(select(.prerelease | not)) | .[1].name')
+sha256=$(nix-prefetch-url "https://raw.github.com/chromium/chromium/$chromium_version/net/http/transport_security_state_static.json")
+
+sed -e "0,/chromium_version/s/chromium_version = \".*\"/chromium_version = \"$chromium_version\"/" \
+    -e "0,/sha256/s/sha256 = \".*\"/sha256 = \"$sha256\"/" \
+  --in-place ./default.nix
diff --git a/nixpkgs/pkgs/development/libraries/libhttpseverywhere/default.nix b/nixpkgs/pkgs/development/libraries/libhttpseverywhere/default.nix
new file mode 100644
index 000000000000..975ad2258131
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libhttpseverywhere/default.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, fetchurl, pkg-config, meson, ninja, makeFontsConf, vala, fetchpatch
+, gnome, libgee, glib, json-glib, libarchive, libsoup, gobject-introspection }:
+
+let
+  pname = "libhttpseverywhere";
+  version = "0.8.3";
+in stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz";
+    sha256 = "1jmn6i4vsm89q1axlq4ajqkzqmlmjaml9xhw3h9jnal46db6y00w";
+  };
+
+  nativeBuildInputs = [ vala gobject-introspection meson ninja pkg-config ];
+  buildInputs = [ glib libgee json-glib libsoup libarchive ];
+
+  # Fixes build with vala >=0.42
+  patches = [
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/libhttpseverywhere/commit/6da08ef1ade9ea267cecf14dd5cb2c3e6e5e50cb.patch";
+      sha256 = "1nwjlh8iqgjayccwdh0fbpq2g1h8bg1k1g9i324f2bhhvyhmpq8f";
+    })
+  ];
+
+  mesonFlags = [ "-Denable_valadoc=true" ];
+
+  doCheck = true;
+
+  checkPhase = "(cd test && ./httpseverywhere_test)";
+
+  FONTCONFIG_FILE = makeFontsConf { fontDirectories = [ ]; };
+
+  outputs = [ "out" "devdoc" ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "Library to use HTTPSEverywhere in desktop applications";
+    homepage = "https://gitlab.gnome.org/GNOME/libhttpseverywhere";
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ sternenseemann ] ++ teams.gnome.members;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libhugetlbfs/default.nix b/nixpkgs/pkgs/development/libraries/libhugetlbfs/default.nix
new file mode 100644
index 000000000000..061fe51ed5ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libhugetlbfs/default.nix
@@ -0,0 +1,41 @@
+{ stdenv, lib, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libhugetlbfs";
+  version = "2.23";
+
+  src = fetchurl {
+    url = "https://github.com/libhugetlbfs/libhugetlbfs/releases/download/${version}/libhugetlbfs-${version}.tar.gz";
+    sha256 = "0ya4q001g111d3pqlzrf3yaifadl0ccirx5dndz1pih7x3qp41mp";
+  };
+
+  outputs = [ "bin" "dev" "man" "doc" "lib" "out" ];
+
+  postConfigure = ''
+    patchShebangs ld.hugetlbfs
+  '';
+
+  enableParallelBuilding = true;
+  makeFlags = [
+    "BUILDTYPE=NATIVEONLY"
+    "PREFIX=$(out)"
+    "HEADERDIR=$(dev)/include"
+    "LIBDIR32=$(lib)/$(LIB32)"
+    "LIBDIR64=$(lib)/$(LIB64)"
+    "EXEDIR=$(bin)/bin"
+    "DOCDIR=$(doc)/share/doc/libhugetlbfs"
+    "MANDIR=$(man)/share/man"
+  ];
+
+  # Default target builds tests as well, and the tests want a static
+  # libc.
+  buildFlags = [ "libs" "tools" ];
+  installTargets = [ "install" "install-docs" ];
+
+  meta = with lib; {
+    description = "library and utilities for Linux hugepages";
+    maintainers = with maintainers; [ qyliss ];
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libiberty/default.nix b/nixpkgs/pkgs/development/libraries/libiberty/default.nix
new file mode 100644
index 000000000000..2040ef3bee08
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libiberty/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, buildPackages
+, staticBuild ? stdenv.hostPlatform.isStatic
+}:
+
+let inherit (buildPackages.buildPackages) gcc; in
+
+stdenv.mkDerivation {
+  pname = "libiberty";
+  version = "${gcc.cc.version}";
+
+  inherit (gcc.cc) src;
+
+  outputs = [ "out" "dev" ];
+
+  postUnpack = "sourceRoot=\${sourceRoot}/libiberty";
+
+  configureFlags = [ "--enable-install-libiberty" ]
+    ++ lib.optional (!staticBuild) "--enable-shared";
+
+  postInstall = lib.optionalString (!staticBuild) ''
+    cp pic/libiberty.a $out/lib*/libiberty.a
+  '';
+
+  meta = with lib; {
+    homepage = "https://gcc.gnu.org/";
+    license = licenses.lgpl2;
+    description = "Collection of subroutines used by various GNU programs";
+    maintainers = with maintainers; [ abbradar ericson2314 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libibmad/default.nix b/nixpkgs/pkgs/development/libraries/libibmad/default.nix
new file mode 100644
index 000000000000..9088d9022069
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libibmad/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, fetchurl, libibumad }:
+
+stdenv.mkDerivation rec {
+  pname = "libibmad";
+  version = "1.3.13";
+
+  src = fetchurl {
+    url = "https://www.openfabrics.org/downloads/management/${pname}-${version}.tar.gz";
+    sha256 = "02sj8k2jpcbiq8s0l2lqk4vwji2dbb2lc730cv1yzv0zr0hxgk8p";
+  };
+
+  buildInputs = [ libibumad ];
+
+  meta = with lib; {
+    homepage = "https://www.openfabrics.org/";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libibumad/default.nix b/nixpkgs/pkgs/development/libraries/libibumad/default.nix
new file mode 100644
index 000000000000..b9ebef7d4ccb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libibumad/default.nix
@@ -0,0 +1,17 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libibumad";
+  version = "1.3.10.2";
+
+  src = fetchurl {
+    url = "https://www.openfabrics.org/downloads/management/${pname}-${version}.tar.gz";
+    sha256 = "0bkygb3lbpaj6s4vsyixybrrkcnilbijv4ga5p1xdwyr3gip83sh";
+  };
+
+  meta = with lib; {
+    homepage = "https://www.openfabrics.org/";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libical/default.nix b/nixpkgs/pkgs/development/libraries/libical/default.nix
new file mode 100644
index 000000000000..909ee73e69a6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libical/default.nix
@@ -0,0 +1,106 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, buildPackages
+, cmake
+, glib
+, icu
+, libxml2
+, ninja
+, perl
+, pkg-config
+, libical
+, python3
+, tzdata
+, fixDarwinDylibNames
+, introspectionSupport ? stdenv.buildPlatform == stdenv.hostPlatform
+, gobject-introspection
+, vala
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libical";
+  version = "3.0.10";
+
+  outputs = [ "out" "dev" ]; # "devdoc" ];
+
+  src = fetchFromGitHub {
+    owner = "libical";
+    repo = "libical";
+    rev = "v${version}";
+    sha256 = "sha256-fLmEJlkZLYLcKZqZwitf8rH261QDPTJZf/+/+FMsGIg=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    ninja
+    perl
+    pkg-config
+    # Docs building fails:
+    # https://github.com/NixOS/nixpkgs/pull/67204
+    # previously with https://github.com/NixOS/nixpkgs/pull/61657#issuecomment-495579489
+    # gtk-doc docbook_xsl docbook_xml_dtd_43 # for docs
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    # provides ical-glib-src-generator that runs during build
+    libical
+  ] ++ lib.optionals introspectionSupport [
+    gobject-introspection
+    vala
+  ] ++ lib.optionals stdenv.isDarwin [
+    fixDarwinDylibNames
+  ];
+  installCheckInputs = [
+    # running libical-glib tests
+    (python3.withPackages (pkgs: with pkgs; [
+      pygobject3
+    ]))
+  ];
+
+  buildInputs = [
+    glib
+    libxml2
+    icu
+  ];
+
+  cmakeFlags = [
+    "-DENABLE_GTK_DOC=False"
+  ] ++ lib.optionals introspectionSupport [
+    "-DGOBJECT_INTROSPECTION=True"
+    "-DICAL_GLIB_VAPI=True"
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "-DIMPORT_ICAL_GLIB_SRC_GENERATOR=${lib.getDev buildPackages.libical}/lib/cmake/LibIcal/IcalGlibSrcGenerator.cmake"
+  ];
+
+  patches = [
+    # Will appear in 3.1.0
+    # https://github.com/libical/libical/issues/350
+    ./respect-env-tzdir.patch
+  ];
+
+  # Using install check so we do not have to manually set
+  # LD_LIBRARY_PATH and GI_TYPELIB_PATH variables
+  doInstallCheck = true;
+  enableParallelChecking = false;
+  preInstallCheck = if stdenv.isDarwin then ''
+    for testexe in $(find ./src/test -maxdepth 1 -type f -executable); do
+      for lib in $(cd lib && ls *.3.dylib); do
+        install_name_tool -change $lib $out/lib/$lib $testexe
+      done
+    done
+  '' else null;
+  installCheckPhase = ''
+    runHook preInstallCheck
+
+    export TZDIR=${tzdata}/share/zoneinfo
+    ctest --output-on-failure
+
+    runHook postInstallCheck
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/libical/libical";
+    description = "An Open Source implementation of the iCalendar protocols";
+    license = licenses.mpl20;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libical/respect-env-tzdir.patch b/nixpkgs/pkgs/development/libraries/libical/respect-env-tzdir.patch
new file mode 100644
index 000000000000..59d23e490e5a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libical/respect-env-tzdir.patch
@@ -0,0 +1,29 @@
+--- a/src/libical/icaltz-util.c
++++ b/src/libical/icaltz-util.c
+@@ -94,9 +94,9 @@
+ static const char *zdir = NULL;
+ 
+ static const char *search_paths[] = {
++    "/etc/zoneinfo",
+     "/usr/share/zoneinfo",
+     "/usr/lib/zoneinfo",
+-    "/etc/zoneinfo",
+     "/usr/share/lib/zoneinfo"
+ };
+ 
+@@ -178,6 +178,15 @@
+     const char *fname = ZONES_TAB_SYSTEM_FILENAME;
+     size_t i, num_search_paths;
+ 
++   const char *env_tzdir = getenv ("TZDIR");
++   if (env_tzdir) {
++       sprintf (file_path, "%s/%s", env_tzdir, fname);
++       if (!access (file_path, F_OK|R_OK)) {
++           zdir = env_tzdir;
++           return;
++       }
++   }
++
+     num_search_paths = sizeof(search_paths) / sizeof(search_paths[0]);
+     for (i = 0; i < num_search_paths; i++) {
+         snprintf(file_path, MAXPATHLEN, "%s/%s", search_paths[i], fname);
diff --git a/nixpkgs/pkgs/development/libraries/libicns/default.nix b/nixpkgs/pkgs/development/libraries/libicns/default.nix
new file mode 100644
index 000000000000..1df2a8abb82c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libicns/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, libpng, openjpeg }:
+
+stdenv.mkDerivation rec {
+  pname = "libicns";
+  version = "0.8.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/icns/${pname}-${version}.tar.gz";
+    sha256 = "1hjm8lwap7bjyyxsyi94fh5817xzqhk4kb5y0b7mb6675xw10prk";
+  };
+
+  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 lib; {
+    description = "Library for manipulation of the Mac OS icns resource format";
+    homepage = "https://icns.sourceforge.io";
+    license = with licenses; [ gpl2 lgpl2 lgpl21 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libiconv/default.nix b/nixpkgs/pkgs/development/libraries/libiconv/default.nix
new file mode 100644
index 000000000000..35d01cd3e820
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libiconv/default.nix
@@ -0,0 +1,57 @@
+{ fetchurl, stdenv, lib
+, enableStatic ? stdenv.hostPlatform.isStatic
+, enableShared ? !stdenv.hostPlatform.isStatic
+}:
+
+# assert !stdenv.hostPlatform.isLinux || stdenv.hostPlatform != stdenv.buildPlatform; # TODO: improve on cross
+
+stdenv.mkDerivation rec {
+  pname = "libiconv";
+  version = "1.16";
+
+  src = fetchurl {
+    url = "mirror://gnu/libiconv/${pname}-${version}.tar.gz";
+    sha256 = "016c57srqr0bza5fxjxfrx6aqxkqy0s3gkhcg7p7fhk5i6sv38g6";
+  };
+
+  setupHooks = [
+    ../../../build-support/setup-hooks/role.bash
+    ./setup-hook.sh
+  ];
+
+  postPatch =
+    lib.optionalString ((stdenv.hostPlatform != stdenv.buildPlatform && stdenv.hostPlatform.libc == "msvcrt") || stdenv.cc.nativeLibc)
+      ''
+        sed '/^_GL_WARN_ON_USE (gets/d' -i srclib/stdio.in.h
+      ''
+    + lib.optionalString (!enableShared) ''
+      sed -i -e '/preload/d' Makefile.in
+    '';
+
+  configureFlags = [
+    (lib.enableFeature enableStatic "static")
+    (lib.enableFeature enableShared "shared")
+  ] ++ lib.optional stdenv.isFreeBSD "--with-pic";
+
+  meta = {
+    description = "An iconv(3) implementation";
+
+    longDescription = ''
+      Some programs, like mailers and web browsers, must be able to convert
+      between a given text encoding and the user's encoding.  Other programs
+      internally store strings in Unicode, to facilitate internal processing,
+      and need to convert between internal string representation (Unicode)
+      and external string representation (a traditional encoding) when they
+      are doing I/O.  GNU libiconv is a conversion library for both kinds of
+      applications.
+    '';
+
+    homepage = "https://www.gnu.org/software/libiconv/";
+    license = lib.licenses.lgpl2Plus;
+
+    maintainers = [ ];
+
+    # This library is not needed on GNU platforms.
+    hydraPlatforms = with lib.platforms; cygwin ++ darwin ++ freebsd;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libiconv/setup-hook.sh b/nixpkgs/pkgs/development/libraries/libiconv/setup-hook.sh
new file mode 100644
index 000000000000..3d9656ffe5d6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libiconv/setup-hook.sh
@@ -0,0 +1,8 @@
+# libiconv must be listed in load flags on non-Glibc
+# it doesn't hurt to have it in Glibc either though
+
+# See pkgs/build-support/setup-hooks/role.bash
+if [ -z "${dontAddExtraLibs-}" ]; then
+    getHostRole
+    export NIX_LDFLAGS${role_post}+=" -liconv"
+fi
diff --git a/nixpkgs/pkgs/development/libraries/libid3tag/CVE-2017-11550-and-CVE-2017-11551.patch b/nixpkgs/pkgs/development/libraries/libid3tag/CVE-2017-11550-and-CVE-2017-11551.patch
new file mode 100644
index 000000000000..b1f9d0978cec
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libid3tag/CVE-2017-11550-and-CVE-2017-11551.patch
@@ -0,0 +1,13 @@
+Common subdirectories: libid3tag-0.15.1b/msvc++ and libid3tag-0.15.1b-patched/msvc++
+diff -uwp libid3tag-0.15.1b/utf16.c libid3tag-0.15.1b-patched/utf16.c
+--- libid3tag-0.15.1b/utf16.c	2004-01-23 10:41:32.000000000 +0100
++++ libid3tag-0.15.1b-patched/utf16.c	2018-11-01 13:12:00.866050641 +0100
+@@ -250,6 +250,8 @@ id3_ucs4_t *id3_utf16_deserialize(id3_by
+   id3_ucs4_t *ucs4;
+ 
+   end = *ptr + (length & ~1);
++  if (end == *ptr)
++    return 0;
+ 
+   utf16 = malloc((length / 2 + 1) * sizeof(*utf16));
+   if (utf16 == 0)
diff --git a/nixpkgs/pkgs/development/libraries/libid3tag/debian-patches.patch b/nixpkgs/pkgs/development/libraries/libid3tag/debian-patches.patch
new file mode 100644
index 000000000000..0a828b334cf8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libid3tag/debian-patches.patch
@@ -0,0 +1,89 @@
+diff --git a/compat.gperf b/compat.gperf
+index 4e24613..5635980 100644
+--- a/compat.gperf
++++ b/compat.gperf
+@@ -236,6 +236,10 @@ int id3_compat_fixup(struct id3_tag *tag)
+
+     encoding = id3_parse_uint(&data, 1);
+     string   = id3_parse_string(&data, end - data, encoding, 0);
++    if (!string)
++    {
++	continue;
++    }
+
+     if (id3_ucs4_length(string) < 4) {
+       free(string);
+diff --git a/genre.dat b/genre.dat
+index 17acab5..1f02779 100644
+--- a/genre.dat
++++ b/genre.dat
+@@ -277,8 +277,8 @@ static id3_ucs4_t const genre_PUNK_ROCK[] =
+   { 'P', 'u', 'n', 'k', ' ', 'R', 'o', 'c', 'k', 0 };
+ static id3_ucs4_t const genre_DRUM_SOLO[] =
+   { 'D', 'r', 'u', 'm', ' ', 'S', 'o', 'l', 'o', 0 };
+-static id3_ucs4_t const genre_A_CAPPELLA[] =
+-  { 'A', ' ', 'C', 'a', 'p', 'p', 'e', 'l', 'l', 'a', 0 };
++static id3_ucs4_t const genre_A_CAPELLA[] =
++  { 'A', ' ', 'C', 'a', 'p', 'e', 'l', 'l', 'a', 0 };
+ static id3_ucs4_t const genre_EURO_HOUSE[] =
+   { 'E', 'u', 'r', 'o', '-', 'H', 'o', 'u', 's', 'e', 0 };
+ static id3_ucs4_t const genre_DANCE_HALL[] =
+@@ -452,7 +452,7 @@ static id3_ucs4_t const *const genre_table[] = {
+   genre_DUET,
+   genre_PUNK_ROCK,
+   genre_DRUM_SOLO,
+-  genre_A_CAPPELLA,
++  genre_A_CAPELLA,
+   genre_EURO_HOUSE,
+   genre_DANCE_HALL,
+   genre_GOA,
+diff --git a/genre.dat.in b/genre.dat.in
+index 872de40..e71e34b 100644
+--- a/genre.dat.in
++++ b/genre.dat.in
+@@ -153,7 +153,7 @@ Freestyle
+ Duet
+ Punk Rock
+ Drum Solo
+-A Cappella
++A Capella
+ Euro-House
+ Dance Hall
+ Goa
+diff --git a/parse.c b/parse.c
+index 86a3f21..947c249 100644
+--- a/parse.c
++++ b/parse.c
+@@ -165,6 +165,9 @@ id3_ucs4_t *id3_parse_string(id3_byte_t const **ptr, id3_length_t length,
+   case ID3_FIELD_TEXTENCODING_UTF_8:
+     ucs4 = id3_utf8_deserialize(ptr, length);
+     break;
++  default:
++  	/* FIXME: Unknown encoding! Print warning? */
++	return NULL;
+   }
+
+   if (ucs4 && !full) {
+diff --git a/utf16.c b/utf16.c
+index 70ee9d5..6e60a75 100644
+--- a/utf16.c
++++ b/utf16.c
+@@ -282,5 +282,18 @@ id3_ucs4_t *id3_utf16_deserialize(id3_byte_t const **ptr, id3_length_t length,
+
+   free(utf16);
+
++  if (end == *ptr && length % 2 != 0)
++  {
++     /* We were called with a bogus length.  It should always
++      * be an even number.  We can deal with this in a few ways:
++      * - Always give an error.
++      * - Try and parse as much as we can and
++      *   - return an error if we're called again when we
++      *     already tried to parse everything we can.
++      *   - tell that we parsed it, which is what we do here.
++      */
++     (*ptr)++;
++  }
++
+   return ucs4;
+ }
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/libraries/libid3tag/default.nix b/nixpkgs/pkgs/development/libraries/libid3tag/default.nix
new file mode 100644
index 000000000000..8cedd1bcb418
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libid3tag/default.nix
@@ -0,0 +1,44 @@
+{lib, stdenv, fetchurl, zlib, gperf}:
+
+stdenv.mkDerivation rec {
+  pname = "libid3tag";
+  version = "0.15.1b";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/mad/libid3tag-0.15.1b.tar.gz";
+    sha256 = "63da4f6e7997278f8a3fef4c6a372d342f705051d1eeb6a46a86b03610e26151";
+  };
+
+  outputs = [ "out" "dev" ];
+  setOutputFlags = false;
+
+  propagatedBuildInputs = [ zlib gperf ];
+
+  patches = [
+    ./debian-patches.patch
+    ./CVE-2017-11550-and-CVE-2017-11551.patch
+  ];
+
+  preConfigure = ''
+    configureFlagsArray+=(
+      --includedir=$dev/include
+    )
+  '';
+
+  postInstall = ''
+    mkdir -p $dev/lib/pkgconfig
+    cp ${./id3tag.pc} $dev/lib/pkgconfig/id3tag.pc
+    substituteInPlace $dev/lib/pkgconfig/id3tag.pc \
+      --subst-var-by out $out \
+      --subst-var-by dev $dev \
+      --subst-var-by version "${version}"
+  '';
+
+  meta = with lib; {
+    description = "ID3 tag manipulation library";
+    homepage = "http://mad.sourceforge.net/";
+    license = licenses.gpl2;
+    maintainers = [ ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libid3tag/id3tag.pc b/nixpkgs/pkgs/development/libraries/libid3tag/id3tag.pc
new file mode 100644
index 000000000000..e3df7b3f9df0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libid3tag/id3tag.pc
@@ -0,0 +1,11 @@
+prefix=@out@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=@dev@/include
+
+Name: libid3tag
+Description: ID3 tag manipulation library
+Version: @version@
+
+Libs: -L${libdir} -lid3tag
+Cflags: -I${includedir}
diff --git a/nixpkgs/pkgs/development/libraries/libidn/default.nix b/nixpkgs/pkgs/development/libraries/libidn/default.nix
new file mode 100644
index 000000000000..e47bb070a36e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libidn/default.nix
@@ -0,0 +1,43 @@
+{ fetchurl, lib, stdenv, libiconv }:
+
+stdenv.mkDerivation rec {
+  pname = "libidn";
+  version = "1.38";
+
+  src = fetchurl {
+    url = "mirror://gnu/libidn/${pname}-${version}.tar.gz";
+    sha256 = "sha256-3gC4QPdXzTuxTdmiDVk2RzI13cugbUvC2oBGVLi78PY=";
+  };
+
+  outputs = [ "bin" "dev" "out" "info" "devdoc" ];
+
+  hardeningDisable = [ "format" ];
+
+  buildInputs = lib.optional stdenv.isDarwin libiconv;
+
+  meta = {
+    homepage = "https://www.gnu.org/software/libidn/";
+    description = "Library for internationalized domain names";
+
+    longDescription = ''
+      GNU Libidn is a fully documented implementation of the
+      Stringprep, Punycode and IDNA specifications.  Libidn's purpose
+      is to encode and decode internationalized domain names.  The
+      native C, C\# and Java libraries are available under the GNU
+      Lesser General Public License version 2.1 or later.
+
+      The library contains a generic Stringprep implementation.
+      Profiles for Nameprep, iSCSI, SASL, XMPP and Kerberos V5 are
+      included.  Punycode and ASCII Compatible Encoding (ACE) via IDNA
+      are supported.  A mechanism to define Top-Level Domain (TLD)
+      specific validation tables, and to compare strings against those
+      tables, is included.  Default tables for some TLDs are also
+      included.
+    '';
+
+    repositories.git = "git://git.savannah.gnu.org/libidn.git";
+    license = lib.licenses.lgpl2Plus;
+    platforms = lib.platforms.all;
+    maintainers = with lib.maintainers; [ lsix ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libidn2/default.nix b/nixpkgs/pkgs/development/libraries/libidn2/default.nix
new file mode 100644
index 000000000000..2b5434e723aa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libidn2/default.nix
@@ -0,0 +1,47 @@
+{ fetchurl, lib, stdenv, libiconv, libunistring, help2man, texinfo, buildPackages }:
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "libidn2";
+  version = "2.3.2";
+
+  src = fetchurl {
+    url = "mirror://gnu/gnu/libidn/${pname}-${version}.tar.gz";
+    sha256 = "sha256-dpQM1Od46Ak1eanRlbJf/16Tbp3GJCBoUotDenZ2T5E=";
+  };
+
+  outputs = [ "bin" "dev" "out" "info" "devdoc" ];
+
+  patches = optional stdenv.isDarwin ./fix-error-darwin.patch;
+
+  # The above patch causes the documentation to be regenerated, so the
+  # documentation tools are required.
+  nativeBuildInputs = optionals stdenv.isDarwin [ help2man texinfo ];
+  buildInputs = [ libunistring ] ++ optional stdenv.isDarwin libiconv;
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+
+  meta = {
+    homepage = "https://www.gnu.org/software/libidn/#libidn2";
+    description = "Free software implementation of IDNA2008 and TR46";
+
+    longDescription = ''
+      Libidn2 is believed to be a complete IDNA2008 and TR46 implementation,
+      but has yet to be as extensively used as the IDNA2003 Libidn library.
+
+      The installed C library libidn2 is dual-licensed under LGPLv3+|GPLv2+,
+      while the rest of the package is GPLv3+.  See the file COPYING for
+      detailed information.
+    '';
+
+    repositories.git = "https://gitlab.com/jas/libidn2";
+    license = with lib.licenses; [ lgpl3Plus gpl2Plus gpl3Plus ];
+    platforms = lib.platforms.all;
+    maintainers = with lib.maintainers; [ fpletz ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libidn2/fix-error-darwin.patch b/nixpkgs/pkgs/development/libraries/libidn2/fix-error-darwin.patch
new file mode 100644
index 000000000000..e2202abd947c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libidn2/fix-error-darwin.patch
@@ -0,0 +1,20 @@
+diff --git a/src/idn2.c b/src/idn2.c
+index 6abbc72..804f0f2 100644
+--- a/src/idn2.c
++++ b/src/idn2.c
+@@ -31,7 +31,6 @@
+ #include <unistr.h>
+ 
+ /* Gnulib headers. */
+-#include "error.h"
+ #include "gettext.h"
+ #define _(String) dgettext (PACKAGE, String)
+ #include "progname.h"
+@@ -222,7 +219,7 @@ main (int argc, char *argv[])
+     }
+ 
+   if (ferror (stdin))
+-    error (EXIT_FAILURE, errno, "%s", _("input error"));
++    perror (_("input error"));
+ 
+   cmdline_parser_free (&args_info);
diff --git a/nixpkgs/pkgs/development/libraries/libiec61883/default.nix b/nixpkgs/pkgs/development/libraries/libiec61883/default.nix
new file mode 100644
index 000000000000..911210202fe0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libiec61883/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, pkg-config, libraw1394 }:
+
+stdenv.mkDerivation rec {
+  version = "1.2.0";
+  pname = "libiec61883";
+
+  src = fetchurl {
+    url = "mirror://debian/pool/main/libi/libiec61883/libiec61883_${version}.orig.tar.gz";
+    name = "libiec61883-${version}.tar.gz";
+    sha256 = "7c7879c6b9add3148baea697dfbfdcefffbc8ac74e8e6bcf46125ec1d21b373a";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  propagatedBuildInputs = [ libraw1394 ];
+
+  meta = with lib; {
+    homepage = "https://www.linux1394.org";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libieee1284/default.nix b/nixpkgs/pkgs/development/libraries/libieee1284/default.nix
new file mode 100644
index 000000000000..7c20d1b4947c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libieee1284/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, xmlto, docbook_xml_dtd_412, docbook_xsl }:
+
+stdenv.mkDerivation rec {
+  pname = "libieee1284";
+  version = "0.2.11";
+
+  src = fetchFromGitHub {
+    owner = "twaugh";
+    repo = pname;
+    rev = "V${builtins.replaceStrings [ "." ] [ "_" ] version}";
+    sha256 = "0wfv1prmhhpyll9l4g1ij3im7hk9mm96ydw3l9fvhjp3993cdn2x";
+  };
+
+  nativeBuildInputs = [
+    autoconf
+    automake
+    libtool
+    xmlto
+    docbook_xml_dtd_412
+    docbook_xsl
+  ];
+
+  configureFlags = [
+    "--without-python"
+  ];
+
+  preConfigure = ''
+    ./bootstrap
+  '';
+
+  meta = with lib; {
+    description = "Parallel port communication library";
+    homepage = "http://cyberelk.net/tim/software/libieee1284/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ romildo ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libiio/cmake-fix-libxml2-find-package.patch b/nixpkgs/pkgs/development/libraries/libiio/cmake-fix-libxml2-find-package.patch
new file mode 100644
index 000000000000..25345bef90c4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libiio/cmake-fix-libxml2-find-package.patch
@@ -0,0 +1,13 @@
+diff --color -ur a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt	2021-05-30 13:46:22.256040282 +0200
++++ b/CMakeLists.txt	2021-05-30 14:15:42.530181216 +0200
+@@ -333,7 +333,7 @@
+ # So, try first to find the CMake module provided by libxml2 package, then fallback
+ # on the CMake's FindLibXml2.cmake module (which can lack some definition, especially
+ # in static build case).
+-find_package(LibXml2 QUIET NO_MODULE)
++find_package(LibXml2 QUIET MODULE)
+ if(DEFINED LIBXML2_VERSION_STRING)
+ 	set(LIBXML2_FOUND ON)
+ 	set(LIBXML2_INCLUDE_DIR ${LIBXML2_INCLUDE_DIRS})
+Seulement dans b: good.patch
diff --git a/nixpkgs/pkgs/development/libraries/libiio/default.nix b/nixpkgs/pkgs/development/libraries/libiio/default.nix
new file mode 100644
index 000000000000..e704076ab57a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libiio/default.nix
@@ -0,0 +1,67 @@
+{ stdenv
+, fetchFromGitHub
+, cmake
+, flex
+, bison
+, libxml2
+, python
+, libusb1
+, runtimeShell
+, lib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libiio";
+  version = "0.21";
+
+  outputs = [ "out" "lib" "dev" "python" ];
+
+  src = fetchFromGitHub {
+    owner = "analogdevicesinc";
+    repo = "libiio";
+    rev = "v${version}";
+    sha256 = "0psw67mzysdb8fkh8xpcwicm7z94k8plkcc8ymxyvl6inshq0mc7";
+  };
+
+  # Revert after https://github.com/NixOS/nixpkgs/issues/125008 is
+  # fixed properly
+  patches = [ ./cmake-fix-libxml2-find-package.patch ];
+
+  nativeBuildInputs = [
+    cmake
+    flex
+    bison
+  ];
+
+  buildInputs = [
+    python
+    libxml2
+    libusb1
+  ] ++ lib.optional python.isPy3k python.pkgs.setuptools;
+
+  cmakeFlags = [
+    "-DUDEV_RULES_INSTALL_DIR=${placeholder "out"}/lib/udev/rules.d"
+    "-DPYTHON_BINDINGS=on"
+  ];
+
+  postPatch = ''
+    # Hardcode path to the shared library into the bindings.
+    sed "s#@libiio@#$lib/lib/libiio${stdenv.hostPlatform.extensions.sharedLibrary}#g" ${./hardcode-library-path.patch} | patch -p1
+
+    substituteInPlace libiio.rules.cmakein \
+      --replace /bin/sh ${runtimeShell}
+  '';
+
+  postInstall = ''
+    # Move Python bindings into a separate output.
+    moveToOutput ${python.sitePackages} "$python"
+  '';
+
+  meta = with lib; {
+    description = "API for interfacing with the Linux Industrial I/O Subsystem";
+    homepage = "https://github.com/analogdevicesinc/libiio";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libiio/hardcode-library-path.patch b/nixpkgs/pkgs/development/libraries/libiio/hardcode-library-path.patch
new file mode 100644
index 000000000000..dad35851cdc6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libiio/hardcode-library-path.patch
@@ -0,0 +1,38 @@
+diff --git a/bindings/python/iio.py b/bindings/python/iio.py
+index 5306daa..f8962ee 100644
+--- a/bindings/python/iio.py
++++ b/bindings/python/iio.py
+@@ -229,9 +229,9 @@ if "Windows" in _system():
+     _iiolib = "libiio.dll"
+ else:
+     # Non-windows, possibly Posix system
+-    _iiolib = "iio"
++    _iiolib = "@libiio@"
+ 
+-_lib = _cdll(find_library(_iiolib), use_errno=True, use_last_error=True)
++_lib = _cdll(_iiolib, use_errno=True, use_last_error=True)
+ 
+ _get_backends_count = _lib.iio_get_backends_count
+ _get_backends_count.restype = c_uint
+diff --git a/bindings/python/setup.py.cmakein b/bindings/python/setup.py.cmakein
+index cd14e2e..516c409 100644
+--- a/bindings/python/setup.py.cmakein
++++ b/bindings/python/setup.py.cmakein
+@@ -62,7 +62,7 @@ class InstallWrapper(install):
+             _iiolib = "libiio.dll"
+         else:
+             # Non-windows, possibly Posix system
+-            _iiolib = "iio"
++            _iiolib = "@libiio@"
+         try:
+             import os
+ 
+@@ -72,7 +72,7 @@ class InstallWrapper(install):
+                 fulllibpath = find_recursive(destdir, "libiio.so")
+                 _lib = _cdll(fulllibpath, use_errno=True, use_last_error=True)
+             else:
+-                _lib = _cdll(find_library(_iiolib), use_errno=True, use_last_error=True)
++                _lib = _cdll(_iiolib, use_errno=True, use_last_error=True)
+             if not _lib._name:
+                 raise OSError
+         except OSError:
diff --git a/nixpkgs/pkgs/development/libraries/libimagequant/default.nix b/nixpkgs/pkgs/development/libraries/libimagequant/default.nix
new file mode 100644
index 000000000000..8a5751411486
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libimagequant/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "libimagequant";
+  version = "2.15.1";
+
+  src = fetchFromGitHub {
+    owner = "ImageOptim";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-ElMwLeUdrJeJJ9YoieCF/CUNcNMwj5WcjXmMW/nMyAw=";
+  };
+
+  preConfigure = ''
+    patchShebangs ./configure
+  '';
+
+  configureFlags = lib.optionals (!stdenv.isi686 && !stdenv.isx86_64) [ "--disable-sse" ];
+
+  meta = with lib; {
+    homepage = "https://pngquant.org/lib/";
+    description = "Image quantization library";
+    longDescription = "Small, portable C library for high-quality conversion of RGBA images to 8-bit indexed-color (palette) images.";
+    license = licenses.gpl3Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ma9e marsam ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libime/default.nix b/nixpkgs/pkgs/development/libraries/libime/default.nix
new file mode 100644
index 000000000000..4f0caa7cc33c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libime/default.nix
@@ -0,0 +1,63 @@
+{ lib, stdenv
+, fetchurl
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, boost
+, python3
+, fcitx5
+}:
+
+let
+  table = fetchurl {
+    url = "https://download.fcitx-im.org/data/table.tar.gz";
+    sha256 = "1dw7mgbaidv3vqy0sh8dbfv8631d2zwv5mlb7npf69a1f8y0b5k1";
+  };
+  arpaVer = "20140820";
+  arpa = fetchurl {
+    url = "https://download.fcitx-im.org/data/lm_sc.3gm.arpa-${arpaVer}.tar.bz2";
+    sha256 = "0bqy3l7mif0yygjrcm65qallszgn17mvgyxhvz7a54zaamyan6vm";
+  };
+  dictVer = "20210402";
+  dict = fetchurl {
+    url = "https://download.fcitx-im.org/data/dict.utf8-${dictVer}.tar.xz";
+    sha256 = "sha256-gYz7tama5bQMJwe2FYc09KEBlkRIU0AMvWsUUFWS2A0=";
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "libime";
+  version = "1.0.7";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = "libime";
+    rev = version;
+    sha256 = "sha256-q/SXS6pT4vBkCkCTarPVHrZPXijYnc2t51YGRvzQ0FY=";
+    fetchSubmodules = true;
+  };
+
+  prePatch = ''
+    ln -s ${table} data/$(stripHash ${table})
+    ln -s ${arpa} data/$(stripHash ${arpa})
+    ln -s ${dict} data/$(stripHash ${dict})
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+    python3
+  ];
+
+  buildInputs = [
+    boost
+    fcitx5
+  ];
+
+  meta = with lib; {
+    description = "A library to support generic input method implementation";
+    homepage = "https://github.com/fcitx/libime";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libimobiledevice/default.nix b/nixpkgs/pkgs/development/libraries/libimobiledevice/default.nix
new file mode 100644
index 000000000000..94fce176127c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libimobiledevice/default.nix
@@ -0,0 +1,64 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, libtool
+, pkg-config
+, gnutls
+, libgcrypt
+, libtasn1
+, glib
+, libplist
+, libusbmuxd
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libimobiledevice";
+  version = "unstable-2021-06-02";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "ca324155f8b33babf907704828c7903608db0aa2";
+    sha256 = "sha256-Q7THwld1+elMJQ14kRnlIJDohFt7MW7JeyIUGC0k52I=";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    libtool
+    pkg-config
+  ];
+
+  propagatedBuildInputs = [
+    glib
+    gnutls
+    libgcrypt
+    libplist
+    libtasn1
+    libusbmuxd
+  ];
+
+  configureFlags = [ "--disable-openssl" "--without-cython" ];
+
+  meta = with lib; {
+    homepage = "https://github.com/libimobiledevice/libimobiledevice";
+    description = "A software library that talks the protocols to support iPhone®, iPod Touch® and iPad® devices on Linux";
+    longDescription = ''
+      libimobiledevice is a software library that talks the protocols to support
+      iPhone®, iPod Touch® and iPad® devices on Linux. Unlike other projects, it
+      does not depend on using any existing proprietary libraries and does not
+      require jailbreaking. It allows other software to easily access the
+      device's filesystem, retrieve information about the device and it's
+      internals, backup/restore the device, manage SpringBoard® icons, manage
+      installed applications, retrieve addressbook/calendars/notes and bookmarks
+      and synchronize music and video to the device. The library is in
+      development since August 2007 with the goal to bring support for these
+      devices to the Linux Desktop.
+    '';
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ infinisil ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libindicator/default.nix b/nixpkgs/pkgs/development/libraries/libindicator/default.nix
new file mode 100644
index 000000000000..139672f6d805
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libindicator/default.nix
@@ -0,0 +1,52 @@
+{ stdenv, fetchurl, lib, file
+, pkg-config
+, gtkVersion ? "3", gtk2 ? null, gtk3 ? null }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  name = "libindicator-gtk${gtkVersion}-${version}";
+  version = "${versionMajor}.${versionMinor}";
+  versionMajor = "12.10";
+  versionMinor = "1";
+
+  src = fetchurl {
+    url = "${meta.homepage}/${versionMajor}/${version}/+download/libindicator-${version}.tar.gz";
+    sha256 = "b2d2e44c10313d5c9cd60db455d520f80b36dc39562df079a3f29495e8f9447f";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ (if gtkVersion == "2" then gtk2 else gtk3) ];
+
+  postPatch = ''
+    substituteInPlace configure \
+      --replace 'LIBINDICATOR_LIBS+="$LIBM"' 'LIBINDICATOR_LIBS+=" $LIBM"'
+    for f in {build-aux/ltmain.sh,configure,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}"
+  ];
+
+  doCheck = false; # fails 8 out of 8 tests
+
+  meta = {
+    description = "A set of symbols and convenience functions for Ayatana indicators";
+    homepage = "https://launchpad.net/libindicator";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.msteen ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libinfinity/default.nix b/nixpkgs/pkgs/development/libraries/libinfinity/default.nix
new file mode 100644
index 000000000000..e68d27cacff5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libinfinity/default.nix
@@ -0,0 +1,53 @@
+{ gtkWidgets ? false # build GTK widgets for libinfinity
+, avahiSupport ? false # build support for Avahi in libinfinity
+, lib, stdenv, fetchurl, pkg-config, glib, libxml2, gnutls, gsasl
+, gobject-introspection
+, gtk3 ? null, gtk-doc, docbook_xsl, docbook_xml_dtd_412, avahi ? null, libdaemon, libidn, gss
+, libintl }:
+
+assert avahiSupport -> avahi != null;
+assert gtkWidgets -> gtk3 != null;
+
+let
+  mkFlag = flag: feature: (if flag then "--with-" else "--without-") + feature;
+
+  self = stdenv.mkDerivation rec {
+    pname = "libinfinity";
+    version = "0.7.2";
+    src = fetchurl {
+      url = "https://github.com/gobby/${pname}/releases/download/${version}/${pname}-${version}.tar.gz";
+      sha256 = "17i3g61hxz9pzl3ryd1yr15142r25m06jfzjrpdy7ic1b8vjjw3f";
+    };
+
+    outputs = [ "bin" "out" "dev" "man" "devdoc" ];
+
+    nativeBuildInputs = [ pkg-config gtk-doc docbook_xsl docbook_xml_dtd_412 gobject-introspection ];
+    buildInputs = [ glib libxml2 gsasl libidn gss libintl libdaemon ]
+      ++ lib.optional gtkWidgets gtk3
+      ++ lib.optional avahiSupport avahi;
+
+    propagatedBuildInputs = [ gnutls ];
+
+    configureFlags = [
+      "--enable-gtk-doc"
+      "--enable-introspection"
+      (mkFlag gtkWidgets "inftextgtk")
+      (mkFlag gtkWidgets "infgtk")
+      "--with-infinoted"
+      "--with-libdaemon"
+      (mkFlag avahiSupport "avahi")
+    ];
+
+    passthru = {
+      infinoted = "${self.bin}/bin/infinoted-${lib.versions.majorMinor version}";
+    };
+
+    meta = {
+      homepage = "https://gobby.github.io/";
+      description = "An implementation of the Infinote protocol written in GObject-based C";
+      license = lib.licenses.lgpl2Plus;
+      maintainers = [ lib.maintainers.phreedom ];
+      platforms = with lib.platforms; linux ++ darwin;
+    };
+  };
+in self
diff --git a/nixpkgs/pkgs/development/libraries/libinjection/default.nix b/nixpkgs/pkgs/development/libraries/libinjection/default.nix
new file mode 100644
index 000000000000..81a1398147ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libinjection/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchFromGitHub
+, python2
+}:
+
+stdenv.mkDerivation rec {
+  pname   = "libinjection";
+  version = "3.10.0";
+
+  src = fetchFromGitHub {
+    owner  = "client9";
+    repo   = pname;
+    rev    = "refs/tags/v${version}";
+    sha256 = "0chsgam5dqr9vjfhdcp8cgk7la6nf3lq44zs6z6si98cq743550g";
+  };
+
+  nativeBuildInputs = [ python2 ];
+
+  strictDeps = true;
+
+  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 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/libinklevel/default.nix b/nixpkgs/pkgs/development/libraries/libinklevel/default.nix
new file mode 100644
index 000000000000..c5dc7987ca62
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libinklevel/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl, pkg-config, libusb1 }:
+
+stdenv.mkDerivation rec {
+  pname = "libinklevel";
+  version = "0.9.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "1zwkicjznkzw81ax745inv4n29y20vq82w8249vizaal76739n19";
+  };
+
+  buildInputs = [
+    pkg-config
+    libusb1
+  ];
+
+  outputs = [ "out" "dev" "doc" ];
+
+  meta = with lib; {
+    description = "A library for checking the ink level of your printer";
+    longDescription = ''
+      Libinklevel is a library for checking the ink level of your printer on a
+      system which runs Linux or FreeBSD. It supports printers attached via
+      USB. Currently printers of the following brands are supported: HP, Epson
+      and Canon. Canon BJNP network printers are supported too. This is not
+      official software from the printer manufacturers. The goal of this
+      project is to create a vendor independent API for retrieving the ink
+      level of a printer connected to a Linux or FreeBSD box.
+    '';
+    homepage = "http://libinklevel.sourceforge.net/";
+    license = licenses.gpl2;
+    platforms = platforms.linux ++ platforms.freebsd;
+    maintainers = with maintainers; [ samb96 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libinotify-kqueue/default.nix b/nixpkgs/pkgs/development/libraries/libinotify-kqueue/default.nix
new file mode 100644
index 000000000000..ff74060d3d46
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libinotify-kqueue/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchzip, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "libinotify-kqueue";
+  version = "20180201";
+
+  src = fetchzip {
+    url = "https://github.com/libinotify-kqueue/libinotify-kqueue/archive/${version}.tar.gz";
+    sha256 = "0dkh6n0ghhcl7cjkjmpin118h7al6i4vlkmw57vip5f6ngr6q3pl";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  doCheck = true;
+  checkFlags = [ "test" ];
+
+  meta = with lib; {
+    description = "Inotify shim for macOS and BSD";
+    homepage = "https://github.com/libinotify-kqueue/libinotify-kqueue";
+    license = licenses.mit;
+    maintainers = with maintainers; [ yegortimoshenko ];
+    platforms = with platforms; darwin ++ freebsd ++ netbsd ++ openbsd;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libinput/default.nix b/nixpkgs/pkgs/development/libraries/libinput/default.nix
new file mode 100644
index 000000000000..8f1511de3304
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libinput/default.nix
@@ -0,0 +1,91 @@
+{ lib, stdenv, fetchFromGitLab, pkg-config, meson, ninja
+, libevdev, mtdev, udev, libwacom
+, documentationSupport ? false, doxygen ? null, graphviz ? null # Documentation
+, eventGUISupport ? false, cairo ? null, glib ? null, gtk3 ? null # GUI event viewer support
+, testsSupport ? false, check ? null, valgrind ? null, python3 ? null
+}:
+
+assert documentationSupport -> doxygen != null && graphviz != null && python3 != null;
+assert eventGUISupport -> cairo != null && glib != null && gtk3 != null;
+assert testsSupport -> check != null && valgrind != null && python3 != null;
+
+let
+  mkFlag = optSet: flag: "-D${flag}=${lib.boolToString optSet}";
+
+  sphinx-build = if documentationSupport then
+    python3.pkgs.sphinx.overrideAttrs (super: {
+      propagatedBuildInputs = super.propagatedBuildInputs ++ (with python3.pkgs; [ recommonmark sphinx_rtd_theme ]);
+
+      postFixup = super.postFixup or "" + ''
+        # Do not propagate Python
+        rm $out/nix-support/propagated-build-inputs
+      '';
+    })
+  else null;
+in
+
+with lib;
+stdenv.mkDerivation rec {
+  pname = "libinput";
+  version = "1.16.4";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.freedesktop.org";
+    owner = pname;
+    repo = pname;
+    rev = version;
+    sha256 = "1c81429kh9av9fanxmnjw5rvsjbzcyi7d0dx0gkyq5yysmpmrppi";
+  };
+
+  outputs = [ "bin" "out" "dev" ];
+
+  mesonFlags = [
+    (mkFlag documentationSupport "documentation")
+    (mkFlag eventGUISupport "debug-gui")
+    (mkFlag testsSupport "tests")
+    "--sysconfdir=/etc"
+    "--libexecdir=${placeholder "bin"}/libexec"
+  ];
+
+  nativeBuildInputs = [ pkg-config meson ninja ]
+    ++ optionals documentationSupport [ doxygen graphviz sphinx-build ];
+
+  buildInputs = [
+    libevdev
+    mtdev
+    libwacom
+    (python3.withPackages (pp: with pp; [
+      pp.libevdev # already in scope
+      pyudev
+      pyyaml
+      setuptools
+    ]))
+  ]
+    ++ optionals eventGUISupport [ cairo glib gtk3 ];
+
+  checkInputs = [
+    check
+    valgrind
+  ];
+
+  propagatedBuildInputs = [ udev ];
+
+  patches = [ ./udev-absolute-path.patch ];
+
+  postPatch = ''
+    patchShebangs tools/helper-copy-and-exec-from-tmp.sh
+    patchShebangs test/symbols-leak-test
+    patchShebangs test/check-leftover-udev-rules.sh
+    patchShebangs test/helper-copy-and-exec-from-tmp.sh
+  '';
+
+  doCheck = testsSupport && stdenv.hostPlatform == stdenv.buildPlatform;
+
+  meta = {
+    description = "Handles input devices in Wayland compositors and provides a generic X.Org input driver";
+    homepage    = "https://www.freedesktop.org/wiki/Software/libinput/";
+    license     = licenses.mit;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ codyopel ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libinput/udev-absolute-path.patch b/nixpkgs/pkgs/development/libraries/libinput/udev-absolute-path.patch
new file mode 100644
index 000000000000..5c85b8639486
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libinput/udev-absolute-path.patch
@@ -0,0 +1,11 @@
+--- a/meson.build
++++ b/meson.build
+@@ -100,7 +100,7 @@
+      args : model_quirks)
+ 
+ udev_rules_config = configuration_data()
+-udev_rules_config.set('UDEV_TEST_PATH', '')
++udev_rules_config.set('UDEV_TEST_PATH', dir_udev + '/')
+ configure_file(input : 'udev/80-libinput-device-groups.rules.in',
+ 	       output : '80-libinput-device-groups.rules',
+ 	       install : true,
diff --git a/nixpkgs/pkgs/development/libraries/libinsane/default.nix b/nixpkgs/pkgs/development/libraries/libinsane/default.nix
new file mode 100644
index 000000000000..51ce6808f5dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libinsane/default.nix
@@ -0,0 +1,47 @@
+{ stdenv
+, lib
+, meson
+, ninja
+, fetchFromGitLab
+, pkg-config
+, glib
+, docbook_xsl
+, sane-backends
+, gobject-introspection
+, vala
+, gtk-doc
+, valgrind
+, doxygen
+, cunit
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libinsane";
+  version = "1.0.9";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchFromGitLab {
+    domain = "gitlab.gnome.org";
+    repo = "libinsane";
+    group = "World";
+    owner = "OpenPaperwork";
+    rev = version;
+    sha256 = "1a1lszhq3j11i1jybc5kmn7hhhji44xhjqsxsldsy9l3344rkzv4";
+  };
+
+  nativeBuildInputs = [ meson pkg-config ninja doxygen gtk-doc docbook_xsl gobject-introspection vala ];
+
+  buildInputs = [ sane-backends glib ];
+
+  checkInputs = [ cunit valgrind ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Crossplatform access to image scanners (paper eaters only)";
+    homepage = "https://openpaper.work/en/projects/";
+    license = lib.licenses.lgpl3Plus;
+    maintainers = [ lib.maintainers.symphorien ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libint/default.nix b/nixpkgs/pkgs/development/libraries/libint/default.nix
new file mode 100644
index 000000000000..64b83166ae99
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libint/default.nix
@@ -0,0 +1,102 @@
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool
+, python3, perl, gmpxx, mpfr, boost, eigen, gfortran, cmake
+, enableFMA ? stdenv.hostPlatform.fmaSupport
+, enableFortran ? true
+}:
+
+let
+  pname = "libint";
+  version = "2.6.0";
+
+  meta = with lib; {
+    description = "Library for the evaluation of molecular integrals of many-body operators over Gaussian functions";
+    homepage = "https://github.com/evaleev/libint";
+    license = with licenses; [ lgpl3Only gpl3Only ];
+    maintainers = with maintainers; [ markuskowa sheepforce ];
+    platforms = [ "x86_64-linux" ];
+  };
+
+  codeGen = stdenv.mkDerivation {
+    inherit pname version;
+
+    src = fetchFromGitHub {
+      owner = "evaleev";
+      repo = pname;
+      rev = "v${version}";
+      sha256 = "0pbc2j928jyffhdp4x5bkw68mqmx610qqhnb223vdzr0n2yj5y19";
+    };
+
+    patches = [ ./fix-paths.patch ];
+
+    nativeBuildInputs = [
+      autoconf
+      automake
+      libtool
+      mpfr
+      python3
+      perl
+      gmpxx
+    ] ++ lib.optional enableFortran gfortran;
+
+    buildInputs = [ boost eigen ];
+
+    preConfigure = "./autogen.sh";
+
+    configureFlags = [
+      "--enable-eri=2"
+      "--enable-eri3=2"
+      "--enable-eri2=2"
+      "--with-eri-max-am=7,5,4"
+      "--with-eri-opt-am=3"
+      "--with-eri3-max-am=7"
+      "--with-eri2-max-am=7"
+      "--with-g12-max-am=5"
+      "--with-g12-opt-am=3"
+      "--with-g12dkh-max-am=5"
+      "--with-g12dkh-opt-am=3"
+      "--enable-contracted-ints"
+      "--enable-shared"
+    ] ++ lib.optional enableFMA "--enable-fma"
+      ++ lib.optional enableFortran "--enable-fortran";
+
+    makeFlags = [ "export" ];
+
+    installPhase = ''
+      mkdir -p $out
+      cp ${pname}-${version}.tgz $out/.
+    '';
+
+    enableParallelBuilding = true;
+
+    inherit meta;
+  };
+
+  codeComp = stdenv.mkDerivation {
+    inherit pname version;
+
+    src = "${codeGen}/${pname}-${version}.tgz";
+
+    nativeBuildInputs = [
+      python3
+      cmake
+    ] ++ lib.optional enableFortran gfortran;
+
+    buildInputs = [ boost eigen ];
+
+    # Default is just "double", but SSE2 is available on all x86_64 CPUs.
+    # AVX support is advertised, but does not work in 2.6 (possibly in 2.7).
+    # Fortran interface is incompatible with changing the LIBINT2_REALTYPE.
+    cmakeFlags = [
+      (if enableFortran
+        then "-DENABLE_FORTRAN=ON"
+        else "-DLIBINT2_REALTYPE=libint2::simd::VectorSSEDouble"
+      )
+    ];
+
+    # Can only build in the source-tree. A lot of preprocessing magic fails otherwise.
+    dontUseCmakeBuildDir = true;
+
+    inherit meta;
+  };
+
+in codeComp
diff --git a/nixpkgs/pkgs/development/libraries/libint/fix-paths.patch b/nixpkgs/pkgs/development/libraries/libint/fix-paths.patch
new file mode 100644
index 000000000000..2cf178e81f3a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libint/fix-paths.patch
@@ -0,0 +1,96 @@
+diff --git a/export/fortran/Makefile b/export/fortran/Makefile
+index 62d8711..a83edc7 100644
+--- a/export/fortran/Makefile
++++ b/export/fortran/Makefile
+@@ -1,12 +1,14 @@
+-TOPDIR = ..
+-SRCDIR = ..
++TOPDIR = ../..
++SRCDIR = ../..
+ 
+--include ../MakeSuffixRules
+--include ../MakeVars
+--include ../MakeVars.features
++-include ../../lib/MakeSuffixRules
++-include ../../src/bin/MakeVars
++-include ../../src/lib/libint/MakeVars.features
+ 
+-FCFLAGS := -I../include -I../include/libint2 -D__COMPILING_LIBINT2=1 $(FCFLAGS)
+-COMPUTE_LIB = -L../lib -lint2
++FCFLAGS := -I../../include -I../../include/libint2 -D__COMPILING_LIBINT2=1 $(FCFLAGS)
++COMPUTE_LIB = -L../../lib -lint2
++
++CXXCPP = cc -E -I../../include/libint2
+ 
+ .PHONY: clean distclean default make_test check_test
+ 
+@@ -28,7 +30,7 @@ libint2_types_f.h: $(TOPDIR)/include/libint2.h.i
+ 
+ fortran_example.o: libint_f.o
+ 
+-fortran_incldefs.h: $(TOPDIR)/include/libint2_types.h
++fortran_incldefs.h: $(TOPDIR)/include/libint2/libint2_types.h
+ 	grep '^#' $< | grep -v '#include' > $@
+ 
+ fortran_example: fortran_example.o libint_f.o
+diff --git a/src/bin/libint/Makefile b/src/bin/libint/Makefile
+index 406306c..bd8a695 100644
+--- a/src/bin/libint/Makefile
++++ b/src/bin/libint/Makefile
+@@ -59,7 +59,7 @@ test: $(TESTCXXOBJ) $(LIBTARGET)
+ 	$(CXX) -o $@ $(CXXFLAGS) $(LDFLAGS) $^ $(SYSLIBS)
+ 
+ $(LIBTARGET): $(LIBOBJ)
+-	/bin/rm -f $@
++	rm -f $@
+ 	$(AR) $(ARFLAGS) $@ $(LIBOBJ)
+ 	$(RANLIB) $@
+ 
+@@ -102,7 +102,7 @@ ifneq ($(CXXDEPENDSUF),none)
+ %.d: %.cc
+ 	$(CXXDEPEND) $(CXXDEPENDFLAGS) -c $(CPPFLAGS) $(CXXFLAGS) $< > /dev/null
+ 	sed 's/^$*.o/$*.$(OBJSUF) $*.d/g' < $(*F).$(CXXDEPENDSUF) > $(@F)
+-	/bin/rm -f $(*F).$(CXXDEPENDSUF)
++	rm -f $(*F).$(CXXDEPENDSUF)
+ else
+ %.d: %.cc
+ 	$(CXXDEPEND) $(CXXDEPENDFLAGS) -c $(CPPFLAGS) $(CXXFLAGS) $< | sed 's/^$*.o/$*.$(OBJSUF) $*.d/g' > $(@F)
+diff --git a/tests/eri/Makefile b/tests/eri/Makefile
+index 6223e4f..05909dc 100644
+--- a/tests/eri/Makefile
++++ b/tests/eri/Makefile
+@@ -62,7 +62,7 @@ ifneq ($(CXXDEPENDSUF),none)
+ %.d: %.cc
+ 	$(CXXDEPEND) $(CXXDEPENDFLAGS) -c $(CPPFLAGS) $(CXXFLAGS) $< > /dev/null
+ 	sed 's/^$*.o/$*.$(OBJSUF) $*.d/g' < $(*F).$(CXXDEPENDSUF) > $(@F)
+-	/bin/rm -f $(*F).$(CXXDEPENDSUF)
++	rm -f $(*F).$(CXXDEPENDSUF)
+ else
+ %.d: %.cc
+ 	$(CXXDEPEND) $(CXXDEPENDFLAGS) -c $(CPPFLAGS) $(CXXFLAGS) $< | sed 's/^$*.o/$*.$(OBJSUF) $*.d/g' > $(@F)
+diff --git a/tests/hartree-fock/Makefile b/tests/hartree-fock/Makefile
+index aaebadc..4971472 100644
+--- a/tests/hartree-fock/Makefile
++++ b/tests/hartree-fock/Makefile
+@@ -95,7 +95,7 @@ ifneq ($(CXXDEPENDSUF),none)
+ %.d:: %.cc
+ 	$(CXXDEPEND) $(CXXDEPENDFLAGS) -c $(CPPFLAGS) $(CXXFLAGS) $< > /dev/null
+ 	sed 's/^$*.o/$*.$(OBJSUF) $*.d/g' < $(*F).$(CXXDEPENDSUF) > $(@F)
+-	/bin/rm -f $(*F).$(CXXDEPENDSUF)
++	rm -f $(*F).$(CXXDEPENDSUF)
+ else
+ %.d:: %.cc
+ 	$(CXXDEPEND) $(CXXDEPENDFLAGS) -c $(CPPFLAGS) $(CXXFLAGS) $< | sed 's/^$*.o/$*.$(OBJSUF) $*.d/g' > $(@F)
+diff --git a/tests/unit/Makefile b/tests/unit/Makefile
+index f2d9400..da9d82b 100644
+--- a/tests/unit/Makefile
++++ b/tests/unit/Makefile
+@@ -93,7 +93,7 @@ ifneq ($(CXXDEPENDSUF),none)
+ %.d:: %.cc
+ 	$(CXXDEPEND) $(CXXDEPENDFLAGS) -c $(CPPFLAGS) $(CXXGENFLAGS) $< > /dev/null
+ 	sed 's/^$*.o/$*.$(OBJSUF) $*.d/g' < $(*F).$(CXXDEPENDSUF) > $(@F)
+-	/bin/rm -f $(*F).$(CXXDEPENDSUF)
++	rm -f $(*F).$(CXXDEPENDSUF)
+ else
+ %.d:: %.cc
+ 	$(CXXDEPEND) $(CXXDEPENDFLAGS) -c $(CPPFLAGS) $(CXXGENFLAGS) $< | sed 's/^$*.o/$*.$(OBJSUF) $*.d/g' > $(@F)
diff --git a/nixpkgs/pkgs/development/libraries/libiodbc/default.nix b/nixpkgs/pkgs/development/libraries/libiodbc/default.nix
new file mode 100644
index 000000000000..a15b00a66ef7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libiodbc/default.nix
@@ -0,0 +1,28 @@
+{ config, lib, stdenv, fetchurl, pkg-config, gtk2, Carbon
+, useGTK ? config.libiodbc.gtk or false }:
+
+stdenv.mkDerivation rec {
+  pname = "libiodbc";
+  version = "3.52.12";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/iodbc/${pname}-${version}.tar.gz";
+    sha256 = "0qpvklgr1lcn5g8xbz7fbc9rldqf9r8s6xybhqj20m4sglxgziai";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = lib.optionals useGTK [ gtk2 ]
+                ++ lib.optional stdenv.isDarwin Carbon;
+
+  preBuild =
+    ''
+      export NIX_LDFLAGS_BEFORE="-rpath $out/lib"
+    '';
+
+  meta = with lib; {
+    description = "iODBC driver manager";
+    homepage = "http://www.iodbc.org";
+    platforms = platforms.unix;
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libipfix/default.nix b/nixpkgs/pkgs/development/libraries/libipfix/default.nix
new file mode 100644
index 000000000000..173bfafc8cc9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libipfix/default.nix
@@ -0,0 +1,17 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  pname = "libipfix";
+  version = "110209";
+  src = fetchurl {
+    url = "mirror://sourceforge/libipfix/files/libipfix/libipfix_110209.tgz";
+    sha256 = "0h7v0sxjjdc41hl5vq2x0yhyn04bczl11bqm97825mivrvfymhn6";
+  };
+  meta = with lib; {
+    homepage = "http://libipfix.sourceforge.net/";
+    description = "The libipfix C-library implements the IPFIX protocol defined by the IP Flow Information Export working group of the IETF";
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ lewo ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libipt/default.nix b/nixpkgs/pkgs/development/libraries/libipt/default.nix
new file mode 100644
index 000000000000..15a677b3188c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libipt/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "libipt";
+  version = "2.0.4";
+
+  src = fetchFromGitHub {
+    owner = "intel";
+    repo = "libipt";
+    rev = "v${version}";
+    sha256 = "sha256-KhRmRoIHvpx5rV7roCnUH+a7JtPb6UqD41Wi4wHSR1c=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Intel Processor Trace decoder library";
+    homepage = "https://github.com/intel/libipt";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ orivej ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libiptcdata/default.nix b/nixpkgs/pkgs/development/libraries/libiptcdata/default.nix
new file mode 100644
index 000000000000..540d6d01a411
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libiptcdata/default.nix
@@ -0,0 +1,18 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "libiptcdata";
+  version = "1.0.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libiptcdata/${pname}-${version}.tar.gz";
+    sha256 = "03pfvkmmx762iydq0q207x2028d275pbdysfsgpmrr0ywy63pxkr";
+  };
+
+  meta = {
+    description = "Library for reading and writing the IPTC metadata in images and other files";
+    homepage = "http://libiptcdata.sourceforge.net/";
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libircclient/default.nix b/nixpkgs/pkgs/development/libraries/libircclient/default.nix
new file mode 100644
index 000000000000..56a9f1b961cf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libircclient/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  version = "1.10";
+  pname   = "libircclient";
+
+  src = fetchurl {
+    url    = "mirror://sourceforge/${pname}/${pname}/${version}/${pname}-${version}.tar.gz";
+    sha256 = "0b9wa0h3xc31wpqlvgxgnvqp5wgx3kwsf5s9432m5cj8ycx6zcmv";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  configureFlags = [ "--enable-shared" ];
+
+  postPatch = ''
+    substituteInPlace src/Makefile.in \
+      --replace "@prefix@/include" "@prefix@/include/libircclient" \
+      --replace "@libdir@"         "@prefix@/lib" \
+      --replace "cp "              "install "
+  '';
+
+  meta = with lib; {
+    description = "A small but extremely powerful library which implements the client IRC protocol";
+    homepage    = "http://www.ulduzsoft.com/libircclient/";
+    license     = licenses.lgpl3;
+    maintainers = with maintainers; [ obadz ];
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libirecovery/default.nix b/nixpkgs/pkgs/development/libraries/libirecovery/default.nix
new file mode 100644
index 000000000000..6a2f926d79ef
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libirecovery/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv, fetchFromGitHub, automake, autoconf, libtool, pkg-config
+, libusb1
+, readline
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libirecovery";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "libimobiledevice";
+    repo = pname;
+    rev = version;
+    sha256 = "0p9ncqnz5kb7qisw00ynvasw1hax5qx241h9nwppi2g544i9lbnr";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [
+    autoconf
+    automake
+    libtool
+    pkg-config
+  ];
+
+  buildInputs = [
+    libusb1
+    readline
+  ];
+
+  preConfigure = "NOCONFIGURE=1 ./autogen.sh";
+
+  # Packager note: Not clear whether this needs a NixOS configuration,
+  # as only the `idevicerestore` binary was tested so far (which worked
+  # without further configuration).
+  configureFlags = [
+    "--with-udevrulesdir=${placeholder "out"}/lib/udev/rules.d"
+    ''--with-udevrule="OWNER=\"root\", GROUP=\"myusergroup\", MODE=\"0660\""''
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/libimobiledevice/libirecovery";
+    description = "Library and utility to talk to iBoot/iBSS via USB on Mac OS X, Windows, and Linux";
+    longDescription = ''
+      libirecovery is a cross-platform library which implements communication to
+      iBoot/iBSS found on Apple's iOS devices via USB. A command-line utility is also
+      provided.
+    '';
+    license = licenses.lgpl21;
+    # Upstream description says it works on more platforms, but packager hasn't tried that yet
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ nh2 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libiscsi/default.nix b/nixpkgs/pkgs/development/libraries/libiscsi/default.nix
new file mode 100644
index 000000000000..6dd23d219d95
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libiscsi/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "libiscsi";
+  version = "1.19.0";
+
+  src = fetchFromGitHub {
+    owner = "sahlberg";
+    repo = "libiscsi";
+    rev = version;
+    sha256 = "0ajrkkg5awmi8m4b3mha7h07ylg18k252qprvk1sgq0qbyd66zy7";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  # This can be removed after >=1.20.0, or if the build suceeds with
+  # pie enabled (default on Musl).
+  hardeningDisable = [ "pie" ];
+
+  # This problem is gone on libiscsi master.
+  NIX_CFLAGS_COMPILE =
+    lib.optional stdenv.hostPlatform.is32bit "-Wno-error=sign-compare";
+
+  meta = with lib; {
+    description = "iscsi client library and utilities";
+    homepage = "https://github.com/sahlberg/libiscsi";
+    license = licenses.lgpl2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ misuzu ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libisds/default.nix b/nixpkgs/pkgs/development/libraries/libisds/default.nix
new file mode 100644
index 000000000000..268acb2f948d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libisds/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv
+, fetchurl
+, expat
+, gpgme
+, libgcrypt
+, libxml2
+, libxslt
+, curl
+, docbook_xsl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libisds";
+  version = "0.11.1";
+
+  src = fetchurl {
+    url = "http://xpisar.wz.cz/${pname}/dist/${pname}-${version}.tar.xz";
+    sha256 = "1n1vl05p78fksv6dm926rngd3wag41gyfbq76ajzcmq08j32y7y1";
+  };
+
+  configureFlags = [
+    "--with-docbook-xsl-stylesheets=${docbook_xsl}/xml/xsl/docbook"
+  ];
+
+  buildInputs = [ expat gpgme libgcrypt libxml2 libxslt curl docbook_xsl ];
+
+  meta = with 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
new file mode 100644
index 000000000000..44367aad1f93
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libisoburn/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, acl, attr, zlib, libburn, libisofs }:
+
+stdenv.mkDerivation rec {
+  pname = "libisoburn";
+  version = "1.5.4";
+
+  src = fetchurl {
+    url = "http://files.libburnia-project.org/releases/${pname}-${version}.tar.gz";
+    sha256 = "sha256-LYmEbUOIDxf6WRxTs76kL/uANijk5jDGgPwskYT3kTI=";
+  };
+
+  buildInputs = [ attr zlib libburn libisofs ];
+  propagatedBuildInputs = [ acl ];
+
+  meta = with lib; {
+    homepage = "http://libburnia-project.org/";
+    description = "Enables creation and expansion of ISO-9660 filesystems on CD/DVD/BD ";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ vrthra ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libisofs/default.nix b/nixpkgs/pkgs/development/libraries/libisofs/default.nix
new file mode 100644
index 000000000000..d80614609c38
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libisofs/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, acl, attr, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "libisofs";
+  version = "1.5.4";
+
+  src = fetchurl {
+    url = "http://files.libburnia-project.org/releases/${pname}-${version}.tar.gz";
+    sha256 = "sha256-qqDtgKdQGXkxb1BbCwF/Kcug6lRjt1EUO60sNgIVqI4=";
+  };
+
+  buildInputs = [ attr zlib ];
+  propagatedBuildInputs = [ acl ];
+
+  meta = with lib; {
+    homepage = "http://libburnia-project.org/";
+    description = "A library to create an ISO-9660 filesystem with extensions like RockRidge or Joliet";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ abbradar vrthra ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libite/default.nix b/nixpkgs/pkgs/development/libraries/libite/default.nix
new file mode 100644
index 000000000000..4ffb7a5f7fbc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libite/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, libconfuse }:
+
+stdenv.mkDerivation rec {
+  pname = "libite";
+  version = "2.4.0";
+
+  src = fetchFromGitHub {
+    owner = "troglobit";
+    repo = "libite";
+    rev = "v${version}";
+    sha256 = "sha256-EV1YVOxd92z2hBZIqe6jzYV06YfNTAbZntZQdH05lBI=";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ libconfuse ];
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "Lightweight library of frog DNA";
+    longDescription = ''
+      Libite is a lightweight library of frog DNA. It can be used to fill
+      the gaps in any dinosaur project. It holds useful functions and macros
+      developed by both Finit and the OpenBSD project. Most notably the
+      string functions: strlcpy(3), strlcat(3) and the highly useful *BSD
+      sys/queue.h and sys/tree.h API's.
+
+      Libite is the frog DNA missing in GNU libc. However, -lite does not
+      aim to become another GLIB! One noticeable gap in GLIBC is the missing
+      _SAFE macros in the BSD sys/queue.h API — highly recommended when
+      traversing lists to delete/free nodes.
+    '';
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ fpletz ];
+    license = with licenses; [ mit isc bsd2 bsd3 ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/libivykis/default.nix b/nixpkgs/pkgs/development/libraries/libivykis/default.nix
new file mode 100644
index 000000000000..9a1c728bd55d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libivykis/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, file, protobufc }:
+
+stdenv.mkDerivation rec {
+  pname = "libivykis";
+
+  version = "0.42.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libivykis/${version}/ivykis-${version}.tar.gz";
+    sha256 = "0abi0rc3wnncvr68hy6rmzp96x6napd7fs1mff20dr8lb0jyvy3f";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ file protobufc ];
+
+  meta = with lib; {
+    homepage = "http://libivykis.sourceforge.net/";
+    description = ''
+      A thin wrapper over various OS'es implementation of I/O readiness
+      notification facilities
+    '';
+    license = licenses.zlib;
+    maintainers = [];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libixp-hg/default.nix b/nixpkgs/pkgs/development/libraries/libixp-hg/default.nix
new file mode 100644
index 000000000000..0aeef61dae9e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libixp-hg/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, unzip, txt2tags }:
+
+stdenv.mkDerivation rec {
+  rev = "148";
+  version = "hg-2012-12-02";
+  pname = "libixp";
+
+  src = fetchurl {
+    url = "https://storage.googleapis.com/google-code-archive-source/v2/code.google.com/libixp/source-archive.zip";
+    sha256 = "0kcdvdcrkw6q39v563ncis6d7ini64xbgn5fd3b4aa95fp9sj3is";
+  };
+
+  configurePhase = ''
+   sed -i -e "s|^PREFIX.*=.*$|PREFIX = $out|" config.mk
+  '';
+
+  nativeBuildInputs = [ unzip ];
+  buildInputs = [ txt2tags ];
+
+  meta = {
+    homepage = "http://repo.cat-v.org/libixp/"; # see also https://libs.suckless.org/deprecated/libixp
+    description = "Portable, simple C-language 9P client and server libary";
+    maintainers = with lib.maintainers; [ kovirobi ];
+    license = lib.licenses.mit;
+    platforms = with lib.platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libjcat/default.nix b/nixpkgs/pkgs/development/libraries/libjcat/default.nix
new file mode 100644
index 000000000000..f027fbe3cb8b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libjcat/default.nix
@@ -0,0 +1,82 @@
+{ lib, stdenv
+, fetchFromGitHub
+, docbook_xml_dtd_43
+, docbook-xsl-nons
+, glib
+, json-glib
+, gnutls
+, gpgme
+, gobject-introspection
+, vala
+, gtk-doc
+, meson
+, ninja
+, pkg-config
+, python3
+, nixosTests
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libjcat";
+  version = "0.1.7";
+
+  outputs = [ "bin" "out" "dev" "devdoc" "man" "installedTests" ];
+
+  src = fetchFromGitHub {
+    owner = "hughsie";
+    repo = "libjcat";
+    rev = version;
+    sha256 = "sha256-WYCYRFjjy9nr1p1SqzBGCBZ5vkhFybddXpHUcwdEDIQ=";
+  };
+
+  patches = [
+    # Installed tests are installed to different output
+    ./installed-tests-path.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    docbook_xml_dtd_43
+    docbook-xsl-nons
+    gobject-introspection
+    vala
+    gtk-doc
+    (python3.withPackages (pkgs: with pkgs; [
+      setuptools
+    ]))
+  ];
+
+  buildInputs = [
+    glib
+    json-glib
+    gnutls
+    gpgme
+  ];
+
+  mesonFlags = [
+    "-Dgtkdoc=true"
+    "-Dinstalled_test_prefix=${placeholder "installedTests"}"
+  ];
+
+  postPatch = ''
+    patchShebangs contrib/generate-version-script.py
+  '';
+
+  doCheck = true;
+
+  passthru = {
+    tests = {
+      installed-tests = nixosTests.installed-tests.libjcat;
+    };
+  };
+
+  meta = with lib; {
+    description = "Library for reading and writing Jcat files";
+    homepage = "https://github.com/hughsie/libjcat";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libjcat/installed-tests-path.patch b/nixpkgs/pkgs/development/libraries/libjcat/installed-tests-path.patch
new file mode 100644
index 000000000000..d199f91385f5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libjcat/installed-tests-path.patch
@@ -0,0 +1,24 @@
+diff --git a/meson.build b/meson.build
+index f69968d..d1d6c6e 100644
+--- a/meson.build
++++ b/meson.build
+@@ -114,8 +114,8 @@ else
+   datadir = join_paths(prefix, get_option('datadir'))
+   localstatedir = join_paths(prefix, get_option('localstatedir'))
+   libexecdir = join_paths(prefix, get_option('libexecdir'))
+-  installed_test_bindir = join_paths(libexecdir, 'installed-tests', meson.project_name())
+-  installed_test_datadir = join_paths(datadir, 'installed-tests', meson.project_name())
++  installed_test_bindir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', meson.project_name())
++  installed_test_datadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', meson.project_name())
+ endif
+ mandir = join_paths(prefix, get_option('mandir'))
+ localedir = join_paths(prefix, get_option('localedir'))
+diff --git a/meson_options.txt b/meson_options.txt
+index 4784300..d382fc1 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -1,3 +1,4 @@
++option('installed_test_prefix', type: 'string', value: '', description: 'Prefix for installed tests')
+ option('gtkdoc', type : 'boolean', value : false, description : 'enable developer documentation')
+ option('introspection', type : 'boolean', value : true, description : 'generate GObject Introspection data')
+ option('tests', type : 'boolean', value : true, description : 'enable tests')
diff --git a/nixpkgs/pkgs/development/libraries/libjpeg-turbo/0001-Compile-transupp.c-as-part-of-the-library.patch b/nixpkgs/pkgs/development/libraries/libjpeg-turbo/0001-Compile-transupp.c-as-part-of-the-library.patch
new file mode 100644
index 000000000000..0a09a8845c13
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libjpeg-turbo/0001-Compile-transupp.c-as-part-of-the-library.patch
@@ -0,0 +1,104 @@
+From 4a0584f7c05641143151ebdc1be1163bebf9d35d Mon Sep 17 00:00:00 2001
+From: Las <las@protonmail.ch>
+Date: Sun, 3 Jan 2021 18:35:37 +0000
+Subject: [PATCH] Compile transupp.c as part of the library
+
+The exported symbols are made weak to not conflict with users
+of the library that already vendor this functionality.
+---
+ CMakeLists.txt |  4 ++--
+ transupp.c     | 14 +++++++-------
+ 2 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 0ca6f98..a9a0fae 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -533,7 +533,7 @@ set(JPEG_SOURCES jcapimin.c jcapistd.c jccoefct.c jccolor.c jcdctmgr.c jchuff.c
+   jdatasrc.c jdcoefct.c jdcolor.c jddctmgr.c jdhuff.c jdicc.c jdinput.c
+   jdmainct.c jdmarker.c jdmaster.c jdmerge.c jdphuff.c jdpostct.c jdsample.c
+   jdtrans.c jerror.c jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c
+-  jidctint.c jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c)
++  jidctint.c jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c transupp.c)
+ 
+ if(WITH_ARITH_ENC OR WITH_ARITH_DEC)
+   set(JPEG_SOURCES ${JPEG_SOURCES} jaricom.c)
+@@ -1489,7 +1489,7 @@ install(EXPORT ${CMAKE_PROJECT_NAME}Targets
+ 
+ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/jconfig.h
+   ${CMAKE_CURRENT_SOURCE_DIR}/jerror.h ${CMAKE_CURRENT_SOURCE_DIR}/jmorecfg.h
+-  ${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h
++  ${CMAKE_CURRENT_SOURCE_DIR}/jpeglib.h ${CMAKE_CURRENT_SOURCE_DIR}/transupp.h
+   DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
+ 
+ include(cmakescripts/BuildPackages.cmake)
+diff --git a/transupp.c b/transupp.c
+index 6e86077..2da49a7 100644
+--- a/transupp.c
++++ b/transupp.c
+@@ -1386,7 +1386,7 @@ jt_read_integer(const char **strptr, JDIMENSION *result)
+  * This code is loosely based on XParseGeometry from the X11 distribution.
+  */
+ 
+-GLOBAL(boolean)
++GLOBAL(boolean) __attribute__((weak))
+ jtransform_parse_crop_spec(jpeg_transform_info *info, const char *spec)
+ {
+   info->crop = FALSE;
+@@ -1486,7 +1486,7 @@ trim_bottom_edge(jpeg_transform_info *info, JDIMENSION full_height)
+  * and transformation is not perfect.  Otherwise returns TRUE.
+  */
+ 
+-GLOBAL(boolean)
++GLOBAL(boolean) __attribute__((weak))
+ jtransform_request_workspace(j_decompress_ptr srcinfo,
+                              jpeg_transform_info *info)
+ {
+@@ -2033,7 +2033,7 @@ adjust_exif_parameters(JOCTET *data, unsigned int length, JDIMENSION new_width,
+  * to jpeg_write_coefficients().
+  */
+ 
+-GLOBAL(jvirt_barray_ptr *)
++GLOBAL(jvirt_barray_ptr *) __attribute__((weak))
+ jtransform_adjust_parameters(j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+                              jvirt_barray_ptr *src_coef_arrays,
+                              jpeg_transform_info *info)
+@@ -2152,7 +2152,7 @@ jtransform_adjust_parameters(j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+  * Note that some transformations will modify the source data arrays!
+  */
+ 
+-GLOBAL(void)
++GLOBAL(void) __attribute__((weak))
+ jtransform_execute_transform(j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+                              jvirt_barray_ptr *src_coef_arrays,
+                              jpeg_transform_info *info)
+@@ -2264,7 +2264,7 @@ jtransform_execute_transform(j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+  *           (may use custom action then)
+  */
+ 
+-GLOBAL(boolean)
++GLOBAL(boolean) __attribute__((weak))
+ jtransform_perfect_transform(JDIMENSION image_width, JDIMENSION image_height,
+                              int MCU_width, int MCU_height,
+                              JXFORM_CODE transform)
+@@ -2303,7 +2303,7 @@ jtransform_perfect_transform(JDIMENSION image_width, JDIMENSION image_height,
+  * This must be called before jpeg_read_header() to have the desired effect.
+  */
+ 
+-GLOBAL(void)
++GLOBAL(void) __attribute__((weak))
+ jcopy_markers_setup(j_decompress_ptr srcinfo, JCOPY_OPTION option)
+ {
+ #ifdef SAVE_MARKERS_SUPPORTED
+@@ -2331,7 +2331,7 @@ jcopy_markers_setup(j_decompress_ptr srcinfo, JCOPY_OPTION option)
+  * JFIF APP0 or Adobe APP14 markers if selected.
+  */
+ 
+-GLOBAL(void)
++GLOBAL(void) __attribute__((weak))
+ jcopy_markers_execute(j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+                       JCOPY_OPTION option)
+ {
+-- 
+2.29.2
+
diff --git a/nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix b/nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix
new file mode 100644
index 000000000000..3d7df2bba9cb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix
@@ -0,0 +1,71 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, nasm
+, openjdk
+, enableJava ? false # whether to build the java wrapper
+, enableJpeg7 ? false # whether to build libjpeg with v7 compatibility
+, enableJpeg8 ? false # whether to build libjpeg with v8 compatibility
+, enableStatic ? stdenv.hostPlatform.isStatic
+, enableShared ? !stdenv.hostPlatform.isStatic
+}:
+
+assert !(enableJpeg7 && enableJpeg8);  # pick only one or none, not both
+
+stdenv.mkDerivation rec {
+
+  pname = "libjpeg-turbo";
+  version = "2.1.0";
+
+  src = fetchFromGitHub {
+    owner = "libjpeg-turbo";
+    repo = "libjpeg-turbo";
+    rev = version;
+    sha256 = "sha256-Ma3Q/zMJPjsQmoaYJtVbHJOx65AfGLWJYi2iRFm3l5s=";
+  };
+
+  # This is needed by freeimage
+  patches = [ ./0001-Compile-transupp.c-as-part-of-the-library.patch ]
+    ++ lib.optional (stdenv.hostPlatform.libc or null == "msvcrt")
+    ./mingw-boolean.patch;
+
+  outputs = [ "bin" "dev" "dev_private" "out" "man" "doc" ];
+
+  postFixup = ''
+    moveToOutput include/transupp.h $dev_private
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    nasm
+  ] ++ lib.optionals enableJava [
+    openjdk
+  ];
+
+  cmakeFlags = [
+    "-DENABLE_STATIC=${if enableStatic then "1" else "0"}"
+    "-DENABLE_SHARED=${if enableShared then "1" else "0"}"
+  ] ++ lib.optionals enableJava [
+    "-DWITH_JAVA=1"
+  ] ++ lib.optionals enableJpeg7 [
+    "-DWITH_JPEG7=1"
+  ] ++ lib.optionals enableJpeg8 [
+    "-DWITH_JPEG8=1"
+  ] ++ lib.optionals stdenv.hostPlatform.isRiscV [
+    # https://github.com/libjpeg-turbo/libjpeg-turbo/issues/428
+    # https://github.com/libjpeg-turbo/libjpeg-turbo/commit/88bf1d16786c74f76f2e4f6ec2873d092f577c75
+    "-DFLOATTEST=fp-contract"
+  ];
+
+  doInstallCheck = true;
+  installCheckTarget = "test";
+
+  meta = with lib; {
+    homepage = "https://libjpeg-turbo.org/";
+    description = "A faster (using SIMD) libjpeg implementation";
+    license = licenses.ijg; # and some parts under other BSD-style licenses
+    maintainers = with maintainers; [ vcunat colemickens kamadorueda ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libjpeg-turbo/mingw-boolean.patch b/nixpkgs/pkgs/development/libraries/libjpeg-turbo/mingw-boolean.patch
new file mode 100644
index 000000000000..9b9483d63987
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libjpeg-turbo/mingw-boolean.patch
@@ -0,0 +1,19 @@
+Ported to updated libjpeg-turbo from
+https://github.com/msys2/MINGW-packages/blob/master/mingw-w64-libjpeg-turbo/jpeg-typedefs.patch
+--- a/jmorecfg.h	2012-02-10 06:47:55 +0300
++++ b/jmorecfg.h	2012-05-03 10:29:13 +0400
+@@ -224,7 +224,13 @@
+  * Defining HAVE_BOOLEAN before including jpeglib.h should make it work.
+  */
+ 
+-#ifndef HAVE_BOOLEAN
++#if defined(_WIN32) && !defined(HAVE_BOOLEAN)
++#ifndef __RPCNDR_H__
++typedef unsigned char boolean;
++#endif
++#define HAVE_BOOLEAN
++#endif
++#if !defined(HAVE_BOOLEAN) && !defined(__RPCNDR_H__)
+ typedef int boolean;
+ #endif
+ #ifndef FALSE			/* in case these macros already exist */
diff --git a/nixpkgs/pkgs/development/libraries/libjpeg/default.nix b/nixpkgs/pkgs/development/libraries/libjpeg/default.nix
new file mode 100644
index 000000000000..028bf5cac337
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libjpeg/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, static ? false }:
+
+stdenv.mkDerivation rec {
+  pname = "libjpeg";
+  version = "9d";
+
+  src = fetchurl {
+    url = "http://www.ijg.org/files/jpegsrc.v${version}.tar.gz";
+    sha256 = "1vkip9rz4hz8f31a2kl7wl7f772wg1z0fg1fbd1653wzwlxllhvc";
+  };
+
+  configureFlags = lib.optional static "--enable-static --disable-shared";
+
+  outputs = [ "bin" "dev" "out" "man" ];
+
+  meta = with lib; {
+    homepage = "https://www.ijg.org/";
+    description = "A library that implements the JPEG image file format";
+    maintainers = with maintainers; [ ];
+    license = licenses.free;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libjreen/default.nix b/nixpkgs/pkgs/development/libraries/libjreen/default.nix
new file mode 100644
index 000000000000..5a70e4b01dd8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libjreen/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, cmake, qt4, pkg-config, gsasl }:
+
+stdenv.mkDerivation rec {
+  pname = "libjreen";
+  version = "1.2.0";
+
+  src = fetchurl {
+    url = "https://qutim.org/dwnl/73/${pname}-${version}.tar.bz2";
+    sha256 = "14nwwk40xx8w6x7yaysgcr0lgzhs7l064f7ikp32s5y9a8mmp582";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ qt4 gsasl ];
+
+  meta = {
+    description = "C++ Jabber library using Qt framework";
+    homepage = "https://qutim.org/jreen/";
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libjson-rpc-cpp/default.nix b/nixpkgs/pkgs/development/libraries/libjson-rpc-cpp/default.nix
new file mode 100644
index 000000000000..e2dd30fc616f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libjson-rpc-cpp/default.nix
@@ -0,0 +1,101 @@
+{ lib, stdenv
+, fetchFromGitHub
+, fetchpatch
+, pkg-config
+, cmake
+, argtable
+, catch2
+, curl
+, doxygen
+, hiredis
+, jsoncpp
+, libmicrohttpd
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libjson-rpc-cpp";
+  version = "1.3.0";
+
+  src = fetchFromGitHub {
+    owner = "cinemast";
+    repo = "libjson-rpc-cpp";
+    sha256 = "sha256-EAakiqlfMprwLjloDekOssaB/EnAmn5njcwHGZtYs9w=";
+    rev = "v${version}";
+  };
+
+  NIX_CFLAGS_COMPILE = "-I${catch2}/include/catch2";
+
+  patches = [
+    (fetchpatch {
+      name = "int-to-MHD_Result.patch";
+      url = "https://patch-diff.githubusercontent.com/raw/cinemast/libjson-rpc-cpp/pull/299.patch";
+      sha256 = "sha256-hiey6etzbOxhMElTMX7offKbey7c2OO/UWeN03k0AaM=";
+    })
+  ];
+
+  nativeBuildInputs = [ pkg-config cmake doxygen ];
+  buildInputs = [
+    argtable
+    catch2
+    curl
+    hiredis
+    jsoncpp
+    libmicrohttpd
+  ];
+
+  postPatch = ''
+    for f in cmake/FindArgtable.cmake \
+             src/stubgenerator/stubgenerator.cpp \
+             src/stubgenerator/stubgeneratorfactory.cpp
+    do
+      sed -i -re 's/argtable2/argtable3/g' $f
+    done
+
+    sed -i -re 's#MATCHES "jsoncpp"#MATCHES ".*/jsoncpp/json$"#g' cmake/FindJsoncpp.cmake
+  '';
+
+  preConfigure = ''
+    mkdir -p Build/Install
+    pushd Build
+  '';
+
+  # this hack is needed because the cmake scripts
+  # require write permission to absolute paths
+  configurePhase = ''
+    runHook preConfigure
+    cmake .. -DCMAKE_INSTALL_PREFIX=$(pwd)/Install \
+             -DCMAKE_BUILD_TYPE=Release
+    runHook postConfigure
+  '';
+
+  preInstall = ''
+    function fixRunPath {
+      p=$(patchelf --print-rpath $1)
+      q="$p:${lib.makeLibraryPath [ jsoncpp argtable libmicrohttpd curl ]}:$out/lib"
+      patchelf --set-rpath $q $1
+    }
+
+    mkdir -p $out
+  '';
+
+  postInstall = ''
+    sed -i -re "s#-([LI]).*/Build/Install(.*)#-\1$out\2#g" Install/lib64/pkgconfig/*.pc
+    for f in Install/lib64/*.so* $(find Install/bin -executable -type f); do
+      fixRunPath $f
+    done
+    cp -r Install/* $out
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    make install
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "C++ framework for json-rpc (json remote procedure call)";
+    homepage = "https://github.com/cinemast/libjson-rpc-cpp";
+    license = licenses.mit;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libjson/default.nix b/nixpkgs/pkgs/development/libraries/libjson/default.nix
new file mode 100644
index 000000000000..9106c1974716
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libjson/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, unzip }:
+
+stdenv.mkDerivation rec {
+  pname = "libjson";
+  version = "7.6.1";
+  src = fetchurl {
+    url = "mirror://sourceforge/libjson/libjson_${version}.zip";
+    sha256 = "0xkk5qc7kjcdwz9l04kmiz1nhmi7iszl3k165phf53h3a4wpl9h7";
+  };
+  patches = [ ./install-fix.patch ];
+  nativeBuildInputs = [ unzip ];
+  makeFlags = [ "prefix=$(out)" ];
+  preInstall = "mkdir -p $out/lib";
+
+  meta = with lib; {
+    homepage = "http://libjson.sourceforge.net/";
+    description = "A JSON reader and writer";
+    longDescription = ''
+      A JSON reader and writer which is super-efficient and
+      usually runs circles around other JSON libraries.
+      It's highly customizable to optimize for your particular project, and
+      very lightweight. For Windows, OSX, or Linux. Works in any language.
+    '';
+    platforms = platforms.unix;
+    license = licenses.bsd2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libjson/install-fix.patch b/nixpkgs/pkgs/development/libraries/libjson/install-fix.patch
new file mode 100644
index 000000000000..f074c8ba3aa5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libjson/install-fix.patch
@@ -0,0 +1,12 @@
+diff -Naur libjson-orig/makefile libjson/makefile
+--- libjson-orig/makefile	2012-05-30 05:15:42.000000000 -0400
++++ libjson/makefile	2013-08-15 09:17:41.154245534 -0400
+@@ -266,7 +266,7 @@
+ 	cp -r ./$(srcdir)/JSONDefs $(include_path)/$(libname_hdr)/$(srcdir)
+ 	chmod -R a+r $(include_path)/$(libname_hdr)
+ 	find  $(include_path)/$(libname_hdr) -type d -exec chmod a+x {} \;
+-	cp -rv $(srcdir)/Dependencies/ $(include_path)/$(libname_hdr)/$(srcdir)
++	cp -rv $(srcdir)/../Dependencies/ $(include_path)/$(libname_hdr)/$(srcdir)/..
+ 	@echo "Install header files: Done."
+ 
+ clean: banner
diff --git a/nixpkgs/pkgs/development/libraries/libjwt/default.nix b/nixpkgs/pkgs/development/libraries/libjwt/default.nix
new file mode 100644
index 000000000000..a81b60c425ec
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libjwt/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkg-config, jansson, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "libjwt";
+  version = "1.13.1";
+
+  src = fetchFromGitHub {
+    owner = "benmcollins";
+    repo = "libjwt";
+    rev = "v${version}";
+    sha256 = "sha256-hS10Ecq0VVuYLDrBu4x+Y2mz6eeJV1SvnqttgbiQbi0=";
+  };
+
+  buildInputs = [ jansson openssl ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  meta = with lib; {
+    homepage = "https://github.com/benmcollins/libjwt";
+    description = "JWT C Library";
+    license = licenses.mpl20;
+    maintainers = with maintainers; [ pnotequalnp ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libjxl/default.nix b/nixpkgs/pkgs/development/libraries/libjxl/default.nix
new file mode 100644
index 000000000000..d33b2bc3bb58
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libjxl/default.nix
@@ -0,0 +1,106 @@
+{ stdenv, lib, fetchFromGitHub
+, asciidoc
+, brotli
+, cmake
+, graphviz
+, doxygen
+, giflib
+, gperftools
+, gtest
+, libjpeg
+, libpng
+, libwebp
+, openexr
+, pkg-config
+, python3
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libjxl";
+  version = "unstable-2021-06-22";
+
+  src = fetchFromGitHub {
+    owner = "libjxl";
+    repo = "libjxl";
+    rev = "409efe027d6a4a4446b84abe8d7b2fa40409257d";
+    sha256 = "1akb6yyp2h4h6mfcqd4bgr3ybcik5v5kdc1rxaqnyjs7fp2f6nvv";
+    # There are various submodules in `third_party/`.
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [
+    asciidoc # for docs
+    cmake
+    graphviz # for docs via doxygen component `dot`
+    doxygen # for docs
+    gtest
+    pkg-config
+    python3 # for docs
+  ];
+
+  # Functionality not currently provided by this package
+  # that the cmake build can apparently use:
+  #     OpenGL/GLUT (for Examples -> comparison with sjpeg)
+  #     viewer (see `cmakeFlags`)
+  #     plugins like for GDK and GIMP (see `cmakeFlags`)
+
+  # Vendored libraries:
+  # `libjxl` currently vendors many libraries as git submodules that they
+  # might patch often (e.g. test/gmock, see
+  # https://github.com/NixOS/nixpkgs/pull/103160#discussion_r519487734).
+  # When it has stabilised in the future, we may want to tell the build
+  # to use use nixpkgs system libraries.
+
+  # As of writing, libjxl does not point out all its dependencies
+  # conclusively in its README or otherwise; they can best be determined
+  # by checking the CMake output for "Could NOT find".
+  buildInputs = [
+    brotli
+    giflib
+    gperftools # provides `libtcmalloc`
+    libjpeg
+    libpng
+    libwebp
+    openexr
+    zlib
+  ];
+
+  cmakeFlags = [
+    # For C dependencies like brotli, which are dynamically linked,
+    # we want to use the system libraries, so that we don't have to care about
+    # installing their .so files generated by this build.
+    # The other C++ dependencies are statically linked in, so there
+    # using the vendorered ones is easier.
+    "-DJPEGXL_FORCE_SYSTEM_BROTLI=ON"
+
+    # TODO: Update this package to enable this (overridably via an option):
+    # Viewer tools for evaluation.
+    # "-DJPEGXL_ENABLE_VIEWERS=ON"
+
+    # TODO: Update this package to enable this (overridably via an option):
+    # Enable plugins, such as:
+    # * the `gdk-pixbuf` one, which allows applications like `eog` to load jpeg-xl files
+    # * the `gimp` one, which allows GIMP to load jpeg-xl files
+    # "-DJPEGXL_ENABLE_PLUGINS=ON"
+  ];
+
+  doCheck = true;
+
+  # The test driver runs a test `LibraryCLinkageTest` which without
+  # LD_LIBRARY_PATH setting errors with:
+  #     /build/source/build/tools/tests/libjxl_test: error while loading shared libraries: libjxl.so.0
+  # The required file is in the build directory (`$PWD`).
+  preCheck = ''
+    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/libjxl/libjxl";
+    description = "JPEG XL image format reference implementation.";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ nh2 ];
+    platforms = platforms.all;
+    broken = stdenv.hostPlatform.isAarch64; # `internal compiler error`, see https://github.com/NixOS/nixpkgs/pull/103160#issuecomment-866388610
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libkate/default.nix b/nixpkgs/pkgs/development/libraries/libkate/default.nix
new file mode 100644
index 000000000000..d2ef623bf157
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libkate/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, libogg, libpng }:
+
+stdenv.mkDerivation rec {
+  pname = "libkate";
+  version = "0.4.1";
+
+  src = fetchurl {
+    url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/libkate/${pname}-${version}.tar.gz";
+    sha256 = "0s3vr2nxfxlf1k75iqpp4l78yf4gil3f0v778kvlngbchvaq23n4";
+  };
+
+  buildInputs = [ libogg libpng ];
+
+  meta = with lib; {
+    description = "A library for encoding and decoding Kate streams";
+    longDescription = ''
+      This is libkate, the reference implementation of a codec for the Kate
+      bitstream format. Kate is a karaoke and text codec meant for encapsulation
+      in an Ogg container. It can carry Unicode text, images, and animate
+      them.'';
+    homepage = "https://code.google.com/archive/p/libkate/";
+    platforms = platforms.unix;
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libkeyfinder/default.nix b/nixpkgs/pkgs/development/libraries/libkeyfinder/default.nix
new file mode 100644
index 000000000000..04137eb02e7b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libkeyfinder/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, cmake, fftw, catch2 }:
+
+stdenv.mkDerivation rec {
+  pname = "libkeyfinder";
+  version = "2.2.5";
+
+  src = fetchFromGitHub {
+    owner = "mixxxdj";
+    repo = "libkeyfinder";
+    rev = "v${version}";
+    sha256 = "sha256-4jbnsKMGJKUIRfRPymGGgqPgwPyLInc6rLvCXnOcQ5g=";
+  };
+
+  # needed for finding libkeyfinder.so to link it into keyfinder-tests executable
+  cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=OFF" ];
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ fftw ];
+
+  checkInputs = [ catch2 ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Musical key detection for digital audio (C++ library)";
+    homepage = "https://mixxxdj.github.io/libkeyfinder/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libkml/default.nix b/nixpkgs/pkgs/development/libraries/libkml/default.nix
new file mode 100644
index 000000000000..0e2ab21ee792
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libkml/default.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, boost
+, expat
+, zlib
+, uriparser
+, minizip
+, gtest
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libkml";
+  version = "1.3.0";
+
+  src = fetchFromGitHub {
+    owner = "libkml";
+    repo = pname;
+    rev = version;
+    sha256 = "0gl4cqfps9mzx6hzf3dc10hy5y8smpyf1s31sqm7w343hgsllv0z";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  cmakeFlags = [
+    "-DBUILD_TESTING=ON"
+  # Darwin tests require rpath for libs in build dir
+  ] ++ lib.optional stdenv.isDarwin [
+    "-DCMAKE_SKIP_BUILD_RPATH=OFF"
+  ];
+
+  buildInputs = [
+    gtest
+    boost
+    expat
+    zlib
+    uriparser
+    minizip
+  ];
+
+  preCheck = ''
+    export LD_LIBRARY_PATH=$PWD/lib
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Reference implementation of OGC KML 2.2";
+    homepage = "https://github.com/libkml/libkml";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ costrouc ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libksba/default.nix b/nixpkgs/pkgs/development/libraries/libksba/default.nix
new file mode 100644
index 000000000000..c8998446c7da
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libksba/default.nix
@@ -0,0 +1,31 @@
+{ buildPackages, lib, stdenv, fetchurl, gettext, libgpgerror }:
+
+stdenv.mkDerivation rec {
+  name = "libksba-1.5.1";
+
+  src = fetchurl {
+    url = "mirror://gnupg/libksba/${name}.tar.bz2";
+    sha256 = "sha256-sPTGXk5EfZojSfa4wOd6KL6VMeRUi6AsVF0fRtx7+SE=";
+  };
+
+  outputs = [ "out" "dev" "info" ];
+
+  buildInputs = [ gettext ];
+  propagatedBuildInputs = [ libgpgerror ];
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+
+  configureFlags = [ "--with-libgpg-error-prefix=${libgpgerror.dev}" ];
+
+  postInstall = ''
+    mkdir -p $dev/bin
+    mv $out/bin/*-config $dev/bin/
+    rmdir --ignore-fail-on-non-empty $out/bin
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.gnupg.org";
+    description = "CMS and X.509 access library";
+    platforms = platforms.all;
+    license = licenses.lgpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libksi/default.nix b/nixpkgs/pkgs/development/libraries/libksi/default.nix
new file mode 100644
index 000000000000..015121811710
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libksi/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, openssl, curl }:
+
+stdenv.mkDerivation rec {
+  pname = "libksi";
+  version = "3.20.3025";
+
+  src = fetchFromGitHub {
+    owner = "Guardtime";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0cagysr8j92r6g7f0mwrlkpn9xz9ncz2v3jymh47j3ljxmfbagpz";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ openssl curl ];
+
+  configureFlags = [
+    "--with-openssl=${openssl.dev}"
+    "--with-cafile=/etc/ssl/certs/ca-certificates.crt"
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/GuardTime/libksi";
+    description = "Keyless Signature Infrastructure API library";
+    license = licenses.asl20;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libktorrent/default.nix b/nixpkgs/pkgs/development/libraries/libktorrent/default.nix
new file mode 100644
index 000000000000..825fe87fe2fe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libktorrent/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, cmake, extra-cmake-modules
+, karchive, kcrash, ki18n, kio, solid
+, boost, gmp, qca-qt5, libgcrypt
+}:
+
+let
+  mainVersion = "5.1.2";
+
+in stdenv.mkDerivation rec {
+  pname = "libktorrent";
+  version = "2.1.1";
+
+  src = fetchurl {
+    url    = "mirror://kde/stable/ktorrent/${mainVersion}/${pname}-${version}.tar.xz";
+    sha256 = "0051zh8bb4p9wmcfn5ql987brhsaiw9880xdck7b5dm1a05mri2w";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ cmake extra-cmake-modules ];
+
+  buildInputs = [ karchive kcrash ki18n kio solid qca-qt5 libgcrypt ];
+
+  propagatedBuildInputs = [ gmp boost ];
+
+  passthru = {
+    inherit mainVersion;
+  };
+
+  dontWrapQtApps = true;
+
+  meta = with lib; {
+    description = "A BitTorrent library used by KTorrent";
+    homepage    = "https://www.kde.org/applications/internet/ktorrent/";
+    maintainers = with maintainers; [ eelco ];
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liblangtag/default.nix b/nixpkgs/pkgs/development/libraries/liblangtag/default.nix
new file mode 100644
index 000000000000..5ba2ecc5d6bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liblangtag/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchurl, autoreconfHook, gtk-doc, gettext
+, pkg-config, glib, libxml2, gobject-introspection, gnome-common, unzip
+}:
+
+stdenv.mkDerivation rec {
+  pname = "liblangtag";
+  version = "0.6.3";
+
+  # Artifact tarball contains lt-localealias.h needed for darwin
+  src = fetchurl {
+    url = "https://bitbucket.org/tagoh/liblangtag/downloads/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-HxKiCgLsOo0i5U3tuLaDpDycFgvaG6M3vxBgYHrnM70=";
+  };
+
+  core_zip = fetchurl {
+    # please update if an update is available
+    url = "http://www.unicode.org/Public/cldr/37/core.zip";
+    sha256 = "0myswkvvaxvrz9zwq4zh65sygfd9n72cd5rk4pwacqba4nxgb4xs";
+  };
+
+  language_subtag_registry = fetchurl {
+    url = "http://www.iana.org/assignments/language-subtag-registry";
+    sha256 = "0y9x5gra6jri4sk16f0dp69p06almnsl48rs85605f035kf539qm";
+  };
+
+  postPatch = ''
+    gtkdocize
+    cp "${core_zip}" data/core.zip
+    touch data/stamp-core-zip
+    cp "${language_subtag_registry}" data/language-subtag-registry
+  '';
+
+  configureFlags =
+    lib.optional
+      (stdenv.hostPlatform.libc == "glibc")
+      "--with-locale-alias=${stdenv.cc.libc}/share/locale/locale.alias";
+
+  buildInputs = [ gettext glib libxml2 gobject-introspection gnome-common ];
+  nativeBuildInputs = [ autoreconfHook gtk-doc gettext pkg-config unzip ];
+
+  meta = with lib; {
+    description = "An interface library to access tags for identifying languages";
+    license = licenses.mpl20;
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.unix;
+    # There are links to a homepage that are broken by a BitBucket change
+    homepage = "https://bitbucket.org/tagoh/liblangtag/overview";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liblastfm/default.nix b/nixpkgs/pkgs/development/libraries/liblastfm/default.nix
new file mode 100644
index 000000000000..5183c47bc061
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liblastfm/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, pkg-config, which, cmake
+, fftwSinglePrec, libsamplerate, qtbase
+, darwin }:
+
+stdenv.mkDerivation rec {
+  pname = "liblastfm-unstable";
+  version = "2019-08-23";
+
+  src = fetchFromGitHub {
+    owner = "lastfm";
+    repo = "liblastfm";
+    rev = "2ce2bfe1879227af8ffafddb82b218faff813db9";
+    sha256 = "1crih9xxf3rb109aqw12bjqv47z28lvlk2dpvyym5shf82nz6yd0";
+  };
+
+  patches = [(fetchpatch {
+    url = "https://github.com/lastfm/liblastfm/commit/9c5d072b55f2863310e40291677e6397e9cbc3c2.patch";
+    name = "0001-Remove-deprecated-staging-server-and-fix-test-for-QT5-at-Ubuntu-19.10.patch";
+    sha256 = "04r14prydxshjgfws3pjajjmp2msszhjjs1mjh8s66yg29vq620l";
+  })];
+
+  nativeBuildInputs = [ pkg-config which cmake ];
+  buildInputs = [ fftwSinglePrec libsamplerate qtbase ]
+    ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.SystemConfiguration;
+
+  dontWrapQtApps = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/lastfm/liblastfm";
+    repositories.git = "git://github.com/lastfm/liblastfm.git";
+    description = "Official LastFM library";
+    platforms = platforms.unix;
+    maintainers = [ maintainers.phreedom ];
+    license = licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liblastfmSF/default.nix b/nixpkgs/pkgs/development/libraries/liblastfmSF/default.nix
new file mode 100644
index 000000000000..74d32a6cc748
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liblastfmSF/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, pkg-config, curl, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "liblastfm-SF";
+  version = "0.5";
+
+  nativeBuildInputs = [ pkg-config ];
+
+  propagatedBuildInputs = [ curl openssl ];
+
+  src = fetchurl {
+    url = "mirror://sourceforge/liblastfm/libclastfm-${version}.tar.gz";
+    sha256 = "0hpfflvfx6r4vvsbvdc564gkby8kr07p8ma7hgpxiy2pnlbpian9";
+  };
+
+  meta = {
+    homepage = "http://liblastfm.sourceforge.net";
+    description = "Unofficial C lastfm library";
+    license = lib.licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liblaxjson/default.nix b/nixpkgs/pkgs/development/libraries/liblaxjson/default.nix
new file mode 100644
index 000000000000..9464714d5cc9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liblaxjson/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  version = "1.0.5";
+  pname = "liblaxjson";
+
+  src = fetchFromGitHub {
+    owner = "andrewrk";
+    repo = "liblaxjson";
+    rev = version;
+    sha256 = "01iqbpbhnqfifhv82m6hi8190w5sdim4qyrkss7z1zyv3gpchc5s";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Library for parsing JSON config files";
+    homepage = "https://github.com/andrewrk/liblaxjson";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.andrewrk ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liblcf/default.nix b/nixpkgs/pkgs/development/libraries/liblcf/default.nix
new file mode 100644
index 000000000000..1e6f57368b78
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liblcf/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, expat, icu }:
+
+stdenv.mkDerivation rec {
+  pname = "liblcf";
+  version = "0.6.2";
+
+  src = fetchFromGitHub {
+    owner = "EasyRPG";
+    repo = "liblcf";
+    rev = version;
+    sha256 = "0b0bz9ydpc98mxbg78bgf8kil85kxyqgkzxgsjq7awzmyw7f3c1c";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  propagatedBuildInputs = [ expat icu ];
+
+  meta = with lib; {
+    description = "Library to handle RPG Maker 2000/2003 and EasyRPG projects";
+    homepage = "https://github.com/EasyRPG/liblcf";
+    license = licenses.mit;
+    maintainers = with maintainers; [ yegortimoshenko ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libliftoff/default.nix b/nixpkgs/pkgs/development/libraries/libliftoff/default.nix
new file mode 100644
index 000000000000..759549dbb289
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libliftoff/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub
+, meson, pkg-config, ninja
+, libdrm
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libliftoff";
+  version = "0.1.0";
+
+  src = fetchFromGitHub {
+    owner = "emersion";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1s53jsll3c7272bhmh4jr6k5m1nvn8i1ld704qmzsm852ilmgrla";
+  };
+
+  nativeBuildInputs = [ meson pkg-config ninja ];
+
+  buildInputs = [ libdrm ];
+
+  meta = with lib; {
+    description = "A lightweight KMS plane library";
+    longDescription = ''
+      libliftoff eases the use of KMS planes from userspace without standing in
+      your way. Users create "virtual planes" called layers, set KMS properties
+      on them, and libliftoff will pick planes for these layers if possible.
+    '';
+    inherit (src.meta) homepage;
+    changelog = "https://github.com/emersion/libliftoff/releases/tag/v${version}";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ primeos ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liblinear/default.nix b/nixpkgs/pkgs/development/libraries/liblinear/default.nix
new file mode 100644
index 000000000000..aa2dcd648b81
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liblinear/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchFromGitHub, fixDarwinDylibNames }:
+
+let
+  soVersion = "4";
+in stdenv.mkDerivation rec {
+  pname = "liblinear";
+  version = "2.43";
+
+  src = fetchFromGitHub {
+    owner = "cjlin1";
+    repo = "liblinear";
+    rev = "v${builtins.replaceStrings ["."] [""] version}";
+    sha256 = "sha256-qcSMuWHJgsapWs1xgxv3fKSXcx18q8cwyIn3E4RCGKA=";
+  };
+
+  postPatch = ''
+    substituteInPlace blas/Makefile \
+      --replace "ar rcv" "${stdenv.cc.targetPrefix}ar rcv" \
+      --replace "ranlib" "${stdenv.cc.targetPrefix}ranlib"
+  '';
+
+  outputs = [ "bin" "dev" "out" ];
+
+  nativeBuildInputs = lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
+
+  buildFlags = [ "lib" "predict" "train" ];
+
+  installPhase = ''
+    ${if stdenv.isDarwin then ''
+      install -D liblinear.so.${soVersion} $out/lib/liblinear.${soVersion}.dylib
+      ln -s $out/lib/liblinear.${soVersion}.dylib $out/lib/liblinear.dylib
+    '' else ''
+      install -Dt $out/lib liblinear.so.${soVersion}
+      ln -s $out/lib/liblinear.so.${soVersion} $out/lib/liblinear.so
+    ''}
+    install -D train $bin/bin/liblinear-train
+    install -D predict $bin/bin/liblinear-predict
+    install -Dm444 -t $dev/include linear.h
+  '';
+
+  meta = with lib; {
+    description = "A library for large linear classification";
+    homepage = "https://www.csie.ntu.edu.tw/~cjlin/liblinear/";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.danieldk ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liblinphone/default.nix b/nixpkgs/pkgs/development/libraries/liblinphone/default.nix
new file mode 100644
index 000000000000..8a38aa36c097
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liblinphone/default.nix
@@ -0,0 +1,132 @@
+{ bcg729
+, bctoolbox
+, bcunit
+, belcard
+, belle-sip
+, belr
+, bzrtp
+, cairo
+, cmake
+, cyrus_sasl
+, doxygen
+, fetchFromGitLab
+, ffmpeg
+, gdk-pixbuf
+, glib
+, graphviz
+, gtk2
+, intltool
+, libexosip
+, libmatroska
+, libnotify
+, libosip
+, libsoup
+, libupnp
+, libX11
+, libxml2
+, lime
+, makeWrapper
+, mbedtls
+, mediastreamer
+, openldap
+, ortp
+, pango
+, pkg-config
+, python3
+, readline
+, soci
+, speex
+, sqlite
+, lib, stdenv
+, udev
+, xercesc
+, xsd
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "liblinphone";
+  version = "4.5.17";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.linphone.org";
+    owner = "public";
+    group = "BC";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-ryyT4bG3lnE72ydvCAoiT3IeHY4mZwX9nCqaTRC1wyc=";
+  };
+
+  # Do not build static libraries
+  cmakeFlags = [ "-DENABLE_STATIC=NO" ];
+
+  # TODO: Not sure if all these inputs are actually needed. Most of them were
+  # defined when liblinphone and linphone-desktop weren't separated yet, so some
+  # of them might not be needed for liblinphone alone.
+  buildInputs = [
+    (python3.withPackages (ps: [ ps.pystache ps.six ]))
+    bcg729
+    bctoolbox
+    belcard
+    belle-sip
+    belr
+    bzrtp
+    cairo
+    cyrus_sasl
+    ffmpeg
+    gdk-pixbuf
+    glib
+    gtk2
+    libX11
+    libexosip
+    libmatroska
+    libnotify
+    libosip
+    libsoup
+    libupnp
+    libxml2
+    lime
+    mbedtls
+    mediastreamer
+    openldap
+    ortp
+    pango
+    readline
+    soci
+    speex
+    sqlite
+    udev
+    xercesc
+    xsd
+    zlib
+  ];
+
+  nativeBuildInputs = [
+    bcunit
+    cmake
+    doxygen
+    graphviz
+    intltool
+    makeWrapper
+    pkg-config
+  ];
+
+  strictDeps = true;
+
+  # Some grammar files needed to be copied too from some dependencies. I suppose
+  # if one define a dependency in such a way that its share directory is found,
+  # then this copying would be unnecessary. Instead of actually copying these
+  # files, create a symlink.
+  postInstall = ''
+    mkdir -p $out/share/belr/grammars
+    ln -s ${belcard}/share/belr/grammars/* $out/share/belr/grammars/
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.linphone.org/technical-corner/liblinphone";
+    description = "Library for SIP calls and instant messaging";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liblo/default.nix b/nixpkgs/pkgs/development/libraries/liblo/default.nix
new file mode 100644
index 000000000000..1a9ce7c331a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liblo/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "liblo";
+  version = "0.31";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/liblo/liblo/${version}/${pname}-${version}.tar.gz";
+    sha256 = "0l67rkdhfa8cffa0nynql3lh2xlbn1454h6qxhjddp1029p48krb";
+  };
+
+  doCheck = false; # fails 1 out of 3 tests
+
+  meta = {
+    description = "Lightweight library to handle the sending and receiving of messages according to the Open Sound Control (OSC) protocol";
+    homepage = "https://sourceforge.net/projects/liblo";
+    license = lib.licenses.gpl2;
+    maintainers = [lib.maintainers.marcweber];
+    platforms = with lib.platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liblockfile/default.nix b/nixpkgs/pkgs/development/libraries/liblockfile/default.nix
new file mode 100644
index 000000000000..003991c80dde
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liblockfile/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  _name   = "liblockfile";
+  version = "1.17";
+  name    = "${_name}-${version}";
+
+  src = fetchurl {
+    url = "mirror://debian/pool/main/libl/${_name}/${_name}_${version}.orig.tar.gz";
+    sha256 = "sha256-bpN/NlCvq0qsGY80i4mxykLtzrF/trsJGPZCFDzP0V4=";
+  };
+
+  preConfigure = ''
+    sed -i -e 's/ -g [^ ]* / /' Makefile.in
+  '';
+
+  preInstall = ''
+    mkdir -p $out/{bin,lib,include,man} $out/man/man{1,3}
+  '';
+
+  meta = {
+    description = "Shared library with NFS-safe locking functions";
+    homepage = "http://packages.debian.org/unstable/libs/liblockfile1";
+    license = lib.licenses.gpl2Plus;
+
+    maintainers = [ lib.maintainers.bluescreen303 ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liblogging/default.nix b/nixpkgs/pkgs/development/libraries/liblogging/default.nix
new file mode 100644
index 000000000000..4a28bf677412
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liblogging/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, pkg-config
+, systemd ? null
+}:
+
+stdenv.mkDerivation rec {
+  name = "liblogging-1.0.6";
+
+  src = fetchurl {
+    url = "http://download.rsyslog.com/liblogging/${name}.tar.gz";
+    sha256 = "14xz00mq07qmcgprlj5b2r21ljgpa4sbwmpr6jm2wrf8wms6331k";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ systemd ];
+
+  configureFlags = [
+    "--enable-rfc3195"
+    "--enable-stdlog"
+    (if systemd != null then "--enable-journal" else "--disable-journal")
+    "--enable-man-pages"
+  ];
+
+  meta = with lib; {
+    homepage = "http://www.liblogging.org/";
+    description = "Lightweight signal-safe logging library";
+    license = licenses.bsd2;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liblognorm/default.nix b/nixpkgs/pkgs/development/libraries/liblognorm/default.nix
new file mode 100644
index 000000000000..293f72d67b2b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liblognorm/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, pkg-config, libestr, json_c, pcre, fastJson }:
+
+stdenv.mkDerivation rec {
+  name = "liblognorm-2.0.6";
+
+  src = fetchurl {
+    url = "http://www.liblognorm.com/files/download/${name}.tar.gz";
+    sha256 = "1wpn15c617r7lfm1z9d5aggmmi339s6yn4pdz698j0r2bkl5gw6g";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libestr json_c pcre fastJson ];
+
+  configureFlags = [ "--enable-regexp" ];
+
+  meta = with lib; {
+    homepage = "https://www.liblognorm.com/";
+    description = "Help to make sense out of syslog data, or, actually, any event data that is present in text form";
+    license = licenses.lgpl21;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liblouis/default.nix b/nixpkgs/pkgs/development/libraries/liblouis/default.nix
new file mode 100644
index 000000000000..dd2738b1774d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liblouis/default.nix
@@ -0,0 +1,68 @@
+{ fetchFromGitHub
+, lib, stdenv
+, autoreconfHook
+, pkg-config
+, gettext
+, python3
+, texinfo
+, help2man
+, libyaml
+, perl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "liblouis";
+  version = "3.18.0";
+
+  src = fetchFromGitHub {
+    owner = "liblouis";
+    repo = "liblouis";
+    rev = "v${version}";
+    sha256 = "sha256-STAfA2QgSrCZaT/tcoj0BVnFfO3jbe6W2FgVOfxjpJc=";
+  };
+
+  outputs = [ "out" "dev" "man" "info" "doc" ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+    gettext
+    python3
+    # Docs, man, info
+    texinfo
+    help2man
+  ];
+
+  buildInputs = [
+    # lou_checkYaml
+    libyaml
+    # maketable.d
+    perl
+  ];
+
+  configureFlags = [
+    # Required by Python bindings
+    "--enable-ucs4"
+  ];
+
+  postPatch = ''
+    patchShebangs tests
+    substituteInPlace python/louis/__init__.py.in --replace "###LIBLOUIS_SONAME###" "$out/lib/liblouis.so"
+  '';
+
+  postInstall = ''
+    pushd python
+    python setup.py install --prefix="$out" --optimize=1
+    popd
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Open-source braille translator and back-translator";
+    homepage = "http://liblouis.org/";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liblqr-1/default.nix b/nixpkgs/pkgs/development/libraries/liblqr-1/default.nix
new file mode 100644
index 000000000000..aa6cd0fd57d8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liblqr-1/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, glib }:
+
+stdenv.mkDerivation rec {
+  pname = "liblqr-1";
+  version = "0.4.2";
+
+  src = fetchFromGitHub {
+    owner = "carlobaldassi";
+    repo = "liblqr";
+    rev = "v${version}";
+    sha256 = "10mrl5k3l2hxjhz4w93n50xwywp6y890rw2vsjcgai8627x5f1df";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  propagatedBuildInputs = [ glib ];
+
+  meta = with lib; {
+    homepage = "http://liblqr.wikidot.com";
+    description = "Seam-carving C/C++ library called Liquid Rescaling";
+    platforms = platforms.all;
+    license = with licenses; [ gpl3 lgpl3 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liblscp/default.nix b/nixpkgs/pkgs/development/libraries/liblscp/default.nix
new file mode 100644
index 000000000000..813aa660ae9d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liblscp/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, autoconf, automake, libtool, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "liblscp";
+  version = "0.9.2";
+
+  src = fetchurl {
+    url = "https://download.linuxsampler.org/packages/${pname}-${version}.tar.gz";
+    sha256 = "sha256-GTW6SBQVCDtzeU+arLmAJi6N9jtN68NdI69p6RSazvs=";
+  };
+
+  nativeBuildInputs = [ autoconf automake libtool pkg-config ];
+
+  preConfigure = "make -f Makefile.git";
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "http://www.linuxsampler.org";
+    description = "LinuxSampler Control Protocol (LSCP) wrapper library";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libltc/default.nix b/nixpkgs/pkgs/development/libraries/libltc/default.nix
new file mode 100644
index 000000000000..a7d52fe17cf9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libltc/default.nix
@@ -0,0 +1,18 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "libltc";
+  version = "1.3.1";
+
+  src = fetchurl {
+    url = "https://github.com/x42/libltc/releases/download/v${version}/libltc-${version}.tar.gz";
+    sha256 = "173h9dgmain3nyrwk6q2d7yl4fnh4vacag4s2p01n5b7nyrkxrjh";
+  };
+
+  meta = with lib; {
+    homepage = "http://x42.github.io/libltc/";
+    description = "POSIX-C Library for handling Linear/Logitudinal Time Code (LTC)";
+    license = licenses.lgpl3Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liblxi/default.nix b/nixpkgs/pkgs/development/libraries/liblxi/default.nix
new file mode 100644
index 000000000000..1ca4043a024d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liblxi/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub
+, pkg-config, autoreconfHook
+, libtirpc, rpcsvc-proto, avahi, libxml2
+}:
+
+stdenv.mkDerivation rec {
+  pname = "liblxi";
+  version = "1.13";
+
+  src = fetchFromGitHub {
+    owner = "lxi-tools";
+    repo = "liblxi";
+    rev = "v${version}";
+    sha256 = "129m0k2wrlgs25qkskynljddqspasla1x8iq51vmg38nhnilpqf6";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config rpcsvc-proto ];
+
+  buildInputs = [ libtirpc avahi libxml2 ];
+
+  meta = with lib; {
+    description = "Library for communicating with LXI compatible instruments";
+    longDescription = ''
+      liblxi is an open source software library which offers a simple
+      API for communicating with LXI compatible instruments.
+      The API allows applications to easily discover instruments
+      on networks and communicate SCPI commands.
+    '';
+    homepage = "https://lxi-tools.github.io/";
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.vq ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmad/default.nix b/nixpkgs/pkgs/development/libraries/libmad/default.nix
new file mode 100644
index 000000000000..dd7923486865
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmad/default.nix
@@ -0,0 +1,63 @@
+{ lib, stdenv, fetchurl, fetchpatch, autoconf }:
+
+stdenv.mkDerivation rec {
+  pname = "libmad";
+  version = "0.15.1b";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/mad/${pname}-${version}.tar.gz";
+    sha256 = "14460zhacxhswnzb36qfpd1f2wbk10qvksvm6wyq5hpvdgnw7ymv";
+  };
+
+  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
+  ++ 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.
+  postPatch = ''
+    substituteInPlace configure.ac --replace "-fforce-mem" ""
+    substituteInPlace configure.ac --replace "arch=\"-march=i486\"" ""
+  '';
+
+  nativeBuildInputs = [ autoconf ];
+
+  preConfigure = "autoconf";
+
+  meta = with lib; {
+    homepage    = "https://sourceforge.net/projects/mad/";
+    description = "A high-quality, fixed-point MPEG audio decoder supporting MPEG-1 and MPEG-2";
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmanette/default.nix b/nixpkgs/pkgs/development/libraries/libmanette/default.nix
new file mode 100644
index 000000000000..645b521b8172
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmanette/default.nix
@@ -0,0 +1,65 @@
+{ lib, stdenv
+, fetchurl
+, ninja
+, meson
+, pkg-config
+, vala
+, gobject-introspection
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+, glib
+, libgudev
+, libevdev
+, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libmanette";
+  version = "0.2.6";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1b3bcdkk5xd5asq797cch9id8692grsjxrc1ss87vv11m1ck4rb3";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    vala
+    gobject-introspection
+    gtk-doc
+    docbook-xsl-nons
+    docbook_xml_dtd_43
+  ];
+
+  buildInputs = [
+    glib
+    libgudev
+    libevdev
+  ];
+
+  mesonFlags = [
+    "-Ddoc=true"
+  ];
+
+  doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "A simple GObject game controller library";
+    homepage = "https://gnome.pages.gitlab.gnome.org/libmanette/";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmatchbox/default.nix b/nixpkgs/pkgs/development/libraries/libmatchbox/default.nix
new file mode 100644
index 000000000000..50b66eccfb3d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmatchbox/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, libX11, libXext, libpng, libXft, libICE, pango, libjpeg}:
+
+stdenv.mkDerivation rec {
+  pname = "libmatchbox";
+  version = "1.11";
+
+  buildInputs = [ libXft libICE pango libjpeg ];
+  propagatedBuildInputs = [ libX11 libXext libpng ];
+  NIX_LDFLAGS = "-lX11";
+
+  src = fetchurl {
+    url = "https://downloads.yoctoproject.org/releases/matchbox/libmatchbox/${version}/libmatchbox-${version}.tar.bz2";
+    sha256 = "0lvv44s3bf96zvkysa4ansxj2ffgj3b5kgpliln538q4wd9ank15";
+  };
+
+  meta = {
+    description = "Library of the matchbox X window manager";
+    homepage = "http://matchbox-project.org/";
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmatheval/default.nix b/nixpkgs/pkgs/development/libraries/libmatheval/default.nix
new file mode 100644
index 000000000000..b0fe1c35ef3a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmatheval/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchurl, pkg-config, guile, autoconf, flex, fetchpatch }:
+
+stdenv.mkDerivation rec {
+  version = "1.1.11";
+  pname = "libmatheval";
+
+  nativeBuildInputs = [ pkg-config autoconf flex ];
+  buildInputs = [ guile ];
+
+  src = fetchurl {
+    url = "https://ftp.gnu.org/gnu/libmatheval/${pname}-${version}.tar.gz";
+    sha256 = "474852d6715ddc3b6969e28de5e1a5fbaff9e8ece6aebb9dc1cc63e9e88e89ab";
+  };
+
+  # Patches coming from debian package
+  # https://packages.debian.org/source/sid/libs/libmatheval
+  patches = [ (fetchpatch {
+                url = "https://salsa.debian.org/science-team/libmatheval/raw/debian/1.1.11+dfsg-3/debian/patches/002-skip-docs.patch";
+                sha256 = "1nnkk9aw4jj6nql46zhwq6vx74zrmr1xq5ix0xyvpawhabhgjg62";
+              } )
+              (fetchpatch {
+                url = "https://salsa.debian.org/science-team/libmatheval/raw/debian/1.1.11+dfsg-3/debian/patches/003-guile2.0.patch";
+                sha256 = "1xgfw4finfvr20kjbpr4yl2djxmyr4lmvfa11pxirfvhrdi602qj";
+               } )
+              (fetchpatch {
+                url = "https://salsa.debian.org/science-team/libmatheval/raw/debian/1.1.11+dfsg-3/debian/patches/disable_coth_test.patch";
+                sha256 = "0bai8jrd5azfz5afmjixlvifk34liq58qb7p9kb45k6kc1fqqxzm";
+               } )
+            ];
+
+  meta = {
+    description = "A library to parse and evaluate symbolic expressions input as text";
+    longDescription = ''
+      GNU libmatheval is a library (callable from C and Fortran) to parse and evaluate symbolic
+      expressions input as text. It supports expressions in any number of variables of arbitrary
+      names, decimal and symbolic constants, basic unary and binary operators, and elementary
+      mathematical functions. In addition to parsing and evaluation, libmatheval can also compute
+      symbolic derivatives and output expressions to strings.
+    '';
+    homepage = "https://www.gnu.org/software/libmatheval/";
+    license = lib.licenses.gpl3;
+    maintainers = [ lib.maintainers.bzizou ];
+    platforms = lib.platforms.linux;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/libmatroska/default.nix b/nixpkgs/pkgs/development/libraries/libmatroska/default.nix
new file mode 100644
index 000000000000..a89bf9fc4ab9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmatroska/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
+, libebml }:
+
+stdenv.mkDerivation rec {
+  pname = "libmatroska";
+  version = "1.6.3";
+
+  src = fetchFromGitHub {
+    owner  = "Matroska-Org";
+    repo   = "libmatroska";
+    rev    = "release-${version}";
+    sha256 = "01dg12ndxfdqgjx5v2qy4mff6xjdxglywyg82sr3if5aw6rp3dji";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [ libebml ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=YES"
+    "-DCMAKE_INSTALL_PREFIX="
+  ];
+
+  meta = with lib; {
+    description = "A library to parse Matroska files";
+    homepage = "https://matroska.org/";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ spwhitt ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmaxminddb/default.nix b/nixpkgs/pkgs/development/libraries/libmaxminddb/default.nix
new file mode 100644
index 000000000000..1c15519aaff9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmaxminddb/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libmaxminddb";
+  version = "1.6.0";
+
+  src = fetchurl {
+    url = meta.homepage + "/releases/download/${version}/${pname}-${version}.tar.gz";
+    sha256 = "sha256-diCsGHxZHOIbzXvzUjdqPFapM+aEVYofa+9L1PP5gmc=";
+  };
+
+  meta = with lib; {
+    description = "C library for working with MaxMind geolocation DB files";
+    homepage = "https://github.com/maxmind/libmaxminddb";
+    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
new file mode 100644
index 000000000000..43a88f9dd5fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmbim/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv
+, fetchurl
+, pkg-config
+, glib
+, python3
+, systemd
+, libgudev
+, withIntrospection ? stdenv.hostPlatform == stdenv.buildPlatform
+, gobject-introspection
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libmbim";
+  version = "1.24.8";
+
+  src = fetchurl {
+    url = "https://www.freedesktop.org/software/libmbim/${pname}-${version}.tar.xz";
+    sha256 = "sha256-AlkHNhY//xDlcyGR/MwbmSCWlhbdxZYToAMFKhFqPCU=";
+  };
+
+  outputs = [ "out" "dev" "man" ];
+
+  configureFlags = [
+    "--with-udev-base-dir=${placeholder "out"}/lib/udev"
+    (lib.enableFeature withIntrospection "introspection")
+  ];
+
+  nativeBuildInputs = [
+    pkg-config
+    python3
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    glib
+    libgudev
+    systemd
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://www.freedesktop.org/wiki/Software/libmbim/";
+    description = "Library for talking to WWAN modems and devices which speak the Mobile Interface Broadband Model (MBIM) protocol";
+    platforms = platforms.linux;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmcrypt/default.nix b/nixpkgs/pkgs/development/libraries/libmcrypt/default.nix
new file mode 100644
index 000000000000..50bbf8383e61
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmcrypt/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, darwin, disablePosixThreads ? false }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "libmcrypt";
+  version = "2.5.8";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/mcrypt/Libmcrypt/${version}/libmcrypt-${version}.tar.gz";
+    sha256 = "0gipgb939vy9m66d3k8il98rvvwczyaw2ixr8yn6icds9c3nrsz4";
+  };
+
+  buildInputs = optional stdenv.isDarwin darwin.cctools;
+
+  configureFlags = optional disablePosixThreads
+    [ "--disable-posix-threads" ];
+
+  meta = {
+    description = "Replacement for the old crypt() package and crypt(1) command, with extensions";
+    homepage = "http://mcrypt.sourceforge.net";
+    license = "GPL";
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmd/default.nix b/nixpkgs/pkgs/development/libraries/libmd/default.nix
new file mode 100644
index 000000000000..7093376aa7e5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmd/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "libmd";
+  version = "1.0.3";
+
+  src = fetchurl {
+    url = "https://archive.hadrons.org/software/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "0jmga8y94h857ilra3qjaiax3wd5pd6mx1h120zhl9fcjmzhj0js";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = with lib; {
+    homepage = "https://www.hadrons.org/software/${pname}/";
+    changelog = "https://archive.hadrons.org/software/libmd/libmd-${version}.announce";
+    # Git: https://git.hadrons.org/cgit/libmd.git
+    description = "Message Digest functions from BSD systems";
+    license = with licenses; [ bsd3 bsd2 isc beerware publicDomain ];
+    maintainers = with maintainers; [ primeos ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmediaart/default.nix b/nixpkgs/pkgs/development/libraries/libmediaart/default.nix
new file mode 100644
index 000000000000..ee1b306c3e51
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmediaart/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, vala, gtk-doc, docbook_xsl, docbook_xml_dtd_412, glib, gdk-pixbuf, gobject-introspection, gnome, fetchpatch }:
+
+stdenv.mkDerivation rec {
+  pname = "libmediaart";
+  version = "1.9.4";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "a57be017257e4815389afe4f58fdacb6a50e74fd185452b23a652ee56b04813d";
+  };
+
+  nativeBuildInputs = [ meson ninja pkg-config 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;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    description = "Library tasked with managing, extracting and handling media art caches";
+    maintainers = teams.gnome.members;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmediainfo/default.nix b/nixpkgs/pkgs/development/libraries/libmediainfo/default.nix
new file mode 100644
index 000000000000..3541d3d466f7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmediainfo/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, libzen, zlib }:
+
+stdenv.mkDerivation rec {
+  version = "21.03";
+  pname = "libmediainfo";
+  src = fetchurl {
+    url = "https://mediaarea.net/download/source/libmediainfo/${version}/libmediainfo_${version}.tar.xz";
+    sha256 = "1jm4mk539wf3crgpcddgwdixshwdzm37mkb5441lifhcz2mykdsn";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ libzen zlib ];
+
+  sourceRoot = "./MediaInfoLib/Project/GNU/Library/";
+
+  configureFlags = [ "--enable-shared" ];
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    install -vD -m 644 libmediainfo.pc "$out/lib/pkgconfig/libmediainfo.pc"
+  '';
+
+  meta = with lib; {
+    description = "Shared library for mediainfo";
+    homepage = "https://mediaarea.net/";
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.devhell ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmemcached/default.nix b/nixpkgs/pkgs/development/libraries/libmemcached/default.nix
new file mode 100644
index 000000000000..099dab139c4f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmemcached/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl, fetchpatch, cyrus_sasl, libevent }:
+
+stdenv.mkDerivation rec {
+  pname = "libmemcached";
+  version = "1.0.18";
+
+  src = fetchurl {
+    url = "https://launchpad.net/libmemcached/${lib.versions.majorMinor version}/${version}/+download/libmemcached-${version}.tar.gz";
+    sha256 = "10jzi14j32lpq0if0p9vygcl2c1352hwbywzvr9qzq7x6aq0nb72";
+  };
+
+  # Fix linking against libpthread (patch from Fedora)
+  # https://bugzilla.redhat.com/show_bug.cgi?id=1037707
+  # https://bugs.launchpad.net/libmemcached/+bug/1281907
+  # Fix building on macOS (patch from Homebrew)
+  # https://bugs.launchpad.net/libmemcached/+bug/1245562
+  patches = lib.optional stdenv.isLinux ./libmemcached-fix-linking-with-libpthread.patch
+    ++ lib.optional stdenv.isDarwin (fetchpatch {
+      url = "https://raw.githubusercontent.com/Homebrew/homebrew/bfd4a0a4626b61c2511fdf573bcbbc6bbe86340e/Library/Formula/libmemcached.rb";
+      sha256 = "1gjf3vd7hiyzxjvlg2zfc3y2j0lyr6nhbws4xb5dmin3csyp8qb8";
+    })
+    ++ lib.optional stdenv.hostPlatform.isMusl ./musl-fixes.patch;
+
+  buildInputs = [ libevent ];
+  propagatedBuildInputs = [ cyrus_sasl ];
+
+  NIX_CFLAGS_COMPILE = "-fpermissive";
+
+  meta = with lib; {
+    homepage = "https://libmemcached.org";
+    description = "Open source C/C++ client library and tools for the memcached server";
+    license = licenses.bsd3;
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmemcached/libmemcached-fix-linking-with-libpthread.patch b/nixpkgs/pkgs/development/libraries/libmemcached/libmemcached-fix-linking-with-libpthread.patch
new file mode 100644
index 000000000000..e5e21c433587
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmemcached/libmemcached-fix-linking-with-libpthread.patch
@@ -0,0 +1,19 @@
+diff -up libmemcached-1.0.16/build-aux/ltmain.sh.orig libmemcached-1.0.16/build-aux/ltmain.sh
+--- libmemcached-1.0.16/build-aux/ltmain.sh.orig	2013-12-03 16:36:53.222107642 +0100
++++ libmemcached-1.0.16/build-aux/ltmain.sh	2013-12-03 16:37:35.770132249 +0100
+@@ -5664,6 +5664,15 @@ func_mode_link ()
+ 	    *" $arg "*) ;;
+ 	    * ) func_append new_inherited_linker_flags " $arg" ;;
+ 	esac
++	# As we are forced to pass -nostdlib to g++ during linking, the option
++	# -pthread{,s} is not in effect;  add the -lpthread to $deplist
++	# explicitly to link correctly.
++	if test "$tagname" = CXX -a x"$with_gcc" = xyes; then
++	  case "$arg" in
++	    -pthread*) func_append deplibs " -lpthread" ;;
++	  esac
++	fi
++
+ 	continue
+ 	;;
+ 
diff --git a/nixpkgs/pkgs/development/libraries/libmemcached/musl-fixes.patch b/nixpkgs/pkgs/development/libraries/libmemcached/musl-fixes.patch
new file mode 100644
index 000000000000..eb2a6bc980eb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmemcached/musl-fixes.patch
@@ -0,0 +1,58 @@
+diff --git a/libhashkit/fnv_64.cc b/libhashkit/fnv_64.cc
+index 68e4dd0..64656b7 100644
+--- a/libhashkit/fnv_64.cc
++++ b/libhashkit/fnv_64.cc
+@@ -37,8 +37,9 @@
+ 
+ 
+ #include <libhashkit/common.h>
++#include <limits.h>
+ 
+-#if __WORDSIZE == 64 && defined(HAVE_FNV64_HASH)
++#if (LONG_BITS == 64) && defined(HAVE_FNV64_HASH)
+ 
+ /* FNV hash'es lifted from Dustin Sallings work */
+ static uint64_t FNV_64_INIT= 0xcbf29ce484222325;
+diff --git a/libhashkit/has.cc b/libhashkit/has.cc
+index 843e32e..4153e5e 100644
+--- a/libhashkit/has.cc
++++ b/libhashkit/has.cc
+@@ -37,6 +37,7 @@
+ 
+ 
+ #include <libhashkit/common.h>
++#include <limits.h>
+ 
+ bool libhashkit_has_algorithm(const hashkit_hash_algorithm_t algo)
+ {
+@@ -44,7 +45,7 @@ bool libhashkit_has_algorithm(const hashkit_hash_algorithm_t algo)
+   {
+   case HASHKIT_HASH_FNV1_64:
+   case HASHKIT_HASH_FNV1A_64:
+-#if __WORDSIZE == 64 && defined(HAVE_FNV64_HASH)
++#if (LONG_BITS == 64) && defined(HAVE_FNV64_HASH)
+     return true;
+ #else
+     return false;
+diff --git a/libtest/cmdline.cc b/libtest/cmdline.cc
+index 29a22de..161c646 100644
+--- a/libtest/cmdline.cc
++++ b/libtest/cmdline.cc
+@@ -61,7 +61,7 @@ using namespace libtest;
+ #include <algorithm>
+ #include <stdexcept>
+ 
+-#ifndef __USE_GNU
++#ifndef _GNU_SOURCE
+ static char **environ= NULL;
+ #endif
+ 
+@@ -201,7 +201,7 @@ Application::error_t Application::run(const char *args[])
+ 
+   fatal_assert(posix_spawnattr_setsigmask(&spawnattr, &mask) == 0);
+ 
+-#if defined(POSIX_SPAWN_USEVFORK) || defined(__linux__)
++#if defined(POSIX_SPAWN_USEVFORK) || defined(__GLIBC__)
+   // Use USEVFORK on linux
+   flags |= POSIX_SPAWN_USEVFORK;
+ #endif
diff --git a/nixpkgs/pkgs/development/libraries/libmesode/default.nix b/nixpkgs/pkgs/development/libraries/libmesode/default.nix
new file mode 100644
index 000000000000..128975246a8a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmesode/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, libtool
+, openssl
+, expat
+, pkg-config
+, check
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libmesode";
+  version = "0.10.1";
+
+  src = fetchFromGitHub {
+    owner = "profanity-im";
+    repo = "libmesode";
+    rev = version;
+    sha256 = "1bxnkhrypgv41qyy1n545kcggmlw1hvxnhwihijhhcf2pxd2s654";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ openssl expat libtool check ];
+
+  dontDisableStatic = true;
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Fork of libstrophe (https://github.com/strophe/libstrophe) for use with Profanity XMPP Client";
+    longDescription = ''
+      Reasons for forking:
+
+      - Remove Windows support
+      - Support only one XML Parser implementation (expat)
+      - Support only one SSL implementation (OpenSSL)
+
+      This simplifies maintenance of the library when used in Profanity.
+      Whilst Profanity will run against libstrophe, libmesode provides extra
+      TLS functionality such as manual SSL certificate verification.
+    '';
+    homepage = "https://github.com/profanity-im/libmesode/";
+    license = with licenses; [ gpl3Only mit];
+    platforms = platforms.unix;
+    broken = stdenv.isDarwin;
+    maintainers = with maintainers; [ devhell ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmhash/autotools-define-conflict-debian-fix.patch b/nixpkgs/pkgs/development/libraries/libmhash/autotools-define-conflict-debian-fix.patch
new file mode 100644
index 000000000000..1e3a5d680df6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmhash/autotools-define-conflict-debian-fix.patch
@@ -0,0 +1,78 @@
+Patch fixing #DEFINE redefinitions for generic PACKAGE_* attributes which
+cause collisions when using libmhash in another package also using autotools.
+
+Debian Bug report #473204
+
+diff -x configure -x config.guess -x config.sub -x 'Makefile.*' -Nru
+mhash-0.9.9.orig/configure.in mhash-0.9.9/configure.in
+--- mhash-0.9.9.orig/configure.in       2007-04-04 19:22:28.000000000 -0700
++++ mhash-0.9.9/configure.in    2008-03-29 00:21:24.000000000 -0800
+@@ -6,6 +6,7 @@
+ AM_INIT_AUTOMAKE
+
+ AC_DEFINE([MHASH_VERSION], PROGRAM_VERSION, "MHash Version")
++AC_CONFIG_HEADER([include/mutils/config.h])
+ AC_CONFIG_HEADER([include/mutils/mhash_config.h])
+
+
+diff -x configure -x config.guess -x config.sub -x 'Makefile.*' -Nru
+mhash-0.9.9.orig/include/mutils/config.h.in
+mhash-0.9.9/include/mutils/config.h.in
+--- mhash-0.9.9.orig/include/mutils/config.h.in 1969-12-31 16:00:00.000000000
+-0800
++++ mhash-0.9.9/include/mutils/config.h.in      2008-03-29 00:48:22.000000000
+-0800
+@@ -0,0 +1,22 @@
++/* Name of package */
++#undef PACKAGE
++
++/* Define to the address where bug reports for this package should be sent. */
++#undef PACKAGE_BUGREPORT
++
++/* Define to the full name of this package. */
++#undef PACKAGE_NAME
++
++/* Define to the full name and version of this package. */
++#undef PACKAGE_STRING
++
++/* Define to the one symbol short name of this package. */
++#undef PACKAGE_TARNAME
++
++/* Define to the version of this package. */
++#undef PACKAGE_VERSION
++
++/* Version number of package */
++#undef VERSION
++
++
+diff -x configure -x config.guess -x config.sub -x 'Makefile.*' -Nru
+mhash-0.9.9.orig/include/mutils/mhash_config.h.in
+mhash-0.9.9/include/mutils/mhash_config.h.in
+--- mhash-0.9.9.orig/include/mutils/mhash_config.h.in   2008-03-29
+00:23:29.000000000 -0800
++++ mhash-0.9.9/include/mutils/mhash_config.h.in        2008-03-29
+00:06:41.000000000 -0800
+@@ -181,24 +181,6 @@
+ /* Define to 1 if your C compiler doesn't accept -c and -o together. */
+ #undef NO_MINUS_C_MINUS_O
+
+-/* Name of package */
+-#undef PACKAGE
+-
+-/* Define to the address where bug reports for this package should be sent. */
+-#undef PACKAGE_BUGREPORT
+-
+-/* Define to the full name of this package. */
+-#undef PACKAGE_NAME
+-
+-/* Define to the full name and version of this package. */
+-#undef PACKAGE_STRING
+-
+-/* Define to the one symbol short name of this package. */
+-#undef PACKAGE_TARNAME
+-
+-/* Define to the version of this package. */
+-#undef PACKAGE_VERSION
+-
+ /* Define to 1 if the C compiler supports function prototypes. */
+ #undef PROTOTYPES
diff --git a/nixpkgs/pkgs/development/libraries/libmhash/default.nix b/nixpkgs/pkgs/development/libraries/libmhash/default.nix
new file mode 100644
index 000000000000..f569ce7fac75
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmhash/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "mhash";
+  version = "0.9.9.9";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.bz2";
+    sha256 = "1w7yiljan8gf1ibiypi6hm3r363imm3sxl1j8hapjdq3m591qljn";
+  };
+
+  dontDisableStatic = true;
+
+  patches = [ ./autotools-define-conflict-debian-fix.patch ];
+
+  meta = {
+    description = "Hash algorithms library";
+    longDescription = ''
+      Libmhash is a library that provides a uniform interface to several hash
+      algorithms. It supports the basics for message authentication by
+      following rfc2104 (HMAC). It also includes some key generation algorithms
+      which are based on hash algorithms.
+    '';
+    homepage = "http://mhash.sourceforge.net";
+    license = "LGPL";
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmicrodns/default.nix b/nixpkgs/pkgs/development/libraries/libmicrodns/default.nix
new file mode 100644
index 000000000000..c9dd899a2b00
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmicrodns/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv
+, fetchFromGitHub
+, meson
+, ninja
+, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  version = "0.2.0";
+  pname = "libmicrodns";
+
+  src = fetchFromGitHub {
+    owner = "videolabs";
+    repo = pname;
+    rev = version;
+    sha256 = "05vgka45c1frnv4q7pbz0bggsn5xaykh4xpklh9yb6d6qj7dbx0b";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+  ];
+
+  meta = with lib; {
+    description = "Minimal mDNS resolver library, used by VLC";
+    homepage = "https://github.com/videolabs/libmicrodns";
+    license = licenses.lgpl21;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.shazow ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmicrohttpd/0.9.70.nix b/nixpkgs/pkgs/development/libraries/libmicrohttpd/0.9.70.nix
new file mode 100644
index 000000000000..c0321e327c52
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmicrohttpd/0.9.70.nix
@@ -0,0 +1,10 @@
+{ callPackage, fetchurl }:
+
+callPackage ./generic.nix ( rec {
+  version = "0.9.70";
+
+  src = fetchurl {
+    url = "mirror://gnu/libmicrohttpd/libmicrohttpd-${version}.tar.gz";
+    sha256 = "01vkjy89b1ylmh22dy5yza2r414nfwcfixxh3v29nvzrjv9s7l4h";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/libmicrohttpd/0.9.71.nix b/nixpkgs/pkgs/development/libraries/libmicrohttpd/0.9.71.nix
new file mode 100644
index 000000000000..7e60f8c72726
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmicrohttpd/0.9.71.nix
@@ -0,0 +1,10 @@
+{ callPackage, fetchurl }:
+
+callPackage ./generic.nix ( rec {
+  version = "0.9.71";
+
+  src = fetchurl {
+    url = "mirror://gnu/libmicrohttpd/libmicrohttpd-${version}.tar.gz";
+    sha256 = "10mii4mifmfs3v7kgciqml7f0fj7ljp0sngrx64pnwmgbzl4bx78";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/libmicrohttpd/0.9.72.nix b/nixpkgs/pkgs/development/libraries/libmicrohttpd/0.9.72.nix
new file mode 100644
index 000000000000..4c695218184c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmicrohttpd/0.9.72.nix
@@ -0,0 +1,10 @@
+{ callPackage, fetchurl }:
+
+callPackage ./generic.nix ( rec {
+  version = "0.9.72";
+
+  src = fetchurl {
+    url = "mirror://gnu/libmicrohttpd/libmicrohttpd-${version}.tar.gz";
+    sha256 = "sha256-Cugl+ODX9BIB/USg3xz0VMHLC8UP6dWcJlUiYCZML/g=";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/libmicrohttpd/generic.nix b/nixpkgs/pkgs/development/libraries/libmicrohttpd/generic.nix
new file mode 100644
index 000000000000..336b66ac8323
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmicrohttpd/generic.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, libgcrypt, curl, gnutls, pkg-config, libiconv, libintl, version, src }:
+
+stdenv.mkDerivation rec {
+  pname = "libmicrohttpd";
+  inherit version src;
+
+  outputs = [ "out" "dev" "devdoc" "info" ];
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libgcrypt curl gnutls libiconv libintl ];
+
+  preCheck = ''
+    # Since `localhost' can't be resolved in a chroot, work around it.
+    sed -ie 's/localhost/127.0.0.1/g' src/test*/*.[ch]
+  '';
+
+  # Disabled because the tests can time-out.
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Embeddable HTTP server library";
+
+    longDescription = ''
+      GNU libmicrohttpd is a small C library that is supposed to make
+      it easy to run an HTTP server as part of another application.
+    '';
+
+    license = licenses.lgpl2Plus;
+
+    homepage = "https://www.gnu.org/software/libmicrohttpd/";
+
+    maintainers = with maintainers; [ eelco vrthra fpletz ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmikmod/default.nix b/nixpkgs/pkgs/development/libraries/libmikmod/default.nix
new file mode 100644
index 000000000000..02ccf0c66fb5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmikmod/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, texinfo, alsa-lib, libpulseaudio, CoreAudio }:
+
+let
+  inherit (lib) optional optionalString;
+
+in stdenv.mkDerivation rec {
+  name = "libmikmod-3.3.11.1";
+  src = fetchurl {
+    url = "mirror://sourceforge/mikmod/${name}.tar.gz";
+    sha256 = "06bdnhb0l81srdzg6gn2v2ydhhaazza7rshrcj3q8dpqr3gn97dd";
+  };
+
+  buildInputs = [ texinfo ]
+    ++ optional stdenv.isLinux alsa-lib
+    ++ optional stdenv.isDarwin CoreAudio;
+  propagatedBuildInputs =
+    optional stdenv.isLinux libpulseaudio;
+
+  NIX_LDFLAGS = optionalString stdenv.isLinux "-lasound";
+
+  meta = with lib; {
+    description = "A library for playing tracker music module files";
+    homepage    = "https://mikmod.shlomifish.org/";
+    license     = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ astsmtl lovek323 ];
+    platforms   = platforms.unix;
+
+    longDescription = ''
+      A library for playing tracker music module files supporting many formats,
+      including MOD, S3M, IT and XM.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmilter/darwin.patch b/nixpkgs/pkgs/development/libraries/libmilter/darwin.patch
new file mode 100644
index 000000000000..be46662d6b38
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmilter/darwin.patch
@@ -0,0 +1,28 @@
+Fix build issues on Darwin.
+
+--- a/devtools/OS/Darwin	2014-03-05 01:59:45.000000000 +0100
++++ b/devtools/OS/Darwin	2020-05-18 14:47:57.000000000 +0200
+@@ -8,6 +8,8 @@
+ #    We look a lot more like 4.4BSD than NeXTStep or OpenStep.
+ #
+ define(`confCC', `cc -traditional-cpp -pipe ${Extra_CC_Flags}')
++define(`confCCOPTS_SO', `-fPIC')
++define(`confSOEXT', `dylib')
+ define(`confMAPDEF', `-DNEWDB -DNIS -DMAP_REGEX -DNETINFO -DAUTO_NETINFO_ALIASES -DAUTO_NETINFO_HOSTS')
+ define(`confENVDEF', `-DDARWIN')
+ define(`confLDOPTS', `${Extra_LD_Flags}')
+--- a/sendmail/sendmail.h	2020-05-18 14:51:17.000000000 +0200
++++ b/sendmail/sendmail.h	2020-05-18 14:51:00.000000000 +0200
+@@ -104,7 +104,11 @@
+ # endif /* NETX25 */
+ 
+ # if NAMED_BIND
+-#  include <arpa/nameser.h>
++#  ifdef __APPLE__
++#   include <arpa/nameser_compat.h>
++#  else
++#   include <arpa/nameser.h>
++#  endif
+ #  ifdef NOERROR
+ #   undef NOERROR		/* avoid <sys/streams.h> conflict */
+ #  endif /* NOERROR */
diff --git a/nixpkgs/pkgs/development/libraries/libmilter/default.nix b/nixpkgs/pkgs/development/libraries/libmilter/default.nix
new file mode 100644
index 000000000000..9287b0a0dea7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmilter/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchurl, m4 }:
+
+stdenv.mkDerivation rec {
+  pname = "libmilter";
+  version = "8.15.2";
+
+  src = fetchurl {
+    url = "ftp://ftp.sendmail.org/pub/sendmail/sendmail.${version}.tar.gz";
+    sha256 = "0fdl9ndmspqspdlmghzxlaqk56j3yajk52d7jxcg21b7sxglpy94";
+  };
+
+  buildPhase = ''
+    mkdir -p $out/lib
+    cd libmilter
+    cat > a.m4 <<EOF
+      define(\`confCC', \`$CC')
+      define(\`confAR', \`$AR')
+      define(\`confEBINDIR', \`$out/libexec')
+      define(\`confINCLUDEDIR', \`$out/include')
+      define(\`confLIBDIR', \`$out/lib')
+      define(\`confMANROOT', \`$out/man/cat')
+      define(\`confMANROOTMAN', \`$out/man/man')
+      define(\`confMBINDIR', \`$out/sbin')
+      define(\`confSBINDIR', \`$out/sbin')
+      define(\`confSHAREDLIBDIR', \`$out/lib')
+      define(\`confUBINDIR', \`$out/bin')
+      define(\`confINCGRP', \`root')
+      define(\`confLIBGRP', \`root')
+      APPENDDEF(\`confENVDEF', \`-DNETINET6')
+    EOF
+    export MILTER_SOVER=1
+    sh Build -f ./a.m4
+  '';
+
+  patches = [ ./install.patch ./sharedlib.patch ./glibc-2.30.patch ./darwin.patch ];
+
+  nativeBuildInputs = [ m4 ];
+
+  meta = with lib; {
+    description = "Sendmail Milter mail filtering API library";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ fpletz ];
+    license = licenses.sendmail;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmilter/glibc-2.30.patch b/nixpkgs/pkgs/development/libraries/libmilter/glibc-2.30.patch
new file mode 100644
index 000000000000..e72ec9911e37
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmilter/glibc-2.30.patch
@@ -0,0 +1,44 @@
+diff --git a/libmilter/sm_gethost.c b/libmilter/sm_gethost.c
+index 2423c34..f00468c 100644
+--- a/libmilter/sm_gethost.c
++++ b/libmilter/sm_gethost.c
+@@ -52,16 +52,8 @@ sm_getipnodebyname(name, family, flags, err)
+ 	bool resv6 = true;
+ 	struct hostent *h;
+ 
+-	if (family == AF_INET6)
+-	{
+-		/* From RFC2133, section 6.1 */
+-		resv6 = bitset(RES_USE_INET6, _res.options);
+-		_res.options |= RES_USE_INET6;
+-	}
+ 	SM_SET_H_ERRNO(0);
+-	h = gethostbyname(name);
+-	if (family == AF_INET6 && !resv6)
+-		_res.options &= ~RES_USE_INET6;
++	h = gethostbyname2(name, family);
+ 
+ 	/* the function is supposed to return only the requested family */
+ 	if (h != NULL && h->h_addrtype != family)
+diff --git a/sendmail/conf.c b/sendmail/conf.c
+index c73334e..500dafb 100644
+--- a/sendmail/conf.c
++++ b/sendmail/conf.c
+@@ -4243,16 +4243,8 @@ sm_getipnodebyname(name, family, flags, err)
+ # else /* HAS_GETHOSTBYNAME2 */
+ 	bool resv6 = true;
+ 
+-	if (family == AF_INET6)
+-	{
+-		/* From RFC2133, section 6.1 */
+-		resv6 = bitset(RES_USE_INET6, _res.options);
+-		_res.options |= RES_USE_INET6;
+-	}
+ 	SM_SET_H_ERRNO(0);
+-	h = gethostbyname(name);
+-	if (!resv6)
+-		_res.options &= ~RES_USE_INET6;
++	h = gethostbyname2(name, family);
+ 
+ 	/* the function is supposed to return only the requested family */
+ 	if (h != NULL && h->h_addrtype != family)
diff --git a/nixpkgs/pkgs/development/libraries/libmilter/install.patch b/nixpkgs/pkgs/development/libraries/libmilter/install.patch
new file mode 100644
index 000000000000..f6d3574ca4c1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmilter/install.patch
@@ -0,0 +1,42 @@
+diff -rc sendmail-8.14.4/devtools/M4/UNIX/library.m4 sendmail-8.14.4-new/devtools/M4/UNIX/library.m4
+*** sendmail-8.14.4/devtools/M4/UNIX/library.m4	Wed Sep  6 00:56:53 2006
+--- sendmail-8.14.4-new/devtools/M4/UNIX/library.m4	Tue Feb  9 11:25:13 2010
+***************
+*** 28,34 ****
+  
+  install-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT.a
+  ifdef(`bldINSTALLABLE', `	ifdef(`confMKDIR', `if [ ! -d ${DESTDIR}${bldINSTALL_DIR`'LIBDIR} ]; then confMKDIR -p ${DESTDIR}${bldINSTALL_DIR`'LIBDIR}; else :; fi ')
+! 	${INSTALL} -c -o ${LIBOWN} -g ${LIBGRP} -m ${LIBMODE} bldCURRENT_PRODUCT.a ${DESTDIR}${LIBDIR}')
+  
+  bldCURRENT_PRODUCT-clean:
+  	rm -f ${OBJS} bldCURRENT_PRODUCT.a ${MANPAGES}
+--- 28,34 ----
+  
+  install-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT.a
+  ifdef(`bldINSTALLABLE', `	ifdef(`confMKDIR', `if [ ! -d ${DESTDIR}${bldINSTALL_DIR`'LIBDIR} ]; then confMKDIR -p ${DESTDIR}${bldINSTALL_DIR`'LIBDIR}; else :; fi ')
+! 	${INSTALL} -c bldCURRENT_PRODUCT.a ${DESTDIR}${LIBDIR}')
+  
+  bldCURRENT_PRODUCT-clean:
+  	rm -f ${OBJS} bldCURRENT_PRODUCT.a ${MANPAGES}
+diff -rc sendmail-8.14.4/libmilter/Makefile.m4 sendmail-8.14.4-new/libmilter/Makefile.m4
+*** sendmail-8.14.4/libmilter/Makefile.m4	Tue Nov 24 22:59:33 2009
+--- sendmail-8.14.4-new/libmilter/Makefile.m4	Tue Feb  9 10:47:19 2010
+***************
+*** 33,40 ****
+  MFDEF=	${SRCDIR}/inc`'lude/libmilter/mfdef.h
+  install-mfapi: ${MFAPI}
+  	if [ ! -d ${DESTDIR}${INCLUDEDIR}/libmilter ]; then mkdir -p ${DESTDIR}${INCLUDEDIR}/libmilter; else :; fi
+! 	${INSTALL} -c -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} ${MFAPI} ${DESTDIR}${INCLUDEDIR}/libmilter/mfapi.h
+! 	${INSTALL} -c -o ${INCOWN} -g ${INCGRP} -m ${INCMODE} ${MFDEF} ${DESTDIR}${INCLUDEDIR}/libmilter/mfdef.h
+  divert(0)
+  
+  bldFINISH
+--- 33,40 ----
+  MFDEF=	${SRCDIR}/inc`'lude/libmilter/mfdef.h
+  install-mfapi: ${MFAPI}
+  	if [ ! -d ${DESTDIR}${INCLUDEDIR}/libmilter ]; then mkdir -p ${DESTDIR}${INCLUDEDIR}/libmilter; else :; fi
+! 	${INSTALL} -c ${MFAPI} ${DESTDIR}${INCLUDEDIR}/libmilter/mfapi.h
+! 	${INSTALL} -c ${MFDEF} ${DESTDIR}${INCLUDEDIR}/libmilter/mfdef.h
+  divert(0)
+  
+  bldFINISH
diff --git a/nixpkgs/pkgs/development/libraries/libmilter/sharedlib.patch b/nixpkgs/pkgs/development/libraries/libmilter/sharedlib.patch
new file mode 100644
index 000000000000..1e256c59ec3e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmilter/sharedlib.patch
@@ -0,0 +1,56 @@
+diff -Nru sendmail-8.14.3.orig/devtools/M4/UNIX/milterlibrary.m4 sendmail-8.14.3/devtools/M4/UNIX/milterlibrary.m4
+--- sendmail-8.14.3.orig/devtools/M4/UNIX/milterlibrary.m4	1970-01-01 01:00:00.000000000 +0100
++++ sendmail-8.14.3/devtools/M4/UNIX/milterlibrary.m4	2009-08-22 21:51:10.000000000 +0200
+@@ -0,0 +1,39 @@
++divert(-1)
++#
++# Copyright (c) 1999-2001 Sendmail, Inc. and its suppliers.
++#	All rights reserved.
++#
++# By using this file, you agree to the terms and conditions set
++# forth in the LICENSE file which can be found at the top level of
++# the sendmail distribution.
++#
++#
++#  Definitions for Makefile construction for sendmail
++#
++divert(0)dnl
++include(confBUILDTOOLSDIR`/M4/'bldM4_TYPE_DIR`/links.m4')dnl
++define(`confSOEXT', ifdef(`confSOEXT', `confSOEXT', `so'))dnl
++bldLIST_PUSH_ITEM(`bldC_PRODUCTS', bldCURRENT_PRODUCT)dnl
++bldPUSH_TARGET(bldCURRENT_PRODUCT`.'confSOEXT bldCURRENT_PRODUCT`.a')dnl
++bldPUSH_INSTALL_TARGET(`install-'bldCURRENT_PRODUCT)dnl
++bldPUSH_CLEAN_TARGET(bldCURRENT_PRODUCT`-clean')dnl
++
++include(confBUILDTOOLSDIR`/M4/'bldM4_TYPE_DIR`/defines.m4')
++divert(bldTARGETS_SECTION)
++bldCURRENT_PRODUCT`.'confSOEXT: ${BEFORE} ${bldCURRENT_PRODUCT`OBJS'}
++	${CCLINK} ${LDOPTS_SO} -o bldCURRENT_PRODUCT.confSOEXT ifdef(`confSONAME',`-Wl,confSONAME,bldCURRENT_PRODUCT.confSOEXT.${MILTER_SOVER}') ${bldCURRENT_PRODUCT`OBJS'} -lc ${LIBS}
++bldCURRENT_PRODUCT.a: ${BEFORE} ${bldCURRENT_PRODUCT`OBJS'}
++	${AR} ${AROPTS} bldCURRENT_PRODUCT.a ${bldCURRENT_PRODUCT`OBJS'}
++	${RANLIB} ${RANLIBOPTS} bldCURRENT_PRODUCT.a
++ifdef(`bldLINK_SOURCES', `bldMAKE_SOURCE_LINKS(bldLINK_SOURCES)')
++
++install-`'bldCURRENT_PRODUCT: bldCURRENT_PRODUCT.confSOEXT bldCURRENT_PRODUCT.a
++ifdef(`bldINSTALLABLE', `	ifdef(`confMKDIR', `if [ ! -d "${DESTDIR}${bldINSTALL_DIR`'LIBDIR}" ]; then confMKDIR -p "${DESTDIR}${bldINSTALL_DIR`'LIBDIR}"; else :; fi ')
++	${INSTALL} -c bldCURRENT_PRODUCT.confSOEXT "${DESTDIR}${LIBDIR}/bldCURRENT_PRODUCT.confSOEXT.${MILTER_SOVER}"
++	${LN} ${LNOPTS} bldCURRENT_PRODUCT.confSOEXT.${MILTER_SOVER} "${DESTDIR}${LIBDIR}/bldCURRENT_PRODUCT.confSOEXT"
++	${INSTALL} -c -m 644 bldCURRENT_PRODUCT.a "${DESTDIR}${LIBDIR}"')
++
++bldCURRENT_PRODUCT-clean:
++	rm -f ${OBJS} bldCURRENT_PRODUCT.confSOEXT bldCURRENT_PRODUCT.a ${MANPAGES}
++
++divert(0)
++COPTS+= confCCOPTS_SO
+diff -Nru sendmail-8.14.3.orig/libmilter/Makefile.m4 sendmail-8.14.3/libmilter/Makefile.m4
+--- sendmail-8.14.3.orig/libmilter/Makefile.m4	2008-04-08 07:23:44.000000000 +0200
++++ sendmail-8.14.3/libmilter/Makefile.m4	2009-08-22 21:53:35.000000000 +0200
+@@ -9,7 +9,7 @@
+ SMSRCDIR=ifdef(`confSMSRCDIR', `confSMSRCDIR', `${SRCDIR}/sendmail')
+ PREPENDDEF(`confINCDIRS', `-I${SMSRCDIR} ')
+ 
+-bldPRODUCT_START(`library', `libmilter')
++bldPRODUCT_START(`milterlibrary', `libmilter')
+ define(`bldINSTALLABLE', `true')
+ define(`LIBMILTER_EXTRAS', `errstring.c strl.c')
+ APPENDDEF(`confENVDEF', `-DNOT_SENDMAIL -Dsm_snprintf=snprintf')
diff --git a/nixpkgs/pkgs/development/libraries/libminc/default.nix b/nixpkgs/pkgs/development/libraries/libminc/default.nix
new file mode 100644
index 000000000000..2440082cce9d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libminc/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchFromGitHub, cmake, zlib, netcdf, nifticlib, hdf5 }:
+
+stdenv.mkDerivation rec {
+  pname   = "libminc";
+  version = "unstable-2020-07-17";
+
+  owner = "BIC-MNI";
+
+  src = fetchFromGitHub {
+    inherit owner;
+    repo   = pname;
+    rev    = "ffb5fb234a852ea7e8da8bb2b3b49f67acbe56ca";
+    sha256 = "0yr4ksghpvxh9zg0a4p7hvln3qirsi08plvjp5kxx2qiyj96zsdm";
+  };
+
+  postPatch = ''
+    patchShebangs .
+  '';
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zlib nifticlib ];
+  propagatedBuildInputs = [ netcdf hdf5 ];
+
+  cmakeFlags = [
+    "-DLIBMINC_MINC1_SUPPORT=ON"
+    "-DLIBMINC_BUILD_SHARED_LIBS=ON"
+    "-DLIBMINC_USE_SYSTEM_NIFTI=ON"
+  ];
+
+  doCheck = !stdenv.isDarwin;
+  checkPhase = ''
+    export LD_LIBRARY_PATH="$(pwd)"  # see #22060
+    ctest -j1 -E 'ezminc_rw_test' --output-on-failure
+    # -j1: see https://github.com/BIC-MNI/libminc/issues/110
+    # ezminc_rw_test: can't find libminc_io.so.5.2.0
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/BIC-MNI/libminc";
+    description = "Medical imaging library based on HDF5";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license = licenses.free;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmkv/default.nix b/nixpkgs/pkgs/development/libraries/libmkv/default.nix
new file mode 100644
index 000000000000..584d76e1cf2b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmkv/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, libtool, autoconf, automake }:
+
+stdenv.mkDerivation rec {
+  pname = "libmkv";
+  version = "0.6.5.1";
+
+  src = fetchFromGitHub {
+    owner = "saintdev";
+    repo = pname;
+    rev = "refs/tags/${version}";
+    sha256 = "0pr9q7yprndl8d15ir7i7cznvmf1yqpvnsyivv763n6wryssq6dl";
+  };
+
+  nativeBuildInputs = [ libtool autoconf automake ];
+
+  preConfigure = "sh bootstrap.sh";
+
+  meta = {
+    description = "Abandoned library. Alternative lightweight Matroska muxer written for HandBrake";
+    longDescription = ''
+      Library was meant to be an alternative to the official libmatroska library.
+      It is written in plain C, and intended to be very portable.
+    '';
+    homepage = "https://github.com/saintdev/libmkv";
+    license = lib.licenses.gpl2;
+    maintainers = [ lib.maintainers.wmertens ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmms/default.nix b/nixpkgs/pkgs/development/libraries/libmms/default.nix
new file mode 100644
index 000000000000..83add1d42a5d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmms/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, glib, pkg-config }:
+
+stdenv.mkDerivation rec {
+  name = "libmms-0.6.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libmms/${name}.tar.gz";
+    sha256 = "0kvhxr5hkabj9v7ah2rzkbirndfqdijd9hp8v52c1z6bxddf019w";
+  };
+
+  buildInputs = [ glib ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  meta = with lib; {
+    description = "Library for downloading (streaming) media files using the mmst and mmsh protocols";
+    homepage = "http://libmms.sourceforge.net";
+    platforms = platforms.all;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmng/default.nix b/nixpkgs/pkgs/development/libraries/libmng/default.nix
new file mode 100644
index 000000000000..15a68bdce589
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmng/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, zlib, libpng, libjpeg, lcms2 }:
+
+stdenv.mkDerivation rec {
+  pname = "libmng";
+  version = "2.0.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libmng/${pname}-${version}.tar.xz";
+    sha256 = "1lvxnpds0vcf0lil6ia2036ghqlbl740c4d2sz0q5g6l93fjyija";
+  };
+
+  outputs = [ "out" "dev" "devdoc" ];
+  outputMan= "devdoc";
+
+  propagatedBuildInputs = [ zlib libpng libjpeg lcms2 ];
+
+  meta = with lib; {
+    description = "Reference library for reading, displaying, writing and examining Multiple-Image Network Graphics";
+    homepage = "http://www.libmng.com";
+    license = licenses.zlib;
+    maintainers = with maintainers; [ marcweber ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmnl/default.nix b/nixpkgs/pkgs/development/libraries/libmnl/default.nix
new file mode 100644
index 000000000000..a8ec4c5f3b95
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmnl/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libmnl";
+  version = "1.0.4";
+
+  src = fetchurl {
+    url = "https://netfilter.org/projects/libmnl/files/${pname}-${version}.tar.bz2";
+    sha256 = "108zampspaalv44zn0ar9h386dlfixpd149bnxa5hsi8kxlqj7qp";
+  };
+
+  meta = {
+    description = "Minimalistic user-space library oriented to Netlink developers";
+    longDescription = ''
+      libmnl is a minimalistic user-space library oriented to Netlink developers.
+      There are a lot of common tasks in parsing, validating, constructing of both the Netlink
+      header and TLVs that are repetitive and easy to get wrong.
+      This library aims to provide simple helpers that allows you to re-use code and to avoid
+      re-inventing the wheel.
+    '';
+    homepage = "https://netfilter.org/projects/libmnl/index.html";
+    license = lib.licenses.lgpl21Plus;
+
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmodbus/default.nix b/nixpkgs/pkgs/development/libraries/libmodbus/default.nix
new file mode 100644
index 000000000000..b311c4f04181
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmodbus/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "libmodbus-3.1.6";
+
+  src = fetchurl {
+    url = "http://libmodbus.org/releases/${name}.tar.gz";
+    sha256 = "05kwz0n5gn9m33cflzv87lz3zp502yp8fpfzbx70knvfl6agmnfp";
+  };
+
+  configureFlags = [
+    # when cross-compiling we assume that the host system will return a valid
+    # pointer for calls to malloc(0) or realloc(0)
+    # https://www.uclibc.org/FAQ.html#gnu_malloc
+    # https://www.gnu.org/software/autoconf/manual/autoconf.html#index-AC_005fFUNC_005fMALLOC-454
+    # the upstream source should be patched to avoid needing this
+    "ac_cv_func_malloc_0_nonnull=yes"
+    "ac_cv_func_realloc_0_nonnull=yes"
+  ];
+
+  meta = with lib; {
+    description = "Library to send/receive data according to the Modbus protocol";
+    homepage = "https://libmodbus.org/";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmodplug/default.nix b/nixpkgs/pkgs/development/libraries/libmodplug/default.nix
new file mode 100644
index 000000000000..3f4f89c0a25c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmodplug/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, file }:
+
+stdenv.mkDerivation rec {
+  pname = "libmodplug";
+  version = "0.8.9.0";
+
+  preConfigure = ''
+     substituteInPlace configure \
+        --replace ' -mmacosx-version-min=10.5' "" \
+        --replace /usr/bin/file ${file}/bin/file
+  '';
+
+  meta = with lib; {
+    description = "MOD playing library";
+    homepage    = "http://modplug-xmms.sourceforge.net/";
+    license     = licenses.publicDomain;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ raskin ];
+  };
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/modplug-xmms/libmodplug/${version}/${pname}-${version}.tar.gz";
+    sha256 = "1pnri98a603xk47smnxr551svbmgbzcw018mq1k6srbrq6kaaz25";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmodule/default.nix b/nixpkgs/pkgs/development/libraries/libmodule/default.nix
new file mode 100644
index 000000000000..d77d2bcbdcd7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmodule/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub
+, cmake, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "libmodule";
+  version = "5.0.1";
+
+  src = fetchFromGitHub {
+    owner = "FedeDP";
+    repo = "libmodule";
+    rev = version;
+    sha256 = "sha256-wkRiDWO9wUyxkAeqvm99u22Jq4xnQJx6zS7Sb+R8iMg=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  meta = with lib; {
+    description = "C simple and elegant implementation of an actor library";
+    homepage = "https://github.com/FedeDP/libmodule";
+    platforms = platforms.linux;
+    license = licenses.mit;
+    maintainers = with maintainers; [
+      eadwu
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmodulemd/default.nix b/nixpkgs/pkgs/development/libraries/libmodulemd/default.nix
new file mode 100644
index 000000000000..79f590af5ffd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmodulemd/default.nix
@@ -0,0 +1,76 @@
+{ lib, stdenv
+, substituteAll
+, fetchFromGitHub
+, pkg-config
+, meson
+, ninja
+, gobject-introspection
+, python3
+, libyaml
+, rpm
+, file
+, gtk-doc
+, docbook-xsl-nons
+, help2man
+, docbook_xml_dtd_412
+, glib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libmodulemd";
+  version = "2.13.0";
+
+  outputs = [ "bin" "out" "dev" "devdoc" "man" "py" ];
+
+  src = fetchFromGitHub {
+    owner = "fedora-modularity";
+    repo = pname;
+    rev = "${pname}-${version}";
+    sha256 = "sha256-hg/it3pHUnEYsmKcLzQKcZNthHZZwdXBjzTlOS1Losk=";
+  };
+
+  patches = [
+    # Use proper glib devdoc path.
+    (substituteAll {
+      src = ./glib-devdoc.patch;
+      glib_devdoc = glib.devdoc;
+    })
+  ];
+
+  nativeBuildInputs = [
+    pkg-config
+    meson
+    ninja
+    gtk-doc
+    docbook-xsl-nons
+    help2man
+    docbook_xml_dtd_412
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    libyaml
+    rpm
+    file # for libmagic
+    glib
+  ];
+
+  mesonFlags = [
+    "-Ddeveloper_build=false"
+    "-Dgobject_overrides_dir_py3=${placeholder "py"}/${python3.sitePackages}/gi/overrides"
+  ];
+
+  postFixup = ''
+    # Python overrides depend our own typelibs and other packages
+    mkdir -p "$py/nix-support"
+    echo "$out ${python3.pkgs.pygobject3} ${python3.pkgs.six}" > "$py/nix-support/propagated-build-inputs"
+  '';
+
+  meta = with lib; {
+    description = "C Library for manipulating module metadata files";
+    homepage = "https://github.com/fedora-modularity/libmodulemd";
+    license = licenses.mit;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.linux ++ platforms.darwin ;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmodulemd/glib-devdoc.patch b/nixpkgs/pkgs/development/libraries/libmodulemd/glib-devdoc.patch
new file mode 100644
index 000000000000..cde42d8e0b2e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmodulemd/glib-devdoc.patch
@@ -0,0 +1,13 @@
+diff --git a/meson.build b/meson.build
+index a8b02b4..dd31a76 100644
+--- a/meson.build
++++ b/meson.build
+@@ -67,7 +67,7 @@ test = find_program('test')
+ with_docs = get_option('with_docs')
+ if with_docs
+   gtkdoc = dependency('gtk-doc')
+-  glib_docpath = join_paths(glib_prefix, 'share', 'gtk-doc', 'html')
++  glib_docpath = join_paths('@glib_devdoc@', 'share', 'gtk-doc', 'html')
+ 
+   ret = run_command ([test, '-e', join_paths(glib_docpath, 'glib/index.html')])
+   if ret.returncode() != 0
diff --git a/nixpkgs/pkgs/development/libraries/libmongo-client/default.nix b/nixpkgs/pkgs/development/libraries/libmongo-client/default.nix
new file mode 100644
index 000000000000..a6a20141cc62
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmongo-client/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, glib }:
+
+stdenv.mkDerivation rec {
+  pname = "libmongo-client";
+  version = "0.1.8";
+
+  src = fetchFromGitHub {
+    owner = "algernon";
+    repo = "libmongo-client";
+    rev = "${pname}-${version}";
+    sha256 = "1cjx06i3gd9zkyvwm2ysjrf0hkhr7bjg3c27s7n0y31j10igfjp0";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ ];
+  propagatedBuildInputs = [ glib ];
+
+  postPatch = ''
+    # Fix when uses glib in public headers
+    sed -i 's/Requires.private/Requires/g' src/libmongo-client.pc.in
+  '';
+
+  meta = with lib; {
+    homepage = "http://algernon.github.io/libmongo-client/";
+    description = "An alternative C driver for MongoDB";
+    license = licenses.asl20;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmowgli/default.nix b/nixpkgs/pkgs/development/libraries/libmowgli/default.nix
new file mode 100644
index 000000000000..e227c09b2b61
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmowgli/default.nix
@@ -0,0 +1,18 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libmowgli";
+  version = "2.1.3";
+
+  src = fetchurl {
+    url = "https://github.com/atheme/libmowgli-2/archive/v${version}.tar.gz";
+    sha256 = "0xx4vndmwz40pxa5gikl8z8cskpdl9a30i2i5fjncqzlp4pspymp";
+  };
+
+  meta = with lib; {
+    description = "A development framework for C providing high performance and highly flexible algorithms";
+    homepage = "https://github.com/atheme/libmowgli-2";
+    license = licenses.isc;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmp3splt/default.nix b/nixpkgs/pkgs/development/libraries/libmp3splt/default.nix
new file mode 100644
index 000000000000..0e813375b9a2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmp3splt/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, libtool, libmad, libid3tag }:
+
+stdenv.mkDerivation rec {
+  pname = "libmp3splt";
+  version = "0.9.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/mp3splt/${pname}-${version}.tar.gz";
+    sha256 = "1p1mn2hsmj5cp40fnc8g1yfvk72p8pjxi866gjdkgjsqrr7xdvih";
+  };
+
+  outputs = [ "out" "dev" ];
+  nativeBuildInputs = [ libtool ];
+  buildInputs = [ libmad libid3tag ];
+
+  configureFlags = [ "--disable-pcre" ];
+
+  meta = with lib; {
+    homepage    = "https://sourceforge.net/projects/mp3splt/";
+    description = "Utility to split mp3, ogg vorbis and FLAC files without decoding";
+    maintainers = with maintainers; [ bosu ];
+    platforms   = platforms.unix;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmpack/default.nix b/nixpkgs/pkgs/development/libraries/libmpack/default.nix
new file mode 100644
index 000000000000..b62da40499cd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmpack/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, libtool }:
+
+stdenv.mkDerivation rec {
+  pname = "libmpack";
+  version = "1.0.5";
+  src = fetchFromGitHub {
+    owner = "libmpack";
+    repo = "libmpack";
+    rev = version;
+    sha256 = "0rai5djdkjz7bsn025k5489in7r1amagw1pib0z4qns6b52kiar2";
+  };
+
+  nativeBuildInputs = [ libtool ];
+
+  makeFlags = [ "LIBTOOL=libtool" "PREFIX=$(out)" ];
+
+  meta = with lib; {
+    description = "Simple implementation of msgpack in C";
+    homepage = "https://github.com/tarruda/libmpack/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ lovek323 ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmpc/default.nix b/nixpkgs/pkgs/development/libraries/libmpc/default.nix
new file mode 100644
index 000000000000..2dede1f976d2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmpc/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl
+, gmp, mpfr
+}:
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+stdenv.mkDerivation rec {
+  pname = "libmpc";
+  version = "1.2.1"; # to avoid clash with the MPD client
+
+  src = fetchurl {
+    url = "mirror://gnu/mpc/mpc-${version}.tar.gz";
+    sha256 = "0n846hqfqvmsmim7qdlms0qr86f1hck19p12nq3g3z2x74n3sl0p";
+  };
+
+  buildInputs = [ gmp mpfr ];
+
+  doCheck = true; # not cross;
+
+  meta = {
+    description = "Library for multiprecision complex arithmetic with exact rounding";
+
+    longDescription =
+      '' GNU MPC is a C library for the arithmetic of complex numbers with
+         arbitrarily high precision and correct rounding of the result.  It is
+         built upon and follows the same principles as GNU MPFR.
+      '';
+
+    homepage = "http://mpc.multiprecision.org/";
+    license = lib.licenses.lgpl2Plus;
+
+    platforms = lib.platforms.all;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmpcdec/default.nix b/nixpkgs/pkgs/development/libraries/libmpcdec/default.nix
new file mode 100644
index 000000000000..753687221245
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmpcdec/default.nix
@@ -0,0 +1,17 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libmpcdec";
+  version = "1.2.6";
+
+  src = fetchurl {
+    url = "https://files.musepack.net/source/libmpcdec-${version}.tar.bz2";
+    sha256 = "1a0jdyga1zfi4wgkg3905y6inghy3s4xfs5m4x7pal08m0llkmab";
+  };
+
+  meta = {
+    description = "Musepack SV7 decoder library";
+    platforms = lib.platforms.unix;
+    license = lib.licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmpeg2/default.nix b/nixpkgs/pkgs/development/libraries/libmpeg2/default.nix
new file mode 100644
index 000000000000..bf5f25ca43f8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmpeg2/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  version = "0.5.1";
+  pname = "libmpeg2";
+
+  src = fetchurl {
+    url = "http://libmpeg2.sourceforge.net/files/${pname}-${version}.tar.gz";
+    sha256 = "1m3i322n2fwgrvbs1yck7g5md1dbg22bhq5xdqmjpz5m7j4jxqny";
+  };
+
+  # Otherwise clang fails with 'duplicate symbol ___sputc'
+  buildFlags = 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 = lib.licenses.gpl2;
+    maintainers = with lib.maintainers; [ ];
+    platforms = with lib.platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmrss/default.nix b/nixpkgs/pkgs/development/libraries/libmrss/default.nix
new file mode 100644
index 000000000000..43d829b98342
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmrss/default.nix
@@ -0,0 +1,23 @@
+{lib, stdenv, fetchurl, curl, libnxml, pkg-config}:
+
+stdenv.mkDerivation rec {
+  pname = "libmrss";
+  version = "0.19.2";
+
+  src = fetchurl {
+    url = "https://www.autistici.org/bakunin/libmrss/libmrss-${version}.tar.gz";
+    sha256 = "02r1bgj8qlkn63xqfi5yq8y7wrilxcnkycaag8qskhg5ranic507";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  propagatedBuildInputs = [ curl libnxml ];
+
+  meta = {
+    homepage = "http://www.autistici.org/bakunin/libmrss/doc";
+    description = "C library for parsing, writing and creating RSS/ATOM files or streams";
+    license = lib.licenses.lgpl2;
+
+    platforms = lib.platforms.all;
+    maintainers = [ lib.maintainers.viric ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmspack/default.nix b/nixpkgs/pkgs/development/libraries/libmspack/default.nix
new file mode 100644
index 000000000000..a26f0c3f3a48
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmspack/default.nix
@@ -0,0 +1,18 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "libmspack";
+  version = "0.10.1alpha";
+
+  src = fetchurl {
+    url = "https://www.cabextract.org.uk/libmspack/${pname}-${version}.tar.gz";
+    sha256 = "13janaqsvm7aqc4agjgd4819pbgqv50j88bh5kci1z70wvg65j5s";
+  };
+
+  meta = {
+    description = "A de/compression library for various Microsoft formats";
+    homepage = "https://www.cabextract.org.uk/libmspack";
+    license = lib.licenses.lgpl2Only;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmtp/default.nix b/nixpkgs/pkgs/development/libraries/libmtp/default.nix
new file mode 100644
index 000000000000..a49026c35dcd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmtp/default.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, gettext, libtool, pkg-config
+, libusb1
+, libiconv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libmtp";
+  version = "1.1.18";
+
+  src = fetchFromGitHub {
+    owner = "libmtp";
+    repo = "libmtp";
+    rev = "libmtp-${builtins.replaceStrings [ "." ] [ "-" ] version}";
+    sha256 = "0rya6dsb67a7ny2i1jzdicnday42qb8njqw6r902k712k5p7d1r9";
+  };
+
+  outputs = [ "bin" "dev" "out" ];
+
+  nativeBuildInputs = [
+    autoconf
+    automake
+    gettext
+    libtool
+    pkg-config
+  ];
+
+  buildInputs = [
+    libiconv
+  ];
+
+  propagatedBuildInputs = [
+    libusb1
+  ];
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  # tried to install files to /lib/udev, hopefully OK
+  configureFlags = [ "--with-udev=$$bin/lib/udev" ];
+
+  meta = with lib; {
+    homepage = "http://libmtp.sourceforge.net";
+    description = "An implementation of Microsoft's Media Transfer Protocol";
+    longDescription = ''
+      libmtp is an implementation of Microsoft's Media Transfer Protocol (MTP)
+      in the form of a library suitable primarily for POSIX compliant operating
+      systems. We implement MTP Basic, the stuff proposed for standardization.
+      '';
+    platforms = platforms.unix;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmusicbrainz/5.x.nix b/nixpkgs/pkgs/development/libraries/libmusicbrainz/5.x.nix
new file mode 100644
index 000000000000..3e7a2f1a0ba0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmusicbrainz/5.x.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, cmake, neon, libdiscid, libxml2, pkg-config }:
+
+stdenv.mkDerivation rec {
+  version = "5.1.0";
+  pname = "libmusicbrainz";
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ neon libdiscid libxml2 ];
+
+  src = fetchFromGitHub {
+    owner  = "metabrainz";
+    repo   = "libmusicbrainz";
+    sha256 = "0ah9kaf3g3iv1cps2vs1hs33nfbjfx1xscpjgxr1cg28p4ri6jhq";
+    rev    = "release-${version}";
+  };
+
+  dontUseCmakeBuildDir=true;
+
+  meta = with lib; {
+    homepage = "http://musicbrainz.org/doc/libmusicbrainz";
+    description = "MusicBrainz Client Library (5.x version)";
+    longDescription = ''
+      The libmusicbrainz (also known as mb_client or MusicBrainz Client
+      Library) is a development library geared towards developers who wish to
+      add MusicBrainz lookup capabilities to their applications.'';
+    platforms = platforms.all;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmusicbrainz/default.nix b/nixpkgs/pkgs/development/libraries/libmusicbrainz/default.nix
new file mode 100644
index 000000000000..e1ad8305188e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmusicbrainz/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, cmake, neon, libdiscid }:
+
+stdenv.mkDerivation rec {
+  pname = "libmusicbrainz";
+  version = "3.0.3";
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ neon libdiscid ];
+
+  src = fetchurl {
+    url = "ftp://ftp.musicbrainz.org/pub/musicbrainz/${pname}-${version}.tar.gz";
+    sha256 = "1i9qly13bwwmgj68vma766hgvsd1m75236haqsp9zgh5znlmkm3z";
+  };
+
+  meta = with lib; {
+    homepage = "http://musicbrainz.org/doc/libmusicbrainz";
+    description = "MusicBrainz Client Library (3.x version)";
+    longDescription = ''
+      The libmusicbrainz (also known as mb_client or MusicBrainz Client
+      Library) is a development library geared towards developers who wish to
+      add MusicBrainz lookup capabilities to their applications.'';
+    platforms = platforms.all;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmwaw/default.nix b/nixpkgs/pkgs/development/libraries/libmwaw/default.nix
new file mode 100644
index 000000000000..ed479ad53e12
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmwaw/default.nix
@@ -0,0 +1,32 @@
+{lib, stdenv, fetchurl, boost, pkg-config, cppunit, zlib, libwpg, libwpd, librevenge}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="libmwaw";
+    version="0.3.20";
+    name="${baseName}-${version}";
+    hash="sha256-FMOLBiFPJ3zNFFDiLm4yZIlVAY12lYlrxWAWV0jIzSE=";
+    url="mirror://sourceforge/libmwaw/libmwaw/libmwaw-0.3.20/libmwaw-0.3.20.tar.xz";
+    sha256="sha256-FMOLBiFPJ3zNFFDiLm4yZIlVAY12lYlrxWAWV0jIzSE=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    boost cppunit zlib libwpg libwpd librevenge
+  ];
+in
+stdenv.mkDerivation {
+  inherit (s) name version;
+  inherit nativeBuildInputs buildInputs;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+  enableParallelBuilding = true;
+  meta = {
+    inherit (s) version;
+    description = "Import library for some old mac text documents";
+    license = lib.licenses.mpl20 ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmwaw/default.upstream b/nixpkgs/pkgs/development/libraries/libmwaw/default.upstream
new file mode 100644
index 000000000000..bcfb53770e1e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmwaw/default.upstream
@@ -0,0 +1,4 @@
+url https://sourceforge.net/projects/libmwaw/files/libmwaw/
+SF_version_dir libmwaw-
+version_link '[.]tar.xz/download$'
+SF_redirect
diff --git a/nixpkgs/pkgs/development/libraries/libmx/default.nix b/nixpkgs/pkgs/development/libraries/libmx/default.nix
new file mode 100644
index 000000000000..f4256de6981b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmx/default.nix
@@ -0,0 +1,62 @@
+{ lib, stdenv, fetchurl
+, libtool, pkg-config, automake, autoconf, intltool
+, glib, gobject-introspection, gtk2, gtk-doc
+, clutter, clutter-gtk
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libmx";
+  version = "1.4.7";
+
+  src = fetchurl {
+    url = "https://github.com/clutter-project/mx/archive/${version}.tar.gz";
+    sha256 = "8a7514ea33c1dec7251d0141e24a702e7701dc9f00348cbcf1816925b7f74dbc";
+  };
+
+  # remove the following superfluous checks
+  preConfigure = ''
+    substituteInPlace "autogen.sh" \
+      --replace '`which intltoolize`' '"x"' \
+      --replace '`which gtkdocize`' '"x"' \
+      --replace '`which autoreconf`' '"x"'
+  '';
+
+  configureFlags = [ "--enable-introspection"
+                     "--without-startup-notification"
+                     "--without-dbus"
+                     "--without-glade"
+                     "--without-clutter-imcontext"
+                     "--without-clutter-gesture"
+                   ];
+
+  configureScript = "sh autogen.sh";
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    automake autoconf libtool
+    intltool
+    gobject-introspection glib
+    gtk2 gtk-doc clutter clutter-gtk
+  ];
+
+  # patch to resolve GL errors
+  # source : https://github.com/clutter-project/mx/pull/62
+  preBuild = ''
+    sed -i 's/GLushort/gushort/g' mx/mx-deform-texture.c
+    sed -i 's/GLfloat/gfloat/g' mx/mx-texture-frame.c
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.clutter-project.org/";
+    description = "A Clutter-based toolkit";
+    longDescription =
+      ''Mx is a widget toolkit using Clutter that provides a set of standard
+        interface elements, including buttons, progress bars, scroll bars and
+        others. It also implements some standard managers. One other interesting
+        feature is the possibility setting style properties from a CSS format
+        file.'';
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ cstrahan ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmypaint/default.nix b/nixpkgs/pkgs/development/libraries/libmypaint/default.nix
new file mode 100644
index 000000000000..655480f75a2f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmypaint/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv
+, autoconf
+, automake
+, fetchFromGitHub
+, glib
+, intltool
+, json_c
+, libtool
+, pkg-config
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libmypaint";
+  version = "1.6.1";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "mypaint";
+    repo = "libmypaint";
+    rev = "v${version}";
+    sha256 = "1ppgpmnhph9h8ayx9776f79a0bxbdszfw9c6bw7c3ffy2yk40178";
+  };
+
+  nativeBuildInputs = [
+    autoconf
+    automake
+    intltool
+    libtool
+    pkg-config
+    python3
+  ];
+
+  buildInputs = [
+    glib
+  ];
+
+  # for libmypaint.pc
+  propagatedBuildInputs = [
+    json_c
+  ];
+
+  doCheck = true;
+
+  preConfigure = "./autogen.sh";
+
+  meta = with lib; {
+    homepage = "http://mypaint.org/";
+    description = "Library for making brushstrokes which is used by MyPaint and other projects";
+    license = licenses.isc;
+    maintainers = with maintainers; [ goibhniu jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libmysqlconnectorcpp/default.nix b/nixpkgs/pkgs/development/libraries/libmysqlconnectorcpp/default.nix
new file mode 100644
index 000000000000..40d814814caa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmysqlconnectorcpp/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv
+, fetchurl
+, cmake
+, boost
+, openssl
+, mysql80
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libmysqlconnectorcpp";
+  version = "8.0.23";
+
+  src = fetchurl {
+    url = "https://cdn.mysql.com/Downloads/Connector-C++/mysql-connector-c++-${version}-src.tar.gz";
+    sha256 = "sha256-mvBklaaggP7WLacJePHLDGbwWO3V6p7ak0WmS/jsaI8=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  buildInputs = [
+    boost
+    openssl
+    mysql80
+  ];
+
+  cmakeFlags = [
+    # libmysqlclient is shared library
+    "-DMYSQLCLIENT_STATIC_LINKING=false"
+    # still needed for mysql-workbench
+    "-DWITH_JDBC=true"
+  ];
+
+  meta = {
+    homepage = "https://dev.mysql.com/downloads/connector/cpp/";
+    description = "C++ library for connecting to mysql servers";
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnabo/default.nix b/nixpkgs/pkgs/development/libraries/libnabo/default.nix
new file mode 100644
index 000000000000..af5e78c25d66
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnabo/default.nix
@@ -0,0 +1,31 @@
+{lib, stdenv, fetchFromGitHub, cmake, eigen, boost}:
+
+stdenv.mkDerivation rec {
+  version = "1.0.7";
+  pname = "libnabo";
+
+  src = fetchFromGitHub {
+    owner = "ethz-asl";
+    repo = "libnabo";
+    rev = version;
+    sha256 = "17vxlmszzpm95vvfdxnm98d5p297i10fyblblj6kf0ynq8r2mpsh";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ eigen boost ];
+
+  cmakeFlags = [
+    "-DEIGEN_INCLUDE_DIR=${eigen}/include/eigen3"
+  ];
+
+  doCheck = true;
+  checkTarget = "test";
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "A fast K Nearest Neighbor library for low-dimensional spaces";
+    license = licenses.bsd3;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ cryptix ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnatpmp/default.nix b/nixpkgs/pkgs/development/libraries/libnatpmp/default.nix
new file mode 100644
index 000000000000..11b8d66b4a8f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnatpmp/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libnatpmp";
+  version = "20150609";
+
+  src = fetchurl {
+    name = "${pname}-${version}.tar.gz";
+    url = "http://miniupnp.free.fr/files/download.php?file=${pname}-${version}.tar.gz";
+    sha256 = "1c1n8n7mp0amsd6vkz32n8zj3vnsckv308bb7na0dg0r8969rap1";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace "gcc" "${stdenv.cc.targetPrefix}cc" \
+      --replace "ar" "${stdenv.cc.targetPrefix}ar"
+  '';
+
+  makeFlags = [ "INSTALLPREFIX=$(out)" ];
+
+  meta = with lib; {
+    homepage = "http://miniupnp.free.fr/libnatpmp.html";
+    description = "NAT-PMP client";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ orivej ];
+    platforms = platforms.all;
+  };
+}
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..3d1e2b7ac4a3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnats-c/default.nix
@@ -0,0 +1,30 @@
+{ lib, 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;
+  outputs = [ "out" "dev" ];
+
+  meta = with 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/libnatspec/default.nix b/nixpkgs/pkgs/development/libraries/libnatspec/default.nix
new file mode 100644
index 000000000000..9a0b90e16a41
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnatspec/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, autoreconfHook, popt, libiconv }:
+
+stdenv.mkDerivation rec {
+  pname = "libnatspec";
+  version = "0.3.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/natspec/${pname}-${version}.tar.bz2";
+    sha256 = "0wffxjlc8svilwmrcg3crddpfrpv35mzzjgchf8ygqsvwbrbb3b7";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  buildInputs = [ popt ];
+
+  meta = with lib; {
+    homepage = "http://natspec.sourceforge.net/";
+    description = "A library intended to smooth national specificities in using of programs";
+    platforms = platforms.unix;
+    license = licenses.lgpl21;
+  };
+} // lib.optionalAttrs (!stdenv.isLinux) {
+  propagatedBuildInputs = [ libiconv ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnbd/default.nix b/nixpkgs/pkgs/development/libraries/libnbd/default.nix
new file mode 100644
index 000000000000..7781c936b929
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnbd/default.nix
@@ -0,0 +1,62 @@
+{ lib
+, stdenv
+, fetchurl
+, bash-completion
+, pkg-config
+, perl
+, libxml2
+, fuse
+, gnutls
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libnbd";
+  version = "1.9.3";
+
+  src = fetchurl {
+    url = "https://download.libguestfs.org/libnbd/${lib.versions.majorMinor version}-development/${pname}-${version}.tar.gz";
+    hash = "sha256-qF9IFZGj+9Zuw00+9pbgAhBUk+eUIAxhYNJAMWxmWo0=";
+  };
+
+  nativeBuildInputs = [
+    bash-completion
+    pkg-config
+    perl
+  ];
+
+  buildInputs = [
+    fuse
+    gnutls
+    libxml2
+  ];
+
+  installFlags = [ "bashcompdir=$(out)/share/bash-completion/completions" ];
+
+  meta = with lib; {
+    homepage = "https://gitlab.com/nbdkit/libnbd";
+    description = "Network Block Device client library in userspace";
+    longDescription = ''
+      NBD — Network Block Device — is a protocol for accessing Block Devices
+      (hard disks and disk-like things) over a Network.  This is the NBD client
+      library in userspace, a simple library for writing NBD clients.
+
+      The key features are:
+      - Synchronous API for ease of use.
+      - Asynchronous API for writing non-blocking, multithreaded clients. You
+        can mix both APIs freely.
+      - High performance.
+      - Minimal dependencies for the basic library.
+      - Well-documented, stable API.
+      - Bindings in several programming languages.
+      - Shell (nbdsh) for command line and scripting.
+    '';
+    license = with licenses; lgpl21Plus;
+    maintainers = with maintainers; [ AndersonTorres humancalico ];
+    platforms = with platforms; linux;
+  };
+}
+# TODO: NBD URI support apparently is not enabled
+# TODO: package the 1.6-stable version too
+# TODO: git version needs ocaml
+# TODO: bindings for go, ocaml and python
+
diff --git a/nixpkgs/pkgs/development/libraries/libndctl/default.nix b/nixpkgs/pkgs/development/libraries/libndctl/default.nix
new file mode 100644
index 000000000000..6e82191e7558
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libndctl/default.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook
+, asciidoc, pkg-config, xmlto, docbook_xsl, docbook_xml_dtd_45, libxslt
+, json_c, kmod, which, util-linux, udev, keyutils
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libndctl";
+  version = "71.1";
+
+  src = fetchFromGitHub {
+    owner  = "pmem";
+    repo   = "ndctl";
+    rev    = "v${version}";
+    sha256 = "sha256-osux3DiKRh8ftHwyfFI+WSFx20+yJsg1nVx5nuoKJu4=";
+  };
+
+  outputs = [ "out" "lib" "man" "dev" ];
+
+  nativeBuildInputs =
+    [ autoreconfHook asciidoc pkg-config xmlto docbook_xml_dtd_45 docbook_xsl libxslt
+      which
+    ];
+
+  buildInputs =
+    [ json_c kmod util-linux udev keyutils
+    ];
+
+  configureFlags =
+    [ "--without-bash"
+      "--without-systemd"
+      "--disable-asciidoctor" # depends on ruby 2.7, use asciidoc instead
+    ];
+
+  patchPhase = ''
+    patchShebangs test
+
+    substituteInPlace git-version --replace /bin/bash ${stdenv.shell}
+    substituteInPlace git-version-gen --replace /bin/sh ${stdenv.shell}
+
+    echo "m4_define([GIT_VERSION], [${version}])" > version.m4;
+  '';
+
+  meta = with lib; {
+    description = "Tools for managing the Linux Non-Volatile Memory Device sub-system";
+    homepage    = "https://github.com/pmem/ndctl";
+    license     = licenses.lgpl21;
+    maintainers = with maintainers; [ thoughtpolice ];
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libndp/default.nix b/nixpkgs/pkgs/development/libraries/libndp/default.nix
new file mode 100644
index 000000000000..42f6ecc64892
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libndp/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "libndp-1.8";
+
+  src = fetchurl {
+    url = "http://libndp.org/files/${name}.tar.gz";
+    sha256 = "sha256-iP+2buLrUn8Ub1wC9cy8OLqX0rDVfrRr+6SIghqwwCs=";
+  };
+
+  meta = with lib; {
+    homepage = "http://libndp.org/";
+    description = "Library for Neighbor Discovery Protocol";
+    platforms = platforms.linux;
+    maintainers = [ ];
+    license = licenses.lgpl21;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/libndtypes/default.nix b/nixpkgs/pkgs/development/libraries/libndtypes/default.nix
new file mode 100644
index 000000000000..1f0709af6cfc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libndtypes/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv
+, fetchFromGitHub
+}:
+
+stdenv.mkDerivation {
+  pname = "libndtypes";
+  version = "unstable-2019-08-01";
+
+  src = fetchFromGitHub {
+    owner = "xnd-project";
+    repo = "ndtypes";
+    rev = "3ce6607c96d8fe67b72cc0c97bf595620cdd274e";
+    sha256 = "18303q0jfar1lmi4krp94plczb455zcgw772f9lb8xa5p0bkhx01";
+  };
+
+  # Override linker with cc (symlink to either gcc or clang)
+  # Library expects to use cc for linking
+  configureFlags = [ "LD=${stdenv.cc.targetPrefix}cc" ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Dynamic types for data description and in-memory computations";
+    homepage = "https://xnd.io/";
+    license = licenses.bsdOriginal;
+    maintainers = [ maintainers.costrouc ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnest2d/default.nix b/nixpkgs/pkgs/development/libraries/libnest2d/default.nix
new file mode 100644
index 000000000000..1e666758f816
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnest2d/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, cmake, clipper, nlopt, boost, python3 }:
+
+stdenv.mkDerivation rec {
+  version = "2020-10-09-unstable";
+  pname = "libnest2d";
+
+  # This revision is waiting to be merged upstream
+  # Once it has been merged, this should be switched to it
+  # Upstream PR: https://github.com/tamasmeszaros/libnest2d/pull/18
+  src = fetchFromGitHub {
+    owner = "Ultimaker";
+    repo = "libnest2d";
+    rev = "31391fd173249ad9b906390058e13b09238fadc8";
+    sha256 = "1hzqi4z55x76rss3xk7hfqhy9hcaq2jaav5jqxa1aqmbvarr2gla";
+  };
+
+  propagatedBuildInputs = [ clipper nlopt boost ];
+  nativeBuildInputs = [ cmake ];
+
+  CLIPPER_PATH = "${clipper.out}";
+  cmakeFlags = [ "-DLIBNEST2D_HEADER_ONLY=OFF" ];
+
+  meta = with lib; {
+    description =
+      "2D irregular bin packaging and nesting library written in modern C++";
+    homepage = "https://github.com/Ultimaker/libnest2d";
+    license = licenses.lgpl3;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnet/default.nix b/nixpkgs/pkgs/development/libraries/libnet/default.nix
new file mode 100644
index 000000000000..cb3375708df1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnet/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libnet";
+  version = "1.2-rc3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libnet-dev/${pname}-${version}.tar.gz";
+    sha256 = "0qsapqa7dzq9f6lb19kzilif0pj82b64fjv5bq086hflb9w81hvj";
+  };
+
+  patches = [ ./fix-includes.patch ];
+
+  meta = with lib; {
+    homepage = "https://github.com/sam-github/libnet";
+    description = "Portable framework for low-level network packet construction";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnet/fix-includes.patch b/nixpkgs/pkgs/development/libraries/libnet/fix-includes.patch
new file mode 100644
index 000000000000..5eb86bc37b79
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnet/fix-includes.patch
@@ -0,0 +1,29 @@
+--- libnet-1.1.6.orig/src/libnet_link_linux.c
++++ libnet-1.1.6/src/libnet_link_linux.c
+@@ -30,26 +30,15 @@
+ #include <sys/time.h>
+ 
+ #include <net/if.h>
+-#if (__GLIBC__)
+ #include <netinet/if_ether.h>
+ #include <net/if_arp.h>
+-#else
+-#include <linux/if_arp.h>
+-#include <linux/if_ether.h>
+-#endif
+ 
+ #if (HAVE_PACKET_SOCKET)
+ #ifndef SOL_PACKET
+ #define SOL_PACKET 263
+ #endif  /* SOL_PACKET */
+-#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
+ #include <netpacket/packet.h>
+ #include <net/ethernet.h>     /* the L2 protocols */
+-#else
+-#include <asm/types.h>
+-#include <linux/if_packet.h>
+-#include <linux/if_ether.h>   /* The L2 protocols */
+-#endif
+ #endif  /* HAVE_PACKET_SOCKET */
+ 
+ #include "../include/libnet.h"
diff --git a/nixpkgs/pkgs/development/libraries/libnetfilter_acct/default.nix b/nixpkgs/pkgs/development/libraries/libnetfilter_acct/default.nix
new file mode 100644
index 000000000000..6c52d7f7b560
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnetfilter_acct/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, pkg-config, libmnl }:
+
+stdenv.mkDerivation rec {
+  version = "1.0.3";
+  pname = "libnetfilter_acct";
+
+  src = fetchurl {
+    url = "https://www.netfilter.org/projects/libnetfilter_acct/files/${pname}-${version}.tar.bz2";
+    sha256 = "06lsjndgfjsgfjr43px2n2wk3nr7whz6r405mks3887y7vpwwl22";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libmnl ];
+
+  meta = with lib; {
+    homepage = "https://www.netfilter.org/projects/libnetfilter_acct/";
+    description = "Userspace library providing interface to extended accounting infrastructure";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnetfilter_conntrack/default.nix b/nixpkgs/pkgs/development/libraries/libnetfilter_conntrack/default.nix
new file mode 100644
index 000000000000..a2097bb17e25
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnetfilter_conntrack/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, pkg-config, libnfnetlink, libmnl }:
+
+stdenv.mkDerivation rec {
+  pname = "libnetfilter_conntrack";
+  version = "1.0.8";
+
+  src = fetchurl {
+    url = "https://netfilter.org/projects/libnetfilter_conntrack/files/${pname}-${version}.tar.bz2";
+    sha256 = "1ky1mqgnplw2h9jf0kn0a69d94jkydhbiipng9l2hdcj13h3pl8c";
+  };
+
+  buildInputs = [ libmnl ];
+  propagatedBuildInputs = [ libnfnetlink ];
+  nativeBuildInputs = [ pkg-config ];
+
+  meta = with lib; {
+    description = "Userspace library providing an API to the in-kernel connection tracking state table";
+    longDescription = ''
+      libnetfilter_conntrack is a userspace library providing a programming interface (API) to the
+      in-kernel connection tracking state table. The library libnetfilter_conntrack has been
+      previously known as libnfnetlink_conntrack and libctnetlink. This library is currently used
+      by conntrack-tools among many other applications
+    '';
+    homepage = "https://netfilter.org/projects/libnetfilter_conntrack/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnetfilter_cthelper/default.nix b/nixpkgs/pkgs/development/libraries/libnetfilter_cthelper/default.nix
new file mode 100644
index 000000000000..294f776192d7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnetfilter_cthelper/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, pkg-config, libmnl }:
+
+stdenv.mkDerivation rec {
+  pname = "libnetfilter_cthelper";
+  version = "1.0.0";
+
+  src = fetchurl {
+    url = "https://netfilter.org/projects/libnetfilter_cthelper/files/${pname}-${version}.tar.bz2";
+    sha256 = "07618e71c4d9a6b6b3dc1986540486ee310a9838ba754926c7d14a17d8fccf3d";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libmnl ];
+
+  meta = {
+    description = "Userspace library that provides the programming interface to the user-space connection tracking helper infrastructure";
+    longDescription = ''
+      libnetfilter_cthelper is the userspace library that provides the programming interface
+      to the user-space helper infrastructure available since Linux kernel 3.6. With this
+      library, you register, configure, enable and disable user-space helpers. This library
+      is used by conntrack-tools.
+    '';
+    homepage = "https://www.netfilter.org/projects/libnetfilter_cthelper/";
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnetfilter_cttimeout/default.nix b/nixpkgs/pkgs/development/libraries/libnetfilter_cttimeout/default.nix
new file mode 100644
index 000000000000..a8d0c2680dfe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnetfilter_cttimeout/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, pkg-config, libmnl }:
+
+stdenv.mkDerivation rec {
+  pname = "libnetfilter_cttimeout";
+  version = "1.0.0";
+
+  src = fetchurl {
+    url = "https://netfilter.org/projects/libnetfilter_cttimeout/files/${pname}-${version}.tar.bz2";
+    sha256 = "aeab12754f557cba3ce2950a2029963d817490df7edb49880008b34d7ff8feba";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libmnl ];
+
+  meta = {
+    description = "Userspace library that provides the programming interface to the connection tracking timeout infrastructure";
+    longDescription = ''
+      libnetfilter_cttimeout is the userspace library that provides the programming
+      interface to the fine-grain connection tracking timeout infrastructure.
+      With this library, you can create, update and delete timeout policies that can
+      be attached to traffic flows. This library is used by conntrack-tools.
+    '';
+    homepage = "https://netfilter.org/projects/libnetfilter_cttimeout/";
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnetfilter_log/default.nix b/nixpkgs/pkgs/development/libraries/libnetfilter_log/default.nix
new file mode 100644
index 000000000000..4ac20cf29cb4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnetfilter_log/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, pkg-config, libnfnetlink, libmnl }:
+
+stdenv.mkDerivation rec {
+  pname = "libnetfilter_log";
+  version = "1.0.1";
+
+  src = fetchurl {
+    url = "https://netfilter.org/projects/libnetfilter_log/files/${pname}-${version}.tar.bz2";
+    sha256 = "089vjcfxl5qjqpswrbgklf4wflh44irmw6sk2k0kmfixfmszxq3l";
+  };
+
+  buildInputs = [ libmnl ];
+  propagatedBuildInputs = [ libnfnetlink ];
+  nativeBuildInputs = [ pkg-config ];
+
+  meta = with lib; {
+    description = "Userspace library providing interface to packets that have been logged by the kernel packet filter";
+    longDescription = ''
+      libnetfilter_log is a userspace library providing interface to packets
+      that have been logged by the kernel packet filter. It is is part of a
+      system that deprecates the old syslog/dmesg based packet logging. This
+      library has been previously known as libnfnetlink_log.
+    '';
+    homepage = "https://netfilter.org/projects/libnetfilter_log/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ orivej ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnetfilter_queue/default.nix b/nixpkgs/pkgs/development/libraries/libnetfilter_queue/default.nix
new file mode 100644
index 000000000000..d1783289965e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnetfilter_queue/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, pkg-config, libmnl, libnfnetlink }:
+
+stdenv.mkDerivation rec {
+  version = "1.0.5";
+  pname = "libnetfilter_queue";
+
+  src = fetchurl {
+    url = "https://www.netfilter.org/projects/libnetfilter_queue/files/${pname}-${version}.tar.bz2";
+    sha256 = "1xdra6i4p8jkv943ygjw646qx8df27f7p5852kc06vjx608krzzr";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libmnl libnfnetlink ];
+
+  meta = with lib; {
+    homepage = "https://www.netfilter.org/projects/libnetfilter_queue/";
+    description = "Userspace API to packets queued by the kernel packet filter";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnfc/default.nix b/nixpkgs/pkgs/development/libraries/libnfc/default.nix
new file mode 100644
index 000000000000..b4daab97388e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnfc/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, libusb-compat-0_1, readline }:
+
+stdenv.mkDerivation {
+  pname = "libnfc";
+  version = "1.7.1";
+
+  src = fetchurl {
+    url = "http://dl.bintray.com/nfc-tools/sources/libnfc-1.7.1.tar.bz2";
+    sha256 = "0wj0iwwcpmpalyk61aa7yc6i4p9hgdajkrgnlswgk0vnwbc78pll";
+  };
+
+  buildInputs = [ libusb-compat-0_1 readline ];
+
+  meta = with lib; {
+    description = "Open source library libnfc for Near Field Communication";
+    license = licenses.gpl3;
+    homepage = "https://github.com/nfc-tools/libnfc";
+    maintainers = with maintainers; [offline];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnfnetlink/Use-stdlib-uint-instead-of-u_int.patch b/nixpkgs/pkgs/development/libraries/libnfnetlink/Use-stdlib-uint-instead-of-u_int.patch
new file mode 100644
index 000000000000..074bef42b97a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnfnetlink/Use-stdlib-uint-instead-of-u_int.patch
@@ -0,0 +1,499 @@
+From patchwork Fri Apr  3 22:04:46 2015
+Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Transfer-Encoding: 7bit
+Subject: Use stdlib uint* instead of u_int*
+From: Nathan McSween <nwmcsween@gmail.com>
+X-Patchwork-Id: 458131
+X-Patchwork-Delegate: pablo@netfilter.org
+Message-Id: <1428098686-17843-1-git-send-email-nwmcsween@gmail.com>
+To: netfilter-devel@vger.kernel.org
+Cc: Nathan McSween <nwmcsween@gmail.com>
+Date: Fri,  3 Apr 2015 22:04:46 +0000
+
+Signed-off-by: Nathan McSween <nwmcsween@gmail.com>
+---
+ include/libnfnetlink/libnfnetlink.h           | 25 +++++-----
+ include/libnfnetlink/linux_nfnetlink.h        | 11 +++--
+ include/libnfnetlink/linux_nfnetlink_compat.h |  6 ++-
+ src/iftable.c                                 |  9 ++--
+ src/iftable.h                                 |  6 ++-
+ src/libnfnetlink.c                            | 71 ++++++++++++++-------------
+ src/rtnl.c                                    |  5 +-
+ src/rtnl.h                                    |  3 +-
+ 8 files changed, 73 insertions(+), 63 deletions(-)
+
+diff --git a/include/libnfnetlink/libnfnetlink.h b/include/libnfnetlink/libnfnetlink.h
+index 1d8c49d..cd0be3d 100644
+--- a/include/libnfnetlink/libnfnetlink.h
++++ b/include/libnfnetlink/libnfnetlink.h
+@@ -15,6 +15,7 @@
+ #define aligned_u64 unsigned long long __attribute__((aligned(8)))
+ #endif
+ 
++#include <stdint.h>
+ #include <sys/socket.h>	/* for sa_family_t */
+ #include <linux/netlink.h>
+ #include <libnfnetlink/linux_nfnetlink.h>
+@@ -55,7 +56,7 @@ struct nfnlhdr {
+ struct nfnl_callback {
+ 	int (*call)(struct nlmsghdr *nlh, struct nfattr *nfa[], void *data);
+ 	void *data;
+-	u_int16_t attr_count;
++	uint16_t attr_count;
+ };
+ 
+ struct nfnl_handle;
+@@ -69,7 +70,7 @@ extern struct nfnl_handle *nfnl_open(void);
+ extern int nfnl_close(struct nfnl_handle *);
+ 
+ extern struct nfnl_subsys_handle *nfnl_subsys_open(struct nfnl_handle *, 
+-						   u_int8_t, u_int8_t, 
++						   uint8_t, uint8_t,
+ 						   unsigned int);
+ extern void nfnl_subsys_close(struct nfnl_subsys_handle *);
+ 
+@@ -88,8 +89,8 @@ extern int nfnl_sendiov(const struct nfnl_handle *nfnlh,
+ 			const struct iovec *iov, unsigned int num,
+ 			unsigned int flags);
+ extern void nfnl_fill_hdr(struct nfnl_subsys_handle *, struct nlmsghdr *,
+-			  unsigned int, u_int8_t, u_int16_t, u_int16_t,
+-			  u_int16_t);
++			  unsigned int, uint8_t, uint16_t, uint16_t,
++			  uint16_t);
+ extern __attribute__((deprecated)) int
+ nfnl_talk(struct nfnl_handle *, struct nlmsghdr *, pid_t,
+           unsigned, struct nlmsghdr *,
+@@ -103,8 +104,8 @@ nfnl_listen(struct nfnl_handle *,
+ /* receiving */
+ extern ssize_t nfnl_recv(const struct nfnl_handle *h, unsigned char *buf, size_t len);
+ extern int nfnl_callback_register(struct nfnl_subsys_handle *,
+-				  u_int8_t type, struct nfnl_callback *cb);
+-extern int nfnl_callback_unregister(struct nfnl_subsys_handle *, u_int8_t type);
++				  uint8_t type, struct nfnl_callback *cb);
++extern int nfnl_callback_unregister(struct nfnl_subsys_handle *, uint8_t type);
+ extern int nfnl_handle_packet(struct nfnl_handle *, char *buf, int len);
+ 
+ /* parsing */
+@@ -180,12 +181,12 @@ extern int nfnl_query(struct nfnl_handle *h, struct nlmsghdr *nlh);
+ 
+ /* nfnl attribute handling functions */
+ extern int nfnl_addattr_l(struct nlmsghdr *, int, int, const void *, int);
+-extern int nfnl_addattr8(struct nlmsghdr *, int, int, u_int8_t);
+-extern int nfnl_addattr16(struct nlmsghdr *, int, int, u_int16_t);
+-extern int nfnl_addattr32(struct nlmsghdr *, int, int, u_int32_t);
++extern int nfnl_addattr8(struct nlmsghdr *, int, int, uint8_t);
++extern int nfnl_addattr16(struct nlmsghdr *, int, int, uint16_t);
++extern int nfnl_addattr32(struct nlmsghdr *, int, int, uint32_t);
+ extern int nfnl_nfa_addattr_l(struct nfattr *, int, int, const void *, int);
+-extern int nfnl_nfa_addattr16(struct nfattr *, int, int, u_int16_t);
+-extern int nfnl_nfa_addattr32(struct nfattr *, int, int, u_int32_t);
++extern int nfnl_nfa_addattr16(struct nfattr *, int, int, uint16_t);
++extern int nfnl_nfa_addattr32(struct nfattr *, int, int, uint32_t);
+ extern int nfnl_parse_attr(struct nfattr **, int, struct nfattr *, int);
+ #define nfnl_parse_nested(tb, max, nfa) \
+ 	nfnl_parse_attr((tb), (max), NFA_DATA((nfa)), NFA_PAYLOAD((nfa)))
+@@ -197,7 +198,7 @@ extern int nfnl_parse_attr(struct nfattr **, int, struct nfattr *, int);
+ ({	(tail)->nfa_len = (void *) NLMSG_TAIL(nlh) - (void *) tail; })
+ 
+ extern void nfnl_build_nfa_iovec(struct iovec *iov, struct nfattr *nfa, 
+-				 u_int16_t type, u_int32_t len,
++				 uint16_t type, uint32_t len,
+ 				 unsigned char *val);
+ extern unsigned int nfnl_rcvbufsiz(const struct nfnl_handle *h, 
+ 				   unsigned int size);
+diff --git a/include/libnfnetlink/linux_nfnetlink.h b/include/libnfnetlink/linux_nfnetlink.h
+index 76a8550..7b843c6 100644
+--- a/include/libnfnetlink/linux_nfnetlink.h
++++ b/include/libnfnetlink/linux_nfnetlink.h
+@@ -1,5 +1,6 @@
+ #ifndef _NFNETLINK_H
+ #define _NFNETLINK_H
++#include <stdint.h>
+ #include <linux/types.h>
+ #include <libnfnetlink/linux_nfnetlink_compat.h>
+ 
+@@ -25,9 +26,9 @@ enum nfnetlink_groups {
+ /* General form of address family dependent message.
+  */
+ struct nfgenmsg {
+-	u_int8_t  nfgen_family;		/* AF_xxx */
+-	u_int8_t  version;		/* nfnetlink version */
+-	u_int16_t    res_id;		/* resource id */
++	uint8_t  nfgen_family;		/* AF_xxx */
++	uint8_t  version;		/* nfnetlink version */
++	uint16_t    res_id;		/* resource id */
+ };
+ 
+ #define NFNETLINK_V0	0
+@@ -59,7 +60,7 @@ struct nfnl_callback
+ 	int (*call)(struct sock *nl, struct sk_buff *skb, 
+ 		struct nlmsghdr *nlh, struct nlattr *cda[]);
+ 	const struct nla_policy *policy;	/* netlink attribute policy */
+-	const u_int16_t attr_count;		/* number of nlattr's */
++	const uint16_t attr_count;		/* number of nlattr's */
+ };
+ 
+ struct nfnetlink_subsystem
+@@ -76,7 +77,7 @@ extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n);
+ extern int nfnetlink_has_listeners(unsigned int group);
+ extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, 
+ 			  int echo);
+-extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags);
++extern int nfnetlink_unicast(struct sk_buff *skb, uint32_t pid, int flags);
+ 
+ #define MODULE_ALIAS_NFNL_SUBSYS(subsys) \
+ 	MODULE_ALIAS("nfnetlink-subsys-" __stringify(subsys))
+diff --git a/include/libnfnetlink/linux_nfnetlink_compat.h b/include/libnfnetlink/linux_nfnetlink_compat.h
+index e145176..cd094fc 100644
+--- a/include/libnfnetlink/linux_nfnetlink_compat.h
++++ b/include/libnfnetlink/linux_nfnetlink_compat.h
+@@ -3,6 +3,8 @@
+ #ifndef __KERNEL__
+ /* Old nfnetlink macros for userspace */
+ 
++#include <stdint.h>
++
+ /* nfnetlink groups: Up to 32 maximum */
+ #define NF_NETLINK_CONNTRACK_NEW 		0x00000001
+ #define NF_NETLINK_CONNTRACK_UPDATE		0x00000002
+@@ -20,8 +22,8 @@
+ 
+ struct nfattr
+ {
+-	u_int16_t nfa_len;
+-	u_int16_t nfa_type;	/* we use 15 bits for the type, and the highest
++	uint16_t nfa_len;
++	uint16_t nfa_type;	/* we use 15 bits for the type, and the highest
+ 				 * bit to indicate whether the payload is nested */
+ };
+ 
+diff --git a/src/iftable.c b/src/iftable.c
+index 5976ed8..3411c4c 100644
+--- a/src/iftable.c
++++ b/src/iftable.c
+@@ -9,6 +9,7 @@
+ /* IFINDEX handling */
+ 
+ #include <unistd.h>
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <string.h>
+@@ -27,10 +28,10 @@
+ struct ifindex_node {
+ 	struct list_head head;
+ 
+-	u_int32_t	index;
+-	u_int32_t	type;
+-	u_int32_t	alen;
+-	u_int32_t	flags;
++	uint32_t	index;
++	uint32_t	type;
++	uint32_t	alen;
++	uint32_t	flags;
+ 	char		addr[8];
+ 	char		name[16];
+ };
+diff --git a/src/iftable.h b/src/iftable.h
+index 8df7f24..0cc5335 100644
+--- a/src/iftable.h
++++ b/src/iftable.h
+@@ -1,8 +1,10 @@
+ #ifndef _IFTABLE_H
+ #define _IFTABLE_H
+ 
+-int iftable_delete(u_int32_t dst, u_int32_t mask, u_int32_t gw, u_int32_t oif);
+-int iftable_insert(u_int32_t dst, u_int32_t mask, u_int32_t gw, u_int32_t oif);
++#include <stdint.h>
++
++int iftable_delete(uint32_t dst, uint32_t mask, uint32_t gw, uint32_t oif);
++int iftable_insert(uint32_t dst, uint32_t mask, uint32_t gw, uint32_t oif);
+ 
+ int iftable_init(void);
+ void iftable_fini(void);
+diff --git a/src/libnfnetlink.c b/src/libnfnetlink.c
+index 398b7d7..b8958dc 100644
+--- a/src/libnfnetlink.c
++++ b/src/libnfnetlink.c
+@@ -36,6 +36,7 @@
+  * 	minor cleanups
+  */
+ 
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <stdio.h>
+ #include <unistd.h>
+@@ -72,9 +73,9 @@
+ 
+ struct nfnl_subsys_handle {
+ 	struct nfnl_handle 	*nfnlh;
+-	u_int32_t		subscriptions;
+-	u_int8_t		subsys_id;
+-	u_int8_t		cb_count;
++	uint32_t		subscriptions;
++	uint8_t		subsys_id;
++	uint8_t		cb_count;
+ 	struct nfnl_callback 	*cb;	/* array of callbacks */
+ };
+ 
+@@ -86,11 +87,11 @@ struct nfnl_handle {
+ 	int			fd;
+ 	struct sockaddr_nl	local;
+ 	struct sockaddr_nl	peer;
+-	u_int32_t		subscriptions;
+-	u_int32_t		seq;
+-	u_int32_t		dump;
+-	u_int32_t		rcv_buffer_size;	/* for nfnl_catch */
+-	u_int32_t		flags;
++	uint32_t		subscriptions;
++	uint32_t		seq;
++	uint32_t		dump;
++	uint32_t		rcv_buffer_size;	/* for nfnl_catch */
++	uint32_t		flags;
+ 	struct nlmsghdr 	*last_nlhdr;
+ 	struct nfnl_subsys_handle subsys[NFNL_MAX_SUBSYS+1];
+ };
+@@ -145,7 +146,7 @@ unsigned int nfnl_portid(const struct nfnl_handle *h)
+ static int recalc_rebind_subscriptions(struct nfnl_handle *nfnlh)
+ {
+ 	int i, err;
+-	u_int32_t new_subscriptions = nfnlh->subscriptions;
++	uint32_t new_subscriptions = nfnlh->subscriptions;
+ 
+ 	for (i = 0; i < NFNL_MAX_SUBSYS; i++)
+ 		new_subscriptions |= nfnlh->subsys[i].subscriptions;
+@@ -273,8 +274,8 @@ void nfnl_set_rcv_buffer_size(struct nfnl_handle *h, unsigned int size)
+  * a valid address that points to a nfnl_subsys_handle structure is returned.
+  */
+ struct nfnl_subsys_handle *
+-nfnl_subsys_open(struct nfnl_handle *nfnlh, u_int8_t subsys_id,
+-		 u_int8_t cb_count, u_int32_t subscriptions)
++nfnl_subsys_open(struct nfnl_handle *nfnlh, uint8_t subsys_id,
++		 uint8_t cb_count, uint32_t subscriptions)
+ {
+ 	struct nfnl_subsys_handle *ssh;
+ 
+@@ -435,10 +436,10 @@ int nfnl_sendiov(const struct nfnl_handle *nfnlh, const struct iovec *iov,
+  */
+ void nfnl_fill_hdr(struct nfnl_subsys_handle *ssh,
+ 		    struct nlmsghdr *nlh, unsigned int len, 
+-		    u_int8_t family,
+-		    u_int16_t res_id,
+-		    u_int16_t msg_type,
+-		    u_int16_t msg_flags)
++		    uint8_t family,
++		    uint16_t res_id,
++		    uint16_t msg_type,
++		    uint16_t msg_flags)
+ {
+ 	assert(ssh);
+ 	assert(nlh);
+@@ -849,14 +850,14 @@ int nfnl_nfa_addattr_l(struct nfattr *nfa, int maxlen, int type,
+ }
+ 
+ /**
+- * nfnl_addattr8 - Add u_int8_t attribute to nlmsghdr
++ * nfnl_addattr8 - Add uint8_t attribute to nlmsghdr
+  *
+  * @n: netlink message header to which attribute is to be added
+  * @maxlen: maximum length of netlink message header
+  * @type: type of new attribute
+  * @data: content of new attribute
+  */
+-int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data)
++int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, uint8_t data)
+ {
+ 	assert(n);
+ 	assert(maxlen > 0);
+@@ -866,7 +867,7 @@ int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data)
+ }
+ 
+ /**
+- * nfnl_nfa_addattr16 - Add u_int16_t attribute to struct nfattr 
++ * nfnl_nfa_addattr16 - Add uint16_t attribute to struct nfattr
+  *
+  * @nfa: struct nfattr
+  * @maxlen: maximal length of nfattr buffer
+@@ -875,7 +876,7 @@ int nfnl_addattr8(struct nlmsghdr *n, int maxlen, int type, u_int8_t data)
+  *
+  */
+ int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type, 
+-		       u_int16_t data)
++		       uint16_t data)
+ {
+ 	assert(nfa);
+ 	assert(maxlen > 0);
+@@ -885,7 +886,7 @@ int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type,
+ }
+ 
+ /**
+- * nfnl_addattr16 - Add u_int16_t attribute to nlmsghdr
++ * nfnl_addattr16 - Add uint16_t attribute to nlmsghdr
+  *
+  * @n: netlink message header to which attribute is to be added
+  * @maxlen: maximum length of netlink message header
+@@ -894,7 +895,7 @@ int nfnl_nfa_addattr16(struct nfattr *nfa, int maxlen, int type,
+  *
+  */
+ int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type,
+-		   u_int16_t data)
++		   uint16_t data)
+ {
+ 	assert(n);
+ 	assert(maxlen > 0);
+@@ -904,7 +905,7 @@ int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type,
+ }
+ 
+ /**
+- * nfnl_nfa_addattr32 - Add u_int32_t attribute to struct nfattr 
++ * nfnl_nfa_addattr32 - Add uint32_t attribute to struct nfattr
+  *
+  * @nfa: struct nfattr
+  * @maxlen: maximal length of nfattr buffer
+@@ -913,7 +914,7 @@ int nfnl_addattr16(struct nlmsghdr *n, int maxlen, int type,
+  *
+  */
+ int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type, 
+-		       u_int32_t data)
++		       uint32_t data)
+ {
+ 	assert(nfa);
+ 	assert(maxlen > 0);
+@@ -923,7 +924,7 @@ int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type,
+ }
+ 
+ /**
+- * nfnl_addattr32 - Add u_int32_t attribute to nlmsghdr
++ * nfnl_addattr32 - Add uint32_t attribute to nlmsghdr
+  *
+  * @n: netlink message header to which attribute is to be added
+  * @maxlen: maximum length of netlink message header
+@@ -932,7 +933,7 @@ int nfnl_nfa_addattr32(struct nfattr *nfa, int maxlen, int type,
+  *
+  */
+ int nfnl_addattr32(struct nlmsghdr *n, int maxlen, int type,
+-		   u_int32_t data)
++		   uint32_t data)
+ {
+ 	assert(n);
+ 	assert(maxlen > 0);
+@@ -980,7 +981,7 @@ int nfnl_parse_attr(struct nfattr *tb[], int max, struct nfattr *nfa, int len)
+  *
+  */ 
+ void nfnl_build_nfa_iovec(struct iovec *iov, struct nfattr *nfa, 
+-			  u_int16_t type, u_int32_t len, unsigned char *val)
++			  uint16_t type, uint32_t len, unsigned char *val)
+ {
+ 	assert(iov);
+ 	assert(nfa);
+@@ -1115,7 +1116,7 @@ struct nlmsghdr *nfnl_get_msg_next(struct nfnl_handle *h,
+  * appropiately.
+  */
+ int nfnl_callback_register(struct nfnl_subsys_handle *ssh,
+-			   u_int8_t type, struct nfnl_callback *cb)
++			   uint8_t type, struct nfnl_callback *cb)
+ {
+ 	assert(ssh);
+ 	assert(cb);
+@@ -1138,7 +1139,7 @@ int nfnl_callback_register(struct nfnl_subsys_handle *ssh,
+  * On sucess, 0 is returned. On error, -1 is returned and errno is
+  * set appropiately.
+  */
+-int nfnl_callback_unregister(struct nfnl_subsys_handle *ssh, u_int8_t type)
++int nfnl_callback_unregister(struct nfnl_subsys_handle *ssh, uint8_t type)
+ {
+ 	assert(ssh);
+ 
+@@ -1161,8 +1162,8 @@ int nfnl_check_attributes(const struct nfnl_handle *h,
+ 	assert(nfa);
+ 
+ 	int min_len;
+-	u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+-	u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
++	uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
++	uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+ 	const struct nfnl_subsys_handle *ssh;
+ 	struct nfnl_callback *cb;
+ 
+@@ -1212,8 +1213,8 @@ static int __nfnl_handle_msg(struct nfnl_handle *h, struct nlmsghdr *nlh,
+ 			     int len)
+ {
+ 	struct nfnl_subsys_handle *ssh;
+-	u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+-	u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
++	uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
++	uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+ 	int err = 0;
+ 
+ 	if (subsys_id > NFNL_MAX_SUBSYS)
+@@ -1243,7 +1244,7 @@ int nfnl_handle_packet(struct nfnl_handle *h, char *buf, int len)
+ {
+ 
+ 	while (len >= NLMSG_SPACE(0)) {
+-		u_int32_t rlen;
++		uint32_t rlen;
+ 		struct nlmsghdr *nlh = (struct nlmsghdr *)buf;
+ 
+ 		if (nlh->nlmsg_len < sizeof(struct nlmsghdr)
+@@ -1285,8 +1286,8 @@ static int nfnl_is_error(struct nfnl_handle *h, struct nlmsghdr *nlh)
+ static int nfnl_step(struct nfnl_handle *h, struct nlmsghdr *nlh)
+ {
+ 	struct nfnl_subsys_handle *ssh;
+-	u_int8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
+-	u_int8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
++	uint8_t type = NFNL_MSG_TYPE(nlh->nlmsg_type);
++	uint8_t subsys_id = NFNL_SUBSYS_ID(nlh->nlmsg_type);
+ 
+ 	/* Is this an error message? */
+ 	if (nfnl_is_error(h, nlh)) {
+diff --git a/src/rtnl.c b/src/rtnl.c
+index 7b4ac7d..34802fe 100644
+--- a/src/rtnl.c
++++ b/src/rtnl.c
+@@ -11,6 +11,7 @@
+ /* rtnetlink - routing table netlink interface */
+ 
+ #include <unistd.h>
++#include <stdint.h>
+ #include <stdlib.h>
+ #include <string.h>
+ #include <errno.h>
+@@ -30,7 +31,7 @@
+ #define rtnl_log(x, ...)
+ 
+ static inline struct rtnl_handler *
+-find_handler(struct rtnl_handle *rtnl_handle, u_int16_t type)
++find_handler(struct rtnl_handle *rtnl_handle, uint16_t type)
+ {
+ 	struct rtnl_handler *h;
+ 	for (h = rtnl_handle->handlers; h; h = h->next) {
+@@ -41,7 +42,7 @@ find_handler(struct rtnl_handle *rtnl_handle, u_int16_t type)
+ }
+ 
+ static int call_handler(struct rtnl_handle *rtnl_handle,
+-			u_int16_t type,
++			uint16_t type,
+ 			struct nlmsghdr *hdr)
+ {
+ 	struct rtnl_handler *h = find_handler(rtnl_handle, type);
+diff --git a/src/rtnl.h b/src/rtnl.h
+index 0c403dc..9858ae5 100644
+--- a/src/rtnl.h
++++ b/src/rtnl.h
+@@ -1,13 +1,14 @@
+ #ifndef _RTNL_H
+ #define _RTNL_H
+ 
++#include <stdint.h>
+ #include <linux/types.h>
+ #include <linux/rtnetlink.h>
+ 
+ struct rtnl_handler {
+ 	struct rtnl_handler *next;
+ 
+-	u_int16_t	nlmsg_type;
++	uint16_t	nlmsg_type;
+ 	int		(*handlefn)(struct nlmsghdr *h, void *arg);
+ 	void		*arg;
+ };
diff --git a/nixpkgs/pkgs/development/libraries/libnfnetlink/default.nix b/nixpkgs/pkgs/development/libraries/libnfnetlink/default.nix
new file mode 100644
index 000000000000..a070d2e3af2e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnfnetlink/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "libnfnetlink-1.0.1";
+
+  src = fetchurl {
+    url = "https://www.netfilter.org/projects/libnfnetlink/files/${name}.tar.bz2";
+    sha256 = "06mm2x4b01k3m7wnrxblk9j0mybyr4pfz28ml7944xhjx6fy2w7j";
+  };
+
+  patches = [
+    ./Use-stdlib-uint-instead-of-u_int.patch
+  ];
+
+  meta = {
+    description = "Low-level library for netfilter related kernel/userspace communication";
+    longDescription = ''
+      libnfnetlink is the low-level library for netfilter related kernel/userspace communication.
+      It provides a generic messaging infrastructure for in-kernel netfilter subsystems
+      (such as nfnetlink_log, nfnetlink_queue, nfnetlink_conntrack) and their respective users
+      and/or management tools in userspace.
+
+      This library is not meant as a public API for application developers.
+      It is only used by other netfilter.org projects, like the aforementioned ones.
+    '';
+    homepage = "https://www.netfilter.org/projects/libnfnetlink/index.html";
+    license = lib.licenses.gpl2;
+
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnfs/default.nix b/nixpkgs/pkgs/development/libraries/libnfs/default.nix
new file mode 100644
index 000000000000..4e12553b00ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnfs/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "libnfs";
+  version = "4.0.0";
+
+  src = fetchFromGitHub {
+    owner = "sahlberg";
+    repo = "libnfs";
+    rev = "libnfs-${version}";
+    sha256 = "0i27wd4zvhjz7620q043p4d4mkx8zv2yz9adm1byin47dynahyda";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=tautological-compare";
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "NFS client library";
+    homepage    = "https://github.com/sahlberg/libnfs";
+    license     = with licenses; [ lgpl2 bsd2 gpl3 ];
+    maintainers = with maintainers; [ peterhoeg ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnftnl/default.nix b/nixpkgs/pkgs/development/libraries/libnftnl/default.nix
new file mode 100644
index 000000000000..276ee52ed54d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnftnl/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, pkg-config, libmnl }:
+
+stdenv.mkDerivation rec {
+  version = "1.2.0";
+  pname = "libnftnl";
+
+  src = fetchurl {
+    url = "https://netfilter.org/projects/${pname}/files/${pname}-${version}.tar.bz2";
+    sha256 = "1xblq1cbcxhr6qmjpy98i1qdza148idgz99vbhjc7s4vzvfizc4h";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libmnl ];
+
+  meta = with lib; {
+    description = "A userspace library providing a low-level netlink API to the in-kernel nf_tables subsystem";
+    homepage = "http://netfilter.org/projects/libnftnl";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ fpletz ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libngspice/default.nix b/nixpkgs/pkgs/development/libraries/libngspice/default.nix
new file mode 100644
index 000000000000..2f8aab830da0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libngspice/default.nix
@@ -0,0 +1,26 @@
+{lib, stdenv, fetchurl, bison, flex, fftw}:
+
+# Note that this does not provide the ngspice command-line utility. For that see
+# the ngspice derivation.
+stdenv.mkDerivation rec {
+  pname = "libngspice";
+  version = "34";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/ngspice/ngspice-${version}.tar.gz";
+    sha256 = "sha256-ImP//GaUdUlyr3By7wHP5irHkIANrWUbwpC/yueb17U=";
+  };
+
+  nativeBuildInputs = [ flex bison ];
+  buildInputs = [ fftw ];
+
+  configureFlags = [ "--with-ngshared" "--enable-xspice" "--enable-cider" ];
+
+  meta = with lib; {
+    description = "The Next Generation Spice (Electronic Circuit Simulator)";
+    homepage = "http://ngspice.sourceforge.net";
+    license = with licenses; [ bsd3 gpl2Plus lgpl2Plus ]; # See https://sourceforge.net/p/ngspice/ngspice/ci/master/tree/COPYING
+    maintainers = with maintainers; [ bgamari ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnice/default.nix b/nixpkgs/pkgs/development/libraries/libnice/default.nix
new file mode 100644
index 000000000000..7c5043165f9d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnice/default.nix
@@ -0,0 +1,85 @@
+{ lib, stdenv
+, fetchurl
+, fetchpatch
+, meson
+, ninja
+, pkg-config
+, python3
+, gobject-introspection
+, gtk-doc
+, docbook_xsl
+, docbook_xml_dtd_412
+, glib
+, gupnp-igd
+, gst_all_1
+, gnutls
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libnice";
+  version = "0.1.18";
+
+  outputs = [ "bin" "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "https://libnice.freedesktop.org/releases/${pname}-${version}.tar.gz";
+    sha256 = "1x3kj9b3dy9m2h6j96wgywfamas1j8k2ca43k5v82kmml9dx5asy";
+  };
+
+  patches = [
+    # Fix generating data
+    # Note: upstream is not willing to merge our fix
+    # https://gitlab.freedesktop.org/libnice/libnice/merge_requests/35#note_98871
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/libnice/libnice/commit/d470c4bf4f2449f7842df26ca1ce1efb63452bc6.patch";
+      sha256 = "0z74vizf92flfw1m83p7yz824vfykmnm0xbnk748bnnyq186i6mg";
+    })
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    python3
+    gobject-introspection
+
+    # documentation
+    gtk-doc
+    docbook_xsl
+    docbook_xml_dtd_412
+  ];
+
+  buildInputs = [
+    gst_all_1.gstreamer
+    gst_all_1.gst-plugins-base
+    gnutls
+    gupnp-igd
+  ];
+
+  propagatedBuildInputs = [
+    glib
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=enabled" # Disabled by default as of libnice-0.1.15
+    "-Dexamples=disabled" # requires many dependencies and probably not useful for our users
+  ];
+
+  # Tests are flaky
+  # see https://github.com/NixOS/nixpkgs/pull/53293#issuecomment-453739295
+  doCheck = false;
+
+  meta = with lib; {
+    description = "GLib ICE implementation";
+    longDescription = ''
+      Libnice is an implementation of the IETF's Interactice Connectivity
+      Establishment (ICE) standard (RFC 5245) and the Session Traversal
+      Utilities for NAT (STUN) standard (RFC 5389).
+
+      It provides a GLib-based library, libnice and a Glib-free library,
+      libstun as well as GStreamer elements.'';
+    homepage = "https://libnice.freedesktop.org/";
+    platforms = platforms.linux;
+    license = with licenses; [ lgpl21 mpl11 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnih/default.nix b/nixpkgs/pkgs/development/libraries/libnih/default.nix
new file mode 100644
index 000000000000..fbe01bf4062d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnih/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, pkg-config, dbus, expat }:
+
+let version = "1.0.3"; in
+
+stdenv.mkDerivation {
+  pname = "libnih";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://code.launchpad.net/libnih/1.0/${version}/+download/libnih-${version}.tar.gz";
+    sha256 = "01glc6y7z1g726zwpvp2zm79pyb37ki729jkh45akh35fpgp4xc9";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dbus expat ];
+
+  doCheck = false; # fails 1 of 17 test
+
+  meta = {
+    description = "A small library for C application development";
+    homepage = "https://launchpad.net/libnih";
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnixxml/default.nix b/nixpkgs/pkgs/development/libraries/libnixxml/default.nix
new file mode 100644
index 000000000000..48edfbfce2c0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnixxml/default.nix
@@ -0,0 +1,61 @@
+{ fetchFromGitHub, lib, stdenv, autoreconfHook, pkg-config, libxml2, gd, glib, getopt, libxslt, nix, bash}:
+
+stdenv.mkDerivation {
+  pname = "libnixxml";
+  version = "unstable-2020-06-25";
+
+  src = fetchFromGitHub {
+    owner = "svanderburg";
+    repo = "libnixxml";
+    rev = "54c04a5fdbc8661b2445a7527f499e0a77753a1a";
+    sha256 = "sha256-HKQnCkO1TDs1e0MDil0Roq4YRembqRHQvb7lK3GAftQ=";
+  };
+
+  prePatch = ''
+    # Remove broken test
+    substituteInPlace tests/draw/Makefile.am \
+      --replace "draw-wrong.sh" ""
+    rm tests/draw/draw-wrong.sh
+
+    # Fix bash path
+    substituteInPlace scripts/nixexpr2xml.in \
+      --replace "/bin/bash" "${bash}/bin/bash"
+  '';
+
+  preAutoreconf = ''
+    # Copied from bootstrap script
+    ln -s README.md README
+    mkdir -p config
+  '';
+
+  configureFlags = [ "--with-gd" "--with-glib" ];
+  CFLAGS = "-Wall";
+
+  strictDeps = true;
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+    getopt
+    libxslt
+  ];
+  buildInputs = [
+    bash
+    libxml2
+    gd.dev
+    glib
+    nix
+  ];
+  checkInputs = [
+    nix
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "XML-based Nix-friendly data integration library";
+    homepage = "https://github.com/svanderburg/libnixxml";
+    license = licenses.mit;
+    maintainers = with maintainers; [ tomberek ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnotify/default.nix b/nixpkgs/pkgs/development/libraries/libnotify/default.nix
new file mode 100644
index 000000000000..b108a5c5eea5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnotify/default.nix
@@ -0,0 +1,60 @@
+{ lib, stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, libxslt
+, docbook-xsl-ns
+, glib
+, gdk-pixbuf
+, gobject-introspection
+, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libnotify";
+  version = "0.7.9";
+
+  outputs = [ "out" "man" "dev" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0qa7cx6ra5hwqnxw95b9svgjg5q6ynm8y843iqjszxvds5z53h36";
+  };
+
+  mesonFlags = [
+    # disable tests as we don't need to depend on GTK (2/3)
+    "-Dtests=false"
+    "-Ddocbook_docs=disabled"
+    "-Dgtk_doc=false"
+  ];
+
+  nativeBuildInputs = [
+    gobject-introspection
+    meson
+    ninja
+    pkg-config
+    libxslt
+    docbook-xsl-ns
+  ];
+
+  propagatedBuildInputs = [
+    gdk-pixbuf
+    glib
+  ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://developer.gnome.org/notification-spec/";
+    description = "A library that sends desktop notifications to a notification daemon";
+    platforms = platforms.unix;
+    maintainers = teams.gnome.members;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnsl/default.nix b/nixpkgs/pkgs/development/libraries/libnsl/default.nix
new file mode 100644
index 000000000000..ac4c6bf9ad3f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnsl/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, libtirpc, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "libnsl";
+  version = "1.3.0";
+
+  src = fetchFromGitHub {
+    owner = "thkukuk";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1dayj5i4bh65gn7zkciacnwv2a0ghm6nn58d78rsi4zby4lyj5w5";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ libtirpc ];
+
+  meta = with lib; {
+    description = "Client interface library for NIS(YP) and NIS+";
+    homepage = "https://github.com/thkukuk/libnsl";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.dezgeg ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libnxml/default.nix b/nixpkgs/pkgs/development/libraries/libnxml/default.nix
new file mode 100644
index 000000000000..846170011437
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libnxml/default.nix
@@ -0,0 +1,21 @@
+{lib, stdenv, fetchurl, curl}:
+
+stdenv.mkDerivation {
+  name = "libnxml-0.18.3";
+
+  src = fetchurl {
+    url = "https://www.autistici.org/bakunin/libnxml/libnxml-0.18.3.tar.gz";
+    sha256 = "0ix5b9bxd7r517vhgcxwdviq4m0g0pq46s5g3h04gcqnpbin150g";
+  };
+
+  buildInputs = [ curl ];
+
+  meta = {
+    homepage = "https://www.autistici.org/bakunin/libnxml/";
+    description = "C library for parsing, writing and creating XML 1.0 and 1.1 files or streams";
+    license = lib.licenses.lgpl2;
+
+    platforms = lib.platforms.all;
+    maintainers = [ lib.maintainers.viric ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liboauth/default.nix b/nixpkgs/pkgs/development/libraries/liboauth/default.nix
new file mode 100644
index 000000000000..7ca9ec5acb6d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liboauth/default.nix
@@ -0,0 +1,34 @@
+{ fetchurl, lib, stdenv, nss, nspr, pkg-config }:
+
+
+stdenv.mkDerivation rec {
+  pname = "liboauth";
+  version = "1.0.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/liboauth/${pname}-${version}.tar.gz";
+    sha256 = "07w1aq8y8wld43wmbk2q8134p3bfkp2vma78mmsfgw2jn1bh3xhd";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  propagatedBuildInputs = [ nss nspr ];
+
+  configureFlags = [ "--enable-nss" ];
+
+  postInstall = ''
+    substituteInPlace $out/lib/liboauth.la \
+      --replace "-lnss3" "-L${nss.out}/lib -lnss3"
+  '';
+
+  meta = with lib; {
+    platforms = platforms.all;
+    description = "C library implementing the OAuth secure authentication protocol";
+    homepage = "http://liboauth.sourceforge.net/";
+    repositories.git = "https://github.com/x42/liboauth.git";
+    license = licenses.mit;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/libodfgen/default.nix b/nixpkgs/pkgs/development/libraries/libodfgen/default.nix
new file mode 100644
index 000000000000..b891c320e868
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libodfgen/default.nix
@@ -0,0 +1,30 @@
+{lib, stdenv, fetchurl, boost, pkg-config, cppunit, zlib, libwpg, libwpd, librevenge}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="libodfgen";
+    version="0.1.7";
+    name="${baseName}-${version}";
+    hash="0cdq48wlpp8m0qmndybv64r0m4vh0qsqx69cn6ms533cjlgljgij";
+    url="mirror://sourceforge/project/libwpd/libodfgen/libodfgen-0.1.7/libodfgen-0.1.7.tar.xz";
+    sha256="0cdq48wlpp8m0qmndybv64r0m4vh0qsqx69cn6ms533cjlgljgij";
+  };
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    boost cppunit zlib libwpg libwpd librevenge
+  ];
+in
+stdenv.mkDerivation {
+  inherit (s) name version;
+  inherit nativeBuildInputs buildInputs;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+  meta = {
+    inherit (s) version;
+    description = "A base library for generating ODF documents";
+    license = lib.licenses.mpl20 ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libodfgen/default.upstream b/nixpkgs/pkgs/development/libraries/libodfgen/default.upstream
new file mode 100644
index 000000000000..bd78e974e42f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libodfgen/default.upstream
@@ -0,0 +1,4 @@
+url https://sourceforge.net/projects/libwpd/files/libodfgen/
+SF_version_dir libodfgen-
+version_link '[.]tar.xz/download$'
+SF_redirect
diff --git a/nixpkgs/pkgs/development/libraries/libofa/default.nix b/nixpkgs/pkgs/development/libraries/libofa/default.nix
new file mode 100644
index 000000000000..a64afbb930ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libofa/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, expat, curl, fftw }:
+
+stdenv.mkDerivation rec {
+  pname = "libofa";
+  version = "0.9.3";
+  deb_patch = "5";
+
+  src = fetchurl {
+    url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/musicip-libofa/${pname}-${version}.tar.gz";
+    sha256 = "184ham039l7lwhfgg0xr2vch2xnw1lwh7sid432mh879adhlc5h2";
+  };
+
+  patches = fetchurl {
+    url = "mirror://debian/pool/main/libo/libofa/libofa_${version}-${deb_patch}.debian.tar.gz";
+    sha256 = "1rfkyz13cm8izm90c1xflp4rvsa24aqs6qpbbbqqcbmvzsj6j9yn";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  setOutputFlags = false;
+
+  preConfigure = ''
+    configureFlagsArray=(--includedir=$dev/include --libdir=$out/lib)
+  '';
+
+  propagatedBuildInputs = [ expat curl fftw ];
+
+  meta = with lib; {
+    homepage = "https://code.google.com/archive/p/musicip-libofa/";
+    description = "Library Open Fingerprint Architecture";
+    longDescription = ''
+      LibOFA (Library Open Fingerprint Architecture) is an open-source audio
+      fingerprint created and provided by MusicIP'';
+    platforms = platforms.linux;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libofx/default.nix b/nixpkgs/pkgs/development/libraries/libofx/default.nix
new file mode 100644
index 000000000000..2cd480ee0103
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libofx/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, opensp, pkg-config, libxml2, curl
+, autoconf, automake, libtool, gengetopt, libiconv }:
+
+stdenv.mkDerivation rec {
+  pname = "libofx";
+  version = "0.10.2";
+
+  src = fetchFromGitHub {
+    owner = "LibOFX";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-V9FyOVH9CB6UtTxDvXRyX6mWaXq2Y2K3t9lotjigK0M=";
+  };
+
+  preConfigure = "./autogen.sh";
+  configureFlags = [ "--with-opensp-includes=${opensp}/include/OpenSP" ];
+  nativeBuildInputs = [ pkg-config libtool autoconf automake gengetopt ];
+  buildInputs = [ opensp libxml2 curl ] ++ lib.optional stdenv.isDarwin libiconv;
+
+  meta = {
+    description = "Opensource implementation of the Open Financial eXchange specification";
+    homepage = "http://libofx.sourceforge.net/";
+    license = "LGPL";
+    platforms = lib.platforms.unix;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libogg/default.nix b/nixpkgs/pkgs/development/libraries/libogg/default.nix
new file mode 100644
index 000000000000..83555ccab8ce
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libogg/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, fetchpatch }:
+
+stdenv.mkDerivation rec {
+  name = "libogg-1.3.4";
+
+  src = fetchurl {
+    url = "http://downloads.xiph.org/releases/ogg/${name}.tar.xz";
+    sha256 = "1zlk33vxvxr0l9lhkbhkdwvylw96d2n0fnd3d8dl031hph9bqqy1";
+  };
+
+  outputs = [ "out" "dev" "doc" ];
+
+  patches = 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 lib; {
+    description = "Media container library to manipulate Ogg files";
+    longDescription = ''
+      Library to work with Ogg multimedia container format.
+      Ogg is flexible file storage and streaming format that supports
+      plethora of codecs. Open format free for anyone to use.
+    '';
+    homepage = "https://xiph.org/ogg/";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.ehmry ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liboggz/default.nix b/nixpkgs/pkgs/development/libraries/liboggz/default.nix
new file mode 100644
index 000000000000..ecf013363ad7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liboggz/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, libogg, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "liboggz";
+  version = "1.1.1";
+
+  src = fetchurl {
+    url = "https://downloads.xiph.org/releases/liboggz/${pname}-${version}.tar.gz";
+    sha256 = "0nj17lhnsw4qbbk8jy4j6a78w6v2llhqdwq46g44mbm9w2qsvbvb";
+  };
+
+  propagatedBuildInputs = [ libogg ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  meta = with lib; {
+    homepage = "https://xiph.org/oggz/";
+    description = "A C library and tools for manipulating with Ogg files and streams";
+    longDescription = ''
+      Oggz comprises liboggz and the tool oggz, which provides commands to
+      inspect, edit and validate Ogg files. The oggz-chop tool can also be used
+      to serve time ranges of Ogg media over HTTP by any web server that
+      supports CGI.
+
+      liboggz is a C library for reading and writing Ogg files and streams.  It
+      offers various improvements over the reference libogg, including support
+      for seeking, validation and timestamp interpretation. Ogg is an
+      interleaving data container developed by Monty at Xiph.Org, originally to
+      support the Ogg Vorbis audio format but now used for many free codecs
+      including Dirac, FLAC, Speex and Theora.'';
+    platforms = platforms.unix;
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liboil/default.nix b/nixpkgs/pkgs/development/libraries/liboil/default.nix
new file mode 100644
index 000000000000..8d9299758159
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liboil/default.nix
@@ -0,0 +1,32 @@
+{lib, stdenv, fetchurl, pkg-config }:
+
+stdenv.mkDerivation rec {
+  name = "liboil-0.3.17";
+
+  src = fetchurl {
+    url = "${meta.homepage}/download/${name}.tar.gz";
+    sha256 = "0sgwic99hxlb1av8cm0albzh8myb7r3lpcwxfm606l0bkc3h4pqh";
+  };
+
+  patches = [ ./x86_64-cpuid.patch ];
+
+  outputs = [ "out" "dev" "devdoc" ];
+  outputBin = "dev"; # oil-bugreport
+
+  nativeBuildInputs = [ pkg-config ];
+
+  # fix "argb_paint_i386.c:53:Incorrect register `%rax' used with `l' suffix"
+  # errors
+  configureFlags = lib.optional stdenv.isDarwin "--build=x86_64";
+
+  # fixes a cast in inline asm: easier than patching
+  buildFlags = lib.optional stdenv.isDarwin "CFLAGS=-fheinous-gnu-extensions";
+
+  meta = with lib; {
+    description = "A library of simple functions that are optimized for various CPUs";
+    homepage    = "https://liboil.freedesktop.org";
+    license     = licenses.bsd2;
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liboil/x86_64-cpuid.patch b/nixpkgs/pkgs/development/libraries/liboil/x86_64-cpuid.patch
new file mode 100644
index 000000000000..d86dd79c3bcb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liboil/x86_64-cpuid.patch
@@ -0,0 +1,38 @@
+From 705916007fba0a845229a02dc6474cb523eff150 Mon Sep 17 00:00:00 2001
+From: David Schleef <ds@schleef.org>
+Date: Tue, 20 Jul 2010 21:05:26 +0000
+Subject: x86: Fix cpuid function on x86-64
+
+Fixes: #28956.
+---
+diff --git a/liboil/liboilcpu-x86.c b/liboil/liboilcpu-x86.c
+index e7a1978..ef4d3f2 100644
+--- a/liboil/liboilcpu-x86.c
++++ b/liboil/liboilcpu-x86.c
+@@ -162,13 +162,10 @@ get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
+ static void
+ get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
+ {
++  *a = op;
+   __asm__ (
+-      "  pushq %%rbx\n"
+       "  cpuid\n"
+-      "  mov %%ebx, %%esi\n"
+-      "  popq %%rbx\n"
+-      : "=a" (*a), "=S" (*b), "=c" (*c), "=d" (*d)
+-      : "0" (op));
++      : "+a" (*a), "=b" (*b), "=c" (*c), "=d" (*d));
+ }
+ #endif
+ 
+@@ -185,7 +182,7 @@ oil_cpu_detect_cpuid (void)
+ {
+   uint32_t eax, ebx, ecx, edx;
+   uint32_t level;
+-  char vendor[13] = { 0 };
++  char vendor[13+4] = { 0 };
+   int ret;
+ 
+   oil_fault_check_enable ();
+--
+cgit v0.9.0.2-2-gbebe
diff --git a/nixpkgs/pkgs/development/libraries/libomxil-bellagio/default.nix b/nixpkgs/pkgs/development/libraries/libomxil-bellagio/default.nix
new file mode 100644
index 000000000000..5e3b0c6798a6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libomxil-bellagio/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libomxil-bellagio";
+  version = "0.9.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/omxil/omxil/Bellagio%20${version}/${pname}-${version}.tar.gz";
+    sha256 = "0k6p6h4npn8p1qlgq6z3jbfld6n1bqswzvxzndki937gr0lhfg2r";
+  };
+
+  configureFlags =
+    lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" ];
+
+  patches = [ ./fedora-fixes.patch ];
+
+  doCheck = false; # fails
+
+  # Fix for #40213, probably permanent, because upstream doesn't seem to be
+  # developed anymore. Alternatively, gcc7Stdenv could be used.
+  NIX_CFLAGS_COMPILE = "-Wno-error=array-bounds -Wno-error=stringop-overflow=8";
+
+  meta = with lib; {
+    homepage = "https://sourceforge.net/projects/omxil/";
+    description = "An opensource implementation of the Khronos OpenMAX Integration Layer API to access multimedia components";
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libomxil-bellagio/fedora-fixes.patch b/nixpkgs/pkgs/development/libraries/libomxil-bellagio/fedora-fixes.patch
new file mode 100644
index 000000000000..2ae3c3c871c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libomxil-bellagio/fedora-fixes.patch
@@ -0,0 +1,199 @@
+When libomxdynamicloader.so is loaded, it complains that RM_Deinit can't be resolved.
+Link explicitly against omxil-bellagio so that ld.so can find the reference.
+
+Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
+
+--- bellagio-0.9.3/src/dynamic_loader/Makefile.am.old	2012-03-23 15:07:47.379021034 +0000
++++ bellagio-0.9.3/src/dynamic_loader/Makefile.am	2012-03-23 15:08:47.563034818 +0000
+@@ -3,7 +3,7 @@
+ omxdynamicloader_LTLIBRARIES = libomxdynamicloader.la
+ libomxdynamicloader_la_SOURCES = ste_dynamic_component_loader.c ste_dynamic_component_loader.h
+ 
+-libomxdynamicloader_la_LDFLAGS =
++libomxdynamicloader_la_LDFLAGS = -L$(abs_top_srcdir)/src/.libs -lomxil-bellagio
+ libomxdynamicloader_la_CFLAGS = -I$(top_srcdir)/include \
+ 			-I$(top_srcdir)/src \
+ 			-I$(top_srcdir)/src/base \
+Fix dependency issue to allow parallel build
+
+Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
+
+Index: bellagio-0.9.3/src/Makefile.am
+===================================================================
+--- bellagio-0.9.3.orig/src/Makefile.am
++++ bellagio-0.9.3/src/Makefile.am
+@@ -8,6 +8,7 @@ omxregister_bellagio_SOURCES = omxregist
+ omxregister_bellagio_CFLAGS = -DOMXILCOMPONENTSPATH=\"$(plugindir)/\" \
+ 			      -I$(top_srcdir)/include
+ omxregister_bellagio_LDFLAGS = -lomxil-bellagio -L$(builddir)
++omxregister_bellagio_DEPENDENCIES = libomxil-bellagio.la
+ 
+ lib_LTLIBRARIES = libomxil-bellagio.la
+ libomxil_bellagio_la_SOURCES = component_loader.h \
+We always access globalComponentList[] at indexComponent=-1 which causes a
+segfault. Use i as the index instead.
+
+Signed-off-by: Qais Yousef <qais.yousef@imgtec.com>
+
+--- bellagio-0.9.3/src/omx_reference_resource_manager.c.old	2012-03-13 10:15:25.743940980 +0000
++++ bellagio-0.9.3/src/omx_reference_resource_manager.c	2012-03-13 10:18:02.201971009 +0000
+@@ -485,7 +485,6 @@
+ OMX_ERRORTYPE RM_removeFromWaitForResource(OMX_COMPONENTTYPE *openmaxStandComp) {
+ 	omx_base_component_PrivateType* omx_base_component_Private;
+ 	int i = 0;
+-	int indexComponent = -1;
+ 
+ 	DEBUG(DEB_LEV_FUNCTION_NAME, "In %s\n", __func__);
+ 	omx_base_component_Private = (omx_base_component_PrivateType*)openmaxStandComp->pComponentPrivate;
+@@ -493,16 +492,13 @@
+ 	while(listOfcomponentRegistered[i].component_name != NULL ) {
+ 		if (!strcmp(listOfcomponentRegistered[i].component_name, omx_base_component_Private->name)) {
+ 			// found component in the list of the resource manager
+-			removeElemFromList(&globalComponentList[indexComponent], openmaxStandComp);
+-			break;
++			removeElemFromList(&globalComponentList[i], openmaxStandComp);
++			DEBUG(DEB_LEV_FUNCTION_NAME, "Out of %s\n", __func__);
++			return OMX_ErrorNone;
+ 		}
+ 		i++;
+ 	}
+-	if (indexComponent <0) {
+-		// No resource to be handled
+-		DEBUG(DEB_LEV_ERR, "In %s No resource to be handled\n", __func__);
+-		return OMX_ErrorNone;
+-	}
+-	DEBUG(DEB_LEV_FUNCTION_NAME, "Out of %s\n", __func__);
++	// No resource to be handled
++	DEBUG(DEB_LEV_ERR, "In %s No resource to be handled\n", __func__);
+ 	return OMX_ErrorNone;
+ }
+ OMX_INDEXTYPE/OMX_INDEXVENDORTYPE in one switch
+ src/base/omx_base_component.c |   54 ++++++++++++++++++++++-------------------
+ 1 files changed, 29 insertions(+), 25 deletions(-)
+--- a/src/base/omx_base_component.c	
++++ a/src/base/omx_base_component.c	
+@@ -915,14 +915,6 @@ OSCL_EXPORT_REF OSCL_EXPORT_REF OMX_ERRORTYPE omx_base_component_GetParameter(
+     return OMX_ErrorBadParameter;
+   }
+   switch(nParamIndex) {
+-  case OMX_IndexParameterThreadsID:
+-	    if ((err = checkHeader(ComponentParameterStructure, sizeof(OMX_PARAM_BELLAGIOTHREADS_ID))) != OMX_ErrorNone) {
+-	      break;
+-	    }
+-	  threadID = (OMX_PARAM_BELLAGIOTHREADS_ID *)ComponentParameterStructure;
+-	  threadID->nThreadBufferMngtID = omx_base_component_Private->bellagioThreads->nThreadBufferMngtID;
+-	  threadID->nThreadMessageID = omx_base_component_Private->bellagioThreads->nThreadMessageID;
+-	  break;
+   case OMX_IndexParamAudioInit:
+   case OMX_IndexParamVideoInit:
+   case OMX_IndexParamImageInit:
+@@ -988,28 +980,40 @@ OSCL_EXPORT_REF OSCL_EXPORT_REF OMX_ERRORTYPE omx_base_component_GetParameter(
+       }
+     }
+     break;
+-  case OMX_IndexVendorCompPropTunnelFlags:
+-    pPropTunnelSetup = (OMX_VENDOR_PROP_TUNNELSETUPTYPE*)ComponentParameterStructure;
++  default:
++    /* additional switch statement for extended OMX_INDEXTYPE */
++    switch((OMX_INDEXVENDORTYPE) nParamIndex) {
++    case OMX_IndexParameterThreadsID:
++        if ((err = checkHeader(ComponentParameterStructure, sizeof(OMX_PARAM_BELLAGIOTHREADS_ID))) != OMX_ErrorNone) {
++          break;
++        }
++      threadID = (OMX_PARAM_BELLAGIOTHREADS_ID *)ComponentParameterStructure;
++      threadID->nThreadBufferMngtID = omx_base_component_Private->bellagioThreads->nThreadBufferMngtID;
++      threadID->nThreadMessageID = omx_base_component_Private->bellagioThreads->nThreadMessageID;
++      break;
++    case OMX_IndexVendorCompPropTunnelFlags:
++      pPropTunnelSetup = (OMX_VENDOR_PROP_TUNNELSETUPTYPE*)ComponentParameterStructure;
+ 
+-    if (pPropTunnelSetup->nPortIndex >= (omx_base_component_Private->sPortTypesParam[OMX_PortDomainAudio].nPorts +
+-                                         omx_base_component_Private->sPortTypesParam[OMX_PortDomainVideo].nPorts +
+-                                         omx_base_component_Private->sPortTypesParam[OMX_PortDomainImage].nPorts +
+-                                         omx_base_component_Private->sPortTypesParam[OMX_PortDomainOther].nPorts)) {
++      if (pPropTunnelSetup->nPortIndex >= (omx_base_component_Private->sPortTypesParam[OMX_PortDomainAudio].nPorts +
++                                           omx_base_component_Private->sPortTypesParam[OMX_PortDomainVideo].nPorts +
++                                           omx_base_component_Private->sPortTypesParam[OMX_PortDomainImage].nPorts +
++                                           omx_base_component_Private->sPortTypesParam[OMX_PortDomainOther].nPorts)) {
+ 
+-      DEBUG(DEB_LEV_ERR,"In %s OMX_IndexVendorCompPropTunnelFlags nPortIndex=%d Line=%d \n",
+-          __func__,(int)pPropTunnelSetup->nPortIndex,__LINE__);
++        DEBUG(DEB_LEV_ERR,"In %s OMX_IndexVendorCompPropTunnelFlags nPortIndex=%d Line=%d \n",
++            __func__,(int)pPropTunnelSetup->nPortIndex,__LINE__);
+ 
+-      return OMX_ErrorBadPortIndex;
+-    }
++        return OMX_ErrorBadPortIndex;
++      }
+ 
+-    pPort = omx_base_component_Private->ports[pPropTunnelSetup->nPortIndex];
++      pPort = omx_base_component_Private->ports[pPropTunnelSetup->nPortIndex];
+ 
+-    pPropTunnelSetup->nTunnelSetup.nTunnelFlags  = pPort->nTunnelFlags;
+-    pPropTunnelSetup->nTunnelSetup.eSupplier     = pPort->eBufferSupplier;
+-    break;
+-  default:
+-    err = OMX_ErrorUnsupportedIndex;
+-    break;
++      pPropTunnelSetup->nTunnelSetup.nTunnelFlags  = pPort->nTunnelFlags;
++      pPropTunnelSetup->nTunnelSetup.eSupplier     = pPort->eBufferSupplier;
++      break;
++    default:
++      err = OMX_ErrorUnsupportedIndex;
++      break;
++    }
+   }
+   DEBUG(DEB_LEV_FUNCTION_NAME, "Out of %s for component %p\n", __func__, hComponent);
+   return err;
+diff -up libomxil-bellagio-0.9.3/Makefile.am.nodoc libomxil-bellagio-0.9.3/Makefile.am
+--- libomxil-bellagio-0.9.3/Makefile.am.nodoc	2011-01-12 08:53:26.000000000 +0100
++++ libomxil-bellagio-0.9.3/Makefile.am	2012-04-23 13:46:15.410823381 +0200
+@@ -7,7 +7,6 @@ EXTRA_DIST = libomxil-bellagio.spec
+ pkgconfigdir = $(libdir)/pkgconfig
+ pkgconfig_DATA = libomxil-bellagio.pc
+ 
+-docdir = $(DESTDIR)$(prefix)/share/doc/@PACKAGE@
+ doc_DATA = README \
+ 	   ChangeLog \
+ 	   TODO
+diff -up libomxil-bellagio-0.9.3/src/omxregister.c.unused libomxil-bellagio-0.9.3/src/omxregister.c
+--- libomxil-bellagio-0.9.3/src/omxregister.c.unused	2011-01-12 08:53:26.000000000 +0100
++++ libomxil-bellagio-0.9.3/src/omxregister.c	2012-12-10 22:02:28.621695659 +0100
+@@ -248,7 +248,15 @@ static int buildComponentsList(FILE* omx
+ 						}
+ 						fptr(stComponents);
+ 						err = fwrite(lib_absolute_path, 1, strlen(lib_absolute_path), omxregistryfp);
+-						err = fwrite("\n", 1, 1, omxregistryfp);
++						if (err != strlen(lib_absolute_path)) {
++							DEBUG(DEB_LEV_ERR, "Failed to write %zu bytes to fd %d\n", strlen(lib_absolute_path), fileno(omxregistryfp));
++							continue;
++						}
++						err = fwrite("\n", 1, strlen(buffer), omxregistryfp);
++						if (err != strlen(buffer)) {
++							DEBUG(DEB_LEV_ERR, "Failed to write %zu bytes to fd %d\n", strlen(buffer), fileno(omxregistryfp));
++							continue;
++						}
+ 
+ 
+ 						for (i = 0; i<num_of_comp; i++) {
+--- libomxil-bellagio-0.9.3/include/OMX_Types.h.orig 2011-01-12 08:53:26.000000000 +0100
++++ libomxil-bellagio-0.9.3/include/OMX_Types.h 2013-02-25 09:53:55.000000000 +0100
+@@ -314,6 +314,18 @@
+  *  platform & operating specific object used to reference the window */
+ typedef void* OMX_NATIVE_WINDOWTYPE;
+
++
++/** Define the OMX IL version that corresponds to this set of header files.
++ *  We also define a combined version that can be used to write or compare
++ *  values of the 32bit nVersion field, assuming a little endian architecture */
++#define OMX_VERSION_MAJOR 1
++#define OMX_VERSION_MINOR 1
++#define OMX_VERSION_REVISION 2
++#define OMX_VERSION_STEP 0
++
++#define OMX_VERSION ((OMX_VERSION_STEP<<24) | (OMX_VERSION_REVISION<<16) | (OMX_VERSION_MINOR<<8) | OMX_VERSION_MAJOR)
++
++
+ /** The OMX_VERSIONTYPE union is used to specify the version for
+     a structure or component.  For a component, the version is entirely
+     specified by the component vendor.  Components doing the same function
diff --git a/nixpkgs/pkgs/development/libraries/liboop/default.nix b/nixpkgs/pkgs/development/libraries/liboop/default.nix
new file mode 100644
index 000000000000..5d849ebe1caf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liboop/default.nix
@@ -0,0 +1,17 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation {
+  name = "liboop-1.0";
+
+  src = fetchurl {
+    url = "http://download.ofb.net/liboop/liboop.tar.gz";
+    sha256 = "34d83c6e0f09ee15cb2bc3131e219747c3b612bb57cf7d25318ab90da9a2d97c";
+  };
+
+  meta = {
+    description = "Event loop library";
+    homepage = "http://liboop.ofb.net/";
+    license = "LGPL";
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libopcodes/default.nix b/nixpkgs/pkgs/development/libraries/libopcodes/default.nix
new file mode 100644
index 000000000000..e448d225b993
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libopcodes/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, buildPackages
+, autoreconfHook, bison, binutils-unwrapped
+, libiberty, libbfd
+}:
+
+stdenv.mkDerivation {
+  pname = "libopcodes";
+  inherit (binutils-unwrapped) version src;
+
+  outputs = [ "out" "dev" ];
+
+  patches = binutils-unwrapped.patches ++ [
+    ../../tools/misc/binutils/build-components-separately.patch
+  ];
+
+  # We just want to build libopcodes
+  postPatch = ''
+    cd opcodes
+    find . ../include/opcode -type f -exec sed {} -i -e 's/"bfd.h"/<bfd.h>/' \;
+  '';
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ autoreconfHook bison ];
+  buildInputs = [ libiberty ];
+  # dis-asm.h includes bfd.h
+  propagatedBuildInputs = [ libbfd ];
+
+  configurePlatforms = [ "build" "host" ];
+  configureFlags = [
+    "--enable-targets=all" "--enable-64-bit-bfd"
+    "--enable-install-libbfd"
+    "--enable-shared"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A library from binutils for manipulating machine code";
+    homepage = "https://www.gnu.org/software/binutils/";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ ericson2314 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libopenaptx/default.nix b/nixpkgs/pkgs/development/libraries/libopenaptx/default.nix
new file mode 100644
index 000000000000..9cc57d1a465a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libopenaptx/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "libopenaptx";
+  version = "0.2.0";
+
+  src = fetchFromGitHub {
+    owner = "pali";
+    repo = "libopenaptx";
+    rev = version;
+    sha256 = "nTpw4vWgJ765FM6Es3SzaaaZr0YDydXglb0RWLbiigI=";
+  };
+
+  makeFlags = [
+    "PREFIX=${placeholder "out"}"
+    # disable static builds
+    "ANAME="
+    "AOBJECTS="
+    "STATIC_UTILITIES="
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Audio Processing Technology codec (aptX)";
+    license = licenses.lgpl21Plus;
+    homepage = "https://github.com/pali/libopenaptx";
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ orivej ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liboping/default.nix b/nixpkgs/pkgs/development/libraries/liboping/default.nix
new file mode 100644
index 000000000000..932133e01921
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liboping/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchurl, ncurses ? null, perl ? null, lib }:
+
+stdenv.mkDerivation rec {
+  pname = "liboping";
+  version = "1.10.0";
+
+  src = fetchurl {
+    url = "https://noping.cc/files/${pname}-${version}.tar.bz2";
+    sha256 = "1n2wkmvw6n80ybdwkjq8ka43z2x8mvxq49byv61b52iyz69slf7b";
+  };
+
+  NIX_CFLAGS_COMPILE = lib.optionalString
+    stdenv.cc.isGNU "-Wno-error=format-truncation";
+
+  buildInputs = [ ncurses perl ];
+
+  configureFlags = lib.optional (perl == null) "--with-perl-bindings=no";
+
+  meta = with lib; {
+    description = "C library to generate ICMP echo requests (a.k.a. ping packets)";
+    longDescription = ''
+      liboping is a C library to generate ICMP echo requests, better known as
+      "ping packets". It is intended for use in network monitoring applications
+      or applications that would otherwise need to fork ping(1) frequently.
+      Included is a sample application, called oping, which demonstrates the
+      library's abilities.
+    '';
+    homepage = "http://noping.cc/";
+    license = licenses.lgpl21;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libopus/default.nix b/nixpkgs/pkgs/development/libraries/libopus/default.nix
new file mode 100644
index 000000000000..7a3a77931c76
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libopus/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl
+, fixedPoint ? false, withCustomModes ? true }:
+
+stdenv.mkDerivation rec {
+  pname = "libopus";
+  version = "1.3.1";
+
+  src = fetchurl {
+    url = "https://archive.mozilla.org/pub/opus/opus-${version}.tar.gz";
+    sha256 = "17gz8kxs4i7icsc1gj713gadiapyklynlwqlf0ai98dj4lg8xdb5";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  configureFlags = lib.optional fixedPoint "--enable-fixed-point"
+                ++ lib.optional withCustomModes "--enable-custom-modes";
+
+  doCheck = !stdenv.isi686 && !stdenv.isAarch32; # test_unit_LPC_inv_pred_gain fails
+
+  meta = with lib; {
+    description = "Open, royalty-free, highly versatile audio codec";
+    license = lib.licenses.bsd3;
+    homepage = "https://www.opus-codec.org/";
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libopusenc/default.nix b/nixpkgs/pkgs/development/libraries/libopusenc/default.nix
new file mode 100644
index 000000000000..3cb14a2ea99e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libopusenc/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, pkg-config, libopus }:
+
+stdenv.mkDerivation rec {
+  pname = "libopusenc";
+  version = "0.2.1";
+
+  src = fetchurl {
+    url = "https://archive.mozilla.org/pub/opus/libopusenc-${version}.tar.gz";
+    sha256 = "1ffb0vhlymlsq70pxsjj0ksz77yfm2x0a1x8q50kxmnkm1hxp642";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  doCheck = true;
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libopus ];
+
+  meta = with lib; {
+    description = "Library for encoding .opus audio files and live streams";
+    license = licenses.bsd3;
+    homepage = "https://www.opus-codec.org/";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ pmiddend ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libosinfo/default.nix b/nixpkgs/pkgs/development/libraries/libosinfo/default.nix
new file mode 100644
index 000000000000..c3852f25741f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libosinfo/default.nix
@@ -0,0 +1,84 @@
+{ lib, stdenv
+, fetchurl
+, fetchpatch
+, pkg-config
+, meson
+, ninja
+, gettext
+, gobject-introspection
+, gtk-doc
+, docbook_xsl
+, glib
+, libsoup
+, libxml2
+, libxslt
+, check
+, curl
+, perl
+, hwdata
+, osinfo-db
+, substituteAll
+, vala ? null
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libosinfo";
+  version = "1.9.0";
+
+  src = fetchurl {
+    url = "https://releases.pagure.org/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-tPNBgVTvP0PZQggnKUkWrqGCcCGvwG4WRPxWlRgwo1k=";
+  };
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  nativeBuildInputs = [
+    pkg-config
+    meson
+    ninja
+    vala
+    gettext
+    gobject-introspection
+    gtk-doc
+    docbook_xsl
+    perl # for pod2man
+  ];
+  buildInputs = [
+    glib
+    libsoup
+    libxml2
+    libxslt
+  ];
+  checkInputs = [
+    check
+    curl
+    perl
+  ];
+
+  patches = [
+    (substituteAll {
+      src = ./osinfo-db-data-dir.patch;
+      osinfo_db_data_dir = "${osinfo-db}/share";
+    })
+  ];
+
+  mesonFlags = [
+    "-Dwith-usb-ids-path=${hwdata}/share/hwdata/usb.ids"
+    "-Dwith-pci-ids-path=${hwdata}/share/hwdata/pci.ids"
+    "-Denable-gtk-doc=true"
+  ];
+
+  preCheck = ''
+    patchShebangs ../osinfo/check-symfile.pl ../osinfo/check-symsorting.pl
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "GObject based library API for managing information about operating systems, hypervisors and the (virtual) hardware devices they can support";
+    homepage = "https://libosinfo.org/";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libosinfo/osinfo-db-data-dir.patch b/nixpkgs/pkgs/development/libraries/libosinfo/osinfo-db-data-dir.patch
new file mode 100644
index 000000000000..2197eca23d9d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libosinfo/osinfo-db-data-dir.patch
@@ -0,0 +1,11 @@
+--- a/osinfo/osinfo_loader.c
++++ b/osinfo/osinfo_loader.c
+@@ -2304,7 +2304,7 @@
+     } else {
+         path = g_getenv("OSINFO_SYSTEM_DIR");
+         if (!path)
+-            path = DATA_DIR "/osinfo";
++            path = "@osinfo_db_data_dir@/osinfo";
+ 
+         file = g_file_new_for_path(path);
+     }
diff --git a/nixpkgs/pkgs/development/libraries/libosmium/default.nix b/nixpkgs/pkgs/development/libraries/libosmium/default.nix
new file mode 100644
index 000000000000..976c39a9ef11
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libosmium/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, cmake, protozero, expat, zlib, bzip2, boost }:
+
+stdenv.mkDerivation rec {
+  pname = "libosmium";
+  version = "2.17.0";
+
+  src = fetchFromGitHub {
+    owner = "osmcode";
+    repo = "libosmium";
+    rev = "v${version}";
+    sha256 = "sha256-q938WA+vJDqGVutVzWdEP7ujDAmfj3vluliomVd0om0=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ protozero zlib bzip2 expat boost ];
+
+  cmakeFlags = [ "-DINSTALL_GDALCPP:BOOL=ON" ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Fast and flexible C++ library for working with OpenStreetMap data";
+    homepage = "https://osmcode.org/libosmium/";
+    license = licenses.boost;
+    maintainers = with maintainers; [ das-g ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libosmscout/default.nix b/nixpkgs/pkgs/development/libraries/libosmscout/default.nix
new file mode 100644
index 000000000000..2f83963d205f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libosmscout/default.nix
@@ -0,0 +1,24 @@
+{ lib, mkDerivation, fetchgit, cmake, pkg-config
+, marisa, qtlocation }:
+
+mkDerivation rec {
+  pname = "libosmscout";
+  version = "2017.06.30";
+
+  src = fetchgit {
+    url = "git://git.code.sf.net/p/libosmscout/code";
+    rev = "0c0fde4d9803539c99911389bc918377a93f350c";
+    sha256 = "1pa459h52kw88mvsdvkz83f4p35vvgsfy2qfjwcj61gj4y9d2rq4";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ marisa qtlocation ];
+
+  meta = with lib; {
+    description = "Simple, high-level interfaces for offline location and POI lokup, rendering and routing functionalities based on OpenStreetMap (OSM) data";
+    homepage = "http://libosmscout.sourceforge.net/";
+    license = licenses.lgpl3Plus;
+    maintainers = [ maintainers.Thra11 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libossp-uuid/default.nix b/nixpkgs/pkgs/development/libraries/libossp-uuid/default.nix
new file mode 100644
index 000000000000..a283df1bbaea
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libossp-uuid/default.nix
@@ -0,0 +1,46 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "libossp-uuid";
+  version = "1.6.2";
+
+  src = fetchurl {
+    url = "ftp://ftp.ossp.org/pkg/lib/uuid/uuid-${version}.tar.gz";
+    sha256= "11a615225baa5f8bb686824423f50e4427acd3f70d394765bdff32801f0fd5b0";
+  };
+
+  configureFlags = [
+    "ac_cv_va_copy=yes"
+  ] ++ lib.optional stdenv.isFreeBSD "--with-pic";
+
+  patches = [ ./shtool.patch ];
+
+  meta = with lib; {
+    homepage = "http://www.ossp.org/pkg/lib/uuid/";
+    description = "OSSP uuid ISO-C and C++ shared library";
+    longDescription =
+      ''
+        OSSP uuid is a ISO-C:1999 application programming interface
+        (API) and corresponding command line interface (CLI) for the
+        generation of DCE 1.1, ISO/IEC 11578:1996 and RFC 4122
+        compliant Universally Unique Identifier (UUID). It supports
+        DCE 1.1 variant UUIDs of version 1 (time and node based),
+        version 3 (name based, MD5), version 4 (random number based)
+        and version 5 (name based, SHA-1). Additional API bindings are
+        provided for the languages ISO-C++:1998, Perl:5 and
+        PHP:4/5. Optional backward compatibility exists for the ISO-C
+        DCE-1.1 and Perl Data::UUID APIs.
+
+        UUIDs are 128 bit numbers which are intended to have a high
+        likelihood of uniqueness over space and time and are
+        computationally difficult to guess. They are globally unique
+        identifiers which can be locally generated without contacting
+        a global registration authority. UUIDs are intended as unique
+        identifiers for both mass tagging objects with an extremely
+        short lifetime and to reliably identifying very persistent
+        objects across a network.
+      '';
+    license = licenses.bsd2;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libossp-uuid/shtool.patch b/nixpkgs/pkgs/development/libraries/libossp-uuid/shtool.patch
new file mode 100644
index 000000000000..f0c7cc485f50
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libossp-uuid/shtool.patch
@@ -0,0 +1,11 @@
+--- a/shtool	2008-07-05 05:43:08.000000000 +0800
++++ b/shtool	2018-07-25 15:45:40.559587471 +0800
+@@ -1400,7 +1400,7 @@
+             if [ ".$opt_t" = .yes ]; then
+                 echo "strip $dsttmp" 1>&2
+             fi
+-            strip $dsttmp || shtool_exit $?
++            $STRIP $dsttmp || shtool_exit $?
+         fi
+         if [ ".$opt_o" != . ]; then
+             if [ ".$opt_t" = .yes ]; then
diff --git a/nixpkgs/pkgs/development/libraries/libotr/default.nix b/nixpkgs/pkgs/development/libraries/libotr/default.nix
new file mode 100644
index 000000000000..7c2a2b9a6b9a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libotr/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, libgcrypt, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  name = "libotr-4.1.1";
+
+  src = fetchurl {
+    url = "https://otr.cypherpunks.ca/${name}.tar.gz";
+    sha256 = "1x8rliydhbibmzwdbyr7pd7n87m2jmxnqkpvaalnf4154hj1hfwb";
+  };
+
+  outputs = [ "bin" "out" "dev" ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+  propagatedBuildInputs = [ libgcrypt ];
+
+  meta = with lib; {
+    homepage = "http://www.cypherpunks.ca/otr/";
+    repositories.git = "git://git.code.sf.net/p/otr/libotr";
+    license = licenses.lgpl21;
+    description = "Library for Off-The-Record Messaging";
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libow/default.nix b/nixpkgs/pkgs/development/libraries/libow/default.nix
new file mode 100644
index 000000000000..5340caeff0a8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libow/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, pkg-config, libtool }:
+
+stdenv.mkDerivation rec {
+  version = "3.2p4";
+  pname = "libow";
+
+  src = fetchFromGitHub {
+    owner = "owfs";
+    repo = "owfs";
+    rev = "v${version}";
+    sha256 = "0dln1ar7bxwhpi36sccmpwapy7iz4j097rbf02mgn42lw5vrcg3s";
+  };
+
+  nativeBuildInputs = [ autoconf automake libtool pkg-config ];
+
+  preConfigure = ''
+    # Tries to use glibtoolize on Darwin, but it shouldn't for Nix.
+    sed -i -e 's/glibtoolize/libtoolize/g' bootstrap
+    ./bootstrap
+  '';
+
+  configureFlags = [
+    "--disable-owtcl"
+    "--disable-owphp"
+    "--disable-owpython"
+    "--disable-zero"
+    "--disable-owshell"
+    "--disable-owhttpd"
+    "--disable-owftpd"
+    "--disable-owserver"
+    "--disable-owperl"
+    "--disable-owtap"
+    "--disable-owmon"
+    "--disable-owexternal"
+  ];
+
+  meta = with lib; {
+    description = "1-Wire File System full library";
+    homepage = "https://owfs.org/";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ disserman ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libowfat/default.nix b/nixpkgs/pkgs/development/libraries/libowfat/default.nix
new file mode 100644
index 000000000000..9db1354677d6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libowfat/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libowfat";
+  version = "0.32";
+
+  src = fetchurl {
+    url = "https://www.fefe.de/libowfat/${pname}-${version}.tar.xz";
+    sha256 = "1hcqg7pvy093bxx8wk7i4gvbmgnxz2grxpyy7b4mphidjbcv7fgl";
+  };
+
+  makeFlags = [ "prefix=$(out)" ];
+  enableParallelBuilding = true;
+
+  meta = with 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/libowlevelzs/default.nix b/nixpkgs/pkgs/development/libraries/libowlevelzs/default.nix
new file mode 100644
index 000000000000..e024874eabe8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libowlevelzs/default.nix
@@ -0,0 +1,27 @@
+{ cmake
+, fetchFromGitHub
+, lib
+, stdenv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libowlevelzs";
+  version = "0.1.1";
+
+  src = fetchFromGitHub {
+    owner = "zseri";
+    repo = "libowlevelzs";
+    rev = "v${version}";
+    sha256 = "y/EaMMsmJEmnptfjwiat4FC2+iIKlndC2Wdpop3t7vY=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Zscheile Lowlevel (utility) library";
+    homepage = "https://github.com/zseri/libowlevelzs";
+    license = licenses.mit;
+    maintainers = with maintainers; [ zseri ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libp11/default.nix b/nixpkgs/pkgs/development/libraries/libp11/default.nix
new file mode 100644
index 000000000000..eb577a7f5a17
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libp11/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, libtool, pkg-config
+, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "libp11";
+  version = "0.4.11";
+
+  src = fetchFromGitHub {
+    owner = "OpenSC";
+    repo = "libp11";
+    rev = "${pname}-${version}";
+    sha256 = "0hcl706i04nw5c1sj7l6sj6m0yjq6qijz345v498jll58fp5wif8";
+  };
+
+  configureFlags = [
+    "--with-enginesdir=${placeholder "out"}/lib/engines"
+  ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config libtool ];
+
+  buildInputs = [ openssl ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Small layer on top of PKCS#11 API to make PKCS#11 implementations easier";
+    homepage = "https://github.com/OpenSC/libp11";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpam-wrapper/default.nix b/nixpkgs/pkgs/development/libraries/libpam-wrapper/default.nix
new file mode 100644
index 000000000000..7d026eb5a091
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpam-wrapper/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv
+, fetchgit
+, cmake
+, linux-pam
+, enablePython ? false
+, python ? null
+}:
+
+assert enablePython -> python != null;
+
+stdenv.mkDerivation rec {
+  pname = "libpam-wrapper";
+  version = "1.1.3";
+
+  src = fetchgit {
+    url = "git://git.samba.org/pam_wrapper.git";
+    rev = "pam_wrapper-${version}";
+    sha256 = "00mqhsashx7njrvxz085d0b88nizhdy7m3x17ip5yhvwsl63km6p";
+  };
+
+  nativeBuildInputs = [ cmake ] ++ lib.optional enablePython [ python ];
+
+  # We must use linux-pam, using openpam will result in broken fprintd.
+  buildInputs = [ linux-pam ];
+
+  meta = with lib; {
+    description = "Wrapper for testing PAM modules";
+    homepage = "https://cwrap.org/pam_wrapper.html";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.elyhaka ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpaper/default.nix b/nixpkgs/pkgs/development/libraries/libpaper/default.nix
new file mode 100644
index 000000000000..b9372ba1d407
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpaper/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchurl, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  version = "1.1.28";
+  pname = "libpaper";
+
+  src = fetchurl {
+    url = "mirror://debian/pool/main/libp/libpaper/libpaper_${version}.tar.gz";
+    sha256 = "sha256-yLuUbsk9PCxyu7HXJX6QFyoipEoHoH+2uAKluyyV/dw=";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  # The configure script of libpaper is buggy: it uses AC_SUBST on a headerfile
+  # to compile sysconfdir into the library. Autoconf however defines sysconfdir
+  # as "${prefix}/etc", which is not expanded by AC_SUBST so libpaper will look
+  # for config files in (literally, without expansion) '${prefix}/etc'. Manually
+  # setting sysconfdir fixes this issue.
+  preConfigure = ''
+    configureFlagsArray+=(
+      "--sysconfdir=$out/etc"
+    )
+  '';
+
+  # Set the default paper to letter (this is what libpaper uses as default as well,
+  # if you call getdefaultpapername()).
+  # The user can still override this with the PAPERCONF environment variable.
+  postInstall = ''
+    mkdir -p $out/etc
+    echo letter > $out/etc/papersize
+  '';
+
+  meta = {
+    description = "Library for handling paper characteristics";
+    homepage = "http://packages.debian.org/unstable/source/libpaper";
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpar2/default.nix b/nixpkgs/pkgs/development/libraries/libpar2/default.nix
new file mode 100644
index 000000000000..0130af664597
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpar2/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, pkg-config, libsigcxx }:
+
+stdenv.mkDerivation rec {
+  pname = "libpar2";
+  version = "0.4";
+
+  src = fetchurl {
+    url = "https://launchpad.net/libpar2/trunk/${version}/+download/${pname}-${version}.tar.gz";
+    sha256 = "1m4ncws1h03zq7zyqbaymvjzzbh1d3lc4wb1aksrdf0ync76yv9i";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libsigcxx ];
+
+  patches = [ ./libpar2-0.4-external-verification.patch ];
+
+  CXXFLAGS = lib.optionalString stdenv.cc.isClang "-std=c++11";
+
+  meta = {
+    homepage = "http://parchive.sourceforge.net/";
+    license = lib.licenses.gpl2Plus;
+    description = "A library for using Parchives (parity archive volume sets)";
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpar2/libpar2-0.4-external-verification.patch b/nixpkgs/pkgs/development/libraries/libpar2/libpar2-0.4-external-verification.patch
new file mode 100644
index 000000000000..74879c4fe9b8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpar2/libpar2-0.4-external-verification.patch
@@ -0,0 +1,16 @@
+diff -aud -U 5 libpar2-0.4-original/par2repairer.h libpar2-0.4-patched/par2repairer.h
+--- libpar2-0.4-original/par2repairer.h	2013-07-18 15:03:10.000000000 +0200
++++ libpar2-0.4-patched/par2repairer.h	2014-08-06 15:52:59.000000000 +0200
+@@ -94,11 +94,11 @@
+   // Perform a sliding window scan of the DiskFile looking for blocks of data that 
+   // might belong to any of the source files (for which a verification packet was
+   // available). If a block of data might be from more than one source file, prefer
+   // the one specified by the "sourcefile" parameter. If the first data block
+   // found is for a different source file then "sourcefile" is changed accordingly.
+-  bool ScanDataFile(DiskFile                *diskfile,   // [in]     The file being scanned
++  virtual bool ScanDataFile(DiskFile                *diskfile,   // [in]     The file being scanned
+                     Par2RepairerSourceFile* &sourcefile, // [in/out] The source file matched
+                     MatchType               &matchtype,  // [out]    The type of match
+                     MD5Hash                 &hashfull,   // [out]    The full hash of the file
+                     MD5Hash                 &hash16k,    // [out]    The hash of the first 16k
+                     u32                     &count);     // [out]    The number of blocks found
diff --git a/nixpkgs/pkgs/development/libraries/libpcap/default.nix b/nixpkgs/pkgs/development/libraries/libpcap/default.nix
new file mode 100644
index 000000000000..f3d3587c14fa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpcap/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchurl, flex, bison, bluez, pkg-config, withBluez ? false }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "libpcap";
+  version = "1.10.1";
+
+  src = fetchurl {
+    url = "https://www.tcpdump.org/release/${pname}-${version}.tar.gz";
+    sha256 = "sha256-7ShfSsyvBTRPkJdXV7Pb/ncrpB0cQBwmSLf6RbcRvdQ=";
+  };
+
+  nativeBuildInputs = [ flex bison ]
+    ++ optionals withBluez [ bluez.dev pkg-config ];
+
+  # We need to force the autodetection because detection doesn't
+  # work in pure build environments.
+  configureFlags = [
+    "--with-pcap=${if stdenv.isLinux then "linux" else "bpf"}"
+  ] ++ optionals stdenv.isDarwin [
+    "--disable-universal"
+  ] ++ optionals (stdenv.hostPlatform == stdenv.buildPlatform)
+    [ "ac_cv_linux_vers=2" ];
+
+  postInstall = ''
+    if [ "$dontDisableStatic" -ne "1" ]; then
+      rm -f $out/lib/libpcap.a
+    fi
+  '';
+
+  meta = {
+    homepage = "https://www.tcpdump.org";
+    description = "Packet Capture Library";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ fpletz ];
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpeas/default.nix b/nixpkgs/pkgs/development/libraries/libpeas/default.nix
new file mode 100644
index 000000000000..55c884d215fd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpeas/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, gettext, gnome
+, glib, gtk3, gobject-introspection, python3, ncurses
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libpeas";
+  version = "1.30.0";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "18xrk1c1ixlhkmykcfiafrl2am470ws687xqvjlq40zwkcp5dx8b";
+  };
+
+  nativeBuildInputs = [ pkg-config meson ninja gettext gobject-introspection ];
+  buildInputs =  [ glib gtk3 ncurses python3 python3.pkgs.pygobject3 ];
+  propagatedBuildInputs = [
+    # Required by libpeas-1.0.pc
+    gobject-introspection
+  ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "A GObject-based plugins engine";
+    homepage = "https://wiki.gnome.org/Projects/Libpeas";
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+    maintainers = teams.gnome.members;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpfm/default.nix b/nixpkgs/pkgs/development/libraries/libpfm/default.nix
new file mode 100644
index 000000000000..20c4c0a1c6e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpfm/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchurl
+, enableShared ? !stdenv.hostPlatform.isStatic
+}:
+
+stdenv.mkDerivation (rec {
+  version = "4.11.0";
+  pname = "libpfm";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/perfmon2/libpfm4/${pname}-${version}.tar.gz";
+    sha256 = "1k7yp6xfsglp2b6271r622sjinlbys0dk24n9iiv656y5f3zi9ax";
+  };
+
+  makeFlags = [
+    "PREFIX=${placeholder "out"}"
+    "LDCONFIG=true"
+    "ARCH=${stdenv.hostPlatform.uname.processor}"
+    "SYS=${stdenv.hostPlatform.uname.system}"
+  ];
+
+  NIX_CFLAGS_COMPILE = "-Wno-error";
+
+  meta = with lib; {
+    description = "Helper library to program the performance monitoring events";
+    longDescription = ''
+      This package provides a library, called libpfm4 which is used to
+      develop monitoring tools exploiting the performance monitoring
+      events such as those provided by the Performance Monitoring Unit
+      (PMU) of modern processors.
+    '';
+    license = licenses.gpl2;
+    maintainers = [ maintainers.pierron ];
+    platforms = platforms.linux;
+  };
+} // lib.optionalAttrs ( ! enableShared )
+{
+  CONFIG_PFMLIB_SHARED = "n";
+}
+)
diff --git a/nixpkgs/pkgs/development/libraries/libpg_query/default.nix b/nixpkgs/pkgs/development/libraries/libpg_query/default.nix
new file mode 100644
index 000000000000..110a2167fd31
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpg_query/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, which }:
+
+stdenv.mkDerivation rec {
+  pname = "libpg_query";
+  version = "13-2.0.7";
+
+  src = fetchFromGitHub {
+    owner = "pganalyze";
+    repo = "libpg_query";
+    rev = version;
+    sha256 = "sha256-xplp7Z17NlYbXIbBdN7EWDN4numdZUBIIVg5EowFMPA=";
+  };
+
+  nativeBuildInputs = [ which ];
+
+  makeFlags = [ "build" ];
+
+  installPhase = ''
+    install -Dm644 -t $out/lib libpg_query.a
+    install -Dm644 -t $out/include pg_query.h
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/pganalyze/libpg_query";
+    description = "C library for accessing the PostgreSQL parser outside of the server environment";
+    changelog = "https://github.com/pganalyze/libpg_query/raw/${version}/CHANGELOG.md";
+    license = licenses.bsd3;
+    platforms = platforms.x86_64;
+    maintainers = [ maintainers.marsam ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpgf/default.nix b/nixpkgs/pkgs/development/libraries/libpgf/default.nix
new file mode 100644
index 000000000000..682ff485d65c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpgf/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchzip, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "libpgf";
+  version = "7.21.2";
+
+  src = fetchzip {
+    url = "mirror://sourceforge/${pname}/${pname}/${version}/${pname}.zip";
+    sha256 = "0l1j5b1d02jn27miggihlppx656i0pc70cn6x89j1rpj33zn0g9r";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  autoreconfPhase = ''
+    mv README.txt README
+    sh autogen.sh
+  '';
+
+  meta = {
+    homepage = "https://www.libpgf.org/";
+    description = "Progressive Graphics Format";
+    license = lib.licenses.lgpl21Plus;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libphonenumber/default.nix b/nixpkgs/pkgs/development/libraries/libphonenumber/default.nix
new file mode 100644
index 000000000000..f36b5436d69c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libphonenumber/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, cmake, gtest, boost, pkg-config, protobuf, icu }:
+
+stdenv.mkDerivation rec {
+  pname = "phonenumber";
+  version = "8.11.3";
+
+  src = fetchFromGitHub {
+    owner = "googlei18n";
+    repo = "libphonenumber";
+    rev = "v${version}";
+    sha256 = "06y3mh1d1mks6d0ynxp3980g712nkf8l5nyljpybsk326b246hg9";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    gtest
+    pkg-config
+  ];
+
+  buildInputs = [
+    boost
+    protobuf
+    icu
+  ];
+
+  cmakeDir = "../cpp";
+
+  checkPhase = "./libphonenumber_test";
+
+  meta = with lib; {
+    description = "Google's i18n library for parsing and using phone numbers";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ illegalprime ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpinyin/default.nix b/nixpkgs/pkgs/development/libraries/libpinyin/default.nix
new file mode 100644
index 000000000000..2d802cf28d76
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpinyin/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, fetchFromGitHub
+, autoreconfHook
+, glib
+, db
+, pkg-config
+}:
+
+let
+  modelData = fetchurl {
+    url    = "mirror://sourceforge/libpinyin/models/model17.text.tar.gz";
+    sha256 = "1kb2nswpsqlk2qm5jr7vqcp97f2dx7nvpk24lxjs1g12n252f5z0";
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "libpinyin";
+  version = "2.3.0";
+
+  src = fetchFromGitHub {
+    owner  = "libpinyin";
+    repo   = "libpinyin";
+    rev    = version;
+    sha256 = "14fkpp16s5k0pbw5wwd24pqr0qbdjgbl90n9aqwx72m03n7an40l";
+  };
+
+  postUnpack = ''
+    tar -xzf ${modelData} -C $sourceRoot/data
+  '';
+
+  nativeBuildInputs = [ autoreconfHook glib db pkg-config ];
+
+  meta = with lib; {
+    description = "Library for intelligent sentence-based Chinese pinyin input method";
+    homepage    = "https://sourceforge.net/projects/libpinyin";
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ ericsagnes ];
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpipeline/default.nix b/nixpkgs/pkgs/development/libraries/libpipeline/default.nix
new file mode 100644
index 000000000000..b5310c3cb8ca
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpipeline/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "libpipeline-1.5.3";
+
+  src = fetchurl {
+    url = "mirror://savannah/libpipeline/${name}.tar.gz";
+    sha256 = "1c5dl017xil2ssb6a5vg927bnsbc9vymfgi9ahvqbb8gypx0igsx";
+  };
+
+  patches = lib.optionals stdenv.isDarwin [ ./fix-on-osx.patch ];
+
+  meta = with lib; {
+    homepage = "http://libpipeline.nongnu.org";
+    description = "C library for manipulating pipelines of subprocesses in a flexible and convenient way";
+    platforms = platforms.unix;
+    license = licenses.gpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpipeline/fix-on-osx.patch b/nixpkgs/pkgs/development/libraries/libpipeline/fix-on-osx.patch
new file mode 100644
index 000000000000..c539e2dde970
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpipeline/fix-on-osx.patch
@@ -0,0 +1,13 @@
+diff --git a/lib/pipeline.c b/lib/pipeline.c
+index 26478f9..1612307 100644
+--- a/lib/pipeline.c
++++ b/lib/pipeline.c
+@@ -75,6 +75,8 @@
+ #   endif
+ #endif
+ 
++const char* program_name = "libpipeline";
++
+ #if defined(HAVE_SETENV) && !defined(HAVE_CLEARENV)
+ int clearenv (void)
+ {
diff --git a/nixpkgs/pkgs/development/libraries/libplacebo/default.nix b/nixpkgs/pkgs/development/libraries/libplacebo/default.nix
new file mode 100644
index 000000000000..a7da64f787a3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libplacebo/default.nix
@@ -0,0 +1,66 @@
+{ lib, stdenv
+, fetchFromGitLab
+, meson
+, ninja
+, pkg-config
+, python3Packages
+, vulkan-headers
+, vulkan-loader
+, shaderc
+, glslang
+, lcms2
+, epoxy
+, libGL
+, xorg
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libplacebo";
+  version = "3.120.3";
+
+  src = fetchFromGitLab {
+    domain = "code.videolan.org";
+    owner = "videolan";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "02hiyhnjdz3zqnzks9bi7my62a85k9k9vfgmh9fy19snsbkd6l80";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    python3Packages.Mako
+  ];
+
+  buildInputs = [
+    vulkan-headers
+    vulkan-loader
+    shaderc
+    glslang
+    lcms2
+    epoxy
+    libGL
+    xorg.libX11
+  ];
+
+  mesonFlags = [
+    "-Dvulkan-registry=${vulkan-headers}/share/vulkan/registry/vk.xml"
+    "-Ddemos=false"
+  ];
+
+  meta = with lib; {
+    description = "Reusable library for GPU-accelerated video/image rendering primitives";
+    longDescription = ''
+      Reusable library for GPU-accelerated image/view processing primitives and
+      shaders, as well a batteries-included, extensible, high-quality rendering
+      pipeline (similar to mpv's vo_gpu). Supports Vulkan, OpenGL and Metal (via
+      MoltenVK).
+    '';
+    homepage = "https://code.videolan.org/videolan/libplacebo";
+    changelog = "https://code.videolan.org/videolan/libplacebo/-/tags/v${version}";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ primeos tadeokondrak ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libplctag/default.nix b/nixpkgs/pkgs/development/libraries/libplctag/default.nix
new file mode 100644
index 000000000000..41283ed7ccd0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libplctag/default.nix
@@ -0,0 +1,27 @@
+{ lib
+, stdenv
+, cmake
+, fetchFromGitHub
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libplctag";
+  version = "2.3.6";
+
+  src = fetchFromGitHub {
+    owner = "libplctag";
+    repo = "libplctag";
+    rev = "v${version}";
+    sha256 = "sha256-mrNEUNYxnRyKhUCz+exp6Upf2g/L6WnYJ8alcIx5wMc=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://github.com/libplctag/libplctag";
+    description = "Library that uses EtherNet/IP or Modbus TCP to read and write tags in PLCs";
+    license = with licenses; [ lgpl2Plus mpl20 ];
+    maintainers = with maintainers; [ petterstorvik ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libplist/default.nix b/nixpkgs/pkgs/development/libraries/libplist/default.nix
new file mode 100644
index 000000000000..cac4299f2890
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libplist/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, autoreconfHook, fetchFromGitHub, pkg-config, enablePython ? false, python ? null, glib }:
+
+stdenv.mkDerivation rec {
+  pname = "libplist";
+  version = "2.2.0";
+
+  src = fetchFromGitHub {
+    owner = "libimobiledevice";
+    repo = pname;
+    rev = version;
+    sha256 = "1vxhpjxniybqsg5wcygmdmr5dv7p2zb34dqnd3bi813rnnzsdjm6";
+  };
+
+  outputs = ["bin" "dev" "out" ] ++ lib.optional enablePython "py";
+
+  nativeBuildInputs = [
+    pkg-config
+    autoreconfHook
+  ] ++ lib.optionals enablePython [
+    python
+    python.pkgs.cython
+  ];
+
+  configureFlags = lib.optionals (!enablePython) [
+    "--without-cython"
+  ];
+
+  propagatedBuildInputs = [ glib ];
+
+  postFixup = lib.optionalString enablePython ''
+    moveToOutput "lib/${python.libPrefix}" "$py"
+  '';
+
+  meta = with lib; {
+    description = "A library to handle Apple Property List format in binary or XML";
+    homepage = "https://github.com/libimobiledevice/libplist";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ infinisil ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpng/12.nix b/nixpkgs/pkgs/development/libraries/libpng/12.nix
new file mode 100644
index 000000000000..bf3d5168d6c6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpng/12.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, zlib }:
+
+assert stdenv.hostPlatform == stdenv.buildPlatform -> zlib != null;
+
+stdenv.mkDerivation rec {
+  name = "libpng-1.2.59";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libpng/${name}.tar.xz";
+    sha256 = "1izw9ybm27llk8531w6h4jp4rk2rxy2s9vil16nwik5dp0amyqxl";
+  };
+
+  outputs = [ "out" "dev" "man" ];
+
+  propagatedBuildInputs = [ zlib ];
+
+  passthru = { inherit zlib; };
+
+  configureFlags = [ "--enable-static" ];
+
+  postInstall = ''mv "$out/bin" "$dev/bin"'';
+
+  meta = with lib; {
+    description = "The official reference implementation for the PNG file format";
+    homepage = "http://www.libpng.org/pub/png/libpng.html";
+    license = licenses.libpng;
+    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
new file mode 100644
index 000000000000..aeb3fcba06fa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpng/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchurl, zlib, apngSupport ? true }:
+
+assert zlib != null;
+
+let
+  patchVersion = "1.6.37";
+  patch_src = fetchurl {
+    url = "mirror://sourceforge/libpng-apng/libpng-${patchVersion}-apng.patch.gz";
+    sha256 = "1dh0250mw9b2hx7cdmnb2blk7ddl49n6vx8zz7jdmiwxy38v4fw2";
+  };
+  whenPatched = lib.optionalString apngSupport;
+
+in stdenv.mkDerivation rec {
+  name = "libpng" + whenPatched "-apng" + "-${version}";
+  version = "1.6.37";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libpng/libpng-${version}.tar.xz";
+    sha256 = "1jl8in381z0128vgxnvn33nln6hzckl7l7j9nqvkaf1m9n1p0pjh";
+  };
+  postPatch = whenPatched "gunzip < ${patch_src} | patch -Np1";
+
+  outputs = [ "out" "dev" "man" ];
+  outputBin = "dev";
+
+  propagatedBuildInputs = [ zlib ];
+
+  doCheck = true;
+
+  passthru = { inherit zlib; };
+
+  meta = with lib; {
+    description = "The official reference implementation for the PNG file format" + whenPatched " with animation patch";
+    homepage = "http://www.libpng.org/pub/png/libpng.html";
+    license = licenses.libpng2;
+    platforms = platforms.all;
+    maintainers = [ maintainers.vcunat ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpointmatcher/default.nix b/nixpkgs/pkgs/development/libraries/libpointmatcher/default.nix
new file mode 100644
index 000000000000..31fb5cb05ba7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpointmatcher/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, cmake, eigen, boost, libnabo }:
+
+stdenv.mkDerivation rec {
+  pname = "libpointmatcher";
+  version = "1.3.1";
+
+  src = fetchFromGitHub {
+    owner = "ethz-asl";
+    repo = pname;
+    rev = version;
+    sha256 = "0lai6sr3a9dj1j4pgjjyp7mx10wixy5wpvbka8nsc2danj6xhdyd";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ eigen boost libnabo ];
+
+  cmakeFlags = [
+    "-DEIGEN_INCLUDE_DIR=${eigen}/include/eigen3"
+  ];
+
+  doCheck = true;
+  checkPhase = ''
+    export LD_LIBRARY_PATH=$PWD
+    ./utest/utest --path ../examples/data/
+  '';
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "An \"Iterative Closest Point\" library for 2-D/3-D mapping in robotic";
+    license = licenses.bsd3;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ cryptix ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libportal/default.nix b/nixpkgs/pkgs/development/libraries/libportal/default.nix
new file mode 100644
index 000000000000..97c5303eabe7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libportal/default.nix
@@ -0,0 +1,46 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, meson
+, ninja
+, pkg-config
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_45
+, glib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libportal";
+  version = "0.4";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchFromGitHub {
+    owner = "flatpak";
+    repo = pname;
+    rev = version;
+    sha256 = "fuYZWGkdazq6H0rThqpF6KIcvwgc17o+CiISb1LjBso=";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gtk-doc
+    docbook-xsl-nons
+    docbook_xml_dtd_45
+  ];
+
+  propagatedBuildInputs = [
+    glib
+  ];
+
+  meta = with lib; {
+    description = "Flatpak portal library";
+    homepage = "https://github.com/flatpak/libportal";
+    license = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpostal/default.nix b/nixpkgs/pkgs/development/libraries/libpostal/default.nix
new file mode 100644
index 000000000000..d32cb2731a11
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpostal/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "libpostal";
+  version = "1.1";
+
+  src = fetchFromGitHub {
+    owner = "openvenues";
+    repo = "libpostal";
+    rev = "v${version}";
+    sha256 = "sha256-gQTD2LQibaB2TK0SbzoILAljAGExURvDcF3C/TfDXqk=";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  configureFlags = [
+    "--disable-data-download"
+  ] ++ lib.optionals stdenv.hostPlatform.isAarch64 [ "--disable-sse2" ];
+
+  meta = with lib; {
+    description = "A C library for parsing/normalizing street addresses around the world. Powered by statistical NLP and open geo data";
+    homepage = "https://github.com/openvenues/libpostal";
+    license = licenses.mit;
+    maintainers = [ maintainers.Thra11 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpqxx/6.nix b/nixpkgs/pkgs/development/libraries/libpqxx/6.nix
new file mode 100644
index 000000000000..feb9c7e65147
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpqxx/6.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, postgresql, doxygen, xmlto, python2, gnused }:
+
+stdenv.mkDerivation rec {
+  pname = "libpqxx";
+  version = "6.4.5";
+
+  src = fetchFromGitHub {
+    owner = "jtv";
+    repo = pname;
+    rev = version;
+    sha256 = "0djmjr2b5x5nd2a4idv5j8s6w0kdmvil910iv1kyc7x94dirbrni";
+  };
+
+  nativeBuildInputs = [ gnused python2 ];
+  buildInputs = [ postgresql doxygen xmlto ];
+
+  preConfigure = ''
+    patchShebangs .
+  '';
+
+  configureFlags = [ "--enable-shared" ];
+
+  meta = {
+    description = "A C++ library to access PostgreSQL databases";
+    homepage = "http://pqxx.org/development/libpqxx/";
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.unix;
+    maintainers = [ lib.maintainers.eelco ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpqxx/default.nix b/nixpkgs/pkgs/development/libraries/libpqxx/default.nix
new file mode 100644
index 000000000000..e95adbd62942
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpqxx/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, postgresql, python3, gnused }:
+
+stdenv.mkDerivation rec {
+  pname = "libpqxx";
+  version = "7.6.0";
+
+  src = fetchFromGitHub {
+    owner = "jtv";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-shcGJebjXJ3ORvcdINJFLiuW7ySqe6HyPUQioeUG/wM=";
+  };
+
+  nativeBuildInputs = [ gnused python3 ];
+  buildInputs = [ postgresql ];
+
+  preConfigure = ''
+    patchShebangs ./tools/splitconfig
+  '';
+
+  configureFlags = [ "--enable-shared --disable-documentation" ];
+
+  meta = {
+    description = "A C++ library to access PostgreSQL databases";
+    homepage = "http://pqxx.org/development/libpqxx/";
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.unix;
+    maintainers = [ lib.maintainers.eelco ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libproxy/default.nix b/nixpkgs/pkgs/development/libraries/libproxy/default.nix
new file mode 100644
index 000000000000..c5d6bc4612f3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libproxy/default.nix
@@ -0,0 +1,74 @@
+{ lib, stdenv
+, fetchFromGitHub
+, pkg-config
+, cmake
+, zlib
+, dbus
+, networkmanager
+, enableJavaScript ? stdenv.isDarwin || lib.meta.availableOn stdenv.hostPlatform spidermonkey_68
+, spidermonkey_68
+, pcre
+, gsettings-desktop-schemas
+, glib
+, makeWrapper
+, python3
+, SystemConfiguration
+, CoreFoundation
+, JavaScriptCore
+}:
+
+let
+  jsRuntime = if stdenv.hostPlatform.isDarwin then JavaScriptCore else spidermonkey_68;
+in stdenv.mkDerivation rec {
+  pname = "libproxy";
+  version = "0.4.17";
+
+  src = fetchFromGitHub {
+    owner = "libproxy";
+    repo = "libproxy";
+    rev = version;
+    sha256 = "0v8q4ln0pd5231kidpi8wpwh0chcjwcmawcki53czlpdrc09z96r";
+  };
+
+  outputs = [ "out" "dev" "py3" ];
+
+  nativeBuildInputs = [
+    pkg-config
+    cmake
+    makeWrapper
+  ];
+
+  buildInputs = [
+    pcre
+    python3
+    zlib
+  ] ++ lib.optionals enableJavaScript [
+    jsRuntime
+  ] ++ (if stdenv.hostPlatform.isDarwin then [
+    SystemConfiguration
+    CoreFoundation
+  ] else [
+    glib
+    dbus
+    networkmanager
+  ]);
+
+  cmakeFlags = [
+    "-DWITH_PYTHON2=OFF"
+    "-DPYTHON3_SITEPKG_DIR=${placeholder "py3"}/${python3.sitePackages}"
+  ] ++ lib.optional (enableJavaScript && !stdenv.hostPlatform.isDarwin) "-DWITH_MOZJS=ON";
+
+  postFixup = lib.optionalString stdenv.isLinux ''
+    # config_gnome3 uses the helper to find GNOME proxy settings
+    wrapProgram $out/libexec/pxgsettings --prefix XDG_DATA_DIRS : "${gsettings-desktop-schemas}/share/gsettings-schemas/${gsettings-desktop-schemas.name}"
+  '';
+
+  doCheck = false; # fails 1 out of 10 tests
+
+  meta = with lib; {
+    platforms = platforms.linux ++ platforms.darwin;
+    license = licenses.lgpl21;
+    homepage = "http://libproxy.github.io/libproxy/";
+    description = "A library that provides automatic proxy configuration management";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpseudo/default.nix b/nixpkgs/pkgs/development/libraries/libpseudo/default.nix
new file mode 100644
index 000000000000..f06381505739
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpseudo/default.nix
@@ -0,0 +1,28 @@
+{lib, stdenv, fetchurl, pkg-config, glib, ncurses}:
+stdenv.mkDerivation rec {
+  name = "libpseudo-1.2.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libpseudo/${name}.tar.gz";
+    sha256 = "0d3pw0m3frycr3x5kzqcaj4r2qh43iv6b0fpd6l4yk0aa4a9560n";
+  };
+
+  patchPhase = ''
+    sed -i -e s@/usr/local@$out@ -e /ldconfig/d Makefile
+  '';
+
+  preInstall = ''
+    mkdir -p $out/include
+    mkdir -p $out/lib
+  '';
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ glib ncurses ];
+
+  meta = with lib; {
+    homepage = "http://libpseudo.sourceforge.net/";
+    description = "Simple, thread-safe messaging between threads";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpsl/default.nix b/nixpkgs/pkgs/development/libraries/libpsl/default.nix
new file mode 100644
index 000000000000..85afe93ea7a7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpsl/default.nix
@@ -0,0 +1,88 @@
+{ lib, stdenv
+, fetchurl
+, autoreconfHook
+, docbook_xsl
+, docbook_xml_dtd_43
+, gtk-doc
+, lzip
+, libidn2
+, libunistring
+, libxslt
+, pkg-config
+, python3
+, valgrind
+, publicsuffix-list
+}:
+
+let
+  enableValgrindTests = !stdenv.isDarwin && lib.meta.availableOn stdenv.hostPlatform valgrind;
+in stdenv.mkDerivation rec {
+  pname = "libpsl";
+  version = "0.21.0";
+
+  src = fetchurl {
+    url = "https://github.com/rockdaboot/${pname}/releases/download/${pname}-${version}/${pname}-${version}.tar.lz";
+    sha256 = "183hadbira0d2zvv8272lspy31dgm9x26z35c61s5axcd5wd9g9i";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    docbook_xsl
+    docbook_xml_dtd_43
+    gtk-doc
+    lzip
+    pkg-config
+    python3
+    libxslt
+  ] ++ lib.optionals enableValgrindTests [
+    valgrind
+  ];
+
+  buildInputs = [
+    libidn2
+    libunistring
+    libxslt
+  ];
+
+  propagatedBuildInputs = [
+    publicsuffix-list
+  ];
+
+  postPatch = ''
+    patchShebangs src/psl-make-dafsa
+  '';
+
+  preAutoreconf = ''
+    gtkdocize
+  '';
+
+  configureFlags = [
+    # "--enable-gtk-doc"
+    "--enable-man"
+    "--with-psl-distfile=${publicsuffix-list}/share/publicsuffix/public_suffix_list.dat"
+    "--with-psl-file=${publicsuffix-list}/share/publicsuffix/public_suffix_list.dat"
+    "--with-psl-testfile=${publicsuffix-list}/share/publicsuffix/test_psl.txt"
+  ] ++ lib.optionals enableValgrindTests [
+    "--enable-valgrind-tests"
+  ];
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "C library for the Publix Suffix List";
+    longDescription = ''
+      libpsl is a C library for the Publix Suffix List (PSL). A "public suffix"
+      is a domain name under which Internet users can directly register own
+      names. Browsers and other web clients can use it to avoid privacy-leaking
+      "supercookies" and "super domain" certificates, for highlighting parts of
+      the domain in a user interface or sorting domain lists by site.
+    '';
+    homepage = "https://rockdaboot.github.io/libpsl/";
+    changelog = "https://raw.githubusercontent.com/rockdaboot/${pname}/${pname}-${version}/NEWS";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.c0bw3b ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpst/default.nix b/nixpkgs/pkgs/development/libraries/libpst/default.nix
new file mode 100644
index 000000000000..f51db1d6c6de
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpst/default.nix
@@ -0,0 +1,52 @@
+{ lib
+, stdenv
+, fetchurl
+, autoreconfHook
+, pkg-config
+, bzip2
+, doxygen
+, gettext
+, imagemagick
+, libgsf
+, xmlto
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libpst";
+  version = "0.6.76";
+
+  src = fetchurl {
+    url = "http://www.five-ten-sg.com/libpst/packages/${pname}-${version}.tar.gz";
+    sha256 = "0hhbbb8ddsgjhv9y1xd8s9ixlhdnjmhw12v06jwx4j6vpgp1na9x";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+    doxygen
+    gettext
+    xmlto
+  ];
+
+  buildInputs = [
+    bzip2
+    imagemagick
+    libgsf
+  ];
+
+  configureFlags = [
+    "--enable-python=no"
+    "--disable-static"
+    "--enable-libpst-shared"
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://www.five-ten-sg.com/libpst/";
+    description = "A library to read PST (MS Outlook Personal Folders) files";
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.tohl ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libpwquality/default.nix b/nixpkgs/pkgs/development/libraries/libpwquality/default.nix
new file mode 100644
index 000000000000..5d83b137b8e6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libpwquality/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, lib, fetchFromGitHub, autoreconfHook, perl, cracklib, python3, fetchpatch }:
+
+stdenv.mkDerivation rec {
+  pname = "libpwquality";
+  version = "1.4.2";
+
+  src = fetchFromGitHub {
+    owner = "libpwquality";
+    repo = "libpwquality";
+    rev = "${pname}-${version}";
+    sha256 = "0n4pjhm7wfivk0wizggaxq4y4mcxic876wcarjabkp5z9k14y36h";
+  };
+
+  nativeBuildInputs = [ autoreconfHook perl python3 ];
+  buildInputs = [ cracklib ];
+
+  patches = lib.optional stdenv.hostPlatform.isStatic [
+    (fetchpatch {
+      name = "static-build.patch";
+      url = "https://github.com/libpwquality/libpwquality/pull/40.patch";
+      sha256 = "1ypccq437wxwgddd98cvd330jfm7jscdlzlyxgy05g6yzrr68xyk";
+    })
+  ];
+
+  configureFlags = lib.optional stdenv.hostPlatform.isStatic [
+    # Python binding generates a shared library which are unavailable with musl build
+    "--disable-python-bindings"
+  ];
+
+  meta = with lib; {
+    description = "Password quality checking and random password generation library";
+    homepage = "https://github.com/libpwquality/libpwquality";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libqalculate/default.nix b/nixpkgs/pkgs/development/libraries/libqalculate/default.nix
new file mode 100644
index 000000000000..75b3dab36cb6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libqalculate/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchFromGitHub, mpfr, libxml2, intltool, pkg-config, doxygen,
+  autoreconfHook, readline, libiconv, icu, curl, gnuplot, gettext }:
+
+stdenv.mkDerivation rec {
+  pname = "libqalculate";
+  version = "3.20.1";
+
+  src = fetchFromGitHub {
+    owner = "qalculate";
+    repo = "libqalculate";
+    rev = "v${version}";
+    sha256 = "sha256-8SYI8CoeTfZXX0CgLnfl0rHwUZbYM7OGYzFQ41jm5Qs=";
+  };
+
+  outputs = [ "out" "dev" "doc" ];
+
+  nativeBuildInputs = [ intltool pkg-config autoreconfHook doxygen ];
+  buildInputs = [ curl gettext libiconv readline ];
+  propagatedBuildInputs = [ libxml2 mpfr icu ];
+  enableParallelBuilding = true;
+
+  preConfigure = ''
+    intltoolize -f
+  '';
+
+  patchPhase = ''
+    substituteInPlace libqalculate/Calculator-plot.cc \
+      --replace 'commandline = "gnuplot"' 'commandline = "${gnuplot}/bin/gnuplot"' \
+      --replace '"gnuplot - ' '"${gnuplot}/bin/gnuplot - '
+  '' + lib.optionalString stdenv.cc.isClang ''
+    substituteInPlace src/qalc.cc \
+      --replace 'printf(_("aborted"))' 'printf("%s", _("aborted"))'
+  '';
+
+  preBuild = ''
+    pushd docs/reference
+    doxygen Doxyfile
+    popd
+  '';
+
+  meta = with lib; {
+    description = "An advanced calculator library";
+    homepage = "http://qalculate.github.io";
+    maintainers = with maintainers; [ gebner ];
+    license = licenses.gpl2Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libqb/default.nix b/nixpkgs/pkgs/development/libraries/libqb/default.nix
new file mode 100644
index 000000000000..73938bd8f973
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libqb/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, libxml2 }:
+
+stdenv.mkDerivation rec {
+  pname = "libqb";
+  version = "2.0.3";
+
+  src = fetchFromGitHub {
+    owner = "ClusterLabs";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-a9CnqfrQUL0DdPPOJjfh9tQ0O8iRHPP3iBmy3MKvt/0=";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  buildInputs = [ libxml2 ];
+
+  meta = with lib; {
+    homepage = "https://github.com/clusterlabs/libqb";
+    description = "A library providing high performance logging, tracing, ipc, and poll";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libqglviewer/default.nix b/nixpkgs/pkgs/development/libraries/libqglviewer/default.nix
new file mode 100644
index 000000000000..65d7a83a8384
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libqglviewer/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, qmake, qtbase, libGLU, AGL }:
+
+stdenv.mkDerivation rec {
+  pname = "libqglviewer";
+  version = "2.7.2";
+
+  src = fetchurl {
+    url = "http://www.libqglviewer.com/src/libQGLViewer-${version}.tar.gz";
+    sha256 = "023w7da1fyn2z69nbkp2rndiv886zahmc5cmira79zswxjfpklp2";
+  };
+
+  nativeBuildInputs = [ qmake ];
+  buildInputs = [ qtbase libGLU ]
+    ++ lib.optional stdenv.isDarwin AGL;
+
+  dontWrapQtApps = true;
+
+  postPatch = ''
+    cd QGLViewer
+  '';
+
+  meta = with lib; {
+    description = "C++ library based on Qt that eases the creation of OpenGL 3D viewers";
+    homepage = "http://libqglviewer.com";
+    license = licenses.gpl2;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libqmi/default.nix b/nixpkgs/pkgs/development/libraries/libqmi/default.nix
new file mode 100644
index 000000000000..157445cfee82
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libqmi/default.nix
@@ -0,0 +1,68 @@
+{ lib
+, stdenv
+, fetchurl
+, pkg-config
+, gobject-introspection
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+, glib
+, python3
+, libgudev
+, libmbim
+, libqrtr-glib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libqmi";
+  version = "1.28.6";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "https://www.freedesktop.org/software/libqmi/${pname}-${version}.tar.xz";
+    sha256 = "1zg5k8f6l87iy9hmzwckdx532s845z9c5npblmpf1pp17n4r1f6b";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    gobject-introspection
+    python3
+    gtk-doc
+    docbook-xsl-nons
+    docbook_xml_dtd_43
+  ];
+
+  buildInputs = [
+    libgudev
+    libmbim
+  ];
+
+  propagatedBuildInputs = [
+    glib
+    libqrtr-glib
+  ];
+
+  configureFlags = [
+    "--with-udev-base-dir=${placeholder "out"}/lib/udev"
+    "--enable-gtk-doc"
+    "--enable-introspection"
+  ];
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://www.freedesktop.org/wiki/Software/libqmi/";
+    description = "Modem protocol helper library";
+    maintainers = teams.freedesktop.members;
+    platforms = platforms.linux;
+    license = with licenses; [
+      # Library
+      lgpl2Plus
+      # Tools
+      gpl2Plus
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libqrtr-glib/default.nix b/nixpkgs/pkgs/development/libraries/libqrtr-glib/default.nix
new file mode 100644
index 000000000000..29097710a697
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libqrtr-glib/default.nix
@@ -0,0 +1,46 @@
+{ lib
+, stdenv
+, fetchurl
+, pkg-config
+, gobject-introspection
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_43
+, glib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libqrtr-glib";
+  version = "1.0.0";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "https://www.freedesktop.org/software/libqmi/${pname}-${version}.tar.xz";
+    sha256 = "MNh5sq3m+PRh3vOmd3VdtcAji6v2iNXIPAOz5qvjXO4=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    gobject-introspection
+    gtk-doc
+    docbook-xsl-nons
+    docbook_xml_dtd_43
+  ];
+
+  buildInputs = [
+    glib
+  ];
+
+  configureFlags = [
+    "--enable-gtk-doc"
+  ];
+
+  meta = with lib; {
+    homepage = "https://gitlab.freedesktop.org/mobile-broadband/libqrtr-glib";
+    description = "Qualcomm IPC Router protocol helper library";
+    maintainers = teams.freedesktop.members;
+    platforms = platforms.linux;
+    license = licenses.lgpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libqtav/default.nix b/nixpkgs/pkgs/development/libraries/libqtav/default.nix
new file mode 100644
index 000000000000..e9a54dc478cd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libqtav/default.nix
@@ -0,0 +1,50 @@
+{ mkDerivation, lib, fetchFromGitHub, extra-cmake-modules
+, qtbase, qtmultimedia, qtquick1, qttools
+, libGL, libX11
+, libass, openal, ffmpeg, libuchardet
+, alsa-lib, libpulseaudio, libva
+}:
+
+with lib;
+
+mkDerivation rec {
+  pname = "libqtav";
+  version = "git-2020-09-10";
+
+  nativeBuildInputs = [ extra-cmake-modules qttools ];
+  buildInputs = [
+    qtbase qtmultimedia qtquick1
+    libGL libX11
+    libass openal ffmpeg libuchardet
+    alsa-lib libpulseaudio libva
+  ];
+
+  src = fetchFromGitHub {
+    sha256 = "0qwrk40dihkbwmm7krz6qaqyn9v3qdjnd2k9b4s3a67x4403pib3";
+    rev = "2a470d2a8d2fe22fae969bee5d594909a07b350a";
+    repo = "QtAV";
+    owner = "wang-bin";
+    fetchSubmodules = true;
+  };
+
+  # 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";
+
+  preFixup = ''
+    mkdir -p "$out/bin"
+    cp -a "./bin/"* "$out/bin"
+  '';
+
+  stripDebugList = [ "lib" "libexec" "bin" "qml" ];
+
+  meta = {
+    description = "A multimedia playback framework based on Qt + FFmpeg";
+    #license = licenses.lgpl21; # For the libraries / headers only.
+    license = licenses.gpl3; # With the examples (under bin) and most likely some of the optional dependencies used.
+    homepage = "http://www.qtav.org/";
+    maintainers = [ maintainers.jraygauthier ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libquotient/default.nix b/nixpkgs/pkgs/development/libraries/libquotient/default.nix
new file mode 100644
index 000000000000..6264a9de3691
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libquotient/default.nix
@@ -0,0 +1,24 @@
+{ mkDerivation, lib, fetchFromGitHub, cmake, qtbase, qtmultimedia }:
+
+mkDerivation rec {
+  pname = "libquotient";
+  version = "0.6.8";
+
+  src = fetchFromGitHub {
+    owner = "quotient-im";
+    repo = "libQuotient";
+    rev = version;
+    sha256 = "sha256-CrAK0yq1upB1+C2z6mqKkSArCmzI+TDEEHTIBWB29Go=";
+  };
+
+  buildInputs = [ qtbase qtmultimedia ];
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "A Qt5 library to write cross-platform clients for Matrix";
+    homepage = "https://matrix.org/docs/projects/sdk/quotient";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ colemickens ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libr3/default.nix b/nixpkgs/pkgs/development/libraries/libr3/default.nix
new file mode 100644
index 000000000000..34ac547f4920
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libr3/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv
+, fetchFromGitHub
+, pcre
+, pkg-config
+, check
+, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "r3";
+  version = "1.3.4";
+
+  src = fetchFromGitHub {
+    owner = "c9s";
+    repo = "r3";
+    rev = version;
+    sha256 = "09cixbms817p6nb77wz3rxp0znnac8ybycvsrrzgwlbfn58a3zwl";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  buildInputs = [ check ];
+  propagatedBuildInputs = [ pcre ];
+
+  strictDeps = true;
+
+  meta = {
+    description = "A high-performance path dispatching library";
+    homepage = "https://github.com/c9s/r3";
+    license = [ lib.licenses.mit ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/libraspberrypi/default.nix b/nixpkgs/pkgs/development/libraries/libraspberrypi/default.nix
new file mode 100644
index 000000000000..a0b959d178f1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libraspberrypi/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libraspberrypi";
+  version = "unstable-2021-06-23";
+
+  src = fetchFromGitHub {
+    owner = "raspberrypi";
+    repo = "userland";
+    rev = "97bc8180ad682b004ea224d1db7b8e108eda4397";
+    sha256 = "0cnjc7w8ynayj90vlpl13xzm9izd8m5b4cvrq52si9vc6wlm4in5";
+  };
+
+  patches = [
+    (fetchpatch {
+      # https://github.com/raspberrypi/userland/pull/670
+      url = "https://github.com/raspberrypi/userland/commit/37cb44f314ab1209fe2a0a2449ef78893b1e5f62.patch";
+      sha256 = "1fbrbkpc4cc010ji8z4ll63g17n6jl67kdy62m74bhlxn72gg9rw";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  cmakeFlags = [
+    (if (stdenv.hostPlatform.isAarch64) then "-DARM64=ON" else "-DARM64=OFF")
+    "-DVMCS_INSTALL_PREFIX=${placeholder "out"}"
+  ];
+
+  meta = with lib; {
+    description = "Userland tools & libraries for interfacing with Raspberry Pi hardware";
+    homepage = "https://github.com/raspberrypi/userland";
+    license = licenses.bsd3;
+    platforms = [ "armv6l-linux" "armv7l-linux" "aarch64-linux" "x86_64-linux" ];
+    maintainers = with maintainers; [ dezgeg tkerber ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libraw/default.nix b/nixpkgs/pkgs/development/libraries/libraw/default.nix
new file mode 100644
index 000000000000..3ff7e725f3d8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libraw/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, lcms2, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "libraw";
+  version = "0.20.2";
+
+  src = fetchFromGitHub {
+    owner = "LibRaw";
+    repo = "LibRaw";
+    rev = version;
+    sha256 = "16nm4r2l5501c9zvz25pzajq5id592jhn068scjxhr8np2cblybc";
+  };
+
+  outputs = [ "out" "lib" "dev" "doc" ];
+
+  propagatedBuildInputs = [ lcms2 ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Library for reading RAW files obtained from digital photo cameras (CRW/CR2, NEF, RAF, DNG, and others)";
+    homepage = "https://www.libraw.org/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/libraw1394/default.nix b/nixpkgs/pkgs/development/libraries/libraw1394/default.nix
new file mode 100644
index 000000000000..184cb2e7de4a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libraw1394/default.nix
@@ -0,0 +1,18 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libraw1394";
+  version = "2.1.2";
+
+  src = fetchurl {
+    url = "mirror://kernel/linux/libs/ieee1394/${pname}-${version}.tar.gz";
+    sha256 = "0z5md84941ky5l7afayx2z6j0sk0mildxbjajq6niznd44ky7i6x";
+  };
+
+  meta = with lib; {
+    description = "Library providing direct access to the IEEE 1394 bus through the Linux 1394 subsystem's raw1394 user space interface";
+    homepage = "https://ieee1394.wiki.kernel.org/index.php/Libraries#libraw1394";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librdf/raptor.nix b/nixpkgs/pkgs/development/libraries/librdf/raptor.nix
new file mode 100644
index 000000000000..ef755b821550
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librdf/raptor.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, libxml2, curl }:
+
+stdenv.mkDerivation rec {
+  name = "raptor-1.4.21";
+
+  src = fetchurl {
+    url = "http://download.librdf.org/source/${name}.tar.gz";
+    sha256 = "db3172d6f3c432623ed87d7d609161973d2f7098e3d2233d0702fbcc22cfd8ca";
+  };
+
+  buildInputs = [ libxml2 curl ];
+
+  preBuild = ''
+    sed -e '/curl\/types/d' -i src/*.c src/*.h
+  '';
+
+  meta = {
+    description = "The RDF Parser Toolkit";
+    homepage = "https://librdf.org/raptor";
+    license = with lib.licenses; [ lgpl21 asl20 ];
+    maintainers = [ lib.maintainers.marcweber ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librdf/raptor2.nix b/nixpkgs/pkgs/development/libraries/librdf/raptor2.nix
new file mode 100644
index 000000000000..656558146857
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librdf/raptor2.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, libxml2, libxslt }:
+
+stdenv.mkDerivation rec {
+  pname = "raptor2";
+  version = "2.0.15";
+
+  src = fetchurl {
+    url = "http://download.librdf.org/source/${pname}-${version}.tar.gz";
+    sha256 = "ada7f0ba54787b33485d090d3d2680533520cd4426d2f7fb4782dd4a6a1480ed";
+  };
+
+  patches = [
+    (fetchurl {
+      name = "CVE-2017-18926.patch";
+      url = "https://github.com/dajobe/raptor/commit/590681e546cd9aa18d57dc2ea1858cb734a3863f.patch";
+      sha256 = "1qlpb5rm3j2yi0x6zgdi5apymg5zlvwq3g1zl417gkjrlvxmndgp";
+    })
+  ];
+
+  buildInputs = [ libxml2 libxslt ];
+
+  postInstall = "rm -rvf $out/share/gtk-doc";
+
+  meta = {
+    description = "The RDF Parser Toolkit";
+    homepage = "https://librdf.org/raptor";
+    license = with lib.licenses; [ lgpl21 asl20 ];
+    maintainers = with lib.maintainers; [ marcweber ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librdf/rasqal.nix b/nixpkgs/pkgs/development/libraries/librdf/rasqal.nix
new file mode 100644
index 000000000000..0dd5b87377f3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librdf/rasqal.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, librdf_raptor2, gmp, pkg-config, pcre, libxml2, perl }:
+
+stdenv.mkDerivation rec {
+  name = "rasqal-0.9.33";
+
+  src = fetchurl {
+    url = "http://download.librdf.org/source/${name}.tar.gz";
+    sha256 = "0z6rrwn4jsagvarg8d5zf0j352kjgi33py39jqd29gbhcnncj939";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ gmp pcre libxml2 ];
+
+  propagatedBuildInputs = [ librdf_raptor2 ];
+
+  postInstall = "rm -rvf $out/share/gtk-doc";
+
+  checkInputs = [ perl ];
+  doCheck = false; # fails with "No testsuite plan file sparql-query-plan.ttl could be created in build/..."
+  doInstallCheck = false; # fails with "rasqal-config does not support (--help|--version)"
+
+  meta = {
+    description = "Library that handles Resource Description Framework (RDF)";
+    homepage = "https://librdf.org/rasqal";
+    license = with lib.licenses; [ lgpl21 asl20 ];
+    maintainers = with lib.maintainers; [ marcweber ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librdf/redland.nix b/nixpkgs/pkgs/development/libraries/librdf/redland.nix
new file mode 100644
index 000000000000..5ac2c711104b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librdf/redland.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, fetchurl, pkg-config, openssl, libxslt, perl
+, curl, pcre, libxml2, librdf_rasqal, gmp
+, libmysqlclient, withMysql ? false
+, postgresql, withPostgresql ? false
+, sqlite, withSqlite ? true
+, db, withBdb ? false
+}:
+
+stdenv.mkDerivation rec {
+  name = "redland-1.0.17";
+
+  src = fetchurl {
+    url = "http://download.librdf.org/source/${name}.tar.gz";
+    sha256 = "de1847f7b59021c16bdc72abb4d8e2d9187cd6124d69156f3326dd34ee043681";
+  };
+
+  nativeBuildInputs = [ perl pkg-config ];
+
+  buildInputs = [ openssl libxslt curl pcre libxml2 gmp ]
+    ++ lib.optional withMysql libmysqlclient
+    ++ lib.optional withSqlite sqlite
+    ++ lib.optional withPostgresql postgresql
+    ++ lib.optional withBdb db;
+
+  propagatedBuildInputs = [ librdf_rasqal ];
+
+  postInstall = "rm -rvf $out/share/gtk-doc";
+
+  configureFlags =
+    [ "--with-threads" ]
+    ++ lib.optionals withBdb [
+      "--with-bdb-include=${db.dev}/include"
+      "--with-bdb-lib=${db.out}/lib"
+    ];
+
+  # Fix broken DT_NEEDED in lib/redland/librdf_storage_sqlite.so.
+  NIX_CFLAGS_LINK = "-lraptor2";
+
+  doCheck = false; # fails 1 out of 17 tests with a segmentation fault
+
+  meta = with lib; {
+    description = "C libraries that provide support for the Resource Description Framework (RDF)";
+    homepage = "https://librdf.org/";
+    platforms = platforms.unix;
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libre/default.nix b/nixpkgs/pkgs/development/libraries/libre/default.nix
new file mode 100644
index 000000000000..7c91950a4c4e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libre/default.nix
@@ -0,0 +1,24 @@
+{lib, stdenv, fetchurl, zlib, openssl}:
+stdenv.mkDerivation rec {
+  version = "0.6.1";
+  pname = "libre";
+  src = fetchurl {
+    url = "http://www.creytiv.com/pub/re-${version}.tar.gz";
+    sha256 = "0hzyc0hdlw795nyx6ik7h2ihs8wapbj32x8c40xq0484ciwzqnyd";
+  };
+  buildInputs = [ zlib openssl ];
+  makeFlags = [ "USE_ZLIB=1" "USE_OPENSSL=1" "PREFIX=$(out)" ]
+  ++ lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${stdenv.cc.cc}"
+  ++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${lib.getDev stdenv.cc.libc}"
+  ;
+  meta = {
+    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 lib.platforms; linux;
+    maintainers = with lib.maintainers; [raskin];
+    license = lib.licenses.bsd3;
+    downloadPage = "http://www.creytiv.com/pub/";
+    updateWalker = true;
+    downloadURLRegexp = "/re-.*[.]tar[.].*";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librealsense/default.nix b/nixpkgs/pkgs/development/libraries/librealsense/default.nix
new file mode 100644
index 000000000000..0011dc2f6e11
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librealsense/default.nix
@@ -0,0 +1,78 @@
+{ stdenv
+, config
+, lib
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, libusb1
+, ninja
+, pkg-config
+, gcc
+, cudaSupport ? config.cudaSupport or false, cudatoolkit
+, enablePython ? false, pythonPackages ? null
+}:
+
+assert cudaSupport -> cudatoolkit != null;
+assert enablePython -> pythonPackages != null;
+
+stdenv.mkDerivation rec {
+  pname = "librealsense";
+  version = "2.45.0";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "IntelRealSense";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0aqf48zl7825v7x8c3x5w4d17m4qq377f1mn6xyqzf9b0dnk4i1j";
+  };
+
+  buildInputs = [
+    libusb1
+    gcc.cc.lib
+  ] ++ lib.optional cudaSupport cudatoolkit
+    ++ lib.optionals enablePython (with pythonPackages; [python pybind11 ]);
+
+  patches = [
+    # fix build on aarch64-darwin
+    # https://github.com/IntelRealSense/librealsense/pull/9253
+    (fetchpatch {
+      url = "https://github.com/IntelRealSense/librealsense/commit/beb4c44debc8336de991c983274cad841eb5c323.patch";
+      sha256 = "05mxsd2pz3xrvywdqyxkwdvxx8hjfxzcgl51897avz4v2j89pyq8";
+    })
+    ./py_sitepackage_dir.patch
+    ./py_pybind11_no_external_download.patch
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    ninja
+    pkg-config
+  ];
+
+  cmakeFlags = [
+    "-DBUILD_EXAMPLES=ON"
+    "-DBUILD_GRAPHICAL_EXAMPLES=OFF"
+    "-DBUILD_GLSL_EXTENSIONS=OFF"
+  ] ++ lib.optionals enablePython [
+    "-DBUILD_PYTHON_BINDINGS:bool=true"
+    "-DXXNIX_PYTHON_SITEPACKAGES=${placeholder "out"}/${pythonPackages.python.sitePackages}"
+  ] ++ lib.optional cudaSupport "-DBUILD_WITH_CUDA:bool=true";
+
+  # ensure python package contains its __init__.py. for some reason the install
+  # script does not do this, and it's questionable if intel knows it should be
+  # done
+  # ( https://github.com/IntelRealSense/meta-intel-realsense/issues/20 )
+  postInstall = lib.optionalString enablePython  ''
+    cp ../wrappers/python/pyrealsense2/__init__.py $out/${pythonPackages.python.sitePackages}/pyrealsense2
+  '';
+
+  meta = with lib; {
+    description = "A cross-platform library for Intel® RealSense™ depth cameras (D400 series and the SR300)";
+    homepage = "https://github.com/IntelRealSense/librealsense";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ brian-dawn ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librealsense/py_pybind11_no_external_download.patch b/nixpkgs/pkgs/development/libraries/librealsense/py_pybind11_no_external_download.patch
new file mode 100644
index 000000000000..2b48edb62e37
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librealsense/py_pybind11_no_external_download.patch
@@ -0,0 +1,39 @@
+From 01e51b9c90ba51b2d0ca797dde676812cf3db415 Mon Sep 17 00:00:00 2001
+From: "Robert T. McGibbon" <rmcgibbo@gmail.com>
+Date: Mon, 10 May 2021 17:26:04 -0400
+Subject: [PATCH 1/1] V1
+
+---
+ wrappers/python/CMakeLists.txt | 15 +--------------
+ 1 file changed, 1 insertion(+), 14 deletions(-)
+
+diff --git a/wrappers/python/CMakeLists.txt b/wrappers/python/CMakeLists.txt
+index aa83e4c77..4ec92ccfa 100644
+--- a/wrappers/python/CMakeLists.txt
++++ b/wrappers/python/CMakeLists.txt
+@@ -8,21 +8,8 @@ if (NOT BUILD_PYTHON_BINDINGS)
+ endif()
+ 
+ set(DEPENDENCIES realsense2)
+-# In order for the external project clone to occur during cmake configure step(rather than during compilation, as would normally happen),
+-# we copy the external project declaration to the build folder and then execute it
+-configure_file(${CMAKE_SOURCE_DIR}/third-party/pybind11/CMakeLists.txt ${CMAKE_BINARY_DIR}/external-projects/pybind11/CMakeLists.txt)
+-execute_process(COMMAND "${CMAKE_COMMAND}" -G "${CMAKE_GENERATOR}" .
+-    WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/external-projects/pybind11"
+-)
+-execute_process(COMMAND "${CMAKE_COMMAND}" --build .
+-    WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/external-projects/pybind11"
+-)
+ 
+-# Add pybind11 makefile
+-add_subdirectory("${CMAKE_BINARY_DIR}/third-party/pybind11"
+-                 "${CMAKE_BINARY_DIR}/third-party/pybind11"
+-                 EXCLUDE_FROM_ALL
+-)
++find_package(pybind11 REQUIRED)
+ 
+ set(PYBIND11_CPP_STANDARD -std=c++11)
+ # Force Pybind11 not to share pyrealsense2 resources with other pybind modules.
+-- 
+2.29.3
+
diff --git a/nixpkgs/pkgs/development/libraries/librealsense/py_sitepackage_dir.patch b/nixpkgs/pkgs/development/libraries/librealsense/py_sitepackage_dir.patch
new file mode 100644
index 000000000000..99b567a429ed
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librealsense/py_sitepackage_dir.patch
@@ -0,0 +1,15 @@
+--- a/wrappers/python/CMakeLists.txt
++++ b/wrappers/python/CMakeLists.txt
+@@ -10,11 +10,11 @@
+ if (CMAKE_VERSION VERSION_LESS 3.12)
+   find_package(PythonInterp REQUIRED)
+   find_package(PythonLibs REQUIRED)
+-  set(PYTHON_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/python${PYTHON_VERSION_MAJOR}.${PYTHON_VERSION_MINOR}/pyrealsense2" CACHE PATH "Installation directory for Python bindings")
++  set(PYTHON_INSTALL_DIR "${XXNIX_PYTHON_SITEPACKAGES}/pyrealsense2" CACHE PATH "Installation directory for Python bindings")
+   set(CMAKECONFIG_PY_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/pyrealsense2")
+ else()
+   find_package(Python REQUIRED COMPONENTS Interpreter Development)
+-  set(PYTHON_INSTALL_DIR "${Python_SITEARCH}/pyrealsense2" CACHE PATH "Installation directory for Python bindings")
++  set(PYTHON_INSTALL_DIR "${XXNIX_PYTHON_SITEPACKAGES}/pyrealsense2" CACHE PATH "Installation directory for Python bindings")
+   set(CMAKECONFIG_PY_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/cmake/pyrealsense2")
+ endif()
diff --git a/nixpkgs/pkgs/development/libraries/libredwg/default.nix b/nixpkgs/pkgs/development/libraries/libredwg/default.nix
new file mode 100644
index 000000000000..e5123fa61af3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libredwg/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, texinfo, pcre2
+, enablePython ? false, python ? null, swig, libxml2, ncurses
+}:
+let
+  isPython3 = enablePython && python.pythonAtLeast "3";
+in
+stdenv.mkDerivation rec {
+  pname = "libredwg";
+  version = "0.12";
+
+  src = fetchFromGitHub {
+    owner = "LibreDWG";
+    repo = pname;
+    rev = version;
+    sha256 = "0ayhp3ym30hzp5f6dz7mmp9hpxf6a48nx3kq5crcmzycm5fllbn7";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config texinfo ]
+    ++ lib.optional enablePython swig;
+
+  buildInputs = [ pcre2 ]
+    ++ lib.optionals enablePython [ python ]
+    # configurePhase fails with python 3 when ncurses is missing
+    ++ lib.optional isPython3 ncurses
+  ;
+
+  # prevent python tests from running when not building with python
+  configureFlags = lib.optional (!enablePython) "--disable-python";
+
+  doCheck = true;
+
+  # the "xmlsuite" test requires the libxml2 c library as well as the python module
+  checkInputs = lib.optionals enablePython [ libxml2 libxml2.dev ];
+
+  meta = with lib; {
+    description = "Free implementation of the DWG file format";
+    homepage = "https://savannah.gnu.org/projects/libredwg/";
+    maintainers = with maintainers; [ tweber ];
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librelp/default.nix b/nixpkgs/pkgs/development/libraries/librelp/default.nix
new file mode 100644
index 000000000000..7b5a7d228d5e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librelp/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub
+, autoreconfHook
+, gnutls
+, openssl
+, pkg-config
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "librelp";
+  version = "1.10.0";
+
+  src = fetchFromGitHub {
+    owner = "rsyslog";
+    repo = "librelp";
+    rev = "v${version}";
+    sha256 = "sha256-aJLsUtik5aXfsdi+8QoDgbi4VUZ8gV3YPA6kIY6wzs4=";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+  buildInputs = [ gnutls zlib openssl ];
+
+  meta = with lib; {
+    description = "A reliable logging library";
+    homepage = "https://www.librelp.com/";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librem/default.nix b/nixpkgs/pkgs/development/libraries/librem/default.nix
new file mode 100644
index 000000000000..349384b4674c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librem/default.nix
@@ -0,0 +1,28 @@
+{lib, stdenv, fetchurl, zlib, openssl, libre}:
+stdenv.mkDerivation rec {
+  version = "0.6.0";
+  pname = "librem";
+  src=fetchurl {
+    url = "http://www.creytiv.com/pub/rem-${version}.tar.gz";
+    sha256 = "0b17wma5w9acizk02isk5k83vv47vf1cf9zkmsc1ail677d20xj1";
+  };
+  buildInputs = [zlib openssl libre];
+  makeFlags = [
+    "LIBRE_MK=${libre}/share/re/re.mk"
+    "LIBRE_INC=${libre}/include/re"
+    "PREFIX=$(out)"
+  ]
+  ++ lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${lib.getDev stdenv.cc.cc}"
+  ++ lib.optional (stdenv.cc.libc != null) "SYSROOT=${lib.getDev stdenv.cc.libc}"
+  ;
+  meta = {
+    description = " A library for real-time audio and video processing";
+    homepage = "http://www.creytiv.com/rem.html";
+    platforms = with lib.platforms; linux;
+    maintainers = with lib.maintainers; [raskin];
+    license = lib.licenses.bsd3;
+    downloadPage = "http://www.creytiv.com/pub/";
+    updateWalker = true;
+    downloadURLRegexp = "/rem-.*[.]tar[.].*";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librep/default.nix b/nixpkgs/pkgs/development/libraries/librep/default.nix
new file mode 100644
index 000000000000..cd007c5fe57a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librep/default.nix
@@ -0,0 +1,49 @@
+{ lib
+, stdenv
+, fetchurl
+, autoreconfHook
+, gdbm
+, gmp
+, libffi
+, pkg-config
+, readline
+, texinfo
+}:
+
+stdenv.mkDerivation rec {
+  pname = "librep";
+  version = "0.92.7";
+
+  src = fetchurl {
+    url = "https://download.tuxfamily.org/${pname}/${pname}_${version}.tar.xz";
+    sha256 = "1bmcjl1x1rdh514q9z3hzyjmjmwwwkziipjpjsl301bwmiwrd8a8";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+    texinfo
+  ];
+  buildInputs = [
+    gdbm
+    gmp
+    libffi
+    readline
+  ];
+
+  setupHook = ./setup-hook.sh;
+
+  meta = with lib;{
+    homepage = "http://sawfish.tuxfamily.org/";
+    description = "Fast, lightweight, and versatile Lisp environment";
+    longDescription = ''
+      librep is a Lisp system for UNIX, comprising an interpreter, a byte-code
+      compiler, and a virtual machine. It can serve as an application extension
+      language but is also suitable for standalone scripts.
+    '';
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = platforms.unix;
+  };
+}
+# TODO: investigate fetchFromGithub
diff --git a/nixpkgs/pkgs/development/libraries/librep/setup-hook.sh b/nixpkgs/pkgs/development/libraries/librep/setup-hook.sh
new file mode 100644
index 000000000000..4d875b693304
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librep/setup-hook.sh
@@ -0,0 +1,5 @@
+addRepDLLoadPath () {
+    addToSearchPath REP_DL_LOAD_PATH $1/lib/rep
+}
+
+addEnvHooks "$hostOffset" addRepDLLoadPath
diff --git a/nixpkgs/pkgs/development/libraries/libresample/default.nix b/nixpkgs/pkgs/development/libraries/libresample/default.nix
new file mode 100644
index 000000000000..f466229cfe8e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libresample/default.nix
@@ -0,0 +1,29 @@
+{lib, stdenv, fetchurl, cmake}:
+
+let
+  patch = fetchurl {
+    url = "mirror://debian/pool/main/libr/libresample/libresample_0.1.3-3.diff.gz";
+    sha256 = "063w8rqxw87fc89gas47vk0ll7xl8cy7d8g70gm1l62bqkkajklx";
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "libresample";
+  version = "0.1.3";
+  src = fetchurl {
+    url = "mirror://debian/pool/main/libr/libresample/libresample_${version}.orig.tar.gz";
+    sha256 = "05a8mmh1bw5afqx0kfdqzmph4x2npcs4idx0p0v6q95lwf22l8i0";
+  };
+  patches = [ patch ];
+  preConfigure = ''
+    cat debian/patches/1001_shlib-cmake.patch | patch -p1
+  '';
+  nativeBuildInputs = [ cmake ];
+
+  meta = {
+    description = "A real-time library for sampling rate conversion library";
+    license = lib.licenses.lgpl2Plus;
+    homepage = "https://ccrma.stanford.edu/~jos/resample/Free_Resampling_Software.html";
+    maintainers = [ lib.maintainers.sander ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libressl/default.nix b/nixpkgs/pkgs/development/libraries/libressl/default.nix
new file mode 100644
index 000000000000..fb362ebbad2f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libressl/default.nix
@@ -0,0 +1,70 @@
+{ stdenv, fetchurl, lib, cmake, cacert, fetchpatch
+, buildShared ? !stdenv.hostPlatform.isStatic
+}:
+
+let
+
+  generic = { version, sha256, patches ? [] }: stdenv.mkDerivation rec {
+    pname = "libressl";
+    inherit version;
+
+    src = fetchurl {
+      url = "mirror://openbsd/LibreSSL/${pname}-${version}.tar.gz";
+      inherit sha256;
+    };
+
+    nativeBuildInputs = [ cmake ];
+
+    cmakeFlags = [
+      "-DENABLE_NC=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'.
+    # Fortunately LibreSSL provides a CMake build as well, so opt for CMake by
+    # removing ./configure pre-config.
+    preConfigure = ''
+      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") ''
+      substituteInPlace ./tls/tls_config.c --replace '"/etc/ssl/cert.pem"' '"${cacert}/etc/ssl/certs/ca-bundle.crt"'
+    '';
+
+    outputs = [ "bin" "dev" "out" "man" "nc" ];
+
+    postFixup = ''
+      moveToOutput "bin/nc" "$nc"
+      moveToOutput "bin/openssl" "$bin"
+      moveToOutput "bin/ocspcheck" "$bin"
+      moveToOutput "share/man/man1/nc.1${lib.optionalString (dontGzipMan==null) ".gz"}" "$nc"
+    '';
+
+    dontGzipMan = if stdenv.isDarwin then true else null; # not sure what's wrong
+
+    meta = with lib; {
+      description = "Free TLS/SSL implementation";
+      homepage    = "https://www.libressl.org";
+      license = with licenses; [ publicDomain bsdOriginal bsd0 bsd3 gpl3 isc openssl ];
+      platforms   = platforms.all;
+      maintainers = with maintainers; [ thoughtpolice fpletz ];
+    };
+  };
+
+in {
+  libressl_3_2 = generic {
+    version = "3.2.5";
+    sha256 = "1zkwrs3b19s1ybz4q9hrb7pqsbsi8vxcs44qanfy11fkc7ynb2kr";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librest/default.nix b/nixpkgs/pkgs/development/libraries/librest/default.nix
new file mode 100644
index 000000000000..0c885f0764b5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librest/default.nix
@@ -0,0 +1,50 @@
+{ lib
+, stdenv
+, fetchurl
+, pkg-config
+, glib
+, libsoup
+, gobject-introspection
+, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "rest";
+  version = "0.8.1";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0513aad38e5d3cedd4ae3c551634e3be1b9baaa79775e53b2dba9456f15b01c9";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    glib
+    libsoup
+  ];
+
+  configureFlags = [
+    # Remove when https://gitlab.gnome.org/GNOME/librest/merge_requests/2 is merged.
+    "--with-ca-certificates=/etc/ssl/certs/ca-certificates.crt"
+  ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      attrPath = "librest";
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "Helper library for RESTful services";
+    homepage = "https://wiki.gnome.org/Projects/Librest";
+    license = licenses.lgpl21Only;
+    platforms = platforms.unix;
+    maintainers = teams.gnome.members;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librevenge/default.nix b/nixpkgs/pkgs/development/libraries/librevenge/default.nix
new file mode 100644
index 000000000000..1d7754bfcaef
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librevenge/default.nix
@@ -0,0 +1,42 @@
+{lib, stdenv, fetchurl, boost, pkg-config, cppunit, zlib}:
+let
+  s = # Generated upstream information
+  rec {
+    baseName="librevenge";
+    version="0.0.4";
+    name="${baseName}-${version}";
+    hash="1cj76cz4mqcy2mgv9l5xlc95bypyk8zbq0ls9cswqrs2y0lhfgwk";
+    url="mirror://sourceforge/project/libwpd/librevenge/librevenge-0.0.4/librevenge-0.0.4.tar.xz";
+    sha256="1cj76cz4mqcy2mgv9l5xlc95bypyk8zbq0ls9cswqrs2y0lhfgwk";
+  };
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    boost cppunit zlib
+  ];
+in
+stdenv.mkDerivation {
+  inherit (s) name version;
+  inherit nativeBuildInputs buildInputs;
+  src = fetchurl {
+    inherit (s) url sha256;
+  };
+
+  # Clang and gcc-7 generate warnings, and
+  # -Werror causes these warnings to be interpreted as errors
+  # Simplest solution: disable -Werror
+  configureFlags = [ "--disable-werror" ];
+
+  # Fix an issue with boost 1.59
+  # This is fixed upstream so please remove this when updating
+  postPatch = ''
+    sed -i 's,-DLIBREVENGE_BUILD,\0 -DBOOST_ERROR_CODE_HEADER_ONLY,g' src/lib/Makefile.in
+  '';
+
+  meta = {
+    inherit (s) version;
+    description = "A base library for writing document import filters";
+    license = lib.licenses.mpl20 ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librevenge/default.upstream b/nixpkgs/pkgs/development/libraries/librevenge/default.upstream
new file mode 100644
index 000000000000..78e47f83433f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librevenge/default.upstream
@@ -0,0 +1,4 @@
+url https://sourceforge.net/projects/libwpd/files/librevenge/
+SF_version_dir librevenge-
+version_link '[.]tar.xz/download$'
+SF_redirect
diff --git a/nixpkgs/pkgs/development/libraries/librevisa/default.nix b/nixpkgs/pkgs/development/libraries/librevisa/default.nix
new file mode 100644
index 000000000000..12d1da460fb9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librevisa/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, pkg-config, libusb1 }:
+
+# TODO: add VXI development files, for VXI-11 (TCPIP) support
+
+stdenv.mkDerivation rec {
+  pname = "librevisa";
+  version = "0.0.20130412";
+
+  src = fetchurl {
+    url = "http://www.librevisa.org/download/${pname}-${version}.tar.gz";
+    sha256 = "0bjzq23s3xzw0l9qx4l8achrx5id8xdd6r52lvdl4a28dxzbcfhq";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libusb1 ];
+
+  meta = with lib; {
+    description = "Implementation of the VISA standard (for instrument control)";
+    longDescription = ''
+      LibreVISA aims to be a compliant implementation of the VISA standard in a
+      free software library.
+
+      We currently support targets connected via USB, exposing the USBTMC
+      interface, and VXI-11 devices.
+    '';
+    homepage = "http://www.librevisa.org/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librime/default.nix b/nixpkgs/pkgs/development/libraries/librime/default.nix
new file mode 100644
index 000000000000..3a2ca1e18c15
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librime/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, cmake, boost, glog, leveldb, marisa, opencc,
+  libyamlcpp, gtest, capnproto, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "librime";
+  version = "1.7.3";
+
+  src = fetchFromGitHub {
+    owner = "rime";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-GzNMwyJR9PgJN0eGYbnBW6LS3vo4SUVLdyNG9kcEE18=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [ boost glog leveldb marisa opencc libyamlcpp gtest capnproto ];
+
+  meta = with lib; {
+    homepage    = "https://rime.im/";
+    description = "Rime Input Method Engine, the core library";
+    license     = licenses.bsd3;
+    maintainers = with maintainers; [ sifmelcara ];
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libroxml/default.nix b/nixpkgs/pkgs/development/libraries/libroxml/default.nix
new file mode 100644
index 000000000000..39c8eab5a65b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libroxml/default.nix
@@ -0,0 +1,16 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  name = "libroxml-2.3.0";
+  src = fetchurl {
+    url = "http://download.libroxml.net/pool/v2.x/libroxml-2.3.0.tar.gz";
+    sha256  = "0y0vc9n4rfbimjp28nx4kdfzz08j5xymh5xjy84l9fhfac5z5a0x";
+  };
+  meta = with lib; {
+    homepage = "https://www.libroxml.net/";
+    description = "This library is minimum, easy-to-use, C implementation for xml file parsing";
+    license = licenses.lgpl3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ mpickering ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librsb/default.nix b/nixpkgs/pkgs/development/libraries/librsb/default.nix
new file mode 100644
index 000000000000..ef8b9ee441d3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librsb/default.nix
@@ -0,0 +1,86 @@
+{ lib, stdenv, fetchurl
+, gfortran
+, pkg-config, libtool
+, m4, gnum4
+, file
+# Memory Hierarchy (End-user can provide this.)
+, memHierarchy ? ""
+# Headers/Libraries
+, blas, zlib
+# RPC headers (rpc/xdr.h)
+, openmpi
+, help2man
+, doxygen
+, octave
+}:
+
+stdenv.mkDerivation rec {
+  pname = "librsb";
+  version = "1.2.0.9";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "1ynrsgnvv1jfm8dv3jwjrip9x9icxv7w3qrk149025j6fbaza8gl";
+  };
+
+  # The default configure flags are still present when building
+  # --disable-static --disable-dependency-tracking
+  # Along with the --prefix=... flag (but we want that one).
+  configureFlags = [
+    "--enable-static"
+    "--enable-doc-build"
+    "--enable-octave-testing"
+    "--enable-sparse-blas-interface"
+    "--enable-fortran-module-install"
+    "--enable-pkg-config-install"
+    "--enable-matrix-types=all"
+    "--with-zlib=${zlib}/lib/libz.so"
+    "--with-memhinfo=${memHierarchy}"
+  ];
+
+  # Ensure C/Fortran code is position-independent.
+  NIX_CFLAGS_COMPILE = [ "-fPIC" "-Ofast" ];
+  FCFLAGS = [ "-fPIC" "-Ofast" ];
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [
+    gfortran
+    pkg-config libtool
+    m4 gnum4
+    file
+    blas zlib
+    openmpi
+    octave
+    help2man # Turn "--help" into a man-page
+    doxygen # Build documentation
+  ];
+
+  # Need to run cleanall target to remove any previously-generated files.
+  preBuild = ''
+    make cleanall
+  '';
+
+  checkInputs = [
+    octave
+  ];
+  checkTarget = "tests";
+
+  meta = with lib; {
+    homepage = "http://librsb.sourceforge.net/";
+    description = "Shared memory parallel sparse matrix and sparse BLAS library";
+    longDescription = ''
+      Library for sparse matrix computations featuring the Recursive Sparse
+      Blocks (RSB) matrix format. This format allows cache efficient and
+      multi-threaded (that is, shared memory parallel) operations on large
+      sparse matrices.
+      librsb implements the Sparse BLAS standard, as specified in the BLAS
+      Forum documents.
+      Contains libraries and header files for developing applications that
+      want to make use of librsb.
+    '';
+    license = with licenses; [ lgpl3Plus ];
+    maintainers = with maintainers; [ KarlJoad ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librseq/default.nix b/nixpkgs/pkgs/development/libraries/librseq/default.nix
new file mode 100644
index 000000000000..82e6c54bb2c8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librseq/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchFromGitHub
+, autoreconfHook, linuxHeaders
+}:
+
+stdenv.mkDerivation rec {
+  pname = "librseq";
+  version = "0.1.0pre70_${builtins.substring 0 7 src.rev}";
+
+  src = fetchFromGitHub {
+    owner  = "compudj";
+    repo   = "librseq";
+    rev    = "d1cdec98d476b16ca5e2d9d7eabcf9f1c97e6111";
+    sha256 = "0vgillrxc1knq591gjj99x2ws6q1xpm5dmfrhsxisngfpcnjr10v";
+  };
+
+  outputs = [ "out" "dev" "man" ];
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ linuxHeaders ];
+
+  installTargets = [ "install" "install-man" ];
+
+  doCheck = true;
+  separateDebugInfo = true;
+  enableParallelBuilding = true;
+
+  patchPhase = ''
+    patchShebangs tests
+  '';
+
+  # 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 lib; {
+    description = "Userspace library for the Linux Restartable Sequence API";
+    homepage    = "https://github.com/compudj/librseq";
+    license     = licenses.lgpl21Only;
+    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
new file mode 100644
index 000000000000..05b7a00be590
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librsvg/default.nix
@@ -0,0 +1,123 @@
+{ lib
+, stdenv
+, fetchurl
+, pkg-config
+, glib
+, gdk-pixbuf
+, pango
+, cairo
+, libxml2
+, bzip2
+, libintl
+, ApplicationServices
+, Foundation
+, libobjc
+, rustc
+, cargo
+, gnome
+, vala
+, gobject-introspection
+, nixosTests
+}:
+
+stdenv.mkDerivation rec {
+  pname = "librsvg";
+  version = "2.50.7";
+
+  outputs = [ "out" "dev" "installedTests" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "//thsIzVKCqq4UegKzBRZqdCb60iqLlCdwjw8vxCbrw=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    rustc
+    cargo
+    vala
+    gobject-introspection
+  ] ++ lib.optionals stdenv.isDarwin [
+    ApplicationServices
+    Foundation
+  ];
+
+  buildInputs = [
+    libxml2
+    bzip2
+    pango
+    libintl
+  ] ++ lib.optionals stdenv.isDarwin [
+    libobjc
+  ];
+
+  propagatedBuildInputs = [
+    glib
+    gdk-pixbuf
+    cairo
+  ];
+
+  configureFlags = [
+    "--enable-introspection"
+  ] ++ lib.optionals (!stdenv.isDarwin) [
+    # Vapi does not build on MacOS.
+    # https://github.com/NixOS/nixpkgs/pull/117081#issuecomment-827782004
+    "--enable-vala"
+  ] ++ [
+    "--enable-installed-tests"
+    "--enable-always-build-tests"
+  ] ++ lib.optional stdenv.isDarwin "--disable-Bsymbolic";
+
+  makeFlags = [
+    "installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/RSVG"
+    "installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/RSVG"
+  ];
+
+  doCheck = false; # all tests fail on libtool-generated rsvg-convert not being able to find coreutils
+
+  # It wants to add loaders and update the loaders.cache in gdk-pixbuf
+  # Patching the Makefiles to it creates rsvg specific loaders and the
+  # relevant loader.cache here.
+  # The loaders.cache can be used by setting GDK_PIXBUF_MODULE_FILE to
+  # point to this file in a wrapper.
+  postConfigure = ''
+    GDK_PIXBUF=$out/lib/gdk-pixbuf-2.0/2.10.0
+    mkdir -p $GDK_PIXBUF/loaders
+    sed -e "s#gdk_pixbuf_moduledir = .*#gdk_pixbuf_moduledir = $GDK_PIXBUF/loaders#" \
+        -i gdk-pixbuf-loader/Makefile
+    sed -e "s#gdk_pixbuf_cache_file = .*#gdk_pixbuf_cache_file = $GDK_PIXBUF/loaders.cache#" \
+        -i gdk-pixbuf-loader/Makefile
+    sed -e "s#\$(GDK_PIXBUF_QUERYLOADERS)#GDK_PIXBUF_MODULEDIR=$GDK_PIXBUF/loaders \$(GDK_PIXBUF_QUERYLOADERS)#" \
+         -i gdk-pixbuf-loader/Makefile
+
+    # Fix thumbnailer path
+    sed -e "s#@bindir@\(/gdk-pixbuf-thumbnailer\)#${gdk-pixbuf}/bin\1#g" \
+        -i gdk-pixbuf-loader/librsvg.thumbnailer.in
+  '';
+
+  # Merge gdkpixbuf and librsvg loaders
+  postInstall = ''
+    mv $GDK_PIXBUF/loaders.cache $GDK_PIXBUF/loaders.cache.tmp
+    cat ${gdk-pixbuf.out}/lib/gdk-pixbuf-2.0/2.10.0/loaders.cache $GDK_PIXBUF/loaders.cache.tmp > $GDK_PIXBUF/loaders.cache
+    rm $GDK_PIXBUF/loaders.cache.tmp
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+
+    tests = {
+      installedTests = nixosTests.installed-tests.librsvg;
+    };
+  };
+
+  meta = with lib; {
+    description = "A small library to render SVG images to Cairo surfaces";
+    homepage = "https://wiki.gnome.org/Projects/LibRsvg";
+    license = licenses.lgpl2Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librsync/default.nix b/nixpkgs/pkgs/development/libraries/librsync/default.nix
new file mode 100644
index 000000000000..a0248e774b7d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librsync/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, cmake, perl, zlib, bzip2, popt }:
+
+stdenv.mkDerivation rec {
+  pname = "librsync";
+  version = "2.3.2";
+
+  src = fetchFromGitHub {
+    owner = "librsync";
+    repo = "librsync";
+    rev = "v${version}";
+    sha256 = "sha256-GNwOIZ2UjvsYIthotiPDBrabYzCGFG/YVEbwVa9Nwi4=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ perl zlib bzip2 popt ];
+
+  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
+
+  meta = with lib; {
+    homepage = "http://librsync.sourceforge.net/";
+    license = licenses.lgpl2Plus;
+    description = "Implementation of the rsync remote-delta algorithm";
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librtlsdr/default.nix b/nixpkgs/pkgs/development/libraries/librtlsdr/default.nix
new file mode 100644
index 000000000000..61f4045b785f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librtlsdr/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+, libusb1
+}:
+
+stdenv.mkDerivation rec {
+  pname = "librtlsdr";
+  version = "0.8.0";
+
+  src = fetchFromGitHub {
+    owner = "librtlsdr";
+    repo = "librtlsdr";
+    rev = "v${version}";
+    sha256 = "sha256-s03h+3EfC5c7yRYBM6aCRWtmstwRJWuBywuyVt+k/bk=";
+  };
+
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace '/etc/udev/rules.d' "$out/etc/udev/rules.d"
+
+    substituteInPlace rtl-sdr.rules \
+      --replace 'MODE:="0666"' 'ENV{ID_SOFTWARE_RADIO}="1", MODE="0660", GROUP="plugdev"'
+  '';
+
+  nativeBuildInputs = [ pkg-config cmake ];
+
+  buildInputs = [ libusb1 ];
+
+  meta = with lib; {
+    description = "Turns your Realtek RTL2832 based DVB dongle into a SDR receiver";
+    homepage = "https://github.com/librtlsdr/librtlsdr";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ bjornfor ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librtprocess/default.nix b/nixpkgs/pkgs/development/libraries/librtprocess/default.nix
new file mode 100644
index 000000000000..3e44bfd3d7dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librtprocess/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "librtprocess";
+  version = "0.11.0";
+
+  src = fetchFromGitHub {
+    owner = "CarVac";
+    repo = pname;
+    rev = version;
+    sha256 = "1bivy3rymmmkdx5phbxq4qaq15hw633dgpks57z9ara15mh817xx";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://github.com/CarVac/librtprocess";
+    description = "Highly optimized library for processing RAW images";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ hjones2199 ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/librttopo/default.nix b/nixpkgs/pkgs/development/libraries/librttopo/default.nix
new file mode 100644
index 000000000000..d349278d5f5d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/librttopo/default.nix
@@ -0,0 +1,32 @@
+{ lib
+, stdenv
+, fetchFromGitea
+, autoreconfHook
+, geos
+}:
+
+stdenv.mkDerivation rec {
+  pname = "librttopo";
+  version = "1.1.0";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitea {
+    domain = "git.osgeo.org/gitea";
+    owner = "rttopo";
+    repo = "librttopo";
+    rev = "librttopo-${version}";
+    sha256 = "0h7lzlkn9g4xky6h81ndy0aa6dxz8wb6rnl8v3987jy1i6pr072p";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  buildInputs = [ geos ];
+
+  meta = with lib; {
+    description = "RT Topology Library";
+    homepage = "https://git.osgeo.org/gitea/rttopo/librttopo";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ dotlambda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libs3/default.nix b/nixpkgs/pkgs/development/libraries/libs3/default.nix
new file mode 100644
index 000000000000..d30fc55fc77f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libs3/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, curl, libxml2 }:
+
+stdenv.mkDerivation {
+  pname = "libs3";
+  version = "unstable-2018-12-03";
+
+  src = fetchFromGitHub {
+    owner = "bji";
+    repo = "libs3";
+    rev = "111dc30029f64bbf82031f3e160f253a0a63c119";
+    sha256 = "1ahf08hc7ql3fazfmlyj9vrhq7cvarsmgn2v8149y63zr1fl61hs";
+  };
+
+  buildInputs = [ curl libxml2 ];
+
+  makeFlags = [ "DESTDIR=$(out)" ];
+
+  meta = with lib; {
+    homepage = "https://github.com/bji/libs3";
+    description = "A library for interfacing with amazon s3";
+    license = licenses.lgpl3Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsamplerate/default.nix b/nixpkgs/pkgs/development/libraries/libsamplerate/default.nix
new file mode 100644
index 000000000000..5f0863bc49c8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsamplerate/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchurl, pkg-config, libsndfile, ApplicationServices, Carbon, CoreServices }:
+
+let
+  inherit (lib) optionals optionalString;
+
+in stdenv.mkDerivation rec {
+  pname = "libsamplerate";
+  version = "0.1.9";
+
+  src = fetchurl {
+    url = "http://www.mega-nerd.com/SRC/${pname}-${version}.tar.gz";
+    sha256 = "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libsndfile ]
+    ++ optionals stdenv.isDarwin [ ApplicationServices CoreServices ];
+
+  configureFlags = [ "--disable-fftw" ];
+
+  outputs = [ "bin" "dev" "out" ];
+
+  postConfigure = optionalString stdenv.isDarwin ''
+    # need headers from the Carbon.framework in /System/Library/Frameworks to
+    # compile this on darwin -- not sure how to handle
+    NIX_CFLAGS_COMPILE+=" -I${Carbon}/Library/Frameworks/Carbon.framework/Headers"
+
+    substituteInPlace examples/Makefile --replace "-fpascal-strings" ""
+  '';
+
+  meta = with lib; {
+    description = "Sample Rate Converter for audio";
+    homepage    = "http://www.mega-nerd.com/SRC/index.html";
+    license     = licenses.bsd2;
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsass/default.nix b/nixpkgs/pkgs/development/libraries/libsass/default.nix
new file mode 100644
index 000000000000..9b61ce65d453
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsass/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "libsass";
+  version = "3.6.5";
+
+  src = fetchFromGitHub {
+    owner = "sass";
+    repo = pname;
+    rev = version;
+    sha256 = "1cxj6r85d5f3qxdwzxrmkx8z875hig4cr8zsi30w6vj23cyds3l2";
+    # Remove unicode file names which leads to different checksums on HFS+
+    # vs. other filesystems because of unicode normalisation.
+    extraPostFetch = ''
+      rm -r $out/test/e2e/unicode-pwd
+    '';
+  };
+
+  preConfigure = ''
+    export LIBSASS_VERSION=${version}
+  '';
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = with lib; {
+    description = "A C/C++ implementation of a Sass compiler";
+    homepage = "https://github.com/sass/libsass";
+    license = licenses.mit;
+    maintainers = with maintainers; [ codyopel offline ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libschrift/default.nix b/nixpkgs/pkgs/development/libraries/libschrift/default.nix
new file mode 100644
index 000000000000..96b8c7ac2e57
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libschrift/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch }:
+
+stdenv.mkDerivation rec {
+  pname = "libschrift";
+  version = "0.10.0";
+
+  src = fetchFromGitHub {
+    owner = "tomolt";
+    repo = pname;
+    rev = "c207585486b3e78ec5506f55f5d56178f421a53c";
+    sha256 = "13qrplsi2a53s84giwnzqmn0zbslyaagvjn89wsn9fd90m2v2bs1";
+  };
+
+  # fix a compilation failure related to darwin integers, remove at next release
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/tomolt/libschrift/commit/1b1292f2cf4b582d66b2f6c87105997391f9fa08.patch";
+      sha256 = "076l3n28famgi74nr5bz47yn192bm76p8c8558fm5zj5c21pcfsv";
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace config.mk \
+      --replace "PREFIX = /usr/local" "PREFIX = $out"
+  '';
+
+  makeFlags = [ "libschrift.a" ];
+
+  meta = with lib; {
+    homepage = "https://github.com/tomolt/libschrift";
+    description = "A lightweight TrueType font rendering library";
+    license = licenses.isc;
+    platforms = platforms.all;
+    maintainers = [ maintainers.sternenseemann ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libscrypt/default.nix b/nixpkgs/pkgs/development/libraries/libscrypt/default.nix
new file mode 100644
index 000000000000..1bd22b2f7901
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libscrypt/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "libscrypt";
+  version = "1.21";
+
+  src = fetchFromGitHub {
+    owner = "technion";
+    repo = "libscrypt";
+    rev = "v${version}";
+    sha256 = "1d76ys6cp7fi4ng1w3mz2l0p9dbr7ljbk33dcywyimzjz8bahdng";
+  };
+
+  buildFlags = lib.optional stdenv.isDarwin "LDFLAGS= CFLAGS_EXTRA=";
+
+  installFlags = [ "PREFIX=$(out)" ];
+  installTargets = lib.optional stdenv.isDarwin "install-osx";
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Shared library that implements scrypt() functionality";
+    homepage = "https://lolware.net/2014/04/29/libscrypt.html";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ davidak ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsearpc/default.nix b/nixpkgs/pkgs/development/libraries/libsearpc/default.nix
new file mode 100644
index 000000000000..199ae0b685cf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsearpc/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, python3Packages
+, glib, jansson }:
+
+stdenv.mkDerivation rec {
+  version = "3.2.0";
+  pname = "libsearpc";
+
+  src = fetchFromGitHub {
+    owner = "haiwen";
+    repo = "libsearpc";
+    rev = "v${version}";
+    sha256 = "18i5zvrp6dv6vygxx5nc93mai2p2x786n5lnf5avrin6xiz2j6hd";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = with python3Packages; [ python simplejson ];
+  propagatedBuildInputs = [ glib jansson ];
+
+  meta = with lib; {
+    homepage = "https://github.com/haiwen/libsearpc";
+    description = "A simple and easy-to-use C language RPC framework based on GObject System";
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ greizgh ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libseccomp/default.nix b/nixpkgs/pkgs/development/libraries/libseccomp/default.nix
new file mode 100644
index 000000000000..7ea7add23f3e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libseccomp/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, fetchurl, getopt, util-linux, gperf }:
+
+stdenv.mkDerivation rec {
+  pname = "libseccomp";
+  version = "2.5.1";
+
+  src = fetchurl {
+    url = "https://github.com/seccomp/libseccomp/releases/download/v${version}/libseccomp-${version}.tar.gz";
+    sha256 = "0m8dlg1v7kflcxvajs4p76p275qwsm2abbf5mfapkakp7hw7wc7f";
+  };
+
+  outputs = [ "out" "lib" "dev" "man" "pythonsrc" ];
+
+  nativeBuildInputs = [ gperf ];
+  buildInputs = [ getopt ];
+
+  patchPhase = ''
+    patchShebangs .
+  '';
+
+  checkInputs = [ util-linux ];
+  doCheck = false; # dependency cycle
+
+  # Hack to ensure that patchelf --shrink-rpath get rids of a $TMPDIR reference.
+  preFixup = "rm -rfv src";
+
+  # Copy the python module code into a tarball that we can export and use as the
+  # src input for buildPythonPackage calls
+  postInstall = ''
+    cp -R ./src/python/ tmp-pythonsrc/
+    tar -zcf $pythonsrc --mtime="@$SOURCE_DATE_EPOCH" --sort=name --transform s/tmp-pythonsrc/python-foundationdb/ ./tmp-pythonsrc/
+  '';
+
+  meta = with lib; {
+    description = "High level library for the Linux Kernel seccomp filter";
+    homepage = "https://github.com/seccomp/libseccomp";
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+    badPlatforms = [
+      "alpha-linux"
+      "riscv32-linux"
+      "sparc-linux"
+      "sparc64-linux"
+    ];
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsecret/default.nix b/nixpkgs/pkgs/development/libraries/libsecret/default.nix
new file mode 100644
index 000000000000..18f00a0933c3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsecret/default.nix
@@ -0,0 +1,61 @@
+{ lib, stdenv, fetchurl, fetchpatch, glib, pkg-config, gettext, libxslt, python3
+, docbook_xsl, docbook_xml_dtd_42 , libgcrypt, gobject-introspection, vala
+, gtk-doc, gnome, gjs, libintl, dbus, xvfb-run }:
+
+stdenv.mkDerivation rec {
+  pname = "libsecret";
+  version = "0.20.4";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0a4xnfmraxchd9cq5ai66j12jv2vrgjmaaxz25kl031jvda4qnij";
+  };
+
+  postPatch = ''
+    patchShebangs .
+  '';
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  propagatedBuildInputs = [ glib ];
+  nativeBuildInputs = [
+    pkg-config gettext libxslt docbook_xsl docbook_xml_dtd_42 libintl
+    gobject-introspection vala gtk-doc glib
+  ];
+  buildInputs = [ libgcrypt ];
+  # optional: build docs with gtk-doc? (probably needs a flag as well)
+
+  configureFlags = [
+    "--with-libgcrypt-prefix=${libgcrypt.dev}"
+  ];
+
+  enableParallelBuilding = true;
+
+  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
+  installCheckPhase = ''
+    export NO_AT_BRIDGE=1
+    xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
+      --config-file=${dbus.daemon}/share/dbus-1/session.conf \
+      make check
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      # Does not seem to use the odd-unstable policy: https://gitlab.gnome.org/GNOME/libsecret/issues/30
+      versionPolicy = "none";
+    };
+  };
+
+  meta = {
+    description = "A library for storing and retrieving passwords and other secrets";
+    homepage = "https://wiki.gnome.org/Projects/Libsecret";
+    license = lib.licenses.lgpl21Plus;
+    inherit (glib.meta) platforms maintainers;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libserdes/default.nix b/nixpkgs/pkgs/development/libraries/libserdes/default.nix
new file mode 100644
index 000000000000..7b48f150c9a1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libserdes/default.nix
@@ -0,0 +1,61 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, perl
+, boost
+, rdkafka
+, jansson
+, curl
+, avro-c
+, avro-cpp }:
+
+stdenv.mkDerivation rec {
+  pname = "libserdes";
+  version = "6.2.0";
+
+  src = fetchFromGitHub {
+    owner = "confluentinc";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "194ras18xw5fcnjgg1isnb24ydx9040ndciniwcbdb7w7wd901gc";
+  };
+
+  outputs = [ "dev" "out" ];
+
+  nativeBuildInputs = [ perl ];
+
+  buildInputs = [ boost rdkafka jansson curl avro-c avro-cpp ];
+
+  makeFlags = [ "GEN_PKG_CONFIG=y" ];
+
+  postPatch = ''
+    patchShebangs configure lds-gen.pl
+  '';
+
+  # Has a configure script but it’s not Autoconf so steal some bits from multiple-outputs.sh:
+  setOutputFlags = false;
+
+  preConfigure = ''
+    configureFlagsArray+=(
+      "--libdir=''${!outputLib}/lib"
+      "--includedir=''${!outputInclude}/include"
+    )
+  '';
+
+  preInstall = ''
+    installFlagsArray+=("pkgconfigdir=''${!outputDev}/lib/pkgconfig")
+  '';
+
+  # Header files get installed with executable bit for some reason; get rid of it.
+  postInstall = ''
+    chmod -x ''${!outputInclude}/include/libserdes/*.h
+  '';
+
+  meta = with lib; {
+    description = "A schema-based serializer/deserializer C/C++ library with support for Avro and the Confluent Platform Schema Registry";
+    homepage = "https://github.com/confluentinc/libserdes";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ liff ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libserialport/default.nix b/nixpkgs/pkgs/development/libraries/libserialport/default.nix
new file mode 100644
index 000000000000..79f46ffca1f8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libserialport/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, pkg-config, udev, darwin }:
+
+stdenv.mkDerivation rec {
+  pname = "libserialport";
+  version = "0.1.1";
+
+  src = fetchurl {
+    url = "https://sigrok.org/download/source/libserialport/${pname}-${version}.tar.gz";
+    sha256 = "17ajlwgvyyrap8z7f16zcs59pksvncwbmd3mzf98wj7zqgczjaja";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = lib.optional stdenv.isLinux udev
+    ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.IOKit;
+
+  meta = with lib; {
+    description = "Cross-platform shared library for serial port access";
+    homepage = "https://sigrok.org/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libshout/default.nix b/nixpkgs/pkgs/development/libraries/libshout/default.nix
new file mode 100644
index 000000000000..5b284e4408c6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libshout/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, pkg-config
+, libvorbis, libtheora, speex }:
+
+# need pkg-config so that libshout installs ${out}/lib/pkgconfig/shout.pc
+
+stdenv.mkDerivation rec {
+  pname = "libshout";
+  version = "2.4.5";
+
+  src = fetchurl {
+    url = "https://downloads.xiph.org/releases/libshout/${pname}-${version}.tar.gz";
+    sha256 = "sha256-2eVoZopnOZTr4/HrXyvuBuMjal25K40MSH4cD4hqaJA=";
+  };
+
+  outputs = [ "out" "dev" "doc" ];
+
+  nativeBuildInputs = [ pkg-config ];
+  propagatedBuildInputs = [ libvorbis libtheora speex ];
+
+  meta = {
+    description = "icecast 'c' language bindings";
+
+    longDescription = ''
+      Libshout is a library for communicating with and sending data to an icecast
+      server.  It handles the socket connection, the timing of the data, and prevents
+      bad data from getting to the icecast server.
+    '';
+
+    homepage = "http://www.icecast.org";
+    license = lib.licenses.gpl2;
+    maintainers = with lib.maintainers; [ jcumming ];
+    platforms = with lib.platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsidplayfp/default.nix b/nixpkgs/pkgs/development/libraries/libsidplayfp/default.nix
new file mode 100644
index 000000000000..99c8b7352943
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsidplayfp/default.nix
@@ -0,0 +1,81 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, nix-update-script
+, autoreconfHook
+, pkg-config
+, perl
+, unittest-cpp
+, xa
+, libgcrypt
+, libexsid
+, docSupport ? true
+, doxygen
+, graphviz
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libsidplayfp";
+  version = "2.2.1";
+
+  src = fetchFromGitHub {
+    owner = "libsidplayfp";
+    repo = "libsidplayfp";
+    rev = "v${version}";
+    fetchSubmodules = true;
+    sha256 = "sha256-Ut6tXaM97R8Y5D2dV/xPvxVzS6Ep6fOKAujtRNKoQCc=";
+  };
+
+  postPatch = ''
+    patchShebangs .
+  '';
+
+  nativeBuildInputs = [ autoreconfHook pkg-config perl xa ]
+    ++ lib.optionals docSupport [ doxygen graphviz ];
+
+  buildInputs = [ libgcrypt libexsid ];
+
+  doCheck = true;
+
+  checkInputs = [ unittest-cpp ];
+
+  enableParallelBuilding = true;
+
+  installTargets = [ "install" ]
+    ++ lib.optionals docSupport [ "doc" ];
+
+  outputs = [ "out" ]
+    ++ lib.optionals docSupport [ "doc" ];
+
+  configureFlags = [
+    "--enable-hardsid"
+    "--with-gcrypt"
+    "--with-exsid"
+  ]
+  ++ lib.optional doCheck "--enable-tests";
+
+  postInstall = lib.optionalString docSupport ''
+    mkdir -p $doc/share/doc/libsidplayfp
+    mv docs/html $doc/share/doc/libsidplayfp/
+  '';
+
+  passthru = {
+    updateScript = nix-update-script {
+      attrPath = pname;
+    };
+  };
+
+  meta = with lib; {
+    description = "A library to play Commodore 64 music derived from libsidplay2";
+    longDescription = ''
+      libsidplayfp is a C64 music player library which integrates
+      the reSID SID chip emulation into a cycle-based emulator
+      environment, constantly aiming to improve emulation of the
+      C64 system and the SID chips.
+    '';
+    homepage = "https://github.com/libsidplayfp/libsidplayfp";
+    license = with licenses; [ gpl2Plus ];
+    maintainers = with maintainers; [ ramkromberg OPNA2608 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsieve/default.nix b/nixpkgs/pkgs/development/libraries/libsieve/default.nix
new file mode 100644
index 000000000000..8253d1df74fe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsieve/default.nix
@@ -0,0 +1,17 @@
+{lib, stdenv, fetchurl}:
+stdenv.mkDerivation rec {
+  version = "2.3.1";
+  pname = "libsieve";
+
+  src = fetchurl {
+    url = "https://github.com/downloads/sodabrew/libsieve/libsieve-${version}.tar.gz";
+    sha256 = "1gllhl9hbmc86dq3k98d4kjs5bwk0p2rlk7ywqj3fjn7jw6mbhcj";
+  };
+
+  meta = with lib; {
+    description = "An interpreter for RFC 3028 Sieve and various extensions";
+    homepage = "http://sodabrew.com/libsieve/";
+    license = licenses.lgpl21;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsigcxx/1.2.nix b/nixpkgs/pkgs/development/libraries/libsigcxx/1.2.nix
new file mode 100644
index 000000000000..a417e0bcc1d7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsigcxx/1.2.nix
@@ -0,0 +1,21 @@
+{lib, stdenv, fetchurl, pkg-config, m4}:
+
+stdenv.mkDerivation rec {
+  name = "libsigc++-1.2.7";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/libsigc++/1.2/${name}.tar.bz2";
+    sha256 = "099224v5y0y1ggqrfc8vga8afr3nb93iicn7cj8xxgsrwa83s5nr";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ m4];
+
+  meta = with lib; {
+    homepage = "https://libsigcplusplus.github.io/libsigcplusplus/";
+    description = "A typesafe callback system for standard C++";
+    branch = "1.2";
+    platforms = platforms.unix;
+    license = licenses.lgpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsigcxx/3.0.nix b/nixpkgs/pkgs/development/libraries/libsigcxx/3.0.nix
new file mode 100644
index 000000000000..edb74c807bfa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsigcxx/3.0.nix
@@ -0,0 +1,42 @@
+{ stdenv
+, lib
+, fetchurl
+, pkg-config
+, meson
+, ninja
+, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libsigc++";
+  version = "3.0.6";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "tw7c9GEWUcVKQm4QmxcZbh+hfaCQWSpQAOLRNMA6xc4=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    meson
+    ninja
+  ];
+
+  doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      attrPath = "libsigcxx30";
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://libsigcplusplus.github.io/libsigcplusplus/";
+    description = "A typesafe callback system for standard C++";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsigcxx/default.nix b/nixpkgs/pkgs/development/libraries/libsigcxx/default.nix
new file mode 100644
index 000000000000..cbc2c8a617b4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsigcxx/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, pkg-config, meson, ninja, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "libsigc++";
+  version = "2.10.6";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-3aF23EaBvanVoqwbxVJzvdOBZit6bUnpGCZ9E+h3Ths=";
+  };
+
+  nativeBuildInputs = [ pkg-config meson ninja ];
+
+  doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      attrPath = "libsigcxx";
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://libsigcplusplus.github.io/libsigcplusplus/";
+    description = "A typesafe callback system for standard C++";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsignal-protocol-c/default.nix b/nixpkgs/pkgs/development/libraries/libsignal-protocol-c/default.nix
new file mode 100644
index 000000000000..203d3613af85
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsignal-protocol-c/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, cmake, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "libsignal-protocol-c";
+  version = "2.3.3";
+
+  src = fetchFromGitHub {
+    owner = "signalapp";
+    repo = "libsignal-protocol-c";
+    rev = "v${version}";
+    sha256 = "0z5p03vk15i6h870azfjgyfgxhv31q2vq6rfhnybrnkxq2wqzwhk";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ openssl ];
+
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
+
+  outputs = [ "out" "dev" ];
+
+  meta = with lib; {
+    description = "Signal Protocol C Library";
+    homepage = "https://github.com/signalapp/libsignal-protocol-c";
+    license = licenses.gpl3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ orivej ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsignon-glib/default.nix b/nixpkgs/pkgs/development/libraries/libsignon-glib/default.nix
new file mode 100644
index 000000000000..f20f80c28429
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsignon-glib/default.nix
@@ -0,0 +1,59 @@
+{ lib, stdenv, fetchgit, nix-update-script, pkg-config, meson, ninja, vala, python3, gtk-doc, docbook_xsl, docbook_xml_dtd_43, docbook_xml_dtd_412, glib, check, gobject-introspection }:
+
+stdenv.mkDerivation rec {
+  pname = "libsignon-glib";
+  version = "2.1";
+
+  outputs = [ "out" "dev" "devdoc" "py" ];
+
+  src = fetchgit {
+    url = "https://gitlab.com/accounts-sso/${pname}";
+    rev = "refs/tags/${version}";
+    sha256 = "0gnx9gqsh0hcfm1lk7w60g64mkn1iicga5f5xcy1j9a9byacsfd0";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [
+    check
+    docbook_xml_dtd_412
+    docbook_xml_dtd_43
+    docbook_xsl
+    gobject-introspection
+    gtk-doc
+    meson
+    ninja
+    pkg-config
+    python3
+    vala
+  ];
+
+  buildInputs = [
+    glib
+    python3.pkgs.pygobject3
+  ];
+
+  mesonFlags = [
+    "-Dintrospection=true"
+    "-Dpy-overrides-dir=${placeholder "py"}/${python3.sitePackages}/gi/overrides"
+  ];
+
+  postPatch = ''
+    chmod +x build-aux/gen-error-map.py
+    patchShebangs build-aux/gen-error-map.py
+  '';
+
+  passthru = {
+    updateScript = nix-update-script {
+      attrPath = pname;
+    };
+  };
+
+  meta = with lib; {
+    description = "A library for managing single signon credentials which can be used from GLib applications";
+    homepage = "https://gitlab.com/accounts-sso/libsignon-glib";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.linux;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/libsigsegv/default.nix b/nixpkgs/pkgs/development/libraries/libsigsegv/default.nix
new file mode 100644
index 000000000000..4189ba9c6fae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsigsegv/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl
+, enableSigbusFix ? false # required by kernels < 3.18.6
+}:
+
+stdenv.mkDerivation rec {
+  name = "libsigsegv-2.13";
+
+  src = fetchurl {
+    url = "mirror://gnu/libsigsegv/${name}.tar.gz";
+    sha256 = "sha256-vnjuQXawX3x1/wMpjYSHTbkPS2ydVQPw2hIms6PEgRk=";
+  };
+
+  patches = if enableSigbusFix then [ ./sigbus_fix.patch ] else null;
+
+  doCheck = true; # not cross;
+
+  meta = {
+    homepage = "https://www.gnu.org/software/libsigsegv/";
+    description = "Library to handle page faults in user mode";
+
+    longDescription = ''
+      GNU libsigsegv is a library for handling page faults in user mode. A
+      page fault occurs when a program tries to access to a region of memory
+      that is currently not available. Catching and handling a page fault is
+      a useful technique for implementing pageable virtual memory,
+      memory-mapped access to persistent databases, generational garbage
+      collectors, stack overflow handlers, distributed shared memory, and
+      more.
+    '';
+
+    license = lib.licenses.gpl2Plus;
+
+    maintainers = [ ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsigsegv/sigbus_fix.patch b/nixpkgs/pkgs/development/libraries/libsigsegv/sigbus_fix.patch
new file mode 100644
index 000000000000..6f1c399041dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsigsegv/sigbus_fix.patch
@@ -0,0 +1,8 @@
+--- a/src/signals.h	2017-08-23 14:07:05.000000000 +0100
++++ b/src/signals.h	2017-08-23 14:06:53.000000000 +0100
+@@ -18,4 +18,4 @@
+ /* List of signals that are sent when an invalid virtual memory address
+    is accessed, or when the stack overflows.  */
+ #define SIGSEGV_FOR_ALL_SIGNALS(var,body) \
+-  { int var; var = SIGSEGV; { body } }
++  { int var; var = SIGSEGV; { body } var = SIGBUS; { body } }
diff --git a/nixpkgs/pkgs/development/libraries/libsixel/default.nix b/nixpkgs/pkgs/development/libraries/libsixel/default.nix
new file mode 100644
index 000000000000..0d5a54f9693e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsixel/default.nix
@@ -0,0 +1,30 @@
+{lib, stdenv, fetchFromGitHub}:
+stdenv.mkDerivation rec {
+  version = "1.8.6";
+  pname = "libsixel";
+
+  src = fetchFromGitHub {
+    repo = "libsixel";
+    rev = "v${version}";
+    owner = "saitoha";
+    sha256 = "1saxdj6sldv01g6w6yk8vr7px4bl31xca3a82j6v1j3fw5rbfphy";
+  };
+
+  configureFlags = [
+    "--enable-tests"
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "The SIXEL library for console graphics, and converter programs";
+    homepage = "http://saitoha.github.com/libsixel";
+    maintainers = with maintainers; [ vrthra ];
+    license = licenses.mit;
+    platforms = with platforms; unix;
+    knownVulnerabilities = [
+      "CVE-2020-11721" # https://github.com/saitoha/libsixel/issues/134
+      "CVE-2020-19668" # https://github.com/saitoha/libsixel/issues/136
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libskk/default.nix b/nixpkgs/pkgs/development/libraries/libskk/default.nix
new file mode 100644
index 000000000000..c4b36704cb97
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libskk/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchFromGitHub,
+  libtool, gettext, pkg-config,
+  vala, gnome-common, gobject-introspection,
+  libgee, json-glib, skk-dicts, libxkbcommon }:
+
+stdenv.mkDerivation rec {
+  pname = "libskk";
+  version = "1.0.5";
+
+  src = fetchFromGitHub {
+    owner = "ueno";
+    repo = "libskk";
+    rev = version;
+    sha256 = "0y279pcgs3jrsi9vzx086xhz9jbz23dqqijp4agygc9ackp9sxy5";
+  };
+
+  buildInputs = [ skk-dicts libxkbcommon ];
+  nativeBuildInputs = [ vala gnome-common gobject-introspection libtool gettext pkg-config ];
+  propagatedBuildInputs = [ libgee json-glib ];
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  # link SKK-JISYO.L from skkdicts for the bundled tool `skk`
+  preInstall = ''
+    dictDir=$out/share/skk
+    mkdir -p $dictDir
+    ln -s ${skk-dicts}/share/SKK-JISYO.L $dictDir/
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "A library to deal with Japanese kana-to-kanji conversion method";
+    longDescription = ''
+      Libskk is a library that implements basic features of SKK including:
+      new word registration, completion, numeric conversion, abbrev mode, kuten input,
+      hankaku-katakana input, Lisp expression evaluation (concat only), and re-conversion.
+      It also supports various typing rules including: romaji-to-kana, AZIK, TUT-Code, and NICOLA,
+      as well as various dictionary types including: file dictionary (such as SKK-JISYO.[SML]),
+      user dictionary, skkserv, and CDB format dictionary.
+    '';
+    homepage = "https://github.com/ueno/libskk";
+    license = lib.licenses.gpl3Plus;
+    maintainers = with lib.maintainers; [ yuriaisaka ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libslirp/default.nix b/nixpkgs/pkgs/development/libraries/libslirp/default.nix
new file mode 100644
index 000000000000..f4eaa9c31993
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libslirp/default.nix
@@ -0,0 +1,37 @@
+{ lib
+, stdenv
+, fetchFromGitLab
+, meson
+, ninja
+, pkg-config
+, glib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libslirp";
+  version = "4.6.1";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.freedesktop.org";
+    owner = "slirp";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-AM6NxO4hjFiUAzRYbXV3fe18xwCBmzdM63n93UOxjKw=";
+  };
+
+  nativeBuildInputs = [ meson ninja pkg-config ];
+
+  buildInputs = [ glib ];
+
+  postPatch = ''
+    echo ${version} > .tarball-version
+  '';
+
+  meta = with lib; {
+    description = "General purpose TCP-IP emulator";
+    homepage = "https://gitlab.freedesktop.org/slirp/libslirp";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ orivej ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsmartcols/default.nix b/nixpkgs/pkgs/development/libraries/libsmartcols/default.nix
new file mode 100644
index 000000000000..3ef1f3148994
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsmartcols/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, python3, gtk-doc}:
+
+stdenv.mkDerivation rec {
+  name = "libsmartcols";
+  version = "v2.36.1";
+
+  nativeBuildInputs = [ autoreconfHook pkg-config python3 gtk-doc ];
+
+  src = fetchFromGitHub {
+    owner = "karelzak";
+    repo = "util-linux";
+    rev = version;
+    sha256 = "0z7nv054pqhlihqiw0vk3h40j0cxk1yxf8zzh0ddmvk6834cnyxs";
+  };
+
+  configureFlags = [ "--disable-all-programs" "--enable-libsmartcols" ];
+
+  buildPhase = ''
+    make libsmartcols.la
+  '';
+
+  installTargets = [ "install-am" "install-pkgconfigDATA" ];
+
+  meta = {
+    description = "smart column output alignment library";
+    homepage = https://github.com/karelzak/util-linux/tree/master/libsmartcols;
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
+    maintainers = with lib.maintainers; [ rb2k ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/libsmi/default.nix b/nixpkgs/pkgs/development/libraries/libsmi/default.nix
new file mode 100644
index 000000000000..9b71a91efed2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsmi/default.nix
@@ -0,0 +1,18 @@
+{ lib, stdenv , fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libsmi";
+  version = "0.5.0";
+
+  src = fetchurl {
+    url = "https://www.ibr.cs.tu-bs.de/projects/libsmi/download/${pname}-${version}.tar.gz";
+    sha256 = "1lslaxr2qcj6hf4naq5n5mparfhmswsgq4wa7zm2icqvvgdcq6pj";
+  };
+
+  meta = with lib; {
+    description = "A Library to Access SMI MIB Information";
+    homepage = "https://www.ibr.cs.tu-bs.de/projects/libsmi/index.html";
+    license = licenses.free;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsnark/default.nix b/nixpkgs/pkgs/development/libraries/libsnark/default.nix
new file mode 100644
index 000000000000..c3e6d0e049e4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsnark/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, openssl, boost, gmp, procps }:
+
+let
+  rev = "9e6b19ff15bc19fba5da1707ba18e7f160e5ed07";
+in stdenv.mkDerivation rec {
+  name = "libsnark-pre${version}";
+  version = lib.substring 0 8 rev;
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ openssl boost gmp ] ++ lib.optional stdenv.hostPlatform.isLinux procps;
+
+  cmakeFlags = lib.optionals stdenv.hostPlatform.isDarwin [ "-DWITH_PROCPS=OFF" "-DWITH_SUPERCOP=OFF" ];
+
+  src = fetchFromGitHub {
+    inherit rev;
+    owner           = "scipr-lab";
+    repo            = "libsnark";
+    sha256          = "13f02qp2fmfhvxlp4xi69m0l8r5nq913l2f0zwdk7hl46lprfdca";
+    fetchSubmodules = true;
+  };
+
+  meta = with lib; {
+    description = "C++ library for zkSNARKs";
+    homepage = "https://github.com/scipr-lab/libsnark";
+    license = licenses.mit;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsndfile/default.nix b/nixpkgs/pkgs/development/libraries/libsndfile/default.nix
new file mode 100644
index 000000000000..61e6d9cd7652
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsndfile/default.nix
@@ -0,0 +1,61 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, autogen, flac, libogg, libopus, libvorbis, pkg-config, python3
+, Carbon, AudioToolbox
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libsndfile";
+  version = "1.0.30";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1rh79y4s4m2wcm2kahmzs2kijpdpayif2gyca6m71f3k7jbhgcwa";
+  };
+
+  nativeBuildInputs = [ autoreconfHook autogen pkg-config python3 ];
+  buildInputs = [ flac libogg libopus libvorbis ]
+    ++ lib.optionals stdenv.isDarwin [ Carbon AudioToolbox ];
+
+  enableParallelBuilding = true;
+
+  outputs = [ "bin" "dev" "out" "man" "doc" ];
+
+  # need headers from the Carbon.framework in /System/Library/Frameworks to
+  # compile this on darwin -- not sure how to handle
+  preConfigure = lib.optionalString stdenv.isDarwin
+    ''
+      NIX_CFLAGS_COMPILE+=" -I$SDKROOT/System/Library/Frameworks/Carbon.framework/Versions/A/Headers"
+    '';
+
+  # Needed on Darwin.
+  NIX_CFLAGS_LINK = "-logg -lvorbis";
+
+  meta = with lib; {
+    description = "A C library for reading and writing files containing sampled sound";
+    homepage    = "https://libsndfile.github.io/libsndfile/";
+    license     = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.unix;
+
+    longDescription = ''
+      Libsndfile is a C library for reading and writing files containing
+      sampled sound (such as MS Windows WAV and the Apple/SGI AIFF format)
+      through one standard library interface.  It is released in source
+      code format under the GNU Lesser General Public License.
+
+      The library was written to compile and run on a Linux system but
+      should compile and run on just about any Unix (including macOS).
+      There are also pre-compiled binaries available for 32 and 64 bit
+      windows.
+
+      It was designed to handle both little-endian (such as WAV) and
+      big-endian (such as AIFF) data, and to compile and run correctly on
+      little-endian (such as Intel and DEC/Compaq Alpha) processor systems
+      as well as big-endian processor systems such as Motorola 68k, Power
+      PC, MIPS and SPARC.  Hopefully the design of the library will also
+      make it easy to extend for reading and writing new sound file
+      formats.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsodium/default.nix b/nixpkgs/pkgs/development/libraries/libsodium/default.nix
new file mode 100644
index 000000000000..bc8a2ced7cd5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsodium/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "libsodium";
+  version = "1.0.18";
+
+  src = fetchurl {
+    url = "https://download.libsodium.org/libsodium/releases/${pname}-${version}.tar.gz";
+    sha256 = "1h9ncvj23qbbni958knzsli8dvybcswcjbx0qjjgi922nf848l3g";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  patches = lib.optional stdenv.targetPlatform.isMinGW ./mingw-no-fortify.patch;
+
+  nativeBuildInputs = lib.optional stdenv.targetPlatform.isMinGW autoreconfHook;
+
+  separateDebugInfo = stdenv.isLinux && stdenv.hostPlatform.libc != "musl";
+
+  enableParallelBuilding = true;
+  hardeningDisable = lib.optional (stdenv.targetPlatform.isMusl && stdenv.targetPlatform.isx86_32) "stackprotector";
+
+  # FIXME: the hardeingDisable attr above does not seems effective, so
+  # the need to disable stackprotector via configureFlags
+  configureFlags = lib.optional (stdenv.targetPlatform.isMusl && stdenv.targetPlatform.isx86_32) "--disable-ssp";
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A modern and easy-to-use crypto library";
+    homepage = "http://doc.libsodium.org/";
+    license = licenses.isc;
+    maintainers = with maintainers; [ raskin ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsodium/mingw-no-fortify.patch b/nixpkgs/pkgs/development/libraries/libsodium/mingw-no-fortify.patch
new file mode 100644
index 000000000000..e13a801f8db7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsodium/mingw-no-fortify.patch
@@ -0,0 +1,15 @@
+diff -Naur libsodium-1.0.18-orig/configure.ac libsodium-1.0.18/configure.ac
+--- libsodium-1.0.18-orig/configure.ac	2019-05-30 16:20:24.000000000 -0400
++++ libsodium-1.0.18/configure.ac	2021-08-11 08:09:54.653907245 -0400
+@@ -217,11 +217,6 @@
+ 
+ AC_CHECK_DEFINE([__wasi__], [WASI="yes"], [])
+ 
+-AC_CHECK_DEFINE([_FORTIFY_SOURCE], [], [
+-  AX_CHECK_COMPILE_FLAG([-D_FORTIFY_SOURCE=2],
+-    [CPPFLAGS="$CPPFLAGS -D_FORTIFY_SOURCE=2"])
+-])
+-
+ AX_CHECK_COMPILE_FLAG([-fvisibility=hidden],
+   [CFLAGS="$CFLAGS -fvisibility=hidden"])
+ 
diff --git a/nixpkgs/pkgs/development/libraries/libsolv/default.nix b/nixpkgs/pkgs/development/libraries/libsolv/default.nix
new file mode 100644
index 000000000000..c7dede355df6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsolv/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, cmake, ninja, zlib, expat, rpm, db }:
+
+stdenv.mkDerivation rec {
+  version  = "0.7.19";
+  pname = "libsolv";
+
+  src = fetchFromGitHub {
+    owner  = "openSUSE";
+    repo   = "libsolv";
+    rev    = version;
+    sha256 = "sha256-AN4cgpMBqTtK04CU89Yqd1ZfWyPrCociPd3XKdVONMU=";
+  };
+
+  cmakeFlags = [
+    "-DENABLE_COMPLEX_DEPS=true"
+    "-DENABLE_RPMMD=true"
+    "-DENABLE_RPMDB=true"
+    "-DENABLE_PUBKEY=true"
+    "-DENABLE_RPMDB_BYRPMHEADER=true"
+  ];
+
+  nativeBuildInputs = [ cmake ninja ];
+  buildInputs = [ zlib expat rpm db ];
+
+  meta = with lib; {
+    description = "A free package dependency solver";
+    homepage    = "https://github.com/openSUSE/libsolv";
+    license     = licenses.bsd3;
+    platforms   = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ copumpkin ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/libsoundio/default.nix b/nixpkgs/pkgs/development/libraries/libsoundio/default.nix
new file mode 100644
index 000000000000..2ef629e5467b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsoundio/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, cmake, alsa-lib, libjack2, libpulseaudio, AudioUnit }:
+
+stdenv.mkDerivation rec {
+  version = "2.0.0";
+  pname = "libsoundio";
+
+  src = fetchFromGitHub {
+    owner = "andrewrk";
+    repo = "libsoundio";
+    rev = version;
+    sha256 = "12l4rvaypv87vigdrmjz48d4d6sq4gfxf5asvnc4adyabxb73i4x";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ libjack2 libpulseaudio ]
+    ++ lib.optional stdenv.isLinux alsa-lib
+    ++ lib.optional stdenv.isDarwin AudioUnit;
+
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-strict-prototypes";
+
+  meta = with lib; {
+    description = "Cross platform audio input and output";
+    homepage = "http://libsound.io/";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.andrewrk ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsoup/default.nix b/nixpkgs/pkgs/development/libraries/libsoup/default.nix
new file mode 100644
index 000000000000..0cc4c8b3453a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsoup/default.nix
@@ -0,0 +1,90 @@
+{ stdenv
+, lib
+, fetchurl
+, glib
+, libxml2
+, meson
+, ninja
+, pkg-config
+, gnome
+, libsysprof-capture
+, gnomeSupport ? true
+, sqlite
+, glib-networking
+, gobject-introspection
+, withIntrospection ? stdenv.buildPlatform == stdenv.hostPlatform
+, vala
+, withVala ? stdenv.buildPlatform == stdenv.hostPlatform
+, libpsl
+, python3
+, brotli
+, fetchpatch
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libsoup";
+  version = "2.72.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "11skbyw2pw32178q3h8pi7xqa41b2x4k6q4k9f75zxmh8s23y30p";
+  };
+
+  patches = [
+    (fetchpatch {
+      # https://gitlab.gnome.org/GNOME/libsoup/-/issues/222
+      url = "https://gitlab.gnome.org/GNOME/libsoup/commit/b5e4f15a09d197b6a9b4b2d78b33779f27d828af.patch";
+      sha256 = "1hqk8lqzc200hi0nwbwq9qm6f03z296cnd79d4ql30683s80xqws";
+    })
+  ];
+
+  postPatch = ''
+    patchShebangs libsoup/
+  '';
+
+  outputs = [ "out" "dev" ];
+
+  buildInputs = [
+    python3
+    sqlite
+    libpsl
+    glib.out
+    brotli
+  ] ++ lib.optionals stdenv.isLinux [
+    libsysprof-capture
+  ];
+  nativeBuildInputs = [ meson ninja pkg-config glib ]
+    ++ lib.optional withIntrospection gobject-introspection
+    ++ lib.optional withVala vala;
+  propagatedBuildInputs = [ glib libxml2 ];
+
+  NIX_CFLAGS_COMPILE = [ "-lpthread" ];
+
+  mesonFlags = [
+    "-Dtls_check=false" # glib-networking is a runtime dependency, not a compile-time dependency
+    "-Dgssapi=disabled"
+    "-Dvapi=${if withVala then "enabled" else "disabled"}"
+    "-Dintrospection=${if withIntrospection then "enabled" else "disabled"}"
+    "-Dgnome=${lib.boolToString gnomeSupport}"
+    "-Dntlm=disabled"
+  ] ++ lib.optionals (!stdenv.isLinux) [
+    "-Dsysprof=disabled"
+  ];
+
+  doCheck = false; # ERROR:../tests/socket-test.c:37:do_unconnected_socket_test: assertion failed (res == SOUP_STATUS_OK): (2 == 200)
+
+  passthru = {
+    propagatedUserEnvPackages = [ glib-networking.out ];
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = {
+    description = "HTTP client/server library for GNOME";
+    homepage = "https://wiki.gnome.org/Projects/libsoup";
+    license = lib.licenses.lgpl2Plus;
+    inherit (glib.meta) maintainers platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libspatialindex/default.nix b/nixpkgs/pkgs/development/libraries/libspatialindex/default.nix
new file mode 100644
index 000000000000..2081650f90a9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libspatialindex/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libspatialindex";
+  version = "1.8.5";
+
+  src = fetchurl {
+    url = "https://download.osgeo.org/libspatialindex/spatialindex-src-${version}.tar.gz";
+    sha256 = "1vxzm7kczwnb6qdmc0hb00z8ykx11zk3sb68gc7rch4vrfi4dakw";
+  };
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Extensible spatial index library in C++";
+    homepage = "http://libspatialindex.github.io/";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libspatialite/default.nix b/nixpkgs/pkgs/development/libraries/libspatialite/default.nix
new file mode 100644
index 000000000000..592b7101a074
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libspatialite/default.nix
@@ -0,0 +1,54 @@
+{ lib
+, stdenv
+, fetchurl
+, pkg-config
+, geos
+, librttopo
+, libxml2
+, minizip
+, proj
+, sqlite
+, libiconv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libspatialite";
+  version = "5.0.1";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "https://www.gaia-gis.it/gaia-sins/libspatialite-sources/${pname}-${version}.tar.gz";
+    sha256 = "sha256-7svJQxHHgBLQWevA+uhupe9u7LEzA+boKzdTwbNAnpg=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [
+    geos
+    librttopo
+    libxml2
+    minizip
+    proj
+    sqlite
+  ] ++ lib.optionals stdenv.isDarwin [
+    libiconv
+  ];
+
+  configureFlags = [ "--disable-freexl" ];
+
+  enableParallelBuilding = true;
+
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    ln -s $out/lib/mod_spatialite.{so,dylib}
+  '';
+
+  meta = with lib; {
+    description = "Extensible spatial index library in C++";
+    homepage = "https://www.gaia-gis.it/fossil/libspatialite";
+    # They allow any of these
+    license = with licenses; [ gpl2Plus lgpl21Plus mpl11 ];
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ dotlambda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libspectre/default.nix b/nixpkgs/pkgs/development/libraries/libspectre/default.nix
new file mode 100644
index 000000000000..81e661a94214
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libspectre/default.nix
@@ -0,0 +1,34 @@
+{ fetchurl, lib, stdenv, pkg-config, ghostscript, cairo }:
+
+stdenv.mkDerivation rec {
+  pname = "libspectre";
+  version = "0.2.7";
+
+  src = fetchurl {
+    url = "https://libspectre.freedesktop.org/releases/${pname}-${version}.tar.gz";
+    sha256 = "1v63lqc6bhhxwkpa43qmz8phqs8ci4dhzizyy16d3vkb20m846z8";
+  };
+
+  patches = [ ./libspectre-0.2.7-gs918.patch ];
+
+  buildInputs = [
+    # Need `libgs.so'.
+    pkg-config ghostscript cairo /*for tests*/
+  ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "http://libspectre.freedesktop.org/";
+    description = "PostScript rendering library";
+
+    longDescription = ''
+      libspectre is a small library for rendering Postscript
+      documents.  It provides a convenient easy to use API for
+      handling and rendering Postscript documents.
+    '';
+
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libspectre/libspectre-0.2.7-gs918.patch b/nixpkgs/pkgs/development/libraries/libspectre/libspectre-0.2.7-gs918.patch
new file mode 100644
index 000000000000..e9a4eda192ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libspectre/libspectre-0.2.7-gs918.patch
@@ -0,0 +1,42 @@
+Fixed error namespace for >=ghostscript-gpl-9.18
+
+https://bugs.gentoo.org/563540
+
+--- libspectre-0.2.7/libspectre/spectre-gs.c
++++ libspectre-0.2.7/libspectre/spectre-gs.c
+@@ -43,12 +43,12 @@
+ 	
+ 	if (code <= -100) {
+ 		switch (code) {
+-			case e_Fatal:
++			case gs_error_Fatal:
+ 				fprintf (stderr, "fatal internal error %d", code);
+ 				return TRUE;
+ 				break;
+ 
+-			case e_ExecStackUnderflow:
++			case gs_error_ExecStackUnderflow:
+ 				fprintf (stderr, "stack overflow %d", code);
+ 				return TRUE;
+ 				break;
+@@ -109,9 +109,9 @@
+ 		set = _spectre_strdup_printf ("%d %d translate\n", -x, -y);
+ 		error = gsapi_run_string_continue (ghostscript_instance, set, strlen (set),
+ 						   0, &exit_code);
+-		error = error == e_NeedInput ? 0 : error;
++		error = error == gs_error_NeedInput ? 0 : error;
+ 		free (set);
+-		if (error != e_NeedInput && critic_error_code (error)) {
++		if (error != gs_error_NeedInput && critic_error_code (error)) {
+ 			fclose (fd);
+ 			return FALSE;
+ 		}
+@@ -126,7 +126,7 @@
+ 		read = fread (buf, sizeof (char), to_read, fd);
+ 		error = gsapi_run_string_continue (ghostscript_instance,
+ 						   buf, read, 0, &exit_code);
+-		error = error == e_NeedInput ? 0 : error;
++		error = error == gs_error_NeedInput ? 0 : error;
+ 		left -= read;
+ 	}
+ 	
diff --git a/nixpkgs/pkgs/development/libraries/libspectrum/default.nix b/nixpkgs/pkgs/development/libraries/libspectrum/default.nix
new file mode 100644
index 000000000000..c373f7c24ff3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libspectrum/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, perl, pkg-config, audiofile, bzip2, glib, libgcrypt, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "libspectrum";
+  version = "1.5.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/fuse-emulator/${pname}-${version}.tar.gz";
+    sha256 = "sha256-o1PLRumxooEGHYFjU+oBDQpv545qF6oLe3QnHKXkrPw=";
+  };
+
+  nativeBuildInputs = [ perl pkg-config ];
+
+  buildInputs = [ audiofile bzip2 glib libgcrypt zlib ];
+
+  enableParallelBuilding = true;
+  doCheck = 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.unix;
+    maintainers = with maintainers; [ orivej ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libspf2/default.nix b/nixpkgs/pkgs/development/libraries/libspf2/default.nix
new file mode 100644
index 000000000000..dc46e356e2c8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libspf2/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchurl, autoreconfHook }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "libspf2";
+  version = "1.2.10";
+
+  src = fetchurl {
+    url = "https://www.libspf2.org/spf/libspf2-${version}.tar.gz";
+    sha256 = "1j91p0qiipzf89qxq4m1wqhdf01hpn1h5xj4djbs51z23bl3s7nr";
+  };
+
+  patches = [
+    (fetchurl {
+      name = "0001-gcc-variadic-macros.patch";
+      url = "https://github.com/shevek/libspf2/commit/5852828582f556e73751076ad092f72acf7fc8b6.patch";
+      sha256 = "1v6ashqzpr0xidxq0vpkjd8wd66cj8df01kyzj678ljzcrax35hk";
+    })
+    (fetchurl {
+      name = "0002-CVE-2021-20314.patch";
+      url = "https://github.com/shevek/libspf2/commit/c37b7c13c30e225183899364b9f2efdfa85552ef.patch";
+      sha256 = "190nnh7mlz6328829ba6jajad16s3md8kraspn81qnvhwh0nkiak";
+    })
+  ];
+
+  postPatch = ''
+    # disable static bins compilation
+    sed -i \
+      -e '/bin_PROGRAMS/s/spfquery_static//' src/spfquery/Makefile.am \
+      -e '/bin_PROGRAMS/s/spftest_static//' src/spftest/Makefile.am \
+      -e '/bin_PROGRAMS/s/spfd_static//' src/spfd/Makefile.am \
+      -e '/bin_PROGRAMS/s/spf_example_static//' src/spf_example/Makefile.am
+  '';
+
+  # autoreconf necessary because we modified automake files
+  nativeBuildInputs = [ autoreconfHook ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Implementation of the Sender Policy Framework for SMTP authorization";
+    homepage = "https://www.libspf2.org";
+    license = with licenses; [ lgpl21Plus bsd2 ];
+    maintainers = with maintainers; [ pacien ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libspiro/default.nix b/nixpkgs/pkgs/development/libraries/libspiro/default.nix
new file mode 100644
index 000000000000..03bfe14d3bee
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libspiro/default.nix
@@ -0,0 +1,22 @@
+{lib, stdenv, pkg-config, autoreconfHook, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "libspiro";
+  version = "20200505";
+
+  src = fetchFromGitHub {
+    owner = "fontforge";
+    repo = pname;
+    rev = version;
+    sha256 = "1b5bw5qxqlral96y1n5f3sh9yxm2yij3zkqjmlgd8r1k4j0d3nqw";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+
+  meta = with lib; {
+    description = "A library that simplifies the drawing of beautiful curves";
+    homepage = "https://github.com/fontforge/libspiro";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.erictapen ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libspnav/configure-socket-path.patch b/nixpkgs/pkgs/development/libraries/libspnav/configure-socket-path.patch
new file mode 100644
index 000000000000..9a8ef0d49811
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libspnav/configure-socket-path.patch
@@ -0,0 +1,47 @@
+diff --git a/spnav.c b/spnav.c
+index f9e10f8..27149f7 100644
+--- a/spnav.c
++++ b/spnav.c
+@@ -36,7 +36,7 @@ OF SUCH DAMAGE.
+ #include <sys/select.h>
+ #include "spnav.h"
+ 
+-#define SPNAV_SOCK_PATH "/var/run/spnav.sock"
++#define DEFAULT_SPNAV_SOCK_PATH "/run/spnav.sock"
+ 
+ #ifdef USE_X11
+ #include <X11/Xlib.h>
+@@ -70,6 +70,24 @@ static struct event_node *ev_queue, *ev_queue_tail;
+ /* AF_UNIX socket used for alternative communication with daemon */
+ static int sock = -1;
+ 
++static char *spath = NULL;
++
++static char *socket_path()
++{
++	char *xdg_runtime_dir;
++	if((xdg_runtime_dir = getenv("XDG_RUNTIME_DIR"))) {
++		if ( spath == NULL ) {
++			spath = malloc(strlen(xdg_runtime_dir) + strlen("/spnav.sock") + 1);
++			if ( spath != NULL ) {
++				sprintf(spath, "%s/spnav.sock", xdg_runtime_dir);
++			}
++		}
++		if(access(spath, F_OK) != -1){
++			return spath;
++		}
++	}
++	return DEFAULT_SPNAV_SOCK_PATH;
++}
+ 
+ int spnav_open(void)
+ {
+@@ -92,7 +110,7 @@ int spnav_open(void)
+ 
+ 	memset(&addr, 0, sizeof addr);
+ 	addr.sun_family = AF_UNIX;
+-	strncpy(addr.sun_path, SPNAV_SOCK_PATH, sizeof(addr.sun_path));
++	strncpy(addr.sun_path, socket_path(), sizeof(addr.sun_path));
+ 
+ 
+ 	if(connect(s, (struct sockaddr*)&addr, sizeof addr) == -1) {
diff --git a/nixpkgs/pkgs/development/libraries/libspnav/default.nix b/nixpkgs/pkgs/development/libraries/libspnav/default.nix
new file mode 100644
index 000000000000..99f2a64d7b12
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libspnav/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, lib, fetchFromGitHub, libX11, fixDarwinDylibNames }:
+
+stdenv.mkDerivation rec {
+  version = "0.2.3";
+  pname = "libspnav";
+
+  src = fetchFromGitHub {
+    owner = "FreeSpacenav";
+    repo = "libspnav";
+    rev = "${pname}-${version}";
+    sha256 = "098h1jhlj87axpza5zgy58prp0zn94wyrbch6x0s7q4mzh7dc8ba";
+  };
+
+  nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames;
+  buildInputs = [ libX11 ];
+
+  patches = [
+    # Changes the socket path from /run/spnav.sock to $XDG_RUNTIME_DIR/spnav.sock
+    # to allow for a user service
+    ./configure-socket-path.patch
+  ];
+
+  configureFlags = [ "--disable-debug"];
+  makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
+
+  preInstall = ''
+    mkdir -p $out/{lib,include}
+  '';
+
+  meta = with lib; {
+    homepage = "http://spacenav.sourceforge.net/";
+    description = "Device driver and SDK for 3Dconnexion 3D input devices";
+    longDescription = "A free, compatible alternative, to the proprietary 3Dconnexion device driver and SDK, for their 3D input devices (called 'space navigator', 'space pilot', 'space traveller', etc)";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ sohalt ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libspotify/default.nix b/nixpkgs/pkgs/development/libraries/libspotify/default.nix
new file mode 100644
index 000000000000..d9be4a2964f4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libspotify/default.nix
@@ -0,0 +1,91 @@
+{ lib, stdenv, fetchurl, libspotify, alsa-lib, readline, pkg-config, apiKey ? null, unzip, gnused }:
+
+let
+  version = "12.1.51";
+  isLinux = (stdenv.hostPlatform.system == "x86_64-linux" || stdenv.hostPlatform.system == "i686-linux");
+in
+
+if (stdenv.hostPlatform.system != "x86_64-linux" && stdenv.hostPlatform.system != "x86_64-darwin" && stdenv.hostPlatform.system != "i686-linux")
+then throw "Check https://developer.spotify.com/technologies/libspotify/ for a tarball for your system and add it here"
+else stdenv.mkDerivation {
+  pname = "libspotify";
+  inherit version;
+
+  src =
+    if stdenv.hostPlatform.system == "x86_64-linux" then
+      fetchurl {
+        url    = "https://developer.spotify.com/download/libspotify/libspotify-${version}-Linux-x86_64-release.tar.gz";
+        sha256 = "0n0h94i4xg46hfba95n3ypah93crwb80bhgsg00f6sms683lx8a3";
+      }
+    else if stdenv.hostPlatform.system == "x86_64-darwin" then
+      fetchurl {
+        url    = "https://developer.spotify.com/download/libspotify/libspotify-${version}-Darwin-universal.zip";
+        sha256 = "1gcgrc8arim3hnszcc886lmcdb4iigc08abkaa02l6gng43ky1c0";
+      }
+    else if stdenv.hostPlatform.system == "i686-linux" then
+      fetchurl {
+        url    = "https://developer.spotify.com/download/libspotify/libspotify-${version}-Linux-i686-release.tar.gz";
+        sha256 = "1bjmn64gbr4p9irq426yap4ipq9rb84zsyhjjr7frmmw22xb86ll";
+      }
+    else
+      null;
+
+  dontBuild = true;
+
+  installPhase = if (isLinux)
+    then "installPhase"
+    else ''
+      mkdir -p "$out"/include/libspotify
+      mv -v libspotify.framework/Versions/Current/Headers/api.h \
+        "$out"/include/libspotify
+      mkdir -p "$out"/lib
+      mv -v libspotify.framework/Versions/Current/libspotify \
+        "$out"/lib/libspotify.dylib
+      mkdir -p "$out"/share/man
+      mv -v man3 "$out"/share/man
+    '';
+
+
+  # darwin-specific
+  nativeBuildInputs = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") unzip;
+
+  # linux-specific
+  installFlags = lib.optional isLinux
+    "prefix=$(out)";
+  patchPhase = lib.optionalString isLinux
+    "${gnused}/bin/sed -i 's/ldconfig//' Makefile";
+  postInstall = lib.optionalString isLinux
+    "mv -v share $out";
+
+  passthru = {
+    samples = if apiKey == null
+      then throw ''
+        Please visit ${libspotify.meta.homepage} to get an api key then set config.libspotify.apiKey accordingly
+      '' else stdenv.mkDerivation {
+        pname = "libspotify-samples";
+        inherit version;
+        src = libspotify.src;
+  nativeBuildInputs = [ pkg-config ];
+        buildInputs = [ libspotify readline ]
+          ++ lib.optional (!stdenv.isDarwin) alsa-lib;
+        postUnpack = "sourceRoot=$sourceRoot/share/doc/libspotify/examples";
+        patchPhase = "cp ${apiKey} appkey.c";
+        installPhase = ''
+          mkdir -p $out/bin
+          install -m 755 jukebox/jukebox $out/bin
+          install -m 755 spshell/spshell $out/bin
+          install -m 755 localfiles/posix_stu $out/bin
+        '';
+        meta = libspotify.meta // { description = "Spotify API library samples"; };
+      };
+
+    inherit apiKey;
+  };
+
+  meta = with lib; {
+    description = "Spotify API library";
+    homepage    = "https://developer.spotify.com/technologies/libspotify";
+    maintainers = with maintainers; [ lovek323 ];
+    license     = licenses.unfree;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsrs2/default.nix b/nixpkgs/pkgs/development/libraries/libsrs2/default.nix
new file mode 100644
index 000000000000..3da48f772545
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsrs2/default.nix
@@ -0,0 +1,18 @@
+{ stdenv, lib, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libsrs2";
+  version = "1.0.18";
+
+  src = fetchurl {
+    url = "https://www.libsrs2.org/srs/libsrs2-${version}.tar.gz";
+    sha256 = "9d1191b705d7587a5886736899001d04168392bbb6ed6345a057ade50943a492";
+  };
+
+  meta = {
+    description = "The next generation SRS library from the original designer of SRS";
+    license = with lib.licenses; [ gpl2 bsd3 ];
+    homepage = "https://www.libsrs2.org/";
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libssh/default.nix b/nixpkgs/pkgs/development/libraries/libssh/default.nix
new file mode 100644
index 000000000000..c613cfab777b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libssh/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, pkg-config, cmake, zlib, openssl, libsodium }:
+
+stdenv.mkDerivation rec {
+  pname = "libssh";
+  version = "0.8.9";
+
+  src = fetchurl {
+    url = "https://www.libssh.org/files/0.8/${pname}-${version}.tar.xz";
+    sha256 = "09b8w9m5qiap8wbvz4613nglsynpk8hn0q9b929ny2y4l2fy2nc5";
+  };
+
+  postPatch = ''
+    # Fix headers to use libsodium instead of NaCl
+    sed -i 's,nacl/,sodium/,g' ./include/libssh/curve25519.h src/curve25519.c
+  '';
+
+  # single output, otherwise cmake and .pc files point to the wrong directory
+  # outputs = [ "out" "dev" ];
+
+  buildInputs = [ zlib openssl libsodium ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  meta = with lib; {
+    description = "SSH client library";
+    homepage = "https://libssh.org";
+    license = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ sander ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libssh2/CVE-2019-17498.patch b/nixpkgs/pkgs/development/libraries/libssh2/CVE-2019-17498.patch
new file mode 100644
index 000000000000..8681c3ef6091
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libssh2/CVE-2019-17498.patch
@@ -0,0 +1,210 @@
+From b9aa7c2495694d0527e4e7fd560a3f0f18556c72 Mon Sep 17 00:00:00 2001
+From: Will Cosgrove <will@panic.com>
+Date: Thu, 29 Aug 2019 15:14:19 -0700
+Subject: [PATCH 1/5] packet.c: improve parsing of packets
+
+file: packet.c
+
+notes:
+Use _libssh2_get_string API in SSH_MSG_DEBUG, additional uint32 bounds check in SSH_MSG_GLOBAL_REQUEST
+---
+ src/packet.c | 30 +++++++++++++++---------------
+ 1 file changed, 15 insertions(+), 15 deletions(-)
+
+diff --git a/src/packet.c b/src/packet.c
+index 38ab62944..ac69768cd 100644
+--- a/src/packet.c
++++ b/src/packet.c
+@@ -537,26 +537,26 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
+         case SSH_MSG_DEBUG:
+             if(datalen >= 2) {
+                 int always_display = data[1];
+-
++            
+                 if(datalen >= 6) {
+-                    message_len = _libssh2_ntohu32(data + 2);
+-
+-                    if(message_len <= (datalen - 10)) {
+-                        /* 6 = packet_type(1) + display(1) + message_len(4) */
+-                        message = (char *) data + 6;
+-                        language_len = _libssh2_ntohu32(data + 6 +
+-                                                        message_len);
+-
+-                        if(language_len <= (datalen - 10 - message_len))
+-                            language = (char *) data + 10 + message_len;
+-                    }
++                    struct string_buf buf;
++                    buf.data = (unsigned char *)data;
++                    buf.dataptr = buf.data;
++                    buf.len = datalen;
++                    buf.dataptr += 2; /* advance past type & always display */
++
++                    _libssh2_get_string(&buf, &message, &message_len);
++                    _libssh2_get_string(&buf, &language, &language_len);
+                 }
+ 
+                 if(session->ssh_msg_debug) {
+-                    LIBSSH2_DEBUG(session, always_display, message,
+-                                  message_len, language, language_len);
++                    LIBSSH2_DEBUG(session, always_display,
++                                  (const char *)message,
++                                  message_len, (const char *)language,
++                                  language_len);
+                 }
+             }
++
+             /*
+              * _libssh2_debug will actually truncate this for us so
+              * that it's not an inordinate about of data
+@@ -579,7 +579,7 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
+                 uint32_t len = 0;
+                 unsigned char want_reply = 0;
+                 len = _libssh2_ntohu32(data + 1);
+-                if(datalen >= (6 + len)) {
++                if((len <= (UINT_MAX - 6) && (datalen >= (6 + len))) {
+                     want_reply = data[5 + len];
+                     _libssh2_debug(session,
+                                    LIBSSH2_TRACE_CONN,
+
+From 8b3cf0b17c1b84a138bed9423a9e0743452b4de9 Mon Sep 17 00:00:00 2001
+From: Will Cosgrove <will@panic.com>
+Date: Thu, 29 Aug 2019 15:15:33 -0700
+Subject: [PATCH 2/5] stray whitespace
+
+---
+ src/packet.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/packet.c b/src/packet.c
+index ac69768cd..8908b2c5a 100644
+--- a/src/packet.c
++++ b/src/packet.c
+@@ -537,7 +537,7 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
+         case SSH_MSG_DEBUG:
+             if(datalen >= 2) {
+                 int always_display = data[1];
+-            
++
+                 if(datalen >= 6) {
+                     struct string_buf buf;
+                     buf.data = (unsigned char *)data;
+
+From 1c6fa92b77e34d089493fe6d3e2c6c8775858b94 Mon Sep 17 00:00:00 2001
+From: Will Cosgrove <will@panic.com>
+Date: Thu, 29 Aug 2019 15:24:22 -0700
+Subject: [PATCH 3/5] fixed type issue, updated SSH_MSG_DISCONNECT
+
+SSH_MSG_DISCONNECT now also uses  _libssh2_get API.
+---
+ src/packet.c | 40 +++++++++++++++-------------------------
+ 1 file changed, 15 insertions(+), 25 deletions(-)
+
+diff --git a/src/packet.c b/src/packet.c
+index 8908b2c5a..97f0cdd4b 100644
+--- a/src/packet.c
++++ b/src/packet.c
+@@ -419,8 +419,8 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
+                     size_t datalen, int macstate)
+ {
+     int rc = 0;
+-    char *message = NULL;
+-    char *language = NULL;
++    unsigned char *message = NULL;
++    unsigned char *language = NULL;
+     size_t message_len = 0;
+     size_t language_len = 0;
+     LIBSSH2_CHANNEL *channelp = NULL;
+@@ -472,33 +472,23 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
+ 
+         case SSH_MSG_DISCONNECT:
+             if(datalen >= 5) {
+-                size_t reason = _libssh2_ntohu32(data + 1);
++                uint32_t reason = 0;
++                struct string_buf buf;
++                buf.data = (unsigned char *)data;
++                buf.dataptr = buf.data;
++                buf.len = datalen;
++                buf.dataptr++; /* advance past type */
+ 
+-                if(datalen >= 9) {
+-                    message_len = _libssh2_ntohu32(data + 5);
++                _libssh2_get_u32(&buf, &reason);
++                _libssh2_get_string(&buf, &message, &message_len);
++                _libssh2_get_string(&buf, &language, &language_len);
+ 
+-                    if(message_len < datalen-13) {
+-                        /* 9 = packet_type(1) + reason(4) + message_len(4) */
+-                        message = (char *) data + 9;
+-
+-                        language_len =
+-                            _libssh2_ntohu32(data + 9 + message_len);
+-                        language = (char *) data + 9 + message_len + 4;
+-
+-                        if(language_len > (datalen-13-message_len)) {
+-                            /* bad input, clear info */
+-                            language = message = NULL;
+-                            language_len = message_len = 0;
+-                        }
+-                    }
+-                    else
+-                        /* bad size, clear it */
+-                        message_len = 0;
+-                }
+                 if(session->ssh_msg_disconnect) {
+-                    LIBSSH2_DISCONNECT(session, reason, message,
+-                                       message_len, language, language_len);
++                    LIBSSH2_DISCONNECT(session, reason, (const char *)message,
++                                       message_len, (const char *)language,
++                                       language_len);
+                 }
++
+                 _libssh2_debug(session, LIBSSH2_TRACE_TRANS,
+                                "Disconnect(%d): %s(%s)", reason,
+                                message, language);
+
+From 77616117cc9dbbdd0fe1157098435bff73a83a0f Mon Sep 17 00:00:00 2001
+From: Will Cosgrove <will@panic.com>
+Date: Thu, 29 Aug 2019 15:26:32 -0700
+Subject: [PATCH 4/5] fixed stray (
+
+bad paste
+---
+ src/packet.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/packet.c b/src/packet.c
+index 97f0cdd4b..bd4c39e46 100644
+--- a/src/packet.c
++++ b/src/packet.c
+@@ -569,7 +569,7 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
+                 uint32_t len = 0;
+                 unsigned char want_reply = 0;
+                 len = _libssh2_ntohu32(data + 1);
+-                if((len <= (UINT_MAX - 6) && (datalen >= (6 + len))) {
++                if(len <= (UINT_MAX - 6) && datalen >= (6 + len)) {
+                     want_reply = data[5 + len];
+                     _libssh2_debug(session,
+                                    LIBSSH2_TRACE_CONN,
+
+From 436c45dc143cadc8c59afac6c4255be332856581 Mon Sep 17 00:00:00 2001
+From: Will Cosgrove <will@panic.com>
+Date: Thu, 29 Aug 2019 15:29:00 -0700
+Subject: [PATCH 5/5] added additional parentheses for clarity
+
+---
+ src/packet.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/packet.c b/src/packet.c
+index bd4c39e46..2e01bfc5d 100644
+--- a/src/packet.c
++++ b/src/packet.c
+@@ -569,7 +569,7 @@ _libssh2_packet_add(LIBSSH2_SESSION * session, unsigned char *data,
+                 uint32_t len = 0;
+                 unsigned char want_reply = 0;
+                 len = _libssh2_ntohu32(data + 1);
+-                if(len <= (UINT_MAX - 6) && datalen >= (6 + len)) {
++                if((len <= (UINT_MAX - 6)) && (datalen >= (6 + len))) {
+                     want_reply = data[5 + len];
+                     _libssh2_debug(session,
+                                    LIBSSH2_TRACE_CONN,
diff --git a/nixpkgs/pkgs/development/libraries/libssh2/default.nix b/nixpkgs/pkgs/development/libraries/libssh2/default.nix
new file mode 100644
index 000000000000..ed09e8ba5624
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libssh2/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, openssl, zlib, windows }:
+
+stdenv.mkDerivation rec {
+  pname = "libssh2";
+  version = "1.9.0";
+
+  src = fetchurl {
+    url = "${meta.homepage}/download/${pname}-${version}.tar.gz";
+    sha256 = "1zfsz9nldakfz61d2j70pk29zlmj7w2vv46s9l3x2prhcgaqpyym";
+  };
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  buildInputs = [ openssl zlib ]
+    ++ lib.optional stdenv.hostPlatform.isMinGW windows.mingw_w64;
+
+  patches = [
+    # Not able to use fetchpatch here: infinite recursion
+    ./CVE-2019-17498.patch
+  ];
+
+  meta = with lib; {
+    description = "A client-side C library implementing the SSH2 protocol";
+    homepage = "https://www.libssh2.org";
+    platforms = platforms.all;
+    license = licenses.bsd3;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libstatgrab/default.nix b/nixpkgs/pkgs/development/libraries/libstatgrab/default.nix
new file mode 100644
index 000000000000..5daf93b943ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libstatgrab/default.nix
@@ -0,0 +1,25 @@
+{ lib
+, stdenv
+, fetchurl
+, IOKit
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libstatgrab";
+  version = "0.92";
+
+  src = fetchurl {
+    url = "https://ftp.i-scream.org/pub/i-scream/libstatgrab/${pname}-${version}.tar.gz";
+    sha256 = "15m1sl990l85ijf8pnc6hdfha6fqyiq74mijrzm3xz4zzxm91wav";
+  };
+
+  buildInputs = lib.optional stdenv.isDarwin IOKit;
+
+  meta = with lib; {
+    homepage = "https://www.i-scream.org/libstatgrab/";
+    description = "A library that provides cross platforms access to statistics about the running system";
+    maintainers = with maintainers; [ ];
+    license = licenses.gpl2;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libstemmer/default.nix b/nixpkgs/pkgs/development/libraries/libstemmer/default.nix
new file mode 100644
index 000000000000..2f6b2835c4e3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libstemmer/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation {
+  name = "libstemmer-2017-03-02";
+
+  src = fetchFromGitHub {
+    owner = "zvelo";
+    repo = "libstemmer";
+    rev = "78c149a3a6f262a35c7f7351d3f77b725fc646cf";
+    sha256 = "06md6n6h1f2zvnjrpfrq7ng46l1x12c14cacbrzmh5n0j98crpq7";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Snowball Stemming Algorithms";
+    homepage = "http://snowball.tartarus.org/";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ fpletz ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libstroke/default.nix b/nixpkgs/pkgs/development/libraries/libstroke/default.nix
new file mode 100644
index 000000000000..697616f01f30
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libstroke/default.nix
@@ -0,0 +1,35 @@
+{lib, stdenv, fetchurl, automake, autoconf, xlibsWrapper}:
+
+stdenv.mkDerivation rec {
+  pname = "libstroke";
+  version = "0.5.1";
+
+  src = fetchurl {
+    url = "https://web.archive.org/web/20161204100704/http://etla.net/libstroke/${pname}-${version}.tar.gz";
+    sha256 = "0bbpqzsqh9zrc6cg62f6vp1p4dzvv37blsd0gdlzdskgwvyzba8d";
+  };
+
+  buildInputs = [ automake autoconf xlibsWrapper ];
+
+  # libstroke ships with an ancient config.sub that doesn't know about x86_64, so regenerate it.
+  # Also, modern automake doesn't like things and returns error code 63.  But it generates the file.
+  preConfigure = ''
+      rm config.sub
+      autoconf
+      automake -a || true
+    '';
+
+  meta = {
+    description = "A library for simple gesture recognition";
+    homepage = "https://web.archive.org/web/20161204100704/http://etla.net/libstroke/";
+    license = lib.licenses.gpl2;
+
+    longDescription =
+      '' libstroke, last updated in 2001, still successfully provides a basic
+        gesture recognition engine based around a 3x3 grid.  It's simple and
+        easy to work with, and notably used by FVWM.
+      '';
+
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libstrophe/default.nix b/nixpkgs/pkgs/development/libraries/libstrophe/default.nix
new file mode 100644
index 000000000000..ccc6fedd9169
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libstrophe/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, libtool
+, openssl
+, expat
+, pkg-config
+, check
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libstrophe";
+  version = "0.10.1";
+
+  src = fetchFromGitHub {
+    owner = "strophe";
+    repo = pname;
+    rev = version;
+    sha256 = "11d341avsfr0z4lq15cy5dkmff6qpy91wkgzdpfdy31l27pa1g79";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ openssl expat libtool check ];
+
+  dontDisableStatic = true;
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A simple, lightweight C library for writing XMPP clients";
+    longDescription = ''
+      libstrophe is a lightweight XMPP client library written in C. It has
+      minimal dependencies and is configurable for various environments. It
+      runs well on both Linux, Unix, and Windows based platforms.
+    '';
+    homepage = "https://strophe.im/libstrophe/";
+    license = with licenses; [ gpl3Only mit ];
+    platforms = platforms.unix;
+    broken = stdenv.isDarwin;
+    maintainers = with maintainers; [ devhell flosse ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/libsurvive/default.nix b/nixpkgs/pkgs/development/libraries/libsurvive/default.nix
new file mode 100644
index 000000000000..08be9c1a35d2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsurvive/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+, freeglut
+, liblapack
+, libusb1
+, openblas
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libsurvive";
+  version = "0.3";
+
+  src = fetchFromGitHub {
+    owner = "cntools";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0m21fnq8pfw2pcvqfgjws531zmalda423q9i65v4qzm8sdb54hl4";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [
+    freeglut
+    liblapack
+    libusb1
+    openblas
+    zlib
+  ];
+
+  meta = with lib; {
+    description = "Open Source Lighthouse Tracking System";
+    homepage = "https://github.com/cntools/libsurvive";
+    license = licenses.mit;
+    maintainers = with maintainers; [ expipiplus1 prusnak ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsvm/default.nix b/nixpkgs/pkgs/development/libraries/libsvm/default.nix
new file mode 100644
index 000000000000..fbc9bc4d3314
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsvm/default.nix
@@ -0,0 +1,39 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "libsvm";
+  version = "3.25";
+
+  src = fetchurl {
+    url = "https://www.csie.ntu.edu.tw/~cjlin/libsvm/libsvm-${version}.tar.gz";
+    sha256 = "sha256-UjUOiqdAsXbh13Pp3AjxNAIYw34BvsN6uQ2wEn5LteU=";
+  };
+
+  buildPhase = ''
+    make
+    make lib
+  '';
+
+  installPhase = let
+    libSuff = stdenv.hostPlatform.extensions.sharedLibrary;
+  in ''
+    install -D libsvm.so.2 $out/lib/libsvm.2${libSuff}
+    ln -s $out/lib/libsvm.2${libSuff} $out/lib/libsvm${libSuff}
+    install -Dt $out/bin/ svm-scale svm-train svm-predict
+    install -Dm644 -t $out/include svm.h
+    mkdir $out/include/libsvm
+    ln -s $out/include/svm.h $out/include/libsvm/svm.h
+  '';
+
+  postFixup = lib.optionalString stdenv.isDarwin ''
+    install_name_tool -id libsvm.2.dylib $out/lib/libsvm.2.dylib;
+  '';
+
+  meta = with lib; {
+    description = "A library for support vector machines";
+    homepage = "https://www.csie.ntu.edu.tw/~cjlin/libsvm/";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.spwhitt ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libsystemtap/default.nix b/nixpkgs/pkgs/development/libraries/libsystemtap/default.nix
new file mode 100644
index 000000000000..17ac533732f9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libsystemtap/default.nix
@@ -0,0 +1,30 @@
+{lib, stdenv, fetchgit, gettext, python2, elfutils}:
+
+stdenv.mkDerivation {
+  pname = "libsystemtap";
+  version = "3.2";
+
+  src = fetchgit {
+    url = "git://sourceware.org/git/systemtap.git";
+    rev = "4051c70c9318c837981384cbb23f3e9eb1bd0892";
+    sha256 = "0sd8n3j3rishks3gyqj2jyqhps7hmlfjyz8i0w8v98cczhhh04rq";
+    fetchSubmodules = false;
+  };
+
+  dontBuild = true;
+
+  nativeBuildInputs = [ gettext python2 elfutils ];
+
+  installPhase = ''
+    mkdir -p $out/include
+    cp -r includes/* $out/include/
+  '';
+
+  meta = with lib; {
+    description = "Statically defined probes development files";
+    homepage = "https://sourceware.org/systemtap/";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = [ lib.maintainers.farlion ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtap/default.nix b/nixpkgs/pkgs/development/libraries/libtap/default.nix
new file mode 100644
index 000000000000..ce7cb6bfd1ee
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtap/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, pkg-config, cmake, perl }:
+
+with lib;
+stdenv.mkDerivation rec {
+
+  pname = "libtap";
+  version = "1.14.0";
+
+  src = fetchurl {
+    url = "https://web-cpan.shlomifish.org/downloads/${pname}-${version}.tar.xz";
+    sha256 = "1ga7rqmppa8ady665736cx443icscqlgflkqmxd4xbkzypmdj9bk";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  propagatedBuildInputs = [ cmake perl ];
+
+  meta = with lib; {
+    description = "A library to implement a test protocol";
+    longDescription = ''
+      libtap is a library to implement the Test Anything Protocol for
+      C originally created by Nik Clayton. This is a maintenance
+      branch by Shlomi Fish.
+    '';
+    homepage = "https://www.shlomifish.org/open-source/projects/libtap/";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtar/default.nix b/nixpkgs/pkgs/development/libraries/libtar/default.nix
new file mode 100644
index 000000000000..3e5b4cd23e9d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtar/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchgit, fetchpatch, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  version = "1.2.20";
+  pname = "libtar";
+
+  # Maintenance repo for libtar (Arch Linux uses this)
+  src = fetchgit {
+    url = "git://repo.or.cz/libtar.git";
+    rev = "refs/tags/v${version}";
+    sha256 = "1pjsqnqjaqgkzf1j8m6y5h76bwprffsjjj6gk8rh2fjsha14rqn9";
+  };
+
+  patches = let
+    fp =  name: sha256:
+      fetchpatch {
+        url = "https://sources.debian.net/data/main/libt/libtar/1.2.20-4/debian/patches/${name}.patch";
+        inherit sha256;
+      };
+    in [
+      (fp "no_static_buffers"         "0yv90bhvqjj0v650gzn8fbzhdhzx5z0r1lh5h9nv39wnww435bd0")
+      (fp "no_maxpathlen"             "11riv231wpbdb1cm4nbdwdsik97wny5sxcwdgknqbp61ibk572b7")
+      (fp "CVE-2013-4420"             "0d010190bqgr2ggy02qwxvjaymy9a22jmyfwdfh4086v876cbxpq")
+      (fp "th_get_size-unsigned-int"  "1ravbs5yrfac98mnkrzciw9hd2fxq4dc07xl3wx8y2pv1bzkwm41")
+    ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ ];
+
+  meta = with lib; {
+    description = "C library for manipulating POSIX tar files";
+    homepage = "https://repo.or.cz/libtar";
+    license = licenses.bsd3;
+    platforms = with platforms; linux ++ darwin;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtasn1/default.nix b/nixpkgs/pkgs/development/libraries/libtasn1/default.nix
new file mode 100644
index 000000000000..4d7b57c1f08c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtasn1/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, perl, texinfo }:
+
+stdenv.mkDerivation rec {
+  name = "libtasn1-4.17.0";
+
+  src = fetchurl {
+    url = "mirror://gnu/libtasn1/${name}.tar.gz";
+    sha256 = "sha256-7OdVHOp5IrjhDX68cLwiSNH91zNRZGotao1oqUIcRaU=";
+  };
+
+  outputs = [ "out" "dev" "devdoc" ];
+  outputBin = "dev";
+
+  nativeBuildInputs = [ texinfo perl ];
+
+  doCheck = true;
+  preCheck = if stdenv.isDarwin then
+    "export DYLD_LIBRARY_PATH=`pwd`/lib/.libs"
+  else
+    null;
+
+  meta = with lib; {
+    homepage = "https://www.gnu.org/software/libtasn1/";
+    description = "An ASN.1 library";
+    longDescription = ''
+      Libtasn1 is the ASN.1 library used by GnuTLS, GNU Shishi and some
+      other packages.  The goal of this implementation is to be highly
+      portable, and only require an ANSI C89 platform.
+    '';
+    license = licenses.lgpl2Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtcod/default.nix b/nixpkgs/pkgs/development/libraries/libtcod/default.nix
new file mode 100644
index 000000000000..3e77d0876be8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtcod/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromBitbucket, cmake, SDL, libGLU, libGL, upx, zlib }:
+
+stdenv.mkDerivation {
+
+  pname = "libtcod";
+  version = "1.5.1";
+
+  src = fetchFromBitbucket {
+    owner = "libtcod";
+    repo = "libtcod";
+    rev = "1.5.1";
+    sha256 = "1ibsnmnim712npxkqklc5ibnd32hgsx2yzyfzzc5fis5mhinbl63";
+  };
+
+  prePatch = ''
+    sed -i CMakeLists.txt \
+      -e "s,SET(ROOT_DIR.*,SET(ROOT_DIR $out),g" \
+      -e "s,SET(INSTALL_DIR.*,SET(INSTALL_DIR $out),g"
+    echo 'INSTALL(DIRECTORY include DESTINATION .)' >> CMakeLists.txt
+  '';
+
+  cmakeFlags = [ "-DLIBTCOD_SAMPLES=OFF" ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ SDL libGLU libGL upx zlib ];
+
+  meta = {
+    description = "API for roguelike games";
+    homepage = "http://roguecentral.org/doryen/libtcod/";
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.linux;
+    maintainers = [ lib.maintainers.skeidel ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtelnet/default.nix b/nixpkgs/pkgs/development/libraries/libtelnet/default.nix
new file mode 100644
index 000000000000..eebaee394ee0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtelnet/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook, zlib }:
+
+stdenv.mkDerivation {
+  pname = "libtelnet";
+  version = "0.21+45f2d5c";
+
+  src = fetchFromGitHub {
+    owner = "seanmiddleditch";
+    repo = "libtelnet";
+    rev = "45f2d5cfcf383312280e61c85b107285fed260cf";
+    sha256 = "1lp6gdbndsp2w8mhy88c2jknxj2klvnggvq04ln7qjg8407ifpda";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+  buildInputs = [ zlib ];
+
+  meta = {
+    description = "Simple RFC-complient TELNET implementation as a C library";
+    homepage = "https://github.com/seanmiddleditch/libtelnet";
+    license = lib.licenses.publicDomain;
+    maintainers = [ lib.maintainers.tomberek ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtermkey/default.nix b/nixpkgs/pkgs/development/libraries/libtermkey/default.nix
new file mode 100644
index 000000000000..9779ad6b9e5f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtermkey/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, lib, fetchzip, libtool, pkg-config, ncurses, unibilium }:
+
+stdenv.mkDerivation rec {
+  pname = "libtermkey";
+
+  version = "0.22";
+
+  src = fetchzip {
+    url = "http://www.leonerd.org.uk/code/libtermkey/libtermkey-${version}.tar.gz";
+    sha256 = "02dks6bj7n23lj005yq41azf95wh3hapmgc2lzyh12vigkjh67rg";
+  };
+
+  makeFlags = [ "PREFIX=$(out)" ]
+    ++ lib.optional stdenv.isDarwin "LIBTOOL=${libtool}/bin/libtool";
+
+  nativeBuildInputs = [ libtool pkg-config ];
+  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/libthai/default.nix b/nixpkgs/pkgs/development/libraries/libthai/default.nix
new file mode 100644
index 000000000000..97745813ef26
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libthai/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, makeWrapper, installShellFiles, pkg-config, libdatrie }:
+
+stdenv.mkDerivation rec {
+  pname = "libthai";
+  version = "0.1.28";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "https://github.com/tlwg/libthai/releases/download/v${version}/libthai-${version}.tar.xz";
+    sha256 = "04g93bgxrcnay9fglpq2lj9nr7x1xh06i60m7haip8as9dxs3q7z";
+  };
+
+  strictDeps = true;
+
+  nativeBuildInputs = [ installShellFiles (lib.getBin libdatrie) pkg-config ];
+
+  buildInputs = [ libdatrie ];
+
+  postInstall = ''
+    installManPage man/man3/*.3
+  '';
+
+  meta = with lib; {
+    homepage = "https://linux.thai.net/projects/libthai/";
+    description = "Set of Thai language support routines";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ SuperSandro2000 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtheora/default.nix b/nixpkgs/pkgs/development/libraries/libtheora/default.nix
new file mode 100644
index 000000000000..1e88218aa0d4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtheora/default.nix
@@ -0,0 +1,33 @@
+{lib, stdenv, fetchurl, libogg, libvorbis, pkg-config, autoreconfHook, fetchpatch }:
+
+stdenv.mkDerivation rec {
+  pname = "libtheora";
+  version = "1.1.1";
+
+  src = fetchurl {
+    url = "https://downloads.xiph.org/releases/theora/${pname}-${version}.tar.gz";
+    sha256 = "0swiaj8987n995rc7hw0asvpwhhzpjiws8kr3s6r44bqqib2k5a0";
+  };
+
+  patches = [
+    # fix error in autoconf scripts
+    (fetchpatch {
+      url = "https://github.com/xiph/theora/commit/28cc6dbd9b2a141df94f60993256a5fca368fa54.diff";
+      sha256 = "16jqrq4h1b3krj609vbpzd5845cvkbh3mwmjrcdg35m490p19x9k";
+    })
+  ];
+
+  outputs = [ "out" "dev" "devdoc" ];
+  outputDoc = "devdoc";
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+  propagatedBuildInputs = [ libogg libvorbis ];
+
+  meta = with lib; {
+    homepage = "https://www.theora.org/";
+    description = "Library for Theora, a free and open video compression format";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ spwhitt ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libthreadar/default.nix b/nixpkgs/pkgs/development/libraries/libthreadar/default.nix
new file mode 100644
index 000000000000..953800cdd576
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libthreadar/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  version = "1.3.2";
+  pname = "libthreadar";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libthreadar/${pname}-${version}.tar.gz";
+    sha256 = "sha256-q5FiBlncbhdXDgRm7wgxcd4rkxqje/1ls9kPGqmomP0=";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  configureFlags = [
+    "--disable-build-html"
+  ];
+
+  postInstall = ''
+    # Disable html help
+    rm -r "$out"/share
+  '';
+
+  meta = {
+    homepage = "http://libthreadar.sourceforge.net/";
+    description = "A C++ library that provides several classes to manipulate threads";
+    longDescription = ''
+      Libthreadar is a C++ library providing a small set of C++ classes to manipulate
+      threads in a very simple and efficient way from your C++ code.
+    '';
+    maintainers = with maintainers; [ izorkin ];
+    license = licenses.lgpl3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libticables2/default.nix b/nixpkgs/pkgs/development/libraries/libticables2/default.nix
new file mode 100644
index 000000000000..f22d7b796e15
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libticables2/default.nix
@@ -0,0 +1,64 @@
+{ stdenv
+, lib
+, fetchurl
+, pkg-config
+, autoreconfHook
+, glib
+, libusb1
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libticables2";
+  version = "1.3.5";
+  src = fetchurl {
+    url = "mirror://sourceforge/tilp/${pname}-${version}.tar.bz2";
+    sha256 = "08j5di0cgix9vcpdv7b8xhxdjkk9zz7fqfnv3l4apk3jdr8vcvqc";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+  ];
+
+  buildInputs = [
+    libusb1
+    glib
+  ];
+
+  configureFlags = [
+    "--enable-libusb10"
+  ];
+
+  postInstall = ''
+    mkdir -p $out/etc/udev/rules.d
+    cat > $out/etc/udev/rules.d/69-libsane.rules << EOF
+      ACTION!="add", GOTO="libticables_end"
+
+      # serial device (assume TI calculator)
+      KERNEL=="ttyS[0-3]", ENV{ID_PDA}="1"
+      # parallel device (assume TI calculator)
+      SUBSYSTEM=="ppdev", ENV{ID_PDA}="1"
+      # SilverLink
+      SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="e001", ENV{ID_PDA}="1"
+      # TI-84+ DirectLink
+      SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="e003", ENV{ID_PDA}="1"
+      # TI-89 Titanium DirectLink
+      SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="e004", ENV{ID_PDA}="1"
+      # TI-84+ SE DirectLink
+      SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="e008", ENV{ID_PDA}="1"
+      # TI-Nspire DirectLink
+      SUBSYSTEM=="usb", ATTR{idVendor}=="0451", ATTR{idProduct}=="e012", ENV{ID_PDA}="1"
+
+      LABEL="libticables_end"
+    EOF
+  '';
+
+  meta = with lib; {
+    changelog = "http://lpg.ticalc.org/prj_tilp/news.html";
+    description = "This library is part of the TiLP framework";
+    homepage = "http://lpg.ticalc.org/prj_tilp/";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ siraben luc65r ];
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libticalcs2/default.nix b/nixpkgs/pkgs/development/libraries/libticalcs2/default.nix
new file mode 100644
index 000000000000..2488a5bbb0b4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libticalcs2/default.nix
@@ -0,0 +1,50 @@
+{ stdenv
+, lib
+, fetchurl
+, pkg-config
+, autoreconfHook
+, glib
+, libticonv
+, libtifiles2
+, libticables2
+, xz
+, bzip2
+, acl
+, libobjc
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libticalcs2";
+  version = "1.1.9";
+  src = fetchurl {
+    url = "mirror://sourceforge/tilp/${pname}-${version}.tar.bz2";
+    sha256 = "08c9wgrdnyqcs45mx1bjb8riqq81bzfkhgaijxzn96rhpj40fy3n";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+  ];
+
+  buildInputs = [
+    glib
+    libticonv
+    libtifiles2
+    libticables2
+    xz
+    bzip2
+  ] ++ lib.optionals stdenv.isLinux [
+    acl
+  ] ++ lib.optionals stdenv.isDarwin [
+    libobjc
+  ];
+
+  meta = with lib; {
+    changelog = "http://lpg.ticalc.org/prj_tilp/news.html";
+    description = "This library is part of the TiLP framework";
+    homepage = "http://lpg.ticalc.org/prj_tilp/";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ siraben luc65r ];
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libticonv/default.nix b/nixpkgs/pkgs/development/libraries/libticonv/default.nix
new file mode 100644
index 000000000000..0c075406dee2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libticonv/default.nix
@@ -0,0 +1,38 @@
+{ stdenv
+, lib
+, fetchurl
+, pkg-config
+, autoreconfHook
+, glib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libticonv";
+  version = "1.1.5";
+  src = fetchurl {
+    url = "mirror://sourceforge/tilp/${pname}-${version}.tar.bz2";
+    sha256 = "0y080v12bm81wgjm6fnw7q0yg7scphm8hhrls9njcszj7fkscv9i";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+  ];
+
+  buildInputs = [
+    glib
+  ];
+
+  configureFlags = [
+    "--enable-iconv"
+  ];
+
+  meta = with lib; {
+    changelog = "http://lpg.ticalc.org/prj_tilp/news.html";
+    description = "This library is part of the TiLP framework";
+    homepage = "http://lpg.ticalc.org/prj_tilp/";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ siraben luc65r ];
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtiff/aarch64-darwin.nix b/nixpkgs/pkgs/development/libraries/libtiff/aarch64-darwin.nix
new file mode 100644
index 000000000000..5de481066f67
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtiff/aarch64-darwin.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv
+, fetchurl
+
+, pkg-config
+, cmake
+
+, libdeflate
+, libjpeg
+, xz
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libtiff";
+  version = "4.2.0";
+
+  src = fetchurl {
+    url = "https://download.osgeo.org/libtiff/tiff-${version}.tar.gz";
+    sha256 = "1jrkjv0xya9radddn8idxvs2gqzp3l2b1s8knlizmn7ad3jq817b";
+  };
+
+  cmakeFlags = lib.optional stdenv.isDarwin "-DCMAKE_SKIP_BUILD_RPATH=OFF";
+
+  # FreeImage needs this patch
+  patches = [ ./headers-cmake.patch ];
+
+  outputs = [ "bin" "dev" "dev_private" "out" "man" "doc" ];
+
+  postFixup = ''
+    moveToOutput include/tif_dir.h $dev_private
+    moveToOutput include/tif_config.h $dev_private
+    moveToOutput include/tiffiop.h $dev_private
+  '';
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  propagatedBuildInputs = [ libjpeg xz zlib ]; #TODO: opengl support (bogus configure detection)
+
+  buildInputs = [ libdeflate ]; # TODO: move all propagatedBuildInputs to buildInputs.
+
+  enableParallelBuilding = true;
+
+  doInstallCheck = true;
+  installCheckTarget = "test";
+
+  meta = with lib; {
+    description = "Library and utilities for working with the TIFF image file format";
+    homepage = "https://libtiff.gitlab.io/libtiff";
+    changelog = "https://libtiff.gitlab.io/libtiff/v${version}.html";
+    license = licenses.libtiff;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtiff/default.nix b/nixpkgs/pkgs/development/libraries/libtiff/default.nix
new file mode 100644
index 000000000000..ea246790020e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtiff/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv
+, fetchurl
+
+, autoreconfHook
+, pkg-config
+
+, libdeflate
+, libjpeg
+, xz
+, zlib
+}:
+
+#FIXME: fix aarch64-darwin build and get rid of ./aarch64-darwin.nix
+
+stdenv.mkDerivation rec {
+  pname = "libtiff";
+  version = "4.3.0";
+
+  src = fetchurl {
+    url = "https://download.osgeo.org/libtiff/tiff-${version}.tar.gz";
+    sha256 = "1j3snghqjbhwmnm5vz3dr1zm68dj15mgbx1wqld7vkl7n2nfaihf";
+  };
+
+  # FreeImage needs this patch
+  patches = [ ./headers.patch ];
+
+  outputs = [ "bin" "dev" "dev_private" "out" "man" "doc" ];
+
+  postFixup = ''
+    moveToOutput include/tif_dir.h $dev_private
+    moveToOutput include/tif_config.h $dev_private
+    moveToOutput include/tiffiop.h $dev_private
+  '';
+
+  # If you want to change to a different build system, please make
+  # sure cross-compilation works first!
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  propagatedBuildInputs = [ libjpeg xz zlib ]; #TODO: opengl support (bogus configure detection)
+
+  buildInputs = [ libdeflate ]; # TODO: move all propagatedBuildInputs to buildInputs.
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Library and utilities for working with the TIFF image file format";
+    homepage = "https://libtiff.gitlab.io/libtiff";
+    changelog = "https://libtiff.gitlab.io/libtiff/v${version}.html";
+    maintainers = with maintainers; [ qyliss ];
+    license = licenses.libtiff;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtiff/headers-cmake.patch b/nixpkgs/pkgs/development/libraries/libtiff/headers-cmake.patch
new file mode 100644
index 000000000000..5a00502ef281
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtiff/headers-cmake.patch
@@ -0,0 +1,13 @@
+diff -ruN a/libtiff/CMakeLists.txt b/libtiff/CMakeLists.txt
+--- a/libtiff/CMakeLists.txt	2019-05-31 13:05:22.849705817 +0000
++++ b/libtiff/CMakeLists.txt	2020-11-27 21:50:03.527831837 +0000
+@@ -42,6 +42,9 @@
+   libtiffxx.map)
+ 
+ set(tiff_HEADERS
++  tiffiop.h
++  ${CMAKE_CURRENT_BINARY_DIR}/tif_config.h
++  tif_dir.h
+   tiff.h
+   tiffio.h
+   tiffvers.h)
diff --git a/nixpkgs/pkgs/development/libraries/libtiff/headers.patch b/nixpkgs/pkgs/development/libraries/libtiff/headers.patch
new file mode 100644
index 000000000000..e1c681502b33
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtiff/headers.patch
@@ -0,0 +1,16 @@
+diff --git i/libtiff/Makefile.am w/libtiff/Makefile.am
+index 44522b62..d66e5948 100644
+--- i/libtiff/Makefile.am
++++ w/libtiff/Makefile.am
+@@ -36,8 +36,11 @@ EXTRA_DIST = \
+ 	tiffconf.h.cmake.in
+ 
+ libtiffinclude_HEADERS = \
++	tif_config.h \
++	tif_dir.h \
+ 	tiff.h \
+ 	tiffio.h \
++	tiffiop.h \
+ 	tiffvers.h
+ 
+ if HAVE_CXX
diff --git a/nixpkgs/pkgs/development/libraries/libtifiles2/default.nix b/nixpkgs/pkgs/development/libraries/libtifiles2/default.nix
new file mode 100644
index 000000000000..874cbc87c875
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtifiles2/default.nix
@@ -0,0 +1,38 @@
+{ stdenv
+, lib
+, fetchurl
+, pkg-config
+, autoreconfHook
+, glib
+, libarchive
+, libticonv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libtifiles2";
+  version = "1.1.7";
+  src = fetchurl {
+    url = "mirror://sourceforge/tilp/${pname}-${version}.tar.bz2";
+    sha256 = "10n9mhlabmaw3ha5ckllxfy6fygs2pmlmj5v6w5v62bvx54kpils";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+  ];
+
+  buildInputs = [
+    glib
+    libarchive
+    libticonv
+  ];
+
+  meta = with lib; {
+    changelog = "http://lpg.ticalc.org/prj_tilp/news.html";
+    description = "This library is part of the TiLP framework";
+    homepage = "http://lpg.ticalc.org/prj_tilp/";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ siraben luc65r ];
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtiger/default.nix b/nixpkgs/pkgs/development/libraries/libtiger/default.nix
new file mode 100644
index 000000000000..094ff565b3c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtiger/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, lib, fetchurl, libkate, pango, cairo, pkg-config, darwin }:
+
+stdenv.mkDerivation rec {
+  name = "libtiger-0.3.4";
+
+  src = fetchurl {
+    url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/libtiger/${name}.tar.gz";
+    sha256 = "0rj1bmr9kngrgbxrjbn4f4f9pww0wmf6viflinq7ava7zdav4hkk";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libkate pango cairo ]
+    ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.ApplicationServices;
+
+  meta = {
+    homepage = "https://code.google.com/archive/p/libtiger/";
+    description = "A rendering library for Kate streams using Pango and Cairo";
+    platforms = lib.platforms.unix;
+    license = lib.licenses.lgpl21Plus;
+    maintainers = with lib.maintainers; [ matthewbauer ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtins/default.nix b/nixpkgs/pkgs/development/libraries/libtins/default.nix
new file mode 100644
index 000000000000..d1a99fb88ab4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtins/default.nix
@@ -0,0 +1,47 @@
+{ boost, cmake, fetchFromGitHub, gtest, libpcap, openssl, lib, stdenv }:
+
+stdenv.mkDerivation rec {
+  pname = "libtins";
+  version = "4.3";
+
+  src = fetchFromGitHub {
+    owner = "mfontanini";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "09ah1a7ska7xiki7625mn1d8i96il3hxbkc39ba8fn1a5383kmqa";
+  };
+
+  postPatch = ''
+    rm -rf googletest
+    cp -r ${gtest.src} googletest
+    chmod -R a+w googletest
+  '';
+
+  nativeBuildInputs = [ cmake gtest ];
+  buildInputs = [
+    openssl
+    libpcap
+    boost
+  ];
+
+  configureFlags = [
+    "--with-boost-libdir=${boost.out}/lib"
+    "--with-boost=${boost.dev}"
+  ];
+
+  doCheck = true;
+  preCheck = ''
+    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD${placeholder "out"}/lib
+    export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD${placeholder "out"}/lib
+  '';
+  checkTarget = "tests test";
+
+  meta = with lib; {
+    description = "High-level, multiplatform C++ network packet sniffing and crafting library";
+    homepage = "https://libtins.github.io/";
+    changelog = "https://raw.githubusercontent.com/mfontanini/${pname}/v${version}/CHANGES.md";
+    license = lib.licenses.bsd2;
+    maintainers = with maintainers; [ fdns ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtomcrypt/default.nix b/nixpkgs/pkgs/development/libraries/libtomcrypt/default.nix
new file mode 100644
index 000000000000..936c92bf7c5d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtomcrypt/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchurl, fetchpatch, libtool, libtommath }:
+
+stdenv.mkDerivation rec {
+  pname = "libtomcrypt";
+  version = "1.18.2";
+
+  src = fetchurl {
+    url = "https://github.com/libtom/libtomcrypt/releases/download/v${version}/crypt-${version}.tar.xz";
+    sha256 = "113vfrgapyv72lalhd3nkw7jnks8az0gcb5wqn9hj19nhcxlrbcn";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "CVE-2019-17362.patch";
+      url = "https://github.com/libtom/libtomcrypt/pull/508/commits/25c26a3b7a9ad8192ccc923e15cf62bf0108ef94.patch";
+      sha256 = "1bwsj0pwffxw648wd713z3xcyrbxc2z646psrzp38ys564fjh5zf";
+    })
+  ];
+
+  nativeBuildInputs = [ libtool libtommath ];
+
+  postPatch = ''
+    substituteInPlace makefile.shared --replace "LT:=glibtool" "LT:=libtool"
+  '';
+
+  preBuild = ''
+    makeFlagsArray+=(PREFIX=$out \
+      CFLAGS="-DUSE_LTM -DLTM_DESC -DLTC_PTHREAD" \
+      EXTRALIBS=\"-ltommath\" \
+      INSTALL_GROUP=$(id -g) \
+      INSTALL_USER=$(id -u))
+  '';
+
+  makefile = "makefile.shared";
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://www.libtom.net/LibTomCrypt/";
+    description = "A fairly comprehensive, modular and portable cryptographic toolkit";
+    license = with licenses; [ publicDomain wtfpl ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtommath/default.nix b/nixpkgs/pkgs/development/libraries/libtommath/default.nix
new file mode 100644
index 000000000000..058ae5242315
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtommath/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl, libtool }:
+
+stdenv.mkDerivation rec {
+  pname = "libtommath";
+  version = "1.2.0";
+
+  src = fetchurl {
+    url = "https://github.com/libtom/libtommath/releases/download/v${version}/ltm-${version}.tar.xz";
+    sha256 = "1c8q1qy88cjhdjlk3g24mra94h34c1ldvkjz0n2988c0yvn5xixp";
+  };
+
+  nativeBuildInputs = [ libtool ];
+
+  postPatch = ''
+    substituteInPlace makefile.shared --replace glibtool libtool
+    substituteInPlace makefile_include.mk --replace "shell arch" "shell uname -m"
+  '';
+
+  preBuild = ''
+    makeFlagsArray=(PREFIX=$out \
+      INSTALL_GROUP=$(id -g) \
+      INSTALL_USER=$(id -u))
+  '';
+
+  makefile = "makefile.shared";
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://www.libtom.net/LibTomMath/";
+    description = "A library for integer-based number-theoretic applications";
+    license = with licenses; [ publicDomain wtfpl ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.1.nix b/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.1.nix
new file mode 100644
index 000000000000..a898dd8e24e6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.1.nix
@@ -0,0 +1,50 @@
+{ stdenv, lib, fetchFromGitHub, pkg-config, automake, autoconf
+, zlib, boost, openssl, libtool, python, libiconv, ncurses
+}:
+
+let
+  version = "1.1.11";
+  formattedVersion = lib.replaceChars ["."] ["_"] version;
+
+  # Make sure we override python, so the correct version is chosen
+  # for the bindings, if overridden
+  boostPython = boost.override { enablePython = true; inherit python; };
+
+in stdenv.mkDerivation {
+  pname = "libtorrent-rasterbar";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "arvidn";
+    repo = "libtorrent";
+    rev = "libtorrent_${formattedVersion}";
+    sha256 = "0nwdsv6d2gkdsh7l5a46g6cqx27xwh3msify5paf02l1qzjy4s5l";
+  };
+
+  enableParallelBuilding = true;
+  nativeBuildInputs = [ automake autoconf libtool pkg-config ];
+  buildInputs = [ boostPython openssl zlib python libiconv ncurses ];
+  preConfigure = "./autotool.sh";
+
+  postInstall = ''
+    moveToOutput "include" "$dev"
+    moveToOutput "lib/${python.libPrefix}" "$python"
+  '';
+
+  outputs = [ "out" "dev" "python" ];
+
+  configureFlags = [
+    "--enable-python-binding"
+    "--with-libiconv=yes"
+    "--with-boost=${boostPython.dev}"
+    "--with-boost-libdir=${boostPython.out}/lib"
+  ];
+
+  meta = with lib; {
+    homepage = "https://libtorrent.org/";
+    description = "A C++ BitTorrent implementation focusing on efficiency and scalability";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.phreedom ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.2.nix b/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.2.nix
new file mode 100644
index 000000000000..fc97b629a52f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.2.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, automake, autoconf
+, zlib, boost, openssl, libtool, python, libiconv, ncurses, SystemConfiguration
+}:
+
+let
+  version = "1.2.11";
+
+  # Make sure we override python, so the correct version is chosen
+  # for the bindings, if overridden
+  boostPython = boost.override { enablePython = true; inherit python; };
+
+in stdenv.mkDerivation {
+  pname = "libtorrent-rasterbar";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "arvidn";
+    repo = "libtorrent";
+    rev = "v${version}";
+    sha256 = "05qm8mcyxsnb6zb8nckln1gkk8ncwzfhsz7d7p3fhx6gdsc8j71b";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ automake autoconf libtool pkg-config ];
+
+  buildInputs = [ boostPython openssl zlib python libiconv ncurses ]
+    ++ lib.optionals stdenv.isDarwin [ SystemConfiguration ];
+
+  preConfigure = "./autotool.sh";
+
+  postInstall = ''
+    moveToOutput "include" "$dev"
+    moveToOutput "lib/${python.libPrefix}" "$python"
+  '';
+
+  outputs = [ "out" "dev" "python" ];
+
+  configureFlags = [
+    "--enable-python-binding"
+    "--with-libiconv=yes"
+    "--with-boost=${boostPython.dev}"
+    "--with-boost-libdir=${boostPython.out}/lib"
+  ];
+
+  meta = with lib; {
+    homepage = "https://libtorrent.org/";
+    description = "A C++ BitTorrent implementation focusing on efficiency and scalability";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.phreedom ];
+    broken = stdenv.isDarwin;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/default.nix b/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/default.nix
new file mode 100644
index 000000000000..90c14c6fdf95
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchFromGitHub, cmake
+, zlib, boost, openssl, python, ncurses, SystemConfiguration
+}:
+
+let
+  version = "2.0.3";
+
+  # Make sure we override python, so the correct version is chosen
+  boostPython = boost.override { enablePython = true; inherit python; };
+
+in stdenv.mkDerivation {
+  pname = "libtorrent-rasterbar";
+  inherit version;
+
+  src = fetchFromGitHub {
+    owner = "arvidn";
+    repo = "libtorrent";
+    rev = "v${version}";
+    sha256 = "0c5g2chylhkwwssfab9gw0b7bm3raj08yzgia7j4d044lp8gflnd";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ boostPython openssl zlib python ncurses ]
+    ++ lib.optionals stdenv.isDarwin [ SystemConfiguration ];
+
+  postInstall = ''
+    moveToOutput "include" "$dev"
+    moveToOutput "lib/${python.libPrefix}" "$python"
+  '';
+
+  outputs = [ "out" "dev" "python" ];
+
+  cmakeFlags = [
+    "-Dpython-bindings=on"
+  ];
+
+  meta = with lib; {
+    homepage = "https://libtorrent.org/";
+    description = "A C++ BitTorrent implementation focusing on efficiency and scalability";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.phreedom ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtoxcore/default.nix b/nixpkgs/pkgs/development/libraries/libtoxcore/default.nix
new file mode 100644
index 000000000000..4badf32fe8cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtoxcore/default.nix
@@ -0,0 +1,59 @@
+{ lib, stdenv, fetchFromGitHub, cmake, libsodium, ncurses, libopus, msgpack
+, libvpx, check, libconfig, pkg-config }:
+
+let
+  generic = { version, sha256 }:
+  stdenv.mkDerivation {
+    pname = "libtoxcore";
+    inherit version;
+
+    src = fetchFromGitHub {
+      owner  = "TokTok";
+      repo   = "c-toxcore";
+      rev    = "v${version}";
+      inherit sha256;
+    };
+
+    cmakeFlags = [
+      "-DBUILD_NTOX=ON"
+      "-DDHT_BOOTSTRAP=ON"
+      "-DBOOTSTRAP_DAEMON=ON"
+    ];
+
+    buildInputs = [
+      libsodium msgpack ncurses libconfig
+    ] ++ lib.optionals (!stdenv.isAarch32) [
+      libopus libvpx
+    ];
+
+    nativeBuildInputs = [ cmake pkg-config ];
+
+    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 lib; {
+      description = "P2P FOSS instant messaging application aimed to replace Skype";
+      homepage = "https://tox.chat";
+      license = licenses.gpl3Plus;
+      maintainers = with maintainers; [ peterhoeg ];
+      platforms = platforms.all;
+    };
+  };
+
+in {
+  libtoxcore_0_1 = generic {
+    version = "0.1.11";
+    sha256 = "1fya5gfiwlpk6fxhalv95n945ymvp2iidiyksrjw1xw95fzsp1ij";
+  };
+
+  libtoxcore_0_2 = generic {
+    version = "0.2.12";
+    sha256 = "0a6sqpm00d2rn0nviqfz4gh9ck1wzci6rxgmqmcyryl5ca19ffvp";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtoxcore/new-api.nix b/nixpkgs/pkgs/development/libraries/libtoxcore/new-api.nix
new file mode 100644
index 000000000000..77119e2830fe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtoxcore/new-api.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, libsodium, ncurses, libopus
+, libvpx, check, libconfig, pkg-config }:
+
+stdenv.mkDerivation {
+  name = "tox-core-new-20160727";
+
+  src = fetchFromGitHub {
+    owner  = "irungentoo";
+    repo   = "toxcore";
+    rev    = "755f084e8720b349026c85afbad58954cb7ff1d4";
+    sha256 = "0ap1gvlyihnfivv235dbrgsxsiiz70bhlmlr5gn1027w3h5kqz8w";
+  };
+
+  NIX_LDFLAGS = "-lgcc_s";
+
+  postPatch = ''
+    # within Nix chroot builds, localhost is unresolvable
+    sed -i -e '/DEFTESTCASE(addr_resolv_localhost)/d' \
+      auto_tests/network_test.c
+    # takes WAAAY too long (~10 minutes) and would timeout
+    sed -i -e '/DEFTESTCASE[^(]*(many_clients\>/d' \
+      auto_tests/tox_test.c
+  '';
+
+  configureFlags = [
+    "--with-libsodium-headers=${libsodium.dev}/include"
+    "--with-libsodium-libs=${libsodium.out}/lib"
+    "--enable-ntox"
+    "--enable-daemon"
+  ];
+
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [
+    autoreconfHook libsodium ncurses check libconfig
+  ] ++ lib.optionals (!stdenv.isAarch32) [
+    libopus
+  ];
+
+  propagatedBuildInputs = lib.optionals (!stdenv.isAarch32) [ libvpx ];
+
+  # Some tests fail randomly due to timeout. This kind of problem is well known
+  # by upstream: https://github.com/irungentoo/toxcore/issues/{950,1054}
+  # They don't recommend running tests on 50core machines with other cpu-bound
+  # tests running in parallel.
+  #
+  # NOTE: run the tests locally on your machine before upgrading this package!
+  doCheck = false;
+
+  meta = with lib; {
+    description = "P2P FOSS instant messaging application aimed to replace Skype with crypto";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libtsm/default.nix b/nixpkgs/pkgs/development/libraries/libtsm/default.nix
new file mode 100644
index 000000000000..d959306c9718
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libtsm/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, libxkbcommon, pkg-config, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "libtsm";
+  version = "4.0.1";
+
+  src = fetchFromGitHub {
+    owner = "Aetf";
+    repo = "libtsm";
+    rev = "v${version}";
+    sha256 = "0mwn91i5h5d518i1s05y7hzv6bc13vzcvxszpfh77473iwg4wprx";
+  };
+
+  buildInputs = [ libxkbcommon ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  meta = with lib; {
+    description = "Terminal-emulator State Machine";
+    homepage = "http://www.freedesktop.org/wiki/Software/kmscon/libtsm/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ cstrahan ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libu2f-host/default.nix b/nixpkgs/pkgs/development/libraries/libu2f-host/default.nix
new file mode 100644
index 000000000000..3be758c906f1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libu2f-host/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, json_c, hidapi }:
+
+stdenv.mkDerivation rec {
+  pname = "libu2f-host";
+  version = "1.1.10";
+
+  src = fetchurl {
+    url = "https://developers.yubico.com/${pname}/Releases/${pname}-${version}.tar.xz";
+    sha256 = "0vrivl1dwql6nfi48z6dy56fwy2z13d7abgahgrs2mcmqng7hra2";
+  };
+
+  patches = [
+    # remove after updating to next release
+    (fetchpatch {
+      name = "json-c-0.14-support.patch";
+      url = "https://github.com/Yubico/libu2f-host/commit/840f01135d2892f45e71b9e90405de587991bd03.patch";
+      sha256 = "0xplx394ppsbsb4h4l8b9m4dv9shbl0zyck3y26vbm9i1g981ki7";
+    })
+  ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ json_c hidapi ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://developers.yubico.com/libu2f-host";
+    description = "A C library and command-line tool that implements the host-side of the U2F protocol";
+    license = with licenses; [ gpl3Plus lgpl21Plus ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libu2f-server/default.nix b/nixpkgs/pkgs/development/libraries/libu2f-server/default.nix
new file mode 100644
index 000000000000..aac71bda3698
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libu2f-server/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, json_c, openssl, check, file, help2man, which, gengetopt }:
+
+stdenv.mkDerivation rec {
+  pname = "libu2f-server";
+  version = "1.1.0";
+  src = fetchurl {
+    url = "https://developers.yubico.com/libu2f-server/Releases/${pname}-${version}.tar.xz";
+    sha256 = "0xx296nmmqa57w0v5p2kasl5zr1ms2gh6qi4lhv6xvzbmjp3rkcd";
+  };
+
+  patches = [
+    # remove after updating to next release
+    (fetchpatch {
+      name = "json-c-0.14-support.patch";
+      url = "https://github.com/Yubico/libu2f-server/commit/f7c4983b31909299c47bf9b2627c84b6bfe225de.patch";
+      sha256 = "10q66w3paii1yhfdmjskpip078fk9p3sjllbqx1yx71qbjki55b0";
+    })
+  ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ json_c openssl check file help2man which gengetopt ];
+
+  meta = with lib; {
+    homepage = "https://developers.yubico.com/libu2f-server/";
+    description = "A C library that implements the server-side of the U2F protocol";
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ philandstuff ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libubox/default.nix b/nixpkgs/pkgs/development/libraries/libubox/default.nix
new file mode 100644
index 000000000000..9261d1b81bac
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libubox/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, lib, fetchgit, cmake, pkg-config, json_c }:
+
+stdenv.mkDerivation {
+  pname = "libubox";
+  version = "unstable-2021-03-09";
+
+  src = fetchgit {
+    url = "https://git.openwrt.org/project/libubox.git";
+    rev = "551d75b5662cccd0466b990d58136bdf799a804d";
+    sha256 = "05cnjjqjv9nvrs1d8pg4xxxf27jryiv6xk8plmdpmm7r2wkvwn3r";
+  };
+
+  cmakeFlags = [ "-DBUILD_LUA=OFF" "-DBUILD_EXAMPLES=OFF" ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ json_c ];
+
+  meta = with lib; {
+    description = "C utility functions for OpenWrt";
+    homepage = "https://git.openwrt.org/?p=project/libubox.git;a=summary";
+    license = licenses.isc;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ fpletz ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libuchardet/default.nix b/nixpkgs/pkgs/development/libraries/libuchardet/default.nix
new file mode 100644
index 000000000000..8bf2e2acff9f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libuchardet/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "uchardet";
+  version = "0.0.7";
+
+  outputs = [ "bin" "out" "man" "dev" ];
+
+  src = fetchurl {
+    url = "https://www.freedesktop.org/software/${pname}/releases/${pname}-${version}.tar.xz";
+    sha256 = "1ca51sryhryqz82v4d0graaiqqq5w2f33a9gj83b910xmq499irz";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    "-DCMAKE_SKIP_BUILD_RPATH=OFF" # for tests
+  ];
+
+  doCheck = !stdenv.isi686; # tests fail on i686
+
+  meta = with lib; {
+    description = "Mozilla's Universal Charset Detector C/C++ API";
+    homepage = "https://www.freedesktop.org/wiki/Software/uchardet/";
+    license = licenses.mpl11;
+    maintainers = with maintainers; [ cstrahan ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libucl/default.nix b/nixpkgs/pkgs/development/libraries/libucl/default.nix
new file mode 100644
index 000000000000..e65d0d475ff9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libucl/default.nix
@@ -0,0 +1,58 @@
+{ lib, stdenv
+, fetchFromGitHub
+, pkg-config
+, autoreconfHook
+, curl
+, lua
+, openssl
+, features ? {
+    urls = false;
+    # Upstream enables regex by default
+    regex = true;
+    # Signature support is broken with openssl 1.1.1: https://github.com/vstakhov/libucl/issues/203
+    signatures = false;
+    lua = false;
+    utils = false;
+  }
+}:
+
+let
+  featureDeps = {
+    urls = [ curl ];
+    signatures = [ openssl ];
+    lua = [ lua ];
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "libucl";
+  version = "0.8.1";
+
+  src = fetchFromGitHub {
+    owner = "vstakhov";
+    repo = pname;
+    rev = version;
+    sha256 = "1h52ldxankyhbbm1qbqz1f2q0j03c1b4mig7343bs3mc6fpm18gf";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+
+  buildInputs = with lib;
+    concatLists (
+      mapAttrsToList (feat: enabled:
+        optionals enabled (featureDeps."${feat}" or [])
+      ) features
+    );
+
+  enableParallelBuilding = true;
+
+  configureFlags = with lib;
+    mapAttrsToList (feat: enabled: strings.enableFeature enabled feat) features;
+
+  meta = with lib; {
+    description = "Universal configuration library parser";
+    homepage = "https://github.com/vstakhov/libucl";
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ jpotier ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libuecc/default.nix b/nixpkgs/pkgs/development/libraries/libuecc/default.nix
new file mode 100644
index 000000000000..1cc3ac8ebea1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libuecc/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchgit, cmake }:
+
+stdenv.mkDerivation rec {
+  version = "7";
+  pname = "libuecc";
+
+  src = fetchgit {
+    url = "git://git.universe-factory.net/libuecc";
+    rev = "refs/tags/v${version}";
+    sha256 = "1sm05aql75sh13ykgsv3ns4x4zzw9lvzid6misd22gfgf6r9n5fs";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Very small Elliptic Curve Cryptography library";
+    homepage = "https://git.universe-factory.net/libuecc";
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ fpletz ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libui/default.nix b/nixpkgs/pkgs/development/libraries/libui/default.nix
new file mode 100644
index 000000000000..7002f75cc45e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libui/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, gtk3, Cocoa }:
+
+let
+  shortName = "libui";
+  version   = "4.1a";
+  backend   = if stdenv.isDarwin then "darwin" else "unix";
+in
+
+stdenv.mkDerivation {
+  name = "${shortName}-${version}";
+  src  = fetchFromGitHub {
+    owner  = "andlabs";
+    repo   = "libui";
+    rev    = "alpha4.1";
+    sha256 = "0bm6xvqk4drg2kw6d304x6mlfal7gh8mbl5a9f0509smmdzgdkwm";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  propagatedBuildInputs = lib.optional stdenv.isLinux gtk3
+    ++ lib.optionals stdenv.isDarwin [ Cocoa ];
+
+  preConfigure = lib.optionalString stdenv.isDarwin ''
+    sed -i 's/set(CMAKE_OSX_DEPLOYMENT_TARGET "10.8")//' ./CMakeLists.txt
+  '';
+
+  installPhase = ''
+    mkdir -p $out/{include,lib}
+    mkdir -p $out/lib/pkgconfig
+  '' + lib.optionalString stdenv.isLinux ''
+    mv ./out/${shortName}.so.0 $out/lib/
+    ln -s $out/lib/${shortName}.so.0 $out/lib/${shortName}.so
+  '' + lib.optionalString stdenv.isDarwin ''
+    mv ./out/${shortName}.A.dylib $out/lib/
+    ln -s $out/lib/${shortName}.A.dylib $out/lib/${shortName}.dylib
+  '' + ''
+    cp $src/ui.h $out/include
+    cp $src/ui_${backend}.h $out/include
+
+    cp ${./libui.pc} $out/lib/pkgconfig/${shortName}.pc
+    substituteInPlace $out/lib/pkgconfig/${shortName}.pc \
+      --subst-var-by out $out \
+      --subst-var-by version "${version}"
+  '';
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    install_name_tool -id $out/lib/${shortName}.A.dylib $out/lib/${shortName}.A.dylib
+  '';
+
+  meta = with lib; {
+    homepage    = "https://github.com/andlabs/libui";
+    description = "Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports";
+    license     = licenses.mit;
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libui/libui.pc b/nixpkgs/pkgs/development/libraries/libui/libui.pc
new file mode 100644
index 000000000000..42ee86fb550f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libui/libui.pc
@@ -0,0 +1,11 @@
+prefix=@out@
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${exec_prefix}/include
+
+Name: libui
+Description: Simple and portable (but not inflexible) GUI library
+Version: @version@
+
+Libs: -L${libdir} -lui
+Cflags: -I${includedir}
diff --git a/nixpkgs/pkgs/development/libraries/libuinputplus/0001-Add-cmake-install-directives.patch b/nixpkgs/pkgs/development/libraries/libuinputplus/0001-Add-cmake-install-directives.patch
new file mode 100644
index 000000000000..cd6f43d37705
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libuinputplus/0001-Add-cmake-install-directives.patch
@@ -0,0 +1,40 @@
+From 265e406e254c8d84016b12b344d8df71d1765dd1 Mon Sep 17 00:00:00 2001
+From: Jappie Klooster <jappieklooster@hotmail.com>
+Date: Fri, 2 Apr 2021 16:33:18 -0400
+Subject: [PATCH] Add cmake install directives
+
+To make nix builds work, it expect a make install command to
+be available.
+Adding these directives seems to fix the build.
+
+If it's no trouble to you, please consider adding them.
+---
+ CMakeLists.txt | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index cbfc9c1..948c432 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -7,6 +7,8 @@ set(SOURCE_FILES
+         uInput.cpp uInputSetup.cpp uInputResource.cpp
+         uInput.hpp CommonIncludes.hpp uInputSetup.hpp)
+ 
++include(GNUInstallDirs)
++
+ add_library(uInputPlus ${SOURCE_FILES})
+ target_include_directories(uInputPlus PUBLIC .)
+ 
+@@ -15,3 +17,9 @@ target_link_libraries(uInputPlus_test uInputPlus)
+ 
+ configure_file(uInputPlus.pc.in uInputPlus.pc @ONLY)
+ 
++
++install(TARGETS uInputPlus
++        LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
++install(FILES uInput.hpp CommonIncludes.hpp uInputSetup.hpp
++        DESTINATION include/)
++
+-- 
+2.29.2
+
diff --git a/nixpkgs/pkgs/development/libraries/libuinputplus/default.nix b/nixpkgs/pkgs/development/libraries/libuinputplus/default.nix
new file mode 100644
index 000000000000..28110b577047
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libuinputplus/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config }:
+stdenv.mkDerivation rec {
+  pname = "libuinputplus";
+  version = "2021-04-02";
+
+  # adds missing cmake install directives
+  # https://github.com/YukiWorkshop/libuInputPlus/pull/7
+  patches = [ ./0001-Add-cmake-install-directives.patch];
+
+  src  = fetchFromGitHub {
+    owner  = "YukiWorkshop";
+    repo   = "libuInputPlus";
+    rev    = "f7f18eb339bba61a43f2cad481a9b1a453a66957";
+    sha256 = "0sind2ghhy4h9kfkr5hsmhcq0di4ifwqyv4gac96rgj5mwvs33lp";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  meta = with 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/libuldaq/0001-uldaq.patch b/nixpkgs/pkgs/development/libraries/libuldaq/0001-uldaq.patch
new file mode 100644
index 000000000000..97375283cd64
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libuldaq/0001-uldaq.patch
@@ -0,0 +1,28 @@
+diff --git a/Makefile.am b/Makefile.am
+index 0e69cd4..b4a1f1a 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -26,7 +26,7 @@ dist_pkgconfig_DATA=libuldaq.pc
+ # fpga/USB_DIO32HS.bin
+ 
+ if OS_LINUX
+-rulesdatadir=/lib/udev/rules.d/
++rulesdatadir=$(libdir)/udev/rules.d/
+ dist_rulesdata_DATA=rules/50-uldaq.rules
+ endif
+ 
+@@ -42,14 +42,6 @@ dist-up: dist
+ 	mkdir -p $(reldir)
+ 	cp $(distdir).tar.bz2 $(reldir)
+ 
+-if OS_LINUX
+-install-data-hook:
+-	udevadm control --reload-rules && \
+-	test -f "/etc/redhat-release" && echo "/usr/local/lib" > /etc/ld.so.conf.d/uldaq.conf || echo "" && \
+-	test -f "/etc/arch-release" && echo "/usr/local/lib" > /etc/ld.so.conf.d/uldaq.conf || echo "" && \
+-	ldconfig
+-endif
+-
+ if OS_LINUX
+ uninstall-hook:
+ 	test -f "/etc/ld.so.conf.d/uldaq.conf" &&  rm "/etc/ld.so.conf.d/uldaq.conf" || echo ""
diff --git a/nixpkgs/pkgs/development/libraries/libuldaq/default.nix b/nixpkgs/pkgs/development/libraries/libuldaq/default.nix
new file mode 100644
index 000000000000..2f8f7fbb30ea
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libuldaq/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, libusb1, ...}:
+
+stdenv.mkDerivation rec {
+  pname = "libuldaq";
+  version = "1.2.0";
+
+  src = fetchFromGitHub {
+    owner = "mccdaq";
+    repo = "uldaq";
+    rev = "v${version}";
+    sha256 = "0l9ima8ac99yd9vvjvdrmacm95ghv687wiy39zxm00cmghcfv3vj";
+  };
+
+  patches = [
+    # Patch needed for `make install` to succeed
+    ./0001-uldaq.patch
+  ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  buildInputs = [ libusb1 ];
+
+  meta = with lib; {
+    description = "Library to talk to uldaq devices";
+    longDescription = ''
+      Library used to communicate with USB data acquisition (DAQ)
+      devices from Measurement Computing
+    '';
+    homepage = "https://github.com/mccdaq/uldaq";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.simonkampe ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libunarr/default.nix b/nixpkgs/pkgs/development/libraries/libunarr/default.nix
new file mode 100644
index 000000000000..523ce82ce22d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libunarr/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "libunarr";
+  version = "1.0.1";
+
+  src = fetchurl {
+    url = "https://github.com/selmf/unarr/releases/download/v${version}/unarr-${version}.tar.xz";
+    sha256 = "1db500k6w90qn6qb4j3zcczailmmv81q9lv4bwq516hbncg5p4sl";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://github.com/selmf/unarr";
+    description = "A lightweight decompression library with support for rar, tar and zip archives";
+    license = licenses.lgpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libunibreak/default.nix b/nixpkgs/pkgs/development/libraries/libunibreak/default.nix
new file mode 100644
index 000000000000..9e6cec471d4d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libunibreak/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "libunibreak";
+  version = "4.3";
+
+  src = let
+      rev_version = lib.replaceStrings ["."] ["_"] version;
+  in fetchFromGitHub {
+    owner = "adah1972";
+    repo = pname;
+    rev = "libunibreak_${rev_version}";
+    sha256 = "19g3ixs1ycisfdnzd8v7j5r49h0x0hshchk9qwlz4i0mjv825plx";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = with lib; {
+    homepage = "https://github.com/adah1972/libunibreak";
+    description = "Implementation of line breaking and word breaking algorithms as in the Unicode standard";
+    license = licenses.zlib;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.coroa ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libuninameslist/default.nix b/nixpkgs/pkgs/development/libraries/libuninameslist/default.nix
new file mode 100644
index 000000000000..2e75c783681e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libuninameslist/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libuninameslist";
+  version = "20200413";
+
+  src = fetchFromGitHub {
+    owner = "fontforge";
+    repo = pname;
+    rev = version;
+    sha256 = "0jbg94z00f5vwqyjfrbill6cjvzp1zrki6m3d235jjxyw0hm3wr5";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/fontforge/libuninameslist/";
+    description = "A Library of Unicode names and annotation data";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ erictapen ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libunique/1.1.6-G_CONST_RETURN.patch b/nixpkgs/pkgs/development/libraries/libunique/1.1.6-G_CONST_RETURN.patch
new file mode 100644
index 000000000000..1cc5b6e01be4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libunique/1.1.6-G_CONST_RETURN.patch
@@ -0,0 +1,143 @@
+From 557b0e5045c9eadb556ce11e16965cf0d0787438 Mon Sep 17 00:00:00 2001
+From: Stef Walter <stefw@collabora.co.uk>
+Date: Tue, 14 Jun 2011 12:33:45 +0100
+Subject: [PATCH] Remove G_CONST_RETURN usage, now that its gone in glib.
+
+https://bugzilla.gnome.org/show_bug.cgi?id=652545
+
+[Alexandre Rostovtsev <tetromino@gmail.com>: backported to unique-1.1]
+---
+ unique/uniqueapp.c       |    4 ++--
+ unique/uniquebackend.c   |    4 ++--
+ unique/uniquebackend.h   |    4 ++--
+ unique/uniqueinternals.h |    4 ++--
+ unique/uniquemessage.c   |    4 ++--
+ unique/uniquemessage.h   |    4 ++--
+ 6 files changed, 12 insertions(+), 12 deletions(-)
+
+diff --git a/unique/uniqueapp.c b/unique/uniqueapp.c
+index b40a86c..e8edc94 100644
+--- a/unique/uniqueapp.c
++++ b/unique/uniqueapp.c
+@@ -781,7 +781,7 @@ unique_app_watch_window (UniqueApp *app,
+ }
+ 
+ 
+-G_CONST_RETURN gchar *
++const gchar *
+ unique_command_to_string (UniqueApp *app,
+                           gint       command)
+ {
+@@ -863,7 +863,7 @@ unique_command_from_string (UniqueApp   *app,
+   return retval;
+ }
+ 
+-G_CONST_RETURN gchar *
++const gchar *
+ unique_response_to_string (UniqueResponse response)
+ {
+   GEnumClass *enum_class;
+diff --git a/unique/uniquebackend.c b/unique/uniquebackend.c
+index a76e42e..68e2735 100644
+--- a/unique/uniquebackend.c
++++ b/unique/uniquebackend.c
+@@ -111,7 +111,7 @@ unique_backend_set_name (UniqueBackend *backend,
+  *
+  * Return value: FIXME
+  */
+-G_CONST_RETURN gchar *
++const gchar *
+ unique_backend_get_name (UniqueBackend *backend)
+ {
+   g_return_val_if_fail (UNIQUE_IS_BACKEND (backend), NULL);
+@@ -154,7 +154,7 @@ unique_backend_set_startup_id (UniqueBackend *backend,
+  *
+  * Return value: FIXME
+  */
+-G_CONST_RETURN gchar *
++const gchar *
+ unique_backend_get_startup_id (UniqueBackend *backend)
+ {
+   g_return_val_if_fail (UNIQUE_IS_BACKEND (backend), NULL);
+diff --git a/unique/uniquebackend.h b/unique/uniquebackend.h
+index a50ce4e..b19ad3e 100644
+--- a/unique/uniquebackend.h
++++ b/unique/uniquebackend.h
+@@ -94,10 +94,10 @@ GType                 unique_backend_get_type       (void) G_GNUC_CONST;
+ 
+ UniqueBackend *       unique_backend_create         (void);
+ 
+-G_CONST_RETURN gchar *unique_backend_get_name       (UniqueBackend     *backend);
++const gchar *         unique_backend_get_name       (UniqueBackend     *backend);
+ void                  unique_backend_set_name       (UniqueBackend     *backend,
+                                                      const gchar       *name);
+-G_CONST_RETURN gchar *unique_backend_get_startup_id (UniqueBackend     *backend);
++const gchar *         unique_backend_get_startup_id (UniqueBackend     *backend);
+ void                  unique_backend_set_startup_id (UniqueBackend     *backend,
+                                                      const gchar       *startup_id);
+ GdkScreen *           unique_backend_get_screen     (UniqueBackend     *backend);
+diff --git a/unique/uniqueinternals.h b/unique/uniqueinternals.h
+index 3cec152..ccae0cd 100644
+--- a/unique/uniqueinternals.h
++++ b/unique/uniqueinternals.h
+@@ -44,11 +44,11 @@ UniqueResponse unique_app_emit_message_received (UniqueApp         *app,
+  * and then back into an id
+  */
+ UniqueResponse        unique_response_from_string  (const gchar    *response);
+-G_CONST_RETURN gchar *unique_response_to_string    (UniqueResponse  response);
++const gchar *         unique_response_to_string    (UniqueResponse  response);
+ 
+ gint                  unique_command_from_string   (UniqueApp      *app,
+                                                     const gchar    *command);
+-G_CONST_RETURN gchar *unique_command_to_string     (UniqueApp      *app,
++const gchar *         unique_command_to_string     (UniqueApp      *app,
+                                                     gint            command);
+ 
+ G_END_DECLS
+diff --git a/unique/uniquemessage.c b/unique/uniquemessage.c
+index c74392d..2b2a9fc 100644
+--- a/unique/uniquemessage.c
++++ b/unique/uniquemessage.c
+@@ -185,7 +185,7 @@ unique_message_data_set (UniqueMessageData *message_data,
+  *
+  * Since: 1.0.2
+  */
+-G_CONST_RETURN guchar *
++const guchar *
+ unique_message_data_get (UniqueMessageData *message_data,
+                          gsize             *length)
+ {
+@@ -525,7 +525,7 @@ unique_message_data_get_screen (UniqueMessageData *message_data)
+  *   owned by the #UniqueMessageData structure and should not be
+  *   modified or freed
+  */
+-G_CONST_RETURN gchar *
++const gchar *
+ unique_message_data_get_startup_id (UniqueMessageData *message_data)
+ {
+   g_return_val_if_fail (message_data != NULL, NULL);
+diff --git a/unique/uniquemessage.h b/unique/uniquemessage.h
+index d3e9c3c..93eee21 100644
+--- a/unique/uniquemessage.h
++++ b/unique/uniquemessage.h
+@@ -48,7 +48,7 @@ void                   unique_message_data_free           (UniqueMessageData *me
+ void                   unique_message_data_set            (UniqueMessageData *message_data,
+                                                            const guchar      *data,
+                                                            gsize              length);
+-G_CONST_RETURN guchar *unique_message_data_get            (UniqueMessageData *message_data,
++const guchar *         unique_message_data_get            (UniqueMessageData *message_data,
+                                                            gsize             *length);
+ 
+ gboolean               unique_message_data_set_text       (UniqueMessageData *message_data,
+@@ -63,7 +63,7 @@ void                   unique_message_data_set_filename   (UniqueMessageData *me
+ gchar *                unique_message_data_get_filename   (UniqueMessageData *message_data);
+ 
+ GdkScreen *            unique_message_data_get_screen     (UniqueMessageData *message_data);
+-G_CONST_RETURN gchar * unique_message_data_get_startup_id (UniqueMessageData *message_data);
++const gchar *          unique_message_data_get_startup_id (UniqueMessageData *message_data);
+ guint                  unique_message_data_get_workspace  (UniqueMessageData *message_data);
+ 
+ G_END_DECLS
+-- 
+1.7.6
+
diff --git a/nixpkgs/pkgs/development/libraries/libunique/1.1.6-compiler-warnings.patch b/nixpkgs/pkgs/development/libraries/libunique/1.1.6-compiler-warnings.patch
new file mode 100644
index 000000000000..f47e66267d50
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libunique/1.1.6-compiler-warnings.patch
@@ -0,0 +1,50 @@
+From 9df132a70d54b768a8e1d0335d24b85ac9b3fb76 Mon Sep 17 00:00:00 2001
+From: Emmanuele Bassi <ebassi@linux.intel.com>
+Date: Sun, 27 Mar 2011 08:42:22 +0000
+Subject: Remove compiler warnings
+
+(cherry picked from commit f791ed16b19dddc7fbaf90d8f797520e67883021)
+
+Signed-off-by: Emmanuele Bassi <ebassi@linux.intel.com>
+---
+diff --git a/unique/dbus/uniquebackend-dbus.c b/unique/dbus/uniquebackend-dbus.c
+index 3ae1bed..69faa00 100644
+--- a/unique/dbus/uniquebackend-dbus.c
++++ b/unique/dbus/uniquebackend-dbus.c
+@@ -84,7 +84,6 @@ unique_backend_dbus_register_proxy (UniqueBackendDBus *backend_dbus)
+ static gboolean
+ unique_backend_dbus_request_name (UniqueBackend *backend)
+ {
+-  UniqueBackendDBus *backend_dbus;
+   const gchar *name;
+   DBusGConnection *connection;
+   DBusGProxy *proxy;
+@@ -97,8 +96,6 @@ unique_backend_dbus_request_name (UniqueBackend *backend)
+   if (!connection)
+     return FALSE;
+ 
+-  backend_dbus = UNIQUE_BACKEND_DBUS (backend);
+-
+   retval = TRUE;
+   name = unique_backend_get_name (backend);
+   g_assert (name != NULL);
+@@ -207,10 +204,14 @@ unique_backend_dbus_send_message (UniqueBackend     *backend,
+                                         cmd, data, time_,
+                                         &resp,
+                                         &error);
+-  if (error)
++  if (!res)
+     {
+-      g_warning ("Error while sending message: %s", error->message);
+-      g_error_free (error);
++      if (error)
++        {
++          g_warning ("Error while sending message: %s", error->message);
++          g_error_free (error);
++        }
++
+       g_free (cmd);
+       
+       return UNIQUE_RESPONSE_INVALID;
+--
+cgit v0.9
diff --git a/nixpkgs/pkgs/development/libraries/libunique/1.1.6-fix-test.patch b/nixpkgs/pkgs/development/libraries/libunique/1.1.6-fix-test.patch
new file mode 100644
index 000000000000..b2e85e4d71a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libunique/1.1.6-fix-test.patch
@@ -0,0 +1,26 @@
+From caf736f4b84808393b0d7030ae6128a3322a71e2 Mon Sep 17 00:00:00 2001
+From: Tobias Mueller <tobiasmue@gnome.org>
+Date: Mon, 12 Apr 2010 13:01:42 +0000
+Subject: test-unique: Resolve format string issues
+
+Provide a proper literal format string to not expose potential vulnerabilites.
+Fixes bug 615522.
+---
+diff --git a/tests/test-unique.c b/tests/test-unique.c
+index b7cde45..c9958c9 100644
+--- a/tests/test-unique.c
++++ b/tests/test-unique.c
+@@ -82,9 +82,11 @@ app_message_cb (UniqueApp         *app,
+                                    GTK_DIALOG_DESTROY_WITH_PARENT,
+                                    GTK_MESSAGE_INFO,
+                                    GTK_BUTTONS_CLOSE,
++                                   "%s",
+                                    title);
+   if (message)
+     gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
++                                              "%s",
+                                               message);
+ 
+   gtk_window_set_urgency_hint (GTK_WINDOW (dialog), TRUE);
+--
+cgit v0.9
diff --git a/nixpkgs/pkgs/development/libraries/libunique/1.1.6-include-terminator.patch b/nixpkgs/pkgs/development/libraries/libunique/1.1.6-include-terminator.patch
new file mode 100644
index 000000000000..927771e7311b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libunique/1.1.6-include-terminator.patch
@@ -0,0 +1,37 @@
+From 30ca2903a8ed4eed974ea744e4b9bd96198c425d Mon Sep 17 00:00:00 2001
+From: Rodney Lorrimar <r.lorrimar@fugro-fsi.com.au>
+Date: Mon, 21 Dec 2009 02:07:46 +0000
+Subject: Include NUL terminator in unique_message_data_get_filename()
+
+https://bugzilla.gnome.org/show_bug.cgi?id=605104
+
+Signed-off-by: Emmanuele Bassi <ebassi@gnome.org>
+---
+diff --git a/unique/uniqueinternals.h b/unique/uniqueinternals.h
+index ace40ed..3cec152 100644
+--- a/unique/uniqueinternals.h
++++ b/unique/uniqueinternals.h
+@@ -13,7 +13,7 @@ G_BEGIN_DECLS
+ struct _UniqueMessageData
+ {
+   guchar *data;
+-  gint length;
++  gint length;  /* length of data not including NUL terminator */
+ 
+   GdkScreen *screen;
+   gchar *startup_id;
+diff --git a/unique/uniquemessage.c b/unique/uniquemessage.c
+index 10f6df5..c74392d 100644
+--- a/unique/uniquemessage.c
++++ b/unique/uniquemessage.c
+@@ -493,7 +493,7 @@ unique_message_data_get_filename (UniqueMessageData *message_data)
+ {
+   g_return_val_if_fail (message_data != NULL, NULL);
+ 
+-  return g_memdup (message_data->data, message_data->length);
++  return g_memdup (message_data->data, message_data->length + 1);
+ }
+ 
+ /**
+--
+cgit v0.9
diff --git a/nixpkgs/pkgs/development/libraries/libunique/3.x.nix b/nixpkgs/pkgs/development/libraries/libunique/3.x.nix
new file mode 100644
index 000000000000..72027b85ed43
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libunique/3.x.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, pkg-config
+, dbus, dbus-glib, gtk3, gobject-introspection
+, gtk-doc, docbook_xml_dtd_45, docbook_xsl
+, libxslt, libxml2 }:
+
+with lib;
+stdenv.mkDerivation rec {
+
+  majorVer = "3.0";
+  minorVer = "2";
+  version = "${majorVer}.${minorVer}";
+  pname = "libunique3";
+  srcName = "libunique-${version}";
+
+  src = fetchurl {
+    url = "http://ftp.gnome.org/pub/GNOME/sources/libunique/${majorVer}/${srcName}.tar.xz";
+    sha256 = "0f70lkw66v9cj72q0iw1s2546r6bwwcd8idcm3621fg2fgh2rw58";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ dbus dbus-glib gtk3 gobject-introspection gtk-doc docbook_xml_dtd_45 docbook_xsl libxslt libxml2 ];
+
+  meta = {
+    homepage = "https://wiki.gnome.org/Attic/LibUnique";
+    description = "A library for writing single instance applications";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libunique/default.nix b/nixpkgs/pkgs/development/libraries/libunique/default.nix
new file mode 100644
index 000000000000..82f71f59070c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libunique/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchurl, pkg-config, glib, gtk2, dbus-glib }:
+
+stdenv.mkDerivation rec {
+  pname = "libunique";
+  version = "1.1.6";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
+    sha256 = "1fsgvmncd9caw552lyfg8swmsd6bh4ijjsph69bwacwfxwf09j75";
+  };
+
+  # Don't make deprecated usages hard errors
+  prePatch = ''
+    substituteInPlace configure --replace "-Werror" "";
+  '';
+
+  # glib-2.62 deprecations
+  NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS";
+
+  # Patches from Gentoo portage
+  patches = [
+    ./1.1.6-compiler-warnings.patch
+    ./1.1.6-fix-test.patch
+    ./1.1.6-G_CONST_RETURN.patch
+    ./1.1.6-include-terminator.patch
+  ] ++ [ ./gcc7-bug.patch ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ glib gtk2 dbus-glib ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://wiki.gnome.org/Attic/LibUnique";
+    description = "A library for writing single instance applications";
+    license = lib.licenses.lgpl21;
+    platforms = with lib.platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libunique/gcc7-bug.patch b/nixpkgs/pkgs/development/libraries/libunique/gcc7-bug.patch
new file mode 100644
index 000000000000..2b0587510bc0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libunique/gcc7-bug.patch
@@ -0,0 +1,18 @@
+gcc-7 newly detects this class of bugs.
+In this particular case it's clear that the inention was
+to detect if the string is non-NULL *and* non-empty.
+
+
+diff --git a/unique/uniqueapp.c b/unique/uniqueapp.c
+index b40a86c..66a7226 100644
+--- a/unique/uniqueapp.c
++++ b/unique/uniqueapp.c
+@@ -176,7 +176,7 @@ set_startup_id (UniqueBackend *backend,
+ {
+   gchar *id;
+ 
+-  if (startup_id && startup_id != '\0')
++  if (startup_id && *startup_id != '\0')
+     id = g_strdup (startup_id);
+   else
+     {
diff --git a/nixpkgs/pkgs/development/libraries/libunistring/default.nix b/nixpkgs/pkgs/development/libraries/libunistring/default.nix
new file mode 100644
index 000000000000..f7a77832c183
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libunistring/default.nix
@@ -0,0 +1,72 @@
+{ fetchurl, lib, stdenv, libiconv }:
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+stdenv.mkDerivation rec {
+  pname = "libunistring";
+  version = "0.9.10";
+
+  src = fetchurl {
+    url = "mirror://gnu/libunistring/${pname}-${version}.tar.gz";
+    sha256 = "02v17za10mxnj095x4pvm80jxyqwk93kailfc2j8xa1r6crmnbm8";
+  };
+
+  outputs = [ "out" "dev" "info" "doc" ];
+
+  propagatedBuildInputs = lib.optional (!stdenv.isLinux) libiconv;
+
+  configureFlags = [
+    "--with-libiconv-prefix=${libiconv}"
+  ];
+
+  doCheck = false;
+
+  /* This seems to cause several random failures like these, which I assume
+     is because of bad or missing target dependencies in their build system:
+
+        ./unistdio/test-u16-vasnprintf2.sh: line 16: ./test-u16-vasnprintf1: No such file or directory
+        FAIL unistdio/test-u16-vasnprintf2.sh (exit status: 1)
+
+        FAIL: unistdio/test-u16-vasnprintf3.sh
+        ======================================
+
+        ./unistdio/test-u16-vasnprintf3.sh: line 16: ./test-u16-vasnprintf1: No such file or directory
+        FAIL unistdio/test-u16-vasnprintf3.sh (exit status: 1)
+  */
+  enableParallelBuilding = false;
+
+  meta = {
+    homepage = "https://www.gnu.org/software/libunistring/";
+
+    description = "Unicode string library";
+
+    longDescription = ''
+      This library provides functions for manipulating Unicode strings
+      and for manipulating C strings according to the Unicode
+      standard.
+
+      GNU libunistring is for you if your application involves
+      non-trivial text processing, such as upper/lower case
+      conversions, line breaking, operations on words, or more
+      advanced analysis of text.  Text provided by the user can, in
+      general, contain characters of all kinds of scripts.  The text
+      processing functions provided by this library handle all scripts
+      and all languages.
+
+      libunistring is for you if your application already uses the ISO
+      C / POSIX <ctype.h>, <wctype.h> functions and the text it
+      operates on is provided by the user and can be in any language.
+
+      libunistring is also for you if your application uses Unicode
+      strings as internal in-memory representation.
+    '';
+
+    license = lib.licenses.lgpl3Plus;
+
+    maintainers = [ ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libunity/default.nix b/nixpkgs/pkgs/development/libraries/libunity/default.nix
new file mode 100644
index 000000000000..c27fce32ec00
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libunity/default.nix
@@ -0,0 +1,70 @@
+{ lib
+, stdenv
+, fetchgit
+, pkg-config
+, glib
+, vala
+, dee
+, gobject-introspection
+, libdbusmenu
+, gtk3
+, intltool
+, python3
+, autoreconfHook
+}:
+
+stdenv.mkDerivation {
+  pname = "libunity";
+  version = "unstable-2021-02-01";
+
+  outputs = [ "out" "dev" "py" ];
+
+  # Obtained from https://git.launchpad.net/ubuntu/+source/libunity/log/
+  src = fetchgit {
+    url = "https://git.launchpad.net/ubuntu/+source/libunity";
+    rev = "import/7.1.4+19.04.20190319-5";
+    sha256 = "LHUs6kl1srS6Xektx+jmm4SXLR47VuQ9IhYbBxf2Wc8=";
+  };
+
+  patches = [
+    # Fix builf with latest Vala
+    # https://code.launchpad.net/~jtojnar/libunity/libunity
+    # Did not send upstream because Ubuntu is stuck on Vala 0.48.
+    ./fix-vala.patch
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    gobject-introspection
+    intltool
+    pkg-config
+    python3
+    vala
+  ];
+
+  buildInputs = [
+    glib
+    gtk3
+  ];
+
+  propagatedBuildInputs = [
+    dee
+    libdbusmenu
+  ];
+
+  preConfigure = ''
+    intltoolize
+  '';
+
+  configureFlags = [
+    "--with-pygi-overrides-dir=${placeholder "py"}/${python3.sitePackages}/gi/overrides"
+  ];
+
+  meta = with lib; {
+    description = "A library for instrumenting and integrating with all aspects of the Unity shell";
+    homepage = "https://launchpad.net/libunity";
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ ];
+  };
+}
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..555c2ad7bcb0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libunity/fix-vala.patch
@@ -0,0 +1,12 @@
+--- a/protocol/protocol-icon.vala	2013-08-27 12:53:57 +0000
++++ b/protocol/protocol-icon.vala	2021-04-13 22:34:41 +0000
+@@ -185,7 +185,7 @@
+   }
+ 
+   /* Added to GIcon interface in 2.37 */
+-  private Variant serialize ()
++  private Variant? serialize ()
+   {
+     Variant? ret = null;
+     return ret;
+
diff --git a/nixpkgs/pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch b/nixpkgs/pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch
new file mode 100644
index 000000000000..5fcaa72c0c01
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libunwind/backtrace-only-with-glibc.patch
@@ -0,0 +1,45 @@
+From 04437142399662b576bd55a85485c6dcc14d0812 Mon Sep 17 00:00:00 2001
+From: Khem Raj <raj.khem at gmail.com>
+Date: Thu, 31 Dec 2015 06:44:07 +0000
+Subject: [PATCH] backtrace: Use only with glibc and uclibc
+
+backtrace API is glibc specific not linux specific
+so make it behave so.
+
+Signed-off-by: Khem Raj <raj.khem at gmail.com>
+---
+Upstream-Status: Pending
+
+ tests/test-coredump-unwind.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/tests/test-coredump-unwind.c b/tests/test-coredump-unwind.c
+index 5254708..8767b42 100644
+--- a/tests/test-coredump-unwind.c
++++ b/tests/test-coredump-unwind.c
+@@ -57,7 +57,9 @@
+ #include <grp.h>
+ 
+ /* For SIGSEGV handler code */
++#ifdef __GLIBC__
+ #include <execinfo.h>
++#endif
+ #include <sys/ucontext.h>
+ 
+ #include <libunwind-coredump.h>
+@@ -238,11 +240,11 @@ void handle_sigsegv(int sig, siginfo_t *info, void *ucontext)
+ 			ip);
+ 
+   {
++#ifdef __GLIBC__
+     /* glibc extension */
+     void *array[50];
+     int size;
+     size = backtrace(array, 50);
+-#ifdef __linux__
+     backtrace_symbols_fd(array, size, 2);
+ #endif
+   }
+-- 
+2.6.4
+
diff --git a/nixpkgs/pkgs/development/libraries/libunwind/default.nix b/nixpkgs/pkgs/development/libraries/libunwind/default.nix
new file mode 100644
index 000000000000..bda7f72a5576
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libunwind/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, lib, fetchurl, autoreconfHook, xz, coreutils }:
+
+stdenv.mkDerivation rec {
+  pname = "libunwind";
+  version = "1.4.0";
+
+  src = fetchurl {
+    url = "mirror://savannah/libunwind/${pname}-${version}.tar.gz";
+    sha256 = "0dc46flppifrv2z0mrdqi60165ghxm1wk0g47vcbyzjdplqwjnfz";
+  };
+
+  patches = [ ./backtrace-only-with-glibc.patch ];
+
+  postPatch = lib.optionalString stdenv.hostPlatform.isMusl ''
+    substituteInPlace configure.ac --replace "-lgcc_s" "-lgcc_eh"
+  '';
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  outputs = [ "out" "dev" "devman" ];
+
+  # Without latex2man, no man pages are installed despite being
+  # prebuilt in the source tarball.
+  configureFlags = [ "LATEX2MAN=${coreutils}/bin/true" ];
+
+  propagatedBuildInputs = [ xz ];
+
+  postInstall = ''
+    find $out -name \*.la | while read file; do
+      sed -i 's,-llzma,${xz.out}/lib/liblzma.la,' $file
+    done
+  '';
+
+  doCheck = false; # fails
+
+  meta = with lib; {
+    homepage = "https://www.nongnu.org/libunwind";
+    description = "A portable and efficient API to determine the call-chain of a program";
+    maintainers = with maintainers; [ orivej ];
+    platforms = platforms.linux;
+    badPlatforms = [ "riscv32-linux" "riscv64-linux" ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liburcu/default.nix b/nixpkgs/pkgs/development/libraries/liburcu/default.nix
new file mode 100644
index 000000000000..b00b4cf9ac85
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liburcu/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, perl }:
+
+stdenv.mkDerivation rec {
+  version = "0.13.0";
+  pname = "liburcu";
+
+  src = fetchurl {
+    url = "https://lttng.org/files/urcu/userspace-rcu-${version}.tar.bz2";
+    sha256 = "sha256-y7INvhqJLCpNiJi6xDFhduWFOSaT1Jh2bMu8aM8guiA=";
+  };
+
+  checkInputs = [ perl ];
+
+  preCheck = "patchShebangs tests/unit";
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Userspace RCU (read-copy-update) library";
+    homepage = "https://lttng.org/urcu";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.bjornfor ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/liburing/default.nix b/nixpkgs/pkgs/development/libraries/liburing/default.nix
new file mode 100644
index 000000000000..ddd7c7b207da
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liburing/default.nix
@@ -0,0 +1,62 @@
+{ lib, stdenv, fetchgit
+, fetchpatch
+}:
+
+stdenv.mkDerivation rec {
+  pname = "liburing";
+  version = "2.0";
+
+  src = fetchgit {
+    url    = "http://git.kernel.dk/${pname}";
+    rev    = "liburing-${version}";
+    sha256 = "0has1yd1ns5q5jgcmhrbgwhbwq0wix3p7xv3dyrwdf784p56izkn";
+  };
+
+  patches = [
+    # Fix build on 32-bit ARM
+    (fetchpatch {
+      url = "https://github.com/axboe/liburing/commit/808b6c72ab753bda0c300b5683cfd31750d1d49b.patch";
+      sha256 = "1x7a9c5a6rwhfsbjqmhbnwh2aiin6yylckrqdjbzljrprzf11wrd";
+    })
+  ];
+
+  separateDebugInfo = true;
+  enableParallelBuilding = true;
+  # Upstream's configure script is not autoconf generated, but a hand written one.
+  setOutputFlags = false;
+  preConfigure =
+    # We cannot use configureFlags or configureFlagsArray directly, since we
+    # don't have structuredAttrs yet and using placeholder causes permissions
+    # denied errors. Using $dev / $man in configureFlags causes bash evaluation
+    # errors
+  ''
+    configureFlagsArray+=(
+      "--includedir=$dev/include"
+      "--mandir=$man/share/man"
+    )
+  '';
+
+  # Doesn't recognize platform flags
+  configurePlatforms = [];
+
+  outputs = [ "out" "bin" "dev" "man" ];
+
+  postInstall =
+  # Copy the examples into $bin. Most reverse dependency of this package should
+  # reference only the $out output
+  ''
+    mkdir -p $bin/bin
+    cp ./examples/io_uring-cp examples/io_uring-test $bin/bin
+    cp ./examples/link-cp $bin/bin/io_uring-link-cp
+    cp ./examples/ucontext-cp $bin/bin/io_uring-ucontext-cp
+  ''
+  ;
+
+  meta = with lib; {
+    description = "Userspace library for the Linux io_uring API";
+    homepage    = "https://git.kernel.dk/cgit/liburing/";
+    license     = licenses.lgpl21;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libusb-compat/0.1.nix b/nixpkgs/pkgs/development/libraries/libusb-compat/0.1.nix
new file mode 100644
index 000000000000..b23123f56eaa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libusb-compat/0.1.nix
@@ -0,0 +1,47 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, autoreconfHook
+, patchelf
+, pkg-config
+, libusb1
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libusb-compat";
+  version = "0.1.7";
+
+  outputs = [ "out" "dev" ]; # get rid of propagating systemd closure
+  outputBin = "dev";
+
+  nativeBuildInputs = [ autoreconfHook patchelf pkg-config ];
+
+  buildInputs = [ libusb1 ];
+
+  src = fetchFromGitHub {
+    owner = "libusb";
+    repo = "libusb-compat-0.1";
+    rev = "v${version}";
+    sha256 = "1nybccgjs14b3phhaycq2jx1gym4nf6sghvnv9qdfmlqxacx0jz5";
+  };
+
+  patches = lib.optional stdenv.hostPlatform.isMusl ./fix-headers.patch;
+
+  # without this, libusb-compat is unable to find libusb1
+  postFixup = ''
+    find $out/lib -name \*.so\* -type f -exec \
+      patchelf --set-rpath ${lib.makeLibraryPath buildInputs} {} \;
+  '';
+
+  meta = with lib; {
+    homepage = "https://libusb.info/";
+    repositories.git = "https://github.com/libusb/libusb-compat-0.1";
+    description = "cross-platform user-mode USB device library";
+    longDescription = ''
+      libusb is a cross-platform user-mode library that provides access to USB devices.
+      The current API is of 1.0 version (libusb-1.0 API), this library is a wrapper exposing the legacy API.
+    '';
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libusb-compat/fix-headers.patch b/nixpkgs/pkgs/development/libraries/libusb-compat/fix-headers.patch
new file mode 100644
index 000000000000..ea9cbc34978e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libusb-compat/fix-headers.patch
@@ -0,0 +1,10 @@
+--- libusb-compat-0.1.5.orig/libusb/usb.h
++++ libusb-compat-0.1.5/libusb/usb.h
+@@ -25,6 +25,7 @@
+ #ifndef __USB_H__
+ #define __USB_H__
+ 
++#include <sys/types.h>
+ #include <unistd.h>
+ #include <stdlib.h>
+ #include <limits.h>
diff --git a/nixpkgs/pkgs/development/libraries/libusb1/default.nix b/nixpkgs/pkgs/development/libraries/libusb1/default.nix
new file mode 100644
index 000000000000..69410cf2b986
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libusb1/default.nix
@@ -0,0 +1,57 @@
+{ lib, stdenv
+, fetchFromGitHub
+, fetchpatch
+, autoreconfHook
+, pkg-config
+, enableUdev ? stdenv.isLinux && !stdenv.hostPlatform.isMusl
+, udev
+, libobjc
+, IOKit
+, withStatic ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libusb";
+  version = "1.0.24";
+
+  src = fetchFromGitHub {
+    owner = "libusb";
+    repo = "libusb";
+    rev = "v${version}";
+    sha256 = "18ri8ky422hw64zry7bpbarb1m0hiljyf64a0a9y093y7aad38i7";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  patches = [ (fetchpatch {
+    # https://bugs.archlinux.org/task/69121
+    url = "https://github.com/libusb/libusb/commit/f6d2cb561402c3b6d3627c0eb89e009b503d9067.patch";
+    sha256 = "1dbahikcbwkjhyvks7wbp7fy2bf7nca48vg5z0zqvqzjb9y595cq";
+    excludes = [ "libusb/version_nano.h" ];
+  }) ];
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+  propagatedBuildInputs =
+    lib.optional enableUdev udev ++
+    lib.optionals stdenv.isDarwin [ libobjc IOKit ];
+
+  dontDisableStatic = withStatic;
+
+  configureFlags = lib.optional (!enableUdev) "--disable-udev";
+
+  preFixup = lib.optionalString enableUdev ''
+    sed 's,-ludev,-L${lib.getLib udev}/lib -ludev,' -i $out/lib/libusb-1.0.la
+  '';
+
+  meta = with lib; {
+    homepage = "https://libusb.info/";
+    repositories.git = "https://github.com/libusb/libusb";
+    description = "cross-platform user-mode USB device library";
+    longDescription = ''
+      libusb is a cross-platform user-mode library that provides access to USB devices.
+    '';
+    platforms = platforms.all;
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ prusnak ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libusbmuxd/default.nix b/nixpkgs/pkgs/development/libraries/libusbmuxd/default.nix
new file mode 100644
index 000000000000..7bba6e8b4040
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libusbmuxd/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, libplist }:
+
+stdenv.mkDerivation rec {
+  pname = "libusbmuxd";
+  version = "unstable-2021-02-06";
+
+  src = fetchFromGitHub {
+    owner = "libimobiledevice";
+    repo = pname;
+    rev = "3eb50a07bad4c2222e76df93b23a0161922150d1";
+    sha256 = "sha256-pBPBgE6s8JYKJYEV8CcumNki+6jD5r7HzQ0nZ8yQLdM=";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ libplist ];
+
+  meta = with lib; {
+    description = "A client library to multiplex connections from and to iOS devices";
+    homepage    = "https://github.com/libimobiledevice/libusbmuxd";
+    license     = licenses.lgpl21Plus;
+    platforms   = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ infinisil ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libutempter/default.nix b/nixpkgs/pkgs/development/libraries/libutempter/default.nix
new file mode 100644
index 000000000000..ff2044242b9f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libutempter/default.nix
@@ -0,0 +1,39 @@
+{ stdenv, fetchurl, lib, glib }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "libutempter";
+  version = "1.1.6";
+
+  src = fetchurl {
+    url = "http://archive.ubuntu.com/ubuntu/pool/main/libu/libutempter/libutempter_${version}.orig.tar.bz2";
+    sha256 = "15y3xbgznjxnfmix4xg3bwmqdvghdw7slbhazb0ybmyf65gmd65q";
+  };
+
+  buildInputs = [ glib ];
+
+  patches = [ ./exec_path.patch ];
+
+  prePatch = ''
+    substituteInPlace Makefile --replace 2711 0711
+  '';
+
+  makeFlags = [
+    "libdir=\${out}/lib"
+    "libexecdir=\${out}/lib"
+    "includedir=\${out}/include"
+    "mandir=\${out}/share/man"
+  ];
+
+  meta = {
+    description = "Interface for terminal emulators such as screen and xterm to record user sessions to utmp and wtmp files";
+    longDescription = ''
+      The bundled utempter binary must be able to run as a user belonging to group utmp.
+      On NixOS systems, this can be achieved by creating a setguid wrapper.
+    '';
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.msteen ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libutempter/exec_path.patch b/nixpkgs/pkgs/development/libraries/libutempter/exec_path.patch
new file mode 100644
index 000000000000..bd5f56611ef9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libutempter/exec_path.patch
@@ -0,0 +1,25 @@
+diff -ur libutempter-1.1.6/iface.c libutempter-1.1.6.patched/iface.c
+--- libutempter-1.1.6/iface.c	2010-11-04 18:14:53.000000000 +0100
++++ libutempter-1.1.6.patched/iface.c	2018-06-06 15:09:11.417755549 +0200
+@@ -60,9 +60,9 @@
+ 		_exit(EXIT_FAILURE);
+ 	}
+ 
+-	execv(path, argv);
++	execvp(path, argv);
+ #ifdef	UTEMPTER_DEBUG
+-	fprintf(stderr, "libutempter: execv: %s\n", strerror(errno));
++	fprintf(stderr, "libutempter: execvp: %s\n", strerror(errno));
+ #endif
+ 
+ 	while (EACCES == errno)
+@@ -79,7 +79,7 @@
+ 		if (setgid(sgid))
+ 			break;
+ 
+-		(void) execv(path, argv);
++		(void) execvp(path, argv);
+ 		break;
+ 	}
+ 
+Only in libutempter-1.1.6.patched: result
diff --git a/nixpkgs/pkgs/development/libraries/libuv/default.nix b/nixpkgs/pkgs/development/libraries/libuv/default.nix
new file mode 100644
index 000000000000..a3de139fb440
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libuv/default.nix
@@ -0,0 +1,77 @@
+{ stdenv, lib, fetchFromGitHub, autoconf, automake, libtool, pkg-config, ApplicationServices, CoreServices }:
+
+stdenv.mkDerivation rec {
+  version = "1.42.0";
+  pname = "libuv";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0f6mfbg750q26fa85nhmw2m0gyp8jcp1kyx9zn6lgi8bha5b7kny";
+  };
+
+  postPatch = let
+    toDisable = [
+      "getnameinfo_basic" "udp_send_hang_loop" # probably network-dependent
+      "tcp_connect_timeout" # tries to reach out to 8.8.8.8
+      "spawn_setuid_fails" "spawn_setgid_fails" "fs_chown" # user namespaces
+      "getaddrinfo_fail" "getaddrinfo_fail_sync"
+      "threadpool_multiple_event_loops" # times out on slow machines
+      "get_passwd" # passed on NixOS but failed on other Linuxes
+      "tcp_writealot" "udp_multicast_join" "udp_multicast_join6" # times out sometimes
+    ] ++ lib.optionals stdenv.isDarwin [
+        # Sometimes: timeout (no output), failed uv_listen. Someone
+        # should report these failures to libuv team. There tests should
+        # be much more robust.
+        "process_title" "emfile" "poll_duplex" "poll_unidirectional"
+        "ipc_listen_before_write" "ipc_listen_after_write" "ipc_tcp_connection"
+        "tcp_alloc_cb_fail" "tcp_ping_pong" "tcp_ref3" "tcp_ref4"
+        "tcp_bind6_error_inval" "tcp_bind6_error_addrinuse" "tcp_read_stop"
+        "tcp_unexpected_read" "tcp_write_to_half_open_connection"
+        "tcp_oob" "tcp_close_accept" "tcp_create_early_accept"
+        "tcp_create_early" "tcp_close" "tcp_bind_error_inval"
+        "tcp_bind_error_addrinuse" "tcp_shutdown_after_write"
+        "tcp_open" "tcp_write_queue_order" "tcp_try_write" "tcp_writealot"
+        "multiple_listen" "delayed_accept"
+        "shutdown_close_tcp" "shutdown_eof" "shutdown_twice" "callback_stack"
+        "tty_pty" "condvar_5" "hrtime" "udp_multicast_join"
+        # Tests that fail when sandboxing is enabled.
+        "fs_event_close_in_callback" "fs_event_watch_dir" "fs_event_error_reporting"
+        "fs_event_watch_dir_recursive" "fs_event_watch_file"
+        "fs_event_watch_file_current_dir" "fs_event_watch_file_exact_path"
+        "process_priority" "udp_create_early_bad_bind"
+    ] ++ lib.optionals stdenv.isAarch32 [
+      # I observe this test failing with some regularity on ARMv7:
+      # https://github.com/libuv/libuv/issues/1871
+      "shutdown_close_pipe"
+    ];
+    tdRegexp = lib.concatStringsSep "\\|" toDisable;
+    in lib.optionalString doCheck ''
+      sed '/${tdRegexp}/d' -i test/test-list.h
+    '';
+
+  nativeBuildInputs = [ automake autoconf libtool pkg-config ];
+  buildInputs = lib.optionals stdenv.isDarwin [ ApplicationServices CoreServices ];
+
+  preConfigure = ''
+    LIBTOOLIZE=libtoolize ./autogen.sh
+  '';
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  # Some of the tests use localhost networking.
+  __darwinAllowLocalNetworking = true;
+
+  meta = with lib; {
+    description = "A multi-platform support library with a focus on asynchronous I/O";
+    homepage    = "https://libuv.org/";
+    changelog   = "https://github.com/libuv/libuv/blob/v${version}/ChangeLog";
+    maintainers = with maintainers; [ cstrahan ];
+    platforms   = with platforms; linux ++ darwin;
+    license     = with licenses; [ mit isc bsd2 bsd3 cc-by-40 ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/libuvc/default.nix b/nixpkgs/pkgs/development/libraries/libuvc/default.nix
new file mode 100644
index 000000000000..e7ff4bb7f288
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libuvc/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+, libusb1
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libuvc";
+  version = "unstable-2020-11-29";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "5cddef71b17d41f7e98875a840c50d9704c3d2b2";
+    sha256 = "0kranb0x1k5qad8rwxnn1w9963sbfj2cfzdgpfmlivb04544m2j7";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [ libusb1 ];
+
+  meta = with lib; {
+    homepage = "https://ken.tossell.net/libuvc/";
+    description = "Cross-platform library for USB video devices";
+    platforms = platforms.linux;
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ prusnak ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libva/1.0.0.nix b/nixpkgs/pkgs/development/libraries/libva/1.0.0.nix
new file mode 100644
index 000000000000..ade56ac16ee9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libva/1.0.0.nix
@@ -0,0 +1,37 @@
+{ stdenv, lib, fetchurl, libX11, pkg-config, libXext, libdrm, libXfixes, wayland, libffi
+, libGL, mesa
+, minimal ? false, libva1-minimal
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libva";
+  version = "1.7.3";
+
+  src = fetchurl {
+    url = "https://www.freedesktop.org/software/vaapi/releases/libva/${pname}-${version}.tar.bz2";
+    sha256 = "1ndrf136rlw03xag7j1xpmf9015d1h0dpnv6v587jnh6k2a17g12";
+  };
+
+  outputs = [ "bin" "dev" "out" ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ libdrm ]
+    ++ lib.optionals (!minimal) [ libva1-minimal libX11 libXext libXfixes wayland libffi libGL ];
+  # TODO: share libs between minimal and !minimal - perhaps just symlink them
+
+  configureFlags =
+    # Add FHS paths for non-NixOS applications.
+    [ "--with-drivers-path=${mesa.drivers.driverLink}/lib/dri:/usr/lib/dri:/usr/lib32/dri" ] ++
+    lib.optionals (!minimal) [ "--enable-glx" ];
+
+  installFlags = [ "dummy_drv_video_ladir=$(out)/lib/dri" ];
+
+  meta = with lib; {
+    homepage = "http://www.freedesktop.org/wiki/Software/vaapi";
+    license = licenses.mit;
+    description = "VAAPI library: Video Acceleration API";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libva/default.nix b/nixpkgs/pkgs/development/libraries/libva/default.nix
new file mode 100644
index 000000000000..1eee4b3870bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libva/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, lib, fetchFromGitHub, meson, pkg-config, ninja, wayland-scanner
+, libdrm
+, minimal ? false, libva-minimal
+, libX11, libXext, libXfixes, wayland, libffi, libGL
+, mesa
+}:
+
+stdenv.mkDerivation rec {
+  name = "libva-${lib.optionalString minimal "minimal-"}${version}";
+  version = "2.12.0";
+
+  src = fetchFromGitHub {
+    owner  = "intel";
+    repo   = "libva";
+    rev    = version;
+    sha256 = "1zfv4kjx0715sy62lkpv0s31f9xwy232z5zwqi5all4w1jr630i7";
+  };
+
+  outputs = [ "dev" "out" ];
+
+  nativeBuildInputs = [ meson pkg-config ninja wayland-scanner ];
+
+  buildInputs = [ libdrm ]
+    ++ lib.optionals (!minimal) [ libva-minimal libX11 libXext libXfixes wayland libffi libGL ];
+  # TODO: share libs between minimal and !minimal - perhaps just symlink them
+
+  mesonFlags = [
+    # Add FHS paths for non-NixOS applications:
+    "-Ddriverdir=${mesa.drivers.driverLink}/lib/dri:/usr/lib/dri:/usr/lib32/dri"
+  ];
+
+  meta = with lib; {
+    description = "An implementation for VA-API (Video Acceleration API)";
+    longDescription = ''
+      VA-API is an open-source library and API specification, which provides
+      access to graphics hardware acceleration capabilities for video
+      processing. It consists of a main library (this package) and
+      driver-specific acceleration backends for each supported hardware vendor.
+    '';
+    homepage = "https://01.org/linuxmedia/vaapi";
+    changelog = "https://raw.githubusercontent.com/intel/libva/${version}/NEWS";
+    license = licenses.mit;
+    maintainers = with maintainers; [ primeos ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libva/utils.nix b/nixpkgs/pkgs/development/libraries/libva/utils.nix
new file mode 100644
index 000000000000..6b5246d09ef2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libva/utils.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config
+, libdrm, libva, libX11, libXext, libXfixes, wayland
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libva-utils";
+  version = "2.12.0";
+
+  src = fetchFromGitHub {
+    owner  = "intel";
+    repo   = "libva-utils";
+    rev    = version;
+    sha256 = "1a4d75gc7rcfwpsh7fn8mygvi4w0jym4szdhw6jpfywvll37lffi";
+  };
+
+  nativeBuildInputs = [ meson ninja pkg-config ];
+
+  buildInputs = [ libdrm libva libX11 libXext libXfixes wayland ];
+
+  meta = with lib; {
+    description = "A collection of utilities and examples for VA-API";
+    longDescription = ''
+      libva-utils is a collection of utilities and examples to exercise VA-API
+      in accordance with the libva project.
+    '';
+    homepage = "https://github.com/intel/libva-utils";
+    changelog = "https://raw.githubusercontent.com/intel/libva-utils/${version}/NEWS";
+    license = licenses.mit;
+    maintainers = with maintainers; [ primeos ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvarlink/default.nix b/nixpkgs/pkgs/development/libraries/libvarlink/default.nix
new file mode 100644
index 000000000000..099fae07dac1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvarlink/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, meson
+, ninja
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libvarlink";
+  version = "22";
+
+  src = fetchFromGitHub {
+    owner = "varlink";
+    repo = pname;
+    rev = version;
+    sha256 = "1i15227vlc9k4276r833ndhxrcys9305pf6dga1j0alx2vj85yz2";
+  };
+
+  nativeBuildInputs = [ meson ninja ];
+
+  postPatch = ''
+    substituteInPlace varlink-wrapper.py \
+      --replace "/usr/bin/env python3" "${python3}/bin/python3"
+
+    # test-object: ../lib/test-object.c:129: main: Assertion `setlocale(LC_NUMERIC, "de_DE.UTF-8") != 0' failed.
+    # PR that added it https://github.com/varlink/libvarlink/pull/27
+    substituteInPlace lib/test-object.c \
+      --replace 'assert(setlocale(LC_NUMERIC, "de_DE.UTF-8") != 0);' ""
+
+    patchShebangs lib/test-symbols.sh
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "C implementation of the Varlink protocol and command line tool";
+    homepage = "https://github.com/varlink/libvarlink";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ artturin ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvdpau-va-gl/default.nix b/nixpkgs/pkgs/development/libraries/libvdpau-va-gl/default.nix
new file mode 100644
index 000000000000..7a042a172c82
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvdpau-va-gl/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libX11, libpthreadstubs, libXau, libXdmcp
+, libXext, libvdpau, glib, libva, libGLU }:
+
+stdenv.mkDerivation rec {
+  pname = "libvdpau-va-gl";
+  version = "0.4.2";
+
+  src = fetchFromGitHub {
+    owner = "i-rinat";
+    repo = "libvdpau-va-gl";
+    rev = "v${version}";
+    sha256 = "0asndybfv8xb0fx73sjjw5kydqrahqkm6n04lh589pbf18s5qlld";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ libX11 libpthreadstubs libXau libXdmcp libXext libvdpau glib libva libGLU ];
+
+  doCheck = false; # fails. needs DRI access
+
+  meta = with lib; {
+    homepage = "https://github.com/i-rinat/libvdpau-va-gl";
+    description = "VDPAU driver with OpenGL/VAAPI backend";
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvdpau/default.nix b/nixpkgs/pkgs/development/libraries/libvdpau/default.nix
new file mode 100644
index 000000000000..75dcd337c38b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvdpau/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, pkg-config, xorg, mesa, meson, ninja }:
+
+stdenv.mkDerivation rec {
+  pname = "libvdpau";
+  version = "1.4";
+
+  src = fetchurl {
+    url = "https://gitlab.freedesktop.org/vdpau/libvdpau/-/archive/${version}/${pname}-${version}.tar.bz2";
+    sha256 = "0c1zsfr6ypzwv8g9z50kdahpb7pirarq4z8avqqyyma5b9684n22";
+  };
+  patches = [ ./installdir.patch ];
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ meson ninja pkg-config ];
+  buildInputs = with xorg; [ xorgproto libXext ];
+
+  propagatedBuildInputs = [ xorg.libX11 ];
+
+  mesonFlags = lib.optional stdenv.isLinux
+    [ "-Dmoduledir=${mesa.drivers.driverLink}/lib/vdpau" ];
+
+  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-lX11";
+
+  meta = with lib; {
+    homepage = "https://people.freedesktop.org/~aplattner/vdpau/";
+    description = "Library to use the Video Decode and Presentation API for Unix (VDPAU)";
+    license = licenses.mit; # expat version
+    platforms = platforms.unix;
+    maintainers = [ maintainers.vcunat ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvdpau/installdir.patch b/nixpkgs/pkgs/development/libraries/libvdpau/installdir.patch
new file mode 100644
index 000000000000..859715f70d39
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvdpau/installdir.patch
@@ -0,0 +1,9 @@
+--- a/trace/meson.build	2020-02-15 16:34:58.698832000 +0100
++++ b/trace/meson.build	2020-02-15 16:39:05.359952802 +0100
+@@ -4,5 +4,5 @@
+     dependencies : libdl,
+     version : '1.0.0',
+     install : true,
+-    install_dir : moduledir,
++    install_dir : get_option('prefix') + '/lib/libvdpau',
+ )
diff --git a/nixpkgs/pkgs/development/libraries/libversion/default.nix b/nixpkgs/pkgs/development/libraries/libversion/default.nix
new file mode 100644
index 000000000000..98ad4ef7feec
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libversion/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, fetchFromGitHub, cmake, lib }:
+
+stdenv.mkDerivation rec {
+  pname = "libversion";
+  version = "3.0.1";
+
+  src = fetchFromGitHub {
+    owner = "repology";
+    repo = "libversion";
+    rev = version;
+    sha256 = "13x5djdpv6aryxsbw6a3b6vwzi9f4aa3gn9dqb7axzppggayawyk";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = lib.optional stdenv.isDarwin [
+    "-DCMAKE_SKIP_BUILD_RPATH=OFF" # needed for tests
+  ];
+
+  preCheck = ''
+    export LD_LIBRARY_PATH=/build/source/build/libversion/''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
+  '';
+  doCheck = true;
+  checkTarget = "test";
+
+  meta = with lib; {
+    description = "Advanced version string comparison library";
+    homepage = "https://github.com/repology/libversion";
+    license = with licenses; [ mit ];
+    maintainers = with maintainers; [ ryantm ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libviper/default.nix b/nixpkgs/pkgs/development/libraries/libviper/default.nix
new file mode 100644
index 000000000000..e3b3674acc9f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libviper/default.nix
@@ -0,0 +1,28 @@
+{lib, stdenv, fetchurl, pkg-config, glib, ncurses, gpm}:
+stdenv.mkDerivation rec {
+  name = "libviper-1.4.6";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libviper/${name}.tar.gz";
+    sha256 = "1jvm7wdgw6ixyhl0pcfr9lnr9g6sg6whyrs9ihjiz0agvqrgvxwc";
+  };
+
+  patchPhase = ''
+    sed -i -e s@/usr/local@$out@ -e /ldconfig/d -e '/cd vdk/d' Makefile
+  '';
+
+  preInstall = ''
+    mkdir -p $out/include
+    mkdir -p $out/lib
+  '';
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ glib ncurses gpm];
+
+  meta = with lib; {
+    homepage = "http://libviper.sourceforge.net/";
+    description = "Simple window creation and management facilities for the console";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvirt-glib/default.nix b/nixpkgs/pkgs/development/libraries/libvirt-glib/default.nix
new file mode 100644
index 000000000000..6c2cb095a818
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvirt-glib/default.nix
@@ -0,0 +1,62 @@
+{ lib
+, stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, gobject-introspection
+, gettext
+, gtk-doc
+, docbook-xsl-nons
+, vala
+, libcap_ng
+, libvirt
+, libxml2
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libvirt-glib";
+  version = "4.0.0";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "https://libvirt.org/sources/glib/${pname}-${version}.tar.xz";
+    sha256 = "hCP3Bp2qR2MHMh0cEeLswoU0DNMsqfwFIHdihD7erL0=";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gettext
+    gtk-doc
+    docbook-xsl-nons
+    vala
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    libcap_ng
+    libvirt
+    libxml2
+    gobject-introspection
+  ];
+
+  strictDeps = true;
+
+  meta = with lib; {
+    description = "Library for working with virtual machines";
+    longDescription = ''
+      libvirt-glib wraps libvirt to provide a high-level object-oriented API better
+      suited for glib-based applications, via three libraries:
+
+      - libvirt-glib    - GLib main loop integration & misc helper APIs
+      - libvirt-gconfig - GObjects for manipulating libvirt XML documents
+      - libvirt-gobject - GObjects for managing libvirt objects
+    '';
+    homepage = "https://libvirt.org/";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvirt/0001-meson-patch-in-an-install-prefix-for-building-on-nix.patch b/nixpkgs/pkgs/development/libraries/libvirt/0001-meson-patch-in-an-install-prefix-for-building-on-nix.patch
new file mode 100644
index 000000000000..86dd461ea07d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvirt/0001-meson-patch-in-an-install-prefix-for-building-on-nix.patch
@@ -0,0 +1,326 @@
+From a896b0be849455edb83a9305dfec9b41447ef3e4 Mon Sep 17 00:00:00 2001
+From: Euan Kemp <euank@euank.com>
+Date: Thu, 14 Jan 2021 00:32:00 -0800
+Subject: [PATCH] meson: patch in an install prefix for building on nix
+
+Used in the nixpkgs version of libvirt so that we can install things in
+the nix store, but read them from the root filesystem.
+---
+ meson.build                       |  9 +++++++++
+ meson_options.txt                 |  2 ++
+ src/libxl/meson.build             |  6 +++---
+ src/locking/meson.build           |  8 ++++----
+ src/lxc/meson.build               |  6 +++---
+ src/meson.build                   | 18 +++++++++---------
+ src/network/meson.build           | 12 ++++++------
+ src/nwfilter/xml/meson.build      |  2 +-
+ src/qemu/meson.build              | 14 +++++++-------
+ src/remote/meson.build            |  6 +++---
+ src/security/apparmor/meson.build |  8 ++++----
+ tools/meson.build                 |  4 ++--
+ 12 files changed, 53 insertions(+), 42 deletions(-)
+
+diff --git a/meson.build b/meson.build
+index b5164f6..33719f1 100644
+--- a/meson.build
++++ b/meson.build
+@@ -39,6 +39,8 @@ if host_machine.system() == 'windows'
+   conf.set('WINVER', '0x0600') # Win Vista / Server 2008
+ endif
+ 
++# patched in for nix
++install_prefix = get_option('install_prefix')
+ 
+ # set various paths
+ 
+@@ -57,6 +59,13 @@ else
+   sysconfdir = prefix / get_option('sysconfdir')
+ endif
+ 
++# nix: don't prefix the localstatedir; some things need to write to it, so it
++# can't be in the nix store, and that's what the prefix is.
++# We'll prefix things ourselves where needed
++localstatedir = get_option('localstatedir')
++# Same for sysconfidr
++sysconfdir = get_option('sysconfdir')
++
+ # if --prefix is /usr, don't use /usr/var for localstatedir or /usr/etc for
+ # sysconfdir as this makes a lot of things break in testing situations
+ if prefix == '/usr'
+diff --git a/meson_options.txt b/meson_options.txt
+index e5d79c2..081cd32 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -1,3 +1,5 @@
++option('install_prefix', type: 'string', value: '', description: 'prefix for nix store installation')
++
+ option('no_git', type: 'boolean', value: false, description: 'Disable git submodule update')
+ option('packager', type: 'string', value: '', description: 'Extra packager name')
+ option('packager_version', type: 'string', value: '', description: 'Extra packager version')
+diff --git a/src/libxl/meson.build b/src/libxl/meson.build
+index 3bb6cc5..78d7be0 100644
+--- a/src/libxl/meson.build
++++ b/src/libxl/meson.build
+@@ -84,8 +84,8 @@ if conf.has('WITH_LIBXL')
+   }
+ 
+   virt_install_dirs += [
+-    localstatedir / 'lib' / 'libvirt' / 'libxl',
+-    runstatedir / 'libvirt' / 'libxl',
+-    localstatedir / 'log' / 'libvirt' / 'libxl',
++    install_prefix + localstatedir / 'lib' / 'libvirt' / 'libxl',
++    install_prefix + runstatedir / 'libvirt' / 'libxl',
++    install_prefix + localstatedir / 'log' / 'libvirt' / 'libxl',
+   ]
+ endif
+diff --git a/src/locking/meson.build b/src/locking/meson.build
+index 8a28310..9da81cc 100644
+--- a/src/locking/meson.build
++++ b/src/locking/meson.build
+@@ -243,14 +243,14 @@ if conf.has('WITH_LIBVIRTD')
+   }
+ 
+   virt_install_dirs += [
+-    localstatedir / 'lib' / 'libvirt' / 'lockd',
+-    localstatedir / 'lib' / 'libvirt' / 'lockd' / 'files',
+-    runstatedir / 'libvirt' / 'lockd',
++    install_prefix + localstatedir / 'lib' / 'libvirt' / 'lockd',
++    install_prefix + localstatedir / 'lib' / 'libvirt' / 'lockd' / 'files',
++    install_prefix + runstatedir / 'libvirt' / 'lockd',
+   ]
+ 
+   if conf.has('WITH_SANLOCK')
+     virt_install_dirs += [
+-      localstatedir / 'lib' / 'libvirt' / 'sanlock',
++      install_prefix + localstatedir / 'lib' / 'libvirt' / 'sanlock',
+     ]
+   endif
+ endif
+diff --git a/src/lxc/meson.build b/src/lxc/meson.build
+index f8e2a88..96d6687 100644
+--- a/src/lxc/meson.build
++++ b/src/lxc/meson.build
+@@ -182,8 +182,8 @@ if conf.has('WITH_LXC')
+   }
+ 
+   virt_install_dirs += [
+-    localstatedir / 'lib' / 'libvirt' / 'lxc',
+-    runstatedir / 'libvirt' / 'lxc',
+-    localstatedir / 'log' / 'libvirt' / 'lxc',
++    install_prefix + localstatedir / 'lib' / 'libvirt' / 'lxc',
++    install_prefix + runstatedir / 'libvirt' / 'lxc',
++    install_prefix + localstatedir / 'log' / 'libvirt' / 'lxc',
+   ]
+ endif
+diff --git a/src/meson.build b/src/meson.build
+index 7c47821..d33d16a 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -669,7 +669,7 @@ endforeach
+ 
+ virt_conf_files += 'libvirt.conf'
+ 
+-install_data(virt_conf_files, install_dir: confdir)
++install_data(virt_conf_files, install_dir: install_prefix + confdir)
+ install_data(virt_aug_files, install_dir: virt_aug_dir)
+ 
+ # augeas_test_data:
+@@ -729,7 +729,7 @@ foreach data : virt_daemon_confs
+     output: '@0@.conf'.format(data['name']),
+     configuration: daemon_conf,
+     install: true,
+-    install_dir: confdir,
++    install_dir: install_prefix + confdir,
+   )
+ 
+   if data.get('with_ip', false)
+@@ -853,14 +853,14 @@ if conf.has('WITH_LIBVIRTD')
+ 
+       install_data(
+         init_file,
+-        install_dir: sysconfdir / 'init.d',
++        install_dir: install_prefix + sysconfdir / 'init.d',
+         rename: [ init['name'] ],
+       )
+ 
+       if init.has_key('confd')
+         install_data(
+           init['confd'],
+-          install_dir: sysconfdir / 'conf.d',
++          install_dir: install_prefix + sysconfdir / 'conf.d',
+           rename: [ init['name'] ],
+         )
+       endif
+@@ -872,7 +872,7 @@ if init_script != 'none'
+   foreach sysconf : sysconf_files
+     install_data(
+       sysconf['file'],
+-      install_dir: sysconfdir / 'sysconfig',
++      install_dir: install_prefix + sysconfdir / 'sysconfig',
+       rename: [ sysconf['name'] ],
+     )
+   endforeach
+@@ -897,10 +897,10 @@ endif
+ # Install empty directories
+ 
+ virt_install_dirs += [
+-  localstatedir / 'cache' / 'libvirt',
+-  localstatedir / 'lib' / 'libvirt' / 'images',
+-  localstatedir / 'lib' / 'libvirt' / 'filesystems',
+-  localstatedir / 'lib' / 'libvirt' / 'boot',
++  install_prefix + localstatedir / 'cache' / 'libvirt',
++  install_prefix + localstatedir / 'lib' / 'libvirt' / 'images',
++  install_prefix + localstatedir / 'lib' / 'libvirt' / 'filesystems',
++  install_prefix + localstatedir / 'lib' / 'libvirt' / 'boot',
+ ]
+ 
+ meson.add_install_script(
+diff --git a/src/network/meson.build b/src/network/meson.build
+index 3ec598c..b02040b 100644
+--- a/src/network/meson.build
++++ b/src/network/meson.build
+@@ -79,9 +79,9 @@ if conf.has('WITH_NETWORK')
+   }
+ 
+   virt_install_dirs += [
+-    localstatedir / 'lib' / 'libvirt' / 'network',
+-    localstatedir / 'lib' / 'libvirt' / 'dnsmasq',
+-    runstatedir / 'libvirt' / 'network',
++    install_prefix + localstatedir / 'lib' / 'libvirt' / 'network',
++    install_prefix + localstatedir / 'lib' / 'libvirt' / 'dnsmasq',
++    install_prefix + runstatedir / 'libvirt' / 'network',
+   ]
+ 
+   configure_file(
+@@ -89,12 +89,12 @@ if conf.has('WITH_NETWORK')
+     output: '@BASENAME@',
+     copy: true,
+     install: true,
+-    install_dir: confdir / 'qemu' / 'networks',
++    install_dir: install_prefix + confdir / 'qemu' / 'networks',
+   )
+ 
+   meson.add_install_script(
+     meson_python_prog.path(), python3_prog.path(), meson_install_symlink_prog.path(),
+-    confdir / 'qemu' / 'networks' / 'autostart',
++    install_prefix + confdir / 'qemu' / 'networks' / 'autostart',
+     '../default.xml', 'default.xml',
+   )
+ 
+diff --git a/src/nwfilter/xml/meson.build b/src/nwfilter/xml/meson.build
+index 0d96c54..66c92a1 100644
+--- a/src/nwfilter/xml/meson.build
++++ b/src/nwfilter/xml/meson.build
+@@ -25,4 +25,4 @@ nwfilter_xml_files = [
+   'qemu-announce-self.xml',
+ ]
+ 
+-install_data(nwfilter_xml_files, install_dir: sysconfdir / 'libvirt' / 'nwfilter')
++install_data(nwfilter_xml_files, install_dir: install_prefix + sysconfdir / 'libvirt' / 'nwfilter')
+diff --git a/src/qemu/meson.build b/src/qemu/meson.build
+index 90640b0..8802cec 100644
+--- a/src/qemu/meson.build
++++ b/src/qemu/meson.build
+@@ -171,12 +171,12 @@ if conf.has('WITH_QEMU')
+   }
+ 
+   virt_install_dirs += [
+-    localstatedir / 'lib' / 'libvirt' / 'qemu',
+-    runstatedir / 'libvirt' / 'qemu',
+-    localstatedir / 'cache' / 'libvirt' / 'qemu',
+-    localstatedir / 'log' / 'libvirt' / 'qemu',
+-    localstatedir / 'lib' / 'libvirt' / 'swtpm',
+-    runstatedir / 'libvirt' / 'qemu' / 'swtpm',
+-    localstatedir / 'log' / 'swtpm' / 'libvirt' / 'qemu',
++    install_prefix + localstatedir / 'lib' / 'libvirt' / 'qemu',
++    install_prefix + runstatedir / 'libvirt' / 'qemu',
++    install_prefix + localstatedir / 'cache' / 'libvirt' / 'qemu',
++    install_prefix + localstatedir / 'log' / 'libvirt' / 'qemu',
++    install_prefix + localstatedir / 'lib' / 'libvirt' / 'swtpm',
++    install_prefix + runstatedir / 'libvirt' / 'qemu' / 'swtpm',
++    install_prefix + localstatedir / 'log' / 'swtpm' / 'libvirt' / 'qemu',
+   ]
+ endif
+diff --git a/src/remote/meson.build b/src/remote/meson.build
+index 9ad2f6a..429a15b 100644
+--- a/src/remote/meson.build
++++ b/src/remote/meson.build
+@@ -245,7 +245,7 @@ if conf.has('WITH_REMOTE')
+     }
+ 
+     virt_install_dirs += [
+-      localstatedir / 'log' / 'libvirt',
++      install_prefix + localstatedir / 'log' / 'libvirt',
+     ]
+ 
+     logrotate_conf = configuration_data()
+@@ -259,7 +259,7 @@ if conf.has('WITH_REMOTE')
+       )
+       install_data(
+         log_file,
+-        install_dir: sysconfdir / 'logrotate.d',
++        install_dir: install_prefix + sysconfdir / 'logrotate.d',
+         rename: [ name ],
+       )
+     endforeach
+@@ -309,7 +309,7 @@ endif
+ if conf.has('WITH_SASL')
+   install_data(
+     'libvirtd.sasl',
+-    install_dir: sysconfdir / 'sasl2',
++    install_dir: install_prefix + sysconfdir / 'sasl2',
+     rename: [ 'libvirt.conf' ],
+   )
+ endif
+diff --git a/src/security/apparmor/meson.build b/src/security/apparmor/meson.build
+index af43780..e2d6c81 100644
+--- a/src/security/apparmor/meson.build
++++ b/src/security/apparmor/meson.build
+@@ -17,22 +17,22 @@ foreach name : apparmor_gen_profiles
+     output: name,
+     configuration: apparmor_gen_profiles_conf,
+     install: true,
+-    install_dir: apparmor_dir,
++    install_dir: install_prefix + apparmor_dir,
+   )
+ endforeach
+ 
+ install_data(
+   [ 'libvirt-qemu', 'libvirt-lxc' ],
+-  install_dir: apparmor_dir / 'abstractions',
++  install_dir: install_prefix + apparmor_dir / 'abstractions',
+ )
+ 
+ install_data(
+   [ 'TEMPLATE.qemu', 'TEMPLATE.lxc' ],
+-  install_dir: apparmor_dir / 'libvirt',
++  install_dir: install_prefix + apparmor_dir / 'libvirt',
+ )
+ 
+ install_data(
+   'usr.lib.libvirt.virt-aa-helper.local',
+-  install_dir: apparmor_dir / 'local',
++  install_dir: install_prefix + apparmor_dir / 'local',
+   rename: 'usr.lib.libvirt.virt-aa-helper',
+ )
+diff --git a/tools/meson.build b/tools/meson.build
+index b8c6802..dacd0ff 100644
+--- a/tools/meson.build
++++ b/tools/meson.build
+@@ -115,7 +115,7 @@ if conf.has('WITH_LOGIN_SHELL')
+     install_rpath: libvirt_rpath,
+   )
+ 
+-  install_data('virt-login-shell.conf', install_dir: sysconfdir / 'libvirt')
++  install_data('virt-login-shell.conf', install_dir: install_prefix + sysconfdir / 'libvirt')
+ endif
+ 
+ if host_machine.system() == 'windows'
+@@ -274,7 +274,7 @@ configure_file(
+ if init_script == 'systemd'
+   install_data(
+     'libvirt-guests.sysconf',
+-    install_dir: sysconfdir / 'sysconfig',
++    install_dir: install_prefix + sysconfdir / 'sysconfig',
+     rename: 'libvirt-guests',
+   )
diff --git a/nixpkgs/pkgs/development/libraries/libvirt/5.9.0.nix b/nixpkgs/pkgs/development/libraries/libvirt/5.9.0.nix
new file mode 100644
index 000000000000..c8ad0e7e6030
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvirt/5.9.0.nix
@@ -0,0 +1,142 @@
+{ lib, stdenv, fetchurl, fetchgit
+, pkg-config, makeWrapper, libtool, autoconf, automake, fetchpatch
+, coreutils, libxml2, gnutls, perl, python2, attr
+, iproute2, iptables, readline, lvm2, util-linux, systemd, libpciaccess, gettext
+, libtasn1, ebtables, libgcrypt, yajl, pmutils, libcap_ng, libapparmor
+, dnsmasq, libnl, libpcap, libxslt, xhtml1, numad, numactl, perlPackages
+, curl, libiconv, gmp, zfs, parted, bridge-utils, dmidecode, glib, rpcsvc-proto, libtirpc
+, enableXen ? false, xen ? null
+, enableIscsi ? false, openiscsi
+, enableCeph ? false, ceph
+}:
+
+with lib;
+
+# if you update, also bump <nixpkgs/pkgs/development/python-modules/libvirt/default.nix> and SysVirt in <nixpkgs/pkgs/top-level/perl-packages.nix>
+let
+  buildFromTarball = stdenv.isDarwin;
+in stdenv.mkDerivation rec {
+  pname = "libvirt";
+  version = "5.9.0";
+
+  src =
+    if buildFromTarball then
+      fetchurl {
+        url = "http://libvirt.org/sources/${pname}-${version}.tar.xz";
+        sha256 = "0fc9jxw3v6x5hc10bkd7bbcayn24hbld5adj2gh5s648v7hx55il";
+      }
+    else
+      fetchgit {
+        url = "git://libvirt.org/libvirt.git";
+        rev = "v${version}";
+        sha256 = "0smm77ag8bg24xkbhl4akqikjrsq2pd3wk31nj0hk1avqnl00gmk";
+        fetchSubmodules = true;
+      };
+
+  nativeBuildInputs = [ makeWrapper pkg-config rpcsvc-proto ];
+  buildInputs = [
+    libxml2 gnutls perl python2 readline gettext libtasn1 libgcrypt yajl
+    libxslt xhtml1 perlPackages.XMLXPath curl libpcap glib
+  ] ++ optionals (!buildFromTarball) [
+    libtool autoconf automake
+  ] ++ optionals stdenv.isLinux [
+    libpciaccess lvm2 util-linux systemd libnl numad zfs
+    libapparmor libcap_ng numactl attr parted libtirpc
+  ] ++ optionals (enableXen && stdenv.isLinux && stdenv.isx86_64) [
+    xen
+  ] ++ optionals enableIscsi [
+    openiscsi
+  ] ++ optionals enableCeph [
+    ceph
+  ] ++ optionals stdenv.isDarwin [
+    libiconv gmp
+  ];
+
+  preConfigure = ''
+    ${ optionalString (!buildFromTarball) "./bootstrap --no-git --gnulib-srcdir=$(pwd)/.gnulib" }
+    PATH=${lib.makeBinPath ([ dnsmasq ] ++ optionals stdenv.isLinux [ iproute2 iptables ebtables lvm2 systemd numad ] ++ optionals enableIscsi [ openiscsi ])}:$PATH
+    # the path to qemu-kvm will be stored in VM's .xml and .save files
+    # do not use "''${qemu_kvm}/bin/qemu-kvm" to avoid bound VMs to particular qemu derivations
+    substituteInPlace src/lxc/lxc_conf.c \
+      --replace 'lxc_path,' '"/run/libvirt/nix-emulators/libvirt_lxc",'
+    patchShebangs . # fixes /usr/bin/python references
+  '';
+
+  configureFlags = [
+    "--localstatedir=/var"
+    "--sysconfdir=/var/lib"
+    "--with-libpcap"
+    "--with-qemu"
+    "--with-vmware"
+    "--with-vbox"
+    "--with-test"
+    "--with-esx"
+    "--with-remote"
+  ] ++ optionals stdenv.isLinux [
+    "QEMU_BRIDGE_HELPER=/run/wrappers/bin/qemu-bridge-helper"
+    "QEMU_PR_HELPER=/run/libvirt/nix-helpers/qemu-pr-helper"
+    "EBTABLES_PATH=${ebtables}/bin/ebtables-legacy"
+    "CFLAGS=-I${libtirpc.dev}/include/tirpc"
+    "--with-attr"
+    "--with-apparmor"
+    "--with-secdriver-apparmor"
+    "--with-numad"
+    "--with-macvtap"
+    "--with-virtualport"
+    "--with-storage-disk"
+  ] ++ optionals (stdenv.isLinux && zfs != null) [
+    "--with-storage-zfs"
+  ] ++ optionals enableIscsi [
+    "--with-storage-iscsi"
+  ] ++ optionals enableCeph [
+    "--with-storage-rbd"
+  ] ++ optionals stdenv.isDarwin [
+    "--with-init-script=none"
+  ];
+
+  installFlags = [
+    "localstatedir=$(TMPDIR)/var"
+    "sysconfdir=$(out)/var/lib"
+  ];
+
+
+  postInstall = let
+    binPath = [ iptables iproute2 pmutils numad numactl bridge-utils dmidecode dnsmasq ebtables ] ++ optionals enableIscsi [ openiscsi ];
+  in ''
+    substituteInPlace $out/libexec/libvirt-guests.sh \
+      --replace 'ON_BOOT=start'       'ON_BOOT=''${ON_BOOT:-start}' \
+      --replace 'ON_SHUTDOWN=suspend' 'ON_SHUTDOWN=''${ON_SHUTDOWN:-suspend}' \
+      --replace "$out/bin"            '${gettext}/bin' \
+      --replace 'lock/subsys'         'lock' \
+      --replace 'gettext.sh'          'gettext.sh
+  # Added in nixpkgs:
+  gettext() { "${gettext}/bin/gettext" "$@"; }
+  '
+  '' + optionalString stdenv.isLinux ''
+    substituteInPlace $out/lib/systemd/system/libvirtd.service --replace /bin/kill ${coreutils}/bin/kill
+    rm $out/lib/systemd/system/{virtlockd,virtlogd}.*
+    wrapProgram $out/sbin/libvirtd \
+      --prefix PATH : /run/libvirt/nix-emulators:${makeBinPath binPath}
+  '';
+
+  enableParallelBuilding = true;
+
+  NIX_CFLAGS_COMPILE = "-fno-stack-protector";
+
+  meta = {
+    homepage = "http://libvirt.org/";
+    repositories.git = "git://libvirt.org/libvirt.git";
+    description = ''
+      A toolkit to interact with the virtualization capabilities of recent
+      versions of Linux (and other OSes)
+    '';
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ fpletz globin ];
+    knownVulnerabilities = [
+      "https://security.libvirt.org/2019/0008.html"
+      "https://security.libvirt.org/2019/0009.html"
+      "https://security.libvirt.org/2020/0001.html"
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvirt/default.nix b/nixpkgs/pkgs/development/libraries/libvirt/default.nix
new file mode 100644
index 000000000000..28b67a801989
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvirt/default.nix
@@ -0,0 +1,162 @@
+{ lib, stdenv, fetchurl, fetchgit
+, makeWrapper, autoreconfHook, fetchpatch
+, coreutils, libxml2, gnutls, perl, python3, attr, glib, docutils
+, iproute2, readline, lvm2, util-linux, systemd, libpciaccess, gettext
+, libtasn1, iptables, ebtables, libgcrypt, yajl, pmutils, libcap_ng, libapparmor
+, dnsmasq, libnl, libpcap, libxslt, xhtml1, numad, numactl, perlPackages
+, curl, libiconv, gmp, zfs, parted, bridge-utils, dmidecode, dbus, libtirpc, rpcsvc-proto, darwin
+, meson, ninja, audit, cmake, bash-completion, pkg-config
+, enableXen ? false, xen ? null
+, enableIscsi ? false, openiscsi
+, enableCeph ? false, ceph
+, enableGlusterfs ? false, glusterfs
+}:
+
+with lib;
+
+# if you update, also bump <nixpkgs/pkgs/development/python-modules/libvirt/default.nix> and SysVirt in <nixpkgs/pkgs/top-level/perl-packages.nix>
+let
+  buildFromTarball = stdenv.isDarwin;
+  # libvirt hardcodes the binary name 'ebtables', but in nixpkgs the ebtables
+  # binary we want to use is named 'ebtables-legacy'.
+  # Create a derivation to alias the binary name so that libvirt can find the right one, and use that below.
+  ebtables-compat = stdenv.mkDerivation {
+    pname = "ebtables-compat";
+    version = ebtables.version;
+    src = null;
+    buildInputs = [ ebtables ];
+    buildCommand = ''
+      mkdir -p $out/bin
+      ln -sf ${ebtables}/bin/ebtables-legacy $out/bin/ebtables
+    '';
+  };
+in stdenv.mkDerivation rec {
+  pname = "libvirt";
+  version = "7.0.0";
+
+  src =
+    if buildFromTarball then
+      fetchurl {
+        url = "https://libvirt.org/sources/${pname}-${version}.tar.xz";
+        sha256 = "12fxkpy7j2qhfxypw9jg3bzdd9xx6vf6x96iy5kjihh89n236f6a";
+      }
+    else
+      fetchgit {
+        url = "https://gitlab.com/libvirt/libvirt.git";
+        rev = "v${version}";
+        sha256 = "0xg9d410008mny73r2cp5ipghqpk0gz9gy7j32vcfk691dq75b3c";
+        fetchSubmodules = true;
+      };
+
+  patches = [
+    ./0001-meson-patch-in-an-install-prefix-for-building-on-nix.patch
+  ];
+
+  nativeBuildInputs = [
+    ninja meson cmake makeWrapper pkg-config docutils
+  ] ++ optional (!stdenv.isDarwin) [
+    rpcsvc-proto
+  ] ++ optionals stdenv.isDarwin [
+    darwin.developer_cmds # needed for rpcgen
+  ];
+
+  buildInputs = [
+    bash-completion pkg-config
+    libxml2 gnutls perl python3 readline gettext libtasn1 libgcrypt yajl
+    libxslt xhtml1 perlPackages.XMLXPath curl libpcap glib dbus
+  ] ++ optionals stdenv.isLinux [
+    audit libpciaccess lvm2 util-linux systemd libnl numad zfs
+    libapparmor libcap_ng numactl attr parted libtirpc
+  ] ++ optionals (enableXen && stdenv.isLinux && stdenv.isx86_64) [
+    xen
+  ] ++ optionals enableIscsi [
+    openiscsi
+  ] ++ optionals enableCeph [
+    ceph
+  ] ++ optionals enableGlusterfs [
+    glusterfs
+  ] ++ optionals stdenv.isDarwin [
+    libiconv gmp
+  ];
+
+  preConfigure = let
+    overrides = {
+      QEMU_BRIDGE_HELPER = "/run/wrappers/bin/qemu-bridge-helper";
+      QEMU_PR_HELPER = "/run/libvirt/nix-helpers/qemu-pr-helper";
+    };
+    patchBuilder = var: value: ''
+      sed -i meson.build -e "s|conf.set_quoted('${var}',.*|conf.set_quoted('${var}','${value}')|"
+    '';
+  in ''
+    PATH=${lib.makeBinPath ([ dnsmasq ] ++ optionals stdenv.isLinux [ iproute2 iptables ebtables-compat lvm2 systemd numad ] ++ optionals enableIscsi [ openiscsi ])}:$PATH
+    # the path to qemu-kvm will be stored in VM's .xml and .save files
+    # do not use "''${qemu_kvm}/bin/qemu-kvm" to avoid bound VMs to particular qemu derivations
+    substituteInPlace src/lxc/lxc_conf.c \
+      --replace 'lxc_path,' '"/run/libvirt/nix-emulators/libvirt_lxc",'
+    patchShebangs .
+  ''
+  + (lib.concatStringsSep "\n" (lib.mapAttrsToList patchBuilder overrides));
+
+  mesonAutoFeatures = "auto";
+
+  mesonFlags = let
+    opt = option: enable: "-D${option}=${if enable then "enabled" else "disabled"}";
+  in [
+    "--sysconfdir=/var/lib"
+    "-Dinstall_prefix=${placeholder "out"}"
+    "-Dlocalstatedir=/var"
+    "-Drunstatedir=/run"
+    "-Dlibpcap=enabled"
+    "-Ddriver_qemu=enabled"
+    "-Ddriver_vmware=enabled"
+    "-Ddriver_vbox=enabled"
+    "-Ddriver_test=enabled"
+    "-Ddriver_esx=enabled"
+    "-Ddriver_remote=enabled"
+    "-Dpolkit=enabled"
+    (opt "storage_iscsi" enableIscsi)
+  ] ++ optionals stdenv.isLinux [
+    (opt "storage_zfs" (zfs != null))
+    "-Dattr=enabled"
+    "-Dapparmor=enabled"
+    "-Dsecdriver_apparmor=enabled"
+    "-Dnumad=enabled"
+    "-Dstorage_disk=enabled"
+    (opt "glusterfs" enableGlusterfs)
+    (opt "storage_rbd" enableCeph)
+  ] ++ optionals stdenv.isDarwin [
+    "-Dinit_script=none"
+  ];
+
+  postInstall = let
+    # Keep the legacy iptables binary for now for backwards compatibility (comment on #109332)
+    binPath = [ iptables ebtables-compat iproute2 pmutils numad numactl bridge-utils dmidecode dnsmasq ] ++ optionals enableIscsi [ openiscsi ];
+  in ''
+    substituteInPlace $out/libexec/libvirt-guests.sh \
+      --replace 'ON_BOOT="start"'       'ON_BOOT=''${ON_BOOT:-start}' \
+      --replace 'ON_SHUTDOWN="suspend"' 'ON_SHUTDOWN=''${ON_SHUTDOWN:-suspend}' \
+      --replace "$out/bin"              '${gettext}/bin' \
+      --replace 'lock/subsys'           'lock' \
+      --replace 'gettext.sh'            'gettext.sh
+  # Added in nixpkgs:
+  gettext() { "${gettext}/bin/gettext" "$@"; }
+  '
+  '' + optionalString stdenv.isLinux ''
+    substituteInPlace $out/lib/systemd/system/libvirtd.service --replace /bin/kill ${coreutils}/bin/kill
+    rm $out/lib/systemd/system/{virtlockd,virtlogd}.*
+    wrapProgram $out/sbin/libvirtd \
+      --prefix PATH : /run/libvirt/nix-emulators:${makeBinPath binPath}
+  '';
+
+  meta = {
+    homepage = "https://libvirt.org/";
+    repositories.git = "git://libvirt.org/libvirt.git";
+    description = ''
+      A toolkit to interact with the virtualization capabilities of recent
+      versions of Linux (and other OSes)
+    '';
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ fpletz globin ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvisio/default.nix b/nixpkgs/pkgs/development/libraries/libvisio/default.nix
new file mode 100644
index 000000000000..42051fe66a63
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvisio/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, boost, libwpd, libwpg, pkg-config, zlib, gperf
+, librevenge, libxml2, icu, perl, cppunit, doxygen
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libvisio";
+  version = "0.1.7";
+
+  outputs = [ "out" "bin" "dev" "doc" ];
+
+  src = fetchurl {
+    url = "https://dev-www.libreoffice.org/src/libvisio/${pname}-${version}.tar.xz";
+    sha256 = "0k7adcbbf27l7n453cca1m6s9yj6qvb5j6bsg2db09ybf3w8vbwg";
+  };
+
+  nativeBuildInputs = [ pkg-config cppunit doxygen ];
+  buildInputs = [ boost libwpd libwpg zlib gperf librevenge libxml2 icu perl ];
+
+  configureFlags = [
+    "--disable-werror"
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A library providing ability to interpret and import visio diagrams into various applications";
+    homepage = "https://wiki.documentfoundation.org/DLP/Libraries/libvisio";
+    license = licenses.mpl20;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvisio2svg/default.nix b/nixpkgs/pkgs/development/libraries/libvisio2svg/default.nix
new file mode 100644
index 000000000000..0525ba80b4f9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvisio2svg/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, freetype
+, libemf2svg
+, librevenge
+, libvisio
+, libwmf
+, libxml2
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libvisio2svg";
+  version = "0.5.5";
+
+  src = fetchFromGitHub {
+    owner = "kakwa";
+    repo = pname;
+    rev = version;
+    sha256 = "14m37mmib1596c76j9w178jqhwxyih2sy5w5q9xglh8cmlfn1hfx";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libxml2 freetype librevenge libvisio libwmf libemf2svg ];
+
+  meta = with lib; {
+    description = "Library and tools to convert Microsoft Visio documents (VSS and VSD) to SVG";
+    homepage = "https://github.com/kakwa/libvisio2svg";
+    maintainers = with maintainers; [ erdnaxe ];
+    license = licenses.gpl2Only;
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvisual/default.nix b/nixpkgs/pkgs/development/libraries/libvisual/default.nix
new file mode 100644
index 000000000000..3e61ee8a6a13
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvisual/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, pkg-config, glib }:
+
+stdenv.mkDerivation rec {
+  pname = "libvisual";
+  version = "0.4.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libvisual/${pname}-${version}.tar.gz";
+    sha256 = "1my1ipd5k1ixag96kwgf07bgxkjlicy9w22jfxb2kq95f6wgsk8b";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ glib ];
+
+  hardeningDisable = [ "format" ];
+
+  configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "ac_cv_func_malloc_0_nonnull=yes"
+    "ac_cv_func_realloc_0_nonnull=yes"
+  ];
+
+  meta = {
+    description = "An abstraction library for audio visualisations";
+    homepage = "https://sourceforge.net/projects/libvisual/";
+    license = lib.licenses.lgpl21Plus;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvmaf/default.nix b/nixpkgs/pkgs/development/libraries/libvmaf/default.nix
new file mode 100644
index 000000000000..1410822a1ca4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvmaf/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, meson, ninja, nasm }:
+
+stdenv.mkDerivation rec {
+  pname = "libvmaf";
+  version = "2.2.0";
+
+  src = fetchFromGitHub {
+    owner = "netflix";
+    repo = "vmaf";
+    rev = "v${version}";
+    sha256 = "1jlmivmdzlhizljbmsvqqxnhjfyjh8zxyf5xv6j040vbfj4mf14f";
+  };
+
+  sourceRoot = "source/libvmaf";
+
+  nativeBuildInputs = [ meson ninja nasm ];
+
+  mesonFlags = [ "-Denable_avx512=true" ];
+
+  outputs = [ "out" "dev" ];
+  doCheck = false;
+
+  meta = with lib; {
+    homepage = "https://github.com/Netflix/vmaf";
+    description = "Perceptual video quality assessment based on multi-method fusion (VMAF)";
+    changelog = "https://github.com/Netflix/vmaf/blob/v${version}/CHANGELOG.md";
+    platforms = platforms.unix;
+    license = licenses.bsd2Patent;
+    maintainers = [ maintainers.cfsmp3 maintainers.marsam ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvmi/default.nix b/nixpkgs/pkgs/development/libraries/libvmi/default.nix
new file mode 100644
index 000000000000..36fd026eeedd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvmi/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv,
+  fetchFromGitHub,
+  autoreconfHook,
+  bison,
+  flex,
+  glib,
+  pkg-config,
+  json_c,
+  xen,
+  libvirt,
+  xenSupport ? true }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "libvmi";
+  version = "0.12.0";
+  libVersion = "0.0.12";
+
+  src = fetchFromGitHub {
+    owner = "libvmi";
+    repo = "libvmi";
+    rev = "v${version}";
+    sha256 = "0wbi2nasb1gbci6cq23g6kq7i10rwi1y7r44rl03icr5prqjpdyv";
+  };
+
+  buildInputs = [ glib libvirt json_c ] ++ (optional xenSupport xen);
+  nativeBuildInputs = [ autoreconfHook bison flex pkg-config ];
+
+  configureFlags = optional (!xenSupport) "--disable-xen";
+
+  # libvmi uses dlopen() for the xen libraries, however autoPatchelfHook doesn't work here
+  postFixup = optionalString xenSupport ''
+    libvmi="$out/lib/libvmi.so.${libVersion}"
+    oldrpath=$(patchelf --print-rpath "$libvmi")
+    patchelf --set-rpath "$oldrpath:${makeLibraryPath [ xen ]}" "$libvmi"
+  '';
+
+  meta = with lib; {
+    homepage = "https://libvmi.com/";
+    description = "A C library for virtual machine introspection";
+    longDescription = ''
+      LibVMI is a C library with Python bindings that makes it easy to monitor the low-level
+      details of a running virtual machine by viewing its memory, trapping on hardware events,
+      and accessing the vCPU registers.
+    '';
+    license = with licenses; [ gpl3 lgpl3 ];
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ matthiasbeyer ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvncserver/default.nix b/nixpkgs/pkgs/development/libraries/libvncserver/default.nix
new file mode 100644
index 000000000000..01a079a20512
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvncserver/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchzip, fetchpatch, cmake
+, libjpeg, openssl, zlib, libgcrypt, libpng
+, systemd, Carbon
+}:
+
+let
+  s = # Generated upstream information
+  rec {
+    pname = "libvncserver";
+    version = "0.9.13";
+    url = "https://github.com/LibVNC/libvncserver/archive/LibVNCServer-${version}.tar.gz";
+    sha256 = "0zz0hslw8b1p3crnfy3xnmrljik359h83dpk64s697dqdcrzy141"; # unpacked archive checksum
+  };
+in
+stdenv.mkDerivation {
+  inherit (s) pname version;
+  src = fetchzip {
+    inherit (s) url sha256;
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libjpeg openssl libgcrypt libpng ]
+    ++ lib.optional stdenv.isLinux systemd
+    ++ lib.optional stdenv.isDarwin Carbon;
+  propagatedBuildInputs = [ zlib ];
+
+  meta = {
+    inherit (s) version;
+    description = "VNC server library";
+    homepage = "https://libvnc.github.io/";
+    license = lib.licenses.gpl2Plus ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvorbis/default.nix b/nixpkgs/pkgs/development/libraries/libvorbis/default.nix
new file mode 100644
index 000000000000..281c7744a339
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvorbis/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, libogg, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "libvorbis";
+  version = "1.3.7";
+
+  src = fetchurl {
+    url = "http://downloads.xiph.org/releases/vorbis/${pname}-${version}.tar.xz";
+    sha256 = "0jwmf87x5sdis64rbv0l87mdpah1rbilkkxszipbzg128f9w8g5k";
+  };
+
+  outputs = [ "out" "dev" "doc" ];
+
+  nativeBuildInputs = [ pkg-config ];
+  propagatedBuildInputs = [ libogg ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Vorbis audio compression reference implementation";
+    homepage = "https://xiph.org/vorbis/";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.ehmry ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvori/default.nix b/nixpkgs/pkgs/development/libraries/libvori/default.nix
new file mode 100644
index 000000000000..2eb7bffbdf12
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvori/default.nix
@@ -0,0 +1,21 @@
+{ stdenv, lib, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "libvori";
+  version = "210412";
+
+  src = fetchurl {
+    url = "https://brehm-research.de/files/${pname}-${version}.tar.gz";
+    sha256 = "1b4hpwibf3k7gl6n984l3wdi0zyl2fmpz84m9g2di4yhm6p8c61k";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Library for Voronoi intergration of electron densities";
+    homepage = "https://brehm-research.de/libvori.php";
+    license = with licenses; [ lgpl3Only ];
+    platforms = platforms.unix;
+    maintainers = [ maintainers.sheepforce ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvpx/1_8.nix b/nixpkgs/pkgs/development/libraries/libvpx/1_8.nix
new file mode 100644
index 000000000000..befbafd5a4ec
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvpx/1_8.nix
@@ -0,0 +1,185 @@
+{ lib, stdenv, fetchFromGitHub, perl, yasm
+, vp8DecoderSupport ? true # VP8 decoder
+, vp8EncoderSupport ? true # VP8 encoder
+, vp9DecoderSupport ? true # VP9 decoder
+, vp9EncoderSupport ? true # VP9 encoder
+, extraWarningsSupport ? false # emit non-fatal warnings
+, werrorSupport ? false # treat warnings as errors (not available with all compilers)
+, debugSupport ? false # debug mode
+, gprofSupport ? false # gprof profiling instrumentation
+, gcovSupport ? false # gcov coverage instrumentation
+, sizeLimitSupport ? true # limit max size to allow in the decoder
+, optimizationsSupport ? true # compiler optimization flags
+, runtimeCpuDetectSupport ? true # detect cpu capabilities at runtime
+, thumbSupport ? false # build arm assembly in thumb mode
+, examplesSupport ? true # build examples (vpxdec & vpxenc are part of examples)
+, debugLibsSupport ? false # include debug version of each library
+, postprocSupport ? true # postprocessing
+, multithreadSupport ? true # multithreaded decoding & encoding
+, internalStatsSupport ? false # output of encoder internal stats for debug, if supported (encoders)
+, spatialResamplingSupport ? true # spatial sampling (scaling)
+, realtimeOnlySupport ? false # build for real-time encoding
+, ontheflyBitpackingSupport ? false # on-the-fly bitpacking in real-time encoding
+, errorConcealmentSupport ? false # decoder conceals losses
+, smallSupport ? false # favor smaller binary over speed
+, postprocVisualizerSupport ? false # macro block/block level visualizers
+, unitTestsSupport ? false, curl ? null, coreutils ? null # unit tests
+, webmIOSupport ? true # input from and output to webm container
+, libyuvSupport ? true # libyuv
+, decodePerfTestsSupport ? false # build decoder perf tests with unit tests
+, encodePerfTestsSupport ? false # build encoder perf tests with unit tests
+, multiResEncodingSupport ? false # multiple-resolution encoding
+, temporalDenoisingSupport ? true # use temporal denoising instead of spatial denoising
+, coefficientRangeCheckingSupport ? false # decoder checks if intermediate transform coefficients are in valid range
+, vp9HighbitdepthSupport ? true # 10/12 bit color support in VP9
+# Experimental features
+, experimentalSpatialSvcSupport ? false # Spatial scalable video coding
+, experimentalFpMbStatsSupport ? false
+, experimentalEmulateHardwareSupport ? false
+}:
+
+let
+  inherit (stdenv) is64bit isMips isDarwin isCygwin;
+  inherit (lib) enableFeature optional optionals;
+in
+
+assert vp8DecoderSupport || vp8EncoderSupport || vp9DecoderSupport || vp9EncoderSupport;
+assert internalStatsSupport && (vp9DecoderSupport || vp9EncoderSupport) -> postprocSupport;
+/* If spatialResamplingSupport not enabled, build will fail with undeclared variable errors.
+   Variables called in vpx_scale/generic/vpx_scale.c are declared by vpx_scale/vpx_scale_rtcd.pl,
+   but is only executed if spatialResamplingSupport is enabled */
+assert spatialResamplingSupport;
+assert postprocVisualizerSupport -> postprocSupport;
+assert unitTestsSupport -> curl != null && coreutils != null;
+assert vp9HighbitdepthSupport -> (vp9DecoderSupport || vp9EncoderSupport);
+assert isCygwin -> unitTestsSupport && webmIOSupport && libyuvSupport;
+
+stdenv.mkDerivation rec {
+  pname = "libvpx";
+  version = "1.8.2";
+
+  src = fetchFromGitHub {
+    owner = "webmproject";
+    repo = "libvpx";
+    rev = "v${version}";
+    sha256 = "0gyq4fkbd2fv7m1mm9xrvn6rk6f4jsmbv8bnlhingmnrvyncnmnr";
+  };
+
+  patches = [
+#    ./CVE-2019-9232.CVE-2019-9325.CVE-2019-9371.CVE-2019-9433.patch
+  ];
+
+  postPatch = ''
+    patchShebangs --build \
+      build/make/*.sh \
+      build/make/*.pl \
+      build/make/*.pm \
+      test/*.sh \
+      configure
+  '';
+
+  outputs = [ "bin" "dev" "out" ];
+  setOutputFlags = false;
+
+  configurePlatforms = [];
+  configureFlags = [
+    (enableFeature (vp8EncoderSupport || vp8DecoderSupport) "vp8")
+    (enableFeature vp8EncoderSupport "vp8-encoder")
+    (enableFeature vp8DecoderSupport "vp8-decoder")
+    (enableFeature (vp9EncoderSupport || vp9DecoderSupport) "vp9")
+    (enableFeature vp9EncoderSupport "vp9-encoder")
+    (enableFeature vp9DecoderSupport "vp9-decoder")
+    (enableFeature extraWarningsSupport "extra-warnings")
+    (enableFeature werrorSupport "werror")
+    "--disable-install-docs"
+    (enableFeature examplesSupport "install-bins")
+    "--enable-install-libs"
+    "--disable-install-srcs"
+    (enableFeature debugSupport "debug")
+    (enableFeature gprofSupport "gprof")
+    (enableFeature gcovSupport "gcov")
+    # Required to build shared libraries
+    (enableFeature (!isCygwin) "pic")
+    (enableFeature optimizationsSupport "optimizations")
+    (enableFeature runtimeCpuDetectSupport "runtime-cpu-detect")
+    (enableFeature thumbSupport "thumb")
+    "--enable-libs"
+    (enableFeature examplesSupport "examples")
+    "--disable-docs"
+    "--as=yasm"
+    # Limit default decoder max to WHXGA
+    (if sizeLimitSupport then "--size-limit=5120x3200" else null)
+    "--disable-codec-srcs"
+    (enableFeature debugLibsSupport "debug-libs")
+    (enableFeature isMips "dequant-tokens")
+    (enableFeature isMips "dc-recon")
+    (enableFeature postprocSupport "postproc")
+    (enableFeature (postprocSupport && (vp9DecoderSupport || vp9EncoderSupport)) "vp9-postproc")
+    (enableFeature multithreadSupport "multithread")
+    (enableFeature internalStatsSupport "internal-stats")
+    (enableFeature spatialResamplingSupport "spatial-resampling")
+    (enableFeature realtimeOnlySupport "realtime-only")
+    (enableFeature ontheflyBitpackingSupport "onthefly-bitpacking")
+    (enableFeature errorConcealmentSupport "error-concealment")
+    # Shared libraries are only supported on ELF platforms
+    (if isDarwin || isCygwin then
+       "--enable-static --disable-shared"
+     else
+       "--enable-shared")
+    (enableFeature smallSupport "small")
+    (enableFeature postprocVisualizerSupport "postproc-visualizer")
+    (enableFeature unitTestsSupport "unit-tests")
+    (enableFeature webmIOSupport "webm-io")
+    (enableFeature libyuvSupport "libyuv")
+    (enableFeature decodePerfTestsSupport "decode-perf-tests")
+    (enableFeature encodePerfTestsSupport "encode-perf-tests")
+    (enableFeature multiResEncodingSupport "multi-res-encoding")
+    (enableFeature temporalDenoisingSupport "temporal-denoising")
+    (enableFeature (temporalDenoisingSupport && (vp9DecoderSupport || vp9EncoderSupport)) "vp9-temporal-denoising")
+    (enableFeature coefficientRangeCheckingSupport "coefficient-range-checking")
+    (enableFeature (vp9HighbitdepthSupport && is64bit) "vp9-highbitdepth")
+    (enableFeature (experimentalSpatialSvcSupport ||
+                    experimentalFpMbStatsSupport ||
+                    experimentalEmulateHardwareSupport) "experimental")
+  ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "--enable-external-build"
+    # libvpx darwin targets include darwin version (ie. ARCH-darwinXX-gcc, XX being the darwin version)
+    # See all_platforms: https://github.com/webmproject/libvpx/blob/master/configure
+    # Darwin versions: 10.4=8, 10.5=9, 10.6=10, 10.7=11, 10.8=12, 10.9=13, 10.10=14
+    "--force-target=${stdenv.hostPlatform.config}${
+            if stdenv.hostPlatform.isDarwin then
+              if      stdenv.hostPlatform.osxMinVersion == "10.10" then "14"
+              else if stdenv.hostPlatform.osxMinVersion == "10.9"  then "13"
+              else if stdenv.hostPlatform.osxMinVersion == "10.8"  then "12"
+              else if stdenv.hostPlatform.osxMinVersion == "10.7"  then "11"
+              else if stdenv.hostPlatform.osxMinVersion == "10.6"  then "10"
+              else if stdenv.hostPlatform.osxMinVersion == "10.5"  then "9"
+              else "8"
+            else ""}-gcc"
+    (if stdenv.hostPlatform.isCygwin then "--enable-static-msvcrt" else "")
+  ] # Experimental features
+    ++ optional experimentalSpatialSvcSupport "--enable-spatial-svc"
+    ++ optional experimentalFpMbStatsSupport "--enable-fp-mb-stats"
+    ++ optional experimentalEmulateHardwareSupport "--enable-emulate-hardware";
+
+  nativeBuildInputs = [ perl yasm ];
+
+  buildInputs = [ ]
+    ++ optionals unitTestsSupport [ coreutils curl ];
+
+  NIX_LDFLAGS = [
+    "-lpthread" # fixes linker errors
+  ];
+
+  enableParallelBuilding = true;
+
+  postInstall = ''moveToOutput bin "$bin" '';
+
+  meta = with lib; {
+    description = "WebM VP8/VP9 codec SDK";
+    homepage    = "https://www.webmproject.org/";
+    license     = licenses.bsd3;
+    maintainers = with maintainers; [ codyopel ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvpx/default.nix b/nixpkgs/pkgs/development/libraries/libvpx/default.nix
new file mode 100644
index 000000000000..d538aa41bff3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvpx/default.nix
@@ -0,0 +1,187 @@
+{ lib, stdenv, fetchFromGitHub, perl, yasm
+, vp8DecoderSupport ? true # VP8 decoder
+, vp8EncoderSupport ? true # VP8 encoder
+, vp9DecoderSupport ? true # VP9 decoder
+, vp9EncoderSupport ? true # VP9 encoder
+, extraWarningsSupport ? false # emit non-fatal warnings
+, werrorSupport ? false # treat warnings as errors (not available with all compilers)
+, debugSupport ? false # debug mode
+, gprofSupport ? false # gprof profiling instrumentation
+, gcovSupport ? false # gcov coverage instrumentation
+, sizeLimitSupport ? true # limit max size to allow in the decoder
+, optimizationsSupport ? true # compiler optimization flags
+, runtimeCpuDetectSupport ? true # detect cpu capabilities at runtime
+, thumbSupport ? false # build arm assembly in thumb mode
+, examplesSupport ? true # build examples (vpxdec & vpxenc are part of examples)
+, debugLibsSupport ? false # include debug version of each library
+, postprocSupport ? true # postprocessing
+, multithreadSupport ? true # multithreaded decoding & encoding
+, internalStatsSupport ? false # output of encoder internal stats for debug, if supported (encoders)
+, spatialResamplingSupport ? true # spatial sampling (scaling)
+, realtimeOnlySupport ? false # build for real-time encoding
+, ontheflyBitpackingSupport ? false # on-the-fly bitpacking in real-time encoding
+, errorConcealmentSupport ? false # decoder conceals losses
+, smallSupport ? false # favor smaller binary over speed
+, postprocVisualizerSupport ? false # macro block/block level visualizers
+, unitTestsSupport ? false, curl ? null, coreutils ? null # unit tests
+, webmIOSupport ? true # input from and output to webm container
+, libyuvSupport ? true # libyuv
+, decodePerfTestsSupport ? false # build decoder perf tests with unit tests
+, encodePerfTestsSupport ? false # build encoder perf tests with unit tests
+, multiResEncodingSupport ? false # multiple-resolution encoding
+, temporalDenoisingSupport ? true # use temporal denoising instead of spatial denoising
+, coefficientRangeCheckingSupport ? false # decoder checks if intermediate transform coefficients are in valid range
+, vp9HighbitdepthSupport ? true # 10/12 bit color support in VP9
+# Experimental features
+, experimentalSpatialSvcSupport ? false # Spatial scalable video coding
+, experimentalFpMbStatsSupport ? false
+, experimentalEmulateHardwareSupport ? false
+}:
+
+let
+  inherit (stdenv) is64bit isMips isDarwin isCygwin;
+  inherit (lib) enableFeature optional optionals;
+in
+
+assert vp8DecoderSupport || vp8EncoderSupport || vp9DecoderSupport || vp9EncoderSupport;
+assert internalStatsSupport && (vp9DecoderSupport || vp9EncoderSupport) -> postprocSupport;
+/* If spatialResamplingSupport not enabled, build will fail with undeclared variable errors.
+   Variables called in vpx_scale/generic/vpx_scale.c are declared by vpx_scale/vpx_scale_rtcd.pl,
+   but is only executed if spatialResamplingSupport is enabled */
+assert spatialResamplingSupport;
+assert postprocVisualizerSupport -> postprocSupport;
+assert unitTestsSupport -> curl != null && coreutils != null;
+assert vp9HighbitdepthSupport -> (vp9DecoderSupport || vp9EncoderSupport);
+assert isCygwin -> unitTestsSupport && webmIOSupport && libyuvSupport;
+
+stdenv.mkDerivation rec {
+  pname = "libvpx";
+  version = "1.10.0";
+
+  src = fetchFromGitHub {
+    owner = "webmproject";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-EZP33U10fchyqy7Jr26vHgUUfWR6xtG3fcMWUII0m9w=";
+  };
+
+  postPatch = ''
+    patchShebangs --build \
+      build/make/*.sh \
+      build/make/*.pl \
+      build/make/*.pm \
+      test/*.sh \
+      configure
+
+    # When cross-compiling (for aarch64-multiplatform), the compiler errors out on these flags.
+    # Since they're 'just' warnings, it's fine to just remove them.
+    substituteInPlace configure \
+      --replace "check_add_cflags -Wparentheses-equality" "" \
+      --replace "check_add_cflags -Wunreachable-code-loop-increment" "" \
+      --replace "check_cflags -Wshorten-64-to-32 && add_cflags_only -Wshorten-64-to-32" ""
+  '';
+
+  outputs = [ "bin" "dev" "out" ];
+  setOutputFlags = false;
+
+  configurePlatforms = [];
+  configureFlags = [
+    (enableFeature (vp8EncoderSupport || vp8DecoderSupport) "vp8")
+    (enableFeature vp8EncoderSupport "vp8-encoder")
+    (enableFeature vp8DecoderSupport "vp8-decoder")
+    (enableFeature (vp9EncoderSupport || vp9DecoderSupport) "vp9")
+    (enableFeature vp9EncoderSupport "vp9-encoder")
+    (enableFeature vp9DecoderSupport "vp9-decoder")
+    (enableFeature extraWarningsSupport "extra-warnings")
+    (enableFeature werrorSupport "werror")
+    "--disable-install-docs"
+    (enableFeature examplesSupport "install-bins")
+    "--enable-install-libs"
+    "--disable-install-srcs"
+    (enableFeature debugSupport "debug")
+    (enableFeature gprofSupport "gprof")
+    (enableFeature gcovSupport "gcov")
+    # Required to build shared libraries
+    (enableFeature (!isCygwin) "pic")
+    (enableFeature optimizationsSupport "optimizations")
+    (enableFeature runtimeCpuDetectSupport "runtime-cpu-detect")
+    (enableFeature thumbSupport "thumb")
+    "--enable-libs"
+    (enableFeature examplesSupport "examples")
+    "--disable-docs"
+    "--as=yasm"
+    # Limit default decoder max to WHXGA
+    (if sizeLimitSupport then "--size-limit=5120x3200" else null)
+    "--disable-codec-srcs"
+    (enableFeature debugLibsSupport "debug-libs")
+    (enableFeature isMips "dequant-tokens")
+    (enableFeature isMips "dc-recon")
+    (enableFeature postprocSupport "postproc")
+    (enableFeature (postprocSupport && (vp9DecoderSupport || vp9EncoderSupport)) "vp9-postproc")
+    (enableFeature multithreadSupport "multithread")
+    (enableFeature internalStatsSupport "internal-stats")
+    (enableFeature spatialResamplingSupport "spatial-resampling")
+    (enableFeature realtimeOnlySupport "realtime-only")
+    (enableFeature ontheflyBitpackingSupport "onthefly-bitpacking")
+    (enableFeature errorConcealmentSupport "error-concealment")
+    # Shared libraries are only supported on ELF platforms
+    (if isDarwin || isCygwin then
+       "--enable-static --disable-shared"
+     else
+       "--enable-shared")
+    (enableFeature smallSupport "small")
+    (enableFeature postprocVisualizerSupport "postproc-visualizer")
+    (enableFeature unitTestsSupport "unit-tests")
+    (enableFeature webmIOSupport "webm-io")
+    (enableFeature libyuvSupport "libyuv")
+    (enableFeature decodePerfTestsSupport "decode-perf-tests")
+    (enableFeature encodePerfTestsSupport "encode-perf-tests")
+    (enableFeature multiResEncodingSupport "multi-res-encoding")
+    (enableFeature temporalDenoisingSupport "temporal-denoising")
+    (enableFeature (temporalDenoisingSupport && (vp9DecoderSupport || vp9EncoderSupport)) "vp9-temporal-denoising")
+    (enableFeature coefficientRangeCheckingSupport "coefficient-range-checking")
+    (enableFeature (vp9HighbitdepthSupport && is64bit) "vp9-highbitdepth")
+    (enableFeature (experimentalSpatialSvcSupport ||
+                    experimentalFpMbStatsSupport ||
+                    experimentalEmulateHardwareSupport) "experimental")
+  ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    # libvpx darwin targets include darwin version (ie. ARCH-darwinXX-gcc, XX being the darwin version)
+    # See all_platforms: https://github.com/webmproject/libvpx/blob/master/configure
+    # Darwin versions: 10.4=8, 10.5=9, 10.6=10, 10.7=11, 10.8=12, 10.9=13, 10.10=14
+    "--force-target=${stdenv.hostPlatform.parsed.cpu.name}-${stdenv.hostPlatform.parsed.kernel.name}${
+            if stdenv.hostPlatform.isDarwin then
+              if      stdenv.hostPlatform.osxMinVersion == "10.10" then "14"
+              else if stdenv.hostPlatform.osxMinVersion == "10.9"  then "13"
+              else if stdenv.hostPlatform.osxMinVersion == "10.8"  then "12"
+              else if stdenv.hostPlatform.osxMinVersion == "10.7"  then "11"
+              else if stdenv.hostPlatform.osxMinVersion == "10.6"  then "10"
+              else if stdenv.hostPlatform.osxMinVersion == "10.5"  then "9"
+              else "8"
+            else ""}-gcc"
+    (if stdenv.hostPlatform.isCygwin then "--enable-static-msvcrt" else "")
+  ] # Experimental features
+    ++ optional experimentalSpatialSvcSupport "--enable-spatial-svc"
+    ++ optional experimentalFpMbStatsSupport "--enable-fp-mb-stats"
+    ++ optional experimentalEmulateHardwareSupport "--enable-emulate-hardware";
+
+  nativeBuildInputs = [ perl yasm ];
+
+  buildInputs = [ ]
+    ++ optionals unitTestsSupport [ coreutils curl ];
+
+  NIX_LDFLAGS = [
+    "-lpthread" # fixes linker errors
+  ];
+
+  enableParallelBuilding = true;
+
+  postInstall = ''moveToOutput bin "$bin" '';
+
+  meta = with lib; {
+    description = "WebM VP8/VP9 codec SDK";
+    homepage    = "https://www.webmproject.org/";
+    license     = licenses.bsd3;
+    maintainers = with maintainers; [ codyopel ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvterm-neovim/default.nix b/nixpkgs/pkgs/development/libraries/libvterm-neovim/default.nix
new file mode 100644
index 000000000000..e4a053601833
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvterm-neovim/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv
+, fetchFromGitHub
+, perl
+, libtool
+}:
+
+stdenv.mkDerivation {
+  pname = "libvterm-neovim";
+  # Releases are not tagged, look at commit history to find latest release
+  version = "0.1.3";
+
+  src = fetchFromGitHub {
+    owner = "neovim";
+    repo = "libvterm";
+    rev = "65dbda3ed214f036ee799d18b2e693a833a0e591";
+    sha256 = "0r6yimzbkgrsi9aaxwvxahai2lzgjd1ysblr6m6by5w459853q3n";
+  };
+
+  buildInputs = [ perl ];
+  nativeBuildInputs = [ libtool ];
+
+  makeFlags = [ "PREFIX=$(out)" ]
+    ++ lib.optional stdenv.isDarwin "LIBTOOL=${libtool}/bin/libtool";
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "VT220/xterm/ECMA-48 terminal emulator library";
+    homepage = "http://www.leonerd.org.uk/code/libvterm/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ rvolosatovs ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libvterm/default.nix b/nixpkgs/pkgs/development/libraries/libvterm/default.nix
new file mode 100644
index 000000000000..066dcb4f34f4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvterm/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, pkg-config, glib, ncurses }:
+
+stdenv.mkDerivation rec {
+  pname = "libvterm";
+  version = "0.99.7";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libvterm/${pname}-${version}.tar.gz";
+    sha256 = "10gaqygmmwp0cwk3j8qflri5caf8vl3f7pwfl2svw5whv8wkn0k2";
+  };
+
+  patchPhase = ''
+    sed -i -e s@/usr@$out@ -e /ldconfig/d Makefile
+  '';
+
+  preInstall = ''
+    mkdir -p $out/include
+    mkdir -p $out/lib
+  '';
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ glib ncurses ];
+
+  meta = with lib; {
+    homepage = "http://libvterm.sourceforge.net/";
+    description = "Terminal emulator library to mimic both vt100 and rxvt";
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libwacom/default.nix b/nixpkgs/pkgs/development/libraries/libwacom/default.nix
new file mode 100644
index 000000000000..5bb6445ac38f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libwacom/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, meson, ninja, glib, pkg-config, udev, libgudev, doxygen, python3 }:
+
+stdenv.mkDerivation rec {
+  pname = "libwacom";
+  version = "1.10";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "linuxwacom";
+    repo = "libwacom";
+    rev = "libwacom-${version}";
+    sha256 = "sha256-Q7b54AMAxdIzN7TUuhIdlrXaVtj2szV4n3y9bAE0LsU=";
+  };
+
+  nativeBuildInputs = [ pkg-config meson ninja doxygen python3 ];
+
+  mesonFlags = [ "-Dtests=disabled" ];
+
+  buildInputs = [ glib udev libgudev ];
+
+  meta = with lib; {
+    platforms = platforms.linux;
+    homepage = "https://linuxwacom.github.io/";
+    description = "Libraries, configuration, and diagnostic tools for Wacom tablets running under Linux";
+    maintainers = teams.freedesktop.members;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libwebp/default.nix b/nixpkgs/pkgs/development/libraries/libwebp/default.nix
new file mode 100644
index 000000000000..4908dc4a9ce1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libwebp/default.nix
@@ -0,0 +1,74 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, libtool
+, threadingSupport ? true # multi-threading
+, 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
+, gifSupport ? true, giflib ? null # GIF image format
+#, wicSupport ? true # Windows Imaging Component
+, alignedSupport ? false # Force aligned memory operations
+, swap16bitcspSupport ? false # Byte swap for 16bit color spaces
+, experimentalSupport ? false # Experimental code
+, libwebpmuxSupport ? true # Build libwebpmux
+, libwebpdemuxSupport ? true # Build libwebpdemux
+, libwebpdecoderSupport ? true # Build libwebpdecoder
+}:
+
+assert openglSupport -> freeglut != null && libGL != null && libGLU != null;
+assert pngSupport -> (libpng != null);
+assert jpegSupport -> (libjpeg != null);
+assert tiffSupport -> (libtiff != null);
+assert gifSupport -> (giflib != null);
+
+let
+  mkFlag = optSet: flag: if optSet then "--enable-${flag}" else "--disable-${flag}";
+in
+
+with lib;
+stdenv.mkDerivation rec {
+  pname = "libwebp";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner  = "webmproject";
+    repo   = pname;
+    rev    = version;
+    sha256 = "1kl6qqa29ygqb2fpv140y59v539gdqx4vcf3mlaxhca2bks98qgm";
+  };
+
+  prePatch = "patchShebangs .";
+
+  configureFlags = [
+    (mkFlag threadingSupport "threading")
+    (mkFlag openglSupport "gl")
+    (mkFlag pngSupport "png")
+    (mkFlag jpegSupport "jpeg")
+    (mkFlag tiffSupport "tiff")
+    (mkFlag gifSupport "gif")
+    #(mkFlag (wicSupport && stdenv.isCygwin) "wic")
+    (mkFlag alignedSupport "aligned")
+    (mkFlag swap16bitcspSupport "swap-16bit-csp")
+    (mkFlag experimentalSupport "experimental")
+    (mkFlag libwebpmuxSupport "libwebpmux")
+    (mkFlag libwebpdemuxSupport "libwebpdemux")
+    (mkFlag libwebpdecoderSupport "libwebpdecoder")
+  ];
+
+  nativeBuildInputs = [ autoreconfHook libtool ];
+  buildInputs = [ ]
+    ++ optionals openglSupport [ freeglut libGL libGLU ]
+    ++ optional pngSupport libpng
+    ++ optional jpegSupport libjpeg
+    ++ optional tiffSupport libtiff
+    ++ optional gifSupport giflib;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Tools and library for the WebP image format";
+    homepage = "https://developers.google.com/speed/webp/";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ codyopel ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libwebsockets/default.nix b/nixpkgs/pkgs/development/libraries/libwebsockets/default.nix
new file mode 100644
index 000000000000..777beb9bc14b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libwebsockets/default.nix
@@ -0,0 +1,67 @@
+{ fetchFromGitHub, lib, stdenv, cmake, openssl, zlib, libuv }:
+
+let
+  generic = { version, sha256 }: stdenv.mkDerivation rec {
+    pname = "libwebsockets";
+    inherit version;
+
+    src = fetchFromGitHub {
+      owner = "warmcat";
+      repo = "libwebsockets";
+      rev = "v${version}";
+      inherit sha256;
+    };
+
+    buildInputs = [ openssl zlib libuv ];
+
+    nativeBuildInputs = [ cmake ];
+
+    cmakeFlags = [
+      "-DLWS_WITH_PLUGINS=ON"
+      "-DLWS_WITH_IPV6=ON"
+      "-DLWS_WITH_SOCKS5=ON"
+      # Required since v4.2.0
+      "-DLWS_BUILD_HASH=no_hash"
+    ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "-DLWS_WITHOUT_TESTAPPS=ON";
+
+    NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=unused-but-set-variable";
+
+    postInstall = ''
+      rm -r ${placeholder "out"}/share/libwebsockets-test-server
+    '';
+
+    # $out/share/libwebsockets-test-server/plugins/libprotocol_*.so refers to crtbeginS.o
+    disallowedReferences = [ stdenv.cc.cc ];
+
+    meta = with lib; {
+      description = "Light, portable C library for websockets";
+      longDescription = ''
+        Libwebsockets is a lightweight pure C library built to
+        use minimal CPU and memory resources, and provide fast
+        throughput in both directions.
+      '';
+      homepage = "https://libwebsockets.org/";
+      # Relicensed from LGPLv2.1+ to MIT with 4.0. Licensing situation
+      # is tricky, see https://github.com/warmcat/libwebsockets/blob/main/LICENSE
+      license = with licenses; [ mit publicDomain bsd3 asl20 ];
+      maintainers = with maintainers; [ mindavi ];
+      platforms = platforms.all;
+    };
+  };
+
+in {
+  libwebsockets_3_1 = generic {
+    sha256 = "1w1wz6snf3cmcpa3f4dci2nz9za2f5rrylxl109id7bcb36xhbdl";
+    version = "3.1.0";
+  };
+
+  libwebsockets_3_2 = generic {
+    version = "3.2.2";
+    sha256 = "0m1kn4p167jv63zvwhsvmdn8azx3q7fkk8qc0fclwyps2scz6dna";
+  };
+
+  libwebsockets_4_2 = generic {
+    version = "4.2.1";
+    sha256 = "sha256-C+WGfNF4tAgbp/7aRraBgjNOe4I5ihm+8CGelXzfxbU=";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libwhereami/default.nix b/nixpkgs/pkgs/development/libraries/libwhereami/default.nix
new file mode 100644
index 000000000000..d0dd593a03dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libwhereami/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, cmake, boost, curl, leatherman }:
+
+stdenv.mkDerivation rec {
+  pname = "libwhereami";
+  version = "0.5.0";
+
+  src = fetchFromGitHub {
+    sha256 = "05fc28dri2h858kxbvldk5b6wd5is3fjcdsiqj3nxf95i66bb3xp";
+    rev = version;
+    repo = "libwhereami";
+    owner = "puppetlabs";
+  };
+
+  NIX_CFLAGS_COMPILE = "-Wno-error";
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ boost curl leatherman ];
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "Library to report hypervisor information from inside a VM";
+    license = licenses.asl20;
+    maintainers = [ maintainers.womfoo ];
+    platforms = with platforms; [ "i686-linux" "x86_64-linux" "x86_64-darwin" ]; # fails on aarch64
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/libwmf/default.nix b/nixpkgs/pkgs/development/libraries/libwmf/default.nix
new file mode 100644
index 000000000000..e955fee57207
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libwmf/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config
+, freetype, glib, imagemagick, libjpeg, libpng, libxml2, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libwmf";
+  version = "0.2.12";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "caolanm";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0i2w5hg8mbgmgabxyd48qp1gx2mhk33hgr3jqvg72k0nhkd2jhf6";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ zlib imagemagick libpng glib freetype libjpeg libxml2 ];
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "WMF library from wvWare";
+    homepage = "http://wvware.sourceforge.net/libwmf.html";
+    downloadPage = "https://github.com/caolanm/libwmf/releases";
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libwnck/2.nix b/nixpkgs/pkgs/development/libraries/libwnck/2.nix
new file mode 100644
index 000000000000..fd7d80574a7d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libwnck/2.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, pkg-config, gtk2, intltool, xorg }:
+
+stdenv.mkDerivation rec {
+  pname = "libwnck";
+  version = "2.31.0";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "17isfjvrzgj5znld2a7zsk9vd39q9wnsysnw5jr8iz410z935xw3";
+  };
+
+  outputs = [ "out" "dev" "devdoc" ];
+  outputBin = "dev";
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ gtk2 intltool xorg.libX11 xorg.libXres ];
+  # ?another optional: startup-notification
+
+  configureFlags = [ "--disable-introspection" ]; # not needed anywhere AFAIK
+
+  meta = {
+    description = "A library for creating task lists and pagers";
+    homepage = "https://gitlab.gnome.org/GNOME/libwnck";
+    license = lib.licenses.lgpl21;
+    maintainers = with lib.maintainers; [ johnazoidberg ];
+    # ./xutils.h:31:10: fatal error: 'gdk/gdkx.h' file not found
+    # #include <gdk/gdkx.h>
+    broken = stdenv.isDarwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libwnck/default.nix b/nixpkgs/pkgs/development/libraries/libwnck/default.nix
new file mode 100644
index 000000000000..39a1d505b652
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libwnck/default.nix
@@ -0,0 +1,76 @@
+{ lib, stdenv
+, fetchurl
+, fetchpatch
+, meson
+, ninja
+, pkg-config
+, gtk-doc
+, docbook_xsl
+, docbook_xml_dtd_412
+, libX11
+, glib
+, gtk3
+, pango
+, cairo
+, libXres
+, libstartup_notification
+, gettext
+, gobject-introspection
+, gnome
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libwnck";
+  version = "3.36.0";
+
+  outputs = [ "out" "dev" "devdoc" ];
+  outputBin = "dev";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0pwjdhca9lz2n1gf9b60xf0m6ipf9snp8rqf9csj4pgdnd882l5w";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gettext
+    gobject-introspection
+    gtk-doc
+    docbook_xsl
+    docbook_xml_dtd_412
+  ];
+
+  buildInputs = [
+    libX11
+    libstartup_notification
+    pango
+    cairo
+    libXres
+  ];
+
+  propagatedBuildInputs = [
+    glib
+    gtk3
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=true"
+  ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      attrPath = "${pname}${lib.versions.major version}";
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "Library to manage X windows and workspaces (via pagers, tasklists, etc.)";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ liff ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libwnck/fix-pc-file.patch b/nixpkgs/pkgs/development/libraries/libwnck/fix-pc-file.patch
new file mode 100644
index 000000000000..42017a993b51
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libwnck/fix-pc-file.patch
@@ -0,0 +1,24 @@
+diff --git a/meson.build b/meson.build
+index 28799d8..047e523 100644
+--- a/meson.build
++++ b/meson.build
+@@ -72,11 +72,15 @@
+ pc_conf = configuration_data()
+ pc_conf.set('prefix', get_option('prefix'))
+ pc_conf.set('exec_prefix', '${prefix}')
+-pc_conf.set('libdir', '${exec_prefix}/' + get_option('libdir'))
+-pc_conf.set('includedir', '${prefix}/' + get_option('includedir'))
+-pc_conf.set('STARTUP_NOTIFICATION_PACKAGE', STARTUP_NOTIFICATION_PACKAGE)
++pc_conf.set('libdir', '${exec_prefix}' / get_option('libdir'))
++pc_conf.set('includedir', '${prefix}' / get_option('includedir'))
++if conf.has('HAVE_' + STARTUP_NOTIFICATION_PACKAGE.to_upper().underscorify())
++  pc_conf.set('STARTUP_NOTIFICATION_PACKAGE', STARTUP_NOTIFICATION_PACKAGE)
++endif
+ pc_conf.set('X11_PACKAGE', X11_PACKAGE)
+-pc_conf.set('XRES_PACKAGE', XRES_PACKAGE)
++if conf.has('HAVE_' + XRES_PACKAGE.to_upper().underscorify())
++  pc_conf.set('XRES_PACKAGE', XRES_PACKAGE)
++endif
+ pc_conf.set('VERSION', meson.project_version())
+ 
+ foreach pc: [PACKAGE_NAME, PACKAGE_NAME + '-uninstalled']
diff --git a/nixpkgs/pkgs/development/libraries/libwpd/0.8.nix b/nixpkgs/pkgs/development/libraries/libwpd/0.8.nix
new file mode 100644
index 000000000000..df21f2640966
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libwpd/0.8.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, pkg-config, glib, libgsf, libxml2, bzip2 }:
+
+stdenv.mkDerivation rec {
+  name = "libwpd-0.8.14";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libwpd/${name}.tar.gz";
+    sha256 = "1syli6i5ma10cwzpa61a18pyjmianjwsf6pvmvzsh5md6yk4yx01";
+  };
+
+  patches = [ ./gcc-0.8.patch ];
+
+  buildInputs = [ glib libgsf libxml2 ];
+
+  nativeBuildInputs = [ pkg-config bzip2 ];
+
+  meta = with lib; {
+    description = "Library for importing WordPerfect documents";
+    homepage = "http://libwpd.sourceforge.net";
+    license = with licenses; [ lgpl21 mpl20 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libwpd/default.nix b/nixpkgs/pkgs/development/libraries/libwpd/default.nix
new file mode 100644
index 000000000000..8afe549cb68f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libwpd/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, zlib, pkg-config, glib, libgsf, libxml2, librevenge }:
+
+stdenv.mkDerivation rec {
+  name = "libwpd-0.10.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libwpd/${name}.tar.xz";
+    sha256 = "0b6krzr6kxzm89g6bapn805kdayq70hn16n5b5wfs2lwrf0ag2wx";
+  };
+
+  buildInputs = [ glib libgsf libxml2 zlib librevenge ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  meta = with lib; {
+    description = "A library for importing and exporting WordPerfect documents";
+    homepage = "http://libwpd.sourceforge.net/";
+    license = licenses.lgpl21;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libwpd/gcc-0.8.patch b/nixpkgs/pkgs/development/libraries/libwpd/gcc-0.8.patch
new file mode 100644
index 000000000000..05eb3293ed7c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libwpd/gcc-0.8.patch
@@ -0,0 +1,13 @@
+diff --git a/src/lib/WPXTable.h b/src/lib/WPXTable.h
+index 6d1e921..0234ad7 100644
+--- a/src/lib/WPXTable.h
++++ b/src/lib/WPXTable.h
+@@ -76,7 +76,7 @@ public:
+ 	WPXTableList & operator=(const WPXTableList & tableList);
+ 	virtual ~WPXTableList();
+ 
+-	WPXTable * operator[](size_t i) { return (*m_tableList)[i]; }
++	WPXTable * operator[](std::size_t i) { return (*m_tableList)[i]; }
+ 	void add(WPXTable *table) { m_tableList->push_back(table); }
+ 
+ private:
diff --git a/nixpkgs/pkgs/development/libraries/libwpe/default.nix b/nixpkgs/pkgs/development/libraries/libwpe/default.nix
new file mode 100644
index 000000000000..1fcb91a7fb39
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libwpe/default.nix
@@ -0,0 +1,39 @@
+{ stdenv
+, lib
+, fetchurl
+, meson
+, pkg-config
+, libxkbcommon
+, libGL
+, ninja
+, libX11 }:
+
+stdenv.mkDerivation rec {
+  pname = "libwpe";
+  version = "1.10.1";
+
+  src = fetchurl {
+    url = "https://wpewebkit.org/releases/${pname}-${version}.tar.xz";
+    sha256 = "sha256-oyez/88jVtvoFIwdtLvcU1nX5xY9F39nVRqDk7FErfA=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    meson
+    ninja
+  ];
+
+  buildInputs = [
+    libxkbcommon
+    libGL
+    libX11
+  ];
+
+  meta = with lib; {
+    description = "General-purpose library for WPE WebKit";
+    license = licenses.bsd2;
+    homepage = "https://wpewebkit.org";
+    maintainers = with maintainers; [ matthewbauer ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libwpe/fdo.nix b/nixpkgs/pkgs/development/libraries/libwpe/fdo.nix
new file mode 100644
index 000000000000..6f9356a6ad88
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libwpe/fdo.nix
@@ -0,0 +1,52 @@
+{ stdenv
+, lib
+, fetchurl
+, meson
+, pkg-config
+, ninja
+, wayland
+, epoxy
+, glib
+, libwpe
+, libxkbcommon
+, libGL
+, libX11 }:
+
+stdenv.mkDerivation rec {
+  pname = "wpebackend-fdo";
+  version = "1.7.1";
+
+  src = fetchurl {
+    url = "https://wpewebkit.org/releases/${pname}-${version}.tar.xz";
+    sha256 = "1xf6akagvpyh0nyxkfijrx5avp6ravnivy28dhk64dsfx9rhm64v";
+  };
+
+  depsBuildBuild = [
+    pkg-config
+  ];
+
+  nativeBuildInputs = [
+    pkg-config
+    meson
+    ninja
+    wayland
+  ];
+
+  buildInputs = [
+    wayland
+    epoxy
+    glib
+    libwpe
+    libxkbcommon
+    libGL
+    libX11
+  ];
+
+  meta = with lib; {
+    description = "Freedesktop.org backend for WPE WebKit";
+    license = licenses.bsd2;
+    homepage = "https://wpewebkit.org";
+    maintainers = with maintainers; [ matthewbauer ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libwpg/default.nix b/nixpkgs/pkgs/development/libraries/libwpg/default.nix
new file mode 100644
index 000000000000..bf0df220935c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libwpg/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, pkg-config, libwpd, zlib, librevenge }:
+
+stdenv.mkDerivation rec {
+  pname = "libwpg";
+  version = "0.3.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libwpg/${pname}-${version}.tar.xz";
+    sha256 = "074x159immf139szkswv2zapnq75p7xk10dbha2p9193hgwggcwr";
+  };
+
+  buildInputs = [ libwpd zlib librevenge ];
+  nativeBuildInputs = [ pkg-config ];
+
+  meta = with lib; {
+    homepage = "http://libwpg.sourceforge.net";
+    description = "C++ library to parse WPG";
+    license = with licenses; [ lgpl21 mpl20 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libwps/default.nix b/nixpkgs/pkgs/development/libraries/libwps/default.nix
new file mode 100644
index 000000000000..7dd7153bae9f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libwps/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, boost, pkg-config, librevenge, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "libwps";
+  version = "0.4.12";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/libwps/${pname}-${version}.tar.bz2";
+    sha256 = "16c6vq6hhi5lcvgyb9dwarr3kz69l1g5fs39b2hwqhkwzx5igpcl";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ boost librevenge zlib ];
+
+  NIX_CFLAGS_COMPILE = "-Wno-error=implicit-fallthrough";
+
+  meta = with lib; {
+    homepage = "http://libwps.sourceforge.net/";
+    description = "Microsoft Works document format import filter library";
+    platforms = platforms.unix;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libx86/constants.patch b/nixpkgs/pkgs/development/libraries/libx86/constants.patch
new file mode 100644
index 000000000000..10fc829d6743
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libx86/constants.patch
@@ -0,0 +1,20 @@
+--- libx86/lrmi.c	2008-09-06 12:24:36.070136428 +0200
++++ libx86/lrmi.c	2008-09-06 12:28:10.584287458 +0200
+@@ -56,5 +56,17 @@
+ 
+ #if defined(__linux__)
++#ifndef TF_MASK
++#define TF_MASK X86_EFLAGS_TF
++#endif
++#ifndef IF_MASK
++#define IF_MASK X86_EFLAGS_IF
++#endif
++#ifndef IOPL_MASK
++#define IOPL_MASK X86_EFLAGS_IOPL
++#endif
++#ifndef VIF_MASK
++#define VIF_MASK X86_EFLAGS_VIF
++#endif
+ #define DEFAULT_VM86_FLAGS 	(IF_MASK | IOPL_MASK)
+ #elif defined(__NetBSD__) || defined(__FreeBSD__)
+ #define DEFAULT_VM86_FLAGS  (PSL_I | PSL_IOPL)
diff --git a/nixpkgs/pkgs/development/libraries/libx86/default.nix b/nixpkgs/pkgs/development/libraries/libx86/default.nix
new file mode 100644
index 000000000000..1abefa8f4374
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libx86/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libx86";
+  version = "1.1";
+  src = fetchurl {
+    url = "https://www.codon.org.uk/~mjg59/libx86/downloads/${pname}-${version}.tar.gz";
+    sha256 = "0j6h6bc02c6qi0q7c1ncraz4d1hkm5936r35rfsp4x1jrc233wav";
+  };
+  patches = [./constants.patch ./non-x86.patch ];
+
+  # using BACKEND=x86emu on 64bit systems fixes:
+  #  http://www.mail-archive.com/suspend-devel@lists.sourceforge.net/msg02355.html
+  makeFlags = [
+    "DESTDIR=$(out)"
+  ] ++ lib.optional (!stdenv.isi686) "BACKEND=x86emu";
+
+  preBuild = ''
+    sed -i lrmi.c -e 's@defined(__i386__)@(defined(__i386__) || defined(__x86_64__))@'
+    sed -e s@/usr@@ -i Makefile
+  '';
+
+  meta = with lib; {
+    description = "Real-mode x86 code emulator";
+    maintainers = with maintainers; [ raskin ];
+    platforms = [ "x86_64-linux" "i686-linux" ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libx86/non-x86.patch b/nixpkgs/pkgs/development/libraries/libx86/non-x86.patch
new file mode 100644
index 000000000000..286057c4ba87
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libx86/non-x86.patch
@@ -0,0 +1,38 @@
+diff -Naur libx86-1.1+ds1.orig/Makefile libx86-1.1+ds1/Makefile
+--- libx86-1.1+ds1.orig/Makefile	2008-05-19 12:28:59.000000000 +0300
++++ libx86-1.1+ds1/Makefile	2012-02-20 01:32:03.750068423 +0200
+@@ -5,6 +5,7 @@
+ ifeq ($(BACKEND),x86emu)
+ 	OBJECTS += thunk.o x86emu/decode.o x86emu/debug.o x86emu/fpu.o \
+ 	x86emu/ops.o x86emu/ops2.o x86emu/prim_ops.o x86emu/sys.o
++	CFLAGS += -DX86EMU -fno-delete-null-pointer-checks
+ else
+ 	OBJECTS += lrmi.o
+ endif
+diff -Naur libx86-1.1+ds1.orig/thunk.c libx86-1.1+ds1/thunk.c
+--- libx86-1.1+ds1.orig/thunk.c	2008-04-03 03:48:00.000000000 +0300
++++ libx86-1.1+ds1/thunk.c	2012-02-20 01:12:56.468820192 +0200
+@@ -32,6 +32,7 @@
+ #define TRUE 1
+ #define FALSE 0
+ 
++#ifndef X86EMU
+ #define __BUILDIO(bwl,bw,type) \
+ static inline void out##bwl##_local(unsigned long port, unsigned type value) {        __asm__ __volatile__("out" #bwl " %" #bw "0, %w1" : : "a"(value), "Nd"(port)); \
+ }\
+@@ -44,6 +45,15 @@
+ __BUILDIO(b,b,char)
+ __BUILDIO(w,w,short)
+ __BUILDIO(l,,int)
++#else
++/* use libc functions */
++#define inb_local inb
++#define inw_local inw
++#define inl_local inl
++#define outb_local outb
++#define outw_local outw
++#define outl_local outl
++#endif /* X86EMU */
+ 
+ 
+ char *mmap_addr = SHMERRORPTR;
diff --git a/nixpkgs/pkgs/development/libraries/libx86/src-for-default.nix b/nixpkgs/pkgs/development/libraries/libx86/src-for-default.nix
new file mode 100644
index 000000000000..b7e432d8109c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libx86/src-for-default.nix
@@ -0,0 +1,7 @@
+rec {
+   pname="libx86";
+   version="1.1";
+   hash="0j6h6bc02c6qi0q7c1ncraz4d1hkm5936r35rfsp4x1jrc233wav";
+   url="http://www.codon.org.uk/~mjg59/libx86/downloads/libx86-${version}.tar.gz";
+   advertisedUrl="http://www.codon.org.uk/~mjg59/libx86/downloads/libx86-${version}.tar.gz";
+}
diff --git a/nixpkgs/pkgs/development/libraries/libx86/src-info-for-default.nix b/nixpkgs/pkgs/development/libraries/libx86/src-info-for-default.nix
new file mode 100644
index 000000000000..9861e21f6559
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libx86/src-info-for-default.nix
@@ -0,0 +1,4 @@
+{
+  downloadPage = "http://www.codon.org.uk/~mjg59/libx86/downloads/?C=M;O=D";
+  baseName = "libx86";
+}
diff --git a/nixpkgs/pkgs/development/libraries/libx86emu/default.nix b/nixpkgs/pkgs/development/libraries/libx86emu/default.nix
new file mode 100644
index 000000000000..8f9669561d62
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libx86emu/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "libx86emu";
+  version = "3.1";
+
+  src = fetchFromGitHub {
+    owner = "wfeldt";
+    repo = "libx86emu";
+    rev = version;
+    sha256 = "104xqc6nj9rpi7knl3dfqvasf087hlz2n5yndb1iycw35a6j509b";
+  };
+
+  nativeBuildInputs = [ perl ];
+
+  postUnpack = "rm $sourceRoot/git2log";
+  patchPhase = ''
+    # VERSION is usually generated using Git
+    echo "${version}" > VERSION
+    substituteInPlace Makefile --replace "/usr" "/"
+  '';
+
+  buildFlags = [ "shared" ];
+  enableParallelBuilding = true;
+
+  installFlags = [ "DESTDIR=$(out)" "LIBDIR=/lib" ];
+
+  meta = with lib; {
+    description = "x86 emulation library";
+    license = licenses.bsd2;
+    homepage = "https://github.com/wfeldt/libx86emu";
+    maintainers = with maintainers; [ bobvanderlinden ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libxc/default.nix b/nixpkgs/pkgs/development/libraries/libxc/default.nix
new file mode 100644
index 000000000000..0680e4b832ce
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxc/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitLab, cmake, gfortran, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "libxc";
+  version = "5.1.5";
+
+  src = fetchFromGitLab {
+    owner = "libxc";
+    repo = "libxc";
+    rev = version;
+    sha256 = "0cy3x2zn1bldc5i0rzislfbc8h4nqgds445jkfqjv0d1shvdy0zn";
+  };
+
+  buildInputs = [ gfortran ];
+  nativeBuildInputs = [ perl cmake ];
+
+  preConfigure = ''
+    patchShebangs ./
+  '';
+
+  cmakeFlags = [ "-DENABLE_FORTRAN=ON" "-DBUILD_SHARED_LIBS=ON" ];
+
+  preCheck = ''
+    export LD_LIBRARY_PATH=$(pwd)
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Library of exchange-correlation functionals for density-functional theory";
+    homepage = "https://www.tddft.org/programs/Libxc/";
+    license = licenses.mpl20;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ markuskowa ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libxcomp/default.nix b/nixpkgs/pkgs/development/libraries/libxcomp/default.nix
new file mode 100644
index 000000000000..b66fe5c5a21a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxcomp/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, libjpeg, libpng, libX11, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "libxcomp";
+  version = "3.5.99.16";
+
+  src = fetchurl {
+    sha256 = "1m3z9w3h6qpgk265xf030w7lcs181jgw2cdyzshb7l97mn1f7hh2";
+    url = "https://code.x2go.org/releases/source/nx-libs/nx-libs-${version}-lite.tar.gz";
+  };
+
+  buildInputs = [ libjpeg libpng libX11 zlib ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  preAutoreconf = ''
+    cd nxcomp/
+    sed -i 's|/src/.libs/libXcomp.a|/src/.libs/libXcomp.la|' test/Makefile.am
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "NX compression library";
+    homepage = "http://wiki.x2go.org/doku.php/wiki:libs:nx-libs";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libxcrypt/default.nix b/nixpkgs/pkgs/development/libraries/libxcrypt/default.nix
new file mode 100644
index 000000000000..4df5bde22871
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxcrypt/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, pkg-config, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "libxcrypt";
+  version = "4.4.18";
+
+  src = fetchFromGitHub {
+    owner = "besser82";
+    repo = "libxcrypt";
+    rev = "v${version}";
+    sha256 = "4015bf1b3a2aab31da5a544424be36c1a0f0ffc1eaa219c0e7b048e4cdcbbfe1";
+  };
+
+  preConfigure = ''
+    patchShebangs autogen.sh
+    ./autogen.sh
+  '';
+
+  nativeBuildInputs = [ autoconf automake libtool pkg-config perl ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Extended crypt library for descrypt, md5crypt, bcrypt, and others";
+    homepage = "https://github.com/besser82/libxcrypt/";
+    platforms = platforms.all;
+    maintainers = with maintainers; [ dottedmag ];
+    license = licenses.lgpl21Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libxdg-basedir/default.nix b/nixpkgs/pkgs/development/libraries/libxdg-basedir/default.nix
new file mode 100644
index 000000000000..58a58f2726bd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxdg-basedir/default.nix
@@ -0,0 +1,24 @@
+{lib, stdenv, fetchurl, fetchpatch}:
+
+stdenv.mkDerivation rec {
+  name = "libxdg-basedir-1.2.0";
+  src = fetchurl {
+    url = "https://nevill.ch/libxdg-basedir/downloads/${name}.tar.gz";
+    sha256 = "2757a949618742d80ac59ee2f0d946adc6e71576406cdf798e6ced507708cdf4";
+  };
+
+  patches = [
+    # Overflow bug
+    (fetchpatch {
+      url = "https://github.com/devnev/libxdg-basedir/commit/14e000f696ef8b83264b0ca4407669bdb365fb23.patch";
+      sha256 = "0lpy1ijir0x0hhb0fz0w5vxy1wl1cw9kkd6gva0rkp41i6vrp2wq";
+    })
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/devnev/libxdg-basedir";
+    description = "Implementation of the XDG Base Directory specification";
+    license = licenses.mit;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libxkbcommon/default.nix b/nixpkgs/pkgs/development/libraries/libxkbcommon/default.nix
new file mode 100644
index 000000000000..8bec962c0aea
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxkbcommon/default.nix
@@ -0,0 +1,66 @@
+{ lib
+, stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, bison
+, doxygen
+, xkeyboard_config
+, libxcb
+, libxml2
+, python3
+, libX11
+  # To enable the "interactive-wayland" subcommand of xkbcli. This is the
+  # wayland equivalent of `xev` on X11.
+, withWaylandTools ? stdenv.isLinux
+, wayland
+, wayland-protocols
+, wayland-scanner
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libxkbcommon";
+  version = "1.3.0";
+
+  src = fetchurl {
+    url = "https://xkbcommon.org/download/${pname}-${version}.tar.xz";
+    sha256 = "0ysynzzgzd9jdrh1321r4bgw8wd5zljrlyn5y1a31g39xacf02bv";
+  };
+
+  outputs = [ "out" "dev" "doc" ];
+
+  depsBuildBuild = [ pkg-config ];
+  nativeBuildInputs = [ meson ninja pkg-config bison doxygen ]
+    ++ lib.optional withWaylandTools wayland-scanner;
+  buildInputs = [ xkeyboard_config libxcb libxml2 ]
+    ++ lib.optionals withWaylandTools [ wayland wayland-protocols ];
+  checkInputs = [ python3 ];
+
+  mesonFlags = [
+    "-Dxkb-config-root=${xkeyboard_config}/etc/X11/xkb"
+    "-Dxkb-config-extra-path=/etc/xkb" # default=$sysconfdir/xkb ($out/etc)
+    "-Dx-locale-root=${libX11.out}/share/X11/locale"
+    "-Denable-wayland=${lib.boolToString withWaylandTools}"
+  ];
+
+  doCheck = true;
+  preCheck = ''
+    patchShebangs ../test/
+  '';
+
+  meta = with lib; {
+    description = "A library to handle keyboard descriptions";
+    longDescription = ''
+      libxkbcommon is a keyboard keymap compiler and support library which
+      processes a reduced subset of keymaps as defined by the XKB (X Keyboard
+      Extension) specification. It also contains a module for handling Compose
+      and dead keys.
+    ''; # and a separate library for listing available keyboard layouts.
+    homepage = "https://xkbcommon.org";
+    changelog = "https://github.com/xkbcommon/libxkbcommon/blob/xkbcommon-${version}/NEWS";
+    license = licenses.mit;
+    maintainers = with maintainers; [ primeos ttuegel ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libxkbcommon/libxkbcommon_7.nix b/nixpkgs/pkgs/development/libraries/libxkbcommon/libxkbcommon_7.nix
new file mode 100644
index 000000000000..9f374c22c1e6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxkbcommon/libxkbcommon_7.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, pkg-config, bison, flex, xkeyboard_config, libxcb, libX11 }:
+
+stdenv.mkDerivation rec {
+  name = "libxkbcommon-0.7.2";
+
+  src = fetchurl {
+    url = "http://xkbcommon.org/download/${name}.tar.xz";
+    sha256 = "1n5rv5n210kjnkyrvbh04gfwaa7zrmzy1393p8nyqfw66lkxr918";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ bison flex xkeyboard_config libxcb ];
+
+  configureFlags = [
+    "--with-xkb-config-root=${xkeyboard_config}/etc/X11/xkb"
+    "--with-x-locale-root=${libX11.out}/share/X11/locale"
+  ];
+
+  preBuild = lib.optionalString stdenv.isDarwin ''
+    sed -i 's/,--version-script=.*$//' Makefile
+  '';
+
+  meta = with lib; {
+    description = "A library to handle keyboard descriptions";
+    homepage = "https://xkbcommon.org";
+    license = licenses.mit;
+    maintainers = with maintainers; [ ttuegel ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libxklavier/default.nix b/nixpkgs/pkgs/development/libraries/libxklavier/default.nix
new file mode 100644
index 000000000000..acf82886d466
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxklavier/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchgit, autoreconfHook, pkg-config, gtk-doc, xkeyboard_config, libxml2, xorg, docbook_xsl
+, glib, isocodes, gobject-introspection }:
+
+stdenv.mkDerivation rec {
+  pname = "libxklavier";
+  version = "5.4";
+
+  src = fetchgit {
+    url = "git://anongit.freedesktop.org/git/libxklavier";
+    rev = "${pname}-${version}";
+    sha256 = "1w1x5mrgly2ldiw3q2r6y620zgd89gk7n90ja46775lhaswxzv7a";
+  };
+
+  patches = [ ./honor-XKB_CONFIG_ROOT.patch ];
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  # TODO: enable xmodmap support, needs xmodmap DB
+  propagatedBuildInputs = with xorg; [ libX11 libXi xkeyboard_config libxml2 libICE glib libxkbfile isocodes ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config gtk-doc docbook_xsl ];
+
+  buildInputs = [ gobject-introspection ];
+
+  preAutoreconf = ''
+    export NOCONFIGURE=1
+    gtkdocize
+  '';
+
+  configureFlags = [
+    "--with-xkb-base=${xkeyboard_config}/etc/X11/xkb"
+    "--with-xkb-bin-base=${xorg.xkbcomp}/bin"
+    "--disable-xmodmap-support"
+    "--enable-gtk-doc"
+  ];
+
+  meta = with lib; {
+    description = "Library providing high-level API for X Keyboard Extension known as XKB";
+    homepage = "http://freedesktop.org/wiki/Software/LibXklavier";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.linux;
+  };
+}
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
new file mode 100644
index 000000000000..601c27c98eed
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxl/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libxl";
+  version = "3.9.4.3";
+
+  src = fetchurl {
+    url = "https://www.libxl.com/download/${pname}-lin-${version}.tar.gz";
+    sha256 = "sha256-U8hXoqBzjSGigOXc29LZQk3KrGiYvBPBJPg5qihcAsY=";
+  };
+
+  dontConfigure = true;
+  dontBuild = true;
+
+  installPhase = ''
+    mkdir $out
+    cp -rva include_c include_cpp license.txt $out/
+    cp -rva lib64 $out/lib
+  '';
+
+  meta = with lib; {
+    description = "A library for parsing Excel files";
+    homepage    = "https://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
new file mode 100644
index 000000000000..3b9c2768f45e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxls/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, unzip }:
+
+stdenv.mkDerivation rec {
+  pname = "libxls";
+  version = "1.6.2";
+
+  src = fetchurl {
+    url = "https://github.com/libxls/libxls/releases/download/v${version}/libxls-${version}.tar.gz";
+    sha256 = "sha256-XazDTZS/IRWSbIDG+2nk570u1kA9Uc/0kEGpQXL143E=";
+  };
+
+  nativeBuildInputs = [ unzip ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Extract Cell Data From Excel xls files";
+    homepage = "https://sourceforge.net/projects/libxls/";
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libxlsxwriter/default.nix b/nixpkgs/pkgs/development/libraries/libxlsxwriter/default.nix
new file mode 100644
index 000000000000..f1d4bd298ded
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxlsxwriter/default.nix
@@ -0,0 +1,46 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, minizip
+, python3
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libxlsxwriter";
+  version = "1.1.3";
+
+  src = fetchFromGitHub {
+    owner = "jmcnamara";
+    repo = "libxlsxwriter";
+    rev = "RELEASE_${version}";
+    sha256 = "sha256-j+tplk8Fdx92YKj7PnchMZWctVmBmNirUmDw5ADmJy0=";
+  };
+
+  nativeBuildInputs = [
+    python3.pkgs.pytest
+  ];
+
+  buildInputs = [
+    minizip
+    zlib
+  ];
+
+  makeFlags = [
+    "PREFIX=${placeholder "out"}"
+    "USE_SYSTEM_MINIZIP=1"
+  ];
+
+  doCheck = true;
+
+  checkTarget = "test";
+
+  meta = with lib; {
+    description = "C library for creating Excel XLSX files";
+    homepage = "https://libxlsxwriter.github.io/";
+    changelog = "https://github.com/jmcnamara/libxlsxwriter/blob/${src.rev}/Changes.txt";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ dotlambda ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libxmi/default.nix b/nixpkgs/pkgs/development/libraries/libxmi/default.nix
new file mode 100644
index 000000000000..2d2a0089c443
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxmi/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, libtool }:
+
+stdenv.mkDerivation rec {
+  pname = "libxmi";
+  version = "1.2";
+
+  src = fetchurl {
+    url = "mirror://gnu/libxmi/${pname}-${version}.tar.gz";
+    sha256 = "03d4ikh29l38rl1wavb0icw7m5pp7yilnv7bb2k8qij1dinsymlx";
+  };
+
+  # For the x86_64 GNU/Linux arch to be recognized by 'configure'
+  preConfigure = "cp ${libtool}/share/libtool/build-aux/config.sub .";
+
+  meta = {
+    description = "Library for rasterizing 2-D vector graphics";
+    homepage = "https://www.gnu.org/software/libxmi/";
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libxml2/default.nix b/nixpkgs/pkgs/development/libraries/libxml2/default.nix
new file mode 100644
index 000000000000..1b58b4539e46
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxml2/default.nix
@@ -0,0 +1,100 @@
+{ stdenv, lib, fetchurl, fetchpatch
+, zlib, xz, libintl, python, gettext, ncurses, findXMLCatalogs
+, pythonSupport ? enableShared && stdenv.buildPlatform == stdenv.hostPlatform
+, icuSupport ? false, icu ? null
+, enableShared ? stdenv.hostPlatform.libc != "msvcrt"
+, enableStatic ? !enableShared
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libxml2";
+  version = "2.9.12";
+
+  src = fetchurl {
+    url = "http://xmlsoft.org/sources/${pname}-${version}.tar.gz";
+    sha256 = "14hxwzmf5xqppx77z7i0ni9lpzg1a84dqpf8j8l1fvy570g6imn8";
+  };
+  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
+
+    # Work around lxml API misuse.
+    # https://gitlab.gnome.org/GNOME/libxml2/issues/255
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/libxml2/commit/85b1792e37b131e7a51af98a37f92472e8de5f3f.patch";
+      sha256 = "epqlNs2S0Zczox3KyCB6R2aJKh87lXydlZ0x6tLHweE=";
+    })
+  ];
+
+  outputs = [ "bin" "dev" "out" "man" "doc" ]
+    ++ lib.optional pythonSupport "py"
+    ++ lib.optional (enableStatic && enableShared) "static";
+
+  buildInputs = lib.optional pythonSupport python
+    ++ lib.optional (pythonSupport && python?isPy2 && python.isPy2) gettext
+    ++ lib.optional (pythonSupport && python?isPy3 && python.isPy3) ncurses
+    ++ lib.optional (stdenv.isDarwin &&
+                     pythonSupport && python?isPy2 && python.isPy2) libintl
+    # Libxml2 has an optional dependency on liblzma.  However, on impure
+    # platforms, it may end up using that from /usr/lib, and thus lack a
+    # RUNPATH for that, leading to undefined references for its users.
+    ++ lib.optional stdenv.isFreeBSD xz;
+
+  propagatedBuildInputs = [ zlib findXMLCatalogs ] ++ lib.optional icuSupport icu;
+
+  configureFlags = [
+    "--exec_prefix=$dev"
+    (lib.enableFeature enableStatic "static")
+    (lib.enableFeature enableShared "shared")
+    (lib.withFeature icuSupport "icu")
+    (lib.withFeatureAs pythonSupport "python" python)
+  ];
+
+  preConfigure = lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") ''
+    MACOSX_DEPLOYMENT_TARGET=10.16
+  '';
+
+  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.optional pythonSupport
+    "pythondir=\"${placeholder "py"}/lib/${python.libPrefix}/site-packages\"";
+
+  postFixup = ''
+    moveToOutput bin/xml2-config "$dev"
+    moveToOutput lib/xml2Conf.sh "$dev"
+    moveToOutput share/man/man1 "$bin"
+  '' + lib.optionalString (enableStatic && enableShared) ''
+    moveToOutput lib/libxml2.a "$static"
+  '';
+
+  passthru = { inherit version; pythonSupport = pythonSupport; };
+
+  meta = {
+    homepage = "http://xmlsoft.org/";
+    description = "An XML parsing library for C";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.all;
+    maintainers = [ lib.maintainers.eelco ];
+  };
+}
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
new file mode 100644
index 000000000000..b476edaf5e60
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxmlb/default.nix
@@ -0,0 +1,74 @@
+{ lib, stdenv
+, fetchFromGitHub
+, docbook_xml_dtd_43
+, docbook_xsl
+, glib
+, gobject-introspection
+, gtk-doc
+, meson
+, ninja
+, pkg-config
+, python3
+, shared-mime-info
+, nixosTests
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libxmlb";
+  version = "0.3.1";
+
+  outputs = [ "out" "lib" "dev" "devdoc" "installedTests" ];
+
+  src = fetchFromGitHub {
+    owner = "hughsie";
+    repo = "libxmlb";
+    rev = version;
+    sha256 = "sha256-4gJBmSbo5uGj12Y2Ov4gmS8nJshQxuBM9BAevY/lwjg=";
+  };
+
+  patches = [
+    ./installed-tests-path.patch
+  ];
+
+  nativeBuildInputs = [
+    docbook_xml_dtd_43
+    docbook_xsl
+    gobject-introspection
+    gtk-doc
+    meson
+    ninja
+    pkg-config
+    (python3.withPackages (pkgs: with pkgs; [ setuptools ]))
+    shared-mime-info
+  ];
+
+  buildInputs = [
+    glib
+  ];
+
+  mesonFlags = [
+    "--libexecdir=${placeholder "out"}/libexec"
+    "-Dgtkdoc=true"
+    "-Dinstalled_test_prefix=${placeholder "installedTests"}"
+  ];
+
+  preCheck = ''
+    export XDG_DATA_DIRS=$XDG_DATA_DIRS:${shared-mime-info}/share
+  '';
+
+  doCheck = true;
+
+  passthru = {
+    tests = {
+      installed-tests = nixosTests.installed-tests.libxmlb;
+    };
+  };
+
+  meta = with lib; {
+    description = "A library to help create and query binary XML blobs";
+    homepage = "https://github.com/hughsie/libxmlb";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libxmlb/installed-tests-path.patch b/nixpkgs/pkgs/development/libraries/libxmlb/installed-tests-path.patch
new file mode 100644
index 000000000000..4207e9a91d74
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxmlb/installed-tests-path.patch
@@ -0,0 +1,24 @@
+diff --git a/meson.build b/meson.build
+index 38486c9..c567613 100644
+--- a/meson.build
++++ b/meson.build
+@@ -110,8 +110,8 @@
+   prefix = get_option('prefix')
+   datadir = join_paths(prefix, get_option('datadir'))
+   libexecdir = join_paths(prefix, get_option('libexecdir'))
+-  installed_test_bindir = join_paths(libexecdir, 'installed-tests', meson.project_name())
+-  installed_test_datadir = join_paths(datadir, 'installed-tests', meson.project_name())
++  installed_test_bindir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests', meson.project_name())
++  installed_test_datadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests', meson.project_name())
+ endif
+ 
+ gio = dependency('gio-2.0', version : '>= 2.45.8')
+diff --git a/meson_options.txt b/meson_options.txt
+index 27e8cb6..74548ae 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -2,3 +2,4 @@
+ option('introspection', type : 'boolean', value : true, description : 'generate GObject Introspection data')
+ option('tests', type : 'boolean', value : true, description : 'enable tests')
+ option('stemmer', type : 'boolean', value : false, description : 'enable stemmer support')
++option('installed_test_prefix', type: 'string', value: '', description: 'Prefix for installed tests')
diff --git a/nixpkgs/pkgs/development/libraries/libxmlxx/default.nix b/nixpkgs/pkgs/development/libraries/libxmlxx/default.nix
new file mode 100644
index 000000000000..67c5a0794ed5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxmlxx/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, pkg-config, libxml2, glibmm, perl, gnome }:
+
+stdenv.mkDerivation rec {
+  pname = "libxml++";
+  version = "2.40.1";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1sb3akryklvh2v6m6dihdnbpf1lkx441v972q9hlz1sq6bfspm2a";
+  };
+
+  outputs = [ "out" "devdoc" ];
+
+  nativeBuildInputs = [ pkg-config perl ];
+
+  propagatedBuildInputs = [ libxml2 glibmm ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "http://libxmlplusplus.sourceforge.net/";
+    description = "C++ wrapper for the libxml2 XML parser library";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ phreedom ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libxmlxx/v3.nix b/nixpkgs/pkgs/development/libraries/libxmlxx/v3.nix
new file mode 100644
index 000000000000..41c842220c7d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxmlxx/v3.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, pkg-config, libxml2, glibmm, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "libxml++";
+  version = "3.0.1";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/libxml++/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "19kik79fmg61nv0by0a5f9wchrcfjwzvih4v2waw01hqflhqvp0r";
+  };
+
+  outputs = [ "out" "dev" "doc" "devdoc" ];
+
+  nativeBuildInputs = [ pkg-config perl ];
+
+  buildInputs = [ glibmm ];
+
+  propagatedBuildInputs = [ libxml2 ];
+
+  postFixup = ''
+    substituteInPlace $dev/lib/pkgconfig/libxml++-3.0.pc \
+      --replace 'docdir=''${datarootdir}' "docdir=$doc/share"
+  '';
+
+  meta = with lib; {
+    homepage = "http://libxmlplusplus.sourceforge.net/";
+    description = "C++ wrapper for the libxml2 XML parser library, version 3";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ loskutov ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libxmp/default.nix b/nixpkgs/pkgs/development/libraries/libxmp/default.nix
new file mode 100644
index 000000000000..47dfcab5a499
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxmp/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libxmp";
+  version = "4.5.0";
+
+  meta = with lib; {
+    description = "Extended module player library";
+    homepage    = "http://xmp.sourceforge.net/";
+    longDescription = ''
+      Libxmp is a library that renders module files to PCM data. It supports
+      over 90 mainstream and obscure module formats including Protracker (MOD),
+      Scream Tracker 3 (S3M), Fast Tracker II (XM), and Impulse Tracker (IT).
+    '';
+    license     = licenses.lgpl21Plus;
+    platforms   = platforms.all;
+  };
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xmp/libxmp/${pname}-${version}.tar.gz";
+    sha256 = "sha256-eEfSYhEtFOhEL0TlrG7Z3bylTCUShHILVjyFKzHybnU=";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libxnd/default.nix b/nixpkgs/pkgs/development/libraries/libxnd/default.nix
new file mode 100644
index 000000000000..1fac0d86d4c7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxnd/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, libndtypes
+}:
+
+stdenv.mkDerivation {
+  pname = "libxnd";
+  version = "unstable-2019-08-01";
+
+  src = fetchFromGitHub {
+    owner = "xnd-project";
+    repo = "xnd";
+    rev = "6f305cd40d90b4f3fc2fe51ae144b433d186a6cc";
+    sha256 = "1n31d64qwlc7m3qkzbafhp0dgrvgvkdx89ykj63kll7r1n3yk59y";
+  };
+
+  buildInputs = [ libndtypes ];
+
+  # Override linker with cc (symlink to either gcc or clang)
+  # Library expects to use cc for linking
+  configureFlags = [
+      # Override linker with cc (symlink to either gcc or clang)
+      # Library expects to use cc for linking
+      "LD=${stdenv.cc.targetPrefix}cc"
+      # needed for tests
+      "--with-includes=${libndtypes}/include"
+      "--with-libs=${libndtypes}/lib"
+  ];
+
+  # other packages which depend on libxnd seem to expect overflow.h, but
+  # it doesn't seem to be included in the installed headers. for now this
+  # works, but the generic name of the header could produce problems
+  # with collisions down the line.
+  postInstall = ''
+    cp libxnd/overflow.h $out/include/overflow.h
+  '';
+
+  doCheck = true;
+
+  meta = {
+    description = "C library for managing typed memory blocks and Python container module";
+    homepage = "https://xnd.io/";
+    license = lib.licenses.bsdOriginal;
+    maintainers = with lib.maintainers; [ costrouc ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libxslt/default.nix b/nixpkgs/pkgs/development/libraries/libxslt/default.nix
new file mode 100644
index 000000000000..eb23e16d653a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxslt/default.nix
@@ -0,0 +1,59 @@
+{ lib, stdenv, fetchurl
+, pkg-config
+, libxml2, findXMLCatalogs, gettext, python3, libgcrypt
+, cryptoSupport ? false
+, pythonSupport ? stdenv.buildPlatform == stdenv.hostPlatform
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libxslt";
+  version = "1.1.34";
+
+  src = fetchurl {
+    url = "http://xmlsoft.org/sources/${pname}-${version}.tar.gz";
+    sha256 = "0zrzz6kjdyavspzik6fbkpvfpbd25r2qg6py5nnjaabrsr3bvccq";
+  };
+
+  outputs = [ "bin" "dev" "out" "man" "doc" ] ++ lib.optional pythonSupport "py";
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  buildInputs = [ libxml2.dev ]
+    ++ lib.optional stdenv.isDarwin gettext
+    ++ lib.optionals pythonSupport [ libxml2.py python3 ]
+    ++ lib.optionals cryptoSupport [ libgcrypt ];
+
+  propagatedBuildInputs = [ findXMLCatalogs ];
+
+  configureFlags = [
+    "--without-debug"
+    "--without-mem-debug"
+    "--without-debugger"
+  ] ++ lib.optional pythonSupport "--with-python=${python3}"
+    ++ lib.optional (!cryptoSupport) "--without-crypto";
+
+  postFixup = ''
+    moveToOutput bin/xslt-config "$dev"
+    moveToOutput lib/xsltConf.sh "$dev"
+    moveToOutput share/man/man1 "$bin"
+  '' + lib.optionalString pythonSupport ''
+    mkdir -p $py/nix-support
+    echo ${libxml2.py} >> $py/nix-support/propagated-build-inputs
+    moveToOutput ${python3.libPrefix} "$py"
+  '';
+
+  passthru = {
+    inherit pythonSupport;
+  };
+
+  meta = with lib; {
+    homepage = "http://xmlsoft.org/XSLT/";
+    description = "A C library and tools to do XSL transformations";
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = [ maintainers.eelco ];
+    broken = !(pythonSupport -> libxml2.pythonSupport); # see #73102 for why this is not an assert
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libxsmm/default.nix b/nixpkgs/pkgs/development/libraries/libxsmm/default.nix
new file mode 100644
index 000000000000..21052df86307
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libxsmm/default.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, fetchFromGitHub, coreutils, gfortran, gnused
+, python3, util-linux, which
+
+, enableStatic ? stdenv.hostPlatform.isStatic
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libxsmm";
+  version = "1.16.1";
+
+  src = fetchFromGitHub {
+    owner = "hfp";
+    repo = "libxsmm";
+    rev = version;
+    sha256 = "1c1qj6hcdfx11bvilnly92vgk1niisd2bjw1s8vfyi2f7ws1wnp0";
+  };
+
+  nativeBuildInputs = [
+    coreutils
+    gfortran
+    gnused
+    python3
+    util-linux
+    which
+  ];
+
+  enableParallelBuilding = true;
+
+  dontConfigure = true;
+
+  makeFlags = let
+    static = if enableStatic then "1" else "0";
+  in [
+    "OMP=1"
+    "PREFIX=$(out)"
+    "STATIC=${static}"
+  ];
+
+  prePatch = ''
+    patchShebangs .
+  '';
+
+  meta = with lib; {
+    description = "Library targeting Intel Architecture for specialized dense and sparse matrix operations, and deep learning primitives";
+    license = licenses.bsd3;
+    homepage = "https://github.com/hfp/libxsmm";
+    platforms = platforms.linux;
+    maintainers = with lib.maintainers; [ chessai ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libyaml-cpp/default.nix b/nixpkgs/pkgs/development/libraries/libyaml-cpp/default.nix
new file mode 100644
index 000000000000..ebfe53b25138
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libyaml-cpp/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "libyaml-cpp";
+  version = "0.7.0";
+
+  src = fetchFromGitHub {
+    owner = "jbeder";
+    repo = "yaml-cpp";
+    rev = "yaml-cpp-${version}";
+    sha256 = "sha256-2tFWccifn0c2lU/U1WNg2FHrBohjx8CXMllPJCevaNk=";
+  };
+
+  # implement https://github.com/jbeder/yaml-cpp/commit/52a1378e48e15d42a0b755af7146394c6eff998c
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace 'option(YAML_BUILD_SHARED_LIBS "Build Shared Libraries" OFF)' \
+                'option(YAML_BUILD_SHARED_LIBS "Build yaml-cpp shared library" ''${BUILD_SHARED_LIBS})'
+  '';
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DYAML_CPP_BUILD_TESTS=OFF" ];
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "A YAML parser and emitter for C++";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ andir ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libyaml/default.nix b/nixpkgs/pkgs/development/libraries/libyaml/default.nix
new file mode 100644
index 000000000000..03e7e4715f88
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libyaml/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libyaml";
+  version = "0.2.5";
+
+  src = fetchFromGitHub {
+    owner = "yaml";
+    repo = "libyaml";
+    rev = version;
+    sha256 = "18zsnsxc53pans4a01cs4401a2cjk3qi098hi440pj4zijifgcsb";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = with lib; {
+    homepage = "https://pyyaml.org/";
+    description = "A YAML 1.1 parser and emitter written in C";
+    license = licenses.mit;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libykclient/default.nix b/nixpkgs/pkgs/development/libraries/libykclient/default.nix
new file mode 100644
index 000000000000..6aacfc5ea2fa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libykclient/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, help2man, curl }:
+
+stdenv.mkDerivation {
+  pname = "libykclient";
+  version = "unstable-2019-03-18";
+  src = fetchFromGitHub {
+    owner = "Yubico";
+    repo = "yubico-c-client";
+    rev = "ad9eda6aac4c3f81784607c30b971f4a050b5c2e";
+    sha256 = "01b19jgv2lypih6lhw9yjjsfl8q1ahl955vhr2ai8ccshh0050yj";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config help2man ];
+  buildInputs = [ curl ];
+
+  meta = with lib; {
+    description = "Yubikey C client library";
+    homepage = "https://developers.yubico.com/yubico-c-client";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libykneomgr/default.nix b/nixpkgs/pkgs/development/libraries/libykneomgr/default.nix
new file mode 100644
index 000000000000..7f314410667f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libykneomgr/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, pkg-config, pcsclite, libzip, help2man }:
+
+stdenv.mkDerivation rec {
+  pname = "libykneomgr";
+  version = "0.1.8";
+
+  src = fetchurl {
+    url = "https://developers.yubico.com/libykneomgr/Releases/${pname}-${version}.tar.gz";
+    sha256 = "12gqblz400kr11m1fdr1vvwr85lgy5v55zy0cf782whpk8lyyj97";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ pcsclite libzip help2man ];
+
+  configureFlags = [
+    "--with-backend=pcsc"
+  ];
+
+  meta = with lib; {
+    homepage = "https://developers.yubico.com/libykneomgr";
+    description = "A C library to interact with the CCID-part of the Yubikey NEO";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libytnef/default.nix b/nixpkgs/pkgs/development/libraries/libytnef/default.nix
new file mode 100644
index 000000000000..e46064ae56e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libytnef/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, lib, fetchFromGitHub, autoreconfHook }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "libytnef";
+  version = "1.9.3";
+
+  src = fetchFromGitHub {
+    owner = "Yeraze";
+    repo = "ytnef";
+    rev = "v${version}";
+    sha256 = "07h48s5qf08503pp9kafqbwipdqghiif22ghki7z8j67gyp04l6l";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = {
+    inherit (src.meta) homepage;
+    description = "Yeraze's TNEF Stream Reader - for winmail.dat files";
+    license = licenses.gpl2Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ fpletz ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libyubikey/default.nix b/nixpkgs/pkgs/development/libraries/libyubikey/default.nix
new file mode 100644
index 000000000000..3b05be00d905
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libyubikey/default.nix
@@ -0,0 +1,18 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "libyubikey";
+  version = "1.13";
+
+  src = fetchurl {
+    url = "https://developers.yubico.com/yubico-c/Releases/${pname}-${version}.tar.gz";
+    sha256 = "009l3k2zyn06dbrlja2d4p2vfnzjhlcqxi88v02mlrnb17mx1v84";
+  };
+
+  meta = with lib; {
+    homepage = "http://opensource.yubico.com/yubico-c/";
+    description = "C library for manipulating Yubico YubiKey One-Time Passwords (OTPs)";
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libzapojit/default.nix b/nixpkgs/pkgs/development/libraries/libzapojit/default.nix
new file mode 100644
index 000000000000..8acb5e858df8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libzapojit/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, pkg-config, glib, intltool, json-glib, librest, libsoup, gnome, gnome-online-accounts, gobject-introspection }:
+
+stdenv.mkDerivation rec {
+  pname = "libzapojit";
+  version = "0.0.3";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0zn3s7ryjc3k1abj4k55dr2na844l451nrg9s6cvnnhh569zj99x";
+  };
+
+  nativeBuildInputs = [ pkg-config intltool gobject-introspection ];
+  propagatedBuildInputs = [ glib json-glib librest libsoup gnome-online-accounts ]; # zapojit-0.0.pc
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "GObject wrapper for the SkyDrive and Hotmail REST APIs";
+    homepage = "https://wiki.gnome.org/Projects/Zapojit";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libzdb/default.nix b/nixpkgs/pkgs/development/libraries/libzdb/default.nix
new file mode 100644
index 000000000000..986f27e27c89
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libzdb/default.nix
@@ -0,0 +1,24 @@
+{lib, stdenv, fetchurl, sqlite}:
+
+stdenv.mkDerivation rec
+{
+  version = "3.2.2";
+  pname = "libzdb";
+
+  src = fetchurl
+  {
+    url = "https://www.tildeslash.com/libzdb/dist/libzdb-${version}.tar.gz";
+    sha256 = "1blmy7228649iscwlldrc1ldf31nhps1ps9xfv44ms0yxqhlw7nm";
+  };
+
+  buildInputs = [ sqlite ];
+
+  meta =
+  {
+    homepage = "http://www.tildeslash.com/libzdb/";
+    description = "A small, easy to use Open Source Database Connection Pool Library";
+    license = lib.licenses.gpl3;
+    platforms = lib.platforms.linux;
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libzen/default.nix b/nixpkgs/pkgs/development/libraries/libzen/default.nix
new file mode 100644
index 000000000000..1c7aa8c54b72
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libzen/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  version = "0.4.39";
+  pname = "libzen";
+  src = fetchurl {
+    url = "https://mediaarea.net/download/source/libzen/${version}/libzen_${version}.tar.bz2";
+    sha256 = "1rwaxmid9iv65n0y6xlcyxxydsvihjni9ldxpg6pbqz43amp49xx";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  configureFlags = [ "--enable-shared" ];
+
+  sourceRoot = "./ZenLib/Project/GNU/Library/";
+
+  preConfigure = "sh autogen.sh";
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Shared library for libmediainfo and mediainfo";
+    homepage = "https://mediaarea.net/";
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.devhell ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libzip/default.nix b/nixpkgs/pkgs/development/libraries/libzip/default.nix
new file mode 100644
index 000000000000..3620943d6c53
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libzip/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv
+, cmake
+, fetchurl
+, perl
+, zlib
+, groff
+, withBzip2 ? false
+, bzip2
+, withLZMA ? false
+, xz
+, withOpenssl ? false
+, openssl
+, withZstd ? false
+, zstd
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libzip";
+  version = "1.8.0";
+
+  src = fetchurl {
+    url = "https://libzip.org/download/${pname}-${version}.tar.gz";
+    sha256 = "17l3ygrnbszm3b99dxmw94wcaqpbljzg54h4c0y8ss8aij35bvih";
+  };
+
+  outputs = [ "out" "dev" "man" ];
+
+  nativeBuildInputs = [ cmake perl groff ];
+  propagatedBuildInputs = [ zlib ];
+  buildInputs = lib.optionals withLZMA [ xz ]
+    ++ lib.optionals withBzip2 [ bzip2 ]
+    ++ lib.optionals withOpenssl [ openssl ]
+    ++ lib.optionals withZstd [ zstd ];
+
+  preCheck = ''
+    # regress/runtest is a generated file
+    patchShebangs regress
+  '';
+
+  meta = with lib; {
+    homepage = "https://libzip.org/";
+    description = "A C library for reading, creating and modifying zip archives";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    changelog = "https://github.com/nih-at/libzip/blob/v${version}/NEWS.md";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libzmf/default.nix b/nixpkgs/pkgs/development/libraries/libzmf/default.nix
new file mode 100644
index 000000000000..7965c934df3e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libzmf/default.nix
@@ -0,0 +1,25 @@
+{lib, stdenv, fetchurl, boost, icu, libpng, librevenge, zlib, doxygen, pkg-config, cppunit}:
+
+stdenv.mkDerivation rec {
+  pname = "libzmf";
+  version = "0.0.2";
+
+  src = fetchurl {
+    url = "http://dev-www.libreoffice.org/src/libzmf/${pname}-${version}.tar.xz";
+    sha256 = "08mg5kmkjrmqrd8j5rkzw9vdqlvibhb1ynp6bmfxnzq5rcq1l197";
+  };
+
+  buildInputs = [ boost icu libpng librevenge zlib cppunit ];
+  nativeBuildInputs = [ doxygen pkg-config ];
+  configureFlags = [ "--disable-werror" ];
+
+  meta = {
+    description = "A library that parses the file format of Zoner Callisto/Draw documents";
+    license = lib.licenses.mpl20;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.unix;
+    homepage = "https://wiki.documentfoundation.org/DLP/Libraries/libzmf";
+    downloadPage = "http://dev-www.libreoffice.org/src/libzmf/";
+    updateWalker = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/libzra/default.nix b/nixpkgs/pkgs/development/libraries/libzra/default.nix
new file mode 100644
index 000000000000..3ebfc21095d1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libzra/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libzra";
+  version = "unstable-2020-09-11";
+
+  src = fetchFromGitHub {
+    owner = "zraorg";
+    repo = "zra";
+    rev = "57abf2774dfc4624f14a0bc5bba71f044ce54a38";
+    sha256 = "10rlqj6ma02005gdcp57wp48d6cg0vkbv4vl9ai0zlgxyx1g6kc4";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://github.com/zraorg/ZRA";
+    description = "Library for ZStandard random access";
+    platforms = platforms.all;
+    maintainers = [ maintainers.ivar ];
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/lief/default.nix b/nixpkgs/pkgs/development/libraries/lief/default.nix
new file mode 100644
index 000000000000..706408061907
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lief/default.nix
@@ -0,0 +1,70 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, python
+, cmake
+}:
+
+let
+  pyEnv = python.withPackages (ps: [ ps.setuptools ]);
+in
+stdenv.mkDerivation rec {
+  pname = "lief";
+  version = "0.11.5";
+
+  src = fetchFromGitHub {
+    owner = "lief-project";
+    repo = "LIEF";
+    rev = version;
+    sha256 = "sha256-crYFBeX+YaIvVAv3uvGEeNCg+ZbUryr0NacDG56TUGE=";
+  };
+
+  outputs = [ "out" "py" ];
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  # Not a propagatedBuildInput because only the $py output needs it; $out is
+  # just the library itself (e.g. C/C++ headers).
+  buildInputs = [
+    python
+  ];
+
+  dontUseCmakeConfigure = true;
+
+  buildPhase = ''
+    runHook preBuild
+
+    substituteInPlace setup.py \
+      --replace 'cmake_args = []' "cmake_args = [ \"-DCMAKE_INSTALL_PREFIX=$prefix\" ]"
+    ${pyEnv.interpreter} setup.py --sdk build --parallel=$NIX_BUILD_CORES
+
+    runHook postBuild
+  '';
+
+  # I was unable to find a way to build the library itself and have it install
+  # to $out, while also installing the Python bindings to $py without building
+  # the project twice (using cmake), so this is the best we've got. It uses
+  # something called CPack to create the tarball, but it's not obvious to me
+  # *how* that happens, or how to intercept it to just get the structured
+  # library output.
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out $py/nix-support
+    echo "${python}" >> $py/nix-support/propagated-build-inputs
+    tar xf build/*.tar.gz --directory $out --strip-components 1
+    ${pyEnv.interpreter} setup.py install --skip-build --root=/ --prefix=$py
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Library to Instrument Executable Formats";
+    homepage = "https://lief.quarkslab.com/";
+    license = [ licenses.asl20 ];
+    platforms = platforms.linux;
+    maintainers = [ maintainers.lassulus ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/lightning/default.nix b/nixpkgs/pkgs/development/libraries/lightning/default.nix
new file mode 100644
index 000000000000..5f8c71fa6aa3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lightning/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, libopcodes }:
+
+with lib;
+stdenv.mkDerivation rec {
+
+  pname = "lightning";
+  version = "2.1.3";
+
+  src = fetchurl {
+    url = "mirror://gnu/lightning/${pname}-${version}.tar.gz";
+    sha256 = "1jgxbq2cm51dzi3zhz38mmgwdcgs328mfl8iviw8dxn6dn36p1gd";
+  };
+
+  checkInputs = [ libopcodes ];
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://www.gnu.org/software/lightning/";
+    description = "Run-time code generation library";
+    longDescription = ''
+      GNU lightning is a library that generates assembly language code
+      at run-time; it is very fast, making it ideal for Just-In-Time
+      compilers, and it abstracts over the target CPU, as it exposes
+      to the clients a standardized RISC instruction set inspired by
+      the MIPS and SPARC chips.
+    '';
+    maintainers = [ maintainers.AndersonTorres ];
+    license = licenses.lgpl3Plus;
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/lightstep-tracer-cpp/default.nix b/nixpkgs/pkgs/development/libraries/lightstep-tracer-cpp/default.nix
new file mode 100644
index 000000000000..8ef4513a18dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lightstep-tracer-cpp/default.nix
@@ -0,0 +1,36 @@
+{ stdenv, lib, fetchFromGitHub, pkg-config, cmake
+, opentracing-cpp, protobuf
+, enableGrpc ? false, grpc, openssl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "lightstep-tracer-cpp";
+  version = "0.14.0";
+
+  src = fetchFromGitHub {
+    owner = "lightstep";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1xr11dm94qpbx3nxb7si7zy7hzg2akj01pyxkd8pzzbvmkmic16j";
+  };
+
+  nativeBuildInputs = [
+    cmake pkg-config
+  ];
+
+  buildInputs = [
+    opentracing-cpp protobuf
+  ] ++ lib.optionals enableGrpc [
+    grpc openssl
+  ];
+
+  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/";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ cstrahan ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/lime/default.nix b/nixpkgs/pkgs/development/libraries/lime/default.nix
new file mode 100644
index 000000000000..81ad3bd8103b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lime/default.nix
@@ -0,0 +1,37 @@
+{ bctoolbox
+, belle-sip
+, cmake
+, fetchFromGitLab
+, lib
+, soci
+, sqlite
+, stdenv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "lime";
+  version = "5.0.0";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.linphone.org";
+    owner = "public";
+    group = "BC";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-11vvvA+pud/eOyYsbRKVvGfiyhwdhNPfRQSfaquUro8=";
+  };
+
+  buildInputs = [ bctoolbox soci belle-sip sqlite ];
+  nativeBuildInputs = [ cmake ];
+
+  # Do not build static libraries
+  cmakeFlags = [ "-DENABLE_STATIC=NO" ];
+
+  meta = with lib; {
+    description = "End-to-end encryption library for instant messaging";
+    homepage = "http://www.linphone.org/technical-corner/lime";
+    license = licenses.gpl3Only;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/linbox/default.nix b/nixpkgs/pkgs/development/libraries/linbox/default.nix
new file mode 100644
index 000000000000..821edd333692
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/linbox/default.nix
@@ -0,0 +1,80 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, givaro
+, pkg-config
+, blas
+, lapack
+, fflas-ffpack
+, gmpxx
+, withSage ? false # sage support
+}:
+
+assert (!blas.isILP64) && (!lapack.isILP64);
+
+stdenv.mkDerivation rec {
+  pname = "linbox";
+  version = "1.6.3"; # TODO: Check postPatch script on update
+
+  src = fetchFromGitHub {
+    owner = "linbox-team";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "10j6dspbsq7d2l4q3y0c1l1xwmaqqba2fxg59q5bhgk9h5d7q571";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+  ];
+
+  buildInputs = [
+    givaro
+    blas
+    gmpxx
+    fflas-ffpack
+  ];
+
+  patches = [
+    # Remove inappropriate `const &` qualifiers on data members that can be
+    # modified via member functions.
+    # See also: https://github.com/linbox-team/linbox/pull/256
+    ./patches/linbox-pr256-part2.patch # TODO: Remove on 1.7.0 update
+  ];
+
+  postPatch = ''
+    # Remove @LINBOXSAGE_LIBS@ that is actually undefined.
+    # See also: https://github.com/linbox-team/linbox/pull/249
+    # TODO: Remove on 1.7.0 update
+    find . -type f -exec sed -e 's/@LINBOXSAGE_LIBS@//' -i {} \;
+  '';
+
+  configureFlags = [
+    "--with-blas-libs=-lblas"
+    "--disable-optimization"
+  ] ++ lib.optionals stdenv.isx86_64 [
+    # disable SIMD instructions (which are enabled *when available* by default)
+    "--${if stdenv.hostPlatform.sse3Support   then "enable" else "disable"}-sse3"
+    "--${if stdenv.hostPlatform.ssse3Support  then "enable" else "disable"}-ssse3"
+    "--${if stdenv.hostPlatform.sse4_1Support then "enable" else "disable"}-sse41"
+    "--${if stdenv.hostPlatform.sse4_2Support then "enable" else "disable"}-sse42"
+    "--${if stdenv.hostPlatform.avxSupport    then "enable" else "disable"}-avx"
+    "--${if stdenv.hostPlatform.avx2Support   then "enable" else "disable"}-avx2"
+    "--${if stdenv.hostPlatform.fmaSupport    then "enable" else "disable"}-fma"
+    "--${if stdenv.hostPlatform.fma4Support   then "enable" else "disable"}-fma4"
+  ] ++ lib.optionals withSage [
+    "--enable-sage"
+  ];
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "C++ library for exact, high-performance linear algebra";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+    homepage = "https://linalg.org/";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/linbox/patches/linbox-pr256-part2.patch b/nixpkgs/pkgs/development/libraries/linbox/patches/linbox-pr256-part2.patch
new file mode 100644
index 000000000000..ec8571a7d710
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/linbox/patches/linbox-pr256-part2.patch
@@ -0,0 +1,13 @@
+--- a/linbox/algorithms/det-rational.h
++++ b/linbox/algorithms/det-rational.h
+@@ -79,8 +79,8 @@
+ 	struct MyRationalModularDet {
+ 		const Blackbox &A;
+ 		const MyMethod &M;
+-		const Integer &mul;//multiplicative prec;
+-		const Integer &div;
++		Integer mul;//multiplicative prec;
++		Integer div;
+ 
+ 		MyRationalModularDet(const Blackbox& b, const MyMethod& n,
+ 				     const Integer & p1, const Integer & p2) :
diff --git a/nixpkgs/pkgs/development/libraries/linenoise-ng/default.nix b/nixpkgs/pkgs/development/libraries/linenoise-ng/default.nix
new file mode 100644
index 000000000000..d19d6748147c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/linenoise-ng/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "linenoise-ng";
+  version = "1.0.1";
+
+  src = fetchFromGitHub {
+    owner = "arangodb";
+    repo = "linenoise-ng";
+    rev = "v${version}";
+    sha256 = "176iz0kj0p8d8i3jqps4z8xkxwl3f1986q88i9xg5fvqgpzsxp20";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = {
+    homepage = "https://github.com/arangodb/linenoise-ng";
+    description = "A small, portable GNU readline replacement for Linux, Windows and MacOS which is capable of handling UTF-8 characters";
+    maintainers = with lib.maintainers; [ cstrahan ];
+    platforms = lib.platforms.all;
+    license = lib.licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/linenoise/create-pkg-config-file.sh b/nixpkgs/pkgs/development/libraries/linenoise/create-pkg-config-file.sh
new file mode 100755
index 000000000000..e3c38f05ab4c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/linenoise/create-pkg-config-file.sh
@@ -0,0 +1,13 @@
+cat <<EOF > linenoise.pc
+prefix=$out
+exec_prefix=\${prefix}
+libdir=\${exec_prefix}/lib
+includedir=\${prefix}/include
+
+Name: linenoise
+Description: A minimal, zero-config, BSD licensed, readline replacement.
+Requires:
+Version: 1.0.10
+Cflags: -I\${includedir}/ \${prefix}/src/linenoise.c
+
+EOF
diff --git a/nixpkgs/pkgs/development/libraries/linenoise/default.nix b/nixpkgs/pkgs/development/libraries/linenoise/default.nix
new file mode 100644
index 000000000000..d465b48a8f46
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/linenoise/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation {
+  pname = "linenoise";
+  version = "1.0.10";  # Its version 1.0 plus 10 commits
+
+  src = fetchFromGitHub {
+    owner = "antirez";
+    repo = "linenoise";
+    rev = "c894b9e59f02203dbe4e2be657572cf88c4230c3";
+    sha256 = "0wasql7ph5g473zxhc2z47z3pjp42q0dsn4gpijwzbxawid71b4w";
+  };
+
+  buildPhase = ./create-pkg-config-file.sh;
+
+  installPhase = ''
+    mkdir -p $out/{lib/pkgconfig,src,include}
+    cp linenoise.c $out/src/
+    cp linenoise.h $out/include/
+    cp linenoise.pc $out/lib/pkgconfig/
+  '';
+
+  meta = {
+    homepage = "https://github.com/antirez/linenoise";
+    description = "A minimal, zero-config, BSD licensed, readline replacement";
+    maintainers = with lib.maintainers; [ mpsyco ];
+    platforms = lib.platforms.unix;
+    license = lib.licenses.bsd2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/liquid-dsp/default.nix b/nixpkgs/pkgs/development/libraries/liquid-dsp/default.nix
new file mode 100644
index 000000000000..746771f44fe4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liquid-dsp/default.nix
@@ -0,0 +1,23 @@
+{lib, stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation {
+  pname = "liquid-dsp";
+  version = "20170307";
+
+  src = fetchFromGitHub {
+    owner = "jgaeddert";
+    repo = "liquid-dsp";
+    rev = "8c1978fa4f5662b8849fe712be716958f29cec0e";
+    sha256 = "0zpxvdsrw0vzzp3iaag3wh4z8ygl7fkswgjppp2fz2zhhqh93k2w";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = {
+    homepage = "https://liquidsdr.org/";
+    description = "Digital signal processing library for software-defined radios";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.unix;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/liquidfun/default.nix b/nixpkgs/pkgs/development/libraries/liquidfun/default.nix
new file mode 100644
index 000000000000..29531a299966
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/liquidfun/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, requireFile, cmake, libGLU, libGL, libX11, libXi }:
+
+let
+  sourceInfo = rec {
+    version="1.1.0";
+    name="liquidfun-${version}";
+    url="https://github.com/google/liquidfun/releases/download/v${version}/${name}";
+    hash="5011a000eacd6202a47317c489e44aa753a833fb562d970e7b8c0da9de01df86";
+  };
+in
+stdenv.mkDerivation {
+  src = requireFile {
+    url = sourceInfo.url;
+    sha256 = sourceInfo.hash;
+    name = sourceInfo.name + ".tar.gz";
+  };
+
+  inherit (sourceInfo) name version;
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libGLU libGL libX11 libXi ];
+
+  sourceRoot = "liquidfun/Box2D/";
+
+  preConfigurePhases = "preConfigure";
+
+  preConfigure = ''
+    sed -i Box2D/Common/b2Settings.h -e 's@b2_maxPolygonVertices .*@b2_maxPolygonVertices 15@'
+    substituteInPlace Box2D/CMakeLists.txt --replace "Common/b2GrowableStack.h" "Common/b2GrowableStack.h Common/b2GrowableBuffer.h"
+  '';
+
+  configurePhase = ''
+    mkdir Build
+    cd Build;
+    cmake -DBOX2D_INSTALL=ON -DBOX2D_BUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX=$out ..
+  '';
+
+  meta = {
+    description = "2D physics engine based on Box2D";
+    maintainers = with lib.maintainers;
+    [
+      qknight
+    ];
+    platforms = lib.platforms.linux;
+    hydraPlatforms = [];
+    license = lib.licenses.bsd2;
+    homepage = "https://google.github.io/liquidfun/";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/lirc/default.nix b/nixpkgs/pkgs/development/libraries/lirc/default.nix
new file mode 100644
index 000000000000..4544fd08aa50
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lirc/default.nix
@@ -0,0 +1,59 @@
+{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, pkg-config, help2man, python3,
+  alsa-lib, xlibsWrapper, libxslt, systemd, libusb-compat-0_1, libftdi1 }:
+
+stdenv.mkDerivation rec {
+  pname = "lirc";
+  version = "0.10.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/lirc/${pname}-${version}.tar.bz2";
+    sha256 = "1whlyifvvc7w04ahq07nnk1h18wc8j7c6wnvlb6mszravxh3qxcb";
+  };
+
+  # Fix installation of Python bindings
+  patches = [ (fetchpatch {
+    url = "https://sourceforge.net/p/lirc/tickets/339/attachment/0001-Fix-Python-bindings.patch";
+    sha256 = "088a39x8c1qd81qwvbiqd6crb2lk777wmrs8rdh1ga06lglyvbly";
+  }) ];
+
+  postPatch = ''
+    patchShebangs .
+
+    # fix overriding PYTHONPATH
+    sed -i 's,^PYTHONPATH *= *,PYTHONPATH := $(PYTHONPATH):,' \
+      Makefile.in
+    sed -i 's,PYTHONPATH=,PYTHONPATH=$(PYTHONPATH):,' \
+      doc/Makefile.in
+  '';
+
+  preConfigure = ''
+    # use empty inc file instead of a from linux kernel generated one
+    touch lib/lirc/input_map.inc
+  '';
+
+  nativeBuildInputs = [ autoreconfHook pkg-config help2man
+    (python3.withPackages (p: with p; [ pyyaml setuptools ])) ];
+
+  buildInputs = [ alsa-lib xlibsWrapper libxslt systemd libusb-compat-0_1 libftdi1 ];
+
+  configureFlags = [
+    "--sysconfdir=/etc"
+    "--localstatedir=/var"
+    "--with-systemdsystemunitdir=$(out)/lib/systemd/system"
+    "--enable-uinput" # explicit activation because build env has no uinput
+    "--enable-devinput" # explicit activation because build env has no /dev/input
+  ];
+
+  installFlags = [
+    "sysconfdir=$out/etc"
+    "localstatedir=$TMPDIR"
+  ];
+
+  meta = with lib; {
+    description = "Allows to receive and send infrared signals";
+    homepage = "https://www.lirc.org/";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ pSub ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/live555/default.nix b/nixpkgs/pkgs/development/libraries/live555/default.nix
new file mode 100644
index 000000000000..081fa2f175bb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/live555/default.nix
@@ -0,0 +1,63 @@
+{ stdenv, fetchurl, lib, darwin }:
+
+# Based on https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD
+stdenv.mkDerivation rec {
+  pname = "live555";
+  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 = "144y2wsfpaclkj7srx85f3y3parzn7vbjmzc2afc62wdsb9gn46d";
+  };
+
+  postPatch = ''
+    sed 's,/bin/rm,rm,g' -i genMakefiles
+    sed \
+      -e 's/$(INCLUDES) -I. -O2 -DSOCKLEN_T/$(INCLUDES) -I. -O2 -I. -fPIC -DRTSPCLIENT_SYNCHRONOUS_INTERFACE=1 -DSOCKLEN_T/g' \
+      -i config.linux
+  '' + lib.optionalString (stdenv ? glibc) ''
+    substituteInPlace liveMedia/include/Locale.hh \
+      --replace '<xlocale.h>' '<locale.h>'
+  '';
+
+  configurePhase = ''
+    runHook preConfigure
+
+    ./genMakefiles ${{
+      x86_64-darwin = "macosx";
+      i686-linux = "linux";
+      x86_64-linux = "linux-64bit";
+      aarch64-linux = "linux-64bit";
+    }.${stdenv.hostPlatform.system} or (throw "Unsupported platform ${stdenv.hostPlatform.system}")}
+
+    runHook postConfigure
+  '';
+
+  installPhase = ''
+    runHook preInstall
+
+    for dir in BasicUsageEnvironment groupsock liveMedia UsageEnvironment; do
+      install -dm755 $out/{bin,lib,include/$dir}
+      install -m644 $dir/*.a "$out/lib"
+      install -m644 $dir/include/*.h* "$out/include/$dir"
+    done
+
+    runHook postInstall
+  '';
+
+  nativeBuildInputs = lib.optional stdenv.isDarwin darwin.cctools;
+
+  enableParallelBuilding = true;
+
+  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/";
+    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
new file mode 100644
index 000000000000..0a3515db2622
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lmdb/default.nix
@@ -0,0 +1,62 @@
+{ lib, stdenv, fetchFromGitLab }:
+
+stdenv.mkDerivation rec {
+  pname = "lmdb";
+  version = "0.9.29";
+
+  src = fetchFromGitLab {
+    domain = "git.openldap.org";
+    owner = "openldap";
+    repo = "openldap";
+    rev = "LMDB_${version}";
+    sha256 = "19zq5s1amrv1fhw1aszcn2w2xjrk080l6jj5hc9f46yiqf98jjg3";
+  };
+
+  postUnpack = "sourceRoot=\${sourceRoot}/libraries/liblmdb";
+
+  patches = [ ./hardcoded-compiler.patch ];
+  patchFlags = [ "-p3" ];
+
+  outputs = [ "bin" "out" "dev" ];
+
+  makeFlags = [
+    "prefix=$(out)"
+    "CC=${stdenv.cc.targetPrefix}cc"
+    "AR=${stdenv.cc.targetPrefix}ar"
+  ]
+    ++ lib.optional stdenv.isDarwin "LDFLAGS=-Wl,-install_name,$(out)/lib/liblmdb.so";
+
+  doCheck = true;
+  checkTarget = "test";
+
+  postInstall = ''
+    moveToOutput bin "$bin"
+  ''
+    # add lmdb.pc (dynamic only)
+    + ''
+    mkdir -p "$dev/lib/pkgconfig"
+    cat > "$dev/lib/pkgconfig/lmdb.pc" <<EOF
+    Name: lmdb
+    Description: ${meta.description}
+    Version: ${version}
+
+    Cflags: -I$dev/include
+    Libs: -L$out/lib -llmdb
+    EOF
+  '';
+
+  meta = with lib; {
+    description = "Lightning memory-mapped database";
+    longDescription = ''
+      LMDB is an ultra-fast, ultra-compact key-value embedded data store
+      developed by Symas for the OpenLDAP Project. It uses memory-mapped files,
+      so it has the read performance of a pure in-memory database while still
+      offering the persistence of standard disk-based databases, and is only
+      limited to the size of the virtual address space.
+    '';
+    homepage = "https://symas.com/lmdb/";
+    maintainers = with maintainers; [ jb55 vcunat ];
+    license = licenses.openldap;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/lmdb/hardcoded-compiler.patch b/nixpkgs/pkgs/development/libraries/lmdb/hardcoded-compiler.patch
new file mode 100644
index 000000000000..ddb247b7f113
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lmdb/hardcoded-compiler.patch
@@ -0,0 +1,26 @@
+commit 029031a68873bc3784a8561bd8e049efbd34f9d0 (HEAD)
+Author: Vladimír Čunát <vcunat@gmail.com>
+Date:   Sun Apr 1 11:05:31 2018 +0200
+
+    make: gcc -> $(CC)
+
+diff --git a/libraries/liblmdb/Makefile b/libraries/liblmdb/Makefile
+index f254511..612484e 100644
+--- a/libraries/liblmdb/Makefile
++++ b/libraries/liblmdb/Makefile
+@@ -102,13 +102,13 @@ COV_OBJS=xmdb.o xmidl.o
+ 
+ coverage: xmtest
+ 	for i in mtest*.c [0-9]*.c; do j=`basename \$$i .c`; $(MAKE) $$j.o; \
+-		gcc -o x$$j $$j.o $(COV_OBJS) -pthread $(COV_FLAGS); \
++		$(CC) -o x$$j $$j.o $(COV_OBJS) -pthread $(COV_FLAGS); \
+ 		rm -rf testdb; mkdir testdb; ./x$$j; done
+ 	gcov xmdb.c
+ 	gcov xmidl.c
+ 
+ xmtest:	mtest.o xmdb.o xmidl.o
+-	gcc -o xmtest mtest.o xmdb.o xmidl.o -pthread $(COV_FLAGS)
++	$(CC) -o xmtest mtest.o xmdb.o xmidl.o -pthread $(COV_FLAGS)
+ 
+ xmdb.o: mdb.c lmdb.h midl.h
+ 	$(CC) $(CFLAGS) -fPIC $(CPPFLAGS) -O0 $(COV_FLAGS) -c mdb.c -o $@
diff --git a/nixpkgs/pkgs/development/libraries/lmdbxx/default.nix b/nixpkgs/pkgs/development/libraries/lmdbxx/default.nix
new file mode 100644
index 000000000000..4fc1573eea1a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lmdbxx/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv
+, fetchFromGitHub
+, lmdb }:
+
+stdenv.mkDerivation rec {
+  pname = "lmdbxx";
+  version = "1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "hoytech";
+    repo = "lmdbxx";
+    rev = version;
+    sha256 = "sha256-7CxQZdgHVvmof6wVR9Mzic6tg89XJT3Z1ICGRs7PZYo=";
+  };
+
+  buildInputs = [ lmdb ];
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = {
+    homepage = "https://github.com/hoytech/lmdbxx#readme";
+    description = "C++11 wrapper for the LMDB embedded B+ tree database library";
+    license = lib.licenses.unlicense;
+    maintainers = with lib.maintainers; [ fgaz ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/log4cplus/default.nix b/nixpkgs/pkgs/development/libraries/log4cplus/default.nix
new file mode 100644
index 000000000000..e9ef841b65d7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/log4cplus/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl }:
+
+let
+  name = "log4cplus-2.0.6";
+in
+stdenv.mkDerivation {
+  inherit name;
+
+  src = fetchurl {
+    url = "mirror://sourceforge/log4cplus/${name}.tar.bz2";
+    sha256 = "sha256-GpY6/Q+IPWLelGsYkn0jgFH9R5NuQV6r7/4rE5fxbso=";
+  };
+
+  meta = {
+    homepage = "http://log4cplus.sourceforge.net/";
+    description = "A port the log4j library from Java to C++";
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/log4cpp/default.nix b/nixpkgs/pkgs/development/libraries/log4cpp/default.nix
new file mode 100644
index 000000000000..f7a10d9c31d3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/log4cpp/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "log4cpp";
+  version = "1.1.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/log4cpp/${pname}-${version}.tar.gz";
+    sha256 = "07gmr3jyaf2239n9sp6h7hwdz1pv7b7aka8n06gmr2fnlmaymfrc";
+  };
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage    = "http://log4cpp.sourceforge.net/";
+    description = "A logging framework for C++ patterned after Apache log4j";
+    license     = licenses.lgpl21Plus;
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/log4cxx/default.nix b/nixpkgs/pkgs/development/libraries/log4cxx/default.nix
new file mode 100644
index 000000000000..aaf7ea5ee9c9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/log4cxx/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchurl, libtool, libxml2, cppunit, boost
+, apr, aprutil, db, expat
+}:
+
+stdenv.mkDerivation rec {
+  pname = "log4cxx";
+  version = "0.10.0";
+
+  src = fetchurl {
+    url = "http://apache.mirrors.hoobly.com/logging/log4cxx/${version}/apache-${pname}-${version}.tar.gz";
+    sha256 = "130cjafck1jlqv92mxbn47yhxd2ccwwnprk605c6lmm941i3kq0d";
+  };
+
+  patches = [
+    # adapted from upstream commit; will be fixed in next version
+    ./narrowing-fixes.patch
+  ];
+
+  postPatch = ''
+    sed -i -e '1,/^#include/ {
+      /^#include/i \
+        #include <cstdio> \
+        #include <cstdlib> \
+        #include <cstring>
+    }' src/examples/cpp/console.cpp \
+       src/main/cpp/inputstreamreader.cpp \
+       src/main/cpp/socketoutputstream.cpp
+  '' + lib.optionalString stdenv.isDarwin ''
+    sed -i 's/namespace std { class locale; }/#include <locale>/' src/main/include/log4cxx/helpers/simpledateformat.h
+    sed -i 's/\(#include <cctype>\)/\1\n#include <cstdlib>/' src/main/cpp/stringhelper.cpp
+  '';
+
+  buildInputs = [ libxml2 cppunit boost apr aprutil db expat ];
+  nativeBuildInputs = [ libtool ];
+
+  meta = {
+    homepage = "https://logging.apache.org/log4cxx/index.html";
+    description = "A logging framework for C++ patterned after Apache log4j";
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/log4cxx/narrowing-fixes.patch b/nixpkgs/pkgs/development/libraries/log4cxx/narrowing-fixes.patch
new file mode 100644
index 000000000000..e583e7661d1d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/log4cxx/narrowing-fixes.patch
@@ -0,0 +1,117 @@
+diff --git a/src/main/cpp/locationinfo.cpp b/src/main/cpp/locationinfo.cpp
+index e76ea29..bd22a1d 100644
+--- a/src/main/cpp/locationinfo.cpp
++++ b/src/main/cpp/locationinfo.cpp
+@@ -149,18 +149,21 @@ void LocationInfo::write(ObjectOutputStream& os, Pool& p) const {
+          os.writeNull(p);
+     } else {
+         char prolog[] = {
+-         0x72, 0x00, 0x21, 0x6F, 0x72, 0x67, 0x2E, 
+-         0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2E, 0x6C, 
+-         0x6F, 0x67, 0x34, 0x6A, 0x2E, 0x73, 0x70, 0x69, 
+-         0x2E, 0x4C, 0x6F, 0x63, 0x61, 0x74, 0x69, 0x6F, 
+-         0x6E, 0x49, 0x6E, 0x66, 0x6F, 0xED, 0x99, 0xBB, 
+-         0xE1, 0x4A, 0x91, 0xA5, 0x7C, 0x02, 0x00, 0x01, 
+-         0x4C, 0x00, 0x08, 0x66, 0x75, 0x6C, 0x6C, 0x49, 
+-         0x6E, 0x66, 0x6F, 
+-            0x74, 0x00, 0x12, 0x4C, 0x6A, 
+-                0x61, 0x76, 0x61, 0x2F, 0x6C, 0x61, 0x6E, 0x67, 
+-                0x2F, 0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x3B,
+-         0x78, 0x70 };
++         0x72,
++         0x00,
++         0x21, 0x6F, 0x72, 0x67, 0x2E, 0x61, 0x70, 0x61, 0x63, 0x68, 0x65, 0x2E,
++         0x6C, 0x6F, 0x67, 0x34, 0x6A, 0x2E, 0x73, 0x70, 0x69, 0x2E, 0x4C, 0x6F,
++         0x63, 0x61, 0x74, 0x69, 0x6F, 0x6E, 0x49, 0x6E, 0x66, 0x6F, static_cast<char>(0xED),
++         static_cast<char>(0x99), static_cast<char>(0xBB), static_cast<char>(0xE1),
++         0x4A, static_cast<char>(0x91), static_cast<char>(0xA5), 0x7C, 0x02,
++         0x00,
++         0x01, 0x4C,
++         0x00,
++         0x08, 0x66, 0x75, 0x6C, 0x6C, 0x49, 0x6E, 0x66, 0x6F, 0x74,
++         0x00,
++         0x12, 0x4C, 0x6A, 0x61, 0x76, 0x61, 0x2F, 0x6C, 0x61, 0x6E, 0x67, 0x2F,
++         0x53, 0x74, 0x72, 0x69, 0x6E, 0x67, 0x3B, 0x78, 0x70
++        };
+       os.writeProlog("org.apache.log4j.spi.LocationInfo", 2, prolog, sizeof(prolog), p);
+         char* line = p.itoa(lineNumber);
+         //
+diff --git a/src/main/cpp/loggingevent.cpp b/src/main/cpp/loggingevent.cpp
+index 1c0d4be..edbf40b 100644
+--- a/src/main/cpp/loggingevent.cpp
++++ b/src/main/cpp/loggingevent.cpp
+@@ -242,7 +242,7 @@ void LoggingEvent::writeProlog(ObjectOutputStream& os, Pool& p)  {
+         0x68, 0x65, 0x2E, 0x6C, 0x6F, 0x67, 0x34, 0x6A, 
+         0x2E, 0x73, 0x70, 0x69, 0x2E, 0x4C, 0x6F, 0x67, 
+         0x67, 0x69, 0x6E, 0x67, 0x45, 0x76, 0x65, 0x6E, 
+-        0x74, 0xF3, 0xF2, 0xB9, 0x23, 0x74, 0x0B, 0xB5, 
++        0x74, static_cast<char>(0xF3), static_cast<char>(0xF2), static_cast<char>(0xB9), 0x23, 0x74, 0x0B, static_cast<char>(0xB5), 
+         0x3F, 0x03, 0x00, 0x0A, 0x5A, 0x00, 0x15, 0x6D, 
+         0x64, 0x63, 0x43, 0x6F, 0x70, 0x79, 0x4C, 0x6F, 
+         0x6F, 0x6B, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 
+diff --git a/src/main/cpp/objectoutputstream.cpp b/src/main/cpp/objectoutputstream.cpp
+index 7cd696b..5442420 100644
+--- a/src/main/cpp/objectoutputstream.cpp
++++ b/src/main/cpp/objectoutputstream.cpp
+@@ -36,7 +36,7 @@ ObjectOutputStream::ObjectOutputStream(OutputStreamPtr outputStream, Pool& p)
+        objectHandle(0x7E0000),
+        classDescriptions(new ClassDescriptionMap())
+ {
+-   char start[] = { 0xAC, 0xED, 0x00, 0x05 };
++   char start[] = { static_cast<char>(0xAC), static_cast<char>(0xED), 0x00, 0x05 };
+    ByteBuffer buf(start, sizeof(start));
+    os->write(buf, p);
+ }
+@@ -81,15 +81,15 @@ void ObjectOutputStream::writeObject(const MDC::Map& val, Pool& p) {
+     //
+     //  TC_OBJECT and the classDesc for java.util.Hashtable
+     //
+-    char prolog[] = {
+-        0x72, 0x00, 0x13, 0x6A, 0x61, 0x76, 0x61, 
+-        0x2E, 0x75, 0x74, 0x69, 0x6C, 0x2E, 0x48, 0x61, 
+-        0x73, 0x68, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x13, 
+-        0xBB, 0x0F, 0x25, 0x21, 0x4A, 0xE4, 0xB8, 0x03, 
+-        0x00, 0x02, 0x46, 0x00, 0x0A, 0x6C, 0x6F, 0x61, 
+-        0x64, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x49, 
+-        0x00, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68, 
+-        0x6F, 0x6C, 0x64, 0x78, 0x70  };
++	char prolog[] = {
++		0x72, 0x00, 0x13, 0x6A, 0x61, 0x76, 0x61,
++		0x2E, 0x75, 0x74, 0x69, 0x6C, 0x2E, 0x48, 0x61,
++		0x73, 0x68, 0x74, 0x61, 0x62, 0x6C, 0x65, 0x13,
++		static_cast<char>(0xBB), 0x0F, 0x25, 0x21, 0x4A, static_cast<char>(0xE4), static_cast<char>(0xB8), 0x03,
++		0x00, 0x02, 0x46, 0x00, 0x0A, 0x6C, 0x6F, 0x61,
++		0x64, 0x46, 0x61, 0x63, 0x74, 0x6F, 0x72, 0x49,
++		0x00, 0x09, 0x74, 0x68, 0x72, 0x65, 0x73, 0x68,
++		0x6F, 0x6C, 0x64, 0x78, 0x70  };
+     writeProlog("java.util.Hashtable", 1, prolog, sizeof(prolog), p);
+     //
+     //   loadFactor = 0.75, threshold = 5, blockdata start, buckets.size = 7
+diff --git a/src/test/cpp/xml/domtestcase.cpp b/src/test/cpp/xml/domtestcase.cpp
+index a500628..29d67dd 100644
+--- a/src/test/cpp/xml/domtestcase.cpp
++++ b/src/test/cpp/xml/domtestcase.cpp
+@@ -190,9 +190,9 @@ public:
+                 DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase3.xml"));
+                 LOG4CXX_INFO(logger, "File name is expected to end with a superscript 3");
+ #if LOG4CXX_LOGCHAR_IS_UTF8
+-                const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xC2, 0xB3, 0 };
++                const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xC2), static_cast<logchar>(0xB3), 0 };
+ #else
+-                const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xB3, 0 };
++                const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xB3), 0 };
+ #endif
+                 File file;
+                 file.setPath(fname);
+@@ -209,9 +209,9 @@ public:
+                 DOMConfigurator::configure(LOG4CXX_TEST_STR("input/xml/DOMTestCase4.xml"));
+                 LOG4CXX_INFO(logger, "File name is expected to end with an ideographic 4");
+ #if LOG4CXX_LOGCHAR_IS_UTF8
+-                const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0xE3, 0x86, 0x95, 0 };
++                const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0xE3), static_cast<logchar>(0x86), static_cast<logchar>(0x95), 0 };
+ #else
+-                const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, 0x3195, 0 };
++                const logchar fname[] = { 0x6F, 0x75, 0x74, 0x70, 0x75, 0x74, 0x2F, 0x64, 0x6F, 0x6D, static_cast<logchar>(0x3195), 0 };
+ #endif
+                 File file;
+                 file.setPath(fname);
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/libraries/log4shib/default.nix b/nixpkgs/pkgs/development/libraries/log4shib/default.nix
new file mode 100644
index 000000000000..0602b4c3b523
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/log4shib/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchgit, autoreconfHook }:
+
+stdenv.mkDerivation {
+  pname = "log4shib";
+  version = "1.0.9";
+
+  src = fetchgit {
+    url = "https://git.shibboleth.net/git/cpp-log4shib.git";
+    rev = "a1afe19b7b49c32fcb03e6d72809501b8965cf85";
+    sha256 = "06rrc5l6qxlc8abzim2jcxwz2c577qrjqx15cbfqq1zfqagj9hix";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = with lib; {
+    description = "A forked version of log4cpp that has been created for the Shibboleth project";
+    maintainers = [ maintainers.jammerful ];
+    license = licenses.lgpl21;
+    homepage = "http://log4cpp.sf.net";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/loki/default.nix b/nixpkgs/pkgs/development/libraries/loki/default.nix
new file mode 100644
index 000000000000..49b850eae65b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/loki/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "loki";
+  version = "0.1.7";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/loki-lib/Loki/Loki%20${version}/loki-${version}.tar.gz";
+    sha256 = "1xhwna961fl4298ac5cc629x5030zlw31vx4h8zws290amw5860g";
+  };
+
+  buildPhase = ''
+    substituteInPlace Makefile.common --replace /usr $out
+    make build-shared
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A C++ library of designs, containing flexible implementations of common design patterns and idioms";
+    homepage = "http://loki-lib.sourceforge.net";
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ peterhoeg ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/loudmouth/default.nix b/nixpkgs/pkgs/development/libraries/loudmouth/default.nix
new file mode 100644
index 000000000000..a8d9b23cc84c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/loudmouth/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, openssl, libidn, glib, pkg-config, zlib }:
+
+stdenv.mkDerivation rec {
+  version = "1.5.3";
+  pname = "loudmouth";
+
+  src = fetchurl {
+    url = "https://mcabber.com/files/loudmouth/${pname}-${version}.tar.bz2";
+    sha256 = "0b6kd5gpndl9nzis3n6hcl0ldz74bnbiypqgqa1vgb0vrcar8cjl";
+  };
+
+  patches = [
+  ];
+
+  configureFlags = [ "--with-ssl=openssl" ];
+
+  propagatedBuildInputs = [ openssl libidn glib zlib ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  meta = with lib; {
+    description = "A lightweight C library for the Jabber protocol";
+    platforms = platforms.all;
+    downloadPage = "http://mcabber.com/files/loudmouth/";
+    downloadURLRegexp = "loudmouth-[0-9.]+[.]tar[.]bz2$";
+    updateWalker = true;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/loudmouth/glib-2.32.patch b/nixpkgs/pkgs/development/libraries/loudmouth/glib-2.32.patch
new file mode 100644
index 000000000000..87fc170c80da
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/loudmouth/glib-2.32.patch
@@ -0,0 +1,13 @@
+Index: loudmouth-1.4.3/loudmouth/lm-error.c
+===================================================================
+--- loudmouth-1.4.3.orig/loudmouth/lm-error.c
++++ loudmouth-1.4.3/loudmouth/lm-error.c
+@@ -19,7 +19,7 @@
+  */
+ 
+ #include <config.h>
+-#include <glib/gerror.h>
++#include <glib.h>
+ #include "lm-error.h"
+ 
+ /**
diff --git a/nixpkgs/pkgs/development/libraries/lrdf/default.nix b/nixpkgs/pkgs/development/libraries/lrdf/default.nix
new file mode 100644
index 000000000000..bd78a4329a59
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lrdf/default.nix
@@ -0,0 +1,36 @@
+{ config, lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook
+, librdf_raptor2, ladspaH, openssl, zlib
+, doCheck ? config.doCheckByDefault or false, ladspaPlugins
+}:
+
+stdenv.mkDerivation rec {
+  pname = "lrdf";
+  version = "0.6.1";
+
+  src = fetchFromGitHub {
+    owner = "swh";
+    repo = "LRDF";
+    rev = "v${version}";
+    sha256 = "00wzkfb8y0aqd519ypz067cq099dpc89w69zw8ln39vl6f9x2pd4";
+  };
+
+  postPatch = lib.optionalString doCheck ''
+    sed -i -e 's:usr/local:${ladspaPlugins}:' examples/{instances,remove}_test.c
+  '';
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  propagatedBuildInputs = [ librdf_raptor2 ];
+
+  inherit doCheck;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Lightweight RDF library with special support for LADSPA plugins";
+    homepage = "https://sourceforge.net/projects/lrdf/";
+    license = lib.licenses.gpl2;
+    maintainers = [ lib.maintainers.marcweber ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/luabind/0.9.1_boost_1.57_fix.patch b/nixpkgs/pkgs/development/libraries/luabind/0.9.1_boost_1.57_fix.patch
new file mode 100644
index 000000000000..7ac495777b54
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/luabind/0.9.1_boost_1.57_fix.patch
@@ -0,0 +1,23 @@
+diff --git a/luabind/object.hpp b/luabind/object.hpp
+index f7b7ca5..1c18e04 100644
+--- a/luabind/object.hpp
++++ b/luabind/object.hpp
+@@ -536,6 +536,8 @@ namespace detail
+       handle m_key;
+   };
+ 
++#if BOOST_VERSION < 105700
++
+ // Needed because of some strange ADL issues.
+ 
+ #define LUABIND_OPERATOR_ADL_WKND(op) \
+@@ -557,7 +559,8 @@ namespace detail
+   LUABIND_OPERATOR_ADL_WKND(!=)
+ 
+ #undef LUABIND_OPERATOR_ADL_WKND
+- 
++
++#endif // BOOST_VERSION < 105700 
+ } // namespace detail
+ 
+ namespace adl
diff --git a/nixpkgs/pkgs/development/libraries/luabind/0.9.1_discover_luajit.patch b/nixpkgs/pkgs/development/libraries/luabind/0.9.1_discover_luajit.patch
new file mode 100644
index 000000000000..6e5fe6aa6f82
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/luabind/0.9.1_discover_luajit.patch
@@ -0,0 +1,22 @@
+diff --git a/Jamroot b/Jamroot
+index 94494bf..83dfcbb 100755
+--- a/Jamroot
++++ b/Jamroot
+@@ -64,7 +64,7 @@ else if [ os.name ] in LINUX MACOSX FREEBSD
+         $(LUA_PATH) $(HOME)/Library/Frameworks /Library/Frameworks /usr /usr/local /opt/local /opt ;
+ 
+     local possible-suffixes =
+-        include/lua5.1 include/lua51 include/lua include ;
++        include/lua5.1 include/lua51 include/lua include include/luajit-2.0 ;
+ 
+     local includes = [ GLOB $(possible-prefixes)/$(possible-suffixes) : lua.h ] ;
+ 
+@@ -83,7 +83,7 @@ else if [ os.name ] in LINUX MACOSX FREEBSD
+ 
+     local lib = $(prefix)/lib ;
+ 
+-    local names = liblua5.1 liblua51 liblua ;
++    local names = liblua5.1 liblua51 liblua libluajit-5.1 ;
+     local extensions = .a .so ;
+ 
+     library = [ GLOB $(lib)/lua51 $(lib)/lua5.1 $(lib)/lua $(lib) :
diff --git a/nixpkgs/pkgs/development/libraries/luabind/0.9.1_modern_boost_fix.patch b/nixpkgs/pkgs/development/libraries/luabind/0.9.1_modern_boost_fix.patch
new file mode 100644
index 000000000000..92e32828a03c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/luabind/0.9.1_modern_boost_fix.patch
@@ -0,0 +1,59 @@
+diff --git luabind-0.9.1/luabind/detail/call_function.hpp luabind-0.9.1-fixed/luabind/detail/call_function.hpp
+index 1b45ec1..8f5afff 100644
+--- luabind-0.9.1/luabind/detail/call_function.hpp
++++ luabind-0.9.1-fixed/luabind/detail/call_function.hpp
+@@ -323,7 +323,8 @@ namespace luabind
+ 
+ #endif // LUABIND_CALL_FUNCTION_HPP_INCLUDED
+ 
+-#elif BOOST_PP_ITERATION_FLAGS() == 1
++#else
++#if BOOST_PP_ITERATION_FLAGS() == 1
+ 
+ #define LUABIND_TUPLE_PARAMS(z, n, data) const A##n *
+ #define LUABIND_OPERATOR_PARAMS(z, n, data) const A##n & a##n
+@@ -440,4 +441,5 @@ namespace luabind
+ 
+ 
+ #endif
++#endif
+ 
+diff --git luabind-0.9.1/luabind/detail/call_member.hpp luabind-0.9.1-fixed/luabind/detail/call_member.hpp
+index de8d563..e63555b 100644
+--- luabind-0.9.1/luabind/detail/call_member.hpp
++++ luabind-0.9.1-fixed/luabind/detail/call_member.hpp
+@@ -316,7 +316,8 @@ namespace luabind
+ 
+ #endif // LUABIND_CALL_MEMBER_HPP_INCLUDED
+ 
+-#elif BOOST_PP_ITERATION_FLAGS() == 1
++#else
++#if BOOST_PP_ITERATION_FLAGS() == 1
+ 
+ #define LUABIND_TUPLE_PARAMS(z, n, data) const A##n *
+ #define LUABIND_OPERATOR_PARAMS(z, n, data) const A##n & a##n
+@@ -360,4 +361,5 @@ namespace luabind
+ #undef LUABIND_TUPLE_PARAMS
+ 
+ #endif
++#endif
+ 
+diff --git luabind-0.9.1/luabind/wrapper_base.hpp luabind-0.9.1-fixed/luabind/wrapper_base.hpp
+index d54c668..0f88cc5 100755
+--- luabind-0.9.1/luabind/wrapper_base.hpp
++++ luabind-0.9.1-fixed/luabind/wrapper_base.hpp
+@@ -89,7 +89,8 @@ namespace luabind
+ 
+ #endif // LUABIND_WRAPPER_BASE_HPP_INCLUDED
+ 
+-#elif BOOST_PP_ITERATION_FLAGS() == 1
++#else
++#if BOOST_PP_ITERATION_FLAGS() == 1
+ 
+ #define LUABIND_TUPLE_PARAMS(z, n, data) const A##n *
+ #define LUABIND_OPERATOR_PARAMS(z, n, data) const A##n & a##n
+@@ -188,3 +189,4 @@ namespace luabind
+ #undef N
+ 
+ #endif
++#endif
diff --git a/nixpkgs/pkgs/development/libraries/luabind/default.nix b/nixpkgs/pkgs/development/libraries/luabind/default.nix
new file mode 100644
index 000000000000..d7aed656fdb9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/luabind/default.nix
@@ -0,0 +1,31 @@
+{lib, stdenv, fetchurl, boost-build, lua, boost}:
+
+stdenv.mkDerivation {
+  name = "luabind-0.9.1";
+
+  src = fetchurl {
+    url = "https://github.com/luabind/luabind/archive/v0.9.1.tar.gz";
+    sha256 = "0e5ead50a07668d29888f2fa6f53220f900c886e46a2c99c7e8656842f05ff2d";
+  };
+
+  patches = [ ./0.9.1_modern_boost_fix.patch ./0.9.1_boost_1.57_fix.patch ./0.9.1_discover_luajit.patch ];
+
+  buildInputs = [ boost-build lua boost ];
+
+  propagatedBuildInputs = [ lua ];
+
+  buildPhase = "LUA_PATH=${lua} bjam release";
+
+  installPhase = "LUA_PATH=${lua} bjam --prefix=$out release install";
+
+  passthru = {
+    inherit lua;
+  };
+
+  meta = {
+    homepage = "https://github.com/luabind/luabind";
+    description = "A library that helps you create bindings between C++ and Lua";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/lucene++/default.nix b/nixpkgs/pkgs/development/libraries/lucene++/default.nix
new file mode 100644
index 000000000000..79e28cc7bb4a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lucene++/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, cmake, boost, gtest }:
+
+stdenv.mkDerivation rec {
+  pname = "lucene++";
+  version = "3.0.7";
+
+  src = fetchFromGitHub {
+    owner = "luceneplusplus";
+    repo = "LucenePlusPlus";
+    rev = "rel_${version}";
+    sha256 = "06b37fly6l27zc6kbm93f6khfsv61w792j8xihfagpcm9cfz2zi1";
+  };
+
+  postPatch = ''
+    sed -i -e '/Subversion *REQUIRED/d' \
+           -e '/include.*CMakeExternal/d' \
+           CMakeLists.txt
+  '';
+
+  cmakeFlags = [ "-DGTEST_INCLUDE_DIR=${gtest}/include" ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost gtest ];
+
+  doCheck = true;
+  checkTarget = "test";
+
+  meta = {
+    description = "C++ port of the popular Java Lucene search engine";
+    homepage = "https://github.com/luceneplusplus/LucenePlusPlus";
+    license = with lib.licenses; [ asl20 lgpl3Plus ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/luksmeta/default.nix b/nixpkgs/pkgs/development/libraries/luksmeta/default.nix
new file mode 100644
index 000000000000..afefcfed82c7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/luksmeta/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, asciidoc
+, cryptsetup
+}:
+
+stdenv.mkDerivation rec {
+  pname = "luksmeta";
+  version = "9";
+
+  src = fetchFromGitHub {
+    owner = "latchset";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "10nslwk7m1qwskd12c204ipa3cbad0q6fn0v084z2f7q6xxbkd2d";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config asciidoc ];
+  buildInputs = [ cryptsetup ];
+
+  meta = {
+    description = "Simple library for storing metadata in the LUKSv1 header";
+    homepage = "https://github.com/latchset/luksmeta/";
+    maintainers = with lib.maintainers; [ fpletz ];
+    license = lib.licenses.lgpl21Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/lyra/default.nix b/nixpkgs/pkgs/development/libraries/lyra/default.nix
new file mode 100644
index 000000000000..31b85b01d6a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lyra/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, installShellFiles, meson, ninja }:
+
+stdenv.mkDerivation rec {
+  pname = "lyra";
+  version = "1.5.1";
+
+  src = fetchFromGitHub {
+    owner = "bfgroup";
+    repo = "lyra";
+    rev = version;
+    sha256 = "0xil6b055csnrvxxmby5x9njf166bri472jxwzshc49cz7svhhpk";
+  };
+
+  nativeBuildInputs = [ meson ninja ];
+
+  postPatch = "sed -i s#/usr#$out#g meson.build";
+
+  postInstall = ''
+    mkdir -p $out/include
+    cp -R $src/include/* $out/include
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/bfgroup/Lyra";
+    description = "A simple to use, composable, command line parser for C++ 11 and beyond";
+    platforms = platforms.unix;
+    license = licenses.boost;
+    maintainers = with maintainers; [ davidtwco ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/lzo/default.nix b/nixpkgs/pkgs/development/libraries/lzo/default.nix
new file mode 100644
index 000000000000..f5b0111a1a78
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/lzo/default.nix
@@ -0,0 +1,35 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "lzo";
+  version = "2.10";
+
+  src = fetchurl {
+    url = "https://www.oberhumer.com/opensource/lzo/download/${pname}-${version}.tar.gz";
+    sha256 = "0wm04519pd3g8hqpjqhfr72q8qmbiwqaxcs3cndny9h86aa95y60";
+  };
+
+  configureFlags = [ "--enable-shared" ];
+
+  enableParallelBuilding = true;
+
+  doCheck = true; # not cross;
+
+  meta = with lib; {
+    description = "Real-time data (de)compression library";
+    longDescription = ''
+      LZO is a portable lossless data compression library written in ANSI C.
+      Both the source code and the compressed data format are designed to be
+      portable across platforms.
+      LZO offers pretty fast compression and *extremely* fast decompression.
+      While it favours speed over compression ratio, it includes slower
+      compression levels achieving a quite competitive compression ratio
+      while still decompressing at this very high speed.
+    '';
+
+    homepage = "http://www.oberhumer.com/opensource/lzo";
+    license = licenses.gpl2Plus;
+
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mac/default.nix b/nixpkgs/pkgs/development/libraries/mac/default.nix
new file mode 100644
index 000000000000..7445d283c6f4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mac/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, fetchpatch, yasm }:
+
+stdenv.mkDerivation rec {
+  pname = "mac";
+  version = "4.11-u4-b5-s7";
+
+  src = fetchurl {
+    url = "https://www.deb-multimedia.org/pool/main/m/monkeys-audio/monkeys-audio_${version}.orig.tar.gz";
+    sha256 = "16i96cw5r3xbsivjigqp15vv32wa38k86mxq11qx1pzmpryqpqkk";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "mac-4.11.4.5.7-gcc6.patch";
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-sound/mac/files/mac-4.11.4.5.7-gcc6.patch?id=1bd4e0e30e4d8a8862217d7067323851b34c7fe4";
+      sha256 = "093b8m8p8s6dmc62fc8vb4hlmjc2ncb4rdgc82g0a8gg6w5kcj8x";
+    })
+    (fetchpatch {
+      name = "mac-4.11.4.5.7-output.patch";
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/media-sound/mac/files/mac-4.11.4.5.7-output.patch?id=1bd4e0e30e4d8a8862217d7067323851b34c7fe4";
+      sha256 = "0njmwj6d9jqi4pz4fax02w37gk22vda0grszrs2nn97zzmjl36zk";
+    })
+  ];
+
+  CXXFLAGS = "-DSHNTOOL";
+
+  nativeBuildInputs = [ yasm ];
+
+  meta = with lib; {
+    description = "APE codec and decompressor";
+    homepage = "http://www.deb-multimedia.org/dists/testing/main/binary-amd64/package/monkeys-audio.php";
+    license = licenses.unfreeRedistributable;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ jfrankenau ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/maeparser/default.nix b/nixpkgs/pkgs/development/libraries/maeparser/default.nix
new file mode 100644
index 000000000000..cd7cc70907cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/maeparser/default.nix
@@ -0,0 +1,28 @@
+{ fetchFromGitHub
+, lib
+, stdenv
+, boost
+, zlib
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "maeparser";
+  version = "1.2.4";
+
+  src = fetchFromGitHub {
+    owner = "schrodinger";
+    repo = "maeparser";
+    rev = "v${version}";
+    sha256 = "1qzp8d58ksy88y4fx1b0x65wycslm7zxzbb8ns28gkjh12xpzhwz";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost zlib ];
+
+  meta = with lib; {
+    description = "maestro file parser";
+    maintainers = [ maintainers.rmcgibbo ];
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mailcore2/default.nix b/nixpkgs/pkgs/development/libraries/mailcore2/default.nix
new file mode 100644
index 000000000000..4e5a5fdbcdbc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mailcore2/default.nix
@@ -0,0 +1,59 @@
+{ stdenv, lib, fetchFromGitHub, cmake, libetpan, icu, cyrus_sasl, libctemplate
+, libuchardet, pkg-config, glib, html-tidy, libxml2, libuuid, openssl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mailcore2";
+
+  version = "0.6.4";
+
+  src = fetchFromGitHub {
+    owner  = "MailCore";
+    repo   = "mailcore2";
+    rev    = version;
+    sha256 = "0a69q11z194fdfwyazjyyylx57sqs9j4lz7jwh5qcws8syqgb23z";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [
+    libetpan icu cyrus_sasl libctemplate libuchardet glib
+    html-tidy libxml2 libuuid openssl
+  ];
+
+  postPatch = ''
+    substituteInPlace CMakeLists.txt \
+       --replace " icule iculx" "" \
+       --replace "tidy/tidy.h" "tidy.h" \
+       --replace "/usr/include/tidy" "${html-tidy}/include" \
+       --replace "/usr/include/libxml2" "${libxml2.dev}/include/libxml2"
+    substituteInPlace src/core/basetypes/MCHTMLCleaner.cpp \
+      --replace buffio.h tidybuffio.h
+  '';
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+  ];
+
+  installPhase = ''
+    mkdir $out
+    cp -r src/include $out
+
+    mkdir $out/lib
+    cp src/libMailCore.so $out/lib
+  '';
+
+  doCheck = true;
+  checkPhase = ''
+    (
+      cd unittest
+      LD_LIBRARY_PATH="$(cd ../src; pwd)" TZ=PST8PDT ./unittestcpp ../../unittest/data
+    )
+  '';
+
+  meta = with lib; {
+    description = "A simple and asynchronous API to work with e-mail protocols IMAP, POP and SMTP";
+    homepage    = "http://libmailcore.com";
+    license     = licenses.bsd3;
+    maintainers = with maintainers; [ cstrahan ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/malcontent/better-separation.patch b/nixpkgs/pkgs/development/libraries/malcontent/better-separation.patch
new file mode 100644
index 000000000000..ef42650e249d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/malcontent/better-separation.patch
@@ -0,0 +1,58 @@
+commit 363c5be465dd6dde35c3d31abd7b5cca9b1f3a9f
+Author: Jan Tojnar <jtojnar@gmail.com>
+Date:   Thu Jul 23 18:49:03 2020 +0200
+
+    Improve separation between malcontent and malcontent-ui packages
+    
+    These artefacts go into both packages by default:
+    
+    * malcontent-control – a CLI tool
+    * PAM module
+    * gettext locale data
+    * help pages ✨
+    * AccountService/D-Bus interfaces
+    * Polkit com.endlessm.ParentalControls rules and policy
+    
+    Items marked with ✨ will go to ui package, while the rest is installed with the base library.
+    
+    See also the packaging done by upstream in Endless:
+    https://github.com/endlessm/malcontent/tree/5482b7eb99aee9b8c344629bc078e193d3c26ffc/debian
+    
+    Cannot upstream this since they are worried about maintainability:
+    https://gitlab.freedesktop.org/pwithnall/malcontent/merge_requests/38#note_437946
+
+diff --git a/meson.build b/meson.build
+index 6e1dfa5..196350b 100644
+--- a/meson.build
++++ b/meson.build
+@@ -123,9 +123,8 @@ test_env = [
+   'LC_ALL=C.UTF-8',
+ ]
+ 
+-subdir('accounts-service')
+-subdir('help')
+ if not get_option('use_system_libmalcontent')
++  subdir('accounts-service')
+   subdir('libmalcontent')
+ else
+   libmalcontent_api_version = '0'
+@@ -136,11 +135,16 @@ endif
+ if get_option('ui').enabled()
+   subdir('libmalcontent-ui')
+ endif
+-subdir('malcontent-client')
++if not get_option('use_system_libmalcontent')
++  subdir('malcontent-client')
++endif
+ if get_option('ui').enabled()
+   subdir('malcontent-control')
++  subdir('help')
++endif
++if not get_option('use_system_libmalcontent')
++  subdir('pam')
++  subdir('po')
+ endif
+-subdir('pam')
+-subdir('po')
+ 
+ meson.add_install_script('build-aux/meson_post_install.py')
diff --git a/nixpkgs/pkgs/development/libraries/malcontent/default.nix b/nixpkgs/pkgs/development/libraries/malcontent/default.nix
new file mode 100644
index 000000000000..82635ae66d63
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/malcontent/default.nix
@@ -0,0 +1,104 @@
+{ lib, stdenv
+, fetchFromGitLab
+, fetchpatch
+, meson
+, ninja
+, pkg-config
+, gobject-introspection
+, wrapGAppsHook
+, glib
+, coreutils
+, accountsservice
+, dbus
+, pam
+, polkit
+, glib-testing
+, python3
+, nixosTests
+}:
+
+stdenv.mkDerivation rec {
+  pname = "malcontent";
+  version = "0.10.1";
+
+  outputs = [ "bin" "out" "lib" "pam" "dev" "man" "installedTests" ];
+
+  src = fetchFromGitLab {
+    domain = "gitlab.freedesktop.org";
+    owner = "pwithnall";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-GgY+E+1gzmiAAALzdKu1CjN3xPeVMhbmNLqJNB1zHaU=";
+  };
+
+  patches = [
+    # Allow installing installed tests to a separate output.
+    ./installed-tests-path.patch
+
+    # Do not build things that are part of malcontent-ui package
+    ./better-separation.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gobject-introspection
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    accountsservice
+    dbus
+    pam
+    polkit
+    glib-testing
+    (python3.withPackages (pp: with pp; [
+      pygobject3
+    ]))
+  ];
+
+  propagatedBuildInputs = [
+    glib
+  ];
+
+  mesonFlags = [
+    "-Dinstalled_tests=true"
+    "-Dinstalled_test_prefix=${placeholder "installedTests"}"
+    "-Dpamlibdir=${placeholder "pam"}/lib/security"
+    "-Dui=disabled"
+  ];
+
+  postPatch = ''
+    substituteInPlace libmalcontent/tests/app-filter.c \
+      --replace "/usr/bin/true" "${coreutils}/bin/true" \
+      --replace "/bin/true" "${coreutils}/bin/true" \
+      --replace "/usr/bin/false" "${coreutils}/bin/false" \
+      --replace "/bin/false" "${coreutils}/bin/false"
+  '';
+
+  postInstall = ''
+    # `giDiscoverSelf` only picks up paths in `out` output.
+    # This needs to be in `postInstall` so that it runs before
+    # `gappsWrapperArgsHook` that runs as one of `preFixupPhases`.
+    addToSearchPath GI_TYPELIB_PATH "$lib/lib/girepository-1.0"
+  '';
+
+  passthru = {
+    tests = {
+      installedTests = nixosTests.installed-tests.malcontent;
+    };
+  };
+
+  meta = with lib; {
+    # We need to install Polkit & AccountsService data files in `out`
+    # but `buildEnv` only uses `bin` when both `bin` and `out` are present.
+    outputsToInstall = [ "bin" "out" "man" ];
+
+    description = "Parental controls library";
+    homepage = "https://gitlab.freedesktop.org/pwithnall/malcontent";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/malcontent/installed-tests-path.patch b/nixpkgs/pkgs/development/libraries/malcontent/installed-tests-path.patch
new file mode 100644
index 000000000000..5d26c0f864f8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/malcontent/installed-tests-path.patch
@@ -0,0 +1,56 @@
+diff --git a/libmalcontent/tests/meson.build b/libmalcontent/tests/meson.build
+index 610bc35..13e0713 100644
+--- a/libmalcontent/tests/meson.build
++++ b/libmalcontent/tests/meson.build
+@@ -72,9 +72,9 @@ test_programs = [
+   ], deps],
+ ]
+ 
+-installed_tests_metadir = join_paths(datadir, 'installed-tests',
++installed_tests_metadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests',
+                                      'libmalcontent-' + libmalcontent_api_version)
+-installed_tests_execdir = join_paths(libexecdir, 'installed-tests',
++installed_tests_execdir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests',
+                                      'libmalcontent-' + libmalcontent_api_version)
+ 
+ foreach program: test_programs
+@@ -105,4 +105,4 @@ foreach program: test_programs
+     env: envs,
+     args: ['--tap'],
+   )
+-endforeach
+\ No newline at end of file
++endforeach
+diff --git a/meson_options.txt b/meson_options.txt
+index d516c70..583cb94 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -4,6 +4,12 @@ option(
+   value: false,
+   description: 'enable installed tests'
+ )
++option(
++  'installed_test_prefix',
++  type: 'string',
++  value: '',
++  description: 'Prefix for installed tests'
++)
+ option(
+   'pamlibdir',
+   type: 'string',
+diff --git a/pam/tests/meson.build b/pam/tests/meson.build
+index 0560dcb..a74dab2 100644
+--- a/pam/tests/meson.build
++++ b/pam/tests/meson.build
+@@ -12,9 +12,9 @@ test_programs = [
+   ['pam_malcontent', [], deps],
+ ]
+ 
+-installed_tests_metadir = join_paths(datadir, 'installed-tests',
++installed_tests_metadir = join_paths(get_option('installed_test_prefix'), 'share', 'installed-tests',
+                                      'libmalcontent-' + libmalcontent_api_version)
+-installed_tests_execdir = join_paths(libexecdir, 'installed-tests',
++installed_tests_execdir = join_paths(get_option('installed_test_prefix'), 'libexec', 'installed-tests',
+                                      'libmalcontent-' + libmalcontent_api_version)
+ 
+ foreach program: test_programs
diff --git a/nixpkgs/pkgs/development/libraries/malcontent/ui.nix b/nixpkgs/pkgs/development/libraries/malcontent/ui.nix
new file mode 100644
index 000000000000..e306267154ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/malcontent/ui.nix
@@ -0,0 +1,74 @@
+{ lib, stdenv
+, meson
+, ninja
+, pkg-config
+, gobject-introspection
+, itstool
+, wrapGAppsHook
+, glib
+, accountsservice
+, dbus
+, flatpak
+, malcontent
+, gtk3
+, appstream-glib
+, desktop-file-utils
+, polkit
+, glib-testing
+}:
+
+stdenv.mkDerivation rec {
+  pname = "malcontent-ui";
+
+  inherit (malcontent) version src;
+
+  outputs = [ "out" "lib" "dev" ];
+
+  patches = [
+    # Allow installing installed tests to a separate output.
+    ./installed-tests-path.patch
+
+    # Do not build things that are part of malcontent package
+    ./better-separation.patch
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    gobject-introspection
+    itstool
+    desktop-file-utils
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    appstream-glib
+    dbus
+    polkit
+    glib-testing
+    flatpak
+  ];
+
+  propagatedBuildInputs = [
+    accountsservice
+    malcontent
+    glib
+    gtk3
+  ];
+
+  mesonFlags = [
+    "-Dinstalled_tests=true"
+    "-Dinstalled_test_prefix=${placeholder "installedTests"}"
+    "-Duse_system_libmalcontent=true"
+    "-Dui=enabled"
+  ];
+
+  meta = with lib; {
+    description = "UI components for parental controls library";
+    homepage = "https://gitlab.freedesktop.org/pwithnall/malcontent";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mapbox-gl-native/default.nix b/nixpkgs/pkgs/development/libraries/mapbox-gl-native/default.nix
new file mode 100644
index 000000000000..c71bf17a3c77
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mapbox-gl-native/default.nix
@@ -0,0 +1,57 @@
+{ lib, mkDerivation, fetchFromGitHub, fetchpatch, cmake, pkg-config
+, qtbase, curl, libuv, glfw3, rapidjson }:
+
+mkDerivation rec {
+  pname = "mapbox-gl-native";
+  version = "1.6.0";
+
+  src = fetchFromGitHub {
+    owner = "mapbox";
+    repo = "mapbox-gl-native";
+    rev = "maps-v${version}";
+    sha256 = "027rw23yvd5a6nl9b5hsanddc44nyb17l2whdcq9fxb9n6vcda4c";
+    fetchSubmodules = true;
+  };
+
+  patches = [
+    # https://github.com/mapbox/mapbox-gl-native/pull/16591
+    (fetchpatch {
+      name = "add-support-for-qmapboxgl-installation.patch";
+      url = "https://github.com/mapbox/mapbox-gl-native/commit/e18467d755f470b26f61f6893eddd76ecf0816e6.patch";
+      sha256 = "0gs7wmkvyhf2db4cwbsq31sprsh1avi70ggvi32bk0wn3cw4d79b";
+    })
+    (fetchpatch {
+      name = "add-support-for-using-qmapboxgl-as-a-proper-cmake-dependency.patch";
+      url = "https://github.com/mapbox/mapbox-gl-native/commit/ab27b9b8207754ef731b588d187c470ffb084455.patch";
+      sha256 = "1lr5p1g4qaizs57vjqry9aq8k1ki59ks0y975chlnrm2sffp140r";
+    })
+    (fetchpatch {
+      name = "skip-license-check.patch";
+      url = "https://git.alpinelinux.org/aports/plain/testing/mapbox-gl-native/0002-skip-license-check.patch?id=6751a93dca26b0b3ceec9eb151272253a2fe497e";
+      sha256 = "1yybwzxbvn0lqb1br1fyg7763p2h117s6mkmywkl4l7qg9daa7ba";
+    })
+  ];
+
+  postPatch = ''
+    # don't use vendored rapidjson
+    rm -r vendor/mapbox-base/extras/rapidjson
+  '';
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ curl libuv glfw3 qtbase rapidjson ];
+
+  cmakeFlags = [
+    "-DMBGL_WITH_QT=ON"
+    "-DMBGL_WITH_QT_LIB_ONLY=ON"
+    "-DMBGL_WITH_QT_HEADLESS=OFF"
+  ];
+  NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations -Wno-error=type-limits";
+
+  meta = with lib; {
+    description = "Interactive, thoroughly customizable maps in native Android, iOS, macOS, Node.js, and Qt applications, powered by vector tiles and OpenGL";
+    homepage = "https://mapbox.com/mobile";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ Thra11 dotlambda ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mapbox-gl-qml/default.nix b/nixpkgs/pkgs/development/libraries/mapbox-gl-qml/default.nix
new file mode 100644
index 000000000000..87e765766227
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mapbox-gl-qml/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, mkDerivation
+, fetchFromGitHub
+, cmake
+, pkg-config
+, curl
+, qtbase
+, qtlocation
+, mapbox-gl-native
+}:
+
+mkDerivation rec {
+  pname = "mapbox-gl-qml";
+  version = "1.7.6";
+
+  src = fetchFromGitHub {
+    owner = "rinigus";
+    repo = "mapbox-gl-qml";
+    rev = version;
+    sha256 = "sha256-E6Pkr8khzDbhmJxzK943+H6cDREgwAqMnJQ3hQWU7fw=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ curl qtlocation mapbox-gl-native ];
+
+  postPatch = ''
+    substituteInPlace src/CMakeLists.txt \
+      --replace ' ''${QT_INSTALL_QML}' " $out/${qtbase.qtQmlPrefix}"
+  '';
+
+  # Package expects qt5 subdirectory of mapbox-gl-native to be in the include path
+  NIX_CFLAGS_COMPILE = "-I${mapbox-gl-native}/include/qt5";
+
+  meta = with lib; {
+    description = "Unofficial Mapbox GL Native bindings for Qt QML";
+    homepage = "https://github.com/rinigus/mapbox-gl-qml";
+    license = licenses.lgpl3Only;
+    maintainers = with maintainers; [ Thra11 dotlambda ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mapnik/default.nix b/nixpkgs/pkgs/development/libraries/mapnik/default.nix
new file mode 100644
index 000000000000..c2556a428a15
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mapnik/default.nix
@@ -0,0 +1,100 @@
+{ lib, stdenv, fetchzip
+, boost, cairo, freetype, gdal, harfbuzz, icu, libjpeg, libpng, libtiff
+, libwebp, libxml2, proj, python3, python ? python3, sqlite, zlib
+
+# supply a postgresql package to enable the PostGIS input plugin
+, postgresql ? null
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mapnik";
+  version = "3.1.0";
+
+  src = fetchzip {
+    # this one contains all git submodules and is cheaper than fetchgit
+    url = "https://github.com/mapnik/mapnik/releases/download/v${version}/mapnik-v${version}.tar.bz2";
+    sha256 = "sha256-qqPqN4vs3ZsqKgnx21yQhX8OzHca/0O+3mvQ/vnC5EY=";
+  };
+
+  # a distinct dev output makes python-mapnik fail
+  outputs = [ "out" ];
+
+  nativeBuildInputs = [ python3 ];
+
+  buildInputs = [
+    boost cairo freetype gdal harfbuzz icu libjpeg libpng libtiff
+    libwebp proj python sqlite zlib
+
+    # optional inputs
+    postgresql
+  ];
+
+  propagatedBuildInputs = [ libxml2 ];
+
+  prefixKey = "PREFIX=";
+
+  preConfigure = ''
+    patchShebangs ./configure
+  '';
+
+  # NOTE: 2021-05-06:
+  # Add -DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1 for backwards compatibility
+  # with major versions 6 and 7 of proj which are otherwise not compatible
+  # with mapnik 3.1.0. Note that:
+  #
+  # 1. Starting with proj version 8, this workaround will no longer be
+  #    supported by the upstream proj project.
+  #
+  # 2. Without the workaround, mapnik configures itself without proj support.
+  #
+  # 3. The master branch of mapnik (after 3.1.0) appears to add native support
+  #    for the proj 6 api, so this workaround is not likely to be needed in
+  #    subsequent mapnik releases. At that point, this block comment and the
+  #    NIX_CFLAGS_COMPILE expression can be removed.
+
+  NIX_CFLAGS_COMPILE =
+    if version != "3.1.0" && lib.versionAtLeast version "3.1.0"
+    then throw "The mapnik compatibility workaround for proj 6 may no longer be required. Remove workaround after checking."
+    else if lib.versionAtLeast (lib.getVersion proj) "8"
+    then throw ("mapnik currently requires a version of proj less than 8, but proj version is: " + (lib.getVersion proj))
+    else "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1";
+
+  configureFlags = [
+    "BOOST_INCLUDES=${boost.dev}/include"
+    "BOOST_LIBS=${boost.out}/lib"
+    "CAIRO_INCLUDES=${cairo.dev}/include"
+    "CAIRO_LIBS=${cairo.out}/lib"
+    "FREETYPE_INCLUDES=${freetype.dev}/include"
+    "FREETYPE_LIBS=${freetype.out}/lib"
+    "GDAL_CONFIG=${gdal}/bin/gdal-config"
+    "HB_INCLUDES=${harfbuzz.dev}/include"
+    "HB_LIBS=${harfbuzz.out}/lib"
+    "ICU_INCLUDES=${icu.dev}/include"
+    "ICU_LIBS=${icu.out}/lib"
+    "JPEG_INCLUDES=${libjpeg.dev}/include"
+    "JPEG_LIBS=${libjpeg.out}/lib"
+    "PNG_INCLUDES=${libpng.dev}/include"
+    "PNG_LIBS=${libpng.out}/lib"
+    "PROJ_INCLUDES=${proj.dev}/include"
+    "PROJ_LIBS=${proj.out}/lib"
+    "SQLITE_INCLUDES=${sqlite.dev}/include"
+    "SQLITE_LIBS=${sqlite.out}/lib"
+    "TIFF_INCLUDES=${libtiff.dev}/include"
+    "TIFF_LIBS=${libtiff.out}/lib"
+    "WEBP_INCLUDES=${libwebp}/include"
+    "WEBP_LIBS=${libwebp}/lib"
+    "XMLPARSER=libxml2"
+  ];
+
+  buildFlags = [
+    "JOBS=$(NIX_BUILD_CORES)"
+  ];
+
+  meta = with lib; {
+    description = "An open source toolkit for developing mapping applications";
+    homepage = "https://mapnik.org";
+    maintainers = with maintainers; [ hrdinka ];
+    license = licenses.lgpl21;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/marisa/default.nix b/nixpkgs/pkgs/development/libraries/marisa/default.nix
new file mode 100644
index 000000000000..4a3f8be04172
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/marisa/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "marisa";
+  version = "0.2.6";
+
+  src = fetchFromGitHub {
+    owner = "s-yata";
+    repo = "marisa-trie";
+    rev = "v${version}";
+    sha256 = "1hy8hfksizk1af6kg8z3b9waiz6d5ggd73fiqcvmhfgra36dscyq";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = with lib; {
+    homepage    = "https://github.com/s-yata/marisa-trie";
+    description = "Static and space-efficient trie data structure library";
+    license     = licenses.bsd3;
+    maintainers = with maintainers; [ sifmelcara ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/marl/default.nix b/nixpkgs/pkgs/development/libraries/marl/default.nix
new file mode 100644
index 000000000000..4545264aad9e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/marl/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, cmake, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "marl";
+  version = "1.0.0";  # Based on marl's CHANGES.md
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = pname;
+    sha256 = "0pnbarbyv82h05ckays2m3vgxzdhpcpg59bnzsddlb5v7rqhw51w";
+    rev = "40209e952f5c1f3bc883d2b7f53b274bd454ca53";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  # Turn on the flag to install after building the library.
+  cmakeFlags = ["-DMARL_INSTALL=ON"];
+
+  meta = with lib; {
+    homepage = "https://github.com/google/marl";
+    description = "A hybrid thread / fiber task scheduler written in C++ 11";
+    platforms = platforms.all;
+    license = licenses.asl20;
+    maintainers = with maintainers; [ breakds ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/martyr/default.nix b/nixpkgs/pkgs/development/libraries/martyr/default.nix
new file mode 100644
index 000000000000..609033e22ead
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/martyr/default.nix
@@ -0,0 +1,25 @@
+{lib, stdenv, fetchurl, ant, jdk}:
+
+stdenv.mkDerivation rec {
+  pname = "martyr";
+  version = "0.3.9";
+  src = fetchurl {
+    url = "mirror://sourceforge/martyr/${pname}-${version}.tar.gz";
+    sha256 = "1ks8j413bcby345kmq1i7av8kwjvz5vxdn1zpv0p7ywxq54i4z59";
+  };
+
+  buildInputs = [ ant jdk ];
+
+  buildPhase = "ant";
+
+  installPhase = ''
+    mkdir -p "$out/share/java"
+    cp -v *.jar "$out/share/java"
+  '';
+
+  meta = {
+    description = "Java framework around the IRC protocol to allow application writers easy manipulation of the protocol and client state";
+    homepage = "http://martyr.sourceforge.net/";
+    license = lib.licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/matio/default.nix b/nixpkgs/pkgs/development/libraries/matio/default.nix
new file mode 100644
index 000000000000..e3b3f288cb5d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/matio/default.nix
@@ -0,0 +1,17 @@
+{ lib, stdenv, fetchurl }:
+stdenv.mkDerivation rec {
+  pname = "matio";
+  version = "1.5.21";
+  src = fetchurl {
+    url = "mirror://sourceforge/matio/${pname}-${version}.tar.gz";
+    sha256 = "sha256-IYCRd+VYOefJTa2nRO5Vwd6n11fdqriWBXdtUBIvsGU=";
+  };
+
+  meta = with lib; {
+    description = "A C library for reading and writing Matlab MAT files";
+    license = licenses.bsd2;
+    platforms = platforms.all;
+    maintainers = [ maintainers.vbgl ];
+    homepage = "http://matio.sourceforge.net/";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mauikit-filebrowsing/default.nix b/nixpkgs/pkgs/development/libraries/mauikit-filebrowsing/default.nix
new file mode 100644
index 000000000000..5cce0382c8f0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mauikit-filebrowsing/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, mkDerivation
+, fetchFromGitLab
+, cmake
+, extra-cmake-modules
+, kconfig
+, kio
+, mauikit
+}:
+
+mkDerivation rec {
+  pname = "mauikit-filebrowsing";
+  version = "1.2.2";
+
+  src = fetchFromGitLab {
+    domain = "invent.kde.org";
+    owner = "maui";
+    repo = "mauikit-filebrowsing";
+    rev = "v${version}";
+    sha256 = "1m56lil7w884wn8qycl7y55abvw2vanfy8c4g786200p6acsh3kl";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+  ];
+
+  buildInputs = [
+    kconfig
+    kio
+    mauikit
+  ];
+
+  meta = with lib; {
+    homepage = "https://invent.kde.org/maui/mauikit-filebrowsing";
+    description = "MauiKit File Browsing utilities and controls";
+    license = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ dotlambda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mauikit/default.nix b/nixpkgs/pkgs/development/libraries/mauikit/default.nix
new file mode 100644
index 000000000000..3991ee5551f0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mauikit/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, mkDerivation
+, fetchFromGitLab
+, cmake
+, extra-cmake-modules
+, kconfig
+, kcoreaddons
+, ki18n
+, qtbase
+, qtquickcontrols2
+}:
+
+mkDerivation rec {
+  pname = "mauikit";
+  version = "1.2.2";
+
+  src = fetchFromGitLab {
+    domain = "invent.kde.org";
+    owner = "maui";
+    repo = "mauikit";
+    rev = "v${version}";
+    sha256 = "1jz0a65bbznjg7aaq19rdyp956wn6xc1x4xigfkhj6mwsvnb49av";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+  ];
+
+  buildInputs = [
+    kconfig
+    kcoreaddons
+    ki18n
+    qtquickcontrols2
+  ];
+
+  meta = with lib; {
+    homepage = "https://mauikit.org/";
+    description = "Free and modular front-end framework for developing fast and compelling user experiences";
+    license = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ dotlambda ];
+    broken = versionOlder qtbase.version "5.15.0";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/maxflow/default.nix b/nixpkgs/pkgs/development/libraries/maxflow/default.nix
new file mode 100644
index 000000000000..9c53a16d3724
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/maxflow/default.nix
@@ -0,0 +1,27 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "maxflow";
+  version = "3.0.5";
+
+  src = fetchFromGitHub {
+    owner = "gerddie";
+    repo = pname;
+    rev = version;
+    hash = "sha256-a84SxGMnfBEaoMEeeIFffTOtErSN5yzZBrAUDjkalGY=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Software for computing mincut/maxflow in a graph";
+    homepage = "https://github.com/gerddie/maxflow";
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+    maintainers = [ maintainers.tadfisher ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mbedtls/default.nix b/nixpkgs/pkgs/development/libraries/mbedtls/default.nix
new file mode 100644
index 000000000000..9210f18ed962
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mbedtls/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv
+, fetchFromGitHub
+
+, cmake
+, ninja
+, perl # Project uses Perl for scripting and testing
+, python3
+
+, enableThreading ? true # Threading can be disabled to increase security https://tls.mbed.org/kb/development/thread-safety-and-multi-threading
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mbedtls";
+  # Auto updates are disabled due to repology listing dev releases as release
+  # versions. See
+  #  * https://github.com/NixOS/nixpkgs/pull/119838#issuecomment-822100428
+  #  * https://github.com/NixOS/nixpkgs/commit/0ee02a9d42b5fe1825b0f7cee7a9986bb4ba975d
+  version = "2.26.0"; # nixpkgs-update: no auto update
+
+  src = fetchFromGitHub {
+    owner = "ARMmbed";
+    repo = "mbedtls";
+    rev = "${pname}-${version}";
+    sha256 = "0scwpmrgvg6q7rvqkc352d2fqlsx0aylcbyibcp1f1rsn8iiif2m";
+  };
+
+  nativeBuildInputs = [ cmake ninja perl python3 ];
+
+  strictDeps = true;
+
+  postConfigure = lib.optionalString enableThreading ''
+    perl scripts/config.pl set MBEDTLS_THREADING_C    # Threading abstraction layer
+    perl scripts/config.pl set MBEDTLS_THREADING_PTHREAD    # POSIX thread wrapper layer for the threading layer.
+  '';
+
+  cmakeFlags = [ "-DUSE_SHARED_MBEDTLS_LIBRARY=on" ];
+  NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [
+    "-Wno-error=format"
+    "-Wno-error=format-truncation"
+  ];
+
+  meta = with lib; {
+    homepage = "https://tls.mbed.org/";
+    description = "Portable cryptographic and TLS library, formerly known as PolarSSL";
+    license = licenses.asl20;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ fpletz ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/md4c/default.nix b/nixpkgs/pkgs/development/libraries/md4c/default.nix
new file mode 100644
index 000000000000..a29b521a2de5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/md4c/default.nix
@@ -0,0 +1,59 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "md4c";
+  version = "0.4.8";
+
+  src = fetchFromGitHub {
+    owner = "mity";
+    repo = pname;
+    rev = "release-${version}";
+    hash = "sha256-+LObAD5JB8Vb4Rt4hTo1Z4ispxzfFkkXA2sw6TKB7Yo=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/mity/md4c";
+    description = "Markdown parser made in C";
+    longDescription = ''
+      MD4C is Markdown parser implementation in C, with the following features:
+
+      - Compliance: Generally, MD4C aims to be compliant to the latest version
+        of CommonMark specification. Currently, we are fully compliant to
+        CommonMark 0.29.
+      - Extensions: MD4C supports some commonly requested and accepted
+        extensions. See below.
+      - Performance: MD4C is very fast.
+      - Compactness: MD4C parser is implemented in one source file and one
+        header file. There are no dependencies other than standard C library.
+      - Embedding: MD4C parser is easy to reuse in other projects, its API is
+        very straightforward: There is actually just one function, md_parse().
+      - Push model: MD4C parses the complete document and calls few callback
+        functions provided by the application to inform it about a start/end of
+        every block, a start/end of every span, and with any textual contents.
+      - Portability: MD4C builds and works on Windows and POSIX-compliant
+        OSes. (It should be simple to make it run also on most other platforms,
+        at least as long as the platform provides C standard library, including
+        a heap memory management.)
+      - Encoding: MD4C by default expects UTF-8 encoding of the input
+        document. But it can be compiled to recognize ASCII-only control
+        characters (i.e. to disable all Unicode-specific code), or (on Windows)
+        to expect UTF-16 (i.e. what is on Windows commonly called just
+        "Unicode"). See more details below.
+      - Permissive license: MD4C is available under the MIT license.
+    '';
+    license = licenses.mit;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = platforms.all;
+  };
+}
+# TODO: enable tests (needs Python)
diff --git a/nixpkgs/pkgs/development/libraries/mdds/default.nix b/nixpkgs/pkgs/development/libraries/mdds/default.nix
new file mode 100644
index 000000000000..89fbdd9f2155
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mdds/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, boost, llvmPackages }:
+
+stdenv.mkDerivation rec {
+  pname = "mdds";
+  version = "1.7.0";
+
+  src = fetchurl {
+    url = "https://kohei.us/files/${pname}/src/${pname}-${version}.tar.bz2";
+    sha256 = "1kzy70b18f2dsqarmdmzbj9nc9kf2lvc5xxgkg6wdax3jf12lsm6";
+  };
+
+  postInstall = ''
+    mkdir -p "$out/lib/pkgconfig"
+    cp "$out/share/pkgconfig/"* "$out/lib/pkgconfig"
+  '';
+
+  buildInputs = lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ];
+
+  checkInputs = [ boost ];
+
+  meta = with lib; {
+    homepage = "https://gitlab.com/mdds/mdds";
+    description = "A collection of multi-dimensional data structure and indexing algorithm";
+    platforms = platforms.all;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mdds/default.upstream b/nixpkgs/pkgs/development/libraries/mdds/default.upstream
new file mode 100644
index 000000000000..96c5bc35d169
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mdds/default.upstream
@@ -0,0 +1,10 @@
+url https://gitlab.com/mdds/mdds
+version_link 'mdds-.*[.]tar[.][a-z0-9]+$'
+version '.*-([0-9.]+)[.]tar[.].*' '\1'
+
+do_overwrite(){
+  ensure_hash
+  ensure_version
+  set_var_value version $CURRENT_VERSION
+  set_var_value sha256 $CURRENT_HASH
+}
diff --git a/nixpkgs/pkgs/development/libraries/medfile/default.nix b/nixpkgs/pkgs/development/libraries/medfile/default.nix
new file mode 100644
index 000000000000..c8ff0c05aded
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/medfile/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, cmake, hdf5 }:
+
+stdenv.mkDerivation rec {
+  pname = "medfile";
+  version = "4.1.0";
+
+  src = fetchurl {
+    url = "http://files.salome-platform.org/Salome/other/med-${version}.tar.gz";
+    sha256 = "1khzclkrd1yn9mz3g14ndgpsbj8j50v8dsjarcj6kkn9zgbbazc4";
+  };
+
+  patches = [
+    ./hdf5-1.12.patch
+  ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ hdf5 ];
+
+  checkPhase = "make test";
+
+  postInstall = "rm -r $out/bin/testc";
+
+  meta = with lib; {
+    description = "Library to read and write MED files";
+    homepage = "http://salome-platform.org/";
+    platforms = platforms.linux;
+    license = licenses.lgpl3Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/medfile/hdf5-1.12.patch b/nixpkgs/pkgs/development/libraries/medfile/hdf5-1.12.patch
new file mode 100644
index 000000000000..ab73e00487ce
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/medfile/hdf5-1.12.patch
@@ -0,0 +1,86 @@
+--- a/config/cmake_files/medMacros.cmake
++++ b/config/cmake_files/medMacros.cmake
+@@ -447,7 +447,7 @@ MACRO(MED_FIND_HDF5)
+     ##
+     ## Requires 1.10.x version
+     ##
+-    IF (NOT HDF_VERSION_MAJOR_REF EQUAL 1 OR NOT HDF_VERSION_MINOR_REF EQUAL 10 OR NOT HDF_VERSION_RELEASE_REF GREATER 1)
++    IF (HDF5_VERSION VERSION_LESS 1.10.2)
+         MESSAGE(FATAL_ERROR "HDF5 version is ${HDF_VERSION_REF}. Only versions >= 1.10.2 are supported.")
+     ENDIF()
+     ##
+--- a/src/ci/MEDfileCompatibility.c
++++ b/src/ci/MEDfileCompatibility.c
+@@ -71,7 +71,7 @@ MEDfileCompatibility(const char* const filename,
+   _hversionMMR=10000*_hmajeur+100*_hmineur+_hrelease;
+   /* ISCRUTE(_hversionMMR); */
+   /* ISCRUTE(HDF_VERSION_NUM_REF); */
+-  if ( (_hversionMMR >= HDF_VERSION_NUM_REF) && (_hmineur == HDF_VERSION_MINOR_REF) ) *hdfok = MED_TRUE;
++  if ( ((_hversionMMR >= HDF_VERSION_NUM_REF) && (_hmineur == HDF_VERSION_MINOR_REF)) || _hversionMMR > HDF_VERSION_NUM_REF ) *hdfok = MED_TRUE;
+ 
+   /* TODO : Vérifier si la version mineure HDF du fichier est supérieure
+      à la version mineure de la bibliothèque HDF utilisée :
+@@ -113,7 +113,7 @@ MEDfileCompatibility(const char* const filename,
+ #if MED_NUM_MAJEUR != 4
+ #error "Don't forget to update the test version here when you change the major version of the library !"
+ #endif
+-#if H5_VERS_MINOR > 10
++#if H5_VERS_MINOR > 12
+ #error "Don't forget to check the compatibility version of the library, depending on the internal hdf model choice !"
+ #error "Cf. _MEDfileCreate ..."
+ #endif
+--- a/src/hdfi/_MEDfileCreate.c
++++ b/src/hdfi/_MEDfileCreate.c
+@@ -159,7 +159,7 @@ med_idt _MEDfileCreate(const char * const filename, const med_access_mode access
+    * En HDF5-1.10.0p1 cela n'a aucun effet ! 
+    * Un test autoconf permet de fixer un intervalle de version HDF à MED.
+    */
+-#if H5_VERS_MINOR > 10
++#if H5_VERS_MINOR > 12
+ #error "Don't forget to change the compatibility version of the library !"
+ #endif
+    
+--- a/src/hdfi/_MEDfileOpen.c
++++ b/src/hdfi/_MEDfileOpen.c
+@@ -72,7 +72,7 @@ med_idt _MEDfileOpen(const char * const filename,const med_access_mode accessmod
+ 
+    •   The creation order tracking property, H5P_CRT_ORDER_TRACKED, has been set in the group creation property list (see H5Pset_link_creation_order). 
+   */
+-#if H5_VERS_MINOR > 10
++#if H5_VERS_MINOR > 12
+ #error "Don't forget to change the compatibility version of the library !"
+ #endif
+ /* L'avantage de bloquer le modèle interne HDF5 
+--- a/src/hdfi/_MEDmemFileOpen.c
++++ b/src/hdfi/_MEDmemFileOpen.c
+@@ -434,7 +434,7 @@ med_idt _MEDmemFileOpen(const char * const filename, med_memfile * const memfile
+     goto ERROR;
+   }
+ 
+-#if H5_VERS_MINOR > 10
++#if H5_VERS_MINOR > 12
+ #error "Don't forget to change the compatibility version of the library !"
+ #endif
+   if ( H5Pset_libver_bounds( _fapl, H5F_LIBVER_18, H5F_LIBVER_18) ) {
+--- a/src/hdfi/_MEDparFileCreate.c
++++ b/src/hdfi/_MEDparFileCreate.c
+@@ -64,7 +64,7 @@ med_idt _MEDparFileCreate(const char * const filename, const med_access_mode acc
+    * En HDF5-1.10.0p1 cela n'a aucun effet ! 
+    * Un test autoconf permet de fixer un intervalle de version HDF à MED.
+    */
+-#if H5_VERS_MINOR > 10
++#if H5_VERS_MINOR > 12
+ #error "Don't forget to change the compatibility version of the library !"
+ #endif
+    
+--- a/src/hdfi/_MEDparFileOpen.c
++++ b/src/hdfi/_MEDparFileOpen.c
+@@ -55,7 +55,7 @@ med_idt _MEDparFileOpen(const char * const filename,const med_access_mode access
+     MED_ERR_(_fid,MED_ERR_INIT,MED_ERR_PROPERTY,MED_ERR_PARALLEL_MSG);
+     goto ERROR;
+   }
+-#if H5_VERS_MINOR > 10
++#if H5_VERS_MINOR > 12
+ #error "Don't forget to change the compatibility version of the library !"
+ #endif
+   if ( H5Pset_libver_bounds( _fapl, H5F_LIBVER_18, H5F_LIBVER_18 ) ) {
diff --git a/nixpkgs/pkgs/development/libraries/mediastreamer/default.nix b/nixpkgs/pkgs/development/libraries/mediastreamer/default.nix
new file mode 100644
index 000000000000..5d9cc98b1a9c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mediastreamer/default.nix
@@ -0,0 +1,111 @@
+{ alsa-lib
+, bctoolbox
+, bzrtp
+, cmake
+, doxygen
+, fetchFromGitLab
+, ffmpeg
+, glew
+, gsm
+, intltool
+, lib
+, libGL
+, libGLU
+, libX11
+, libXext
+, libXv
+, libmatroska
+, libopus
+, libpcap
+, libpulseaudio
+, libtheora
+, libupnp
+, libv4l
+, libvpx
+, ortp
+, pkg-config
+, python3
+, SDL
+, speex
+, srtp
+, stdenv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mediastreamer2";
+  version = "4.5.15";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.linphone.org";
+    owner = "public";
+    group = "BC";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-n/EuXEQ9nJKC32PMvWkfP1G+E6uQQuu1/A168n8/cIY=";
+  };
+
+  patches = [
+    # Plugins directory is normally fixed during compile time. This patch makes
+    # it possible to set the plugins directory run time with an environment
+    # variable MEDIASTREAMER_PLUGINS_DIR. This makes it possible to construct a
+    # plugin directory with desired plugins and wrap executables so that the
+    # environment variable points to that directory.
+    ./plugins_dir.patch
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    doxygen
+    intltool
+    pkg-config
+    python3
+  ];
+
+  propagatedBuildInputs = [
+    alsa-lib
+    bctoolbox
+    bzrtp
+    ffmpeg
+    glew
+    gsm
+    libGL
+    libGLU
+    libX11
+    libXext
+    libXv
+    libmatroska
+    libopus
+    libpcap
+    libpulseaudio
+    libtheora
+    libupnp
+    libv4l
+    libvpx
+    ortp
+    SDL
+    speex
+    srtp
+  ];
+
+  strictDeps = true;
+
+  # Do not build static libraries
+  cmakeFlags = [ "-DENABLE_STATIC=NO" ];
+
+  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";
+
+  meta = with lib; {
+    description = "A powerful and lightweight streaming engine specialized for voice/video telephony applications";
+    homepage = "http://www.linphone.org/technical-corner/mediastreamer2";
+    license = licenses.gpl3Only;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mediastreamer/msopenh264.nix b/nixpkgs/pkgs/development/libraries/mediastreamer/msopenh264.nix
new file mode 100644
index 000000000000..08842889f865
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mediastreamer/msopenh264.nix
@@ -0,0 +1,49 @@
+{ autoreconfHook
+, cmake
+, fetchFromGitLab
+, fetchpatch
+, mediastreamer
+, openh264
+, pkg-config
+, lib, stdenv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "msopenh264";
+  # Using master branch for linphone-desktop caused a chain reaction that many
+  # of its dependencies needed to use master branch too.
+  version = "unstable-2020-03-03";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.linphone.org";
+    owner = "public";
+    group = "BC";
+    repo = pname;
+    rev = "2c3abf52824ad23a4caae7565ef158ef91767704";
+    sha256 = "140hs5lzpshzswvl39klcypankq3v2qck41696j22my7s4wsa0hr";
+  };
+
+  nativeBuildInputs = [ autoreconfHook cmake pkg-config ];
+  buildInputs = [ mediastreamer openh264 ];
+
+  # Do not build static libraries
+  cmakeFlags = [
+    "-DENABLE_STATIC=NO"
+    "-DCMAKE_SKIP_INSTALL_RPATH=ON"
+  ];
+
+  # CMAKE_INSTALL_PREFIX has no effect so let's install manually. See:
+  # https://gitlab.linphone.org/BC/public/msopenh264/issues/1
+  installPhase = ''
+    mkdir -p $out/lib/mediastreamer/plugins
+    cp src/libmsopenh264.so $out/lib/mediastreamer/plugins/
+  '';
+
+  meta = with lib; {
+    description = "H.264 encoder/decoder plugin for mediastreamer2";
+    homepage = "https://www.linphone.org/technical-corner/mediastreamer2";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mediastreamer/plugins_dir.patch b/nixpkgs/pkgs/development/libraries/mediastreamer/plugins_dir.patch
new file mode 100644
index 000000000000..43e398aafee4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mediastreamer/plugins_dir.patch
@@ -0,0 +1,18 @@
+diff --git a/src/base/msfactory.c b/src/base/msfactory.c
+index 14f868e3..2e3445a1 100644
+--- a/src/base/msfactory.c
++++ b/src/base/msfactory.c
+@@ -770,7 +770,12 @@ void ms_factory_uninit_plugins(MSFactory *factory){
+ }
+ 
+ void ms_factory_init_plugins(MSFactory *obj) {
+-	if (obj->plugins_dir == NULL) {
++	char *package_plugins_dir;
++	// Force plugin dir from environment variable if set
++	package_plugins_dir = getenv("MEDIASTREAMER_PLUGINS_DIR");
++	if (package_plugins_dir != NULL) {
++		ms_factory_set_plugins_dir(obj, package_plugins_dir);
++	} else if (obj->plugins_dir == NULL) {
+ #ifdef __APPLE__
+ 	char *dir = getPluginsDir();
+ 	if (dir != NULL) {
diff --git a/nixpkgs/pkgs/development/libraries/menu-cache/default.nix b/nixpkgs/pkgs/development/libraries/menu-cache/default.nix
new file mode 100644
index 000000000000..b2f06b9e627b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/menu-cache/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, glib, pkg-config, libfm-extra }:
+
+let name = "menu-cache-1.1.0";
+in
+stdenv.mkDerivation {
+  inherit name;
+  src = fetchurl {
+    url = "mirror://sourceforge/lxde/${name}.tar.xz";
+    sha256 = "1iry4zlpppww8qai2cw4zid4081hh7fz8nzsp5lqyffbkm2yn0pd";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ glib libfm-extra ];
+
+  meta = with lib; {
+    description = "Library to read freedesktop.org menu files";
+    homepage = "https://blog.lxde.org/tag/menu-cache/";
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.ttuegel ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mesa-glu/default.nix b/nixpkgs/pkgs/development/libraries/mesa-glu/default.nix
new file mode 100644
index 000000000000..d2e92da0ea96
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mesa-glu/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, pkg-config, libGL, ApplicationServices }:
+
+stdenv.mkDerivation rec {
+  pname = "glu";
+  version = "9.0.2";
+
+  src = fetchurl {
+    url = "https://mesa.freedesktop.org/archive/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-bnKA/1hcah2d/N8vykiSUWNLM3e/wzwp5AAkZqONAtQ=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  propagatedBuildInputs = [ libGL ]
+    ++ lib.optional stdenv.isDarwin ApplicationServices;
+
+  outputs = [ "out" "dev" ];
+
+  meta = {
+    description = "OpenGL utility library";
+    homepage = "https://cgit.freedesktop.org/mesa/glu/";
+    license = lib.licenses.sgi-b-20;
+    platforms = lib.platforms.unix;
+    broken = stdenv.hostPlatform.isAndroid;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mesa/aarch64-darwin.patch b/nixpkgs/pkgs/development/libraries/mesa/aarch64-darwin.patch
new file mode 100644
index 000000000000..e60a4ffa308a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mesa/aarch64-darwin.patch
@@ -0,0 +1,33 @@
+From 8ac29b952e638ec1ea8c3734a3b91253e50c336d Mon Sep 17 00:00:00 2001
+From: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+Date: Sun, 24 Jan 2021 21:10:29 -0800
+Subject: [PATCH 4/4] Hack to address build failure when using newer macOS SDKs
+ with older deployment targets
+
+Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
+---
+ include/c11/threads_posix.h | 8 +++++++-
+ 1 file changed, 7 insertions(+), 1 deletion(-)
+
+diff --git a/include/c11/threads_posix.h b/include/c11/threads_posix.h
+index 45cb6075e6e..355d725f7da 100644
+--- a/include/c11/threads_posix.h
++++ b/include/c11/threads_posix.h
+@@ -382,7 +382,13 @@ tss_set(tss_t key, void *val)
+ 
+ /*-------------------- 7.25.7 Time functions --------------------*/
+ // 7.25.6.1
+-#ifndef HAVE_TIMESPEC_GET
++#if !defined(HAVE_TIMESPEC_GET) || defined(__APPLE__)
++
++#ifdef __APPLE__
++#include <time.h>
++#define timespec_get(ts, b) mesa_timespec_get(ts, b)
++#endif
++
+ static inline int
+ timespec_get(struct timespec *ts, int base)
+ {
+-- 
+2.29.2 (Apple Git-129)
+
diff --git a/nixpkgs/pkgs/development/libraries/mesa/default.nix b/nixpkgs/pkgs/development/libraries/mesa/default.nix
new file mode 100644
index 000000000000..876a3c015a0d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mesa/default.nix
@@ -0,0 +1,253 @@
+{ stdenv, lib, fetchurl, fetchpatch, buildPackages
+, meson, pkg-config, ninja
+, intltool, bison, flex, file, python3Packages, wayland-scanner
+, expat, libdrm, xorg, wayland, wayland-protocols, openssl
+, llvmPackages, libffi, libomxil-bellagio, libva-minimal
+, libelf, libvdpau
+, libglvnd, libunwind
+, galliumDrivers ? ["auto"]
+, driDrivers ? ["auto"]
+, vulkanDrivers ? ["auto"]
+, eglPlatforms ? [ "x11" ] ++ lib.optionals stdenv.isLinux [ "wayland" ]
+, OpenGL, Xplugin
+, withValgrind ? !stdenv.isDarwin && lib.meta.availableOn stdenv.hostPlatform valgrind-light, valgrind-light
+, enableGalliumNine ? stdenv.isLinux
+, enableOSMesa ? stdenv.isLinux
+}:
+
+/** Packaging design:
+  - The basic mesa ($out) contains headers and libraries (GLU is in libGLU now).
+    This or the mesa attribute (which also contains GLU) are small (~ 2 MB, mostly headers)
+    and are designed to be the buildInput of other packages.
+  - DRI drivers are compiled into $drivers output, which is much bigger and
+    depends on LLVM. These should be searched at runtime in
+    "/run/opengl-driver{,-32}/lib/*" and so are kind-of impure (given by NixOS).
+    (I suppose on non-NixOS one would create the appropriate symlinks from there.)
+  - libOSMesa is in $osmesa (~4 MB)
+*/
+
+with lib;
+
+let
+  # Release calendar: https://www.mesa3d.org/release-calendar.html
+  # Release frequency: https://www.mesa3d.org/releasing.html#schedule
+  version = "21.1.7";
+  branch  = versions.major version;
+
+self = stdenv.mkDerivation {
+  pname = "mesa";
+  inherit version;
+
+  src = fetchurl {
+    urls = [
+      "https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
+      "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"
+    ];
+    sha256 = "1fx7nfvh1drfa6vv34j7ma944qbs014b0jwlbgqlnbjgcl87rrp9";
+  };
+
+  prePatch = "patchShebangs .";
+
+  # TODO:
+  #  revive ./dricore-gallium.patch when it gets ported (from Ubuntu), as it saved
+  #  ~35 MB in $drivers; watch https://launchpad.net/ubuntu/+source/mesa/+changelog
+  patches = [
+    ./missing-includes.patch # dev_t needs sys/stat.h, time_t needs time.h, etc.-- fixes build w/musl
+    ./opencl-install-dir.patch
+    ./disk_cache-include-dri-driver-path-in-cache-key.patch
+    # Fix `-Werror=int-conversion` pthread warnings on musl.
+    # TODO: Remove when https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6121 is merged and available
+    (fetchpatch {
+      name = "nine_debug-Make-tid-more-type-correct";
+      url = "https://gitlab.freedesktop.org/mesa/mesa/commit/aebbf819df6d1e.patch";
+      sha256 = "17248hyzg43d73c86p077m4lv1pkncaycr3l27hwv9k4ija9zl8q";
+    })
+    # For RISC-V support:
+    (fetchpatch {
+      name = "add-riscv-default-selections.patch";
+      url = "https://gitlab.freedesktop.org/mesa/mesa/-/commit/9908da1b7a5eaf0156d458e0e24b694c070ba345.patch";
+      sha256 = "036gv95m5gzzs6qpgkydf5fwgdlm7kpbdfalg8vmayghd260rw1w";
+    })
+  ] ++ optionals (stdenv.isDarwin && stdenv.isAarch64) [
+    # Fix aarch64-darwin build, remove when upstreaam supports it out of the box.
+    # See: https://gitlab.freedesktop.org/mesa/mesa/-/issues/1020
+    ./aarch64-darwin.patch
+  ];
+
+  postPatch = ''
+    substituteInPlace meson.build --replace \
+      "find_program('pkg-config')" \
+      "find_program('${buildPackages.pkg-config.targetPrefix}pkg-config')"
+
+    # The drirc.d directory cannot be installed to $drivers as that would cause a cyclic dependency:
+    substituteInPlace src/util/xmlconfig.c --replace \
+      'DATADIR "/drirc.d"' '"${placeholder "out"}/share/drirc.d"'
+    substituteInPlace src/util/meson.build --replace \
+      "get_option('datadir')" "'${placeholder "out"}/share'"
+  '' + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+    substituteInPlace meson.build --replace \
+      "find_program('nm')" \
+      "find_program('${stdenv.cc.targetPrefix}nm')"
+  '';
+
+  outputs = [ "out" "dev" "drivers" ]
+    ++ lib.optional enableOSMesa "osmesa"
+    ++ lib.optional stdenv.isLinux "driversdev";
+
+  # TODO: Figure out how to enable opencl without having a runtime dependency on clang
+  mesonFlags = [
+    "--sysconfdir=/etc"
+    "--datadir=${placeholder "drivers"}/share" # Vendor files
+
+    # Don't build in debug mode
+    # https://gitlab.freedesktop.org/mesa/mesa/blob/master/docs/meson.html#L327
+    "-Db_ndebug=true"
+
+    "-Ddisk-cache-key=${placeholder "drivers"}"
+    "-Ddri-search-path=${libglvnd.driverLink}/lib/dri"
+
+    "-Dplatforms=${concatStringsSep "," eglPlatforms}"
+    "-Ddri-drivers=${concatStringsSep "," driDrivers}"
+    "-Dgallium-drivers=${concatStringsSep "," galliumDrivers}"
+    "-Dvulkan-drivers=${concatStringsSep "," vulkanDrivers}"
+
+    "-Ddri-drivers-path=${placeholder "drivers"}/lib/dri"
+    "-Dvdpau-libs-path=${placeholder "drivers"}/lib/vdpau"
+    "-Dxvmc-libs-path=${placeholder "drivers"}/lib"
+    "-Domx-libs-path=${placeholder "drivers"}/lib/bellagio"
+    "-Dva-libs-path=${placeholder "drivers"}/lib/dri"
+    "-Dd3d-drivers-path=${placeholder "drivers"}/lib/d3d"
+    "-Dgallium-nine=${boolToString enableGalliumNine}" # Direct3D in Wine
+    "-Dosmesa=${boolToString enableOSMesa}" # used by wine
+    "-Dmicrosoft-clc=disabled" # Only relevant on Windows (OpenCL 1.2 API on top of D3D12)
+  ] ++ optionals stdenv.isLinux [
+    "-Dglvnd=true"
+  ];
+
+  buildInputs = with xorg; [
+    expat llvmPackages.libllvm libglvnd xorgproto
+    libX11 libXext libxcb libXt libXfixes libxshmfence libXrandr
+    libffi libvdpau libelf libXvMC
+    libpthreadstubs openssl /*or another sha1 provider*/
+  ] ++ lib.optionals (elem "wayland" eglPlatforms) [ wayland wayland-protocols ]
+    ++ lib.optionals stdenv.isLinux [ libomxil-bellagio libva-minimal ]
+    ++ lib.optionals stdenv.isDarwin [ libunwind ]
+    ++ lib.optional withValgrind valgrind-light;
+
+  depsBuildBuild = [ pkg-config ];
+
+  nativeBuildInputs = [
+    meson pkg-config ninja
+    intltool bison flex file
+    python3Packages.python python3Packages.Mako
+  ] ++ lib.optionals (elem "wayland" eglPlatforms) [
+    wayland-scanner
+  ];
+
+  propagatedBuildInputs = with xorg; [
+    libXdamage libXxf86vm
+  ] ++ optional stdenv.isLinux libdrm
+    ++ optionals stdenv.isDarwin [ OpenGL Xplugin ];
+
+  doCheck = false;
+
+  postInstall = ''
+    # Some installs don't have any drivers so this directory is never created.
+    mkdir -p $drivers $osmesa
+  '' + optionalString stdenv.isLinux ''
+    mkdir -p $drivers/lib
+
+    if [ -n "$(shopt -s nullglob; echo "$out/lib/libxatracker"*)" -o -n "$(shopt -s nullglob; echo "$out/lib/libvulkan_"*)" ]; then
+      # move gallium-related stuff to $drivers, so $out doesn't depend on LLVM
+      mv -t $drivers/lib       \
+        $out/lib/libxatracker* \
+        $out/lib/libvulkan_*
+    fi
+
+    if [ -n "$(shopt -s nullglob; echo "$out"/lib/lib*_mesa*)" ]; then
+      # Move other drivers to a separate output
+      mv $out/lib/lib*_mesa* $drivers/lib
+    fi
+
+    # Update search path used by glvnd
+    for js in $drivers/share/glvnd/egl_vendor.d/*.json; do
+      substituteInPlace "$js" --replace '"libEGL_' '"'"$drivers/lib/libEGL_"
+    done
+
+    # Update search path used by Vulkan (it's pointing to $out but
+    # drivers are in $drivers)
+    for js in $drivers/share/vulkan/icd.d/*.json; do
+      substituteInPlace "$js" --replace "$out" "$drivers"
+    done
+  '' + lib.optionalString enableOSMesa ''
+    # move libOSMesa to $osmesa, as it's relatively big
+    mkdir -p $osmesa/lib
+    mv -t $osmesa/lib/ $out/lib/libOSMesa*
+  '';
+
+  postFixup = optionalString stdenv.isLinux ''
+    # set the default search path for DRI drivers; used e.g. by X server
+    substituteInPlace "$dev/lib/pkgconfig/dri.pc" --replace "$drivers" "${libglvnd.driverLink}"
+    [ -f "$dev/lib/pkgconfig/d3d.pc" ] && substituteInPlace "$dev/lib/pkgconfig/d3d.pc" --replace "$drivers" "${libglvnd.driverLink}"
+
+    # remove pkgconfig files for GL/EGL; they are provided by libGL.
+    rm -f $dev/lib/pkgconfig/{gl,egl}.pc
+
+    # Move development files for libraries in $drivers to $driversdev
+    mkdir -p $driversdev/include
+    mv $dev/include/xa_* $dev/include/d3d* -t $driversdev/include || true
+    mkdir -p $driversdev/lib/pkgconfig
+    for pc in lib/pkgconfig/{xatracker,d3d}.pc; do
+      if [ -f "$dev/$pc" ]; then
+        substituteInPlace "$dev/$pc" --replace $out $drivers
+        mv $dev/$pc $driversdev/$pc
+      fi
+    done
+
+    # add RPATH so the drivers can find the moved libgallium and libdricore9
+    # moved here to avoid problems with stripping patchelfed files
+    for lib in $drivers/lib/*.so* $drivers/lib/*/*.so*; do
+      if [[ ! -L "$lib" ]]; then
+        patchelf --set-rpath "$(patchelf --print-rpath $lib):$drivers/lib" "$lib"
+      fi
+    done
+  '';
+
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-fno-common";
+
+  passthru = {
+    inherit libdrm;
+    inherit (libglvnd) driverLink;
+    inherit llvmPackages;
+
+    tests.devDoesNotDependOnLLVM = stdenv.mkDerivation {
+      name = "mesa-dev-does-not-depend-on-llvm";
+      buildCommand = ''
+        echo ${self.dev} >>$out
+      '';
+      disallowedRequisites = [ llvmPackages.llvm self.drivers ];
+    };
+  };
+
+  meta = {
+    description = "An open source 3D graphics library";
+    longDescription = ''
+      The Mesa project began as an open-source implementation of the OpenGL
+      specification - a system for rendering interactive 3D graphics. Over the
+      years the project has grown to implement more graphics APIs, including
+      OpenGL ES (versions 1, 2, 3), OpenCL, OpenMAX, VDPAU, VA API, XvMC, and
+      Vulkan.  A variety of device drivers allows the Mesa libraries to be used
+      in many different environments ranging from software emulation to
+      complete hardware acceleration for modern GPUs.
+    '';
+    homepage = "https://www.mesa3d.org/";
+    changelog = "https://www.mesa3d.org/relnotes/${version}.html";
+    license = licenses.mit; # X11 variant, in most files
+    platforms = platforms.mesaPlatforms;
+    maintainers = with maintainers; [ primeos vcunat ]; # Help is welcome :)
+  };
+};
+
+in self
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
new file mode 100644
index 000000000000..fa78f4ae730a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mesa/disk_cache-include-dri-driver-path-in-cache-key.patch
@@ -0,0 +1,74 @@
+From 980164fd92f5c2302624cd046d30ff21e6e4ba8a 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
+
+This fixes invalid cache hits on NixOS where all shared library
+timestamps in /nix/store are zero.
+---
+ meson_options.txt     | 6 ++++++
+ src/util/disk_cache.c | 3 +++
+ src/util/meson.build  | 7 ++++++-
+ 3 files changed, 15 insertions(+), 1 deletion(-)
+
+diff --git a/meson_options.txt b/meson_options.txt
+index 2d39d13b6ad..daf06480a60 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -368,6 +368,12 @@ option(
+   value : true,
+   description : 'Enable direct rendering in GLX and EGL for DRI',
+ )
++option(
++  'disk-cache-key',
++  type : 'string',
++  value : '',
++  description : 'Mesa cache key.'
++)
+ option(
+   'prefer-iris',
+   type : 'boolean',
+diff --git a/src/util/disk_cache.c b/src/util/disk_cache.c
+index a92d621927a..3bd65c6890c 100644
+--- a/src/util/disk_cache.c
++++ b/src/util/disk_cache.c
+@@ -401,8 +401,10 @@ disk_cache_create(const char *gpu_name, const char *driver_id,
+ 
+    /* Create driver id keys */
+    size_t id_size = strlen(driver_id) + 1;
++   size_t key_size = strlen(DISK_CACHE_KEY) + 1;
+    size_t gpu_name_size = strlen(gpu_name) + 1;
+    cache->driver_keys_blob_size += id_size;
++   cache->driver_keys_blob_size += key_size;
+    cache->driver_keys_blob_size += gpu_name_size;
+ 
+    /* We sometimes store entire structs that contains a pointers in the cache,
+@@ -423,6 +425,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)
++   DRV_KEY_CPY(drv_key_blob, DISK_CACHE_KEY, key_size)
+    DRV_KEY_CPY(drv_key_blob, gpu_name, gpu_name_size)
+    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 0893f64793b..d46ce85a85f 100644
+--- a/src/util/meson.build
++++ b/src/util/meson.build
+@@ -179,7 +179,12 @@ _libmesa_util = static_library(
+   include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
+   dependencies : deps_for_libmesa_util,
+   link_with: libmesa_format,
+-  c_args : [c_msvc_compat_args],
++  c_args : [
++    c_msvc_compat_args,
++    '-DDISK_CACHE_KEY="@0@"'.format(
++      get_option('disk-cache-key')
++    ),
++  ],
+   gnu_symbol_visibility : 'hidden',
+   build_by_default : false
+ )
+-- 
+2.28.0
+
diff --git a/nixpkgs/pkgs/development/libraries/mesa/missing-includes.patch b/nixpkgs/pkgs/development/libraries/mesa/missing-includes.patch
new file mode 100644
index 000000000000..c17d54908553
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mesa/missing-includes.patch
@@ -0,0 +1,22 @@
+--- ./src/gallium/winsys/svga/drm/vmw_screen.h.orig
++++ ./src/gallium/winsys/svga/drm/vmw_screen.h
+@@ -34,7 +34,7 @@
+ #ifndef VMW_SCREEN_H_
+ #define VMW_SCREEN_H_
+ 
+-
++#include <sys/stat.h>
+ #include "pipe/p_compiler.h"
+ #include "pipe/p_state.h"
+ 
+--- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
++++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.h
+@@ -28,6 +28,8 @@
+ #ifndef RADV_AMDGPU_WINSYS_H
+ #define RADV_AMDGPU_WINSYS_H
+
++#include <sys/types.h>
++
+ #include <amdgpu.h>
+ #include <pthread.h>
+ #include "util/list.h"
diff --git a/nixpkgs/pkgs/development/libraries/mesa/opencl-install-dir.patch b/nixpkgs/pkgs/development/libraries/mesa/opencl-install-dir.patch
new file mode 100644
index 000000000000..fe85d2c90bb2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mesa/opencl-install-dir.patch
@@ -0,0 +1,12 @@
+diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build
+index 317ad8dab4a..5567308caf0 100644
+--- a/src/gallium/targets/opencl/meson.build
++++ b/src/gallium/targets/opencl/meson.build
+@@ -68,6 +68,6 @@ if with_opencl_icd
+     input : 'mesa.icd.in',
+     output : 'mesa.icd',
+     install : true,
+-    install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'),
++    install_dir : join_paths(get_option('prefix'), 'etc', 'OpenCL', 'vendors'),
+   )
+ endif
diff --git a/nixpkgs/pkgs/development/libraries/mesa/stubs.nix b/nixpkgs/pkgs/development/libraries/mesa/stubs.nix
new file mode 100644
index 000000000000..753ad1b91966
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mesa/stubs.nix
@@ -0,0 +1,75 @@
+{ stdenv
+, libglvnd, mesa
+, OpenGL }:
+
+stdenv.mkDerivation {
+  inherit (libglvnd) version;
+  pname = "libGL";
+  outputs = [ "out" "dev" ];
+
+  # On macOS, libglvnd is not supported, so we just use what mesa
+  # build. We need to also include OpenGL.framework, and some
+  # extra tricks to go along with. We add mesa’s libGLX to support
+  # the X extensions to OpenGL.
+  buildCommand = if stdenv.hostPlatform.isDarwin then ''
+    mkdir -p $out/nix-support $dev
+    echo ${OpenGL} >> $out/nix-support/propagated-build-inputs
+    ln -s ${mesa.out}/lib $out/lib
+
+    mkdir -p $dev/lib/pkgconfig $dev/nix-support
+    echo "$out" > $dev/nix-support/propagated-build-inputs
+    ln -s ${mesa.dev}/include $dev/include
+
+    cat <<EOF >$dev/lib/pkgconfig/gl.pc
+  Name: gl
+  Description: gl library
+  Version: ${mesa.version}
+  Libs: -L${mesa.out}/lib -lGL
+  Cflags: -I${mesa.dev}/include
+  EOF
+
+    cat <<EOF >$dev/lib/pkgconfig/glesv1_cm.pc
+  Name: glesv1_cm
+  Description: glesv1_cm library
+  Version: ${mesa.version}
+  Libs: -L${mesa.out}/lib -lGLESv1_CM
+  Cflags: -I${mesa.dev}/include
+  EOF
+
+    cat <<EOF >$dev/lib/pkgconfig/glesv2.pc
+  Name: glesv2
+  Description: glesv2 library
+  Version: ${mesa.version}
+  Libs: -L${mesa.out}/lib -lGLESv2
+  Cflags: -I${mesa.dev}/include
+  EOF
+  ''
+
+  # Otherwise, setup gl stubs to use libglvnd.
+  else ''
+    mkdir -p $out/nix-support
+    ln -s ${libglvnd.out}/lib $out/lib
+
+    mkdir -p $dev/{,lib/pkgconfig,nix-support}
+    echo "$out ${libglvnd} ${libglvnd.dev}" > $dev/nix-support/propagated-build-inputs
+    ln -s ${libglvnd.dev}/include $dev/include
+
+    genPkgConfig() {
+      local name="$1"
+      local lib="$2"
+
+      cat <<EOF >$dev/lib/pkgconfig/$name.pc
+    Name: $name
+    Description: $lib library
+    Version: ${libglvnd.version}
+    Libs: -L${libglvnd.out}/lib -l$lib
+    Cflags: -I${libglvnd.dev}/include
+    EOF
+    }
+
+    genPkgConfig gl GL
+    genPkgConfig egl EGL
+    genPkgConfig glesv1_cm GLESv1_CM
+    genPkgConfig glesv2 GLESv2
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/metal/default.nix b/nixpkgs/pkgs/development/libraries/metal/default.nix
new file mode 100644
index 000000000000..2f43485e05e0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/metal/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+stdenv.mkDerivation rec {
+  pname = "metal";
+  version = "2.1.2";
+
+  src = fetchFromGitHub {
+    owner = "brunocodutra";
+    repo = "metal";
+    rev = "v${version}";
+    sha256 = "sha256-1I+EZtIz/2y4+dJGBONhTlUQGHgRdvXc1ZAOC9pmStw=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Single-header C++11 library designed to make you love template metaprogramming";
+    homepage = "https://github.com/brunocodutra/metal";
+    license = licenses.mit;
+    maintainers = with maintainers; [ pmiddend ];
+    platforms = platforms.all;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/microsoft_gsl/default.nix b/nixpkgs/pkgs/development/libraries/microsoft_gsl/default.nix
new file mode 100644
index 000000000000..187508a99818
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/microsoft_gsl/default.nix
@@ -0,0 +1,46 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, gtest
+, fetchurl
+, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "microsoft_gsl";
+  version = "3.1.0";
+
+  src = fetchFromGitHub {
+    owner = "Microsoft";
+    repo = "GSL";
+    rev = "v${version}";
+    sha256 = "sha256-gIpyuNlp3mvR8r1Azs2r76ElEodykRLGAwMN4BDJez0=";
+  };
+
+  patches = [
+    # Search for GoogleTest via pkg-config first, ref: https://github.com/NixOS/nixpkgs/pull/130525
+    (fetchurl {
+      url = "https://github.com/microsoft/GSL/commit/f5cf01083baf7e8dc8318db3648bc6098dc32d67.patch";
+      sha256 = "sha256-uouv35crtly8kYhKyvMyZkqwTKt1jXC6dZjw4sQ6uv0=";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ gtest ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "C++ Core Guideline support library";
+    longDescription = ''
+      The Guideline Support Library (GSL) contains functions and types that are suggested for
+      use by the C++ Core Guidelines maintained by the Standard C++ Foundation.
+      This package contains Microsoft's implementation of GSL.
+    '';
+    homepage = "https://github.com/Microsoft/GSL";
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ thoughtpolice yuriaisaka ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mimalloc/default.nix b/nixpkgs/pkgs/development/libraries/mimalloc/default.nix
new file mode 100644
index 000000000000..1e9e44e09973
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mimalloc/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchFromGitHub, cmake, ninja
+, secureBuild ? false
+}:
+
+let
+  soext = stdenv.hostPlatform.extensions.sharedLibrary;
+in
+stdenv.mkDerivation rec {
+  pname   = "mimalloc";
+  version = "2.0.2";
+
+  src = fetchFromGitHub {
+    owner  = "microsoft";
+    repo   = pname;
+    rev    = "v${version}";
+    sha256 = "sha256-n4FGld3bq6ZOSLTzXcVlucCGbQ5/eSFbijU0dfBD/T0=";
+  };
+
+  nativeBuildInputs = [ cmake ninja ];
+  cmakeFlags = [ "-DMI_INSTALL_TOPLEVEL=ON" ] ++ lib.optional secureBuild [ "-DMI_SECURE=ON" ];
+
+  postInstall = let
+    rel = lib.versions.majorMinor version;
+    suffix = if stdenv.isLinux then "${soext}.${rel}" else ".${rel}${soext}";
+  in ''
+    # first, move headers and cmake files, that's easy
+    mkdir -p $dev/lib
+    mv $out/include $dev/include
+    mv $out/cmake $dev/lib/
+
+    find $out/lib
+  '' + (lib.optionalString secureBuild ''
+    # pretend we're normal mimalloc
+    ln -sfv $out/lib/libmimalloc-secure${suffix} $out/lib/libmimalloc${suffix}
+    ln -sfv $out/lib/libmimalloc-secure${suffix} $out/lib/libmimalloc${soext}
+    ln -sfv $out/lib/libmimalloc-secure.a $out/lib/libmimalloc.a
+    ln -sfv $out/lib/mimalloc-secure.o $out/lib/mimalloc.o
+  '');
+
+  outputs = [ "out" "dev" ];
+
+  meta = with lib; {
+    description = "Compact, fast, general-purpose memory allocator";
+    homepage    = "https://github.com/microsoft/mimalloc";
+    license     = licenses.bsd2;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mimetic/default.nix b/nixpkgs/pkgs/development/libraries/mimetic/default.nix
new file mode 100644
index 000000000000..1638caa0d1f8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mimetic/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, cutee }:
+
+stdenv.mkDerivation rec {
+  pname = "mimetic";
+  version = "0.9.8";
+
+  src = fetchurl {
+    url    = "http://www.codesink.org/download/${pname}-${version}.tar.gz";
+    sha256 = "003715lvj4nx23arn1s9ss6hgc2yblkwfy5h94li6pjz2a6xc1rs";
+  };
+
+  buildInputs = [ cutee ];
+
+  patches = lib.optional stdenv.isAarch64 ./narrowing.patch;
+
+  meta = with lib; {
+    description = "MIME handling library";
+    homepage    = "http://www.codesink.org/mimetic_mime_library.html";
+    license     = licenses.mit;
+    maintainers = with maintainers; [ leenaars];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mimetic/narrowing.patch b/nixpkgs/pkgs/development/libraries/mimetic/narrowing.patch
new file mode 100644
index 000000000000..676e29376c7d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mimetic/narrowing.patch
@@ -0,0 +1,32 @@
+diff -ru a/mimetic/codec/base64.cxx b/mimetic/codec/base64.cxx
+--- a/mimetic/codec/base64.cxx	2014-06-17 10:12:00.000000000 +0200
++++ b/mimetic/codec/base64.cxx	2020-07-30 20:54:10.212742011 +0200
+@@ -14,19 +14,19 @@
+     "0123456789+/=";
+ 
+ const char Base64::sDecTable[] = {
+-        -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+-        -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+-        -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+-        -1,-1,-1,-1,-1,-1,-1,-1,-1,-1,
+-        -1,-1,-1,62,-1,-1,-1,63,52,53,
+-        54,55,56,57,58,59,60,61,-1,-1,
+-        -1, eq_sign, -1,-1,-1, 0, 1, 2, 3, 4, 
++        255,255,255,255,255,255,255,255,255,255,
++        255,255,255,255,255,255,255,255,255,255,
++        255,255,255,255,255,255,255,255,255,255,
++        255,255,255,255,255,255,255,255,255,255,
++        255,255,255,62,255,255,255,63,52,53,
++        54,55,56,57,58,59,60,61,255,255,
++        255, eq_sign, 255,255,255, 0, 1, 2, 3, 4, 
+          5, 6, 7, 8, 9,10,11,12,13,14,
+         15,16,17,18,19,20,21,22,23,24,
+-        25,-1,-1,-1,-1,-1,-1,26,27,28,
++        25,255,255,255,255,255,255,26,27,28,
+         29,30,31,32,33,34,35,36,37,38,
+         39,40,41,42,43,44,45,46,47,48,
+-        49,50,51,-1
++        49,50,51,255
+ };
+ 
+ const int Base64::sDecTableSz = sizeof(Base64::sDecTable) / sizeof(char);
diff --git a/nixpkgs/pkgs/development/libraries/miniball/default.nix b/nixpkgs/pkgs/development/libraries/miniball/default.nix
new file mode 100644
index 000000000000..13a814684a42
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/miniball/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  pname = "miniball";
+  version = "3.0";
+
+  src = fetchurl {
+    url = "https://www.inf.ethz.ch/personal/gaertner/miniball/Miniball.hpp";
+    sha256 = "1piap5v8wqq0aachrq6j50qkr01gzpyndl6vf661vyykrfq0nnd2";
+  };
+
+  dontUnpack = true;
+
+  installPhase = ''
+    mkdir -p $out/include
+    cp $src $out/include/miniball.hpp
+  '';
+
+  meta = {
+    description = "Smallest Enclosing Balls of Points";
+    homepage = "https://www.inf.ethz.ch/personal/gaertner/miniball.html";
+    license = lib.licenses.gpl3;
+    maintainers = [ lib.maintainers.erikryb ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/minixml/default.nix b/nixpkgs/pkgs/development/libraries/minixml/default.nix
new file mode 100644
index 000000000000..9bf5235db824
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/minixml/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "mxml";
+  version = "3.2";
+
+  src = fetchFromGitHub {
+    owner = "michaelrsweet";
+    repo = "mxml";
+    rev = "v${version}";
+    sha256 = "0zvib87rgsib0w9xp6bks5slq5ma1qbgyyyvr23cv7zkbgw3xgil";
+  };
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A small XML library";
+    homepage = "https://www.msweet.org/mxml/";
+    license = licenses.asl20;
+    platforms = platforms.all;
+    maintainers = [ maintainers.goibhniu ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/minizip/default.nix b/nixpkgs/pkgs/development/libraries/minizip/default.nix
new file mode 100644
index 000000000000..bb62a9b3b2ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/minizip/default.nix
@@ -0,0 +1,17 @@
+{ lib, stdenv, zlib, autoreconfHook }:
+
+stdenv.mkDerivation {
+  name = "minizip-${zlib.version}";
+  inherit (zlib) src;
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ zlib ];
+
+  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 = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/minizip2/default.nix b/nixpkgs/pkgs/development/libraries/minizip2/default.nix
new file mode 100644
index 000000000000..591bb8c8dc3a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/minizip2/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, zlib, bzip2, xz, zstd, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "minizip";
+  version = "2.10.6";
+
+  src = fetchFromGitHub {
+    owner = "nmoinvaz";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-OAm4OZeQdP2Q/UKYI9bR7OV9RmLmYF/j2NpK5TPoE60=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=YES"
+    "-DMZ_OPENSSL=ON"
+  ];
+
+  buildInputs = [ zlib bzip2 xz zstd openssl ];
+
+  meta = with lib; {
+    description = "Compression library implementing the deflate compression method found in gzip and PKZIP";
+    homepage = "https://github.com/nmoinvaz/minizip";
+    license = licenses.zlib;
+    maintainers = with maintainers; [ gebner ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mlt/default.nix b/nixpkgs/pkgs/development/libraries/mlt/default.nix
new file mode 100644
index 000000000000..a4f0289cd58e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mlt/default.nix
@@ -0,0 +1,67 @@
+{ lib, stdenv, fetchFromGitHub, makeWrapper
+, SDL, ffmpeg, frei0r, libjack2, libdv, libsamplerate, libexif
+, libvorbis, libxml2, movit, pkg-config, sox, fftw, opencv4, SDL2
+, gtk2, genericUpdater, common-updater-scripts, libebur128
+, jack2, ladspa-sdk, swig, which, ncurses
+, enablePython ? false, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mlt";
+  version = "6.26.0";
+
+  src = fetchFromGitHub {
+    owner = "mltframework";
+    repo = "mlt";
+    rev = "v${version}";
+    sha256 = "FPXROiX7A6oB1VMipw3slyhk7q4fO6m9amohnC67lnA=";
+  };
+
+  buildInputs = [
+    SDL ffmpeg frei0r libjack2 libdv libsamplerate libvorbis libxml2.dev
+    movit sox libexif gtk2 fftw libebur128 opencv4 SDL2 jack2
+    ladspa-sdk
+  ] ++ lib.optional enablePython ncurses;
+
+  nativeBuildInputs = [ pkg-config makeWrapper which ]
+  ++ lib.optionals enablePython [ python3 swig ];
+
+  strictDeps = true;
+
+  # 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-gpl3" "--enable-opengl"
+  ] ++ lib.optional enablePython "--swig-languages=python";
+
+  enableParallelBuilding = true;
+  outPythonPath = lib.optionalString enablePython "$(toPythonPath $out)";
+
+  postInstall = ''
+    wrapProgram $out/bin/melt --prefix FREI0R_PATH : ${frei0r}/lib/frei0r-1
+
+    # Remove an unnecessary reference to movit.dev.
+    s=${movit.dev}/include
+    t=$(for ((i = 0; i < ''${#s}; i++)); do echo -n X; done)
+    sed -i $out/lib/mlt/libmltopengl.so -e "s|$s|$t|g"
+  '' + lib.optionalString enablePython ''
+    mkdir -p ${outPythonPath}/mlt
+    cp -a src/swig/python/_mlt.so ${outPythonPath}/mlt/
+    cp -a src/swig/python/mlt.py ${outPythonPath}/mlt/__init__.py
+    sed -i ${outPythonPath}/mlt/__init__.py -e "s|return importlib.import_module('_mlt')|return importlib.import_module('mlt._mlt')|g"
+  '';
+
+  passthru.updateScript = genericUpdater {
+    inherit pname version;
+    versionLister = "${common-updater-scripts}/bin/list-git-tags ${src.meta.homepage}";
+    rev-prefix = "v";
+  };
+
+  meta = with lib; {
+    description = "Open source multimedia framework, designed for television broadcasting";
+    homepage = "https://www.mltframework.org";
+    license = with licenses; [ gpl3Only gpl2Only lgpl21Only ];
+    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
new file mode 100644
index 000000000000..f8724703f049
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mlt/qt-5.nix
@@ -0,0 +1,112 @@
+{ lib
+, fetchFromGitHub
+, SDL
+, ffmpeg
+, frei0r
+, libjack2
+, libdv
+, libsamplerate
+, libvorbis
+, libxml2
+, movit
+, pkg-config
+, sox
+, qtbase
+, qtsvg
+, fftw
+, vid-stab
+, opencv3
+, ladspa-sdk
+, genericUpdater
+, common-updater-scripts
+, ladspaPlugins
+, mkDerivation
+, which
+}:
+
+mkDerivation rec {
+  pname = "mlt";
+  version = "6.24.0";
+
+  src = fetchFromGitHub {
+    owner = "mltframework";
+    repo = "mlt";
+    rev = "v${version}";
+    sha256 = "1my43ica2qax2622307dv4gn3w8hkchy643i9pq8r9yh2hd4pvs9";
+  };
+
+  buildInputs = [
+    SDL
+    ffmpeg
+    frei0r
+    libjack2
+    libdv
+    libsamplerate
+    libvorbis
+    libxml2
+    movit
+    pkg-config
+    qtbase
+    qtsvg
+    sox
+    fftw
+    vid-stab
+    opencv3
+    ladspa-sdk
+    ladspaPlugins
+  ];
+
+  nativeBuildInputs = [ which ];
+
+  outputs = [ "out" "dev" ];
+
+  # 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-gpl3"
+    "--enable-opengl"
+  ];
+
+  # mlt is unable to cope with our multi-prefix Qt build
+  # because it does not use CMake or qmake.
+  NIX_CFLAGS_COMPILE = "-I${lib.getDev qtsvg}/include/QtSvg";
+
+  CXXFLAGS = "-std=c++11";
+
+  qtWrapperArgs = [
+    "--prefix FREI0R_PATH : ${frei0r}/lib/frei0r-1"
+    "--prefix LADSPA_PATH : ${ladspaPlugins}/lib/ladspa"
+  ];
+
+  postInstall = ''
+    # Remove an unnecessary reference to movit.dev.
+    s=${movit.dev}/include
+    t=$(for ((i = 0; i < ''${#s}; i++)); do echo -n X; done)
+    sed -i $out/lib/mlt/libmltopengl.so -e "s|$s|$t|g"
+
+    # Remove an unnecessary reference to movit.dev.
+    s=${qtbase.dev}/include
+    t=$(for ((i = 0; i < ''${#s}; i++)); do echo -n X; done)
+    sed -i $out/lib/mlt/libmltqt.so -e "s|$s|$t|g"
+  '';
+
+  passthru = {
+    inherit ffmpeg;
+  };
+
+  passthru.updateScript = genericUpdater {
+    inherit pname version;
+    versionLister = "${common-updater-scripts}/bin/list-git-tags ${src.meta.homepage}";
+    rev-prefix = "v";
+  };
+
+  meta = with lib; {
+    description = "Open source multimedia framework, designed for television broadcasting";
+    homepage = "https://www.mltframework.org/";
+    license = licenses.gpl3;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mm-common/default.nix b/nixpkgs/pkgs/development/libraries/mm-common/default.nix
new file mode 100644
index 000000000000..7ce2675e3017
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mm-common/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv
+, fetchurl
+, gnome
+, meson
+, python3
+, ninja
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mm-common";
+  version = "1.0.2";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "07b4s5ckcz9q5gwx8vchim19mhfgl8wysqwi30pndks3m4zrzad2";
+  };
+
+  nativeBuildInputs = [
+    meson
+    python3
+    ninja
+  ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    description = "Common build files of GLib/GTK C++ bindings";
+    longDescription = ''
+      The mm-common module provides the build infrastructure and utilities
+      shared among the GNOME C++ binding libraries. It is only a required
+      dependency for building the C++ bindings from the gnome.org version
+      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";
+    license = licenses.gpl2Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mongoc/default.nix b/nixpkgs/pkgs/development/libraries/mongoc/default.nix
new file mode 100644
index 000000000000..e9779cf0a054
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mongoc/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchzip, perl, pkg-config, libbson
+, openssl, which, zlib, snappy
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mongoc";
+  version = "1.8.0";
+
+  src = fetchzip {
+    url = "https://github.com/mongodb/mongo-c-driver/releases/download/${version}/mongo-c-driver-${version}.tar.gz";
+    sha256 = "1vnnk3pwbcmwva1010bl111kdcdx3yb2w7j7a78hhvrm1k9r1wp8";
+  };
+
+  nativeBuildInputs = [ pkg-config which perl ];
+  buildInputs = [ openssl zlib ];
+  propagatedBuildInputs = [ libbson snappy ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "The official C client library for MongoDB";
+    homepage = "https://github.com/mongodb/mongo-c-driver";
+    license = licenses.asl20;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mono-addins/default.nix b/nixpkgs/pkgs/development/libraries/mono-addins/default.nix
new file mode 100644
index 000000000000..158b39a8186a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mono-addins/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, mono4, gtk-sharp-2_0 }:
+
+stdenv.mkDerivation rec {
+  pname = "mono-addins";
+  version = "1.3.3";
+
+  src = fetchFromGitHub {
+    owner = "mono";
+    repo = "mono-addins";
+
+    rev = "mono-addins-${version}";
+    sha256 = "018g3bd8afjc39h22h2j5r6ldsdn08ynx7wg889gdvnxg3hrxgl2";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+
+  # Use msbuild when https://github.com/NixOS/nixpkgs/pull/43680 is merged
+  buildInputs = [ mono4 gtk-sharp-2_0 ];
+
+  dontStrip = true;
+
+  meta = with lib; {
+    homepage = "https://www.mono-project.com/archived/monoaddins/";
+    description = "A generic framework for creating extensible applications";
+    longDescription = ''
+      Mono.Addins is a generic framework for creating extensible applications,
+      and for creating libraries which extend those applications.
+    '';
+    platforms = platforms.linux;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/motif/Add-X.Org-to-bindings-file.patch b/nixpkgs/pkgs/development/libraries/motif/Add-X.Org-to-bindings-file.patch
new file mode 100644
index 000000000000..84b62dcd4eb0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/motif/Add-X.Org-to-bindings-file.patch
@@ -0,0 +1,7 @@
+--- a/bindings/xmbind.alias
++++ b/bindings/xmbind.alias
+@@ -62,3 +62,4 @@
+ "Sun Microsystems, Inc."				sun
+ ! "Sun Microsystems, Inc."				sun_at
+ "Tektronix, Inc."					tek
++"The X.Org Foundation"				tpc
diff --git a/nixpkgs/pkgs/development/libraries/motif/Remove-unsupported-weak-refs-on-darwin.patch b/nixpkgs/pkgs/development/libraries/motif/Remove-unsupported-weak-refs-on-darwin.patch
new file mode 100644
index 000000000000..801310ba41ce
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/motif/Remove-unsupported-weak-refs-on-darwin.patch
@@ -0,0 +1,12 @@
+--- a/lib/Xm/XmP.h
++++ b/lib/Xm/XmP.h
+@@ -1437,7 +1437,7 @@ extern void _XmDestroyParentCallback(
+ 
+ #endif /* NO_XM_1_2_BC */
+ 
+-#if __GNUC__
++#if __GNUC__ && ! __APPLE__
+ #  define XM_DEPRECATED  __attribute__((__deprecated__))
+ #  define XM_ALIAS(sym)  __attribute__((__weak__,alias(#sym)))
+ #else
+
diff --git a/nixpkgs/pkgs/development/libraries/motif/default.nix b/nixpkgs/pkgs/development/libraries/motif/default.nix
new file mode 100644
index 000000000000..f99bd8f2630e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/motif/default.nix
@@ -0,0 +1,52 @@
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, libtool
+, xlibsWrapper, xbitmaps, libXrender, libXmu, libXt
+, expat, libjpeg, libpng, libiconv
+, flex
+, libXp, libXau
+, demoSupport ? false
+}:
+# refer to the gentoo package
+
+stdenv.mkDerivation rec {
+  pname = "motif";
+  version = "2.3.8";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/motif/${pname}-${version}.tar.gz";
+    sha256 = "1rxwkrhmj8sfg7dwmkhq885valwqbh26d79033q7vb7fcqv756w5";
+  };
+
+  buildInputs = [
+    libtool
+    xlibsWrapper xbitmaps libXrender libXmu libXt
+    expat libjpeg libpng libiconv
+  ];
+
+  nativeBuildInputs = [ pkg-config flex ];
+
+  propagatedBuildInputs = [ libXp libXau ];
+
+  prePatch = lib.optionalString (!demoSupport) ''
+    sed '/^SUBDIRS =,^$/s/\<demos\>//' -i Makefile.{am,in}
+  '';
+
+  patches = [
+    ./Remove-unsupported-weak-refs-on-darwin.patch
+    ./Add-X.Org-to-bindings-file.patch
+    (fetchpatch rec {
+      name = "fix-format-security.patch";
+      url = "https://raw.githubusercontent.com/void-linux/void-packages/b9a1110dabb01c052dadc1abae1413bd4afe3652/srcpkgs/motif/patches/02-${name}";
+      sha256 = "13vzpf8yxvhf4gl7q0yzlr6ak1yzx382fsqsrv5lc8jbbg4nwrrq";
+    })
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://motif.ics.com";
+    description = "Unix standard widget-toolkit and window-manager";
+    platforms = platforms.unix;
+    license = with licenses; [ lgpl21Plus ];
+    maintainers = with maintainers; [ qyliss ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/movit/default.nix b/nixpkgs/pkgs/development/libraries/movit/default.nix
new file mode 100644
index 000000000000..9c03a9f6c491
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/movit/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, SDL2, eigen, epoxy, fftw, gtest, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "movit";
+  version = "1.6.3";
+
+  src = fetchurl {
+    url = "https://movit.sesse.net/${pname}-${version}.tar.gz";
+    sha256 = "164lm5sg95ca6k546zf775g3s79mgff0az96wl6hbmlrxh4z26gb";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  GTEST_DIR = "${gtest.src}/googletest";
+
+  propagatedBuildInputs = [ eigen epoxy ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ SDL2 fftw gtest ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "High-performance, high-quality video filters for the GPU";
+    homepage = "https://movit.sesse.net";
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mp4v2/default.nix b/nixpkgs/pkgs/development/libraries/mp4v2/default.nix
new file mode 100644
index 000000000000..fe0049c1f384
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mp4v2/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, lib, fetchFromGitHub, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "mp4v2";
+  version = "4.1.3";
+
+  src = fetchFromGitHub {
+    # 2020-06-20: THE current upstream, maintained and used in distros fork.
+    owner = "TechSmith";
+    repo = "mp4v2";
+    rev = "Release-ThirdParty-MP4v2-${version}";
+    sha256 = "053a0lgy819sbz92cfkq0vmkn2ky39bva554pj4ypky1j6vs04fv";
+  };
+
+  patches = [
+    (fetchurl {
+      # 2020-06-19: NOTE: # Fix build with C++11
+      # Close when https://github.com/TechSmith/mp4v2/pull/36 merged/closed.
+      url = "https://raw.githubusercontent.com/archlinux/svntogit-packages/203f5a72bc97ffe089b424c47b07dd9eaea35713/trunk/libmp4v2-c++11.patch";
+      sha256 = "0sbn0il7lmk77yrjyb4f0a3z3h8gsmdkscvz5n9hmrrrhrwf672w";
+    })
+  ] ++ lib.optionals stdenv.cc.isClang [
+    # unbreak build with Clang≥6 (C++14 by default). Based on https://reviews.freebsd.org/rP458678
+    ./fix-build-clang.patch
+  ];
+
+  NIX_CFLAGS_COMPILE = [ "-Wno-error=narrowing" ];
+
+  # `faac' expects `mp4.h'.
+  postInstall = "ln -s mp4v2/mp4v2.h $out/include/mp4.h";
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "Provides functions to read, create, and modify mp4 files";
+    longDescription = ''
+      MP4v2 library provides an API to work with mp4 files
+      as defined by ISO-IEC:14496-1:2001 MPEG-4 Systems.
+      This container format is derived from Apple's QuickTime format.
+    '';
+    homepage = "https://github.com/TechSmith/mp4v2";
+    maintainers = [ lib.maintainers.Anton-Latukha ];
+    platforms = lib.platforms.unix;
+    license = lib.licenses.mpl11;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mp4v2/fix-build-clang.patch b/nixpkgs/pkgs/development/libraries/mp4v2/fix-build-clang.patch
new file mode 100644
index 000000000000..5d99f1951f7a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mp4v2/fix-build-clang.patch
@@ -0,0 +1,13 @@
+diff --git a/src/mp4.cpp b/src/mp4.cpp
+index c2a7238..9bb3e38 100644
+--- a/src/mp4.cpp
++++ b/src/mp4.cpp
+@@ -870,7 +870,7 @@ MP4FileHandle MP4ReadProvider( const char* fileName, const MP4FileProvider* file
+         }
+ 
+         catch (...) {
+-            return MP4_INVALID_TRACK_ID;
++            return NULL;
+         }
+     }
+ 
diff --git a/nixpkgs/pkgs/development/libraries/mpfi/default.nix b/nixpkgs/pkgs/development/libraries/mpfi/default.nix
new file mode 100644
index 000000000000..152c35e6e6f0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mpfi/default.nix
@@ -0,0 +1,25 @@
+{lib, stdenv, fetchurl, autoreconfHook, texinfo, mpfr}:
+stdenv.mkDerivation rec {
+  pname = "mpfi";
+  version = "1.5.4";
+  file_nr = "38111";
+
+  src = fetchurl {
+    # NOTE: the file_nr is whats important here. The actual package name (including the version)
+    # is ignored. To find out the correct file_nr, go to https://gforge.inria.fr/projects/mpfi/
+    # and click on Download in the section "Latest File Releases".
+    url = "https://gforge.inria.fr/frs/download.php/file/${file_nr}/mpfi-${version}.tgz";
+    sha256 = "sha256-Ozk4WV1yCvF5c96vcnz8DdQcixbCCtwQOpcPSkOuOlY=";
+  };
+
+  nativeBuildInputs = [ autoreconfHook texinfo ];
+  buildInputs = [ mpfr ];
+
+  meta = {
+    description = "A multiple precision interval arithmetic library based on MPFR";
+    homepage = "https://gforge.inria.fr/projects/mpfi/";
+    license = lib.licenses.lgpl21Plus;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mpfr/default.nix b/nixpkgs/pkgs/development/libraries/mpfr/default.nix
new file mode 100644
index 000000000000..fc7eeeab9420
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mpfr/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv, fetchurl, gmp }:
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+stdenv.mkDerivation rec {
+  version = "4.1.0";
+  pname = "mpfr";
+
+  src = fetchurl {
+    urls = [
+      #"https://www.mpfr.org/${name}/${name}.tar.xz"
+      "mirror://gnu/mpfr/${pname}-${version}.tar.xz"
+    ];
+    sha256 = "0zwaanakrqjf84lfr5hfsdr7hncwv9wj0mchlr7cmxigfgqs760c";
+  };
+
+  outputs = [ "out" "dev" "doc" "info" ];
+
+  # mpfr.h requires gmp.h
+  propagatedBuildInputs = [ gmp ];
+
+  configureFlags =
+    lib.optional stdenv.hostPlatform.isSunOS "--disable-thread-safe" ++
+    lib.optional stdenv.hostPlatform.is64bit "--with-pic";
+
+  doCheck = true; # not cross;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "https://www.mpfr.org/";
+    description = "Library for multiple-precision floating-point arithmetic";
+
+    longDescription = ''
+      The GNU MPFR library is a C library for multiple-precision
+      floating-point computations with correct rounding.  MPFR is
+      based on the GMP multiple-precision library.
+
+      The main goal of MPFR is to provide a library for
+      multiple-precision floating-point computation which is both
+      efficient and has a well-defined semantics.  It copies the good
+      ideas from the ANSI/IEEE-754 standard for double-precision
+      floating-point arithmetic (53-bit mantissa).
+    '';
+
+    license = lib.licenses.lgpl2Plus;
+
+    maintainers = [ ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mpich/default.nix b/nixpkgs/pkgs/development/libraries/mpich/default.nix
new file mode 100644
index 000000000000..9227cd705430
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mpich/default.nix
@@ -0,0 +1,57 @@
+{ stdenv, lib, fetchurl, perl, gfortran
+, openssh, hwloc
+# either libfabric or ucx work for ch4backend on linux. On darwin, neither of
+# these libraries currently build so this argument is ignored on Darwin.
+, ch4backend
+# Process manager to build
+, withPm ? "hydra:gforker"
+} :
+
+assert (ch4backend.pname == "ucx" || ch4backend.pname == "libfabric");
+
+stdenv.mkDerivation  rec {
+  pname = "mpich";
+  version = "3.4.2";
+
+  src = fetchurl {
+    url = "https://www.mpich.org/static/downloads/${version}/mpich-${version}.tar.gz";
+    sha256 = "1gw7qpb27mhsj7ip0hhljshgpwvz2hmyhizhlp6793afp2lbw6aw";
+  };
+
+  configureFlags = [
+    "--enable-shared"
+    "--enable-sharedlib"
+    "--with-pm=${withPm}"
+  ];
+
+  enableParallelBuilding = true;
+
+  buildInputs = [ perl gfortran openssh hwloc ]
+    ++ lib.optional (!stdenv.isDarwin) ch4backend;
+
+  doCheck = true;
+
+  preFixup = ''
+    # Ensure the default compilers are the ones mpich was built with
+    sed -i 's:CC="gcc":CC=${stdenv.cc}/bin/gcc:' $out/bin/mpicc
+    sed -i 's:CXX="g++":CXX=${stdenv.cc}/bin/g++:' $out/bin/mpicxx
+    sed -i 's:FC="gfortran":FC=${gfortran}/bin/gfortran:' $out/bin/mpifort
+  '';
+
+  meta = with lib; {
+    description = "Implementation of the Message Passing Interface (MPI) standard";
+
+    longDescription = ''
+      MPICH2 is a free high-performance and portable implementation of
+      the Message Passing Interface (MPI) standard, both version 1 and
+      version 2.
+    '';
+    homepage = "http://www.mcs.anl.gov/mpi/mpich2/";
+    license = {
+      url = "http://git.mpich.org/mpich.git/blob/a385d6d0d55e83c3709ae851967ce613e892cd21:/COPYRIGHT";
+      fullName = "MPICH license (permissive)";
+    };
+    maintainers = [ maintainers.markuskowa ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mpir/default.nix b/nixpkgs/pkgs/development/libraries/mpir/default.nix
new file mode 100644
index 000000000000..b8ee4fb4e765
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mpir/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, m4, which, yasm }:
+
+stdenv.mkDerivation rec {
+  pname = "mpir";
+  version = "3.0.0";
+
+  nativeBuildInputs = [ m4 which yasm ];
+
+  src = fetchurl {
+    url = "https://mpir.org/mpir-${version}.tar.bz2";
+    sha256 = "1fvmhrqdjs925hzr2i8bszm50h00gwsh17p2kn2pi51zrxck9xjj";
+  };
+
+  configureFlags = [ "--enable-cxx" ]
+    ++ lib.optionals stdenv.isLinux [ "--enable-fat" ];
+
+  meta = {
+    description = "A highly optimised library for bignum arithmetic forked from GMP";
+    license = lib.licenses.lgpl3Plus;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.unix;
+    downloadPage = "https://mpir.org/downloads.html";
+    homepage = "https://mpir.org/";
+    updateWalker = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mps/default.nix b/nixpkgs/pkgs/development/libraries/mps/default.nix
new file mode 100644
index 000000000000..81b102d9bc36
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mps/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, autoreconfHook, sqlite }:
+
+stdenv.mkDerivation rec {
+  pname = "mps";
+  version = "1.117.0";
+
+  src = fetchurl {
+    url    = "https://www.ravenbrook.com/project/mps/release/${version}/mps-kit-${version}.tar.gz";
+    sha256 = "04ix4l7lk6nxxk9sawpnxbybvqb82lks5606ym10bc1qbc2kqdcz";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ sqlite ];
+
+  # needed for 1.116.0 to build with gcc7
+  NIX_CFLAGS_COMPILE = toString [
+    "-Wno-implicit-fallthrough"
+    "-Wno-error=clobbered"
+    "-Wno-error=cast-function-type"
+  ];
+
+
+  meta = {
+    description = "A flexible memory management and garbage collection library";
+    homepage    = "https://www.ravenbrook.com/project/mps";
+    license     = lib.licenses.sleepycat;
+    platforms   = lib.platforms.linux;
+    maintainers = [ lib.maintainers.thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/msgpack/default.nix b/nixpkgs/pkgs/development/libraries/msgpack/default.nix
new file mode 100644
index 000000000000..d040eff11a32
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/msgpack/default.nix
@@ -0,0 +1,12 @@
+{ callPackage, fetchFromGitHub, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "3.3.0";
+
+  src = fetchFromGitHub {
+    owner  = "msgpack";
+    repo   = "msgpack-c";
+    rev    = "cpp-${version}";
+    sha256 = "02dxgzxlwn8g9ca2j4m0rjvdq1k2iciy6ickj615daz5w8pcjajd";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/msgpack/generic.nix b/nixpkgs/pkgs/development/libraries/msgpack/generic.nix
new file mode 100644
index 000000000000..a784bc026361
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/msgpack/generic.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, cmake
+, version, src, patches ? [ ]
+, ...
+}:
+
+stdenv.mkDerivation {
+  pname = "msgpack";
+  inherit version;
+
+  inherit src patches;
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "-DMSGPACK_BUILD_EXAMPLES=OFF";
+
+  meta = with lib; {
+    description = "MessagePack implementation for C and C++";
+    homepage    = "https://msgpack.org";
+    license     = licenses.asl20;
+    maintainers = with maintainers; [ redbaron ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/msgpuck/default.nix b/nixpkgs/pkgs/development/libraries/msgpuck/default.nix
new file mode 100644
index 000000000000..cc7b056bb988
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/msgpuck/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "msgpuck";
+  version = "2.0";
+
+  src = fetchFromGitHub {
+    owner = "rtsisyk";
+    repo = "msgpuck";
+    rev = version;
+    sha256 = "0cjq86kncn3lv65vig9cqkqqv2p296ymcjjbviw0j1s85cfflps0";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  meta = with lib; {
+     description = "A simple and efficient MsgPack binary serialization library in a self-contained header file";
+     homepage = "https://github.com/rtsisyk/msgpuck";
+     license = licenses.bsd2;
+     platforms = platforms.all;
+     maintainers = with maintainers; [ izorkin ];
+ };
+}
diff --git a/nixpkgs/pkgs/development/libraries/msilbc/default.nix b/nixpkgs/pkgs/development/libraries/msilbc/default.nix
new file mode 100644
index 000000000000..b5eaee26aa03
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/msilbc/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, ilbc, mediastreamer, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "msilbc";
+  version = "2.1.2";
+
+  src = fetchurl {
+    url = "mirror://savannah/linphone/plugins/sources/${pname}-${version}.tar.gz";
+    sha256 = "07j02y994ybh274fp7ydjvi76h34y2c34ndwjpjfcwwr03b48cfp";
+  };
+
+  propagatedBuildInputs = [ ilbc mediastreamer ];
+  nativeBuildInputs = [ pkg-config ];
+
+  configureFlags = [
+    "ILBC_LIBS=ilbc" "ILBC_CFLAGS=-I${ilbc}/include"
+    "MEDIASTREAMER_LIBS=mediastreamer" "MEDIASTREAMER_CFLAGS=-I${mediastreamer}/include"
+  ];
+
+  meta = with lib; {
+    description = "Mediastreamer plugin for the iLBC audio codec";
+    platforms = platforms.linux;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mtdev/default.nix b/nixpkgs/pkgs/development/libraries/mtdev/default.nix
new file mode 100644
index 000000000000..4a510762f7f0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mtdev/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "mtdev";
+  version = "1.1.6";
+
+  src = fetchurl {
+    url = "https://bitmath.org/code/mtdev/${pname}-${version}.tar.bz2";
+    sha256 = "1q700h9dqcm3zl6c3gj0qxxjcx6ibw2c51wjijydhwdcm26v5mqm";
+  };
+
+  meta = with lib; {
+    homepage = "http://bitmath.org/code/mtdev/";
+    description = "Multitouch Protocol Translation Library";
+    longDescription = ''
+      The mtdev is a stand-alone library which transforms all variants of
+      kernel MT events to the slotted type B protocol. The events put into
+      mtdev may be from any MT device, specifically type A without contact
+      tracking, type A with contact tracking, or type B with contact tracking.
+      See the kernel documentation for further details.
+    '';
+    license = licenses.mit;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mtxclient/default.nix b/nixpkgs/pkgs/development/libraries/mtxclient/default.nix
new file mode 100644
index 000000000000..05950bc68654
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mtxclient/default.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, pkg-config
+, boost17x
+, openssl
+, olm
+, spdlog
+, nlohmann_json
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mtxclient";
+  version = "0.5.1";
+
+  src = fetchFromGitHub {
+    owner = "Nheko-Reborn";
+    repo = "mtxclient";
+    rev = "v${version}";
+    sha256 = "sha256-UKroV1p7jYuNzCAFMsuUsYC/C9AZ1D4rhwpwuER39vc=";
+  };
+
+  cmakeFlags = [
+    # Network requiring tests can't be disabled individually:
+    # https://github.com/Nheko-Reborn/mtxclient/issues/22
+    "-DBUILD_LIB_TESTS=OFF"
+    "-DBUILD_LIB_EXAMPLES=OFF"
+    "-Dnlohmann_json_DIR=${nlohmann_json}/lib/cmake/nlohmann_json"
+    # Can be removed once either https://github.com/NixOS/nixpkgs/pull/85254 or
+    # https://github.com/NixOS/nixpkgs/pull/73940 are merged
+    "-DBoost_NO_BOOST_CMAKE=TRUE"
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+  buildInputs = [
+    spdlog
+    boost17x
+    openssl
+    olm
+  ];
+
+  meta = with lib; {
+    description = "Client API library for Matrix, built on top of Boost.Asio";
+    homepage = "https://github.com/Nheko-Reborn/mtxclient";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fpletz pstn ];
+    platforms = platforms.all;
+    # Should be fixable if a higher clang version is used, see:
+    # https://github.com/NixOS/nixpkgs/pull/85922#issuecomment-619287177
+    broken = stdenv.targetPlatform.isDarwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/multipart-parser-c/default.nix b/nixpkgs/pkgs/development/libraries/multipart-parser-c/default.nix
new file mode 100644
index 000000000000..45b0abdee71b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/multipart-parser-c/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv
+, fetchFromGitHub
+}:
+
+stdenv.mkDerivation rec {
+  pname = "multipart-parser-c";
+  version = "unstable-2015-12-14";
+
+  src = fetchFromGitHub {
+    owner = "iafonov";
+    repo = pname;
+    rev = "772639cf10db6d9f5a655ee9b7eb20b815fab396";
+    sha256 = "056r63vj8f1rwf3wk7jmwhm8ba25l6h1gs6jnkh0schbwcvi56xl";
+  };
+
+  buildPhase = ''
+    make solib
+  '';
+
+  installPhase = ''
+    mkdir -p $out/lib
+    mv lib*${stdenv.targetPlatform.extensions.sharedLibrary} $out/lib/
+
+    mkdir -p $out/include
+    mv *.h $out/include/
+  '';
+
+  meta = {
+    description = "Http multipart parser implemented in C ";
+    homepage = "https://github.com/iafonov/multipart-parser-c";
+    license = [ lib.licenses.mit ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/mumlib/default.nix b/nixpkgs/pkgs/development/libraries/mumlib/default.nix
new file mode 100644
index 000000000000..02f0cd671f28
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mumlib/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, lib, fetchFromGitHub, cmake, pkg-config
+, boost, openssl, log4cpp, libopus, protobuf }:
+with lib; stdenv.mkDerivation {
+  pname = "mumlib";
+  version = "unstable-2018-12-12";
+
+  src = fetchFromGitHub {
+    owner = "slomkowski";
+    repo = "mumlib";
+    rev = "f91720de264c0ab5e02bb30deafc5c4b2c245eac";
+    sha256 = "0p29z8379dp2ra0420x8xjp4d3r2mf680lj38xmlc8npdzqjqjdp";
+  };
+
+  buildInputs = [ boost openssl libopus protobuf log4cpp ];
+  nativeBuildInputs = [ cmake pkg-config ];
+  installPhase = ''
+    install -Dm555 libmumlib.so $out/lib/libmumlib.so
+    cp -a ../include $out
+  '';
+
+  meta = {
+    description = "Fairy simple Mumble library written in C++, using boost::asio asynchronous networking framework";
+    homepage = "https://github.com/slomkowski/mumlib";
+    maintainers = with maintainers; [ das_j ];
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/muparser/default.nix b/nixpkgs/pkgs/development/libraries/muparser/default.nix
new file mode 100644
index 000000000000..f213f39c06d3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/muparser/default.nix
@@ -0,0 +1,22 @@
+{lib, stdenv, fetchurl, unzip, setfile}:
+
+stdenv.mkDerivation rec {
+  pname = "muparser";
+  version = "2.2.3";
+  url-version = lib.replaceChars ["."] ["_"] version;
+
+  src = fetchurl {
+    url = "mirror://sourceforge/muparser/muparser_v${url-version}.zip";
+    sha256 = "00l92k231yb49wijzkspa2l58mapn6vh2dlxnlg0pawjjfv33s6z";
+  };
+
+  nativeBuildInputs = [ unzip ];
+  buildInputs = lib.optionals stdenv.isDarwin [setfile];
+
+  meta = {
+    homepage = "http://muparser.sourceforge.net";
+    description = "An extensible high performance math expression parser library written in C++";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/muparserx/default.nix b/nixpkgs/pkgs/development/libraries/muparserx/default.nix
new file mode 100644
index 000000000000..4d3036d4cfbb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/muparserx/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "muparserx";
+  version = "4.0.8";
+
+  src = fetchFromGitHub {
+    owner = "beltoforion";
+    repo = "muparserx";
+    rev = "v${version}";
+    sha256 = "097pkdffv0phr0345hy06mjm5pfy259z13plsvbxvcmds80wl48v";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=Release"
+  ];
+
+  doCheck = true;
+  checkPhase = ''
+    echo "***Muparserx self-test***"
+    echo "quit" | ./example > test_result.log
+    cat test_result.log
+    if grep -Fqi "failed" test_result.log; then
+      echo ">=1 muparserx tests failed"
+      exit 1
+    else
+      echo -e "\nmuparserx tests succeeded"
+    fi
+  '';
+
+  meta = with lib; {
+    description = "A C++ Library for Parsing Expressions with Strings, Complex Numbers, Vectors, Matrices and more";
+    homepage = "https://beltoforion.de/en/muparserx/";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ drewrisinger ];
+    # selftest fails
+    broken = stdenv.isDarwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mustache-hpp/default.nix b/nixpkgs/pkgs/development/libraries/mustache-hpp/default.nix
new file mode 100644
index 000000000000..373f232a9866
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mustache-hpp/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "mustache";
+  version = "4.1";
+
+  src = fetchFromGitHub {
+    owner = "kainjow";
+    repo = "Mustache";
+    rev = "v${version}";
+    sha256 = "0r9rbk6v1wpld2ismfsk2lkhbyv3dkf0p03hkjivbj05qkfhvlbb";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  installPhase = ''
+    mkdir -p $out/include
+    cp ../mustache.hpp $out/include
+  '';
+
+  meta = with lib; {
+    description = "Mustache text templates for modern C++";
+    homepage = "https://github.com/kainjow/Mustache";
+    license = licenses.boost;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mutest/default.nix b/nixpkgs/pkgs/development/libraries/mutest/default.nix
new file mode 100644
index 000000000000..f2d3a5595530
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mutest/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv
+, fetchFromGitHub
+, meson
+, ninja
+}:
+
+stdenv.mkDerivation {
+  pname = "mutest";
+  version = "unstable-2019-08-26";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "ebassi";
+    repo = "mutest";
+    rev = "e6246c9ae4f36ffe8c021f0a80438f6c7a6efa3a";
+    sha256 = "0gdqwq6fvk06wld4rhnw5752hahrvhd69zrci045x25rwx90x26q";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://ebassi.github.io/mutest/mutest.md.html";
+    description = "A BDD testing framework for C, inspired by Mocha";
+    license = licenses.mit;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mvapich/default.nix b/nixpkgs/pkgs/development/libraries/mvapich/default.nix
new file mode 100644
index 000000000000..704a28dbb8cd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mvapich/default.nix
@@ -0,0 +1,73 @@
+{ lib, stdenv, fetchurl, pkg-config, bison, numactl, libxml2
+, perl, gfortran, slurm, openssh, hwloc, zlib, makeWrapper
+# InfiniBand dependencies
+, opensm, rdma-core
+# OmniPath dependencies
+, libpsm2, libfabric
+# Compile with slurm as a process manager
+, useSlurm ? false
+# Network type for MVAPICH2
+, network ? "ethernet"
+} :
+
+assert builtins.elem network [ "ethernet" "infiniband" "omnipath" ];
+
+stdenv.mkDerivation rec {
+  pname = "mvapich";
+  version = "2.3.6";
+
+  src = fetchurl {
+    url = "http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-${version}.tar.gz";
+    sha256 = "0jd28vy9ivl3rcpkxmhw73b6krzm0pd9jps8asw92wa00lm2z9mk";
+  };
+
+  nativeBuildInputs = [ pkg-config bison makeWrapper ];
+  propagatedBuildInputs = [ numactl rdma-core zlib opensm ];
+  buildInputs = with lib; [
+    numactl
+    libxml2
+    perl
+    gfortran
+    openssh
+    hwloc
+  ] ++ optionals (network == "infiniband") [ rdma-core opensm ]
+    ++ optionals (network == "omnipath") [ libpsm2 libfabric ]
+    ++ optional useSlurm slurm;
+
+  configureFlags = with lib; [
+    "--with-pm=hydra"
+    "--enable-fortran=all"
+    "--enable-cxx"
+    "--enable-threads=multiple"
+    "--enable-hybrid"
+    "--enable-shared"
+  ] ++ optional useSlurm "--with-pm=slurm"
+    ++ optional (network == "ethernet") "--with-device=ch3:sock"
+    ++ optionals (network == "infiniband") [ "--with-device=ch3:mrail" "--with-rdma=gen2" ]
+    ++ optionals (network == "omnipath") ["--with-device=ch3:psm" "--with-psm2=${libpsm2}"];
+
+  doCheck = true;
+
+  preFixup = ''
+    # /tmp/nix-build... ends up in the RPATH, fix it manually
+    for entry in $out/bin/mpichversion $out/bin/mpivars; do
+      echo "fix rpath: $entry"
+      patchelf --set-rpath "$out/lib" $entry
+    done
+
+    # Ensure the default compilers are the ones mvapich was built with
+    substituteInPlace $out/bin/mpicc --replace 'CC="gcc"' 'CC=${stdenv.cc}/bin/cc'
+    substituteInPlace $out/bin/mpicxx --replace 'CXX="g++"' 'CXX=${stdenv.cc}/bin/c++'
+    substituteInPlace $out/bin/mpifort --replace 'FC="gfortran"' 'FC=${gfortran}/bin/gfortran'
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "MPI-3.1 implementation optimized for Infiband transport";
+    homepage = "https://mvapich.cse.ohio-state.edu";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.markuskowa ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mygui/default.nix b/nixpkgs/pkgs/development/libraries/mygui/default.nix
new file mode 100644
index 000000000000..740c1fec8834
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mygui/default.nix
@@ -0,0 +1,30 @@
+{  lib, stdenv, fetchFromGitHub, libX11, cmake, ois, freetype, libuuid,
+   boost, pkg-config, withOgre ? false, ogre ? null, libGL, libGLU ? null } :
+
+let
+  renderSystem = if withOgre then "3" else "4";
+in stdenv.mkDerivation rec {
+  pname = "mygui";
+  version = "3.4.0";
+
+  src = fetchFromGitHub {
+    owner = "MyGUI";
+    repo = "mygui";
+    rev = "MyGUI${version}";
+    sha256 = "0a4zi8w18pjj813n7kmxldl1d9r1jp0iyhkw7pbqgl8f7qaq994w";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ libX11 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}" ];
+
+  meta = with lib; {
+    homepage = "http://mygui.info/";
+    description = "Library for creating GUIs for games and 3D applications";
+    license = licenses.lgpl3Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mypaint-brushes/1.0.nix b/nixpkgs/pkgs/development/libraries/mypaint-brushes/1.0.nix
new file mode 100644
index 000000000000..73acfd9287f7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mypaint-brushes/1.0.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv
+, autoconf
+, automake
+, fetchFromGitHub
+, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mypaint-brushes";
+  version = "1.3.1";
+
+  src = fetchFromGitHub {
+    owner = "mypaint";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1c95l1vfz7sbrdlzrbz7h1p6s1k113kyjfd9wfnxlm0p6562cz3j";
+  };
+
+  nativeBuildInputs = [
+    autoconf
+    automake
+    pkg-config
+  ];
+
+  preConfigure = "./autogen.sh";
+
+  meta = with lib; {
+    homepage = "http://mypaint.org/";
+    description = "Brushes used by MyPaint and other software using libmypaint";
+    license = licenses.cc0;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mypaint-brushes/default.nix b/nixpkgs/pkgs/development/libraries/mypaint-brushes/default.nix
new file mode 100644
index 000000000000..acdee52b85ef
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mypaint-brushes/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv
+, autoconf
+, automake
+, fetchFromGitHub
+, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mypaint-brushes";
+  version = "2.0.2";
+
+  src = fetchFromGitHub {
+    owner = "mypaint";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0kcqz13vzpy24dhmrx9hbs6s7hqb8y305vciznm15h277sabpmw9";
+  };
+
+  nativeBuildInputs = [
+    autoconf
+    automake
+    pkg-config
+  ];
+
+  preConfigure = "./autogen.sh";
+
+  meta = with lib; {
+    homepage = "http://mypaint.org/";
+    description = "Brushes used by MyPaint and other software using libmypaint";
+    license = licenses.cc0;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mysocketw/default.nix b/nixpkgs/pkgs/development/libraries/mysocketw/default.nix
new file mode 100644
index 000000000000..7997fc18d111
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mysocketw/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "mysocketw";
+  version = "031026";
+  src = fetchurl {
+    url = "https://www.digitalfanatics.org/cal/socketw/files/SocketW${version}.tar.gz";
+    sha256 = "0crinikhdl7xihzmc3k3k41pgxy16d5ci8m9sza1lbibns7pdwj4";
+  };
+
+  patches = [ ./gcc.patch ];
+
+  buildInputs = [ openssl ];
+
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace src/Makefile \
+        --replace -Wl,-soname, -Wl,-install_name,$out/lib/
+  '';
+
+  makeFlags = [ "PREFIX=$(out)" "CXX=${stdenv.cc.targetPrefix}c++" ];
+
+  meta = {
+    description = "Cross platform (Linux/FreeBSD/Unix/Win32) streaming socket C++";
+    license = lib.licenses.lgpl21Plus;
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/mysocketw/gcc.patch b/nixpkgs/pkgs/development/libraries/mysocketw/gcc.patch
new file mode 100644
index 000000000000..7779a18fa528
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mysocketw/gcc.patch
@@ -0,0 +1,13 @@
+I picked it up from:
+http://www.rigsofrods.com/wiki/images/c/c0/Socketw.patch
+
+--- a/src/sw_base.cxx.old	2009-12-19 21:19:31.057051328 -0800
++++ b/src/sw_base.cxx	2009-12-19 21:19:44.939551918 -0800
+@@ -19,6 +19,7 @@
+ #include <time.h>
+ #include <stdio.h>
+ #include <string.h>
++#include <stdlib.h>
+ 
+ #ifndef __WIN32__
+   #include <netdb.h>
diff --git a/nixpkgs/pkgs/development/libraries/mythes/default.nix b/nixpkgs/pkgs/development/libraries/mythes/default.nix
new file mode 100644
index 000000000000..b678baf98819
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/mythes/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl, hunspell, ncurses, pkg-config, perl }:
+
+stdenv.mkDerivation rec {
+  name = "mythes-1.2.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/hunspell/${name}.tar.gz";
+    sha256 = "0prh19wy1c74kmzkkavm9qslk99gz8h8wmjvwzjc6lf8v2az708y";
+  };
+
+  buildInputs = [ hunspell ];
+  nativeBuildInputs = [ ncurses pkg-config perl ];
+
+  meta = {
+    homepage = "http://hunspell.sourceforge.net/";
+    description = "Thesaurus library from Hunspell project";
+    license = lib.licenses.bsd3;
+    inherit (hunspell.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nanoflann/default.nix b/nixpkgs/pkgs/development/libraries/nanoflann/default.nix
new file mode 100644
index 000000000000..0dbbd461dc21
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nanoflann/default.nix
@@ -0,0 +1,29 @@
+{lib, stdenv, fetchFromGitHub, cmake}:
+
+stdenv.mkDerivation rec {
+  version = "1.3.2";
+  pname = "nanoflann";
+
+  src = fetchFromGitHub {
+    owner = "jlblancoc";
+    repo = "nanoflann";
+    rev = "v${version}";
+    sha256 = "0lq1zqwjvk8wv15hd7aw57jsqbvv45cwb8ngdh1d2iyw5rvnbhsn";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    "-DBUILD_EXAMPLES=OFF"
+  ];
+
+  doCheck = true;
+  checkTarget = "test";
+
+  meta = {
+    homepage = "https://github.com/jlblancoc/nanoflann";
+    license = lib.licenses.bsd2;
+    description = "Header only C++ library for approximate nearest neighbor search";
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nanomsg/default.nix b/nixpkgs/pkgs/development/libraries/nanomsg/default.nix
new file mode 100644
index 000000000000..49a93abd7fb0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nanomsg/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, cmake, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  version = "1.1.5";
+  pname = "nanomsg";
+
+  src = fetchFromGitHub {
+    owner = "nanomsg";
+    repo = "nanomsg";
+    rev = version;
+    sha256 = "01ddfzjlkf2dgijrmm3j3j8irccsnbgfvjcnwslsfaxnrmrq5s64";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description= "Socket library that provides several common communication patterns";
+    homepage = "https://nanomsg.org/";
+    license = licenses.mit;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nanopb/default.nix b/nixpkgs/pkgs/development/libraries/nanopb/default.nix
new file mode 100644
index 000000000000..ca078a3f9d2a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nanopb/default.nix
@@ -0,0 +1,74 @@
+{ callPackage
+, cmake
+, fetchFromGitHub
+, lib
+, protobuf
+, python3
+, stdenv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "nanopb";
+  version = "0.4.5";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = version;
+    sha256 = "0cjfkwwzi018kc0b7lia7z2jdfgibqc99mf8rvj2xq2pfapp9kf1";
+  };
+
+  nativeBuildInputs = [ cmake python3 python3.pkgs.wrapPython ];
+
+  pythonPath = with python3.pkgs; [ python3.pkgs.protobuf six ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON" # generate $out/lib/libprotobuf-nanopb.so{.0,}
+    "-DBUILD_STATIC_LIBS=ON" # generate $out/lib/libprotobuf-nanopb.a
+    "-Dnanopb_PROTOC_PATH=${protobuf}/bin/protoc"
+  ];
+
+  postInstall = ''
+    mkdir -p $out/share/nanopb/generator/proto
+    cp ../generator/proto/nanopb.proto $out/share/nanopb/generator/proto/nanopb.proto
+    cp ../pb_common.c ../pb_decode.c ../pb_encode.c $out/include/
+  '';
+
+  postFixup = ''
+    wrapPythonPrograms
+  '';
+
+  passthru.tests = {
+    simple-proto2 = callPackage ./test-simple-proto2 {};
+    simple-proto3 = callPackage ./test-simple-proto3 {};
+    message-with-annotations = callPackage ./test-message-with-annotations {};
+    message-with-options = callPackage ./test-message-with-options {};
+  };
+
+  meta = with lib; {
+    inherit (protobuf.meta) platforms;
+
+    description = "Protocol Buffers with small code size";
+    homepage = "https://jpa.kapsi.fi/nanopb/";
+    license = licenses.zlib;
+    maintainers = with maintainers; [ kalbasit ];
+
+    longDescription = ''
+      Nanopb is a small code-size Protocol Buffers implementation in ansi C. It
+      is especially suitable for use in microcontrollers, but fits any memory
+      restricted system.
+
+      - Homepage: jpa.kapsi.fi/nanopb
+      - Documentation: jpa.kapsi.fi/nanopb/docs
+      - Downloads: jpa.kapsi.fi/nanopb/download
+      - Forum: groups.google.com/forum/#!forum/nanopb
+
+      In order to use the nanopb options in your proto files, you'll need to
+      tell protoc where to find the nanopb.proto file.
+      You can do so with the --proto_path (-I) option to add the directory
+      ''${nanopb}/share/nanopb/generator/proto like so:
+
+      protoc --proto_path=. --proto_path=''${nanopb}/share/nanopb/generator/proto --plugin=protoc-gen-nanopb=''${nanopb}/bin/protoc-gen-nanopb --nanopb_out=out file.proto
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nanopb/test-message-with-annotations/default.nix b/nixpkgs/pkgs/development/libraries/nanopb/test-message-with-annotations/default.nix
new file mode 100644
index 000000000000..9eca4dbb9368
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nanopb/test-message-with-annotations/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, protobuf, nanopb }:
+
+stdenv.mkDerivation {
+  name = "nanopb-test-message-with-annotations";
+  meta.timeout = 60;
+  src = ./.;
+
+  # protoc requires any .proto file to be compiled to reside within it's
+  # proto_path. By default the current directory is automatically added to the
+  # proto_path. I tried using --proto_path ${./.} ${./simple.proto} and it did
+  # not work because they end up in the store at different locations.
+  dontInstall = true;
+  buildPhase = ''
+    mkdir $out
+
+    ${protobuf}/bin/protoc --proto_path=. --proto_path=${nanopb}/share/nanopb/generator/proto --plugin=protoc-gen-nanopb=${nanopb}/bin/protoc-gen-nanopb --nanopb_out=$out withannotations.proto
+  '';
+
+  doCheck = true;
+  checkPhase = ''
+    grep -q WithAnnotations $out/withannotations.pb.c || (echo "error: WithAnnotations not found in $out/withannotations.pb.c"; exit 1)
+    grep -q WithAnnotations $out/withannotations.pb.h || (echo "error: WithAnnotations not found in $out/withannotations.pb.h"; exit 1)
+    grep -q "pb_byte_t uuid\[16\]" $out/withannotations.pb.h || (echo "error: uuid is not of type pb_byte_t and of size 16 in $out/withannotations.pb.h"; exit 1)
+    grep -q "FIXED_LENGTH_BYTES, uuid" $out/withannotations.pb.h || (echo "error: uuid is not of fixed lenght bytes in $out/withannotations.pb.h"; exit 1)
+    grep -q "#define WithAnnotations_size" $out/withannotations.pb.h || (echo "error: the size of WithAnnotations is not known in $out/withannotations.pb.h"; exit 1)
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/nanopb/test-message-with-annotations/withannotations.proto b/nixpkgs/pkgs/development/libraries/nanopb/test-message-with-annotations/withannotations.proto
new file mode 100644
index 000000000000..d8109e877d68
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nanopb/test-message-with-annotations/withannotations.proto
@@ -0,0 +1,7 @@
+syntax = "proto3";
+
+import "nanopb.proto";
+
+message WithAnnotations {
+  bytes uuid = 1 [(nanopb).max_size = 16, (nanopb).fixed_length = true];
+}
diff --git a/nixpkgs/pkgs/development/libraries/nanopb/test-message-with-options/default.nix b/nixpkgs/pkgs/development/libraries/nanopb/test-message-with-options/default.nix
new file mode 100644
index 000000000000..0030158df91b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nanopb/test-message-with-options/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, protobuf, nanopb }:
+
+stdenv.mkDerivation {
+  name = "nanopb-test-message-with-options";
+  meta.timeout = 60;
+  src = ./.;
+
+  # protoc requires any .proto file to be compiled to reside within it's
+  # proto_path. By default the current directory is automatically added to the
+  # proto_path. I tried using --proto_path ${./.} ${./simple.proto} and it did
+  # not work because they end up in the store at different locations.
+  dontInstall = true;
+  buildPhase = ''
+    mkdir $out
+
+    ${protobuf}/bin/protoc --plugin=protoc-gen-nanopb=${nanopb}/bin/protoc-gen-nanopb --nanopb_out=$out withoptions.proto
+  '';
+
+  doCheck = true;
+  checkPhase = ''
+    grep -q WithOptions $out/withoptions.pb.c || (echo "error: WithOptions not found in $out/withoptions.pb.c"; exit 1)
+    grep -q WithOptions $out/withoptions.pb.h || (echo "error: WithOptions not found in $out/withoptions.pb.h"; exit 1)
+    grep -q "pb_byte_t uuid\[16\]" $out/withoptions.pb.h || (echo "error: uuid is not of type pb_byte_t and of size 16 in $out/withoptions.pb.h"; exit 1)
+    grep -q "FIXED_LENGTH_BYTES, uuid" $out/withoptions.pb.h || (echo "error: uuid is not of fixed lenght bytes in $out/withoptions.pb.h"; exit 1)
+    grep -q "#define WithOptions_size" $out/withoptions.pb.h || (echo "error: the size of WithOptions is not known in $out/withoptions.pb.h"; exit 1)
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/nanopb/test-message-with-options/withoptions.options b/nixpkgs/pkgs/development/libraries/nanopb/test-message-with-options/withoptions.options
new file mode 100644
index 000000000000..ecf98a217367
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nanopb/test-message-with-options/withoptions.options
@@ -0,0 +1 @@
+ WithOptions.uuid max_size:16 fixed_length:true
diff --git a/nixpkgs/pkgs/development/libraries/nanopb/test-message-with-options/withoptions.proto b/nixpkgs/pkgs/development/libraries/nanopb/test-message-with-options/withoptions.proto
new file mode 100644
index 000000000000..5a5da3a1c973
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nanopb/test-message-with-options/withoptions.proto
@@ -0,0 +1,5 @@
+syntax = "proto3";
+
+message WithOptions {
+  bytes uuid = 1;
+}
diff --git a/nixpkgs/pkgs/development/libraries/nanopb/test-simple-proto2/default.nix b/nixpkgs/pkgs/development/libraries/nanopb/test-simple-proto2/default.nix
new file mode 100644
index 000000000000..d1d3e1a855a7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nanopb/test-simple-proto2/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, protobuf, nanopb }:
+
+stdenv.mkDerivation {
+  name = "nanopb-test-simple-proto2";
+  meta.timeout = 60;
+  src = ./.;
+
+  # protoc requires any .proto file to be compiled to reside within it's
+  # proto_path. By default the current directory is automatically added to the
+  # proto_path. I tried using --proto_path ${./.} ${./simple.proto} and it did
+  # not work because they end up in the store at different locations.
+  dontInstall = true;
+  buildPhase = ''
+    mkdir $out
+
+    ${protobuf}/bin/protoc --plugin=protoc-gen-nanopb=${nanopb}/bin/protoc-gen-nanopb --nanopb_out=$out simple.proto
+  '';
+
+  doCheck = true;
+  checkPhase = ''
+    grep -q SimpleMessage $out/simple.pb.c || (echo "ERROR: SimpleMessage not found in $out/simple.pb.c"; exit 1)
+    grep -q SimpleMessage $out/simple.pb.h || (echo "ERROR: SimpleMessage not found in $out/simple.pb.h"; exit 1)
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/nanopb/test-simple-proto2/simple.proto b/nixpkgs/pkgs/development/libraries/nanopb/test-simple-proto2/simple.proto
new file mode 100644
index 000000000000..b02936b1ae26
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nanopb/test-simple-proto2/simple.proto
@@ -0,0 +1,5 @@
+syntax = "proto2";
+
+message SimpleMessage {
+  required int32 lucky_number = 1;
+}
diff --git a/nixpkgs/pkgs/development/libraries/nanopb/test-simple-proto3/default.nix b/nixpkgs/pkgs/development/libraries/nanopb/test-simple-proto3/default.nix
new file mode 100644
index 000000000000..71507054458f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nanopb/test-simple-proto3/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, protobuf, nanopb }:
+
+stdenv.mkDerivation {
+  name = "nanopb-test-simple-proto3";
+  meta.timeout = 60;
+  src = ./.;
+
+  # protoc requires any .proto file to be compiled to reside within it's
+  # proto_path. By default the current directory is automatically added to the
+  # proto_path. I tried using --proto_path ${./.} ${./simple.proto} and it did
+  # not work because they end up in the store at different locations.
+  dontInstall = true;
+  buildPhase = ''
+    mkdir $out
+
+    ${protobuf}/bin/protoc --plugin=protoc-gen-nanopb=${nanopb}/bin/protoc-gen-nanopb --nanopb_out=$out simple.proto
+  '';
+
+  doCheck = true;
+  checkPhase = ''
+    grep -q SimpleMessage $out/simple.pb.c || (echo "ERROR: SimpleMessage not found in $out/simple.pb.c"; exit 1)
+    grep -q SimpleMessage $out/simple.pb.h || (echo "ERROR: SimpleMessage not found in $out/simple.pb.h"; exit 1)
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/nanopb/test-simple-proto3/simple.proto b/nixpkgs/pkgs/development/libraries/nanopb/test-simple-proto3/simple.proto
new file mode 100644
index 000000000000..6b99cdb5daa7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nanopb/test-simple-proto3/simple.proto
@@ -0,0 +1,5 @@
+syntax = "proto3";
+
+message SimpleMessage {
+  int32 lucky_number = 1;
+}
diff --git a/nixpkgs/pkgs/development/libraries/nco/default.nix b/nixpkgs/pkgs/development/libraries/nco/default.nix
new file mode 100644
index 000000000000..e551e439051d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nco/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchzip, netcdf, netcdfcxx4, gsl, udunits, antlr2, which, curl, flex, coreutils }:
+
+stdenv.mkDerivation rec {
+  version = "5.0.1";
+  pname = "nco";
+
+  nativeBuildInputs = [ flex which antlr2 ];
+  buildInputs = [ netcdf netcdfcxx4 gsl udunits curl coreutils ];
+
+  src = fetchzip {
+    url = "https://github.com/nco/nco/archive/${version}.tar.gz";
+    sha256 = "sha256-Mdnko+0ZuMoKgBp//+rCVsbFJx90Tmrnal7FAmwIKEQ=";
+  };
+
+  prePatch = ''
+    substituteInPlace src/nco/nco_fl_utl.c \
+      --replace "/bin/cp" "${coreutils}/bin/cp"
+    substituteInPlace src/nco/nco_fl_utl.c \
+      --replace "/bin/mv" "${coreutils}/bin/mv"
+  '';
+
+  parallelBuild = true;
+
+  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/";
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.bzizou ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ncurses/clang.patch b/nixpkgs/pkgs/development/libraries/ncurses/clang.patch
new file mode 100644
index 000000000000..ce33049bf405
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ncurses/clang.patch
@@ -0,0 +1,42 @@
+diff -ruNp ncurses-5.8.orig/c++/cursesf.h ncurses-5.8/c++/cursesf.h
+--- ncurses-5.8.orig/c++/cursesf.h	2005-08-13 21:08:24.000000000 +0300
++++ ncurses-5.8/c++/cursesf.h	2011-04-03 18:29:29.000000000 +0300
+@@ -681,7 +681,7 @@ public:
+ 		   const T* p_UserData = STATIC_CAST(T*)(0),
+ 		   bool with_frame=FALSE,
+ 		   bool autoDelete_Fields=FALSE)
+-    : NCursesForm (Fields, with_frame, autoDelete_Fields) {
++    : NCursesForm (&Fields, with_frame, autoDelete_Fields) {
+       if (form)
+ 	set_user (const_cast<void *>(p_UserData));
+   };
+@@ -694,7 +694,7 @@ public:
+ 		   const T* p_UserData = STATIC_CAST(T*)(0),
+ 		   bool with_frame=FALSE,
+ 		   bool autoDelete_Fields=FALSE)
+-    : NCursesForm (Fields, nlines, ncols, begin_y, begin_x,
++    : NCursesForm (&Fields, nlines, ncols, begin_y, begin_x,
+ 		   with_frame, autoDelete_Fields) {
+       if (form)
+ 	set_user (const_cast<void *>(p_UserData));
+diff -ruNp ncurses-5.8.orig/c++/cursesm.h ncurses-5.8/c++/cursesm.h
+--- ncurses-5.8.orig/c++/cursesm.h	2005-08-13 21:10:36.000000000 +0300
++++ ncurses-5.8/c++/cursesm.h	2011-04-03 18:31:42.000000000 +0300
+@@ -639,7 +639,7 @@ public:
+ 		   const T* p_UserData = STATIC_CAST(T*)(0),
+ 		   bool with_frame=FALSE,
+ 		   bool autoDelete_Items=FALSE)
+-    : NCursesMenu (Items, with_frame, autoDelete_Items) {
++    : NCursesMenu (&Items, with_frame, autoDelete_Items) {
+       if (menu)
+ 	set_user (const_cast<void *>(p_UserData));
+   };
+@@ -651,7 +651,7 @@ public:
+ 		   int begin_x = 0,
+ 		   const T* p_UserData = STATIC_CAST(T*)(0),
+ 		   bool with_frame=FALSE)
+-    : NCursesMenu (Items, nlines, ncols, begin_y, begin_x, with_frame) {
++    : NCursesMenu (&Items, nlines, ncols, begin_y, begin_x, with_frame) {
+       if (menu)
+ 	set_user (const_cast<void *>(p_UserData));
+   };
diff --git a/nixpkgs/pkgs/development/libraries/ncurses/default.nix b/nixpkgs/pkgs/development/libraries/ncurses/default.nix
new file mode 100644
index 000000000000..dd1eea632e18
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ncurses/default.nix
@@ -0,0 +1,179 @@
+{ lib, stdenv, fetchurl, pkg-config
+
+, abiVersion ? "6"
+, mouseSupport ? false
+, unicode ? true
+, enableStatic ? stdenv.hostPlatform.isStatic
+, enableShared ? !enableStatic
+, withCxx ? !stdenv.hostPlatform.useAndroidPrebuilt
+
+, gpm
+
+, buildPackages
+}:
+
+stdenv.mkDerivation rec {
+  # Note the revision needs to be adjusted.
+  version = "6.2";
+  name = "ncurses-${version}" + lib.optionalString (abiVersion == "5") "-abi5-compat";
+
+  # We cannot use fetchFromGitHub (which calls fetchzip)
+  # because we need to be able to use fetchurlBoot.
+  src = let
+    # Note the version needs to be adjusted.
+    rev = "v${version}";
+  in fetchurl {
+    url = "https://github.com/mirror/ncurses/archive/${rev}.tar.gz";
+    sha256 = "15r2456g0mlq2q7gh2z52vl6zv6y0z8sdchrs80kg4idqd8sm8fd";
+  };
+
+  patches = lib.optional (!stdenv.cc.isClang) ./clang.patch;
+
+  outputs = [ "out" "dev" "man" ];
+  setOutputFlags = false; # some aren't supported
+
+  configureFlags = [
+    (lib.withFeature enableShared "shared")
+    "--without-debug"
+    "--enable-pc-files"
+    "--enable-symlinks"
+    "--with-manpage-format=normal"
+    "--disable-stripping"
+  ] ++ lib.optional unicode "--enable-widec"
+    ++ lib.optional (!withCxx) "--without-cxx"
+    ++ lib.optional (abiVersion == "5") "--with-abi-version=5"
+    ++ lib.optional stdenv.hostPlatform.isNetBSD "--enable-rpath"
+    ++ lib.optionals stdenv.hostPlatform.isWindows [
+      "--enable-sp-funcs"
+      "--enable-term-driver"
+    ];
+
+  # Only the C compiler, and explicitly not C++ compiler needs this flag on solaris:
+  CFLAGS = lib.optionalString stdenv.isSunOS "-D_XOPEN_SOURCE_EXTENDED";
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [
+    pkg-config
+  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+    buildPackages.ncurses
+  ];
+  buildInputs = lib.optional (mouseSupport && stdenv.isLinux) gpm;
+
+  preConfigure = ''
+    export PKG_CONFIG_LIBDIR="$dev/lib/pkgconfig"
+    mkdir -p "$PKG_CONFIG_LIBDIR"
+    configureFlagsArray+=(
+      "--libdir=$out/lib"
+      "--includedir=$dev/include"
+      "--bindir=$dev/bin"
+      "--mandir=$man/share/man"
+      "--with-pkg-config-libdir=$PKG_CONFIG_LIBDIR"
+    )
+  ''
+  + lib.optionalString stdenv.isSunOS ''
+    sed -i -e '/-D__EXTENSIONS__/ s/-D_XOPEN_SOURCE=\$cf_XOPEN_SOURCE//' \
+           -e '/CPPFLAGS="$CPPFLAGS/s/ -D_XOPEN_SOURCE_EXTENDED//' \
+        configure
+    CFLAGS=-D_XOPEN_SOURCE_EXTENDED
+  '';
+
+  enableParallelBuilding = true;
+
+  doCheck = false;
+
+  # When building a wide-character (Unicode) build, create backward
+  # compatibility links from the the "normal" libraries to the
+  # wide-character libraries (e.g. libncurses.so to libncursesw.so).
+  postFixup = let
+    abiVersion-extension = if stdenv.isDarwin then "${abiVersion}.$dylibtype" else "$dylibtype.${abiVersion}"; in
+  ''
+    # Determine what suffixes our libraries have
+    suffix="$(awk -F': ' 'f{print $3; f=0} /default library suffix/{f=1}' config.log)"
+    libs="$(ls $dev/lib/pkgconfig | tr ' ' '\n' | sed "s,\(.*\)$suffix\.pc,\1,g")"
+    suffixes="$(echo "$suffix" | awk '{for (i=1; i < length($0); i++) {x=substr($0, i+1, length($0)-i); print x}}')"
+
+    # Get the path to the config util
+    cfg=$(basename $dev/bin/ncurses*-config)
+
+    # symlink the full suffixed include directory
+    ln -svf . $dev/include/ncurses$suffix
+
+    for newsuffix in $suffixes ""; do
+      # Create a non-abi versioned config util links
+      ln -svf $cfg $dev/bin/ncurses$newsuffix-config
+
+      # Allow for end users who #include <ncurses?w/*.h>
+      ln -svf . $dev/include/ncurses$newsuffix
+
+      for library in $libs; do
+        for dylibtype in so dll dylib; do
+          if [ -e "$out/lib/lib''${library}$suffix.$dylibtype" ]; then
+            ln -svf lib''${library}$suffix.$dylibtype $out/lib/lib$library$newsuffix.$dylibtype
+            ln -svf lib''${library}$suffix.${abiVersion-extension} $out/lib/lib$library$newsuffix.${abiVersion-extension}
+            if [ "ncurses" = "$library" ]
+            then
+              # make libtinfo symlinks
+              ln -svf lib''${library}$suffix.$dylibtype $out/lib/libtinfo$newsuffix.$dylibtype
+              ln -svf lib''${library}$suffix.${abiVersion-extension} $out/lib/libtinfo$newsuffix.${abiVersion-extension}
+            fi
+          fi
+        done
+        for statictype in a dll.a la; do
+          if [ -e "$out/lib/lib''${library}$suffix.$statictype" ]; then
+            ln -svf lib''${library}$suffix.$statictype $out/lib/lib$library$newsuffix.$statictype
+            if [ "ncurses" = "$library" ]
+            then
+              # make libtinfo symlinks
+              ln -svf lib''${library}$suffix.$statictype $out/lib/libtinfo$newsuffix.$statictype
+            fi
+          fi
+        done
+        ln -svf ''${library}$suffix.pc $dev/lib/pkgconfig/$library$newsuffix.pc
+      done
+    done
+
+    # move some utilities to $bin
+    # these programs are used at runtime and don't really belong in $dev
+    moveToOutput "bin/clear" "$out"
+    moveToOutput "bin/reset" "$out"
+    moveToOutput "bin/tabs" "$out"
+    moveToOutput "bin/tic" "$out"
+    moveToOutput "bin/tput" "$out"
+    moveToOutput "bin/tset" "$out"
+    moveToOutput "bin/captoinfo" "$out"
+    moveToOutput "bin/infotocap" "$out"
+    moveToOutput "bin/infocmp" "$out"
+  '';
+
+  preFixup = lib.optionalString (!stdenv.hostPlatform.isCygwin && !enableStatic) ''
+    rm "$out"/lib/*.a
+  '';
+
+  meta = {
+    description = "Free software emulation of curses in SVR4 and more";
+
+    longDescription = ''
+      The Ncurses (new curses) library is a free software emulation of
+      curses in System V Release 4.0, and more.  It uses Terminfo
+      format, supports pads and color and multiple highlights and
+      forms characters and function-key mapping, and has all the other
+      SYSV-curses enhancements over BSD Curses.
+
+      The ncurses code was developed under GNU/Linux.  It has been in
+      use for some time with OpenBSD as the system curses library, and
+      on FreeBSD and NetBSD as an external package.  It should port
+      easily to any ANSI/POSIX-conforming UNIX.  It has even been
+      ported to OS/2 Warp!
+    '';
+
+    homepage = "https://www.gnu.org/software/ncurses/";
+
+    license = lib.licenses.mit;
+    platforms = lib.platforms.all;
+  };
+
+  passthru = {
+    ldflags = "-lncurses";
+    inherit unicode abiVersion;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ndi/default.nix b/nixpkgs/pkgs/development/libraries/ndi/default.nix
new file mode 100644
index 000000000000..90032f774bbc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ndi/default.nix
@@ -0,0 +1,61 @@
+{ lib, stdenv, requireFile, avahi }:
+
+stdenv.mkDerivation rec {
+  pname = "ndi";
+  fullVersion = "4.6.2";
+  version = builtins.head (builtins.splitVersion fullVersion);
+
+  src = requireFile rec {
+    name    = "InstallNDISDK_v${version}_Linux.tar.gz";
+    sha256  = "181ypfj1bl0kljzrfr6037i14ykg2y4plkzdhym6m3z7kcrnm1fl";
+    message = ''
+      In order to use NDI SDK version ${fullVersion}, you need to comply with
+      NewTek's license and download the appropriate Linux 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 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/ndn-cxx/default.nix b/nixpkgs/pkgs/development/libraries/ndn-cxx/default.nix
new file mode 100644
index 000000000000..3fb3fc305a33
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ndn-cxx/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv
+, fetchFromGitHub
+, doxygen
+, pkg-config
+, python3
+, python3Packages
+, wafHook
+, boost
+, openssl
+, sqlite
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ndn-cxx";
+  version = "0.7.1";
+
+  src = fetchFromGitHub {
+    owner = "named-data";
+    repo = "ndn-cxx";
+    rev = "${pname}-${version}";
+    sha256 = "1lcaqc79n3d9sip7knddblba17sz18b0w7nlxmj3fz3lb3z9qd51";
+  };
+
+  nativeBuildInputs = [ doxygen pkg-config python3 python3Packages.sphinx wafHook ];
+
+  buildInputs = [ boost openssl sqlite ];
+
+  wafConfigureFlags = [
+    "--with-openssl=${openssl.dev}"
+    "--boost-includes=${boost.dev}/include"
+    "--boost-libs=${boost.out}/lib"
+  ];
+
+  meta = with lib; {
+    homepage = "https://named-data.net/";
+    description = "A Named Data Neworking (NDN) or Content Centric Networking (CCN) abstraction";
+    longDescription = ''
+      ndn-cxx is a C++ library, implementing Named Data Networking (NDN)
+      primitives that can be used to implement various NDN applications.
+      NDN operates by addressing and delivering Content Objects directly
+      by Name instead of merely addressing network end-points. In addition,
+      the NDN security model explicitly secures individual Content Objects
+      rather than securing the connection or “pipe”. Named and secured
+      content resides in distributed caches automatically populated on
+      demand or selectively pre-populated. When requested by name, NDN
+      delivers named content to the user from the nearest cache, thereby
+      traversing fewer network hops, eliminating redundant requests,
+      and consuming less resources overall.
+    '';
+    license = licenses.lgpl3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ sjmackenzie ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ndpi/default.nix b/nixpkgs/pkgs/development/libraries/ndpi/default.nix
new file mode 100644
index 000000000000..a45884f72dc6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ndpi/default.nix
@@ -0,0 +1,41 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, which
+, autoconf
+, automake
+, libtool
+, libpcap
+, json_c
+, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "ndpi";
+  version = "4.0";
+
+  src = fetchFromGitHub {
+    owner = "ntop";
+    repo = "nDPI";
+    rev = version;
+    sha256 = "0snzvlracc6s7r2pgdn0jqcc7nxjxzcivsa579h90g5ibhhplv5x";
+  };
+
+  configureScript = "./autogen.sh";
+
+  nativeBuildInputs = [ which autoconf automake libtool pkg-config ];
+  buildInputs = [
+    libpcap
+    json_c
+  ];
+
+  meta = with lib; {
+    description = "A library for deep-packet inspection";
+    longDescription = ''
+      nDPI is a library for deep-packet inspection based on OpenDPI.
+    '';
+    homepage = "https://www.ntop.org/products/deep-packet-inspection/ndpi/";
+    license = with licenses; lgpl3;
+    maintainers = with maintainers; [ takikawa ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/neardal/default.nix b/nixpkgs/pkgs/development/libraries/neardal/default.nix
new file mode 100644
index 000000000000..43f63d91a618
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/neardal/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, pkg-config, glib, readline, makeWrapper }:
+
+stdenv.mkDerivation {
+  name = "neardal-0.7-post-git-20150930";
+
+  src = fetchFromGitHub {
+    owner = "connectivity";
+    repo = "neardal";
+    rev = "5b1c8b5c2c45c10f11cee12fbcb397f8953850d7";
+    sha256 = "12qwg7qiw2wfpaxfg2fjkmj5lls0g33xp6w433g8bnkvwlq4s29g";
+  };
+
+  nativeBuildInputs = [ pkg-config makeWrapper ];
+  buildInputs = [ autoconf automake libtool glib readline ];
+
+  preConfigure = ''
+    substituteInPlace "ncl/Makefile.am" --replace "noinst_PROGRAMS" "bin_PROGRAMS"
+    substituteInPlace "demo/Makefile.am" --replace "noinst_PROGRAMS" "bin_PROGRAMS"
+    sh autogen.sh
+  '';
+
+  configureFlags = [ "--disable-dependency-tracking" "--disable-traces" ];
+
+  meta = with lib; {
+    description = "C APIs to exchange datas with the NFC daemon 'Neard'";
+    license = licenses.lgpl2;
+    homepage = "https://01.org/linux-nfc";
+    maintainers = with maintainers; [ tstrobel ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/neatvnc/default.nix b/nixpkgs/pkgs/development/libraries/neatvnc/default.nix
new file mode 100644
index 000000000000..980424b7fd48
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/neatvnc/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, meson, pkg-config, ninja
+, pixman, gnutls, libdrm, libjpeg_turbo, zlib, aml
+}:
+
+stdenv.mkDerivation rec {
+  pname = "neatvnc";
+  version = "0.4.0";
+
+  src = fetchFromGitHub {
+    owner = "any1";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1wpq1vyjqra877vwc3n4i0c1dyhmabyn993cslf1k142ikyc0a8w";
+  };
+
+  nativeBuildInputs = [ meson pkg-config ninja ];
+  buildInputs = [ pixman gnutls libdrm libjpeg_turbo zlib aml ];
+
+  meta = with lib; {
+    description = "A VNC server library";
+    longDescription = ''
+      This is a liberally licensed VNC server library that's intended to be
+      fast and neat. Goals:
+      - Speed
+      - Clean interface
+      - Interoperability with the Freedesktop.org ecosystem
+    '';
+    inherit (src.meta) homepage;
+    changelog = "https://github.com/any1/neatvnc/releases/tag/v${version}";
+    license = licenses.isc;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ primeos ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nemo-qml-plugin-dbus/default.nix b/nixpkgs/pkgs/development/libraries/nemo-qml-plugin-dbus/default.nix
new file mode 100644
index 000000000000..a07a692f295e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nemo-qml-plugin-dbus/default.nix
@@ -0,0 +1,33 @@
+{ mkDerivation, lib, fetchFromGitLab, qmake, qtbase }:
+
+mkDerivation rec {
+  pname = "nemo-qml-plugin-dbus";
+  version = "2.1.24";
+
+  src = fetchFromGitLab {
+    domain = "git.sailfishos.org";
+    owner = "mer-core";
+    repo = "nemo-qml-plugin-dbus";
+    rev = version;
+    sha256 = "1ilg929456d3k0xkvxa5r4k7i4kkw9i8kgah5xx1yq0d9wka0l77";
+  };
+
+  nativeBuildInputs = [ qmake ];
+
+  postPatch = ''
+    substituteInPlace dbus.pro --replace ' tests' ""
+    substituteInPlace src/nemo-dbus/nemo-dbus.pro \
+      --replace /usr $out \
+      --replace '$$[QT_INSTALL_LIBS]' $out'/lib'
+    substituteInPlace src/plugin/plugin.pro \
+      --replace '$$[QT_INSTALL_QML]' $out'/${qtbase.qtQmlPrefix}'
+  '';
+
+  meta = with lib; {
+    description = "Nemo DBus plugin for qml";
+    homepage = "https://git.sailfishos.org/mer-core/nemo-qml-plugin-dbus/";
+    license = licenses.lgpl2Only;
+    maintainers = [ maintainers.Thra11 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/neon/0.29.6-darwin-fix-configure.patch b/nixpkgs/pkgs/development/libraries/neon/0.29.6-darwin-fix-configure.patch
new file mode 100644
index 000000000000..87222a9c0ce0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/neon/0.29.6-darwin-fix-configure.patch
@@ -0,0 +1,12 @@
+diff -Nuar neon-0.29.6/configure neon-0.29.6-darwin-fix-configure/configure
+--- neon-0.29.6/configure	2011-05-03 14:25:31.000000000 +0200
++++ neon-0.29.6-darwin-fix-configure/configure	2012-06-06 23:32:21.000000000 +0200
+@@ -4184,7 +4184,7 @@
+ $as_echo "$ne_cv_os_uname" >&6; }
+ 
+ if test "$ne_cv_os_uname" = "Darwin"; then
+-  CPPFLAGS="$CPPFLAGS -no-cpp-precomp"
++  CPPFLAGS="$CPPFLAGS"
+   LDFLAGS="$LDFLAGS -flat_namespace"
+   # poll has various issues in various Darwin releases
+   if test x${ac_cv_func_poll+set} != xset; then
diff --git a/nixpkgs/pkgs/development/libraries/neon/0.29.nix b/nixpkgs/pkgs/development/libraries/neon/0.29.nix
new file mode 100644
index 000000000000..e0437fb7cea1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/neon/0.29.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchurl, libxml2, pkg-config, perl
+, compressionSupport ? true, zlib ? null
+, sslSupport ? true, openssl ? null
+, static ? false
+, shared ? true
+}:
+
+assert compressionSupport -> zlib != null;
+assert sslSupport -> openssl != null;
+assert static || shared;
+
+let
+   inherit (lib) optionals;
+in
+
+stdenv.mkDerivation rec {
+  version = "0.29.6";
+  pname = "neon";
+
+  src = fetchurl {
+    url = "http://www.webdav.org/neon/${pname}-${version}.tar.gz";
+    sha256 = "0hzbjqdx1z8zw0vmbknf159wjsxbcq8ii0wgwkqhxj3dimr0nr4w";
+  };
+
+  patches = optionals stdenv.isDarwin [ ./0.29.6-darwin-fix-configure.patch ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [libxml2 openssl]
+    ++ lib.optional compressionSupport zlib;
+
+  configureFlags = [
+    (lib.enableFeature shared "shared")
+    (lib.enableFeature static "static")
+    (lib.withFeature compressionSupport "zlib")
+    (lib.withFeature sslSupport "ssl")
+  ];
+
+  passthru = {inherit compressionSupport sslSupport;};
+
+  checkInputs = [ perl ];
+  doCheck = false; # fails, needs the net
+
+  meta = with lib; {
+    description = "An HTTP and WebDAV client library";
+    homepage = "http://www.webdav.org/neon/";
+    platforms = platforms.unix;
+    license = licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/neon/default.nix b/nixpkgs/pkgs/development/libraries/neon/default.nix
new file mode 100644
index 000000000000..739c5e07d206
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/neon/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, fetchurl, libxml2, pkg-config
+, compressionSupport ? true, zlib ? null
+, sslSupport ? true, openssl ? null
+, static ? stdenv.hostPlatform.isStatic
+, shared ? !stdenv.hostPlatform.isStatic
+}:
+
+assert compressionSupport -> zlib != null;
+assert sslSupport -> openssl != null;
+assert static || shared;
+
+let
+   inherit (lib) optionals;
+in
+
+stdenv.mkDerivation rec {
+  version = "0.31.2";
+  pname = "neon";
+
+  src = fetchurl {
+    url = "https://notroj.github.io/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "0y46dbhiblcvg8k41bdydr3fivghwk73z040ki5825d24ynf67ng";
+  };
+
+  patches = optionals stdenv.isDarwin [ ./0.29.6-darwin-fix-configure.patch ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [libxml2 openssl]
+    ++ lib.optional compressionSupport zlib;
+
+  configureFlags = [
+    (lib.enableFeature shared "shared")
+    (lib.enableFeature static "static")
+    (lib.withFeature compressionSupport "zlib")
+    (lib.withFeature sslSupport "ssl")
+  ];
+
+  passthru = {inherit compressionSupport sslSupport;};
+
+  meta = with lib; {
+    description = "An HTTP and WebDAV client library";
+    homepage = "https://notroj.github.io/neon/";
+    changelog = "https://github.com/notroj/${pname}/blob/${version}/NEWS";
+    platforms = platforms.unix;
+    license = licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/netcdf-cxx4/default.nix b/nixpkgs/pkgs/development/libraries/netcdf-cxx4/default.nix
new file mode 100644
index 000000000000..494f4bf71575
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/netcdf-cxx4/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchzip, netcdf, hdf5, curl, cmake, ninja }:
+stdenv.mkDerivation rec {
+  pname = "netcdf-cxx4";
+  version = "4.3.1";
+
+  src = fetchzip {
+    url = "https://github.com/Unidata/netcdf-cxx4/archive/v${version}.tar.gz";
+    sha256 = "05kydd5z9iil5iv4fp7l11cicda5n5lsg5sdmsmc55xpspnsg7hr";
+  };
+
+  preConfigure = ''
+    cmakeFlags+="-Dabs_top_srcdir=$(readlink -f ./)"
+  '';
+
+  nativeBuildInputs = [ cmake ninja ];
+  buildInputs = [ netcdf hdf5 curl ];
+
+  doCheck = true;
+  enableParallelChecking = false;
+
+  meta = {
+    description = "C++ API to manipulate netcdf files";
+    homepage = "https://www.unidata.ucar.edu/software/netcdf/";
+    license = lib.licenses.free;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/netcdf-fortran/default.nix b/nixpkgs/pkgs/development/libraries/netcdf-fortran/default.nix
new file mode 100644
index 000000000000..0cdeda238792
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/netcdf-fortran/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, netcdf, hdf5, curl, gfortran }:
+stdenv.mkDerivation rec {
+  pname = "netcdf-fortran";
+  version = "4.4.5";
+
+  src = fetchurl {
+    url = "https://github.com/Unidata/netcdf-fortran/archive/v${version}.tar.gz";
+    sha256 = "00qwg4v250yg8kxp68srrnvfbfim241fnlm071p9ila2mihk8r01";
+  };
+
+  buildInputs = [ netcdf hdf5 curl gfortran ];
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Fortran API to manipulate netcdf files";
+    homepage = "https://www.unidata.ucar.edu/software/netcdf/";
+    license = licenses.free;
+    maintainers = [ maintainers.bzizou ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/netcdf/default.nix b/nixpkgs/pkgs/development/libraries/netcdf/default.nix
new file mode 100644
index 000000000000..d24078b91a27
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/netcdf/default.nix
@@ -0,0 +1,75 @@
+{ lib, stdenv
+, fetchpatch
+, fetchurl
+, hdf5
+, m4
+, curl # for DAP
+, removeReferencesTo
+}:
+
+let
+  mpiSupport = hdf5.mpiSupport;
+  mpi = hdf5.mpi;
+in stdenv.mkDerivation rec {
+  pname = "netcdf";
+  version = "4.8.0"; # Remove patch mentioned below on upgrade
+
+  src = fetchurl {
+    url = "https://www.unidata.ucar.edu/downloads/netcdf/ftp/${pname}-c-${version}.tar.gz";
+    sha256 = "1mfn8qi4k0b8pyar3wa8v0npj69c7rhgfdlppdwmq5jqk88kb5k7";
+  };
+
+  patches = [
+    # Fixes:
+    #     *** Checking vlen of compound file...Sorry! Unexpected result, tst_h_atts3.c, line: 289
+    #     FAIL tst_h_atts3 (exit status: 2)
+    # TODO: Remove with next netcdf release (see https://github.com/Unidata/netcdf-c/pull/1980)
+    (fetchpatch {
+      name = "netcdf-Fix-tst_h_atts3-for-hdf5-1.12.patch";
+      url = "https://github.com/Unidata/netcdf-c/commit/9fc8ae62a8564e095ff17f4612874581db0e4db5.patch";
+      sha256 = "128kxz5jikq32x5qjmi0xdngi0k336rf6bvbcppvlk5gibg5nk7v";
+    })
+  ];
+
+  postPatch = ''
+    patchShebangs .
+
+    # this test requires the net
+    for a in ncdap_test/Makefile.am ncdap_test/Makefile.in; do
+      substituteInPlace $a --replace testurl.sh " "
+    done
+  '';
+
+  nativeBuildInputs = [ m4 removeReferencesTo ];
+  buildInputs = [ hdf5 curl mpi ];
+
+  passthru = {
+    mpiSupport = mpiSupport;
+    inherit mpi;
+  };
+
+  configureFlags = [
+      "--enable-netcdf-4"
+      "--enable-dap"
+      "--enable-shared"
+      "--disable-dap-remote-tests"
+  ]
+  ++ (lib.optionals mpiSupport [ "--enable-parallel-tests" "CC=${mpi}/bin/mpicc" ]);
+
+  disallowedReferences = [ stdenv.cc ];
+
+  postFixup = ''
+    remove-references-to -t ${stdenv.cc} "$(readlink -f $out/lib/libnetcdf.settings)"
+  '';
+
+  doCheck = !mpiSupport;
+
+  meta = {
+      description = "Libraries for the Unidata network Common Data Format";
+      platforms = lib.platforms.unix;
+      homepage = "https://www.unidata.ucar.edu/software/netcdf/";
+      license = {
+        url = "https://www.unidata.ucar.edu/software/netcdf/docs/copyright.html";
+      };
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nettle/cygwin.patch b/nixpkgs/pkgs/development/libraries/nettle/cygwin.patch
new file mode 100644
index 000000000000..d5036237c8d5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nettle/cygwin.patch
@@ -0,0 +1,12 @@
+Cygwin sucks.  Patch suggested by Niel Möller.
+
+--- nettle-2.0/examples/setup-env	2009-06-08 20:27:12.000000000 +0200
++++ nettle-2.0/examples/setup-env	2009-09-18 16:58:03.000000000 +0200
+@@ -3,5 +3,5 @@
+ set -e
+ 
+ if [ -x rsa-keygen ] ; then
+-  ./rsa-keygen -r rsa-decrypt -o testkey || exit 1
++  ./rsa-keygen -r rsa-decrypt.exe -o testkey || exit 1
+ fi
+
diff --git a/nixpkgs/pkgs/development/libraries/nettle/default.nix b/nixpkgs/pkgs/development/libraries/nettle/default.nix
new file mode 100644
index 000000000000..0e3c18c0ac30
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nettle/default.nix
@@ -0,0 +1,10 @@
+{ callPackage, fetchurl }:
+
+callPackage ./generic.nix rec {
+  version = "3.7.3";
+
+  src = fetchurl {
+    url = "mirror://gnu/nettle/nettle-${version}.tar.gz";
+    sha256 = "1w5wwc3q0r97d2ifhx77cw7y8s20bm8x52is9j93p2h47yq5w7v6";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nettle/generic.nix b/nixpkgs/pkgs/development/libraries/nettle/generic.nix
new file mode 100644
index 000000000000..348faf56b56a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nettle/generic.nix
@@ -0,0 +1,68 @@
+{ lib, stdenv, buildPackages, gmp, gnum4
+
+# Version specific args
+, version, src
+}:
+
+stdenv.mkDerivation {
+  name = "nettle-${version}";
+
+  inherit src;
+
+  outputs = [ "out" "dev" ];
+  outputBin = "dev";
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ gnum4 ];
+  propagatedBuildInputs = [ gmp ];
+
+  configureFlags =
+    # runtime selection of HW-accelerated code; it's default since 3.7
+    [ "--enable-fat" ]
+    # Make sure the right <gmp.h> is found, and not the incompatible
+    # /usr/include/mp.h from OpenSolaris.  See
+    # <https://lists.gnu.org/archive/html/hydra-users/2012-08/msg00000.html>
+    # for details.
+    ++ lib.optional stdenv.isSunOS "--with-include-path=${gmp.dev}/include";
+
+  doCheck = (stdenv.hostPlatform.system != "i686-cygwin" && !stdenv.isDarwin);
+
+  enableParallelBuilding = true;
+
+  patches = lib.optional (stdenv.hostPlatform.system == "i686-cygwin")
+              ./cygwin.patch;
+
+  meta = with lib; {
+    description = "Cryptographic library";
+
+    longDescription = ''
+        Nettle is a cryptographic library that is designed to fit
+        easily in more or less any context: In crypto toolkits for
+        object-oriented languages (C++, Python, Pike, ...), in
+        applications like LSH or GNUPG, or even in kernel space.  In
+        most contexts, you need more than the basic cryptographic
+        algorithms, you also need some way to keep track of available
+        algorithms, their properties and variants.  You often have
+        some algorithm selection process, often dictated by a protocol
+        you want to implement.
+
+        And as the requirements of applications differ in subtle and
+        not so subtle ways, an API that fits one application well can
+        be a pain to use in a different context.  And that is why
+        there are so many different cryptographic libraries around.
+
+        Nettle tries to avoid this problem by doing one thing, the
+        low-level crypto stuff, and providing a simple but general
+        interface to it.  In particular, Nettle doesn't do algorithm
+        selection.  It doesn't do memory allocation. It doesn't do any
+        I/O.
+     '';
+
+     license = licenses.gpl2Plus;
+
+     homepage = "https://www.lysator.liu.se/~nisse/nettle/";
+
+     platforms = platforms.all;
+     maintainers = [ maintainers.vcunat ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/networking-ts-cxx/default.nix b/nixpkgs/pkgs/development/libraries/networking-ts-cxx/default.nix
new file mode 100644
index 000000000000..7dc6d4b11fee
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/networking-ts-cxx/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "networking-ts-cxx";
+  version = "2019-02-27";
+
+  # Used until https://github.com/chriskohlhoff/networking-ts-impl/issues/17 is
+  # resolved and we can generate in Nix.
+  src = fetchFromGitHub {
+    owner = "chriskohlhoff";
+    repo = "networking-ts-impl";
+    rev = "c97570e7ceef436581be3c138868a19ad96e025b";
+    sha256 = "12b5lg989nn1b8v6x9fy3cxsf3hs5hr67bd1mfyh8pjikir7zv6j";
+  };
+
+  installPhase = ''
+    mkdir -p $out/{include,lib/pkgconfig}
+    cp -r include $out/
+    substituteAll ${./networking_ts.pc.in} $out/lib/pkgconfig/networking_ts.pc
+  '';
+
+  meta = with lib; {
+    description = "Experimental implementation of the C++ Networking Technical Specification";
+    homepage = "https://github.com/chriskohlhoff/networking-ts-impl";
+    license = licenses.boost;
+    maintainers = with maintainers; [ bhipple ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/networking-ts-cxx/networking_ts.pc.in b/nixpkgs/pkgs/development/libraries/networking-ts-cxx/networking_ts.pc.in
new file mode 100644
index 000000000000..d52f68f4c155
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/networking-ts-cxx/networking_ts.pc.in
@@ -0,0 +1,8 @@
+prefix=@out@
+includedir=${prefix}/include
+
+Name: networking_ts
+Description: Experimental implementation of the C++ Networking Technical Specification
+URL: https://github.com/chriskohlhoff/networking-ts-impl
+Version: ${networking_ts_version}
+Cflags: -isystem${includedir}
diff --git a/nixpkgs/pkgs/development/libraries/newt/default.nix b/nixpkgs/pkgs/development/libraries/newt/default.nix
new file mode 100644
index 000000000000..dc6b604bd8e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/newt/default.nix
@@ -0,0 +1,46 @@
+{ lib, fetchurl, stdenv, slang, popt, python }:
+
+let
+  pythonIncludePath = "${lib.getDev python}/include/python";
+in
+stdenv.mkDerivation rec {
+  pname = "newt";
+  version = "0.52.21";
+
+  src = fetchurl {
+    url = "https://fedorahosted.org/releases/n/e/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "0cdvbancr7y4nrj8257y5n45hmhizr8isynagy4fpsnpammv8pi6";
+  };
+
+  patchPhase = ''
+    sed -i -e s,/usr/bin/install,install, -e s,-I/usr/include/slang,, Makefile.in po/Makefile
+
+    substituteInPlace configure \
+      --replace "/usr/include/python" "${pythonIncludePath}"
+    substituteInPlace configure.ac \
+      --replace "/usr/include/python" "${pythonIncludePath}"
+  '';
+
+  buildInputs = [ slang popt python ];
+
+  NIX_LDFLAGS = "-lncurses";
+
+  preConfigure = ''
+    # If CPP is set explicitly, configure and make will not agree about which
+    # programs to use at different stages.
+    unset CPP
+  '';
+
+  makeFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+    "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
+  ];
+
+  meta = with lib; {
+    homepage = "https://fedorahosted.org/newt/";
+    description = "Library for color text mode, widget based user interfaces";
+
+    license = licenses.lgpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.viric ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nghttp2/default.nix b/nixpkgs/pkgs/development/libraries/nghttp2/default.nix
new file mode 100644
index 000000000000..86edacc6166b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nghttp2/default.nix
@@ -0,0 +1,82 @@
+{ lib, stdenv, fetchurl, pkg-config
+
+# Optional Dependencies
+, 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
+, enableJemalloc ? false, jemalloc ? null
+, enableApp ? with stdenv.hostPlatform; !isWindows && !isStatic
+, enablePython ? false, python ? null, cython ? null, ncurses ? null, setuptools ? null
+}:
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+assert enableHpack -> jansson != null;
+assert enableAsioLib -> boost != null;
+assert enableGetAssets -> libxml2 != null;
+assert enableJemalloc -> jemalloc != null;
+assert enablePython -> python != null && cython != null && ncurses != null && setuptools != null;
+
+let inherit (lib) optional optionals optionalString; in
+
+stdenv.mkDerivation rec {
+  pname = "nghttp2";
+  version = "1.43.0";
+
+  src = fetchurl {
+    url = "https://github.com/${pname}/${pname}/releases/download/v${version}/${pname}-${version}.tar.bz2";
+    sha256 = "0qhgyphzdv72dgdfxin2xbk9623za3jwbcvhhaxixiwp6djj8vsm";
+  };
+
+  outputs = [ "bin" "out" "dev" "lib" ]
+    ++ optional enablePython "python";
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ openssl ]
+    ++ optional enableLibEv libev
+    ++ [ zlib ]
+    ++ optional enableCAres c-ares
+    ++ optional enableHpack jansson
+    ++ optional enableAsioLib boost
+    ++ optional enableGetAssets libxml2
+    ++ optional enableJemalloc jemalloc
+    ++ optionals enablePython [ python ncurses setuptools ];
+
+  enableParallelBuilding = true;
+
+  configureFlags = [
+    "--with-spdylay=no"
+    "--disable-examples"
+    (lib.enableFeature enableApp "app")
+  ] ++ optional enableAsioLib "--enable-asio-lib --with-boost-libdir=${boost}/lib"
+    ++ (if enablePython then [
+    "--with-cython=${cython}/bin/cython"
+  ] else [
+    "--disable-python-bindings"
+  ]);
+
+  preInstall = optionalString enablePython ''
+    mkdir -p $out/${python.sitePackages}
+    # convince installer it's ok to install here
+    export PYTHONPATH="$PYTHONPATH:$out/${python.sitePackages}"
+  '';
+  postInstall = optionalString enablePython ''
+    mkdir -p $python/${python.sitePackages}
+    mv $out/${python.sitePackages}/* $python/${python.sitePackages}
+  '';
+
+  #doCheck = true;  # requires CUnit ; currently failing at test_util_localtime_date in util_test.cc
+
+  meta = with lib; {
+    homepage = "https://nghttp2.org/";
+    description = "A C implementation of HTTP/2";
+    license = licenses.mit;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ngt/default.nix b/nixpkgs/pkgs/development/libraries/ngt/default.nix
new file mode 100644
index 000000000000..385f2d84f8a6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ngt/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, llvmPackages
+, enableAVX ? stdenv.hostPlatform.avxSupport
+}:
+
+stdenv.mkDerivation rec {
+  pname = "NGT";
+  version = "v1.12.3-alpha";
+
+  src = fetchFromGitHub {
+    owner = "yahoojapan";
+    repo = "NGT";
+    rev = "29c88ff6cd5824d3196986d1f50b834565b6c9dd";
+    sha256 = "sha256-nu0MJNpaenOB4+evoSVLKmPIuZXVj1Rm9x53+TfhezY=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ llvmPackages.openmp ];
+
+  NIX_ENFORCE_NO_NATIVE = ! enableAVX;
+  __AVX2__ = if enableAVX then 1 else 0;
+
+  meta = with lib; {
+    homepage = "https://github.com/yahoojapan/NGT";
+    description = "Nearest Neighbor Search with Neighborhood Graph and Tree for High-dimensional Data";
+    platforms = platforms.linux ++ platforms.darwin;
+    license = licenses.asl20;
+    maintainers = with maintainers; [ tomberek ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nix-plugins/default.nix b/nixpkgs/pkgs/development/libraries/nix-plugins/default.nix
new file mode 100644
index 000000000000..a4c18e9f0466
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nix-plugins/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, nix, cmake, pkg-config, boost }:
+
+stdenv.mkDerivation rec {
+  pname = "nix-plugins";
+  version = "6.0.0";
+
+  src = fetchFromGitHub {
+    owner = "shlevy";
+    repo = "nix-plugins";
+    rev = version;
+    sha256 = "08kxdci0sijj1hfkn3dbr7nbpb9xck0xr3xa3a0j116n4kvwb6qv";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [ nix boost ];
+
+  meta = {
+    description = "Collection of miscellaneous plugins for the nix expression language";
+    homepage = "https://github.com/shlevy/nix-plugins";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix b/nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix
new file mode 100644
index 000000000000..41a967a5b709
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "nlohmann_json";
+  version = "3.9.1";
+
+  src = fetchFromGitHub {
+    owner = "nlohmann";
+    repo = "json";
+    rev = "v${version}";
+    sha256 = "sha256-THordDPdH2qwk6lFTgeFmkl7iDuA/7YH71PTUe6vJCs=";
+  };
+
+  patches = [
+    # https://github.com/nlohmann/json/pull/2690
+    (fetchpatch {
+      url = "https://github.com/nlohmann/json/commit/53a9850eebb88c6ff95f6042d08d5c0cc9d18097.patch";
+      sha256 = "k+Og00nXNg5IsFQY5fWD3xVQQXUFFTie44UXole0S1M=";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    "-DBuildTests=${if doCheck then "ON" else "OFF"}"
+    "-DJSON_MultipleHeaders=ON"
+  ];
+
+  # 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 lib; {
+    description = "Header only C++ library for the JSON file format";
+    homepage = "https://github.com/nlohmann/json";
+    license = licenses.mit;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nlopt/default.nix b/nixpkgs/pkgs/development/libraries/nlopt/default.nix
new file mode 100644
index 000000000000..36fcf9081182
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nlopt/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, cmake, octave ? null }:
+
+stdenv.mkDerivation rec {
+  pname = "nlopt";
+  version = "2.7.0";
+
+  src = fetchFromGitHub {
+    owner = "stevengj";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0xm8y9cg5p2vgxbn8wn8gqfpxkbm0m4qsidp0bq1dqs8gvj9017v";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ octave ];
+
+  configureFlags = [
+    "--with-cxx"
+    "--enable-shared"
+    "--with-pic"
+    "--without-guile"
+    "--without-python"
+    "--without-matlab"
+  ] ++ lib.optionals (octave != null) [
+    "--with-octave"
+    "M_INSTALL_DIR=$(out)/${octave.sitePath}/m"
+    "OCT_INSTALL_DIR=$(out)/${octave.sitePath}/oct"
+  ];
+
+  meta = {
+    homepage = "https://nlopt.readthedocs.io/en/latest/";
+    description = "Free open-source library for nonlinear optimization";
+    license = lib.licenses.lgpl21Plus;
+    hydraPlatforms = lib.platforms.linux;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/notcurses/default.nix b/nixpkgs/pkgs/development/libraries/notcurses/default.nix
new file mode 100644
index 000000000000..a99a09a0fe69
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/notcurses/default.nix
@@ -0,0 +1,51 @@
+{ stdenv
+, cmake
+, pkg-config
+, pandoc
+, libunistring
+, ncurses
+, ffmpeg
+, readline
+, fetchFromGitHub
+, lib
+, multimediaSupport ? true
+}:
+
+stdenv.mkDerivation rec {
+  pname = "notcurses";
+  version = "2.3.8";
+
+  src = fetchFromGitHub {
+    owner = "dankamongmen";
+    repo = "notcurses";
+    rev = "v${version}";
+    sha256 = "sha256-CTMFXTmOnBUCm0KdVNBoDT08arr01XTHdELFiTayk3E=";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ cmake pkg-config pandoc ];
+
+  buildInputs = [ libunistring ncurses readline ]
+    ++ lib.optional multimediaSupport ffmpeg;
+
+  cmakeFlags = [ "-DUSE_QRCODEGEN=OFF" ]
+    ++ lib.optional (!multimediaSupport) "-DUSE_MULTIMEDIA=none";
+
+  meta = with lib; {
+    description = "blingful TUIs and character graphics";
+    longDescription = ''
+      A library facilitating complex TUIs on modern terminal emulators,
+      supporting vivid colors, multimedia, and Unicode to the maximum degree
+      possible. Things can be done with Notcurses that simply can't be done
+      with NCURSES.
+
+      It is not a source-compatible X/Open Curses implementation, nor a
+      replacement for NCURSES on existing systems.
+    '';
+    homepage = "https://github.com/dankamongmen/notcurses";
+    license = licenses.asl20;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ jb55 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/notify-sharp/default.nix b/nixpkgs/pkgs/development/libraries/notify-sharp/default.nix
new file mode 100644
index 000000000000..1cd69074911b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/notify-sharp/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitLab, pkg-config, autoreconfHook
+, mono, gtk-sharp-3_0, dbus-sharp-1_0, dbus-sharp-glib-1_0 }:
+
+stdenv.mkDerivation rec {
+  pname = "notify-sharp";
+  version = "3.0.3";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.gnome.org";
+    owner = "Archive";
+    repo = "notify-sharp";
+
+    rev = version;
+    sha256 = "1vm7mnmxdwrgy4mr07lfva8sa6a32f2ah5x7w8yzcmahaks3sj5m";
+  };
+
+  nativeBuildInputs = [
+    pkg-config autoreconfHook
+  ];
+
+  buildInputs = [
+    mono gtk-sharp-3_0
+    dbus-sharp-1_0 dbus-sharp-glib-1_0
+  ];
+
+  dontStrip = true;
+
+  postPatch = ''
+    sed -i 's#^[ \t]*DOCDIR=.*$#DOCDIR=$out/lib/monodoc#' ./configure.ac
+  '';
+
+  meta = with lib; {
+    description = "D-Bus for .NET";
+    platforms = platforms.linux;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/npapi-sdk/default.nix b/nixpkgs/pkgs/development/libraries/npapi-sdk/default.nix
new file mode 100644
index 000000000000..6611f99bdfc2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/npapi-sdk/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "npapi-sdk";
+
+  version = "0.27.2";
+
+  src = fetchurl {
+    url = "https://bitbucket.org/mgorny/npapi-sdk/downloads/${pname}-${version}.tar.bz2";
+
+    sha256 = "0xxfcsjmmgbbyl9zwpzdshbx27grj5fnzjfmldmm9apws2yk9gq1";
+  };
+
+  meta = with lib; {
+    description = "A bundle of NPAPI headers by Mozilla";
+
+    homepage = "https://bitbucket.org/mgorny/npapi-sdk"; # see also https://github.com/mozilla/npapi-sdk
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/npth/default.nix b/nixpkgs/pkgs/development/libraries/npth/default.nix
new file mode 100644
index 000000000000..a5ac9ce99127
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/npth/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "npth-1.6";
+
+  src = fetchurl {
+    url = "mirror://gnupg/npth/${name}.tar.bz2";
+    sha256 = "1lg2lkdd3z1s3rpyf88786l243adrzyk9p4q8z9n41ygmpcsp4qk";
+  };
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "The New GNU Portable Threads Library";
+    longDescription = ''
+      This is a library to provide the GNU Pth API and thus a non-preemptive
+      threads implementation.
+
+      In contrast to GNU Pth is is based on the system's standard threads
+      implementation.  This allows the use of libraries which are not
+      compatible to GNU Pth.  Experience with a Windows Pth emulation showed
+      that this is a solid way to provide a co-routine based framework.
+    '';
+    homepage = "http://www.gnupg.org";
+    license = licenses.lgpl3;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nspr/0001-Makefile-use-SOURCE_DATE_EPOCH-for-reproducibility.patch b/nixpkgs/pkgs/development/libraries/nspr/0001-Makefile-use-SOURCE_DATE_EPOCH-for-reproducibility.patch
new file mode 100644
index 000000000000..d7fec73910fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nspr/0001-Makefile-use-SOURCE_DATE_EPOCH-for-reproducibility.patch
@@ -0,0 +1,84 @@
+From e5cc8f7c387e3238ebb8239e2555c933a41502c0 Mon Sep 17 00:00:00 2001
+From: Graham Christensen <graham@grahamc.com>
+Date: Thu, 7 Mar 2019 08:11:32 -0500
+Subject: [PATCH] Makefile: use SOURCE_DATE_EPOCH for reproducibility
+
+---
+ nspr/lib/ds/Makefile.in        | 4 ++--
+ nspr/lib/libc/src/Makefile.in  | 4 ++--
+ nspr/lib/prstreams/Makefile.in | 4 ++--
+ nspr/pr/src/Makefile.in        | 6 +++---
+ 4 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/nspr/lib/ds/Makefile.in b/nspr/lib/ds/Makefile.in
+index e737791..d56b0a7 100644
+--- a/nspr/lib/ds/Makefile.in
++++ b/nspr/lib/ds/Makefile.in
+@@ -101,8 +101,8 @@ ECHO = echo
+ TINC = $(OBJDIR)/_pl_bld.h
+ PROD = $(notdir $(SHARED_LIBRARY))
+ NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
+-SH_DATE = $(shell date "+%Y-%m-%d %T")
+-SH_NOW = $(shell $(NOW))
++SH_DATE = $(shell date "+%Y-%m-%d %T" --date $(SOURCE_DATE_EPOCH))
++SH_NOW = $(SOURCE_DATE_EPOCH)000000
+ 
+ ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
+ 	SUF = i64
+diff --git a/nspr/lib/libc/src/Makefile.in b/nspr/lib/libc/src/Makefile.in
+index e8a6d9f..0485737 100644
+--- a/nspr/lib/libc/src/Makefile.in
++++ b/nspr/lib/libc/src/Makefile.in
+@@ -103,8 +103,8 @@ ECHO = echo
+ TINC = $(OBJDIR)/_pl_bld.h
+ PROD = $(notdir $(SHARED_LIBRARY))
+ NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
+-SH_DATE = $(shell date "+%Y-%m-%d %T")
+-SH_NOW = $(shell $(NOW))
++SH_DATE = $(shell date "+%Y-%m-%d %T" --date $(SOURCE_DATE_EPOCH))
++SH_NOW = $(SOURCE_DATE_EPOCH)000000
+ 
+ ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
+ 	SUF = i64
+diff --git a/nspr/lib/prstreams/Makefile.in b/nspr/lib/prstreams/Makefile.in
+index aeb2944..83ae423 100644
+--- a/nspr/lib/prstreams/Makefile.in
++++ b/nspr/lib/prstreams/Makefile.in
+@@ -105,8 +105,8 @@ ECHO = echo
+ TINC = $(OBJDIR)/_pl_bld.h
+ PROD = $(notdir $(SHARED_LIBRARY))
+ NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
+-SH_DATE = $(shell date "+%Y-%m-%d %T")
+-SH_NOW = $(shell $(NOW))
++SH_DATE = $(shell date "+%Y-%m-%d %T" --date $(SOURCE_DATE_EPOCH))
++SH_NOW = $(SOURCE_DATE_EPOCH)000000
+ 
+ ifeq ($(OS_ARCH), WINNT)
+ 	SUF = i64
+diff --git a/nspr/pr/src/Makefile.in b/nspr/pr/src/Makefile.in
+index 19c5a69..989cc8c 100644
+--- a/nspr/pr/src/Makefile.in
++++ b/nspr/pr/src/Makefile.in
+@@ -46,7 +46,7 @@ MKSHLIB += -M $(MAPFILE)
+ endif
+ #
+ # In Solaris 2.6 or earlier, -lrt is called -lposix4.
+-# 
++#
+ LIBRT_TEST=$(firstword $(sort 5.7 $(OS_RELEASE)))
+ ifeq (5.7, $(LIBRT_TEST))
+ LIBRT=-lrt
+@@ -311,8 +311,8 @@ PROD = $(notdir $(SHARED_LIBRARY))
+ endif
+ 
+ NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
+-SH_DATE = $(shell date "+%Y-%m-%d %T")
+-SH_NOW = $(shell $(NOW))
++SH_DATE = $(shell date "+%Y-%m-%d %T" --date $(SOURCE_DATE_EPOCH))
++SH_NOW = $(SOURCE_DATE_EPOCH)000000
+ 
+ ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
+ 	SUF = i64
+-- 
+2.19.2
+
diff --git a/nixpkgs/pkgs/development/libraries/nspr/default.nix b/nixpkgs/pkgs/development/libraries/nspr/default.nix
new file mode 100644
index 000000000000..8048ef2a5e70
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nspr/default.nix
@@ -0,0 +1,54 @@
+{ lib
+, stdenv
+, fetchurl
+, CoreServices
+, buildPackages
+}:
+
+stdenv.mkDerivation rec {
+  pname = "nspr";
+  version = "4.32";
+
+  src = fetchurl {
+    url = "mirror://mozilla/nspr/releases/v${version}/src/nspr-${version}.tar.gz";
+    sha256 = "0v3zds1id71j5a5si42a658fjz8nv2f6zp6w4gqrqmdr6ksz8sxv";
+  };
+
+  patches = [
+    ./0001-Makefile-use-SOURCE_DATE_EPOCH-for-reproducibility.patch
+  ];
+
+  outputs = [ "out" "dev" ];
+  outputBin = "dev";
+
+  preConfigure = ''
+    cd nspr
+  '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace configure --replace '@executable_path/' "$out/lib/"
+    substituteInPlace configure.in --replace '@executable_path/' "$out/lib/"
+  '';
+
+  HOST_CC = "cc";
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+  configureFlags = [
+    "--enable-optimize"
+    "--disable-debug"
+  ] ++ lib.optional stdenv.is64bit "--enable-64bit";
+
+  postInstall = ''
+    find $out -name "*.a" -delete
+    moveToOutput share "$dev" # just aclocal
+  '';
+
+  buildInputs = lib.optionals stdenv.isDarwin [ CoreServices ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/Reference/NSPR_functions";
+    description = "Netscape Portable Runtime, a platform-neutral API for system-level and libc-like functions";
+    maintainers = with maintainers; [ ];
+    platforms = platforms.all;
+    license = licenses.mpl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nss/3.53.nix b/nixpkgs/pkgs/development/libraries/nss/3.53.nix
new file mode 100644
index 000000000000..4d22e9a1a7cf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nss/3.53.nix
@@ -0,0 +1,182 @@
+{ lib
+, stdenv
+, fetchurl
+, nspr
+, perl
+, zlib
+, sqlite
+, darwin
+, fixDarwinDylibNames
+, buildPackages
+, ninja
+, # allow FIPS mode. Note that this makes the output non-reproducible.
+  # https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_Tech_Notes/nss_tech_note6
+  enableFIPS ? false
+}:
+
+let
+  nssPEM = fetchurl {
+    url = "http://dev.gentoo.org/~polynomial-c/mozilla/nss-3.15.4-pem-support-20140109.patch.xz";
+    sha256 = "10ibz6y0hknac15zr6dw4gv9nb5r5z9ym6gq18j3xqx7v7n3vpdw";
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "nss";
+  version = "3.53.1";
+
+  src = fetchurl {
+    url = "mirror://mozilla/security/nss/releases/NSS_${lib.replaceStrings ["."] ["_"] version}_RTM/src/${pname}-${version}.tar.gz";
+    sha256 = "05jk65x3zy6q8lx2djj8ik7kg741n88iy4n3bblw89cv0xkxxk1d";
+  };
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+
+  nativeBuildInputs = [ perl ninja (buildPackages.python3.withPackages (ps: with ps; [ gyp ])) ]
+    ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.cctools fixDarwinDylibNames ];
+
+  buildInputs = [ zlib sqlite ];
+
+  propagatedBuildInputs = [ nspr ];
+
+  prePatch = ''
+    # strip the trailing whitespace from the patch line and the renamed CKO_NETSCAPE_ enum to CKO_NSS_
+    xz -d < ${nssPEM} | sed \
+       -e 's/-DIRS = builtins $/-DIRS = . builtins/g' \
+       -e 's/CKO_NETSCAPE_/CKO_NSS_/g' \
+       -e 's/CKT_NETSCAPE_/CKT_NSS_/g' \
+       | patch -p1
+
+    patchShebangs nss
+
+    for f in nss/coreconf/config.gypi nss/build.sh nss/coreconf/config.gypi; do
+      substituteInPlace "$f" --replace "/usr/bin/env" "${buildPackages.coreutils}/bin/env"
+    done
+
+    substituteInPlace nss/coreconf/config.gypi --replace "/usr/bin/grep" "${buildPackages.coreutils}/bin/env grep"
+  '';
+
+  patches = [
+    # Based on http://patch-tracker.debian.org/patch/series/dl/nss/2:3.15.4-1/85_security_load.patch
+    ./85_security_load.patch
+    ./ckpem.patch
+    ./fix-cross-compilation.patch
+  ];
+
+  patchFlags = [ "-p0" ];
+
+  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
+    substituteInPlace nss/coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)"
+    substituteInPlace nss/coreconf/config.gypi --replace "'DYLIB_INSTALL_NAME_BASE': '@executable_path'" "'DYLIB_INSTALL_NAME_BASE': '$out/lib'"
+  '';
+
+  outputs = [ "out" "dev" "tools" ];
+
+  preConfigure = "cd nss";
+
+  buildPhase =
+    let
+      getArch = platform:
+        if platform.isx86_64 then "x64"
+        else if platform.isx86_32 then "ia32"
+        else if platform.isAarch32 then "arm"
+        else if platform.isAarch64 then "arm64"
+        else if platform.isPower && platform.is64bit then
+          (
+            if platform.isLittleEndian then "ppc64le" else "ppc64"
+          )
+        else platform.parsed.cpu.name;
+      # yes, this is correct. nixpkgs uses "host" for the platform the binary will run on whereas nss uses "host" for the platform that the build is running on
+      target = getArch stdenv.hostPlatform;
+      host = getArch stdenv.buildPlatform;
+    in
+    ''
+      runHook preBuild
+
+      sed -i 's|nss_dist_dir="$dist_dir"|nss_dist_dir="'$out'"|;s|nss_dist_obj_dir="$obj_dir"|nss_dist_obj_dir="'$out'"|' build.sh
+      ./build.sh -v --opt \
+        --with-nspr=${nspr.dev}/include:${nspr.out}/lib \
+        --system-sqlite \
+        --enable-legacy-db \
+        --target ${target} \
+        -Dhost_arch=${host} \
+        -Duse_system_zlib=1 \
+        --enable-libpkix \
+        ${lib.optionalString enableFIPS "--enable-fips"} \
+        ${lib.optionalString stdenv.isDarwin "--clang"} \
+        ${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "--disable-tests"}
+
+      runHook postBuild
+    '';
+
+  NIX_CFLAGS_COMPILE = "-Wno-error -DNIX_NSS_LIBDIR=\"${placeholder "out"}/lib/\"";
+
+  installPhase = ''
+    runHook preInstall
+
+    rm -rf $out/private
+    find $out -name "*.TOC" -delete
+    mv $out/public $out/include
+
+    ln -s lib $out/lib64
+
+    # Upstream issue: https://bugzilla.mozilla.org/show_bug.cgi?id=530672
+    # https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-libs/nss/files/nss-3.32-gentoo-fixups.patch?id=af1acce6c6d2c3adb17689261dfe2c2b6771ab8a
+    NSS_MAJOR_VERSION=`grep "NSS_VMAJOR" lib/nss/nss.h | awk '{print $3}'`
+    NSS_MINOR_VERSION=`grep "NSS_VMINOR" lib/nss/nss.h | awk '{print $3}'`
+    NSS_PATCH_VERSION=`grep "NSS_VPATCH" lib/nss/nss.h | awk '{print $3}'`
+    PREFIX="$out"
+
+    mkdir -p $out/lib/pkgconfig
+    sed -e "s,%prefix%,$PREFIX," \
+        -e "s,%exec_prefix%,$PREFIX," \
+        -e "s,%libdir%,$PREFIX/lib64," \
+        -e "s,%includedir%,$dev/include/nss," \
+        -e "s,%NSS_VERSION%,$NSS_MAJOR_VERSION.$NSS_MINOR_VERSION.$NSS_PATCH_VERSION,g" \
+        -e "s,%NSPR_VERSION%,4.16,g" \
+        pkg/pkg-config/nss.pc.in > $out/lib/pkgconfig/nss.pc
+    chmod 0644 $out/lib/pkgconfig/nss.pc
+
+    sed -e "s,@prefix@,$PREFIX," \
+        -e "s,@MOD_MAJOR_VERSION@,$NSS_MAJOR_VERSION," \
+        -e "s,@MOD_MINOR_VERSION@,$NSS_MINOR_VERSION," \
+        -e "s,@MOD_PATCH_VERSION@,$NSS_PATCH_VERSION," \
+        pkg/pkg-config/nss-config.in > $out/bin/nss-config
+    chmod 0755 $out/bin/nss-config
+  '';
+
+  postFixup =
+    let
+      isCross = stdenv.hostPlatform != stdenv.buildPlatform;
+      nss = if isCross then buildPackages.nss.tools else "$out";
+    in
+    (lib.optionalString enableFIPS (''
+      for libname in freebl3 nssdbm3 softokn3
+      do '' +
+    (if stdenv.isDarwin
+    then ''
+      libfile="$out/lib/lib$libname.dylib"
+      DYLD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
+    '' else ''
+      libfile="$out/lib/lib$libname.so"
+      LD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
+    '') + ''
+          ${nss}/bin/shlibsign -v -i "$libfile"
+      done
+    '')) +
+    ''
+      moveToOutput bin "$tools"
+      moveToOutput bin/nss-config "$dev"
+      moveToOutput lib/libcrmf.a "$dev" # needed by firefox, for example
+      rm -f "$out"/lib/*.a
+
+      runHook postInstall
+    '';
+
+  meta = with lib; {
+    homepage = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS";
+    description = "A set of libraries for development of security-enabled client and server applications";
+    maintainers = with maintainers; [ ];
+    license = licenses.mpl20;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nss/85_security_load.patch b/nixpkgs/pkgs/development/libraries/nss/85_security_load.patch
new file mode 100644
index 000000000000..2b2cce465ba7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nss/85_security_load.patch
@@ -0,0 +1,76 @@
+diff --git nss/cmd/shlibsign/shlibsign.c nss/cmd/shlibsign/shlibsign.c
+index ad8f3b84e..74676d039 100644
+--- nss/cmd/shlibsign/shlibsign.c
++++ nss/cmd/shlibsign/shlibsign.c
+@@ -875,6 +875,8 @@ main(int argc, char **argv)
+         goto cleanup;
+     }
+     lib = PR_LoadLibrary(libname);
++    if (!lib)
++        lib = PR_LoadLibrary(NIX_NSS_LIBDIR"libsoftokn3.so");
+     assert(lib != NULL);
+     if (!lib) {
+         PR_fprintf(PR_STDERR, "loading softokn3 failed");
+diff --git nss/lib/pk11wrap/pk11load.c nss/lib/pk11wrap/pk11load.c
+index 9e7a0a546..a0a23a1a4 100644
+--- nss/lib/pk11wrap/pk11load.c
++++ nss/lib/pk11wrap/pk11load.c
+@@ -466,6 +466,15 @@ secmod_LoadPKCS11Module(SECMODModule *mod, SECMODModule **oldModule)
+          * unload the library if anything goes wrong from here on out...
+          */
+         library = PR_LoadLibrary(mod->dllName);
++#ifndef NSS_STATIC_SOFTOKEN
++        if ((library == NULL) &&
++            !rindex(mod->dllName, PR_GetDirectorySeparator())) {
++            library = PORT_LoadLibraryFromOrigin(my_shlib_name,
++                (PRFuncPtr) &softoken_LoadDSO,
++                mod->dllName);
++        }
++#endif
++
+         mod->library = (void *)library;
+ 
+         if (library == NULL) {
+diff --git nss/lib/util/secload.c nss/lib/util/secload.c
+index 12efd2f75..8b74478f6 100644
+--- nss/lib/util/secload.c
++++ nss/lib/util/secload.c
+@@ -70,9 +70,14 @@ loader_LoadLibInReferenceDir(const char* referencePath, const char* name)
+ 
+     /* Remove the trailing filename from referencePath and add the new one */
+     c = strrchr(referencePath, PR_GetDirectorySeparator());
++    if (!c) { /* referencePath doesn't contain a / means that dladdr gave us argv[0]
++               * and program was called from $PATH. Hack to get libs from NIX_NSS_LIBDIR */
++        referencePath = NIX_NSS_LIBDIR;
++        c = (char*) &referencePath[sizeof(NIX_NSS_LIBDIR) - 1]; /* last / */
++    }
+     if (c) {
+         size_t referencePathSize = 1 + c - referencePath;
+-        fullName = (char*)PORT_Alloc(strlen(name) + referencePathSize + 1);
++        fullName = (char*) PORT_Alloc(strlen(name) + referencePathSize + 5);
+         if (fullName) {
+             memcpy(fullName, referencePath, referencePathSize);
+             strcpy(fullName + referencePathSize, name);
+@@ -82,6 +87,11 @@ loader_LoadLibInReferenceDir(const char* referencePath, const char* name)
+ #endif
+             libSpec.type = PR_LibSpec_Pathname;
+             libSpec.value.pathname = fullName;
++            if ((referencePathSize >= 4) &&
++                (strncmp(fullName + referencePathSize - 4, "bin", 3) == 0)) {
++                memcpy(fullName + referencePathSize -4, "lib", 3);
++            }
++            strcpy(fullName + referencePathSize, name);
+             dlh = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW | PR_LD_LOCAL
+ #ifdef PR_LD_ALT_SEARCH_PATH
+                                                        /* allow library's dependencies to be found in the same directory
+@@ -89,6 +99,10 @@ loader_LoadLibInReferenceDir(const char* referencePath, const char* name)
+                                                        | PR_LD_ALT_SEARCH_PATH
+ #endif
+                                           );
++            if (! dlh) {
++                strcpy(fullName + referencePathSize, name);
++                dlh = PR_LoadLibraryWithFlags(libSpec, PR_LD_NOW | PR_LD_LOCAL);
++            }
+             PORT_Free(fullName);
+         }
+     }
diff --git a/nixpkgs/pkgs/development/libraries/nss/ckpem.patch b/nixpkgs/pkgs/development/libraries/nss/ckpem.patch
new file mode 100644
index 000000000000..c1a65a6c0b28
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nss/ckpem.patch
@@ -0,0 +1,11 @@
+--- nss/lib/ckfw/pem/ckpem.h	2018-01-03 13:36:12.000000000 -0800
++++ nss/lib/ckfw/pem/ckpem.h	2018-01-03 13:36:20.000000000 -0800
+@@ -156,8 +156,6 @@
+ NSS_EXTERN_DATA pemInternalObject nss_pem_data[];
+ NSS_EXTERN_DATA const PRUint32               nss_pem_nObjects;
+ 
+-  PRBool          logged_in;
+-
+ /* our raw object data array */
+ NSS_EXTERN_DATA pemInternalObject nss_pem_data[];
+ NSS_EXTERN_DATA const PRUint32               nss_pem_nObjects;
diff --git a/nixpkgs/pkgs/development/libraries/nss/default.nix b/nixpkgs/pkgs/development/libraries/nss/default.nix
new file mode 100644
index 000000000000..2df6214ab091
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nss/default.nix
@@ -0,0 +1,197 @@
+{ lib
+, stdenv
+, fetchurl
+, nspr
+, perl
+, zlib
+, sqlite
+, ninja
+, darwin
+, fixDarwinDylibNames
+, buildPackages
+, useP11kit ? true
+, p11-kit
+, # allow FIPS mode. Note that this makes the output non-reproducible.
+  # https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS/NSS_Tech_Notes/nss_tech_note6
+  enableFIPS ? false
+}:
+
+let
+  nssPEM = fetchurl {
+    url = "http://dev.gentoo.org/~polynomial-c/mozilla/nss-3.15.4-pem-support-20140109.patch.xz";
+    sha256 = "10ibz6y0hknac15zr6dw4gv9nb5r5z9ym6gq18j3xqx7v7n3vpdw";
+  };
+
+  # NOTE: Whenever you updated this version check if the `cacert` package also
+  #       needs an update. You can run the regular updater script for cacerts.
+  #       It will rebuild itself using the version of this package (NSS) and if
+  #       an update is required do the required changes to the expression.
+  #       Example: nix-shell ./maintainers/scripts/update.nix --argstr package cacert
+  version = "3.68";
+
+in
+stdenv.mkDerivation rec {
+  pname = "nss";
+  inherit version;
+
+  src = fetchurl {
+    url = "mirror://mozilla/security/nss/releases/NSS_${lib.replaceStrings [ "." ] [ "_" ] version}_RTM/src/${pname}-${version}.tar.gz";
+    sha256 = "0nvj7h2brcw21p1z99nrsxka056d0r1yy9nqqg0lw0w3mhnb60n4";
+  };
+
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+
+  nativeBuildInputs = [ perl ninja (buildPackages.python3.withPackages (ps: with ps; [ gyp ])) ]
+    ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.cctools fixDarwinDylibNames ];
+
+  buildInputs = [ zlib sqlite ];
+
+  propagatedBuildInputs = [ nspr ];
+
+  prePatch = ''
+    # strip the trailing whitespace from the patch line and the renamed CKO_NETSCAPE_ enum to CKO_NSS_
+    xz -d < ${nssPEM} | sed \
+       -e 's/-DIRS = builtins $/-DIRS = . builtins/g' \
+       -e 's/CKO_NETSCAPE_/CKO_NSS_/g' \
+       -e 's/CKT_NETSCAPE_/CKT_NSS_/g' \
+       | patch -p1
+
+    patchShebangs nss
+
+    for f in nss/coreconf/config.gypi nss/build.sh nss/coreconf/config.gypi; do
+      substituteInPlace "$f" --replace "/usr/bin/env" "${buildPackages.coreutils}/bin/env"
+    done
+
+    substituteInPlace nss/coreconf/config.gypi --replace "/usr/bin/grep" "${buildPackages.coreutils}/bin/env grep"
+  '';
+
+  patches = [
+    # Based on http://patch-tracker.debian.org/patch/series/dl/nss/2:3.15.4-1/85_security_load.patch
+    ./85_security_load.patch
+    ./ckpem.patch
+    ./fix-cross-compilation.patch
+  ];
+
+  patchFlags = [ "-p0" ];
+
+  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
+    substituteInPlace nss/coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)"
+    substituteInPlace nss/coreconf/config.gypi --replace "'DYLIB_INSTALL_NAME_BASE': '@executable_path'" "'DYLIB_INSTALL_NAME_BASE': '$out/lib'"
+  '';
+
+  outputs = [ "out" "dev" "tools" ];
+
+  preConfigure = "cd nss";
+
+  buildPhase =
+    let
+      getArch = platform:
+        if platform.isx86_64 then "x64"
+        else if platform.isx86_32 then "ia32"
+        else if platform.isAarch32 then "arm"
+        else if platform.isAarch64 then "arm64"
+        else if platform.isPower && platform.is64bit then
+          (
+            if platform.isLittleEndian then "ppc64le" else "ppc64"
+          )
+        else platform.parsed.cpu.name;
+      # yes, this is correct. nixpkgs uses "host" for the platform the binary will run on whereas nss uses "host" for the platform that the build is running on
+      target = getArch stdenv.hostPlatform;
+      host = getArch stdenv.buildPlatform;
+    in
+    ''
+      runHook preBuild
+
+      sed -i 's|nss_dist_dir="$dist_dir"|nss_dist_dir="'$out'"|;s|nss_dist_obj_dir="$obj_dir"|nss_dist_obj_dir="'$out'"|' build.sh
+      ./build.sh -v --opt \
+        --with-nspr=${nspr.dev}/include:${nspr.out}/lib \
+        --system-sqlite \
+        --enable-legacy-db \
+        --target ${target} \
+        -Dhost_arch=${host} \
+        -Duse_system_zlib=1 \
+        --enable-libpkix \
+        ${lib.optionalString enableFIPS "--enable-fips"} \
+        ${lib.optionalString stdenv.isDarwin "--clang"} \
+        ${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "--disable-tests"}
+
+      runHook postBuild
+    '';
+
+  NIX_CFLAGS_COMPILE = "-Wno-error -DNIX_NSS_LIBDIR=\"${placeholder "out"}/lib/\" " + lib.optionalString stdenv.hostPlatform.is64bit "-DNSS_USE_64=1";
+
+  installPhase = ''
+    runHook preInstall
+
+    rm -rf $out/private
+    find $out -name "*.TOC" -delete
+    mv $out/public $out/include
+
+    ln -s lib $out/lib64
+
+    # Upstream issue: https://bugzilla.mozilla.org/show_bug.cgi?id=530672
+    # https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-libs/nss/files/nss-3.32-gentoo-fixups.patch?id=af1acce6c6d2c3adb17689261dfe2c2b6771ab8a
+    NSS_MAJOR_VERSION=`grep "NSS_VMAJOR" lib/nss/nss.h | awk '{print $3}'`
+    NSS_MINOR_VERSION=`grep "NSS_VMINOR" lib/nss/nss.h | awk '{print $3}'`
+    NSS_PATCH_VERSION=`grep "NSS_VPATCH" lib/nss/nss.h | awk '{print $3}'`
+    PREFIX="$out"
+
+    mkdir -p $out/lib/pkgconfig
+    sed -e "s,%prefix%,$PREFIX," \
+        -e "s,%exec_prefix%,$PREFIX," \
+        -e "s,%libdir%,$PREFIX/lib64," \
+        -e "s,%includedir%,$dev/include/nss," \
+        -e "s,%NSS_VERSION%,$NSS_MAJOR_VERSION.$NSS_MINOR_VERSION.$NSS_PATCH_VERSION,g" \
+        -e "s,%NSPR_VERSION%,4.16,g" \
+        pkg/pkg-config/nss.pc.in > $out/lib/pkgconfig/nss.pc
+    chmod 0644 $out/lib/pkgconfig/nss.pc
+
+    sed -e "s,@prefix@,$PREFIX," \
+        -e "s,@MOD_MAJOR_VERSION@,$NSS_MAJOR_VERSION," \
+        -e "s,@MOD_MINOR_VERSION@,$NSS_MINOR_VERSION," \
+        -e "s,@MOD_PATCH_VERSION@,$NSS_PATCH_VERSION," \
+        pkg/pkg-config/nss-config.in > $out/bin/nss-config
+    chmod 0755 $out/bin/nss-config
+  '';
+
+  postInstall = lib.optionalString useP11kit ''
+    # Replace built-in trust with p11-kit connection
+    ln -sf ${p11-kit}/lib/pkcs11/p11-kit-trust.so $out/lib/libnssckbi.so
+  '';
+
+  postFixup =
+    let
+      isCross = stdenv.hostPlatform != stdenv.buildPlatform;
+      nss = if isCross then buildPackages.nss.tools else "$out";
+    in
+    (lib.optionalString enableFIPS (''
+      for libname in freebl3 nssdbm3 softokn3
+      do '' +
+    (if stdenv.isDarwin
+    then ''
+      libfile="$out/lib/lib$libname.dylib"
+      DYLD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
+    '' else ''
+      libfile="$out/lib/lib$libname.so"
+      LD_LIBRARY_PATH=$out/lib:${nspr.out}/lib \
+    '') + ''
+          ${nss}/bin/shlibsign -v -i "$libfile"
+      done
+    '')) +
+    ''
+      moveToOutput bin "$tools"
+      moveToOutput bin/nss-config "$dev"
+      moveToOutput lib/libcrmf.a "$dev" # needed by firefox, for example
+      rm -f "$out"/lib/*.a
+
+      runHook postInstall
+    '';
+
+  meta = with lib; {
+    homepage = "https://developer.mozilla.org/en-US/docs/Mozilla/Projects/NSS";
+    description = "A set of libraries for development of security-enabled client and server applications";
+    maintainers = with maintainers; [ ];
+    license = licenses.mpl20;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nss/fix-cross-compilation.patch b/nixpkgs/pkgs/development/libraries/nss/fix-cross-compilation.patch
new file mode 100644
index 000000000000..42b0620f48d9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nss/fix-cross-compilation.patch
@@ -0,0 +1,11 @@
+--- nss/nss.gyp
++++ nss/nss.gyp
+@@ -280,7 +280,7 @@
+                   'outputs/': [['exclude', 'nssdbm3']]
+                 }],
+               ],
+-              'action': ['<(python)', '<(DEPTH)/coreconf/shlibsign.py', '<@(_inputs)']
++              'action': ['true']
+             }
+           ],
+         },
diff --git a/nixpkgs/pkgs/development/libraries/nss_wrapper/default.nix b/nixpkgs/pkgs/development/libraries/nss_wrapper/default.nix
new file mode 100644
index 000000000000..a4538aa370cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nss_wrapper/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, cmake, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "nss_wrapper";
+  version = "1.1.11";
+
+  src = fetchurl {
+    url = "mirror://samba/cwrap/nss_wrapper-${version}.tar.gz";
+    sha256 = "1q5l6w69yc71ly8gcbnkrcbnq6b64cbiiv99m0z5vn5lgwp36igv";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  meta = with lib; {
+    description = "A wrapper for the user, group and hosts NSS API";
+    homepage = "https://git.samba.org/?p=nss_wrapper.git;a=summary;";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    broken = stdenv.isDarwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nsss/default.nix b/nixpkgs/pkgs/development/libraries/nsss/default.nix
new file mode 100644
index 000000000000..527e7d4898e1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nsss/default.nix
@@ -0,0 +1,33 @@
+{ skawarePackages }:
+
+with skawarePackages;
+
+buildPackage {
+  pname = "nsss";
+  version = "0.1.0.1";
+  sha256 = "1nair10m7fddp50mpqnwj0qiggnh5qmnffmyzxis5l1ixcav1ir0";
+
+  description = "An implementation of a subset of the pwd.h, group.h and shadow.h family of functions.";
+
+  # TODO: nsss support
+  configureFlags = [
+    "--libdir=\${lib}/lib"
+    "--dynlibdir=\${lib}/lib"
+    "--bindir=\${bin}/bin"
+    "--includedir=\${dev}/include"
+    "--with-sysdeps=${skalibs.lib}/lib/skalibs/sysdeps"
+    "--with-include=${skalibs.dev}/include"
+    "--with-lib=${skalibs.lib}/lib"
+    "--with-dynlib=${skalibs.lib}/lib"
+  ];
+
+  postInstall = ''
+    # remove all nsss executables from build directory
+    rm $(find -name "nsssd-*" -type f -mindepth 1 -maxdepth 1 -executable)
+    rm libnsss.* libnsssd.*
+
+    mv doc $doc/share/doc/nsss/html
+    mv examples $doc/share/doc/nsss/examples
+  '';
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/ntbtls/default.nix b/nixpkgs/pkgs/development/libraries/ntbtls/default.nix
new file mode 100644
index 000000000000..b6dcfc782f3a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ntbtls/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, gettext, libgpgerror, libgcrypt, libksba, zlib }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "ntbtls";
+  version = "0.2.0";
+
+  src = fetchurl {
+    url = "mirror://gnupg/ntbtls/ntbtls-${version}.tar.bz2";
+    sha256 = "sha256-ZJ/nSjEdE+Q7FrJuuqkWZd22MpJbc5AlkurD7TBRnhc=";
+  };
+
+  outputs = [ "dev" "out" ];
+
+  buildInputs = [ libgcrypt libgpgerror libksba zlib ]
+    ++ lib.optional stdenv.isDarwin gettext;
+
+  postInstall = ''
+    moveToOutput "bin/ntbtls-config" $dev
+  '';
+
+  meta = {
+    description = "A tiny TLS 1.2 only implementation";
+    homepage = "https://www.gnupg.org/software/ntbtls/";
+    license = licenses.gpl3Plus;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ joachifm ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ntdb/default.nix b/nixpkgs/pkgs/development/libraries/ntdb/default.nix
new file mode 100644
index 000000000000..021436516c22
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ntdb/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv
+, fetchurl
+, python2
+, python3
+, pkg-config
+, readline
+, gettext
+, libxslt
+, docbook-xsl-nons
+, docbook_xml_dtd_42
+, wafHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ntdb";
+  version = "1.0";
+
+  src = fetchurl {
+    url = "mirror://samba/tdb/${pname}-${version}.tar.gz";
+    sha256 = "0jdzgrz5sr25k83yrw7wqb3r0yj1v04z4s3lhsmnr5z6n5ifhyl1";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    gettext
+    libxslt
+    docbook-xsl-nons
+    docbook_xml_dtd_42
+    wafHook
+    python2 # For wafHook
+  ];
+
+  buildInputs = [
+    python3
+    readline # required to build python
+  ];
+
+  wafPath = "buildtools/bin/waf";
+
+  wafConfigureFlags = [
+    "--bundled-libraries=NONE"
+    "--builtin-libraries=replace,ccan"
+  ];
+
+  meta = with lib; {
+    description = "The not-so trivial database";
+    homepage = "https://tdb.samba.org/";
+    license = licenses.lgpl3Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ntirpc/default.nix b/nixpkgs/pkgs/development/libraries/ntirpc/default.nix
new file mode 100644
index 000000000000..e98cfac78581
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ntirpc/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, cmake
+, krb5, liburcu , libtirpc, libnsl
+} :
+
+stdenv.mkDerivation rec {
+  pname = "ntirpc";
+  version = "3.4";
+
+  src = fetchFromGitHub {
+    owner = "nfs-ganesha";
+    repo = "ntirpc";
+    rev = "v${version}";
+    sha256 = "1xdwqyc9m4lbsgr7ll1g0f84c2h8jrfkg67cgvsp424i1a7r9mm1";
+  };
+
+  postPatch = ''
+    substituteInPlace ntirpc/netconfig.h --replace "/etc/netconfig" "$out/etc/netconfig"
+  '';
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ krb5 liburcu libnsl ];
+
+  postInstall = ''
+    mkdir -p $out/etc
+
+    # Library needs a netconfig to run.
+    # Steal the file from libtirpc
+    cp ${libtirpc}/etc/netconfig $out/etc/
+  '';
+
+  meta = with lib; {
+    description = "Transport-independent RPC (TI-RPC)";
+    homepage = "https://github.com/nfs-ganesha/ntirpc";
+    maintainers = [ maintainers.markuskowa ];
+    platforms = platforms.linux;
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ntl/default.nix b/nixpkgs/pkgs/development/libraries/ntl/default.nix
new file mode 100644
index 000000000000..6e41639d48e5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ntl/default.nix
@@ -0,0 +1,76 @@
+{ stdenv
+, lib
+, fetchurl
+, perl
+, gmp
+, gf2x ? null
+# I asked the ntl maintainer weather or not to include gf2x by default:
+# > If I remember correctly, gf2x is now thread safe, so there's no reason not to use it.
+, withGf2x ? true
+, tune ? false # tune for current system; non reproducible and time consuming
+}:
+
+assert withGf2x -> gf2x != null;
+
+stdenv.mkDerivation rec {
+  pname = "ntl";
+  version = "11.4.4";
+
+  src = fetchurl {
+    url = "http://www.shoup.net/ntl/ntl-${version}.tar.gz";
+    sha256 = "sha256-nX9uguEaQJ8VHA3i3rCMDXY7r5g0/d/UMr89IY+AIds=";
+  };
+
+  buildInputs = [
+    gmp
+  ];
+
+  nativeBuildInputs = [
+    perl # needed for ./configure
+  ];
+
+  sourceRoot = "${pname}-${version}/src";
+
+  enableParallelBuilding = true;
+
+  dontAddPrefix = true; # DEF_PREFIX instead
+
+  # reference: http://shoup.net/ntl/doc/tour-unix.html
+  configureFlags = [
+    "DEF_PREFIX=$(out)"
+    "SHARED=on" # genereate a shared library (as well as static)
+    "NATIVE=off" # don't target code to current hardware (reproducibility, portability)
+    "TUNE=${
+      if tune then
+        "auto"
+      else if stdenv.targetPlatform.isx86 then
+        "x86" # "chooses options that should be well suited for most x86 platforms"
+      else
+        "generic" # "chooses options that should be OK for most platforms"
+    }"
+    "CXX=${stdenv.cc.targetPrefix}c++"
+  ] ++ lib.optionals withGf2x [
+    "NTL_GF2X_LIB=on"
+    "GF2X_PREFIX=${gf2x}"
+  ];
+
+  doCheck = true; # takes some time
+
+  meta = with lib; {
+    description = "A Library for doing Number Theory";
+    longDescription = ''
+      NTL is a high-performance, portable C++ library providing data
+      structures and algorithms for manipulating signed, arbitrary
+      length integers, and for vectors, matrices, and polynomials over
+      the integers and over finite fields.
+    '';
+    # 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 = teams.sage.members;
+    license = licenses.gpl2Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ntrack/default.nix b/nixpkgs/pkgs/development/libraries/ntrack/default.nix
new file mode 100644
index 000000000000..eef6bbdd580f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ntrack/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, qt4, pkg-config, libnl, python }:
+
+stdenv.mkDerivation rec {
+  pname = "ntrack";
+  version = "016";
+
+  src = fetchurl {
+    url = "https://launchpad.net/ntrack/main/${version}/+download/${pname}-${version}.tar.gz";
+    sha256 = "037ig5y0mp327m0hh4pnfr3vmsk3wrxgfjy3645q4ws9vdhx807w";
+  };
+
+  buildInputs = [ libnl qt4 ];
+
+  nativeBuildInputs = [ pkg-config python ];
+
+  # error: ISO C does not support '__FUNCTION__' predefined identifier [-Werror=pedantic]
+  NIX_CFLAGS_COMPILE = "-Wno-error";
+
+  configureFlags = [ "--without-gobject" "CFLAGS=--std=gnu99" ];
+
+  # Remove this patch after version 016
+  patches = [ ./libnl-fix.patch ];
+
+  postPatch = ''
+    sed -e "s@/usr\(/lib/ntrack/modules/\)@$out&@" -i common/ntrack.c
+  '';
+
+  meta = with lib; {
+    description = "Network Connectivity Tracking library for Desktop Applications";
+    homepage = "https://launchpad.net/ntrack";
+    platforms = platforms.linux;
+    license = licenses.lgpl3Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ntrack/libnl-fix.patch b/nixpkgs/pkgs/development/libraries/ntrack/libnl-fix.patch
new file mode 100644
index 000000000000..806a0178ec8a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ntrack/libnl-fix.patch
@@ -0,0 +1,11 @@
+--- ./modules/ntrack-libnl.c.orig	2013-12-02 11:31:54.749215448 -0600
++++ ./modules/ntrack-libnl.c	2013-12-02 11:34:46.597684553 -0600
+@@ -530,7 +530,7 @@
+ 		op_default_route_disappeared ((struct _ntrack_monitor_arch*) self, nl_info);
+ 	} else if (nl_info->topmost_route && topmost_route) {
+ 		int diff_bits;
+-		if ((diff_bits = (route_obj_ops.oo_id_attrs | ROUTE_ATTR_OIF
++		if ((diff_bits = (nl_object_get_id_attrs(OBJ_CAST(topmost_route)) | ROUTE_ATTR_OIF
+ 		                  | ROUTE_ATTR_GATEWAY) &
+ 		                  nl_object_diff (OBJ_CAST (nl_info->topmost_route),
+ 		                                  OBJ_CAST (topmost_route)))) {
diff --git a/nixpkgs/pkgs/development/libraries/nuraft/default.nix b/nixpkgs/pkgs/development/libraries/nuraft/default.nix
new file mode 100644
index 000000000000..232fdfc512f0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nuraft/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, cmake, boost172, asio, openssl, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "nuraft";
+  version = "1.3.0";
+
+  src = fetchFromGitHub {
+    owner = "eBay";
+    repo = "NuRaft";
+    rev = "v${version}";
+    sha256 = "sha256-Fyy9B5CXyMcDSOdqaeJ4ejo1svM90ESXuNL0rzsTZpE=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost172 asio openssl zlib ];
+
+  meta = with lib; {
+    homepage = "https://github.com/eBay/NuRaft";
+    description = "C++ implementation of Raft core logic as a replication library";
+    license = licenses.asl20;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ wheelsandmetal ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nuspell/default.nix b/nixpkgs/pkgs/development/libraries/nuspell/default.nix
new file mode 100644
index 000000000000..b7f438e9d072
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nuspell/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, icu, catch2, pandoc }:
+
+stdenv.mkDerivation rec {
+  pname = "nuspell";
+  version = "5.0.0";
+
+  src = fetchFromGitHub {
+    owner = "nuspell";
+    repo = "nuspell";
+    rev = "v${version}";
+    sha256 = "039ryhwfbbrrhavzyr999kngj10nk9n81i6qigxj6igfl4fzjy87";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config pandoc ];
+  buildInputs = [ icu ];
+
+  outputs = [ "out" "lib" "dev" "man" ];
+
+  postPatch = ''
+    rm -rf external/Catch2
+    ln -sf ${catch2.src} external/Catch2
+  '';
+
+  postInstall = ''
+    rm -rf $out/share/doc
+  '';
+
+  meta = with lib; {
+    description = "Free and open source C++ spell checking library";
+    homepage = "https://nuspell.github.io/";
+    platforms = platforms.all;
+    maintainers = with maintainers; [ fpletz ];
+    license = licenses.lgpl3Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nuspell/wrapper.nix b/nixpkgs/pkgs/development/libraries/nuspell/wrapper.nix
new file mode 100644
index 000000000000..ab09931579c7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nuspell/wrapper.nix
@@ -0,0 +1,13 @@
+{ stdenv, lib, nuspell, makeWrapper, dicts ? [] }:
+with lib;
+let
+  searchPath = makeSearchPath "share/hunspell" dicts;
+in
+stdenv.mkDerivation {
+  name = (appendToName "with-dicts" nuspell).name;
+  nativeBuildInputs = [ makeWrapper ];
+  buildCommand = ''
+    makeWrapper ${nuspell}/bin/nuspell $out/bin/nuspell --prefix DICPATH : ${searchPath}
+  '';
+  meta = removeAttrs nuspell.meta ["outputsToInstall"];
+}
diff --git a/nixpkgs/pkgs/development/libraries/nv-codec-headers/10_x.nix b/nixpkgs/pkgs/development/libraries/nv-codec-headers/10_x.nix
new file mode 100644
index 000000000000..b1fe1611301f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nv-codec-headers/10_x.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchgit }:
+
+stdenv.mkDerivation rec {
+  pname = "nv-codec-headers";
+  version = "10.0.26.2";
+
+  src = fetchgit {
+    url = "https://git.videolan.org/git/ffmpeg/nv-codec-headers.git";
+    rev = "n${version}";
+    sha256 = "0n5jlwjfv5irx1if1g0n52m279bw7ab6bd3jz2v4vwg9cdzbxx85";
+  };
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = {
+    description = "FFmpeg version of headers for NVENC";
+    homepage = "https://ffmpeg.org/";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.MP2E ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nv-codec-headers/default.nix b/nixpkgs/pkgs/development/libraries/nv-codec-headers/default.nix
new file mode 100644
index 000000000000..9b8323e6c978
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nv-codec-headers/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchgit }:
+
+stdenv.mkDerivation rec {
+  pname = "nv-codec-headers";
+  version = "9.1.23.1";
+
+  src = fetchgit {
+    url = "https://git.videolan.org/git/ffmpeg/nv-codec-headers.git";
+    rev = "n${version}";
+    sha256 = "1xfvb3mhz6wfx9c732888xa82ivaig903lhvvrqqzs31qfznsplh";
+  };
+
+  makeFlags = [ "PREFIX=$(out)" ];
+
+  meta = {
+    description = "FFmpeg version of headers for NVENC";
+    homepage = "https://ffmpeg.org/";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.MP2E ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nvidia-optical-flow-sdk/default.nix b/nixpkgs/pkgs/development/libraries/nvidia-optical-flow-sdk/default.nix
new file mode 100644
index 000000000000..a82fa9068c66
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nvidia-optical-flow-sdk/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation {
+  pname = "nvidia-optical-flow-sdk";
+  version = "2.0";
+
+  src = fetchFromGitHub {
+    owner = "NVIDIA";
+    repo = "NVIDIAOpticalFlowSDK";
+    rev = "edb50da3cf849840d680249aa6dbef248ebce2ca";
+    sha256 = "0hv0m0k9wl2wjhhl886j7ymngnf2xz7851nfh57s1gy5bv9lgdgz";
+  };
+
+  # # We only need the header files. The library files are
+  # # in the nvidia_x11 driver.
+  installPhase = ''
+    mkdir -p $out/include
+    cp -R * $out/include
+  '';
+
+  meta = with lib; {
+    description = "Nvidia optical flow headers for computing the relative motion of pixels between images";
+    homepage = "https://developer.nvidia.com/opticalflow-sdk";
+    license = licenses.bsd3; # applies to the header files only
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nvidia-texture-tools/default.nix b/nixpkgs/pkgs/development/libraries/nvidia-texture-tools/default.nix
new file mode 100644
index 000000000000..676245967202
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nvidia-texture-tools/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, fetchFromGitHub, cmake, fetchpatch }:
+
+stdenv.mkDerivation rec {
+  pname = "nvidia-texture-tools";
+  version = "unstable-2019-10-27";
+
+  src = fetchFromGitHub {
+    owner = "castano";
+    repo = "nvidia-texture-tools";
+    rev = "a131e4c6b0b7c9c73ccc3c9e6f1c7e165be86bcc";
+    sha256 = "1qzyr3ib5dpxyq1y33lq02qv4cww075sm9bm4f651d34q5x38sk3";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://github.com/castano/nvidia-texture-tools/commit/6474f2593428d89ec152da2502aa136ababe66ca.patch";
+      sha256 = "0akbkvm55hiv58jx71h9hj173rbnqlb5a430y9azjiix7zga42vd";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  outputs = [ "out" "dev" "lib" ];
+
+  postPatch = ''
+    # Make a recently added pure virtual function just virtual,
+    # to keep compatibility.
+    sed -i 's/virtual void endImage() = 0;/virtual void endImage() {}/' src/nvtt/nvtt.h
+  '';
+
+  cmakeFlags = [
+    "-DNVTT_SHARED=TRUE"
+  ];
+
+  postInstall = ''
+    moveToOutput include "$dev"
+    moveToOutput lib "$lib"
+  '';
+
+  meta = with lib; {
+    description = "A set of cuda-enabled texture tools and compressors";
+    homepage = "https://github.com/castano/nvidia-texture-tools";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    broken = stdenv.isAarch64;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/nvidia-video-sdk/default.nix b/nixpkgs/pkgs/development/libraries/nvidia-video-sdk/default.nix
new file mode 100644
index 000000000000..ab674833ebfc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/nvidia-video-sdk/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, unzip }:
+
+stdenv.mkDerivation rec {
+  pname = "nvidia-video-sdk";
+  version = "6.0.1";
+
+  src = fetchurl {
+    url = "https://developer.nvidia.com/video-sdk-601";
+    name = "nvidia_video_sdk_${version}.zip";
+    sha256 = "08h1vnqsv22js9v3pyim5yb80z87baxb7s2g5gsvvjax07j7w8h5";
+  };
+
+  nativeBuildInputs = [ unzip ];
+
+  # We only need the header files. The library files are
+  # in the nvidia_x11 driver.
+  installPhase = ''
+    mkdir -p $out/include
+    cp -R Samples/common/inc/* $out/include
+  '';
+
+  meta = with lib; {
+    description = "The NVIDIA Video Codec SDK";
+    homepage = "https://developer.nvidia.com/nvidia-video-codec-sdk";
+    license = licenses.unfree;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/oatpp/default.nix b/nixpkgs/pkgs/development/libraries/oatpp/default.nix
new file mode 100644
index 000000000000..e9f92a31f2c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/oatpp/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "oatpp";
+  version = "1.2.5";
+
+  src = fetchFromGitHub {
+    owner = "oatpp";
+    repo = "oatpp";
+    rev = version;
+    sha256 = "sha256-Vtdz03scx0hvY1yeM7yfSxCVKzi84OQ1Oh9b922movE=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  # Tests fail on darwin. See https://github.com/NixOS/nixpkgs/pull/105419#issuecomment-735826894
+  doCheck = !stdenv.isDarwin;
+
+  meta = with lib; {
+    homepage = "https://oatpp.io/";
+    description = "Light and powerful C++ web framework for highly scalable and resource-efficient web applications";
+    license = licenses.asl20;
+    maintainers = [ maintainers.ivar ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ocl-icd/default.nix b/nixpkgs/pkgs/development/libraries/ocl-icd/default.nix
new file mode 100644
index 000000000000..b84aa6a146d7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ocl-icd/default.nix
@@ -0,0 +1,26 @@
+{lib, stdenv, fetchurl, ruby, opencl-headers, addOpenGLRunpath }:
+
+stdenv.mkDerivation rec {
+  pname = "ocl-icd";
+  version = "2.2.10";
+
+  src = fetchurl {
+    url = "https://forge.imag.fr/frs/download.php/810/${pname}-${version}.tar.gz";
+    sha256 = "0f14gpa13sdm0kzqv5yycp4pschbmi6n5fj7wl4ilspzsrqcgqr2";
+  };
+
+  nativeBuildInputs = [ ruby ];
+
+  buildInputs = [ opencl-headers ];
+
+  postPatch = ''
+    sed -i 's,"/etc/OpenCL/vendors","${addOpenGLRunpath.driverLink}/etc/OpenCL/vendors",g' ocl_icd_loader.c
+  '';
+
+  meta = with lib; {
+    description = "OpenCL ICD Loader for ${opencl-headers.name}";
+    homepage    = "https://forge.imag.fr/projects/ocl-icd/";
+    license     = licenses.bsd2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/octomap/default.nix b/nixpkgs/pkgs/development/libraries/octomap/default.nix
new file mode 100644
index 000000000000..e35a0df79f08
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/octomap/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "octomap";
+  version = "1.9.7";
+
+  src = fetchFromGitHub {
+    owner = "OctoMap";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1pb58w6vka7wzs533lcy7i6y5nwjfrzy6b35fhrb1dhq2mgszc79";
+  };
+  sourceRoot = "source/octomap";
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "A probabilistic, flexible, and compact 3D mapping library for robotic systems";
+    homepage = "https://octomap.github.io/";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ lopsided98 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ode/default.nix b/nixpkgs/pkgs/development/libraries/ode/default.nix
new file mode 100644
index 000000000000..211821e084cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ode/default.nix
@@ -0,0 +1,18 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "ode";
+  version = "0.16.2";
+
+  src = fetchurl {
+    url = "https://bitbucket.org/odedevs/${pname}/downloads/${pname}-${version}.tar.gz";
+    sha256 = "08hgh4gqdk77jcw8b7gq2mwsfg4a5v5y0j7g42bxiqhmn3ffnsmj";
+  };
+
+  meta = with lib; {
+    description = "Open Dynamics Engine";
+    homepage = "https://www.ode.org";
+    platforms = platforms.linux;
+    license = with licenses; [ bsd3 lgpl21 lgpl3 zlib ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/odpic/default.nix b/nixpkgs/pkgs/development/libraries/odpic/default.nix
new file mode 100644
index 000000000000..9e4b01ef172c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/odpic/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchFromGitHub, fixDarwinDylibNames, oracle-instantclient, libaio }:
+
+let
+  version = "4.2.1";
+  libPath = lib.makeLibraryPath [ oracle-instantclient.lib ];
+
+in stdenv.mkDerivation {
+  inherit version;
+
+  pname = "odpic";
+
+  src = fetchFromGitHub {
+    owner = "oracle";
+    repo = "odpi";
+    rev = "v${version}";
+    sha256 = "sha256-jdDMG6+bvsKQkHSpUrwtwU/ngq1iINcUhWu2b9lJgPY=";
+  };
+
+  nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames;
+
+  buildInputs = [ oracle-instantclient ]
+    ++ lib.optionals stdenv.isLinux [ libaio ];
+
+  dontPatchELF = true;
+  makeFlags = [ "PREFIX=$(out)" "CC=${stdenv.cc.targetPrefix}cc" "LD=${stdenv.cc.targetPrefix}cc"];
+
+  postFixup = ''
+    ${lib.optionalString (stdenv.isLinux) ''
+      patchelf --set-rpath "${libPath}:$(patchelf --print-rpath $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary})" $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary}
+    ''}
+    ${lib.optionalString (stdenv.isDarwin) ''
+      install_name_tool -add_rpath "${libPath}" $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary}
+    ''}
+    '';
+
+  meta = with lib; {
+    description = "Oracle ODPI-C library";
+    homepage = "https://oracle.github.io/odpi/";
+    maintainers = with maintainers; [ mkazulak flokli ];
+    license = licenses.asl20;
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+    hydraPlatforms = [];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ogdf/default.nix b/nixpkgs/pkgs/development/libraries/ogdf/default.nix
new file mode 100644
index 000000000000..bee64afd2900
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ogdf/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchFromGitHub, cmake, doxygen }:
+
+stdenv.mkDerivation rec {
+  pname = "ogdf";
+  version = "2020.02";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "catalpa-202002";
+    sha256 = "0drrs8zh1097i5c60z9g658vs9k1iinkav8crlwk722ihfm1vxqd";
+  };
+
+  nativeBuildInputs = [ cmake doxygen ];
+
+  cmakeFlags = [ "-DCMAKE_CXX_FLAGS=-fPIC" ];
+
+  # Without disabling hardening for format, the build fails with
+  # the following error.
+  #> /build/source/src/coin/CoinUtils/CoinMessageHandler.cpp:766:35: error: format not a string literal and no format arguments [-Werror=format-security]
+  #> 766 |      sprintf(messageOut_,format_+2);
+  hardeningDisable = [ "format" ];
+
+  meta = with lib; {
+    description = "Open Graph Drawing Framework/Open Graph algorithms and Data structure Framework";
+    homepage = "http://www.ogdf.net";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.ianwookim ];
+    platforms = platforms.i686 ++ platforms.x86_64;
+    longDescription = ''
+      OGDF stands both for Open Graph Drawing Framework (the original name) and
+      Open Graph algorithms and Data structures Framework.
+
+      OGDF is a self-contained C++ library for graph algorithms, in particular
+      for (but not restricted to) automatic graph drawing. It offers sophisticated
+      algorithms and data structures to use within your own applications or
+      scientific projects.
+
+      OGDF is developed and supported by Osnabrück University, TU Dortmund,
+      University of Cologne, University of Konstanz, and TU Ilmenau.
+    '';
+   };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix b/nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix
new file mode 100644
index 000000000000..849db216b921
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix
@@ -0,0 +1,41 @@
+{ fetchurl, stdenv, lib
+, cmake, libGLU, libGL
+, freetype, freeimage, zziplib, xorgproto, libXrandr
+, libXaw, freeglut, libXt, libpng, boost, ois
+, libX11, libXmu, libSM, pkg-config
+, libXxf86vm, libICE
+, libXrender
+, withNvidiaCg ? false, nvidia_cg_toolkit
+, withSamples ? false }:
+
+stdenv.mkDerivation {
+  name = "ogre-1.10.11";
+
+  src = fetchurl {
+     url = "https://bitbucket.org/sinbad/ogre/get/v1-10-11.tar.gz";
+     sha256 = "1zwvlx5dz9nwjazhnrhzb0w8ilpa84r0hrxrmmy69pgr1p1yif5a";
+  };
+
+  cmakeFlags = [ "-DOGRE_BUILD_SAMPLES=${toString withSamples}" ]
+    ++ map (x: "-DOGRE_BUILD_PLUGIN_${x}=on")
+           ([ "BSP" "OCTREE" "PCZ" "PFX" ] ++ lib.optional withNvidiaCg "CG")
+    ++ map (x: "-DOGRE_BUILD_RENDERSYSTEM_${x}=on") [ "GL" ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs =
+   [ libGLU libGL
+     freetype freeimage zziplib xorgproto libXrandr
+     libXaw freeglut libXt libpng boost ois
+     libX11 libXmu libSM
+     libXxf86vm libICE
+     libXrender
+   ] ++ lib.optional withNvidiaCg nvidia_cg_toolkit;
+
+  meta = {
+    description = "A 3D engine";
+    homepage = "https://www.ogre3d.org/";
+    maintainers = [ lib.maintainers.raskin ];
+    platforms = lib.platforms.linux;
+    license = lib.licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ogre/1.9.x.nix b/nixpkgs/pkgs/development/libraries/ogre/1.9.x.nix
new file mode 100644
index 000000000000..30d1dd185547
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ogre/1.9.x.nix
@@ -0,0 +1,45 @@
+{ fetchFromGitHub, stdenv, lib
+, cmake, libGLU, libGL
+, freetype, freeimage, zziplib, xorgproto, libXrandr
+, libXaw, freeglut, libXt, libpng, boost, ois
+, libX11, libXmu, libSM, pkg-config
+, libXxf86vm, libICE
+, libXrender
+, withNvidiaCg ? false, nvidia_cg_toolkit
+, withSamples ? false }:
+
+stdenv.mkDerivation rec {
+  pname = "ogre";
+  version = "1.9.1";
+
+  src = fetchFromGitHub {
+    owner = "OGRECave";
+    repo = "ogre";
+    rev = "v${version}";
+    sha256 = "11lfgzqaps3728dswrq3cbwk7aicigyz08q4hfyy6ikc6m35r4wg";
+  };
+
+  cmakeFlags = [ "-DOGRE_BUILD_SAMPLES=${toString withSamples}" ]
+    ++ map (x: "-DOGRE_BUILD_PLUGIN_${x}=on")
+           ([ "BSP" "OCTREE" "PCZ" "PFX" ] ++ lib.optional withNvidiaCg "CG")
+    ++ map (x: "-DOGRE_BUILD_RENDERSYSTEM_${x}=on") [ "GL" ];
+
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs =
+   [ libGLU libGL
+     freetype freeimage zziplib xorgproto libXrandr
+     libXaw freeglut libXt libpng boost ois
+     libX11 libXmu libSM
+     libXxf86vm libICE
+     libXrender
+   ] ++ lib.optional withNvidiaCg nvidia_cg_toolkit;
+
+  meta = {
+    description = "A 3D engine";
+    homepage = "https://www.ogre3d.org/";
+    maintainers = [ lib.maintainers.raskin ];
+    platforms = lib.platforms.linux;
+    license = lib.licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ogre/default.nix b/nixpkgs/pkgs/development/libraries/ogre/default.nix
new file mode 100644
index 000000000000..d097dc623e76
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ogre/default.nix
@@ -0,0 +1,46 @@
+{ fetchurl, stdenv, lib
+, cmake, libGLU, libGL
+, freetype, freeimage, zziplib, xorgproto, libXrandr
+, libXaw, freeglut, libXt, libpng, boost, ois
+, libX11, libXmu, libSM, pkg-config
+, libXxf86vm, libICE
+, unzip
+, libXrender
+, SDL2
+, withNvidiaCg ? false, nvidia_cg_toolkit
+, withSamples ? false }:
+
+stdenv.mkDerivation rec {
+  pname = "ogre";
+  version = "1.12.1";
+
+  src = fetchurl {
+     url = "https://github.com/OGRECave/ogre/archive/v${version}.zip";
+     sha256 = "1iv6k0dwdzg5nnzw2mcgcl663q4f7p2kj7nhs8afnsikrzxxgsi4";
+  };
+
+  cmakeFlags = [ "-DOGRE_BUILD_DEPENDENCIES=OFF" "-DOGRE_BUILD_SAMPLES=${toString withSamples}" ]
+    ++ map (x: "-DOGRE_BUILD_PLUGIN_${x}=on")
+           ([ "BSP" "OCTREE" "PCZ" "PFX" ] ++ lib.optional withNvidiaCg "CG")
+    ++ map (x: "-DOGRE_BUILD_RENDERSYSTEM_${x}=on") [ "GL" ];
+
+
+  nativeBuildInputs = [ cmake unzip pkg-config ];
+  buildInputs =
+   [ cmake libGLU libGL
+     freetype freeimage zziplib xorgproto libXrandr
+     libXaw freeglut libXt libpng boost ois
+     libX11 libXmu libSM
+     libXxf86vm libICE
+     libXrender
+     SDL2
+   ] ++ lib.optional withNvidiaCg nvidia_cg_toolkit;
+
+  meta = {
+    description = "A 3D engine";
+    homepage = "https://www.ogre3d.org/";
+    maintainers = [ lib.maintainers.raskin ];
+    platforms = lib.platforms.linux;
+    license = lib.licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ogrepaged/default.nix b/nixpkgs/pkgs/development/libraries/ogrepaged/default.nix
new file mode 100644
index 000000000000..0aefedb52575
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ogrepaged/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl, fetchpatch, cmake, pkg-config, ois, ogre, libX11, boost }:
+
+stdenv.mkDerivation rec {
+  pname = "ogre-paged";
+  version = "1.2.0";
+
+  src = fetchurl {
+    url = "https://github.com/RigsOfRods/ogre-pagedgeometry/archive/v${version}.tar.gz";
+    sha256 = "17j7rw9wbkynxbhm2lay3qgjnnagb2vd5jn9iijnn2lf8qzbgy82";
+  };
+
+  patches = [
+    # These patches come from https://github.com/RigsOfRods/ogre-pagedgeometry/pull/6
+    # and make ogre-paged build with ogre-1.10.
+    (fetchpatch {
+      url = "https://github.com/RigsOfRods/ogre-pagedgeometry/commit/2d4df577decba37ec3cdafc965deae0f6d31fe45.patch";
+      sha256 = "0mdqa9w1p6cmli6976v4wi0sw9r4p5prkj7lzfd1877wk11c9c73";
+    })
+    (fetchpatch {
+      url = "https://github.com/RigsOfRods/ogre-pagedgeometry/commit/4d81789ec6f55e294a5ad040ea7abe2b415cbc92.patch";
+      sha256 = "17q8djdz2y3g46azxc3idhyvi6vf0sqkxld4bbyp3l9zn7dq76rp";
+    })
+    (fetchpatch {
+      url = "https://github.com/RigsOfRods/ogre-pagedgeometry/commit/10f7c5ce5b422e9cbac59d466f3567a24c8831a4.patch";
+      sha256 = "1kk0dbadzg73ai99l3w04q51sil36vzbkaqc79mdwy0vjrn4ardb";
+    })
+  ];
+
+  buildInputs = [ ois ogre libX11 boost ];
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  cmakeFlags = [ "-DPAGEDGEOMETRY_BUILD_SAMPLES=OFF" ];
+
+  meta = {
+    description = "Paged Geometry for Ogre3D";
+    homepage = "https://github.com/RigsOfRods/ogre-paged";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ois/default.nix b/nixpkgs/pkgs/development/libraries/ois/default.nix
new file mode 100644
index 000000000000..2edbc35aa899
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ois/default.nix
@@ -0,0 +1,24 @@
+{ stdenv, lib, fetchFromGitHub, cmake, libX11, Cocoa, IOKit, Kernel }:
+
+stdenv.mkDerivation rec {
+  pname = "ois";
+  version = "1.5";
+
+  src = fetchFromGitHub {
+    owner = "wgois";
+    repo = "OIS";
+    rev = "v${version}";
+    sha256 = "0g8krgq5bdx2rw7ig0xva4kqv4x815672i7z6lljp3n8847wmypa";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ libX11 ] ++ lib.optionals stdenv.isDarwin [ Cocoa IOKit Kernel ];
+
+  meta = with lib; {
+    description = "Object-oriented C++ input system";
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.unix;
+    license = licenses.zlib;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/olm/default.nix b/nixpkgs/pkgs/development/libraries/olm/default.nix
new file mode 100644
index 000000000000..e7642e16c955
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/olm/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitLab, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "olm";
+  version = "3.2.4";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.matrix.org";
+    owner = "matrix-org";
+    repo = pname;
+    rev = version;
+    sha256 = "1rl7j26li1irb1lqnnkzan7jrj38kvmdn69rlwbbp390v3z15lvh";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Implements double cryptographic ratchet and Megolm ratchet";
+    homepage = "https://gitlab.matrix.org/matrix-org/olm";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ tilpner oxzi ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/oneDNN/default.nix b/nixpkgs/pkgs/development/libraries/oneDNN/default.nix
new file mode 100644
index 000000000000..42f05a656163
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/oneDNN/default.nix
@@ -0,0 +1,44 @@
+{ stdenv, lib, fetchFromGitHub, cmake }:
+
+# This was originally called mkl-dnn, then it was renamed to dnnl, and it has
+# just recently been renamed again to oneDNN. See here for details:
+# https://github.com/oneapi-src/oneDNN#oneapi-deep-neural-network-library-onednn
+stdenv.mkDerivation rec {
+  pname = "oneDNN";
+  version = "2.3.2";
+
+  src = fetchFromGitHub {
+    owner = "oneapi-src";
+    repo = "oneDNN";
+    rev = "v${version}";
+    sha256 = "sha256-sfTcBthrnt7m9AnzdwWl9yLu1jRpwUp8i9s9DlA3IJo=";
+  };
+
+  outputs = [ "out" "dev" "doc" ];
+
+  nativeBuildInputs = [ cmake ];
+
+  # Tests fail on some Hydra builders, because they do not support SSE4.2.
+  doCheck = false;
+
+  # The test driver doesn't add an RPath to the build libdir
+  preCheck = ''
+    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/src
+    export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/src
+  '';
+
+  # The cmake install gets tripped up and installs a nix tree into $out, in
+  # addition to the correct install; clean it up.
+  postInstall = ''
+    rm -r $out/nix
+  '';
+
+  meta = with lib; {
+    description = "oneAPI Deep Neural Network Library (oneDNN)";
+    homepage = "https://01.org/oneDNN";
+    changelog = "https://github.com/oneapi-src/oneDNN/releases/tag/v${version}";
+    license = licenses.asl20;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ alexarice bhipple ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/oniguruma/default.nix b/nixpkgs/pkgs/development/libraries/oniguruma/default.nix
new file mode 100644
index 000000000000..016207c13060
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/oniguruma/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "onig";
+  version = "6.9.6";
+
+  src = fetchFromGitHub {
+    owner = "kkos";
+    repo = "oniguruma";
+    rev = "v${version}";
+    sha256 = "0y0dv6axvjjzi9367xc4q2nvvx58919iyzy25d5022lpz9z569kj";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = with lib; {
+    homepage = "https://github.com/kkos/oniguruma";
+    description = "Regular expressions library";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opae/default.nix b/nixpkgs/pkgs/development/libraries/opae/default.nix
new file mode 100644
index 000000000000..cba7e7b285d9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opae/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchFromGitHub, cmake
+, libuuid, json_c
+, doxygen, perl, python2, python2Packages
+}:
+
+stdenv.mkDerivation rec {
+  pname = "opae";
+  version = "1.0.0";
+
+  # the tag has a silly name for some reason. drop this in the future if
+  # possible
+  tver    = "${version}-5";
+
+  src = fetchFromGitHub {
+    owner  = "opae";
+    repo   = "opae-sdk";
+    rev    = "refs/tags/${tver}";
+    sha256 = "1dmkpnr9dqxwjhbdzx2r3fdfylvinda421yyg319am5gzlysxwi8";
+  };
+
+  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 ];
+
+  # Set the Epoch to 1980; otherwise the Python wheel/zip code
+  # gets very angry
+  preConfigure = ''
+    find . -type f | while read file; do
+      touch -d @315532800 $file;
+    done
+  '';
+
+  cmakeFlags = [ "-DBUILD_ASE=1" ];
+
+  meta = with lib; {
+    description = "Open Programmable Acceleration Engine SDK";
+    homepage    = "https://01.org/opae";
+    license     = licenses.bsd3;
+    platforms   = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openal-soft/default.nix b/nixpkgs/pkgs/development/libraries/openal-soft/default.nix
new file mode 100644
index 000000000000..2d469a406dec
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openal-soft/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchFromGitHub, cmake
+, alsaSupport ? !stdenv.isDarwin, alsa-lib ? null
+, pulseSupport ? !stdenv.isDarwin, libpulseaudio ? null
+, CoreServices, AudioUnit, AudioToolbox
+}:
+
+with lib;
+
+assert alsaSupport -> alsa-lib != null;
+assert pulseSupport -> libpulseaudio != null;
+
+stdenv.mkDerivation rec {
+  version = "1.19.1";
+  pname = "openal-soft";
+
+  src = fetchFromGitHub {
+    owner = "kcat";
+    repo = "openal-soft";
+    rev = "${pname}-${version}";
+    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 = []
+    ++ optional alsaSupport alsa-lib
+    ++ optional pulseSupport libpulseaudio
+    ++ optionals stdenv.isDarwin [ CoreServices AudioUnit AudioToolbox ];
+
+  NIX_LDFLAGS = toString ([]
+    ++ optional alsaSupport "-lasound"
+    ++ optional pulseSupport "-lpulse");
+
+  meta = {
+    description = "OpenAL alternative";
+    homepage = "https://kcat.strangesoft.net/openal.html";
+    license = licenses.lgpl2;
+    maintainers = with maintainers; [ftrvxmtrx];
+    platforms = platforms.unix;
+  };
+}
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/2.nix b/nixpkgs/pkgs/development/libraries/openbabel/2.nix
new file mode 100644
index 000000000000..11265c643f94
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openbabel/2.nix
@@ -0,0 +1,31 @@
+{stdenv, lib, fetchurl, fetchpatch, cmake, zlib, libxml2, eigen, python, cairo, pcre, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "openbabel";
+  version = "2.4.1";
+
+  src = fetchurl {
+    url = "https://github.com/openbabel/openbabel/archive/openbabel-${lib.replaceStrings ["."] ["-"] version}.tar.gz";
+    sha256 = "0xm7y859ivq2cp0q08mwshfxm0jq31xkyr4x8s0j6l7khf57yk2r";
+  };
+
+  patches = [
+    # ARM / AArch64 fixes.
+    (fetchpatch {
+      url = "https://github.com/openbabel/openbabel/commit/ee11c98a655296550710db1207b294f00e168216.patch";
+      sha256 = "0wjqjrkr4pfirzzicdvlyr591vppydk572ix28jd2sagnfnf566g";
+    })
+  ];
+
+  buildInputs = [ zlib libxml2 eigen python cairo pcre ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  meta = with lib; {
+    description = "A toolbox designed to speak the many languages of chemical data";
+    homepage = "http://openbabel.org";
+    platforms = platforms.all;
+    maintainers = with maintainers; [ danielbarter ];
+    license = licenses.gpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openbabel/default.nix b/nixpkgs/pkgs/development/libraries/openbabel/default.nix
new file mode 100644
index 000000000000..63784d94d8f0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openbabel/default.nix
@@ -0,0 +1,45 @@
+{stdenv, lib, fetchurl, cmake, zlib, libxml2, eigen, python, cairo, pcre, pkg-config, swig, rapidjson }:
+
+stdenv.mkDerivation rec {
+  pname = "openbabel";
+  version = "3.1.1";
+
+  src = fetchurl {
+    url = "https://github.com/openbabel/openbabel/archive/openbabel-${lib.replaceStrings ["."] ["-"] version}.tar.gz";
+    sha256 = "c97023ac6300d26176c97d4ef39957f06e68848d64f1a04b0b284ccff2744f02";
+  };
+
+
+  buildInputs = [ zlib libxml2 eigen python cairo pcre swig rapidjson ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  pythonMajorMinor = "${python.sourceVersion.major}.${python.sourceVersion.minor}";
+
+  cmakeFlags = [
+    "-DRUN_SWIG=ON"
+    "-DPYTHON_BINDINGS=ON"
+  ];
+
+
+  postFixup = ''
+    cat <<EOF > $out/lib/python$pythonMajorMinor/site-packages/setup.py
+    from distutils.core import setup
+
+    setup(
+        name = 'pyopenbabel',
+        version = '${version}',
+        packages = ['openbabel'],
+        package_data = {'openbabel' : ['_openbabel.so']}
+    )
+    EOF
+    '';
+
+  meta = with lib; {
+    description = "A toolbox designed to speak the many languages of chemical data";
+    homepage = "http://openbabel.org";
+    platforms = platforms.all;
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ danielbarter ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openbr/default.nix b/nixpkgs/pkgs/development/libraries/openbr/default.nix
new file mode 100644
index 000000000000..8e56e250ac40
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openbr/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, cmake, opencv, qtbase, qtsvg }:
+
+stdenv.mkDerivation {
+
+  version = "0.5";
+  pname = "openbr";
+
+  src = fetchFromGitHub {
+    owner = "biometrics";
+    repo = "openbr";
+    rev = "cc364a89a86698cd8d3052f42a3cb520c929b325";
+    sha256 = "12y00cf5dlzp9ciiwbihf6xhlkdxpydhscv5hwp83qjdllid9rrz";
+  };
+
+  buildInputs = [ opencv qtbase qtsvg ];
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = {
+    description = "Open Source Biometric Recognition";
+    homepage = "http://openbiometrics.org/";
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [flosse];
+    platforms = with lib.platforms; linux;
+    broken = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openbsm/bsm-add-audit_token_to_pid.patch b/nixpkgs/pkgs/development/libraries/openbsm/bsm-add-audit_token_to_pid.patch
new file mode 100644
index 000000000000..77b9e1febddc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openbsm/bsm-add-audit_token_to_pid.patch
@@ -0,0 +1,24 @@
+Subject: Add audit_token_to_pid()
+
+Description: Apple provides audit_token_to_pid to get the pid of an
+audit token. Unfortunately, they have never released this to the
+OpenBSM project.
+
+diff -r -u -p1 a/bsm/libbsm.h b/bsm/libbsm.h
+--- a/bsm/libbsm.h	      2009-04-15 16:45:54.000000000 -0500
++++ b/bsm/libbsm.h	      2018-05-11 04:11:14.063083147 -0500
+@@ -1298,1 +1298,2 @@ int audit_set_stat(au_stat_t *stats, siz
+ int audit_send_trigger(int *trigger);
++pid_t audit_token_to_pid(audit_token_t atoken);
+
+diff -r -u -p1 a/libbsm/bsm_wrappers.c b/libbsm/bsm_wrappers.c
+--- a/libbsm/bsm_wrappers.c	       2009-04-15 16:46:06.000000000 -0500
++++ b/libbsm/bsm_wrappers.c	       2018-05-11 04:10:15.710820393 -0500
+@@ -823,1 +823,6 @@ audit_get_car(char *path, size_t sz)
+ }
++
++pid_t audit_token_to_pid(audit_token_t atoken)
++{
++	return atoken.val[5];
++}
+ 
\ No newline at end of file
diff --git a/nixpkgs/pkgs/development/libraries/openbsm/default.nix b/nixpkgs/pkgs/development/libraries/openbsm/default.nix
new file mode 100644
index 000000000000..4719b7fb7470
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openbsm/default.nix
@@ -0,0 +1,29 @@
+{ stdenv, fetchFromGitHub, lib }:
+
+stdenv.mkDerivation rec {
+  pname = "openbsm";
+  version = "1.1";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = lib.toUpper (builtins.replaceStrings ["." "-"] ["_" "_"] "${pname}-${version}");
+    sha256 = "0b98359hd8mm585sh145ss828pg2y8vgz38lqrb7nypapiyqdnd1";
+  };
+
+  patches = lib.optional stdenv.isDarwin [ ./bsm-add-audit_token_to_pid.patch ];
+
+  preConfigure = lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") ''
+    MACOSX_DEPLOYMENT_TARGET=10.16
+  '';
+
+  configureFlags = [ "ac_cv_file__usr_include_mach_audit_triggers_defs=no" ];
+
+  meta = {
+    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/opencascade-occt/default.nix b/nixpkgs/pkgs/development/libraries/opencascade-occt/default.nix
new file mode 100644
index 000000000000..f2a9833d77d0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencascade-occt/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, fetchpatch, cmake, ninja, tcl, tk,
+  libGL, libGLU, libXext, libXmu, libXi, darwin }:
+
+stdenv.mkDerivation rec {
+  pname = "opencascade-occt";
+  version = "7.5.1";
+  commit = "V${builtins.replaceStrings ["."] ["_"] version}";
+
+  src = fetchurl {
+    name = "occt-${commit}.tar.gz";
+    url = "https://git.dev.opencascade.org/gitweb/?p=occt.git;a=snapshot;h=${commit};sf=tgz";
+    sha256 = "sha256-1whKU+7AMVYabfs15x8MabohKonn5oM54ZEtxF93wAo=";
+  };
+
+  nativeBuildInputs = [ cmake ninja ];
+  buildInputs = [ tcl tk libGL libGLU libXext libXmu libXi ]
+    ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Cocoa;
+
+  meta = with lib; {
+    description = "Open CASCADE Technology, libraries for 3D modeling and numerical simulation";
+    homepage = "https://www.opencascade.org/";
+    license = licenses.lgpl21;  # essentially...
+    # The special exception defined in the file OCCT_LGPL_EXCEPTION.txt
+    # are basically about making the license a little less share-alike.
+    maintainers = with maintainers; [ amiloradovsky gebner ];
+    platforms = platforms.all;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/opencascade/default.nix b/nixpkgs/pkgs/development/libraries/opencascade/default.nix
new file mode 100644
index 000000000000..5c262a3680c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencascade/default.nix
@@ -0,0 +1,66 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, libGL, libGLU, libXmu, cmake, ninja,
+  pkg-config, fontconfig, freetype, expat, freeimage, vtk, gl2ps, tbb,
+  OpenCL, Cocoa
+}:
+
+with lib;
+stdenv.mkDerivation rec {
+  pname = "opencascade-oce";
+  version = "0.18.3";
+
+  src = fetchFromGitHub {
+    owner = "tpaviot";
+    repo = "oce";
+    rev = "OCE-${version}";
+    sha256 = "17wy8dcf44vqisishv1jjf3cmcxyygqq29y9c3wjdj983qi2hsig";
+  };
+
+  nativeBuildInputs = [ cmake ninja pkg-config ];
+  buildInputs = [
+    libGL libGLU libXmu freetype fontconfig expat freeimage vtk
+    gl2ps tbb
+  ]
+    ++ optionals stdenv.isDarwin [OpenCL Cocoa]
+  ;
+
+  cmakeFlags = [
+    "-DOCE_INSTALL_PREFIX=${placeholder "out"}"
+    "-DOCE_WITH_FREEIMAGE=ON"
+    "-DOCE_WITH_VTK=ON"
+    "-DOCE_WITH_GL2PS=ON"
+    "-DOCE_MULTITHREAD_LIBRARY=TBB"
+  ]
+  ++ optionals stdenv.isDarwin ["-DOCE_OSX_USE_COCOA=ON" "-DOCE_WITH_OPENCL=ON"];
+
+  patches = [
+    # Use fontconfig instead of hardcoded directory list
+    # https://github.com/tpaviot/oce/pull/714
+    (fetchpatch {
+      url = "https://github.com/tpaviot/oce/commit/9643432b27fec8974ca0ee15c3c372f5fe8fc069.patch";
+      sha256 = "1wd940rszmh5apcpk5fv6126h8mcjcy4rjifrql5d4ac90v06v4c";
+    })
+    # Fix for glibc 2.26
+    (fetchpatch {
+      url = "https://github.com/tpaviot/oce/commit/3b44656e93270d782009b06ec4be84d2a13f8126.patch";
+      sha256 = "1ccakkcwy5g0184m23x0mnh22i0lk45xm8kgiv5z3pl7nh35dh8k";
+    })
+    (fetchpatch {
+      url = "https://github.com/tpaviot/oce/commit/cf50d078cd5fac03a48fd204938bd240930a08dc.patch";
+      sha256 = "1xv94hcvggmb1c8vqwic1aiw9jw1sxk8mqbaak9xs9ycfqdvgdyc";
+    })
+  ];
+
+  postPatch = ''
+    # make sure the installed cmake file uses absolute paths for fontconfig
+    substituteInPlace adm/cmake/TKService/CMakeLists.txt \
+      --replace FONTCONFIG_LIBRARIES FONTCONFIG_LINK_LIBRARIES
+  '';
+
+  meta = {
+    description = "Open CASCADE Technology, libraries for 3D modeling and numerical simulation";
+    homepage = "https://github.com/tpaviot/oce";
+    maintainers = [ maintainers.viric ];
+    platforms = platforms.unix;
+    license = licenses.lgpl21;
+  };
+}
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..48c681973d16
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencl-clang/default.nix
@@ -0,0 +1,107 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, git
+
+, llvmPackages_8
+, spirv-llvm-translator
+
+, buildWithPatches ? true
+}:
+
+let
+  llvmPkgs = llvmPackages_8 // {
+    inherit spirv-llvm-translator;
+  };
+
+  inherit (lib) getVersion;
+
+  addPatches = component: pkg:
+    with builtins; with 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 {
+
+    libclang = addPatches "clang" llvmPkgs.libclang;
+
+    clang-unwrapped = libclang.out;
+
+    clang = llvmPkgs.clang.override {
+      cc = clang-unwrapped;
+    };
+
+    patchesOut = stdenv.mkDerivation rec {
+      pname = "opencl-clang-patches";
+      inherit (library) 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;
+
+  };
+
+  library = let
+    inherit (llvmPkgs) llvm;
+    inherit (if buildWithPatches then passthru else llvmPkgs) libclang 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
+      ];
+
+      # Uses linker flags that are not supported on Darwin.
+      postPatch = lib.optionalString stdenv.isDarwin ''
+        sed -i -e '/SET_LINUX_EXPORTS_FILE/d' CMakeLists.txt
+        substituteInPlace CMakeLists.txt \
+          --replace '-Wl,--no-undefined' ""
+      '';
+
+      nativeBuildInputs = [ cmake git llvm.dev ];
+
+      buildInputs = [ libclang llvm spirv-llvm-translator ];
+
+      cmakeFlags = [
+        "-DPREFERRED_LLVM_VERSION=${getVersion llvm}"
+        "-DOPENCL_HEADERS_DIR=${libclang.lib}/lib/clang/${getVersion libclang}/include/"
+
+        "-DLLVMSPIRV_INCLUDED_IN_LLVM=OFF"
+        "-DSPIRV_TRANSLATOR_DIR=${spirv-llvm-translator}"
+      ];
+
+      meta = with 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
+  library
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/opencl-clhpp/default.nix b/nixpkgs/pkgs/development/libraries/opencl-clhpp/default.nix
new file mode 100644
index 000000000000..b6aa71491680
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencl-clhpp/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, cmake, python3, opencl-headers }:
+
+stdenv.mkDerivation rec {
+  pname = "opencl-clhpp";
+  version = "2.0.12";
+
+  src = fetchFromGitHub {
+    owner = "KhronosGroup";
+    repo = "OpenCL-CLHPP";
+    rev = "v${version}";
+    sha256 = "04g3mg2cpbi048fxxkghra81bpxzqr4r3gspx5mvqipx1lzypsci";
+  };
+
+  nativeBuildInputs = [ cmake python3 ];
+
+  propagatedBuildInputs = [ opencl-headers ];
+
+  strictDeps = true;
+
+  cmakeFlags = [
+    "-DBUILD_EXAMPLES=OFF"
+    "-DBUILD_TESTS=OFF"
+  ];
+
+  meta = with lib; {
+    description = "OpenCL Host API C++ bindings";
+    homepage = "http://github.khronos.org/OpenCL-CLHPP/";
+    license = licenses.mit;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opencl-headers/default.nix b/nixpkgs/pkgs/development/libraries/opencl-headers/default.nix
new file mode 100644
index 000000000000..d7a8b4497f7f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencl-headers/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub
+}:
+
+stdenv.mkDerivation rec {
+  name = "opencl-headers-${version}";
+  version = "2020.06.16";
+
+  src = fetchFromGitHub {
+    owner = "KhronosGroup";
+    repo = "OpenCL-Headers";
+    rev = "v${version}";
+    sha256 = "0viiwhfqccw90r3mr45ab3wyhabpdrihplj5842brn5ny0ayh73z";
+  };
+
+  installPhase = ''
+    mkdir -p $out/include/CL
+    cp CL/* $out/include/CL
+  '';
+
+  meta = with lib; {
+    description = "Khronos OpenCL headers version ${version}";
+    homepage = "https://www.khronos.org/registry/cl/";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opencollada/default.nix b/nixpkgs/pkgs/development/libraries/opencollada/default.nix
new file mode 100644
index 000000000000..d05822174339
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencollada/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libxml2, pcre
+, darwin}:
+
+stdenv.mkDerivation rec {
+  pname = "opencollada";
+
+  version = "1.6.68";
+
+  src = fetchFromGitHub {
+    owner = "KhronosGroup";
+    repo = "OpenCOLLADA";
+    rev = "v${version}";
+    sha256 = "1ym16fxx9qhf952vva71sdzgbm7ifis0h1n5fj1bfdj8zvvkbw5w";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ AGL ]);
+
+  propagatedBuildInputs = [ libxml2 pcre ];
+
+  patchPhase = ''
+    patch -p1 < ${./pcre.patch}
+  '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace GeneratedSaxParser/src/GeneratedSaxParserUtils.cpp \
+      --replace math.h cmath
+  '';
+
+  meta = {
+    description = "A library for handling the COLLADA file format";
+    homepage = "https://github.com/KhronosGroup/OpenCOLLADA/";
+    maintainers = [ lib.maintainers.eelco ];
+    platforms = lib.platforms.unix;
+    license = lib.licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opencollada/pcre.patch b/nixpkgs/pkgs/development/libraries/opencollada/pcre.patch
new file mode 100644
index 000000000000..39408f5a61e3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencollada/pcre.patch
@@ -0,0 +1,14 @@
+diff --git a/COLLADABaseUtils/include/COLLADABUPcreCompiledPattern.h b/COLLADABaseUtils/include/COLLADABUPcreCompiledPattern.h
+index 22f2598b..269c50ca 100644
+--- a/COLLADABaseUtils/include/COLLADABUPcreCompiledPattern.h
++++ b/COLLADABaseUtils/include/COLLADABUPcreCompiledPattern.h
+@@ -13,8 +13,7 @@
+ 

+ #include "COLLADABUPrerequisites.h"

+ 

+-struct real_pcre;
+-typedef struct real_pcre pcre;
++#include "pcre.h"
+ 

+ 

+ namespace COLLADABU

diff --git a/nixpkgs/pkgs/development/libraries/opencolorio/1.x.nix b/nixpkgs/pkgs/development/libraries/opencolorio/1.x.nix
new file mode 100644
index 000000000000..041ddf8e8371
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencolorio/1.x.nix
@@ -0,0 +1,45 @@
+{ stdenv, lib, fetchFromGitHub, cmake, boost, pkg-config, lcms2, tinyxml, git }:
+
+stdenv.mkDerivation rec {
+  pname = "opencolorio";
+  version = "1.1.1";
+
+  src = fetchFromGitHub {
+    owner = "imageworks";
+    repo = "OpenColorIO";
+    rev = "v${version}";
+    sha256 = "12srvxca51czpfjl0gabpidj9n84mw78ivxy5w75qhq2mmc798sb";
+  };
+
+  outputs = [ "bin" "out" "dev" ];
+
+  # TODO: Investigate whether git can be dropped: It's only used to apply patches
+  nativeBuildInputs = [ cmake pkg-config git ];
+
+  buildInputs = [ lcms2 tinyxml ] ++ lib.optional stdenv.isDarwin boost;
+
+  postPatch = ''
+    substituteInPlace src/core/CMakeLists.txt --replace "-Werror" ""
+    substituteInPlace src/pyglue/CMakeLists.txt --replace "-Werror" ""
+  '';
+
+  cmakeFlags = [
+    "-DUSE_EXTERNAL_LCMS=ON"
+    "-DUSE_EXTERNAL_TINYXML=ON"
+    # External libyamlcpp 0.6.* not compatible: https://github.com/imageworks/OpenColorIO/issues/517
+    "-DUSE_EXTERNAL_YAML=OFF"
+  ] ++ lib.optional stdenv.isDarwin "-DOCIO_USE_BOOST_PTR=ON"
+    ++ lib.optional (!stdenv.hostPlatform.isi686 && !stdenv.hostPlatform.isx86_64) "-DOCIO_USE_SSE=OFF";
+
+  postInstall = ''
+    mkdir -p $bin/bin; mv $out/bin $bin/
+  '';
+
+  meta = with lib; {
+    homepage = "https://opencolorio.org";
+    description = "A color management framework for visual effects and animation";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opencolorio/default.nix b/nixpkgs/pkgs/development/libraries/opencolorio/default.nix
new file mode 100644
index 000000000000..522c8cfa4a13
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencolorio/default.nix
@@ -0,0 +1,49 @@
+{
+  stdenv, lib, fetchFromGitHub,
+  cmake, expat, libyamlcpp, ilmbase, pystring, # Base dependencies
+
+  glew, freeglut, # Only required on Linux
+  Carbon, GLUT, Cocoa, # Only required on Darwin
+
+  pythonBindings ? true, # Python bindings
+  python3Packages,
+
+  buildApps ? true, # Utility applications
+  lcms2, openimageio2, openexr,
+}:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "opencolorio";
+  version = "2.0.1";
+
+  src = fetchFromGitHub {
+    owner = "AcademySoftwareFoundation";
+    repo = "OpenColorIO";
+    rev = "v${version}";
+    sha256 = "194j9jp5c8ws0fryiz936wyinphnpzwpqnzvw9ryx6rbiwrba487";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ expat libyamlcpp ilmbase pystring ]
+    ++ lib.optionals stdenv.hostPlatform.isLinux [ glew freeglut ]
+    ++ lib.optionals stdenv.hostPlatform.isDarwin [ Carbon GLUT Cocoa ]
+    ++ lib.optionals pythonBindings [ python3Packages.python python3Packages.pybind11 ]
+    ++ lib.optionals buildApps [ lcms2 openimageio2 openexr ];
+
+    cmakeFlags = [ "-DOCIO_INSTALL_EXT_PACKAGES=NONE" ]
+    ++ lib.optional (!pythonBindings) "-DOCIO_BUILD_PYTHON=OFF"
+    ++ lib.optional (!buildApps) "-DOCIO_BUILD_APPS=OFF";
+
+  # TODO Investigate this: Python and GPU tests fail to load libOpenColorIO.so.2.0
+  # doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://opencolorio.org";
+    description = "A color management framework for visual effects and animation";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.rytone ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opencore-amr/default.nix b/nixpkgs/pkgs/development/libraries/opencore-amr/default.nix
new file mode 100644
index 000000000000..26b2715658bb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencore-amr/default.nix
@@ -0,0 +1,18 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "opencore-amr";
+  version = "0.1.5";
+  src = fetchurl {
+    url = "https://vorboss.dl.sourceforge.net/project/opencore-amr/opencore-amr/opencore-amr-${version}.tar.gz";
+    sha256 = "0hfk9khz3by0119h3jdwgdfd7jgkdbzxnmh1wssvylgnsnwnq01c";
+  };
+
+  meta = {
+    homepage = "https://opencore-amr.sourceforge.io/";
+    description = "Library of OpenCORE Framework implementation of Adaptive Multi Rate Narrowband and Wideband (AMR-NB and AMR-WB) speech codec.
+    Library of VisualOn implementation of Adaptive Multi Rate Wideband (AMR-WB)";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.kiloreux ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opencsg/default.nix b/nixpkgs/pkgs/development/libraries/opencsg/default.nix
new file mode 100644
index 000000000000..7625db9a5953
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencsg/default.nix
@@ -0,0 +1,54 @@
+{lib, stdenv, fetchurl, libGLU, libGL, freeglut, glew, libXmu, libXext, libX11
+, qmake, GLUT, fixDarwinDylibNames }:
+
+stdenv.mkDerivation rec {
+  version = "1.4.2";
+  pname = "opencsg";
+  src = fetchurl {
+    url = "http://www.opencsg.org/OpenCSG-${version}.tar.gz";
+    sha256 = "1ysazynm759gnw1rdhn9xw9nixnzrlzrc462340a6iif79fyqlnr";
+  };
+
+  nativeBuildInputs = [ qmake ]
+    ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
+
+  buildInputs = [ glew ]
+    ++ lib.optionals stdenv.isLinux [ libGLU libGL freeglut libXmu libXext libX11 ]
+    ++ lib.optional stdenv.isDarwin GLUT;
+
+  doCheck = false;
+
+  patches = [ ./fix-pro-files.patch ];
+
+  preConfigure = ''
+    rm example/Makefile src/Makefile
+    qmakeFlags=("''${qmakeFlags[@]}" "INSTALLDIR=$out")
+  '';
+
+  postInstall = ''
+    install -D license.txt "$out/share/doc/opencsg/license.txt"
+  '' + lib.optionalString stdenv.isDarwin ''
+    mkdir -p $out/Applications
+    mv $out/bin/*.app $out/Applications
+    rmdir $out/bin || true
+  '';
+
+  dontWrapQtApps = true;
+
+  postFixup = lib.optionalString stdenv.isDarwin ''
+    app=$out/Applications/opencsgexample.app/Contents/MacOS/opencsgexample
+    install_name_tool -change \
+      $(otool -L $app | awk '/opencsg.+dylib/ { print $1 }') \
+      $(otool -D $out/lib/libopencsg.dylib | tail -n 1) \
+      $app
+  '';
+
+  meta = with lib; {
+    description = "Constructive Solid Geometry library";
+    homepage = "http://www.opencsg.org/";
+    platforms = platforms.unix;
+    maintainers = [ maintainers.raskin ];
+    license = licenses.gpl2;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/opencsg/fix-pro-files.patch b/nixpkgs/pkgs/development/libraries/opencsg/fix-pro-files.patch
new file mode 100644
index 000000000000..462b44c8f40c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencsg/fix-pro-files.patch
@@ -0,0 +1,21 @@
+diff -ur OpenCSG-1.4.2-pristine/example/example.pro OpenCSG-1.4.2/example/example.pro
+--- OpenCSG-1.4.2-pristine/example/example.pro	2016-09-27 06:11:16.000000000 +0900
++++ OpenCSG-1.4.2/example/example.pro	2019-05-07 10:45:18.785251737 +0900
+@@ -6,7 +6,9 @@
+ INCLUDEPATH += ../include
+ LIBS += -L../lib -lopencsg -lGLEW
+ 
+-INSTALLDIR = /usr/local
++isEmpty(INSTALLDIR) {
++  INSTALLDIR = /usr/local
++}
+ INSTALLS += target
+ target.path = $$INSTALLDIR/bin
+ 
+diff -ur OpenCSG-1.4.2-pristine/opencsg.pro OpenCSG-1.4.2/opencsg.pro
+--- OpenCSG-1.4.2-pristine/opencsg.pro	2016-09-27 06:11:16.000000000 +0900
++++ OpenCSG-1.4.2/opencsg.pro	2019-05-07 10:44:50.578698165 +0900
+@@ -1,2 +1,3 @@
+ TEMPLATE = subdirs
+ SUBDIRS  = src example
++CONFIG   += ordered
diff --git a/nixpkgs/pkgs/development/libraries/openct/default.nix b/nixpkgs/pkgs/development/libraries/openct/default.nix
new file mode 100644
index 000000000000..92dec5ee2334
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openct/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, pcsclite, libusb-compat-0_1
+, doxygen, libxslt
+}:
+
+stdenv.mkDerivation rec {
+  pname = "openct";
+  version = "0.6.20";
+
+  src = fetchFromGitHub {
+    owner = "OpenSC";
+    repo = "openct";
+    rev = "${pname}-${version}";
+    sha256 = "09wxq0jxdxhci3zr7jd3zcxjkl3j0r1v00k3q8gqrg9gighh8nk2";
+  };
+
+  postPatch = ''
+    sed -i 's,$(DESTDIR),$(out),g' etc/Makefile.am
+  '';
+
+  configureFlags = [
+    "--enable-api-doc"
+    "--enable-usb"
+    "--enable-pcsc"
+    "--localstatedir=/var"
+    "--sysconfdir=/etc"
+  ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ pcsclite libusb-compat-0_1 doxygen libxslt ];
+
+  preInstall = ''
+    mkdir -p $out/etc
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/OpenSC/openct/";
+    license = licenses.lgpl21;
+    description = "Drivers for several smart card readers";
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opencv/3.x.nix b/nixpkgs/pkgs/development/libraries/opencv/3.x.nix
new file mode 100644
index 000000000000..33b1cd187571
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencv/3.x.nix
@@ -0,0 +1,281 @@
+{ lib, stdenv
+, fetchFromGitHub, fetchpatch
+, cmake, pkg-config, unzip, zlib, pcre, hdf5
+, glog, boost, gflags, protobuf
+, config
+
+, enableJPEG      ? true, libjpeg
+, enablePNG       ? true, libpng
+, enableTIFF      ? true, libtiff
+, enableWebP      ? true, libwebp
+, enableEXR ?     !stdenv.isDarwin, openexr, ilmbase
+, enableEigen     ? true, eigen
+, enableOpenblas  ? true, openblas, blas, lapack
+, enableContrib   ? true
+
+, enableCuda      ? (config.cudaSupport or false) &&
+                    stdenv.hostPlatform.isx86_64, cudatoolkit
+
+, enableUnfree    ? false
+, enableIpp       ? false
+, enablePython    ? false, pythonPackages ? null
+, enableGtk2      ? false, gtk2
+, enableGtk3      ? false, gtk3
+, enableVtk       ? false, vtk
+, enableFfmpeg    ? false, ffmpeg
+, enableGStreamer ? false, gst_all_1
+, enableTesseract ? false, tesseract, leptonica
+, enableTbb       ? false, tbb
+, enableOvis      ? false, ogre
+, enableGPhoto2   ? false, libgphoto2
+, enableDC1394    ? false, libdc1394
+, enableDocs      ? false, doxygen, graphviz-nox
+
+, AVFoundation, Cocoa, VideoDecodeAcceleration, bzip2
+}:
+
+assert blas.implementation == "openblas" && lapack.implementation == "openblas";
+
+assert enablePython -> pythonPackages != null;
+
+let
+  version = "3.4.8";
+
+  src = fetchFromGitHub {
+    owner  = "opencv";
+    repo   = "opencv";
+    rev    = version;
+    sha256 = "1dnz3gfj70lm1gbrk8pz28apinlqi2x6nvd6xcy5hs08505nqnjp";
+  };
+
+  contribSrc = fetchFromGitHub {
+    owner  = "opencv";
+    repo   = "opencv_contrib";
+    rev    = version;
+    sha256 = "0psaa1yx36n34l09zd1y8jxgf8q4jzxd3vn06fqmzwzy85hcqn8i";
+  };
+
+  # Contrib must be built in order to enable Tesseract support:
+  buildContrib = enableContrib || enableTesseract;
+
+  useSystemProtobuf = ! stdenv.isDarwin;
+
+  # See opencv/3rdparty/ippicv/ippicv.cmake
+  ippicv = {
+    src = fetchFromGitHub {
+      owner  = "opencv";
+      repo   = "opencv_3rdparty";
+      rev    = "32e315a5b106a7b89dbed51c28f8120a48b368b4";
+      sha256 = "19w9f0r16072s59diqxsr5q6nmwyz9gnxjs49nglzhd66p3ddbkp";
+    } + "/ippicv";
+    files = let name = platform : "ippicv_2019_${platform}_general_20180723.tgz"; in
+      if stdenv.hostPlatform.system == "x86_64-linux" then
+      { ${name "lnx_intel64"} = "c0bd78adb4156bbf552c1dfe90599607"; }
+      else if stdenv.hostPlatform.system == "i686-linux" then
+      { ${name "lnx_ia32"}    = "4f38432c30bfd6423164b7a24bbc98a0"; }
+      else if stdenv.hostPlatform.system == "x86_64-darwin" then
+      { ${name "mac_intel64"} = "fe6b2bb75ae0e3f19ad3ae1a31dfa4a2"; }
+      else
+      throw "ICV is not available for this platform (or not yet supported by this package)";
+    dst = ".cache/ippicv";
+  };
+
+  # See opencv_contrib/modules/xfeatures2d/cmake/download_vgg.cmake
+  vgg = {
+    src = fetchFromGitHub {
+      owner  = "opencv";
+      repo   = "opencv_3rdparty";
+      rev    = "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d";
+      sha256 = "0r9fam8dplyqqsd3qgpnnfgf9l7lj44di19rxwbm8mxiw0rlcdvy";
+    };
+    files = {
+      "vgg_generated_48.i"  = "e8d0dcd54d1bcfdc29203d011a797179";
+      "vgg_generated_64.i"  = "7126a5d9a8884ebca5aea5d63d677225";
+      "vgg_generated_80.i"  = "7cd47228edec52b6d82f46511af325c5";
+      "vgg_generated_120.i" = "151805e03568c9f490a5e3a872777b75";
+    };
+    dst = ".cache/xfeatures2d/vgg";
+  };
+
+  # See opencv_contrib/modules/xfeatures2d/cmake/download_boostdesc.cmake
+  boostdesc = {
+    src = fetchFromGitHub {
+      owner  = "opencv";
+      repo   = "opencv_3rdparty";
+      rev    = "34e4206aef44d50e6bbcd0ab06354b52e7466d26";
+      sha256 = "13yig1xhvgghvxspxmdidss5lqiikpjr0ddm83jsi0k85j92sn62";
+    };
+    files = {
+      "boostdesc_bgm.i"          = "0ea90e7a8f3f7876d450e4149c97c74f";
+      "boostdesc_bgm_bi.i"       = "232c966b13651bd0e46a1497b0852191";
+      "boostdesc_bgm_hd.i"       = "324426a24fa56ad9c5b8e3e0b3e5303e";
+      "boostdesc_binboost_064.i" = "202e1b3e9fec871b04da31f7f016679f";
+      "boostdesc_binboost_128.i" = "98ea99d399965c03d555cef3ea502a0b";
+      "boostdesc_binboost_256.i" = "e6dcfa9f647779eb1ce446a8d759b6ea";
+      "boostdesc_lbgm.i"         = "0ae0675534aa318d9668f2a179c2a052";
+    };
+    dst = ".cache/xfeatures2d/boostdesc";
+  };
+
+  # See opencv_contrib/modules/face/CMakeLists.txt
+  face = {
+    src = fetchFromGitHub {
+      owner  = "opencv";
+      repo   = "opencv_3rdparty";
+      rev    = "8afa57abc8229d611c4937165d20e2a2d9fc5a12";
+      sha256 = "061lsvqdidq9xa2hwrcvwi9ixflr2c2lfpc8drr159g68zi8bp4v";
+    };
+    files = {
+      "face_landmark_model.dat" = "7505c44ca4eb54b4ab1e4777cb96ac05";
+    };
+    dst = ".cache/data";
+  };
+
+  # See opencv/cmake/OpenCVDownload.cmake
+  installExtraFiles = extra : with lib; ''
+    mkdir -p "${extra.dst}"
+  '' + concatStrings (mapAttrsToList (name : md5 : ''
+    ln -s "${extra.src}/${name}" "${extra.dst}/${md5}-${name}"
+  '') extra.files);
+
+  opencvFlag = name: enabled: "-DWITH_${name}=${printEnabled enabled}";
+
+  printEnabled = enabled : if enabled then "ON" else "OFF";
+in
+
+stdenv.mkDerivation {
+  pname = "opencv";
+  inherit version src;
+
+  postUnpack = lib.optionalString buildContrib ''
+    cp --no-preserve=mode -r "${contribSrc}/modules" "$NIX_BUILD_TOP/opencv_contrib"
+  '';
+
+  # 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
+  # what appears to be some stray headers in dnn/misc/tensorflow
+  # in contrib when generating the Python bindings:
+  postPatch = ''
+    sed -i '/Add these standard paths to the search paths for FIND_LIBRARY/,/^\s*$/{d}' CMakeLists.txt
+    sed -i -e 's|if len(decls) == 0:|if len(decls) == 0 or "opencv2/" not in hdr:|' ./modules/python/src2/gen2.py
+  '';
+
+  preConfigure =
+    lib.optionalString enableIpp (installExtraFiles ippicv) + (
+    lib.optionalString buildContrib ''
+      cmakeFlagsArray+=("-DOPENCV_EXTRA_MODULES_PATH=$NIX_BUILD_TOP/opencv_contrib")
+
+      ${installExtraFiles vgg}
+      ${installExtraFiles boostdesc}
+      ${installExtraFiles face}
+    '');
+
+  postConfigure = ''
+    [ -e modules/core/version_string.inc ]
+    echo '"(build info elided)"' > modules/core/version_string.inc
+  '';
+
+  buildInputs =
+       [ zlib pcre hdf5 glog boost gflags ]
+    ++ lib.optional useSystemProtobuf protobuf
+    ++ lib.optional enablePython pythonPackages.python
+    ++ lib.optional enableGtk2 gtk2
+    ++ lib.optional enableGtk3 gtk3
+    ++ lib.optional enableVtk vtk
+    ++ lib.optional enableJPEG libjpeg
+    ++ lib.optional enablePNG libpng
+    ++ lib.optional enableTIFF libtiff
+    ++ lib.optional enableWebP libwebp
+    ++ lib.optionals enableEXR [ openexr ilmbase ]
+    ++ lib.optional enableFfmpeg ffmpeg
+    ++ lib.optionals (enableFfmpeg && stdenv.isDarwin)
+                     [ VideoDecodeAcceleration bzip2 ]
+    ++ lib.optionals enableGStreamer (with gst_all_1; [ gstreamer gst-plugins-base ])
+    ++ lib.optional enableOvis ogre
+    ++ lib.optional enableGPhoto2 libgphoto2
+    ++ lib.optional enableDC1394 libdc1394
+    ++ lib.optional enableEigen eigen
+    ++ lib.optional enableOpenblas openblas
+    # There is seemingly no compile-time flag for Tesseract.  It's
+    # simply enabled automatically if contrib is built, and it detects
+    # tesseract & leptonica.
+    ++ lib.optionals enableTesseract [ tesseract leptonica ]
+    ++ lib.optional enableTbb tbb
+    ++ lib.optional enableCuda cudatoolkit
+    ++ lib.optionals stdenv.isDarwin [ bzip2 AVFoundation Cocoa VideoDecodeAcceleration ]
+    ++ lib.optionals enableDocs [ doxygen graphviz-nox ];
+
+  propagatedBuildInputs = lib.optional enablePython pythonPackages.numpy;
+
+  nativeBuildInputs = [ cmake pkg-config unzip ];
+
+  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;
+
+  cmakeFlags = [
+    "-DWITH_OPENMP=ON"
+    "-DBUILD_PROTOBUF=${printEnabled (!useSystemProtobuf)}"
+    "-DPROTOBUF_UPDATE_FILES=${printEnabled useSystemProtobuf}"
+    "-DOPENCV_ENABLE_NONFREE=${printEnabled enableUnfree}"
+    "-DBUILD_TESTS=OFF"
+    "-DBUILD_PERF_TESTS=OFF"
+    "-DBUILD_DOCS=${printEnabled enableDocs}"
+    (opencvFlag "IPP" enableIpp)
+    (opencvFlag "TIFF" enableTIFF)
+    (opencvFlag "WEBP" enableWebP)
+    (opencvFlag "JPEG" enableJPEG)
+    (opencvFlag "PNG" enablePNG)
+    (opencvFlag "OPENEXR" enableEXR)
+    (opencvFlag "CUDA" enableCuda)
+    (opencvFlag "CUBLAS" enableCuda)
+    (opencvFlag "TBB" enableTbb)
+  ] ++ lib.optionals enableCuda [
+    "-DCUDA_FAST_MATH=ON"
+    "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc"
+    "-DCUDA_NVCC_FLAGS=--expt-relaxed-constexpr"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "-DWITH_OPENCL=OFF"
+    "-DWITH_LAPACK=OFF"
+    "-DBUILD_opencv_videoio=OFF"
+  ] ++ lib.optionals enablePython [
+    "-DOPENCV_SKIP_PYTHON_LOADER=ON"
+  ] ++ lib.optional enableEigen [
+    # Autodetection broken by https://github.com/opencv/opencv/pull/13337
+    "-DEIGEN_INCLUDE_PATH=${eigen}/include/eigen3"
+  ];
+
+  postBuild = lib.optionalString enableDocs ''
+    make doxygen
+  '';
+
+  # By default $out/lib/pkgconfig/opencv.pc looks something like this:
+  #
+  #   prefix=/nix/store/10pzq1a8fkh8q4sysj8n6mv0w0nl0miq-opencv-3.4.1
+  #   exec_prefix=${prefix}
+  #   libdir=${exec_prefix}//nix/store/10pzq1a8fkh8q4sysj8n6mv0w0nl0miq-opencv-3.4.1/lib
+  #   ...
+  #   Libs: -L${exec_prefix}//nix/store/10pzq1a8fkh8q4sysj8n6mv0w0nl0miq-opencv-3.4.1/lib ...
+  #
+  # Note that ${exec_prefix} is set to $out but that $out is also appended to
+  # ${exec_prefix}. This causes linker errors in downstream packages so we strip
+  # of $out after the ${exec_prefix} prefix:
+  postInstall = ''
+    sed -i "s|{exec_prefix}/$out|{exec_prefix}|" \
+      "$out/lib/pkgconfig/opencv.pc"
+  '';
+
+  hardeningDisable = [ "bindnow" "relro" ];
+
+  passthru = lib.optionalAttrs enablePython { pythonPath = []; };
+
+  meta = with lib; {
+    description = "Open Computer Vision Library with more than 500 algorithms";
+    homepage = "https://opencv.org/";
+    license = with licenses; if enableUnfree then unfree else bsd3;
+    maintainers = with maintainers; [mdaiter basvandijk];
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opencv/4.x.nix b/nixpkgs/pkgs/development/libraries/opencv/4.x.nix
new file mode 100644
index 000000000000..a33eff4faa53
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencv/4.x.nix
@@ -0,0 +1,342 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchFromGitHub
+, cmake
+, pkg-config
+, unzip
+, zlib
+, pcre
+, hdf5
+, boost
+, gflags
+, protobuf
+, config
+
+, enableJPEG ? true
+, libjpeg
+, enablePNG ? true
+, libpng
+, enableTIFF ? true
+, libtiff
+, enableWebP ? true
+, libwebp
+, enableEXR ? !stdenv.isDarwin
+, openexr
+, ilmbase
+, enableEigen ? true
+, eigen
+, enableOpenblas ? true
+, openblas
+, enableContrib ? true
+
+, enableCuda ? (config.cudaSupport or false) && stdenv.hostPlatform.isx86_64
+, cudatoolkit
+, nvidia-optical-flow-sdk
+
+, enableUnfree ? false
+, enableIpp ? false
+, enablePython ? false
+, pythonPackages
+, enableGtk2 ? false
+, gtk2
+, enableGtk3 ? false
+, gtk3
+, enableVtk ? false
+, vtk
+, enableFfmpeg ? true
+, ffmpeg
+, enableGStreamer ? true
+, gst_all_1
+, enableTesseract ? false
+, tesseract
+, leptonica
+, enableTbb ? false
+, tbb
+, enableOvis ? false
+, ogre
+, enableGPhoto2 ? false
+, libgphoto2
+, enableDC1394 ? false
+, libdc1394
+, enableDocs ? false
+, doxygen
+, graphviz-nox
+
+, AVFoundation
+, Cocoa
+, VideoDecodeAcceleration
+, CoreMedia
+, MediaToolbox
+, bzip2
+}:
+
+let
+  version = "4.5.2";
+
+  src = fetchFromGitHub {
+    owner = "opencv";
+    repo = "opencv";
+    rev = version;
+    sha256 = "sha256-pxi1VBF4txvRqspdqvCsAQ3XKzl633/o3wyOgD9wid4=";
+  };
+
+  contribSrc = fetchFromGitHub {
+    owner = "opencv";
+    repo = "opencv_contrib";
+    rev = version;
+    sha256 = "sha256-iMenRTY+qeL7WRgnRuQbsHflYDakE7pWWSHeIjrg0Iw=";
+  };
+
+  # Contrib must be built in order to enable Tesseract support:
+  buildContrib = enableContrib || enableTesseract || enableOvis;
+
+  # See opencv/3rdparty/ippicv/ippicv.cmake
+  ippicv = {
+    src = fetchFromGitHub {
+      owner = "opencv";
+      repo = "opencv_3rdparty";
+      rev = "a56b6ac6f030c312b2dce17430eef13aed9af274";
+      sha256 = "1msbkc3zixx61rcg6a04i1bcfhw1phgsrh93glq1n80hgsk3nbjq";
+    } + "/ippicv";
+    files = let name = platform: "ippicv_2019_${platform}_general_20180723.tgz"; in
+      if stdenv.hostPlatform.system == "x86_64-linux" then
+        { ${name "lnx_intel64"} = "c0bd78adb4156bbf552c1dfe90599607"; }
+      else if stdenv.hostPlatform.system == "i686-linux" then
+        { ${name "lnx_ia32"} = "4f38432c30bfd6423164b7a24bbc98a0"; }
+      else if stdenv.hostPlatform.system == "x86_64-darwin" then
+        { ${name "mac_intel64"} = "fe6b2bb75ae0e3f19ad3ae1a31dfa4a2"; }
+      else
+        throw "ICV is not available for this platform (or not yet supported by this package)";
+    dst = ".cache/ippicv";
+  };
+
+  # See opencv_contrib/modules/xfeatures2d/cmake/download_vgg.cmake
+  vgg = {
+    src = fetchFromGitHub {
+      owner = "opencv";
+      repo = "opencv_3rdparty";
+      rev = "fccf7cd6a4b12079f73bbfb21745f9babcd4eb1d";
+      sha256 = "0r9fam8dplyqqsd3qgpnnfgf9l7lj44di19rxwbm8mxiw0rlcdvy";
+    };
+    files = {
+      "vgg_generated_48.i" = "e8d0dcd54d1bcfdc29203d011a797179";
+      "vgg_generated_64.i" = "7126a5d9a8884ebca5aea5d63d677225";
+      "vgg_generated_80.i" = "7cd47228edec52b6d82f46511af325c5";
+      "vgg_generated_120.i" = "151805e03568c9f490a5e3a872777b75";
+    };
+    dst = ".cache/xfeatures2d/vgg";
+  };
+
+  # See opencv_contrib/modules/xfeatures2d/cmake/download_boostdesc.cmake
+  boostdesc = {
+    src = fetchFromGitHub {
+      owner = "opencv";
+      repo = "opencv_3rdparty";
+      rev = "34e4206aef44d50e6bbcd0ab06354b52e7466d26";
+      sha256 = "13yig1xhvgghvxspxmdidss5lqiikpjr0ddm83jsi0k85j92sn62";
+    };
+    files = {
+      "boostdesc_bgm.i" = "0ea90e7a8f3f7876d450e4149c97c74f";
+      "boostdesc_bgm_bi.i" = "232c966b13651bd0e46a1497b0852191";
+      "boostdesc_bgm_hd.i" = "324426a24fa56ad9c5b8e3e0b3e5303e";
+      "boostdesc_binboost_064.i" = "202e1b3e9fec871b04da31f7f016679f";
+      "boostdesc_binboost_128.i" = "98ea99d399965c03d555cef3ea502a0b";
+      "boostdesc_binboost_256.i" = "e6dcfa9f647779eb1ce446a8d759b6ea";
+      "boostdesc_lbgm.i" = "0ae0675534aa318d9668f2a179c2a052";
+    };
+    dst = ".cache/xfeatures2d/boostdesc";
+  };
+
+  # See opencv_contrib/modules/face/CMakeLists.txt
+  face = {
+    src = fetchFromGitHub {
+      owner = "opencv";
+      repo = "opencv_3rdparty";
+      rev = "8afa57abc8229d611c4937165d20e2a2d9fc5a12";
+      sha256 = "061lsvqdidq9xa2hwrcvwi9ixflr2c2lfpc8drr159g68zi8bp4v";
+    };
+    files = {
+      "face_landmark_model.dat" = "7505c44ca4eb54b4ab1e4777cb96ac05";
+    };
+    dst = ".cache/data";
+  };
+
+  # See opencv/modules/gapi/cmake/DownloadADE.cmake
+  ade = rec {
+    src = fetchurl {
+      url = "https://github.com/opencv/ade/archive/${name}";
+      sha256 = "04n9na2bph706bdxnnqfcbga4cyj8kd9s9ni7qyvnpj5v98jwvlm";
+    };
+    name = "v0.1.1f.zip";
+    md5 = "b624b995ec9c439cbc2e9e6ee940d3a2";
+    dst = ".cache/ade";
+  };
+
+  # See opencv/modules/wechat_qrcode/CMakeLists.txt
+  wechat_qrcode = {
+    src = fetchFromGitHub {
+      owner = "opencv";
+      repo = "opencv_3rdparty";
+      rev = "a8b69ccc738421293254aec5ddb38bd523503252";
+      sha256 = "sha256-/n6zHwf0Rdc4v9o4rmETzow/HTv+81DnHP+nL56XiTY=";
+    };
+    files = {
+      "detect.caffemodel" = "238e2b2d6f3c18d6c3a30de0c31e23cf";
+      "detect.prototxt" = "6fb4976b32695f9f5c6305c19f12537d";
+      "sr.caffemodel" = "cbfcd60361a73beb8c583eea7e8e6664";
+      "sr.prototxt" = "69db99927a70df953b471daaba03fbef";
+    };
+    dst = ".cache/wechat_qrcode";
+  };
+
+  # See opencv/cmake/OpenCVDownload.cmake
+  installExtraFiles = extra: with lib; ''
+    mkdir -p "${extra.dst}"
+  '' + concatStrings (flip mapAttrsToList extra.files (name: md5: ''
+    ln -s "${extra.src}/${name}" "${extra.dst}/${md5}-${name}"
+  ''));
+  installExtraFile = extra: ''
+    mkdir -p "${extra.dst}"
+    ln -s "${extra.src}" "${extra.dst}/${extra.md5}-${extra.name}"
+  '';
+
+  opencvFlag = name: enabled: "-DWITH_${name}=${printEnabled enabled}";
+
+  printEnabled = enabled: if enabled then "ON" else "OFF";
+in
+
+stdenv.mkDerivation {
+  pname = "opencv";
+  inherit version src;
+
+  postUnpack = lib.optionalString buildContrib ''
+    cp --no-preserve=mode -r "${contribSrc}/modules" "$NIX_BUILD_TOP/source/opencv_contrib"
+  '';
+
+  # This prevents cmake from using libraries in impure paths (which
+  # causes build failure on non NixOS)
+  patches = [
+    ./cmake-don-t-use-OpenCVFindOpenEXR.patch
+  ] ++ lib.optional enableCuda ./cuda_opt_flow.patch;
+  postPatch = ''
+    sed -i '/Add these standard paths to the search paths for FIND_LIBRARY/,/^\s*$/{d}' CMakeLists.txt
+  '';
+
+  preConfigure =
+    installExtraFile ade +
+    lib.optionalString enableIpp (installExtraFiles ippicv) + (
+      lib.optionalString buildContrib ''
+        cmakeFlagsArray+=("-DOPENCV_EXTRA_MODULES_PATH=$NIX_BUILD_TOP/source/opencv_contrib")
+
+        ${installExtraFiles vgg}
+        ${installExtraFiles boostdesc}
+        ${installExtraFiles face}
+        ${installExtraFiles wechat_qrcode}
+      ''
+    );
+
+  postConfigure = ''
+    [ -e modules/core/version_string.inc ]
+    echo '"(build info elided)"' > modules/core/version_string.inc
+  '';
+
+  buildInputs =
+    [ zlib pcre hdf5 boost gflags protobuf ]
+    ++ lib.optional enablePython pythonPackages.python
+    ++ lib.optional enableGtk2 gtk2
+    ++ lib.optional enableGtk3 gtk3
+    ++ lib.optional enableVtk vtk
+    ++ lib.optional enableJPEG libjpeg
+    ++ lib.optional enablePNG libpng
+    ++ lib.optional enableTIFF libtiff
+    ++ lib.optional enableWebP libwebp
+    ++ lib.optionals enableEXR [ openexr ilmbase ]
+    ++ lib.optional enableFfmpeg ffmpeg
+    ++ lib.optionals (enableFfmpeg && stdenv.isDarwin)
+      [ VideoDecodeAcceleration bzip2 ]
+    ++ lib.optionals enableGStreamer (with gst_all_1; [ gstreamer gst-plugins-base ])
+    ++ lib.optional enableOvis ogre
+    ++ lib.optional enableGPhoto2 libgphoto2
+    ++ lib.optional enableDC1394 libdc1394
+    ++ lib.optional enableEigen eigen
+    ++ lib.optional enableOpenblas openblas
+    # There is seemingly no compile-time flag for Tesseract.  It's
+    # simply enabled automatically if contrib is built, and it detects
+    # tesseract & leptonica.
+    ++ lib.optionals enableTesseract [ tesseract leptonica ]
+    ++ lib.optional enableTbb tbb
+    ++ lib.optionals enableCuda [ cudatoolkit nvidia-optical-flow-sdk ]
+    ++ lib.optionals stdenv.isDarwin [ bzip2 AVFoundation Cocoa VideoDecodeAcceleration CoreMedia MediaToolbox ]
+    ++ lib.optionals enableDocs [ doxygen graphviz-nox ];
+
+  propagatedBuildInputs = lib.optional enablePython pythonPackages.numpy;
+
+  nativeBuildInputs = [ cmake pkg-config unzip ];
+
+  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;
+
+  cmakeFlags = [
+    "-DOPENCV_GENERATE_PKGCONFIG=ON"
+    "-DWITH_OPENMP=ON"
+    "-DBUILD_PROTOBUF=OFF"
+    "-DPROTOBUF_UPDATE_FILES=ON"
+    "-DOPENCV_ENABLE_NONFREE=${printEnabled enableUnfree}"
+    "-DBUILD_TESTS=OFF"
+    "-DBUILD_PERF_TESTS=OFF"
+    "-DBUILD_DOCS=${printEnabled enableDocs}"
+    (opencvFlag "IPP" enableIpp)
+    (opencvFlag "TIFF" enableTIFF)
+    (opencvFlag "WEBP" enableWebP)
+    (opencvFlag "JPEG" enableJPEG)
+    (opencvFlag "PNG" enablePNG)
+    (opencvFlag "OPENEXR" enableEXR)
+    (opencvFlag "CUDA" enableCuda)
+    (opencvFlag "CUBLAS" enableCuda)
+    (opencvFlag "TBB" enableTbb)
+  ] ++ lib.optionals enableCuda [
+    "-DCUDA_FAST_MATH=ON"
+    "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc"
+    "-DCUDA_NVCC_FLAGS=--expt-relaxed-constexpr"
+    "-DNVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH=${nvidia-optical-flow-sdk}"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "-DWITH_OPENCL=OFF"
+    "-DWITH_LAPACK=OFF"
+  ] ++ lib.optionals enablePython [
+    "-DOPENCV_SKIP_PYTHON_LOADER=ON"
+  ];
+
+  postBuild = lib.optionalString enableDocs ''
+    make doxygen
+  '';
+
+  # By default $out/lib/pkgconfig/opencv4.pc looks something like this:
+  #
+  #   prefix=/nix/store/g0wnfyjjh4rikkvp22cpkh41naa43i4i-opencv-4.0.0
+  #   exec_prefix=${prefix}
+  #   libdir=${exec_prefix}//nix/store/g0wnfyjjh4rikkvp22cpkh41naa43i4i-opencv-4.0.0/lib
+  #   includedir_old=${prefix}//nix/store/g0wnfyjjh4rikkvp22cpkh41naa43i4i-opencv-4.0.0/include/opencv4/opencv
+  #   includedir_new=${prefix}//nix/store/g0wnfyjjh4rikkvp22cpkh41naa43i4i-opencv-4.0.0/include/opencv4
+  #   ...
+  #   Libs: -L${exec_prefix}//nix/store/g0wnfyjjh4rikkvp22cpkh41naa43i4i-opencv-4.0.0/lib ...
+  # Note that ${exec_prefix} is set to $out but that $out is also appended to
+  # ${exec_prefix}. This causes linker errors in downstream packages so we strip
+  # of $out after the ${exec_prefix} and ${prefix} prefixes:
+  postInstall = ''
+    sed -i "s|{exec_prefix}/$out|{exec_prefix}|;s|{prefix}/$out|{prefix}|" \
+      "$out/lib/pkgconfig/opencv4.pc"
+  '';
+
+  passthru = lib.optionalAttrs enablePython { pythonPath = [ ]; };
+
+  meta = with lib; {
+    description = "Open Computer Vision Library with more than 500 algorithms";
+    homepage = "https://opencv.org/";
+    license = with licenses; if enableUnfree then unfree else bsd3;
+    maintainers = with maintainers; [ mdaiter basvandijk ];
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opencv/cmake-don-t-use-OpenCVFindOpenEXR.patch b/nixpkgs/pkgs/development/libraries/opencv/cmake-don-t-use-OpenCVFindOpenEXR.patch
new file mode 100644
index 000000000000..bb398f7546b0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencv/cmake-don-t-use-OpenCVFindOpenEXR.patch
@@ -0,0 +1,29 @@
+diff --git a/cmake/OpenCVFindLibsGrfmt.cmake b/cmake/OpenCVFindLibsGrfmt.cmake
+index 23a6ca6959..27e121943a 100644
+--- a/cmake/OpenCVFindLibsGrfmt.cmake
++++ b/cmake/OpenCVFindLibsGrfmt.cmake
+@@ -255,21 +255,12 @@ endif()
+ # --- OpenEXR (optional) ---
+ if(WITH_OPENEXR)
+   ocv_clear_vars(HAVE_OPENEXR)
+-  if(NOT BUILD_OPENEXR)
+-    ocv_clear_internal_cache_vars(OPENEXR_INCLUDE_PATHS OPENEXR_LIBRARIES OPENEXR_ILMIMF_LIBRARY OPENEXR_VERSION)
+-    include("${OpenCV_SOURCE_DIR}/cmake/OpenCVFindOpenEXR.cmake")
+-  endif()
++  pkg_check_modules(OPENEXR OpenEXR)
+ 
+   if(OPENEXR_FOUND)
+     set(HAVE_OPENEXR YES)
+-  else()
+-    ocv_clear_vars(OPENEXR_INCLUDE_PATHS OPENEXR_LIBRARIES OPENEXR_ILMIMF_LIBRARY OPENEXR_VERSION)
+-
+-    set(OPENEXR_LIBRARIES IlmImf)
+-    add_subdirectory("${OpenCV_SOURCE_DIR}/3rdparty/openexr")
+-    if(OPENEXR_VERSION)  # check via TARGET doesn't work
+-      set(HAVE_OPENEXR YES)
+-    endif()
++    set(OPENEXR_INCLUDE_PATHS ${OPENEXR_INCLUDE_DIRS})
++    set(OPENEXR_LIBRARIES ${OPENEXR_LIBRARIES})
+   endif()
+ endif()
+ 
diff --git a/nixpkgs/pkgs/development/libraries/opencv/cuda_opt_flow.patch b/nixpkgs/pkgs/development/libraries/opencv/cuda_opt_flow.patch
new file mode 100644
index 000000000000..2f97abd51bbf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencv/cuda_opt_flow.patch
@@ -0,0 +1,27 @@
+diff --unified --recursive --text a/opencv_contrib/cudaoptflow/CMakeLists.txt b/opencv_contrib/cudaoptflow/CMakeLists.txt
+--- a/opencv_contrib/cudaoptflow/CMakeLists.txt	2021-06-12 01:35:47.536395972 +0300
++++ b/opencv_contrib/cudaoptflow/CMakeLists.txt	2021-06-12 01:36:02.029498597 +0300
+@@ -12,19 +12,6 @@
+   set(NVIDIA_OPTICAL_FLOW_2_0_HEADERS_COMMIT "edb50da3cf849840d680249aa6dbef248ebce2ca")
+   set(NVIDIA_OPTICAL_FLOW_2_0_HEADERS_MD5 "a73cd48b18dcc0cc8933b30796074191")
+   set(NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH "${OpenCV_BINARY_DIR}/3rdparty/NVIDIAOpticalFlowSDK_2_0_Headers")
+-  ocv_download(FILENAME "${NVIDIA_OPTICAL_FLOW_2_0_HEADERS_COMMIT}.zip"
+-                 HASH ${NVIDIA_OPTICAL_FLOW_2_0_HEADERS_MD5}
+-                 URL "https://github.com/NVIDIA/NVIDIAOpticalFlowSDK/archive/"
+-                 DESTINATION_DIR "${NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH}"
+-                 STATUS NVIDIA_OPTICAL_FLOW_2_0_HEADERS_DOWNLOAD_SUCCESS
+-                 ID "NVIDIA_OPTICAL_FLOW"
+-                 UNPACK RELATIVE_URL)
+-
+-  if(NOT NVIDIA_OPTICAL_FLOW_2_0_HEADERS_DOWNLOAD_SUCCESS)
+-    message(STATUS "Failed to download NVIDIA_Optical_Flow_2_0 Headers")
+-  else()
+-    message(STATUS "Building with NVIDIA Optical Flow API 2.0")
+-    add_definitions(-DHAVE_NVIDIA_OPTFLOW=2)
+-    ocv_include_directories(SYSTEM "${NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH}/NVIDIAOpticalFlowSDK-${NVIDIA_OPTICAL_FLOW_2_0_HEADERS_COMMIT}")
+-  endif()
+-endif()
+\ No newline at end of file
++  add_definitions(-DHAVE_NVIDIA_OPTFLOW=2)
++  ocv_include_directories(SYSTEM "${NVIDIA_OPTICAL_FLOW_2_0_HEADERS_PATH}")
++endif()
diff --git a/nixpkgs/pkgs/development/libraries/opencv/default.nix b/nixpkgs/pkgs/development/libraries/opencv/default.nix
new file mode 100644
index 000000000000..005257780e40
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencv/default.nix
@@ -0,0 +1,89 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, unzip
+, zlib
+, enablePython ? false, pythonPackages
+, enableGtk2 ? false, gtk2
+, enableJPEG ? true, libjpeg
+, enablePNG ? true, libpng
+, enableTIFF ? true, libtiff
+, enableEXR ? (!stdenv.isDarwin), openexr, ilmbase
+, enableFfmpeg ? false, ffmpeg
+, enableGStreamer ? false, gst_all_1
+, enableEigen ? true, eigen
+, Cocoa, QTKit
+}:
+
+let
+  opencvFlag = name: enabled: "-DWITH_${name}=${if enabled then "ON" else "OFF"}";
+
+in
+
+stdenv.mkDerivation rec {
+  pname = "opencv";
+  version = "2.4.13.7";
+
+  src = fetchFromGitHub {
+    owner = "opencv";
+    repo = "opencv";
+    rev = version;
+    sha256 = "062js7zhh4ixi2wk61wyi23qp9zsk5vw24iz2i5fab2hp97y5zq3";
+  };
+
+  patches =
+    [ # Don't include a copy of the CMake status output in the
+      # build. This causes a runtime dependency on GCC.
+      ./no-build-info.patch
+    ];
+
+  # This prevents cmake from using libraries in impure paths (which causes build failure on non NixOS)
+  postPatch = ''
+    sed -i '/Add these standard paths to the search paths for FIND_LIBRARY/,/^\s*$/{d}' CMakeLists.txt
+  '';
+
+  outputs = [ "out" "dev" ];
+
+  buildInputs =
+       [ zlib ]
+    ++ lib.optional enablePython pythonPackages.python
+    ++ lib.optional enableGtk2 gtk2
+    ++ lib.optional enableJPEG libjpeg
+    ++ lib.optional enablePNG libpng
+    ++ lib.optional enableTIFF libtiff
+    ++ lib.optionals enableEXR [ openexr ilmbase ]
+    ++ lib.optional enableFfmpeg ffmpeg
+    ++ lib.optionals enableGStreamer (with gst_all_1; [ gstreamer gst-plugins-base ])
+    ++ lib.optional enableEigen eigen
+    ++ lib.optionals stdenv.isDarwin [ Cocoa QTKit ]
+    ;
+
+  propagatedBuildInputs = lib.optional enablePython pythonPackages.numpy;
+
+  nativeBuildInputs = [ cmake pkg-config unzip ];
+
+  NIX_CFLAGS_COMPILE = lib.optionalString enableEXR "-I${ilmbase.dev}/include/OpenEXR";
+
+  cmakeFlags = [
+    (opencvFlag "TIFF" enableTIFF)
+    (opencvFlag "JPEG" enableJPEG)
+    (opencvFlag "PNG" enablePNG)
+    (opencvFlag "OPENEXR" enableEXR)
+    (opencvFlag "GSTREAMER" enableGStreamer)
+  ];
+
+  hardeningDisable = [ "bindnow" "relro" ];
+
+  # Fix pkg-config file that gets broken with multiple outputs
+  postFixup = ''
+    sed -i $dev/lib/pkgconfig/opencv.pc -e "s|includedir_old=.*|includedir_old=$dev/include/opencv|"
+    sed -i $dev/lib/pkgconfig/opencv.pc -e "s|includedir_new=.*|includedir_new=$dev/include|"
+  '';
+
+  passthru = lib.optionalAttrs enablePython { pythonPath = []; };
+
+  meta = with lib; {
+    description = "Open Computer Vision Library with more than 500 algorithms";
+    homepage = "https://opencv.org/";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opencv/no-build-info.patch b/nixpkgs/pkgs/development/libraries/opencv/no-build-info.patch
new file mode 100644
index 000000000000..4ee9701583a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opencv/no-build-info.patch
@@ -0,0 +1,14 @@
+diff -ru -x '*~' opencv-2.4.13-orig/modules/core/src/system.cpp opencv-2.4.13/modules/core/src/system.cpp
+--- opencv-2.4.13-orig/modules/core/src/system.cpp	1970-01-01 01:00:01.000000000 +0100
++++ opencv-2.4.13/modules/core/src/system.cpp	2016-10-02 18:44:53.674181762 +0200
+@@ -442,9 +442,7 @@
+ 
+ const std::string& getBuildInformation()
+ {
+-    static std::string build_info =
+-#include "version_string.inc"
+-    ;
++    static std::string build_info = "(build info elided)";
+     return build_info;
+ }
+ 
diff --git a/nixpkgs/pkgs/development/libraries/opendbx/default.nix b/nixpkgs/pkgs/development/libraries/opendbx/default.nix
new file mode 100644
index 000000000000..a9eb209edda8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opendbx/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, readline, libmysqlclient, postgresql, sqlite }:
+
+let inherit (lib) getDev; in
+
+stdenv.mkDerivation rec {
+  name = "opendbx-1.4.6";
+
+  src = fetchurl {
+    url = "https://linuxnetworks.de/opendbx/download/${name}.tar.gz";
+    sha256 = "0z29h6zx5f3gghkh1a0060w6wr572ci1rl2a3480znf728wa0ii2";
+  };
+
+  preConfigure = ''
+    export CPPFLAGS="-I${getDev libmysqlclient}/include/mysql"
+    export LDFLAGS="-L${libmysqlclient}/lib/mysql -L${postgresql}/lib"
+    configureFlagsArray=(--with-backends="mysql pgsql sqlite3")
+  '';
+
+  buildInputs = [ readline libmysqlclient postgresql sqlite ];
+
+  meta = with lib; {
+    description = "Extremely lightweight but extensible database access library written in C";
+    license = licenses.lgpl21;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opendht/default.nix b/nixpkgs/pkgs/development/libraries/opendht/default.nix
new file mode 100644
index 000000000000..3cf29b7351e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opendht/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchFromGitHub, darwin
+, cmake, pkg-config
+, asio, nettle, gnutls, msgpack, readline, libargon2
+}:
+
+stdenv.mkDerivation rec {
+  pname = "opendht";
+  version = "2.2.0";
+
+  src = fetchFromGitHub {
+    owner = "savoirfairelinux";
+    repo = "opendht";
+    rev = version;
+    sha256 = "sha256-u4MWMUbnq2q4FH0TMpbrbhS5erAfT4/3HYGLXaLTz+I=";
+  };
+
+  nativeBuildInputs =
+    [ cmake
+      pkg-config
+    ];
+
+  buildInputs =
+    [ asio
+      nettle
+      gnutls
+      msgpack
+      readline
+      libargon2
+    ] ++ lib.optionals stdenv.isDarwin [
+      darwin.apple_sdk.frameworks.Security
+    ];
+
+  outputs = [ "out" "lib" "dev" "man" ];
+
+  meta = with lib; {
+    description = "A C++11 Kademlia distributed hash table implementation";
+    homepage    = "https://github.com/savoirfairelinux/opendht";
+    license     = licenses.gpl3Plus;
+    maintainers = with maintainers; [ taeer olynch thoughtpolice ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opendkim/default.nix b/nixpkgs/pkgs/development/libraries/opendkim/default.nix
new file mode 100644
index 000000000000..b3d18748f74b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opendkim/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, libbsd, openssl, libmilter
+, autoreconfHook, perl, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "opendkim";
+  version = "2.11.0-Beta2";
+
+  src = fetchFromGitHub {
+    owner = "trusteddomainproject";
+    repo = "OpenDKIM";
+    rev = "rel-opendkim-${lib.replaceChars ["."] ["-"] version}";
+    sha256 = "0nx3in8sa6xna4vfacj8g60hfzk61jpj2ldag80xzxip9c3rd2pw";
+  };
+
+  configureFlags= [
+    "--with-milter=${libmilter}"
+    "ac_cv_func_malloc_0_nonnull=yes"
+    "ac_cv_func_realloc_0_nonnull=yes"
+  ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config makeWrapper ];
+
+  buildInputs = [ libbsd openssl libmilter perl ];
+
+  postInstall = ''
+    wrapProgram $out/sbin/opendkim-genkey \
+      --prefix PATH : ${openssl.bin}/bin
+  '';
+
+  meta = with lib; {
+    description = "C library for producing DKIM-aware applications and an open source milter for providing DKIM service";
+    homepage = "http://www.opendkim.org/";
+    maintainers = with maintainers; [ abbradar ];
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opendmarc/default.nix b/nixpkgs/pkgs/development/libraries/opendmarc/default.nix
new file mode 100644
index 000000000000..0dedfa3a85ed
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opendmarc/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, libmilter, perl, perlPackages, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "opendmarc";
+  version = "1.3.3";
+
+  src = fetchFromGitHub {
+    owner = "trusteddomainproject";
+    repo = "opendmarc";
+    rev = "rel-opendmarc-${builtins.replaceStrings [ "." ] [ "-" ] version}";
+    sha256 = "sha256-SQH85FLfVEEtYhR1+A1XxCDMiTjDgLQX6zifbLxCa5c=";
+  };
+
+  outputs = [ "bin" "dev" "out" "doc" ];
+
+  buildInputs = [ perl ];
+  nativeBuildInputs = [ autoreconfHook makeWrapper ];
+
+  postPatch = ''
+    substituteInPlace configure.ac --replace '	docs/Makefile' ""
+    patchShebangs contrib reports
+  '';
+
+  configureFlags = [
+    "--with-milter=${libmilter}"
+  ];
+
+  postFixup = ''
+    for b in $bin/bin/opendmarc-{expire,import,params,reports}; do
+      wrapProgram $b --set PERL5LIB ${perlPackages.makeFullPerlPath (with perlPackages; [ Switch DBI DBDmysql HTTPMessage ])}
+    done
+  '';
+
+  meta = with lib; {
+    description = "A free open source software implementation of the DMARC specification";
+    homepage = "http://www.trusteddomain.org/opendmarc/";
+    license = with licenses; [ bsd3 sendmail ];
+    maintainers = with maintainers; [ ajs124 das_j ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openexr/3.nix b/nixpkgs/pkgs/development/libraries/openexr/3.nix
new file mode 100644
index 000000000000..ee5e849f2eae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openexr/3.nix
@@ -0,0 +1,32 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, zlib
+, cmake
+, imath
+}:
+
+stdenv.mkDerivation rec {
+  pname = "openexr";
+  version = "3.1.1";
+
+  outputs = [ "bin" "dev" "out" "doc" ];
+
+  src = fetchFromGitHub {
+    owner = "AcademySoftwareFoundation";
+    repo = "openexr";
+    rev = "v${version}";
+    sha256 = "1p0l07vfpb25fx6jcgk1747v8x9xgpifx4cvvgi3g2473wlx6pyb";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  propagatedBuildInputs = [ imath zlib ];
+
+  meta = with lib; {
+    description = "A high dynamic-range (HDR) image file format";
+    homepage = "https://www.openexr.com/";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ paperdigits ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openexr/default.nix b/nixpkgs/pkgs/development/libraries/openexr/default.nix
new file mode 100644
index 000000000000..d60b7b7fc436
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openexr/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, zlib
+, ilmbase
+, fetchpatch
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "openexr";
+  version = "2.5.7";
+
+  outputs = [ "bin" "dev" "out" "doc" ];
+
+  src = fetchFromGitHub {
+    owner = "AcademySoftwareFoundation";
+    repo = "openexr";
+    rev = "v${version}";
+    sha256 = "1vja0rbilcd1wn184w8nbcmck00n7bfwlddwiaxw8dhj64nx4468";
+  };
+
+  patches = [
+    # Fix pkg-config paths
+    (fetchpatch {
+      url = "https://github.com/AcademySoftwareFoundation/openexr/commit/2f19a01923885fda75ec9d19332de080ec7102bd.patch";
+      sha256 = "1yxmrdzq1x1911wdzwnzr29jmg2r4wd4yx3vhjn0y5dpny0ri5y5";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+  propagatedBuildInputs = [ ilmbase zlib ];
+
+  meta = with lib; {
+    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
new file mode 100644
index 000000000000..47b2f6395478
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openexrid-unstable/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv, fetchFromGitHub, re2, openfx, zlib, ilmbase, libGLU, libGL, openexr }:
+
+stdenv.mkDerivation {
+  pname = "openexrid-unstable";
+  version = "2017-09-17";
+
+  src = fetchFromGitHub {
+    owner = "MercenariesEngineering";
+    repo = "openexrid";
+    rev = "bec0081548a096f9bcdd1504970c96264b0fc050";
+    sha256 = "0h4b74lv59p4hhrvrqdmlnchn2i0v5id4kl8xc7j26l9884q0383";
+  };
+
+  outputs = [ "dev" "out" "lib" ];
+
+  patches = [ ./openexrid.patch ];
+
+  postPatch = ''
+    substituteInPlace openexrid/makefile \
+        --replace g++ c++
+  '';
+
+  NIX_CFLAGS_COMPILE=''-I${ilmbase.dev}/include/OpenEXR
+                       -I${openexr.dev}/include/OpenEXR
+                       -I${openfx.dev}/include/OpenFX
+                      '';
+
+  buildInputs = [ re2 openfx zlib ilmbase libGLU libGL openexr ];
+
+  enableParallelBuilding = true;
+
+  buildPhase = ''
+      mkdir openexrid/release
+
+      PREFIX=$out make -C openexrid install
+
+      mkdir $dev;
+      mkdir $lib;
+  '';
+
+  installPhase = ''
+      find $out
+      mv $out/include $dev/
+      mv $out/lib $lib/
+  '';
+
+  meta = with lib; {
+    description = "OpenEXR files able to isolate any object of a CG image with a perfect antialiazing";
+    homepage = "https://github.com/MercenariesEngineering/openexrid";
+    maintainers = [ maintainers.guibou ];
+    platforms = platforms.all;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openexrid-unstable/openexrid.patch b/nixpkgs/pkgs/development/libraries/openexrid-unstable/openexrid.patch
new file mode 100644
index 000000000000..bbbf75b575dc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openexrid-unstable/openexrid.patch
@@ -0,0 +1,35 @@
+diff --git a/makefile b/makefile
+index 7a92771..31ef664 100644
+--- a/makefile
++++ b/makefile
+@@ -8,8 +8,8 @@ _openexrid:
+ _openfx:
+ 	make -C openfx
+ 
+-_test: _openexrid
+-	make -C test
++#_test: _openexrid
++#	make -C test
+ 
+ clean:
+ 	make -C openfx clean
+diff --git a/makefile.config b/makefile.config
+index 0c6cdfa..0166c4c 100644
+--- a/makefile.config
++++ b/makefile.config
+@@ -4,7 +4,7 @@
+ 
+ PREFIX ?= ~/openexrid
+ 
+-OFX_INCLUDE ?= /usr/include/openfx
++OFX_INCLUDE ?= /usr/include/OpenFX
+ EXR_INCLUDE ?= /usr/include/OpenEXR
+ EXR_LIB ?= /usr/lib
+ RE2_INCLUDE ?= /usr/include
+@@ -13,5 +13,5 @@ RE2_LIB ?= /usr/lib
+ VERSION ?= release
+ CPPFLAGS += -O3 -Wall -DNDEBUG -fPIC -I $(EXR_INCLUDE) -I $(OFX_INCLUDE) -I $(RE2_INCLUDE) -Dlinux
+ LDFLAGS += -L$(EXR_LIB) -L$(RE2_LIB) -L../openexrid/$(VERSION) -lpthread
+-LDFLAGS += -Wl,-Bstatic -lopenexrid -lIlmImf -lIlmThread -lIex -lImath -lHalf -lz -lre2 -Wl,-Bdynamic
++LDFLAGS += -lopenexrid -lIlmImf -lIlmThread -lIex -lImath -lHalf -lz -lre2 -Wl,-Bdynamic
+ 
diff --git a/nixpkgs/pkgs/development/libraries/openfst/default.nix b/nixpkgs/pkgs/development/libraries/openfst/default.nix
new file mode 100644
index 000000000000..51e661eabb3b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openfst/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "openfst";
+  version = "1.7.9";
+
+  src = fetchurl {
+    url = "http://www.openfst.org/twiki/pub/FST/FstDownload/${pname}-${version}.tar.gz";
+    sha256 = "1pmx1yhn2gknj0an0zwqmzgwjaycapi896244np50a8y3nrsw6ck";
+  };
+
+  configureFlags = [
+    "--enable-compact-fsts"
+    "--enable-compress"
+    "--enable-const-fsts"
+    "--enable-far"
+    "--enable-linear-fsts"
+    "--enable-lookahead-fsts"
+    "--enable-mpdt"
+    "--enable-ngram-fsts"
+    "--enable-pdt"
+  ];
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  meta = with lib; {
+    description = "Library for working with finite-state transducers";
+    longDescription = ''
+      Library for constructing, combining, optimizing, and searching weighted finite-state transducers (FSTs).
+      FSTs have key applications in speech recognition and synthesis, machine translation, optical character recognition,
+      pattern matching, string processing, machine learning, information extraction and retrieval among others
+    '';
+    homepage = "http://www.openfst.org/twiki/bin/view/FST/WebHome";
+    license = licenses.asl20;
+    maintainers = [ maintainers.dfordivam ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openfx/default.nix b/nixpkgs/pkgs/development/libraries/openfx/default.nix
new file mode 100644
index 000000000000..201bf16ad647
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openfx/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation {
+  pname = "openfx";
+  version = "1.4";
+
+  src = fetchFromGitHub {
+    owner = "ofxa";
+    repo = "openfx";
+    rev = "OFX_Release_1_4_TAG";
+    sha256 = "0k9ggzr6bisn77mipjfvawg3mv4bz50b63v8f7w1jhldi1sfy548";
+  };
+
+  outputs = [ "dev" "out" ];
+
+  enableParallelBuilding = true;
+
+  buildPhase = ''
+      mkdir $dev
+      mkdir $out
+      '';
+
+  installPhase = ''
+     mkdir -p $dev/include/OpenFX/
+     cp -r include/* $dev/include/OpenFX/
+  '';
+
+  meta = with lib; {
+    description = "Image processing plug-in standard";
+    homepage = "http://openeffects.org/";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+    maintainers = [ maintainers.guibou ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opengrm-ngram/default.nix b/nixpkgs/pkgs/development/libraries/opengrm-ngram/default.nix
new file mode 100644
index 000000000000..9b105808b8bb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opengrm-ngram/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, autoreconfHook, fetchurl, openfst }:
+
+stdenv.mkDerivation rec {
+  pname = "opengrm-ngram";
+  version = "1.3.11";
+
+  src = fetchurl {
+    url = "http://www.openfst.org/twiki/pub/GRM/NGramDownload/ngram-${version}.tar.gz";
+    sha256 = "0wwpcj8qncdr9f2pmi0vhlw277dyxr85ygdi8g57xp2ifysigm05";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  buildInputs = [ openfst ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Library to make and modify n-gram language models encoded as weighted finite-state transducers";
+    homepage = "http://www.openfst.org/twiki/bin/view/GRM/NGramLibrary";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ mic92 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openh264/default.nix b/nixpkgs/pkgs/development/libraries/openh264/default.nix
new file mode 100644
index 000000000000..6e856b04ac4a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openh264/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, nasm }:
+
+stdenv.mkDerivation rec {
+  pname = "openh264";
+  version = "2.1.1";
+
+  src = fetchFromGitHub {
+    owner = "cisco";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0ffav46pz3sbj92nipd62z03fibyqgclfq9w8lgr80s6za6zdk5s";
+  };
+
+  nativeBuildInputs = [ nasm ];
+
+  makeFlags = [ "PREFIX=${placeholder "out"}" ];
+
+  meta = with lib; {
+    description = "A codec library which supports H.264 encoding and decoding";
+    homepage = "https://www.openh264.org";
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openhmd/default.nix b/nixpkgs/pkgs/development/libraries/openhmd/default.nix
new file mode 100644
index 000000000000..a692dcb5e4e3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openhmd/default.nix
@@ -0,0 +1,61 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+, hidapi
+, SDL2
+, libGL
+, glew
+, withExamples ? true
+}:
+
+let examplesOnOff = if withExamples then "ON" else "OFF"; in
+
+stdenv.mkDerivation rec {
+  pname = "openhmd";
+  version = "0.3.0";
+
+  src = fetchFromGitHub {
+    owner = "OpenHMD";
+    repo = "OpenHMD";
+    rev = version;
+    sha256 = "1hkpdl4zgycag5k8njvqpx01apxmm8m8pvhlsxgxpqiqy9a38ccg";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [
+    hidapi
+  ] ++ lib.optionals withExamples [
+    SDL2
+    glew
+    libGL
+  ];
+
+  cmakeFlags = [
+    "-DBUILD_BOTH_STATIC_SHARED_LIBS=ON"
+    "-DOPENHMD_EXAMPLE_SIMPLE=${examplesOnOff}"
+    "-DOPENHMD_EXAMPLE_SDL=${examplesOnOff}"
+    "-DOpenGL_GL_PREFERENCE=GLVND"
+  ];
+
+  postInstall = lib.optionalString withExamples ''
+    mkdir -p $out/bin
+    install -D examples/simple/simple $out/bin/openhmd-example-simple
+    install -D examples/opengl/openglexample $out/bin/openhmd-example-opengl
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.openhmd.net"; # https does not work
+    description = "Library API and drivers immersive technology";
+    longDescription = ''
+      OpenHMD is a very simple FLOSS C library and a set of drivers
+      for interfacing with Virtual Reality (VR) Headsets aka
+      Head-mounted Displays (HMDs), controllers and trackers like
+      Oculus Rift, HTC Vive, Windows Mixed Reality, and etc.
+    '';
+    license = licenses.boost;
+    maintainers = with maintainers; [ oxij ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openimagedenoise/1_2_x.nix b/nixpkgs/pkgs/development/libraries/openimagedenoise/1_2_x.nix
new file mode 100644
index 000000000000..10f6abd79ef8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openimagedenoise/1_2_x.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchzip, cmake, tbb, python3, ispc }:
+
+stdenv.mkDerivation rec {
+  pname = "openimagedenoise";
+  version = "1.2.2";
+
+  # The release tarballs include pretrained weights, which would otherwise need to be fetched with git-lfs
+  src = fetchzip {
+    url = "https://github.com/OpenImageDenoise/oidn/releases/download/v${version}/oidn-${version}.src.tar.gz";
+    sha256 = "0wyaarjxkzlvljmpnr7qm06ma2wl1aik3z664gwpzhizswygk6yp";
+  };
+
+  nativeBuildInputs = [ cmake python3 ispc ];
+  buildInputs = [ tbb ];
+
+  meta = with lib; {
+    homepage = "https://openimagedenoise.github.io";
+    description = "High-Performance Denoising Library for Ray Tracing";
+    license = licenses.asl20;
+    maintainers = [ maintainers.leshainc ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openimagedenoise/default.nix b/nixpkgs/pkgs/development/libraries/openimagedenoise/default.nix
new file mode 100644
index 000000000000..c44dccbb5d51
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openimagedenoise/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchzip, cmake, tbb, python3, ispc }:
+
+stdenv.mkDerivation rec {
+  pname = "openimagedenoise";
+  version = "1.4.1";
+
+  # The release tarballs include pretrained weights, which would otherwise need to be fetched with git-lfs
+  src = fetchzip {
+    url = "https://github.com/OpenImageDenoise/oidn/releases/download/v${version}/oidn-${version}.src.tar.gz";
+    sha256 = "sha256-TQ7cL0/6pnSTuW21DESA5I3S/C1BHStrWK9yaPoim6E=";
+  };
+
+  nativeBuildInputs = [ cmake python3 ispc ];
+  buildInputs = [ tbb ];
+
+  meta = with lib; {
+    homepage = "https://openimagedenoise.github.io";
+    description = "High-Performance Denoising Library for Ray Tracing";
+    license = licenses.asl20;
+    maintainers = [ maintainers.leshainc ];
+    platforms = platforms.unix;
+    changelog = "https://github.com/OpenImageDenoise/oidn/blob/v${version}/CHANGELOG.md";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openjpeg/default.nix b/nixpkgs/pkgs/development/libraries/openjpeg/default.nix
new file mode 100644
index 000000000000..32bfa6f24584
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openjpeg/default.nix
@@ -0,0 +1,90 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, pkg-config
+, libpng, libtiff, lcms2, jpylyzer
+, mj2Support ? true # MJ2 executables
+, jpwlLibSupport ? true # JPWL library & executables
+, jpipLibSupport ? false # JPIP library & executables
+, jpipServerSupport ? false, curl ? null, fcgi ? null # JPIP Server
+#, opjViewerSupport ? false, wxGTK ? null # OPJViewer executable
+, openjpegJarSupport ? false # Openjpeg jar (Java)
+, jp3dSupport ? true # # JP3D comp
+, thirdPartySupport ? false # Third party libraries - OFF: only build when found, ON: always build
+, testsSupport ? true
+, jdk ? null
+}:
+
+assert jpipServerSupport -> jpipLibSupport && curl != null && fcgi != null;
+#assert opjViewerSupport -> (wxGTK != null);
+assert (openjpegJarSupport || jpipLibSupport) -> jdk != null;
+
+let
+  inherit (lib) optional optionals;
+  mkFlag = optSet: flag: "-D${flag}=${if optSet then "ON" else "OFF"}";
+in
+
+stdenv.mkDerivation rec {
+  pname = "openjpeg";
+  version = "2.4.0"; # don't forget to change passthru.incDir
+
+  src = fetchFromGitHub {
+    owner = "uclouvain";
+    repo = "openjpeg";
+    rev = "v${version}";
+    sha256 = "143dvy5g6v6129lzvl0r8mrgva2fppkn0zl099qmi9yi9l9h7yyf";
+  };
+
+  patches = [
+    ./fix-cmake-config-includedir.patch
+    (fetchpatch {
+      url = "https://patch-diff.githubusercontent.com/raw/uclouvain/openjpeg/pull/1321.patch";
+      sha256 = "1cjpr76nf9g65nqkfnxnjzi3bv7ifbxpc74kxxibh58pzjlp6al8";
+    })
+  ];
+
+  outputs = [ "out" "dev" ];
+
+  cmakeFlags = [
+    "-DCMAKE_INSTALL_NAME_DIR=\${CMAKE_INSTALL_PREFIX}/lib"
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DBUILD_CODEC=ON"
+    (mkFlag mj2Support "BUILD_MJ2")
+    (mkFlag jpwlLibSupport "BUILD_JPWL")
+    (mkFlag jpipLibSupport "BUILD_JPIP")
+    (mkFlag jpipServerSupport "BUILD_JPIP_SERVER")
+    #(mkFlag opjViewerSupport "BUILD_VIEWER")
+    "-DBUILD_VIEWER=OFF"
+    (mkFlag openjpegJarSupport "BUILD_JAVA")
+    (mkFlag jp3dSupport "BUILD_JP3D")
+    (mkFlag thirdPartySupport "BUILD_THIRDPARTY")
+    (mkFlag testsSupport "BUILD_TESTING")
+    "-DOPENJPEG_INSTALL_INCLUDE_DIR=${placeholder "dev"}/include/${passthru.incDir}"
+    "-DOPENJPEG_INSTALL_PACKAGE_DIR=${placeholder "dev"}/lib/${passthru.incDir}"
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [ ]
+    ++ optionals jpipServerSupport [ curl fcgi ]
+    #++ optional opjViewerSupport wxGTK
+    ++ optional (openjpegJarSupport || jpipLibSupport) jdk;
+
+  propagatedBuildInputs = [ libpng libtiff lcms2 ];
+
+  doCheck = (testsSupport && !stdenv.isAarch64); # tests fail on aarch64-linux
+  checkPhase = ''
+    substituteInPlace ../tools/ctest_scripts/travis-ci.cmake \
+      --replace "JPYLYZER_EXECUTABLE=" "JPYLYZER_EXECUTABLE=\"${jpylyzer}/bin/jpylyzer\" # "
+    OPJ_SOURCE_DIR=.. ctest -S ../tools/ctest_scripts/travis-ci.cmake
+  '';
+
+  passthru = {
+    incDir = "openjpeg-2.4";
+  };
+
+  meta = with lib; {
+    description = "Open-source JPEG 2000 codec written in C language";
+    homepage = "https://www.openjpeg.org/";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ codyopel ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openjpeg/fix-cmake-config-includedir.patch b/nixpkgs/pkgs/development/libraries/openjpeg/fix-cmake-config-includedir.patch
new file mode 100644
index 000000000000..21306400dd46
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openjpeg/fix-cmake-config-includedir.patch
@@ -0,0 +1,44 @@
+--- a/src/lib/openjp2/libopenjp2.pc.cmake.in
++++ b/src/lib/openjp2/libopenjp2.pc.cmake.in
+@@ -3,7 +3,7 @@
+ mandir=${prefix}/@OPENJPEG_INSTALL_MAN_DIR@
+ docdir=${prefix}/@OPENJPEG_INSTALL_DOC_DIR@
+ libdir=${prefix}/@OPENJPEG_INSTALL_LIB_DIR@
+-includedir=${prefix}/@OPENJPEG_INSTALL_INCLUDE_DIR@
++includedir=@OPENJPEG_INSTALL_INCLUDE_DIR@
+ 
+ Name: openjp2
+ Description: JPEG2000 library (Part 1 and 2)
+--- a/src/lib/openjp3d/libopenjp3d.pc.cmake.in
++++ b/src/lib/openjp3d/libopenjp3d.pc.cmake.in
+@@ -3,7 +3,7 @@
+ mandir=${prefix}/@OPENJPEG_INSTALL_MAN_DIR@
+ docdir=${prefix}/@OPENJPEG_INSTALL_DOC_DIR@
+ libdir=${prefix}/@OPENJPEG_INSTALL_LIB_DIR@
+-includedir=${prefix}/@OPENJPEG_INSTALL_INCLUDE_DIR@
++includedir=@OPENJPEG_INSTALL_INCLUDE_DIR@
+ 
+ Name: openjp3d
+ Description: JPEG2000 Extensions for three-dimensional data (Part 10)
+--- a/src/lib/openjpip/libopenjpip.pc.cmake.in
++++ b/src/lib/openjpip/libopenjpip.pc.cmake.in
+@@ -3,7 +3,7 @@
+ mandir=${prefix}/@OPENJPEG_INSTALL_MAN_DIR@
+ docdir=${prefix}/@OPENJPEG_INSTALL_DOC_DIR@
+ libdir=${prefix}/@OPENJPEG_INSTALL_LIB_DIR@
+-includedir=${prefix}/@OPENJPEG_INSTALL_INCLUDE_DIR@
++includedir=@OPENJPEG_INSTALL_INCLUDE_DIR@
+ 
+ Name: openjpip
+ Description: JPEG2000 Interactivity tools, APIs and protocols (Part 9)
+--- a/src/lib/openjpwl/libopenjpwl.pc.cmake.in
++++ b/src/lib/openjpwl/libopenjpwl.pc.cmake.in
+@@ -3,7 +3,7 @@
+ mandir=${prefix}/@OPENJPEG_INSTALL_MAN_DIR@
+ docdir=${prefix}/@OPENJPEG_INSTALL_DOC_DIR@
+ libdir=${prefix}/@OPENJPEG_INSTALL_LIB_DIR@
+-includedir=${prefix}/@OPENJPEG_INSTALL_INCLUDE_DIR@
++includedir=@OPENJPEG_INSTALL_INCLUDE_DIR@
+ 
+ Name: openjpwl
+ Description: JPEG2000 Wireless library (Part 11)
diff --git a/nixpkgs/pkgs/development/libraries/openldap/default.nix b/nixpkgs/pkgs/development/libraries/openldap/default.nix
new file mode 100644
index 000000000000..f9e2b3c0b3fc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openldap/default.nix
@@ -0,0 +1,98 @@
+{ lib, stdenv, fetchurl, openssl, db, groff, libtool, libsodium
+, withCyrusSasl ? true
+, cyrus_sasl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "openldap";
+  version = "2.4.58";
+
+  src = fetchurl {
+    url = "https://www.openldap.org/software/download/OpenLDAP/openldap-release/${pname}-${version}.tgz";
+    sha256 = "sha256-V7WSVL4V0L9qmrPVFMHAV3ewISMpFTMTSofJRGj49Hs=";
+  };
+
+  # TODO: separate "out" and "bin"
+  outputs = [ "out" "dev" "man" "devdoc" ];
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ groff ];
+
+  buildInputs = [ openssl cyrus_sasl db libsodium libtool ];
+
+  # Disable install stripping as it breaks cross-compiling.
+  # We strip binaries anyway in fixupPhase.
+  makeFlags= [
+    "STRIP="
+    "prefix=$(out)"
+    "moduledir=$(out)/lib/modules"
+    "CC=${stdenv.cc.targetPrefix}cc"
+  ];
+
+  preConfigure = lib.optionalString (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11") ''
+    MACOSX_DEPLOYMENT_TARGET=10.16
+  '';
+
+  configureFlags = [
+    "--enable-overlays"
+    "--disable-dependency-tracking"   # speeds up one-time build
+    "--enable-modules"
+    "--sysconfdir=/etc"
+    "--localstatedir=/var"
+    "--enable-crypt"
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "--with-yielding_select=yes"
+    "ac_cv_func_memcmp_working=yes"
+  ] ++ lib.optional (!withCyrusSasl) "--without-cyrus-sasl"
+    ++ lib.optional stdenv.isFreeBSD "--with-pic";
+
+  postBuild = ''
+    make $makeFlags CC=$CC -C contrib/slapd-modules/passwd/sha2
+    make $makeFlags CC=$CC -C contrib/slapd-modules/passwd/pbkdf2
+    make $makeFlags CC=$CC -C contrib/slapd-modules/passwd/argon2
+  '';
+
+  doCheck = false; # needs a running LDAP server
+
+  installFlags = [
+    "sysconfdir=$(out)/etc"
+    "localstatedir=$(out)/var"
+    "moduledir=$(out)/lib/modules"
+    # The argon2 module hardcodes /usr/bin/install as the path for the
+    # `install` binary, which is overridden here.
+    "INSTALL=install"
+  ];
+
+  # 1. Libraries left in the build location confuse `patchelf --shrink-rpath`
+  #    Delete these to let patchelf discover the right path instead.
+  #    FIXME: that one can be removed when https://github.com/NixOS/patchelf/pull/98
+  #    is in Nixpkgs patchelf.
+  # 2. Fixup broken libtool for openssl and cyrus_sasl (if it is not disabled)
+  preFixup = ''
+    rm -r $out/var
+    rm -r libraries/*/.libs
+    rm -r contrib/slapd-modules/passwd/*/.libs
+    for f in $out/lib/libldap.la $out/lib/libldap_r.la; do
+      substituteInPlace "$f" --replace '-lssl' '-L${openssl.out}/lib -lssl'
+  '' + lib.optionalString withCyrusSasl ''
+      substituteInPlace "$f" --replace '-lsasl2' '-L${cyrus_sasl.out}/lib -lsasl2'
+  '' + ''
+    done
+  '';
+
+  postInstall = ''
+    make $installFlags install -C contrib/slapd-modules/passwd/sha2
+    make $installFlags install -C contrib/slapd-modules/passwd/pbkdf2
+    make $installFlags install-lib -C contrib/slapd-modules/passwd/argon2
+    chmod +x "$out"/lib/*.{so,dylib}
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.openldap.org/";
+    description = "An open source implementation of the Lightweight Directory Access Protocol";
+    license = licenses.openldap;
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openmpi/default.nix b/nixpkgs/pkgs/development/libraries/openmpi/default.nix
new file mode 100644
index 000000000000..35708c0ac016
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openmpi/default.nix
@@ -0,0 +1,122 @@
+{ lib, stdenv, fetchurl, gfortran, perl, libnl
+, rdma-core, zlib, numactl, libevent, hwloc, targetPackages, symlinkJoin
+, libpsm2, libfabric, pmix, ucx
+
+# Enable CUDA support
+, cudaSupport ? false, cudatoolkit ? null
+
+# Enable the Sun Grid Engine bindings
+, enableSGE ? false
+
+# Pass PATH/LD_LIBRARY_PATH to point to current mpirun by default
+, enablePrefix ? false
+
+# Enable libfabric support (necessary for Omnipath networks) on x86_64 linux
+, fabricSupport ? stdenv.isLinux && stdenv.isx86_64
+
+# Enable Fortran support
+, fortranSupport ? true
+}:
+
+assert !cudaSupport || cudatoolkit != null;
+
+let
+  cudatoolkit_joined = symlinkJoin {
+    name = "${cudatoolkit.name}-unsplit";
+    paths = [ cudatoolkit.out cudatoolkit.lib ];
+  };
+in stdenv.mkDerivation rec {
+  pname = "openmpi";
+  version = "4.1.1";
+
+  src = with lib.versions; fetchurl {
+    url = "https://www.open-mpi.org/software/ompi/v${major version}.${minor version}/downloads/${pname}-${version}.tar.bz2";
+    sha256 = "1nkwq123vvmggcay48snm9qqmrh0bdzpln0l1jnp26niidvplkz2";
+  };
+
+  postPatch = ''
+    patchShebangs ./
+
+    # Ensure build is reproducible
+    ts=`date -d @$SOURCE_DATE_EPOCH`
+    sed -i 's/OPAL_CONFIGURE_USER=.*/OPAL_CONFIGURE_USER="nixbld"/' configure
+    sed -i 's/OPAL_CONFIGURE_HOST=.*/OPAL_CONFIGURE_HOST="localhost"/' configure
+    sed -i "s/OPAL_CONFIGURE_DATE=.*/OPAL_CONFIGURE_DATE=\"$ts\"/" configure
+    find -name "Makefile.in" -exec sed -i "s/\`date\`/$ts/" \{} \;
+  '';
+
+  buildInputs = [ zlib ]
+    ++ lib.optionals fortranSupport [ gfortran ]
+    ++ lib.optionals stdenv.isLinux [ libnl numactl pmix ucx ]
+    ++ lib.optionals cudaSupport [ cudatoolkit ]
+    ++ [ libevent hwloc ]
+    ++ lib.optional (stdenv.isLinux || stdenv.isFreeBSD) rdma-core
+    ++ lib.optional fabricSupport [ libpsm2 libfabric ];
+
+  nativeBuildInputs = [ perl ];
+
+  configureFlags = lib.optional (!cudaSupport) "--disable-mca-dso"
+    ++ lib.optional (!fortranSupport) "--disable-mpi-fortran"
+    ++ lib.optionals stdenv.isLinux  [
+      "--with-libnl=${libnl.dev}"
+      "--with-pmix=${pmix}"
+      "--with-pmix-libdir=${pmix}/lib"
+      "--enable-mpi-cxx"
+    ] ++ 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" ]
+    ++ lib.optionals fabricSupport [ "--with-psm2=${libpsm2}" "--with-libfabric=${libfabric}" ]
+    ;
+
+  enableParallelBuilding = true;
+
+  # disable stackprotector on aarch64-darwin for now
+  # https://github.com/NixOS/nixpkgs/issues/127608
+  #
+  # build error:
+  #
+  # /private/tmp/nix-build-openmpi-4.1.1.drv-0/ccg7QqR8.s:13:15: error: index must be an integer in range [-256, 255].
+  #         ldr     x2, [x2, ___stack_chk_guard];momd
+  #
+  hardeningDisable = lib.optionals (stdenv.isAarch64 && stdenv.isDarwin) [ "stackprotector" ];
+
+  postInstall = ''
+    rm -f $out/lib/*.la
+   '';
+
+  postFixup = ''
+    # default compilers should be indentical to the
+    # compilers at build time
+
+    sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc:' \
+      $out/share/openmpi/mpicc-wrapper-data.txt
+
+    sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}cc:' \
+       $out/share/openmpi/ortecc-wrapper-data.txt
+
+    sed -i 's:compiler=.*:compiler=${targetPackages.stdenv.cc}/bin/${targetPackages.stdenv.cc.targetPrefix}c++:' \
+       $out/share/openmpi/mpic++-wrapper-data.txt
+  '' + lib.optionalString fortranSupport ''
+
+    sed -i 's:compiler=.*:compiler=${gfortran}/bin/${gfortran.targetPrefix}gfortran:'  \
+       $out/share/openmpi/mpifort-wrapper-data.txt
+  '';
+
+  doCheck = true;
+
+  passthru = {
+    inherit cudaSupport cudatoolkit;
+  };
+
+  meta = with lib; {
+    homepage = "https://www.open-mpi.org/";
+    description = "Open source MPI-3 implementation";
+    longDescription = "The Open MPI Project is an open source MPI-3 implementation that is developed and maintained by a consortium of academic, research, and industry partners. Open MPI is therefore able to combine the expertise, technologies, and resources from all across the High Performance Computing community in order to build the best MPI library available. Open MPI offers advantages for system and software vendors, application developers and computer science researchers.";
+    maintainers = with maintainers; [ markuskowa ];
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openpa/default.nix b/nixpkgs/pkgs/development/libraries/openpa/default.nix
new file mode 100644
index 000000000000..23f025e2aa63
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openpa/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, file }:
+
+stdenv.mkDerivation rec {
+  pname = "openpa";
+  version = "1.0.4";
+
+  src = fetchurl {
+    url = "https://trac.mpich.org/projects/${pname}/raw-attachment/wiki/Downloads/${pname}-${version}.tar.gz";
+    sha256 = "0flyi596hm6fv7xyw2iykx3s65p748s62bf15624xcnwpfrh8ncy";
+  };
+
+  prePatch = "substituteInPlace configure --replace /usr/bin/file ${file}/bin/file";
+
+  doCheck = true;
+
+  meta = {
+    description = "Atomic primitives for high performance, concurrent software";
+    homepage = "https://trac.mpich.org/projects/openpa";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ leenaars ];
+    platforms = lib.platforms.unix;
+    longDescription = ''
+      OPA (or sometimes OpenPA or Open Portable Atomics) is an
+      open source library intended to provide a consistent C API for performing
+      atomic operations on a variety of platforms. The main goal of the project is to
+      enable the portable usage of atomic operations in concurrent software.
+      Developers of client software can worry about implementing and improving their
+      concurrent algorithms instead of fiddling with inline assembly syntax and
+      learning new assembly dialects in order improve or maintain application
+      portability.
+    '';
+   };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openpam/default.nix b/nixpkgs/pkgs/development/libraries/openpam/default.nix
new file mode 100644
index 000000000000..3d1cff05a085
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openpam/default.nix
@@ -0,0 +1,19 @@
+{ stdenv, fetchurl, lib }:
+
+stdenv.mkDerivation rec {
+  pname = "openpam";
+  version = "20170430";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/openpam/openpam/Resedacea/${pname}-${version}.tar.gz";
+    sha256 = "0pz8kf9mxj0k8yp8jgmhahddz58zv2b7gnyjwng75xgsx4i55xi2";
+  };
+
+  meta = with lib; {
+    homepage = "https://www.openpam.org";
+    description = "An open source PAM library that focuses on simplicity, correctness, and cleanliness";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ matthewbauer ];
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opensaml-cpp/default.nix b/nixpkgs/pkgs/development/libraries/opensaml-cpp/default.nix
new file mode 100644
index 000000000000..4f83f22856e3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opensaml-cpp/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchgit, autoreconfHook, pkg-config
+, boost, openssl, log4shib, xercesc, xml-security-c, xml-tooling-c, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "opensaml-cpp";
+  version = "3.0.1";
+
+  src = fetchgit {
+    url = "https://git.shibboleth.net/git/cpp-opensaml.git";
+    rev = version;
+    sha256 = "0ms3sqmwqkrqb92d7jy2hqwnz5yd7cbrz73n321jik0jilrwl5w8";
+  };
+
+  buildInputs = [
+    boost openssl log4shib xercesc xml-security-c xml-tooling-c zlib
+  ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  configureFlags = [ "--with-xmltooling=${xml-tooling-c}" ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage    = "https://shibboleth.net/products/opensaml-cpp.html";
+    description = "A low-level library written in C++ that provides support for producing and consuming SAML messages";
+    platforms   = platforms.unix;
+    license     = licenses.asl20;
+    maintainers = [ maintainers.jammerful ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openscenegraph/default.nix b/nixpkgs/pkgs/development/libraries/openscenegraph/default.nix
new file mode 100644
index 000000000000..6b446882ba13
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openscenegraph/default.nix
@@ -0,0 +1,76 @@
+{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, doxygen,
+  libX11, libXinerama, libXrandr, libGLU, libGL,
+  glib, ilmbase, libxml2, pcre, zlib,
+  AGL, Carbon, Cocoa, Foundation,
+  jpegSupport ? true, libjpeg,
+  exrSupport ? false, openexr,
+  gifSupport ? true, giflib,
+  pngSupport ? true, libpng,
+  tiffSupport ? true, libtiff,
+  gdalSupport ? false, gdal,
+  curlSupport ? true, curl,
+  colladaSupport ? false, opencollada,
+  opencascadeSupport ? false, opencascade,
+  ffmpegSupport ? false, ffmpeg,
+  nvttSupport ? false, nvidia-texture-tools,
+  freetypeSupport ? true, freetype,
+  svgSupport ? false, librsvg,
+  pdfSupport ? false, poppler,
+  vncSupport ? false, libvncserver,
+  lasSupport ? false, libLAS,
+  luaSupport ? false, lua,
+  sdlSupport ? false, SDL2,
+  restSupport ? false, asio, boost,
+  withApps ? false,
+  withExamples ? false, fltk, wxGTK,
+}:
+
+stdenv.mkDerivation rec {
+  pname = "openscenegraph";
+  version = "3.6.5";
+
+  src = fetchFromGitHub {
+    owner = "openscenegraph";
+    repo = "OpenSceneGraph";
+    rev = "OpenSceneGraph-${version}";
+    sha256 = "00i14h82qg3xzcyd8p02wrarnmby3aiwmz0z43l50byc9f8i05n1";
+  };
+
+  nativeBuildInputs = [ pkg-config cmake doxygen ];
+
+  buildInputs = [
+    libX11 libXinerama libXrandr libGLU libGL
+    glib ilmbase libxml2 pcre zlib
+  ] ++ lib.optional jpegSupport libjpeg
+    ++ lib.optional exrSupport openexr
+    ++ lib.optional gifSupport giflib
+    ++ lib.optional pngSupport libpng
+    ++ lib.optional tiffSupport libtiff
+    ++ lib.optional gdalSupport gdal
+    ++ lib.optional curlSupport curl
+    ++ lib.optional colladaSupport opencollada
+    ++ lib.optional opencascadeSupport opencascade
+    ++ lib.optional ffmpegSupport ffmpeg
+    ++ lib.optional nvttSupport nvidia-texture-tools
+    ++ lib.optional freetypeSupport freetype
+    ++ lib.optional svgSupport librsvg
+    ++ lib.optional pdfSupport poppler
+    ++ lib.optional vncSupport libvncserver
+    ++ lib.optional lasSupport libLAS
+    ++ lib.optional luaSupport lua
+    ++ lib.optional sdlSupport SDL2
+    ++ lib.optionals restSupport [ asio boost ]
+    ++ lib.optionals withExamples [ fltk wxGTK ]
+    ++ lib.optionals stdenv.isDarwin [ AGL Carbon Cocoa Foundation ]
+  ;
+
+  cmakeFlags = lib.optional (!withApps) "-DBUILD_OSG_APPLICATIONS=OFF" ++ lib.optional withExamples "-DBUILD_OSG_EXAMPLES=ON";
+
+  meta = with lib; {
+    description = "A 3D graphics toolkit";
+    homepage = "http://www.openscenegraph.org/";
+    maintainers = with maintainers; [ aanderse raskin ];
+    platforms = with platforms; linux ++ darwin;
+    license = "OpenSceneGraph Public License - free LGPL-based license";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openslide/default.nix b/nixpkgs/pkgs/development/libraries/openslide/default.nix
new file mode 100644
index 000000000000..71c2017f9e5a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openslide/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook
+, pkg-config, cairo, glib, gdk-pixbuf, libjpeg
+, libpng, libtiff, libxml2, openjpeg, sqlite, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "openslide";
+  version = "3.4.1";
+
+  src = fetchFromGitHub {
+    owner = "openslide";
+    repo = "openslide";
+    rev = "v${version}";
+    sha256 = "1g4hhjr4cbx754cwi9wl84k33bkg232w8ajic7aqhzm8x182hszp";
+  };
+
+  buildInputs = [ cairo glib gdk-pixbuf libjpeg libpng libtiff libxml2 openjpeg sqlite zlib ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  meta = with lib; {
+    homepage = "https://openslide.org";
+    description = "A C library that provides a simple interface to read whole-slide images.";
+    license = licenses.lgpl21;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ lromor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openslp/CVE-2016-4912.patch b/nixpkgs/pkgs/development/libraries/openslp/CVE-2016-4912.patch
new file mode 100644
index 000000000000..06223deda89b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openslp/CVE-2016-4912.patch
@@ -0,0 +1,11 @@
+--- a/common/slp_xmalloc.c
++++ b/common/slp_xmalloc.c
+@@ -206,7 +206,7 @@ void * _xrealloc(const char * file, int line, void * ptr, size_t size)
+          if (newptr == 0)
+             return 0;
+          memcpy(newptr, ptr, x->size);
+-         _xfree(file, line, x);
++         _xfree(file, line, ptr);
+       }
+       return newptr;
+    }
diff --git a/nixpkgs/pkgs/development/libraries/openslp/CVE-2019-5544.patch b/nixpkgs/pkgs/development/libraries/openslp/CVE-2019-5544.patch
new file mode 100644
index 000000000000..2afc0aed3302
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openslp/CVE-2019-5544.patch
@@ -0,0 +1,165 @@
+diff -ur openslp-2.0.0.orig/common/slp_buffer.c openslp-2.0.0/common/slp_buffer.c
+--- openslp-2.0.0.orig/common/slp_buffer.c	2012-12-10 15:31:53.000000000 -0800
++++ openslp-2.0.0/common/slp_buffer.c	2019-11-26 21:54:20.000000000 -0800
+@@ -30,6 +30,13 @@
+  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  *-------------------------------------------------------------------------*/
+ 
++/* Copyright (c) 2019 VMware, Inc.
++ * SPDX-License-Identifier: BSD-3-Clause
++ * This file is provided under the BSD-3-Clause license.
++ * See COPYING file for more details and other copyrights
++ * that may apply.
++ */
++
+ /** Functions for managing SLP message buffers.
+  *
+  * This file provides a higher level abstraction over malloc and free that
+@@ -153,4 +160,20 @@
+    xfree(buf);
+ }
+ 
++/** Report remaining free buffer size in bytes.
++ *
++ * Check if buffer is allocated and if so return bytes left in a
++ * @c SLPBuffer object.
++ *
++ * @param[in] buf The SLPBuffer to be freed.
++ */
++size_t
++RemainingBufferSpace(SLPBuffer buf)
++{
++   if (buf->allocated == 0) {
++      return 0;
++   }
++   return buf->end - buf->curpos;
++}
++
+ /*=========================================================================*/
+diff -ur openslp-2.0.0.orig/common/slp_buffer.h openslp-2.0.0/common/slp_buffer.h
+--- openslp-2.0.0.orig/common/slp_buffer.h	2012-11-28 09:07:04.000000000 -0800
++++ openslp-2.0.0/common/slp_buffer.h	2019-11-26 21:54:32.000000000 -0800
+@@ -30,6 +30,13 @@
+  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  *-------------------------------------------------------------------------*/
+ 
++/* Copyright (c) 2019 VMware, Inc.
++ * SPDX-License-Identifier: BSD-3-Clause
++ * This file is provided under the BSD-3-Clause license.
++ * See COPYING file for more details and other copyrights
++ * that may apply.
++ */
++
+ /** Header file that defines SLP message buffer management routines.
+  *
+  * Includes structures, constants and functions that used to handle memory 
+@@ -78,6 +85,8 @@
+ 
+ SLPBuffer SLPBufferListAdd(SLPBuffer * list, SLPBuffer buf);
+ 
++size_t RemainingBufferSpace(SLPBuffer buf);
++
+ /*! @} */
+ 
+ #endif /* SLP_BUFFER_H_INCLUDED */
+diff -ur openslp-2.0.0.orig/slpd/slpd_process.c openslp-2.0.0/slpd/slpd_process.c
+--- openslp-2.0.0.orig/slpd/slpd_process.c	2012-12-12 09:38:54.000000000 -0800
++++ openslp-2.0.0/slpd/slpd_process.c	2019-11-26 21:55:10.000000000 -0800
+@@ -30,6 +30,13 @@
+  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+  *-------------------------------------------------------------------------*/
+ 
++/* Copyright (c) 2019 VMware, Inc.
++ * SPDX-License-Identifier: BSD-3-Clause
++ * This file is provided under the BSD-3-Clause license.
++ * See COPYING file for more details and other copyrights
++ * that may apply.
++ */
++
+ /** Processes incoming SLP messages.
+  *
+  * @file       slpd_process.c
+@@ -514,13 +521,27 @@
+    {
+       for (i = 0; i < db->urlcount; i++)
+       {
+-         /* urlentry is the url from the db result */
+          urlentry = db->urlarray[i];
++         if (urlentry->opaque != NULL) {
++            const int64_t newsize = size + urlentry->opaquelen;
++            if (urlentry->opaquelen <= 0 || newsize > INT_MAX)
++            {
++               SLPDLog("Invalid opaquelen %d or sizeo of opaque url is too big, size=%d\n",
++                       urlentry->opaquelen, size);
++               errorcode = SLP_ERROR_PARSE_ERROR;
++               goto FINISHED;
++            }
++            size +=  urlentry->opaquelen;
++         }
++         else
++         {
++            /* urlentry is the url from the db result */
++            size += urlentry->urllen + 6; /*  1 byte for reserved  */
++                                          /*  2 bytes for lifetime */
++                                          /*  2 bytes for urllen   */
++                                          /*  1 byte for authcount */
++          }
+ 
+-         size += urlentry->urllen + 6; /*  1 byte for reserved  */
+-                                       /*  2 bytes for lifetime */
+-                                       /*  2 bytes for urllen   */
+-                                       /*  1 byte for authcount */
+ #ifdef ENABLE_SLPv2_SECURITY
+          /* make room to include the authblock that was asked for */
+          if (G_SlpdProperty.securityEnabled
+@@ -594,7 +615,7 @@
+          urlentry = db->urlarray[i];
+ 
+ #ifdef ENABLE_SLPv1
+-         if (urlentry->opaque == 0)
++         if (urlentry->opaque == NULL)
+          {
+             /* url-entry reserved */
+             *result->curpos++ = 0;
+@@ -606,8 +627,18 @@
+             PutUINT16(&result->curpos, urlentry->urllen);
+ 
+             /* url-entry url */
+-            memcpy(result->curpos, urlentry->url, urlentry->urllen);
+-            result->curpos += urlentry->urllen;
++            if (RemainingBufferSpace(result) >= urlentry->urllen)
++            {
++               memcpy(result->curpos, urlentry->url, urlentry->urllen);
++               result->curpos = result->curpos + urlentry->urllen;
++            }
++            else
++            {
++                SLPDLog("Url too big (ask: %d have %" PRId64 "), failing request\n",
++                        urlentry->opaquelen, (int64_t) RemainingBufferSpace(result));
++                errorcode = SLP_ERROR_PARSE_ERROR;
++                goto FINISHED;
++            }
+ 
+             /* url-entry auths */
+             *result->curpos++ = 0;
+@@ -621,8 +652,18 @@
+ 
+             /* TRICKY: Fix up the lifetime. */
+             TO_UINT16(urlentry->opaque + 1, urlentry->lifetime);
+-            memcpy(result->curpos, urlentry->opaque, urlentry->opaquelen);
+-            result->curpos += urlentry->opaquelen;
++            if (RemainingBufferSpace(result) >= urlentry->opaquelen)
++            {
++               memcpy(result->curpos, urlentry->opaque, urlentry->opaquelen);
++               result->curpos = result->curpos + urlentry->opaquelen;
++             }
++             else
++             {
++               SLPDLog("Opaque Url too big (ask: %d have %" PRId64 "), failing request\n",
++                       urlentry->opaquelen, (int64_t) RemainingBufferSpace(result));
++               errorcode = SLP_ERROR_PARSE_ERROR;
++               goto FINISHED;
++             }
+          }
+       }
+    }
diff --git a/nixpkgs/pkgs/development/libraries/openslp/default.nix b/nixpkgs/pkgs/development/libraries/openslp/default.nix
new file mode 100644
index 000000000000..4fa03c5e7c1b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openslp/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, fetchpatch }:
+
+stdenv.mkDerivation {
+  name = "openslp-2.0.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/openslp/2.0.0/2.0.0/openslp-2.0.0.tar.gz";
+    sha256 = "16splwmqp0400w56297fkipaq9vlbhv7hapap8z09gp5m2i3fhwj";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "openslp-2.0.0-null-pointer-deref.patch";
+      url = "https://src.fedoraproject.org/cgit/rpms/openslp.git/plain/openslp-2.0.0-null-pointer-deref.patch";
+      sha256 = "186f3rj3z2lf5h1lpbhqk0szj2a9far1p3mjqg6422f29yjfnz6a";
+    })
+    (fetchpatch {
+      name = "openslp-2.0.0-CVE-2016-7567.patch";
+      url = "https://src.fedoraproject.org/cgit/rpms/openslp.git/plain/openslp-2.0.0-cve-2016-7567.patch";
+      sha256 = "0zp61axx93b7nrbsyhn2x4dnw7n9y6g4rys21hyqxk4khrnc2yr9";
+    })
+    ./CVE-2016-4912.patch
+    ./CVE-2019-5544.patch
+  ];
+
+  meta = with lib; {
+    homepage = "http://www.openslp.org/";
+    description = "An open-source implementation of the IETF Service Location Protocol";
+    maintainers = with maintainers; [ ttuegel ];
+    license = licenses.bsd3;
+    platforms = platforms.all;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/openssl/1.0.2/darwin64-arm64.patch b/nixpkgs/pkgs/development/libraries/openssl/1.0.2/darwin64-arm64.patch
new file mode 100644
index 000000000000..5ecfb4175569
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openssl/1.0.2/darwin64-arm64.patch
@@ -0,0 +1,12 @@
+diff --git a/Configure b/Configure
+index 494e0b3..0b448aa 100755
+--- a/Configure
++++ b/Configure
+@@ -652,6 +652,8 @@ my %table=(
+ "darwin64-x86_64-cc","cc:-arch x86_64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+ "debug-darwin64-x86_64-cc","cc:-arch x86_64 -ggdb -g2 -O0 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:".eval{my $asm=$x86_64_asm;$asm=~s/rc4\-[^:]+//;$asm}.":macosx:dlfcn:darwin-shared:-fPIC -fno-common:-arch x86_64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+ "debug-darwin-ppc-cc","cc:-DBN_DEBUG -DREF_CHECK -DCONF_DEBUG -DCRYPTO_MDEBUG -DB_ENDIAN -g -Wall -O::-D_REENTRANT:MACOSX::BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${ppc32_asm}:osx32:dlfcn:darwin-shared:-fPIC:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
++"darwin64-arm64-cc","cc:-arch arm64 -O3 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch arm64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
++"debug-darwin64-arm64-cc","cc:-arch arm64 -ggdb -g2 -O0 -DL_ENDIAN -Wall::-D_REENTRANT:MACOSX:-Wl,-search_paths_first%:SIXTY_FOUR_BIT_LONG RC4_CHUNK DES_INT DES_UNROLL:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-arch arm64 -dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
+ # iPhoneOS/iOS
+ "iphoneos-cross","llvm-gcc:-O3 -isysroot \$(CROSS_TOP)/SDKs/\$(CROSS_SDK) -fomit-frame-pointer -fno-common::-D_REENTRANT:iOS:-Wl,-search_paths_first%:BN_LLONG RC4_CHAR RC4_CHUNK DES_UNROLL BF_PTR:${no_asm}:dlfcn:darwin-shared:-fPIC -fno-common:-dynamiclib:.\$(SHLIB_MAJOR).\$(SHLIB_MINOR).dylib",
diff --git a/nixpkgs/pkgs/development/libraries/openssl/1.0.2/nix-ssl-cert-file.patch b/nixpkgs/pkgs/development/libraries/openssl/1.0.2/nix-ssl-cert-file.patch
new file mode 100644
index 000000000000..5765409fdd57
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openssl/1.0.2/nix-ssl-cert-file.patch
@@ -0,0 +1,16 @@
+diff --git a/crypto/x509/by_file.c b/crypto/x509/by_file.c
+index e6d0e6e1a6..b89456fd87 100644
+--- a/crypto/x509/by_file.c
++++ b/crypto/x509/by_file.c
+@@ -97,7 +97,10 @@ static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp,
+     switch (cmd) {
+     case X509_L_FILE_LOAD:
+         if (argl == X509_FILETYPE_DEFAULT) {
+-            file = ossl_safe_getenv(X509_get_default_cert_file_env());
++            file = ossl_safe_getenv("NIX_SSL_CERT_FILE");
++
++            if (!file)
++                file = ossl_safe_getenv(X509_get_default_cert_file_env());
+ 
+             if (file)
+                 ok = (X509_load_cert_crl_file(ctx, file,
diff --git a/nixpkgs/pkgs/development/libraries/openssl/1.0.2/use-etc-ssl-certs-darwin.patch b/nixpkgs/pkgs/development/libraries/openssl/1.0.2/use-etc-ssl-certs-darwin.patch
new file mode 100644
index 000000000000..3d9ee7e6a822
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openssl/1.0.2/use-etc-ssl-certs-darwin.patch
@@ -0,0 +1,13 @@
+diff -ru -x '*~' openssl-1.0.1r-orig/crypto/cryptlib.h openssl-1.0.1r/crypto/cryptlib.h
+--- openssl-1.0.1r-orig/crypto/cryptlib.h	2016-01-28 14:38:30.000000000 +0100
++++ openssl-1.0.1r/crypto/cryptlib.h	2016-02-03 12:54:29.193165176 +0100
+@@ -81,8 +81,8 @@
+ 
+ # ifndef OPENSSL_SYS_VMS
+ #  define X509_CERT_AREA          OPENSSLDIR
+ #  define X509_CERT_DIR           OPENSSLDIR "/certs"
+-#  define X509_CERT_FILE          OPENSSLDIR "/cert.pem"
++#  define X509_CERT_FILE          "/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
+ #  define X509_PRIVATE_DIR        OPENSSLDIR "/private"
+ # else
+ #  define X509_CERT_AREA          "SSLROOT:[000000]"
diff --git a/nixpkgs/pkgs/development/libraries/openssl/1.0.2/use-etc-ssl-certs.patch b/nixpkgs/pkgs/development/libraries/openssl/1.0.2/use-etc-ssl-certs.patch
new file mode 100644
index 000000000000..813c6bdf44ab
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openssl/1.0.2/use-etc-ssl-certs.patch
@@ -0,0 +1,13 @@
+diff -ru -x '*~' openssl-1.0.1r-orig/crypto/cryptlib.h openssl-1.0.1r/crypto/cryptlib.h
+--- openssl-1.0.1r-orig/crypto/cryptlib.h	2016-01-28 14:38:30.000000000 +0100
++++ openssl-1.0.1r/crypto/cryptlib.h	2016-02-03 12:54:29.193165176 +0100
+@@ -81,8 +81,8 @@
+ 
+ # ifndef OPENSSL_SYS_VMS
+ #  define X509_CERT_AREA          OPENSSLDIR
+ #  define X509_CERT_DIR           OPENSSLDIR "/certs"
+-#  define X509_CERT_FILE          OPENSSLDIR "/cert.pem"
++#  define X509_CERT_FILE          "/etc/ssl/certs/ca-certificates.crt"
+ #  define X509_PRIVATE_DIR        OPENSSLDIR "/private"
+ # else
+ #  define X509_CERT_AREA          "SSLROOT:[000000]"
diff --git a/nixpkgs/pkgs/development/libraries/openssl/1.1/macos-yosemite-compat.patch b/nixpkgs/pkgs/development/libraries/openssl/1.1/macos-yosemite-compat.patch
new file mode 100644
index 000000000000..b0e37e325611
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openssl/1.1/macos-yosemite-compat.patch
@@ -0,0 +1,56 @@
+From cef404f1e7a598166cbc2fd2e0048f7e2d752ad5 Mon Sep 17 00:00:00 2001
+From: David Carlier <devnexen@gmail.com>
+Date: Tue, 24 Aug 2021 22:40:14 +0100
+Subject: [PATCH] Darwin platform allows to build on releases before
+ Yosemite/ios 8.
+
+issue #16407 #16408
+---
+ crypto/rand/rand_unix.c |  5 +----
+ include/crypto/rand.h   | 10 ++++++++++
+ 2 files changed, 11 insertions(+), 4 deletions(-)
+
+diff --git a/crypto/rand/rand_unix.c b/crypto/rand/rand_unix.c
+index 43f1069d151d..0f4525106af7 100644
+--- a/crypto/rand/rand_unix.c
++++ b/crypto/rand/rand_unix.c
+@@ -34,9 +34,6 @@
+ #if defined(__OpenBSD__)
+ # include <sys/param.h>
+ #endif
+-#if defined(__APPLE__)
+-# include <CommonCrypto/CommonRandom.h>
+-#endif
+ 
+ #if defined(OPENSSL_SYS_UNIX) || defined(__DJGPP__)
+ # include <sys/types.h>
+@@ -381,7 +378,7 @@ static ssize_t syscall_random(void *buf, size_t buflen)
+         if (errno != ENOSYS)
+             return -1;
+     }
+-#  elif defined(__APPLE__)
++#  elif defined(OPENSSL_APPLE_CRYPTO_RANDOM)
+     if (CCRandomGenerateBytes(buf, buflen) == kCCSuccess)
+ 	    return (ssize_t)buflen;
+ 
+diff --git a/include/crypto/rand.h b/include/crypto/rand.h
+index 5350d3a93119..674f840fd13c 100644
+--- a/include/crypto/rand.h
++++ b/include/crypto/rand.h
+@@ -20,6 +20,16 @@
+ 
+ # include <openssl/rand.h>
+ 
++# if defined(__APPLE__) && !defined(OPENSSL_NO_APPLE_CRYPTO_RANDOM)
++#  include <Availability.h>
++#  if (defined(__MAC_OS_X_VERSION_MIN_REQUIRED) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000) || \
++     (defined(__IPHONE_OS_VERSION_MIN_REQUIRED) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 80000)
++#   define OPENSSL_APPLE_CRYPTO_RANDOM 1
++#   include <CommonCrypto/CommonCryptoError.h>
++#   include <CommonCrypto/CommonRandom.h>
++#  endif
++# endif
++
+ /* forward declaration */
+ typedef struct rand_pool_st RAND_POOL;
+ 
diff --git a/nixpkgs/pkgs/development/libraries/openssl/1.1/nix-ssl-cert-file.patch b/nixpkgs/pkgs/development/libraries/openssl/1.1/nix-ssl-cert-file.patch
new file mode 100644
index 000000000000..9e871cfb1d31
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openssl/1.1/nix-ssl-cert-file.patch
@@ -0,0 +1,15 @@
+diff --git a/crypto/x509/by_file.c b/crypto/x509/by_file.c
+index 244512c935..f0b70d7ea1 100644
+--- a/crypto/x509/by_file.c
++++ b/crypto/x509/by_file.c
+@@ -46,7 +46,9 @@ static int by_file_ctrl(X509_LOOKUP *ctx, int cmd, const char *argp,
+     switch (cmd) {
+     case X509_L_FILE_LOAD:
+         if (argl == X509_FILETYPE_DEFAULT) {
+-            file = ossl_safe_getenv(X509_get_default_cert_file_env());
++            file = ossl_safe_getenv("NIX_SSL_CERT_FILE");
++            if (!file)
++                file = ossl_safe_getenv(X509_get_default_cert_file_env());
+             if (file)
+                 ok = (X509_load_cert_crl_file(ctx, file,
+                                               X509_FILETYPE_PEM) != 0);
diff --git a/nixpkgs/pkgs/development/libraries/openssl/1.1/use-etc-ssl-certs-darwin.patch b/nixpkgs/pkgs/development/libraries/openssl/1.1/use-etc-ssl-certs-darwin.patch
new file mode 100644
index 000000000000..2c98ccfa7ed0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openssl/1.1/use-etc-ssl-certs-darwin.patch
@@ -0,0 +1,13 @@
+diff --git a/include/internal/cryptlib.h b/include/internal/cryptlib.h
+index 329ef62..9a8df64 100644
+--- a/include/internal/cryptlib.h
++++ b/include/internal/cryptlib.h
+@@ -56,7 +56,7 @@ DEFINE_LHASH_OF(MEM);
+ # ifndef OPENSSL_SYS_VMS
+ #  define X509_CERT_AREA          OPENSSLDIR
+ #  define X509_CERT_DIR           OPENSSLDIR "/certs"
+-#  define X509_CERT_FILE          OPENSSLDIR "/cert.pem"
++#  define X509_CERT_FILE          "/nix/var/nix/profiles/default/etc/ssl/certs/ca-bundle.crt"
+ #  define X509_PRIVATE_DIR        OPENSSLDIR "/private"
+ #  define CTLOG_FILE              OPENSSLDIR "/ct_log_list.cnf"
+ # else
diff --git a/nixpkgs/pkgs/development/libraries/openssl/1.1/use-etc-ssl-certs.patch b/nixpkgs/pkgs/development/libraries/openssl/1.1/use-etc-ssl-certs.patch
new file mode 100644
index 000000000000..67d199681f96
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openssl/1.1/use-etc-ssl-certs.patch
@@ -0,0 +1,13 @@
+diff --git a/include/internal/cryptlib.h b/include/internal/cryptlib.h
+index 329ef62..9a8df64 100644
+--- a/include/internal/cryptlib.h
++++ b/include/internal/cryptlib.h
+@@ -56,7 +56,7 @@ DEFINE_LHASH_OF(MEM);
+ # ifndef OPENSSL_SYS_VMS
+ #  define X509_CERT_AREA          OPENSSLDIR
+ #  define X509_CERT_DIR           OPENSSLDIR "/certs"
+-#  define X509_CERT_FILE          OPENSSLDIR "/cert.pem"
++#  define X509_CERT_FILE          "/etc/ssl/certs/ca-certificates.crt"
+ #  define X509_PRIVATE_DIR        OPENSSLDIR "/private"
+ #  define CTLOG_FILE              OPENSSLDIR "/ct_log_list.cnf"
+ # else
diff --git a/nixpkgs/pkgs/development/libraries/openssl/chacha.nix b/nixpkgs/pkgs/development/libraries/openssl/chacha.nix
new file mode 100644
index 000000000000..bae3e53f441f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openssl/chacha.nix
@@ -0,0 +1,82 @@
+{ lib, stdenv, fetchFromGitHub, perl, zlib
+, withCryptodev ? false, cryptodev
+}:
+
+with lib;
+stdenv.mkDerivation {
+  pname = "openssl-chacha";
+  version = "2016-08-22";
+
+  src = fetchFromGitHub {
+    owner = "PeterMosmans";
+    repo = "openssl";
+    rev = "293717318e903b95f4d7e83a98a087282f37efc3";
+    sha256 = "134j3anjnj2q99xsd8d47bwvjp73qkdsimdd9riyjxa3hd8ysr00";
+  };
+
+  outputs = [ "bin" "dev" "out" "man" ];
+  setOutputFlags = false;
+
+  nativeBuildInputs = [ perl zlib ];
+  buildInputs = lib.optional withCryptodev cryptodev;
+
+  configureScript = "./config";
+
+  configureFlags = [
+    "zlib"
+    "shared"
+    "experimental-jpake"
+    "enable-md2"
+    "enable-rc5"
+    "enable-rfc3779"
+    "enable-gost"
+    "--libdir=lib"
+    "--openssldir=etc/ssl"
+  ] ++ lib.optionals withCryptodev [
+    "-DHAVE_CRYPTODEV"
+    "-DUSE_CRYPTODEV_DIGESTS"
+  ];
+
+  makeFlags = [
+    "MANDIR=$(man)/share/man"
+  ];
+
+  # Parallel building is broken in OpenSSL.
+  enableParallelBuilding = false;
+
+  postInstall = ''
+    # If we're building dynamic libraries, then don't install static
+    # libraries.
+    if [ -n "$(echo $out/lib/*.so $out/lib/*.dylib $out/lib/*.dll)" ]; then
+        rm "$out/lib/"*.a
+    fi
+
+    mkdir -p $bin
+    mv $out/bin $bin/
+
+    mkdir $dev
+    mv $out/include $dev/
+
+    # remove dependency on Perl at runtime
+    rm -r $out/etc/ssl/misc
+
+    rmdir $out/etc/ssl/{certs,private}
+  '';
+
+  postFixup = ''
+    # Check to make sure we don't depend on perl
+    if grep -r '${perl}' $out; then
+      echo "Found an erroneous dependency on perl ^^^" >&2
+      exit 1
+    fi
+  '';
+
+  meta = {
+    homepage = "https://www.openssl.org/";
+    description = "A cryptographic library that implements the SSL and TLS protocols";
+    platforms = [ "x86_64-linux" ];
+    maintainers = [ lib.maintainers.cstrahan ];
+    license = licenses.openssl;
+    priority = 10; # resolves collision with ‘man-pages’
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openssl/default.nix b/nixpkgs/pkgs/development/libraries/openssl/default.nix
new file mode 100644
index 000000000000..2d3f1c313caa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openssl/default.nix
@@ -0,0 +1,208 @@
+{ lib, stdenv, fetchurl, buildPackages, perl, coreutils
+, withCryptodev ? false, cryptodev
+, enableSSL2 ? false
+, enableSSL3 ? false
+, static ? stdenv.hostPlatform.isStatic
+# Used to avoid cross compiling perl, for example, in darwin bootstrap tools.
+# This will cause c_rehash to refer to perl via the environment, but otherwise
+# will produce a perfectly functional openssl binary and library.
+, withPerl ? stdenv.hostPlatform == stdenv.buildPlatform
+}:
+
+assert (
+  lib.assertMsg (!withPerl -> stdenv.hostPlatform != stdenv.buildPlatform)
+  "withPerl should not be disabled unless cross compiling"
+);
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+with lib;
+
+let
+  common = { version, sha256, patches ? [], withDocs ? false, extraMeta ? {} }:
+   stdenv.mkDerivation rec {
+    pname = "openssl";
+    inherit version;
+
+    src = fetchurl {
+      url = "https://www.openssl.org/source/${pname}-${version}.tar.gz";
+      inherit sha256;
+    };
+
+    inherit patches;
+
+    postPatch = ''
+      patchShebangs Configure
+    '' + optionalString (versionOlder version "1.1.0") ''
+      patchShebangs test/*
+      for a in test/t* ; do
+        substituteInPlace "$a" \
+          --replace /bin/rm rm
+      done
+    ''
+    # config is a configure script which is not installed.
+    + optionalString (versionAtLeast version "1.1.1") ''
+      substituteInPlace config --replace '/usr/bin/env' '${buildPackages.coreutils}/bin/env'
+    '' + optionalString (versionAtLeast version "1.1.0" && stdenv.hostPlatform.isMusl) ''
+      substituteInPlace crypto/async/arch/async_posix.h \
+        --replace '!defined(__ANDROID__) && !defined(__OpenBSD__)' \
+                  '!defined(__ANDROID__) && !defined(__OpenBSD__) && 0'
+    '';
+
+    outputs = [ "bin" "dev" "out" "man" ] ++ optional withDocs "doc";
+    setOutputFlags = false;
+    separateDebugInfo =
+      !stdenv.hostPlatform.isDarwin &&
+      !(stdenv.hostPlatform.useLLVM or false) &&
+      stdenv.cc.isGNU;
+
+    nativeBuildInputs = [ perl ];
+    buildInputs = lib.optional withCryptodev cryptodev
+      # perl is included to allow the interpreter path fixup hook to set the
+      # correct interpreter in c_rehash.
+      ++ lib.optional withPerl perl;
+
+    # TODO(@Ericson2314): Improve with mass rebuild
+    configurePlatforms = [];
+    configureScript = {
+        armv5tel-linux = "./Configure linux-armv4 -march=armv5te";
+        armv6l-linux = "./Configure linux-armv4 -march=armv6";
+        armv7l-linux = "./Configure linux-armv4 -march=armv7-a";
+        x86_64-darwin  = "./Configure darwin64-x86_64-cc";
+        aarch64-darwin = "./Configure darwin64-arm64-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"
+        else if stdenv.hostPlatform.isBSD && stdenv.hostPlatform.isx86_64
+          then "./Configure BSD-x86_64"
+        else if stdenv.hostPlatform.isBSD && stdenv.hostPlatform.isx86_32
+          then "./Configure BSD-x86" + lib.optionalString (stdenv.hostPlatform.parsed.kernel.execFormat.name == "elf") "-elf"
+        else if stdenv.hostPlatform.isBSD
+          then "./Configure BSD-generic${toString stdenv.hostPlatform.parsed.cpu.bits}"
+        else if stdenv.hostPlatform.isMinGW
+          then "./Configure mingw${optionalString
+                                     (stdenv.hostPlatform.parsed.cpu.bits != 32)
+                                     (toString stdenv.hostPlatform.parsed.cpu.bits)}"
+        else if stdenv.hostPlatform.isLinux
+          then "./Configure linux-generic${toString stdenv.hostPlatform.parsed.cpu.bits}"
+        else if stdenv.hostPlatform.isiOS
+          then "./Configure ios${toString stdenv.hostPlatform.parsed.cpu.bits}-cross"
+        else
+          throw "Not sure what configuration to use for ${stdenv.hostPlatform.config}"
+      );
+
+    # OpenSSL doesn't like the `--enable-static` / `--disable-shared` flags.
+    dontAddStaticConfigureFlags = true;
+    configureFlags = [
+      "shared" # "shared" builds both shared and static libraries
+      "--libdir=lib"
+      "--openssldir=etc/ssl"
+    ] ++ lib.optionals withCryptodev [
+      "-DHAVE_CRYPTODEV"
+      "-DUSE_CRYPTODEV_DIGESTS"
+    ] ++ lib.optional enableSSL2 "enable-ssl2"
+      ++ lib.optional enableSSL3 "enable-ssl3"
+      ++ lib.optional (versionAtLeast version "1.1.0" && stdenv.hostPlatform.isAarch64) "no-afalgeng"
+      # OpenSSL needs a specific `no-shared` configure flag.
+      # See https://wiki.openssl.org/index.php/Compilation_and_Installation#Configure_Options
+      # for a comprehensive list of configuration options.
+      ++ lib.optional (versionAtLeast version "1.1.0" && static) "no-shared";
+
+    makeFlags = [
+      "MANDIR=$(man)/share/man"
+      # This avoids conflicts between man pages of openssl subcommands (for
+      # example 'ts' and 'err') man pages and their equivalent top-level
+      # command in other packages (respectively man-pages and moreutils).
+      # This is done in ubuntu and archlinux, and possiibly many other distros.
+      "MANSUFFIX=ssl"
+    ];
+
+    enableParallelBuilding = true;
+
+    postInstall =
+    lib.optionalString (!static) ''
+      # If we're building dynamic libraries, then don't install static
+      # libraries.
+      if [ -n "$(echo $out/lib/*.so $out/lib/*.dylib $out/lib/*.dll)" ]; then
+          rm "$out/lib/"*.a
+      fi
+    '' + lib.optionalString (!stdenv.hostPlatform.isWindows)
+      # Fix bin/c_rehash's perl interpreter line
+      #
+      # - openssl 1_0_2: embeds a reference to buildPackages.perl
+      # - openssl 1_1:   emits "#!/usr/bin/env perl"
+      #
+      # In the case of openssl_1_0_2, reset the invalid reference and let the
+      # interpreter hook take care of it.
+      #
+      # In both cases, if withPerl = false, the intepreter line is expected be
+      # "#!/usr/bin/env perl"
+    ''
+      substituteInPlace $out/bin/c_rehash --replace ${buildPackages.perl}/bin/perl "/usr/bin/env perl"
+    '' + ''
+      mkdir -p $bin
+      mv $out/bin $bin/bin
+
+      mkdir $dev
+      mv $out/include $dev/
+
+      # remove dependency on Perl at runtime
+      rm -r $out/etc/ssl/misc
+
+      rmdir $out/etc/ssl/{certs,private}
+    '';
+
+    postFixup = 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
+        exit 1
+      fi
+    '';
+
+    meta = with lib; {
+      homepage = "https://www.openssl.org/";
+      description = "A cryptographic library that implements the SSL and TLS protocols";
+      license = licenses.openssl;
+      platforms = platforms.all;
+      maintainers = [ maintainers.peti ];
+    } // extraMeta;
+  };
+
+in {
+
+  openssl_1_0_2 = common {
+    version = "1.0.2u";
+    sha256 = "ecd0c6ffb493dd06707d38b14bb4d8c2288bb7033735606569d8f90f89669d16";
+    patches = [
+      ./1.0.2/nix-ssl-cert-file.patch
+
+      (if stdenv.hostPlatform.isDarwin
+       then ./1.0.2/use-etc-ssl-certs-darwin.patch
+       else ./1.0.2/use-etc-ssl-certs.patch)
+    ] ++ lib.optionals (stdenv.hostPlatform.system == "aarch64-darwin") [
+      ./1.0.2/darwin64-arm64.patch
+    ];
+    extraMeta.knownVulnerabilities = [ "Support for OpenSSL 1.0.2 ended with 2019." ];
+  };
+
+  openssl_1_1 = common {
+    version = "1.1.1l";
+    sha256 = "sha256-C3o+XlnDSCf+DDp0t+yLrvMCuY+oAIjX+RU6oW+na9E=";
+    patches = [
+      ./1.1/nix-ssl-cert-file.patch
+
+      (if stdenv.hostPlatform.isDarwin
+       then ./1.1/use-etc-ssl-certs-darwin.patch
+       else ./1.1/use-etc-ssl-certs.patch)
+    ] ++ lib.optionals (stdenv.isDarwin) [
+      ./1.1/macos-yosemite-compat.patch
+    ];
+    withDocs = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opensubdiv/default.nix b/nixpkgs/pkgs/development/libraries/opensubdiv/default.nix
new file mode 100644
index 000000000000..83eb77b603c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opensubdiv/default.nix
@@ -0,0 +1,53 @@
+{ config, lib, stdenv, fetchFromGitHub, cmake, pkg-config, xorg, libGLU
+, libGL, glew, ocl-icd, python3
+, cudaSupport ? config.cudaSupport or false, cudatoolkit
+, darwin
+}:
+
+stdenv.mkDerivation rec {
+  pname = "opensubdiv";
+  version = "3.4.4";
+
+  src = fetchFromGitHub {
+    owner = "PixarAnimationStudios";
+    repo = "OpenSubdiv";
+    rev = "v${lib.replaceChars ["."] ["_"] version}";
+    sha256 = "sha256-ejxQ5mGIIrEa/rAfkTrRbIRerrAvEPoWn7e0lIqS1JQ=";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs =
+    [ libGLU libGL python3
+      # FIXME: these are not actually needed, but the configure script wants them.
+      glew xorg.libX11 xorg.libXrandr xorg.libXxf86vm xorg.libXcursor
+      xorg.libXinerama xorg.libXi
+    ]
+    ++ lib.optional (!stdenv.isDarwin) ocl-icd
+    ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [OpenCL Cocoa CoreVideo IOKit AppKit AGL ])
+    ++ lib.optional cudaSupport cudatoolkit;
+
+  cmakeFlags =
+    [ "-DNO_TUTORIALS=1"
+      "-DNO_REGRESSION=1"
+      "-DNO_EXAMPLES=1"
+      "-DNO_METAL=1" # don’t have metal in apple sdk
+    ] ++ lib.optionals (!stdenv.isDarwin) [
+      "-DGLEW_INCLUDE_DIR=${glew.dev}/include"
+      "-DGLEW_LIBRARY=${glew.dev}/lib"
+    ] ++ lib.optionals cudaSupport [
+      "-DOSD_CUDA_NVCC_FLAGS=--gpu-architecture=compute_30"
+      "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc"
+    ];
+
+  postInstall = "rm $out/lib/*.a";
+
+  meta = {
+    description = "An Open-Source subdivision surface library";
+    homepage = "http://graphics.pixar.com/opensubdiv";
+    platforms = lib.platforms.unix;
+    maintainers = [ lib.maintainers.eelco ];
+    license = lib.licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/opentracing-cpp/default.nix b/nixpkgs/pkgs/development/libraries/opentracing-cpp/default.nix
new file mode 100644
index 000000000000..9c99ee6027dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/opentracing-cpp/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+stdenv.mkDerivation rec {
+  pname = "opentracing-cpp";
+  version = "1.5.1";
+  src = fetchFromGitHub {
+    owner = "opentracing";
+    repo = "opentracing-cpp";
+    rev = "v${version}";
+    sha256 = "04kw19g8qrv3kd40va3sqbfish7kfczkdpxdwraifk9950wfs3gx";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = {
+    description = "C++ implementation of the OpenTracing API";
+    homepage = "https://opentracing.io";
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ rob ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/openvdb/default.nix b/nixpkgs/pkgs/development/libraries/openvdb/default.nix
new file mode 100644
index 000000000000..655d664d8fa6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openvdb/default.nix
@@ -0,0 +1,50 @@
+{ lib, stdenv, fetchFromGitHub, openexr, boost, jemalloc, c-blosc, ilmbase, tbb }:
+
+stdenv.mkDerivation rec
+{
+  pname = "openvdb";
+  version = "7.0.0";
+
+  src = fetchFromGitHub {
+    owner = "dreamworksanimation";
+    repo = "openvdb";
+    rev = "v${version}";
+    sha256 = "0hhs50f05hkgj1wni53cwbsx2bhn1aam6z65j133356gbid2carl";
+  };
+
+  outputs = [ "out" ];
+
+  buildInputs = [ openexr boost tbb jemalloc c-blosc ilmbase ];
+
+  setSourceRoot = ''
+    sourceRoot=$(echo */openvdb)
+  '';
+
+  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)" ];
+
+  NIX_CFLAGS_COMPILE="-I${openexr.dev}/include/OpenEXR -I${ilmbase.dev}/include/OpenEXR/";
+  NIX_LDFLAGS="-lboost_iostreams";
+
+  meta = with lib; {
+    description = "An open framework for voxel";
+    homepage = "https://www.openvdb.org";
+    maintainers = [ maintainers.guibou ];
+    platforms = platforms.linux;
+    license = licenses.mpl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openvino/default.nix b/nixpkgs/pkgs/development/libraries/openvino/default.nix
new file mode 100644
index 000000000000..b4e487887999
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openvino/default.nix
@@ -0,0 +1,121 @@
+{ lib
+, addOpenGLRunpath
+, autoPatchelfHook
+, stdenv
+, fetchFromGitHub
+, cmake
+, git
+, protobuf
+, tbb
+, opencv
+, unzip
+, shellcheck
+, python
+, enablePython ? false
+}:
+
+let
+
+  onnx_src = fetchFromGitHub {
+    owner = "onnx";
+    repo = "onnx";
+    rev = "v1.8.1";
+    sha256 = "+1zNnZ4lAyVYRptfk0PV7koIX9FqcfD1Ah33qj/G2rA=";
+  };
+
+in
+stdenv.mkDerivation rec {
+  pname = "openvino";
+  version = "2021.2";
+
+  src = fetchFromGitHub {
+    owner = "openvinotoolkit";
+    repo = "openvino";
+    rev = version;
+    sha256 = "pv4WTfY1U5GbA9Yj07UOLQifvVH3oDfWptxxYW5IwVQ=";
+    fetchSubmodules = true;
+  };
+
+  dontUseCmakeBuildDir = true;
+
+  cmakeFlags = [
+    "-DNGRAPH_USE_SYSTEM_PROTOBUF:BOOL=ON"
+    "-DFETCHCONTENT_FULLY_DISCONNECTED:BOOL=ON"
+    "-DFETCHCONTENT_SOURCE_DIR_EXT_ONNX:STRING=${onnx_src}"
+    "-DENABLE_VPU:BOOL=OFF"
+    "-DTBB_DIR:STRING=${tbb}"
+    "-DENABLE_OPENCV:BOOL=ON"
+    "-DOPENCV:STRING=${opencv}"
+    "-DENABLE_GNA:BOOL=OFF"
+    "-DENABLE_SPEECH_DEMO:BOOL=OFF"
+    "-DBUILD_TESTING:BOOL=OFF"
+    "-DENABLE_CLDNN_TESTS:BOOL=OFF"
+    "-DNGRAPH_INTERPRETER_ENABLE:BOOL=ON"
+    "-DNGRAPH_TEST_UTIL_ENABLE:BOOL=OFF"
+    "-DNGRAPH_UNIT_TEST_ENABLE:BOOL=OFF"
+    "-DENABLE_SAMPLES:BOOL=OFF"
+    "-DENABLE_CPPLINT:BOOL=OFF"
+  ] ++ lib.optional enablePython [
+    "-DENABLE_PYTHON:BOOL=ON"
+  ];
+
+  preConfigure = ''
+    # To make install openvino inside /lib instead of /python
+    substituteInPlace inference-engine/ie_bridges/python/CMakeLists.txt \
+      --replace 'DESTINATION python/''${PYTHON_VERSION}/openvino' 'DESTINATION lib/''${PYTHON_VERSION}/site-packages/openvino' \
+      --replace 'DESTINATION python/''${PYTHON_VERSION}' 'DESTINATION lib/''${PYTHON_VERSION}/site-packages/openvino'
+    substituteInPlace inference-engine/ie_bridges/python/src/openvino/inference_engine/CMakeLists.txt \
+      --replace 'python/''${PYTHON_VERSION}/openvino/inference_engine' 'lib/''${PYTHON_VERSION}/site-packages/openvino/inference_engine'
+
+    # Used to download OpenCV based on Linux Distro and make it use system OpenCV
+    substituteInPlace inference-engine/cmake/dependencies.cmake \
+        --replace 'include(linux_name)' ' ' \
+        --replace 'if (ENABLE_OPENCV)' 'if (ENABLE_OPENCV AND NOT DEFINED OPENCV)'
+
+    cmakeDir=$PWD
+    mkdir ../build
+    cd ../build
+  '';
+
+  autoPatchelfIgnoreMissingDeps = true;
+
+  nativeBuildInputs = [
+    cmake
+    autoPatchelfHook
+    addOpenGLRunpath
+    unzip
+  ];
+
+  buildInputs = [
+    git
+    protobuf
+    opencv
+    python
+    tbb
+    shellcheck
+  ] ++ lib.optional enablePython (with python.pkgs; [
+    cython
+    pybind11
+  ]);
+
+  postFixup = ''
+    # Link to OpenCL
+    find $out -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do
+      addOpenGLRunpath "$lib"
+    done
+  '';
+
+  meta = with lib; {
+    description = "OpenVINO™ Toolkit repository";
+    longDescription = ''
+      This toolkit allows developers to deploy pre-trained deep learning models through a high-level C++ Inference Engine API integrated with application logic.
+
+      This open source version includes several components: namely Model Optimizer, nGraph and Inference Engine, as well as CPU, GPU, MYRIAD,
+      multi device and heterogeneous plugins to accelerate deep learning inferencing on Intel® CPUs and Intel® Processor Graphics.
+      It supports pre-trained models from the Open Model Zoo, along with 100+ open source and public models in popular formats such as Caffe*, TensorFlow*, MXNet* and ONNX*.
+    '';
+    homepage = "https://docs.openvinotoolkit.org/";
+    license = with licenses; [ asl20 ];
+    maintainers = with maintainers; [ tfmoraes ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openwsman/default.nix b/nixpkgs/pkgs/development/libraries/openwsman/default.nix
new file mode 100644
index 000000000000..9276ccac6fd2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openwsman/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
+, curl, libxml2, pam, sblim-sfcc }:
+
+stdenv.mkDerivation rec {
+  pname = "openwsman";
+  version = "2.7.0";
+
+  src = fetchFromGitHub {
+    owner  = "Openwsman";
+    repo   = "openwsman";
+    rev    = "v${version}";
+    sha256 = "19dj38jyzhhhvk863cikcwk5awzlq3337pxmsaqqm4wrcygrkfmx";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [ curl libxml2 pam sblim-sfcc ];
+
+  cmakeFlags = [
+    "-DCMAKE_BUILD_RUBY_GEM=no"
+    "-DBUILD_PYTHON=no"
+    "-DBUILD_PYTHON3=yes"
+  ];
+
+  preConfigure = ''
+    cmakeFlags="$cmakeFlags -DPACKAGE_ARCHITECTURE=$(uname -m)";
+  '';
+
+  configureFlags = [ "--disable-more-warnings" ];
+
+  meta = with lib; {
+    description  = "Openwsman server implementation and client API with bindings";
+    downloadPage = "https://github.com/Openwsman/openwsman/releases";
+    homepage     = "https://openwsman.github.io";
+    license      = licenses.bsd3;
+    maintainers  = with maintainers; [ deepfire ];
+    platforms    = platforms.linux; # PAM is not available on Darwin
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openxr-loader/default.nix b/nixpkgs/pkgs/development/libraries/openxr-loader/default.nix
new file mode 100644
index 000000000000..b4a2634867bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openxr-loader/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchFromGitHub, cmake, python3, libX11, libXxf86vm, libXrandr, vulkan-headers, libGL }:
+
+stdenv.mkDerivation rec {
+  pname = "openxr-loader";
+  version = "1.0.19";
+
+  src = fetchFromGitHub {
+    owner = "KhronosGroup";
+    repo = "OpenXR-SDK-Source";
+    rev = "release-${version}";
+    sha256 = "sha256-LEXxqzHzTadgK2PV9Wiud9MzblDHdF4L5T4fVydRJW8=";
+  };
+
+  nativeBuildInputs = [ cmake python3 ];
+  buildInputs = [ libX11 libXxf86vm libXrandr vulkan-headers libGL ];
+
+  cmakeFlags = [ "-DBUILD_TESTS=OFF" ];
+
+  outputs = [ "out" "dev" "layers" ];
+
+  postInstall = ''
+    mkdir -p "$layers/share"
+    mv "$out/share/openxr" "$layers/share"
+    # Use absolute paths in manifests so no LD_LIBRARY_PATH shenanigans are necessary
+    for file in "$layers/share/openxr/1/api_layers/explicit.d/"*; do
+        substituteInPlace "$file" --replace '"library_path": "lib' "\"library_path\": \"$layers/lib/lib"
+    done
+    mkdir -p "$layers/lib"
+    mv "$out/lib/libXrApiLayer"* "$layers/lib"
+  '';
+
+  meta = with lib; {
+    description = "Khronos OpenXR loader";
+    homepage    = "https://www.khronos.org/openxr";
+    platforms   = platforms.linux;
+    license     = licenses.asl20;
+    maintainers = [ maintainers.ralith ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/openzwave/default.nix b/nixpkgs/pkgs/development/libraries/openzwave/default.nix
new file mode 100644
index 000000000000..723288ab4a91
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openzwave/default.nix
@@ -0,0 +1,58 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch
+, doxygen, fontconfig, graphviz-nox, libxml2, pkg-config, which
+, systemd }:
+
+stdenv.mkDerivation rec {
+  pname = "openzwave";
+  version = "1.6";
+
+  src = fetchFromGitHub {
+    owner = "OpenZWave";
+    repo = "open-zwave";
+    rev = "v${version}";
+    sha256 = "0xgs4mmr0480c269wx9xkk67ikjzxkh8xcssrdx0f5xcl1lyd333";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "fix-strncat-build-failure.patch";
+      url = "https://github.com/OpenZWave/open-zwave/commit/601e5fb16232a7984885e67fdddaf5b9c9dd8105.patch";
+      sha256 = "1n1k5arwk1dyc12xz6xl4n8yw28vghzhv27j65z1nca4zqsxgza1";
+    })
+    (fetchpatch {
+      name = "fix-text-uninitialized.patch";
+      url = "https://github.com/OpenZWave/open-zwave/commit/3b029a467e83bc7f0054e4dbba1e77e6eac7bc7f.patch";
+      sha256 = "183mrzjh1zx2b2wzkj4jisiw8br7g7bbs167afls4li0fm01d638";
+    })
+  ];
+
+  outputs = [ "out" "doc" ];
+
+  nativeBuildInputs = [ doxygen fontconfig graphviz-nox libxml2 pkg-config which ];
+
+  buildInputs = [ systemd ];
+
+  hardeningDisable = [ "format" ];
+
+  enableParallelBuilding = true;
+
+  makeFlags = [
+    "PREFIX=${placeholder "out"}"
+  ];
+
+  FONTCONFIG_FILE="${fontconfig.out}/etc/fonts/fonts.conf";
+  FONTCONFIG_PATH="${fontconfig.out}/etc/fonts/";
+
+  postPatch = ''
+    substituteInPlace cpp/src/Options.cpp \
+      --replace /etc/openzwave $out/etc/openzwave
+  '';
+
+  meta = with lib; {
+    description = "C++ library to control Z-Wave Networks via a USB Z-Wave Controller";
+    homepage = "http://www.openzwave.net/";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ etu ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/optparse-bash/default.nix b/nixpkgs/pkgs/development/libraries/optparse-bash/default.nix
new file mode 100644
index 000000000000..811458ed187c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/optparse-bash/default.nix
@@ -0,0 +1,63 @@
+{ stdenvNoCC
+, lib
+, fetchFromGitHub
+, bash
+, gnused
+, gawk
+, coreutils
+}:
+
+stdenvNoCC.mkDerivation {
+  pname = "optparse-bash-unstable";
+  version = "2021-06-13";
+
+  src = fetchFromGitHub {
+    owner = "nk412";
+    repo = "optparse";
+    rev = "d86ec17d15368e5b54eb2d47b001b0b61d68bbd0";
+    sha256 = "sha256-vs7Jo1+sV0tPse4Wu2xtzSX1IkahwLgO3e4Riz3uMmI=";
+  };
+
+  postPatch = ''
+    substituteInPlace optparse.bash \
+      --replace sed "${gnused}/bin/sed" \
+      --replace awk "${gawk}/bin/awk" \
+      --replace printf "${coreutils}/bin/printf"
+'';
+
+  dontBuild = true;
+
+  doCheck = true;
+
+  checkInputs = [ bash ];
+
+  # `#!/usr/bin/env` isn't okay for OfBorg
+  # Need external bash to run
+  checkPhase = ''
+    runHook preCheck
+    bash ./sample_head.sh -v --file README.md
+    runHook postCheck
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/bin
+    mv optparse.bash $out/bin/
+    mkdir -p $out/share/doc/optparse-bash
+    mv README.md sample_head.sh $out/share/doc/optparse-bash/
+    runHook postInstall
+  '';
+
+  # As example code,
+  # sample_head.sh shows how users can use opt-parse in their script,
+  # and its shebang (`/usr/bin/env bash`) should not be patched.
+  dontPatchShebangs = true;
+
+  meta = with lib; {
+    description = "A BASH wrapper for getopts, for simple command-line argument parsing";
+    homepage = "https://github.com/nk412/optparse";
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ ShamrockLee ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/oracle-instantclient/default.nix b/nixpkgs/pkgs/development/libraries/oracle-instantclient/default.nix
new file mode 100644
index 000000000000..8947c6f42394
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/oracle-instantclient/default.nix
@@ -0,0 +1,133 @@
+{ lib
+, stdenv
+, fetchurl
+, autoPatchelfHook
+, fixDarwinDylibNames
+, unzip
+, libaio
+, makeWrapper
+, odbcSupport ? true
+, unixODBC
+}:
+
+assert odbcSupport -> unixODBC != null;
+
+let
+  inherit (lib) optional optionals optionalString;
+
+  throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
+
+  # assemble list of components
+  components = [ "basic" "sdk" "sqlplus" "tools" ] ++ optional odbcSupport "odbc";
+
+  # determine the version number, there might be different ones per architecture
+  version = {
+    x86_64-linux = "19.3.0.0.0";
+    x86_64-darwin = "19.3.0.0.0";
+  }.${stdenv.hostPlatform.system} or throwSystem;
+
+  # hashes per component and architecture
+  hashes = {
+    x86_64-linux = {
+      basic = "1yk4ng3a9ka1mzgfph9br6rwclagbgfvmg6kja11nl5dapxdzaxy";
+      sdk = "115v1gqr0czy7dcf2idwxhc6ja5b0nind0mf1rn8iawgrw560l99";
+      sqlplus = "0zj5h84ypv4n4678kfix6jih9yakb277l9hc0819iddc0a5slbi5";
+      tools = "1q19blr0gz1c8bq0bnv1njzflrp03hf82ngid966xc6gwmqpkdsk";
+      odbc = "1g1z6pdn76dp440fh49pm8ijfgjazx4cvxdi665fsr62h62xkvch";
+    };
+    x86_64-darwin = {
+      basic = "f4335c1d53e8188a3a8cdfb97494ff87c4d0f481309284cf086dc64080a60abd";
+      sdk = "b46b4b87af593f7cfe447cfb903d1ae5073cec34049143ad8cdc9f3e78b23b27";
+      sqlplus = "f7565c3cbf898b0a7953fbb0017c5edd9d11d1863781588b7caf3a69937a2e9e";
+      tools = "b2bc474f98da13efdbc77fd05f559498cd8c08582c5b9038f6a862215de33f2c";
+      odbc = "f91da40684abaa866aa059eb26b1322f2d527670a1937d678404c991eadeb725";
+    };
+  }.${stdenv.hostPlatform.system} or throwSystem;
+
+  # rels per component and architecture, optional
+  rels = { }.${stdenv.hostPlatform.system} or { };
+
+  # convert platform to oracle architecture names
+  arch = {
+    x86_64-linux = "linux.x64";
+    x86_64-darwin = "macos.x64";
+  }.${stdenv.hostPlatform.system} or throwSystem;
+
+  shortArch = {
+    x86_64-linux = "linux";
+    x86_64-darwin = "mac";
+  }.${stdenv.hostPlatform.system} or throwSystem;
+
+  # calculate the filename of a single zip file
+  srcFilename = component: arch: version: rel:
+    "instantclient-${component}-${arch}-${version}" +
+    (optionalString (rel != "") "-${rel}") +
+    (optionalString (arch == "linux.x64" || arch == "macos.x64") "dbru") + # ¯\_(ツ)_/¯
+    ".zip";
+
+  # fetcher for the non clickthrough artifacts
+  fetcher = srcFilename: hash: fetchurl {
+    url = "https://download.oracle.com/otn_software/${shortArch}/instantclient/193000/${srcFilename}";
+    sha256 = hash;
+  };
+
+  # assemble srcs
+  srcs = map
+    (component:
+      (fetcher (srcFilename component arch version rels.${component} or "") hashes.${component} or ""))
+    components;
+
+  pname = "oracle-instantclient";
+  extLib = stdenv.hostPlatform.extensions.sharedLibrary;
+in
+stdenv.mkDerivation {
+  inherit pname version srcs;
+
+  buildInputs = [ stdenv.cc.cc.lib ]
+    ++ optional stdenv.isLinux libaio
+    ++ optional odbcSupport unixODBC;
+
+  nativeBuildInputs = [ makeWrapper unzip ]
+    ++ optional stdenv.isLinux autoPatchelfHook
+    ++ optional stdenv.isDarwin fixDarwinDylibNames;
+
+  outputs = [ "out" "dev" "lib" ];
+
+  unpackCmd = "unzip $curSrc";
+
+  installPhase = ''
+    mkdir -p "$out/"{bin,include,lib,"share/java","share/${pname}-${version}/demo/"} $lib/lib
+    install -Dm755 {adrci,genezi,uidrvci,sqlplus,exp,expdp,imp,impdp} $out/bin
+
+    # cp to preserve symlinks
+    cp -P *${extLib}* $lib/lib
+
+    install -Dm644 *.jar $out/share/java
+    install -Dm644 sdk/include/* $out/include
+    install -Dm644 sdk/demo/* $out/share/${pname}-${version}/demo
+
+    # provide alias
+    ln -sfn $out/bin/sqlplus $out/bin/sqlplus64
+  '';
+
+  postFixup = optionalString stdenv.isDarwin ''
+    for exe in "$out/bin/"* ; do
+      if [ ! -L "$exe" ]; then
+        install_name_tool -add_rpath "$lib/lib" "$exe"
+      fi
+    done
+  '';
+
+  meta = with lib; {
+    description = "Oracle instant client libraries and sqlplus CLI";
+    longDescription = ''
+      Oracle instant client provides access to Oracle databases (OCI,
+      OCCI, Pro*C, ODBC or JDBC). This package includes the sqlplus
+      command line SQL client.
+    '';
+    license = licenses.unfree;
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+    maintainers = with maintainers; [ flokli ];
+    hydraPlatforms = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/orcania/default.nix b/nixpkgs/pkgs/development/libraries/orcania/default.nix
new file mode 100644
index 000000000000..1058eaa1f631
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/orcania/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, cmake, check, subunit }:
+stdenv.mkDerivation rec {
+  pname = "orcania";
+  version = "2.2.1";
+
+  src = fetchFromGitHub {
+    owner = "babelouest";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-6Libn+S5c7sCmKGq8KojiUhI18zO37rgiiVwQxP3p4o=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  checkInputs = [ check subunit ];
+
+  cmakeFlags = [ "-DBUILD_ORCANIA_TESTING=on" ];
+
+  doCheck = true;
+
+  preCheck = ''
+    export LD_LIBRARY_PATH="$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
+    export DYLD_FALLBACK_LIBRARY_PATH="$(pwd):$DYLD_FALLBACK_LIBRARY_PATH"
+  '';
+
+  meta = with lib; {
+    description = "Potluck with different functions for different purposes that can be shared among C programs";
+    homepage = "https://github.com/babelouest/orcania";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ johnazoidberg ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/orocos-kdl/default.nix b/nixpkgs/pkgs/development/libraries/orocos-kdl/default.nix
new file mode 100644
index 000000000000..4eb18c347c09
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/orocos-kdl/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, cmake, eigen }:
+
+stdenv.mkDerivation rec {
+  pname = "orocos-kdl";
+  version = "1.5.0";
+
+  src = fetchFromGitHub {
+    owner = "orocos";
+    repo = "orocos_kinematics_dynamics";
+    rev = "v${version}";
+    sha256 = "181w2q6lsrfcvrgqwi6m0xrydjlblj1b654apf2d7zjc7qqgd6ca";
+    # Needed to build Python bindings
+    fetchSubmodules = true;
+  };
+
+  sourceRoot = "source/orocos_kdl";
+
+  nativeBuildInputs = [ cmake ];
+  propagatedBuildInputs = [ eigen ];
+
+  meta = with lib; {
+    description = "Kinematics and Dynamics Library";
+    homepage = "https://www.orocos.org/kdl.html";
+    license = licenses.lgpl21Only;
+    maintainers = with maintainers; [ lopsided98 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ortp/default.nix b/nixpkgs/pkgs/development/libraries/ortp/default.nix
new file mode 100644
index 000000000000..af924ad80d26
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ortp/default.nix
@@ -0,0 +1,35 @@
+{ bctoolbox
+, cmake
+, fetchFromGitLab
+, lib, stdenv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ortp";
+  version = "4.5.1";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.linphone.org";
+    owner = "public";
+    group = "BC";
+    repo = pname;
+    rev = version;
+    sha256 = "1lc1j7wvkyp5lhcflq3h5y7n8aiwgwj84ffm81ggbsmavamgwkk7";
+  };
+
+  # Do not build static libraries
+  cmakeFlags = [ "-DENABLE_STATIC=NO" ];
+
+  NIX_CFLAGS_COMPILE = "-Wno-error=stringop-truncation";
+
+  buildInputs = [ bctoolbox ];
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "A Real-Time Transport Protocol (RFC3550) stack";
+    homepage = "https://linphone.org/technical-corner/ortp";
+    license = licenses.gpl3Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/osip/default.nix b/nixpkgs/pkgs/development/libraries/osip/default.nix
new file mode 100644
index 000000000000..b0603cc454f6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/osip/default.nix
@@ -0,0 +1,17 @@
+{lib, stdenv, fetchurl}:
+stdenv.mkDerivation rec {
+  version = "5.2.0";
+  src = fetchurl {
+    url = "mirror://gnu/osip/libosip2-${version}.tar.gz";
+    sha256 = "0xdk3cszkzb8nb757gl47slrr13mf6xz43ab4k343fv8llp8pd2g";
+  };
+  pname = "libosip2";
+
+  meta = {
+    license = lib.licenses.lgpl21Plus;
+    homepage = "https://www.gnu.org/software/osip/";
+    description = "The GNU oSIP library, an implementation of the Session Initiation Protocol (SIP)";
+    maintainers = with lib.maintainers; [ raskin ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/osip/default.upstream b/nixpkgs/pkgs/development/libraries/osip/default.upstream
new file mode 100644
index 000000000000..ba0ed2a9b299
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/osip/default.upstream
@@ -0,0 +1,3 @@
+url http://ftp.u-tx.net/gnu/osip/
+attribute_name libosip
+minimize_overwrite
diff --git a/nixpkgs/pkgs/development/libraries/osm-gps-map/default.nix b/nixpkgs/pkgs/development/libraries/osm-gps-map/default.nix
new file mode 100644
index 000000000000..79bc2421dc99
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/osm-gps-map/default.nix
@@ -0,0 +1,28 @@
+{ cairo, fetchzip, glib, gnome, gtk3, gobject-introspection, pkg-config, lib, stdenv }:
+
+stdenv.mkDerivation rec {
+  pname = "osm-gps-map";
+  version = "1.2.0";
+
+  src = fetchzip {
+    url = "https://github.com/nzjrs/osm-gps-map/releases/download/${version}/osm-gps-map-${version}.tar.gz";
+    sha256 = "sha256-ciw28YXhR+GC6B2VPC+ZxjyhadOk3zYGuOssSgqjwH0=";
+  };
+
+  outputs = [ "out" "dev" "doc" ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [
+    cairo glib gobject-introspection
+    gnome.gnome-common gtk3 gnome.libsoup
+  ];
+
+  meta = with lib; {
+    description = "GTK widget for displaying OpenStreetMap tiles";
+    homepage = "https://nzjrs.github.io/osm-gps-map";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ hrdinka ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/p11-kit/default.nix b/nixpkgs/pkgs/development/libraries/p11-kit/default.nix
new file mode 100644
index 000000000000..681b60e16de4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/p11-kit/default.nix
@@ -0,0 +1,63 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, which
+, gettext, libffi, libiconv, libtasn1
+}:
+
+stdenv.mkDerivation rec {
+  pname = "p11-kit";
+  version = "0.24.0";
+
+  src = fetchFromGitHub {
+    owner = "p11-glue";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-jvUzOhMvbq05SxQ+kjKQHDDMzNwo4U6nFHu3JjygJHw=";
+  };
+
+  outputs = [ "out" "dev"];
+  outputBin = "dev";
+
+  # for cross platform builds of p11-kit, libtasn1 in nativeBuildInputs
+  # provides the asn1Parser binary on the hostPlatform needed for building.
+  # at the same time, libtasn1 in buildInputs provides the libasn1 library
+  # to link against for the target platform.
+  # hence, libtasn1 is required in both native and build inputs.
+  nativeBuildInputs = [ autoreconfHook pkg-config which libtasn1 ];
+  buildInputs = [ gettext libffi libiconv libtasn1 ];
+
+  autoreconfPhase = ''
+    NOCONFIGURE=1 ./autogen.sh
+  '';
+
+  configureFlags = [
+    "--sysconfdir=/etc"
+    "--localstatedir=/var"
+    "--with-trust-paths=/etc/ssl/certs/ca-certificates.crt"
+  ];
+
+  enableParallelBuilding = true;
+
+  # Tests run in fakeroot for non-root users
+  preCheck = ''
+    if [ "$(id -u)" != "0" ]; then
+      export FAKED_MODE=1
+    fi
+  '';
+
+  doCheck = !stdenv.isDarwin;
+
+  installFlags = [
+    "exampledir=${placeholder "out"}/etc/pkcs11"
+  ];
+
+  meta = with lib; {
+    description = "Library for loading and sharing PKCS#11 modules";
+    longDescription = ''
+      Provides a way to load and enumerate PKCS#11 modules.
+      Provides a standard configuration setup for installing
+      PKCS#11 modules in such a way that they're discoverable.
+    '';
+    homepage = "https://p11-glue.github.io/p11-glue/p11-kit.html";
+    platforms = platforms.all;
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/packr/default.nix b/nixpkgs/pkgs/development/libraries/packr/default.nix
new file mode 100644
index 000000000000..e3abc6e5d62e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/packr/default.nix
@@ -0,0 +1,60 @@
+{ buildGoModule
+, fetchFromGitHub
+, lib
+
+, symlinkJoin
+}:
+
+let p2 = buildGoModule rec {
+  pname = "packr2";
+  version = "2.8.0";
+
+  src = fetchFromGitHub {
+    owner = "gobuffalo";
+    repo = "packr";
+    rev = "v${version}";
+    sha256 = "1x78yq2yg0r82h7a67078llni85gk9nbd2ismlbqgppap7fcpyai";
+  }+"/v2";
+
+  subPackages = [ "packr2" ];
+
+  vendorSha256 = "12yq121b0bn8z12091fyqhhz421kgx4z1nskrkvbxlhyc47bwyrp";
+
+  doCheck = false;
+
+  meta = with lib; {
+    description = "The simple and easy way to embed static files into Go binaries";
+    homepage = "https://github.com/gobuffalo/packr";
+    license = licenses.mit;
+    maintainers = with maintainers; [ mmahut ];
+  };
+};
+p1 = buildGoModule rec {
+  pname = "packr1";
+  version = "2.8.0";
+
+  src = fetchFromGitHub {
+    owner = "gobuffalo";
+    repo = "packr";
+    rev = "v${version}";
+    sha256 = "1x78yq2yg0r82h7a67078llni85gk9nbd2ismlbqgppap7fcpyai";
+  };
+
+  subPackages = [ "packr" ];
+
+  vendorSha256 = "0m3yj8ww4a16j56p8d8w0sdnyx0g2bkd8zg0l4d8vb72mvg5asga";
+
+  doCheck = false;
+
+  meta = with lib; {
+    description = "The simple and easy way to embed static files into Go binaries";
+    homepage = "https://github.com/gobuffalo/packr";
+    license = licenses.mit;
+    maintainers = with maintainers; [ mmahut ];
+  };
+};
+in
+symlinkJoin{
+    name = "packr";
+    paths = [p1 p2];
+}
diff --git a/nixpkgs/pkgs/development/libraries/pagmo2/default.nix b/nixpkgs/pkgs/development/libraries/pagmo2/default.nix
new file mode 100644
index 000000000000..abef3d6cd1dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pagmo2/default.nix
@@ -0,0 +1,42 @@
+{ fetchFromGitHub
+, lib, stdenv
+, cmake
+, eigen
+, nlopt
+, ipopt
+, boost
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pagmo2";
+  version = "2.9";
+
+  src = fetchFromGitHub {
+     owner = "esa";
+     repo = "pagmo2";
+     rev = "v${version}";
+     sha256 = "0al2i59m5qr83wz5n5408zvys0b3mc40rszf0l5b9a0gp1axj400";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ eigen nlopt ipopt boost ];
+
+  cmakeFlags = [
+    "-DPAGMO_BUILD_TESTS=no"
+    "-DPAGMO_WITH_EIGEN3=yes"
+    "-DPAGMO_WITH_NLOPT=yes"
+    "-DNLOPT_LIBRARY=${nlopt}/lib/libnlopt.so"
+    "-DPAGMO_WITH_IPOPT=yes"
+    "-DCMAKE_CXX_FLAGS='-fuse-ld=gold'"
+  ];
+
+  # tests pass but take 30+ minutes
+  doCheck = false;
+
+  meta = with lib; {
+    homepage = "https://esa.github.io/pagmo2/";
+    description = "Scientific library for massively parallel optimization";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.costrouc ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pango/default.nix b/nixpkgs/pkgs/development/libraries/pango/default.nix
new file mode 100644
index 000000000000..c75e33a0686e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pango/default.nix
@@ -0,0 +1,111 @@
+{ lib
+, stdenv
+, fetchurl
+, pkg-config
+, cairo
+, harfbuzz
+, libintl
+, libthai
+, gobject-introspection
+, darwin
+, fribidi
+, gnome
+, gi-docgen
+, makeFontsConf
+, freefont_ttf
+, meson
+, ninja
+, glib
+, x11Support? !stdenv.isDarwin, libXft
+}:
+
+let
+  withDocs = stdenv.buildPlatform == stdenv.hostPlatform;
+in
+stdenv.mkDerivation rec {
+  pname = "pango";
+  version = "1.48.5";
+
+  outputs = [ "bin" "out" "dev" ]
+    ++ lib.optionals withDocs [ "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0aivpd6l5687lj5293j859zd7vq97yxpzvad0b6jvh3kc54p87jh";
+  };
+
+  nativeBuildInputs = [
+    meson ninja
+    glib # for glib-mkenum
+    pkg-config
+    gobject-introspection
+    gi-docgen
+  ];
+
+  buildInputs = [
+    fribidi
+    libthai
+  ] ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+    ApplicationServices
+    Carbon
+    CoreGraphics
+    CoreText
+  ]);
+
+  propagatedBuildInputs = [
+    cairo
+    glib
+    libintl
+    harfbuzz
+  ] ++ lib.optionals x11Support [
+    libXft
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=${lib.boolToString withDocs}"
+  ] ++ lib.optionals (!x11Support) [
+    "-Dxft=disabled" # only works with x11
+  ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+    "-Dintrospection=disabled"
+  ];
+
+  # Fontconfig error: Cannot load default config file
+  FONTCONFIG_FILE = makeFontsConf {
+    fontDirectories = [ freefont_ttf ];
+  };
+
+  doCheck = false; # test-font: FAIL
+
+  postInstall = lib.optionalString withDocs ''
+    # So that devhelp can find this.
+    # https://gitlab.gnome.org/GNOME/pango/merge_requests/293/diffs#note_1058448
+    mkdir -p "$devdoc/share/devhelp"
+    mv "$out/share/doc/pango/reference" "$devdoc/share/devhelp/books"
+    rmdir -p --ignore-fail-on-non-empty "$out/share/doc/pango"
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "A library for laying out and rendering of text, with an emphasis on internationalization";
+
+    longDescription = ''
+      Pango is a library for laying out and rendering of text, with an
+      emphasis on internationalization.  Pango can be used anywhere
+      that text layout is needed, though most of the work on Pango so
+      far has been done in the context of the GTK widget toolkit.
+      Pango forms the core of text and font handling for GTK.
+    '';
+
+    homepage = "https://www.pango.org/";
+    license = licenses.lgpl2Plus;
+
+    maintainers = with maintainers; [ raskin ] ++ teams.gnome.members;
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pangolin/default.nix b/nixpkgs/pkgs/development/libraries/pangolin/default.nix
new file mode 100644
index 000000000000..331284021e3b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pangolin/default.nix
@@ -0,0 +1,54 @@
+{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, doxygen, libGL, glew
+, xorg, ffmpeg, libjpeg, libpng, libtiff, eigen
+, Carbon ? null, Cocoa ? null
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pangolin";
+
+  version = "0.6";
+
+  src = fetchFromGitHub {
+    owner = "stevenlovegrove";
+    repo = "Pangolin";
+    rev = "v${version}";
+    sha256 = "0abjajxj7lc2yajshimar4w8kf8115prsjnhy83s6jc7cbz63wj8";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config doxygen ];
+
+  buildInputs = [
+    libGL
+    glew
+    xorg.libX11
+    ffmpeg
+    libjpeg
+    libpng
+    libtiff
+    eigen
+  ]
+  ++ lib.optionals stdenv.isDarwin [ Carbon Cocoa ];
+
+  # The tests use cmake's findPackage to find the installed version of
+  # pangolin, which isn't what we want (or available).
+  doCheck = false;
+  cmakeFlags = [ "-DBUILD_TESTS=OFF" ];
+
+  meta = {
+    description = "A lightweight portable rapid development library for managing OpenGL display / interaction and abstracting video input";
+    longDescription = ''
+      Pangolin is a lightweight portable rapid development library for managing
+      OpenGL display / interaction and abstracting video input. At its heart is
+      a simple OpenGl viewport manager which can help to modularise 3D
+      visualisation without adding to its complexity, and offers an advanced
+      but intuitive 3D navigation handler. Pangolin also provides a mechanism
+      for manipulating program variables through config files and ui
+      integration, and has a flexible real-time plotter for visualising
+      graphical data.
+    '';
+    homepage = "https://github.com/stevenlovegrove/Pangolin";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.expipiplus1 ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pangomm/2.48.nix b/nixpkgs/pkgs/development/libraries/pangomm/2.48.nix
new file mode 100644
index 000000000000..3c25d113d727
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pangomm/2.48.nix
@@ -0,0 +1,65 @@
+{ stdenv
+, lib
+, fetchurl
+, pkg-config
+, meson
+, ninja
+, python3
+, pango
+, glibmm_2_68
+, cairomm_1_16
+, gnome
+, ApplicationServices
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pangomm";
+  version= "2.48.0";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-ng7UdMM/jCACyp4rYcoNHz2OQJ4J6Z9NjBnur8z1W3g=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    meson
+    ninja
+    python3
+  ] ++ lib.optional stdenv.isDarwin [
+    ApplicationServices
+  ];
+
+  propagatedBuildInputs = [
+    pango
+    glibmm_2_68
+    cairomm_1_16
+  ];
+
+  doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      attrPath = "${pname}_2_48";
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "C++ interface to the Pango text rendering library";
+    longDescription = ''
+      Pango is a library for laying out and rendering of text, with an
+      emphasis on internationalization.  Pango can be used anywhere
+      that text layout is needed, though most of the work on Pango so
+      far has been done in the context of the GTK widget toolkit.
+      Pango forms the core of text and font handling for GTK.
+    '';
+    homepage = "https://www.pango.org/";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members ++ (with maintainers; [ lovek323 raskin ]);
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pangomm/default.nix b/nixpkgs/pkgs/development/libraries/pangomm/default.nix
new file mode 100644
index 000000000000..afb79c7eafed
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pangomm/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchurl, pkg-config, meson, ninja, python3, pango, glibmm, cairomm, gnome
+, ApplicationServices }:
+
+stdenv.mkDerivation rec {
+  pname = "pangomm";
+  version= "2.42.2";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-GyTJJiSuEnXMtXdYF10198Oa0zQtjAtLpg8NmEnS0Io=";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ pkg-config meson ninja python3 ] ++ lib.optional stdenv.isDarwin [
+    ApplicationServices
+  ];
+  propagatedBuildInputs = [ pango glibmm cairomm ];
+
+  doCheck = true;
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "C++ interface to the Pango text rendering library";
+    homepage    = "https://www.pango.org/";
+    license     = with licenses; [ lgpl2 lgpl21 ];
+    maintainers = with maintainers; [ lovek323 raskin ];
+    platforms   = platforms.unix;
+
+    longDescription = ''
+      Pango is a library for laying out and rendering of text, with an
+      emphasis on internationalization.  Pango can be used anywhere
+      that text layout is needed, though most of the work on Pango so
+      far has been done in the context of the GTK widget toolkit.
+      Pango forms the core of text and font handling for GTK.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pangoxsl/default.nix b/nixpkgs/pkgs/development/libraries/pangoxsl/default.nix
new file mode 100644
index 000000000000..7d314a930f25
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pangoxsl/default.nix
@@ -0,0 +1,22 @@
+{lib, stdenv, fetchurl, pkg-config, glib, pango}:
+
+stdenv.mkDerivation {
+  name = "pangoxsl-1.6.0.3";
+  src = fetchurl {
+    url = "mirror://sourceforge/pangopdf/pangoxsl-1.6.0.3.tar.gz";
+    sha256 = "1wcd553nf4nwkrfrh765cyzwj9bsg7zpkndg2hjs8mhwgx04lm8n";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    glib
+    pango
+  ];
+
+  meta = with lib; {
+    description = "Implements several of the inline properties defined by XSL that are not currently implemented by Pango";
+    homepage = "https://sourceforge.net/projects/pangopdf";
+    platforms = platforms.unix;
+    license = licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/parquet-cpp/api.patch b/nixpkgs/pkgs/development/libraries/parquet-cpp/api.patch
new file mode 100644
index 000000000000..3fd567ea098f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/parquet-cpp/api.patch
@@ -0,0 +1,12 @@
+diff --git a/src/parquet/arrow/reader.cc b/src/parquet/arrow/reader.cc
+--- a/src/parquet/arrow/reader.cc
++++ b/src/parquet/arrow/reader.cc
+@@ -1421,7 +1421,7 @@ Status StructImpl::DefLevelsToNullArray(std::shared_ptr<Buffer>* null_bitmap_out
+   const int16_t* def_levels_data;
+   size_t def_levels_length;
+   RETURN_NOT_OK(GetDefLevels(&def_levels_data, &def_levels_length));
+-  RETURN_NOT_OK(AllocateEmptyBitmap(pool_, def_levels_length, &null_bitmap));
++  RETURN_NOT_OK(GetEmptyBitmap(pool_, def_levels_length, &null_bitmap));
+   uint8_t* null_bitmap_ptr = null_bitmap->mutable_data();
+   for (size_t i = 0; i < def_levels_length; i++) {
+     if (def_levels_data[i] < struct_def_level_) {
diff --git a/nixpkgs/pkgs/development/libraries/partio/default.nix b/nixpkgs/pkgs/development/libraries/partio/default.nix
new file mode 100644
index 000000000000..d4af69532b39
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/partio/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchFromGitHub, unzip, cmake, freeglut, libGLU, libGL, zlib, swig, doxygen, xorg }:
+
+stdenv.mkDerivation {
+  pname = "partio";
+  version = "2018-03-01";
+
+  src = fetchFromGitHub {
+    owner = "wdas";
+    repo = "partio";
+    rev = "8b6ea0d20f1ab77cd7f18390999251e60932de4a";
+    sha256 = "16sdj103v02l2dgq9y9cna9jakafabz9jxzdxsd737ir6wn10ksb";
+  };
+
+  outputs = [ "dev" "out" "lib" ];
+
+  nativeBuildInputs = [ unzip cmake doxygen ];
+  buildInputs = [ freeglut libGLU libGL zlib swig xorg.libXi xorg.libXmu ];
+
+  buildPhase = ''
+    make partio
+
+    mkdir $dev
+    mkdir $out
+      '';
+
+  # TODO:
+  # Sexpr support
+
+  installPhase = ''
+    make install prefix=$out
+    mkdir $dev/include/partio
+    mv $dev/include/*.h $dev/include/partio
+  '';
+
+  strictDeps = true;
+
+  meta = with lib; {
+    description = "C++ (with python bindings) library for easily reading/writing/manipulating common animation particle formats such as PDB, BGEO, PTC";
+    homepage = "https://www.disneyanimation.com/technology/partio.html";
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.guibou ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pc-ble-driver/default.nix b/nixpkgs/pkgs/development/libraries/pc-ble-driver/default.nix
new file mode 100644
index 000000000000..5f09860cb3a4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pc-ble-driver/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchFromGitHub
+, cmake, git
+, asio, catch2, spdlog
+, IOKit, udev
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pc-ble-driver";
+  version = "4.1.4";
+
+  src = fetchFromGitHub {
+    owner = "NordicSemiconductor";
+    repo = "pc-ble-driver";
+    rev = "v${version}";
+    sha256 = "1609x17sbfi668jfwyvnfk9z29w6cgzvgv67xcpvpx5jv0czpcdj";
+  };
+
+  cmakeFlags = [
+    "-DNRF_BLE_DRIVER_VERSION=${version}"
+  ];
+
+  nativeBuildInputs = [ cmake git ];
+  buildInputs = [ asio catch2 spdlog ];
+
+  propagatedBuildInputs = [
+
+  ] ++ lib.optionals stdenv.isDarwin [
+    IOKit
+  ] ++ lib.optionals stdenv.isLinux [
+    udev
+  ];
+
+  meta = with lib; {
+    description = "Desktop library for Bluetooth low energy development";
+    homepage = "https://github.com/NordicSemiconductor/pc-ble-driver";
+    license = licenses.unfreeRedistributable;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ jschievink ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pcaudiolib/default.nix b/nixpkgs/pkgs/development/libraries/pcaudiolib/default.nix
new file mode 100644
index 000000000000..2c7dd440da82
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pcaudiolib/default.nix
@@ -0,0 +1,32 @@
+{ config, stdenv, lib, fetchFromGitHub
+, autoconf, automake, which, libtool, pkg-config
+, portaudio, alsa-lib
+, pulseaudioSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio }:
+
+stdenv.mkDerivation rec {
+  pname = "pcaudiolib";
+  version = "1.1";
+
+  src = fetchFromGitHub {
+    owner = "espeak-ng";
+    repo = "pcaudiolib";
+    rev = version;
+    sha256 = "0c55hlqqh0m7bcb3nlgv1s4a22s5bgczr1cakjh3767rjb10khi0";
+  };
+
+  nativeBuildInputs = [ autoconf automake which libtool pkg-config ];
+
+  buildInputs = [ portaudio ]
+    ++ lib.optionals stdenv.isLinux [ alsa-lib ]
+    ++ lib.optionals pulseaudioSupport [ libpulseaudio ];
+
+  preConfigure = "./autogen.sh";
+
+  meta = with lib; {
+    description = "Provides a C API to different audio devices";
+    homepage = "https://github.com/espeak-ng/pcaudiolib";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ aske ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pcg-c/default.nix b/nixpkgs/pkgs/development/libraries/pcg-c/default.nix
new file mode 100644
index 000000000000..9722210b9d10
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pcg-c/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchzip }:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  version = "0.94";
+  pname = "pcg-c";
+
+  src = fetchzip {
+    url = "http://www.pcg-random.org/downloads/${pname}-${version}.zip";
+    sha256 = "0smm811xbvs03a5nc2668zd0178wnyri2h023pqffy767bpy1vlv";
+  };
+
+  enableParallelBuilding = true;
+
+  patches = [
+    ./prefix-variable.patch
+    ];
+
+  preInstall = ''
+    sed -i s,/usr/local,$out, Makefile
+    mkdir -p $out/lib $out/include
+  '';
+
+  meta = {
+    description = "A family of better random number generators";
+    homepage = "https://www.pcg-random.org/";
+    license = lib.licenses.asl20;
+    longDescription = ''
+      PCG is a family of simple fast space-efficient statistically good
+      algorithms for random number generation. Unlike many general-purpose RNGs,
+      they are also hard to predict.
+    '';
+    platforms = platforms.unix;
+    maintainers = [ maintainers.linus ];
+    repositories.git = "git://github.com/imneme/pcg-c.git";
+    broken = stdenv.isi686; # https://github.com/imneme/pcg-c/issues/11
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pcg-c/prefix-variable.patch b/nixpkgs/pkgs/development/libraries/pcg-c/prefix-variable.patch
new file mode 100644
index 000000000000..bfdcdfa7b17e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pcg-c/prefix-variable.patch
@@ -0,0 +1,15 @@
+diff --git a/Makefile b/Makefile
+index dddea44..fdb9401 100644
+--- a/Makefile
++++ b/Makefile
+@@ -30,8 +30,8 @@ all:
+ PREFIX = /usr/local
+ 
+ install: all
+-	install src/libpcg_random.a $PREFIX/lib
+-	install -m 0644 include/pcg_variants.h $PREFIX/include
++	install src/libpcg_random.a ${PREFIX}/lib
++	install -m 0644 include/pcg_variants.h ${PREFIX}/include
+ 
+ test:   all
+ 	cd test-low; $(MAKE) test
diff --git a/nixpkgs/pkgs/development/libraries/pcl/default.nix b/nixpkgs/pkgs/development/libraries/pcl/default.nix
new file mode 100644
index 000000000000..d940d0518155
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pcl/default.nix
@@ -0,0 +1,61 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, wrapQtAppsHook
+, cmake
+, qhull
+, flann
+, boost
+, vtk
+, eigen
+, pkg-config
+, qtbase
+, libusb1
+, libpcap
+, libXt
+, libpng
+, Cocoa
+, AGL
+, OpenGL
+, withCuda ? false, cudatoolkit
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pcl";
+  version = "1.12.0";
+
+  src = fetchFromGitHub {
+    owner = "PointCloudLibrary";
+    repo = "pcl";
+    rev = "${pname}-${version}";
+    sha256 = "0jhvciaw43y6iqqk7hyxnfhn1b4bsw5fpy04s01r5pkcsjjbdbqc";
+  };
+
+  nativeBuildInputs = [ pkg-config cmake wrapQtAppsHook ];
+  buildInputs = [
+    qhull
+    flann
+    boost
+    eigen
+    libusb1
+    libpcap
+    libpng
+    vtk
+    qtbase
+    libXt
+  ]
+  ++ lib.optionals stdenv.isDarwin [ Cocoa AGL ]
+  ++ lib.optionals withCuda [ cudatoolkit ];
+
+  cmakeFlags = lib.optionals stdenv.isDarwin [
+    "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks"
+  ] ++ lib.optionals withCuda [ "-DWITH_CUDA=true" ];
+
+  meta = {
+    homepage = "https://pointclouds.org/";
+    description = "Open project for 2D/3D image and point cloud processing";
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ viric ];
+    platforms = with lib.platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pcmsolver/default.nix b/nixpkgs/pkgs/development/libraries/pcmsolver/default.nix
new file mode 100644
index 000000000000..8cd4b318cc5a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pcmsolver/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchFromGitHub, cmake, perl, gfortran, python
+, boost, eigen, zlib
+} :
+
+stdenv.mkDerivation rec {
+  pname = "pcmsolver";
+  version = "1.3.0";
+
+  src = fetchFromGitHub  {
+    owner = "PCMSolver";
+    repo = pname;
+    rev = "v${version}";
+    sha256= "0jrxr8z21hjy7ik999hna9rdqy221kbkl3qkb06xw7g80rc9x9yr";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    gfortran
+    perl
+    python
+  ];
+
+  buildInputs = [
+    boost
+    eigen
+    zlib
+  ];
+
+  cmakeFlags = [ "-DENABLE_OPENMP=ON" ];
+
+  hardeningDisable = [ "format" ];
+
+  # Requires files, that are not installed.
+  doCheck = false;
+
+  meta = with lib; {
+    description = "An API for the Polarizable Continuum Model";
+    homepage = "https://pcmsolver.readthedocs.io/en/stable/";
+    license = licenses.lgpl3Only;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.sheepforce ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pcre/default.nix b/nixpkgs/pkgs/development/libraries/pcre/default.nix
new file mode 100644
index 000000000000..c91d4e2bd0c2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pcre/default.nix
@@ -0,0 +1,66 @@
+{ lib, stdenv, fetchurl
+, pcre, windows ? null
+, variant ? null
+}:
+
+with lib;
+
+assert elem variant [ null "cpp" "pcre16" "pcre32" ];
+
+let
+  version = "8.44";
+  pname = if (variant == null) then "pcre"
+    else  if (variant == "cpp") then "pcre-cpp"
+    else  variant;
+
+in stdenv.mkDerivation {
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "https://ftp.pcre.org/pub/pcre/pcre-${version}.tar.bz2";
+    sha256 = "0v9nk51wh55pcbnf2jr36yarz8ayajn6d7ywiq2wagivn9c8c40r";
+  };
+
+  outputs = [ "bin" "dev" "out" "doc" "man" ];
+
+  # Disable jit on Apple Silicon, https://github.com/zherczeg/sljit/issues/51
+  configureFlags = optional (!stdenv.hostPlatform.isRiscV && !(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)) "--enable-jit" ++ [
+    "--enable-unicode-properties"
+    "--disable-cpp"
+  ]
+    ++ optional (variant != null) "--enable-${variant}";
+
+  # https://bugs.exim.org/show_bug.cgi?id=2173
+  patches = [ ./stacksize-detection.patch ];
+
+  preCheck = ''
+    patchShebangs RunGrepTest
+  '';
+
+  doCheck = !(with stdenv.hostPlatform; isCygwin || isFreeBSD) && stdenv.hostPlatform == stdenv.buildPlatform;
+    # XXX: test failure on Cygwin
+    # we are running out of stack on both freeBSDs on Hydra
+
+  postFixup = ''
+    moveToOutput bin/pcre-config "$dev"
+  ''
+    + optionalString (variant != null) ''
+    ln -sf -t "$out/lib/" '${pcre.out}'/lib/libpcre{,posix}.{so.*.*.*,*dylib}
+  '';
+
+  meta = {
+    homepage = "http://www.pcre.org/";
+    description = "A library for Perl Compatible Regular Expressions";
+    license = lib.licenses.bsd3;
+
+    longDescription = ''
+      The PCRE library is a set of functions that implement regular
+      expression pattern matching using the same syntax and semantics as
+      Perl 5. PCRE has its own native API, as well as a set of wrapper
+      functions that correspond to the POSIX regular expression API. The
+      PCRE library is free, even for building proprietary software.
+    '';
+
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pcre/stacksize-detection.patch b/nixpkgs/pkgs/development/libraries/pcre/stacksize-detection.patch
new file mode 100644
index 000000000000..4bc97069b1e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pcre/stacksize-detection.patch
@@ -0,0 +1,16 @@
+diff --git a/pcre_exec.c b/pcre_exec.c
+--- a/pcre_exec.c
++++ b/pcre_exec.c
+@@ -509,6 +509,12 @@
+                  (e.g. stopped by repeated call or recursion limit)
+ */
+ 
++#ifdef __GNUC__
++static int
++match(REGISTER PCRE_PUCHAR eptr, REGISTER const pcre_uchar *ecode,
++  PCRE_PUCHAR mstart, int offset_top, match_data *md, eptrblock *eptrb,
++  unsigned int rdepth) __attribute__((noinline,noclone));
++#endif
+ static int
+ match(REGISTER PCRE_PUCHAR eptr, REGISTER const pcre_uchar *ecode,
+   PCRE_PUCHAR mstart, int offset_top, match_data *md, eptrblock *eptrb,
diff --git a/nixpkgs/pkgs/development/libraries/pcre2/default.nix b/nixpkgs/pkgs/development/libraries/pcre2/default.nix
new file mode 100644
index 000000000000..188fa9b16b7e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pcre2/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "pcre2";
+  version = "10.36";
+  src = fetchurl {
+    url = "https://ftp.pcre.org/pub/pcre/${pname}-${version}.tar.bz2";
+    sha256 = "0p3699msps07p40g9426lvxa3b41rg7k2fn7qxl2jm0kh4kkkvx9";
+  };
+
+  # Disable jit on Apple Silicon, https://github.com/zherczeg/sljit/issues/51
+  configureFlags = [
+    "--enable-pcre2-16"
+    "--enable-pcre2-32"
+  ] ++ lib.optional (!stdenv.hostPlatform.isRiscV && !(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)) "--enable-jit";
+
+  outputs = [ "bin" "dev" "out" "doc" "man" "devdoc" ];
+
+  doCheck = false; # fails 1 out of 3 tests, looks like a bug
+
+  postFixup = ''
+    moveToOutput bin/pcre2-config "$dev"
+  '';
+
+  meta = with lib; {
+    description = "Perl Compatible Regular Expressions";
+    homepage = "http://www.pcre.org/";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ ttuegel ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pdal/default.nix b/nixpkgs/pkgs/development/libraries/pdal/default.nix
new file mode 100644
index 000000000000..2d971444416c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pdal/default.nix
@@ -0,0 +1,81 @@
+{ lib, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, pkg-config
+, openscenegraph
+, curl
+, gdal
+, hdf5-cpp
+, LASzip
+, libe57format
+, libgeotiff
+, libxml2
+, postgresql
+, tiledb
+, xercesc
+, zlib
+, zstd
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pdal";
+  version = "2.3.0";
+
+  src = fetchFromGitHub {
+    owner = "PDAL";
+    repo = "PDAL";
+    rev = version;
+    sha256 = "sha256-DKIraCyp8fcgnVp5dFrtQ4Wq96cQGC9SiAPLS6htUZc=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  buildInputs = [
+    openscenegraph
+    curl
+    gdal
+    hdf5-cpp
+    LASzip
+    libe57format
+    libgeotiff
+    libxml2
+    postgresql
+    tiledb
+    xercesc
+    zlib
+    zstd
+  ];
+
+  cmakeFlags = [
+    "-DBUILD_PLUGIN_E57=ON"
+    "-DBUILD_PLUGIN_HDF=ON"
+    "-DBUILD_PLUGIN_PGPOINTCLOUD=ON"
+    "-DBUILD_PLUGIN_TILEDB=ON"
+
+    # Plugins can probably not be made work easily:
+    "-DBUILD_PLUGIN_CPD=OFF"
+    "-DBUILD_PLUGIN_FBX=OFF" # Autodesk FBX SDK is gratis+proprietary; not packaged in nixpkgs
+    "-DBUILD_PLUGIN_GEOWAVE=OFF"
+    "-DBUILD_PLUGIN_I3S=OFF"
+    "-DBUILD_PLUGIN_ICEBRIDGE=OFF"
+    "-DBUILD_PLUGIN_MATLAB=OFF"
+    "-DBUILD_PLUGIN_MBIO=OFF"
+    "-DBUILD_PLUGIN_MRSID=OFF"
+    "-DBUILD_PLUGIN_NITF=OFF"
+    "-DBUILD_PLUGIN_OCI=OFF"
+    "-DBUILD_PLUGIN_RDBLIB=OFF" # Riegl rdblib is proprietary; not packaged in nixpkgs
+    "-DBUILD_PLUGIN_RIVLIB=OFF"
+  ];
+
+  meta = with lib; {
+    description = "PDAL is Point Data Abstraction Library. GDAL for point cloud data";
+    homepage = "https://pdal.io";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ nh2 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pdf2xml/default.nix b/nixpkgs/pkgs/development/libraries/pdf2xml/default.nix
new file mode 100644
index 000000000000..2dfd35466858
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pdf2xml/default.nix
@@ -0,0 +1,40 @@
+{lib, stdenv, fetchurl, libxpdf, libxml2}:
+
+stdenv.mkDerivation {
+  name = "pdf2xml";
+
+  src = fetchurl {
+      url = "http://tarballs.nixos.org/pdf2xml.tar.gz";
+      sha256 = "04rl7ppxqgnvxvvws669cxp478lnrdmiqj0g3m4p69bawfjc4z3w";
+  };
+  sourceRoot = "pdf2xml/pdf2xml";
+
+  buildInputs = [libxml2 libxpdf];
+
+  patches = [./pdf2xml.patch];
+
+  hardeningDisable = [ "format" ];
+
+  preBuild = ''
+    cp Makefile.linux Makefile
+
+    sed -i 's|/usr/include/libxml2|${libxml2.dev}/include/libxml2|' Makefile
+    sed -i 's|-lxml2|-lxml2 -L${libxml2.out}/lib|' Makefile
+    sed -i 's|XPDF = xpdf_3.01|XPDF = ${libxpdf}/lib|' Makefile
+
+    mkdir exe
+
+    buildFlags+=" CXX=$CXX"
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp exe/* $out/bin
+  '';
+
+  meta = with lib; {
+    description = "PDF to XML converter";
+    platforms = platforms.unix;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pdf2xml/pdf2xml.patch b/nixpkgs/pkgs/development/libraries/pdf2xml/pdf2xml.patch
new file mode 100644
index 000000000000..596a3aea6749
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pdf2xml/pdf2xml.patch
@@ -0,0 +1,48 @@
+diff -rc pdf2xml/pdf2xml/Makefile.linux pdf2xml-new/pdf2xml/Makefile.linux
+*** pdf2xml/Makefile.linux	2008-02-07 17:43:10.000000000 +0100
+--- pdf2xml-new/Makefile.linux	2010-08-25 15:41:23.000000000 +0200
+***************
+*** 30,36 ****
+  
+  
+  # Executable name
+! PDFTOXMLEXE=pdftoxml.exe
+  
+  # Main target
+  all: pdftoxmlEXE
+--- 30,36 ----
+  
+  
+  # Executable name
+! PDFTOXMLEXE=pdftoxml
+  
+  # Main target
+  all: pdftoxmlEXE
+diff -rc pdf2xml/pdf2xml/src/pdftoxml.cc pdf2xml-new/pdf2xml/src/pdftoxml.cc
+*** pdf2xml/src/pdftoxml.cc	2010-04-26 10:58:01.000000000 +0200
+--- pdf2xml-new/src/pdftoxml.cc	2010-08-25 15:36:15.000000000 +0200
+***************
+*** 11,21 ****
+  //
+  //===========================================================================
+  
+  #include <aconf.h>
+- #include <stdio.h>
+  #include <stdlib.h>
+  #include <stddef.h>
+! #include <string.h>
+  #include "parseargs.h"
+  #include "GString.h"
+  #include "gmem.h"
+--- 11,21 ----
+  //
+  //===========================================================================
+  
++ #include <string.h>
+  #include <aconf.h>
+  #include <stdlib.h>
+  #include <stddef.h>
+! #include <cstdio>
+  #include "parseargs.h"
+  #include "GString.h"
+  #include "gmem.h"
diff --git a/nixpkgs/pkgs/development/libraries/pe-parse/default.nix b/nixpkgs/pkgs/development/libraries/pe-parse/default.nix
new file mode 100644
index 000000000000..445188bd0d9b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pe-parse/default.nix
@@ -0,0 +1,28 @@
+{ stdenv, lib, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "pe-parse";
+  version = "1.2.0";
+
+  src = fetchFromGitHub {
+    owner = "trailofbits";
+    repo = "pe-parse";
+    rev = "v${version}";
+    sha256 = "1jvfjaiwddczjlx4xdhpbgwvvpycab7ix35lwp3wfy44hs6qpjqv";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  doInstallCheck = true;
+  installCheckPhase = ''
+    $out/bin/dump-pe ../test/assets/example.exe
+  '';
+
+  meta = with lib; {
+    description = "A principled, lightweight parser for Windows portable executable files";
+    homepage = "https://github.com/trailofbits/pe-parse";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ arturcygan ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/phash/default.nix b/nixpkgs/pkgs/development/libraries/phash/default.nix
new file mode 100644
index 000000000000..8d3f3e987023
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/phash/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, cimg, imagemagick }:
+
+stdenv.mkDerivation rec {
+  pname = "pHash";
+  version = "0.9.4";
+
+  buildInputs = [ cimg ];
+
+  # CImg.h calls to external binary `convert` from the `imagemagick` package
+  # at runtime
+  propagatedBuildInputs = [ imagemagick ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  configureFlags = ["--enable-video-hash=no" "--enable-audio-hash=no"];
+  postInstall = ''
+    cp ${cimg}/include/CImg.h $out/include/
+  '';
+
+  src = fetchFromGitHub {
+    owner = "clearscene";
+    repo = "pHash";
+    rev = version;
+    sha256 = "0y4gknfkns5sssfaj0snyx29752my20xmxajg6xggijx0myabbv0";
+  };
+
+  meta = with lib; {
+    description = "Compute the perceptual hash of an image";
+    license = licenses.gpl3;
+    maintainers = [maintainers.imalsogreg];
+    platforms = platforms.all;
+    homepage = "http://www.phash.org";
+    downloadPage = "https://github.com/clearscene/pHash";
+    updateWalker = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/phonetisaurus/default.nix b/nixpkgs/pkgs/development/libraries/phonetisaurus/default.nix
new file mode 100644
index 000000000000..9ba00833d623
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/phonetisaurus/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv
+, fetchFromGitHub
+, openfst
+, pkg-config
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "phonetisaurus";
+  version = "0.9.1";
+
+  src = fetchFromGitHub {
+    owner = "AdolfVonKleist";
+    repo = pname;
+    rev = version;
+    sha256 = "1b18s5zz0l0fhqh9n9jnmgjz2hzprwzf6hx5a12zibmmam3qyriv";
+  };
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ python3 openfst ];
+
+  meta = with lib; {
+    description = "Framework for Grapheme-to-phoneme models for speech recognition using the OpenFst framework";
+    inherit (src.meta) homepage;
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ mic92 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/phonon/backends/gst-plugin-paths.patch b/nixpkgs/pkgs/development/libraries/phonon/backends/gst-plugin-paths.patch
new file mode 100644
index 000000000000..39c1b9c0d290
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/phonon/backends/gst-plugin-paths.patch
@@ -0,0 +1,13 @@
+Index: phonon-gstreamer-4.9.0/gstreamer/backend.cpp
+===================================================================
+--- phonon-gstreamer-4.9.0.orig/gstreamer/backend.cpp
++++ phonon-gstreamer-4.9.0/gstreamer/backend.cpp
+@@ -85,6 +85,8 @@ Backend::Backend(QObject *parent, const
+         "--gst-debug-no-color"
+     };
+ 
++    qputenv("GST_PLUGIN_PATH_1_0", GST_PLUGIN_PATH_1_0);
++
+     int argc = sizeof(args) / sizeof(*args);
+     char **argv = const_cast<char**>(args);
+     GError *err = 0;
diff --git a/nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix b/nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix
new file mode 100644
index 000000000000..3e21415b4c77
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix
@@ -0,0 +1,67 @@
+{ stdenv, lib, fetchurl, cmake, gst_all_1, phonon, pkg-config
+, extra-cmake-modules, qttools, qtbase, qtx11extras
+, debug ? false
+}:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "phonon-backend-gstreamer";
+  version = "4.10.0";
+
+  meta = with lib; {
+    homepage = "https://phonon.kde.org/";
+    description = "GStreamer backend for Phonon";
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ ttuegel ];
+    license = licenses.lgpl21;
+  };
+
+  src = fetchurl {
+    url = "mirror://kde/stable/phonon/${pname}/${version}/${pname}-${version}.tar.xz";
+    sha256 = "1wk1ip2w7fkh65zk6rilj314dna0hgsv2xhjmpr5w08xa8sii1y5";
+  };
+
+  # Hardcode paths to useful plugins so the backend doesn't depend
+  # on system paths being set.
+  patches = [ ./gst-plugin-paths.patch ];
+
+  dontWrapQtApps = true;
+
+  NIX_CFLAGS_COMPILE =
+    let gstPluginPaths =
+          lib.makeSearchPathOutput "lib" "/lib/gstreamer-1.0"
+          (with gst_all_1; [
+            gstreamer
+            gst-plugins-base
+            gst-plugins-good
+            gst-plugins-ugly
+            gst-plugins-bad
+            gst-libav
+          ]);
+    in toString [
+      # This flag should be picked up through pkg-config, 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
+    qtbase
+    qtx11extras
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    extra-cmake-modules
+    qttools
+  ];
+
+  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
new file mode 100644
index 000000000000..8ff0f3bb4917
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/phonon/backends/vlc.nix
@@ -0,0 +1,41 @@
+{ stdenv, lib, fetchurl, cmake, phonon, pkg-config, libvlc
+, extra-cmake-modules, qttools, qtbase, qtx11extras
+, debug ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "phonon-backend-vlc";
+  version = "0.11.2";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/phonon/${pname}/${version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-xsM7/GjRN/DlegKeS3mMu5D1Svb3Ma9JZ3hXeRzNU6U=";
+  };
+
+  buildInputs = [
+    phonon
+    libvlc
+    qtbase
+    qtx11extras
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    qttools
+    extra-cmake-modules
+  ];
+
+  dontWrapQtApps = true;
+
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}"
+  ];
+
+  meta = with lib; {
+    homepage = "https://phonon.kde.org/";
+    description = "GStreamer backend for Phonon";
+    platforms = platforms.linux;
+    license = with licenses; [ bsd3 lgpl2Plus ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/phonon/default.nix b/nixpkgs/pkgs/development/libraries/phonon/default.nix
new file mode 100644
index 000000000000..877bf973194a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/phonon/default.nix
@@ -0,0 +1,90 @@
+{ stdenv
+, lib
+, fetchurl
+, cmake
+, libGLU
+, libGL
+, pkg-config
+, libpulseaudio
+, extra-cmake-modules
+, qtbase
+, qttools
+, debug ? false
+}:
+
+with lib;
+
+let
+  soname = "phonon4qt5";
+  buildsystemdir = "share/cmake/${soname}";
+in
+
+stdenv.mkDerivation rec {
+  pname = "phonon";
+  version = "4.11.1";
+
+  meta = {
+    homepage = "https://community.kde.org/Phonon";
+    description = "Multimedia API for Qt";
+    license = lib.licenses.lgpl2;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ ttuegel ];
+  };
+
+  src = fetchurl {
+    url = "mirror://kde/stable/phonon/${version}/phonon-${version}.tar.xz";
+    sha256 = "0bfy8iqmjhlg3ma3iqd3kxjc2zkzpjgashbpf5x17y0dc2i1whxl";
+  };
+
+  buildInputs = [
+    libGLU
+    libGL
+    libpulseaudio
+    qtbase
+    qttools
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+    extra-cmake-modules
+  ];
+
+  outputs = [ "out" "dev" ];
+
+  NIX_CFLAGS_COMPILE = "-fPIC";
+
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=${if debug then "Debug" else "Release"}"
+  ];
+
+  dontWrapQtApps = true;
+
+  preConfigure = ''
+    cmakeFlags+=" -DPHONON_QT_MKSPECS_INSTALL_DIR=''${!outputDev}/mkspecs"
+    cmakeFlags+=" -DPHONON_QT_IMPORTS_INSTALL_DIR=''${!outputBin}/$qtQmlPrefix"
+    cmakeFlags+=" -DPHONON_QT_PLUGIN_INSTALL_DIR=''${!outputBin}/$qtPluginPrefix/designer"
+  '';
+
+  postPatch = ''
+    sed -i PhononConfig.cmake.in \
+        -e "/get_filename_component(rootDir/ s/^.*$//" \
+        -e "/^set(PHONON_INCLUDE_DIR/ s|\''${rootDir}/||" \
+        -e "/^set(PHONON_LIBRARY_DIR/ s|\''${rootDir}/||" \
+        -e "/^set(PHONON_BUILDSYSTEM_DIR/ s|\''${rootDir}|''${!outputDev}|"
+
+    sed -i cmake/FindPhononInternal.cmake \
+        -e "/set(INCLUDE_INSTALL_DIR/ c set(INCLUDE_INSTALL_DIR \"''${!outputDev}/include\")"
+
+    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}\")"
+  '';
+
+  postFixup = ''
+    sed -i "''${!outputDev}/lib/pkgconfig/${soname}.pc" \
+        -e "/^exec_prefix=/ c exec_prefix=''${!outputBin}/bin"
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/physfs/default.nix b/nixpkgs/pkgs/development/libraries/physfs/default.nix
new file mode 100644
index 000000000000..faa338c94fcf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physfs/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl, cmake, doxygen, zlib, Foundation, Carbon }:
+
+let
+  generic = version: sha256:
+  stdenv.mkDerivation rec {
+    pname = "physfs";
+    inherit version;
+
+    src = fetchurl {
+      url = "${meta.homepage}/downloads/${pname}-${version}.tar.bz2";
+      inherit sha256;
+    };
+
+    nativeBuildInputs = [ cmake doxygen ];
+
+    buildInputs = [ zlib ]
+      ++ lib.optionals stdenv.isDarwin [ Foundation Carbon ];
+
+    patchPhase = ''
+      sed s,-Werror,, -i CMakeLists.txt
+    '';
+
+    doInstallCheck = true;
+
+    installCheckPhase = ''
+      ./test_physfs --version
+    '';
+
+    meta = with lib; {
+      homepage = "http://icculus.org/physfs/";
+      description = "Library to provide abstract access to various archives";
+      license = licenses.free;
+      platforms = platforms.unix;
+    };
+  };
+
+in {
+  physfs_2 = generic "2.0.3" "0sbbyqzqhyf0g68fcvvv20n3928j0x6ik1njmhn1yigvq2bj11na";
+  physfs   = generic "3.0.2" "0qzqz4r88gvd8m7sh2z5hvqcr0jfr4wb2f77c19xycyn0rigfk9h";
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/apfel/default.nix b/nixpkgs/pkgs/development/libraries/physics/apfel/default.nix
new file mode 100644
index 000000000000..b0fff0c92ba5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/apfel/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, gfortran, lhapdf, python2, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "apfel";
+  version = "3.0.5";
+
+  src = fetchFromGitHub {
+    owner = "scarrazza";
+    repo = "apfel";
+    rev = version;
+    sha256 = "sha256-szEtSC/NouYlHSjVoX9Hoh7yQ0W82rVccYEF1L2tXoU=";
+  };
+
+  buildInputs = [ gfortran lhapdf python2 zlib ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A PDF Evolution Library";
+    license     = licenses.gpl3;
+    homepage    = "https://apfel.mi.infn.it/";
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/apfelgrid/default.nix b/nixpkgs/pkgs/development/libraries/physics/apfelgrid/default.nix
new file mode 100644
index 000000000000..33ca03267270
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/apfelgrid/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, apfel, applgrid, lhapdf, root5 }:
+
+stdenv.mkDerivation rec {
+  pname = "apfelgrid";
+  version = "1.0.1";
+
+  src = fetchFromGitHub {
+    owner = "nhartland";
+    repo = "APFELgrid";
+    rev = "v${version}";
+    sha256 = "0l0cyxd00kmb5aggzwsxg83ah0qiwav0shbxkxwrz3dvw78n89jk";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ apfel applgrid lhapdf root5 ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Ultra-fast theory predictions for collider observables";
+    license     = licenses.mit;
+    homepage    = "http://nhartland.github.io/APFELgrid/";
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/applgrid/bad_code.patch b/nixpkgs/pkgs/development/libraries/physics/applgrid/bad_code.patch
new file mode 100644
index 000000000000..e90000efe2db
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/applgrid/bad_code.patch
@@ -0,0 +1,50 @@
+diff --git a/appl_grid/appl_grid.h b/appl_grid/appl_grid.h
+index 5059622..a0651c9 100644
+--- a/appl_grid/appl_grid.h
++++ b/appl_grid/appl_grid.h
+@@ -56,7 +56,7 @@ public:
+   class exception : public std::exception { 
+   public:
+     exception(const std::string& s) { std::cerr << what() << " " << s << std::endl; }; 
+-    exception(std::ostream& s)      { std::cerr << what() << " " << s << std::endl; }; 
++    exception(std::ostream& s)      { s << what() << " " << std::endl; }; 
+     virtual const char* what() const throw() { return "appl::grid::exception"; }
+   };
+ 
+diff --git a/appl_grid/appl_pdf.h b/appl_grid/appl_pdf.h
+index c71fd84..2525527 100644
+--- a/appl_grid/appl_pdf.h
++++ b/appl_grid/appl_pdf.h
+@@ -51,7 +51,7 @@ public:
+   class exception : public std::exception { 
+   public: 
+     exception(const std::string& s="") { std::cerr << what() << " " << s << std::endl; }; 
+-    exception(std::ostream& s)         { std::cerr << what() << " " << s << std::endl; }; 
++    exception(std::ostream& s)         { s << " " << std::endl; }; 
+     const char* what() const throw() { return "appl::appl_pdf::exception "; }
+   };
+   
+diff --git a/src/appl_igrid.h b/src/appl_igrid.h
+index d25288e..be354df 100644
+--- a/src/appl_igrid.h
++++ b/src/appl_igrid.h
+@@ -52,7 +52,7 @@ private:
+   class exception { 
+   public:
+     exception(const std::string& s) { std::cerr << s << std::endl; }; 
+-    exception(std::ostream& s)      { std::cerr << s << std::endl; }; 
++    exception(std::ostream& s)      { s << std::endl; }; 
+   };
+ 
+   typedef double (igrid::*transform_t)(double) const;
+diff --git a/src/lumi_pdf.cxx b/src/lumi_pdf.cxx
+--- a/src/lumi_pdf.cxx
++++ b/src/lumi_pdf.cxx
+@@ -235,6 +235,6 @@ void lumi_pdf::write(const std::string& filename) const {
+ // std::string lumi_pdf::summary(std::ostream& s=std::cout) const { 
+ std::string lumi_pdf::summary() const { 
+   std::stringstream s;
+-  s << "lumi_pdf::lumi_pdf() " << s << "\tsize " << m_combinations.size() << " lookup size " << m_lookup.size() << " " << this; 
++  s << "lumi_pdf::lumi_pdf() " << "\tsize " << m_combinations.size() << " lookup size " << m_lookup.size() << " " << this; 
+   return s.str();
+ }
diff --git a/nixpkgs/pkgs/development/libraries/physics/applgrid/default.nix b/nixpkgs/pkgs/development/libraries/physics/applgrid/default.nix
new file mode 100644
index 000000000000..65aa7b8b4703
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/applgrid/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchurl, gfortran, hoppet, lhapdf, root5, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "applgrid";
+  version = "1.4.70";
+
+  src = fetchurl {
+    url = "https://www.hepforge.org/archive/applgrid/${pname}-${version}.tgz";
+    sha256 = "1yw9wrk3vjv84kd3j4s1scfhinirknwk6xq0hvj7x2srx3h93q9p";
+  };
+
+  # For some reason zlib was only needed after bump to gfortran8
+  buildInputs = [ gfortran hoppet lhapdf root5 zlib ];
+
+  patches = [
+    ./bad_code.patch
+  ];
+
+  preConfigure = ''
+    substituteInPlace src/Makefile.in \
+      --replace "-L\$(subst /libgfortran.a, ,\$(FRTLIB) )" "-L${gfortran.cc.lib}/lib"
+  '' + (if stdenv.isDarwin then ''
+    substituteInPlace src/Makefile.in \
+      --replace "gfortran -print-file-name=libgfortran.a" "gfortran -print-file-name=libgfortran.dylib"
+  '' else "");
+
+  enableParallelBuilding = false; # broken
+
+  # Install private headers required by APFELgrid
+  postInstall = ''
+    for header in src/*.h; do
+      install -Dm644 "$header" "$out"/include/appl_grid/"`basename $header`"
+    done
+  '';
+
+  meta = with lib; {
+    description = "The APPLgrid project provides a fast and flexible way to reproduce the results of full NLO calculations with any input parton distribution set in only a few milliseconds rather than the weeks normally required to gain adequate statistics";
+    license     = licenses.gpl3;
+    homepage    = "http://applgrid.hepforge.org";
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/cernlib/0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch b/nixpkgs/pkgs/development/libraries/physics/cernlib/0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch
new file mode 100644
index 000000000000..bc8c77f913c6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/cernlib/0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch
@@ -0,0 +1,94 @@
+From a69607c511b6da94cde477283b129cbc9cfdd5a3 Mon Sep 17 00:00:00 2001
+From: Maximilian Bosch <maximilian@mbosch.me>
+Date: Tue, 11 Aug 2020 12:32:06 +0200
+Subject: [PATCH] Use `strerror` rather than `sys_errlist` to fix compilation
+ w/glibc-2.32
+
+To quote the release-notes[1]:
+
+  All programs should use
+  strerror or strerror_r instead.
+
+[1] https://sourceware.org/pipermail/libc-announce/2020/000029.html
+---
+ 2006/src/packlib/cspack/sysreq/serror.c         | 10 +---------
+ 2006/src/packlib/cspack/sysreq/socket.c         |  2 +-
+ 2006/src/packlib/kernlib/kernbit/z268/systems.c |  4 ++--
+ 2006/src/pawlib/paw/piafs/piafc.c               |  5 +----
+ 4 files changed, 5 insertions(+), 16 deletions(-)
+
+diff --git a/2006/src/packlib/cspack/sysreq/serror.c b/2006/src/packlib/cspack/sysreq/serror.c
+index 3667c42a..c560e499 100644
+--- a/2006/src/packlib/cspack/sysreq/serror.c
++++ b/2006/src/packlib/cspack/sysreq/serror.c
+@@ -176,15 +176,7 @@ int     n;
+         }
+         else {
+ #if !defined(vms)
+-                if ((n>0) && (n<sys_nerr)) {
+-                        return(sys_errlist[n]);
+-                }
+-                else {
+-                        (void) sprintf(buf,"%s: %d\n",
+- sys_serrlist[SEMAXERR+1-SEBASEOFF],
+-                            n);
+-                        return(buf);
+-                }
++          return strerror(n);
+ #else /* vms */
+ /*
+  * There are (were) some bugs is DEC C compilers (/OPT), just check
+diff --git a/2006/src/packlib/cspack/sysreq/socket.c b/2006/src/packlib/cspack/sysreq/socket.c
+index ceb5bd63..34c2a7bc 100644
+--- a/2006/src/packlib/cspack/sysreq/socket.c
++++ b/2006/src/packlib/cspack/sysreq/socket.c
+@@ -412,7 +412,7 @@ char *
+ s_errmsg()                              /* return last error message    */
+ {
+ #if !defined(vms)
+-        return(sys_errlist[errno]);
++        return(strerror(errno));
+ #else /* vms */
+ #if defined(MULTINET) && (MULTINET == 1)
+         return(vms_errno_string());
+diff --git a/2006/src/packlib/kernlib/kernbit/z268/systems.c b/2006/src/packlib/kernlib/kernbit/z268/systems.c
+index 98459459..d1ad63ed 100644
+--- a/2006/src/packlib/kernlib/kernbit/z268/systems.c
++++ b/2006/src/packlib/kernlib/kernbit/z268/systems.c
+@@ -134,7 +134,7 @@ int     *ovflw;
+ #endif /* hpux */
+ 
+ 	if ( (ps=(FILE *)popen(command,"r"))==NULL ) {
+-		fprintf(stderr,"systems(): popen(): %s\n",sys_errlist[errno] );
++		fprintf(stderr,"systems(): popen(): %s\n",strerror(errno) );
+ 		*rc= -errno;
+ 		*chars=0        ;
+                 *l=0        ;
+@@ -144,7 +144,7 @@ int     *ovflw;
+ 	rcode = fread(buf, 1, buflen , ps );
+ 	if ( rcode < 0 ) {
+ 		fprintf(stderr,"systems(): pipe fread(): %s\n",
+-                                                       sys_errlist[errno] );
++                                                       strerror(errno) );
+ 		buf[0]='\n';
+ 		*rc= -errno;
+                 *chars=0        ;
+diff --git a/2006/src/pawlib/paw/piafs/piafc.c b/2006/src/pawlib/paw/piafs/piafc.c
+index b163f80c..4d8d5528 100644
+--- a/2006/src/pawlib/paw/piafs/piafc.c
++++ b/2006/src/pawlib/paw/piafs/piafc.c
+@@ -1795,10 +1795,7 @@ static void fatalperror(char *msg)
+    extern char  *sys_errlist[];
+ #endif
+ 
+-   if ((unsigned) errno < sys_nerr)
+-      sprintf(buf, "%s: %s", msg, sys_errlist[errno]);
+-   else
+-      sprintf(buf, "%s: Error %d", msg, errno);
++   sprintf(buf, "%s: %s", msg, strerror(errno));
+ 
+    fatal(buf);
+ }
+-- 
+2.25.4
+
diff --git a/nixpkgs/pkgs/development/libraries/physics/cernlib/default.nix b/nixpkgs/pkgs/development/libraries/physics/cernlib/default.nix
new file mode 100644
index 000000000000..84657d726797
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/cernlib/default.nix
@@ -0,0 +1,69 @@
+{ lib, stdenv, fetchurl, gfortran, gnumake, imake, makedepend, motif, xorg }:
+
+stdenv.mkDerivation rec {
+  version = "2006";
+  pname = "cernlib";
+
+  src = fetchurl {
+    urls = [
+      "https://ftp.riken.jp/cernlib/download/${version}_source/tar/${version}_src.tar.gz"
+      "https://cernlib.web.cern.ch/cernlib/download/${version}_source/tar/${version}_src.tar.gz"
+    ];
+    sha256 = "0awla1rl96z82br7slcmg8ks1d2a7slk6dj79ywb871j2ksi3fky";
+  };
+
+  buildInputs = with xorg; [ gfortran motif libX11 libXft libXt ];
+  nativeBuildInputs = [ gnumake imake makedepend ];
+  sourceRoot = ".";
+
+  patches = [ ./patch.patch ./0001-Use-strerror-rather-than-sys_errlist-to-fix-compilat.patch ];
+
+  postPatch = ''
+    substituteInPlace 2006/src/config/site.def \
+      --replace "# define MakeCmd gmake" "# define MakeCmd make"
+    substituteInPlace 2006/src/config/lnxLib.rules \
+      --replace "# lib" "// lib"
+  '';
+
+  configurePhase = ''
+    export CERN=`pwd`
+    export CERN_LEVEL=${version}
+    export CERN_ROOT=$CERN/$CERN_LEVEL
+    export CVSCOSRC=`pwd`/$CERN_LEVEL/src
+    export PATH=$PATH:$CERN_ROOT/bin
+  '';
+
+  buildPhase = ''
+    cd $CERN_ROOT
+    mkdir -p build bin lib
+
+    cd $CERN_ROOT/build
+    $CVSCOSRC/config/imake_boot
+    make bin/kuipc
+    make scripts/Makefile
+    pushd scripts
+    make install.bin
+    popd
+    make
+  '';
+
+  installPhase = ''
+    mkdir "$out"
+    cp -r "$CERN_ROOT/bin" "$out"
+    cp -r "$CERN_ROOT/lib" "$out"
+    mkdir "$out/$CERN_LEVEL"
+    ln -s "$out/bin" "$out/$CERN_LEVEL/bin"
+    ln -s "$out/lib" "$out/$CERN_LEVEL/lib"
+  '';
+
+  setupHook = ./setup-hook.sh;
+
+  meta = {
+    homepage = "http://cernlib.web.cern.ch";
+    description = "Legacy collection of libraries and modules for data analysis in high energy physics";
+    broken = stdenv.isDarwin;
+    platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
+    maintainers = with lib.maintainers; [ veprbl ];
+    license = lib.licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/cernlib/patch.patch b/nixpkgs/pkgs/development/libraries/physics/cernlib/patch.patch
new file mode 100644
index 000000000000..2d75b6bf0f88
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/cernlib/patch.patch
@@ -0,0 +1,186 @@
+diff --git a/2006/src/config/Imake.tmpl b/2006/src/config/Imake.tmpl
+index 054fb04..a3b3828 100644
+--- a/2006/src/config/Imake.tmpl
++++ b/2006/src/config/Imake.tmpl
+@@ -455,7 +455,7 @@ XCOMM the platform-specific parameters - edit site.def to change
+ #define NoRConst NO /* YES if const for structs of funcs is bad */
+ #endif
+ #ifndef InstPgmFlags
+-#define InstPgmFlags -s
++#define InstPgmFlags
+ #endif
+ #ifndef InstBinFlags
+ #define InstBinFlags -m 0755
+diff --git a/2006/src/config/biglib.rules b/2006/src/config/biglib.rules
+index c90e58a..9173bdc 100644
+--- a/2006/src/config/biglib.rules
++++ b/2006/src/config/biglib.rules
+@@ -368,7 +368,7 @@ define build-object-list						@@\
+ @ (set -e;\							@@\
+ 	 case '${MFLAGS}' in *[i]*) set +e;; esac; \		@@\
+ 	 subdirs=Quote(dirs);\					@@\
+-	 list=`/bin/pwd`/$@;\					@@\
++	 list=`pwd`/$@;\					@@\
+ 	 for dir in $$subdirs; do \				@@\
+ 	  (set -e;cd $$dir;SedCmd -e "\=^[^/]=s=^.=$$dir/&=" $@ >> $$list);\@@\
+ 	 done) || (rm $@; exit 1)				@@\
+diff --git a/2006/src/config/imake_boot b/2006/src/config/imake_boot
+index b52d0d3..69cf1b3 100755
+--- a/2006/src/config/imake_boot
++++ b/2006/src/config/imake_boot
+@@ -10,8 +10,8 @@ if [ "$CVSCOSRC" = "" ] ; then
+ fi
+ if [ -f Imakefile ] ; then
+ 	imake -DUseInstalled -I$CVSCOSRC/config \
+-		-DTOPDIR=`/bin/pwd` -DCURDIR= -fImakefile
++		-DTOPDIR=`pwd` -DCURDIR= -fImakefile
+ else
+ 	imake -DUseInstalled -I$CVSCOSRC/config \
+-		-DTOPDIR=`/bin/pwd` -DCURDIR= -f$CVSCOSRC/Imakefile
++		-DTOPDIR=`pwd` -DCURDIR= -f$CVSCOSRC/Imakefile
+ fi
+diff --git a/2006/src/config/linux-lp64.cf b/2006/src/config/linux-lp64.cf
+index e071b2f..3cc5c3b 100644
+--- a/2006/src/config/linux-lp64.cf
++++ b/2006/src/config/linux-lp64.cf
+@@ -173,7 +173,7 @@
+ #define FortranCmd		g77
+ #define XargsCmd		xargs
+ #define FortranSaveFlags	/* */ /* Everything static !? */
+-#define DefaultFCOptions	-fno-automatic -fno-second-underscore -fugly-complex
++#define DefaultFCOptions	-fno-automatic -fno-second-underscore
+ #define CernlibSystem	        -DCERNLIB_LINUX -DCERNLIB_UNIX -DCERNLIB_LNX -DCERNLIB_QMGLIBC -DCERNLIB_QMLXIA64
+ 
+ # endif
+diff --git a/2006/src/config/linux.cf b/2006/src/config/linux.cf
+index cc0bee5..a8dd954 100644
+--- a/2006/src/config/linux.cf
++++ b/2006/src/config/linux.cf
+@@ -258,7 +258,7 @@ endif									@@\
+ #define FortranCmd		g77
+ #define XargsCmd		xargs
+ #define FortranSaveFlags	/* */ /* Everything static !? */
+-#define DefaultFCOptions	-fno-automatic -fno-second-underscore -fugly-complex
++#define DefaultFCOptions	-fno-automatic -fno-second-underscore
+ #define CernlibSystem	        -DCERNLIB_LINUX -DCERNLIB_UNIX -DCERNLIB_LNX -DCERNLIB_QMGLIBC
+ 
+ # endif
+diff --git a/2006/src/packlib/kuip/code_kuip/kkern.c b/2006/src/packlib/kuip/code_kuip/kkern.c
+index 3a5579f..5f3c352 100644
+--- a/2006/src/packlib/kuip/code_kuip/kkern.c
++++ b/2006/src/packlib/kuip/code_kuip/kkern.c
+@@ -543,24 +543,6 @@ char *str0dup( const char *str )
+ 
+ 
+ /*
+- * like strdup() but string is n characters long and not terminated
+- */
+-char *strndup( const char *str,
+-              size_t len )
+-{
+-  size_t bytes = len + 1;
+-  char *p;
+-
+-  if( bytes < ALLOC_MIN_BYTES )
+-    bytes = ALLOC_MIN_BYTES;
+-
+-  p = strncpy( malloc( bytes ), str, len );
+-  p[len] = '\0';
+-  return p;
+-}
+-
+-
+-/*
+  * strdup() of character representation of integer n
+  */
+ char *stridup( int n )
+diff --git a/2006/src/packlib/kuip/code_kuip/kmenu.c b/2006/src/packlib/kuip/code_kuip/kmenu.c
+index f135b07..23007a8 100644
+--- a/2006/src/packlib/kuip/code_kuip/kmenu.c
++++ b/2006/src/packlib/kuip/code_kuip/kmenu.c
+@@ -1404,7 +1404,7 @@ void interactive_find( char *expr, int keym )
+          printf ("See also:\n    ");
+          for (i = 0; i < nval; i++) {
+              if (i == ncmd) continue;
+-             printf (flis_name[i]);
++             printf ("%s", flis_name[i]);
+              if (i < nval-1)
+                 printf (", ");
+              else
+diff --git a/2006/src/packlib/kuip/kuip/kstring.h b/2006/src/packlib/kuip/kuip/kstring.h
+index 7811f15..12a1344 100644
+--- a/2006/src/packlib/kuip/kuip/kstring.h
++++ b/2006/src/packlib/kuip/kuip/kstring.h
+@@ -21,7 +21,6 @@ extern "C" {
+  */
+ 
+ #ifndef WIN32
+-extern void* memmove( void* dst, const void* src, size_t n );
+ #endif
+ 
+ /* GF. make conform to kkern.c#if !defined(__convexc__)*/
+@@ -46,7 +45,6 @@ extern char* str4dup( const char* str1, const char* str2, const char* str3,
+                      const char* str4 );
+ extern char* str5dup( const char* str1, const char* str2, const char* str3,
+                      const char* str4, const char* str5 );
+-extern char* strndup( const char* buf, size_t n );
+ extern char* stridup( int i );
+ 
+ extern char* mstrcat( char* ptr, const char* str );
+diff --git a/2006/src/pawlib/paw/cpaw/bugrep.c b/2006/src/pawlib/paw/cpaw/bugrep.c
+index d503a45..d26e30f 100644
+--- a/2006/src/pawlib/paw/cpaw/bugrep.c
++++ b/2006/src/pawlib/paw/cpaw/bugrep.c
+@@ -432,51 +432,7 @@ br_add_config( char * tmp_file )
+ 
+ static int
+ br_mail_file( char *addr, char *subj, char *file )
+-#if (defined(CERNLIB_UNIX))&&(!defined(CERNLIB_WINNT))&&(!defined(CERNLIB_MACOSX))
+-{
+-        FILE            *mfp, *fp;
+-        char            line[1024], my_addr[L_cuserid];
+-        time_t          clock;
+-        struct tm       *ts;
+-
+-        fp = fopen( file, "r" );
+-        if ( fp == NULL ) {
+-                printf( "BUGREPORT: cannot (re)open temporary file\n" );
+-                return MAIL_ERROR;
+-        }
+-
+-        cuserid( my_addr );
+-
+-        sprintf( line, "/usr/lib/sendmail -t" );
+-        mfp = popen( line, "w" );
+-
+-        if ( mfp == NULL ) {
+-                printf( "BUGREPORT: cannot run sendmail\n" );
+-                return MAIL_ERROR;
+-        }
+-
+-
+-        clock = time( (time_t *) 0 );
+-        ts = localtime( &clock );
+-        strftime( line, sizeof( line ),
+-                "%a, %d %h %y %H:%M:%S", ts );
+-        fprintf ( mfp, "To: %s\n", addr );
+-        fprintf ( mfp, "Bcc: %s\n", my_addr );
+-        fprintf ( mfp, "Date: %s\n", line );
+-        fprintf ( mfp, "Subject: %s\n", subj );
+-        fprintf ( mfp, "\n" );
+-
+-        while( fgets( line, sizeof( line ), fp ) != NULL ) {
+-                fputs( line, mfp );
+-        }
+-        fclose( fp );
+-
+-        pclose( mfp );
+-
+-        return MAIL_OK;
+-}
+-#endif
+-#if defined(CERNLIB_MACOSX)
++#if (defined(CERNLIB_UNIX))&&(!defined(CERNLIB_WINNT))
+ {
+         FILE            *mfp, *fp;
+         char            line[1024], *my_addr;
diff --git a/nixpkgs/pkgs/development/libraries/physics/cernlib/setup-hook.sh b/nixpkgs/pkgs/development/libraries/physics/cernlib/setup-hook.sh
new file mode 100644
index 000000000000..d83759327760
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/cernlib/setup-hook.sh
@@ -0,0 +1,3 @@
+export CERN_LEVEL=@version@
+export CERN=@out@
+export CERN_ROOT=$CERN/$CERN_LEVEL
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..a09f031e7651
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/fastjet-contrib/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl, fastjet }:
+
+stdenv.mkDerivation rec {
+  pname = "fastjet-contrib";
+  version = "1.045";
+
+  src = fetchurl {
+    url = "http://fastjet.hepforge.org/contrib/downloads/fjcontrib-${version}.tar.gz";
+    sha256 = "1y45jx7i30ik2pjv33y16fi5i5jpmi0zp1jh32pwywd3diaiazv6";
+  };
+
+  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 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
new file mode 100644
index 000000000000..35ce8dedca74
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/fastjet/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, python2 }:
+
+stdenv.mkDerivation rec {
+  pname = "fastjet";
+  version = "3.3.4";
+
+  src = fetchurl {
+    url = "http://fastjet.fr/repo/fastjet-${version}.tar.gz";
+    sha256 = "00zwvmnp2j79z95n9lgnq67q02bqfgirqla8j9y6jd8k3r052as3";
+  };
+
+  buildInputs = [ python2 ];
+
+  configureFlags = [
+    "--enable-allcxxplugins"
+    "--enable-pyext"
+    ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "A software package for jet finding in pp and e+e− collisions";
+    license     = lib.licenses.gpl2Plus;
+    homepage    = "http://fastjet.fr/";
+    platforms   = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/fastnlo_toolkit/default.nix b/nixpkgs/pkgs/development/libraries/physics/fastnlo_toolkit/default.nix
new file mode 100644
index 000000000000..fae2ff5a0f22
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/fastnlo_toolkit/default.nix
@@ -0,0 +1,93 @@
+{ lib
+, stdenv
+, fetchFromGitLab
+, autoreconfHook
+, boost
+, gfortran
+, lhapdf
+, ncurses
+, perl
+, python ? null
+, swig
+, yoda
+, zlib
+, withPython ? false
+}:
+
+let
+  tag = "2823";
+in
+
+stdenv.mkDerivation rec {
+  pname = "fastnlo_toolkit";
+  version = "2.5.0pre-${tag}";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.etp.kit.edu";
+    owner = "qcd-public";
+    repo = "fastNLO";
+    rev = tag;
+    hash = "sha256-FEKnEnK90tT4BJJ6MLva9lCl3aYzO1YGdx/8Ol2vM7M=";
+  } + /v2.5/toolkit;
+
+  postPatch = ''
+    # remove duplicate macro, to fix for autoconf 2.70
+    sed -e '0,/AC_CONFIG_MACRO_DIR\([m4]\)/{/AC_CONFIG_MACRO_DIR/d}' -i configure.ac
+  '';
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  buildInputs = [
+    boost
+    gfortran
+    gfortran.cc.lib
+    lhapdf
+    yoda
+  ] ++ lib.optional withPython python
+    ++ lib.optional (withPython && python.isPy3k) ncurses;
+
+  propagatedBuildInputs = [
+    zlib
+  ] ++ lib.optional withPython swig;
+
+  preConfigure = ''
+    substituteInPlace ./fastnlotoolkit/Makefile.in \
+      --replace "-fext-numeric-literals" ""
+  '';
+
+  configureFlags = [
+    "--with-yoda=${yoda}"
+  ] ++ lib.optional withPython "--enable-pyext";
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+  checkInputs = [
+    perl
+    lhapdf.pdf_sets.CT10nlo
+  ];
+  preCheck = ''
+    patchShebangs --build check
+  '';
+  enableParallelChecking = false;
+
+  meta = with lib; {
+    homepage = "http://fastnlo.hepforge.org";
+    description = "Fast pQCD calculations for hadron-induced processes";
+    longDescription = ''
+      The fastNLO project provides computer code to create and evaluate fast
+      interpolation tables of pre-computed coefficients in perturbation theory
+      for observables in hadron-induced processes.
+
+      This allows fast theory predictions of these observables for arbitrary
+      parton distribution functions (of regular shape), renormalization or
+      factorization scale choices, and/or values of alpha_s(Mz) as e.g. needed
+      in PDF fits or in systematic studies. Very time consuming complete
+      recalculations are thus avoided.
+    '';
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ veprbl ];
+    platforms = platforms.unix;
+    broken = stdenv.isAarch64; # failing test "fnlo-tk-stattest.pl"
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/datasets-hook.sh b/nixpkgs/pkgs/development/libraries/physics/geant4/datasets-hook.sh
new file mode 100644
index 000000000000..8aed8b8832b3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/geant4/datasets-hook.sh
@@ -0,0 +1,5 @@
+@name@ () {
+    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
new file mode 100644
index 000000000000..4c6906c9c2e3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix
@@ -0,0 +1,119 @@
+{ lib, stdenv, fetchurl, geant_version }:
+
+let
+  mkDataset = { name, version, sha256, envvar }:
+    stdenv.mkDerivation {
+      inherit name version;
+      inherit geant_version;
+
+      src = fetchurl {
+        url = "https://cern.ch/geant4-data/datasets/${name}.${version}.tar.gz";
+        inherit sha256;
+      };
+
+      preferLocalBuild = true;
+      dontBuild = true;
+      dontConfigure = true;
+
+      datadir = "${placeholder "out"}/share/Geant4-${geant_version}/data/${name}${version}";
+      installPhase = ''
+        mkdir -p $datadir
+        mv ./* $datadir
+      '';
+
+      inherit envvar;
+      setupHook = ./datasets-hook.sh;
+
+      meta = with lib; {
+        description = "Data files for the Geant4 toolkit";
+        homepage = "https://geant4.web.cern.ch/support/download";
+        license = licenses.g4sl;
+        platforms = platforms.all;
+      };
+    };
+in
+  builtins.listToAttrs (map (a: { inherit (a) name; value = mkDataset a; }) [
+    {
+      name = "G4NDL";
+      version = "4.6";
+      sha256 = "022l2jjhi57frfdv9nk6s6q23gmr9zkix06fmni8gf0gmvr7qa4x";
+      envvar = "NEUTRONHP";
+    }
+
+    {
+      name = "G4EMLOW";
+      version = "7.13";
+      sha256 = "0scczd4ismvd4g3vfshbvwv92bzkdjz0ma7y21n6qxxy96v9cj1p";
+      envvar = "LE";
+    }
+
+    {
+      name = "G4PhotonEvaporation";
+      version = "5.7";
+      sha256 = "1rg7fygfxx06h98ywlci6b0b9ih74q8diygr76c3vppxdzjl47kn";
+      envvar = "LEVELGAMMA";
+    }
+
+    {
+      name = "G4RadioactiveDecay";
+      version = "5.6";
+      sha256 = "1w8d9zzc4ss7sh1f8cxv5pmrx2b74p1y26377rw9hnlfkiy0g1iq";
+      envvar = "RADIOACTIVE";
+    }
+
+    {
+      name = "G4SAIDDATA";
+      version = "2.0";
+      sha256 = "149fqy801n1pj2g6lcai2ziyvdz8cxdgbfarax6y8wdakgksh9hx";
+      envvar = "SAIDXS";
+    }
+
+    {
+      name = "G4PARTICLEXS";
+      version = "3.1.1";
+      sha256 = "1nmgy8w1s196php7inrkbsi0f690qa2dsyj9s1sp75mndkfpxhb6";
+      envvar = "PARTICLEXS";
+    }
+
+    {
+      name = "G4ABLA";
+      version = "3.1";
+      sha256 = "1v97q28g1xqwnav0lwzwk7hc3b87yrmbvkgadf4bkwcbnm9b163n";
+      envvar = "ABLA";
+    }
+
+    {
+      name = "G4INCL";
+      version = "1.0";
+      sha256 = "0z9nqk125vvf4f19lhgb37jy60jf9zrjqg5zbxbd1wz93a162qbi";
+      envvar = "INCL";
+    }
+
+    {
+      name = "G4PII";
+      version = "1.3";
+      sha256 = "09p92rk1sj837m6n6yd9k9a8gkh6bby2bfn6k0f3ix3m4s8as9b2";
+      envvar = "PII";
+    }
+
+    {
+      name = "G4ENSDFSTATE";
+      version = "2.3";
+      sha256 = "00wjir59rrrlk0a12vi8rsnhyya71rdi1kmark9sp487hbhcai4l";
+      envvar = "ENSDFSTATE";
+    }
+
+    {
+      name = "G4RealSurface";
+      version = "2.2";
+      sha256 = "08382y1258ifs7nap6zaaazvabg72blr0dkqgwk32lrg07hdwm4r";
+      envvar = "REALSURFACE";
+    }
+
+    {
+      name = "G4TENDL";
+      version = "1.3.2";
+      sha256 = "0jdqmz3rz5a7yrq1mli6dj3bnmn73igf4fdxwfbl3rxywg38fa9v";
+      envvar = "PARTICLEHP";
+    }
+  ])
diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix b/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix
new file mode 100644
index 000000000000..8d2f2f1ef55d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix
@@ -0,0 +1,143 @@
+{ enableMultiThreading ? true
+, enableG3toG4         ? false
+, enableInventor       ? false
+, enableGDML           ? false
+, enableQT             ? false
+, enableXM             ? false
+, enableOpenGLX11      ? true
+, enablePython         ? false
+, enableRaytracerX11   ? false
+
+# Standard build environment with cmake.
+, lib, stdenv, fetchurl, fetchpatch, cmake
+
+# Optional system packages, otherwise internal GEANT4 packages are used.
+, clhep ? null # not packaged currently
+, expat
+, zlib
+
+# For enableGDML.
+, xercesc
+
+# For enableQT.
+, qtbase
+, wrapQtAppsHook
+
+# For enableXM.
+, motif
+
+# For enableInventor
+, coin3d
+, soxt
+, libXpm
+
+# For enableQT, enableXM, enableOpenGLX11, enableRaytracerX11.
+, libGLU, libGL
+, xlibsWrapper
+, libXmu
+
+# For enablePython
+, boost
+, python3
+
+# For tests
+, callPackage
+}:
+
+let
+  boost_python = boost.override { enablePython = true; python = python3; };
+in
+
+stdenv.mkDerivation rec {
+  version = "10.7.1";
+  pname = "geant4";
+
+  src = fetchurl{
+    url = "https://geant4-data.web.cern.ch/geant4-data/releases/geant4.10.07.p01.tar.gz";
+    sha256 = "07if874aljizkjyp21qj6v193pmyifyfmwi5kg8jm71x79sn2laj";
+  };
+
+  boost_python_lib = "python${builtins.replaceStrings ["."] [""] python3.pythonVersion}";
+  postPatch = ''
+    # Fix for boost 1.67+
+    substituteInPlace environments/g4py/CMakeLists.txt \
+      --replace "REQUIRED python" \
+                "REQUIRED COMPONENTS $boost_python_lib"
+    substituteInPlace environments/g4py/G4PythonHelpers.cmake \
+      --replace "Boost::python" "Boost::$boost_python_lib"
+  '';
+
+  cmakeFlags = [
+    "-DGEANT4_INSTALL_DATA=OFF"
+    "-DGEANT4_USE_GDML=${if enableGDML then "ON" else "OFF"}"
+    "-DGEANT4_USE_G3TOG4=${if enableG3toG4 then "ON" else "OFF"}"
+    "-DGEANT4_USE_QT=${if enableQT then "ON" else "OFF"}"
+    "-DGEANT4_USE_XM=${if enableXM then "ON" else "OFF"}"
+    "-DGEANT4_USE_OPENGL_X11=${if enableOpenGLX11 then "ON" else "OFF"}"
+    "-DGEANT4_USE_INVENTOR=${if enableInventor then "ON" else "OFF"}"
+    "-DGEANT4_USE_PYTHON=${if enablePython then "ON" else "OFF"}"
+    "-DGEANT4_USE_RAYTRACER_X11=${if enableRaytracerX11 then "ON" else "OFF"}"
+    "-DGEANT4_USE_SYSTEM_CLHEP=${if clhep != null then "ON" else "OFF"}"
+    "-DGEANT4_USE_SYSTEM_EXPAT=${if expat != null then "ON" else "OFF"}"
+    "-DGEANT4_USE_SYSTEM_ZLIB=${if zlib != null then "ON" else "OFF"}"
+    "-DGEANT4_BUILD_MULTITHREADED=${if enableMultiThreading then "ON" else "OFF"}"
+  ] ++ lib.optionals (enableMultiThreading && enablePython) [
+    "-DGEANT4_BUILD_TLS_MODEL=global-dynamic"
+  ] ++ lib.optionals enableInventor [
+    "-DINVENTOR_INCLUDE_DIR=${coin3d}/include"
+    "-DINVENTOR_LIBRARY_RELEASE=${coin3d}/lib/libCoin.so"
+  ];
+
+  nativeBuildInputs =  [
+    cmake
+  ] ++ lib.optionals enableQT [
+    wrapQtAppsHook
+  ];
+
+  dontWrapQtApps = !enableQT;
+
+  buildInputs = [ libGLU xlibsWrapper libXmu ]
+    ++ lib.optionals enableInventor [ libXpm coin3d soxt motif ]
+    ++ lib.optionals enablePython [ boost_python python3 ];
+
+  propagatedBuildInputs = [ clhep expat zlib libGL ]
+    ++ lib.optionals enableGDML [ xercesc ]
+    ++ lib.optionals enableXM [ motif ]
+    ++ lib.optionals enableQT [ qtbase ];
+
+  postFixup = ''
+    # Don't try to export invalid environment variables.
+    sed -i 's/export G4\([A-Z]*\)DATA/#export G4\1DATA/' "$out"/bin/geant4.sh
+  '' + lib.optionalString enableQT ''
+    wrapQtAppsHook
+  '';
+
+  setupHook = ./geant4-hook.sh;
+
+  passthru = {
+    data = import ./datasets.nix {
+          inherit lib stdenv fetchurl;
+          geant_version = version;
+      };
+
+    tests = callPackage ./tests.nix {};
+  };
+
+  # Set the myriad of envars required by Geant4 if we use a nix-shell.
+  shellHook = ''
+    source $out/nix-support/setup-hook
+  '';
+
+  meta = with lib; {
+    description = "A toolkit for the simulation of the passage of particles through matter";
+    longDescription = ''
+      Geant4 is a toolkit for the simulation of the passage of particles through matter.
+      Its areas of application include high energy, nuclear and accelerator physics, as well as studies in medical and space science.
+      The two main reference papers for Geant4 are published in Nuclear Instruments and Methods in Physics Research A 506 (2003) 250-303, and IEEE Transactions on Nuclear Science 53 No. 1 (2006) 270-278.
+    '';
+    homepage = "http://www.geant4.org";
+    license = licenses.g4sl;
+    maintainers = with maintainers; [ tmplt omnipotententity ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/geant4-hook.sh b/nixpkgs/pkgs/development/libraries/physics/geant4/geant4-hook.sh
new file mode 100644
index 000000000000..0b775d432831
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/geant4/geant4-hook.sh
@@ -0,0 +1 @@
+source @out@/bin/geant4.sh
diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/tests.nix b/nixpkgs/pkgs/development/libraries/physics/geant4/tests.nix
new file mode 100644
index 000000000000..83afee6089d4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/geant4/tests.nix
@@ -0,0 +1,31 @@
+{ stdenv, cmake, geant4 }:
+
+{
+  example_B1 = stdenv.mkDerivation {
+    name = "${geant4.name}-test-example_B1";
+
+    inherit (geant4) src;
+
+    nativeBuildInputs = [ cmake ];
+    buildInputs = [ geant4 ];
+    checkInputs = with geant4.data; [
+      G4EMLOW
+      G4ENSDFSTATE
+      G4PARTICLEXS
+      G4PhotonEvaporation
+    ];
+
+    prePatch = ''
+      cd examples/basic/B1
+    '';
+
+    doCheck = true;
+    checkPhase = ''
+      runHook preCheck
+
+      ./exampleB1 ../run2.mac
+
+      runHook postCheck
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/hepmc2/default.nix b/nixpkgs/pkgs/development/libraries/physics/hepmc2/default.nix
new file mode 100644
index 000000000000..e2ab42c418a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/hepmc2/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "hepmc";
+  version = "2.06.11";
+
+  src = fetchurl {
+    url = "http://hepmc.web.cern.ch/hepmc/releases/HepMC-${version}.tar.gz";
+    sha256 = "1pp89bs05nv60wjk1690ndwh4dsd5mk20bzsd4a2lklysdifvb6f";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    "-Dmomentum:STRING=GEV"
+    "-Dlength:STRING=MM"
+  ];
+
+  meta = with lib; {
+    description = "The HepMC package is an object oriented event record written in C++ for High Energy Physics Monte Carlo Generators";
+    license     = licenses.lgpl21;
+    homepage    = "http://hepmc.web.cern.ch/hepmc/";
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/hepmc3/default.nix b/nixpkgs/pkgs/development/libraries/physics/hepmc3/default.nix
new file mode 100644
index 000000000000..629066d23a4e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/hepmc3/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchurl, cmake, coreutils, python, root }:
+
+let
+  pythonVersion = with lib.versions; "${major python.version}${minor python.version}";
+  withPython = python != null;
+  # ensure that root is built with the same python interpreter, as it links against numpy
+  root_py = if withPython then root.override { inherit python; } else root;
+in
+
+stdenv.mkDerivation rec {
+  pname = "hepmc3";
+  version = "3.2.4";
+
+  src = fetchurl {
+    url = "http://hepmc.web.cern.ch/hepmc/releases/HepMC3-${version}.tar.gz";
+    sha256 = "sha256-4Ij8z9GmwvjhCJ9FcQG+4eXHqXd+nVHGQZyKKIpJ4bs=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ root_py ]
+    ++ lib.optional withPython python;
+
+  cmakeFlags = [
+    "-DHEPMC3_ENABLE_PYTHON=${if withPython then "ON" else "OFF"}"
+  ] ++ lib.optionals withPython [
+    "-DHEPMC3_PYTHON_VERSIONS=${if python.isPy3k then "3.X" else "2.X"}"
+    "-DHEPMC3_Python_SITEARCH${pythonVersion}=${placeholder "out"}/${python.sitePackages}"
+  ];
+
+  postInstall = ''
+    substituteInPlace "$out"/bin/HepMC3-config \
+      --replace 'greadlink' '${coreutils}/bin/readlink' \
+      --replace 'readlink' '${coreutils}/bin/readlink'
+  '';
+
+  doInstallCheck = withPython;
+  # prevent nix from trying to dereference a null python
+  installCheckPhase = lib.optionalString withPython ''
+    PYTHONPATH=${placeholder "out"}/${python.sitePackages} python -c 'import pyHepMC3'
+  '';
+
+  meta = with lib; {
+    description = "The HepMC package is an object oriented, C++ event record for High Energy Physics Monte Carlo generators and simulation";
+    license = licenses.gpl3;
+    homepage = "http://hepmc.web.cern.ch/hepmc/";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/herwig/default.nix b/nixpkgs/pkgs/development/libraries/physics/herwig/default.nix
new file mode 100644
index 000000000000..0a7e9b4d948e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/herwig/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, boost, fastjet, gfortran, gsl, lhapdf, thepeg, zlib, autoconf, automake, libtool }:
+
+stdenv.mkDerivation rec {
+  pname = "herwig";
+  version = "7.2.2";
+
+  src = fetchurl {
+    url = "https://www.hepforge.org/archive/herwig/Herwig-${version}.tar.bz2";
+    sha256 = "10y3fb33zsinr0z3hzap9rsbcqhy1yjqnv4b4vz21g7mdlw6pq2k";
+  };
+
+  nativeBuildInputs = [ autoconf automake libtool ];
+
+  buildInputs = [ boost fastjet gfortran gsl thepeg zlib ]
+    # There is a bug that requires for default PDF's to be present during the build
+    ++ (with lhapdf.pdf_sets; [ CT14lo CT14nlo ]);
+
+  postPatch = ''
+    patchShebangs ./
+  '';
+
+  configureFlags = [
+    "--with-thepeg=${thepeg}"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A multi-purpose particle physics event generator";
+    homepage = "https://herwig.hepforge.org/";
+    license = licenses.gpl3Only;
+    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/hoppet/default.nix b/nixpkgs/pkgs/development/libraries/physics/hoppet/default.nix
new file mode 100644
index 000000000000..7ad5b9861a1d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/hoppet/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, gfortran, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "hoppet";
+  version = "1.2.0";
+
+  src = fetchurl {
+    url = "https://hoppet.hepforge.org/downloads/${pname}-${version}.tgz";
+    sha256 = "0j7437rh4xxbfzmkjr22ry34xm266gijzj6mvrq193fcsfzipzdz";
+  };
+
+  buildInputs = [ gfortran ];
+  nativeBuildInputs = [ perl ];
+
+  enableParallelBuilding = true;
+
+  preConfigure = ''
+    patchShebangs .
+  '';
+
+  meta = with lib; {
+    description = "Higher Order Perturbative Parton Evolution Toolkit";
+    license     = licenses.gpl2;
+    homepage    = "https://hoppet.hepforge.org";
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/lhapdf/default.nix b/nixpkgs/pkgs/development/libraries/physics/lhapdf/default.nix
new file mode 100644
index 000000000000..143f72541b4d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/lhapdf/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, python, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "lhapdf";
+  version = "6.3.0";
+
+  src = fetchurl {
+    url = "https://www.hepforge.org/archive/lhapdf/LHAPDF-${version}.tar.gz";
+    sha256 = "0pcvigpjqzfng06n98bshhhpimiqfg416ak8lz8jdgp6nxr8fkgd";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ python ];
+
+  enableParallelBuilding = true;
+
+  passthru = {
+    pdf_sets = import ./pdf_sets.nix { inherit lib stdenv fetchurl; };
+  };
+
+  postInstall = ''
+    wrapProgram $out/bin/lhapdf --prefix PYTHONPATH : "$(toPythonPath "$out")"
+  '';
+
+  meta = with lib; {
+    description = "A general purpose interpolator, used for evaluating Parton Distribution Functions from discretised data files";
+    license     = licenses.gpl2;
+    homepage    = "http://lhapdf.hepforge.org";
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/lhapdf/maintainer.sh b/nixpkgs/pkgs/development/libraries/physics/lhapdf/maintainer.sh
new file mode 100755
index 000000000000..92c225f90ccd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/lhapdf/maintainer.sh
@@ -0,0 +1,13 @@
+#!/bin/bash
+
+set -xe
+
+: ${SED:="$(nix-build '<nixpkgs>' -A gnused --no-out-link)/bin/sed"}
+
+BASE_URL="https://lhapdfsets.web.cern.ch/lhapdfsets/current/"
+
+for pdf_set in `curl -L $BASE_URL 2>/dev/null | "$SED" -e "s/.*<a href=\"\([^\"/]*.tar.gz\)\".*/\1/;tx;d;:x" | sort -u`; do
+	echo -n "    \"${pdf_set%.tar.gz}\" = \""
+	nix-prefetch-url "${BASE_URL}${pdf_set}" 2>/dev/null | tr -d '\n'
+	echo "\";"
+done
diff --git a/nixpkgs/pkgs/development/libraries/physics/lhapdf/pdf_sets.nix b/nixpkgs/pkgs/development/libraries/physics/lhapdf/pdf_sets.nix
new file mode 100644
index 000000000000..694164f5af2e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/lhapdf/pdf_sets.nix
@@ -0,0 +1,1067 @@
+{ lib, stdenv, fetchurl }:
+
+let
+  mkPdfSet = name: sha256:
+    stdenv.mkDerivation {
+      inherit name;
+
+      src = fetchurl {
+        url = "https://lhapdfsets.web.cern.ch/lhapdfsets/current/${name}.tar.gz";
+        inherit sha256;
+      };
+
+      preferLocalBuild = true;
+
+      installPhase = ''
+        mkdir -p $out/${name}/
+        cp * $out/${name}/
+      '';
+
+      setupHook = ./pdfset-hook.sh;
+    };
+in
+  lib.mapAttrs mkPdfSet {
+    "ABMP15_3_nnlo" = "028q5xixxjxhb8sr7l5v5mwh9mkszm5m59fgnpb69yxvv40a70v0";
+    "ABMP15_4_nnlo" = "11zjp4dxmgp69kdkmdwqkpsajvwjrbwylmwgs56mgjb0vgb8wk0i";
+    "ABMP15_5_nnlo" = "0z47g5fwh53gg5ws5bbip5q2m5mm7vl09q2w58g6ah9dk25r10ll";
+    "ABMP16_3_nlo" = "1ylppc7clyk74mr7qgk0r2cknj2m58y38r3h1dfhjjjmdkw1g1sn";
+    "ABMP16_3_nnlo" = "0bwirm3wqyjj6i3asya7kjmmjhqi69l1rnc6gnq7v136ajmv96y0";
+    "ABMP16_4_nlo" = "0wx00x98wgvhwsj2fg4kp76n9fhv2s5mbar75dsp6xs4v0d1w1g3";
+    "ABMP16_4_nnlo" = "1cw52ijyrhgvyqc28pp278bavy9acvs6qywysgc7qjifygb14mca";
+    "ABMP16_5_nlo" = "0s7yz85fjfkmmxj3xdkhz5658n3nx8rr4yjz4hrqbcy00zdcscr2";
+    "ABMP16_5_nnlo" = "0iyypvj4645g7nh8w6v88pz37p81bxilgc4p7wlkaa90hiq0wrk0";
+    "ABMP16als112_5_nnlo" = "17kg6gvl09p5gm99yb9d8hkl1q51904qflsziv3r5ybxs18ym5g8";
+    "ABMP16als113_5_nnlo" = "1gaiyq70zxx7c7c0gkkad3ygbhdwc563al2a6ksy78q8is3bhdy9";
+    "ABMP16als114_5_nlo" = "0vnwbz6v2d02d5r34ysd7b4d22h948f3zri2n3yj93k6za9y42gw";
+    "ABMP16als114_5_nnlo" = "1gd41d8ay8i8m35qfqsm96jcv8vx6hpdsrdzsj415f4zpw5j29fm";
+    "ABMP16als115_5_nlo" = "0pyk43d6v3hzcq487nzj5awd2zhcjbg9ak0pcs1lykhvxwm227hz";
+    "ABMP16als115_5_nnlo" = "0i70z8i0qgzr875szdh8sa6x3xcdkvrfsba97a6ha7b6km4p1yjk";
+    "ABMP16als116_5_nlo" = "0nyrcb3hbzngj5j3yhpwlnz8a7dx7higngzmp26kmcrr4bmhiq6w";
+    "ABMP16als116_5_nnlo" = "11rph6vmmvvsi8msfp2agb7747n7xjgxb7z766i5jkvnggbmz75m";
+    "ABMP16als117_5_nlo" = "1pfjdxxdwrwz5n5206jcv61l8ycliwigqgram6hlm8ibl9a828cy";
+    "ABMP16als117_5_nnlo" = "1sz9hy2m983aiwyssg60v4kq1zvz4xxvbzrgsdik1qv13bj4wx9w";
+    "ABMP16als118_5_nlo" = "0ddaf2a7v3kdynsmls6zxld9zflv9m8qkp8gibc5xd6vqsg64f8x";
+    "ABMP16als118_5_nnlo" = "1slvr5ygwwryk63mah45xp5x31qwrf0gkrnh4p9fvl4rdkji6z0z";
+    "ABMP16als119_5_nlo" = "1brv76x4z0r0vrxr51gqvfzn4d03srhvab6dmxhhj3sy23qnbxg5";
+    "ABMP16als119_5_nnlo" = "1iqs1bi8r22awflf698cj39q8s2w86fwvdfgqb6sr8csm36ih6qp";
+    "ABMP16als120_5_nlo" = "133vy2zhvh49fa9xkp889mxy6xbriv10q8r4lx74wb9d1kqwfx81";
+    "ABMP16als120_5_nnlo" = "051bqfyh2017vnvlisvkm1ik6x7n829p8205f5algsw7wi1s7b9v";
+    "ABMP16als121_5_nlo" = "1l41qgba24rslg6ascsn1i0y0y0d7yh6hszhclxqyn07gzwq7p78";
+    "ABMP16als122_5_nlo" = "1ivy4m9fah8i0ipfxfq8caxa7pz8y86wgrqydg9wal9qin8n8xcd";
+    "ABMP16als123_5_nlo" = "0gcf7dqr1gzjfa6iy0qzivyibw72qpagfda0a5aksd0h6aap5mxc";
+    "ABMP16free_3_nlo" = "1hxlbmc2kzd8yai7ipyc95khdsawdcnzxzr0vkk3h42fxczx9y6q";
+    "ABMP16free_4_nlo" = "1ckwbyj18bgvpv16r6lx3866ca4frq6rxmzvz14ak6h8mpwvcnmq";
+    "ABMP16free_5_nlo" = "0sbkrn3g4048bn0y5bm6dqpn1za3761n6x40k7i4pdi0b1g7zlc0";
+    "ATLAS-epWZ12-EIG" = "010ddmyfrmscgd1xdjsxsjc773jlvbh3s6mjbwk9zd298i3bf4kx";
+    "ATLAS-epWZ12-VAR" = "1r9ip8549dzhs02skm8v00g6nsh7q1rwd3syz3bd6cl4sqhs0k37";
+    "ATLAS-epWZ16-EIG" = "0b1zzp8p0kh4xjn76nm6waqlvdpqvnwyqsnnqdp2n7b9r9ssryyf";
+    "ATLAS-epWZ16-THEO" = "0b0wqa203b2x159y54xhf9yh34lkchp48vp9693k51g9aznx8gjm";
+    "ATLAS-epWZ16-VAR" = "1zkhlv8yxfla46gj57119w9prsd3zyy5vg275bayfwa6b71gmc0b";
+    "ATLAS-epWZtop18-EIG" = "069rysd9mf3cshx7xkcv7735ydh2g6szvljbfkcqwckaqjg2x3v5";
+    "ATLAS-epWZtop18-VAR" = "0hpyp52dwl8fnw47pyw8g7fsz97wr6sk4yli6sx0zbj8yy2j28yj";
+    "CJ12max" = "1vk2zkaiqbl6fixaxy7mrggmmxv7lvnw736lxm5sh25dapg6s8ag";
+    "CJ12mid" = "0s2558ihypn0l9qqx25qwnawbc7fkbi2wwwhbyb108rjk2klaf8v";
+    "CJ12min" = "1kdla638m3axr65ndid9irmqhby4gl084r297xw3jxxlrb0b7hj9";
+    "CJ15lo" = "0hww26wbcb3i61z41s518gj41mn5gcikb08pdzyb5vyrl63b39bf";
+    "CJ15nlo" = "0acmyr5zpb7yzs2pikhgf8nx8l7csmai4sv361l7x3miqir56ss4";
+    "CSKK_nnlo_EIG" = "0fdc2a7xax7xl5n5f3ff5dcf7zbpk43z4kfy3ffij2qykrwfx7bp";
+    "CSKK_nnlo_THEO" = "0srs535f9xydqfzyy208304yxah1rg1r5ilx8hk9nvgaiy7kwnvq";
+    "CSKK_nnlo_VAR" = "1iyiam3kbjrckh0sw290hwi04h5cqif081afgd16f0a44wbcjsi1";
+    "CT09MC1" = "18ap08vh1f4ivibq5z57wv7lwvw1pzwl865xznzzcr0jy4f59103";
+    "CT09MC2" = "04yxg4bl0dcgh6hb9g223wm084w0q1y2lbd4z7w8vmvvvn579ij8";
+    "CT09MCS" = "01vjpdgy79gvk3w4blwjgfqpf50mjdi5kmfcgnlnwxp5q0804pgf";
+    "CT10" = "17glhnqj4yknqy70zs7m097n1qq9fqljj3mna6qxchmgql04dvxw";
+    "CT10as" = "1709bb3ky4mpn4cgx9lda8swmvb2pl70ly1gzk4ahgsflkb8iaj3";
+    "CT10f3" = "0ijrx0wm03r0yg6f0n4vwp1c3kypdjpmmnv12gk79y193bfk362l";
+    "CT10f4" = "14icbh8lg9290wfalr1bsx0zff1df19x0qrjqh8n0y9ckqmkbh6l";
+    "CT10nlo" = "14ib003sxpxc8awywjckbw124aqhmi70wg4hlwc2nvdh46sqk11b";
+    "CT10nlo_as_0112" = "0n2abywijgjys56kz5qm30arh3v5k685l0gayl4mdablbw0ccaca";
+    "CT10nlo_as_0113" = "123kbzzfjlparffgmqpimygzjcn0wi1vnyrkjfjn2kwcdjazz8dp";
+    "CT10nlo_as_0114" = "17lgcbf7914dfb89d4v8fal69zq7gmadvha8gpz0wfw4p0pq765b";
+    "CT10nlo_as_0115" = "0rgpc3mcsd18yg4j41k9hhvbjbi3d1zrd9fq1314m4qvviq6d9j7";
+    "CT10nlo_as_0116" = "15xyhmipv9xbiz3jaqdj59nyczn35nq14183xz4py68l2v20smqi";
+    "CT10nlo_as_0117" = "1qf9azafrwqpyp5flc912g2frfpi899vb032yrrgqj2l1flg474x";
+    "CT10nlo_as_0118" = "1jra85s6df6vvmljkf8gg2jkj3r6b1yl6aidzlm3j59di0fk9xp8";
+    "CT10nlo_as_0119" = "0y7k0w592j777jpbrh8v2zh1l6n38xbxjvyiv5x4pvwi6zrp9ppf";
+    "CT10nlo_as_0120" = "0mh1hdmic5c3krlb1xypy0n6r86r7da0ay9183xwb68d1kh4j630";
+    "CT10nlo_as_0121" = "1gwvgj3bwv8fz8mbmgnfsy0bvsm4h9d898mf1kcaaivh56sfial8";
+    "CT10nlo_as_0122" = "1jkkqcmjynd30paxc9z9gpmxkfhs6ad3x5sms5980jx291rc8hgd";
+    "CT10nlo_as_0123" = "0gppcp49275pg3yv37mzkx7az6298wwy7gqla3gzxfzlas0ybg0b";
+    "CT10nlo_as_0124" = "1irl19q4wyw36dwhln1m4y7y40by5xgdjqpgj7sqaix8jvijc9bz";
+    "CT10nlo_as_0125" = "17c6n2prdsry2phqmaykrf1yc02mvhacb87r7yl0nhkhx80kysk2";
+    "CT10nlo_as_0126" = "183p4fd85zs2c1j0zwfsa08wq6v780xvwbg44bpm52m4ih1dgqy3";
+    "CT10nlo_as_0127" = "1vcpadkf90x9qiqaplc25hld7qljk5d3lzs1dssqi5fh1kci8qd1";
+    "CT10nlo_nf3" = "1dfzas3z075riwx26bkmvjck42pjgbm32d1flg5rccsxjn4pmmm0";
+    "CT10nlo_nf4" = "0npv1h5gi2vhgxzcbcsl740z2p7j9p8pg3jwfb0yz88wlbj5bkah";
+    "CT10nnlo" = "1la35l1b3hxdkihh9vkibfh68rghcfgq48q27x2b05dfhcvcz9lz";
+    "CT10nnlo_as_0110" = "0j1f6lbjhwcpgfb8kwzsij0hfmzb3dggi6zwwv9f2w39ax2rfb8i";
+    "CT10nnlo_as_0111" = "1519hvpi1zrjk8p31ksna39n9l8v02ggj5q775q243p9qyfayxlf";
+    "CT10nnlo_as_0112" = "0asnbr0va5p1j81kmv8ar267aciap638kcb48cs5ghz9fvhxp197";
+    "CT10nnlo_as_0113" = "1j5cfbv1d5q2hscyrvig6xkk7gfv4x5cxn1142qmd8pdm9ky2fdb";
+    "CT10nnlo_as_0114" = "03rkvf4ljv7bnzp0fyyrypbbx4rxd1y6id3dfvg4w22s65kp0csm";
+    "CT10nnlo_as_0115" = "1d8rkwvnymx4pi0v1s2vbc880mggdmfnzjppd7fghjqj4lkkanyi";
+    "CT10nnlo_as_0116" = "039i2bq4xr6hlvg0syzmyfv4lm7lrwr59myrhd609dybiky4aqd8";
+    "CT10nnlo_as_0117" = "0q3a5lbpxh24zv7ypbc680kqrkwy5m7xbgx5v44b6cdzlib6lvsn";
+    "CT10nnlo_as_0118" = "0b11mpgrkqn2n37asg8qg3qmhdhbr8lmj8qjixxpca0h1j7m71a5";
+    "CT10nnlo_as_0119" = "1j411yqrlbhqmby8mplgghmb4zxclf1h3pdsffx9iv8sq1q6dy2i";
+    "CT10nnlo_as_0120" = "1djf9qfqrywpsyv0w6igidg9a4ca739dvqgc7qz7qg2bpclbaly9";
+    "CT10nnlo_as_0121" = "0nlm5iwcvb02fd7kan4yp60qbc0fgir4dii3xg03n42xzqixy2qm";
+    "CT10nnlo_as_0122" = "1kwq04i5ln8wv32vf4akjnzid3jdq67zccfg7xriqrwd9367x5kv";
+    "CT10nnlo_as_0123" = "0w4fmsmyci09v0cxnmhdbqxv3xq3wa9ma7m4g39sg2gdsxqz1rgd";
+    "CT10nnlo_as_0124" = "0yzrj1pdigssi39z21k9jxbiahhc1785rjxhq7xl8zx38paspbg7";
+    "CT10nnlo_as_0125" = "0qvdvj3wkbkw0b0zv79ybds2pk5z9kbriwsm5ffpnycrfkzrm2kd";
+    "CT10nnlo_as_0126" = "1cf8bqi1g4c3xqg5k9m4fa8v8bcnwkzblmfn7zc396pgbzhhz610";
+    "CT10nnlo_as_0127" = "0zknrx60h8jdf2pfg2zq6xk73hn86gcv69ml78ik5ms0y5gp21av";
+    "CT10nnlo_as_0128" = "09yn8l3nv29frj3xn9pafiz2iamccp8ii8j7hmp63iaji6c7m5fg";
+    "CT10nnlo_as_0129" = "1ypq63r5myz2phn4y5sbb5dbxvycwis8jixjl0n95xmqlx5zhixi";
+    "CT10nnlo_as_0130" = "0ilr6ijbbh1zki66ma006h1qhdq7wmzm0ipki78bk01jnr5yl5sg";
+    "CT10w" = "1qkwz1drbkxcb4gskkfn0r7fsa6g9hjlc8716m633x35kha1v52j";
+    "CT10was" = "00s4n3nkngwyhh82l132v88c4jgkg03ff4x7m7nna21lvkv4wkb3";
+    "CT10wf3" = "1r43pzb1291bjcmahgfh0f86pvb3nhdpxw7gikqmypdmck0n2mqf";
+    "CT10wf4" = "18bf9k0jp95y9yz0m896sdzy9q1fyp0r4f5hrv4jq4d1z84zdis5";
+    "CT10wnlo" = "17wsw6p0h618q68swn9mjsahfyqikjgsiykiby7y27ryairv709n";
+    "CT10wnlo_as_0112" = "0p7mh56zyqh9i72llbmjchwm50ifa358snd8i1nqr3r6lr5265hb";
+    "CT10wnlo_as_0113" = "0nl4lk3cscsn6p50b3qqaabqfnkn5xgjmcxvfrr1n4njh411kmln";
+    "CT10wnlo_as_0114" = "1vck1i34dspbzskzpbqxbq11gp79drlrik52waklvsl5110xawnv";
+    "CT10wnlo_as_0115" = "070cl0prprqqkkzwxnvyw7r4ivvs8slb98v5yza0gvpwck0blnzn";
+    "CT10wnlo_as_0116" = "0v50pyjqpcrarbx886la0hr6vwvnavsldm9amcdp1vlck5w8mmg9";
+    "CT10wnlo_as_0117" = "108sb5h79mpgkvdzqlx830dykba5kw9zqgxa60i7bcyjnv0277si";
+    "CT10wnlo_as_0118" = "0zf335291hwfmdbhgl5v2y5pbc9slm7dmjfkijdv0jm33drpkcg2";
+    "CT10wnlo_as_0119" = "0kvwc0k5y51p4qvlb6hhxvn9c2n8x0xn0xyp5zkz75ad3vaz9yvn";
+    "CT10wnlo_as_0120" = "0yvbcni3xf718xild7s9g6cxw7dwa38f4iqdm5z7dd9ahxyw9rxv";
+    "CT10wnlo_as_0121" = "1z0mlrbdn8a9n6h0jpha3p1lqz4iamrwa80svqn9y4qii9h5pjkn";
+    "CT10wnlo_as_0122" = "1dh5czjvyjnwlzc14vz91693pr3nyls5g926g347rdrkqkjq8dcz";
+    "CT10wnlo_as_0123" = "0nf7qpgb83ahm5dkzr10xafhcx4lvb3zlxnz70jczl1jd4v2cld9";
+    "CT10wnlo_as_0124" = "14h07z06csxb6v6ai1w5ba0kygnsrzdwxr2nx1kcn93axcsqqbhv";
+    "CT10wnlo_as_0125" = "0g0w6mwy5y4l36cn4z8gfmigzharyn5xqk5ricasracrnf7ydix2";
+    "CT10wnlo_as_0126" = "0dbkkyimpll9r3979vbk4xqi5cfhzr6b28x6j73fbxxxi1xfavl5";
+    "CT10wnlo_as_0127" = "1svmgs55kg74rifjyns38lggv1c18mzmpmvsv116rrllklb19pfp";
+    "CT10wnlo_nf3" = "1m13if0d9xijq695x41snpwwrsgs5a0jvil6j2ww8cspc33d7vr3";
+    "CT10wnlo_nf4" = "1b9lz23rn2w7fqwxxgf6fcg620ac58dnb1ssj3ml3vfn7z88yx43";
+    "CT14MC1nlo" = "0z82q7xr9agq8iyw7w2rcclh27mry5snn5jswn3cxpgnalls50rx";
+    "CT14MC1nnlo" = "0fj6hjdv82fp4iv7iyk9gna7sksnpkgqx0bsrl2wjbigm4ys031g";
+    "CT14MC2nlo" = "1x6a6js1jpvkykagz6w3klh6hb2wf56r3kh65i6qlnzak4m7b8sq";
+    "CT14MC2nnlo" = "0hbdz8agjm16mm51hclpl2nsa5ji88zpqdsn682xgihq64kahsnb";
+    "CT14llo" = "0sz2ni8xcjjg8034qjrhb77ak1akzlf5fwq00qs9c196lk5b2x7s";
+    "CT14llo_NF3" = "07zzs3jprh0haqx5bcsii213m99m2nh9vki76d9cbhicyzx23pc1";
+    "CT14llo_NF4" = "0bxkw5qms6dpab0zf1hhd8dllrjip2izbv23aqpg72d5rqxb6ny4";
+    "CT14llo_NF6" = "060fx2xrc90id3nb7rlmrvkxlyafx3g7nhdb5jmbr3hxwrzrq674";
+    "CT14lo" = "0y36qkjqd75zf1w1hs1q51qxgin7sm3bhmcbwczwrb17c3vb4m2m";
+    "CT14lo_NF3" = "06iad9lrpxsy0d365vrjv6gjlgggakylrmj1px17y6s796jq6c6g";
+    "CT14lo_NF4" = "18c03j26mbapjidq01s4yrfdh0i7j75gbswdhwcllwdvcg3gnki1";
+    "CT14lo_NF6" = "09ncggqnqcdpzakm16dzxd6ikay9gd5k8si80k52hrr9m2gf36ci";
+    "CT14nlo" = "137i0n7g9rgfsf5rx65d50njwsqawprazp5an513kmz1cwq0cqmd";
+    "CT14nlo_NF3" = "0pmamazh9i8pahalasr7mwx67ixbgrbsh8004grg0cimr2y4iwjj";
+    "CT14nlo_NF4" = "1k7sy8lpzkwy0dc4ig9i9134k854fk0r0lann6pj3jsxs0l6h5km";
+    "CT14nlo_NF6" = "1gfwr0sjbq41gx3057hqy8v6ysivjf1xrh6fp3qqn6m13gy2kbas";
+    "CT14nlo_as_0111" = "0kgg9r635grdwp152ylzklawzy8nf2ywlp75bjc1yyagg765k6jv";
+    "CT14nlo_as_0112" = "0j0bxx0gjdnj41gjasgd153gd811wyhsza56fvzrpka820bkk6rg";
+    "CT14nlo_as_0113" = "06if5wk1asazvff57ah944mnzkh5460yqkkwcs8zhnwx2kbq9v85";
+    "CT14nlo_as_0114" = "1szy7jwjvdvqqpjvcra1f0wn8qgrja6wx4kwcq9vf60pns7mzk7v";
+    "CT14nlo_as_0115" = "1kkahzmrbdr7s06v093arnss0xpxv7byqqx2f5aqh4fzimwp9n7v";
+    "CT14nlo_as_0116" = "0qpkmmpq1b33grf85jzkanwpa02j1cam39pkxchql95hv2jlgw4l";
+    "CT14nlo_as_0117" = "0381620r6h9s2qby52jvys4z8m6jfafa5qnia2fq3q1pc0xp1q2p";
+    "CT14nlo_as_0118" = "13hgxmjx6bv7njb6jdlypy1z61nqf5m5bavxsbrmwwfxlsl4jdzn";
+    "CT14nlo_as_0119" = "06pjl10js0xq7p14ifjn7xhndxyb39sxyc9ksd6wx55i6zyqf08l";
+    "CT14nlo_as_0120" = "1wyygxxjlcsh1qg6npk5szfbf59k4j80hnxnxhah9x9wrg5kg9j2";
+    "CT14nlo_as_0121" = "064afbxxqx4rsa3l73rki8wxa08a1rb53qyf3nwwjb4zb426jfgg";
+    "CT14nlo_as_0122" = "172xvndzcm8s4hzjgrq3szg6j7z4s2f4pgr07vr178zvn9986ham";
+    "CT14nlo_as_0123" = "0q2dansvna4p04ilb1sajz3s5mi89jgd8badqh6r72g26s96dman";
+    "CT14nnlo" = "1y3gd5wzpwv024xcrn70bz6h62n96mgqqwyl5r7q6czw0is52dzq";
+    "CT14nnloIC" = "1wnpwy0mz0c5y29wi497jcn5k47bndd0h65d6a18qcfk0l15rfzx";
+    "CT14nnlo_NF3" = "0ijns9bjkw8zcinba7rflc7ic03mn5701lqfrxqjyq4q6kh8fia7";
+    "CT14nnlo_NF4" = "0fhyzaxnm17pi7wfh5hwaic9q4y0hb05ripd6r648wnnhhi353xy";
+    "CT14nnlo_NF6" = "1rnacbsh0y9qjd2x7ggs87zi9msrxrp2l6lidg92i2la4pri27zk";
+    "CT14nnlo_as_0111" = "1hl88j40czr73h9fbz0zbliawlqwng7ikrmq01hsfns190axm8w9";
+    "CT14nnlo_as_0112" = "1w9344v9ihr0w8vrfhhxn81gcnr0qm6ihwwijvcdds09jpdlp6vr";
+    "CT14nnlo_as_0113" = "11symfb1ljislbksrars1k766fa2n1inbarzbw3kp01vxpw8gxf5";
+    "CT14nnlo_as_0114" = "1s1zz0ibr72jvx9c7w3kcryiywnmg264gprn020yxl9sqfzm0kzz";
+    "CT14nnlo_as_0115" = "19c4c4s7djav1zai2nlxbvy8fzg8hqlynri1y4hyhc8hhl00lwb4";
+    "CT14nnlo_as_0116" = "1shjwky7jjwcci0frra2lfc0wycvza7na89c4bsqiksnk413v2z3";
+    "CT14nnlo_as_0117" = "1mp5xxv810khs59zg4kfsdj5qp6ny0878fbz7jf101mpyhdawf0m";
+    "CT14nnlo_as_0118" = "1mvyv13agnmc2c47i9yl8ki5d0qac3l6ipn3nf5rwxjgah495rv6";
+    "CT14nnlo_as_0119" = "02b14lrx3zpbl5s4nj1rvh30i9xdji37yvvg2xwjiw3i56vl8b2l";
+    "CT14nnlo_as_0120" = "0wf29wz9k2v39pbzh91bxwifbs4cn0gsnjdzm24cpgq7bnhyszn3";
+    "CT14nnlo_as_0121" = "1w12xmxqclrrwvfb2g3zvivkq858n0lpp0bzfibvh4wamdyyx3an";
+    "CT14nnlo_as_0122" = "1hgghn4ad7fj3ya17qnka3xcwz7sp4fl0vpcbqkrs9mbbz570fjc";
+    "CT14nnlo_as_0123" = "0m66gwhw2n668sg4srq683qbavwabrk4f4vfcsbppzbcgm7i4yz7";
+    "CT14qed_inc_neutron" = "0ph835nfx98i74nncmspj7qb5798yciq76hqvc505n5zd0hwp87x";
+    "CT14qed_inc_proton" = "0gv0rlr6l62gidqp02ifn75d1ribvbihgpaqc92fww73zwilr7l0";
+    "CT14qed_neutron" = "0ck1vmqk17i7rq42hra79cz2rm8ngxv4da6dvz62l6m2nrga3l2k";
+    "CT14qed_proton" = "1gijxkq5gpsljijblzd13kgr7xjjvnjv18v02jivylf73igsakd7";
+    "CT18ANLO" = "16lbhgkbiym3njiffxdcm3hf7kkm33hyj2w1hwgb3mvxx2sja31c";
+    "CT18ANLO_as_0110" = "08hwxc99l645a9craimgawwynxcs5cmapgxgk0fy9ihvjvqs6jg2";
+    "CT18ANLO_as_0111" = "02ff3s127svdjzawbhzry04rcsw5waggmf3iwpqndzxhqpm0py8a";
+    "CT18ANLO_as_0112" = "063g7sqii0gf2rdjg9k9x95kzwg62w8lfq9cgyv3bnkpapnbqhia";
+    "CT18ANLO_as_0113" = "01zh34dg4cc8955ipg2i0k6s13h77jg8yaa4v2f4aw0020js9dn2";
+    "CT18ANLO_as_0114" = "061lvglsg4889q6qya83f7ngyzi2ibar1c9w6xyl462x5i4frx2x";
+    "CT18ANLO_as_0115" = "0a35axfjxywy4yh8pk4w4f57rfljvd593bx7a8wnix0cifnngg4j";
+    "CT18ANLO_as_0116" = "1cm3m3m6l93qlr9fxbc0d21gq3x0wn09qi8cxbx7lj0yqhjf2zh8";
+    "CT18ANLO_as_0117" = "1nrzrlp7i42z7pv550ggga0fk356i9rqbj60mdxvlw3xl6v4kkf4";
+    "CT18ANLO_as_0118" = "19p7x6q9flsz1s82scakgnsfsrjf8ym6ix3gp195fjgfdkannh9i";
+    "CT18ANLO_as_0119" = "1jz27f39dpg0g46p834vgvaajxspyqwd8f7zlpv44lfb43va6dgy";
+    "CT18ANLO_as_0120" = "0rp9hrvs44d8pbagmc3vipnh5d9amam3prkm2k7spvxahr6dp8dp";
+    "CT18ANLO_as_0121" = "15abhrjmmhyka9dxjmwz7103i0bpa605yhy6kisgzf7km5ca14h9";
+    "CT18ANLO_as_0122" = "15mxybppydzsxx308hqljahnmrw0islw2zl45kjlhxjxsmaai2nc";
+    "CT18ANLO_as_0123" = "19zlyapm5cp1hwvfqcjm3v6mgwdaa6f5d0mvnh68c05sn39xjhz2";
+    "CT18ANLO_as_0124" = "1fwzcs50bj6d6cjkvi4qj44mwrwxhjh25lxmk2q82wdmddgpaz0c";
+    "CT18ANNLO" = "1kbsbvvkkchhwwjdrj4d91lbykid4dcy4ghanpdd9x0nfm5b4sgk";
+    "CT18ANNLO_as_0110" = "1a60p22r292hjjcrdkgis6d81hgihnjzyzlbcqrvx9bkbq447kjq";
+    "CT18ANNLO_as_0111" = "1gyl4h92xs4s64dm7cwrfqk2zrs1cbzp76dqckf7z44k4pm460m9";
+    "CT18ANNLO_as_0112" = "1bsn5q12bgkhyl1d6wkq32m3l7i0wqxpnjxh790xcd3ympbfx16h";
+    "CT18ANNLO_as_0113" = "1dri54s71ygnd1pdnmvr9vqbyfllwzr9x39zg01rpj02zy7kidb0";
+    "CT18ANNLO_as_0114" = "0f731ryn1031053zv40mak9m7mxmn6dvnhn6ik6kyag9d3az6lvx";
+    "CT18ANNLO_as_0115" = "107569wrkjic6xjp574i6r6n8wj2x9cx4h7dqh77wxl8g4aajkh6";
+    "CT18ANNLO_as_0116" = "0r951p0a4pan71lkhf701ysw6kyq1wvf15rbjdjr4j7khjfaykcp";
+    "CT18ANNLO_as_0117" = "0xsgzga5bya0ng6i7nvk33nrf792vzbd1rs174cix4v406g99xm8";
+    "CT18ANNLO_as_0118" = "049534355lxhppw2l85i677ysb2gwzccs0b5afm719sh06rv6jkn";
+    "CT18ANNLO_as_0119" = "034kd7pg103ldc3nmgsylv0ffl8v0sp9jkf9073ny11s7b3pb5wa";
+    "CT18ANNLO_as_0120" = "1ph23xpirkahpr9x1k2qm9pp3a1hc3i15bhc6xprpc29k53m4wsi";
+    "CT18ANNLO_as_0121" = "12qrg3jb1kar46b8lai56lb7wxjr950dzaixfncxvy38hrny6mxh";
+    "CT18ANNLO_as_0122" = "1wmkl2rlhkwzxi1yln0m9i6lvpbqkp3bxdnyzz7hp3hy1sa5f60s";
+    "CT18ANNLO_as_0123" = "1caz4rfmcmabfdw5b8xg2307bs1bjclgdcxq2k6gf73z3pqbjs8w";
+    "CT18ANNLO_as_0124" = "0mx8h8vdhlklgvysmhllkzga3g65zkmzpz7bmyvaqmvbvr6x5q0w";
+    "CT18NLO" = "04y2p6vz484l3yv6381pfavqs3xh78h3jn6bg7ncp5vywwqp44n9";
+    "CT18NLO_as_0110" = "0ncaacfw8dh45vaf84kkj93hwxgwz744qqd6llpy73zdilnl62a8";
+    "CT18NLO_as_0111" = "1cib3ggy0wajvvw908wr4bfymcw62iy5abwdadhq69crcg01619r";
+    "CT18NLO_as_0112" = "1x242x4y0vykfypm02g02qxpwmsq2p45bxqrqgfy29qagxz6j66d";
+    "CT18NLO_as_0113" = "0fkis7l0s1lb2k7qyfwnn5axbpiv9yky4j5qc8g3fa068czijmhi";
+    "CT18NLO_as_0114" = "1r6ih2gqiwm7z24iw9xgn2n35659v5nwl2d02f07j1k3d33j175n";
+    "CT18NLO_as_0115" = "0z4vm73l16mpjf3wcrv5q659f2mwkx85wpmnq8j1fnk0vhms59dx";
+    "CT18NLO_as_0116" = "0g4lxxc9g09alpsff9wr7w0jgi26h3klx8rk6nb71j9yzrwv12vv";
+    "CT18NLO_as_0117" = "0hmn5vkgi5981q0s5lyp9mq9jjrzhgr1f9w8np3i2nwcgn1awis5";
+    "CT18NLO_as_0118" = "1z6is1f3064wq56lfxrmqckk3yi6wsl42s2xigx87p8zqg3r4nkz";
+    "CT18NLO_as_0119" = "0p3r7w5v3pq2dgaq96r3khx1wwjq6i33l0bbf63dxs88gk5cx1s4";
+    "CT18NLO_as_0120" = "1h0rcra68yypf1yqwlzql385ks1agxc9njdpyx60j3yg3whk4h63";
+    "CT18NLO_as_0121" = "1by1iiy7qby73m8s3qmnrf0dyca3k4z00fclbrm651f79nz8scz7";
+    "CT18NLO_as_0122" = "1r8h2cw874dh1mj4r545wp9msr1358qw1lzznwvgkmgwjclndjg4";
+    "CT18NLO_as_0123" = "1d8c3bk6bvy3azbv9yqi45cwkcmjbxxw7qaxn6xnc5jfcf6wbsp1";
+    "CT18NLO_as_0124" = "1haqxq1jbcz9qbhnw4pxsvlr37908fkdlzyn7c1csrlr8a51s3z4";
+    "CT18NNLO" = "1shkah5ma0hp101aklkz2p8n9y4i4sv6zwa5ifzyj3bgz1020l5f";
+    "CT18NNLO_as_0110" = "1smilnmhw8zjd0hl03v7wflbbia5qxqfmvyikbgwc29g212xbq71";
+    "CT18NNLO_as_0111" = "0mj77vshb9fmlvc1pp3m701nl574p0k013lg0l25r4nhvlfiiriz";
+    "CT18NNLO_as_0112" = "0a87crw7dygf9q28v95h9j02yq5f9rr5fdrxvqj5ggw839nazgmk";
+    "CT18NNLO_as_0113" = "011269haxlh2grq60qbmwrilgnkz6hlacd8x56iizl6ify7hcs2c";
+    "CT18NNLO_as_0114" = "0im03f2vr9pfd223skadmcfrypxlpka4pqizjcbqq75fddhljivq";
+    "CT18NNLO_as_0115" = "0pppdh2vq86iiar18c5wi2qbm6viv0hpyfah8pn1p6bcg1k99srs";
+    "CT18NNLO_as_0116" = "17wsn6jxp25klk3x3yfa5abxjjdl5j9vdwxqb51zg6ic3a7is764";
+    "CT18NNLO_as_0117" = "0nkdmqyqzzg19m98mqm9n2dcaiy4i97zrxmy7x1c3rxc0n7igkzh";
+    "CT18NNLO_as_0118" = "0v931kw5dzqq95940mxmkj1r6a75w525j99yf47pyf55vg22ybkb";
+    "CT18NNLO_as_0119" = "1z4kg4na0m2vrflnizxhjdxa9rdzp66mq66bxcjlvqiraf4ygkd4";
+    "CT18NNLO_as_0120" = "07bz7q5h0rfxf5989sarchsv2mcn4093b6x5094725p74sw41sq5";
+    "CT18NNLO_as_0121" = "0slw6m1scnajlfhxswd05if782k32gcyx9zz50gaiwqimrz188fa";
+    "CT18NNLO_as_0122" = "1jrzxq7mqhkfj96whqfr3ny2g1kggc047cvzb7ladlirmi05injg";
+    "CT18NNLO_as_0123" = "1zdmvp9pxjjs96yw05l5s0c0ym1hyj7d3an5siy3i20lvyxcgyz7";
+    "CT18NNLO_as_0124" = "1lb88y4c68n669c2g2q2zwjp92d9hgbxgpl0b7dxny9a7zdmw0mx";
+    "CT18XNLO" = "1k0cli4j0z5hj24pk9f78flhlvsdfya51hgh90jv4myniapk616l";
+    "CT18XNLO_as_0110" = "0yahahfmzzwzxiqanm7029z05f3nx9cs2yjdvyvhazvicsq3ibid";
+    "CT18XNLO_as_0111" = "1n0q8d0j8smq2z6n9l091r2q8v319zcf896nk2m0s7n9g9a0vcjq";
+    "CT18XNLO_as_0112" = "1wj968g1vb58gz6vslzfmihvqg5f9f2cqgq8inlgdhai1y8vk1lz";
+    "CT18XNLO_as_0113" = "1gi939mxv99q2r1m8a6d4ky5nrp24xv16xw6d9h7ly27jrw8kzm5";
+    "CT18XNLO_as_0114" = "06gf4m01yr89xklch6ack012in2i1bifyzvp793x9w8m56dx12ms";
+    "CT18XNLO_as_0115" = "1g4705l0qb0immd4la2vrj9v4kw7r7i1wz1vn4knbqjwig5kcfws";
+    "CT18XNLO_as_0116" = "0vaxwg3ixf4x92vssh8gqrszbfa5zgzbsd5p81j14nlksshrs6bf";
+    "CT18XNLO_as_0117" = "10qg2yr63csg4nd62a8h0s1z08cmgbkwvcsh0wp7zkzpw70r7x78";
+    "CT18XNLO_as_0118" = "0kxhg2pn7ki4nxcs5jhxvx4fs6c414mq0d0qm3vldv0hsayqsbnd";
+    "CT18XNLO_as_0119" = "1xd4ib2fqzhg9c6z2zyc8h3il4msm7rv9kkaaapll4h0gpjdda6x";
+    "CT18XNLO_as_0120" = "0jyb8gs0avvlhiwwvrv09p47vs3jim3y315hg7wcy31xab90b91i";
+    "CT18XNLO_as_0121" = "1afizsl9phvvdjbyrifx3ii10gpxl51rvx311imz30l51i3fzl7v";
+    "CT18XNLO_as_0122" = "0wkpicsv9357lh96vjnrxzddaaaiaagyfph2jcyp97mjhixx2hlg";
+    "CT18XNLO_as_0123" = "0hr9m422shvp5yzjdd7lqansim7qcx3iv1p017fp1a4ihj661sra";
+    "CT18XNLO_as_0124" = "03zf75f6gx41g3fxrdc6sqkfcyzz03izchwfvabwfxr06yq94jxc";
+    "CT18XNNLO" = "0j7bwzkhax4cm3wnbhqdv48j4wha9zdd7v77ihlgcvcmk79rx1fa";
+    "CT18XNNLO_as_0110" = "1vwaz00jwpyd1nafpfw0mw309v10zqxcsygdjsdd9mn5p1j6z3hv";
+    "CT18XNNLO_as_0111" = "0g6w519dc13mzgb2wpyy7chnl5wkl0ndrdiw7nymad0csg20yss2";
+    "CT18XNNLO_as_0112" = "06wlzpx9b83gblg4rvqv22k60pvjikqs5m5gp2kvrwmc2wxp73d2";
+    "CT18XNNLO_as_0113" = "0ybm5v0dprid7vvsnsihkd3vn5gqsqsmib63sh3xl45i58h1szzz";
+    "CT18XNNLO_as_0114" = "0hpznnkarzjmf5447jp9za1w52lqpysprnf14v31mda9k7a6kdkn";
+    "CT18XNNLO_as_0115" = "0lj637cwm726hqilrnfa064apdsqdav142dy3scz2gxzpzqpya7c";
+    "CT18XNNLO_as_0116" = "0m1zh15f975g628npifyqmlj578lpdlc67sdrxgdg97jfvxrq7s2";
+    "CT18XNNLO_as_0117" = "1r5kwl333ipq3g78cmn7h5yxk2gl3rfszm1ijzyf8hrjqz9m2p35";
+    "CT18XNNLO_as_0118" = "070jcd7y5w0h65ssk359w4kf2j7164pgdkg78mjwifi2garrlv0s";
+    "CT18XNNLO_as_0119" = "12nzzjyllr4vs422dxdccjy0qffg9gy8p2wa828cr3a26wjlipfr";
+    "CT18XNNLO_as_0120" = "1b9k3wd212nrhhncckj6fml58jzjagiskgmc6h248mcc8mcc2gyz";
+    "CT18XNNLO_as_0121" = "1wkgmkw5djzxc5g4iyr4h2cz08jv1clmp8x8xcidg5532zclavmd";
+    "CT18XNNLO_as_0122" = "1w7jhlk432qni1kn1big44yk16bxghbzrjb1g1rdxpibzy2jdkw3";
+    "CT18XNNLO_as_0123" = "15hqb1c4jx41119h2ahx6zacbigs9xw92jw7c4xsww9dkzr1qsr5";
+    "CT18XNNLO_as_0124" = "0fx7am4dv4d09hdk0yxvxzbdlhzc03y3q2x1hfx9wk07kcxw1mj5";
+    "CT18ZNLO" = "0iv8laks2ymn5fygk6k9lxm3s7fld5g292n9bfkhn3nmcfxczi03";
+    "CT18ZNLO_as_0110" = "0q90c9nx0b3fbqq317qr0j13cc9m3zcgpk3pcn8s2sd6aaksa66i";
+    "CT18ZNLO_as_0111" = "0wnxj323k29xvcrrf68mfyhflfnblvvnx63p070l5x52qqbfjl7y";
+    "CT18ZNLO_as_0112" = "03qjvv004g99lbi022l9bvr82gvv6gzk651r8x5hwwyr0mar4j0v";
+    "CT18ZNLO_as_0113" = "0hw6w7x3bnx2fy03jj5yvbjjab9mj0fzca8bc46phjsmx3nqxq5k";
+    "CT18ZNLO_as_0114" = "0gnhqhxcsaslcldhyh69lxdx1misjz5qiwry57n31j6mqjrggqbi";
+    "CT18ZNLO_as_0115" = "1dn32bwarggnfq2s9drmdjikcrn0nm0mqih4f5wxr3zbmq70xw4q";
+    "CT18ZNLO_as_0116" = "17q8ysl7ar1n7wym55k8vzrx963rip9l9b0kxw2bqkha5ipwmnv3";
+    "CT18ZNLO_as_0117" = "1afaqy8afzib6fmyy7ysnfk8w5f92893nvh4fn1sx9ink7i2zqal";
+    "CT18ZNLO_as_0118" = "0sbhjzjsjd8m6sgz66vky3w7ymhwpss0dr2p603dxgm84fig1kzx";
+    "CT18ZNLO_as_0119" = "0fxplpy2l1fdh5p4csdlabg36xgbpdg8pcdfcnws2cfj3g0941as";
+    "CT18ZNLO_as_0120" = "05dk8bvwkn5y5j4rk18an25rg1f1am9vlddal84rbp8m15qnms65";
+    "CT18ZNLO_as_0121" = "0ymql1wjxng5i887lx2q6p8gryw29zs0d2hzkfxl4f0zzn2wlwpi";
+    "CT18ZNLO_as_0122" = "0gnl23n4ljlry340pwwfs0xs22bl2qp2b8p3f73gpp9xn42nwz1g";
+    "CT18ZNLO_as_0123" = "1wfx59iadvn85raa1bq81ipxpjbxli58hs8wpzm1vz10ilifn9d5";
+    "CT18ZNLO_as_0124" = "0jm0gnp8g1drz6a10wrdxkj2s8gws80ias1ixdnr5fdmnghf1wl7";
+    "CT18ZNNLO" = "0zsqrpab6vgcinsxjq3rqdadig5flxzk61wc1aa9rwnkbpm1paa5";
+    "CT18ZNNLO_as_0110" = "09ypj0yydkiw82bq3ymsp19i4iz82fm2z2xfplb3iasa86y377in";
+    "CT18ZNNLO_as_0111" = "00h0zd5indm57xhn467qffpx7aadzb73vyfazq09pl5vdqq9fn8x";
+    "CT18ZNNLO_as_0112" = "19vlb1bvp7r9jnknd2dvblggim1xqf4yjqyf5h04r90b89pyzxn8";
+    "CT18ZNNLO_as_0113" = "0h8i68dligavf051dpil2bqvlxm19156v1951n340pcncaxxi5d1";
+    "CT18ZNNLO_as_0114" = "1n2drxdd6f36njq0lcfm7s6cyignqdqvirh03ixvvar2pgj02yay";
+    "CT18ZNNLO_as_0115" = "0cv633f5gg6hcyhwfh22h5n4irnk1pxsk7949wiax7qkl84mcm1j";
+    "CT18ZNNLO_as_0116" = "17z25cky2ysrcplsxblrzka667npnnp42k6n8jsm73pagscsj91n";
+    "CT18ZNNLO_as_0117" = "1yrbrzbg5r2pvwhbnvfwcp9d9rvfmqqxwph0rd0sdfix9agwy2yd";
+    "CT18ZNNLO_as_0118" = "019lbvb8pjfbwz8hz8h2xw76nf1ly9mgnbz6pzi3v9msk0qbmlp1";
+    "CT18ZNNLO_as_0119" = "1x08wg3y3fqa8ah6m0c6x2fckjjyylkhnmry6vg93rp3n7qlvynw";
+    "CT18ZNNLO_as_0120" = "0m9mfr8553yrysbcksx17nz1gm1vi2zvs5bp8d3v82phsv5alhf5";
+    "CT18ZNNLO_as_0121" = "0snzl818ag926n0i67hdwkjclfvykx546vfnvsx7n2z5pabakd1j";
+    "CT18ZNNLO_as_0122" = "10i7dk1bllyk6f3l92kbiqdib8l2zvqf91g9c20k12sim6n6x2g5";
+    "CT18ZNNLO_as_0123" = "0v2h2fjkdsnyssb6ralw32c23l0nmdxbg3sx38vxh2y2s2nycz5h";
+    "CT18ZNNLO_as_0124" = "0w29hn728p8yip40mr27kqmv5wndfkq6nx0vnl53x41pwczkhkdl";
+    "EPPS16nlo_CT14nlo_Ag108" = "1p7gckhv44h04rvknd6fdizy9c1jqfwic7ppf0ra14ic8wp1g7wg";
+    "EPPS16nlo_CT14nlo_Al27" = "0hxyakfgknmixxndfj14i44afp5gcfz9afjvjdaj702sv42a7qa8";
+    "EPPS16nlo_CT14nlo_Au197" = "1g272110y3a1fr6raxdfhagn68i0lcnwbdhiiqg4j6wb6v4m3p6i";
+    "EPPS16nlo_CT14nlo_Be9" = "0zxsdmvz919ajwwb917613byshhpr876jcg9kik0pkz8c4ddr2z0";
+    "EPPS16nlo_CT14nlo_C12" = "0mjmjk9n36aikhm8i6zwzfszyb5zcy1syn13vs2rm12x535j6dm5";
+    "EPPS16nlo_CT14nlo_Ca40" = "18vd67splj75sjijfvhyq0q6068yr8l083sczamwpmy8z3l798ih";
+    "EPPS16nlo_CT14nlo_Cu64" = "0g64gpc5cssmwl1sn7cl0ramsg2zfq7snr9bzr41q2dznbvqahgd";
+    "EPPS16nlo_CT14nlo_Fe56" = "0dxfzpx99ha9g27bxx6xzxxh87va91qqwq6hnz1qsligjfx7q4yz";
+    "EPPS16nlo_CT14nlo_He4" = "1ln5kz3270kyx6m3ji6q5xyp5a23f3kbwh9z9dmdwwsw7q9n8way";
+    "EPPS16nlo_CT14nlo_Li6" = "04rviiml0rnym9qppsczcydw37r923ljx8hj63vv6dxng0g617qb";
+    "EPPS16nlo_CT14nlo_Pb208" = "1b2zibpigdvvkg29zh7zm32jpdr2prm35jasafh17pfpwlfc55mb";
+    "EPPS16nlo_CT14nlo_Pt195" = "14v1gicvm8i8z9d98rlv5rbhaglkbi9fhs3z465p4d764al6znnc";
+    "EPPS16nlo_CT14nlo_Sn119" = "10nxn6rdp7svsrkdcdwxryjmirn1s871yj1w493adpfcy3chqw9k";
+    "EPPS16nlo_CT14nlo_W184" = "1x8ndmkzmnl79vz1bgi9972190x03asvgnls6qiz746xl37q4ky7";
+    "GKG18_DPDF_FitA_LO" = "0ql03hp30wfaw9gfyska0v5vf4p3n2dsxvkapjqnyfl01ad6vjw2";
+    "GKG18_DPDF_FitA_NLO" = "0n9khzvhyxfwbl758vzy8jgyqkgcgl328m657vlami3w22hmpbrz";
+    "GKG18_DPDF_FitB_LO" = "0s15ia8mcn00xl28rhdxjigpq0ai80a831366sx0w7qx44bb5n0p";
+    "GKG18_DPDF_FitB_NLO" = "0qlv7p1fx3gq2cqrvamlpn6r54nssbk7rrx1znhfdzx3x9v1ii1q";
+    "GRVPI0" = "0i5icsw9hf4jm25d0szxqc3r1131n417lv8b4gslg93xqj4ry1hf";
+    "GRVPI1" = "05j3mcrb0sq4nzv7y0k68f2m3v8vnd13mzbhq43gjq712cbj126p";
+    "H1PDF2017" = "10yfikq1mlw6bzhbvwblajicpqzhi06gl1aabhxr6mcf9vby4zw8";
+    "HERAPDF15LO_EIG" = "12cqj3vqwi86sfgxkiwbd7rnpw1awnbqbc852b0x32d9j18nz9c2";
+    "HERAPDF15NLO_ALPHAS" = "06yiid611zi5i9snqrkjr3g4z2n1gwkvqjs606ha0b4nrwlpnkhc";
+    "HERAPDF15NLO_EIG" = "0h5brmk7w70dgbwhjikfpprni924c2f3kxsmxzcm2qlrlgj0nswd";
+    "HERAPDF15NLO_VAR" = "049bfsgkcfnz4z7vzkl4vr6ivp9kvak2f07nmarm8q2wwd6pjjqy";
+    "HERAPDF15NNLO_ALPHAS" = "09qf93b336yak3aqnfqlvz5j6xvvrsqkc4ag41xh4prpswj8fmrc";
+    "HERAPDF15NNLO_EIG" = "1yf48sr7nak6lph2s1vd3s91mrw0da9kjxlvqzcg3n9j48l3f3r0";
+    "HERAPDF15NNLO_VAR" = "0di4b75ag82iysyrv5wfvn8728jdi8mkq96ycpq534078ps2n3bd";
+    "HERAPDF20_AG_NLO_EIG" = "0jr2s4dj5w9xwidrqbqi8af2dqycm4vr36qy3x5javllp4dn04cr";
+    "HERAPDF20_AG_NNLO_EIG" = "11cdhjwz4qm2hxf8i5kl38ny4nbsrd2vf3jkwz17lrgls716wh00";
+    "HERAPDF20_HiQ2_NLO_EIG" = "09wwkv8lk7gy14avvamk3sqdsvig2bvnzha5d4v5s2ln7g6g7vhq";
+    "HERAPDF20_HiQ2_NLO_VAR" = "1cgprisw1bksi8nryqqsy6ac097ywxdgj5yg796izari7j72p4bh";
+    "HERAPDF20_HiQ2_NNLO_EIG" = "05670fr76fx14gp4ywywz71scr6f25jk14i4k84gpcb2l6rnbv9g";
+    "HERAPDF20_HiQ2_NNLO_VAR" = "15nxgq5hy6ncvqma6ai8k7601bfw97p0h9db2gqbbyyvxf2ldnc7";
+    "HERAPDF20_Jets_NLO_EIG" = "1c2n2cn9l8x9jc8c4dh2whgz3378nnnvb3448cgpv0qfm589ygxy";
+    "HERAPDF20_Jets_NLO_VAR_Duv" = "0z2pkmlpffy29x2bh0086m1ybbb94x507fkr4khmdb4d0h33ppdw";
+    "HERAPDF20_Jets_NLO_VAR_fsdn" = "1ya4hbr3shjggpqi6h3g9j3jnbmmgrva2djbsaxgp7icii39yf1a";
+    "HERAPDF20_Jets_NLO_VAR_fshdn" = "1sl2sq27xx40mj4zn00vc44k3vf1yxb7fwpqp0p3lqlp9gcwlycp";
+    "HERAPDF20_Jets_NLO_VAR_fshup" = "0qs8g45s70d0l3g7xh0bqhk65ac9g003bjpacd9v97gzpm6jvr45";
+    "HERAPDF20_Jets_NLO_VAR_fsup" = "17ix21qwjkp9gy9gvn3143d8ganzg9r78n6q47wdfxh12jzvgc7k";
+    "HERAPDF20_Jets_NLO_VAR_haddn" = "15rbsdddm5ayg5r0gljxxcmrrvzhfdr44ky2d6a70wjr2g6lc5yc";
+    "HERAPDF20_Jets_NLO_VAR_hadup" = "1x3rnr2hkcfglpmv732blziygzvdlw2rkks1ap9majnayh01vvfk";
+    "HERAPDF20_Jets_NLO_VAR_mbdn" = "1fi0rp4gpqj7yjmv6b68ac7m8v4f9m4q9kd6nq4ndk2gp11i6799";
+    "HERAPDF20_Jets_NLO_VAR_mbup" = "062dfx73lihlhndn5xjlsimfxalxbfhn1xyqzbk7bsqj9mffmwli";
+    "HERAPDF20_Jets_NLO_VAR_mcdn" = "092hwkx9kliib8lf405sy9bvxg6xgydnsxl92yjqwyicajihhij4";
+    "HERAPDF20_Jets_NLO_VAR_mcup" = "0qcirk0sqnkfyb3pdxlpkl51pbj2gybw7kgw9xzmj4j3jdg2zjqg";
+    "HERAPDF20_Jets_NLO_VAR_q0dn" = "1xv319ai4pwy1mcy6i3wk3mp4nkdpjb2zcnz17gxvdx2l6z1bz5m";
+    "HERAPDF20_Jets_NLO_VAR_q0up" = "0bfsqx23jsrjjsczl5j90hp3njvlwaw8mypj1si83mr1z0s9q4rx";
+    "HERAPDF20_Jets_NLO_VAR_q2mdn" = "16qfw118c3lh91zsg2nb49xjynbd9w1rh4y5ybr35v38i4acpdab";
+    "HERAPDF20_Jets_NLO_VAR_q2mup" = "1q80h7r0cklpz1jam3nzxs7h3i8jpgpc03l7c3g4mkz61ynh0ida";
+    "HERAPDF20_LO_EIG" = "1r6ylwi2yszsk5dmw27734s0ghkvdawmqa6fik1k3j82d9s22mkl";
+    "HERAPDF20_NLO_ALPHAS_110" = "0zmmg0k33bf52skbz42cgxdjw0ap33fyf0h1kfd9ciw4gra2rakn";
+    "HERAPDF20_NLO_ALPHAS_111" = "1mlc33kfs4zlmn305hifjh2d85byvym1mzdj9bc3nlypv4zcszlf";
+    "HERAPDF20_NLO_ALPHAS_112" = "0wswbdmkyv0a6fw531s1s7jnskzxsvwh9bydvgiav53pfpibsyx6";
+    "HERAPDF20_NLO_ALPHAS_113" = "0qx7kh3cmqz59sm6vjcvi2hj5c7d816mc7jfhqr03hvavqcsla14";
+    "HERAPDF20_NLO_ALPHAS_114" = "1n2434j9gvdz24h30sng8z5jmc9hhnm9nbr3hi82n6ssnwabsl97";
+    "HERAPDF20_NLO_ALPHAS_115" = "05wk9glb6xpg5n689slihcfkdvm3kgwpxw8dxp4rp8zyvrsh6l6f";
+    "HERAPDF20_NLO_ALPHAS_116" = "133vvg5bh1lx6zcacnaphkj11608wafim4rb6lcqx4mkpxabmzxa";
+    "HERAPDF20_NLO_ALPHAS_117" = "18n1s7qqzf67lg8gphpm606dvz802i6xmlz5if5jdhjz8r3qklzf";
+    "HERAPDF20_NLO_ALPHAS_118" = "07xj5j7k54bwi9xq51cf8zanqlkjcbdrvw9k8ch3h40bk961c5pz";
+    "HERAPDF20_NLO_ALPHAS_119" = "0njyfp84kf51m9rw9z3d3figp23043p5ml7cdb45dvh9hbpssh40";
+    "HERAPDF20_NLO_ALPHAS_120" = "02paa7bng9nycd8dd2zf2099592mbaz8c4a5hamcmvzqfz0sdy7d";
+    "HERAPDF20_NLO_ALPHAS_121" = "07hmbvpm96pm5yp9bsx9aksznksh6k4qrw0k28bns0wjn75khxsl";
+    "HERAPDF20_NLO_ALPHAS_122" = "1pjn3h1wr6l6sy7kjvk72qc409dr939z787q2qbaph7xh5rf7k2s";
+    "HERAPDF20_NLO_ALPHAS_123" = "09hz6pw4nklwf94krna7g80659v9c2c0f5rf99mnx900xyhk7pxa";
+    "HERAPDF20_NLO_ALPHAS_124" = "1d9gmc3g0j32kgwyfddmx9f3gxwrgnq3xcbrabdx9cw554ysd6sg";
+    "HERAPDF20_NLO_ALPHAS_125" = "0mi2q9yhkcdpj7336kbs1vw4zvm8c9fryz0c7hdj246kj26rb0mv";
+    "HERAPDF20_NLO_ALPHAS_126" = "067rng6gv24qf1j8lz37115mc42k8wjpzrfcw4jw2d1yg22ci0lb";
+    "HERAPDF20_NLO_ALPHAS_127" = "0v3xcdr8wsradqf3bzayvvlsdjzr54qa2kbqb5pyvfi3rafrwrmi";
+    "HERAPDF20_NLO_ALPHAS_128" = "0ywnd9c6bq5bp02s3b3pql8a74wm472p11alqi4b4pmlzphzk1ix";
+    "HERAPDF20_NLO_ALPHAS_129" = "055ya2wxscbzp2w3zx2a5xgs94wl60bm6c2vxrs2rgnab72382j9";
+    "HERAPDF20_NLO_ALPHAS_130" = "0k91azhwxrfni5yfasn83f67ma9w8fax2k1k9xc8pvgmbh3c14wi";
+    "HERAPDF20_NLO_EIG" = "1ryamdwblj1ysbha672q2z9qai62h6cibb0laizfq2nq4j4ml3vz";
+    "HERAPDF20_NLO_FF3A_EIG" = "1fs6ldnwflmn5ysqkq9aky2xskd0dvq372h48x89h4vmsvd302wn";
+    "HERAPDF20_NLO_FF3A_VAR" = "0jd9wgrhchqjcjrkh5hjx7x8agm43jq5p8dmyvk0rniz9zybx64d";
+    "HERAPDF20_NLO_FF3B_EIG" = "0r04zjfaaq686g3bd6c753vkcwsbgdcfzr67ngm7vsz27zscbjbz";
+    "HERAPDF20_NLO_FF3B_VAR" = "12qrfld8958gvk9c2q8l0mvccx6wkrgnsiapgzl37s6s6zcgid10";
+    "HERAPDF20_NLO_VAR" = "0q5ih9ac3z6n158h6q149h0ggkfjrdn5rqwf7nzi3j50fhs63swj";
+    "HERAPDF20_NNLO_ALPHAS_110" = "1828i4ybdzs7zj62lzsifgshxdas81vjvhfg86ixry4xqkfprlfg";
+    "HERAPDF20_NNLO_ALPHAS_111" = "011d1a900jjpa78ph05sdy353gfmrr8azpngcf0cjigcn4fwdna6";
+    "HERAPDF20_NNLO_ALPHAS_112" = "0xb2bnigwlhs0vs3fwzsz66zidchwgs97kn6vjfhxnik8xdfkyb8";
+    "HERAPDF20_NNLO_ALPHAS_113" = "13b8gh0qwpy574ra6184vgff3wba0blr44lxj56xrkaql9zi1jx1";
+    "HERAPDF20_NNLO_ALPHAS_114" = "09n30p5pbw2wyjss2jjz1h4nl9scin42s91sxdcrwinnc3y5n1in";
+    "HERAPDF20_NNLO_ALPHAS_115" = "0nlimqmfhx2ijx48ylciih5diwlsb5zzkli82rgnnxci3r4ycjq4";
+    "HERAPDF20_NNLO_ALPHAS_116" = "0nr8svx60zrf42nxg74v0h759y9lwg54892xpdmswg7mw0nwcrm9";
+    "HERAPDF20_NNLO_ALPHAS_117" = "0xiqdr2r5dyyp5q56b3w04wy3raqrh1mjsv1fm05xswxn2xwyhlq";
+    "HERAPDF20_NNLO_ALPHAS_118" = "0d0w0f077g11s4clx1556y9xx5nn1dgm8zcp0bk92v4lapngf33c";
+    "HERAPDF20_NNLO_ALPHAS_119" = "1w9nl0pnfc1cii4knmqdq4cnh6shhhgj8pg4a42bx20lvqc3aqgb";
+    "HERAPDF20_NNLO_ALPHAS_120" = "1lksn0rcxq2scwpnps8dawlzijhvwbg0pn2is4r29igbqck2jvb3";
+    "HERAPDF20_NNLO_ALPHAS_121" = "03d58rbibvgcvmsw86q3030qnw5nnvq8p6diqscd9srb8br06p8m";
+    "HERAPDF20_NNLO_ALPHAS_122" = "0541yx5fcadw7rggpypd8kg393m5hwzsw5jangsmsrsby1rc2m4a";
+    "HERAPDF20_NNLO_ALPHAS_123" = "1ckc8s04jf7x19xpwwb8g60likrlz3dp91qzaafljvbd9b27aa61";
+    "HERAPDF20_NNLO_ALPHAS_124" = "13dx2wh0dhxsjjk6ak7wy1gr8g297dpc9xvkxvb5ayd0rzmhjlwb";
+    "HERAPDF20_NNLO_ALPHAS_125" = "0yh6jakycsqhh4h6jqrilw1afmk1jkcq2px978z4qcz4y0m6bx4a";
+    "HERAPDF20_NNLO_ALPHAS_126" = "0045sa1kl4w75ja6an38i2a3fi78q6xg22av536l9h1c8j82ql13";
+    "HERAPDF20_NNLO_ALPHAS_127" = "1f5l9cy59dc3rc9xqrsq85g0mbhyaqkbpzi40f3gjg6bxjlgb4rx";
+    "HERAPDF20_NNLO_ALPHAS_128" = "1c2pbd4zam5av582r777197638l6i5a0chmw9ci7l05lzm19nzmi";
+    "HERAPDF20_NNLO_ALPHAS_129" = "1aipmxxn7s1r66m6gmrjgr2yca7sxvpf8r86s4a5j768akkgmlld";
+    "HERAPDF20_NNLO_ALPHAS_130" = "1g2q3438bivd20i685jmx565cq108yv72vhxmpmhysh4qwvwpqqw";
+    "HERAPDF20_NNLO_EIG" = "12zn49jx7qjr8apgpbhknzll4vwlz3x9y1ai908ix2h86pgap2ml";
+    "HERAPDF20_NNLO_VAR" = "152h21khvkhxwx87c5lqwzpakmahcpj1ixw6kgl0wrrwjknvfgxn";
+    "JAM19FF_kaon_nlo" = "05mcahzr0k5w0hqfbn902lmkwxlkbf8wrk6akpqnfsyqpbmhja5k";
+    "JAM19FF_pion_nlo" = "06krcf0c9jbbpwf1rk1xd5z7rz904ji984xz05kv9p1j1vgk0ha0";
+    "JAM19PDF_proton_nlo" = "1zrcijik60rci6km5d8pn8ivww8w3v8pb1m5dshqjs51lhf56ayp";
+    "JAM20-SIDIS_FF_hadron_nlo" = "11g4syy0r46m1wvzq0pb84s4kk2aihjmhx16mr8gzv5b11520a6d";
+    "JAM20-SIDIS_FF_kaon_nlo" = "1b2rz6k0g6ck3m28vdqjnnfc025ql5alhjmgn1l84cflf4fvkkgp";
+    "JAM20-SIDIS_FF_pion_nlo" = "15l98gmzsqxw615802si94dmj8ihsz6n1mraxkkwjl86hm8nalzi";
+    "JAM20-SIDIS_PDF_proton_nlo" = "07xwp9as0nscm4whl5x9bry1p54yl5qmj2r3hqh6vjsz6mxksdjp";
+    "JR14NLO08FF" = "16azkqxf1yw1j32ay6j01gf8n9n7qm56jh4yzgjag0zdhm01lbip";
+    "JR14NLO08VF" = "1ilw38pp4vy8c8v1glfi4ixca73wjkdg3di1wh9p8xqrifdb096p";
+    "JR14NNLO08FF" = "1w0pywmjb4xi7bsvv1mdd4q2adf1g7khspfbkphmlh8zipx29nxx";
+    "JR14NNLO08VF" = "0kzszj1r141fcg9vbf53480224nxcc5wfk9zmpmzbmrxzi0w127r";
+    "JR14NNLO20FF" = "0wc3qib90dpd1wgiymrn5lzwhqmh58ji2s92vpj2v9v4spws7pdq";
+    "JR14NNLO20VF" = "18l4ipn80gmh9kdw7a1k49fwgbl7b1frgc0hsa04vbwnv6hm73hn";
+    "LUXlep-NNPDF31_nlo_as_0118_luxqed" = "09ch6mjfn6rjsd31jfb59j92ngqiy0x19qamyxh0jwk0sbyr1dpw";
+    "LUXqed17_plus_PDF4LHC15_nnlo_100" = "18y3pa6gjmcv2s21si9a5dvbq6xxqphbqz5qiy39c62g2zf8512c";
+    "LUXqed17_plus_PDF4LHC15_nnlo_30" = "1bnwlxr8p4xmr36zd2flhqssil6w7jh50k46j0mxfnd8jgxgwn6n";
+    "LUXqed_plus_PDF4LHC15_nnlo_100" = "08jzl4wcsrr9agycq1r5kd5bqxsx4b637nxk34s82vs7vwpq7qib";
+    "METAv10LHC" = "1vn4wnx1blz6wylbzirswdqqf0knmyh1pcfh62wvj695mh7i0w16";
+    "METAv10LHCH" = "1p4wy7m1ksz0r1fylwz3cbq7jl8s58v817n3d898l83ic2ghp4vj";
+    "METAv10LHCHfull" = "1w623939fjdyx1316rxyaavf6kmxff19himr00br57jrw3v49nfg";
+    "METAv10LHCas0116" = "0y1l6djkmx8zcsii9j9krwhvgh071a9y5d4m1rkqpbqf6dnq9kll";
+    "METAv10LHCas0120" = "1g1izkf3j0vdrjskbjzh8lzsdn1bqssidr0gsapyzlx0dzc2ixdp";
+    "MMHT2014lo68cl" = "03wrjv448zdqblv4zx5b2p4m0nj8h4igabh8pzskj0327w7g91lm";
+    "MMHT2014lo_asmzsmallrange" = "16ki4aib5dslb7lx6w9nzx18nh0sgh41zbiw4hszf2qxn3asdyhz";
+    "MMHT2014nlo68cl" = "039zw5zrzm661bgjv7d0imzhfv3j3ixnrssi13ynfpin9v2izy6g";
+    "MMHT2014nlo68cl_nf3" = "0bjmng4ifdswi88kf59zzxpdq8ka80m01208nb2ij3dkpw0n5hnf";
+    "MMHT2014nlo68cl_nf4" = "01g0bbfwxaqhgpv0yz17fvwa4q1a1vh9867kp9fyavn600kd91ds";
+    "MMHT2014nlo68cl_nf4as5" = "1wdrk7b1hs6s8f2gxp7b3c1qrxvncs41h4aph1dhf8zffn3653yy";
+    "MMHT2014nlo68clas118" = "1nv7h2j31z061mgph5154qgxn8rl5sdgwzzs3d3clxfshh5gcccn";
+    "MMHT2014nlo68clas118_nf3" = "1d7k0vablssy1vfimsvxdiklaachw44lg37fgj1im52k81qxzd3n";
+    "MMHT2014nlo68clas118_nf4" = "1s8gv434b4mz6y5rv4kms69ghliafcmih09icj4qwk66hj7pn5lj";
+    "MMHT2014nlo68clas118_nf4as5" = "00zvf9zkrp9lk9psqvzsn04l1rw1xmq37bd2c8mqc2px3zdq9q0f";
+    "MMHT2014nlo_asmzlargerange" = "186jz5r74qas28x04daqkxhs5p31i68hhy8a7q6lzd5nh42x6kk0";
+    "MMHT2014nlo_asmzsmallrange" = "1x347h5g8d2k73wg6naj6zs7m2glankiwjgzy0gmmrnz3pyryq6x";
+    "MMHT2014nlo_asmzsmallrange_nf3" = "0ckw5971pwvvix8idw2m6j7w6bjivqpa1ynm6ml0bhc75cmm6l4i";
+    "MMHT2014nlo_asmzsmallrange_nf4" = "1asnk3pl3dw1sh76k0s95jb57cv5k90zjgpbkr3nnrbhvnkizl5a";
+    "MMHT2014nlo_mbrange_nf3" = "0bghvriw01jxmzcm9isz7in43ph7vz6zzr0rmmi81snrwvg8918h";
+    "MMHT2014nlo_mbrange_nf4" = "1gad7269hz4jj3946yyqzmcx3zyxx2p4r0h88x3lfrm0rd0fg00d";
+    "MMHT2014nlo_mbrange_nf5" = "03id7bfds16kbnd0nwjla8sn4pl3q3qa5v0a3pykdwj14k9igi3n";
+    "MMHT2014nlo_mcrange_nf3" = "1zfmdclsgwf6517v88zg34wby40606sspcghh4yahc2bbznd6a63";
+    "MMHT2014nlo_mcrange_nf4" = "0hzhkv81a0z3ichj5kfhwnhc720xw48h63llijl0pcfv8qqpvl19";
+    "MMHT2014nlo_mcrange_nf5" = "148hg5dc60yhfmwsm0svasxc7l1py6ggj7lzv0mrshl07rwfh62a";
+    "MMHT2014nloas118_mbrange_nf3" = "03w1wish6ig3mw9j195rakxsjr7gr46qz8dh009sigqcgp3s9fad";
+    "MMHT2014nloas118_mbrange_nf4" = "1lbj3r1bbxx2y1ybnxpd0cw7jzkdz0rb1grn1pmwmrl0l13s7j59";
+    "MMHT2014nloas118_mbrange_nf5" = "12q0gkqzhxqwrvy8lpg66ldsxnwr8id6jv6k4dj6f0p93qif5wr8";
+    "MMHT2014nloas118_mcrange_nf3" = "093yh7wa3p4028x5zxw15pwkrkjxzfl7kcdm7jqlf08zwm52clyx";
+    "MMHT2014nloas118_mcrange_nf4" = "0q0y77i0fgdvjk9y76kqzxpn22jbzsh64qbx8186ri9fqzfi868i";
+    "MMHT2014nloas118_mcrange_nf5" = "187wsfm49ack0jh9rwy5h29b1511b17myqn28bm6nbn7r4rfvnkz";
+    "MMHT2014nnlo68cl" = "0sss77zwv94vcy4ghv6493vbw08xwm264dk081w34jc4ifa0vg90";
+    "MMHT2014nnlo68cl_nf3" = "06paq3nzs87babpksabnkqi38gvvyfvpqlh8p18140zrdpdffaj2";
+    "MMHT2014nnlo68cl_nf4" = "0lbqpdy66v3ns6ax9vj1ix4wjn2pwlw5y1z26hlbrxz3l8hbizg1";
+    "MMHT2014nnlo68cl_nf4as5" = "1bh5nsral3lrlqq6afvq9ahkfmhfw3mq0m0qcvsx4ma5jx5rv7dv";
+    "MMHT2014nnlo_asmzlargerange" = "00l2jqccsl3jfwdj7lndr4b5cpx44krjvnm3h0hjw6hkv4irxb5s";
+    "MMHT2014nnlo_asmzsmallrange" = "1x36pv9nhj74whibb16bc414ypcks6nd1s7q1jc0fb7ndf5rijy6";
+    "MMHT2014nnlo_asmzsmallrange_nf3" = "0svpc51n25cbz2b43zbd60bfckrlz3q2jn3x668xnha9qsd3c2vq";
+    "MMHT2014nnlo_asmzsmallrange_nf4" = "15jggp2nbm828nprxyyinmp7kfxngpm0apg446hvwd8hg7blb1a4";
+    "MMHT2014nnlo_mbrange_nf3" = "0r9gi5cw76zn0lq3fcs7s2xxh6jl9y5vdv31bhv6mac9jmhjb458";
+    "MMHT2014nnlo_mbrange_nf4" = "190wva3k49mymflbm1v5xd449j38jm7ylfcdiflym8pgkdvwcgyl";
+    "MMHT2014nnlo_mbrange_nf5" = "19mnv9nz01lmbiv01qmflhg24kldhqpmcc8mgp7bnkhicgivb5ib";
+    "MMHT2014nnlo_mcrange_nf3" = "0zskxladqr40v6wqafbl1pl04vq43babqf437c4xxg4sz9435l3l";
+    "MMHT2014nnlo_mcrange_nf4" = "0sny8r9zap8gnjh9id1klr59d9hs0bb40pf8hpy8q5pg6052vx3q";
+    "MMHT2014nnlo_mcrange_nf5" = "1l340c1x4fz647bhybrvbb6z00mla81b78jfqpnwd4vwfxnqmq9y";
+    "MMHT2015qed_nlo" = "130fmxnaashvwwaaiz5b787ldz8l78ar5h2h038xvisdjkxvdqni";
+    "MMHT2015qed_nlo_elastic" = "1whplgg2s55wjii1hd32hzd5wsqbgvjjbnfw4fzjmnx4vwn63n2j";
+    "MMHT2015qed_nlo_inelastic" = "1b24flby6n9q2cg4haldmjs8ql35lhlw0bgynwja1v2n0fbf550y";
+    "MMHT2015qed_nnlo" = "1ypqiz0yz6hnxfml7ym83k4qqvqsbl39abbr38galns8xzzpi03m";
+    "MMHT2015qed_nnlo_elastic" = "17in1cz5j7mm9qjk8i27fif6x276lcqmccl7kfz8a5yn73xxzja4";
+    "MMHT2015qed_nnlo_inelastic" = "1ngk4p7w8l8b8sfg6hlm8ypxz97i1iwzlrc48szy7bi99kn8rmy1";
+    "MRST2004qed" = "1kdrzk2arvs36lnpkbc94w06hx3nh8nixh2qjhb271c2blwgahzh";
+    "MRST2004qed_neutron" = "12vna0ic6gh313k22b44b0k9kd939v7zjl2hj65k1075j23mq425";
+    "MRST2004qed_proton" = "10z0cr8pnr0lfxxi916naiz381a2cqn461jblfzvvddwqmqbllbc";
+    "MRST2007lomod" = "13ar6hzw9al20zlm8lg0hvwmgrmv0dbam820gm36rj8p7i33qlr6";
+    "MRSTMCal" = "0kbyp4rypw8jm28zfpvf0grvfvxmsrp3grwsmfxpa2c38x6la3rq";
+    "MSHT20lo_as130" = "0ivjvqabk9jnrlrczjlqywmijx5ql8wy579j77qkl1vhv7sqccm1";
+    "MSHT20nlo_as118" = "1qwbwcq8p4hrprz4ib18mp5142b0lbyyzc1bf5a4iq5jjvi5qm93";
+    "MSHT20nlo_as120" = "10y1a6iryahrafzdqskypjrnad6xxq08gm72pa9yc61xdy6andc6";
+    "MSHT20nlo_as_smallrange" = "1rygvj33g84whl24kgpqa47g11c48l93jlnpzqq8f5zr1ijqcq7i";
+    "MSHT20nnlo_as118" = "1yz0003ixjg97974648qba5d37vb4fhzzmq4k9xh4c37pnc3kgyn";
+    "MSHT20nnlo_as_smallrange" = "1bv7cbdynp6dm5c9v7r32gqy1lch4428apw426pr0d7xpm0abnxv";
+    "MSTW2008CPdeutnlo68cl" = "1x2y7hl8ckplx175bp3wi04xafm44dd7vzfgnmvvai1x0072xi51";
+    "MSTW2008CPdeutnnlo68cl" = "1szsdqjkmny30mpw4pdzi97vj7i55agxm285dvnkzp06ycgp1ld3";
+    "MSTW2008lo68cl" = "0j12mv286r4ds9v7piqh4n44yjnc51hm74lqa4vv5xznxhibng7l";
+    "MSTW2008lo68cl_nf3" = "1s5z55b2aj37bx0p305lcgrdclgvyl99xgfrl0rhmdgr2byg33wi";
+    "MSTW2008lo68cl_nf4" = "0m539ihcz3dxy4gpfbam5badhhsimywlbgnczbybph8yn1118j9r";
+    "MSTW2008lo68cl_nf4as5" = "0vl1q7xnr425sscbk4djqi56jbpzpi8l3z2nknfqiy3l7ykg23ng";
+    "MSTW2008lo90cl" = "0af5j0s1i8yn0mjs4nb77migihw643lhd7dfl184v6wik3031yg3";
+    "MSTW2008lo90cl_nf3" = "1a6kc1lgswjk800jzcqlbpwzz4rs3g6agckhnlr8cizmp9p7risk";
+    "MSTW2008lo90cl_nf4" = "1bdjl58gslhw539650qwi7vbvsr22hpxpca17rkbqz9szh0ljhym";
+    "MSTW2008lo90cl_nf4as5" = "1crsm7dfcs0fn1i2ng18wy23z2ap01xr2rsnafqlra0q135m6hfp";
+    "MSTW2008nlo68cl" = "0pdvb5nshjjw7ddmdmj1v88m3jlk3vwfnab0pf2kf8hfx10hbv4q";
+    "MSTW2008nlo68cl_asmz+68cl" = "0gwmxs0f7raxvmpn12zavzqsrp3x0a82y1vq2kf9p9fq17in55yn";
+    "MSTW2008nlo68cl_asmz+68clhalf" = "1rmda4zpm6cs9kyxkhwpz38iv6g259156bmka4dc4zyfg1lcw85d";
+    "MSTW2008nlo68cl_asmz-68cl" = "15mmdnd3wwlrs5pwwhfa9f88vjpgza8vwxwxpyadxsmhx9jk79hy";
+    "MSTW2008nlo68cl_asmz-68clhalf" = "0dd7llc6ip6myy2yvf16riqs334f20l8wkmkksq53xngmz9qf263";
+    "MSTW2008nlo68cl_nf3" = "1j82imyylvnf3x39x1mb19hhp2nbcq2lk82hf7sj72c557l3qpjk";
+    "MSTW2008nlo68cl_nf4" = "08f008by768c8v3cmrsbgxpglqdj58nwwf22dmk2mbf2jq449s0n";
+    "MSTW2008nlo68cl_nf4as5" = "0hrqmmnp20vpj6dpz3bvm531i0pvl06als8irqz91cknv6zsvxf9";
+    "MSTW2008nlo90cl" = "1d3p4cialrngci9kn7225zcmyrr547dskzi74dfgdhbqc0256a2r";
+    "MSTW2008nlo90cl_asmz+90cl" = "19cd358yqklc8bxv0mg69cq3sf6zah7di0q9ilfqbiddmw1flw3p";
+    "MSTW2008nlo90cl_asmz+90clhalf" = "0ngn8f149agvmc54nrxjxqa0rifbd8a1hbcgpa443l75bmd9sqcp";
+    "MSTW2008nlo90cl_asmz-90cl" = "0fnqj7ywnp9nz5733ggjwmhxpy15zs2xgxjz7ixmql5mmaz3sxb6";
+    "MSTW2008nlo90cl_asmz-90clhalf" = "1jrp9q8li7a4bwhgh7q9h9zc0sdhck957zn14q9ca9kjsflyb9f5";
+    "MSTW2008nlo90cl_nf3" = "02ihabrcgp474wkq4w2fshpiqdznjaxyg5vawv52yj6hxifyy5a9";
+    "MSTW2008nlo90cl_nf4" = "1wrdl79qy8mimqk48705f3sd651zy130k1dmvvzwvdsjd9y8q58w";
+    "MSTW2008nlo90cl_nf4as5" = "18d1pvijcyfxkipmd2v2zrkxdbhxygkcyn3p8vz0vzq5q7s1s7r2";
+    "MSTW2008nlo_asmzrange" = "161364fvc8w8ggad58r1c58b0kngqa1bjpabaqi5cigmzazj3rl8";
+    "MSTW2008nlo_mbrange" = "1b7z4mm3f8wjjbxb8hs8l7kclh1yfz5yffzdsch2i09c7wh79616";
+    "MSTW2008nlo_mbrange_nf4" = "02s7ljzwamsha87i6nsd4kdfb9ky4k6m8xpqa1iz9wgrcy4pmw5p";
+    "MSTW2008nlo_mcrange" = "1bndxfi27r8k0m4r26bfsflbbrjc4s2vp5ixy7qidkw33g6mqh96";
+    "MSTW2008nlo_mcrange_fixasmz" = "10s2sfhdx5668cffwb0sbh5m54zq0inmpfnhkj0zk9ij4f5y815f";
+    "MSTW2008nlo_mcrange_fixasmz_nf3" = "0zwnicbmmqbak5sw92njpmvxpjnnhwl1ggvlj8q39hn5w5kdy1kq";
+    "MSTW2008nlo_mcrange_nf3" = "01mlzqwk30glr95g7n2y3yvvy7s6mkbdb5cqwl1m7k8d6m18n49g";
+    "MSTW2008nnlo68cl" = "0y6lv1wkhydfnlakjrrrjapxaapa0bcbmfx0w9c4psgy156kv1fv";
+    "MSTW2008nnlo68cl_asmz+68cl" = "0fhkbkshrc29kz0fc9vi2dqsg6irjm4sfw4sp0s4wkj766wg19nz";
+    "MSTW2008nnlo68cl_asmz+68clhalf" = "1z0fplsv1fij4fgrz7npr34hcmc2qkf7g398bq1smvb6b2qy5jb8";
+    "MSTW2008nnlo68cl_asmz-68cl" = "1qhjhdzpy67665ccwv0n3g7jlyb2vfk60cphjr0jb1adgv9fxa7q";
+    "MSTW2008nnlo68cl_asmz-68clhalf" = "0rlsis3r7l32jdiq2yhx1mz7q6qlzlsrarljvrmxf0g0g2d8nr4c";
+    "MSTW2008nnlo68cl_nf3" = "07nrz7afd1mcsqc3lqv9vk2phs1nfxdl63qh1bc0g7nznxwmmn97";
+    "MSTW2008nnlo68cl_nf4" = "1kd62hzk2p3q56kj79bs101arp55ajlyhwwa3vq3yp37i3ynz9ds";
+    "MSTW2008nnlo68cl_nf4as5" = "0x19rq5k9c97vzskqppf4k0fjahwiw2c1nb6iy5c2fq8mj1pz2gj";
+    "MSTW2008nnlo90cl" = "13xqlfys37b8chinah2yqmzd0clzli06p7vjk30ha22wgwm02dq3";
+    "MSTW2008nnlo90cl_asmz+90cl" = "0pd6imc3hvq7vgyv1db9y8rvpgz4ffwqv6rqzp27c7ipxg0wjyz0";
+    "MSTW2008nnlo90cl_asmz+90clhalf" = "1xn52ppixjg22ybd8ggf0azb3zg5zyilqjss033g0k9crq4a6y2v";
+    "MSTW2008nnlo90cl_asmz-90cl" = "10wxgh52zs0fp0bwd0b6csnz9x6mvp45gvjhk0y1dhgfwbcvw9y9";
+    "MSTW2008nnlo90cl_asmz-90clhalf" = "1kmvp1yfgsx4jhsjc4drg82cq4xs6as4grwrymfkrqnvhcg86vap";
+    "MSTW2008nnlo90cl_nf3" = "0vw0cmszwp49fsskacccl921za88cl5cfy0sqckgxzs4hx21x43n";
+    "MSTW2008nnlo90cl_nf4" = "1b3fy8mfclgsmvpyzfs34fjry6djmkjcjppdxni1ipjyp1bcaia3";
+    "MSTW2008nnlo90cl_nf4as5" = "05phi752spikwq74i0hfid7lsqi51hdvwxm520kdmbdz2pblbz4f";
+    "MSTW2008nnlo_asmzrange" = "1nj68qhvlsqi7299d9rrsmq7pr6bdil4gzr6yla2cgn4wwiggdwn";
+    "MSTW2008nnlo_mbrange" = "0jnmy4i593wz80lbm0r0cwdj9xw496p3in0lq8ksr4yjwz0agpbk";
+    "MSTW2008nnlo_mbrange_nf4" = "0lw3p4q0ixj7plcmwqh43lfgv1i7ljar3f3k1v6f0imyvz8swfgr";
+    "MSTW2008nnlo_mcrange" = "17v549iq2wn5zvxfdvq8pf5f7zvgnpa72i6gxvxzfqwkji7mv522";
+    "MSTW2008nnlo_mcrange_fixasmz" = "05c8z2q2866550clx2mwb1jvhpn0agkyg82vvrswi3h4hgkvlfjx";
+    "MSTW2008nnlo_mcrange_fixasmz_nf3" = "0r86xsl1wfphwdj2hhlilkwc2949m7bcn42dms14g7w45i24g6id";
+    "MSTW2008nnlo_mcrange_nf3" = "1c9lsggncwghvw9mgd18h50ljrnlpp1p5r2zlzf8z3g8i4f3aaih";
+    "NNFF10_KAm_lo" = "19wn44svz61lhk33kzc6id18w6qbkw4bfnwncar19phrjjp965v6";
+    "NNFF10_KAm_nlo" = "191db9pj5yspiqc7598r147j9wvfc4s6cm0q805m5vmzpfg2cgr6";
+    "NNFF10_KAm_nnlo" = "1hm8vhk1p31zdn72bgcyyq0w5qii1ba0cf81wjlbhwv4fadfd4sy";
+    "NNFF10_KAp_lo" = "13yas11c7xxij45zrd3r6njjvx33kn9lg8i28ki0y4nw6ss21w3b";
+    "NNFF10_KAp_nlo" = "1jza83klbcb3j2pcg2xhgj2imh4llb6hsfkbfj294q0isqypgzsv";
+    "NNFF10_KAp_nnlo" = "0xwl34a31ajxwlgx6bhzzyf9b2xiq7bpv51p4zi6k1xihs91vwzc";
+    "NNFF10_KAsum_lo" = "128cj81qp09hn99dnkm9q06wf2dr7xjq9qmwvrmdizrd8cwfa4l1";
+    "NNFF10_KAsum_nlo" = "19pglfl1i5qg8sj3hg0qnhr1f66isfbrv7f901hnxniibbdjxib2";
+    "NNFF10_KAsum_nnlo" = "1769ybc49a94appmiw0bbn3kkvcpw82sggxgvvda5jq9m36m9yzb";
+    "NNFF10_PIm_lo" = "095xl0cs6p5z44hydfa963ylxvzqxdwwj1n8jn7n0c48rwssx357";
+    "NNFF10_PIm_nlo" = "1fn8863092fn4aqacprbsdxlgz27q6pam08pccwq9ps0dwjn7cc5";
+    "NNFF10_PIm_nnlo" = "0j4p50k821pphy8i6s73h3c29d7jb3bp5s4l8rl3bfb0nfx4p6hq";
+    "NNFF10_PIp_lo" = "0hhw2ympx1a8d3sl953k27yzww0j2f5m9b865gv1ybb3l9ccv1i6";
+    "NNFF10_PIp_nlo" = "18k3s7i1xvh8717n5cdllbb6zs8svh2bkw0k2zf4ql5ijiypvc10";
+    "NNFF10_PIp_nnlo" = "16mywhpc3439dpk2c1i6gxrv9khyyg0kl4gsc41qyi3r4d7k6n2c";
+    "NNFF10_PIsum_lo" = "1yh3hxfmgzgpwqidmzlc189syjbsj4vyswc4kch7yykxw4dqf6sa";
+    "NNFF10_PIsum_nlo" = "12rgg0nc9rjvwfpf0y9kl1w9814a4pv4b17p46h8qm6kfyqqwjia";
+    "NNFF10_PIsum_nnlo" = "19iz4q31apgm2il9478c7zmmc6kgz2wyp84qja761jvyl6z0img5";
+    "NNFF10_PRm_lo" = "0c5pavhf5flx2nmld2dprgp1lsbvsrjw5mqdzvgkks7ibvq0ap5j";
+    "NNFF10_PRm_nlo" = "0nfwhp9hacnm95w2qa5hvmfwaj7drc0w7lxqw1lrdp074bpd0ma3";
+    "NNFF10_PRm_nnlo" = "084dz4xxmydf71vkhcrmj03jkwyj56jxvmbzm22mdh2dxmkz3l1g";
+    "NNFF10_PRp_lo" = "014m0vjzrr4rbi84qxzmrym07kc4wax29fs66mfxkmrimxpb9l21";
+    "NNFF10_PRp_nlo" = "0lrzw2618kgk7vsksbr1qxqc4h9lza573bz6208hwdgkmh7awasc";
+    "NNFF10_PRp_nnlo" = "0bv07hh5rxvqw58jcam3piiiy19w325nrwivrifyv5wii8sybz8r";
+    "NNFF10_PRsum_lo" = "1a9m77rl49wzzgdkr6x618bzcm2p50f915bbggknx5xjw550dqd1";
+    "NNFF10_PRsum_nlo" = "1qambqywda7lvvkd6kx2r1g60v6lnqcamdd51396id33fvw3k45h";
+    "NNFF10_PRsum_nnlo" = "1kijaxw6v1w33q6l89raz7ic59zcmd3nx5djp83lyg134a15crmw";
+    "NNFF11_HadronSum_nlo" = "1n9fb71kl7y8rp1smyal28wdvdx1b410mhqkxmavnr1fs85hkh85";
+    "NNPDF21_lo_as_0119_100" = "19qw2hp1yk82qgcrpx8wp2fg8wklaj6rr653m6mndhhr0aa0w80v";
+    "NNPDF21_lo_as_0130_100" = "0p5cw77dg5pkhl3d0y6r3k8vhw4m467wf3gd8kp2l5vcbdwb4izv";
+    "NNPDF21_lostar_as_0119_100" = "0i23axf0xl11nb2dn6p34bnm1xfisnn3a82db9dz863n60gqb5x4";
+    "NNPDF21_lostar_as_0130_100" = "1aka01747071l53jx4v7rgmfj5danzjillbwincgi1b28mw78yhq";
+    "NNPDF23_lo_as_0119_qed" = "02d85an11mr66yg3vi5fq4919ymbrh9h8b8qzzzm9dvfarzmbwxi";
+    "NNPDF23_lo_as_0130_qed" = "0qsxxw3nds42924xqnhs56wmd8ihmrip28glj47q9r9i3kgw3lv0";
+    "NNPDF23_nlo_FFN_NF4_as_0116" = "1d5wccg8l5xmdr8pvks6851zxrlgq1rk2y5dgp10k6r108059rgn";
+    "NNPDF23_nlo_FFN_NF4_as_0116_mc" = "1sc13cqah6di97fmlnb6qw454jyrp0i9jv2pfxvi8ix2vzd6km00";
+    "NNPDF23_nlo_FFN_NF4_as_0117" = "1gkzb46fnf9k97fgbbxljdnklffwnxmg58z01x55iklq4sn2aww3";
+    "NNPDF23_nlo_FFN_NF4_as_0117_mc" = "0nc3fx9ggqybymw5kglwq3kmznc9hm28sp58gs1l4gwx3xiy0bj6";
+    "NNPDF23_nlo_FFN_NF4_as_0118" = "1zlcqh0nfy8yf2cnzs0iy615nbmhpa2zh4carvifcqd4lv4azkp6";
+    "NNPDF23_nlo_FFN_NF4_as_0118_mc" = "0518z8jakc9r74kzanraf2n8haminfipp2rvr1288ymhsl5bxyp0";
+    "NNPDF23_nlo_FFN_NF4_as_0119" = "1k5mcql2411020m6vq26ck8ig3q01j79ndjgci2biq743m8nlvm2";
+    "NNPDF23_nlo_FFN_NF4_as_0119_mc" = "06yv9mwgvhag5442581r7by3nsxcy7c76llgaalphbzszqr2vy0p";
+    "NNPDF23_nlo_FFN_NF4_as_0120" = "1m97g47p44vq3izjji6agwmj2fwdvgddzy8w40mqqbr9fk19lbyi";
+    "NNPDF23_nlo_FFN_NF4_as_0120_mc" = "0bjllckv61jc1y6f8c1gqdh36r15glqn8fqp99q0kckaxyszy5vw";
+    "NNPDF23_nlo_FFN_NF5_as_0116" = "0x4kjj791hkwng4l5dvch8z0ig1nkliirlz9mkv02g54qrilnkmy";
+    "NNPDF23_nlo_FFN_NF5_as_0116_mc" = "055clf0m8l8gnby2lgwh4wkyqciskwp54y34vb1kwfbhdf71zmnj";
+    "NNPDF23_nlo_FFN_NF5_as_0117" = "1cplvrizlsjcixsjzlm2drssbjsrzj9bvq0k5mnv79r3p1xdp997";
+    "NNPDF23_nlo_FFN_NF5_as_0117_mc" = "17nic3kw991dbrhyjyxpk0zzv8rjh0r0whd6nl8v6wsf5q5h0ny2";
+    "NNPDF23_nlo_FFN_NF5_as_0118" = "07fgr71x2zk2ywcbnw0ikv0p9kzsmd83kdidfs49vm7azcbm0qfw";
+    "NNPDF23_nlo_FFN_NF5_as_0118_mc" = "0s365gsidichyj9x5926q1gm0x1bp52chv7fkpirflrrsywf0lc3";
+    "NNPDF23_nlo_FFN_NF5_as_0119" = "1qspxbwswz7ssqj2rx2jdg0bkj8prawwshvjd26ifz9i0l9qnqc0";
+    "NNPDF23_nlo_FFN_NF5_as_0119_mc" = "0aqyhrcrzs3kqhj1hndilpibvdwfw9qhg1x0cypx97h16n37j46x";
+    "NNPDF23_nlo_FFN_NF5_as_0120" = "1k9savpyg2iqr1ab4i5y7q1qhd8zxq413040h2v46jl8mp7x6bjn";
+    "NNPDF23_nlo_FFN_NF5_as_0120_mc" = "01g7mh7v62s47cwdf6ws6j37gxl4mrb26ivdzzwmhy6ydiw8ka53";
+    "NNPDF23_nlo_as_0114" = "0mmq32kddspgpacx2qj086das9z2bxh3l37qvp9yf84gqzjj7mml";
+    "NNPDF23_nlo_as_0115" = "0jn1gv137d2x3vxq7ny0qc0hnfmcd4hs3cxkyn7j26w7p59q81x7";
+    "NNPDF23_nlo_as_0116" = "1mnq360acd5vfwz9z8fzynldchkqrfiqhsxvi3s9a263h3p44bsa";
+    "NNPDF23_nlo_as_0116_mc" = "0ngw2hls52bax6dmis3nfa2ix8q8nh2d9mwjax4cjdkmmf7rdn2g";
+    "NNPDF23_nlo_as_0117" = "01wkq68b8zl3mznzvc4p7p9b4ik2bnqgjq97mw2287i448mnj9jn";
+    "NNPDF23_nlo_as_0117_mc" = "1s2g55240gh9j32ach9rban0iw4hjmw5haj1c21wgyh4nqiqlfwr";
+    "NNPDF23_nlo_as_0117_qed" = "1l2rbxn9fw72nmhqazfkh568q4df0q2jp0pn0fj368wdpf36fk0b";
+    "NNPDF23_nlo_as_0117_qed_neutron" = "17rpz4bdp3fxvafiz32aawxw64prkhqwqpnfnbqsigcslm18bwnc";
+    "NNPDF23_nlo_as_0118" = "01kax3g4d8nd6n1gip70d02kl3kvbqib93b99xgwc1f0np85p3r0";
+    "NNPDF23_nlo_as_0118_mc" = "0qhs7r4zzw68grrmfh7qdad49w4y4mvf55qnp86piri5vi8lklwk";
+    "NNPDF23_nlo_as_0118_qed" = "10xfv8nkg2jjy3yg9m9gakz6lixdvmahdy1z12znqyr1br57bdhy";
+    "NNPDF23_nlo_as_0118_qed_neutron" = "1zffxfykx2v3dniypsvyyqbz5pb4dcww653amaxv96hplw3fvr0h";
+    "NNPDF23_nlo_as_0119" = "1v24iwddahxy6sd43bxv6ywf8n7302qkwl9hv7d074q1d932kgr1";
+    "NNPDF23_nlo_as_0119_mc" = "0l95fgr5bwhsh0h3qqlnx9czkgmrf5y084zlzk3qhix3ldh8zbp4";
+    "NNPDF23_nlo_as_0119_qed" = "0rayscazcacy89lzg0ynpwrl9g4pnjwwp0l0vwc3gjz9cwznmwsk";
+    "NNPDF23_nlo_as_0119_qed_mc" = "1cc3candpavcfbv681zpg8gmwbh3g14vqkhs2s6v7rr9xhx6zqv1";
+    "NNPDF23_nlo_as_0119_qed_neutron" = "12h4x97yglcklrvwh937xa5bgqahq949a5wm3nyjbvrfsw9n330i";
+    "NNPDF23_nlo_as_0120" = "0f8lwydw45vy7c0mqmz60hpc0b40czx0gx35liyrhcbjvj9129m7";
+    "NNPDF23_nlo_as_0120_mc" = "0kqiizf0c0mbdavnv7ivk89kga84j7p7xprqi10589ggplchx8ag";
+    "NNPDF23_nlo_as_0121" = "17603srm35158sdwrqijyxm614splx7k6bjyzphgvznnkwpgi0i3";
+    "NNPDF23_nlo_as_0122" = "0c16498ngx436k9mb8fwkhhvcbdyjd4m0jh54v2n1dl354jz60sm";
+    "NNPDF23_nlo_as_0123" = "1j6d7k8d04gfx532iipd4vzm0nldbvy86pg8asgv4xrh80c1zslc";
+    "NNPDF23_nlo_as_0124" = "0dwv41kc9qsvvp22gvxi56gj13dnklgfp4ndrm0475q6gvfz25ak";
+    "NNPDF23_nlo_collider_as_0116" = "1hl7xw8jz0gijxh9cjkxv1rb1xncb1622ghf6wnsaarlqr4947ky";
+    "NNPDF23_nlo_collider_as_0117" = "08krhmjbgza9f4mbq7cdj9g7hh260aaniqqi5awbgp7idbn3nccj";
+    "NNPDF23_nlo_collider_as_0118" = "17645h9l8z8nk7pdaxdhvcfmcvi8ib8yylhiijkkw9yrywb5pakm";
+    "NNPDF23_nlo_collider_as_0119" = "0csf74lpxgzg48v6962falxd8n2nc9xdrqnxxwadqqyrnrfs06dw";
+    "NNPDF23_nlo_collider_as_0120" = "17xqx8hnwy7a67ah0ds8m3nv3cbq20vri83nlwahwfsbig7w505x";
+    "NNPDF23_nlo_noLHC_as_0116" = "02nhh7n2qzx3ak7ih2d3vw3a4dffxbbpv9wrh2yhz30zbrqqlzv2";
+    "NNPDF23_nlo_noLHC_as_0117" = "14j8hx346krwbi2fyyk77k60d7dlk2xlsc6zd543y03jdpk4ahlx";
+    "NNPDF23_nlo_noLHC_as_0118" = "0vwi6h1fkwjg28p2f3br1g601i8ca4dpfjs9vxg80kjzkif6k310";
+    "NNPDF23_nlo_noLHC_as_0119" = "02l15h62gn0njnj459pkp3k1nhiaivlknmbxb3giqpg6wmm2m9y1";
+    "NNPDF23_nlo_noLHC_as_0120" = "13lxmwmywg7wrwhgp0cb41b42479fgfa1bz3aqkbrnf6gi6pviln";
+    "NNPDF23_nnlo_FFN_NF4_as_0116" = "0j4ng2vl955vnq40zv5v9sb0wk8qari61v7995p2l0sxz268sz50";
+    "NNPDF23_nnlo_FFN_NF4_as_0117" = "1wjqlv6mbl2lgvwr5av47amrs8gnqkpkxzq91jvpaxkya3bmglc3";
+    "NNPDF23_nnlo_FFN_NF4_as_0118" = "113s8lxrmif79c6f11pnk5jz7q4lq7108gcfx84nanpksr9dmi6m";
+    "NNPDF23_nnlo_FFN_NF4_as_0119" = "1688qacmp9kl50q1vzffcprf9ydbi2bb2brc68jvid5f7bjkyfmw";
+    "NNPDF23_nnlo_FFN_NF4_as_0120" = "1i3cjnz5zgk8jw5jcrqy6kxx1i5v2a2lgy2fdck3j19cvn0iqqr9";
+    "NNPDF23_nnlo_FFN_NF5_as_0116" = "0v6ap405v9zapbi5sqldvs5lyhz5wsh4cxl8ssxj0l4789qm24hb";
+    "NNPDF23_nnlo_FFN_NF5_as_0117" = "153f95cqd0hkxfy9p81mf2dfdp13h3fhhp0qyxmiknhqm10ykdxq";
+    "NNPDF23_nnlo_FFN_NF5_as_0118" = "0fch9i9qj1k8h3sdwfdcd75idi0bv2q7a338dvj4697xqpxf2mj4";
+    "NNPDF23_nnlo_FFN_NF5_as_0119" = "03r72mrbvy9jkkbmgvp2776xxgjx0jyxsv4bvpxmhscpym9mjvq7";
+    "NNPDF23_nnlo_FFN_NF5_as_0120" = "0rsflim77kdp849pg6f87rq6j0wirj4gayvrnvi4xvfjlk1mxkll";
+    "NNPDF23_nnlo_as_0114" = "1p32hw48zwmvj9i5iyg9pqhf11zwf7m7g5q8prfj8825dvsgql94";
+    "NNPDF23_nnlo_as_0115" = "0smmwd7xla73sb3bci46grj1kfd751pybkf7fz3w3qdkp5jjglqp";
+    "NNPDF23_nnlo_as_0116" = "14blxcfb2jbdgwh73f2spvqxy5dhn5v6ygwi346dzwswipwbixir";
+    "NNPDF23_nnlo_as_0117" = "0di0a5dkskalllnh90ngfb046z5hm9ihjra1r1ck06v9ryam2w9c";
+    "NNPDF23_nnlo_as_0117_qed" = "0dvzz7ac45j4m655k0i3ycy6xwfm6y6801qsb5bgp1kdv7g2pj3z";
+    "NNPDF23_nnlo_as_0117_qed_neutron" = "0v05yw5nc1r7vh8sjag4fmdklkn4jmcdpsmgvwm7sblgfc6gnssm";
+    "NNPDF23_nnlo_as_0118" = "14p9y1ryc1j26gl01sn60pmrfpnkm81bhark2g98xz8dmfmjp7iq";
+    "NNPDF23_nnlo_as_0118_qed" = "15mcq4q20ijmf06pcc626jlk22fm8c473p4i80bmi27h5x2pl56i";
+    "NNPDF23_nnlo_as_0118_qed_neutron" = "15vsjjc1i2x6lb0603h6knj68si8cvxml2xk97pw343qn3p8h4ka";
+    "NNPDF23_nnlo_as_0119" = "1qzap9zlpwyyshh8hc0gm82y9rl9hpy232j03gd6vwmcw5pgm2d2";
+    "NNPDF23_nnlo_as_0119_qed" = "1cqvdmq0hm9rh6749bn08i6c94gshpjafmwv8siizdlm8v9af442";
+    "NNPDF23_nnlo_as_0119_qed_mc" = "0a77i8grscxwnybgikik94ldiddrif3yy6d4bqb6x1aj4hr9i5ag";
+    "NNPDF23_nnlo_as_0119_qed_neutron" = "182jqm5019n94givs4rwblpz02hp90mbizp0b5svrxf21zdyrmbx";
+    "NNPDF23_nnlo_as_0120" = "1v8ykgxnqbvfra57xpamhgbcjvj89dndhk62pmji004gvqpmwi61";
+    "NNPDF23_nnlo_as_0121" = "1fv1m86ya7zi77ajd8r1nls2zcr7n6s3wqrdiwq5ikxidqxc6cgy";
+    "NNPDF23_nnlo_as_0122" = "0bn6bmvs8w9qsqcpq8y8a7w64xbkvrqwiikm5shjprwqy9xbspyf";
+    "NNPDF23_nnlo_as_0123" = "0w7sqyyf98ymxpgqfh8gr9g1pdwr2pw12zc8gqykn5nkjbbmijgy";
+    "NNPDF23_nnlo_as_0124" = "1hilgda0gqyj81a5h0mxrl5g9ahlm1n6mhd3ajkicxz2fvxm2n1l";
+    "NNPDF23_nnlo_collider_as_0116" = "07m2jwjwzjc4bdsx9dkrp41qn04f9z3k2m6n4q308hwdq9lmcm99";
+    "NNPDF23_nnlo_collider_as_0117" = "0i4kggkkkp407r33a2nsdy329zxpx8h6dq0h0wwpvq1kmyrjk6i4";
+    "NNPDF23_nnlo_collider_as_0118" = "027wlw7lk04grz5qavyymj21ik4zr9fy9yk2kwjc9gx2ycp3sj2z";
+    "NNPDF23_nnlo_collider_as_0119" = "0jq3q3sh1p8rn1qap77794v9hh3j0b7pmfl24wxvpc4dly4al0vs";
+    "NNPDF23_nnlo_collider_as_0120" = "1s0jic8amasmxczdflbbhn6071nx8cxr3ynfrinllp36d92pmgsx";
+    "NNPDF23_nnlo_noLHC_as_0116" = "0jzn78p2gygsqip50jfnnrmwl7issbp4vzpf71cbvj39ihsmavy0";
+    "NNPDF23_nnlo_noLHC_as_0117" = "0zns2yy50c0bm91y8xaafmzhgx1wafvmv39cykw7xwsnkgclh487";
+    "NNPDF23_nnlo_noLHC_as_0118" = "0v5bdc8d9w5g606h42rpn6zw31y1a5nk9akgfd1lyrhilvh7ayck";
+    "NNPDF23_nnlo_noLHC_as_0119" = "1zacfd5jc5wvcig0g8g4jkr77zcxvzcvppa4ci81c1n8d0whnr5s";
+    "NNPDF23_nnlo_noLHC_as_0120" = "1lx7m8ajwvhkzxck2ngxng1g90fpay5r5iwdnk2w7xgp1hb1ayc3";
+    "NNPDF30_lo_as_0118" = "12adhizxskpjzdr6inc2hi6bxrs8ns3bnyihz09hfh9q53d5ayik";
+    "NNPDF30_lo_as_0118_nf_3" = "1gjaiwqdhlswf1qmw39xr6g0w4bnnbinfpwl9c37jnggk6dxwdjz";
+    "NNPDF30_lo_as_0118_nf_4" = "121xn280f5xx04q0rr4ina9iqzbc1v8cay78km836kqvgb3pcpyx";
+    "NNPDF30_lo_as_0118_nf_6" = "1s77g0bf1qjb9rn1svnpfx10laxx87lw660ark9fhhx14zgybs3i";
+    "NNPDF30_lo_as_0130" = "0nvpwbmdzm8fn4wlb2rhzar71kk4myfddpqsqhd7wb1fqxkj5b7y";
+    "NNPDF30_lo_as_0130_nf_3" = "10diiahiy3yk6y7m1r4bd6nr1kf4mnccgj5qyq2lw49highn4s8k";
+    "NNPDF30_lo_as_0130_nf_4" = "0j3b3rj5pr2ws3yaq6h74hhsjy7lv3d2x5nryc55q22xfkgf451i";
+    "NNPDF30_lo_as_0130_nf_6" = "0w7k4a9ir4xvfh3v6dba70rhwkkq7qk16z178wld26zl6a7gw1hk";
+    "NNPDF30_nlo_as_0115" = "15g9alyc317qydqy3g7sqlh6pc4pxn3xmhmzv9lcw2ghg3gn35fi";
+    "NNPDF30_nlo_as_0115_nf_3" = "05b5xl89jvk6bgp86yl5hwdh3x8211czdsbianqkfix35rqrvlx3";
+    "NNPDF30_nlo_as_0115_nf_4" = "02p9lhvricjl5r79pkcm2fv14p9gw1d2qizka4w254ang3i1hcm0";
+    "NNPDF30_nlo_as_0115_nf_6" = "1iabf2qszv1270ac2sr2bqs7rb3gm58fj388saqbhnra4p2kv9fw";
+    "NNPDF30_nlo_as_0117" = "01my1m7vx7yax8ldnjp7s1mz1w3x3m0h1gdd8mamfrvphaghwp4x";
+    "NNPDF30_nlo_as_0117_atlas" = "0vjfh6kihsypvkpg3fwqf96kd2ldq0azcl72ia6w1nr52rsqc27l";
+    "NNPDF30_nlo_as_0117_cms" = "1sbaq99731ihrkp9a2fj6lxj9dr2c9j4vp2335249nrkinfpf4mq";
+    "NNPDF30_nlo_as_0117_cons" = "14qwjsa633v3h0sbizmhifrwdm7fmglyk608lq4ims8y7nn491nq";
+    "NNPDF30_nlo_as_0117_hera" = "05gs9ril5vkm7xrnz5pvjd6pk8ivgk0bl4bh45gx658fgg2snhiy";
+    "NNPDF30_nlo_as_0117_nf_3" = "0jc8p8h9pny0l7j3hv55iwaw684ymj0hl62d6bxlvw8sqvhxcqyl";
+    "NNPDF30_nlo_as_0117_nf_4" = "0a37b46ach3m0gqniwk79qk963w0m96dknda2rhp1glpg5xdxl0z";
+    "NNPDF30_nlo_as_0117_nf_6" = "1hjj6k5g2fia7xq5piy0dhsqs9lwriasmppjwil9wxnwklnwmr2m";
+    "NNPDF30_nlo_as_0117_nojet" = "0z3s8ixmq2l4znv2dn0dcz9rq5f9b3jgnlwmvjzcab3wvj1za687";
+    "NNPDF30_nlo_as_0117_nolhc" = "1x9nbnxm72wzaky4rvlrq1kmqs86ypphqwvsng33n0zdd9yr82pr";
+    "NNPDF30_nlo_as_0118" = "0b51qb2i3h9d7hrviarfszwljsy88m8ibzgz7dd5gn88k9kardrm";
+    "NNPDF30_nlo_as_0118_1000" = "17yla3w0rqy1a5hxq3bfq94ddda2qv6zzj76lfrm4zahl6m02kdy";
+    "NNPDF30_nlo_as_0118_atlas" = "034h2wgakbm3mx70034nwb44ii38rca7xv3az3fhcnjbpg9vnf0p";
+    "NNPDF30_nlo_as_0118_cms" = "08g9315fpc4khwfjf76vvyqa9nannvwq0bpc42f9f7yc0pck71qa";
+    "NNPDF30_nlo_as_0118_cons" = "1lw0fhy9gwk3zr7vq7qh9p6zprbyd4faln3npnxs2snncic1mnz6";
+    "NNPDF30_nlo_as_0118_hera" = "1833gd9h3gg75hblxf5qh5hp61k7n9vavb91ll9lbqmcbfr34aas";
+    "NNPDF30_nlo_as_0118_hera_1000" = "0lljb96d3q25yw3fz3cbk2in90q6srpc4alkz95nyrvgp25xgbgy";
+    "NNPDF30_nlo_as_0118_hessian" = "0h8d2zc02ccr1rmlsf4xd5a41irbs9q9wx68caj2xy0i7qr8rsmp";
+    "NNPDF30_nlo_as_0118_mc" = "12nnyzh2f6mv4gq4x4b8nlqx34lbj5y2y60zivfdbcpyg2spj5y8";
+    "NNPDF30_nlo_as_0118_nf_3" = "10f5md8bhf44n5x6r7ln8c58a9ylm4mfgxg30vd0d8mvjc3zpsng";
+    "NNPDF30_nlo_as_0118_nf_4" = "0q14zqkzqy2hgh8wli5db7dsqgsljgbc717da661wj8kqa23w4r4";
+    "NNPDF30_nlo_as_0118_nf_6" = "08ajfn1r27hdarff464j2gpi7ffjjxs6pwzh3vil8lpjij5y7d4l";
+    "NNPDF30_nlo_as_0118_nojet" = "0zzzk72n7nq1mcaalbv7mpfpb9kh095j0zazbzfjf2k6r3p0v082";
+    "NNPDF30_nlo_as_0118_nolhc" = "1p7iac75znr1li8qg9xf1my37i70flhvjkfjmrb5b0h3hk9agb1r";
+    "NNPDF30_nlo_as_0118_nolhc_1000" = "04mgjfq1ncy90gqljfdzw1iwzav5infkfv7zj2rid088n3qfs91p";
+    "NNPDF30_nlo_as_0119" = "0p0kgw17c97p99zy3ffr6g7pphhc8ccdhcq4iip5drqm4hc6nb58";
+    "NNPDF30_nlo_as_0119_atlas" = "1hpx2jm4y6kz9b4j42ags98j115hd2s41km670979z9zxmj2qm5q";
+    "NNPDF30_nlo_as_0119_cms" = "1j0135mxdiyn22iqrmg0d44w2w7ql1cdacprxgdz4jfb0ppn68rx";
+    "NNPDF30_nlo_as_0119_cons" = "00qvhq9ypqv62zvlg32k3x5gibl5jh0b78hyrpvxf1l3y2b77nw1";
+    "NNPDF30_nlo_as_0119_hera" = "008f4m8p9gi4w61mgjiqqpw346rgqxaayc1rncy2fggl4gs64yi1";
+    "NNPDF30_nlo_as_0119_nf_3" = "1bh0sl8pjy5n90j5dz9c80n3vy21hdsv8vxwbqkq0b2lkv8gzw5g";
+    "NNPDF30_nlo_as_0119_nf_4" = "0swgnmbxz0g3ziib1992s0454jfsdi7l0x3lrvs5qzzjk6rg6qgd";
+    "NNPDF30_nlo_as_0119_nf_6" = "001awj8h76wybmxj9vvkxgqixzak4zbhsvjmj2lscb2v5qq3y68r";
+    "NNPDF30_nlo_as_0119_nojet" = "1x961nmad1rxmf4yzbz2drpi5hfac2ag1bs1jbvvlw3p04xr2c38";
+    "NNPDF30_nlo_as_0119_nolhc" = "1yx6f4n577zqwhp0i440r6zk06702jg4kkib9nmgws3jl5f28big";
+    "NNPDF30_nlo_as_0121" = "10k01z1amzp3jmfvfb2snrm8d04vr31kly1m30pw4fv0qn78idlw";
+    "NNPDF30_nlo_as_0121_nf_3" = "1gb40ycnf42fkrbdwfhb8wp56nmzxyi7fzbqgvlkby7pn86m2f7m";
+    "NNPDF30_nlo_as_0121_nf_4" = "18ywp6b9f83rxmh7gfn648wslvvf5g4ffm83rradp308smr1sv6p";
+    "NNPDF30_nlo_as_0121_nf_6" = "12dps7n3glrzwb8vsfghwbvnh1yyxvjnvqfilbrrcy0dm3sams7b";
+    "NNPDF30_nlo_nf_4_pdfas" = "0hrx872m52bb894c32jrvlvm9lcpy3yllj5ps52nmywqd8n1simj";
+    "NNPDF30_nlo_nf_5_pdfas" = "0q25jxvwpz8inkax0j2zq9pj8swqfn4jmkhs4ibkl6xs78bhjfb8";
+    "NNPDF30_nnlo_as_0115" = "03apmzw7krj77zdyl6sxwqg5fyv3vicp8iax445qdx8ld9kv225w";
+    "NNPDF30_nnlo_as_0115_nf_3" = "08y1gjzkpnjn6mn247n7a9ya8z6pml3602p08rjha4ljggxhyffq";
+    "NNPDF30_nnlo_as_0115_nf_4" = "19mjfk1rib9dxbsn0473ggi6akwv1zs9y3q9nzjg47mdjqlspb2q";
+    "NNPDF30_nnlo_as_0115_nf_6" = "1zcjjbjwjgbkrhgh0kira7wzwmy5vvi1n15wycg33yk09m06db6b";
+    "NNPDF30_nnlo_as_0117" = "1225gj4ihmphnfav2h38rz17lj1dyi9j1lazqlwww8vizl8933bz";
+    "NNPDF30_nnlo_as_0117_atlas" = "0i9nc7q1cwl8cxxaj1xaz28wmj09q5bjmh19p1fcbcln7hklvj5x";
+    "NNPDF30_nnlo_as_0117_cms" = "01ffhsw191nrr58x6wnjizx7bbijkknicvgk73pjbwyr67gfj581";
+    "NNPDF30_nnlo_as_0117_cons" = "1blfi0p231r5j34wspk192fmbv34gbvx3bkisjh7wxpiab80qdws";
+    "NNPDF30_nnlo_as_0117_hera" = "0ds02aj1q6y4dndfk9l9fyxci0dhpwr7jx1jq1qb9g5bb7bbhzz1";
+    "NNPDF30_nnlo_as_0117_nf_3" = "087rz8bz3j2h7yk7rknlqz3rpbczgx2r2zdag8pjccdqi9jnk9pg";
+    "NNPDF30_nnlo_as_0117_nf_4" = "1w44bwx6m6g8r990vl6f505bgf3v583mi19r0nfh2pahx2k2djaw";
+    "NNPDF30_nnlo_as_0117_nf_6" = "1l7gwbsl2haqaj6hqsnnqwrnxrkdv1h63qbs7iwfdq6474ndzwsf";
+    "NNPDF30_nnlo_as_0117_nojet" = "1nmv44arab9gfhs02jf4zijdb0644pvdmi6k809bxbfhir9sry8v";
+    "NNPDF30_nnlo_as_0117_nolhc" = "0zn2b05jv9da7394in14mswvma48y26lvpw7rwh7wmyw323rxpfv";
+    "NNPDF30_nnlo_as_0118" = "09xxi0vq90n9vfzq72c0mbf4yz4zif3kl6xwcjdb8r620ihwrnfw";
+    "NNPDF30_nnlo_as_0118_1000" = "1iy5inrsfpn70w65hy42pmz0630pbrgg4l48qgsamcjgqdhd3n84";
+    "NNPDF30_nnlo_as_0118_atlas" = "013jm6f2hnmzc2di7spf6zp31fwhm6c9sddwql36hww63w8sys71";
+    "NNPDF30_nnlo_as_0118_cms" = "1w0ax68rg5877s35zlg13c451fcz2rij4adzwhz4yf4skkbgflng";
+    "NNPDF30_nnlo_as_0118_cons" = "1qniswwj6cmcs7bm4n11jx2disqcwszl08cb7im824nvrcjka2pg";
+    "NNPDF30_nnlo_as_0118_hera" = "05j5yrra93dxh1nah19hszd0q3pj4zfica8a7vm5akbfn02rccj6";
+    "NNPDF30_nnlo_as_0118_hera_1000" = "0ssiw9fk5fqwg77rbycrxrclldws35n6gj4a4sj6d9yc87vz1g7z";
+    "NNPDF30_nnlo_as_0118_hessian" = "1hb32bamwlx5il8g2sf5gy6xjr7r4rky7xgvdhf5ndq7v3n1ncx1";
+    "NNPDF30_nnlo_as_0118_mc" = "1gxl4c5z2vh382y8l2kpr8vy4fqvbxvrw6xjc6dp229ak89cd6c2";
+    "NNPDF30_nnlo_as_0118_nf_3" = "0iccjcds9j9pp8s3mwrshhzl5anklax4rgcwm5im90hipj450rgj";
+    "NNPDF30_nnlo_as_0118_nf_4" = "002r0179jsl0l43psvw3hd1drg9fcrlzw57sbyndlswvq4zkyzyc";
+    "NNPDF30_nnlo_as_0118_nf_6" = "1mwh2dxymayxa2khxjfxqmbhaj85jdnz548wmq6fyrxr63cfmw07";
+    "NNPDF30_nnlo_as_0118_nojet" = "0nly14fxfww78qihrd8b6wk3da24x5sxkb13h8l2cgdxkq90fxbd";
+    "NNPDF30_nnlo_as_0118_nolhc" = "11yvr5h66v37376d5p2m2g8fajdycv9baqq6mjfphf4a2abrl7m5";
+    "NNPDF30_nnlo_as_0118_nolhc_1000" = "1bi0mxs6v1izlbvich55vi7qab72v1sizd4wj13787w47ffqm89p";
+    "NNPDF30_nnlo_as_0119" = "11bvbqqjbyz0vjd4kh5qyd0a4rb62l103n10d1cyffgdfxxsk8f9";
+    "NNPDF30_nnlo_as_0119_atlas" = "1fm46crfparx2swpxnyscpwqgicxb4skhclnc5xaijcpzraflzp7";
+    "NNPDF30_nnlo_as_0119_cms" = "0i2d4wq7bsbfp8hqdr88nbii980zhfmpg6758czz7swd5yv8076a";
+    "NNPDF30_nnlo_as_0119_cons" = "0v54zyz410rg3wcdw44japzynzvvrbjrspk91d0129rdv2xz51cg";
+    "NNPDF30_nnlo_as_0119_hera" = "09w3krirq117cnhfkxlb8pld3xb5g2r3nhgc11v3ksavq746jhvk";
+    "NNPDF30_nnlo_as_0119_nf_3" = "1k00h1c0lv6884lb02qmqki7sfmxkqpj88fkvf057frk120f59ah";
+    "NNPDF30_nnlo_as_0119_nf_4" = "0pqjvaw2ad3g9zzjdyhh72580jrj4p8hxlvy9h6q9hhpwdihnnmh";
+    "NNPDF30_nnlo_as_0119_nf_6" = "096fc9958s3z559knxqccwj3vylxviq2g58rwirj3qdjvy96y2cc";
+    "NNPDF30_nnlo_as_0119_nojet" = "0l5crj00jm2vxgyr5nhs6h1n64xnxwpanrsjk8f8qfis37s68ar7";
+    "NNPDF30_nnlo_as_0119_nolhc" = "1nl4gkjjz3kpq1sbzqk2d0d50vmb3ks7j5z14hqf9dib2xr39jl1";
+    "NNPDF30_nnlo_as_0121" = "1c0ddbjskxw4rq1p8sp63vayxkvcnls062qp16wvrrbw7zkj1jaa";
+    "NNPDF30_nnlo_as_0121_nf_3" = "1sj9g0wg6x2cvwp45i726dcs44hpqjiqa011xzindnjh8cq7m6xn";
+    "NNPDF30_nnlo_as_0121_nf_4" = "1j4khzpw52vc26n7a95xg1wyqz720fnz2kbb8l9a5bsbmxmaa7xv";
+    "NNPDF30_nnlo_as_0121_nf_6" = "1kln7zjgl0hwl621wnhhsih0m8f9ir2i8ligfg2s0qp8s3787lrg";
+    "NNPDF30_nnlo_nf_4_pdfas" = "0s460v9712ahz09fhzhlnsnkl9arsy3l82g1z6xjz4la8fwkr9wq";
+    "NNPDF30_nnlo_nf_5_pdfas" = "1vjfm9j39m4389b0r51axlbzdbkpk2vbs3vks3yqcr3hr09g9myk";
+    "NNPDF31_lo_as_0118" = "1jq8ad68kym717qinwdldvrjnry9sfsfq7lvfv6ipm1sdzixqm96";
+    "NNPDF31_lo_as_0130" = "1lg49cbg43yrpb7fgqfk0d55m28rrw781mks3zn9m24fv0hiyzqp";
+    "NNPDF31_lo_pch_as_0118" = "0xm3fyvrm77hd2layrfwc74vncc470gvf7hx8nzd2sw3ai1g9h7x";
+    "NNPDF31_lo_pch_as_0130" = "18fip94c0ywzj543qq154z2wnllbn8jw61nx6l8v9wmg2sdzi6zi";
+    "NNPDF31_nlo_as_0116" = "0i6bpa2wf52vsc6x5nlsmncal1ghqpsyz7pya2a2zg0k7z6dfcsp";
+    "NNPDF31_nlo_as_0118" = "0vwbgaxs5gj5cnyncmc7m3650pd6bplwdga3fnyy1vrrh3mpsngh";
+    "NNPDF31_nlo_as_0118_1000" = "0ql0phs563ck7bx7cm5x242icfb2jrlsxhsv80m0hxyr3fhyc06h";
+    "NNPDF31_nlo_as_0118_C1p6" = "0nn6krh6vk8rxiwhpnn3nbxian8hw8d1vq31ywh9560hbi3vpcrl";
+    "NNPDF31_nlo_as_0118_hessian" = "10v2ayms2mhm9zi7k0fw9rshawc7njdlbjs8rfg5hiqn1adss4w3";
+    "NNPDF31_nlo_as_0118_luxqed" = "19fdqxfmx8kzcgq13dk4k1nhkgqpnm5xgahp13hwz1i2vcp6xq87";
+    "NNPDF31_nlo_as_0118_mc" = "1yw21cs6p85ij8lm9k0cvlm651a3x9f73f23ysxjgh1r5kqnhz9y";
+    "NNPDF31_nlo_as_0118_nf_4" = "0qywlyd34yqb2r8ch9wjimyfi1jr3rdhxliwrmns0558hbd47a3z";
+    "NNPDF31_nlo_as_0118_nf_6" = "1pb22z2s0ir130dk5pkxwyid37i6mf8jpr7k7nlfi45gl9zy5ldd";
+    "NNPDF31_nlo_as_0120" = "1b5wsab66karm1ay5vxpjw21g2ywhnzqnlahxnvnaf80izha35hl";
+    "NNPDF31_nlo_hessian_pdfas" = "0sxka18qp99gjj9abml2ba4877zavijmjfzg6m0qczx9m8v9m3xg";
+    "NNPDF31_nlo_pch_as_0116" = "1wqpq2qj5czvcj754nd6c7rrss8skjx58vp2gj2bc5n95jv1qazn";
+    "NNPDF31_nlo_pch_as_0118" = "113xpp3xvpfpivlj6p7av4czfbfnh6bk2kd4d2635ddvy0clqkpf";
+    "NNPDF31_nlo_pch_as_0118_1000" = "1sbjqkwq7iy7fnk3r9ga1rzadzy8x3ld933vcih87is09bzg5rfl";
+    "NNPDF31_nlo_pch_as_0118_hessian" = "0xmz2hc3n8alhf210axv3amf7klhbyl1dd1z2yyx6c3pcvcrf80m";
+    "NNPDF31_nlo_pch_as_0118_mc" = "1w1jifp5f7ypf5xqdw1mkx1d6shknryhqzk8rk8naf37bms68mfn";
+    "NNPDF31_nlo_pch_as_0118_nf_3" = "0m7rq7k8x6bsakkw3kmcicq04c39flrw1axv72dqaf9xci9w3pii";
+    "NNPDF31_nlo_pch_as_0118_nf_4" = "0k77chw866shjkc0ml6kb4az75sdcvdd897r8d56jl72d2lkxp3m";
+    "NNPDF31_nlo_pch_as_0118_nf_6" = "0bdc60dxj7jmqacbbaxp2m9qzg82r6pgn7h9pi2k15d07qm6fc4d";
+    "NNPDF31_nlo_pch_as_0120" = "15s1b5w52c3q1nfzckdxmdwrnxw08pprmphc1p33am9v7cwwq2jk";
+    "NNPDF31_nlo_pch_hessian_pdfas" = "0qdswml17bg68y67yw2zbwwp233nxpd1qpc23rqjwyzk2r7qk9bg";
+    "NNPDF31_nlo_pch_pdfas" = "196pcdwsi5p9g88g1c8958qkdj6qmzvl7rsg3j8zll6274m42s4c";
+    "NNPDF31_nlo_pdfas" = "1as7bkp56pwpn2vinxdnhzlnvnxx5ng0mlpmwzz5n7gsinyaz1x9";
+    "NNPDF31_nnlo_as_0108" = "03kg0i43wxf794c4xhvismks6c7nw9hq9ihn58sz628lqcjmsccq";
+    "NNPDF31_nnlo_as_0110" = "04a5gf6nyd58h9sad8zv46vmb074dx7j19r23lbc9w1di23sk104";
+    "NNPDF31_nnlo_as_0112" = "1xkjjm49nlm72f4l3ynrm4g2ayzask22saaf6p1p61lx0jv1hjyd";
+    "NNPDF31_nnlo_as_0114" = "1j4q47qscyw52swmnn0a3lr0avfsjvy20ca50xfhjsvla6wd9lpg";
+    "NNPDF31_nnlo_as_0116" = "1k2d4jzg5jfs6f2mscpvalmh7i5fypx98lnb5wjycprlwd3nr3i9";
+    "NNPDF31_nnlo_as_0117" = "0b6d1xlq4qwjalvrc7ppavw44w5zf0fn3rbsvh3k4qy9r19wk5fb";
+    "NNPDF31_nnlo_as_0118" = "1bw2ksmxdfbwdcimc0ld87hanbqy514sridrcarqwgqh9yv5n0qp";
+    "NNPDF31_nnlo_as_0118_1000" = "026d0xygh046y10jxsfc91hr4qxgark12m393r0afip69dzdsrx0";
+    "NNPDF31_nnlo_as_0118_CMSW1" = "0vqjyziilfzi0gz3a2rv0i6hk3ri3krc2zcdjwfa61z1mg5syi4a";
+    "NNPDF31_nnlo_as_0118_CMSW1_hessian_100" = "1jc8k64pj1mfcw8v9qq9v8m222d09bgfkla7viqzzzbdhy5f6yy1";
+    "NNPDF31_nnlo_as_0118_CMSW2" = "14acp7w3sx5v4ly5wa32vpsk8xw2rh8g5gl7x3f72c0s5jcs4n81";
+    "NNPDF31_nnlo_as_0118_CMSW2_hessian_100" = "0ykaw8x0i6k8vlbms2inm9zm860apsi5mf4wkxha416v4chrpd04";
+    "NNPDF31_nnlo_as_0118_CMSW3" = "1snkandx6apar3sp0c182n770rxn2s64pc07h5k18627cnvpzing";
+    "NNPDF31_nnlo_as_0118_CMSW3_hessian_100" = "03n59yvpgciipkv3k0yr0ab3myhx263n90ah3q3h8hdszkf80ri1";
+    "NNPDF31_nnlo_as_0118_CMSW4" = "1zpnvawdj20izx0mx9a3xz0d0an6i65axbzg5z7fkiq0p09rfx70";
+    "NNPDF31_nnlo_as_0118_CMSW4_hessian_100" = "1qczy2935iq2h4mfq0mv53v2vlfsyvhkff36c5dkdlkrzfkvpl8x";
+    "NNPDF31_nnlo_as_0118_collider" = "1y2axnkjwx7yg301mj1yx1x937j7mhsnbbdpip94pl3vm5hz10dk";
+    "NNPDF31_nnlo_as_0118_hessian" = "0jvzl1bs0mh9c7ypkdgw0s06qn9jkww1d124lc7aq48w1g4n0zyy";
+    "NNPDF31_nnlo_as_0118_luxqed" = "10fwxncr1y7hnja5nxywldpkzrijxz5ayldqjc21jamyhyj3qsh7";
+    "NNPDF31_nnlo_as_0118_mc" = "0sg939j6xn7d5g46547np3123srgz44h9clh29ybl5cnmccv23cl";
+    "NNPDF31_nnlo_as_0118_mc_138" = "1kbxhjzrr4802kcpi7m2g2dx4ywvs9rqjispjwbjc60rqkqispyv";
+    "NNPDF31_nnlo_as_0118_mc_164" = "0i9yxnbps63nz6ala4jk6qmpxlg6p46w6jja8qn73hp0n69w2acz";
+    "NNPDF31_nnlo_as_0118_mc_hessian_pdfas" = "1b9ijn595qfq32yz9rlnn2br7lssbk8ka39ripfcfyf33v9sv460";
+    "NNPDF31_nnlo_as_0118_nf_4" = "0l796ns5xm0biyl0jra5z6y7vddv52v48wlbdywsq54082scfpl0";
+    "NNPDF31_nnlo_as_0118_nf_4_mc_hessian" = "1bw0x75pah1kp387s8m0rv2qc54k5pbncbv507d5278hhfsn68qa";
+    "NNPDF31_nnlo_as_0118_nf_6" = "0dbxxk0p001sk6sb9nf5ipzi39w65vf4c4g8cbhll7p4fqi8f8dy";
+    "NNPDF31_nnlo_as_0118_noLHC" = "18y9mnp1gmvdbikgfdybw8wz2w5x60wk8lya13g7z6nhbfs08qa4";
+    "NNPDF31_nnlo_as_0118_noZpt" = "1jwhkz8b1x6a2qi62jvprcp1rmcq5aq7s31qhw0skcpx8r6r6gnb";
+    "NNPDF31_nnlo_as_0118_nojets" = "1bg714agc25p7zw2yydvl340sns7fhszpbphzap6fc0jsg511zh5";
+    "NNPDF31_nnlo_as_0118_notop" = "1v675r4qk0wz1hg000fw79nmf1zjqi2ghvgjgs7hyzzbh5g4l3ds";
+    "NNPDF31_nnlo_as_0118_proton" = "0ipsp8kk59fb3w9d1y4pq85f4fl6789rypjfbpp44gcy8hzshbm7";
+    "NNPDF31_nnlo_as_0118_wEMC" = "0savd87jahlac4ag3qfamhnpa7mpnm00j104f3ci17gdax1sds50";
+    "NNPDF31_nnlo_as_0119" = "1s7ildlffbh6cpmzlmafxzbbrlgggfqxsv4qic99yvgqvdgqar8w";
+    "NNPDF31_nnlo_as_0120" = "1z6lqcq1dgvqnpwlfymlf9yhcaqc2p8ny7wv4xs57639dsp5xarb";
+    "NNPDF31_nnlo_as_0122" = "0482r1hip6c4kpq24xzi8nw8awky0669k4plgpgv0av12l4bh9c9";
+    "NNPDF31_nnlo_as_0124" = "0cf3djgs4gayzwy8p0qvynripz3hxd3866m8ldlhxnjmcsgcps11";
+    "NNPDF31_nnlo_hessian_pdfas" = "1m5wdnj7hvg2a51w1qmhm934glhjf9db0x5nry5blp90y5x0v185";
+    "NNPDF31_nnlo_pch_as_0116" = "1i8yzqywg4hcf53vcp25fg8llybis3pz6xbp5ajpyjvrvsgii1pc";
+    "NNPDF31_nnlo_pch_as_0118" = "01rsx0ss67772b20dnnw463328pgbd57d8zcj3lqymlb4a6fq8f7";
+    "NNPDF31_nnlo_pch_as_0118_1000" = "187xkvp7y1wssgpb21r1w4yxn6m1280jac9nmiavrma06jfd57c1";
+    "NNPDF31_nnlo_pch_as_0118_hessian" = "0fs5d450hc15hqs6xv9nxfsnhwszmg9ybjypgwa9kn4s4kkaz1wl";
+    "NNPDF31_nnlo_pch_as_0118_mc" = "06vgb01l1yigln7cn9y3lslg35grwvydpd8g04xn4pj4pj2vjrs0";
+    "NNPDF31_nnlo_pch_as_0118_mc_138" = "0za3v1mg8gb631039kg5mkr9zhn390dkyim9p663srpk85j7h5g5";
+    "NNPDF31_nnlo_pch_as_0118_mc_164" = "1xc02sbmhyjr4gjwim4p0gg90zh26zdmnz89395pxzbq2navcraz";
+    "NNPDF31_nnlo_pch_as_0118_nf_3" = "14xb6m1wqc5f7xjiklwnshn7ljrlg6kmbzr2rib44pgbj6pnl2xn";
+    "NNPDF31_nnlo_pch_as_0118_nf_4" = "1sg823n82j9ijqx4ldysh0g53pjzn4sysvag837ywfyns4p5qy9k";
+    "NNPDF31_nnlo_pch_as_0118_nf_6" = "14ls2yd1n2pqvdvq18qmhizms3a8pwqvksdkvwn0m1379lkss106";
+    "NNPDF31_nnlo_pch_as_0120" = "09zc56cmpj9iw0qp2bm9a8d86r0mdagg1vrpf2xqza4fr841r5km";
+    "NNPDF31_nnlo_pch_hessian_pdfas" = "08baysni2lhbpr1scx7h0zf64gyncj2ahcv4y86142gl4zqrafvp";
+    "NNPDF31_nnlo_pch_pdfas" = "09mw3gr7dz0vwdnralaplvlz2c464lmdizf673xsb0wlm12pqf6g";
+    "NNPDF31_nnlo_pdfas" = "0l92q3xhdk5nrnhkmrirxnvplj531rdpnblnacd759cl4hgxcs2q";
+    "NNPDFpol10_100" = "0r5qfa8cyanalphgjdsh57s3viqv9i10v51p1pyamj1f90gb9pr8";
+    "NNPDFpol11_100" = "0nny1lpw37jcillpfxjx82hq7wlzp4yksxialmc2ivr192qqdda8";
+    "PDF4LHC15_nlo_100" = "0m9d4zy7608iryqy1ypgkr1d3yhw2wv1nrrc70zrfih7x0fp7lz7";
+    "PDF4LHC15_nlo_100_pdfas" = "05wyqyh9y32sxflq69igcnnsl0ifnkyw3vnnnjn6kscl8h8hs7lp";
+    "PDF4LHC15_nlo_30" = "05n0i1mr7v7ssvxvdmv9fn621rinl08frz71apjj7wfdm7s7bk72";
+    "PDF4LHC15_nlo_30_pdfas" = "0xi4xydx0x4ina0wmqv9jf4978xhd8x0l91dwfxh5vy39r5x4lm4";
+    "PDF4LHC15_nlo_asvar" = "14hdgj5g8ia7y6hi40zbh925dacrk7hd6cli6lkhlqzxl755nbs3";
+    "PDF4LHC15_nlo_mc" = "09p7y0z04r6wdkf8gi3yj85qk5hmp0mmhab8c7a7lly4731fyf42";
+    "PDF4LHC15_nlo_mc_pdfas" = "0sds9rkvbjkk7pardwq959qqbrvgwswxmsqcfppky2p0qmdsjs0s";
+    "PDF4LHC15_nlo_nf4_30" = "1ysy6dqlacg4bwb2f16p1aza5gwm9qnhmc0g0mhsdw4d2i4ml5yg";
+    "PDF4LHC15_nnlo_100" = "1gcq3qrf39dhq2pmpjrj3z0i0ycrk76mjdwmgfvzdxysp530ax54";
+    "PDF4LHC15_nnlo_100_pdfas" = "16r8far43ymsd64a4bbqlj56qvbjmcyxbawv4lkfxysjvbydxj4w";
+    "PDF4LHC15_nnlo_30" = "10cm4wa0mk34rnvsr5q8g9w7fs9cblsryms2nl370wdvcrhzsxph";
+    "PDF4LHC15_nnlo_30_pdfas" = "13xln0y8l0qcj9951glj4f1kqfaagj8gwkxzlvdkgjnj1scdy6yj";
+    "PDF4LHC15_nnlo_asvar" = "03fh1jcbmvla7n2jj3zq4ibwvq66h0rniply7h93d94zawcgsy4v";
+    "PDF4LHC15_nnlo_mc" = "0c6nfkv3x1p5iw514knjvqcs1dcaryf74qqg1za8x234yr5ndi3p";
+    "PDF4LHC15_nnlo_mc_pdfas" = "0l8hlcz69cdii7mpgargi9nsx7iy746nad5pnn7pvycrc40marij";
+    "TUJU19_nlo_119_50" = "1q1dhsxz1kq75rpzv6gg6p6bzvvv0d44pc4y3wsiy9g14aff85vq";
+    "TUJU19_nlo_12_6" = "006j6y4xbjss9apzagjcc3r1z6s61a1hzafhcyriiffqhn8bg50k";
+    "TUJU19_nlo_131_54" = "0ymf35alyar6fwagmdny2zz2aag576f38kail7gh2lvqpmjmv6np";
+    "TUJU19_nlo_197_79" = "0rq57sjcwljz8fz2m5bz0hm1670jp080zawmavmagmzvmyxbpnpj";
+    "TUJU19_nlo_1_1" = "0fp4syfjgl0y58hrr3g515j96yp7ncbrnzj1h7i5h3fphxzayhcz";
+    "TUJU19_nlo_208_82" = "16g5fjpa1r6pml6jnmzikwafdc0vgj8j3b0ivjz0bsqxms66msg9";
+    "TUJU19_nlo_27_13" = "1ffipy7g22mjbhy7wpjipfka84k4iw52bni4gw2a6aan5qljlcii";
+    "TUJU19_nlo_2_1" = "1l17drwy3vv8s7g9fdivxs2z6m88h7fpamnr5y0y6nbkh6bja2s6";
+    "TUJU19_nlo_3_2" = "1qm010yjnj9amj2j89v6s5s42q18q8b6md35c9mbv88ibqbsdnvn";
+    "TUJU19_nlo_40_20" = "0xylrincss1ijkfxnk7hl72c1rzpzm14hcarddh9pd57z7i1gv4c";
+    "TUJU19_nlo_4_2" = "0adqxh47pnhgmq9r89wcqaldfrqll5gpjzqncqd5ba8301i3d98m";
+    "TUJU19_nlo_56_26" = "04q8c3gkbxib5fz20f7rwn33sqapcmsj6fwwihi6ca8n1rl6hw6h";
+    "TUJU19_nlo_64_29" = "1yyl70v8s16s2v630wamyfk8lwdw53cbp5hipgwdw1sfs33pj1mj";
+    "TUJU19_nlo_7_3" = "17qfnf8bv6c5q6xkl68c6n1gxp81gang5w71gvn9m5d6pn2wiicj";
+    "TUJU19_nnlo_119_50" = "186fja2z84csh6zsp0lpy5mch5swmwaf7mvq8kf073jxlrkrws42";
+    "TUJU19_nnlo_12_6" = "0k5q6a8jidhmnjgll1l71dxx85lzd7w4v9bsmi42qladkd71vblv";
+    "TUJU19_nnlo_131_54" = "0inwqb1v390xkjzhc7gy4hng07jzbbhpq99f4zpkzx115xs57l74";
+    "TUJU19_nnlo_197_79" = "09c9b1kqzw28rqgxfxq2mvwna8yb6f2y90332f05jpvfk3mmr7n2";
+    "TUJU19_nnlo_1_1" = "0qmvcbsyi333b9dd42xjdq62a7dfa3hvfcbk48fg4m179mzhp588";
+    "TUJU19_nnlo_208_82" = "1xpwnl342g8ahhp3lm7p2xhzlx5qzhjvz6g1w1nqrd818w3994zn";
+    "TUJU19_nnlo_27_13" = "18fsbp1nh4zx2wgg9r7ian0mvhvf4y8ssqv33vqvn0vwk7gqw7jf";
+    "TUJU19_nnlo_2_1" = "1p0b74w1a9906lqbxbc8dkk5bcdhnbqc82lnhsr4qfi8sxih2l9i";
+    "TUJU19_nnlo_3_2" = "132w4cv8r7958sad6jakfppsywifwzzacsfyn81qvv76xzc2hm3w";
+    "TUJU19_nnlo_40_20" = "0fkbwxh0smj1icjfn58fsfh52ny35pmqjs7cs3qnw6dk5p95qx6k";
+    "TUJU19_nnlo_4_2" = "12vm0dl8ylz38zzi6rsyy24h3yg30nq6l464nl5fr6jdkvkbz2f0";
+    "TUJU19_nnlo_56_26" = "1kqc6v6qq6wl3nls31gn5nrzwfl9kshm2bbak771c3xvjsgvjpdy";
+    "TUJU19_nnlo_64_29" = "166k8swsysr7x5rgivi6k04q4p8njb2ny7xj7xjqhkgxrznc8jzq";
+    "TUJU19_nnlo_7_3" = "0q9vswr0s3k15abghx3cccf1ays0601n1438pwqgd5xz8981ngm5";
+    "abkm09_3_nlo" = "0h268l7j1zkxm2nacari10f86lpha511xhgrg0q9r8hc47sw2vxs";
+    "abkm09_3_nnlo" = "1gzhvblckskscql53pfxp79qclhhhhm45sqjhc9jrm1bp3x52w8i";
+    "abkm09_4_nlo" = "0yq3gy0qgnk5dh0hh3ldrf5bqzx5wpkhw509nvz5arlh0bfwhyg4";
+    "abkm09_4_nnlo" = "1b8470v2n5v87mmhp2dhmfh7iv3280ad67z2vyl0sfv87iic409j";
+    "abkm09_5_nlo" = "1nhck955mw94h3pyhm2vd3q60qxwsmclkfqdscp06fc3avyvrzfv";
+    "abkm09_5_nnlo" = "0wklkcjknn7ys1akg56zxdrkd7ardlc5qnbjq51mva1nf2bxk0np";
+    "abm11_3n_nlo" = "06r54q3ph851a0hyn4di1ifwjmdkdklf3wlsdpz7qn0w4w3xcg29";
+    "abm11_3n_nnlo" = "03rgkj2hyn3zmj8yxllfnc2iqr12j8shjcpdjka33v270lim3gq2";
+    "abm11_4n_nlo" = "02r9ba7rz8f5438rfckzny5amnq9qjgl164x8il6xqh5crxn4vb3";
+    "abm11_4n_nnlo" = "0z6a9wxy6018qm9nyyip9wdq46j7rh2if5xch19h4qx20gx6m48a";
+    "abm11_5n_as_nlo" = "0x2w81w9cz955k9dd45872k98my57w83cjdsv4gvjb64d1hsygzq";
+    "abm11_5n_as_nnlo" = "0091vwjkc686d1dnfn2dpa7jb56p8gli2z687fpx5f8yhjzpbh80";
+    "abm11_5n_nlo" = "1bpf37mg5wgcf1id2am98l5mj162xrnb8k16ppfx3qxlakp0iabl";
+    "abm11_5n_nnlo" = "1mpk322mqs078pk2nxxk8fa29ka6cxzsf65ffiny38678djmfqd2";
+    "abm12lhc_3_nnlo" = "09k90vhjq7p0i0aaq2697pq2dc86bkmnv4q8zyqxjp3wnqx1v95f";
+    "abm12lhc_4_nnlo" = "1hciv1z9b5fiz7swv21gr0rshijj9yj2n8x4l54v9g0jyd061jaz";
+    "abm12lhc_5_nnlo" = "00xxkrhbfkxhg33mkpwwk5nsdp4nmi0zmllx5z5ygxl24rinsq9j";
+    "cteq6" = "0lp110wldhliad354v29f0rhdzf5qrs1ibklj0cmzp2rcbp8zrix";
+    "cteq61" = "14hbc855b3wsjk7ypg86md46cjm1bj7n4hins9nr8kgzs69i6vss";
+    "cteq66" = "09i69ac3gkrai5jmazjyjvi5sl8k2vm48m90ijn6pl24p31qf68y";
+    "cteq6l1" = "1b5m7g7wawk72h76l9yr3gx3n67jggna1004lwffvj43gffwkjap";
+    "nCTEQ15FullNuc_108_54" = "107klcpsr9d4dwavcqqs3849k90mdb3bdjam3pd79cmsy7ncr2hf";
+    "nCTEQ15FullNuc_119_59" = "14az155s3xfl8nscwpajzwj0dy94dadc4qdc64njlg3xlnxsgxy7";
+    "nCTEQ15FullNuc_12_6" = "14z11wyzclx5k6dl46zr0jp6mja178bvd547cqqfy811nbzmmri3";
+    "nCTEQ15FullNuc_131_54" = "1984nphc6sqizaq1c1laphw3hdvkp5k7sy7g563wq18578fifbmk";
+    "nCTEQ15FullNuc_14_7" = "11i2xcd6ncp2aqw3y8pgcp63zkaj383ciwvqpzmjnqraiqqqa77i";
+    "nCTEQ15FullNuc_184_74" = "1m311m5bkzq00qf117dli9xrmcmx8qqh716wff1yj8ri4c4h9m8x";
+    "nCTEQ15FullNuc_197_79" = "0vi29fdxaj7fnpc01k3y2ylb7ngpdnmbnzgxdnr6p9bj5wfa69z5";
+    "nCTEQ15FullNuc_197_98" = "0qjkdfgpbcmwc39wzyfb07wrqnkkwn7v8235y1m25x4wy5bbpjbg";
+    "nCTEQ15FullNuc_1_1" = "0nx1n814mkikd01pxmpndk2qxpwqwd55cbn6z1kgxm8qlhhhd2zw";
+    "nCTEQ15FullNuc_207_103" = "09py38s7shcyy07p5mxfiil5wlxijzbv9k4l3x0g1v191k0vi3m6";
+    "nCTEQ15FullNuc_208_82" = "1c9r5wr43291rw965axdzpshzjhnynsrlf28kfr17v7vpd9dykl4";
+    "nCTEQ15FullNuc_20_10" = "19vhxi7ch9vxa1vyjpxknk69hnnm2n5wpz4qybg1cznk59dvpi28";
+    "nCTEQ15FullNuc_27_13" = "09pflgyxl2ydzrmys7rv0mmvl32z3dmdx63wpilrw592aa70bc2i";
+    "nCTEQ15FullNuc_3_2" = "1l2js36nh4jawwkpiq386blgwbmgi9ccvvzbwq92jb5kpd2fvh7z";
+    "nCTEQ15FullNuc_40_18" = "11pw23fbrz97i9278cxrvc0a4wbdyhz788axq8jn7yka9mg9kch6";
+    "nCTEQ15FullNuc_40_20" = "0raiqn6w90n17irf4l197my77999ygqwhim9lnjqgbn68yjqfqf3";
+    "nCTEQ15FullNuc_4_2" = "0fip3n3pjd94rz3f4gcv2szrx5k72m5b8xcmsgjfd1671r5kmlkd";
+    "nCTEQ15FullNuc_56_26" = "13msj49c1lfisgcigvc4wr32w597jwir8cggrcdq74b0d0ab85ch";
+    "nCTEQ15FullNuc_64_32" = "1spgcb340nz8by8051hngnh6pa1wjf19vi5a40xr8gyprdzhwb4a";
+    "nCTEQ15FullNuc_6_3" = "0v5yabjw3xkjq5c1zjqmj3wwb7yz1blkprxnrpvai54v17w3sk3r";
+    "nCTEQ15FullNuc_7_3" = "1ncarbncfkqk6l3rx3zg34a3sj7mpm2diqsafyldpn92cw66bcs2";
+    "nCTEQ15FullNuc_84_42" = "1z719mcx5lnx2ciwlnxxhgc4s00jrr9sfrxcimh69sj14hmzgx0d";
+    "nCTEQ15FullNuc_9_4" = "180ipb4m2zy54h7n4s0jwqk9k6562bygvnv7mg9dp2f7vf5317a1";
+    "nCTEQ15_108_54" = "1bjx2d61qjhabfx28pfi64hf8br4gl67nzir3ygdpwdcah4k6lz8";
+    "nCTEQ15_119_59" = "0g7wffsyjh84r2wv8w67skx8gwdb3clv9c1dlpijwqmpkcm3b8q5";
+    "nCTEQ15_12_6" = "1xnnqp38zz3b61jb38hz54wv09w06fwwnb66sf93r1agcajvv1vi";
+    "nCTEQ15_131_54" = "062sg81yrrdsc376gpq01xzsb6114sp6814ah9jbrd08qqxh04p2";
+    "nCTEQ15_14_7" = "164p2fhlsmkcc6fibi28lysbfn8q5vds4f0k0kppi96absgrfa70";
+    "nCTEQ15_184_74" = "1zqyvla6dj93cgfjw5z97b6wh6qy8pkrvcbwirjva769210rax75";
+    "nCTEQ15_197_79" = "0mp1gddlwxk2vdyhra5lafvblc82g6n2p19lmjwkmnrmjqdqsz12";
+    "nCTEQ15_197_98" = "0z2ymk9y0syzqj88mnr2kjn104602ajg17s31d9vi29lggy4cn44";
+    "nCTEQ15_1_1" = "14dlybcc038ssv2xbyhing27b9zx07nkqvgf66ysbb83ym5dvibs";
+    "nCTEQ15_207_103" = "1zpxky925n9jssdr036dyax8wxa0d478l4mjl50bjmzqhr8wl7hv";
+    "nCTEQ15_208_82" = "01jf2mrknx5igs0cvhm7xr25gr6z93bvj12cbq53k15fk5niyglv";
+    "nCTEQ15_20_10" = "1vhk2lmpf5kci9173v5qh2gsz7zghvjb11x1mln8yqcdxaq4az8x";
+    "nCTEQ15_27_13" = "1md9xv99m6jcdqldhbbypdix581nmhpyanvr049l5c1a2ab5nbpa";
+    "nCTEQ15_3_2" = "0nq1aj4hxjih4z4xlhjfbza2dp2fyhwbccjgmgh2za5y7rzgz9fk";
+    "nCTEQ15_40_18" = "1gb4kfs207izq4dij9pqbmwm10vx6f1h7pdnf749jysmf6nayndh";
+    "nCTEQ15_40_20" = "0b44nkk315a9zaq3280wmsj67rkxw4jyk9v37s859fikr5v7s0sv";
+    "nCTEQ15_4_2" = "0c8r4vq3phi40v5h4p3nm7by72pz27zqwd67z9slmf1jy1yilnly";
+    "nCTEQ15_56_26" = "0ndyjjh7sxnhkamx182rpax0kcc2iqzwnmh391m5wh629zk0av8i";
+    "nCTEQ15_64_32" = "0ixbr2d30v6slqvp6gpry1159rx5m4hd1msymgli1w9k7pp7xjz5";
+    "nCTEQ15_6_3" = "14ars149pssaiyhaln9zm7vz3wzj2597cy2xasyhlrfqhlgrq056";
+    "nCTEQ15_7_3" = "13b9wbm2hqx4lixq3dad1y3cr6didcch8kg7mqm9lgbism7dwaqw";
+    "nCTEQ15_84_42" = "12vkqpvjjyh0x0hbn7r4gx5za01yqs9a7lqirdxd15k04fp5rnjr";
+    "nCTEQ15_9_4" = "1rkxhxwp0v9dm6f71c5635ihlspfx0sj666maif4iaw1sf4hazln";
+    "nCTEQ15npFullNuc_108_54" = "1g8id10rpys9566r8h92diqrr43mww6q8nhvlns0kfjkvkr22m9y";
+    "nCTEQ15npFullNuc_119_59" = "0df499pvfls1281zkvngrhicnc0ac0bfwamzs027k7f2y6ygkfb4";
+    "nCTEQ15npFullNuc_12_6" = "0mb3zixcikagsqzpxb7jzrcg05dln37d7anz5359ssjyd6p1mqyi";
+    "nCTEQ15npFullNuc_131_54" = "0i83f1wg81nr742jf9407w7fbknigz6pyx64h7p65x82s4wmj9gf";
+    "nCTEQ15npFullNuc_14_7" = "1k2554rg82msxzkarjx85p6di3kmfqxmbfxpasi1x74laz38663n";
+    "nCTEQ15npFullNuc_184_74" = "1pnl4y2arxf87b1pp95b9jajzlqdyzs7mv82xhmw9fcn9yliy5s0";
+    "nCTEQ15npFullNuc_197_79" = "0d5c6g4185k6pwm5bs5fqlwc97l0gvf6bhk9l8a5vc039dggsgkj";
+    "nCTEQ15npFullNuc_197_98" = "0ql9xnwggsqibld13yisvsdkkymzph8wnqffnxhlyp5digwhl64v";
+    "nCTEQ15npFullNuc_1_1" = "1fq80hzfy16gs00knvl0g0yqrys27vzyk8h5jzs1ra981zgcw1zp";
+    "nCTEQ15npFullNuc_207_103" = "04bg7hnngfsckk92gdrxbrxhsbb1ac1s7dscj7ycdy64fxn4lq8x";
+    "nCTEQ15npFullNuc_208_82" = "0f9ddimq9av2jr3yr15n630bi30bxh5nxrsbrcfw9cx8dwnjscwb";
+    "nCTEQ15npFullNuc_20_10" = "03dv3z7j69l97xacd38wbp7iyyi36g0bbc2xmxhm3l64rjs21bmz";
+    "nCTEQ15npFullNuc_27_13" = "03lb2dznl5dpv0cwsl08dlrh7x26yi9acx3n70imr13gspfxp8ag";
+    "nCTEQ15npFullNuc_3_2" = "0rqjxc8q53jndxjrxd293r1m8gin3vif33jzr35y2ail9bhkjyzp";
+    "nCTEQ15npFullNuc_40_18" = "1827gpzdrxdkg9ikk7pjgv9h983mwzk21p60635l1zhwby5p4mn6";
+    "nCTEQ15npFullNuc_40_20" = "11mjdibgypwpphm1wmf4z311wg4lp37010vwyys8q6d927jzikn2";
+    "nCTEQ15npFullNuc_4_2" = "12gx03drv7hnmsgk6sni7mc7c4rbpag5gn2czyha1n19v13rry93";
+    "nCTEQ15npFullNuc_56_26" = "1hq6qv19gqzjv57msdajb9kc0lv5jvl3b6x2fc905lg0dc7h2ab5";
+    "nCTEQ15npFullNuc_64_32" = "15gq3l91p69dba5gfxvh7j4npwl7rwkakjnsv9lx84hvys7hgba9";
+    "nCTEQ15npFullNuc_6_3" = "1gcxs7vcjcdyniczd1rprvzlc1p9yf08sy1fcrny2jfbxkfndqwx";
+    "nCTEQ15npFullNuc_7_3" = "09kwf5kbshw4pwh6iilqy1mzgvlg83jhakmvvgz27f569f20ci68";
+    "nCTEQ15npFullNuc_84_42" = "0ah349jih2ia0x14mnrygzzw38prfgcmbxyw1hdvzqvgk73wazwa";
+    "nCTEQ15npFullNuc_9_4" = "0gsh5jmyn7jlasp9ixx7imvkbp5rxmvfa480vy0bnxwjwz0924ia";
+    "nCTEQ15np_108_54" = "16hsl5ihcbx7wvrabrff5h422zfhlfrpskn5dy8s1phhla4r4ff3";
+    "nCTEQ15np_119_59" = "1bwhbfhw5xyb1dm18vxm095l1d9l9v0yl072qdbb6z9l29pa71dp";
+    "nCTEQ15np_12_6" = "0zv9g7r648f1h1f9qifii0mk2afdvphbfib3hp2sf960zb0d0nsv";
+    "nCTEQ15np_131_54" = "19sn6ig1c5smxi845qyflrrqaivm4pphwbxpz2zd9r0qhn032mlm";
+    "nCTEQ15np_14_7" = "07pyaik3h2yi05hn49fv3x191i4x6429bb6kywy999bzfrkjndcp";
+    "nCTEQ15np_184_74" = "1s2vmirmi1npw3pkxpzxjf9i69gmrl1dqrm2s0cfzl6286h87scb";
+    "nCTEQ15np_197_79" = "0p7lnffr4gy8qad8nsm6qfaw05s9pndkw0n9yb6v5i6mqg0j3cgd";
+    "nCTEQ15np_197_98" = "0vmjvjqkdn5cixsnvl9lvg07lrq17yw5pf2mdbzkrrfblqki6g0x";
+    "nCTEQ15np_1_1" = "1fndfff1lialb2qy08qp44w4605j9c2acrwpdb16k3awj88kx7mf";
+    "nCTEQ15np_207_103" = "1fcaw2hqxnzhs9glrh9lxvpfh0sn3mwahgd8d7hnfikrw93v0sbz";
+    "nCTEQ15np_208_82" = "0glf5nw1mr42icmbcjliz627nlsb7a5hyp591ng9y7dh41hxr01w";
+    "nCTEQ15np_20_10" = "1ka5hnq9cmr4l12ajmw4fpgdzcf0pjlw2pk4lkw6ai1h5h5absa5";
+    "nCTEQ15np_27_13" = "02dmzdqqh58h7232s2hcjnpd76rll8vxynq1bx059mvxak5lr5kw";
+    "nCTEQ15np_3_2" = "0jxg5f5n4yp4zbdkm9y7xd40m89pbw5687hz7mylpn9n3phsi58y";
+    "nCTEQ15np_40_18" = "0yp65xq318qw6xh3wm0n4s4a3s4ahvl14kq3cmwq9b954c5a5vkl";
+    "nCTEQ15np_40_20" = "1c367xb361p5mdwyda5iwswg7wb6s6gjibdv27n2kq41p1qp41y0";
+    "nCTEQ15np_4_2" = "04q9gq8163lhfjrrp0ysqyb5sx2nkw5mpz70daqnxvybavbkg7mm";
+    "nCTEQ15np_56_26" = "1qgh3g6xwk9jc6sd7kjj89w8mr89bhpdaiml5g7lvdqn39l95ng6";
+    "nCTEQ15np_64_32" = "02966xmh15i7kg9iif19p5c27rv369yikpm1xqclf8dz45a7xsry";
+    "nCTEQ15np_6_3" = "1rr7wr9wwsjfgnrnfvm7nrplhb38zym6qiyg2sagq7saw6kqpprz";
+    "nCTEQ15np_7_3" = "0ndqi05g88b769p1chfc6maz6wvs33rx45r4k8f68n79yy6kvrh1";
+    "nCTEQ15np_84_42" = "0v968jw1m9ky1mh82w1bjidvg7r7cx23bnpv0vr4c1kqz0n5hb5s";
+    "nCTEQ15np_9_4" = "0akxbyrs4y8gmnjiwma8z8ryrzmaw6dj148iq7ihsllwar3hp3p0";
+    "nNNPDF10_nlo_as_0118_Ag108" = "1xqhzgvkicxd9wy4lnhqw6brsksxqsq429r6bb0ghn1ll5ln4qzx";
+    "nNNPDF10_nlo_as_0118_Al27" = "0z836h7a5abbwq988zdvvf8yhr92krzzmys6lkkgkcffdf2pc0zq";
+    "nNNPDF10_nlo_as_0118_Au197" = "1f6vn6n0zz8wml8zn7n2n6wj5y41yanw9b9av51m5kiq4n1r9lrk";
+    "nNNPDF10_nlo_as_0118_Be9" = "1jy2cix4gkx648dypdqfj7xi8gdlflh20xlasmwl78av5j7s7rs5";
+    "nNNPDF10_nlo_as_0118_C12" = "1c6fvp82cs3464akqf0skrqpcvyp75yqp39zxafzgbqd4wc3pv9f";
+    "nNNPDF10_nlo_as_0118_Ca40" = "0r903a01085yhfagnljvjaqfn190r3q0ggvx87kh54xsbv1wkvbl";
+    "nNNPDF10_nlo_as_0118_Cu64" = "1vq8a6drcp606fkx8mml2qq37if59cakmcq73y4n7c7swp6q51r3";
+    "nNNPDF10_nlo_as_0118_D2" = "07kjzhyh6n6723h2fylgwm7w7ljxz4m6fs9bgwjxp987i00msrra";
+    "nNNPDF10_nlo_as_0118_Fe56" = "1smkjmymykhlp0vvlpsp6p6p44pw5aa705sw9lcyxmg8ccy9kmpj";
+    "nNNPDF10_nlo_as_0118_He4" = "0mdxsh41m0vzcdq4axvz81m9ra0p6dff88k09gjb4adx9vv52mjc";
+    "nNNPDF10_nlo_as_0118_Li6" = "1hrryxhhg9xxg817brrd39k5wz6iq1fv6z8sdabrpxn0nwr1bj7r";
+    "nNNPDF10_nlo_as_0118_N1" = "01h7g4w3nc09jyi7g8j5yx2yzqair3ysbx9rx244k1rjx6jppian";
+    "nNNPDF10_nlo_as_0118_N14" = "1ny3znivkkl7xhdw8pxkdadwc957236rh60wviiyw4cdqjb6a3iq";
+    "nNNPDF10_nlo_as_0118_Pb208" = "066w59xm6lkwrm3glssc6n3qyvv38mx47mkx39p8z9r2spb8igks";
+    "nNNPDF10_nlo_as_0118_Sn119" = "1mqx7wj095v0799wxbvfxvb6bl1qh5wdkf14a8gqsj0f5qjnpmyw";
+    "nNNPDF10_nlo_as_0118_Xe131" = "0mz9fgxfyx1asi2vxs1xfwn8z51z08naiq1ycl77f4yp6wim6s54";
+    "nNNPDF10_nnlo_as_0118_Ag108" = "08vy16fskrvc62y3h0hsikmi6q86njwfm2msmajxbd7vzcv5wkkn";
+    "nNNPDF10_nnlo_as_0118_Al27" = "0vm95lawgsncsx10ypy99746sz34y6shblkj9pgn6si2cy8gpcwp";
+    "nNNPDF10_nnlo_as_0118_Au197" = "0b3ld033f2hwjaqp5p5pzmmzfid8hl416a1q8fc0zmd2lfiamsac";
+    "nNNPDF10_nnlo_as_0118_Be9" = "10skffir8hqfv2wj01ghc14lfs516kmh59q3v48nw3a724kxr93a";
+    "nNNPDF10_nnlo_as_0118_C12" = "12rrpcq9bvwcncj1hk28wkym5zzdjkf0d0pdj1nx9asm6vpbjsdv";
+    "nNNPDF10_nnlo_as_0118_Ca40" = "0k914fnqsv45f16s6zmdwbnbnhj5lxnrk9pbnnaap4vk7vx7101j";
+    "nNNPDF10_nnlo_as_0118_Cu64" = "137n1nsq75g0n4hmbqfl1gihngfrz0rqd2gwj24m5byhbylwlg83";
+    "nNNPDF10_nnlo_as_0118_D2" = "0xa17gjjh0mphg1h711vb6p2pjln0lqy7401lamnib2z7p7mss0m";
+    "nNNPDF10_nnlo_as_0118_Fe56" = "0h0qwbckdcppqgbhfy3kyy9p4nryh3p45sjmlxhm94mlznipjwrd";
+    "nNNPDF10_nnlo_as_0118_He4" = "022h44i8k2ybvm9lkgc4lkcv4z7r0xzlrq2bxyqkfmpp5fpp7gkw";
+    "nNNPDF10_nnlo_as_0118_Li6" = "11bci8mnv57a583ayrpvvnz4lsxz43z23iqgqjc3b3rychgiz57a";
+    "nNNPDF10_nnlo_as_0118_N1" = "174gscxa2acqpgf2mks5xpim1jcpb0vg76pggxazm376vyyjk883";
+    "nNNPDF10_nnlo_as_0118_N14" = "1g2gwnbfzlfa094px1rnjgk8py8qzwq7bi68n7p49bqjj88km3av";
+    "nNNPDF10_nnlo_as_0118_Pb208" = "0bdi3z36ckf788v3ld3ngvchyxzsxcfl9fj7rzs2lwkg80rclgd9";
+    "nNNPDF10_nnlo_as_0118_Sn119" = "0k7lnr1ils38sqybipmf13n582wb0cf9rr288ibrbmx15rkk5c3w";
+    "nNNPDF10_nnlo_as_0118_Xe131" = "17k1afk6j53nl83ixyy6nyds3wy5agacdyn62bwp7ykfs8x97s4n";
+    "nNNPDF20_nlo_as_0118_Ag108" = "1fb2h6752vn0v66h12dhhk2izxjs4b10mdqx17djrvpkzl97hf8d";
+    "nNNPDF20_nlo_as_0118_Al27" = "1lfkg84hf0chgk0qzp45ch23pzjixkzxxh3x7xphcmnpri4cgl3r";
+    "nNNPDF20_nlo_as_0118_Au197" = "08ll61b96iggm1qnr9q2qdzyxasxn9mlshnxz7kzigfsnqqnkfbw";
+    "nNNPDF20_nlo_as_0118_Be9" = "1g4vlr9p6i6n87bx6w2i5d4qkhymldkyxj1i2qnl8v467vhsz6la";
+    "nNNPDF20_nlo_as_0118_C12" = "15366p04rh31nnd6zxcmcs9ki5fwzn8d8cvzms45apnw928k6pqn";
+    "nNNPDF20_nlo_as_0118_Ca40" = "1abxkr4r5psi6n8rrsbf97gwwkh1dg9jqfd46hn2725r22c6k8l4";
+    "nNNPDF20_nlo_as_0118_Cu64" = "1nkkiwx22b649pmyfykn2ggdq99y985mnkv3fnkm8i43scwbswvb";
+    "nNNPDF20_nlo_as_0118_D2" = "0gvf9qqgr4ixm9cf2654xyvkc624k5ijqwdds61frljlhd49yqm1";
+    "nNNPDF20_nlo_as_0118_Fe56" = "1ci132hc8mpsj0zjr9fichnkapagjs6q9pqli0yzgnnv6l2aih3a";
+    "nNNPDF20_nlo_as_0118_He4" = "1phq7m6lbx87s4whs2xygigq7fz1qhzj3nd9anx5r67w7q99rcad";
+    "nNNPDF20_nlo_as_0118_Li6" = "0pwdqrmivpm0j7hrg6h2qqshpna2vjlslxnz0sd100kc3lfq7xab";
+    "nNNPDF20_nlo_as_0118_N1" = "09y7pd3nnys49w25gb4524x5xkahillvaypjgncbn8n5x1a11nsr";
+    "nNNPDF20_nlo_as_0118_N14" = "0nb3kcmhbyncp9frs27ww550mjl3f7yiahyyrm3aik93ycpm16n7";
+    "nNNPDF20_nlo_as_0118_O16" = "12kfhldvg8gqxjaian14dng6qqc6nikydwcj5jz2i2d1da3dyhgg";
+    "nNNPDF20_nlo_as_0118_Pb208" = "1rwb7vca0y1aj38mz8m3wg07q9hq66qd5j3y6hs9bh0jz6hkifzh";
+    "nNNPDF20_nlo_as_0118_Sn119" = "1dan86ckd5padipp4x12x8msfg5p97b8hwxm78gfyf88kq725m6z";
+    "nNNPDF20_nlo_as_0118_W184" = "1g0br4gdrb2vzwmqhgj5778a6vl0lykc4ymylibxlqbqrhf8j89b";
+    "nNNPDF20_nlo_as_0118_Xe131" = "1a62qi3qy5kli9q80p2w80mj5v3ps2g6p40zxlgm65q5mphkx1qi";
+    "xFitterPI_NLO_EIG" = "1v6mfhmcrmdvica0wlc2ilfca1srxc7vjyli113wjvpd7wfpnvj5";
+    "xFitterPI_NLO_VAR" = "09mlsww89hhm2s96rlkqbkfwwf9qkblw7n3nnrgas6l1kn2hxq1i";
+  }
diff --git a/nixpkgs/pkgs/development/libraries/physics/lhapdf/pdfset-hook.sh b/nixpkgs/pkgs/development/libraries/physics/lhapdf/pdfset-hook.sh
new file mode 100644
index 000000000000..c499d370d866
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/lhapdf/pdfset-hook.sh
@@ -0,0 +1,5 @@
+@name@ () {
+  addToSearchPath LHAPDF_DATA_PATH "@out@"
+}
+
+postHooks+=(@name@)
diff --git a/nixpkgs/pkgs/development/libraries/physics/mela/default.nix b/nixpkgs/pkgs/development/libraries/physics/mela/default.nix
new file mode 100644
index 000000000000..90cf5ac8b2d1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/mela/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, gfortran }:
+
+stdenv.mkDerivation rec {
+  pname = "mela";
+  version = "2.0.1";
+
+  src = fetchFromGitHub {
+    owner = "vbertone";
+    repo = "MELA";
+    rev = version;
+    sha256 = "01sgd4mwx4n58x95brphp4dskqkkx8434bvsr38r5drg9na5nc9y";
+  };
+
+  buildInputs = [ gfortran ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "a Mellin Evolution LibrAry";
+    license     = licenses.gpl3;
+    homepage    = "https://github.com/vbertone/MELA";
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/nlojet/default.nix b/nixpkgs/pkgs/development/libraries/physics/nlojet/default.nix
new file mode 100644
index 000000000000..f84c1bda32d3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/nlojet/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "nlojet++";
+  version = "4.1.3";
+
+  src = fetchurl {
+    url = "https://desy.de/~znagy/hep-programs/nlojet++/nlojet++-${version}.tar.gz";
+    sha256 = "18qfn5kjzvnyh29x40zm2maqzfmrnay9r58n8pfpq5lcphdhhv8p";
+  };
+
+  patches = [
+    ./nlojet_clang_fix.patch
+  ];
+
+  meta = {
+    homepage    = "http://www.desy.de/~znagy/Site/NLOJet++.html";
+    license     = lib.licenses.gpl2;
+    description = "Implementation of calculation of the hadron jet cross sections";
+    platforms   = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/nlojet/nlojet_clang_fix.patch b/nixpkgs/pkgs/development/libraries/physics/nlojet/nlojet_clang_fix.patch
new file mode 100644
index 000000000000..917c57e8cb47
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/nlojet/nlojet_clang_fix.patch
@@ -0,0 +1,30 @@
+diff -rupN nlojet++-4.1.3-orig/nlo-hep/hep-lorentz/bits/hep-lorentzvector_complex.h nlojet++-4.1.3/nlo-hep/hep-lorentz/bits/hep-lorentzvector_complex.h
+--- nlojet++-4.1.3-orig/nlo-hep/hep-lorentz/bits/hep-lorentzvector_complex.h	2010-05-11 11:06:00.000000000 -0400
++++ nlojet++-4.1.3/nlo-hep/hep-lorentz/bits/hep-lorentzvector_complex.h	2014-08-23 03:22:51.000000000 -0400
+@@ -26,8 +26,11 @@
+ namespace nlo {
+ 
+   //   Spacializations
++  template<>
+   class lorentzvector<std::complex<float> >;
++  template<>
+   class lorentzvector<std::complex<double> >;
++  template<>
+   class lorentzvector<std::complex<long double> >;
+   
+   template<>
+diff -rupN nlojet++-4.1.3-orig/nlo-hep/hep-lorentz/bits/hep-threevector_complex.h nlojet++-4.1.3/nlo-hep/hep-lorentz/bits/hep-threevector_complex.h
+--- nlojet++-4.1.3-orig/nlo-hep/hep-lorentz/bits/hep-threevector_complex.h	2010-05-11 11:06:00.000000000 -0400
++++ nlojet++-4.1.3/nlo-hep/hep-lorentz/bits/hep-threevector_complex.h	2014-08-23 03:23:09.000000000 -0400
+@@ -26,8 +26,11 @@
+ namespace nlo {
+   
+   //    Specializations
++  template<>
+   class threevector<std::complex<float> >;
++  template<>
+   class threevector<std::complex<double> >;
++  template<>
+   class threevector<std::complex<long double> >;
+   
+   template<>
diff --git a/nixpkgs/pkgs/development/libraries/physics/pythia/default.nix b/nixpkgs/pkgs/development/libraries/physics/pythia/default.nix
new file mode 100644
index 000000000000..8a58cd638b9d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/pythia/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, boost, fastjet, hepmc, lhapdf, rsync, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "pythia";
+  version = "8.305";
+
+  src = fetchurl {
+    url = "http://home.thep.lu.se/~torbjorn/pythia8/pythia${builtins.replaceStrings ["."] [""] version}.tgz";
+    sha256 = "03rpy2bmx67217fh1spfn36x9xrk0igcj56byki77lgj0y5mz21a";
+  };
+
+  nativeBuildInputs = [ rsync ];
+  buildInputs = [ boost fastjet hepmc zlib lhapdf ];
+
+  preConfigure = ''
+    patchShebangs ./configure
+  '';
+
+  configureFlags = [
+    "--enable-shared"
+    "--with-lhapdf6=${lhapdf}"
+  ] ++ (if lib.versions.major hepmc.version == "3" then [
+    "--with-hepmc3=${hepmc}"
+  ] else [
+    "--with-hepmc2=${hepmc}"
+  ]);
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A program for the generation of high-energy physics events";
+    license = licenses.gpl2Only;
+    homepage = "http://home.thep.lu.se/~torbjorn/Pythia.html";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix b/nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix
new file mode 100644
index 000000000000..834e3fcbba89
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, gfortran, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "QCDNUM";
+  version = "17-01-15";
+
+  src = fetchurl {
+    url = "http://www.nikhef.nl/user/h24/qcdnum-files/download/qcdnum${builtins.replaceStrings ["-"] [""] version}.tar.gz";
+    sha256 = "0ibk1sppss45qh0g8i2c99alkx82xdbss3p55f5367bxjx4iqvvg";
+  };
+
+  nativeBuildInputs = [ gfortran ];
+  buildInputs = [ zlib ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "A very fast QCD evolution program written in FORTRAN77";
+    license     = lib.licenses.gpl3;
+    homepage    = "https://www.nikhef.nl/~h24/qcdnum/index.html";
+    platforms   = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/rivet/default.nix b/nixpkgs/pkgs/development/libraries/physics/rivet/default.nix
new file mode 100644
index 000000000000..9d3124987048
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/rivet/default.nix
@@ -0,0 +1,81 @@
+{ lib, stdenv, fetchurl, fastjet, fastjet-contrib, ghostscript, hepmc, imagemagick, less, python3, rsync, texlive, yoda, which, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "rivet";
+  version = "3.1.4";
+
+  src = fetchurl {
+    url = "https://www.hepforge.org/archive/rivet/Rivet-${version}.tar.bz2";
+    sha256 = "sha256-N+3ICilozhAxWJ5DumtJKHfKeQG+o4+Lt1NqXIz4EA0=";
+  };
+
+  latex = texlive.combine { inherit (texlive)
+    scheme-basic
+    collection-pstricks
+    collection-fontsrecommended
+    l3kernel
+    l3packages
+    mathastext
+    pgf
+    relsize
+    sansmath
+    sfmath
+    siunitx
+    xcolor
+    xkeyval
+    xstring
+    ;};
+
+  nativeBuildInputs = [ rsync makeWrapper ];
+  buildInputs = [ hepmc imagemagick python3 latex python3.pkgs.yoda ];
+  propagatedBuildInputs = [ fastjet fastjet-contrib ];
+
+  preConfigure = ''
+    substituteInPlace bin/rivet-build.in \
+      --replace 'num_jobs=$(getconf _NPROCESSORS_ONLN)' 'num_jobs=''${NIX_BUILD_CORES:-$(getconf _NPROCESSORS_ONLN)}' \
+      --replace 'which' '"${which}/bin/which"' \
+      --replace 'mycxx=' 'mycxx=${stdenv.cc}/bin/${if stdenv.cc.isClang or false then "clang++" else "g++"}  #' \
+      --replace 'mycxxflags="' "mycxxflags=\"$NIX_CFLAGS_COMPILE $NIX_CXXSTDLIB_COMPILE $NIX_CFLAGS_LINK "
+  '';
+
+  preInstall = ''
+    substituteInPlace bin/make-plots \
+      --replace '"which"' '"${which}/bin/which"' \
+      --replace '"latex"' '"'$latex'/bin/latex"' \
+      --replace '"dvips"' '"'$latex'/bin/dvips"' \
+      --replace '"ps2pdf"' '"${ghostscript}/bin/ps2pdf"' \
+      --replace '"ps2eps"' '"${ghostscript}/bin/ps2eps"' \
+      --replace '"kpsewhich"' '"'$latex'/bin/kpsewhich"' \
+      --replace '"convert"' '"${imagemagick.out}/bin/convert"'
+    substituteInPlace bin/rivet \
+      --replace '"less"' '"${less}/bin/less"'
+    substituteInPlace bin/rivet-mkhtml \
+      --replace '"make-plots"' \"$out/bin/make-plots\" \
+      --replace '"rivet-cmphistos"' \"$out/bin/rivet-cmphistos\"
+  '';
+
+  configureFlags = [
+    "--with-fastjet=${fastjet}"
+    "--with-yoda=${yoda}"
+  ] ++ (if lib.versions.major hepmc.version == "3" then [
+    "--with-hepmc3=${hepmc}"
+  ] else [
+    "--with-hepmc=${hepmc}"
+  ]);
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    for prog in "$out"/bin/*; do
+      wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out")
+    done
+  '';
+
+  meta = with lib; {
+    description = "A framework for comparison of experimental measurements from high-energy particle colliders to theory predictions";
+    license     = licenses.gpl3;
+    homepage    = "https://rivet.hepforge.org";
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/thepeg/default.nix b/nixpkgs/pkgs/development/libraries/physics/thepeg/default.nix
new file mode 100644
index 000000000000..ed92889b5b21
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/thepeg/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, boost, fastjet, gsl, hepmc2, lhapdf, rivet, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "thepeg";
+  version = "2.2.2";
+
+  src = fetchurl {
+    url = "https://www.hepforge.org/archive/thepeg/ThePEG-${version}.tar.bz2";
+    sha256 = "0gif4vb9lw2px2qdywqm7x0frbv0h5gq9lq36c50f2hv77a5bgwp";
+  };
+
+  buildInputs = [ boost fastjet gsl hepmc2 lhapdf rivet zlib ];
+
+  configureFlags = [
+    "--with-hepmc=${hepmc2}"
+    "--with-rivet=${rivet}"
+    "--without-javagui"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Toolkit for High Energy Physics Event Generation";
+    homepage = "https://herwig.hepforge.org/";
+    license = licenses.gpl3Only;
+    maintainers = with maintainers; [ veprbl ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/physics/yoda/default.nix b/nixpkgs/pkgs/development/libraries/physics/yoda/default.nix
new file mode 100644
index 000000000000..9398c4d2f36e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/physics/yoda/default.nix
@@ -0,0 +1,68 @@
+{ lib, stdenv, fetchurl, fetchpatch, python, root, makeWrapper, zlib, withRootSupport ? false }:
+
+stdenv.mkDerivation rec {
+  pname = "yoda";
+  version = "1.9.0";
+
+  src = fetchurl {
+    url = "https://www.hepforge.org/archive/yoda/YODA-${version}.tar.bz2";
+    sha256 = "1x7xi6w7lb92x8202kbaxgqg1sly534wana4f38l3gpbzw9dwmcs";
+  };
+
+  patches = [
+    # fix a minor bug
+    # https://gitlab.com/hepcedar/yoda/-/merge_requests/38
+    (fetchpatch {
+      name = "yoda-fix-fuzzy-compare-bin2d.patch";
+      url = "https://gitlab.com/hepcedar/yoda/-/commit/a2999d78cb3d9ed874f367bad375dc39a1a11148.diff";
+      sha256 = "sha256-BsaVm+4VtCvRoEuN4r6A4bj9XwgMe75UesKzN+b56Qw=";
+    })
+    # fix a regression
+    # https://gitlab.com/hepcedar/yoda/-/merge_requests/40
+    (fetchpatch {
+      name = "yoda-fix-for-yodagz.patch";
+      url = "https://gitlab.com/hepcedar/yoda/-/commit/3338ba5a7466599ac6969e4ae462f133d6cf4fd8.diff";
+      sha256 = "sha256-MZTOIt468bdPCS7UVfr5hQZUsVy3TpY/TjRrNySIL70=";
+      excludes = [ "ChangeLog" ];
+    })
+    # fix a minor bug
+    # https://gitlab.com/hepcedar/yoda/-/merge_requests/45
+    (fetchpatch {
+      name = "yoda-fix-yodascale-for-gz.patch";
+      url = "https://gitlab.com/hepcedar/yoda/-/commit/b03162aeaa2c99e38512ba6e4818d2e0a825b757.diff";
+      sha256 = "sha256-IMuPalQ/GKcdJOKAlwE/IRWtxDdu0inoj+A9nbRl6Gs=";
+    })
+  ];
+
+  nativeBuildInputs = with python.pkgs; [ cython makeWrapper ];
+  buildInputs = [ python ]
+    ++ (with python.pkgs; [ numpy matplotlib ])
+    ++ lib.optional withRootSupport root;
+  propagatedBuildInputs = [ zlib ];
+
+  enableParallelBuilding = true;
+
+  postPatch = ''
+    touch pyext/yoda/*.{pyx,pxd}
+    patchShebangs .
+  '';
+
+  postInstall = ''
+    for prog in "$out"/bin/*; do
+      wrapProgram "$prog" --set PYTHONPATH $PYTHONPATH:$(toPythonPath "$out")
+    done
+  '';
+
+  hardeningDisable = [ "format" ];
+
+  doInstallCheck = true;
+  installCheckTarget = "check";
+
+  meta = {
+    description = "Provides small set of data analysis (specifically histogramming) classes";
+    license     = lib.licenses.gpl3;
+    homepage    = "https://yoda.hepforge.org";
+    platforms   = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ veprbl ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pico-sdk/default.nix b/nixpkgs/pkgs/development/libraries/pico-sdk/default.nix
new file mode 100644
index 000000000000..3db4ff336ffb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pico-sdk/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "pico-sdk";
+  version = "1.2.0";
+
+  src = fetchFromGitHub {
+    owner = "raspberrypi";
+    repo = pname;
+    rev = version;
+    sha256 = "00z160f7ypws5pzp1ql7xrs3gmjcbw6gywnnq2fiwl47940balns";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  # SDK contains libraries and build-system to develop projects for RP2040 chip
+  # We only need to compile pioasm binary
+  sourceRoot = "source/tools/pioasm";
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/lib/pico-sdk
+    cp -a ../../../* $out/lib/pico-sdk/
+    chmod 755 $out/lib/pico-sdk/tools/pioasm/build/pioasm
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/raspberrypi/picotool";
+    description = "SDK provides the headers, libraries and build system necessary to write programs for the RP2040-based devices";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ musfay ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pipewire/0.2.nix b/nixpkgs/pkgs/development/libraries/pipewire/0.2.nix
new file mode 100644
index 000000000000..276ad6b8c492
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pipewire/0.2.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config, doxygen, graphviz, valgrind
+, glib, dbus, gst_all_1, alsa-lib, ffmpeg_4, libjack2, udev, libva, xorg
+, sbc, SDL2, makeFontsConf
+}:
+
+let
+  fontsConf = makeFontsConf {
+    fontDirectories = [ ];
+  };
+in stdenv.mkDerivation rec {
+  pname = "pipewire";
+  version = "0.2.7";
+
+  src = fetchFromGitHub {
+    owner = "PipeWire";
+    repo = "pipewire";
+    rev = version;
+    sha256 = "1q5wrqnhhs6r49p8yvkw1pl0cnsd4rndxy4h5lvdydwgf1civcwc";
+  };
+
+  outputs = [ "out" "lib" "dev" "doc" ];
+
+  nativeBuildInputs = [
+    meson ninja pkg-config doxygen graphviz valgrind
+  ];
+  buildInputs = [
+    glib dbus gst_all_1.gst-plugins-base gst_all_1.gstreamer
+    alsa-lib ffmpeg_4 libjack2 udev libva xorg.libX11 sbc SDL2
+  ];
+
+  mesonFlags = [
+    "-Ddocs=true"
+    "-Dgstreamer=enabled"
+  ];
+
+  PKG_CONFIG_SYSTEMD_SYSTEMDUSERUNITDIR = "${placeholder "out"}/lib/systemd/user";
+
+  FONTCONFIG_FILE = fontsConf; # Fontconfig error: Cannot load default config file
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Server and user space API to deal with multimedia pipelines";
+    homepage = "https://pipewire.org/";
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ jtojnar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pipewire/0040-alsa-profiles-use-libdir.patch b/nixpkgs/pkgs/development/libraries/pipewire/0040-alsa-profiles-use-libdir.patch
new file mode 100644
index 000000000000..fab89c4ffd93
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pipewire/0040-alsa-profiles-use-libdir.patch
@@ -0,0 +1,13 @@
+diff --git a/meson.build b/meson.build
+index 99a4b2d1..d4a4cda7 100644
+--- a/meson.build
++++ b/meson.build
+@@ -55,7 +55,7 @@ endif
+ 
+ spa_plugindir = pipewire_libdir / spa_name
+ 
+-alsadatadir = pipewire_datadir / 'alsa-card-profile' / 'mixer'
++alsadatadir = pipewire_libdir / '..' / 'share' / 'alsa-card-profile' / 'mixer'
+ 
+ pipewire_headers_dir = pipewire_name / 'pipewire'
+ 
diff --git a/nixpkgs/pkgs/development/libraries/pipewire/0050-pipewire-pulse-path.patch b/nixpkgs/pkgs/development/libraries/pipewire/0050-pipewire-pulse-path.patch
new file mode 100644
index 000000000000..fd7d031ee0fe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pipewire/0050-pipewire-pulse-path.patch
@@ -0,0 +1,27 @@
+diff --git a/meson_options.txt b/meson_options.txt
+index 66791f3a..93b5e2a9 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -172,6 +172,9 @@ option('udev',
+ option('udevrulesdir',
+        type : 'string',
+        description : 'Directory for udev rules (defaults to /lib/udev/rules.d)')
++option('pipewire_pulse_prefix',
++       type : 'string',
++       description: 'Install directory for the pipewire-pulse daemon')
+ option('systemd-user-unit-dir',
+        type : 'string',
+        description : 'Directory for user systemd units (defaults to /usr/lib/systemd/user)')
+diff --git a/src/daemon/systemd/user/meson.build b/src/daemon/systemd/user/meson.build
+index aa30a86f..1edebb2d 100644
+--- a/src/daemon/systemd/user/meson.build
++++ b/src/daemon/systemd/user/meson.build
+@@ -9,7 +9,7 @@ install_data(
+ 
+ systemd_config = configuration_data()
+ systemd_config.set('PW_BINARY', pipewire_bindir / 'pipewire')
+-systemd_config.set('PW_PULSE_BINARY', pipewire_bindir / 'pipewire-pulse')
++systemd_config.set('PW_PULSE_BINARY', get_option('pipewire_pulse_prefix') / 'bin/pipewire-pulse')
+ systemd_config.set('PW_MEDIA_SESSION_BINARY', pipewire_bindir / 'pipewire-media-session')
+ 
+ configure_file(input : 'pipewire.service.in',
diff --git a/nixpkgs/pkgs/development/libraries/pipewire/0055-pipewire-media-session-path.patch b/nixpkgs/pkgs/development/libraries/pipewire/0055-pipewire-media-session-path.patch
new file mode 100644
index 000000000000..8290aec5dfc4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pipewire/0055-pipewire-media-session-path.patch
@@ -0,0 +1,24 @@
+diff --git a/meson_options.txt b/meson_options.txt
+index 93b5e2a9..1b915ac3 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -200,3 +200,6 @@ option('media-session',
+        type: 'feature',
+        value: 'auto')
++option('media-session-prefix',
++       description: 'Install directory for pipewire-media-session and its support files',
++       type: 'string')
+ option('session-managers',
+diff --git a/src/daemon/systemd/user/meson.build b/src/daemon/systemd/user/meson.build
+index 1edebb2d..251270eb 100644
+--- a/src/daemon/systemd/user/meson.build
++++ b/src/daemon/systemd/user/meson.build
+@@ -10,7 +10,7 @@ install_data(
+ systemd_config = configuration_data()
+ systemd_config.set('PW_BINARY', pipewire_bindir / 'pipewire')
+ systemd_config.set('PW_PULSE_BINARY', get_option('pipewire_pulse_prefix') / 'bin/pipewire-pulse')
+-systemd_config.set('PW_MEDIA_SESSION_BINARY', pipewire_bindir / 'pipewire-media-session')
++systemd_config.set('PW_MEDIA_SESSION_BINARY', get_option('media-session-prefix') / 'bin/pipewire-media-session')
+ 
+ configure_file(input : 'pipewire.service.in',
+                output : 'pipewire.service',
diff --git a/nixpkgs/pkgs/development/libraries/pipewire/0070-installed-tests-path.patch b/nixpkgs/pkgs/development/libraries/pipewire/0070-installed-tests-path.patch
new file mode 100644
index 000000000000..926de3062546
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pipewire/0070-installed-tests-path.patch
@@ -0,0 +1,29 @@
+diff --git a/meson.build b/meson.build
+index d4a4cda7..a27569bd 100644
+--- a/meson.build
++++ b/meson.build
+@@ -353,8 +353,8 @@ libinotify_dep = (build_machine.system() == 'freebsd'
+ 
+ alsa_dep = dependency('alsa', version : '>=1.1.7', required: get_option('pipewire-alsa'))
+ 
+-installed_tests_metadir = pipewire_datadir / 'installed-tests' / pipewire_name
+-installed_tests_execdir = pipewire_libexecdir / 'installed-tests' / pipewire_name
++installed_tests_metadir = get_option('installed_test_prefix') / 'share' / 'installed-tests' / pipewire_name
++installed_tests_execdir = get_option('installed_test_prefix') / 'libexec' / 'installed-tests' / pipewire_name
+ installed_tests_enabled = not get_option('installed_tests').disabled()
+ installed_tests_template = files('template.test.in')
+ 
+diff --git a/meson_options.txt b/meson_options.txt
+index 1b915ac3..85beb86a 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -29,6 +29,9 @@ option('installed_tests',
+        description: 'Install manual and automated test executables',
+        type: 'feature',
+        value: 'disabled')
++option('installed_test_prefix',
++       description: 'Prefix for installed tests',
++       type: 'string')
+ option('gstreamer',
+        description: 'Build GStreamer plugins',
+        type: 'feature',
diff --git a/nixpkgs/pkgs/development/libraries/pipewire/0080-pipewire-config-dir.patch b/nixpkgs/pkgs/development/libraries/pipewire/0080-pipewire-config-dir.patch
new file mode 100644
index 000000000000..b8d8fcb0f905
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pipewire/0080-pipewire-config-dir.patch
@@ -0,0 +1,30 @@
+diff --git a/meson.build b/meson.build
+index b6b4553b..f21c29d8 100644
+--- a/meson.build
++++ b/meson.build
+@@ -37,7 +37,10 @@ pipewire_localedir = prefix / get_option('localedir')
+ pipewire_sysconfdir = prefix / get_option('sysconfdir')
+ 
+ pipewire_configdir = pipewire_sysconfdir / 'pipewire'
+-pipewire_confdatadir = pipewire_datadir / 'pipewire'
++pipewire_confdatadir = get_option('pipewire_confdata_dir')
++if pipewire_confdatadir == ''
++  pipewire_confdatadir = pipewire_datadir / 'pipewire'
++endif
+ modules_install_dir = pipewire_libdir / pipewire_name
+ 
+ if host_machine.system() == 'linux'
+diff --git a/meson_options.txt b/meson_options.txt
+index 9bc33fcd..e4bd2dc1 100644
+--- a/meson_options.txt
++++ b/meson_options.txt
+@@ -61,6 +61,9 @@ option('jack-devel',
+ option('libjack-path',
+        description: 'Where to install the libjack.so library',
+        type: 'string')
++option('pipewire_confdata_dir',
++       type: 'string',
++       description: 'Directory for pipewire default configuration (defaults to /usr/share/pipewire)')
+ option('spa-plugins',
+        description: 'Enable spa plugins integration',
+        type: 'feature',
diff --git a/nixpkgs/pkgs/development/libraries/pipewire/0090-pipewire-config-template-paths.patch b/nixpkgs/pkgs/development/libraries/pipewire/0090-pipewire-config-template-paths.patch
new file mode 100644
index 000000000000..1f1a98780e9c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pipewire/0090-pipewire-config-template-paths.patch
@@ -0,0 +1,28 @@
+diff --git a/src/daemon/pipewire.conf.in b/src/daemon/pipewire.conf.in
+index bbafa134..227d3e06 100644
+--- a/src/daemon/pipewire.conf.in
++++ b/src/daemon/pipewire.conf.in
+@@ -116,7 +116,7 @@ context.modules = [
+             # access.allowed to list an array of paths of allowed
+             # apps.
+             #access.allowed = [
+-            #    @session_manager_path@
++            #    <session_manager_path>
+             #]
+ 
+             # An array of rejected paths.
+@@ -220,12 +220,12 @@ context.exec = [
+     # but it is better to start it as a systemd service.
+     # Run the session manager with -h for options.
+     #
+-    @comment@{ path = "@session_manager_path@"  args = "@session_manager_args@" }
++    @comment@{ path = "<session_manager_path>"  args = "@session_manager_args@" }
+     #
+     # You can optionally start the pulseaudio-server here as well
+     # but it is better to start it as a systemd service.
+     # It can be interesting to start another daemon here that listens
+     # on another address with the -a option (eg. -a tcp:4713).
+     #
+-    @comment@{ path = "@pipewire_path@" args = "-c pipewire-pulse.conf" }
++    @comment@{ path = "<pipewire_path>" args = "-c pipewire-pulse.conf" }
+ ]
diff --git a/nixpkgs/pkgs/development/libraries/pipewire/default.nix b/nixpkgs/pkgs/development/libraries/pipewire/default.nix
new file mode 100644
index 000000000000..ed22eb6c6838
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pipewire/default.nix
@@ -0,0 +1,226 @@
+{ stdenv
+, lib
+, fetchFromGitLab
+, removeReferencesTo
+, python3
+, meson
+, ninja
+, systemd
+, pkg-config
+, doxygen
+, graphviz
+, valgrind
+, glib
+, dbus
+, alsa-lib
+, libjack2
+, libusb1
+, udev
+, libva
+, libsndfile
+, SDL2
+, vulkan-headers
+, vulkan-loader
+, webrtc-audio-processing
+, ncurses
+, makeFontsConf
+, callPackage
+, nixosTests
+, withMediaSession ? true
+, gstreamerSupport ? true
+, gst_all_1 ? null
+, ffmpegSupport ? true
+, ffmpeg ? null
+, bluezSupport ? true
+, bluez ? null
+, sbc ? null
+, libfreeaptx ? null
+, ldacbt ? null
+, fdk_aac ? null
+, nativeHspSupport ? true
+, nativeHfpSupport ? true
+, ofonoSupport ? true
+, hsphfpdSupport ? true
+, pulseTunnelSupport ? true
+, libpulseaudio ? null
+, zeroconfSupport ? true
+, avahi ? null
+}:
+
+let
+  fontsConf = makeFontsConf {
+    fontDirectories = [ ];
+  };
+
+  mesonEnable = b: if b then "enabled" else "disabled";
+  mesonList = l: "[" + lib.concatStringsSep "," l + "]";
+
+  self = stdenv.mkDerivation rec {
+    pname = "pipewire";
+    version = "0.3.34";
+
+    outputs = [
+      "out"
+      "lib"
+      "pulse"
+      "jack"
+      "dev"
+      "doc"
+      "mediaSession"
+      "installedTests"
+    ];
+
+    src = fetchFromGitLab {
+      domain = "gitlab.freedesktop.org";
+      owner = "pipewire";
+      repo = "pipewire";
+      rev = version;
+      sha256 = "sha256-ZFARA7YuDnpObGLWbgy1Rk+wzmAxHEMuHQkb6tWD0s0=";
+    };
+
+    patches = [
+      # Break up a dependency cycle between outputs.
+      ./0040-alsa-profiles-use-libdir.patch
+      # Change the path of the pipewire-pulse binary in the service definition.
+      ./0050-pipewire-pulse-path.patch
+      # Change the path of the pipewire-media-session binary in the service definition.
+      ./0055-pipewire-media-session-path.patch
+      # Move installed tests into their own output.
+      ./0070-installed-tests-path.patch
+      # Add option for changing the config install directory
+      ./0080-pipewire-config-dir.patch
+      # Remove output paths from the comments in the config templates to break dependency cycles
+      ./0090-pipewire-config-template-paths.patch
+    ];
+
+    nativeBuildInputs = [
+      doxygen
+      graphviz
+      meson
+      ninja
+      pkg-config
+      python3
+    ];
+
+    buildInputs = [
+      alsa-lib
+      dbus
+      glib
+      libjack2
+      libusb1
+      libsndfile
+      ncurses
+      udev
+      vulkan-headers
+      vulkan-loader
+      webrtc-audio-processing
+      valgrind
+      SDL2
+      systemd
+    ] ++ lib.optionals gstreamerSupport [ gst_all_1.gst-plugins-base gst_all_1.gstreamer ]
+    ++ lib.optional ffmpegSupport ffmpeg
+    ++ lib.optionals bluezSupport [ bluez libfreeaptx ldacbt sbc fdk_aac ]
+    ++ lib.optional pulseTunnelSupport libpulseaudio
+    ++ lib.optional zeroconfSupport avahi;
+
+    mesonFlags = [
+      "-Ddocs=enabled"
+      "-Dman=disabled" # we don't have xmltoman
+      "-Dexamples=${mesonEnable withMediaSession}" # only needed for `pipewire-media-session`
+      "-Dudevrulesdir=lib/udev/rules.d"
+      "-Dinstalled_tests=enabled"
+      "-Dinstalled_test_prefix=${placeholder "installedTests"}"
+      "-Dpipewire_pulse_prefix=${placeholder "pulse"}"
+      "-Dmedia-session-prefix=${placeholder "mediaSession"}"
+      "-Dlibjack-path=${placeholder "jack"}/lib"
+      "-Dlibcamera=disabled"
+      "-Droc=disabled"
+      "-Dlibpulse=${mesonEnable pulseTunnelSupport}"
+      "-Davahi=${mesonEnable zeroconfSupport}"
+      "-Dgstreamer=${mesonEnable gstreamerSupport}"
+      "-Dffmpeg=${mesonEnable ffmpegSupport}"
+      "-Dbluez5=${mesonEnable bluezSupport}"
+      "-Dbluez5-backend-hsp-native=${mesonEnable nativeHspSupport}"
+      "-Dbluez5-backend-hfp-native=${mesonEnable nativeHfpSupport}"
+      "-Dbluez5-backend-ofono=${mesonEnable ofonoSupport}"
+      "-Dbluez5-backend-hsphfpd=${mesonEnable hsphfpdSupport}"
+      "-Dsysconfdir=/etc"
+      "-Dpipewire_confdata_dir=${placeholder "lib"}/share/pipewire"
+      "-Dsession-managers=${mesonList (lib.optional withMediaSession "media-session")}"
+    ];
+
+    FONTCONFIG_FILE = fontsConf; # Fontconfig error: Cannot load default config file
+
+    doCheck = true;
+
+    postUnpack = ''
+      patchShebangs source/doc/strip-static.sh
+      patchShebangs source/spa/tests/gen-cpp-test.py
+    '';
+
+    postInstall = ''
+      pushd $lib/share
+      mkdir -p $out/nix-support/etc/pipewire
+      for f in pipewire/*.conf; do
+        echo "Generating JSON from $f"
+        $out/bin/spa-json-dump "$f" > "$out/nix-support/etc/$f.json"
+      done
+
+      mkdir -p $mediaSession/nix-support/etc/pipewire/media-session.d
+      for f in pipewire/media-session.d/*.conf; do
+        echo "Generating JSON from $f"
+        $out/bin/spa-json-dump "$f" > "$mediaSession/nix-support/etc/$f.json"
+      done
+      popd
+
+      moveToOutput "share/pipewire/media-session.d/*.conf" "$mediaSession"
+      moveToOutput "share/systemd/user/pipewire-media-session.*" "$mediaSession"
+      moveToOutput "lib/systemd/user/pipewire-media-session.*" "$mediaSession"
+      moveToOutput "bin/pipewire-media-session" "$mediaSession"
+
+      moveToOutput "share/systemd/user/pipewire-pulse.*" "$pulse"
+      moveToOutput "lib/systemd/user/pipewire-pulse.*" "$pulse"
+      moveToOutput "bin/pipewire-pulse" "$pulse"
+    '';
+
+    passthru = {
+      updateScript = ./update.sh;
+      tests = {
+        installedTests = nixosTests.installed-tests.pipewire;
+
+        # This ensures that all the paths used by the NixOS module are found.
+        test-paths = callPackage ./test-paths.nix {
+          paths-out = [
+            "share/alsa/alsa.conf.d/50-pipewire.conf"
+            "nix-support/etc/pipewire/client-rt.conf.json"
+            "nix-support/etc/pipewire/client.conf.json"
+            "nix-support/etc/pipewire/jack.conf.json"
+            "nix-support/etc/pipewire/pipewire.conf.json"
+            "nix-support/etc/pipewire/pipewire-pulse.conf.json"
+          ];
+          paths-out-media-session = [
+            "nix-support/etc/pipewire/media-session.d/alsa-monitor.conf.json"
+            "nix-support/etc/pipewire/media-session.d/bluez-monitor.conf.json"
+            "nix-support/etc/pipewire/media-session.d/bluez-hardware.conf.json"
+            "nix-support/etc/pipewire/media-session.d/media-session.conf.json"
+            "nix-support/etc/pipewire/media-session.d/v4l2-monitor.conf.json"
+          ];
+          paths-lib = [
+            "lib/alsa-lib/libasound_module_pcm_pipewire.so"
+            "share/alsa-card-profile/mixer"
+          ];
+        };
+      };
+    };
+
+    meta = with lib; {
+      description = "Server and user space API to deal with multimedia pipelines";
+      homepage = "https://pipewire.org/";
+      license = licenses.mit;
+      platforms = platforms.linux;
+      maintainers = with maintainers; [ jtojnar kranzes ];
+    };
+  };
+
+in
+self
diff --git a/nixpkgs/pkgs/development/libraries/pipewire/test-paths.nix b/nixpkgs/pkgs/development/libraries/pipewire/test-paths.nix
new file mode 100644
index 000000000000..939b79686e3f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pipewire/test-paths.nix
@@ -0,0 +1,24 @@
+{ lib, runCommand, pipewire, paths-out, paths-lib, paths-out-media-session }:
+
+let
+  check-path = output: path: ''
+    if [[ ! -f "${output}/${path}" && ! -d "${output}/${path}" ]]; then
+      printf "Missing: %s\n" "${output}/${path}" | tee -a $out
+      error=error
+    else
+      printf "Found: %s\n" "${output}/${path}" | tee -a $out
+    fi
+  '';
+
+  check-output = output: lib.concatMapStringsSep "\n" (check-path output);
+in runCommand "pipewire-test-paths" { } ''
+  touch $out
+
+  ${check-output pipewire.mediaSession paths-out-media-session}
+  ${check-output pipewire.lib paths-lib}
+  ${check-output pipewire paths-out}
+
+  if [[ -n "$error" ]]; then
+    exit 1
+  fi
+''
diff --git a/nixpkgs/pkgs/development/libraries/pipewire/update.sh b/nixpkgs/pkgs/development/libraries/pipewire/update.sh
new file mode 100755
index 000000000000..6d0088c206cb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pipewire/update.sh
@@ -0,0 +1,24 @@
+#!/usr/bin/env nix-shell
+#!nix-shell -p nix-update -i bash
+# shellcheck shell=bash
+
+set -o errexit -o pipefail -o nounset -o errtrace
+shopt -s inherit_errexit
+shopt -s nullglob
+IFS=$'\n'
+
+NIXPKGS_ROOT="$(git rev-parse --show-toplevel)"
+
+cd "$NIXPKGS_ROOT"
+nix-update pipewire
+outputs=$(nix-build . -A pipewire -A pipewire.mediaSession)
+for p in $outputs; do
+    conf_files=$(find "$p/nix-support/etc/pipewire/" -name '*.conf.json')
+    for c in $conf_files; do
+        file_name=$(basename "$c")
+        if [[ ! -e "nixos/modules/services/desktops/pipewire/$file_name" ]]; then
+            echo "New file $file_name found! Add it to the module config and passthru tests!"
+        fi
+        install -m 0644 "$c" "nixos/modules/services/desktops/pipewire/"
+    done
+done
diff --git a/nixpkgs/pkgs/development/libraries/pixman/default.nix b/nixpkgs/pkgs/development/libraries/pixman/default.nix
new file mode 100644
index 000000000000..a8cea4638069
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pixman/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, pkg-config, libpng, glib /*just passthru*/ }:
+
+stdenv.mkDerivation rec {
+  pname = "pixman";
+  version = "0.38.4";
+
+  src = fetchurl {
+    url = "mirror://xorg/individual/lib/${pname}-${version}.tar.bz2";
+    sha256 = "0l0m48lnmdlmnaxn2021qi5cj366d9fzfjxkqgcj9bs14pxbgaw4";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ libpng ];
+
+  configureFlags = lib.optional stdenv.isAarch32 "--disable-arm-iwmmxt";
+
+  doCheck = true;
+
+  postInstall = glib.flattenInclude;
+
+  meta = with lib; {
+    homepage = "http://pixman.org";
+    description = "A low-level library for pixel manipulation";
+    license = licenses.mit;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pkcs11helper/default.nix b/nixpkgs/pkgs/development/libraries/pkcs11helper/default.nix
new file mode 100644
index 000000000000..4148ca4fc47d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pkcs11helper/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, openssl, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "pkcs11-helper";
+  version = "1.27";
+
+  src = fetchFromGitHub {
+    owner = "OpenSC";
+    repo = "pkcs11-helper";
+    rev = "${pname}-${version}";
+    sha256 = "1idrqip59bqzcgddpnk2inin5n5yn4y0dmcyaggfpdishraiqgd5";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ openssl ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/OpenSC/pkcs11-helper";
+    license = with licenses; [ bsd3 gpl2 ];
+    description = "Library that simplifies the interaction with PKCS#11 providers";
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pkger/default.nix b/nixpkgs/pkgs/development/libraries/pkger/default.nix
new file mode 100644
index 000000000000..f2e984c8c816
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pkger/default.nix
@@ -0,0 +1,29 @@
+{ buildGoModule
+, fetchFromGitHub
+, lib
+
+}:
+
+buildGoModule rec {
+  pname = "pkger";
+  version = "0.17.1";
+
+  src = fetchFromGitHub {
+    owner = "markbates";
+    repo = "pkger";
+    rev = "v${version}";
+    sha256 = "12zcvsd6bv581wwhahp1wy903495s51lw86b99cfihwmxc5qw6ww";
+  };
+
+  vendorSha256 = "1b9gpym6kb4hpdbrixphfh1qylmqr265jrmcd4vxb87ahvrsrvgp";
+
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Embed static files in Go binaries (replacement for gobuffalo/packr) ";
+    homepage = "https://github.com/markbates/pkger";
+    changelog = "https://github.com/markbates/pkger/releases/tag/v${version}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ flokli ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/plasma-wayland-protocols/default.nix b/nixpkgs/pkgs/development/libraries/plasma-wayland-protocols/default.nix
new file mode 100644
index 000000000000..fff25d5bb44f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/plasma-wayland-protocols/default.nix
@@ -0,0 +1,25 @@
+{ mkDerivation, fetchurl, lib
+, extra-cmake-modules
+, qtbase
+}:
+
+mkDerivation rec {
+  pname = "plasma-wayland-protocols";
+  version = "1.3.0";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-DaojYvLg0V954OAG6NfxkI6I43tcUgi0DJyw1NbcqbU=";
+  };
+
+  nativeBuildInputs = [ extra-cmake-modules ];
+
+  buildInputs = [ qtbase ];
+
+  meta = {
+    description = "Plasma Wayland Protocols";
+    license = lib.licenses.lgpl21Plus;
+    platforms = qtbase.meta.platforms;
+    maintainers = [ lib.maintainers.ttuegel ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/plib/default.nix b/nixpkgs/pkgs/development/libraries/plib/default.nix
new file mode 100644
index 000000000000..da95f9ef698c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/plib/default.nix
@@ -0,0 +1,51 @@
+{ fetchurl, fetchpatch, lib, stdenv, libGLU, libGL, freeglut, SDL
+, libXi, libSM, libXmu, libXext, libX11 }:
+
+stdenv.mkDerivation rec {
+  pname = "plib";
+  version = "1.8.5";
+
+  src = fetchurl {
+    # XXX: The author doesn't use the orthodox SF way to store tarballs.
+    url = "http://plib.sourceforge.net/dist/${pname}-${version}.tar.gz";
+    sha256 = "0cha71mflpa10vh2l7ipyqk67dq2y0k5xbafwdks03fwdyzj4ns8";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://sources.debian.net/data/main/p/plib/1.8.5-7/debian/patches/04_CVE-2011-4620.diff";
+      sha256 = "1b7y0vqqdzd48q68ldlzw0zzqy9mg4c10a754r4hi3ldjmcplf0j";
+    })
+    (fetchpatch {
+      url = "https://sources.debian.net/data/main/p/plib/1.8.5-7/debian/patches/05_CVE-2012-4552.diff";
+      sha256 = "0b6cwdwii5b5vy78sbw5cw1s96l4jyzr4dk69v63pa0wwi2b5dki";
+    })
+  ];
+
+  propagatedBuildInputs = [
+    libGLU libGL freeglut SDL
+
+    # The following libs ought to be propagated build inputs of Mesa.
+    libXi libSM libXmu libXext libX11
+  ];
+
+  meta = {
+    description = "A suite of portable game libraries";
+
+    longDescription = ''
+      PLIB includes sound effects, music, a complete 3D engine, font
+      rendering, a simple Windowing library, a game scripting
+      language, a GUI, networking, 3D math library and a collection of
+      handy utility functions.  All are 100% portable across nearly
+      all modern computing platforms.  What's more, it's all available
+      on line - and completely free.  Each library component is fairly
+      independent of the others - so if you want to use SDL, GTK,
+      GLUT, or FLTK instead of PLIB's 'PW' windowing library, you can.
+    '';
+
+    license = lib.licenses.lgpl2Plus;
+
+    homepage = "http://plib.sourceforge.net/";
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/plplot/default.nix b/nixpkgs/pkgs/development/libraries/plplot/default.nix
new file mode 100644
index 000000000000..05f12d0148be
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/plplot/default.nix
@@ -0,0 +1,25 @@
+{ lib, 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 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
new file mode 100644
index 000000000000..6e0b6ab6722b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pmdk/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchFromGitHub
+, autoconf, libndctl, pkg-config, gnum4, pandoc
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pmdk";
+  version = "1.9.2";
+
+  src = fetchFromGitHub {
+    owner  = "pmem";
+    repo   = "pmdk";
+    rev    = "refs/tags/${version}";
+    sha256 = "0awmkj6j9y2pbqqmp9ql00s7qa3mnpppa82dfy5324lindq0z8a1";
+  };
+
+  nativeBuildInputs = [ autoconf pkg-config gnum4 pandoc ];
+  buildInputs = [ libndctl ];
+  enableParallelBuilding = true;
+
+  outputs = [ "out" "lib" "dev" "man" ];
+
+  patchPhase = "patchShebangs utils";
+
+  installPhase = ''
+    make install prefix=$out
+
+    mkdir -p $lib $dev $man/share
+    mv $out/share/man $man/share/man
+    mv $out/include $dev/include
+    mv $out/lib     $lib/lib
+  '';
+
+  meta = with lib; {
+    description = "Persistent Memory Development Kit";
+    homepage    = "https://github.com/pmem/pmdk";
+    license     = licenses.lgpl21;
+    maintainers = with maintainers; [ thoughtpolice ];
+    platforms   = [ "x86_64-linux" ]; # aarch64 is experimental
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pmix/default.nix b/nixpkgs/pkgs/development/libraries/pmix/default.nix
new file mode 100644
index 000000000000..7791973bb127
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pmix/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchFromGitHub, perl, autoconf, automake
+, libtool, flex, libevent, hwloc, munge, zlib, pandoc
+} :
+
+stdenv.mkDerivation rec {
+  pname = "pmix";
+  version = "3.2.3";
+
+  src = fetchFromGitHub {
+    repo = "openpmix";
+    owner = "openpmix";
+    rev = "v${version}";
+    sha256 = "sha256-w3j4zgEAn6RxIHAvy0B3MPFTV46ocCvc0Z36tN1T+rc=";
+  };
+
+  postPatch = ''
+    patchShebangs ./autogen.pl
+    patchShebangs ./config
+  '';
+
+  nativeBuildInputs = [ pandoc perl autoconf automake libtool flex ];
+
+  buildInputs = [ libevent hwloc munge zlib ];
+
+  configureFlags = [
+    "--with-libevent=${libevent.dev}"
+    "--with-munge=${munge}"
+    "--with-hwloc=${hwloc.dev}"
+  ];
+
+  preConfigure = ''
+    ./autogen.pl
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Process Management Interface for HPC environments";
+    homepage = "https://openpmix.github.io/";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.markuskowa ];
+    platforms = platforms.linux;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/png++/default.nix b/nixpkgs/pkgs/development/libraries/png++/default.nix
new file mode 100644
index 000000000000..dfd74e495e76
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/png++/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv, fetchurl, libpng
+, docSupport ? true, doxygen ? null
+}:
+assert docSupport -> doxygen != null;
+
+stdenv.mkDerivation rec {
+  pname = "pngpp";
+  version = "0.2.10";
+
+  src = fetchurl {
+    url = "mirror://savannah/pngpp/png++-${version}.tar.gz";
+    sha256 = "1qgf8j25r57wjqlnzdkm8ya5x1bmj6xjvapv8f2visqnmcbg52lr";
+  };
+
+  doCheck = true;
+  checkTarget = "test";
+  preCheck = ''
+    patchShebangs test/test.sh
+    substituteInPlace test/test.sh --replace "exit 1" "exit 0"
+  '';
+
+  postCheck = "cat test/test.log";
+
+  buildInputs = lib.optional docSupport doxygen;
+
+  propagatedBuildInputs = [ libpng ];
+
+  preConfigure = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace error.hpp --replace "#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE" "#if (__clang__ || _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && !_GNU_SOURCE"
+  '' + ''
+    sed "s|\(PNGPP := .\)|PREFIX := ''${out}\n\\1|" -i Makefile
+  '';
+
+  makeFlags = lib.optional docSupport "docs";
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://www.nongnu.org/pngpp/";
+    description = "C++ wrapper for libpng library";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.ramkromberg ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pocketsphinx/default.nix b/nixpkgs/pkgs/development/libraries/pocketsphinx/default.nix
new file mode 100644
index 000000000000..18d5d0bcfa22
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pocketsphinx/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv
+, fetchurl
+, sphinxbase
+, pkg-config
+, python27 # >= 2.6
+, swig2 # 2.0
+}:
+
+stdenv.mkDerivation rec {
+  name = "pocketsphinx-5prealpha";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/cmusphinx/${name}.tar.gz";
+    sha256 = "1n9yazzdgvpqgnfzsbl96ch9cirayh74jmpjf7svs4i7grabanzg";
+  };
+
+  propagatedBuildInputs = [ sphinxbase ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ python27 swig2 ];
+
+  meta = {
+    description = "Voice recognition library written in C";
+    homepage = "http://cmusphinx.sourceforge.net";
+    license = lib.licenses.free;
+    platforms = lib.platforms.linux;
+  };
+}
+
+/* Example usage:
+
+
+1.
+
+$ cat << EOF > vocabulary.txt
+oh mighty computer /1e-40/
+hello world /1e-30/
+EOF
+
+2.
+
+$ pocketsphinx_continuous -inmic yes -kws vocabulary.txt 2> /dev/null
+# after you say "hello world":
+hello world
+...
+
+*/
diff --git a/nixpkgs/pkgs/development/libraries/poco/default.nix b/nixpkgs/pkgs/development/libraries/poco/default.nix
new file mode 100644
index 000000000000..8f963bb366a9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/poco/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, cmake, pkg-config, zlib, pcre, expat, sqlite, openssl, unixODBC, libmysqlclient }:
+
+stdenv.mkDerivation rec {
+  pname = "poco";
+
+  version = "1.10.1";
+
+  src = fetchurl {
+    url = "https://pocoproject.org/releases/${pname}-${version}/${pname}-${version}-all.tar.gz";
+    sha256 = "1jilzh0h6ik5lr167nax7q6nrpzxl99p11pkl202ig06pgh32nbz";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [ zlib pcre expat sqlite openssl unixODBC libmysqlclient ];
+
+  MYSQL_DIR = libmysqlclient;
+  MYSQL_INCLUDE_DIR = "${MYSQL_DIR}/include/mysql";
+
+  cmakeFlags = [
+    "-DPOCO_UNBUNDLED=ON"
+  ];
+
+  meta = with lib; {
+    homepage = "https://pocoproject.org/";
+    description = "Cross-platform C++ libraries with a network/internet focus";
+    license = licenses.boost;
+    maintainers = with maintainers; [ orivej ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/podofo/default.nix b/nixpkgs/pkgs/development/libraries/podofo/default.nix
new file mode 100644
index 000000000000..ee99ab5de6f7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/podofo/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, cmake, zlib, freetype, libjpeg, libtiff, fontconfig
+, openssl, libpng, lua5, pkg-config, libidn, expat
+}:
+
+stdenv.mkDerivation rec {
+  version = "0.9.7";
+  pname = "podofo";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/podofo/${pname}-${version}.tar.gz";
+    sha256 = "1f0yvkx6nf99fp741w2y706d8bs9824x1z2gqm3rdy5fv8bfgwkw";
+  };
+
+  outputs = [ "out" "dev" "lib" ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [ zlib freetype libjpeg libtiff fontconfig openssl libpng
+                  libidn expat lua5 ];
+
+  cmakeFlags = [
+    "-DPODOFO_BUILD_SHARED=ON"
+    "-DPODOFO_BUILD_STATIC=OFF"
+    "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON"
+  ];
+
+  postInstall = ''
+    moveToOutput lib "$lib"
+  '';
+
+  meta = with lib; {
+    homepage = "http://podofo.sourceforge.net";
+    description = "A library to work with the PDF file format";
+    platforms = platforms.all;
+    license = with licenses; [ gpl2Plus lgpl2Plus ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/polkit-qt-1/default.nix b/nixpkgs/pkgs/development/libraries/polkit-qt-1/default.nix
new file mode 100644
index 000000000000..86ef2af96e7c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/polkit-qt-1/default.nix
@@ -0,0 +1,37 @@
+{ stdenv
+, lib
+, mkDerivation
+, fetchurl
+, cmake
+, pkg-config
+, polkit
+, glib
+, pcre
+, libselinux
+, libsepol
+, util-linux
+}:
+
+mkDerivation rec {
+  pname = "polkit-qt-1";
+  version = "0.113.0";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/${pname}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-W4ZqKVTvEP+2YVbi/orQMhtVKKjfLkqRsC9QQc5VY6c=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [
+    glib
+    pcre
+    polkit
+  ] ++ lib.optionals stdenv.isLinux [ libselinux libsepol util-linux ];
+
+  meta = with lib; {
+    description = "A Qt wrapper around PolKit";
+    maintainers = with maintainers; [ ttuegel ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/polkit/default.nix b/nixpkgs/pkgs/development/libraries/polkit/default.nix
new file mode 100644
index 000000000000..a8b012a20998
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/polkit/default.nix
@@ -0,0 +1,118 @@
+{ lib, stdenv, fetchurl, pkg-config, glib, expat, pam, perl, fetchpatch
+, intltool, spidermonkey_78, gobject-introspection, libxslt, docbook_xsl, dbus
+, docbook_xml_dtd_412, gtk-doc, coreutils
+, useSystemd ? (stdenv.isLinux && !stdenv.hostPlatform.isMusl), systemd, elogind
+# needed until gobject-introspection does cross-compile (https://github.com/NixOS/nixpkgs/pull/88222)
+, withIntrospection ? (stdenv.buildPlatform == stdenv.hostPlatform)
+# 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";
+
+in
+
+stdenv.mkDerivation rec {
+  pname = "polkit";
+  version = "0.119";
+
+  src = fetchurl {
+    url = "https://www.freedesktop.org/software/${pname}/releases/${pname}-${version}.tar.gz";
+    sha256 = "0p0zzmr0kh3mpmqya4q27y4h9b920zp5ya0i8909ahp9hvdrymy8";
+  };
+
+  patches = 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 = lib.optionalString stdenv.isDarwin ''
+    sed -i -e "s/-Wl,--as-needed//" configure.ac
+  '';
+
+  outputs = [ "bin" "dev" "out" ]; # small man pages in $bin
+
+  nativeBuildInputs =
+    [ glib gtk-doc pkg-config intltool perl ]
+    ++ [ libxslt docbook_xsl docbook_xml_dtd_412 ]; # man pages
+  buildInputs =
+    [ expat pam spidermonkey_78 ]
+    # On Linux, fall back to elogind when systemd support is off.
+    ++ lib.optional stdenv.isLinux (if useSystemd then systemd else elogind)
+    ++ lib.optional withIntrospection gobject-introspection;
+
+  propagatedBuildInputs = [
+    glib # in .pc Requires
+  ];
+
+  preConfigure = ''
+    chmod +x test/mocklibc/bin/mocklibc{,-test}.in
+    patchShebangs .
+
+    # ‘libpolkit-agent-1.so’ should call the setuid wrapper on
+    # NixOS.  Hard-coding the path is kinda ugly.  Maybe we can just
+    # call through $PATH, but that might have security implications.
+    substituteInPlace src/polkitagent/polkitagentsession.c \
+      --replace   'PACKAGE_PREFIX "/lib/polkit-1/'   '"${setuid}/'
+    substituteInPlace test/data/etc/polkit-1/rules.d/10-testing.rules \
+      --replace   /bin/true ${coreutils}/bin/true \
+      --replace   /bin/false ${coreutils}/bin/false
+
+  '' + lib.optionalString useSystemd /* bogus chroot detection */ ''
+    sed '/libsystemd autoconfigured/s/.*/:/' -i configure
+  '';
+
+  configureFlags = [
+    "--datadir=${system}/share"
+    "--sysconfdir=/etc"
+    "--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 withIntrospection then "--enable-introspection" else "--disable-introspection")
+  ] ++ lib.optional (!doCheck) "--disable-test";
+
+  makeFlags = [
+    "INTROSPECTION_GIRDIR=${placeholder "out"}/share/gir-1.0"
+    "INTROSPECTION_TYPELIBDIR=${placeholder "out"}/lib/girepository-1.0"
+  ];
+
+  installFlags = [
+    "datadir=${placeholder "out"}/share"
+    "sysconfdir=${placeholder "out"}/etc"
+  ];
+
+  inherit doCheck;
+  checkInputs = [ dbus ];
+  checkPhase = ''
+    runHook preCheck
+
+    # unfortunately this test needs python-dbusmock, but python-dbusmock needs polkit,
+    # leading to a circular dependency
+    substituteInPlace test/Makefile --replace polkitbackend ""
+
+    # 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'
+
+    runHook postCheck
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.freedesktop.org/wiki/Software/polkit";
+    description = "A toolkit for defining and handling the policy that allows unprivileged processes to speak to privileged processes";
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
+    maintainers = teams.freedesktop.members ++ (with maintainers; [ ]);
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/polkit/system_bus.conf b/nixpkgs/pkgs/development/libraries/polkit/system_bus.conf
new file mode 100644
index 000000000000..435b4740a2f7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/polkit/system_bus.conf
@@ -0,0 +1,58 @@
+<!DOCTYPE busconfig PUBLIC "-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN"
+ "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
+<busconfig>
+  <!-- Our well-known bus type, do not change this -->
+  <type>system</type>
+
+  <!-- Fork into daemon mode -->
+  <fork/>
+
+  <!-- Enable logging to syslog -->
+  <syslog/>
+
+  <!-- Only allow socket-credentials-based authentication -->
+  <auth>EXTERNAL</auth>
+
+  <!-- Only listen on a local socket. (abstract=/path/to/socket 
+       means use abstract namespace, don't really create filesystem 
+       file; only Linux supports this. Use path=/whatever on other 
+       systems.) -->
+  <listen>unix:path=/tmp/system_bus_socket</listen>
+
+  <policy context="default">
+    <!-- All users can connect to system bus -->
+    <allow user="*"/>
+
+    <!-- Holes must be punched in service configuration files for
+         name ownership and sending method calls -->
+    <deny own="*"/>
+    <deny send_type="method_call"/>
+
+    <!-- Signals and reply messages (method returns, errors) are allowed
+         by default -->
+    <allow send_type="signal"/>
+    <allow send_requested_reply="true" send_type="method_return"/>
+    <allow send_requested_reply="true" send_type="error"/>
+
+    <!-- All messages may be received by default -->
+    <allow receive_type="method_call"/>
+    <allow receive_type="method_return"/>
+    <allow receive_type="error"/>
+    <allow receive_type="signal"/>
+
+    <!-- Allow anyone to talk to the message bus -->
+    <allow send_destination="org.freedesktop.DBus"
+           send_interface="org.freedesktop.DBus" />
+    <allow send_destination="org.freedesktop.DBus"
+           send_interface="org.freedesktop.DBus.Introspectable"/>
+    <!-- But disallow some specific bus services -->
+    <deny send_destination="org.freedesktop.DBus"
+          send_interface="org.freedesktop.DBus"
+          send_member="UpdateActivationEnvironment"/>
+    <deny send_destination="org.freedesktop.DBus"
+          send_interface="org.freedesktop.DBus.Debug.Stats"/>
+    <deny send_destination="org.freedesktop.DBus"
+          send_interface="org.freedesktop.systemd1.Activator"/>
+  </policy>
+
+</busconfig>
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..cdfd376add1c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/poly2tri-c/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv
+, fetchFromGitLab
+, autoreconfHook
+, pkg-config
+, glib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "poly2tri-c";
+  version = "0.1.0";
+
+  outputs = [ "bin" "out" "dev" ];
+
+  src = fetchFromGitLab {
+    domain = "gitlab.gnome.org";
+    owner = "jtojnar";
+    repo = pname;
+    rev = "p2tc-${version}";
+    sha256 = "158vm3wqfxs22b74kqc4prlvjny38qqm3kz5wrgasmx0qciwh0g8";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+  ];
+
+  buildInputs = [
+    glib
+  ];
+
+  NIX_CFLAGS_COMPILE = [
+    "--std=gnu99"
+    "-Wno-error"
+  ];
+
+  meta = with 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 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
new file mode 100644
index 000000000000..e46da53f68dc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/poppler/0.61.nix
@@ -0,0 +1,94 @@
+{ stdenv
+, lib
+, fetchurl
+, fetchpatch
+, cairo
+, cmake
+, curl
+, fontconfig
+, freetype
+, lcms
+, libiconv
+, libintl
+, libjpeg
+, ninja
+, openjpeg
+, pkg-config
+, zlib
+, withData ? true, poppler_data
+, qt5Support ? false, qtbase ? null
+, introspectionSupport ? false, gobject-introspection ? null
+, utils ? false
+, minimal ? false, suffix ? "glib"
+}:
+
+let
+  version = "0.61.1";
+  mkFlag = optset: flag: "-DENABLE_${flag}=${if optset then "on" else "off"}";
+in
+stdenv.mkDerivation rec {
+  pname = "poppler-${suffix}";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://poppler.freedesktop.org/poppler-${version}.tar.xz";
+    sha256 = "1afdrxxkaivvviazxkg5blsf2x24sjkfj92ib0d3q5pm8dihjrhj";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  patches = [
+    # Fix internal crash: a negative number that should not be
+    (fetchpatch {
+      name = "CVE-2018-13988";
+      url = "https://cgit.freedesktop.org/poppler/poppler/patch/?id=004e3c10df0abda214f0c293f9e269fdd979c5ee";
+      sha256 = "1l8713s57xc6g81bldw934rsfm140fqc7ggd50ha5mxdl1b3app2";
+    })
+    # Fix internal crash: a negative number that should not be (not the above!)
+    ./0.61-CVE-2019-9959.patch
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    ninja
+    pkg-config
+  ];
+
+  buildInputs = [
+    libiconv
+    libintl
+  ]
+  ++ lib.optional withData poppler_data;
+
+  # TODO: reduce propagation to necessary libs
+  propagatedBuildInputs = with lib;
+    [ zlib freetype fontconfig libjpeg openjpeg ]
+    ++ optionals (!minimal) [ cairo lcms curl ]
+    ++ optional qt5Support qtbase
+    ++ optional introspectionSupport gobject-introspection;
+
+  # Not sure when and how to pass it.  It seems an upstream bug anyway.
+  CXXFLAGS = lib.optionalString stdenv.cc.isClang "-std=c++11";
+
+  cmakeFlags = [
+    (mkFlag true "XPDF_HEADERS")
+    (mkFlag (!minimal) "GLIB")
+    (mkFlag (!minimal) "CPP")
+    (mkFlag (!minimal) "LIBCURL")
+    (mkFlag utils "UTILS")
+    (mkFlag qt5Support "QT5")
+  ];
+
+  dontWrapQtApps = true;
+
+  meta = with lib; {
+    homepage = "https://poppler.freedesktop.org/";
+    description = "A PDF rendering library";
+    longDescription = ''
+      Poppler is a PDF rendering library based on the xpdf-3.0 code base.
+    '';
+    license = licenses.gpl2Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ ttuegel ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/poppler/default.nix b/nixpkgs/pkgs/development/libraries/poppler/default.nix
new file mode 100644
index 000000000000..08ca1456ea8f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/poppler/default.nix
@@ -0,0 +1,113 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchpatch
+, cairo
+, cmake
+, pcre
+, boost
+, cups-filters
+, curl
+, fontconfig
+, freetype
+, inkscape
+, lcms
+, libiconv
+, libintl
+, libjpeg
+, ninja
+, openjpeg
+, pkg-config
+, scribusUnstable
+, texlive
+, zlib
+, withData ? true, poppler_data
+, qt5Support ? false, qtbase ? null
+, introspectionSupport ? false, gobject-introspection ? null
+, utils ? false, nss ? null
+, minimal ? false
+, suffix ? "glib"
+}:
+
+let
+  mkFlag = optset: flag: "-DENABLE_${flag}=${if optset then "on" else "off"}";
+in
+stdenv.mkDerivation rec {
+  pname = "poppler-${suffix}";
+  version = "21.06.1"; # beware: updates often break cups-filters build, check texlive and scribusUnstable too!
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "https://poppler.freedesktop.org/poppler-${version}.tar.xz";
+    sha256 = "sha256-hrCeWgLeQAgaORbvhxHFEo6vSx/FnV+H0Oxm8E9ZXbQ=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    ninja
+    pkg-config
+  ];
+
+  buildInputs = [
+    boost
+    pcre
+    libiconv
+    libintl
+  ] ++ lib.optional withData [
+    poppler_data
+  ];
+
+  # TODO: reduce propagation to necessary libs
+  propagatedBuildInputs = [
+    zlib
+    freetype
+    fontconfig
+    libjpeg
+    openjpeg
+  ] ++ lib.optionals (!minimal) [
+    cairo
+    lcms
+    curl
+    nss
+  ] ++ lib.optionals qt5Support [
+    qtbase
+  ] ++ lib.optionals introspectionSupport [
+    gobject-introspection
+  ];
+
+  cmakeFlags = [
+    (mkFlag true "UNSTABLE_API_ABI_HEADERS") # previously "XPDF_HEADERS"
+    (mkFlag (!minimal) "GLIB")
+    (mkFlag (!minimal) "CPP")
+    (mkFlag (!minimal) "LIBCURL")
+    (mkFlag utils "UTILS")
+    (mkFlag qt5Support "QT5")
+  ];
+
+  dontWrapQtApps = true;
+
+  # Workaround #54606
+  preConfigure = lib.optionalString stdenv.isDarwin ''
+    sed -i -e '1i cmake_policy(SET CMP0025 NEW)' CMakeLists.txt
+  '';
+
+  passthru = {
+    tests = {
+      # These depend on internal poppler code that frequently changes.
+      inherit inkscape cups-filters texlive scribusUnstable;
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://poppler.freedesktop.org/";
+    description = "A PDF rendering library";
+    longDescription = ''
+      Poppler is a PDF rendering library based on the xpdf-3.0 code base. In
+      addition it provides a number of tools that can be installed separately.
+    '';
+    license = licenses.gpl2Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ ttuegel ] ++ teams.freedesktop.members;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/popt/1.16-cygwin.patch b/nixpkgs/pkgs/development/libraries/popt/1.16-cygwin.patch
new file mode 100644
index 000000000000..9c084f0b8eaa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/popt/1.16-cygwin.patch
@@ -0,0 +1,11 @@
+--- origsrc/poptconfig.c	2009-05-20 08:18:07.000000000 -0500
++++ src/poptconfig.c	2012-03-29 18:13:46.869286100 -0500
+@@ -42,7 +42,7 @@ extern int glob_pattern_p (const char *_
+ /*@=declundef =exportheader =incondefs =protoparammatch =redecl =type @*/
+ #endif	/* __LCLINT__ */
+ 
+-#if !defined(__GLIBC__)
++#if !defined(__GLIBC__) && !defined(__CYGWIN__)
+ /* Return nonzero if PATTERN contains any metacharacters.
+    Metacharacters can be quoted with backslashes if QUOTE is nonzero.  */
+ static int
diff --git a/nixpkgs/pkgs/development/libraries/popt/1.16-vpath.patch b/nixpkgs/pkgs/development/libraries/popt/1.16-vpath.patch
new file mode 100644
index 000000000000..4cfa1c8fb4db
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/popt/1.16-vpath.patch
@@ -0,0 +1,34 @@
+--- origsrc/Doxyfile.in	2008-04-26 16:57:32.000000000 -0500
++++ src/Doxyfile.in	2012-03-29 18:15:56.649709100 -0500
+@@ -460,14 +460,14 @@ WARN_LOGFILE           =
+ # with spaces.
+ 
+ INPUT                  = \
+-                        ./popt.c \
+-                        ./popt.h \
+-                        ./poptconfig.c \
+-                        ./popthelp.c \
+-                        ./poptint.c \
+-                        ./poptint.h \
+-                        ./poptparse.c \
+-			./system.h
++                        @srcdir@/popt.c \
++                        @srcdir@/popt.h \
++                        @srcdir@/poptconfig.c \
++                        @srcdir@/popthelp.c \
++                        @srcdir@/poptint.c \
++                        @srcdir@/poptint.h \
++                        @srcdir@/poptparse.c \
++			@srcdir@/system.h
+ 
+ # If the value of the INPUT tag contains directories, you can use the 
+ # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 
+@@ -658,7 +658,7 @@ HTML_HEADER            =
+ # each generated HTML page. If it is left blank doxygen will generate a 
+ # standard footer.
+ 
+-HTML_FOOTER            = footer_no_timestamp.html
++HTML_FOOTER            = @srcdir@/footer_no_timestamp.html
+ 
+ # The HTML_STYLESHEET tag can be used to specify a user-defined cascading 
+ # style sheet that is used by each HTML page. It can be used to 
diff --git a/nixpkgs/pkgs/development/libraries/popt/default.nix b/nixpkgs/pkgs/development/libraries/popt/default.nix
new file mode 100644
index 000000000000..307408e4db1d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/popt/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "popt";
+  version = "1.18";
+
+  src = fetchurl {
+    url = "https://ftp.osuosl.org/pub/rpm/popt/releases/popt-1.x/popt-${version}.tar.gz";
+    sha256 = "1lf5zlj5rbg6s4bww7hbhpca97prgprnarx978vcwa0bl81vqnai";
+  };
+
+  patches = lib.optionals stdenv.isCygwin [
+    ./1.16-cygwin.patch
+    ./1.16-vpath.patch
+  ];
+
+  doCheck = false; # fails
+
+  meta = with lib; {
+    homepage = "https://github.com/rpm-software-management/popt";
+    description = "Command line option parsing library";
+    maintainers = with maintainers; [ qyliss ];
+    license = licenses.mit;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/portaudio/default.nix b/nixpkgs/pkgs/development/libraries/portaudio/default.nix
new file mode 100644
index 000000000000..9a43d5a921e5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/portaudio/default.nix
@@ -0,0 +1,54 @@
+{ lib
+, stdenv
+, fetchurl
+, alsa-lib
+, pkg-config
+, AudioUnit
+, AudioToolbox
+, CoreAudio
+, CoreServices
+, Carbon }:
+
+stdenv.mkDerivation rec {
+  pname = "portaudio";
+  version =  "190700_20210406";
+
+  src = fetchurl {
+    url = "http://files.portaudio.com/archives/pa_stable_v${version}.tgz";
+    sha256 = "1vrdrd42jsnffh6rq8ap2c6fr4g9fcld89z649fs06bwqx1bzvs7";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = lib.optional (!stdenv.isDarwin) alsa-lib;
+
+  configureFlags = [ "--disable-mac-universal" "--enable-cxx" ];
+
+  postConfigure = ''
+    substituteInPlace Makefile --replace "-Werror" ""
+  '';
+
+  propagatedBuildInputs = lib.optionals stdenv.isDarwin [ AudioUnit AudioToolbox CoreAudio CoreServices Carbon ];
+
+  # not sure why, but all the headers seem to be installed by the make install
+  installPhase = ''
+    make install
+  '' + lib.optionalString (!stdenv.isDarwin) ''
+    # fixup .pc file to find alsa library
+    sed -i "s|-lasound|-L${alsa-lib.out}/lib -lasound|" "$out/lib/pkgconfig/"*.pc
+  '' + lib.optionalString stdenv.isDarwin ''
+    cp include/pa_mac_core.h $out/include/pa_mac_core.h
+  '';
+
+  meta = with lib; {
+    description = "Portable cross-platform Audio API";
+    homepage    = "http://www.portaudio.com/";
+    # Not exactly a bsd license, but alike
+    license     = licenses.mit;
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.unix;
+  };
+
+  passthru = {
+    api_version = 19;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/portmidi/default.nix b/nixpkgs/pkgs/development/libraries/portmidi/default.nix
new file mode 100644
index 000000000000..2b8f006a7558
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/portmidi/default.nix
@@ -0,0 +1,84 @@
+{ lib, stdenv, fetchurl, unzip, cmake, /*jdk,*/ alsa-lib, Carbon, CoreAudio, CoreFoundation, CoreMIDI, CoreServices }:
+
+stdenv.mkDerivation rec {
+  pname = "portmidi";
+  version = "234";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/portmedia/portmedia-code-r${version}.zip";
+    sha256 = "1g7i8hgarihycadbgy2f7lifiy5cbc0mcrcazmwnmbbh1bqx6dyp";
+  };
+
+  prePatch = ''
+    cd portmidi/trunk
+  '';
+
+  cmakeFlags = let
+    #base = "${jdk}/jre/lib/${jdk.architecture}";
+  in [
+    "-DPORTMIDI_ENABLE_JAVA=0"
+    /* TODO: Fix Java support.
+    "-DJAVA_AWT_LIBRARY=${base}/libawt.so"
+    "-DJAVA_JVM_LIBRARY=${base}/server/libjvm.so"
+    */
+    "-DCMAKE_ARCHIVE_OUTPUT_DIRECTORY=Release"
+    "-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=Release"
+    "-DCMAKE_RUNTIME_OUTPUT_DIRECTORY=Release"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "-DCMAKE_OSX_ARCHITECTURES=${if stdenv.isAarch64 then "arm64" else "x86_64"}"
+    "-DCOREAUDIO_LIB=${CoreAudio}"
+    "-DCOREFOUNDATION_LIB=${CoreFoundation}"
+    "-DCOREMIDI_LIB=${CoreMIDI}"
+    "-DCORESERVICES_LIB=${CoreServices}"
+  ];
+
+  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin [
+    "-framework CoreAudio"
+    "-framework CoreFoundation"
+    "-framework CoreMIDI"
+    "-framework CoreServices"
+  ];
+
+  patches = [
+    # XXX: This is to deactivate Java support.
+    (fetchurl {
+      url = "https://raw.github.com/Rogentos/argent-gentoo/master/media-libs/portmidi/files/portmidi-217-cmake-libdir-java-opts.patch";
+      sha256 = "1jbjwan61iqq9fqfpq2a4fd30k3clg7a6j0gfgsw87r8c76kqf6h";
+    })
+  ] ++ lib.optionals stdenv.isDarwin [
+    # Remove hardcoded variables so we can set them properly
+    ./remove-darwin-variables.diff
+  ];
+
+  postPatch = ''
+    sed -i -e 's|/usr/local/|'"$out"'|' -e 's|/usr/share/|'"$out"'/share/|' \
+      pm_common/CMakeLists.txt pm_dylib/CMakeLists.txt pm_java/CMakeLists.txt
+    sed -i \
+        -e 's|-classpath .|-classpath '"$(pwd)"'/pm_java|' \
+        -e 's|pmdefaults/|'"$(pwd)"'/pm_java/&|g' \
+        -e 's|jportmidi/|'"$(pwd)"'/pm_java/&|g' \
+        -e 's/WORKING_DIRECTORY pm_java//' \
+        pm_java/CMakeLists.txt
+  '';
+
+  postInstall = let ext = stdenv.hostPlatform.extensions.sharedLibrary; in ''
+    ln -s libportmidi${ext} "$out/lib/libporttime${ext}"
+  '';
+
+  nativeBuildInputs = [ unzip cmake ];
+  buildInputs = lib.optionals stdenv.isLinux [
+    alsa-lib
+  ] ++ lib.optionals stdenv.isDarwin [
+    Carbon CoreAudio CoreFoundation CoreMIDI CoreServices
+  ];
+
+  hardeningDisable = [ "format" ];
+
+  meta = with lib; {
+    homepage = "http://portmedia.sourceforge.net/portmidi/";
+    description = "Platform independent library for MIDI I/O";
+    license = licenses.mit;
+    maintainers = with maintainers; [ angustrau ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/portmidi/remove-darwin-variables.diff b/nixpkgs/pkgs/development/libraries/portmidi/remove-darwin-variables.diff
new file mode 100644
index 000000000000..15ed874f172f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/portmidi/remove-darwin-variables.diff
@@ -0,0 +1,52 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 4919b78..758eccb 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -36,8 +36,6 @@ set(CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")
+ set(CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")
+ set(CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO "" CACHE INTERNAL "Unused")
+ 
+-set(CMAKE_OSX_ARCHITECTURES i386 ppc x86_64 CACHE STRING "change to needed architecture for a smaller library" FORCE)
+-
+ PROJECT(portmidi)
+ 
+ if(UNIX)
+diff --git a/pm_common/CMakeLists.txt b/pm_common/CMakeLists.txt
+index cbeeade..f765430 100644
+--- a/pm_common/CMakeLists.txt
++++ b/pm_common/CMakeLists.txt
+@@ -22,7 +22,7 @@ else(APPLE OR WIN32)
+ endif(APPLE OR WIN32)
+ 
+ if(APPLE)
+-  set(CMAKE_OSX_SYSROOT /Developer/SDKs/MacOSX10.6.sdk CACHE 
++  set(CMAKE_OSX_SYSROOT / CACHE 
+       PATH "-isysroot parameter for compiler")
+   set(CMAKE_C_FLAGS "-mmacosx-version-min=10.6" CACHE 
+       STRING "needed in conjunction with CMAKE_OSX_SYSROOT" FORCE)
+@@ -54,10 +54,6 @@ if(UNIX)
+ 
+     include_directories(${CMAKE_OSX_SYSROOT}/Developer/Headers/FlatCarbon)
+     set(FRAMEWORK_PATH ${CMAKE_OSX_SYSROOT}/System/Library/Frameworks)
+-    set(COREAUDIO_LIB "${FRAMEWORK_PATH}/CoreAudio.framework")
+-    set(COREFOUNDATION_LIB "${FRAMEWORK_PATH}/CoreFoundation.framework")
+-    set(COREMIDI_LIB "${FRAMEWORK_PATH}/CoreMIDI.framework")
+-    set(CORESERVICES_LIB "${FRAMEWORK_PATH}/CoreServices.framework")
+     set(PM_NEEDED_LIBS ${COREAUDIO_LIB} ${COREFOUNDATION_LIB}
+                              ${COREMIDI_LIB} ${CORESERVICES_LIB}
+         CACHE INTERNAL "")
+diff --git a/pm_dylib/CMakeLists.txt b/pm_dylib/CMakeLists.txt
+index f693dd6..1dc5cd6 100644
+--- a/pm_dylib/CMakeLists.txt
++++ b/pm_dylib/CMakeLists.txt
+@@ -49,10 +49,6 @@ if(UNIX)
+ 
+     include_directories(${CMAKE_OSX_SYSROOT}/Developer/Headers/FlatCarbon)
+     set(FRAMEWORK_PATH ${CMAKE_OSX_SYSROOT}/System/Library/Frameworks)
+-    set(COREAUDIO_LIB "${FRAMEWORK_PATH}/CoreAudio.framework")
+-    set(COREFOUNDATION_LIB "${FRAMEWORK_PATH}/CoreFoundation.framework")
+-    set(COREMIDI_LIB "${FRAMEWORK_PATH}/CoreMIDI.framework")
+-    set(CORESERVICES_LIB "${FRAMEWORK_PATH}/CoreServices.framework")
+     set(PM_NEEDED_LIBS ${COREAUDIO_LIB} ${COREFOUNDATION_LIB}
+                              ${COREMIDI_LIB} ${CORESERVICES_LIB}
+         CACHE INTERNAL "")
diff --git a/nixpkgs/pkgs/development/libraries/ppl/default.nix b/nixpkgs/pkgs/development/libraries/ppl/default.nix
new file mode 100644
index 000000000000..a94cf9e38d0e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ppl/default.nix
@@ -0,0 +1,61 @@
+{ fetchurl, fetchpatch, lib, stdenv, gmpxx, perl, gnum4 }:
+
+let version = "1.2"; in
+
+stdenv.mkDerivation {
+  pname = "ppl";
+  inherit version;
+
+  src = fetchurl {
+    url = "http://bugseng.com/products/ppl/download/ftp/releases/${version}/ppl-${version}.tar.bz2";
+    sha256 = "1wgxcbgmijgk11df43aiqfzv31r3bkxmgb4yl68g21194q60nird";
+  };
+
+  patches = [(fetchpatch {
+    name = "clang5-support.patch";
+    url = "https://git.sagemath.org/sage.git/plain/build/pkgs/ppl/patches/clang5-support.patch?h=9.2";
+    sha256 = "1zj90hm25pkgvk4jlkfzh18ak9b98217gbidl3731fdccbw6hr87";
+  })];
+
+  nativeBuildInputs = [ perl gnum4 ];
+  propagatedBuildInputs = [ gmpxx ];
+
+  configureFlags = [ "--disable-watchdog" ] ++
+    lib.optionals stdenv.isDarwin [
+      "CPPFLAGS=-fexceptions"
+      "--disable-ppl_lcdd" "--disable-ppl_lpsol" "--disable-ppl_pips"
+    ];
+
+  # Beware!  It took ~6 hours to compile PPL and run its tests on a 1.2 GHz
+  # x86_64 box.  Nevertheless, being a dependency of GCC, it probably ought
+  # to be tested.
+  doCheck = false;
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "The Parma Polyhedra Library";
+
+    longDescription = ''
+      The Parma Polyhedra Library (PPL) provides numerical abstractions
+      especially targeted at applications in the field of analysis and
+      verification of complex systems.  These abstractions include convex
+      polyhedra, defined as the intersection of a finite number of (open or
+      closed) halfspaces, each described by a linear inequality (strict or
+      non-strict) with rational coefficients; some special classes of
+      polyhedra shapes that offer interesting complexity/precision tradeoffs;
+      and grids which represent regularly spaced points that satisfy a set of
+      linear congruence relations.  The library also supports finite
+      powersets and products of (any kind of) polyhedra and grids and a mixed
+      integer linear programming problem solver using an exact-arithmetic
+      version of the simplex algorithm.
+    '';
+
+    homepage = "http://bugseng.com/products/ppl/";
+
+    license = lib.licenses.gpl3Plus;
+
+    maintainers = [ ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/precice/default.nix b/nixpkgs/pkgs/development/libraries/precice/default.nix
new file mode 100644
index 000000000000..68084eb52b3b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/precice/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, cmake, gcc, boost, eigen, libxml2, mpi, python3, petsc }:
+
+stdenv.mkDerivation rec {
+  pname = "precice";
+  version = "2.2.1";
+
+  src = fetchFromGitHub {
+    owner = "precice";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-XEdrKhxG0dhsfJH6glrzc+JZeCgPEVIswj0ofP838lg=";
+  };
+
+  cmakeFlags = [
+    "-DPRECICE_PETScMapping=OFF"
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DPYTHON_LIBRARIES=${python3.libPrefix}"
+    "-DPYTHON_INCLUDE_DIR=${python3}/include/${python3.libPrefix}"
+  ];
+
+  NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin [ "-D_GNU_SOURCE" ];
+
+  nativeBuildInputs = [ cmake gcc ];
+  buildInputs = [ boost eigen libxml2 mpi python3 python3.pkgs.numpy ];
+
+  meta = {
+    description = "preCICE stands for Precise Code Interaction Coupling Environment";
+    license = with lib.licenses; [ gpl3 ];
+    homepage = "https://www.precice.org/";
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ Scriptkiddi ];
+  };
+}
+
+
diff --git a/nixpkgs/pkgs/development/libraries/presage/default.nix b/nixpkgs/pkgs/development/libraries/presage/default.nix
new file mode 100644
index 000000000000..df15e73f73cf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/presage/default.nix
@@ -0,0 +1,69 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchpatch
+, autoreconfHook
+, dbus
+, doxygen
+, fontconfig
+, gettext
+, graphviz
+, help2man
+, pkg-config
+, sqlite
+, tinyxml
+, cppunit
+}:
+
+stdenv.mkDerivation rec {
+  pname = "presage";
+  version = "0.9.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/presage/presage/${version}/presage-${version}.tar.gz";
+    sha256 = "0rm3b3zaf6bd7hia0lr1wyvi1rrvxkn7hg05r5r1saj0a3ingmay";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://git.alpinelinux.org/aports/plain/community/presage/gcc6.patch";
+      sha256 = "0243nx1ygggmsly7057vndb4pkjxg9rpay5gyqqrq9jjzjzh63dj";
+    })
+    ./fixed-cppunit-detection.patch
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    doxygen
+    fontconfig
+    gettext
+    graphviz
+    help2man
+    pkg-config
+  ];
+
+  preBuild = ''
+    export FONTCONFIG_FILE=${fontconfig.out}/etc/fonts/fonts.conf
+  '';
+
+  buildInputs = [
+    dbus
+    sqlite
+    tinyxml
+  ];
+
+  checkInputs = [
+    cppunit
+  ];
+
+  doCheck = true;
+
+  checkTarget = "check";
+
+  meta = with lib; {
+    description = "An intelligent predictive text entry system";
+    homepage = "https://presage.sourceforge.io/";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ dotlambda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/presage/fixed-cppunit-detection.patch b/nixpkgs/pkgs/development/libraries/presage/fixed-cppunit-detection.patch
new file mode 100644
index 000000000000..27238d2956d1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/presage/fixed-cppunit-detection.patch
@@ -0,0 +1,46 @@
+From 5624aa156c551ab2b81bb86279844397ed690653 Mon Sep 17 00:00:00 2001
+From: Matteo Vescovi <matteo.vescovi@yahoo.co.uk>
+Date: Sun, 21 Jan 2018 17:17:12 +0000
+Subject: [PATCH] Fixed cppunit detection.
+
+---
+ configure.ac | 16 +++++++++++-----
+ 1 file changed, 11 insertions(+), 5 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index a02e9f1..1538a51 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -204,10 +204,16 @@ AM_CONDITIONAL([USE_SQLITE], [test "x$use_sqlite" = "xyes"])
+ dnl ==================
+ dnl Checks for CppUnit
+ dnl ==================
+-AM_PATH_CPPUNIT([1.9.6],
+-                [],
+-                [AC_MSG_WARN([CppUnit not found. Unit tests will not be built. CppUnit can be obtained from http://cppunit.sourceforge.net.])])
+-AM_CONDITIONAL([HAVE_CPPUNIT], [test "$CPPUNIT_LIBS"])
++PKG_CHECK_MODULES([CPPUNIT],
++                  [cppunit >= 1.9],
++                  [have_cppunit=yes],
++                  [AM_PATH_CPPUNIT([1.9],
++                                   [have_cppunit=yes],
++                                   [AC_MSG_WARN([CppUnit not found. Unit tests will not be built. CppUnit can be obtained from http://cppunit.sourceforge.net.])])
++                  ])
++AC_SUBST([CPPUNIT_CFLAGS])
++AC_SUBST([CPPUNIT_LIBS])
++AM_CONDITIONAL([HAVE_CPPUNIT], [test "x$have_cppunit" = "xyes"])
+ 
+ 
+ dnl ============================
+@@ -592,7 +598,7 @@ then
+ else
+     build_demo_application="no"
+ fi
+-if test "$CPPUNIT_LIBS"
++if test "x$have_cppunit" = "xyes"
+ then
+     build_unit_tests="yes"
+ else
+-- 
+2.31.1
+
diff --git a/nixpkgs/pkgs/development/libraries/prime-server/default.nix b/nixpkgs/pkgs/development/libraries/prime-server/default.nix
new file mode 100644
index 000000000000..4f30a9f005c9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/prime-server/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
+, curl, zeromq, czmq, libsodium }:
+
+stdenv.mkDerivation rec {
+  pname = "prime-server";
+  version = "0.7.0";
+
+  src = fetchFromGitHub {
+    owner = "kevinkreiser";
+    repo = "prime_server";
+    rev = version;
+    sha256 = "0izmmvi3pvidhlrgfpg4ccblrw6fil3ddxg5cfxsz4qbh399x83w";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ curl zeromq czmq libsodium ];
+
+  # https://github.com/kevinkreiser/prime_server/issues/95
+  NIX_CFLAGS_COMPILE = [ "-Wno-error=unused-variable" ];
+
+  meta = with lib; {
+    description = "Non-blocking (web)server API for distributed computing and SOA based on zeromq";
+    homepage = "https://github.com/kevinkreiser/prime_server";
+    license = licenses.bsd2;
+    maintainers = [ maintainers.Thra11 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/prison/default.nix b/nixpkgs/pkgs/development/libraries/prison/default.nix
new file mode 100644
index 000000000000..4275622c24f4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/prison/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, cmake, qrencode, qt4, libdmtx }:
+
+let v = "1.0"; in
+
+stdenv.mkDerivation rec {
+  name = "prison-${v}";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/prison/${v}/src/${name}.tar.gz";
+    sha256 = "08hkzzda36jpdywjqlyzcvli7cx17h4l9yffzsdnhdd788n28krr";
+  };
+
+  buildInputs = [ qt4 qrencode libdmtx ];
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = {
+    description = "Qt4 library for QR-codes";
+    license = lib.licenses.mit;
+    inherit (qt4.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/proj-datumgrid/default.nix b/nixpkgs/pkgs/development/libraries/proj-datumgrid/default.nix
new file mode 100644
index 000000000000..93e415f62699
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/proj-datumgrid/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  name = "proj-datumgrid";
+  version = "world-1.0";
+
+  src = fetchFromGitHub {
+    owner = "OSGeo";
+    repo = "proj-datumgrid";
+    rev = version;
+    sha256 = "132wp77fszx33wann0fjkmi1isxvsb0v9iw0gd9sxapa9h6hf3am";
+  };
+
+  sourceRoot = "source/scripts";
+
+  buildPhase = ''
+    $CC nad2bin.c -o nad2bin
+  '';
+
+  installPhase = ''
+    mkdir -p $out/bin
+    cp nad2bin $out/bin/
+  '';
+
+  meta = with lib; {
+    description = "Repository for proj datum grids";
+    homepage = "https://proj4.org";
+    license = licenses.mit;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/proj/default.nix b/nixpkgs/pkgs/development/libraries/proj/default.nix
new file mode 100644
index 000000000000..f22878ec8290
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/proj/default.nix
@@ -0,0 +1,62 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+, sqlite
+, libtiff
+, curl
+, gtest
+, fetchpatch
+}:
+
+stdenv.mkDerivation rec {
+  pname = "proj";
+  version = "7.2.1";
+
+  src = fetchFromGitHub {
+    owner = "OSGeo";
+    repo = "PROJ";
+    rev = version;
+    sha256 = "0mymvfvs8xggl4axvlj7kc1ksd9g94kaz6w1vdv0x2y5mqk93gx9";
+  };
+
+  patches = [
+    (fetchpatch { # https://github.com/OSGeo/PROJ/issues/2557
+      name = "gie_self_tests-fail.diff"; # included in >= 8.0.1
+      url = "https://github.com/OSGeo/PROJ/commit/6f1a3c4648bf06862dca0b3725cbb3b7ee0284e3.diff";
+      sha256 = "0gapny0a9c3r0x9szjgn86sspjrrf4vwbija77b17w6ci5cq4pdf";
+    })
+  ];
+
+  postPatch = lib.optionalString (version == "7.2.1") ''
+    substituteInPlace CMakeLists.txt \
+      --replace "MAJOR 7 MINOR 2 PATCH 0" "MAJOR 7 MINOR 2 PATCH 1"
+  '';
+
+  outputs = [ "out" "dev"];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [ sqlite libtiff curl ];
+
+  checkInputs = [ gtest ];
+
+  cmakeFlags = [
+    "-DUSE_EXTERNAL_GTEST=ON"
+  ];
+
+  doCheck = stdenv.is64bit;
+
+  preCheck = ''
+    export HOME=$TMPDIR
+  '';
+
+  meta = with lib; {
+    description = "Cartographic Projections Library";
+    homepage = "https://proj4.org";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ vbgl dotlambda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/prometheus-client-c/default.nix b/nixpkgs/pkgs/development/libraries/prometheus-client-c/default.nix
new file mode 100644
index 000000000000..9b18b25c7268
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/prometheus-client-c/default.nix
@@ -0,0 +1,71 @@
+{ lib, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, libmicrohttpd
+}:
+let
+  build =
+    { pname
+    , subdir
+    , buildInputs ? [ ]
+    , description
+    }:
+    stdenv.mkDerivation rec {
+      inherit pname;
+      version = "0.1.1";
+
+      src = fetchFromGitHub {
+        owner = "digitalocean";
+        repo = "prometheus-client-c";
+        rev = "v${version}";
+        sha256 = "0g69s24xwrv5974acshrhnp6i8rpby8c6bhz15m3d8kpgjw3cm8f";
+      };
+
+      nativeBuildInputs = [ cmake ];
+      inherit buildInputs;
+
+      # These patches will be in 0.1.2
+      patches = [
+        # Required so CMAKE_INSTALL_PREFIX is honored, otherwise it
+        # installs headers in /usr/include (absolute)
+        (
+          fetchpatch {
+            url = "https://github.com/digitalocean/prometheus-client-c/commit/5fcedeb506b7d47dd7bab35797f2c3f23db6fe10.patch";
+            sha256 = "10hzg8v5jcgxz224kdq0nha9vs78wz098b0ys7gig2iwgrg018fy";
+          }
+        )
+        (
+          fetchpatch {
+            url = "https://github.com/digitalocean/prometheus-client-c/commit/0c15e7e45ad0c3726593591fdd7d8f2fde845fe3.patch";
+            sha256 = "06899v1xz3lpsdxww4p3q7pv8nrymnibncdc472056znr5fidlp0";
+          }
+        )
+      ];
+
+      preConfigure = ''
+        cd ${subdir}
+      '';
+
+      meta = {
+        homepage = "https://github.com/digitalocean/prometheus-client-c/";
+        inherit description;
+        platforms = lib.platforms.unix;
+        license = lib.licenses.asl20;
+        maintainers = [ lib.maintainers.cfsmp3 ];
+      };
+    };
+in
+rec {
+  libprom = build {
+    pname = "libprom";
+    subdir = "prom";
+    description = "A Prometheus Client in C";
+  };
+  libpromhttp = build {
+    pname = "libpromhttp";
+    subdir = "promhttp";
+    buildInputs = [ libmicrohttpd libprom ];
+    description = "A Prometheus HTTP Endpoint in C";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/prometheus-cpp/default.nix b/nixpkgs/pkgs/development/libraries/prometheus-cpp/default.nix
new file mode 100644
index 000000000000..173ee6d2e09d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/prometheus-cpp/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, gbenchmark
+, gtest
+, civetweb
+, zlib
+, curl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "prometheus-cpp";
+  version = "0.9.0";
+
+  src = fetchFromGitHub {
+    owner = "jupp0r";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1pjz29ywzfg3blhg2v8fn7gjvq46k3bqn7y0xvmn468ixxhv21fi";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ gbenchmark civetweb gtest zlib curl ];
+
+  strictDeps = true;
+
+  cmakeFlags = [
+    "-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";
+
+  postInstall = ''
+    mkdir -p $out/lib/pkgconfig
+    substituteAll ${./prometheus-cpp.pc.in} $out/lib/pkgconfig/prometheus-cpp.pc
+  '';
+
+  meta = {
+    description = "Prometheus Client Library for Modern C++";
+    homepage = "https://github.com/jupp0r/prometheus-cpp";
+    license = [ lib.licenses.mit ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/prometheus-cpp/prometheus-cpp.pc.in b/nixpkgs/pkgs/development/libraries/prometheus-cpp/prometheus-cpp.pc.in
new file mode 100644
index 000000000000..c373f4153b55
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/prometheus-cpp/prometheus-cpp.pc.in
@@ -0,0 +1,10 @@
+prefix=@out@
+includedir=${prefix}/include
+libdir=${prefix}/lib
+
+Name: prometheus-cpp
+Description: Prometheus Client Library for Modern C++
+URL: https://github.com/jupp0r/prometheus-cpp
+Version: @version@
+Cflags: -isystem${includedir}
+Libs: -Wl,-rpath,${libdir} -L${libdir} -lprometheus-cpp-core -lprometheus-cpp-pull -lprometheus-cpp-push
diff --git a/nixpkgs/pkgs/development/libraries/properties-cpp/default.nix b/nixpkgs/pkgs/development/libraries/properties-cpp/default.nix
new file mode 100644
index 000000000000..431e6348b3fa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/properties-cpp/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv
+, fetchurl
+, cmake
+, pkg-config
+, gtest
+, doxygen
+, graphviz
+, lcov
+}:
+
+stdenv.mkDerivation rec {
+  pname = "properties-cpp";
+  version = "0.0.1";
+
+  src = let srcver = "${version}+14.10.20140730"; in
+    fetchurl {
+      url = "https://launchpad.net/ubuntu/+archive/primary/+files/${pname}_${srcver}.orig.tar.gz";
+      sha256 = "08vjyv7ibn6jh2ikj5v48kjpr3n6hlkp9qlvdn8r0vpiwzah0m2w";
+    };
+
+  postPatch = ''
+    sed -i "/add_subdirectory(tests)/d" CMakeLists.txt
+  '';
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [ gtest doxygen graphviz lcov ];
+
+  meta = with lib; {
+    homepage = "https://launchpad.net/properties-cpp";
+    description = "A very simple convenience library for handling properties and signals in C++11";
+    license = licenses.lgpl3Only;
+    maintainers = with maintainers; [ edwtjo ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/2.5.nix b/nixpkgs/pkgs/development/libraries/protobuf/2.5.nix
new file mode 100644
index 000000000000..9d7bb38cf3c9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobuf/2.5.nix
@@ -0,0 +1,10 @@
+{ callPackage, fetchurl, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "2.5.0";
+  # make sure you test also -A pythonPackages.protobuf
+  src = fetchurl {
+    url = "http://protobuf.googlecode.com/files/${version}.tar.bz2";
+    sha256 = "0xxn9gxhvsgzz2sgmihzf6pf75clr05mqj6218camwrwajpcbgqk";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/3.1.nix b/nixpkgs/pkgs/development/libraries/protobuf/3.1.nix
new file mode 100644
index 000000000000..91ef87512c84
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobuf/3.1.nix
@@ -0,0 +1,6 @@
+{ callPackage, ... }:
+
+callPackage ./generic-v3.nix {
+  version = "3.1.0";
+  sha256 = "0qlvpsmqgh9nw0k4zrxlxf75pafi3p0ahz99v6761b903y8qyv4i";
+}
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..c5d8b21b1ac4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobuf/3.11.nix
@@ -0,0 +1,6 @@
+{ callPackage, ... }:
+
+callPackage ./generic-v3.nix {
+  version = "3.11.4";
+  sha256 = "00g61f1yd8z5l0z0svmr3hms38ph35lcx2y7hivw6fahslw0l8yw";
+}
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/3.12.nix b/nixpkgs/pkgs/development/libraries/protobuf/3.12.nix
new file mode 100644
index 000000000000..6ea64a023800
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobuf/3.12.nix
@@ -0,0 +1,6 @@
+{ callPackage, ... }:
+
+callPackage ./generic-v3.nix {
+  version = "3.12.4";
+  sha256 = "1gzvnd0g5hmx5ln39w7p4z4qphw87ksgsa1fgbpvi8d0asmwab2p";
+}
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/3.13.nix b/nixpkgs/pkgs/development/libraries/protobuf/3.13.nix
new file mode 100644
index 000000000000..8499ac069e84
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobuf/3.13.nix
@@ -0,0 +1,6 @@
+{ callPackage, ... }:
+
+callPackage ./generic-v3.nix {
+  version = "3.13.0.1";
+  sha256 = "1r3hvbvjjww6pdk0mlg1lym7avxn8851xm8dg98bf4zq4vyrcw12";
+}
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/3.14.nix b/nixpkgs/pkgs/development/libraries/protobuf/3.14.nix
new file mode 100644
index 000000000000..82896b0dadee
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobuf/3.14.nix
@@ -0,0 +1,6 @@
+{ callPackage, ... }:
+
+callPackage ./generic-v3.nix {
+  version = "3.14.0";
+  sha256 = "1k4kkb78kdbz732wsph07v3zy3cz7l1msk2byrfvp0nb02sfl3a4";
+}
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/3.15.nix b/nixpkgs/pkgs/development/libraries/protobuf/3.15.nix
new file mode 100644
index 000000000000..e4783be6a351
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobuf/3.15.nix
@@ -0,0 +1,6 @@
+{ callPackage, ... }:
+
+callPackage ./generic-v3.nix {
+  version = "3.15.8";
+  sha256 = "1q3k8axhq6g8fqczmd6kbgzpdplrrgygppym4x1l99lzhplx9rqv";
+}
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/3.16.nix b/nixpkgs/pkgs/development/libraries/protobuf/3.16.nix
new file mode 100644
index 000000000000..df8d53b9f1c3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobuf/3.16.nix
@@ -0,0 +1,6 @@
+{ callPackage, ... }:
+
+callPackage ./generic-v3.nix {
+  version = "3.16.0";
+  sha256 = "0jc523ys6xh1fk3l52f5mfqxhb4g8aim1js7330v0fdc3fjr8ncf";
+}
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/3.17.nix b/nixpkgs/pkgs/development/libraries/protobuf/3.17.nix
new file mode 100644
index 000000000000..d869b9ce76ef
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobuf/3.17.nix
@@ -0,0 +1,6 @@
+{ callPackage, ... }:
+
+callPackage ./generic-v3.nix {
+  version = "3.17.3";
+  sha256 = "08644kaxhpjs38q5q4fp01yr0wakg1ijha4g3lzp2ifg7y3c465d";
+}
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/3.6.nix b/nixpkgs/pkgs/development/libraries/protobuf/3.6.nix
new file mode 100644
index 000000000000..16decc44e847
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobuf/3.6.nix
@@ -0,0 +1,6 @@
+{ callPackage, ... }:
+
+callPackage ./generic-v3.nix {
+  version = "3.6.1.3";
+  sha256 = "1spj0d4flx6h3phxx3sg9r00yv734hina3365avkcz9brnm089c1";
+}
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/3.7.nix b/nixpkgs/pkgs/development/libraries/protobuf/3.7.nix
new file mode 100644
index 000000000000..9bfb307e3286
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobuf/3.7.nix
@@ -0,0 +1,6 @@
+{ callPackage, ... }:
+
+callPackage ./generic-v3.nix {
+  version = "3.7.1";
+  sha256 = "00zkijvj80bmhlj8290x4bc416mng2dlbzwc4bkvfmbal1fx93m2";
+}
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/3.8.nix b/nixpkgs/pkgs/development/libraries/protobuf/3.8.nix
new file mode 100644
index 000000000000..2ea03643b3ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobuf/3.8.nix
@@ -0,0 +1,6 @@
+{ callPackage, ... }:
+
+callPackage ./generic-v3.nix {
+  version = "3.8.0";
+  sha256 = "0vll02a6k46k720wfh25sl4hdai0130s3ix2l1wh6j1lm9pi7bm8";
+}
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/3.9.nix b/nixpkgs/pkgs/development/libraries/protobuf/3.9.nix
new file mode 100644
index 000000000000..e74d5c527b1d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobuf/3.9.nix
@@ -0,0 +1,6 @@
+{ callPackage, ... }:
+
+callPackage ./generic-v3.nix {
+  version = "3.9.2";
+  sha256 = "080zxa9w1pxp5y05aiwc0c8mlqkkh98wmid4l7m99cliphsd4qnn";
+}
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/generic-v3.nix b/nixpkgs/pkgs/development/libraries/protobuf/generic-v3.nix
new file mode 100644
index 000000000000..6867940d1f23
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobuf/generic-v3.nix
@@ -0,0 +1,60 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook, zlib, gtest, buildPackages
+, version, sha256
+, ...
+}:
+
+let
+mkProtobufDerivation = buildProtobuf: stdenv: stdenv.mkDerivation {
+  pname = "protobuf";
+  inherit version;
+
+  # make sure you test also -A pythonPackages.protobuf
+  src = fetchFromGitHub {
+    owner = "protocolbuffers";
+    repo = "protobuf";
+    rev = "v${version}";
+    inherit sha256;
+  };
+
+  postPatch = ''
+    rm -rf gmock
+    cp -r ${gtest.src}/googlemock gmock
+    cp -r ${gtest.src}/googletest googletest
+    chmod -R a+w gmock
+    chmod -R a+w googletest
+    ln -s ../googletest gmock/gtest
+  '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace src/google/protobuf/testing/googletest.cc \
+      --replace 'tmpnam(b)' '"'$TMPDIR'/foo"'
+  '';
+
+  nativeBuildInputs = [ autoreconfHook buildPackages.which buildPackages.stdenv.cc buildProtobuf ];
+
+  buildInputs = [ zlib ];
+  configureFlags = if buildProtobuf == null then [] else [ "--with-protoc=${buildProtobuf}/bin/protoc" ];
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  dontDisableStatic = true;
+
+  meta = {
+    description = "Google's data interchange format";
+    longDescription =
+      ''Protocol Buffers are a way of encoding structured data in an efficient
+        yet extensible format. Google uses Protocol Buffers for almost all of
+        its internal RPC protocols and file formats.
+      '';
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.unix;
+    homepage = "https://developers.google.com/protocol-buffers/";
+  };
+
+  passthru.version = version;
+};
+in mkProtobufDerivation(if (stdenv.buildPlatform != stdenv.hostPlatform)
+                        then (mkProtobufDerivation null buildPackages.stdenv)
+                        else null) stdenv
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/generic.nix b/nixpkgs/pkgs/development/libraries/protobuf/generic.nix
new file mode 100644
index 000000000000..7d64df436260
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobuf/generic.nix
@@ -0,0 +1,61 @@
+{ lib, stdenv, version, src
+, autoreconfHook, zlib, gtest
+, ...
+}:
+
+stdenv.mkDerivation {
+  pname = "protobuf";
+  inherit version;
+
+  inherit src;
+
+  postPatch = ''
+    rm -rf gtest
+    cp -r ${gtest.src}/googletest gtest
+    chmod -R a+w gtest
+  '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace src/google/protobuf/testing/googletest.cc \
+      --replace 'tmpnam(b)' '"'$TMPDIR'/foo"'
+  '';
+
+  outputs = [ "out" "lib" ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = [ zlib ];
+
+  # The generated C++ code uses static initializers which mutate a global data
+  # structure. This causes problems for an executable when:
+  #
+  # 1) it dynamically links to two libs, both of which contain generated C++ for
+  #    the same proto file, and
+  # 2) the two aforementioned libs both dynamically link to libprotobuf.
+  #
+  # One solution is to statically link libprotobuf, that way the global
+  # variables are not shared; in fact, this is necessary for the python Mesos
+  # binding to not crash, as the python lib contains two C extensions which
+  # both refer to the same proto schema.
+  #
+  # See: https://github.com/NixOS/nixpkgs/pull/19064#issuecomment-255082684
+  #      https://github.com/google/protobuf/issues/1489
+  dontDisableStatic = true;
+  configureFlags = [
+    "CFLAGS=-fPIC"
+    "CXXFLAGS=-fPIC"
+  ];
+
+  doCheck = true;
+
+  meta = {
+    description = "Protocol Buffers - Google's data interchange format";
+    longDescription =
+      '' Protocol Buffers are a way of encoding structured data in an
+         efficient yet extensible format.  Google uses Protocol Buffers for
+         almost all of its internal RPC protocols and file formats.
+      '';
+    license = "mBSD";
+    homepage = "https://developers.google.com/protocol-buffers/";
+    platforms = lib.platforms.unix;
+  };
+
+  passthru.version = version;
+}
diff --git a/nixpkgs/pkgs/development/libraries/protobufc/1.3.nix b/nixpkgs/pkgs/development/libraries/protobufc/1.3.nix
new file mode 100644
index 000000000000..82126727282c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobufc/1.3.nix
@@ -0,0 +1,11 @@
+{ callPackage, fetchFromGitHub, ... } @ args:
+
+callPackage ./generic.nix (args // rec {
+  version = "1.3.3";
+  src = fetchFromGitHub {
+    owner = "protobuf-c";
+    repo = "protobuf-c";
+    rev = "v${version}";
+    sha256 = "13948amsjj9xpa4yl6amlyk3ksr96bbd4ngshh2yzflwcslhg6gv";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/protobufc/generic.nix b/nixpkgs/pkgs/development/libraries/protobufc/generic.nix
new file mode 100644
index 000000000000..b64d75076baf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protobufc/generic.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, src, version
+, autoreconfHook, pkg-config, protobuf, zlib
+, ...
+}:
+
+stdenv.mkDerivation {
+  pname = "protobuf-c";
+  inherit version;
+
+  inherit src;
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ protobuf zlib ];
+
+  meta = with lib; {
+    homepage = "https://github.com/protobuf-c/protobuf-c/";
+    description = "C bindings for Google's Protocol Buffers";
+    license = licenses.bsd2;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/protolock/default.nix b/nixpkgs/pkgs/development/libraries/protolock/default.nix
new file mode 100644
index 000000000000..7d423ac03470
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protolock/default.nix
@@ -0,0 +1,28 @@
+{ lib, buildGoModule, fetchFromGitHub }:
+
+buildGoModule rec {
+  pname = "protolock";
+  version = "0.15.2";
+
+  src = fetchFromGitHub {
+    owner = "nilslice";
+    repo = "protolock";
+    rev = "v${version}";
+    sha256 = "sha256-cKrG8f8cabuGDN1gmBYleXcBqeJksdREiEy63UK/6J0=";
+  };
+
+  vendorSha256 = "sha256-3kRGLZgYcbUQb6S+NrleMNNX0dXrE9Yer3vvqxiP4So=";
+
+  doCheck = false;
+
+  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/prototypejs/default.nix b/nixpkgs/pkgs/development/libraries/prototypejs/default.nix
new file mode 100644
index 000000000000..fd06b49604ad
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/prototypejs/default.nix
@@ -0,0 +1,23 @@
+{ lib, fetchurl, ... }:
+let
+  version = "1.7.3.0";
+in fetchurl {
+  name = "prototype-${version}.js";
+  url = "https://ajax.googleapis.com/ajax/libs/prototype/${version}/prototype.js";
+  sha256 = "0q43vvrsb22h4jvavs1gk3v4ps61yx9k85b5n6q9mxivhmxprg26";
+
+  meta = with lib; {
+    description = "A foundation for ambitious web user interfaces";
+    longDescription = ''
+      Prototype takes the complexity out of client-side web
+      programming. Built to solve real-world problems, it adds
+      useful extensions to the browser scripting environment
+      and provides elegant APIs around the clumsy interfaces
+      of Ajax and the Document Object Model.
+    '';
+    homepage = "http://prototypejs.org/";
+    downloadPage = "http://prototypejs.org/download/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ das_j ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/protozero/default.nix b/nixpkgs/pkgs/development/libraries/protozero/default.nix
new file mode 100644
index 000000000000..6bff5998b56d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/protozero/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "protozero";
+  version = "1.7.0";
+
+  src = fetchFromGitHub {
+    owner = "mapbox";
+    repo = "protozero";
+    rev = "v${version}";
+    sha256 = "0fdihfl5j68wayjjxvpvhvnjq1anzcfnfl09f68wpzbkg3zmhblz";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Minimalistic protocol buffer decoder and encoder in C++";
+    homepage = "https://github.com/mapbox/protozero";
+    license = with licenses; [ bsd2 asl20 ];
+    maintainers = with maintainers; [ das-g ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pslib/default.nix b/nixpkgs/pkgs/development/libraries/pslib/default.nix
new file mode 100644
index 000000000000..b3439b7ee96f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pslib/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchurl, cmake, pkg-config, zlib, libpng, libjpeg, giflib, libtiff
+}:
+
+stdenv.mkDerivation rec {
+  pname = "pslib";
+  version = "0.4.6";
+
+  src = fetchurl {
+    name = "${pname}-snixource-${version}.tar.gz";
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "0m191ckqj1kj2yvxiilqw26x4vrn7pnlc2vy636yphjxr02q8bk4";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ zlib libpng libjpeg giflib libtiff ];
+
+  doCheck = true;
+
+  outputs = [ "out" "dev" "doc" ];
+
+  installPhase = ''
+    mkdir -p $out/lib
+    for path in *.so *.so.* *.o *.o.*; do
+      mv $path $out/lib/
+    done
+    mkdir -p $dev/include
+    mv ../include/libps $dev/include
+    if test -d nix-support; then
+      mv nix-support $dev
+    fi
+    mkdir -p $doc/share/doc/${pname}
+    cp -r ../doc/. $doc/share/doc/${pname}
+  '';
+
+  meta = with lib; {
+    description = "A C-library for generating multi page PostScript documents";
+    homepage = "http://pslib.sourceforge.net/";
+    changelog =
+      "https://sourceforge.net/p/pslib/git/ci/master/tree/pslib/ChangeLog";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ ShamrockLee ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/psol/default.nix b/nixpkgs/pkgs/development/libraries/psol/default.nix
new file mode 100644
index 000000000000..270c24dc01f4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/psol/default.nix
@@ -0,0 +1,5 @@
+{ callPackage }:
+callPackage ./generic.nix {} {
+  version = "1.13.35.2"; # Latest stable, 2018-02-05
+  sha256  = "0xi2srf9gx0x2sz9r45zb35k2n0iv457if1lqzvbanls3f935cmr";
+}
diff --git a/nixpkgs/pkgs/development/libraries/psol/generic.nix b/nixpkgs/pkgs/development/libraries/psol/generic.nix
new file mode 100644
index 000000000000..aa2522a5dad1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/psol/generic.nix
@@ -0,0 +1,16 @@
+{ fetchzip, lib }:
+{ version, sha256 }:
+{ inherit version; } // fetchzip {
+  inherit sha256;
+  name   = "psol-${version}";
+  url    = "https://dl.google.com/dl/page-speed/psol/${version}-x64.tar.gz";
+
+  meta = {
+    description = "PageSpeed Optimization Libraries";
+    homepage    = "https://developers.google.com/speed/pagespeed/psol";
+    license     = lib.licenses.asl20;
+    # WARNING: This only works with Linux because the pre-built PSOL binary is only supplied for Linux.
+    # TODO: Build PSOL from source to support more platforms.
+    platforms   = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/psqlodbc/default.nix b/nixpkgs/pkgs/development/libraries/psqlodbc/default.nix
new file mode 100644
index 000000000000..c1a86b1f3979
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/psqlodbc/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, libiodbc, postgresql, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "psqlodbc";
+  version = "09.01.0200";
+
+  src = fetchurl {
+    url = "https://ftp.postgresql.org/pub/odbc/versions/src/${pname}-${version}.tar.gz";
+    sha256 = "0b4w1ahfpp34jpscfk2kv9050lh3xl9pvcysqvaigkcd0vsk1hl9";
+  };
+
+  buildInputs = [ libiodbc postgresql openssl ];
+
+  configureFlags = [ "--with-iodbc=${libiodbc}" ];
+
+  meta = with lib; {
+    homepage = "https://odbc.postgresql.org/";
+    description = "ODBC driver for PostgreSQL";
+    license = licenses.lgpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pstreams/default.nix b/nixpkgs/pkgs/development/libraries/pstreams/default.nix
new file mode 100644
index 000000000000..bb9b6bc9c84b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pstreams/default.nix
@@ -0,0 +1,40 @@
+{ lib, 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 = 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 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/ptex/default.nix b/nixpkgs/pkgs/development/libraries/ptex/default.nix
new file mode 100644
index 000000000000..3f62d672ea97
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ptex/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, zlib, python, cmake, pkg-config }:
+
+stdenv.mkDerivation rec
+{
+  pname = "ptex";
+  version = "2.3.2";
+
+  src = fetchFromGitHub {
+    owner = "wdas";
+    repo = "ptex";
+    rev = "v${version}";
+    sha256 = "1c3pdqszn4y3d86qzng8b0hqdrchnl39adq5ab30wfnrgl2hnm4z";
+  };
+
+  outputs = [ "bin" "dev" "out" "lib" ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zlib python pkg-config ];
+
+  # Can be removed in the next release
+  # https://github.com/wdas/ptex/pull/42
+  patchPhase = ''
+    echo v${version} >version
+  '';
+
+  meta = with lib; {
+    description = "Per-Face Texture Mapping for Production Rendering";
+    homepage = "http://ptex.us/";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+    maintainers = [ maintainers.guibou ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pth/default.nix b/nixpkgs/pkgs/development/libraries/pth/default.nix
new file mode 100644
index 000000000000..240c903a8a77
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pth/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "pth-2.0.7";
+
+  src = fetchurl {
+    url = "mirror://gnu/pth/${name}.tar.gz";
+    sha256 = "0ckjqw5kz5m30srqi87idj7xhpw6bpki43mj07bazjm2qmh3cdbj";
+  };
+
+  preConfigure = lib.optionalString stdenv.isAarch32 ''
+    configureFlagsArray=("CFLAGS=-DJB_SP=8 -DJB_PC=9")
+  '' + lib.optionalString (stdenv.hostPlatform.libc == "glibc") ''
+    configureFlagsArray+=("ac_cv_check_sjlj=ssjlj")
+  '';
+
+  meta = with lib; {
+    description = "The GNU Portable Threads library";
+    homepage = "https://www.gnu.org/software/pth";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pugixml/default.nix b/nixpkgs/pkgs/development/libraries/pugixml/default.nix
new file mode 100644
index 000000000000..57335fa3d970
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pugixml/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, lib, fetchFromGitHub, cmake, check, validatePkgConfig, shared ? false }:
+
+stdenv.mkDerivation rec {
+  pname = "pugixml";
+  version = "1.11.4";
+
+  src = fetchFromGitHub {
+    owner = "zeux";
+    repo = "pugixml";
+    rev = "v${version}";
+    sha256 = "sha256-pXadPs2Dlht3BMNYDVxWZqnVv0umDgYVcqH5YVxr+uA=";
+  };
+
+  outputs = if shared then [ "out" "dev" ] else [ "out" ];
+
+  nativeBuildInputs = [ cmake validatePkgConfig ];
+
+  cmakeFlags = [
+    "-DBUILD_TESTS=ON"
+    "-DBUILD_SHARED_LIBS=${if shared then "ON" else "OFF"}"
+  ];
+
+  checkInputs = [ check ];
+
+  # Hack to be able to run the test, broken because we use
+  # CMAKE_SKIP_BUILD_RPATH to avoid cmake resetting rpath on install
+  preCheck = if stdenv.isDarwin then ''
+    export DYLD_LIBRARY_PATH="$(pwd)''${DYLD_LIBRARY_PATH:+:}$DYLD_LIBRARY_PATH"
+  '' else ''
+    export LD_LIBRARY_PATH="$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
+  '';
+
+  preConfigure = ''
+    # Enable long long support (required for filezilla)
+    sed -ire '/PUGIXML_HAS_LONG_LONG/ s/^\/\///' src/pugiconfig.hpp
+  '';
+
+  meta = with lib; {
+    description = "Light-weight, simple and fast XML parser for C++ with XPath support";
+    homepage = "https://pugixml.org";
+    license = licenses.mit;
+    maintainers = with maintainers; [ pSub ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pulseaudio-qt/default.nix b/nixpkgs/pkgs/development/libraries/pulseaudio-qt/default.nix
new file mode 100644
index 000000000000..03d656f91fae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pulseaudio-qt/default.nix
@@ -0,0 +1,35 @@
+{ mkDerivation
+, lib
+, fetchurl
+, cmake
+, extra-cmake-modules
+, pkg-config
+, pulseaudio
+}:
+
+mkDerivation rec {
+  pname = "pulseaudio-qt";
+  version = "1.2.0";
+
+  src = fetchurl {
+    url = "mirror://kde/stable/${pname}/${pname}-${lib.versions.majorMinor version}.tar.xz";
+    sha256 = "1i0ql68kxv9jxs24rsd3s7jhjid3f2fq56fj4wbp16zb4wd14099";
+  };
+
+  buildInputs = [
+    pulseaudio
+  ];
+
+  nativeBuildInputs = [
+    pkg-config
+    cmake
+    extra-cmake-modules
+  ];
+
+  meta = with lib; {
+    description = "Pulseaudio bindings for Qt";
+    homepage    = "https://invent.kde.org/libraries/pulseaudio-qt";
+    license     = with licenses; [ lgpl2 ];
+    maintainers = with maintainers; [ doronbehar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pupnp/default.nix b/nixpkgs/pkgs/development/libraries/pupnp/default.nix
new file mode 100644
index 000000000000..2c5c6c263484
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pupnp/default.nix
@@ -0,0 +1,47 @@
+{ fetchFromGitHub
+, lib
+, stdenv
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "libupnp";
+  version = "1.14.10";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "pupnp";
+    repo = "pupnp";
+    rev = "release-${version}";
+    sha256 = "sha256-QlV5V1+VPj/C0M3XgwVIJbxzVXfSvP6yMcJz9al6a+U=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  postPatch = ''
+    # Wrong paths in pkg-config file generated by CMake
+    # https://github.com/pupnp/pupnp/pull/205/files#r588946478
+    substituteInPlace CMakeLists.txt \
+      --replace '\''${exec_prefix}/' "" \
+      --replace '\''${prefix}/' ""
+  '';
+
+  meta = {
+    description = "An open source UPnP development kit for Linux";
+
+    longDescription = ''
+      The Linux SDK for UPnP Devices (libupnp) provides developers
+      with an API and open source code for building control points,
+      devices, and bridges that are compliant with Version 1.0 of the
+      UPnP Device Architecture Specification.
+    '';
+
+    license = lib.licenses.bsd3;
+
+    homepage = "https://pupnp.github.io/pupnp/";
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pxlib/default.nix b/nixpkgs/pkgs/development/libraries/pxlib/default.nix
new file mode 100644
index 000000000000..4b6b9ada7ab7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pxlib/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl, intltool }:
+
+stdenv.mkDerivation rec {
+  pname = "pxlib";
+  version = "0.6.8";
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
+    sha256 = "1yafwz4z5h30hqvk51wpgbjlmq9f2z2znvfim87ydrfrqfjmi6sz";
+  };
+
+  nativeBuildInputs = [ intltool ];
+
+  meta = with lib; {
+    description = "Library to read and write Paradox files";
+    homepage = "http://pxlib.sourceforge.net/";
+    license = licenses.gpl2;
+    platforms = platforms.all;
+    maintainers = [ maintainers.winpat ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/py3c/default.nix b/nixpkgs/pkgs/development/libraries/py3c/default.nix
new file mode 100644
index 000000000000..eec051f0cc1c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/py3c/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, python2, python3 }:
+
+stdenv.mkDerivation rec {
+  pname = "py3c";
+  version = "1.3.1";
+
+  src = fetchFromGitHub {
+    owner = "encukou";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "04i2z7hrig78clc59q3i1z2hh24g7z1bfvxznlzxv00d4s57nhpi";
+  };
+
+  postPatch = lib.optionalString stdenv.cc.isClang ''
+    substituteInPlace test/setup.py \
+      --replace "'-Werror', " ""
+  '';
+
+  makeFlags = [
+    "prefix=${placeholder "out"}"
+  ];
+
+  doCheck = true;
+
+  checkInputs = [
+    python2
+    python3
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/encukou/py3c";
+    description = "Python 2/3 compatibility layer for C extensions";
+    license = licenses.mit;
+    maintainers = with maintainers; [ ajs124 dotlambda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pyotherside/default.nix b/nixpkgs/pkgs/development/libraries/pyotherside/default.nix
new file mode 100644
index 000000000000..da327ae13fac
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pyotherside/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub
+, python3, qmake, qtbase, qtquickcontrols, qtsvg, ncurses }:
+
+stdenv.mkDerivation rec {
+  pname = "pyotherside";
+  version = "1.5.9";
+
+  src = fetchFromGitHub {
+    owner = "thp";
+    repo = "pyotherside";
+    rev = version;
+    sha256 = "1k1fdsinysgx5gp6q62jiwcyiklakmjv6wbi1s2659am96vz3zj8";
+  };
+
+  nativeBuildInputs = [ qmake ];
+  buildInputs = [
+    python3 qtbase qtquickcontrols qtsvg ncurses
+  ];
+
+  dontWrapQtApps = true;
+
+  patches = [ ./qml-path.patch ];
+  installTargets = [ "sub-src-install_subtargets" ];
+
+  meta = with lib; {
+    description = "Asynchronous Python 3 Bindings for Qt 5";
+    homepage = "https://thp.io/2011/pyotherside/";
+    license = licenses.isc;
+    maintainers = [ maintainers.mic92 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/pyotherside/qml-path.patch b/nixpkgs/pkgs/development/libraries/pyotherside/qml-path.patch
new file mode 100644
index 000000000000..9f7208909970
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pyotherside/qml-path.patch
@@ -0,0 +1,12 @@
+diff -Naur --strip-trailing-cr source.org/src/src.pro source/src/src.pro
+--- source.org/src/src.pro	1970-01-01 01:00:01.000000000 +0100
++++ source/src/src.pro	2019-01-17 19:14:46.256821852 +0000
+@@ -10,7 +10,7 @@
+ CONFIG += qt plugin
+ QT += qml quick svg
+ 
+-target.path = $$[QT_INSTALL_QML]/$$PLUGIN_IMPORT_PATH
++target.path = $$NIX_OUTPUT_QML/$$PLUGIN_IMPORT_PATH
+ INSTALLS += target
+ 
+ qmldir.files += $$_PRO_FILE_PWD_/qmldir $$_PRO_FILE_PWD_/pyotherside.qmltypes
diff --git a/nixpkgs/pkgs/development/libraries/pystring/default.nix b/nixpkgs/pkgs/development/libraries/pystring/default.nix
new file mode 100644
index 000000000000..3a1e64c0b000
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/pystring/default.nix
@@ -0,0 +1,33 @@
+{ stdenv, lib, fetchFromGitHub, fetchpatch, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "pystring";
+  version = "1.1.3";
+
+  src = fetchFromGitHub {
+    owner = "imageworks";
+    repo = "pystring";
+    rev = "v${version}";
+    sha256 = "1w31pjiyshqgk6zd6m3ab3xfgb0ribi77r6fwrry2aw8w1adjknf";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "pystring-cmake-configuration.patch";
+      url = "https://github.com/imageworks/pystring/commit/4f653fc35421129eae8a2c424901ca7170059370.patch";
+      sha256 = "1hynzz76ff4vvmi6kwixsmjswkpyj6s4vv05d7nw0zscj4cdp8k3";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/imageworks/pystring/";
+    description = "A collection of C++ functions which match the interface and behavior of python's string class methods using std::string";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.rytone ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/python-qt/default.nix b/nixpkgs/pkgs/development/libraries/python-qt/default.nix
new file mode 100644
index 000000000000..2be89b3b7534
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/python-qt/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchurl, python, qmake,
+  qtwebengine, qtxmlpatterns,
+  qttools, unzip }:
+
+stdenv.mkDerivation rec {
+  version = "3.2";
+  pname = "python-qt";
+
+  src = fetchurl {
+    url="mirror://sourceforge/pythonqt/PythonQt${version}.zip";
+    sha256="13hzprk58m3yj39sj0xn6acg8796lll1256mpd81kw0z3yykyl8c";
+  };
+
+  hardeningDisable = [ "all" ];
+
+  nativeBuildInputs = [ qmake qtwebengine qtxmlpatterns qttools unzip ];
+
+  buildInputs = [ python ];
+
+  qmakeFlags = [ "PythonQt.pro"
+                 "INCLUDEPATH+=${python}/include/python3.6"
+                 "PYTHON_PATH=${python}/bin"
+                 "PYTHON_LIB=${python}/lib"];
+
+  dontWrapQtApps = true;
+
+  unpackCmd = "unzip $src";
+
+  installPhase = ''
+    mkdir -p $out/include/PythonQt
+    cp -r ./lib $out
+    cp -r ./src/* $out/include/PythonQt
+    cp -r ./build $out/include/PythonQt
+    cp -r ./extensions $out/include/PythonQt
+  '';
+
+  meta = with lib; {
+    description = "PythonQt is a dynamic Python binding for the Qt framework. It offers an easy way to embed the Python scripting language into your C++ Qt applications";
+    homepage = "http://pythonqt.sourceforge.net/";
+    license = licenses.lgpl21;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ hlolli ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qca-qt5/default.nix b/nixpkgs/pkgs/development/libraries/qca-qt5/default.nix
new file mode 100644
index 000000000000..f8159417378c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qca-qt5/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, cmake, openssl, pkg-config, qtbase }:
+
+stdenv.mkDerivation rec {
+  pname = "qca-qt5";
+  version = "2.3.1";
+
+  src = fetchurl {
+    url = "http://download.kde.org/stable/qca/${version}/qca-${version}.tar.xz";
+    sha256 = "sha256-wThREJq+/EYjNwmJ+uOnRb9rGss8KhOolYU5gj6XTks=";
+  };
+
+  buildInputs = [ openssl qtbase ];
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  dontWrapQtApps = true;
+
+  # tells CMake to use this CA bundle file if it is accessible
+  preConfigure = "export QC_CERTSTORE_PATH=/etc/ssl/certs/ca-certificates.crt";
+
+  # tricks CMake into using this CA bundle file if it is not accessible (in a sandbox)
+  cmakeFlags = [ "-Dqca_CERTSTORE=/etc/ssl/certs/ca-certificates.crt" ];
+
+  meta = with lib; {
+    description = "Qt 5 Cryptographic Architecture";
+    homepage = "http://delta.affinix.com/qca";
+    maintainers = with maintainers; [ ttuegel ];
+    license = licenses.lgpl21Plus;
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qca2/default.nix b/nixpkgs/pkgs/development/libraries/qca2/default.nix
new file mode 100644
index 000000000000..42dcf1a87d36
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qca2/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl, openssl, cmake, pkg-config, qt, darwin }:
+
+stdenv.mkDerivation rec {
+  pname = "qca";
+  version = "2.2.1";
+
+  src = fetchurl {
+    url = "http://download.kde.org/stable/qca/${version}/qca-${version}.tar.xz";
+    sha256 = "00kv1vsrc8fp556hm8s6yw3240vx3l4067q6vfxrb3gdwgcd45np";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ openssl qt ]
+    ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
+
+  # tells CMake to use this CA bundle file if it is accessible
+  preConfigure = ''
+    export QC_CERTSTORE_PATH=/etc/ssl/certs/ca-certificates.crt
+  '';
+
+  # tricks CMake into using this CA bundle file if it is not accessible (in a sandbox)
+  cmakeFlags = [ "-Dqca_CERTSTORE=/etc/ssl/certs/ca-certificates.crt" ];
+
+  postPatch = ''
+    sed -i -e '1i cmake_policy(SET CMP0025 NEW)' CMakeLists.txt
+  '';
+
+  meta = with lib; {
+    description = "Qt Cryptographic Architecture";
+    license = "LGPL";
+    homepage = "http://delta.affinix.com/qca";
+    maintainers = [ maintainers.sander ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qca2/libressl.patch b/nixpkgs/pkgs/development/libraries/qca2/libressl.patch
new file mode 100644
index 000000000000..c9b0267f85d8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qca2/libressl.patch
@@ -0,0 +1,28 @@
+--- a/plugins/qca-ossl/qca-ossl.cpp	2015-12-02 09:34:25.810682094 +0000
++++ b/plugins/qca-ossl/qca-ossl.cpp	2015-12-02 09:29:51.720392423 +0000
+@@ -5403,11 +5403,13 @@
+ 			ctx = SSL_CTX_new(SSLv2_client_method());
+ 			break;
+ #endif
++#ifndef OPENSSL_NO_SSL3
+ 		case TLS::SSL_v3:
+ 			ctx = SSL_CTX_new(SSLv3_client_method());
+ 			break;
++#endif
+ 		case TLS::TLS_v1:
++			ctx = SSL_CTX_new(SSLv23_client_method());
+-			ctx = SSL_CTX_new(TLSv1_client_method());
+ 			break;
+ 		case TLS::DTLS_v1:
+ 		default:
+@@ -7133,8 +7135,10 @@
+ 			return new opensslInfoContext(this);
+ 		else if ( type == "sha1" )
+ 			return new opensslHashContext( EVP_sha1(), this, type);
++#ifndef OPENSSL_NO_SHA0
+ 		else if ( type == "sha0" )
+ 			return new opensslHashContext( EVP_sha(), this, type);
++#endif
+ 		else if ( type == "ripemd160" )
+ 			return new opensslHashContext( EVP_ripemd160(), this, type);
+ #ifdef HAVE_OPENSSL_MD2
diff --git a/nixpkgs/pkgs/development/libraries/qgnomeplatform/default.nix b/nixpkgs/pkgs/development/libraries/qgnomeplatform/default.nix
new file mode 100644
index 000000000000..bfb1859ba655
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qgnomeplatform/default.nix
@@ -0,0 +1,65 @@
+{ mkDerivation
+, lib
+, fetchFromGitHub
+, nix-update-script
+, cmake
+, pkg-config
+, adwaita-qt
+, glib
+, gtk3
+, qtbase
+, pantheon
+, substituteAll
+, gsettings-desktop-schemas
+}:
+
+mkDerivation rec {
+  pname = "qgnomeplatform";
+  version = "0.8.0";
+
+  src = fetchFromGitHub {
+    owner = "FedoraQt";
+    repo = "QGnomePlatform";
+    rev = version;
+    sha256 = "C/n8i5j0UWfxhP10c4j89U+LrpPozXnam4fIPYMXZAA=";
+  };
+
+  patches = [
+    # Hardcode GSettings schema path to avoid crashes from missing schemas
+    (substituteAll {
+      src = ./hardcode-gsettings.patch;
+      gds_gsettings_path = glib.getSchemaPath gsettings-desktop-schemas;
+    })
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  buildInputs = [
+    adwaita-qt
+    glib
+    gtk3
+    qtbase
+  ];
+
+  cmakeFlags = [
+    "-DGLIB_SCHEMAS_DIR=${glib.getSchemaPath gsettings-desktop-schemas}"
+    "-DQT_PLUGINS_DIR=${placeholder "out"}/${qtbase.qtPluginPrefix}"
+  ];
+
+  passthru = {
+    updateScript = nix-update-script {
+      attrPath = pname;
+    };
+  };
+
+  meta = with lib; {
+    description = "QPlatformTheme for a better Qt application inclusion in GNOME";
+    homepage = "https://github.com/FedoraQt/QGnomePlatform";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members ++ (with maintainers; [ ]);
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qgnomeplatform/hardcode-gsettings.patch b/nixpkgs/pkgs/development/libraries/qgnomeplatform/hardcode-gsettings.patch
new file mode 100644
index 000000000000..40f7f98f25c7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qgnomeplatform/hardcode-gsettings.patch
@@ -0,0 +1,25 @@
+diff --git a/src/common/gnomesettings.cpp b/src/common/gnomesettings.cpp
+index 717cc9b..ee255ea 100644
+--- a/src/common/gnomesettings.cpp
++++ b/src/common/gnomesettings.cpp
+@@ -150,10 +150,18 @@ GnomeSettingsPrivate::GnomeSettingsPrivate(QObject *parent)
+     : GnomeSettings(parent)
+     , m_usePortal(checkUsePortalSupport())
+     , m_canUseFileChooserPortal(!m_usePortal)
+-    , m_gnomeDesktopSettings(g_settings_new("org.gnome.desktop.wm.preferences"))
+-    , m_settings(g_settings_new("org.gnome.desktop.interface"))
+     , m_fallbackFont(new QFont(QLatin1String("Sans"), 10))
+ {
++    g_autoptr(GSettingsSchemaSource) schemaSource = nullptr;
++    g_autoptr(GSettingsSchema) gnomeDesktopSchema = nullptr;
++    g_autoptr(GSettingsSchema) settingsSchema = nullptr;
++
++    schemaSource = g_settings_schema_source_new_from_directory("@gds_gsettings_path@", g_settings_schema_source_get_default(), true, nullptr);
++    gnomeDesktopSchema = g_settings_schema_source_lookup(schemaSource, "org.gnome.desktop.wm.preferences", false);
++    m_gnomeDesktopSettings = g_settings_new_full(gnomeDesktopSchema, nullptr, nullptr);
++    settingsSchema = g_settings_schema_source_lookup(schemaSource, "org.gnome.desktop.interface", false);
++    m_settings = g_settings_new_full(settingsSchema, nullptr, nullptr);
++
+     gtk_init(nullptr, nullptr);
+ 
+     // Set log handler to suppress false GtkDialog warnings
diff --git a/nixpkgs/pkgs/development/libraries/qhull/default.nix b/nixpkgs/pkgs/development/libraries/qhull/default.nix
new file mode 100644
index 000000000000..a7f1bc271155
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qhull/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, cmake, fixDarwinDylibNames }:
+
+stdenv.mkDerivation rec {
+  pname = "qhull";
+  version = "2020.2";
+
+  src = fetchFromGitHub {
+    owner = "qhull";
+    repo = "qhull";
+    rev = version;
+    sha256 = "sha256-djUO3qzY8ch29AuhY3Bn1ajxWZ4/W70icWVrxWRAxRc=";
+  };
+
+  nativeBuildInputs = [ cmake ]
+    ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
+
+  meta = with lib; {
+    homepage = "http://www.qhull.org/";
+    description = "Compute the convex hull, Delaunay triangulation, Voronoi diagram and more";
+    license = licenses.qhull;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ orivej ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qimageblitz/default.nix b/nixpkgs/pkgs/development/libraries/qimageblitz/default.nix
new file mode 100644
index 000000000000..709a3fb1533d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qimageblitz/default.nix
@@ -0,0 +1,27 @@
+{lib, stdenv, fetchurl, cmake, qt4}:
+
+let
+  pn = "qimageblitz";
+  v = "0.0.4";
+in
+
+stdenv.mkDerivation {
+  name = "${pn}-${v}";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pn}/${pn}-${v}.tar.bz2";
+    sha256 = "0pnaf3qi7rgkxzs2mssmslb3f9ya4cyx09wzwlis3ppyvf72j0p9";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ qt4 ];
+
+  patches = [ ./qimageblitz-9999-exec-stack.patch ];
+
+  meta = {
+    description = "Graphical effect and filter library for KDE4";
+    license = lib.licenses.bsd2;
+    homepage = "http://${pn}.sourceforge.net";
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qimageblitz/qimageblitz-9999-exec-stack.patch b/nixpkgs/pkgs/development/libraries/qimageblitz/qimageblitz-9999-exec-stack.patch
new file mode 100644
index 000000000000..8692c240f7bb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qimageblitz/qimageblitz-9999-exec-stack.patch
@@ -0,0 +1,11 @@
+diff -uar qimageblitz/blitz/asm_scale.S qimageblitz~/blitz/asm_scale.S
+--- qimageblitz-orig/blitz/asm_scale.S	2007-10-17 01:17:57.000000000 +0200
++++ qimageblitz/blitz/asm_scale.S	2007-10-17 01:19:12.000000000 +0200
+@@ -814,3 +814,7 @@
+ SIZE(qimageScale_mmx_AARGBA)
+ 
+ #endif
++#if defined(__linux__) && defined(__ELF__)
++.section .note.GNU-stack,"",%progbits
++#endif
++
diff --git a/nixpkgs/pkgs/development/libraries/qjson/default.nix b/nixpkgs/pkgs/development/libraries/qjson/default.nix
new file mode 100644
index 000000000000..a6ee272a38b5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qjson/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, cmake, qt4 }:
+
+stdenv.mkDerivation rec {
+  version = "0.9.0";
+  pname = "qjson";
+
+  src = fetchFromGitHub {
+    owner = "flavio";
+    repo = "qjson";
+    rev = version;
+    sha256 = "1f4wnxzx0qdmxzc7hqk28m0sva7z9p9xmxm6aifvjlp0ha6pmfxs";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ qt4 ];
+
+  meta = with lib; {
+    description = "Lightweight data-interchange format";
+    homepage = "http://qjson.sourceforge.net/";
+    license = licenses.lgpl21;
+    inherit (qt4.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qmlbox2d/default.nix b/nixpkgs/pkgs/development/libraries/qmlbox2d/default.nix
new file mode 100644
index 000000000000..e1e69b9f10b4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qmlbox2d/default.nix
@@ -0,0 +1,32 @@
+{lib, stdenv, qtdeclarative, fetchFromGitHub, qmake }:
+stdenv.mkDerivation {
+  pname = "qml-box2d";
+  version = "unstable-2018-04-06";
+  src = fetchFromGitHub {
+    owner = "qml-box2d";
+    repo = "qml-box2d";
+    sha256 = "0gb8limy6ck23z3k0k2j7c4c4s95p40f6lbzk4szq7fjnnw22kb7";
+    rev = "b7212d5640701f93f0cd88fbd3a32c619030ae62";
+  };
+
+  dontWrapQtApps = true;
+  nativeBuildInputs = [ qmake ];
+
+  buildInputs = [ qtdeclarative ];
+
+  patchPhase = ''
+    substituteInPlace box2d.pro \
+      --replace '$$[QT_INSTALL_QML]' "/$qtQmlPrefix/"
+    qmakeFlags="$qmakeFlags PREFIXSHORTCUT=$out"
+    '';
+
+  installFlags = [ "INSTALL_ROOT=$(out)" ];
+
+  meta = with lib; {
+    description = "A QML plugin for Box2D engine";
+    homepage = "https://github.com/qml-box2d/qml-box2d";
+    maintainers = [ maintainers.guibou ];
+    platforms = platforms.linux;
+    license = licenses.zlib;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qmltermwidget/default.nix b/nixpkgs/pkgs/development/libraries/qmltermwidget/default.nix
new file mode 100644
index 000000000000..bd6ebbd8e375
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qmltermwidget/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchFromGitHub, qtbase, qtquick1, qmake, qtmultimedia, utmp, fetchpatch }:
+
+stdenv.mkDerivation {
+  version = "2018-11-24";
+  pname = "qmltermwidget-unstable";
+
+  src = fetchFromGitHub {
+    repo = "qmltermwidget";
+    owner = "Swordfish90";
+    rev = "48274c75660e28d44af7c195e79accdf1bd44963";
+    sha256 = "028nb1xp84jmakif5mmzx52q3rsjwckw27jdpahyaqw7j7i5znq6";
+  };
+
+  buildInputs = [ qtbase qtquick1 qtmultimedia ]
+                ++ lib.optional stdenv.isDarwin utmp;
+  nativeBuildInputs = [ qmake ];
+
+  patches = [
+    (fetchpatch {
+      name = "fix-missing-includes.patch";
+      url = "https://github.com/Swordfish90/qmltermwidget/pull/27/commits/485f8d6d841b607ba49e55a791f7f587e4e193bc.diff";
+      sha256 = "186s8pv3642vr4lxsds919h0y2vrkl61r7wqq9mc4a5zk5vprinj";
+    })
+  ];
+
+  postPatch = ''
+    substituteInPlace qmltermwidget.pro \
+      --replace '$$[QT_INSTALL_QML]' "/$qtQmlPrefix/"
+  '';
+
+  installFlags = [ "INSTALL_ROOT=$(out)" ];
+
+  dontWrapQtApps = true;
+
+  meta = {
+    description = "A QML port of qtermwidget";
+    homepage = "https://github.com/Swordfish90/qmltermwidget";
+    license = lib.licenses.gpl2;
+    platforms = with lib.platforms; linux ++ darwin;
+    maintainers = with lib.maintainers; [ skeidel ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qoauth/default.nix b/nixpkgs/pkgs/development/libraries/qoauth/default.nix
new file mode 100644
index 000000000000..2c62ea27d19b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qoauth/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, qtbase, qmake, qca-qt5 }:
+
+stdenv.mkDerivation rec {
+  pname = "qoauth";
+  version = "2.0.0";
+
+  src = fetchFromGitHub {
+    owner = "ayoy";
+    repo = "qoauth";
+    rev = "v${version}";
+    name = "qoauth-${version}.tar.gz";
+    sha256 = "1b2jdqs526ac635yb2whm049spcsk7almnnr6r5b4yqhq922anw3";
+  };
+
+  postPatch = ''
+    sed -i src/src.pro \
+        -e 's/lib64/lib/g' \
+        -e '/features.path =/ s|$$\[QMAKE_MKSPECS\]|$$NIX_OUTPUT_DEV/mkspecs|'
+  '';
+
+  buildInputs = [ qtbase qca-qt5 ];
+  nativeBuildInputs = [ qmake ];
+
+  NIX_CFLAGS_COMPILE = "-I${qca-qt5}/include/Qca-qt5/QtCrypto";
+  NIX_LDFLAGS = "-lqca-qt5";
+
+  dontWrapQtApps = true;
+
+  meta = with lib; {
+    description = "Qt library for OAuth authentication";
+    inherit (qtbase.meta) platforms;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qpdf/default.nix b/nixpkgs/pkgs/development/libraries/qpdf/default.nix
new file mode 100644
index 000000000000..637335b86291
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qpdf/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, libjpeg, zlib, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "qpdf";
+  version = "10.3.2";
+
+  src = fetchFromGitHub {
+    owner = "qpdf";
+    repo = "qpdf";
+    rev = "release-qpdf-${version}";
+    sha256 = "sha256-fhn6hE/MLYiaOxZYfaVcj17V+h8Yvn18QTewS0rPIXE=";
+  };
+
+  nativeBuildInputs = [ perl ];
+
+  buildInputs = [ zlib libjpeg ];
+
+  preCheck = ''
+    patchShebangs qtest/bin/qtest-driver
+  '';
+
+  doCheck = true;
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "http://qpdf.sourceforge.net/";
+    description = "A C++ library and set of programs that inspect and manipulate the structure of PDF files";
+    license = licenses.asl20; # as of 7.0.0, people may stay at artistic2
+    maintainers = with maintainers; [ abbradar ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qrcodegen/default.nix b/nixpkgs/pkgs/development/libraries/qrcodegen/default.nix
new file mode 100644
index 000000000000..0ad42c1fc4d7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qrcodegen/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub }:
+stdenv.mkDerivation rec {
+  pname = "qrcodegen";
+  version = "1.7.0";
+
+  src = fetchFromGitHub {
+    owner = "nayuki";
+    repo = "QR-Code-generator";
+    rev = "v${version}";
+    sha256 = "sha256-WH6O3YE/+NNznzl52TXZYL+6O25GmKSnaFqDDhRl4As=";
+  };
+
+  preBuild = "cd c";
+  installPhase = ''
+    mkdir -p $out/lib $out/include/qrcodegen
+    cp libqrcodegen.a $out/lib
+    cp qrcodegen.h $out/include/qrcodegen/
+  '';
+
+  meta = with lib;
+    {
+      description = "qrcode generator library in multiple languages";
+
+      longDescription = ''
+        This project aims to be the best, clearest library for generating QR Codes. My primary goals are flexible options and absolute correctness. Secondary goals are compact implementation size and good documentation comments.
+      '';
+
+      homepage = "https://github.com/nayuki/QR-Code-generator";
+
+      license = licenses.mit;
+      platforms = platforms.all;
+      maintainers = with maintainers; [ mcbeth ];
+    };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qrencode/default.nix b/nixpkgs/pkgs/development/libraries/qrencode/default.nix
new file mode 100644
index 000000000000..c005b835a932
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qrencode/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, fetchurl, pkg-config, SDL2, libpng, libiconv }:
+
+stdenv.mkDerivation rec {
+  pname = "qrencode";
+  version = "4.1.1";
+
+  outputs = [ "bin" "out" "man" "dev" ];
+
+  src = fetchurl {
+    url = "https://fukuchi.org/works/qrencode/qrencode-${version}.tar.gz";
+    sha256 = "sha256-2kSO1PUqumvLDNSMrA3VG4aSvMxM0SdDFAL8pvgXHo4=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ SDL2 libpng ] ++ lib.optionals stdenv.isDarwin [ libiconv ];
+
+  configureFlags = [
+    "--with-tests"
+  ];
+
+  doCheck = true;
+
+  checkPhase = ''
+    runHook preCheck
+
+    pushd tests
+    ./test_basic.sh
+    popd
+
+    runHook postCheck
+  '';
+
+  meta = with lib; {
+    homepage = "https://fukuchi.org/works/qrencode/";
+    description = "C library for encoding data in a QR Code symbol";
+
+    longDescription = ''
+      Libqrencode is a C library for encoding data in a QR Code symbol,
+      a kind of 2D symbology that can be scanned by handy terminals
+      such as a mobile phone with CCD.
+    '';
+
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ adolfogc yegortimoshenko ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qrupdate/default.nix b/nixpkgs/pkgs/development/libraries/qrupdate/default.nix
new file mode 100644
index 000000000000..ad7e88d4647e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qrupdate/default.nix
@@ -0,0 +1,56 @@
+{ stdenv
+, lib
+, fetchurl
+, gfortran
+, blas
+, lapack
+, which
+}:
+
+stdenv.mkDerivation rec {
+  pname = "qrupdate";
+  version = "1.1.2";
+  src = fetchurl {
+    url = "mirror://sourceforge/qrupdate/${pname}-${version}.tar.gz";
+    sha256 = "024f601685phcm1pg8lhif3lpy5j9j0k6n0r46743g4fvh8wg8g2";
+  };
+
+  preBuild =
+    # Check that blas and lapack are compatible
+    assert (blas.isILP64 == lapack.isILP64);
+  # We don't have structuredAttrs yet implemented, and we need to use space
+  # seprated values in makeFlags, so only this works.
+  ''
+    makeFlagsArray+=(
+      "LAPACK=-L${lapack}/lib -llapack"
+      "BLAS=-L${blas}/lib -lblas"
+      "PREFIX=${placeholder "out"}"
+      ${lib.optionalString blas.isILP64
+      # If another application intends to use qrupdate compiled with blas with
+      # 64 bit support, it should add this to it's FFLAGS as well. See (e.g):
+      # https://savannah.gnu.org/bugs/?50339
+      "FFLAGS=-fdefault-integer-8"
+      }
+    )
+  '';
+
+  doCheck = true;
+
+  checkTarget = "test";
+
+  buildFlags = [ "lib" "solib" ];
+
+  installTargets = lib.optionals stdenv.isDarwin [ "install-staticlib" "install-shlib" ];
+
+  buildInputs = [ gfortran ];
+
+  nativeBuildInputs = [ which ];
+
+  meta = with lib; {
+    description = "Library for fast updating of qr and cholesky decompositions";
+    homepage = "https://sourceforge.net/projects/qrupdate/";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ doronbehar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qscintilla/default.nix b/nixpkgs/pkgs/development/libraries/qscintilla/default.nix
new file mode 100644
index 000000000000..fc2ef6c09a63
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qscintilla/default.nix
@@ -0,0 +1,70 @@
+{ stdenv, lib, fetchurl, unzip
+, qt4 ? null, qmake4Hook ? null
+, withQt5 ? false, qtbase ? null, qtmacextras ? null, qmake ? null
+, fixDarwinDylibNames
+}:
+
+let
+  pname = "qscintilla-qt${if withQt5 then "5" else "4"}";
+  version = "2.11.6";
+
+in stdenv.mkDerivation rec {
+  inherit pname version;
+
+  src = fetchurl {
+    url = "https://www.riverbankcomputing.com/static/Downloads/QScintilla/${version}/QScintilla-${version}.tar.gz";
+    sha256 = "5zRgV9tH0vs4RGf6/M/LE6oHQTc8XVk7xytVsvDdIKc=";
+  };
+
+  sourceRoot = "QScintilla-${version}/Qt4Qt5";
+
+  buildInputs = [ (if withQt5 then qtbase else qt4) ];
+
+  propagatedBuildInputs = lib.optional (withQt5 && stdenv.isDarwin) qtmacextras;
+
+  nativeBuildInputs = [ unzip ]
+    ++ (if withQt5 then [ qmake ] else [ qmake4Hook ])
+    ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
+
+  patches = lib.optional (!withQt5) ./fix-qt4-build.patch;
+
+  # 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
+  '';
+
+  dontWrapQtApps = true;
+
+  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 lib; {
+    description = "A Qt port of the Scintilla text editing library";
+    longDescription = ''
+      QScintilla is a port to Qt of Neil Hodgson's Scintilla C++ editor
+      control.
+
+      As well as features found in standard text editing components,
+      QScintilla includes features especially useful when editing and
+      debugging source code. These include support for syntax styling,
+      error indicators, code completion and call tips. The selection
+      margin can contain markers like those used in debuggers to
+      indicate breakpoints and the current line. Styling choices are
+      more open than with many editors, allowing the use of
+      proportional fonts, bold and italics, multiple foreground and
+      background colours and multiple fonts.
+    '';
+    homepage = "https://www.riverbankcomputing.com/software/qscintilla/intro";
+    license = with licenses; [ gpl3 ]; # and commercial
+    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-4.x/4.8/clang-5-darwin.patch b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/clang-5-darwin.patch
new file mode 100644
index 000000000000..7b181f3ad896
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/clang-5-darwin.patch
@@ -0,0 +1,13 @@
+diff --git a/src/gui/text/qfontengine_coretext.mm b/src/gui/text/qfontengine_coretext.mm
+index 204d685..e05179e 100644
+--- a/src/gui/text/qfontengine_coretext.mm
++++ b/src/gui/text/qfontengine_coretext.mm
+@@ -886,7 +886,7 @@ void QCoreTextFontEngine::getUnscaledGlyph(glyph_t glyph, QPainterPath *path, gl
+ 
+ QFixed QCoreTextFontEngine::emSquareSize() const
+ {
+-    return QFixed::QFixed(int(CTFontGetUnitsPerEm(ctfont)));
++    return QFixed(int(CTFontGetUnitsPerEm(ctfont)));
+ }
+ 
+ QFontEngine *QCoreTextFontEngine::cloneWithSize(qreal pixelSize) const
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
new file mode 100644
index 000000000000..5856e0b84b5c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/default.nix
@@ -0,0 +1,239 @@
+{ stdenv, lib, fetchurl, fetchpatch, substituteAll
+, libXrender, libXinerama, libXcursor, libXv, libXext
+, libXfixes, libXrandr, libSM, freetype, fontconfig, zlib, libjpeg, libpng
+, libmng, which, libGLU, openssl, dbus, cups, pkg-config
+, libtiff, glib, icu, libmysqlclient, postgresql, sqlite, perl, coreutils, libXi
+, alsa-lib
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
+, gtkStyle ? stdenv.hostPlatform == stdenv.buildPlatform, gtk2, gdk-pixbuf
+, gnomeStyle ? false, libgnomeui, GConf, gnome_vfs
+, developerBuild ? false
+, docs ? false
+, examples ? false
+, demos ? false
+# darwin support
+, libobjc, ApplicationServices, OpenGL, Cocoa, AGL, libcxx
+}:
+
+let
+  v_maj = "4.8";
+  v_min = "7";
+  vers = "${v_maj}.${v_min}";
+in
+
+# TODO:
+#  * move some plugins (e.g., SQL plugins) to dedicated derivations to avoid
+#    false build-time dependencies
+
+stdenv.mkDerivation rec {
+  name = "qt-${vers}";
+
+  src = fetchurl {
+    url = "http://download.qt-project.org/official_releases/qt/"
+      + "${v_maj}/${vers}/qt-everywhere-opensource-src-${vers}.tar.gz";
+    sha256 = "183fca7n7439nlhxyg1z7aky0izgbyll3iwakw4gwivy16aj5272";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  outputInclude = "out";
+
+  setOutputFlags = false;
+
+  # The version property must be kept because it will be included into the QtSDK package name
+  version = vers;
+
+  prePatch = ''
+    substituteInPlace configure --replace /bin/pwd pwd
+    substituteInPlace src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls
+    substituteInPlace src/3rdparty/javascriptcore/JavaScriptCore/jit/JITStubs.cpp \
+      --replace 'asm volatile' 'asm'
+    sed -e 's@/\(usr\|opt\)/@/var/empty/@g' -i config.tests/*/*.test -i mkspecs/*/*.conf
+  '' + lib.optionalString stdenv.isDarwin ''
+    # remove impure reference to /usr/lib/libstdc++.6.dylib
+    # there might be more references, but this is the only one I could find
+    substituteInPlace tools/macdeployqt/tests/tst_deployment_mac.cpp \
+      --replace /usr/lib/libstdc++.6.dylib "${stdenv.cc}/lib/libstdc++.6.dylib"
+  '' + lib.optionalString stdenv.cc.isClang ''
+    substituteInPlace src/3rdparty/webkit/Source/WebCore/html/HTMLImageElement.cpp \
+      --replace 'optionalHeight > 0' 'optionalHeight != NULL'
+
+    substituteInPlace ./tools/linguist/linguist/messagemodel.cpp \
+      --replace 'm->comment()) >= 0' 'm->comment()) != NULL'
+  '';
+
+  patches =
+    lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [
+      ./glib-2.32.patch
+      ./libressl.patch
+      ./parallel-configure.patch
+      ./clang-5-darwin.patch
+      ./qt-4.8.7-unixmake-darwin.patch
+      ./kill-legacy-darwin-apis.patch
+      (substituteAll {
+        src = ./dlopen-absolute-paths.diff;
+        cups = if cups != null then lib.getLib cups else null;
+        icu = icu.out;
+        libXfixes = libXfixes.out;
+        glibc = stdenv.cc.libc.out;
+      })
+      (fetchpatch {
+        name = "fix-medium-font.patch";
+        url = "https://salsa.debian.org/qt-kde-team/qt/qt4-x11/raw/"
+          + "21b342d71c19e6d68b649947f913410fe6129ea4/debian/patches/kubuntu_39_fix_medium_font.diff";
+        sha256 = "0bli44chn03c2y70w1n8l7ss4ya0b40jqqav8yxrykayi01yf95j";
+      })
+      # Patches are no longer available from here, so vendoring it for now.
+      #(fetchpatch {
+      #  name = "qt4-gcc6.patch";
+      #  url = "https://git.archlinux.org/svntogit/packages.git/plain/trunk/qt4-gcc6.patch?h=packages/qt4&id=ca773a144f5abb244ac4f2749eeee9333cac001f";
+      #  sha256 = "07lrva7bjh6i40p7b3ml26a2jlznri8bh7y7iyx5zmvb1gfxmj34";
+      #})
+      ./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;
+        # substituteAll ignores env vars starting with capital letter
+        gtk = gtk2.out;
+      } // lib.optionalAttrs gnomeStyle {
+        gconf = GConf.out;
+        libgnomeui = libgnomeui.out;
+        gnome_vfs = gnome_vfs.out;
+      }))
+    ++ lib.optional stdenv.isAarch64 (fetchpatch {
+        url = "https://src.fedoraproject.org/rpms/qt/raw/ecf530486e0fb7fe31bad26805cde61115562b2b/f/qt-aarch64.patch";
+        sha256 = "1fbjh78nmafqmj7yk67qwjbhl3f6ylkp6x33b1dqxfw9gld8b3gl";
+      })
+    ++ lib.optionals stdenv.hostPlatform.isMusl [
+        ./qt-musl.patch
+        ./qt-musl-iconv-no-bom.patch
+        ./patch-qthread-stacksize.diff
+        ./qsettings-recursive-global-mutex.patch
+      ];
+
+  preConfigure = ''
+    export LD_LIBRARY_PATH="`pwd`/lib''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
+    configureFlags+="
+      -docdir $out/share/doc/${name}
+      -plugindir $out/lib/qt4/plugins
+      -importdir $out/lib/qt4/imports
+      -examplesdir $TMPDIR/share/doc/${name}/examples
+      -demosdir $TMPDIR/share/doc/${name}/demos
+      -datadir $out/share/${name}
+      -translationdir $out/share/${name}/translations
+      --jobs=$NIX_BUILD_CORES
+    "
+    unset LD # Makefile uses gcc for linking; setting LD interferes
+  '' + lib.optionalString stdenv.cc.isClang ''
+    sed -i 's/QMAKE_CC = gcc/QMAKE_CC = clang/' mkspecs/common/g++-base.conf
+    sed -i 's/QMAKE_CXX = g++/QMAKE_CXX = clang++/' mkspecs/common/g++-base.conf
+  '' + lib.optionalString stdenv.hostPlatform.isWindows ''
+    sed -i -e 's/ g++/ ${stdenv.cc.targetPrefix}g++/' \
+      -e 's/ gcc/ ${stdenv.cc.targetPrefix}gcc/' \
+      -e 's/ ar/ ${stdenv.cc.targetPrefix}ar/' \
+      -e 's/ strip/ ${stdenv.cc.targetPrefix}strip/' \
+      -e 's/ windres/ ${stdenv.cc.targetPrefix}windres/' \
+      mkspecs/win32-g++/qmake.conf
+  '';
+
+  prefixKey = "-prefix ";
+
+  configurePlatforms = [];
+  configureFlags = let
+    mk = cond: name: "-${lib.optionalString (!cond) "no-"}${name}";
+    platformFlag =
+      if stdenv.hostPlatform != stdenv.buildPlatform
+      then "-xplatform"
+      else "-platform";
+  in (if stdenv.hostPlatform != stdenv.buildPlatform then [
+    # I've not tried any case other than i686-pc-mingw32.
+    # -nomake tools: it fails linking some asian language symbols
+    # -no-svg: it fails to build on mingw64
+    "-static" "-release" "-confirm-license" "-opensource"
+    "-no-opengl" "-no-phonon"
+    "-no-svg"
+    "-make" "qmake" "-make" "libs" "-nomake" "tools"
+  ] else [
+    "-v" "-no-separate-debug-info" "-release" "-fast" "-confirm-license" "-opensource"
+
+    (mk (!stdenv.isFreeBSD) "opengl") "-xrender" "-xrandr" "-xinerama" "-xcursor" "-xinput" "-xfixes" "-fontconfig"
+    "-qdbus" (mk (cups != null) "cups") "-glib" "-dbus-linked" "-openssl-linked"
+
+    "-${if libmysqlclient != null then "plugin" else "no"}-sql-mysql" "-system-sqlite"
+
+    "-exceptions" "-xmlpatterns"
+
+    "-make" "libs" "-make" "tools" "-make" "translations"
+    "-no-phonon" "-no-webkit" "-no-multimedia" "-audio-backend"
+  ]) ++ [
+    "-${if demos then "" else "no"}make" "demos"
+    "-${if examples then "" else "no"}make" "examples"
+    "-${if docs then "" else "no"}make" "docs"
+  ] ++ lib.optional developerBuild "-developer-build"
+    ++ lib.optionals stdenv.hostPlatform.isDarwin [ platformFlag "unsupported/macx-clang-libc++" ]
+    ++ lib.optionals stdenv.hostPlatform.isWindows [ platformFlag "win32-g++-4.6" ];
+
+  propagatedBuildInputs =
+    [ libXrender libXrandr libXinerama libXcursor libXext libXfixes libXv libXi
+      libSM zlib libpng openssl dbus freetype fontconfig glib ]
+        # Qt doesn't directly need GLU (just GL), but many apps use, it's small and doesn't remain a runtime-dep if not used
+    ++ lib.optional libGLSupported libGLU;
+
+  # The following libraries are only used in plugins
+  buildInputs =
+    [ cups # Qt dlopen's libcups instead of linking to it
+      postgresql sqlite libjpeg libmng libtiff icu ]
+    ++ lib.optionals (libmysqlclient != null) [ libmysqlclient ]
+    ++ lib.optionals gtkStyle [ gtk2 gdk-pixbuf ]
+    ++ lib.optionals stdenv.isDarwin [ ApplicationServices OpenGL Cocoa AGL libcxx libobjc ];
+
+  nativeBuildInputs = [ perl pkg-config which ];
+
+  enableParallelBuilding = true;
+
+  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${lib.getDev libcxx}/include/c++/v1");
+
+  NIX_LDFLAGS = lib.optionalString (stdenv.isFreeBSD || stdenv.isDarwin) "-lglib-2.0";
+
+  preBuild = lib.optionalString stdenv.isDarwin ''
+    # resolve "extra qualification on member" error
+    sed -i 's/struct ::TabletProximityRec;/struct TabletProximityRec;/' \
+      src/gui/kernel/qt_cocoa_helpers_mac_p.h
+    find . -name "Makefile*" | xargs sed -i 's/^\(LINK[[:space:]]* = clang++\)/\1 ${NIX_LDFLAGS}/'
+    sed -i 's/^\(LIBS[[:space:]]*=.*$\)/\1 -lobjc/' ./src/corelib/Makefile.Release
+  '';
+
+  doCheck = false; # qwebframe test fails with fontconfig errors
+
+  postInstall = ''
+    rm -rf $out/tests
+  ''
+  # I don't know why it does not install qmake
+  + lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+    cp bin/qmake* $out/bin
+  '';
+
+  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
+
+  meta = {
+    homepage    = "https://qt-project.org/";
+    description = "A cross-platform application framework for C++";
+    license     = lib.licenses.lgpl21Plus; # or gpl3
+    maintainers = with lib.maintainers; [ orivej lovek323 phreedom sander ];
+    platforms   = lib.platforms.unix;
+    badPlatforms = [ "x86_64-darwin" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/dlopen-absolute-paths.diff b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/dlopen-absolute-paths.diff
new file mode 100644
index 000000000000..4c64e9e26e30
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/dlopen-absolute-paths.diff
@@ -0,0 +1,74 @@
+diff --git a/src/corelib/tools/qlocale_icu.cpp b/src/corelib/tools/qlocale_icu.cpp
+index c3e2907..2fac4e1 100644
+--- a/src/corelib/tools/qlocale_icu.cpp
++++ b/src/corelib/tools/qlocale_icu.cpp
+@@ -81,7 +81,7 @@ bool qt_initIcu(const QString &localeString)
+     if (status == NotLoaded) {
+ 
+         // resolve libicui18n
+-        QLibrary lib(QLatin1String("icui18n"), QLatin1String(U_ICU_VERSION_SHORT));
++        QLibrary lib(QLatin1String("@icu@/lib/libicui18n"), QLatin1String(U_ICU_VERSION_SHORT));
+         lib.setLoadHints(QLibrary::ImprovedSearchHeuristics);
+         if (!lib.load()) {
+             qWarning() << "Unable to load library icui18n" << lib.errorString();
+@@ -111,7 +111,7 @@ bool qt_initIcu(const QString &localeString)
+         }
+ 
+         // resolve libicuuc
+-        QLibrary ucLib(QLatin1String("icuuc"), QLatin1String(U_ICU_VERSION_SHORT));
++        QLibrary ucLib(QLatin1String("@icu@/lib/libicuuc"), QLatin1String(U_ICU_VERSION_SHORT));
+         ucLib.setLoadHints(QLibrary::ImprovedSearchHeuristics);
+         if (!ucLib.load()) {
+             qWarning() << "Unable to load library icuuc" << ucLib.errorString();
+diff --git a/src/gui/painting/qcups.cpp b/src/gui/painting/qcups.cpp
+index 99ea43f..acdf9c9 100644
+--- a/src/gui/painting/qcups.cpp
++++ b/src/gui/painting/qcups.cpp
+@@ -87,7 +87,7 @@ static CupsPrintFile _cupsPrintFile = 0;
+ 
+ static void resolveCups()
+ {
+-    QLibrary cupsLib(QLatin1String("cups"), 2);
++    QLibrary cupsLib(QLatin1String("@cups@/lib/libcups"), 2);
+     if(cupsLib.load()) {
+         _cupsGetDests = (CupsGetDests) cupsLib.resolve("cupsGetDests");
+         _cupsFreeDests = (CupsFreeDests) cupsLib.resolve("cupsFreeDests");
+diff --git a/src/gui/painting/qprinterinfo_unix.cpp b/src/gui/painting/qprinterinfo_unix.cpp
+index 3d15538..f0f5351 100644
+--- a/src/gui/painting/qprinterinfo_unix.cpp
++++ b/src/gui/painting/qprinterinfo_unix.cpp
+@@ -454,7 +454,7 @@ int qt_retrieveNisPrinters(QList<QPrinterDescription> *printers)
+     char *domain;
+     int err;
+ 
+-    QLibrary lib(QLatin1String("nsl"));
++    QLibrary lib(QLatin1String("@glibc@/lib/libnsl"));
+     typedef int (*ypGetDefaultDomain)(char **);
+     ypGetDefaultDomain _ypGetDefaultDomain = (ypGetDefaultDomain)lib.resolve("yp_get_default_domain");
+     typedef int (*ypAll)(const char *, const char *, const struct ypall_callback *);
+diff --git a/src/network/kernel/qhostinfo_unix.cpp b/src/network/kernel/qhostinfo_unix.cpp
+index 6b42d1e..f88b628 100644
+--- a/src/network/kernel/qhostinfo_unix.cpp
++++ b/src/network/kernel/qhostinfo_unix.cpp
+@@ -95,7 +95,7 @@ static res_state_ptr local_res = 0;
+ static void resolveLibrary()
+ {
+ #if !defined(QT_NO_LIBRARY) && !defined(Q_OS_QNX)
+-    QLibrary lib(QLatin1String("resolv"));
++    QLibrary lib(QLatin1String("@glibc@/lib/libresolv"));
+     lib.setLoadHints(QLibrary::ImprovedSearchHeuristics);
+     if (!lib.load())
+         return;
+diff --git a/src/plugins/platforms/xlib/qxlibstatic.cpp b/src/plugins/platforms/xlib/qxlibstatic.cpp
+index f8f3d69..d63c5bc 100644
+--- a/src/plugins/platforms/xlib/qxlibstatic.cpp
++++ b/src/plugins/platforms/xlib/qxlibstatic.cpp
+@@ -242,7 +242,7 @@ static void* qt_load_library_runtime(const char *library, int vernum,
+ }
+ 
+ #  define XFIXES_LOAD_RUNTIME(vernum, symbol, symbol_type) \
+-    (symbol_type)qt_load_library_runtime("libXfixes", vernum, 4, #symbol);
++    (symbol_type)qt_load_library_runtime("@libXfixes@/lib/libXfixes", vernum, 4, #symbol);
+ #  define XFIXES_LOAD_V1(symbol) \
+     XFIXES_LOAD_RUNTIME(1, symbol, Ptr##symbol)
+ #  define XFIXES_LOAD_V2(symbol) \
diff --git a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/dlopen-gtkstyle.diff b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/dlopen-gtkstyle.diff
new file mode 100644
index 000000000000..a1c9238be1ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/dlopen-gtkstyle.diff
@@ -0,0 +1,37 @@
+diff --git a/src/gui/styles/qgtkstyle_p.cpp b/src/gui/styles/qgtkstyle_p.cpp
+index 3b128e6..39434db 100644
+--- a/src/gui/styles/qgtkstyle_p.cpp
++++ b/src/gui/styles/qgtkstyle_p.cpp
+@@ -312,7 +312,7 @@ GtkStyle* QGtkStylePrivate::gtkStyle(const QHashableLatin1Literal &path)
+ void QGtkStylePrivate::resolveGtk() const
+ {
+     // enforce the "0" suffix, so we'll open libgtk-x11-2.0.so.0
+-    QLibrary libgtk(QLS("gtk-x11-2.0"), 0, 0);
++    QLibrary libgtk(QLS("@gtk@/lib/libgtk-x11-2.0"), 0, 0);
+     libgtk.setLoadHints(QLibrary::ImprovedSearchHeuristics);
+ 
+     gtk_init = (Ptr_gtk_init)libgtk.resolve("gtk_init");
+@@ -435,8 +435,8 @@ void QGtkStylePrivate::resolveGtk() const
+     pango_font_description_get_family = (Ptr_pango_font_description_get_family)libgtk.resolve("pango_font_description_get_family");
+     pango_font_description_get_style = (Ptr_pango_font_description_get_style)libgtk.resolve("pango_font_description_get_style");
+ 
+-    gnome_icon_lookup_sync = (Ptr_gnome_icon_lookup_sync)QLibrary::resolve(QLS("gnomeui-2"), 0, "gnome_icon_lookup_sync");
+-    gnome_vfs_init= (Ptr_gnome_vfs_init)QLibrary::resolve(QLS("gnomevfs-2"), 0, "gnome_vfs_init");
++    gnome_icon_lookup_sync = (Ptr_gnome_icon_lookup_sync)QLibrary::resolve(QLS("@libgnomeui@/lib/libgnomeui-2"), 0, "gnome_icon_lookup_sync");
++    gnome_vfs_init= (Ptr_gnome_vfs_init)QLibrary::resolve(QLS("@gnome_vfs@/lib/libgnomevfs-2"), 0, "gnome_vfs_init");
+ }
+ 
+ /* \internal
+@@ -608,9 +608,9 @@ void QGtkStylePrivate::cleanupGtkWidgets()
+ static bool resolveGConf()
+ {
+     if (!QGtkStylePrivate::gconf_client_get_default) {
+-        QGtkStylePrivate::gconf_client_get_default = (Ptr_gconf_client_get_default)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_default");
+-        QGtkStylePrivate::gconf_client_get_string =  (Ptr_gconf_client_get_string)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_string");
+-        QGtkStylePrivate::gconf_client_get_bool =  (Ptr_gconf_client_get_bool)QLibrary::resolve(QLS("gconf-2"), 4, "gconf_client_get_bool");
++        QGtkStylePrivate::gconf_client_get_default = (Ptr_gconf_client_get_default)QLibrary::resolve(QLS("@gconf@/lib/libgconf-2"), 4, "gconf_client_get_default");
++        QGtkStylePrivate::gconf_client_get_string =  (Ptr_gconf_client_get_string)QLibrary::resolve(QLS("@gconf@/lib/libgconf-2"), 4, "gconf_client_get_string");
++        QGtkStylePrivate::gconf_client_get_bool =  (Ptr_gconf_client_get_bool)QLibrary::resolve(QLS("@gconf@/lib/libgconf-2"), 4, "gconf_client_get_bool");
+     }
+     return (QGtkStylePrivate::gconf_client_get_default !=0);
+ }
diff --git a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/glib-2.32.patch b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/glib-2.32.patch
new file mode 100644
index 000000000000..4593c1b4ba8d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/glib-2.32.patch
@@ -0,0 +1,12 @@
+diff -Naur qt-everywhere-opensource-src-4.8.2-orig/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h qt-everywhere-opensource-src-4.8.2/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h
+--- qt-everywhere-opensource-src-4.8.2-orig/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h	2012-04-26 15:46:22.000000000 -0400
++++ qt-everywhere-opensource-src-4.8.2/src/3rdparty/javascriptcore/JavaScriptCore/wtf/Threading.h	2012-07-14 22:47:02.145152876 -0400
+@@ -89,7 +89,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-4.x/4.8/kill-legacy-darwin-apis.patch b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/kill-legacy-darwin-apis.patch
new file mode 100644
index 000000000000..c1338e98d851
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/kill-legacy-darwin-apis.patch
@@ -0,0 +1,330 @@
+diff --git a/src/corelib/io/qfilesystemengine_unix.cpp b/src/corelib/io/qfilesystemengine_unix.cpp
+index 4a9049b..c0ac9db 100644
+--- a/src/corelib/io/qfilesystemengine_unix.cpp
++++ b/src/corelib/io/qfilesystemengine_unix.cpp
+@@ -242,9 +242,8 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry,
+ #else
+     char *ret = 0;
+ # if defined(Q_OS_MAC) && !defined(Q_OS_IOS)
+-    // When using -mmacosx-version-min=10.4, we get the legacy realpath implementation,
+-    // which does not work properly with the realpath(X,0) form. See QTBUG-28282.
+-    if (QSysInfo::MacintoshVersion >= QSysInfo::MV_10_6) {
++    // In Nix-on-Darwin, we don't support ancient macOS anyway, and the deleted branch relies on
++    // a symbol that's been deprecated for years and that our CF doesn't have
+         ret = (char*)malloc(PATH_MAX + 1);
+         if (ret && realpath(entry.nativeFilePath().constData(), (char*)ret) == 0) {
+             const int savedErrno = errno; // errno is checked below, and free() might change it
+@@ -252,19 +251,6 @@ QFileSystemEntry QFileSystemEngine::canonicalName(const QFileSystemEntry &entry,
+             errno = savedErrno;
+             ret = 0;
+         }
+-    } else {
+-        // on 10.5 we can use FSRef to resolve the file path.
+-        QString path = QDir::cleanPath(entry.filePath());
+-        FSRef fsref;
+-        if (FSPathMakeRef((const UInt8 *)path.toUtf8().data(), &fsref, 0) == noErr) {
+-            CFURLRef urlref = CFURLCreateFromFSRef(NULL, &fsref);
+-            CFStringRef canonicalPath = CFURLCopyFileSystemPath(urlref, kCFURLPOSIXPathStyle);
+-            QString ret = QCFString::toQString(canonicalPath);
+-            CFRelease(canonicalPath);
+-            CFRelease(urlref);
+-            return QFileSystemEntry(ret);
+-        }
+-    }
+ # else
+ #  if _POSIX_VERSION >= 200801L
+     ret = realpath(entry.nativeFilePath().constData(), (char*)0);
+diff --git a/src/3rdparty/webkit/Source/WebCore/platform/mac/WebCoreNSStringExtras.h b/src/3rdparty/webkit/Source/WebCore/platform/mac/WebCoreNSStringExtras.h
+index 3bf7342..b6bcfc0 100644
+--- a/src/3rdparty/webkit/Source/WebCore/platform/mac/WebCoreNSStringExtras.h
++++ b/src/3rdparty/webkit/Source/WebCore/platform/mac/WebCoreNSStringExtras.h
+@@ -43,7 +43,6 @@ BOOL stringIsCaseInsensitiveEqualToString(NSString *first, NSString *second);
+ BOOL hasCaseInsensitiveSuffix(NSString *string, NSString *suffix);
+ BOOL hasCaseInsensitiveSubstring(NSString *string, NSString *substring);
+ NSString *filenameByFixingIllegalCharacters(NSString *string);
+-CFStringEncoding stringEncodingForResource(Handle resource);
+ 
+ #ifdef __cplusplus
+ }
+diff --git a/src/3rdparty/webkit/Source/WebCore/platform/mac/WebCoreNSStringExtras.mm b/src/3rdparty/webkit/Source/WebCore/platform/mac/WebCoreNSStringExtras.mm
+index d6c3f0c..c88ca76 100644
+--- a/src/3rdparty/webkit/Source/WebCore/platform/mac/WebCoreNSStringExtras.mm
++++ b/src/3rdparty/webkit/Source/WebCore/platform/mac/WebCoreNSStringExtras.mm
+@@ -68,45 +68,4 @@ BOOL hasCaseInsensitiveSubstring(NSString *string, NSString *substring)
+     return filename;
+ }
+ 
+-CFStringEncoding stringEncodingForResource(Handle resource)
+-{
+-    short resRef = HomeResFile(resource);
+-    if (ResError() != noErr)
+-        return NSMacOSRomanStringEncoding;
+-    
+-    // Get the FSRef for the current resource file
+-    FSRef fref;
+-    OSStatus error = FSGetForkCBInfo(resRef, 0, NULL, NULL, NULL, &fref, NULL);
+-    if (error != noErr)
+-        return NSMacOSRomanStringEncoding;
+-    
+-    RetainPtr<CFURLRef> url(AdoptCF, CFURLCreateFromFSRef(NULL, &fref));
+-    if (!url)
+-        return NSMacOSRomanStringEncoding;
+-
+-    NSString *path = [(NSURL *)url.get() path];
+-
+-    // Get the lproj directory name
+-    path = [path stringByDeletingLastPathComponent];
+-    if (!stringIsCaseInsensitiveEqualToString([path pathExtension], @"lproj"))
+-        return NSMacOSRomanStringEncoding;
+-    
+-    NSString *directoryName = [[path stringByDeletingPathExtension] lastPathComponent];
+-    RetainPtr<CFStringRef> locale(AdoptCF, CFLocaleCreateCanonicalLocaleIdentifierFromString(NULL, (CFStringRef)directoryName));
+-    if (!locale)
+-        return NSMacOSRomanStringEncoding;
+-
+-    LangCode lang;
+-    RegionCode region;
+-    error = LocaleStringToLangAndRegionCodes([(NSString *)locale.get() UTF8String], &lang, &region);
+-    if (error != noErr)
+-        return NSMacOSRomanStringEncoding;
+-
+-    TextEncoding encoding;
+-    error = UpgradeScriptInfoToTextEncoding(kTextScriptDontCare, lang, region, NULL, &encoding);
+-    if (error != noErr)
+-        return NSMacOSRomanStringEncoding;
+-    
+-    return encoding;
+-}
+ 
+diff --git a/src/3rdparty/webkit/Source/WebCore/plugins/mac/PluginPackageMac.cpp b/src/3rdparty/webkit/Source/WebCore/plugins/mac/PluginPackageMac.cpp
+index 865ea32..20bda8d 100644
+--- a/src/3rdparty/webkit/Source/WebCore/plugins/mac/PluginPackageMac.cpp
++++ b/src/3rdparty/webkit/Source/WebCore/plugins/mac/PluginPackageMac.cpp
+@@ -101,33 +101,6 @@ static WTF::RetainPtr<CFDictionaryRef> readPListFile(CFStringRef fileName, bool
+     return map;
+ }
+ 
+-static Vector<String> stringListFromResourceId(SInt16 id)
+-{
+-    Vector<String> list;
+-
+-    Handle handle = Get1Resource('STR#', id);
+-    if (!handle)
+-        return list;
+-
+-    CFStringEncoding encoding = stringEncodingForResource(handle);
+-
+-    unsigned char* p = (unsigned char*)*handle;
+-    if (!p)
+-        return list;
+-
+-    SInt16 count = *(SInt16*)p;
+-    p += sizeof(SInt16);
+-
+-    for (SInt16 i = 0; i < count; ++i) {
+-        unsigned char length = *p;
+-        WTF::RetainPtr<CFStringRef> str = CFStringCreateWithPascalString(0, p, encoding);
+-        list.append(str.get());
+-        p += 1 + length;
+-    }
+-
+-    return list;
+-}
+-
+ bool PluginPackage::fetchInfo()
+ {
+     if (!load())
+@@ -202,36 +175,8 @@ bool PluginPackage::fetchInfo()
+         m_description = (CFStringRef)CFBundleGetValueForInfoDictionaryKey(m_module, CFSTR("WebPluginDescription"));
+ 
+     } else {
+-        int resFile = CFBundleOpenBundleResourceMap(m_module);
+-
+-        UseResFile(resFile);
+-
+-        Vector<String> mimes = stringListFromResourceId(MIMEListStringStringNumber);
+-
+-        if (mimes.size() % 2 != 0)
+-            return false;
+-
+-        Vector<String> descriptions = stringListFromResourceId(MIMEDescriptionStringNumber);
+-        if (descriptions.size() != mimes.size() / 2)
+-            return false;
+-
+-        for (size_t i = 0;  i < mimes.size(); i += 2) {
+-            String mime = mimes[i].lower();
+-            Vector<String> extensions;
+-            mimes[i + 1].lower().split(UChar(','), extensions);
+-
+-            m_mimeToExtensions.set(mime, extensions);
+-
+-            m_mimeToDescriptions.set(mime, descriptions[i / 2]);
+-        }
+-
+-        Vector<String> names = stringListFromResourceId(PluginNameOrDescriptionStringNumber);
+-        if (names.size() == 2) {
+-            m_description = names[0];
+-            m_name = names[1];
+-        }
+-
+-        CFBundleCloseBundleResourceMap(m_module, resFile);
++        LOG(Plugins, "Nix removed ancient code that relies on long-deprecated functionality that we don't want to support!");
++        return false;
+     }
+ 
+     LOG(Plugins, "PluginPackage::fetchInfo(): Found plug-in '%s'", m_name.utf8().data());
+diff --git a/src/3rdparty/webkit/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm b/src/3rdparty/webkit/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm
+index b206e48..669d442 100644
+--- a/src/3rdparty/webkit/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm
++++ b/src/3rdparty/webkit/Source/WebKit2/Shared/Plugins/Netscape/mac/NetscapePluginModuleMac.mm
+@@ -26,7 +26,6 @@
+ #import "config.h"
+ #import "NetscapePluginModule.h"
+ 
+-#import <WebCore/WebCoreNSStringExtras.h>
+ #import <wtf/HashSet.h>
+ 
+ using namespace WebCore;
+@@ -196,132 +195,6 @@ static bool getPluginInfoFromPropertyLists(CFBundleRef bundle, PluginInfo& plugi
+     return true;    
+ }
+ 
+-class ResourceMap {
+-public:
+-    explicit ResourceMap(CFBundleRef bundle)
+-        : m_bundle(bundle)
+-        , m_currentResourceFile(CurResFile())
+-        , m_bundleResourceMap(CFBundleOpenBundleResourceMap(m_bundle))
+-    {
+-        UseResFile(m_bundleResourceMap);
+-    }
+-
+-    ~ResourceMap()
+-    {
+-        // Close the resource map.
+-        CFBundleCloseBundleResourceMap(m_bundle, m_bundleResourceMap);
+-        
+-        // And restore the old resource.
+-        UseResFile(m_currentResourceFile);
+-    }
+-
+-    bool isValid() const { return m_bundleResourceMap != -1; }
+-
+-private:
+-    CFBundleRef m_bundle;
+-    ResFileRefNum m_currentResourceFile;
+-    ResFileRefNum m_bundleResourceMap;
+-};
+-
+-static bool getStringListResource(ResID resourceID, Vector<String>& stringList) {
+-    Handle stringListHandle = Get1Resource('STR#', resourceID);
+-    if (!stringListHandle || !*stringListHandle)
+-        return false;
+-
+-    // Get the string list size.
+-    Size stringListSize = GetHandleSize(stringListHandle);
+-    if (stringListSize < static_cast<Size>(sizeof(UInt16)))
+-        return false;
+-
+-    CFStringEncoding stringEncoding = stringEncodingForResource(stringListHandle);
+-
+-    unsigned char* ptr = reinterpret_cast<unsigned char*>(*stringListHandle);
+-    unsigned char* end = ptr + stringListSize;
+-    
+-    // Get the number of strings in the string list.
+-    UInt16 numStrings = *reinterpret_cast<UInt16*>(ptr);
+-    ptr += sizeof(UInt16);
+-
+-    for (UInt16 i = 0; i < numStrings; ++i) {
+-        // We're past the end of the string, bail.
+-        if (ptr >= end)
+-            return false;
+-
+-        // Get the string length.
+-        unsigned char stringLength = *ptr++;
+-
+-        RetainPtr<CFStringRef> cfString(AdoptCF, CFStringCreateWithBytesNoCopy(kCFAllocatorDefault, ptr, stringLength, stringEncoding, false, kCFAllocatorNull));
+-        if (!cfString.get())
+-            return false;
+-
+-        stringList.append(cfString.get());
+-        ptr += stringLength;
+-    }
+-
+-    if (ptr != end)
+-        return false;
+-
+-    return true;
+-}
+-
+-static const ResID PluginNameOrDescriptionStringNumber = 126;
+-static const ResID MIMEDescriptionStringNumber = 127;
+-static const ResID MIMEListStringStringNumber = 128;
+-
+-static bool getPluginInfoFromCarbonResources(CFBundleRef bundle, PluginInfo& pluginInfo)
+-{
+-    ResourceMap resourceMap(bundle);
+-    if (!resourceMap.isValid())
+-        return false;
+-
+-    // Get the description and name string list.
+-    Vector<String> descriptionAndName;
+-    if (!getStringListResource(PluginNameOrDescriptionStringNumber, descriptionAndName))
+-        return false;
+-
+-    // Get the MIME types and extensions string list. This list needs to be a multiple of two.
+-    Vector<String> mimeTypesAndExtensions;
+-    if (!getStringListResource(MIMEListStringStringNumber, mimeTypesAndExtensions))
+-        return false;
+-
+-    if (mimeTypesAndExtensions.size() % 2)
+-        return false;
+-
+-    // Now get the MIME type descriptions string list. This string list needs to be the same length as the number of MIME types.
+-    Vector<String> mimeTypeDescriptions;
+-    if (!getStringListResource(MIMEDescriptionStringNumber, mimeTypeDescriptions))
+-        return false;
+-
+-    // Add all MIME types.
+-    for (size_t i = 0; i < mimeTypesAndExtensions.size() / 2; ++i) {
+-        MimeClassInfo mimeClassInfo;
+-        
+-        const String& mimeType = mimeTypesAndExtensions[i * 2];
+-        String description;
+-        if (i < mimeTypeDescriptions.size())
+-            description = mimeTypeDescriptions[i];
+-        
+-        mimeClassInfo.type = mimeType.lower();
+-        mimeClassInfo.desc = description;
+-        
+-        Vector<String> extensions;
+-        mimeTypesAndExtensions[i * 2 + 1].split(',', extensions);
+-        
+-        for (size_t i = 0; i < extensions.size(); ++i)
+-            mimeClassInfo.extensions.append(extensions[i].lower());
+-
+-        pluginInfo.mimes.append(mimeClassInfo);
+-    }
+-
+-    // Set the description and name if they exist.
+-    if (descriptionAndName.size() > 0)
+-        pluginInfo.desc = descriptionAndName[0];
+-    if (descriptionAndName.size() > 1)
+-        pluginInfo.name = descriptionAndName[1];
+-
+-    return true;
+-}
+-
+ bool NetscapePluginModule::getPluginInfo(const String& pluginPath, PluginInfoStore::Plugin& plugin)
+ {
+     RetainPtr<CFStringRef> bundlePath(AdoptCF, pluginPath.createCFString());
+@@ -344,8 +217,7 @@ static bool getPluginInfoFromCarbonResources(CFBundleRef bundle, PluginInfo& plu
+         return false;
+     
+     // Check that there's valid info for this plug-in.
+-    if (!getPluginInfoFromPropertyLists(bundle.get(), plugin.info) &&
+-        !getPluginInfoFromCarbonResources(bundle.get(), plugin.info))
++    if (!getPluginInfoFromPropertyLists(bundle.get(), plugin.info))
+         return false;
+     
+     plugin.path = pluginPath;
diff --git a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/libressl.patch b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/libressl.patch
new file mode 100644
index 000000000000..5432610d9dc9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/libressl.patch
@@ -0,0 +1,64 @@
+$OpenBSD: patch-src_network_ssl_qsslsocket_openssl_symbols_cpp,v 1.3 2015/09/17 12:24:42 dcoppa Exp $
+--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp	Wed Sep 16 13:27:39 2015
++++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp	Wed Sep 16 13:33:06 2015
+@@ -228,13 +228,17 @@ DEFINEFUNC(int, SSL_shutdown, SSL *a, a, return -1, re
+ #ifndef OPENSSL_NO_SSL2
+ DEFINEFUNC(const SSL_METHOD *, SSLv2_client_method, DUMMYARG, DUMMYARG, return 0, return)
+ #endif
++#ifndef OPENSSL_NO_SSL3
+ 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)
+ #ifndef OPENSSL_NO_SSL2
+ DEFINEFUNC(const SSL_METHOD *, SSLv2_server_method, DUMMYARG, DUMMYARG, return 0, return)
+ #endif
++#ifndef OPENSSL_NO_SSL3
+ 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)
+ #else
+@@ -822,13 +826,17 @@ bool q_resolveOpenSslSymbols()
+ #ifndef OPENSSL_NO_SSL2
+     RESOLVEFUNC(SSLv2_client_method)
+ #endif
++#ifndef OPENSSL_NO_SSL3
+     RESOLVEFUNC(SSLv3_client_method)
++#endif
+     RESOLVEFUNC(SSLv23_client_method)
+     RESOLVEFUNC(TLSv1_client_method)
+ #ifndef OPENSSL_NO_SSL2
+     RESOLVEFUNC(SSLv2_server_method)
+ #endif
++#ifndef OPENSSL_NO_SSL3
+     RESOLVEFUNC(SSLv3_server_method)
++#endif
+     RESOLVEFUNC(SSLv23_server_method)
+     RESOLVEFUNC(TLSv1_server_method)
+     RESOLVEFUNC(X509_NAME_entry_count)
+--- a/src/network/ssl/qsslsocket_openssl.cpp	Thu May  7 16:14:44 2015
++++ b/src/network/ssl/qsslsocket_openssl.cpp	Wed Sep 16 13:30:03 2015
+@@ -267,15 +267,19 @@ init_context:
+ #endif
+         break;
+     case QSsl::SslV3:
++#ifndef OPENSSL_NO_SSL3
+         ctx = q_SSL_CTX_new(client ? q_SSLv3_client_method() : q_SSLv3_server_method());
++#else
++        ctx = 0; // SSL 3 not supported by the system, but chosen deliberately -> error
++#endif
+         break;
+-    case QSsl::SecureProtocols: // SslV2 will be disabled below
+-    case QSsl::TlsV1SslV3: // SslV2 will be disabled below
+     case QSsl::AnyProtocol:
+-    default:
+         ctx = q_SSL_CTX_new(client ? q_SSLv23_client_method() : q_SSLv23_server_method());
+         break;
+     case QSsl::TlsV1:
++    case QSsl::SecureProtocols:
++    case QSsl::TlsV1SslV3:
++    default:
+         ctx = q_SSL_CTX_new(client ? q_TLSv1_client_method() : q_TLSv1_server_method());
+         break;
+     }
diff --git a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/parallel-configure.patch b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/parallel-configure.patch
new file mode 100644
index 000000000000..b9b9d6d0a683
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/parallel-configure.patch
@@ -0,0 +1,22 @@
+--- a/configure
++++ b/configure
+@@ -1087,2 +1087,3 @@ fi
+ #-------------------------------------------------------------------------------
++JOBS=
+ 
+@@ -2528,2 +2529,5 @@ while [ "$#" -gt 0 ]; do
+         ;;
++    jobs)
++        JOBS=-j$VAL
++        ;;
+     *)
+@@ -5072,3 +5076,3 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
+         if "$WHICH" makedepend >/dev/null 2>&1 && grep 'depend:' "$mkfile" >/dev/null 2>&1; then
+-            (cd "$outpath/qmake" && "$MAKE" -f "$mkfile" depend) >/dev/null 2>&1
++            (cd "$outpath/qmake" && "$MAKE" $JOBS -f "$mkfile" depend) >/dev/null 2>&1
+            sed "s,^.*/\([^/]*.o\):,\1:,g" "$mkfile" >"$mkfile.tmp"
+@@ -5080,3 +5084,3 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
+     QMAKE_BUILD_ERROR=no
+-    (cd "$outpath/qmake"; "$MAKE") || QMAKE_BUILD_ERROR=yes
++    (cd "$outpath/qmake"; "$MAKE" $JOBS) || QMAKE_BUILD_ERROR=yes
+     [ '!' -z "$QCONFIG_H" ] && mv -f "$QCONFIG_H" "$QMAKE_QCONFIG_H" #move qmake's qconfig.h to qconfig.h.qmake
diff --git a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/patch-qthread-stacksize.diff b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/patch-qthread-stacksize.diff
new file mode 100644
index 000000000000..53a4c70ac3ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/patch-qthread-stacksize.diff
@@ -0,0 +1,54 @@
+--- a/src/corelib/thread/qthread_unix.cpp.orig	2015-11-23 19:05:40.000000000 +0100
++++ b/src/corelib/thread/qthread_unix.cpp	2015-11-24 11:22:31.000000000 +0100
+@@ -79,6 +79,7 @@
+ #endif
+ 
++#include <sys/resource.h> // getrlimit/setrlimit
+ #if defined(Q_OS_MAC)
+ # ifdef qDebug
+ #   define old_qDebug qDebug
+ #   undef qDebug
+@@ -649,6 +650,43 @@
+ #endif // QT_HAS_THREAD_PRIORITY_SCHEDULING
+ 
+ 
++    if (d->stackSize == 0) {
++        // Fix the default (too small) stack size for threads on OS X,
++        // which also affects the thread pool.
++        // See also:
++        // https://bugreports.qt.io/browse/QTBUG-2568
++        // This fix can also be found in Chromium:
++        // https://chromium.googlesource.com/chromium/src.git/+/master/base/threading/platform_thread_mac.mm#186
++
++        // The Mac OS X default for a pthread stack size is 512kB.
++        // Libc-594.1.4/pthreads/pthread.c's pthread_attr_init uses
++        // DEFAULT_STACK_SIZE for this purpose.
++        //
++        // 512kB isn't quite generous enough for some deeply recursive threads that
++        // otherwise request the default stack size by specifying 0. Here, adopt
++        // glibc's behavior as on Linux, which is to use the current stack size
++        // limit (ulimit -s) as the default stack size. See
++        // glibc-2.11.1/nptl/nptl-init.c's __pthread_initialize_minimal_internal. To
++        // avoid setting the limit below the Mac OS X default or the minimum usable
++        // stack size, these values are also considered. If any of these values
++        // can't be determined, or if stack size is unlimited (ulimit -s unlimited),
++        // stack_size is left at 0 to get the system default.
++        //
++        // Mac OS X normally only applies ulimit -s to the main thread stack. On
++        // contemporary OS X and Linux systems alike, this value is generally 8MB
++        // or in that neighborhood.
++        size_t default_stack_size = 0;
++        struct rlimit stack_rlimit;
++        if (pthread_attr_getstacksize(&attr, &default_stack_size) == 0 &&
++            getrlimit(RLIMIT_STACK, &stack_rlimit) == 0 &&
++            stack_rlimit.rlim_cur != RLIM_INFINITY) {
++            default_stack_size =
++                    std::max(std::max(default_stack_size,
++                                      static_cast<size_t>(PTHREAD_STACK_MIN)),
++                             static_cast<size_t>(stack_rlimit.rlim_cur));
++        }
++        d->stackSize = default_stack_size;
++    }
+     if (d->stackSize > 0) {
+ #if defined(_POSIX_THREAD_ATTR_STACKSIZE) && (_POSIX_THREAD_ATTR_STACKSIZE-0 > 0)
+         int code = pthread_attr_setstacksize(&attr, d->stackSize);
diff --git a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qmake-hook.sh b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qmake-hook.sh
new file mode 100644
index 000000000000..f288e99dd12a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qmake-hook.sh
@@ -0,0 +1,16 @@
+qmakeConfigurePhase() {
+    runHook preConfigure
+
+    $QMAKE PREFIX=$out $qmakeFlags
+
+    if ! [[ -v enableParallelBuilding ]]; then
+        enableParallelBuilding=1
+        echo "qmake4Hook: enabled parallel building"
+    fi
+
+    runHook postConfigure
+}
+
+export QMAKE=@qt4@/bin/qmake
+
+configurePhase=qmakeConfigurePhase
diff --git a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qsettings-recursive-global-mutex.patch b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qsettings-recursive-global-mutex.patch
new file mode 100644
index 000000000000..229123c54f76
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qsettings-recursive-global-mutex.patch
@@ -0,0 +1,17 @@
+Calling qsettings before constructing qapplications causes a dead-lock.
+
+http://sourceforge.net/tracker/?func=detail&aid=3168620&group_id=4932&atid=104932
+http://developer.qt.nokia.com/forums/viewthread/10365
+
+
+--- ./src/corelib/io/qsettings.cpp.orig
++++ ./src/corelib/io/qsettings.cpp
+@@ -122,7 +122,7 @@
+ Q_GLOBAL_STATIC(ConfFileCache, unusedCacheFunc)
+ Q_GLOBAL_STATIC(PathHash, pathHashFunc)
+ Q_GLOBAL_STATIC(CustomFormatVector, customFormatVectorFunc)
+-Q_GLOBAL_STATIC(QMutex, globalMutex)
++Q_GLOBAL_STATIC_WITH_ARGS(QMutex, globalMutex, (QMutex::Recursive))
+ static QSettings::Format globalDefaultFormat = QSettings::NativeFormat;
+ 
+ #ifndef Q_OS_WIN
diff --git a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt-4.8.7-unixmake-darwin.patch b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt-4.8.7-unixmake-darwin.patch
new file mode 100644
index 000000000000..99a36a24fe43
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt-4.8.7-unixmake-darwin.patch
@@ -0,0 +1,11 @@
+--- a/qmake/generators/unix/unixmake.cpp
++++ b/qmake/generators/unix/unixmake.cpp
+@@ -831,7 +831,7 @@ UnixMakefileGenerator::defaultInstall(const QString &t)
+             else if(project->first("TEMPLATE") == "app" && !project->isEmpty("QMAKE_STRIPFLAGS_APP"))
+                 ret += " " + var("QMAKE_STRIPFLAGS_APP");
+             if(bundle)
+-                ret = " \"" + dst_targ + "/Contents/MacOS/$(QMAKE_TARGET)\"";
++                ret += " \"" + dst_targ + "/Contents/MacOS/$(QMAKE_TARGET)\"";
+             else
+                 ret += " \"" + dst_targ + "\"";
+         }
diff --git a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt-musl-iconv-no-bom.patch b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt-musl-iconv-no-bom.patch
new file mode 100644
index 000000000000..35380ad6714d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt-musl-iconv-no-bom.patch
@@ -0,0 +1,11 @@
+--- qt-everywhere-opensource-src-4.8.5/src/corelib/codecs/qiconvcodec.cpp.orig
++++ qt-everywhere-opensource-src-4.8.5/src/corelib/codecs/qiconvcodec.cpp
+@@ -62,7 +62,7 @@
+ #elif defined(Q_OS_AIX)
+ #  define NO_BOM
+ #  define UTF16 "UCS-2"
+-#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC)
++#elif defined(Q_OS_FREEBSD) || defined(Q_OS_MAC) || (defined(Q_OS_LINUX) && !defined(__GLIBC__))
+ #  define NO_BOM
+ #  if Q_BYTE_ORDER == Q_BIG_ENDIAN
+ #    define UTF16 "UTF-16BE"
diff --git a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt-musl.patch b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt-musl.patch
new file mode 100644
index 000000000000..90b9ccda08c9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt-musl.patch
@@ -0,0 +1,14 @@
+--- qt-everywhere-opensource-src-4.8.5/mkspecs/linux-g++/qplatformdefs.h.orig
++++ qt-everywhere-opensource-src-4.8.5/mkspecs/linux-g++/qplatformdefs.h
+@@ -86,11 +86,7 @@
+ 
+ #undef QT_SOCKLEN_T
+ 
+-#if defined(__GLIBC__) && (__GLIBC__ >= 2)
+ #define QT_SOCKLEN_T            socklen_t
+-#else
+-#define QT_SOCKLEN_T            int
+-#endif
+ 
+ #if defined(_XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)
+ #define QT_SNPRINTF		::snprintf
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
new file mode 100644
index 000000000000..dfd1d8b893b0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt4-gcc6.patch
@@ -0,0 +1,33 @@
+--- qt-everywhere-opensource-src-4.8.7/configure.gcc6	2016-04-15 07:04:19.430268222 -0500
++++ qt-everywhere-opensource-src-4.8.7/configure	2016-04-15 07:05:22.157568689 -0500
+@@ -7744,7 +7744,7 @@
+     *-g++*)
+ 	# Check gcc's version
+ 	case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
+-	    5*|4*|3.4*)
++	    9*|8*|7*|6*|5*|4*|3.4*)
+ 		;;
+             3.3*)
+                 canBuildWebKit="no"
+@@ -8060,7 +8060,7 @@
+     3.*)
+         COMPILER_VERSION="3.*"
+         ;;
+-    5*|4.*)
++    9*|8*|7*|6*|5*|4.*)
+         COMPILER_VERSION="4"
+         ;;
+     *)
+--- qt-everywhere-opensource-src-4.8.7/src/xmlpatterns/api/qcoloroutput_p.h.gcc6	2015-05-07 09:14:48.000000000 -0500
++++ qt-everywhere-opensource-src-4.8.7/src/xmlpatterns/api/qcoloroutput_p.h	2016-04-15 07:04:19.431268227 -0500
+@@ -70,8 +70,8 @@
+             ForegroundShift = 10,
+             BackgroundShift = 20,
+             SpecialShift    = 20,
+-            ForegroundMask  = ((1 << ForegroundShift) - 1) << ForegroundShift,
+-            BackgroundMask  = ((1 << BackgroundShift) - 1) << BackgroundShift
++            ForegroundMask  = 0x1f << ForegroundShift,
++            BackgroundMask  = 0x7 << BackgroundShift
+         };
+ 
+     public:
diff --git a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt4-openssl-1.1.patch b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt4-openssl-1.1.patch
new file mode 100644
index 000000000000..1931ceb0c749
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/qt4-openssl-1.1.patch
@@ -0,0 +1,398 @@
+--- a/src/network/ssl/qsslcertificate.cpp
++++ b/src/network/ssl/qsslcertificate.cpp
+@@ -259,10 +259,10 @@
+ QByteArray QSslCertificate::version() const
+ {
+     QMutexLocker lock(QMutexPool::globalInstanceGet(d.data()));
+-    if (d->versionString.isEmpty() && d->x509)
++    if (d->versionString.isEmpty() && d->x509) {
+         d->versionString =
+-            QByteArray::number(qlonglong(q_ASN1_INTEGER_get(d->x509->cert_info->version)) + 1);
+-
++	    QByteArray::number(qlonglong(q_X509_get_version(d->x509)) + 1);
++    }
+     return d->versionString;
+ }
+ 
+@@ -276,7 +276,7 @@
+ {
+     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);
+         // if we cannot convert to a long, just output the hexadecimal number
+         if (serialNumber->length > 4) {
+             QByteArray hexString;
+@@ -489,24 +489,33 @@
+     QSslKey key;
+ 
+     key.d->type = QSsl::PublicKey;
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+     X509_PUBKEY *xkey = d->x509->cert_info->key;
++#else
++    X509_PUBKEY *xkey = q_X509_get_X509_PUBKEY(d->x509);
++#endif
+     EVP_PKEY *pkey = q_X509_PUBKEY_get(xkey);
+     Q_ASSERT(pkey);
+ 
+-    if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_RSA) {
++    int key_id;
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++    key_id = q_EVP_PKEY_type(pkey->type);
++#else
++    key_id = q_EVP_PKEY_base_id(pkey);
++#endif
++    if (key_id == 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 (key_id == EVP_PKEY_DSA) {
+         key.d->dsa = q_EVP_PKEY_get1_DSA(pkey);
+         key.d->algorithm = QSsl::Dsa;
+         key.d->isNull = false;
+-    } else if (q_EVP_PKEY_type(pkey->type) == EVP_PKEY_DH) {
++    } else if (key_id == EVP_PKEY_DH) {
+         // DH unsupported
+     } else {
+         // error?
+     }
+-
+     q_EVP_PKEY_free(pkey);
+     return key;
+ }
+--- a/src/network/ssl/qsslkey.cpp
++++ b/src/network/ssl/qsslkey.cpp
+@@ -321,8 +321,19 @@
+ {
+     if (d->isNull)
+         return -1;
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+     return (d->algorithm == QSsl::Rsa)
+            ? q_BN_num_bits(d->rsa->n) : q_BN_num_bits(d->dsa->p);
++#else
++    if (d->algorithm == QSsl::Rsa) {
++        return q_RSA_bits(d->rsa);
++    }else{
++        BIGNUM *p = NULL;
++        q_DSA_get0_pqg(d->dsa, &p, NULL, NULL);
++	return q_BN_num_bits(p);
++    }
++#endif
++
+ }
+ 
+ /*!
+--- a/src/network/ssl/qsslsocket_openssl.cpp
++++ b/src/network/ssl/qsslsocket_openssl.cpp
+@@ -93,6 +93,7 @@
+ bool QSslSocketPrivate::s_loadedCiphersAndCerts = false;
+ bool QSslSocketPrivate::s_loadRootCertsOnDemand = false;
+ 
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ /* \internal
+ 
+     From OpenSSL's thread(3) manual page:
+@@ -174,6 +175,8 @@
+ }
+ } // extern "C"
+ 
++#endif //OPENSSL_VERSION_NUMBER >= 0x10100000L
++
+ QSslSocketBackendPrivate::QSslSocketBackendPrivate()
+     : ssl(0),
+       ctx(0),
+@@ -222,9 +225,12 @@
+             ciph.d->encryptionMethod = descriptionList.at(4).mid(4);
+         ciph.d->exportable = (descriptionList.size() > 6 && descriptionList.at(6) == QLatin1String("export"));
+ 
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+         ciph.d->bits = cipher->strength_bits;
+         ciph.d->supportedBits = cipher->alg_bits;
+-
++#else
++	ciph.d->bits = q_SSL_CIPHER_get_bits(cipher, &ciph.d->supportedBits);
++#endif
+     }
+     return ciph;
+ }
+@@ -367,7 +373,7 @@
+         //
+         // See also: QSslContext::fromConfiguration()
+         if (caCertificate.expiryDate() >= QDateTime::currentDateTime()) {
+-            q_X509_STORE_add_cert(ctx->cert_store, (X509 *)caCertificate.handle());
++	  q_X509_STORE_add_cert(q_SSL_CTX_get_cert_store(ctx), (X509 *)caCertificate.handle());
+         }
+     }
+ 
+@@ -504,8 +510,10 @@
+ */
+ void QSslSocketPrivate::deinitialize()
+ {
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+     q_CRYPTO_set_id_callback(0);
+     q_CRYPTO_set_locking_callback(0);
++#endif
+ }
+ 
+ /*!
+@@ -526,13 +534,17 @@
+         return false;
+ 
+     // Check if the library itself needs to be initialized.
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+     QMutexLocker locker(openssl_locks()->initLock());
++#endif
+     if (!s_libraryLoaded) {
+         s_libraryLoaded = true;
+ 
+         // Initialize OpenSSL.
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+         q_CRYPTO_set_id_callback(id_function);
+         q_CRYPTO_set_locking_callback(locking_function);
++#endif
+         if (q_SSL_library_init() != 1)
+             return false;
+         q_SSL_load_error_strings();
+@@ -571,7 +583,9 @@
+ 
+ void QSslSocketPrivate::ensureCiphersAndCertsLoaded()
+ {
+-    QMutexLocker locker(openssl_locks()->initLock());
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++  QMutexLocker locker(openssl_locks()->initLock());
++#endif
+     if (s_loadedCiphersAndCerts)
+         return;
+     s_loadedCiphersAndCerts = true;
+@@ -663,13 +677,18 @@
+     STACK_OF(SSL_CIPHER) *supportedCiphers = q_SSL_get_ciphers(mySsl);
+     for (int i = 0; i < q_sk_SSL_CIPHER_num(supportedCiphers); ++i) {
+         if (SSL_CIPHER *cipher = q_sk_SSL_CIPHER_value(supportedCiphers, i)) {
+-            if (cipher->valid) {
++
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
++	  if (cipher->valid) {
++#endif
+                 QSslCipher ciph = QSslSocketBackendPrivate::QSslCipher_from_SSL_CIPHER(cipher);
+                 if (!ciph.isNull()) {
+                     if (!ciph.name().toLower().startsWith(QLatin1String("adh")))
+                         ciphers << ciph;
+                 }
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+             }
++#endif
+         }
+     }
+ 
+--- a/src/network/ssl/qsslsocket_openssl_symbols.cpp
++++ b/src/network/ssl/qsslsocket_openssl_symbols.cpp
+@@ -290,6 +290,22 @@
+ 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(X509_STORE *, SSL_CTX_get_cert_store, const SSL_CTX *ctx, ctx, return 0, return)
++
++DEFINEFUNC(ASN1_INTEGER *, X509_get_serialNumber, X509 *x, x, return 0, return)
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++DEFINEFUNC(int, EVP_PKEY_id, const EVP_PKEY *pkey, pkey, return 0, return)
++DEFINEFUNC(int, EVP_PKEY_base_id, const EVP_PKEY *pkey, pkey, return 0, return)
++DEFINEFUNC2(int, SSL_CIPHER_get_bits, const SSL_CIPHER *cipher, cipher, int *alg_bits, alg_bits, return 0, return)
++DEFINEFUNC2(long, SSL_CTX_set_options, SSL_CTX *ctx, ctx, long options, options, return 0, return)
++DEFINEFUNC(long, X509_get_version, X509 *x, x, return 0, return)
++DEFINEFUNC(X509_PUBKEY *, X509_get_X509_PUBKEY, X509 *x, x, return 0, return)
++DEFINEFUNC(int, RSA_bits,  const RSA *rsa, rsa, return 0, return)
++DEFINEFUNC(int, DSA_security_bits, const DSA *dsa, dsa, return 0, return)
++DEFINEFUNC(ASN1_TIME *, X509_get_notAfter, X509 *x, x, return 0, return)
++DEFINEFUNC(ASN1_TIME *, X509_get_notBefore, X509 *x, x, return 0, return)
++DEFINEFUNC4(void, DSA_get0_pqg, const DSA *d, d, BIGNUM **p, p, BIGNUM **q, q, BIGNUM **g, g, return, return)
++#endif
+ 
+ #ifdef Q_OS_SYMBIAN
+ #define RESOLVEFUNC(func, ordinal, lib) \
+@@ -801,6 +817,7 @@
+     RESOLVEFUNC(SSL_CTX_use_PrivateKey)
+     RESOLVEFUNC(SSL_CTX_use_RSAPrivateKey)
+     RESOLVEFUNC(SSL_CTX_use_PrivateKey_file)
++    RESOLVEFUNC(SSL_CTX_get_cert_store)
+     RESOLVEFUNC(SSL_accept)
+     RESOLVEFUNC(SSL_clear)
+     RESOLVEFUNC(SSL_connect)
+@@ -823,6 +840,23 @@
+     RESOLVEFUNC(SSL_set_connect_state)
+     RESOLVEFUNC(SSL_shutdown)
+     RESOLVEFUNC(SSL_write)
++
++    RESOLVEFUNC(X509_get_serialNumber)
++#if OPENSSL_VERSION_NUMBER >= 0x10100000L
++    RESOLVEFUNC(SSL_CTX_ctrl)
++    RESOLVEFUNC(EVP_PKEY_id)
++    RESOLVEFUNC(EVP_PKEY_base_id)
++    RESOLVEFUNC(SSL_CIPHER_get_bits)
++    RESOLVEFUNC(SSL_CTX_set_options)
++    RESOLVEFUNC(X509_get_version)
++    RESOLVEFUNC(X509_get_X509_PUBKEY)
++    RESOLVEFUNC(RSA_bits)
++    RESOLVEFUNC(DSA_security_bits)
++    RESOLVEFUNC(DSA_get0_pqg)
++    RESOLVEFUNC(X509_get_notAfter)
++    RESOLVEFUNC(X509_get_notBefore)
++#endif
++
+ #ifndef OPENSSL_NO_SSL2
+     RESOLVEFUNC(SSLv2_client_method)
+ #endif
+--- a/src/network/ssl/qsslsocket_openssl_symbols_p.h
++++ b/src/network/ssl/qsslsocket_openssl_symbols_p.h
+@@ -399,7 +399,25 @@
+ 		PEM_ASN1_write_bio((int (*)(void*, unsigned char**))q_i2d_DSAPrivateKey,PEM_STRING_DSA,\
+ 			bp,(char *)x,enc,kstr,klen,cb,u)
+ #endif
++
++X509_STORE * q_SSL_CTX_get_cert_store(const SSL_CTX *ctx);
++ASN1_INTEGER * q_X509_get_serialNumber(X509 *x);
++
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ #define q_SSL_CTX_set_options(ctx,op) q_SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL)
++#define q_X509_get_version(x) X509_get_version(x)
++#else
++int q_EVP_PKEY_id(const EVP_PKEY *pkey);
++int q_EVP_PKEY_base_id(const EVP_PKEY *pkey);
++int q_SSL_CIPHER_get_bits(const SSL_CIPHER *cipher, int *alg_bits);
++long q_SSL_CTX_set_options(SSL_CTX *ctx, long options);
++long q_X509_get_version(X509 *x);
++X509_PUBKEY * q_X509_get_X509_PUBKEY(X509 *x);
++int q_RSA_bits(const RSA *rsa);
++int q_DSA_security_bits(const DSA *dsa);
++void q_DSA_get0_pqg(const DSA *d, BIGNUM **p, BIGNUM **q, BIGNUM **g);
++#endif
++
+ #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))
+@@ -410,8 +428,15 @@
+ #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)
++
++#if OPENSSL_VERSION_NUMBER < 0x10100000L
+ #define q_X509_get_notAfter(x) X509_get_notAfter(x)
+ #define q_X509_get_notBefore(x) X509_get_notBefore(x)
++#else
++ASN1_TIME *q_X509_get_notAfter(X509 *x);
++ASN1_TIME *q_X509_get_notBefore(X509 *x);
++#endif
++
+ #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,\
+--- qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslcertificate.cpp.omv~	2017-03-15 02:27:18.143322736 +0100
++++ qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslcertificate.cpp	2017-03-15 02:29:56.215819741 +0100
+@@ -696,7 +696,7 @@
+         unsigned char *data = 0;
+         int size = q_ASN1_STRING_to_UTF8(&data, q_X509_NAME_ENTRY_get_data(e));
+         info[QString::fromUtf8(obj)] = QString::fromUtf8((char*)data, size);
+-        q_CRYPTO_free(data);
++        q_OPENSSL_free(data);
+     }
+     return info;
+ }
+--- qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslkey.cpp.0131~	2017-03-15 02:22:37.053244125 +0100
++++ qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslkey.cpp	2017-03-15 02:22:37.055244057 +0100
+@@ -328,7 +328,7 @@
+     if (d->algorithm == QSsl::Rsa) {
+         return q_RSA_bits(d->rsa);
+     }else{
+-        BIGNUM *p = NULL;
++        const BIGNUM *p = NULL;
+         q_DSA_get0_pqg(d->dsa, &p, NULL, NULL);
+ 	return q_BN_num_bits(p);
+     }
+--- qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslsocket_openssl_symbols.cpp.0131~	2017-03-15 02:22:37.054244091 +0100
++++ qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslsocket_openssl_symbols.cpp	2017-03-15 02:29:41.155236836 +0100
+@@ -111,16 +111,16 @@
+ 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)
++DEFINEFUNC(BIO *, BIO_new, const 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)
++DEFINEFUNC(const 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)
+ 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(void, OPENSSL_free, void *a, a, return, DUMMYARG)
+ DEFINEFUNC(void, DSA_free, DSA *a, a, return, DUMMYARG)
+ #if  OPENSSL_VERSION_NUMBER < 0x00908000L
+ DEFINEFUNC3(X509 *, d2i_X509, X509 **a, a, unsigned char **b, b, long c, c, return 0, return)
+@@ -300,7 +300,7 @@
+ DEFINEFUNC(int, DSA_security_bits, const DSA *dsa, dsa, return 0, return)
+ DEFINEFUNC(ASN1_TIME *, X509_get_notAfter, X509 *x, x, return 0, return)
+ DEFINEFUNC(ASN1_TIME *, X509_get_notBefore, X509 *x, x, return 0, return)
+-DEFINEFUNC4(void, DSA_get0_pqg, const DSA *d, d, BIGNUM **p, p, BIGNUM **q, q, BIGNUM **g, g, return, return)
++DEFINEFUNC4(void, DSA_get0_pqg, const DSA *d, d, const BIGNUM **p, p, const BIGNUM **q, q, const BIGNUM **g, g, return, return)
+ #endif
+ 
+ #ifdef Q_OS_SYMBIAN
+--- qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslsocket_openssl_symbols_p.h.0131~	2017-03-15 02:22:37.054244091 +0100
++++ qt-everywhere-opensource-src-4.8.7/src/network/ssl/qsslsocket_openssl_symbols_p.h	2017-03-15 02:29:50.192986268 +0100
+@@ -59,6 +59,9 @@
+ QT_BEGIN_NAMESPACE
+ 
+ #define DUMMYARG
++#ifndef OPENSSL_NO_SSL2
++#define OPENSSL_NO_SSL2 1
++#endif
+ 
+ #if !defined QT_LINKED_OPENSSL
+ // **************** Shared declarations ******************
+@@ -207,16 +210,16 @@
+ int q_ASN1_STRING_to_UTF8(unsigned char **a, ASN1_STRING *b);
+ long q_BIO_ctrl(BIO *a, int b, long c, void *d);
+ int q_BIO_free(BIO *a);
+-BIO *q_BIO_new(BIO_METHOD *a);
++BIO *q_BIO_new(const BIO_METHOD *a);
+ BIO *q_BIO_new_mem_buf(void *a, int b);
+ int q_BIO_read(BIO *a, void *b, int c);
+-BIO_METHOD *q_BIO_s_mem();
++const BIO_METHOD *q_BIO_s_mem();
+ int q_BIO_write(BIO *a, const void *b, int c);
+ int q_BN_num_bits(const BIGNUM *a);
+ 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);
++void q_OPENSSL_free(void *a);
+ void q_DSA_free(DSA *a);
+ #if OPENSSL_VERSION_NUMBER >= 0x00908000L
+ // 0.9.8 broke SC and BC by changing this function's signature.
+@@ -326,7 +329,6 @@
+ void q_SSL_set_connect_state(SSL *a);
+ int q_SSL_shutdown(SSL *a);
+ #if OPENSSL_VERSION_NUMBER >= 0x10000000L
+-const SSL_METHOD *q_SSLv2_client_method();
+ const SSL_METHOD *q_SSLv3_client_method();
+ const SSL_METHOD *q_SSLv23_client_method();
+ const SSL_METHOD *q_TLSv1_client_method();
+@@ -335,7 +337,6 @@
+ const SSL_METHOD *q_SSLv23_server_method();
+ const SSL_METHOD *q_TLSv1_server_method();
+ #else
+-SSL_METHOD *q_SSLv2_client_method();
+ SSL_METHOD *q_SSLv3_client_method();
+ SSL_METHOD *q_SSLv23_client_method();
+ SSL_METHOD *q_TLSv1_client_method();
+@@ -415,7 +416,7 @@
+ X509_PUBKEY * q_X509_get_X509_PUBKEY(X509 *x);
+ int q_RSA_bits(const RSA *rsa);
+ int q_DSA_security_bits(const DSA *dsa);
+-void q_DSA_get0_pqg(const DSA *d, BIGNUM **p, BIGNUM **q, BIGNUM **g);
++void q_DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g);
+ #endif
+ 
+ #define q_SKM_sk_num(type, st) ((int (*)(const STACK_OF(type) *))q_sk_num)(st)
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/default.nix b/nixpkgs/pkgs/development/libraries/qt-5/5.12/default.nix
new file mode 100644
index 000000000000..0f5eb19474e4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/default.nix
@@ -0,0 +1,222 @@
+/*
+
+# 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`.
+3. Check that the new packages build correctly.
+4. Commit the changes and open a pull request.
+
+*/
+
+{ newScope
+, lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper
+, bison, cups ? null, harfbuzz, libGL, perl
+, gstreamer, gst-plugins-base, gtk3, dconf
+, llvmPackages_5, darwin
+
+  # options
+, developerBuild ? false
+, decryptSslTraffic ? false
+, debug ? false
+}:
+
+let
+
+  qtCompatVersion = srcs.qtbase.version;
+
+  stdenvActual = if stdenv.cc.isClang then llvmPackages_5.stdenv else stdenv;
+
+  mirror = "https://download.qt.io";
+  srcs = import ./srcs.nix { inherit fetchurl; inherit mirror; } // {
+    # Community port of the now unmaintained upstream qtwebkit.
+    qtwebkit = rec {
+      src = fetchFromGitHub {
+        owner = "qtwebkit";
+        repo = "qtwebkit";
+        rev = "qtwebkit-${version}";
+        sha256 = "11lc5sk10d9cyg8jqkbgkqiap72b9rax7hy61nm90zw9749y2yfg";
+      };
+      version = "5.212.0-alpha4";
+    };
+  };
+
+  patches = {
+    qtbase = [
+      ./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
+      ./qtbase.patch.d/0002-qtbase-mac.patch
+      ./qtbase.patch.d/0013-define-kiosurfacesuccess.patch
+
+      # Patch framework detection to support X.framework/X.tbd,
+      # extending the current support for X.framework/X.
+      ./qtbase.patch.d/0015-qtbase-tbd-frameworks.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
+
+      # Ensure -I${includedir} is added to Cflags in pkg-config files.
+      # See https://github.com/NixOS/nixpkgs/issues/52457
+      ./qtbase.patch.d/0014-qtbase-pkg-config.patch
+    ];
+    qtdeclarative = [ ./qtdeclarative.patch ];
+    qtlocation = [ ./qtlocation-gcc-9.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://raw.githubusercontent.com/archlinux/svntogit-packages/fc77d6b3d5ec74e421b58f199efceb2593cbf951/trunk/qtbug-77037-workaround.patch";
+        sha256 = "1gv733qfdn9746nbqqxzyjx4ijjqkkb7zb71nxax49nna5bri3am";
+      })
+
+      ./qtwebengine-darwin-no-platform-check.patch
+      ./qtwebengine-darwin-fix-failed-static-assertion.patch
+    ];
+    qtwebkit = [
+      (fetchpatch {
+        name = "qtwebkit-bison-3.7-build.patch";
+        url = "https://github.com/qtwebkit/qtwebkit/commit/d92b11fea65364fefa700249bd3340e0cd4c5b31.patch";
+        sha256 = "0h8ymfnwgkjkwaankr3iifiscsvngqpwb91yygndx344qdiw9y0n";
+      })
+      (fetchpatch {
+        name = "qtwebkit-glib-2.68.patch";
+        url = "https://github.com/qtwebkit/qtwebkit/pull/1058/commits/5b698ba3faffd4e198a45be9fe74f53307395e4b.patch";
+        sha256 = "0a3xv0h4lv8wggckgy8cg8xnpkg7n9h45312pdjdnnwy87xvzss0";
+      })
+      ./qtwebkit.patch
+      ./qtwebkit-icu68.patch
+
+      ./qtwebkit-darwin-no-readline.patch
+      ./qtwebkit-darwin-no-qos-classes.patch
+    ];
+    qttools = [ ./qttools.patch ];
+  };
+
+  qtModule =
+    import ../qtModule.nix
+    {
+      inherit perl;
+      inherit lib;
+      # Use a variant of mkDerivation that does not include wrapQtApplications
+      # to avoid cyclic dependencies between Qt modules.
+      mkDerivation =
+        import ../mkDerivation.nix
+        { inherit lib; inherit debug; wrapQtAppsHook = null; }
+        stdenvActual.mkDerivation;
+    }
+    { inherit self srcs patches; };
+
+  addPackages = self: with self;
+    let
+      callPackage = self.newScope { inherit qtCompatVersion qtModule srcs; };
+    in {
+
+      inherit callPackage qtCompatVersion qtModule srcs;
+
+      mkDerivationWith =
+        import ../mkDerivation.nix
+        { inherit lib; inherit debug; inherit (self) wrapQtAppsHook; };
+
+      mkDerivation = mkDerivationWith stdenvActual.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 debug developerBuild decryptSslTraffic;
+        inherit (darwin.apple_sdk.frameworks) AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth
+          CoreLocation CoreServices DiskArbitration Foundation OpenGL MetalKit IOKit;
+        inherit (darwin) libobjc;
+      };
+
+      qt3d = callPackage ../modules/qt3d.nix {};
+      qtcharts = callPackage ../modules/qtcharts.nix {};
+      qtconnectivity = callPackage ../modules/qtconnectivity.nix {};
+      qtdeclarative = callPackage ../modules/qtdeclarative.nix {};
+      qtdoc = callPackage ../modules/qtdoc.nix {};
+      qtgamepad = callPackage ../modules/qtgamepad.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 {};
+      qtserialbus = callPackage ../modules/qtserialbus.nix {};
+      qtserialport = callPackage ../modules/qtserialport.nix {};
+      qtspeech = callPackage ../modules/qtspeech.nix {};
+      qtsvg = callPackage ../modules/qtsvg.nix {};
+      qtscxml = callPackage ../modules/qtscxml.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 {
+        inherit (darwin) cctools libobjc libunwind xnu;
+        inherit (darwin.apple_sdk.libs) sandbox;
+        inherit (darwin.apple_sdk.frameworks) ApplicationServices AVFoundation Foundation ForceFeedback GameController AppKit
+          ImageCaptureCore CoreBluetooth IOBluetooth CoreWLAN Quartz Cocoa LocalAuthentication;
+      };
+      qtwebglplugin = callPackage ../modules/qtwebglplugin.nix {};
+      qtwebkit = callPackage ../modules/qtwebkit.nix {
+        inherit (darwin) ICU;
+        inherit (darwin.apple_sdk.frameworks) OpenGL;
+      };
+      qtwebsockets = callPackage ../modules/qtwebsockets.nix {};
+      qtwebview = callPackage ../modules/qtwebview.nix {
+        inherit (darwin.apple_sdk.frameworks) CoreFoundation WebKit;
+      };
+      qtx11extras = callPackage ../modules/qtx11extras.nix {};
+      qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {};
+
+      env = callPackage ../qt-env.nix {};
+      full = env "qt-full-${qtbase.version}" ([
+        qt3d qtcharts qtconnectivity qtdeclarative qtdoc qtgamepad qtgraphicaleffects
+        qtimageformats qtlocation qtmultimedia qtquickcontrols qtquickcontrols2
+        qtscript qtsensors qtserialport qtsvg qttools qttranslations
+        qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets
+        qtwebview qtx11extras qtxmlpatterns
+      ] ++ lib.optional (!stdenv.isDarwin) qtwayland
+        ++ lib.optional (stdenv.isDarwin) qtmacextras);
+
+      qmake = makeSetupHook {
+        deps = [ self.qtbase.dev ];
+        substitutions = {
+          inherit debug;
+          fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
+        };
+      } ../hooks/qmake-hook.sh;
+
+      wrapQtAppsHook = makeSetupHook {
+        deps = [ self.qtbase.dev makeWrapper ]
+          ++ lib.optional stdenv.isLinux self.qtwayland.dev;
+      } ../hooks/wrap-qt-apps-hook.sh;
+    };
+
+   self = lib.makeScope newScope addPackages;
+
+in self
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/fetch.sh b/nixpkgs/pkgs/development/libraries/qt-5/5.12/fetch.sh
new file mode 100644
index 000000000000..6d2cf551dd5b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/fetch.sh
@@ -0,0 +1,2 @@
+WGET_ARGS=( http://download.qt.io/official_releases/qt/5.12/5.12.10/submodules/ \
+            -A '*.tar.xz' )
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..6646e1e0b2be
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
@@ -0,0 +1,387 @@
+diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf
+index b77494ec..470c38e7 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 d052808c..b80ec1e8 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} \
+-                -isysroot$$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 += -isysroot $$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 e3534561..3b01424e 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 c40f58c9..e69de29b 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 3a9c2778..e69de29b 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)
+-}
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..506397bc6056
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0003-qtbase-mkspecs.patch
@@ -0,0 +1,491 @@
+From 9ffbcc5e362d17aea3e3d67e43cd3cd993e987eb Mon Sep 17 00:00:00 2001
+From: OPNA2608 <christoph.neidahl@gmail.com>
+Date: Mon, 12 Apr 2021 20:05:25 +0200
+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             | 27 ++++---
+ mkspecs/features/qt_installs.prf              | 22 ++---
+ mkspecs/features/qt_plugin.prf                |  2 +-
+ 11 files changed, 53 insertions(+), 153 deletions(-)
+
+diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
+index 02e5775983..3782949d32 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()
+@@ -334,7 +309,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..1dc117a388 100644
+--- a/mkspecs/features/qt_functions.prf
++++ b/mkspecs/features/qt_functions.prf
+@@ -69,19 +69,22 @@ defineTest(qtHaveModule) {
+ defineTest(qtPrepareTool) {
+     cmd = $$eval(QT_TOOL.$${2}.binary)
+     isEmpty(cmd) {
+-        cmd = $$[QT_HOST_BINS]/$$2
+-        exists($${cmd}.pl) {
+-            $${1}_EXE = $${cmd}.pl
+-            cmd = perl -w $$system_path($${cmd}.pl)
+-        } else: contains(QMAKE_HOST.os, Windows) {
+-            $${1}_EXE = $${cmd}.exe
+-            cmd = $$system_path($${cmd}.exe)
+-        } else:contains(QMAKE_HOST.os, Darwin) {
+-            BUNDLENAME = $${cmd}.app/Contents/MacOS/$$2
+-            exists($$BUNDLENAME) {
+-                cmd = $$BUNDLENAME
++        cmd = $$system("command -v $${2}")
++        isEmpty(cmd) {
++            cmd = $$system("command -v $${2}.pl")
++            !isEmpty(cmd) {
++                $${1}_EXE = $$cmd
++                cmd = perl -w $$system_path($${cmd})
++            } else: contains(QMAKE_HOST.os, Windows) {
++                cmd = $$system("command -v $${2}.exe")
++                $${1}_EXE = $$cmd
++            } else: contains(QMAKE_HOST.os, Darwin) {
++                cmd = $$system("command -v $${2}.app")
++                !isEmpty(cmd) {
++                    cmd = $${cmd}/Contents/MacOS/$${2}
++                    $${1}_EXE = $$cmd
++                }
+             }
+-            $${1}_EXE = $$cmd
+         } else {
+             $${1}_EXE = $$cmd
+         }
+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.29.3
+
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/qtbase.patch.d/0014-qtbase-pkg-config.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0014-qtbase-pkg-config.patch
new file mode 100644
index 000000000000..90caaea1cf4d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0014-qtbase-pkg-config.patch
@@ -0,0 +1,14 @@
+diff --git a/qmake/generators/makefile.cpp b/qmake/generators/makefile.cpp
+--- a/qmake/generators/makefile.cpp
++++ b/qmake/generators/makefile.cpp
+@@ -3390,8 +3390,7 @@ MakefileGenerator::writePkgConfigFile()
+       << varGlue("QMAKE_PKGCONFIG_CFLAGS", "", " ", " ")
+         //      << varGlue("DEFINES","-D"," -D"," ")
+          ;
+-    if (!project->values("QMAKE_DEFAULT_INCDIRS").contains(includeDir))
+-        t << "-I${includedir}";
++    t << "-I${includedir}";
+     if (target_mode == TARG_MAC_MODE && project->isActiveConfig("lib_bundle")
+         && libDir != QLatin1String("/Library/Frameworks")) {
+             t << " -F${libdir}";
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0015-qtbase-tbd-frameworks.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0015-qtbase-tbd-frameworks.patch
new file mode 100644
index 000000000000..8a5939978a6b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtbase.patch.d/0015-qtbase-tbd-frameworks.patch
@@ -0,0 +1,15 @@
+diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
+index 84dbbfebd4..615bfed124 100644
+--- a/src/gui/Qt5GuiConfigExtras.cmake.in
++++ b/src/gui/Qt5GuiConfigExtras.cmake.in
+@@ -119,6 +119,10 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
+             if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
+                 set(Qt5Gui_${_cmake_lib_name}_LIBRARY)
+             endif()
++            set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}.tbd")
++            if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
++                set(Qt5Gui_${_cmake_lib_name}_LIBRARY)
++            endif()
+ !!ENDIF
+             if (NOT Qt5Gui_${_cmake_lib_name}_LIBRARY)
+                 # The above find_library call doesn\'t work for finding
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtdeclarative.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtdeclarative.patch
new file mode 100644
index 000000000000..8f5b5d4790fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtdeclarative.patch
@@ -0,0 +1,33 @@
+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/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.12/qtlocation-gcc-9.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtlocation-gcc-9.patch
new file mode 100644
index 000000000000..1791313e5603
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtlocation-gcc-9.patch
@@ -0,0 +1,21 @@
+diff --git a/src/3rdparty/mapbox-gl-native/platform/default/bidi.cpp b/src/3rdparty/mapbox-gl-native/platform/default/bidi.cpp
+index d475c38..c1710a6 100644
+--- a/src/3rdparty/mapbox-gl-native/platform/default/bidi.cpp
++++ b/src/3rdparty/mapbox-gl-native/platform/default/bidi.cpp
+@@ -5,6 +5,7 @@
+ #include <unicode/ushape.h>
+ 
+ #include <memory>
++#include <stdexcept>
+ 
+ namespace mbgl {
+ 
+diff --git a/src/3rdparty/mapbox-gl-native/src/mbgl/util/convert.cpp b/src/3rdparty/mapbox-gl-native/src/mbgl/util/convert.cpp
+index 97bfe91..56d3e17 100644
+--- a/src/3rdparty/mapbox-gl-native/src/mbgl/util/convert.cpp
++++ b/src/3rdparty/mapbox-gl-native/src/mbgl/util/convert.cpp
+@@ -1,3 +1,4 @@
++#include <cstdint>
+ #include <mbgl/util/convert.hpp>
+ 
+ namespace mbgl {
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtscript.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtscript.patch
new file mode 100644
index 000000000000..5508dec1280e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtscript.patch
@@ -0,0 +1,13 @@
+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.12/qtserialport.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtserialport.patch
new file mode 100644
index 000000000000..f25524e80bcf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtserialport.patch
@@ -0,0 +1,22 @@
+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.12/qttools.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qttools.patch
new file mode 100644
index 000000000000..8ae12198ca25
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qttools.patch
@@ -0,0 +1,15 @@
+--- 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.12/qtwebengine-darwin-fix-failed-static-assertion.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebengine-darwin-fix-failed-static-assertion.patch
new file mode 100644
index 000000000000..510e25f56a4d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebengine-darwin-fix-failed-static-assertion.patch
@@ -0,0 +1,31 @@
+Fix a following build error:
+
+In file included from ../../3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm:7:
+../../3rdparty/chromium/base/bind.h:59:3: error: static_assert failed "Bound argument |i| of type |Arg| cannot be forwarded as |Unwrapped| to the bound functor, which declares it as |Param|."
+  static_assert(
+  ^
+../../3rdparty/chromium/base/bind.h:91:7: note: in instantiation of template class 'base::internal::AssertConstructible<1, long, long, const long &, NSError *>' requested here
+    : AssertConstructible<Ns, Args, std::decay_t<Args>, Unwrapped, Params>... {
+      ^
+../../3rdparty/chromium/base/bind.h:213:27: note: in instantiation of template class 'base::internal::AssertBindArgsValidity<std::__1::integer_sequence<unsigned long, 0, 1>, base::internal::TypeList<base::WeakPtr<device::BluetoothRemoteGattCharacteristicMac>, long>, base::internal::TypeList<device::BluetoothRemoteGattCharacteristicMac *, const long &>, base::internal::TypeList<device::BluetoothRemoteGattCharacteristicMac *, NSError *> >' requested here
+  static_assert(internal::AssertBindArgsValidity<
+                          ^
+../../3rdparty/chromium/base/bind.h:242:16: note: in instantiation of function template specialization 'base::BindRepeating<void (device::BluetoothRemoteGattCharacteristicMac::*)(NSError *), base::WeakPtr<device::BluetoothRemoteGattCharacteristicMac>, long>' requested here
+  return base::BindRepeating(std::forward<Functor>(functor),
+               ^
+../../3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm:211:15: note: in instantiation of function template specialization 'base::Bind<void (device::BluetoothRemoteGattCharacteristicMac::*)(NSError *), base::WeakPtr<device::BluetoothRemoteGattCharacteristicMac>, long>' requested here
+        base::Bind(&BluetoothRemoteGattCharacteristicMac::DidWriteValue,
+              ^
+
+Resurrected from https://github.com/NixOS/nixpkgs/blob/ddcf01bca6c7a7a7f096bec836a1e6a707ad473d/pkgs/development/libraries/qt-5/5.11/qtwebengine-clang-fix.patch because the same problem is present in 5.12 when compiling on macOS.
+
+--- a/src/3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
++++ b/src/3rdparty/chromium/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm
+@@ -209,7 +209,7 @@ void BluetoothRemoteGattCharacteristicMac::WriteRemoteCharacteristic(
+     base::ThreadTaskRunnerHandle::Get()->PostTask(
+         FROM_HERE,
+         base::Bind(&BluetoothRemoteGattCharacteristicMac::DidWriteValue,
+-                   weak_ptr_factory_.GetWeakPtr(), nil));
++                   weak_ptr_factory_.GetWeakPtr(), nullptr));
+   }
+ }
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebengine-darwin-no-platform-check.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebengine-darwin-no-platform-check.patch
new file mode 100644
index 000000000000..cd2343e42ca3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebengine-darwin-no-platform-check.patch
@@ -0,0 +1,69 @@
+diff --git a/configure.pri b/configure.pri
+index 897bea540..6f834c202 100644
+--- a/configure.pri
++++ b/configure.pri
+@@ -269,7 +269,7 @@ defineReplace(webEngineGetMacOSVersion) {
+ }
+ 
+ defineReplace(webEngineGetMacOSSDKVersion) {
+-    value = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version ProductVersion 2>/dev/null")
++    value = $$system("xcrun --show-sdk-version")
+     return($$value)
+ }
+ 
+diff --git a/mkspecs/features/platform.prf b/mkspecs/features/platform.prf
+index 35eb6b89c..7eed640a5 100644
+--- a/mkspecs/features/platform.prf
++++ b/mkspecs/features/platform.prf
+@@ -40,8 +40,6 @@ defineTest(isPlatformSupported) {
+   } else:osx {
+     # FIXME: Try to get it back down to 8.2 for building on OS X 10.11
+     !isMinXcodeVersion(8, 3, 3) {
+-      skipBuild("Using Xcode version $$QMAKE_XCODE_VERSION, but at least version 8.3.3 is required to build Qt WebEngine.")
+-      return(false)
+     }
+     !clang|intel_icc {
+         skipBuild("Qt WebEngine on macOS requires Clang.")
+@@ -54,8 +52,6 @@ defineTest(isPlatformSupported) {
+       return(false)
+     }
+     !isMinOSXSDKVersion(10, 12): {
+-      skipBuild("Building Qt WebEngine requires a macOS SDK version of 10.12 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
+-      return(false)
+     }
+   } else {
+     skipBuild("Unknown platform. Qt WebEngine only supports Linux, Windows, and macOS.")
+@@ -111,7 +107,7 @@ defineTest(isMinOSXSDKVersion) {
+     requested_minor = $$2
+     requested_patch = $$3
+     isEmpty(requested_patch): requested_patch = 0
+-    WEBENGINE_OSX_SDK_PRODUCT_VERSION = $$system("/usr/bin/xcodebuild -sdk $$QMAKE_MAC_SDK -version ProductVersion 2>/dev/null")
++    WEBENGINE_OSX_SDK_PRODUCT_VERSION = $$system("xcrun --show-sdk-version")
+     export(WEBENGINE_OSX_SDK_PRODUCT_VERSION)
+     isEmpty(WEBENGINE_OSX_SDK_PRODUCT_VERSION) {
+         skipBuild("Could not resolve SDK product version for \'$$QMAKE_MAC_SDK\'.")
+diff --git a/src/core/config/mac_osx.pri b/src/core/config/mac_osx.pri
+index 7b77a8bf7..0e1284ee4 100644
+--- a/src/core/config/mac_osx.pri
++++ b/src/core/config/mac_osx.pri
+@@ -5,7 +5,7 @@ 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")
++     QMAKE_MAC_SDK_VERSION = $$system("xcrun --show-sdk-version")
+      isEmpty(QMAKE_MAC_SDK_VERSION): error("Could not resolve SDK version for \'$${QMAKE_MAC_SDK}\'")
+ }
+ 
+@@ -14,11 +14,6 @@ isEmpty(QMAKE_MAC_SDK_VERSION) {
+ QMAKE_MAC_SDK_VERSION_MAJOR_MINOR = $$section(QMAKE_MAC_SDK_VERSION, ".", 0, 1)
+ 
+ QMAKE_CLANG_DIR = "/usr"
+-QMAKE_CLANG_PATH = $$eval(QMAKE_MAC_SDK.macx-clang.$${QMAKE_MAC_SDK}.QMAKE_CXX)
+-!isEmpty(QMAKE_CLANG_PATH) {
+-    clang_dir = $$clean_path("$$dirname(QMAKE_CLANG_PATH)/../")
+-    exists($$clang_dir): QMAKE_CLANG_DIR = $$clang_dir
+-}
+ 
+ QMAKE_CLANG_PATH = "$${QMAKE_CLANG_DIR}/bin/clang++"
+ message("Using clang++ from $${QMAKE_CLANG_PATH}")
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebengine-no-build-skip.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebengine-no-build-skip.patch
new file mode 100644
index 000000000000..f332d5e1bb2b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebengine-no-build-skip.patch
@@ -0,0 +1,12 @@
+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.12/qtwebkit-darwin-no-qos-classes.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-qos-classes.patch
new file mode 100644
index 000000000000..a7087f517623
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-qos-classes.patch
@@ -0,0 +1,11 @@
+diff --git a/Source/cmake/OptionsQt.cmake b/Source/cmake/OptionsQt.cmake
+--- a/Source/cmake/OptionsQt.cmake
++++ b/Source/cmake/OptionsQt.cmake
+@@ -683,7 +683,6 @@ if (WIN32 AND COMPILER_IS_GCC_OR_CLANG)
+ endif ()
+ 
+ if (APPLE)
+-    SET_AND_EXPOSE_TO_BUILD(HAVE_QOS_CLASSES 1)
+ endif ()
+ 
+ if (ENABLE_MATHML)
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-readline.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-readline.patch
new file mode 100644
index 000000000000..26d189d86019
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebkit-darwin-no-readline.patch
@@ -0,0 +1,45 @@
+diff --git a/Source/JavaScriptCore/shell/CMakeLists.txt b/Source/JavaScriptCore/shell/CMakeLists.txt
+--- a/Source/JavaScriptCore/shell/CMakeLists.txt
++++ b/Source/JavaScriptCore/shell/CMakeLists.txt
+@@ -9,7 +9,6 @@ set(JSC_LIBRARIES
+ )
+ 
+ if (WTF_OS_MAC_OS_X)
+-    list(APPEND JSC_LIBRARIES edit)
+ endif ()
+ 
+ if ("${JavaScriptCore_LIBRARY_TYPE}" MATCHES "STATIC")
+diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
+--- a/Source/WTF/wtf/Platform.h
++++ b/Source/WTF/wtf/Platform.h
+@@ -563,7 +563,6 @@
+ #if PLATFORM(IOS)
+ 
+ #define HAVE_NETWORK_EXTENSION 1
+-#define HAVE_READLINE 1
+ #if USE(APPLE_INTERNAL_SDK)
+ #define USE_CFNETWORK 1
+ #endif
+@@ -650,7 +649,6 @@
+ #define HAVE_MADV_DONTNEED 1
+ #define HAVE_MERGESORT 1
+ #define HAVE_PTHREAD_SETNAME_NP 1
+-#define HAVE_READLINE 1
+ #define HAVE_SYS_TIMEB_H 1
+ 
+ #if !PLATFORM(GTK) && !PLATFORM(QT)
+diff --git a/Source/WTF/wtf/PlatformMac.cmake b/Source/WTF/wtf/PlatformMac.cmake
+--- a/Source/WTF/wtf/PlatformMac.cmake
++++ b/Source/WTF/wtf/PlatformMac.cmake
+@@ -2,11 +2,9 @@ set(WTF_LIBRARY_TYPE SHARED)
+ 
+ find_library(COCOA_LIBRARY Cocoa)
+ find_library(COREFOUNDATION_LIBRARY CoreFoundation)
+-find_library(READLINE_LIBRARY Readline)
+ list(APPEND WTF_LIBRARIES
+     ${COREFOUNDATION_LIBRARY}
+     ${COCOA_LIBRARY}
+-    ${READLINE_LIBRARY}
+     libicucore.dylib
+ )
+ 
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebkit-icu68.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebkit-icu68.patch
new file mode 100644
index 000000000000..73463d7567a3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebkit-icu68.patch
@@ -0,0 +1,170 @@
+Regressed by https://github.com/unicode-org/icu/commit/c3fe7e09d844
+
+In file included from Source/WebCore/platform/text/TextAllInOne.cpp:31:
+Source/WebCore/platform/text/TextCodecICU.cpp:311:42: error: use of undeclared identifier 'TRUE'
+        ucnv_setFallback(m_converterICU, TRUE);
+                                         ^
+In file included from Source/WebCore/platform/text/TextAllInOne.cpp:40:
+In file included from Source/WebCore/platform/text/icu/UTextProvider.cpp:27:
+Source/WebCore/platform/text/icu/UTextProvider.h:83:28: error: use of undeclared identifier 'TRUE'
+            isAccessible = TRUE;
+                           ^
+Source/WebCore/platform/text/icu/UTextProvider.h:88:28: error: use of undeclared identifier 'FALSE'
+            isAccessible = FALSE;
+                           ^
+Source/WebCore/platform/text/icu/UTextProvider.h:97:28: error: use of undeclared identifier 'TRUE'
+            isAccessible = TRUE;
+                           ^
+Source/WebCore/platform/text/icu/UTextProvider.h:102:28: error: use of undeclared identifier 'FALSE'
+            isAccessible = FALSE;
+                           ^
+In file included from Source/WebCore/platform/text/TextAllInOne.cpp:41:
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:103:20: error: use of undeclared identifier 'TRUE'
+            return TRUE;
+                   ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:108:20: error: use of undeclared identifier 'FALSE'
+            return FALSE;
+                   ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:114:20: error: use of undeclared identifier 'TRUE'
+            return TRUE;
+                   ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:119:20: error: use of undeclared identifier 'FALSE'
+            return FALSE;
+                   ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:147:12: error: use of undeclared identifier 'TRUE'
+    return TRUE;
+           ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:339:16: error: use of undeclared identifier 'FALSE'
+        return FALSE;
+               ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:359:12: error: use of undeclared identifier 'TRUE'
+    return TRUE;
+           ^
+In file included from Source/WebCore/platform/text/TextAllInOne.cpp:42:
+Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp:128:16: error: use of undeclared identifier 'FALSE'
+        return FALSE;
+               ^
+Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp:148:12: error: use of undeclared identifier 'TRUE'
+    return TRUE;
+           ^
+
+--- a/Source/WebCore/platform/text/TextCodecICU.cpp
++++ b/Source/WebCore/platform/text/TextCodecICU.cpp
+@@ -308,7 +308,7 @@ void TextCodecICU::createICUConverter() const
+     m_converterICU = ucnv_open(m_canonicalConverterName, &err);
+     ASSERT(U_SUCCESS(err));
+     if (m_converterICU)
+-        ucnv_setFallback(m_converterICU, TRUE);
++        ucnv_setFallback(m_converterICU, true);
+ }
+ 
+ int TextCodecICU::decodeToBuffer(UChar* target, UChar* targetLimit, const char*& source, const char* sourceLimit, int32_t* offsets, bool flush, UErrorCode& err)
+--- a/Source/WebCore/platform/text/icu/UTextProvider.h
++++ b/Source/WebCore/platform/text/icu/UTextProvider.h
+@@ -80,12 +80,12 @@ inline bool uTextAccessInChunkOrOutOfRange(UText* text
+             // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
+             ASSERT(offset < std::numeric_limits<int32_t>::max());
+             text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
+-            isAccessible = TRUE;
++            isAccessible = true;
+             return true;
+         }
+         if (nativeIndex >= nativeLength && text->chunkNativeLimit == nativeLength) {
+             text->chunkOffset = text->chunkLength;
+-            isAccessible = FALSE;
++            isAccessible = false;
+             return true;
+         }
+     } else {
+@@ -94,12 +94,12 @@ inline bool uTextAccessInChunkOrOutOfRange(UText* text
+             // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
+             ASSERT(offset < std::numeric_limits<int32_t>::max());
+             text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
+-            isAccessible = TRUE;
++            isAccessible = true;
+             return true;
+         }
+         if (nativeIndex <= 0 && !text->chunkNativeStart) {
+             text->chunkOffset = 0;
+-            isAccessible = FALSE;
++            isAccessible = false;
+             return true;
+         }
+     }
+--- a/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
++++ b/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
+@@ -100,23 +100,23 @@ static UBool uTextLatin1Access(UText* uText, int64_t i
+         if (index < uText->chunkNativeLimit && index >= uText->chunkNativeStart) {
+             // Already inside the buffer. Set the new offset.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return TRUE;
++            return true;
+         }
+         if (index >= length && uText->chunkNativeLimit == length) {
+             // Off the end of the buffer, but we can't get it.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return FALSE;
++            return false;
+         }
+     } else {
+         if (index <= uText->chunkNativeLimit && index > uText->chunkNativeStart) {
+             // Already inside the buffer. Set the new offset.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return TRUE;
++            return true;
+         }
+         if (!index && !uText->chunkNativeStart) {
+             // Already at the beginning; can't go any farther.
+             uText->chunkOffset = 0;
+-            return FALSE;
++            return false;
+         }
+     }
+     
+@@ -144,7 +144,7 @@ static UBool uTextLatin1Access(UText* uText, int64_t i
+ 
+     uText->nativeIndexingLimit = uText->chunkLength;
+ 
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextLatin1Extract(UText* uText, int64_t start, int64_t limit, UChar* dest, int32_t destCapacity, UErrorCode* status)
+@@ -336,7 +336,7 @@ static int64_t uTextLatin1ContextAwareNativeLength(UTe
+ static UBool uTextLatin1ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
+ {
+     if (!text->context)
+-        return FALSE;
++        return false;
+     int64_t nativeLength = uTextLatin1ContextAwareNativeLength(text);
+     UBool isAccessible;
+     if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
+@@ -356,7 +356,7 @@ static UBool uTextLatin1ContextAwareAccess(UText* text
+         ASSERT(newContext == UTextProviderContext::PriorContext);
+         textLatin1ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
+     }
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextLatin1ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
+--- a/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
++++ b/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
+@@ -125,7 +125,7 @@ static inline int64_t uTextUTF16ContextAwareNativeLeng
+ static UBool uTextUTF16ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
+ {
+     if (!text->context)
+-        return FALSE;
++        return false;
+     int64_t nativeLength = uTextUTF16ContextAwareNativeLength(text);
+     UBool isAccessible;
+     if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
+@@ -145,7 +145,7 @@ static UBool uTextUTF16ContextAwareAccess(UText* text,
+         ASSERT(newContext == UTextProviderContext::PriorContext);
+         textUTF16ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
+     }
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextUTF16ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebkit.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebkit.patch
new file mode 100644
index 000000000000..b94a4b76cbab
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/qtwebkit.patch
@@ -0,0 +1,12 @@
+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.12/srcs.nix b/nixpkgs/pkgs/development/libraries/qt-5/5.12/srcs.nix
new file mode 100644
index 000000000000..03f8973766a9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/srcs.nix
@@ -0,0 +1,326 @@
+# DO NOT EDIT! This file is generated automatically.
+# Command: ./maintainers/scripts/fetch-kde-qt.sh pkgs/development/libraries/qt-5/5.12
+{ fetchurl, mirror }:
+
+{
+  qt3d = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qt3d-everywhere-src-5.12.10.tar.xz";
+      sha256 = "1fnhdy0vwh1npq04pw3lzb15rsp0nx8wh57c8lvz9jn945xwc3vd";
+      name = "qt3d-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtactiveqt = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtactiveqt-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0lf96ziba5g8izwcjzzaf4n2j336j6627rb3dzwvmsdkd9168zax";
+      name = "qtactiveqt-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtandroidextras = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtandroidextras-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0blapv4jd80wcvzp96zxlrsyca7lwax17y6yij1d14a51353hrnc";
+      name = "qtandroidextras-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtbase = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtbase-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0h39r3irahdms4gidg5l4a1kr7kagc4bd0y02sapg3njwrsg3240";
+      name = "qtbase-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtcanvas3d = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtcanvas3d-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0pbxw89m2s19yk2985c49msd7s1mapydka9b7nzg9phs9nrzvf1m";
+      name = "qtcanvas3d-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtcharts = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtcharts-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0cndm8llvfl9jdzn34b886gxgxwsibb24amhblh96cadhhkpwadc";
+      name = "qtcharts-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtconnectivity = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtconnectivity-everywhere-src-5.12.10.tar.xz";
+      sha256 = "19l816zfpx87vwzj18mbib5x3mb9hy1msacpy8i9bagfw9p0i6c0";
+      name = "qtconnectivity-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtdatavis3d = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtdatavis3d-everywhere-src-5.12.10.tar.xz";
+      sha256 = "1ximhph17kkh40v2ksk51lq21mbjs2ajyf5l32ckhc7n7bmaryb6";
+      name = "qtdatavis3d-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtdeclarative = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtdeclarative-everywhere-src-5.12.10.tar.xz";
+      sha256 = "05la1zlijcaargfh4ljnmxvvksdwzl409wl7w3m96kwm8s370mmf";
+      name = "qtdeclarative-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtdoc = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtdoc-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0ljc29hnn8knncvq8hsk0rdcwrxbsk1ywlprknkvyb4pggp9rkp6";
+      name = "qtdoc-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtgamepad = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtgamepad-everywhere-src-5.12.10.tar.xz";
+      sha256 = "1bs50wghy3n8af656angkkkaac0swkq3mfllg3dkjg236ngzdhdh";
+      name = "qtgamepad-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtgraphicaleffects = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtgraphicaleffects-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0hnsb757ircqmid34d0cxbh0mi4qnil22k5ka9a1b8xy00ydkfky";
+      name = "qtgraphicaleffects-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtimageformats = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtimageformats-everywhere-src-5.12.10.tar.xz";
+      sha256 = "1bh38xp4v914ksg91p9pij1gsdzs3y7sn7diy3d7wn5i039syn0i";
+      name = "qtimageformats-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtlocation = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtlocation-everywhere-src-5.12.10.tar.xz";
+      sha256 = "1czg0z69ilnxp1sqk0jawlnyp2gx87yb57g8dwjznqxxvaq744dc";
+      name = "qtlocation-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtmacextras = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtmacextras-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0mh9p3f1f22pj4i8yxnn56amy53dapmcikza04ll4fvx5hy340v8";
+      name = "qtmacextras-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtmultimedia = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtmultimedia-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0g50jzhwbrl5r0lmfz5ffpkp54mf0zfc8m884x51yn2bnngg366c";
+      name = "qtmultimedia-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtnetworkauth = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtnetworkauth-everywhere-src-5.12.10.tar.xz";
+      sha256 = "12n3xqlskrk2mbcgz5p613sx219j6rmpq8yn7p97xdv7li61gzl2";
+      name = "qtnetworkauth-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtpurchasing = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtpurchasing-everywhere-src-5.12.10.tar.xz";
+      sha256 = "1azdg03vxyk140i9z93x0zzlazbmd3qrqxgwk747jsd1ibns9ddy";
+      name = "qtpurchasing-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtquickcontrols = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtquickcontrols-everywhere-src-5.12.10.tar.xz";
+      sha256 = "1cy9vjl9zf95frnydzljqwbx3is8p8w27kdgszvmb67p6xkpblk7";
+      name = "qtquickcontrols-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtquickcontrols2 = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtquickcontrols2-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0541n8n012d0xwxrfznv1jwh28d35mdx6cl8jadsaxaspgwz4vb3";
+      name = "qtquickcontrols2-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtremoteobjects = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtremoteobjects-everywhere-src-5.12.10.tar.xz";
+      sha256 = "147p0xdi22xz2d3501ig78bs97gbyz8ccyhn6dhbw2yalx33gma6";
+      name = "qtremoteobjects-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtscript = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtscript-everywhere-src-5.12.10.tar.xz";
+      sha256 = "1cfcfwq4shr6yphgwq2jnvgzjjqjrz10qnzr7dccksmfg3i0ad02";
+      name = "qtscript-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtscxml = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtscxml-everywhere-src-5.12.10.tar.xz";
+      sha256 = "057zchhm1s5ly2a685y4105pgmzgqp1jkkf9w0ca8xd05z4clb4r";
+      name = "qtscxml-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtsensors = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtsensors-everywhere-src-5.12.10.tar.xz";
+      sha256 = "10f00njvc7kwjci0g4g3pibl9ra798iplvj2ymql3zppxqqdq25m";
+      name = "qtsensors-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtserialbus = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtserialbus-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0zd0crs2nrsvncj070fl05g0nm3j5bf16g54c7m9603b6q7bryrx";
+      name = "qtserialbus-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtserialport = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtserialport-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0anndf6pyssiygj0kk2j80vwil2z0765gccs87djhsni1xvk3n9r";
+      name = "qtserialport-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtspeech = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtspeech-everywhere-src-5.12.10.tar.xz";
+      sha256 = "11fycm604r1xswb9dg1g568jxd68zd9m2dzfy4qda6sr4mdaj6jg";
+      name = "qtspeech-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtsvg = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtsvg-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0jrkz8y225g93pznsvc1icanxxc5cfm23ic2y6rprqaqw77z9zxm";
+      name = "qtsvg-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qttools = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qttools-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0v339a1w3kqvfl8hcds032g8zafp8d4c1b2rzihpq6y4mbksdkxh";
+      name = "qttools-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qttranslations = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qttranslations-everywhere-src-5.12.10.tar.xz";
+      sha256 = "1pjkkkkjvs9harz70sir67yf3i528vyn1shmi09hlzlb23nmipp1";
+      name = "qttranslations-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtvirtualkeyboard = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtvirtualkeyboard-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0afw3lj5cg3zj0hzxlhz5l7s1j2y491yxwylc4vchbqjpyvsadgg";
+      name = "qtvirtualkeyboard-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtwayland = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtwayland-everywhere-src-5.12.10.tar.xz";
+      sha256 = "1bs61xmc4l03w21wkrxx0llfg5bbnq5ij7w0bnfkx3rk0vncy0q6";
+      name = "qtwayland-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtwebchannel = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtwebchannel-everywhere-src-5.12.10.tar.xz";
+      sha256 = "1jmprqgavqwknnnl6qp0psxz7bc69ivxhm7y4qci95vpx9k5yjg8";
+      name = "qtwebchannel-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtwebengine = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtwebengine-everywhere-src-5.12.10.tar.xz";
+      sha256 = "16zbyfc7qy9f20anfrdi25f6nf1j7zw8kps60mqb18nfjw411d50";
+      name = "qtwebengine-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtwebglplugin = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtwebglplugin-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0nhim67rl9dbshnarismnd54qzks8v14a08h8qi7x0dm9bj9ij7q";
+      name = "qtwebglplugin-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtwebsockets = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtwebsockets-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0p74ds53d3a30i7pq85b9ql9i4z1p0yyanhmaizw2bv9225py4jr";
+      name = "qtwebsockets-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtwebview = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtwebview-everywhere-src-5.12.10.tar.xz";
+      sha256 = "07pz7wfhyijfdlxnaqpn4hwgvpglma6dfmkcb8xw6hfhg30riaxd";
+      name = "qtwebview-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtwinextras = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtwinextras-everywhere-src-5.12.10.tar.xz";
+      sha256 = "1x5k0z0p94zppqsw2fz8ki9v5abf0crzva16wllznn89ylqjyn0j";
+      name = "qtwinextras-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtx11extras = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtx11extras-everywhere-src-5.12.10.tar.xz";
+      sha256 = "0xk10iynkfs31vgpadrmw30k4s1hlnggxy2f3q988qyqd37dh5h8";
+      name = "qtx11extras-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+  qtxmlpatterns = {
+    version = "5.12.10";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.12/5.12.10/submodules/qtxmlpatterns-everywhere-src-5.12.10.tar.xz";
+      sha256 = "1qg09yxagz36sry03kv3swwfjc8lrik1asjk2lxlpzzcl2q95lbv";
+      name = "qtxmlpatterns-everywhere-src-5.12.10.tar.xz";
+    };
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/default.nix b/nixpkgs/pkgs/development/libraries/qt-5/5.14/default.nix
new file mode 100644
index 000000000000..c12a20dd4daf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/default.nix
@@ -0,0 +1,232 @@
+/*
+
+# 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`.
+3. Check that the new packages build correctly.
+4. Commit the changes and open a pull request.
+
+*/
+
+{ newScope
+, lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper
+, bison, cups ? null, harfbuzz, libGL, perl
+, gstreamer, gst-plugins-base, gtk3, dconf
+, llvmPackages_5, darwin
+
+  # options
+, developerBuild ? false
+, decryptSslTraffic ? false
+, debug ? false
+}:
+
+let
+
+  qtCompatVersion = srcs.qtbase.version;
+
+  stdenvActual = if stdenv.cc.isClang then llvmPackages_5.stdenv else stdenv;
+
+  mirror = "https://download.qt.io";
+  srcs = import ./srcs.nix { inherit fetchurl; inherit mirror; } // {
+    # qtwebkit does not have an official release tarball on the qt mirror and is
+    # mostly maintained by the community.
+    qtwebkit = rec {
+      src = fetchFromGitHub {
+        owner = "qt";
+        repo = "qtwebkit";
+        rev = "v${version}";
+        sha256 = "0x8rng96h19xirn7qkz3lydal6v4vn00bcl0s3brz36dfs0z8wpg";
+      };
+      version = "5.212.0-alpha4";
+    };
+  };
+
+  patches = {
+    qtbase = lib.optionals stdenv.isDarwin [
+      ./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
+
+      # Downgrade minimal required SDK to 10.12
+      ./qtbase.patch.d/0013-define-kiosurfacesuccess.patch
+      ./qtbase.patch.d/qtbase-sdk-10.12-mac.patch
+
+      # Patch framework detection to support X.framework/X.tbd,
+      # extending the current support for X.framework/X.
+      ./qtbase.patch.d/0012-qtbase-tbd-frameworks.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-tzdir.patch
+      ./qtbase.patch.d/0009-qtbase-qtpluginpath.patch
+      ./qtbase.patch.d/0010-qtbase-assert.patch
+      ./qtbase.patch.d/0011-fix-header_module.patch
+    ];
+    qtdeclarative = [ ./qtdeclarative.patch ];
+    qtlocation = [ ./qtlocation-gcc-9.patch ];
+    qtscript = [ ./qtscript.patch ];
+    qtserialport = [ ./qtserialport.patch ];
+    qtwebengine = [
+      # Fix build with bison-3.7: https://code.qt.io/cgit/qt/qtwebengine-chromium.git/commit/?id=1a53f599
+      (fetchpatch {
+        name = "qtwebengine-bison-3.7-build.patch";
+        url = "https://code.qt.io/cgit/qt/qtwebengine-chromium.git/patch/?id=1a53f599";
+        sha256 = "1nqpyn5fq37q7i9nasag6i14lnz0d7sld5ikqhlm8qwq9d7gbmjy";
+        stripLen = 1;
+        extraPrefix = "src/3rdparty/";
+      })
+      # Fix build with GCC 10 (part 1): https://code.qt.io/cgit/qt/qtwebengine-chromium.git/commit/?id=fad3e27b
+      (fetchpatch {
+        name = "qtwebengine-gcc10-part1.patch";
+        url = "https://code.qt.io/cgit/qt/qtwebengine-chromium.git/patch/?id=fad3e27bfb50d1e23a07577f087a826b5e00bb1d";
+        sha256 = "0c55j9zww8jyif6wl7jy1qqidgw9fdhiyfjgzhzi85r716m4pwwd";
+        stripLen = 1;
+        extraPrefix = "src/3rdparty/";
+      })
+      # Fix build with GCC 10 (part 2): https://code.qt.io/cgit/qt/qtwebengine-chromium.git/commit/?id=193c5bed
+      (fetchpatch {
+        name = "qtwebengine-gcc10-part2.patch";
+        url = "https://code.qt.io/cgit/qt/qtwebengine-chromium.git/patch/?id=193c5bed1cff123e21b7e6d12f464d6709ace2e3";
+        sha256 = "1jb6s32ara6l4rbn4h3gg95mzv8sd8dl1zpjaqwywf1w7p8ymk86";
+        stripLen = 1;
+        extraPrefix = "src/3rdparty/";
+      })
+    ] ++ lib.optional stdenv.isDarwin ./qtwebengine-darwin-no-platform-check.patch;
+    qtwebkit = [
+      (fetchpatch {
+        name = "qtwebkit-bison-3.7-build.patch";
+        url = "https://github.com/qtwebkit/qtwebkit/commit/d92b11fea65364fefa700249bd3340e0cd4c5b31.patch";
+        sha256 = "0h8ymfnwgkjkwaankr3iifiscsvngqpwb91yygndx344qdiw9y0n";
+      })
+      (fetchpatch {
+        name = "qtwebkit-glib-2.68.patch";
+        url = "https://github.com/qtwebkit/qtwebkit/pull/1058/commits/5b698ba3faffd4e198a45be9fe74f53307395e4b.patch";
+        sha256 = "0a3xv0h4lv8wggckgy8cg8xnpkg7n9h45312pdjdnnwy87xvzss0";
+      })
+      ./qtwebkit.patch
+      ./qtwebkit-icu68.patch
+    ] ++ lib.optionals stdenv.isDarwin [
+      ./qtwebkit-darwin-no-readline.patch
+      ./qtwebkit-darwin-no-qos-classes.patch
+    ];
+    qttools = [ ./qttools.patch ];
+    qtwayland = [ ./qtwayland-libdrm-build.patch ];
+  };
+
+  qtModule =
+    import ../qtModule.nix
+    {
+      inherit perl;
+      inherit lib;
+      # Use a variant of mkDerivation that does not include wrapQtApplications
+      # to avoid cyclic dependencies between Qt modules.
+      mkDerivation =
+        import ../mkDerivation.nix
+        { inherit lib; inherit debug; wrapQtAppsHook = null; }
+        stdenvActual.mkDerivation;
+    }
+    { inherit self srcs patches; };
+
+  addPackages = self: with self;
+    let
+      callPackage = self.newScope { inherit qtCompatVersion qtModule srcs; };
+    in {
+
+      inherit callPackage qtCompatVersion qtModule srcs;
+
+      mkDerivationWith =
+        import ../mkDerivation.nix
+        { inherit lib; inherit debug; inherit (self) wrapQtAppsHook; };
+
+      mkDerivation = mkDerivationWith stdenvActual.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 debug developerBuild decryptSslTraffic;
+        inherit (darwin.apple_sdk.frameworks) AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth
+          CoreLocation CoreServices DiskArbitration Foundation OpenGL MetalKit IOKit;
+        inherit (darwin) libobjc;
+      };
+
+      qt3d = callPackage ../modules/qt3d.nix {};
+      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 {};
+      qtspeech = callPackage ../modules/qtspeech.nix {};
+      qtsvg = callPackage ../modules/qtsvg.nix {};
+      qtscxml = callPackage ../modules/qtscxml.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 {
+        inherit (darwin) cctools libobjc libunwind xnu;
+        inherit (darwin.apple_sdk.libs) sandbox;
+        inherit (darwin.apple_sdk.frameworks) ApplicationServices AVFoundation Foundation ForceFeedback GameController AppKit
+          ImageCaptureCore CoreBluetooth IOBluetooth CoreWLAN Quartz Cocoa LocalAuthentication;
+      };
+      qtwebglplugin = callPackage ../modules/qtwebglplugin.nix {};
+      qtwebkit = callPackage ../modules/qtwebkit.nix {
+        inherit (darwin) ICU;
+        inherit (darwin.apple_sdk.frameworks) OpenGL;
+      };
+      qtwebsockets = callPackage ../modules/qtwebsockets.nix {};
+      qtwebview = callPackage ../modules/qtwebview.nix {
+        inherit (darwin.apple_sdk.frameworks) CoreFoundation WebKit;
+      };
+      qtx11extras = callPackage ../modules/qtx11extras.nix {};
+      qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {};
+
+      env = callPackage ../qt-env.nix {};
+      full = env "qt-full-${qtbase.version}" ([
+        qt3d qtcharts qtconnectivity qtdeclarative qtdoc qtgraphicaleffects
+        qtimageformats qtlocation qtmultimedia qtquickcontrols qtquickcontrols2
+        qtscript qtsensors qtserialport qtsvg qttools qttranslations
+        qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets
+        qtwebview qtx11extras qtxmlpatterns
+      ] ++ lib.optional (!stdenv.isDarwin) qtwayland
+        ++ lib.optional (stdenv.isDarwin) qtmacextras);
+
+      qmake = makeSetupHook {
+        deps = [ self.qtbase.dev ];
+        substitutions = {
+          inherit debug;
+          fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
+        };
+      } ../hooks/qmake-hook.sh;
+
+      wrapQtAppsHook = makeSetupHook {
+        deps = [ self.qtbase.dev makeWrapper ]
+          ++ lib.optional stdenv.isLinux self.qtwayland.dev;
+      } ../hooks/wrap-qt-apps-hook.sh;
+    };
+
+   self = lib.makeScope newScope addPackages;
+
+in self
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/fetch.sh b/nixpkgs/pkgs/development/libraries/qt-5/5.14/fetch.sh
new file mode 100644
index 000000000000..e4e02bd82ed3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/fetch.sh
@@ -0,0 +1,2 @@
+WGET_ARGS=( http://download.qt.io/official_releases/qt/5.14/5.14.2/submodules/ \
+            -A '*.tar.xz' )
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
new file mode 100644
index 000000000000..0f38ce0d7f61
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
@@ -0,0 +1,409 @@
+From a5848991db270ffdd9f2fa05220475bb3194d12f Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Milan=20P=C3=A4ssler?= <me@pbb.lc>
+Date: Fri, 3 Apr 2020 21:07:58 +0200
+Subject: [PATCH 01/10] qtbase-mkspecs-mac
+
+---
+ mkspecs/common/mac.conf               |   2 +-
+ mkspecs/features/mac/default_post.prf | 206 --------------------------
+ mkspecs/features/mac/default_pre.prf  |  58 --------
+ mkspecs/features/mac/sdk.mk           |  25 ----
+ mkspecs/features/mac/sdk.prf          |  61 --------
+ 5 files changed, 1 insertion(+), 351 deletions(-)
+ delete mode 100644 mkspecs/features/mac/sdk.mk
+ delete mode 100644 mkspecs/features/mac/sdk.prf
+
+diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf
+index 61bea952b2..9909dae726 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/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
+index ba163efc18..b80ec1e801 100644
+--- a/mkspecs/features/mac/default_post.prf
++++ b/mkspecs/features/mac/default_post.prf
+@@ -68,212 +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 {
+-    uikit: QMAKE_RPATHDIR += @executable_path/Frameworks
+-    else: 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
+-            sysroot_path  = $$xcodeSDKInfo(Path, $$simulator.sdk)
+-        } else {
+-            version_identifier = $$device.deployment_identifier
+-            sysroot_path  = $$xcodeSDKInfo(Path, $$device.sdk)
+-        }
+-        version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
+-        QMAKE_CFLAGS += -isysroot $$sysroot_path $$version_min_flag
+-        QMAKE_CXXFLAGS += -isysroot $$sysroot_path $$version_min_flag
+-        QMAKE_LFLAGS += -Wl,-syslibroot,$$sysroot_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
+--- 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
+deleted file mode 100644
+index 3a9c2778bb..0000000000
+--- a/mkspecs/features/mac/sdk.prf
++++ /dev/null
+@@ -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.25.1
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0003-qtbase-mkspecs.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0003-qtbase-mkspecs.patch
new file mode 100644
index 000000000000..dbd6b3663443
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0003-qtbase-mkspecs.patch
@@ -0,0 +1,490 @@
+From 87c81a31d65862a2f32fdc575cfb47b7a46bfae7 Mon Sep 17 00:00:00 2001
+From: OPNA2608 <christoph.neidahl@gmail.com>
+Date: Mon, 12 Apr 2021 20:05:25 +0200
+Subject: [PATCH 03/10] qtbase-mkspecs
+
+---
+ mkspecs/features/create_cmake.prf             | 51 +++---------
+ .../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             | 27 ++++---
+ mkspecs/features/qt_installs.prf              | 22 ++---
+ mkspecs/features/qt_plugin.prf                |  2 +-
+ 11 files changed, 52 insertions(+), 152 deletions(-)
+
+diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
+index 0e71fd0015..ba071d9a70 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
+@@ -77,45 +77,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
+-}
++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
+ 
+@@ -258,7 +233,7 @@ contains(CONFIG, plugin) {
+ 
+     cmake_qt5_plugin_file.files = $$cmake_target_file.output
+     static|staticlib: cmake_qt5_plugin_file.files += $$cmake_qt5_plugin_import_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()
+@@ -396,7 +371,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 1099a761ce..87679b7e68 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)")
+@@ -146,11 +122,7 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI
+       IsDebugAndRelease)
+     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(_deps
+         ${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}
+@@ -210,11 +182,7 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI
+ !!ENDIF
+ 
+ !!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
+@@ -230,24 +198,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 \"\")
+@@ -263,7 +220,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
+@@ -465,25 +421,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}\" \"\" $${CMAKE_DEBUG_AND_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_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}\" $${CMAKE_DEBUG_AND_RELEASE})
+ !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
+     endif()
+@@ -502,25 +446,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}\" \"\" $${CMAKE_DEBUG_AND_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}\" $${CMAKE_DEBUG_AND_RELEASE})
+ !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
+     endif()
+@@ -542,11 +474,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+           IsDebugAndRelease)
+         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 c0b50416c9..cabe39b22e 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
+ 
+ qmlfiles.base = $$_PRO_FILE_PWD_
+ qmlfiles.files = $$fq_aux_qml_files
+diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf
+index f1c5658b04..029595e721 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 095bf15dac..4cc977bea5 100644
+--- a/mkspecs/features/qt_docs.prf
++++ b/mkspecs/features/qt_docs.prf
+@@ -65,7 +65,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) {
+@@ -84,8 +84,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
+@@ -108,12 +108,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 72b47bce27..d59e949e78 100644
+--- a/mkspecs/features/qt_example_installs.prf
++++ b/mkspecs/features/qt_example_installs.prf
+@@ -90,7 +90,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 7777e615bd..b0c6880a74 100644
+--- a/mkspecs/features/qt_functions.prf
++++ b/mkspecs/features/qt_functions.prf
+@@ -87,19 +87,22 @@ defineTest(qtHaveModule) {
+ defineTest(qtPrepareTool) {
+     cmd = $$eval(QT_TOOL.$${2}.binary)
+     isEmpty(cmd) {
+-        cmd = $$[QT_HOST_BINS]/$$2
+-        exists($${cmd}.pl) {
+-            $${1}_EXE = $${cmd}.pl
+-            cmd = perl -w $$system_path($${cmd}.pl)
+-        } else: contains(QMAKE_HOST.os, Windows) {
+-            $${1}_EXE = $${cmd}.exe
+-            cmd = $$system_path($${cmd}.exe)
+-        } else:contains(QMAKE_HOST.os, Darwin) {
+-            BUNDLENAME = $${cmd}.app/Contents/MacOS/$$2
+-            exists($$BUNDLENAME) {
+-                cmd = $$BUNDLENAME
++        cmd = $$system("command -v $${2}")
++        isEmpty(cmd) {
++            cmd = $$system("command -v $${2}.pl")
++            !isEmpty(cmd) {
++                $${1}_EXE = $$cmd
++                cmd = perl -w $$system_path($${cmd})
++            } else: contains(QMAKE_HOST.os, Windows) {
++                cmd = $$system("command -v $${2}.exe")
++                $${1}_EXE = $$cmd
++            } else: contains(QMAKE_HOST.os, Darwin) {
++                cmd = $$system("command -v $${2}.app")
++                !isEmpty(cmd) {
++                    cmd = $${cmd}/Contents/MacOS/$${2}
++                    $${1}_EXE = $$cmd
++                }
+             }
+-            $${1}_EXE = $$cmd
+         } else {
+             $${1}_EXE = $$cmd
+         }
+diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf
+index 1ebca17366..a8f958eae8 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 573d717eea..024c624cb6 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
+ 
+ qt_libinfix_plugins: TARGET = $$TARGET$$QT_LIBINFIX
+-- 
+2.29.3
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0004-qtbase-replace-libdir.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0004-qtbase-replace-libdir.patch
new file mode 100644
index 000000000000..86ea2e75d9be
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0004-qtbase-replace-libdir.patch
@@ -0,0 +1,68 @@
+From 1cae0c31c9849615190ee175ebf929b3aca13fe0 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Milan=20P=C3=A4ssler?= <me@pbb.lc>
+Date: Sat, 4 Apr 2020 00:27:41 +0200
+Subject: [PATCH 04/10] 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 c24f2c6062..0d72ce7286 100644
+--- a/mkspecs/features/qt_common.prf
++++ b/mkspecs/features/qt_common.prf
+@@ -31,32 +31,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 828a9621b9..b9e5d35026 100644
+--- a/mkspecs/features/qt_module.prf
++++ b/mkspecs/features/qt_module.prf
+@@ -305,10 +305,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.25.1
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0005-qtbase-cmake.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0005-qtbase-cmake.patch
new file mode 100644
index 000000000000..85a729563417
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0005-qtbase-cmake.patch
@@ -0,0 +1,194 @@
+From 7e93d1330e1f8c8cd68334201ad100b8c05c9ab5 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/10] 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 87679b7e68..57060e6470 100644
+--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
++++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+@@ -474,7 +474,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+           IsDebugAndRelease)
+         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 7b70cfed09..e700cfa539 100644
+--- a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
++++ b/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
+@@ -53,10 +53,10 @@ set_property(TARGET Qt5::$$CMAKE_PLUGIN_NAME PROPERTY INTERFACE_SOURCES
+ !!ENDIF
+ 
+ !!IF !isEmpty(CMAKE_RELEASE_TYPE)
+-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE})
++_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_DIR}$${CMAKE_PLUGIN_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE})
+ !!ENDIF
+ !!IF !isEmpty(CMAKE_DEBUG_TYPE)
+-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE})
++_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_DIR}$${CMAKE_PLUGIN_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE})
+ !!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 9b672327ef..319ba94d6d 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
+@@ -118,7 +118,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
+@@ -132,7 +132,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.25.1
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0006-qtbase-gtk3.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0006-qtbase-gtk3.patch
new file mode 100644
index 000000000000..6ce0e5d0c433
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0006-qtbase-gtk3.patch
@@ -0,0 +1,48 @@
+From 1ad04525cdd342e3c8a750323fb3a61b93fee753 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/10] 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.25.1
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0007-qtbase-xcursor.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0007-qtbase-xcursor.patch
new file mode 100644
index 000000000000..6a92a9528303
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0007-qtbase-xcursor.patch
@@ -0,0 +1,29 @@
+From cc953cc3f736fabef1f5c211964f30be719fb35e 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/10] 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.25.1
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0008-qtbase-tzdir.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0008-qtbase-tzdir.patch
new file mode 100644
index 000000000000..71653a0e36e0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0008-qtbase-tzdir.patch
@@ -0,0 +1,64 @@
+From 882343ea200fe28810bf217a820816affe885a39 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Tue, 17 Sep 2019 05:36:25 -0500
+Subject: [PATCH 08/10] qtbase-tzdir
+
+---
+ src/corelib/time/qtimezoneprivate_tz.cpp | 31 +++++++++++++++---------
+ 1 file changed, 19 insertions(+), 12 deletions(-)
+
+diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp
+index 3c2695a789..e75735f88f 100644
+--- a/src/corelib/time/qtimezoneprivate_tz.cpp
++++ b/src/corelib/time/qtimezoneprivate_tz.cpp
+@@ -75,7 +75,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");
+ 
+@@ -658,20 +662,23 @@ 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));
++            tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
+             if (!tzif.open(QIODevice::ReadOnly)) {
+-                // ianaId may be a POSIX rule, taken from $TZ or /etc/TZ
+-                const QByteArray zoneInfo = ianaId.split(',').at(0);
+-                const char *begin = zoneInfo.constBegin();
+-                if (PosixZone::parse(begin, zoneInfo.constEnd()).hasValidOffset()
+-                    && (begin == zoneInfo.constEnd()
+-                        || PosixZone::parse(begin, zoneInfo.constEnd()).hasValidOffset())) {
+-                    m_id = m_posixRule = ianaId;
++                tzif.setFileName(QLatin1String("/usr/lib/zoneinfo/") + QString::fromLocal8Bit(ianaId));
++                if (!tzif.open(QIODevice::ReadOnly)) {
++                    // ianaId may be a POSIX rule, taken from $TZ or /etc/TZ
++                    const QByteArray zoneInfo = ianaId.split(',').at(0);
++                    const char *begin = zoneInfo.constBegin();
++                    if (PosixZone::parse(begin, zoneInfo.constEnd()).hasValidOffset()
++                        && (begin == zoneInfo.constEnd()
++                            || PosixZone::parse(begin, zoneInfo.constEnd()).hasValidOffset())) {
++                        m_id = m_posixRule = ianaId;
++                    }
++                    return;
+                 }
+-                return;
+             }
+         }
+     }
+-- 
+2.25.1
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0009-qtbase-qtpluginpath.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0009-qtbase-qtpluginpath.patch
new file mode 100644
index 000000000000..009fe14838e7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0009-qtbase-qtpluginpath.patch
@@ -0,0 +1,19 @@
+--- qtbase-everywhere-src-5.14.2/src/corelib/kernel/qcoreapplication.cpp	2020-03-27 10:49:31.000000000 +0100
++++ qtbase-everywhere-src-5.14.2/src/corelib/kernel/qcoreapplication.cpp.patched	2020-05-09 15:03:03.968084088 +0200
+@@ -2691,6 +2691,16 @@
+         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));
++            }
++        }
++
++
+         auto setPathsFromEnv = [&](QString libPathEnv) {
+             if (!libPathEnv.isEmpty()) {
+                 QStringList paths = libPathEnv.split(QDir::listSeparator(), QString::SkipEmptyParts);
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0010-qtbase-assert.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0010-qtbase-assert.patch
new file mode 100644
index 000000000000..e10f97607326
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0010-qtbase-assert.patch
@@ -0,0 +1,32 @@
+From c8893a4e0a1b46796e39b4a338358fdb45685cba Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Tue, 17 Sep 2019 05:37:04 -0500
+Subject: [PATCH 09/10] 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.25.1
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0011-fix-header_module.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0011-fix-header_module.patch
new file mode 100644
index 000000000000..4358097dddf2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0011-fix-header_module.patch
@@ -0,0 +1,25 @@
+From 4c488fdb457e63924383fb7f8ad45bed3df49480 Mon Sep 17 00:00:00 2001
+From: Will Dietz <w@wdtz.org>
+Date: Mon, 30 Sep 2019 20:15:40 -0500
+Subject: [PATCH 10/10] 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 16b39031bc..1ac3d6fe59 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.25.1
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0012-qtbase-tbd-frameworks.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0012-qtbase-tbd-frameworks.patch
new file mode 100644
index 000000000000..8a5939978a6b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0012-qtbase-tbd-frameworks.patch
@@ -0,0 +1,15 @@
+diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
+index 84dbbfebd4..615bfed124 100644
+--- a/src/gui/Qt5GuiConfigExtras.cmake.in
++++ b/src/gui/Qt5GuiConfigExtras.cmake.in
+@@ -119,6 +119,10 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
+             if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
+                 set(Qt5Gui_${_cmake_lib_name}_LIBRARY)
+             endif()
++            set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}.tbd")
++            if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
++                set(Qt5Gui_${_cmake_lib_name}_LIBRARY)
++            endif()
+ !!ENDIF
+             if (NOT Qt5Gui_${_cmake_lib_name}_LIBRARY)
+                 # The above find_library call doesn\'t work for finding
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0013-define-kiosurfacesuccess.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/0013-define-kiosurfacesuccess.patch
new file mode 100644
index 000000000000..a43a46d8a69b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/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.14/qtbase.patch.d/qtbase-sdk-10.12-mac.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/qtbase-sdk-10.12-mac.patch
new file mode 100644
index 000000000000..b2dff5aba8f6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtbase.patch.d/qtbase-sdk-10.12-mac.patch
@@ -0,0 +1,77 @@
+diff --git a/mkspecs/common/macx.conf b/mkspecs/common/macx.conf
+--- a/mkspecs/common/macx.conf
++++ b/mkspecs/common/macx.conf
+@@ -10,7 +10,7 @@ QMAKE_APPLE_DEVICE_ARCHS = x86_64
+ 
+ # Should be 10.15, but as long as the CI builds with
+ # older SDKs we have to keep this.
+-QT_MAC_SDK_VERSION_MIN = 10.14
++QT_MAC_SDK_VERSION_MIN = 10.12
+ 
+ QT_MAC_SDK_VERSION_MAX = 10.15
+ 
+diff --git a/src/corelib/kernel/qcore_mac_objc.mm b/src/corelib/kernel/qcore_mac_objc.mm
+--- a/src/corelib/kernel/qcore_mac_objc.mm
++++ b/src/corelib/kernel/qcore_mac_objc.mm
+@@ -142,16 +142,10 @@ QMacAutoReleasePool::QMacAutoReleasePool()
+ 
+ #ifdef QT_DEBUG
+     void *poolFrame = nullptr;
+-    if (__builtin_available(macOS 10.14, iOS 12.0, tvOS 12.0, watchOS 5.0, *)) {
+-        void *frame;
+-        if (backtrace_from_fp(__builtin_frame_address(0), &frame, 1))
+-            poolFrame = frame;
+-    } else {
+         static const int maxFrames = 3;
+         void *callstack[maxFrames];
+         if (backtrace(callstack, maxFrames) == maxFrames)
+             poolFrame = callstack[maxFrames - 1];
+-    }
+ 
+     if (poolFrame) {
+         Dl_info info;
+diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp
+--- a/src/gui/rhi/qrhi.cpp
++++ b/src/gui/rhi/qrhi.cpp
+@@ -4050,7 +4050,7 @@ QRhi *QRhi::create(Implementation impl, QRhiInitParams *params, Flags flags, QRh
+ #endif
+     case Metal:
+ //#ifdef Q_OS_DARWIN
+-#ifdef Q_OS_MACOS
++#if 0
+         r->d = new QRhiMetal(static_cast<QRhiMetalInitParams *>(params),
+                              static_cast<QRhiMetalNativeHandles *>(importDevice));
+         break;
+diff --git a/src/gui/rhi/rhi.pri b/src/gui/rhi/rhi.pri
+--- a/src/gui/rhi/rhi.pri
++++ b/src/gui/rhi/rhi.pri
+@@ -44,7 +44,7 @@ win32 {
+ }
+ 
+ # darwin {
+-macos {
++false {
+     HEADERS += \
+         rhi/qrhimetal_p.h \
+         rhi/qrhimetal_p_p.h
+diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
+--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
++++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
+@@ -134,7 +134,7 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
+     NSImage *nsimage = qt_mac_create_nsimage(pm);
+     [nsimage setSize:NSSizeFromCGSize(pmDeviceIndependentSize.toCGSize())];
+ 
+-    QMacPasteboard dragBoard(CFStringRef(NSPasteboardNameDrag), QMacInternalPasteboardMime::MIME_DND);
++    QMacPasteboard dragBoard((CFStringRef) NSDragPboard, QMacInternalPasteboardMime::MIME_DND);
+     m_drag->mimeData()->setData(QLatin1String("application/x-qt-mime-type-name"), QByteArray("dummy"));
+     dragBoard.setMimeData(m_drag->mimeData(), QMacPasteboard::LazyRequest);
+ 
+@@ -145,7 +145,7 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
+     CGFloat flippedY = pmDeviceIndependentSize.height() - hotSpot.y();
+     event_location.y -= flippedY;
+     NSSize mouseOffset_unused = NSMakeSize(0.0, 0.0);
+-    NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSPasteboardNameDrag];
++    NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
+ 
+     [theWindow dragImage:nsimage
+         at:event_location
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtdeclarative.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtdeclarative.patch
new file mode 100644
index 000000000000..8f5b5d4790fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtdeclarative.patch
@@ -0,0 +1,33 @@
+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/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.14/qtlocation-gcc-9.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtlocation-gcc-9.patch
new file mode 100644
index 000000000000..1791313e5603
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtlocation-gcc-9.patch
@@ -0,0 +1,21 @@
+diff --git a/src/3rdparty/mapbox-gl-native/platform/default/bidi.cpp b/src/3rdparty/mapbox-gl-native/platform/default/bidi.cpp
+index d475c38..c1710a6 100644
+--- a/src/3rdparty/mapbox-gl-native/platform/default/bidi.cpp
++++ b/src/3rdparty/mapbox-gl-native/platform/default/bidi.cpp
+@@ -5,6 +5,7 @@
+ #include <unicode/ushape.h>
+ 
+ #include <memory>
++#include <stdexcept>
+ 
+ namespace mbgl {
+ 
+diff --git a/src/3rdparty/mapbox-gl-native/src/mbgl/util/convert.cpp b/src/3rdparty/mapbox-gl-native/src/mbgl/util/convert.cpp
+index 97bfe91..56d3e17 100644
+--- a/src/3rdparty/mapbox-gl-native/src/mbgl/util/convert.cpp
++++ b/src/3rdparty/mapbox-gl-native/src/mbgl/util/convert.cpp
+@@ -1,3 +1,4 @@
++#include <cstdint>
+ #include <mbgl/util/convert.hpp>
+ 
+ namespace mbgl {
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtscript.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtscript.patch
new file mode 100644
index 000000000000..5508dec1280e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtscript.patch
@@ -0,0 +1,13 @@
+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.14/qtserialport.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtserialport.patch
new file mode 100644
index 000000000000..f25524e80bcf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtserialport.patch
@@ -0,0 +1,22 @@
+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.14/qttools.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qttools.patch
new file mode 100644
index 000000000000..8ae12198ca25
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qttools.patch
@@ -0,0 +1,15 @@
+--- 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.14/qtwayland-libdrm-build.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwayland-libdrm-build.patch
new file mode 100644
index 000000000000..fb3d6327e45b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwayland-libdrm-build.patch
@@ -0,0 +1,56 @@
+commit 7217ea9cf297e664be876eb82b66a1b4f157ca80
+Author: Peter Seiderer <ps.report@gmx.net>
+Date:   Fri Apr 3 21:52:30 2020 +0200
+
+    fix libdrm related configure test failure
+    
+    Fixes:
+    
+      Project ERROR: Test config.qtwayland_client.tests.dmabuf-server-buffer tries to use undeclared library 'drm'
+      Project ERROR: Test config.qtwayland_compositor.tests.dmabuf-server-buffer tries to use undeclared library 'drm'
+      Project ERROR: Test config.qtwayland_compositor.tests.dmabuf-client-buffer tries to use undeclared library 'drm'
+    
+    Task-number: QTBUG-83303
+    Change-Id: I3970f4e3855fcfa760493631a14adb6a16950aa9
+    Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
+    Reviewed-by: Heikki Halmet <heikki.halmet@qt.io>
+    Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
+    (cherry picked from commit ca63fe81df8ac910f43539719566ed6745700c2b)
+    (cherry picked from commit 1344ca6b5a8fbc1b28727feea6d856af8bf3bc93)
+
+diff --git a/src/client/configure.json b/src/client/configure.json
+index 06213968..27c73f89 100644
+--- a/src/client/configure.json
++++ b/src/client/configure.json
+@@ -74,7 +74,8 @@
+             "label": "Linux dma-buf Buffer Sharing",
+             "type": "compile",
+             "test": "dmabuf_server_buffer",
+-            "use": "egl drm"
++            "libs": "-ldrm",
++            "use": "egl"
+         },
+         "vulkan-server-buffer": {
+             "label": "Vulkan Buffer Sharing",
+diff --git a/src/compositor/configure.json b/src/compositor/configure.json
+index 0dbb3364..73e4c1a8 100644
+--- a/src/compositor/configure.json
++++ b/src/compositor/configure.json
+@@ -80,13 +80,15 @@
+             "label": "Linux dma-buf Buffer Sharing",
+             "type": "compile",
+             "test": "dmabuf_server_buffer",
+-            "use": "egl drm"
++            "libs": "-ldrm",
++            "use": "egl"
+         },
+         "dmabuf-client-buffer": {
+             "label": "Linux Client dma-buf Buffer Sharing",
+             "type": "compile",
+             "test": "dmabuf_client_buffer",
+-            "use": "egl drm"
++            "libs": "-ldrm",
++            "use": "egl"
+         },
+         "vulkan-server-buffer": {
+             "label": "Vulkan Buffer Sharing",
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebengine-darwin-no-platform-check.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebengine-darwin-no-platform-check.patch
new file mode 100644
index 000000000000..546e753144d0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebengine-darwin-no-platform-check.patch
@@ -0,0 +1,33 @@
+diff --git a/mkspecs/features/platform.prf b/mkspecs/features/platform.prf
+--- a/mkspecs/features/platform.prf
++++ b/mkspecs/features/platform.prf
+@@ -40,8 +40,6 @@ defineTest(isPlatformSupported) {
+   } else:osx {
+     # FIXME: Try to get it back down to 8.2 for building on OS X 10.11
+     !isMinXcodeVersion(8, 3, 3) {
+-      skipBuild("Using Xcode version $$QMAKE_XCODE_VERSION, but at least version 8.3.3 is required to build Qt WebEngine.")
+-      return(false)
+     }
+     !clang|intel_icc {
+         skipBuild("Qt WebEngine on macOS requires Clang.")
+@@ -54,8 +52,6 @@ defineTest(isPlatformSupported) {
+       return(false)
+     }
+     !isMinOSXSDKVersion(10, 12): {
+-      skipBuild("Building Qt WebEngine requires a macOS SDK version of 10.12 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
+-      return(false)
+     }
+   } else {
+     skipBuild("Unknown platform. Qt WebEngine only supports Linux, Windows, and macOS.")
+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.14/qtwebkit-darwin-no-qos-classes.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebkit-darwin-no-qos-classes.patch
new file mode 100644
index 000000000000..a7087f517623
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebkit-darwin-no-qos-classes.patch
@@ -0,0 +1,11 @@
+diff --git a/Source/cmake/OptionsQt.cmake b/Source/cmake/OptionsQt.cmake
+--- a/Source/cmake/OptionsQt.cmake
++++ b/Source/cmake/OptionsQt.cmake
+@@ -683,7 +683,6 @@ if (WIN32 AND COMPILER_IS_GCC_OR_CLANG)
+ endif ()
+ 
+ if (APPLE)
+-    SET_AND_EXPOSE_TO_BUILD(HAVE_QOS_CLASSES 1)
+ endif ()
+ 
+ if (ENABLE_MATHML)
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebkit-darwin-no-readline.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebkit-darwin-no-readline.patch
new file mode 100644
index 000000000000..4871032f6f2c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebkit-darwin-no-readline.patch
@@ -0,0 +1,30 @@
+diff --git a/Source/JavaScriptCore/shell/CMakeLists.txt b/Source/JavaScriptCore/shell/CMakeLists.txt
+--- a/Source/JavaScriptCore/shell/CMakeLists.txt
++++ b/Source/JavaScriptCore/shell/CMakeLists.txt
+@@ -9,7 +9,6 @@ set(JSC_LIBRARIES
+ )
+ 
+ if (WTF_OS_MAC_OS_X)
+-    list(APPEND JSC_LIBRARIES edit)
+ endif ()
+ 
+ if ("${JavaScriptCore_LIBRARY_TYPE}" MATCHES "STATIC")
+diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
+--- a/Source/WTF/wtf/Platform.h
++++ b/Source/WTF/wtf/Platform.h
+@@ -563,7 +563,6 @@
+ #if PLATFORM(IOS)
+ 
+ #define HAVE_NETWORK_EXTENSION 1
+-#define HAVE_READLINE 1
+ #if USE(APPLE_INTERNAL_SDK)
+ #define USE_CFNETWORK 1
+ #endif
+@@ -650,7 +649,6 @@
+ #define HAVE_MADV_DONTNEED 1
+ #define HAVE_MERGESORT 1
+ #define HAVE_PTHREAD_SETNAME_NP 1
+-#define HAVE_READLINE 1
+ #define HAVE_SYS_TIMEB_H 1
+ 
+ #if !PLATFORM(GTK) && !PLATFORM(QT)
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebkit-icu68.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebkit-icu68.patch
new file mode 100644
index 000000000000..73463d7567a3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebkit-icu68.patch
@@ -0,0 +1,170 @@
+Regressed by https://github.com/unicode-org/icu/commit/c3fe7e09d844
+
+In file included from Source/WebCore/platform/text/TextAllInOne.cpp:31:
+Source/WebCore/platform/text/TextCodecICU.cpp:311:42: error: use of undeclared identifier 'TRUE'
+        ucnv_setFallback(m_converterICU, TRUE);
+                                         ^
+In file included from Source/WebCore/platform/text/TextAllInOne.cpp:40:
+In file included from Source/WebCore/platform/text/icu/UTextProvider.cpp:27:
+Source/WebCore/platform/text/icu/UTextProvider.h:83:28: error: use of undeclared identifier 'TRUE'
+            isAccessible = TRUE;
+                           ^
+Source/WebCore/platform/text/icu/UTextProvider.h:88:28: error: use of undeclared identifier 'FALSE'
+            isAccessible = FALSE;
+                           ^
+Source/WebCore/platform/text/icu/UTextProvider.h:97:28: error: use of undeclared identifier 'TRUE'
+            isAccessible = TRUE;
+                           ^
+Source/WebCore/platform/text/icu/UTextProvider.h:102:28: error: use of undeclared identifier 'FALSE'
+            isAccessible = FALSE;
+                           ^
+In file included from Source/WebCore/platform/text/TextAllInOne.cpp:41:
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:103:20: error: use of undeclared identifier 'TRUE'
+            return TRUE;
+                   ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:108:20: error: use of undeclared identifier 'FALSE'
+            return FALSE;
+                   ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:114:20: error: use of undeclared identifier 'TRUE'
+            return TRUE;
+                   ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:119:20: error: use of undeclared identifier 'FALSE'
+            return FALSE;
+                   ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:147:12: error: use of undeclared identifier 'TRUE'
+    return TRUE;
+           ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:339:16: error: use of undeclared identifier 'FALSE'
+        return FALSE;
+               ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:359:12: error: use of undeclared identifier 'TRUE'
+    return TRUE;
+           ^
+In file included from Source/WebCore/platform/text/TextAllInOne.cpp:42:
+Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp:128:16: error: use of undeclared identifier 'FALSE'
+        return FALSE;
+               ^
+Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp:148:12: error: use of undeclared identifier 'TRUE'
+    return TRUE;
+           ^
+
+--- a/Source/WebCore/platform/text/TextCodecICU.cpp
++++ b/Source/WebCore/platform/text/TextCodecICU.cpp
+@@ -308,7 +308,7 @@ void TextCodecICU::createICUConverter() const
+     m_converterICU = ucnv_open(m_canonicalConverterName, &err);
+     ASSERT(U_SUCCESS(err));
+     if (m_converterICU)
+-        ucnv_setFallback(m_converterICU, TRUE);
++        ucnv_setFallback(m_converterICU, true);
+ }
+ 
+ int TextCodecICU::decodeToBuffer(UChar* target, UChar* targetLimit, const char*& source, const char* sourceLimit, int32_t* offsets, bool flush, UErrorCode& err)
+--- a/Source/WebCore/platform/text/icu/UTextProvider.h
++++ b/Source/WebCore/platform/text/icu/UTextProvider.h
+@@ -80,12 +80,12 @@ inline bool uTextAccessInChunkOrOutOfRange(UText* text
+             // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
+             ASSERT(offset < std::numeric_limits<int32_t>::max());
+             text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
+-            isAccessible = TRUE;
++            isAccessible = true;
+             return true;
+         }
+         if (nativeIndex >= nativeLength && text->chunkNativeLimit == nativeLength) {
+             text->chunkOffset = text->chunkLength;
+-            isAccessible = FALSE;
++            isAccessible = false;
+             return true;
+         }
+     } else {
+@@ -94,12 +94,12 @@ inline bool uTextAccessInChunkOrOutOfRange(UText* text
+             // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
+             ASSERT(offset < std::numeric_limits<int32_t>::max());
+             text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
+-            isAccessible = TRUE;
++            isAccessible = true;
+             return true;
+         }
+         if (nativeIndex <= 0 && !text->chunkNativeStart) {
+             text->chunkOffset = 0;
+-            isAccessible = FALSE;
++            isAccessible = false;
+             return true;
+         }
+     }
+--- a/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
++++ b/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
+@@ -100,23 +100,23 @@ static UBool uTextLatin1Access(UText* uText, int64_t i
+         if (index < uText->chunkNativeLimit && index >= uText->chunkNativeStart) {
+             // Already inside the buffer. Set the new offset.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return TRUE;
++            return true;
+         }
+         if (index >= length && uText->chunkNativeLimit == length) {
+             // Off the end of the buffer, but we can't get it.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return FALSE;
++            return false;
+         }
+     } else {
+         if (index <= uText->chunkNativeLimit && index > uText->chunkNativeStart) {
+             // Already inside the buffer. Set the new offset.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return TRUE;
++            return true;
+         }
+         if (!index && !uText->chunkNativeStart) {
+             // Already at the beginning; can't go any farther.
+             uText->chunkOffset = 0;
+-            return FALSE;
++            return false;
+         }
+     }
+     
+@@ -144,7 +144,7 @@ static UBool uTextLatin1Access(UText* uText, int64_t i
+ 
+     uText->nativeIndexingLimit = uText->chunkLength;
+ 
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextLatin1Extract(UText* uText, int64_t start, int64_t limit, UChar* dest, int32_t destCapacity, UErrorCode* status)
+@@ -336,7 +336,7 @@ static int64_t uTextLatin1ContextAwareNativeLength(UTe
+ static UBool uTextLatin1ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
+ {
+     if (!text->context)
+-        return FALSE;
++        return false;
+     int64_t nativeLength = uTextLatin1ContextAwareNativeLength(text);
+     UBool isAccessible;
+     if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
+@@ -356,7 +356,7 @@ static UBool uTextLatin1ContextAwareAccess(UText* text
+         ASSERT(newContext == UTextProviderContext::PriorContext);
+         textLatin1ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
+     }
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextLatin1ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
+--- a/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
++++ b/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
+@@ -125,7 +125,7 @@ static inline int64_t uTextUTF16ContextAwareNativeLeng
+ static UBool uTextUTF16ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
+ {
+     if (!text->context)
+-        return FALSE;
++        return false;
+     int64_t nativeLength = uTextUTF16ContextAwareNativeLength(text);
+     UBool isAccessible;
+     if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
+@@ -145,7 +145,7 @@ static UBool uTextUTF16ContextAwareAccess(UText* text,
+         ASSERT(newContext == UTextProviderContext::PriorContext);
+         textUTF16ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
+     }
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextUTF16ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebkit.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebkit.patch
new file mode 100644
index 000000000000..b94a4b76cbab
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/qtwebkit.patch
@@ -0,0 +1,12 @@
+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.14/srcs.nix b/nixpkgs/pkgs/development/libraries/qt-5/5.14/srcs.nix
new file mode 100644
index 000000000000..6ac958442f49
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/srcs.nix
@@ -0,0 +1,342 @@
+# DO NOT EDIT! This file is generated automatically.
+# Command: ./maintainers/scripts/fetch-kde-qt.sh pkgs/development/libraries/qt-5/5.14
+{ fetchurl, mirror }:
+
+{
+  qt3d = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qt3d-everywhere-src-5.14.2.tar.xz";
+      sha256 = "9da82f1cc4b7d416d31ec96224c59d221473a48f6e579eef978f7d2e3932c674";
+      name = "qt3d-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtactiveqt = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtactiveqt-everywhere-src-5.14.2.tar.xz";
+      sha256 = "b53517d5d128719773a2941ba52da10acd7aa3149948862bc08c98f5b64152a9";
+      name = "qtactiveqt-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtandroidextras = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtandroidextras-everywhere-src-5.14.2.tar.xz";
+      sha256 = "4a8fd92b5c49a663cf0bd492804eaf1574d11137e2cbdd41d6bf5fad0c3c4d76";
+      name = "qtandroidextras-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtbase = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtbase-everywhere-src-5.14.2.tar.xz";
+      sha256 = "48b9e79220941665a9dd827548c6428f7aa3052ccba8f4f7e039a94aa1d2b28a";
+      name = "qtbase-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtcharts = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtcharts-everywhere-src-5.14.2.tar.xz";
+      sha256 = "adb25203ea748d886cc3d8993c20def702115eccea311594592058134ba83bb7";
+      name = "qtcharts-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtconnectivity = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtconnectivity-everywhere-src-5.14.2.tar.xz";
+      sha256 = "abe67b3e3a775e2a2e27c62a5391f37007ffbe72bce58b96116995616cfcbc28";
+      name = "qtconnectivity-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtdatavis3d = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtdatavis3d-everywhere-src-5.14.2.tar.xz";
+      sha256 = "723c03db2d2805b1be4ca534ac7bc867a1a21894d33a7e9261a382f3fa9d0e20";
+      name = "qtdatavis3d-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtdeclarative = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtdeclarative-everywhere-src-5.14.2.tar.xz";
+      sha256 = "a3c4617adc9760347c93d2eb6c25d22f620cd22f44afa0494eb499a805831650";
+      name = "qtdeclarative-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtdoc = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtdoc-everywhere-src-5.14.2.tar.xz";
+      sha256 = "5a55cdb55af35eb222d06179567851c175f24a3732f7dee5be073df4a893172b";
+      name = "qtdoc-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtgamepad = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtgamepad-everywhere-src-5.14.2.tar.xz";
+      sha256 = "f77daadb4755cf760e11812264259fb103396fd1b06df1e06b5df162081c8d03";
+      name = "qtgamepad-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtgraphicaleffects = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtgraphicaleffects-everywhere-src-5.14.2.tar.xz";
+      sha256 = "487a7f858244a08264363733055a8cf8b00e77c658c5608cc462817d15e4b50f";
+      name = "qtgraphicaleffects-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtimageformats = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtimageformats-everywhere-src-5.14.2.tar.xz";
+      sha256 = "733eca0165c15e046b106039c989dac7f6bc2ecf215396d965ed065369264f8c";
+      name = "qtimageformats-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtlocation = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtlocation-everywhere-src-5.14.2.tar.xz";
+      sha256 = "c37708bc396f6dac397b49a6a268d5edb39e1c8296ca2337ce9e80bde04775cc";
+      name = "qtlocation-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtlottie = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtlottie-everywhere-src-5.14.2.tar.xz";
+      sha256 = "55d1392dc92cbec11263084360075dc5fc3fdc25c1969adfbdec84299b285978";
+      name = "qtlottie-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtmacextras = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtmacextras-everywhere-src-5.14.2.tar.xz";
+      sha256 = "d12587b46c84a7822194fc3ccf46f7c18ff3b31566d3dde4f5fe772f1d8776e5";
+      name = "qtmacextras-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtmultimedia = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtmultimedia-everywhere-src-5.14.2.tar.xz";
+      sha256 = "7acd8ede6835314206e407b35b668f0add67544577fb51fe67afb03137fb9fe9";
+      name = "qtmultimedia-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtnetworkauth = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtnetworkauth-everywhere-src-5.14.2.tar.xz";
+      sha256 = "4f00513dd18598487d02187b80b54c669662cf8a8f2573858c7f9282d7b9265e";
+      name = "qtnetworkauth-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtpurchasing = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtpurchasing-everywhere-src-5.14.2.tar.xz";
+      sha256 = "69b087001e8fcec5bb49ca333d5f44e6b7eb09f76421dc792fc9cd76dee9e851";
+      name = "qtpurchasing-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtquick3d = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtquick3d-everywhere-src-5.14.2.tar.xz";
+      sha256 = "0640696d501f2b0bf57f64e98f30bfa3e1cc19c11c0e05e43d4fdb0d20488b2e";
+      name = "qtquick3d-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtquickcontrols = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtquickcontrols-everywhere-src-5.14.2.tar.xz";
+      sha256 = "d55def1dd4ee1250bd6a4e76849f4e362368b6411c2216d5f669c761216d4461";
+      name = "qtquickcontrols-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtquickcontrols2 = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtquickcontrols2-everywhere-src-5.14.2.tar.xz";
+      sha256 = "faf7d349d8f4a8db36cd3c62a5724bcf689300f2fdb7dc1ea034392aab981560";
+      name = "qtquickcontrols2-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtquicktimeline = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtquicktimeline-everywhere-src-5.14.2.tar.xz";
+      sha256 = "83a45d0998cbc77f8094854a477ab1ac0838ae7fd822563d995df40149893a9e";
+      name = "qtquicktimeline-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtremoteobjects = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtremoteobjects-everywhere-src-5.14.2.tar.xz";
+      sha256 = "a6a601c4f4aab6fe41a462dae57033819f697e3317240a382cee45c08be614d6";
+      name = "qtremoteobjects-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtscript = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtscript-everywhere-src-5.14.2.tar.xz";
+      sha256 = "e9fd487ccb3cbf00e86b0b803aa79e9f6bbe7a337b8e97d069e040c3e0789bfe";
+      name = "qtscript-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtscxml = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtscxml-everywhere-src-5.14.2.tar.xz";
+      sha256 = "030cea352a56074f577200f967ef37c959b2767127de61f766f59b0d99763790";
+      name = "qtscxml-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtsensors = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtsensors-everywhere-src-5.14.2.tar.xz";
+      sha256 = "bccfca6910b0383d8f65823496ff5011abed2fa8fd446b4b27333d0fd7bb8c61";
+      name = "qtsensors-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtserialbus = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtserialbus-everywhere-src-5.14.2.tar.xz";
+      sha256 = "0b7762175a649a40c4dd619c5de61d772235dc86099343278e2c3229d0836a91";
+      name = "qtserialbus-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtserialport = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtserialport-everywhere-src-5.14.2.tar.xz";
+      sha256 = "a6d977dd723ad4d3368b5163691405b8852f809974a96ec54103494e834aea21";
+      name = "qtserialport-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtspeech = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtspeech-everywhere-src-5.14.2.tar.xz";
+      sha256 = "5e9e8ea62f0207ba894df1e136df0af9fc5443c7817d28c39f0ea2bbae9ec6da";
+      name = "qtspeech-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtsvg = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtsvg-everywhere-src-5.14.2.tar.xz";
+      sha256 = "c7d7faa01a3e7a6e4d38fafcec5529a488258218749779e6fa0e09a21173b5a1";
+      name = "qtsvg-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qttools = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qttools-everywhere-src-5.14.2.tar.xz";
+      sha256 = "5bb0cf7832b88eb6bc9d4289f98307eb14b16a453ad6cf42cca13c4fe1a053c5";
+      name = "qttools-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qttranslations = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qttranslations-everywhere-src-5.14.2.tar.xz";
+      sha256 = "2088ebee9f5dd0336c9fd11436899a95b7ce0141ce072290de1e8f315d82d1a6";
+      name = "qttranslations-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtvirtualkeyboard = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtvirtualkeyboard-everywhere-src-5.14.2.tar.xz";
+      sha256 = "364f3338563e617e7c964a37170b415b546c5f82965e781271f9dada3e3868d7";
+      name = "qtvirtualkeyboard-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtwayland = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtwayland-everywhere-src-5.14.2.tar.xz";
+      sha256 = "d31633ca718fb407cf70870613d45d0ed80aa04c058586ac3036bae1aff7832a";
+      name = "qtwayland-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtwebchannel = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtwebchannel-everywhere-src-5.14.2.tar.xz";
+      sha256 = "7d1dc8441523638c3d455c7d408ec65aebc073acab80e24063865f929231f874";
+      name = "qtwebchannel-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtwebengine = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtwebengine-everywhere-src-5.14.2.tar.xz";
+      sha256 = "e169d6a75d8c397e04f843bc1b9585950fb9a001255cd18d6293f66fa8a6c947";
+      name = "qtwebengine-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtwebglplugin = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtwebglplugin-everywhere-src-5.14.2.tar.xz";
+      sha256 = "eb4118910b65d03d8448658ac1646e860d337e59b82d6575beda21824e313417";
+      name = "qtwebglplugin-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtwebsockets = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtwebsockets-everywhere-src-5.14.2.tar.xz";
+      sha256 = "f06e62b18313fe1b40a35566e79645de4a8e7ac9f7717d1d98a06c5b49afca84";
+      name = "qtwebsockets-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtwebview = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtwebview-everywhere-src-5.14.2.tar.xz";
+      sha256 = "c61f9213ee84fd7408898c0194468208ffb51af9d257e87e6b53daf24f65ff4b";
+      name = "qtwebview-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtwinextras = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtwinextras-everywhere-src-5.14.2.tar.xz";
+      sha256 = "980f1bc31b37c8597c0bac55f69ecf00d1677218ce82f7bc3933236cb6d907f2";
+      name = "qtwinextras-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtx11extras = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtx11extras-everywhere-src-5.14.2.tar.xz";
+      sha256 = "be9a84a03a2ee81771215264e5dff7a996d04be6192b8cdaa1d41e319a81545a";
+      name = "qtx11extras-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+  qtxmlpatterns = {
+    version = "5.14.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.14/5.14.2/submodules/qtxmlpatterns-everywhere-src-5.14.2.tar.xz";
+      sha256 = "219a876665345e3801baff71f31f30f5495c1cb9ab23fbbd27602632c80fcfb7";
+      name = "qtxmlpatterns-everywhere-src-5.14.2.tar.xz";
+    };
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix b/nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix
new file mode 100644
index 000000000000..3b8540ca68fe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix
@@ -0,0 +1,261 @@
+/*
+
+# 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`.
+3. Check that the new packages build correctly.
+4. Commit the changes and open a pull request.
+
+*/
+
+{ newScope
+, lib, stdenv, fetchurl, fetchgit, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper
+, bison, cups ? null, harfbuzz, libGL, perl
+, gstreamer, gst-plugins-base, gtk3, dconf
+, llvmPackages_5, darwin
+
+  # options
+, developerBuild ? false
+, decryptSslTraffic ? false
+, debug ? false
+}:
+
+let
+
+  qtCompatVersion = srcs.qtbase.version;
+
+  stdenvActual = if stdenv.cc.isClang then llvmPackages_5.stdenv else stdenv;
+
+  mirror = "https://download.qt.io";
+  srcs = import ./srcs.nix { inherit fetchurl; inherit mirror; } // {
+    # qtwebkit does not have an official release tarball on the qt mirror and is
+    # mostly maintained by the community.
+    qtwebkit = rec {
+      src = fetchFromGitHub {
+        owner = "qt";
+        repo = "qtwebkit";
+        rev = "v${version}";
+        sha256 = "0x8rng96h19xirn7qkz3lydal6v4vn00bcl0s3brz36dfs0z8wpg";
+      };
+      version = "5.212.0-alpha4";
+    };
+
+    qtwebengine =
+      let
+        branchName = "5.15.5";
+        rev = "v${branchName}-lts";
+      in
+      {
+        version = "${branchName}-${lib.substring 0 7 rev}";
+
+        src = fetchgit {
+          url = "https://github.com/qt/qtwebengine.git";
+          sha256 = "12wf30d34sgn82mbz91xybxyn3j1mhvxda452cfkxm232n1f2kjb";
+          inherit rev branchName;
+          fetchSubmodules = true;
+          leaveDotGit = true;
+          name = "qtwebengine-${lib.substring 0 7 rev}.tar.gz";
+          postFetch = ''
+            # remove submodule .git directory
+            rm -rf $out/src/3rdparty/.git
+
+            # compress to not exceed the 2GB output limit
+            mv $out source
+            # try to make a deterministic tarball
+            tar -I 'gzip -n' \
+              --sort name \
+              --mtime 1970-01-01 \
+              --owner=root --group=root \
+              --numeric-owner --mode=go=rX,u+rw,a-s \
+              -cf $out source
+          '';
+        };
+      };
+  };
+
+  patches = {
+    qtbase = lib.optionals stdenv.isDarwin [
+      ./qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
+
+      # Downgrade minimal required SDK to 10.12
+      ./qtbase.patch.d/0013-define-kiosurfacesuccess.patch
+      ./qtbase.patch.d/macos-sdk-10.12/0001-Revert-QCocoaDrag-set-image-only-on-the-first-drag-i.patch
+      ./qtbase.patch.d/macos-sdk-10.12/0002-Revert-QCocoaDrag-drag-make-sure-clipboard-is-ours-a.patch
+      ./qtbase.patch.d/macos-sdk-10.12/0003-Revert-QCocoaDrag-maybeDragMultipleItems-fix-erroneo.patch
+      ./qtbase.patch.d/macos-sdk-10.12/0004-Revert-QCocoaDrag-avoid-using-the-deprecated-API-if-.patch
+      ./qtbase.patch.d/macos-sdk-10.12/0005-Revert-macOS-Fix-use-of-deprecated-NSOffState.patch
+      ./qtbase.patch.d/macos-sdk-10.12/0006-git-checkout-v5.15.0-src-plugins-platforms-cocoa-qco.patch
+      ./qtbase.patch.d/qtbase-sdk-10.12-mac.patch
+
+      # Patch framework detection to support X.framework/X.tbd,
+      # extending the current support for X.framework/X.
+      ./qtbase.patch.d/0012-qtbase-tbd-frameworks.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-tzdir.patch
+      ./qtbase.patch.d/0009-qtbase-qtpluginpath.patch
+      ./qtbase.patch.d/0010-qtbase-assert.patch
+      ./qtbase.patch.d/0011-fix-header_module.patch
+      (fetchpatch { # This can be removed when https://codereview.qt-project.org/c/qt/qtbase/+/339323 is included in an release.
+        name = "0014-gcc11-compat.patch";
+        url = "https://codereview.qt-project.org/gitweb?p=qt/qtbase.git;a=patch;h=049e14870c13235cd066758f29c42dc96c1ccdf8";
+        sha256 = "1cb2hwi859hds0fa2cbap014qaa7mah9p0rcxcm2cvj2ybl33qfc";
+      })
+    ];
+    qtdeclarative = [ ./qtdeclarative.patch ];
+    qtscript = [ ./qtscript.patch ];
+    qtserialport = [ ./qtserialport.patch ];
+    qtwebengine = [
+      # Fix invisible fonts with glibc 2.33: https://github.com/NixOS/nixpkgs/issues/131074
+      (fetchpatch {
+        url = "https://src.fedoraproject.org/rpms/qt5-qtwebengine/raw/d122c011631137b79455850c363676c655cf9e09/f/qtwebengine-everywhere-src-5.15.5-%231904652.patch";
+        name = "qtwebengine-everywhere-src-5.15.5-_1904652.patch";
+        sha256 = "01q7hagq0ysii1jnrh5adm97vdm9cis592xr6im7accyw6hgcn7b";
+      })
+    ] ++ lib.optionals stdenv.isDarwin [
+      ./qtwebengine-darwin-no-platform-check.patch
+      ./qtwebengine-mac-dont-set-dsymutil-path.patch
+    ];
+    qtwebkit = [
+      (fetchpatch {
+        name = "qtwebkit-bison-3.7-build.patch";
+        url = "https://github.com/qtwebkit/qtwebkit/commit/d92b11fea65364fefa700249bd3340e0cd4c5b31.patch";
+        sha256 = "0h8ymfnwgkjkwaankr3iifiscsvngqpwb91yygndx344qdiw9y0n";
+      })
+      (fetchpatch {
+        name = "qtwebkit-glib-2.68.patch";
+        url = "https://github.com/qtwebkit/qtwebkit/pull/1058/commits/5b698ba3faffd4e198a45be9fe74f53307395e4b.patch";
+        sha256 = "0a3xv0h4lv8wggckgy8cg8xnpkg7n9h45312pdjdnnwy87xvzss0";
+      })
+      ./qtwebkit.patch
+      ./qtwebkit-icu68.patch
+    ] ++ lib.optionals stdenv.isDarwin [
+      ./qtwebkit-darwin-no-readline.patch
+      ./qtwebkit-darwin-no-qos-classes.patch
+    ];
+    qttools = [ ./qttools.patch ];
+  };
+
+  qtModule =
+    import ../qtModule.nix
+    {
+      inherit perl;
+      inherit lib;
+      # Use a variant of mkDerivation that does not include wrapQtApplications
+      # to avoid cyclic dependencies between Qt modules.
+      mkDerivation =
+        import ../mkDerivation.nix
+        { inherit lib; inherit debug; wrapQtAppsHook = null; }
+        stdenvActual.mkDerivation;
+    }
+    { inherit self srcs patches; };
+
+  addPackages = self: with self;
+    let
+      callPackage = self.newScope { inherit qtCompatVersion qtModule srcs; };
+    in {
+
+      inherit callPackage qtCompatVersion qtModule srcs;
+
+      mkDerivationWith =
+        import ../mkDerivation.nix
+        { inherit lib; inherit debug; inherit (self) wrapQtAppsHook; };
+
+      mkDerivation = mkDerivationWith stdenvActual.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;
+        inherit (darwin.apple_sdk.frameworks) AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth
+          CoreLocation CoreServices DiskArbitration Foundation OpenGL MetalKit IOKit;
+        inherit (darwin) libobjc;
+      };
+
+      qt3d = callPackage ../modules/qt3d.nix {};
+      qtcharts = callPackage ../modules/qtcharts.nix {};
+      qtconnectivity = callPackage ../modules/qtconnectivity.nix {};
+      qtdeclarative = callPackage ../modules/qtdeclarative.nix {};
+      qtdoc = callPackage ../modules/qtdoc.nix {};
+      qtgamepad = callPackage ../modules/qtgamepad.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 {};
+      qtserialbus = callPackage ../modules/qtserialbus.nix {};
+      qtserialport = callPackage ../modules/qtserialport.nix {};
+      qtspeech = callPackage ../modules/qtspeech.nix {};
+      qtsvg = callPackage ../modules/qtsvg.nix {};
+      qtscxml = callPackage ../modules/qtscxml.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 {
+        inherit (srcs.qtwebengine) version;
+        inherit (darwin) cctools libobjc libunwind xnu;
+        inherit (darwin.apple_sdk.libs) sandbox;
+        inherit (darwin.apple_sdk.frameworks) ApplicationServices AVFoundation Foundation ForceFeedback GameController AppKit
+          ImageCaptureCore CoreBluetooth IOBluetooth CoreWLAN Quartz Cocoa LocalAuthentication;
+      };
+      qtwebglplugin = callPackage ../modules/qtwebglplugin.nix {};
+      qtwebkit = callPackage ../modules/qtwebkit.nix {
+        inherit (darwin) ICU;
+        inherit (darwin.apple_sdk.frameworks) OpenGL;
+      };
+      qtwebsockets = callPackage ../modules/qtwebsockets.nix {};
+      qtwebview = callPackage ../modules/qtwebview.nix {
+        inherit (darwin.apple_sdk.frameworks) CoreFoundation WebKit;
+      };
+      qtx11extras = callPackage ../modules/qtx11extras.nix {};
+      qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {};
+
+      env = callPackage ../qt-env.nix {};
+      full = env "qt-full-${qtbase.version}" ([
+        qt3d qtcharts qtconnectivity qtdeclarative qtdoc qtgraphicaleffects
+        qtimageformats qtlocation qtmultimedia qtquickcontrols qtquickcontrols2
+        qtscript qtsensors qtserialport qtsvg qttools qttranslations
+        qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets
+        qtwebview qtx11extras qtxmlpatterns
+      ] ++ lib.optional (!stdenv.isDarwin) qtwayland
+        ++ lib.optional (stdenv.isDarwin) qtmacextras);
+
+      qmake = makeSetupHook {
+        deps = [ self.qtbase.dev ];
+        substitutions = {
+          inherit debug;
+          fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
+        };
+      } ../hooks/qmake-hook.sh;
+
+      wrapQtAppsHook = makeSetupHook {
+        deps = [ self.qtbase.dev makeWrapper ]
+          ++ lib.optional stdenv.isLinux self.qtwayland.dev;
+      } ../hooks/wrap-qt-apps-hook.sh;
+    };
+
+   self = lib.makeScope newScope addPackages;
+
+in self
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/fetch.sh b/nixpkgs/pkgs/development/libraries/qt-5/5.15/fetch.sh
new file mode 100644
index 000000000000..81ceb3ef77ea
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/fetch.sh
@@ -0,0 +1,2 @@
+WGET_ARGS=( http://download.qt.io/official_releases/qt/5.15/5.15.2/submodules/ \
+            -A '*.tar.xz' )
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
new file mode 100644
index 000000000000..3a2900abdd6b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0001-qtbase-mkspecs-mac.patch
@@ -0,0 +1,409 @@
+From 5ec1d1009d9943f20e82ffc087deabb31d447e75 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Milan=20P=C3=A4ssler?= <me@pbb.lc>
+Date: Fri, 3 Apr 2020 21:07:58 +0200
+Subject: [PATCH 01/11] qtbase-mkspecs-mac
+
+---
+ mkspecs/common/mac.conf               |   2 +-
+ mkspecs/features/mac/default_post.prf | 206 --------------------------
+ mkspecs/features/mac/default_pre.prf  |  58 --------
+ mkspecs/features/mac/sdk.mk           |  25 ----
+ mkspecs/features/mac/sdk.prf          |  61 --------
+ 5 files changed, 1 insertion(+), 351 deletions(-)
+ delete mode 100644 mkspecs/features/mac/sdk.mk
+ delete mode 100644 mkspecs/features/mac/sdk.prf
+
+diff --git a/mkspecs/common/mac.conf b/mkspecs/common/mac.conf
+index 61bea952b2..9909dae726 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/mac/default_post.prf b/mkspecs/features/mac/default_post.prf
+index 92a9112bca..b80ec1e801 100644
+--- a/mkspecs/features/mac/default_post.prf
++++ b/mkspecs/features/mac/default_post.prf
+@@ -68,212 +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 {
+-    uikit: QMAKE_RPATHDIR += @executable_path/Frameworks
+-    else: 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} \
+-                -isysroot$$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
+-            sysroot_path  = $$xcodeSDKInfo(Path, $$simulator.sdk)
+-        } else {
+-            version_identifier = $$device.deployment_identifier
+-            sysroot_path  = $$xcodeSDKInfo(Path, $$device.sdk)
+-        }
+-        version_min_flag = -m$${version_identifier}-version-min=$$deployment_target
+-        QMAKE_CFLAGS += -isysroot $$sysroot_path $$version_min_flag
+-        QMAKE_CXXFLAGS += -isysroot $$sysroot_path $$version_min_flag
+-        QMAKE_LFLAGS += -isysroot $$sysroot_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
+--- 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
+deleted file mode 100644
+index 3a9c2778bb..0000000000
+--- a/mkspecs/features/mac/sdk.prf
++++ /dev/null
+@@ -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.25.4
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0003-qtbase-mkspecs.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0003-qtbase-mkspecs.patch
new file mode 100644
index 000000000000..1c9012c0f2e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0003-qtbase-mkspecs.patch
@@ -0,0 +1,490 @@
+From 03a5a7eab673d18d00c9b5eb8c7d5b790079e8ff Mon Sep 17 00:00:00 2001
+From: OPNA2608 <christoph.neidahl@gmail.com>
+Date: Mon, 12 Apr 2021 20:20:46 +0200
+Subject: [PATCH 03/11] qtbase-mkspecs
+
+---
+ mkspecs/features/create_cmake.prf             | 51 +++---------
+ .../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             | 27 ++++---
+ mkspecs/features/qt_installs.prf              | 22 ++---
+ mkspecs/features/qt_plugin.prf                |  2 +-
+ 11 files changed, 52 insertions(+), 152 deletions(-)
+
+diff --git a/mkspecs/features/create_cmake.prf b/mkspecs/features/create_cmake.prf
+index 24ed125f12..f0666a1986 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
+@@ -77,45 +77,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
+-}
++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
+ 
+@@ -258,7 +233,7 @@ contains(CONFIG, plugin) {
+ 
+     cmake_qt5_plugin_file.files = $$cmake_target_file.output
+     static|staticlib: cmake_qt5_plugin_file.files += $$cmake_qt5_plugin_import_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()
+@@ -400,7 +375,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 db18dbece6..8246f37931 100644
+--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
++++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+@@ -2,30 +2,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)")
+@@ -145,11 +121,7 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI
+       IsDebugAndRelease)
+     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(_deps
+         ${_Qt5$${CMAKE_MODULE_NAME}_LIB_DEPENDENCIES}
+@@ -209,11 +181,7 @@ macro(_populate_$${CMAKE_MODULE_NAME}_target_properties Configuration LIB_LOCATI
+ !!ENDIF
+ 
+ !!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
+@@ -229,24 +197,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 \"\")
+@@ -262,7 +219,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
+@@ -491,25 +447,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}\" \"\" $${CMAKE_DEBUG_AND_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_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}\" $${CMAKE_DEBUG_AND_RELEASE})
+ !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
+     endif()
+@@ -528,25 +472,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}\" \"\" $${CMAKE_DEBUG_AND_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}\" $${CMAKE_DEBUG_AND_RELEASE})
+ !!ENDIF // CMAKE_STATIC_WINDOWS_BUILD
+     endif()
+@@ -573,11 +505,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+           IsDebugAndRelease)
+         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 3d6cd9b3db..ca8b0b2701 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
+ 
+ qmlfiles.base = $$_PRO_FILE_PWD_
+ qmlfiles.files = $$fq_aux_qml_files
+diff --git a/mkspecs/features/qml_plugin.prf b/mkspecs/features/qml_plugin.prf
+index 1b67435787..24a1f78c17 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 095bf15dac..4cc977bea5 100644
+--- a/mkspecs/features/qt_docs.prf
++++ b/mkspecs/features/qt_docs.prf
+@@ -65,7 +65,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) {
+@@ -84,8 +84,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
+@@ -108,12 +108,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 15b373ba40..5c373fe1d5 100644
+--- a/mkspecs/features/qt_example_installs.prf
++++ b/mkspecs/features/qt_example_installs.prf
+@@ -91,7 +91,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 7777e615bd..b0c6880a74 100644
+--- a/mkspecs/features/qt_functions.prf
++++ b/mkspecs/features/qt_functions.prf
+@@ -87,19 +87,22 @@ defineTest(qtHaveModule) {
+ defineTest(qtPrepareTool) {
+     cmd = $$eval(QT_TOOL.$${2}.binary)
+     isEmpty(cmd) {
+-        cmd = $$[QT_HOST_BINS]/$$2
+-        exists($${cmd}.pl) {
+-            $${1}_EXE = $${cmd}.pl
+-            cmd = perl -w $$system_path($${cmd}.pl)
+-        } else: contains(QMAKE_HOST.os, Windows) {
+-            $${1}_EXE = $${cmd}.exe
+-            cmd = $$system_path($${cmd}.exe)
+-        } else:contains(QMAKE_HOST.os, Darwin) {
+-            BUNDLENAME = $${cmd}.app/Contents/MacOS/$$2
+-            exists($$BUNDLENAME) {
+-                cmd = $$BUNDLENAME
++        cmd = $$system("command -v $${2}")
++        isEmpty(cmd) {
++            cmd = $$system("command -v $${2}.pl")
++            !isEmpty(cmd) {
++                $${1}_EXE = $$cmd
++                cmd = perl -w $$system_path($${cmd})
++            } else: contains(QMAKE_HOST.os, Windows) {
++                cmd = $$system("command -v $${2}.exe")
++                $${1}_EXE = $$cmd
++            } else: contains(QMAKE_HOST.os, Darwin) {
++                cmd = $$system("command -v $${2}.app")
++                !isEmpty(cmd) {
++                    cmd = $${cmd}/Contents/MacOS/$${2}
++                    $${1}_EXE = $$cmd
++                }
+             }
+-            $${1}_EXE = $$cmd
+         } else {
+             $${1}_EXE = $$cmd
+         }
+diff --git a/mkspecs/features/qt_installs.prf b/mkspecs/features/qt_installs.prf
+index 1ebca17366..a8f958eae8 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 573d717eea..024c624cb6 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
+ 
+ qt_libinfix_plugins: TARGET = $$TARGET$$QT_LIBINFIX
+-- 
+2.29.3
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0004-qtbase-replace-libdir.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0004-qtbase-replace-libdir.patch
new file mode 100644
index 000000000000..bbfc93897873
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0004-qtbase-replace-libdir.patch
@@ -0,0 +1,68 @@
+From 30d3906ff5e8671e9c97c5336c6c549656c0e293 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Milan=20P=C3=A4ssler?= <me@pbb.lc>
+Date: Sat, 4 Apr 2020 00:27:41 +0200
+Subject: [PATCH 04/11] 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 8df94aa4ee..414029f31c 100644
+--- a/mkspecs/features/qt_common.prf
++++ b/mkspecs/features/qt_common.prf
+@@ -31,32 +31,16 @@ contains(TEMPLATE, .*lib)|contains(TEMPLATE, aux) {
+         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
+-    }
+ }
+ contains(TEMPLATE, .*lib)|darwin {
+     if(!host_build|!cross_compile):qtConfig(reduce_exports): CONFIG += hide_symbols
+diff --git a/mkspecs/features/qt_module.prf b/mkspecs/features/qt_module.prf
+index 828a9621b9..b9e5d35026 100644
+--- a/mkspecs/features/qt_module.prf
++++ b/mkspecs/features/qt_module.prf
+@@ -305,10 +305,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.25.4
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0005-qtbase-cmake.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0005-qtbase-cmake.patch
new file mode 100644
index 000000000000..19646df1666f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0005-qtbase-cmake.patch
@@ -0,0 +1,194 @@
+From 7871fbcefc7596a458cec005edafd9d4962baea3 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/11] 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 b6c3ab8609..edb6a89316 100644
+--- a/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
++++ b/mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+@@ -513,7 +513,7 @@ if (NOT TARGET Qt5::$${CMAKE_MODULE_NAME})
+           IsDebugAndRelease)
+         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 b550a52c60..dbd3243885 100644
+--- a/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
++++ b/mkspecs/features/data/cmake/Qt5PluginTarget.cmake.in
+@@ -53,10 +53,10 @@ set_property(TARGET Qt5::$$CMAKE_PLUGIN_NAME PROPERTY INTERFACE_SOURCES
+ !!ENDIF
+ 
+ !!IF !isEmpty(CMAKE_RELEASE_TYPE)
+-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE})
++_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME RELEASE \"$${CMAKE_PLUGIN_DIR}$${CMAKE_PLUGIN_LOCATION_RELEASE}\" $${CMAKE_DEBUG_AND_RELEASE})
+ !!ENDIF
+ !!IF !isEmpty(CMAKE_DEBUG_TYPE)
+-_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE})
++_populate_$${CMAKE_MODULE_NAME}_plugin_properties($$CMAKE_PLUGIN_NAME DEBUG \"$${CMAKE_PLUGIN_DIR}$${CMAKE_PLUGIN_LOCATION_DEBUG}\" $${CMAKE_DEBUG_AND_RELEASE})
+ !!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 4c1c3a612b..bb8ab08143 100644
+--- a/src/corelib/Qt5CoreConfigExtras.cmake.in
++++ b/src/corelib/Qt5CoreConfigExtras.cmake.in
+@@ -6,7 +6,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
+@@ -21,7 +21,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
+@@ -38,7 +38,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
+@@ -121,7 +121,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
+@@ -135,7 +135,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 a814678f7b..b13b964ec8 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 83d8004a08..ca0b8e4bfb 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.25.4
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0006-qtbase-gtk3.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0006-qtbase-gtk3.patch
new file mode 100644
index 000000000000..48f4c9b3f99e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0006-qtbase-gtk3.patch
@@ -0,0 +1,48 @@
+From 7a9f4f875053aed8ab387161eea623bf8325cfa8 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/11] 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 860fc3a26e..8cd4663d49 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 nullptr;
+ }
+-- 
+2.25.4
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0007-qtbase-xcursor.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0007-qtbase-xcursor.patch
new file mode 100644
index 000000000000..617b0684df65
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0007-qtbase-xcursor.patch
@@ -0,0 +1,29 @@
+From 707098eada20ba074e642a73248de74407bc261c 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/11] 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 42c7a52bd4..ba670ddb44 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.25.4
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0008-qtbase-tzdir.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0008-qtbase-tzdir.patch
new file mode 100644
index 000000000000..319de315bfb7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0008-qtbase-tzdir.patch
@@ -0,0 +1,64 @@
+From da003b582ee8823b29b1ff5c0aca8e06e7741b94 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Tue, 17 Sep 2019 05:36:25 -0500
+Subject: [PATCH 08/11] qtbase-tzdir
+
+---
+ src/corelib/time/qtimezoneprivate_tz.cpp | 31 +++++++++++++++---------
+ 1 file changed, 19 insertions(+), 12 deletions(-)
+
+diff --git a/src/corelib/time/qtimezoneprivate_tz.cpp b/src/corelib/time/qtimezoneprivate_tz.cpp
+index 01f9a6cce0..910338205a 100644
+--- a/src/corelib/time/qtimezoneprivate_tz.cpp
++++ b/src/corelib/time/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");
+ 
+@@ -672,20 +676,23 @@ QTzTimeZoneCacheEntry QTzTimeZoneCache::findEntry(const QByteArray &ianaId)
+         if (!tzif.open(QIODevice::ReadOnly))
+             return ret;
+     } 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));
++            tzif.setFileName(QLatin1String("/usr/share/zoneinfo/") + QString::fromLocal8Bit(ianaId));
+             if (!tzif.open(QIODevice::ReadOnly)) {
+-                // ianaId may be a POSIX rule, taken from $TZ or /etc/TZ
+-                const QByteArray zoneInfo = ianaId.split(',').at(0);
+-                const char *begin = zoneInfo.constBegin();
+-                if (PosixZone::parse(begin, zoneInfo.constEnd()).hasValidOffset()
+-                    && (begin == zoneInfo.constEnd()
+-                        || PosixZone::parse(begin, zoneInfo.constEnd()).hasValidOffset())) {
+-                    ret.m_posixRule = ianaId;
++                tzif.setFileName(QLatin1String("/usr/lib/zoneinfo/") + QString::fromLocal8Bit(ianaId));
++                if (!tzif.open(QIODevice::ReadOnly)) {
++                    // ianaId may be a POSIX rule, taken from $TZ or /etc/TZ
++                    const QByteArray zoneInfo = ianaId.split(',').at(0);
++                    const char *begin = zoneInfo.constBegin();
++                    if (PosixZone::parse(begin, zoneInfo.constEnd()).hasValidOffset()
++                        && (begin == zoneInfo.constEnd()
++                            || PosixZone::parse(begin, zoneInfo.constEnd()).hasValidOffset())) {
++                        ret.m_posixRule = ianaId;
++                    }
++                    return ret;
+                 }
+-                return ret;
+             }
+         }
+     }
+-- 
+2.25.4
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0009-qtbase-qtpluginpath.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0009-qtbase-qtpluginpath.patch
new file mode 100644
index 000000000000..28013ec10482
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0009-qtbase-qtpluginpath.patch
@@ -0,0 +1,33 @@
+From 9fc6efaf774a8716932c98c0b0ea6408ed2614c2 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Milan=20P=C3=A4ssler?= <me@pbb.lc>
+Date: Sun, 10 May 2020 12:47:28 +0200
+Subject: [PATCH 09/11] qtbase-qtpluginpath
+
+---
+ src/corelib/kernel/qcoreapplication.cpp | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/src/corelib/kernel/qcoreapplication.cpp b/src/corelib/kernel/qcoreapplication.cpp
+index 5fdcc9b914..1a126ef359 100644
+--- a/src/corelib/kernel/qcoreapplication.cpp
++++ b/src/corelib/kernel/qcoreapplication.cpp
+@@ -2691,6 +2691,16 @@ QStringList QCoreApplication::libraryPathsLocked()
+         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));
++            }
++        }
++
++
+         auto setPathsFromEnv = [&](QString libPathEnv) {
+             if (!libPathEnv.isEmpty()) {
+                 QStringList paths = libPathEnv.split(QDir::listSeparator(), Qt::SkipEmptyParts);
+-- 
+2.25.4
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0010-qtbase-assert.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0010-qtbase-assert.patch
new file mode 100644
index 000000000000..c5b099c4ca35
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0010-qtbase-assert.patch
@@ -0,0 +1,32 @@
+From 015845b3c320d02691f28373097d1e6dbbac79f7 Mon Sep 17 00:00:00 2001
+From: Thomas Tuegel <ttuegel@mailbox.org>
+Date: Tue, 17 Sep 2019 05:37:04 -0500
+Subject: [PATCH 10/11] 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.25.4
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0011-fix-header_module.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0011-fix-header_module.patch
new file mode 100644
index 000000000000..98738656114d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0011-fix-header_module.patch
@@ -0,0 +1,25 @@
+From 2bce8511877db1db532e1437e7140b1d55633f86 Mon Sep 17 00:00:00 2001
+From: Will Dietz <w@wdtz.org>
+Date: Mon, 30 Sep 2019 20:15:40 -0500
+Subject: [PATCH 11/11] 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 b9e5d35026..9924271042 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.25.4
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0012-qtbase-tbd-frameworks.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0012-qtbase-tbd-frameworks.patch
new file mode 100644
index 000000000000..8a5939978a6b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0012-qtbase-tbd-frameworks.patch
@@ -0,0 +1,15 @@
+diff --git a/src/gui/Qt5GuiConfigExtras.cmake.in b/src/gui/Qt5GuiConfigExtras.cmake.in
+index 84dbbfebd4..615bfed124 100644
+--- a/src/gui/Qt5GuiConfigExtras.cmake.in
++++ b/src/gui/Qt5GuiConfigExtras.cmake.in
+@@ -119,6 +119,10 @@ macro(_qt5gui_find_extra_libs Name Libs LibDir IncDirs)
+             if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
+                 set(Qt5Gui_${_cmake_lib_name}_LIBRARY)
+             endif()
++            set(Qt5Gui_${_cmake_lib_name}_LIBRARY "${Qt5Gui_${_cmake_lib_name}_LIBRARY}/${_lib}.tbd")
++            if (NOT EXISTS "${Qt5Gui_${_cmake_lib_name}_LIBRARY}")
++                set(Qt5Gui_${_cmake_lib_name}_LIBRARY)
++            endif()
+ !!ENDIF
+             if (NOT Qt5Gui_${_cmake_lib_name}_LIBRARY)
+                 # The above find_library call doesn\'t work for finding
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0013-define-kiosurfacesuccess.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/0013-define-kiosurfacesuccess.patch
new file mode 100644
index 000000000000..a43a46d8a69b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/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.15/qtbase.patch.d/macos-sdk-10.12/0001-Revert-QCocoaDrag-set-image-only-on-the-first-drag-i.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0001-Revert-QCocoaDrag-set-image-only-on-the-first-drag-i.patch
new file mode 100644
index 000000000000..de75ecbd0c17
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0001-Revert-QCocoaDrag-set-image-only-on-the-first-drag-i.patch
@@ -0,0 +1,47 @@
+From f156c35975e7844d2369ec5a6633ee40ec56f17a Mon Sep 17 00:00:00 2001
+From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
+Date: Mon, 7 Dec 2020 12:32:29 -0500
+Subject: [PATCH 1/6] Revert "QCocoaDrag - set image only on the first drag
+ item"
+
+This reverts commit 7ee9bfc158a290776f622f62d0202220c6d159bc.
+---
+ src/plugins/platforms/cocoa/qcocoadrag.mm | 9 ++-------
+ 1 file changed, 2 insertions(+), 7 deletions(-)
+
+diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
+index 4bd1b129bd..a506126c72 100644
+--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
++++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
+@@ -217,18 +217,13 @@ bool QCocoaDrag::maybeDragMultipleItems()
+     // 0. We start from URLs, which can be actually in a list (thus technically
+     // only ONE item in the pasteboard. The fact it's only one does not help, we are
+     // still getting an exception because of the number of items/images mismatch ...
+-    // We only set the image for the first item and nil for the rest, the image already
+-    // contains a combined picture for all urls we drag.
+-    auto imageOrNil = dragImage;
+     for (const auto &qtUrl : qtUrls) {
+         NSURL *nsUrl = qtUrl.toNSURL();
+         auto *newItem = [[[NSDraggingItem alloc] initWithPasteboardWriter:nsUrl] autorelease];
+         const NSRect itemFrame = NSMakeRect(itemLocation.x, itemLocation.y,
+                                             dragImage.size.width,
+                                             dragImage.size.height);
+-
+-        [newItem setDraggingFrame:itemFrame contents:imageOrNil];
+-        imageOrNil = nil;
++        [newItem setDraggingFrame:itemFrame contents:dragImage];
+         [dragItems addObject:newItem];
+     }
+     // 1. Repeat for non-url items, if any:
+@@ -237,7 +232,7 @@ bool QCocoaDrag::maybeDragMultipleItems()
+         const NSRect itemFrame = NSMakeRect(itemLocation.x, itemLocation.y,
+                                             dragImage.size.width,
+                                             dragImage.size.height);
+-        [newItem setDraggingFrame:itemFrame contents:imageOrNil];
++        [newItem setDraggingFrame:itemFrame contents:dragImage];
+         [dragItems addObject:newItem];
+     }
+ 
+-- 
+2.21.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0002-Revert-QCocoaDrag-drag-make-sure-clipboard-is-ours-a.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0002-Revert-QCocoaDrag-drag-make-sure-clipboard-is-ours-a.patch
new file mode 100644
index 000000000000..ee3a2d9f5a4d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0002-Revert-QCocoaDrag-drag-make-sure-clipboard-is-ours-a.patch
@@ -0,0 +1,40 @@
+From 9aaac67e3c3bf40ef3efc3b07b1655f72c8c54aa Mon Sep 17 00:00:00 2001
+From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
+Date: Mon, 7 Dec 2020 12:32:31 -0500
+Subject: [PATCH 2/6] Revert "QCocoaDrag::drag - make sure clipboard is ours
+ and populated"
+
+This reverts commit 720e2e0c92ca6635c5f05f318770a70cf653c1c7.
+---
+ src/plugins/platforms/cocoa/qcocoadrag.mm | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
+index a506126c72..c6ee4323ce 100644
+--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
++++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
+@@ -131,10 +131,6 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
+     m_drag = o;
+     m_executed_drop_action = Qt::IgnoreAction;
+ 
+-    QMacPasteboard dragBoard(CFStringRef(NSPasteboardNameDrag), QMacInternalPasteboardMime::MIME_DND);
+-    m_drag->mimeData()->setData(QLatin1String("application/x-qt-mime-type-name"), QByteArray("dummy"));
+-    dragBoard.setMimeData(m_drag->mimeData(), QMacPasteboard::LazyRequest);
+-
+     if (maybeDragMultipleItems())
+         return m_executed_drop_action;
+ 
+@@ -143,6 +139,10 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
+     NSImage *dragImage = [NSImage imageFromQImage:pm.toImage()];
+     Q_ASSERT(dragImage);
+ 
++    QMacPasteboard dragBoard(CFStringRef(NSPasteboardNameDrag), QMacInternalPasteboardMime::MIME_DND);
++    m_drag->mimeData()->setData(QLatin1String("application/x-qt-mime-type-name"), QByteArray("dummy"));
++    dragBoard.setMimeData(m_drag->mimeData(), QMacPasteboard::LazyRequest);
++
+     NSPoint event_location = [m_lastEvent locationInWindow];
+     NSWindow *theWindow = [m_lastEvent window];
+     Q_ASSERT(theWindow);
+-- 
+2.21.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0003-Revert-QCocoaDrag-maybeDragMultipleItems-fix-erroneo.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0003-Revert-QCocoaDrag-maybeDragMultipleItems-fix-erroneo.patch
new file mode 100644
index 000000000000..55211fca64c7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0003-Revert-QCocoaDrag-maybeDragMultipleItems-fix-erroneo.patch
@@ -0,0 +1,27 @@
+From d1626c55d10537274c6f365855342a1c619a4c3a Mon Sep 17 00:00:00 2001
+From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
+Date: Mon, 7 Dec 2020 12:32:32 -0500
+Subject: [PATCH 3/6] Revert "QCocoaDrag::maybeDragMultipleItems - fix
+ erroneous size check"
+
+This reverts commit b8a03411784803c07ecc1f769860756d6fdc04cd.
+---
+ src/plugins/platforms/cocoa/qcocoadrag.mm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
+index c6ee4323ce..ab6863a432 100644
+--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
++++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
+@@ -187,7 +187,7 @@ bool QCocoaDrag::maybeDragMultipleItems()
+     const auto &qtUrls = m_drag->mimeData()->urls();
+     NSPasteboard *dragBoard = [NSPasteboard pasteboardWithName:NSPasteboardNameDrag];
+ 
+-    if (qtUrls.size() <= 1) {
++    if (int(dragBoard.pasteboardItems.count) == 1 && qtUrls.size() <= 1) {
+         // Good old -dragImage: works perfectly for this ...
+         return false;
+     }
+-- 
+2.21.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0004-Revert-QCocoaDrag-avoid-using-the-deprecated-API-if-.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0004-Revert-QCocoaDrag-avoid-using-the-deprecated-API-if-.patch
new file mode 100644
index 000000000000..7b568a91943f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0004-Revert-QCocoaDrag-avoid-using-the-deprecated-API-if-.patch
@@ -0,0 +1,192 @@
+From d5c155a9f3ff38e28ac073f6df43175724ebc290 Mon Sep 17 00:00:00 2001
+From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
+Date: Mon, 7 Dec 2020 12:32:34 -0500
+Subject: [PATCH 4/6] Revert "QCocoaDrag - avoid using the deprecated API if
+ possible"
+
+This reverts commit 8481a9fc974a1f1dd44a9f82decb18fe2290689f.
+---
+ src/plugins/platforms/cocoa/qcocoadrag.h      |  6 --
+ src/plugins/platforms/cocoa/qcocoadrag.mm     | 90 -------------------
+ .../platforms/cocoa/qnsview_dragging.mm       |  9 +-
+ 3 files changed, 1 insertion(+), 104 deletions(-)
+
+diff --git a/src/plugins/platforms/cocoa/qcocoadrag.h b/src/plugins/platforms/cocoa/qcocoadrag.h
+index 975741c270..5a5b985c6e 100644
+--- a/src/plugins/platforms/cocoa/qcocoadrag.h
++++ b/src/plugins/platforms/cocoa/qcocoadrag.h
+@@ -48,8 +48,6 @@
+ #include <QtGui/private/qdnd_p.h>
+ #include <QtGui/private/qinternalmimedata_p.h>
+ 
+-#include <QtCore/qeventloop.h>
+-
+ QT_BEGIN_NAMESPACE
+ 
+ class QCocoaDrag : public QPlatformDrag
+@@ -71,15 +69,11 @@ public:
+     void setLastMouseEvent(NSEvent *event, NSView *view);
+ 
+     void setAcceptedAction(Qt::DropAction act);
+-    void exitDragLoop();
+ private:
+     QDrag *m_drag;
+     NSEvent *m_lastEvent;
+     NSView *m_lastView;
+     Qt::DropAction m_executed_drop_action;
+-    QEventLoop internalDragLoop;
+-
+-    bool maybeDragMultipleItems();
+ 
+     QPixmap dragPixmap(QDrag *drag, QPoint &hotSpot) const;
+ };
+diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
+index ab6863a432..b4a16ab912 100644
+--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
++++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
+@@ -44,9 +44,6 @@
+ #include <QtWidgets/qwidget.h>
+ #endif
+ #include <QtGui/private/qcoregraphics_p.h>
+-#include <QtCore/qsysinfo.h>
+-
+-#include <vector>
+ 
+ QT_BEGIN_NAMESPACE
+ 
+@@ -131,9 +128,6 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
+     m_drag = o;
+     m_executed_drop_action = Qt::IgnoreAction;
+ 
+-    if (maybeDragMultipleItems())
+-        return m_executed_drop_action;
+-
+     QPoint hotSpot = m_drag->hotSpot();
+     QPixmap pm = dragPixmap(m_drag, hotSpot);
+     NSImage *dragImage = [NSImage imageFromQImage:pm.toImage()];
+@@ -164,95 +158,11 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
+     return m_executed_drop_action;
+ }
+ 
+-bool QCocoaDrag::maybeDragMultipleItems()
+-{
+-    Q_ASSERT(m_drag && m_drag->mimeData());
+-    Q_ASSERT(m_executed_drop_action == Qt::IgnoreAction);
+-
+-    if (QOperatingSystemVersion::current() < QOperatingSystemVersion::MacOSMojave) {
+-        // -dragImage: stopped working in 10.14 first.
+-        return false;
+-    }
+-
+-    const QMacAutoReleasePool pool;
+-
+-    NSWindow *theWindow = [m_lastEvent window];
+-    Q_ASSERT(theWindow);
+-
+-    if (![theWindow.contentView respondsToSelector:@selector(draggingSession:sourceOperationMaskForDraggingContext:)])
+-        return false;
+-
+-    auto *sourceView = static_cast<NSView<NSDraggingSource>*>(theWindow.contentView);
+-
+-    const auto &qtUrls = m_drag->mimeData()->urls();
+-    NSPasteboard *dragBoard = [NSPasteboard pasteboardWithName:NSPasteboardNameDrag];
+-
+-    if (int(dragBoard.pasteboardItems.count) == 1 && qtUrls.size() <= 1) {
+-        // Good old -dragImage: works perfectly for this ...
+-        return false;
+-    }
+-
+-    std::vector<NSPasteboardItem *> nonUrls;
+-    for (NSPasteboardItem *item in dragBoard.pasteboardItems) {
+-        bool isUrl = false;
+-        for (NSPasteboardType type in item.types) {
+-            using NSStringRef = NSString *;
+-            if ([type isEqualToString:NSStringRef(kUTTypeFileURL)]) {
+-                isUrl = true;
+-                break;
+-            }
+-        }
+-
+-        if (!isUrl)
+-            nonUrls.push_back(item);
+-    }
+-
+-    QPoint hotSpot = m_drag->hotSpot();
+-    const auto pixmap = dragPixmap(m_drag, hotSpot);
+-    NSImage *dragImage = [NSImage imageFromQImage:pixmap.toImage()];
+-    Q_ASSERT(dragImage);
+-
+-    NSMutableArray<NSDraggingItem *> *dragItems = [[[NSMutableArray alloc] init] autorelease];
+-    const NSPoint itemLocation = m_drag->hotSpot().toCGPoint();
+-    // 0. We start from URLs, which can be actually in a list (thus technically
+-    // only ONE item in the pasteboard. The fact it's only one does not help, we are
+-    // still getting an exception because of the number of items/images mismatch ...
+-    for (const auto &qtUrl : qtUrls) {
+-        NSURL *nsUrl = qtUrl.toNSURL();
+-        auto *newItem = [[[NSDraggingItem alloc] initWithPasteboardWriter:nsUrl] autorelease];
+-        const NSRect itemFrame = NSMakeRect(itemLocation.x, itemLocation.y,
+-                                            dragImage.size.width,
+-                                            dragImage.size.height);
+-        [newItem setDraggingFrame:itemFrame contents:dragImage];
+-        [dragItems addObject:newItem];
+-    }
+-    // 1. Repeat for non-url items, if any:
+-    for (auto *pbItem : nonUrls) {
+-        auto *newItem = [[[NSDraggingItem alloc] initWithPasteboardWriter:pbItem] autorelease];
+-        const NSRect itemFrame = NSMakeRect(itemLocation.x, itemLocation.y,
+-                                            dragImage.size.width,
+-                                            dragImage.size.height);
+-        [newItem setDraggingFrame:itemFrame contents:dragImage];
+-        [dragItems addObject:newItem];
+-    }
+-
+-    [sourceView beginDraggingSessionWithItems:dragItems event:m_lastEvent source:sourceView];
+-    internalDragLoop.exec();
+-    return true;
+-}
+-
+ void QCocoaDrag::setAcceptedAction(Qt::DropAction act)
+ {
+     m_executed_drop_action = act;
+ }
+ 
+-void QCocoaDrag::exitDragLoop()
+-{
+-    if (internalDragLoop.isRunning())
+-        internalDragLoop.exit();
+-}
+-
+-
+ QPixmap QCocoaDrag::dragPixmap(QDrag *drag, QPoint &hotSpot) const
+ {
+     const QMimeData* data = drag->mimeData();
+diff --git a/src/plugins/platforms/cocoa/qnsview_dragging.mm b/src/plugins/platforms/cocoa/qnsview_dragging.mm
+index 978d73f7d9..463e3c5579 100644
+--- a/src/plugins/platforms/cocoa/qnsview_dragging.mm
++++ b/src/plugins/platforms/cocoa/qnsview_dragging.mm
+@@ -232,10 +232,6 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
+     if (!target)
+         return;
+ 
+-    auto *nativeDrag = QCocoaIntegration::instance()->drag();
+-    Q_ASSERT(nativeDrag);
+-    nativeDrag->exitDragLoop();
+-
+     QPoint windowPoint = QPointF::fromCGPoint([self convertPoint:sender.draggingLocation fromView:nil]).toPoint();
+ 
+     qCDebug(lcQpaMouse) << QEvent::DragLeave << self << "at" << windowPoint;
+@@ -294,10 +290,7 @@ static QPoint mapWindowCoordinates(QWindow *source, QWindow *target, QPoint poin
+     if (!target)
+         return;
+ 
+-    QCocoaDrag* nativeDrag = QCocoaIntegration::instance()->drag();
+-    Q_ASSERT(nativeDrag);
+-    nativeDrag->exitDragLoop();
+-    nativeDrag->setAcceptedAction(qt_mac_mapNSDragOperation(operation));
++    QCocoaIntegration::instance()->drag();
+ 
+     // Qt starts drag-and-drop on a mouse button press event. Cococa in
+     // this case won't send the matching release event, so we have to
+-- 
+2.21.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0005-Revert-macOS-Fix-use-of-deprecated-NSOffState.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0005-Revert-macOS-Fix-use-of-deprecated-NSOffState.patch
new file mode 100644
index 000000000000..f93f80055982
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0005-Revert-macOS-Fix-use-of-deprecated-NSOffState.patch
@@ -0,0 +1,26 @@
+From e55ca5d08b29e67b699dc217abcb65e4a7655f72 Mon Sep 17 00:00:00 2001
+From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
+Date: Mon, 7 Dec 2020 12:32:37 -0500
+Subject: [PATCH 5/6] Revert "macOS: Fix use of deprecated NSOffState"
+
+This reverts commit 6a0995525d306a1fa224adcbcb9f0ae1fc7d01bd.
+---
+ src/plugins/styles/mac/qmacstyle_mac.mm | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
+index d1febd81d4..b5e6e60ec0 100644
+--- a/src/plugins/styles/mac/qmacstyle_mac.mm
++++ b/src/plugins/styles/mac/qmacstyle_mac.mm
+@@ -3955,7 +3955,7 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
+                     pbCell = static_cast<NSPopUpButtonCell *>(pb.cell);
+                     oldPosition = pbCell.arrowPosition;
+                     pbCell.arrowPosition = NSPopUpNoArrow;
+-                    if (pb.state == NSControlStateValueOff) {
++                    if (pb.state == NSOffState) {
+                         // NSPopUpButton in this state is smaller.
+                         rAdjusted.origin.x -= 3;
+                         rAdjusted.size.width += 6;
+-- 
+2.21.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0006-git-checkout-v5.15.0-src-plugins-platforms-cocoa-qco.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0006-git-checkout-v5.15.0-src-plugins-platforms-cocoa-qco.patch
new file mode 100644
index 000000000000..b5c634aff76b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/macos-sdk-10.12/0006-git-checkout-v5.15.0-src-plugins-platforms-cocoa-qco.patch
@@ -0,0 +1,77 @@
+From 3ce5e752c66307f905fdf732b102a396d9248fbb Mon Sep 17 00:00:00 2001
+From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
+Date: Mon, 7 Dec 2020 13:22:02 -0500
+Subject: [PATCH 6/6] git checkout v5.15.0 --
+ src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
+
+---
+ .../cocoa/qcocoacolordialoghelper.mm          | 50 +++++++++----------
+ 1 file changed, 25 insertions(+), 25 deletions(-)
+
+diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
+index 5ad1f9d7bb..c9fa035d87 100644
+--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
++++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
+@@ -180,34 +180,34 @@ QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSColorPanelDelegate);
+ 
+ - (void)updateQtColor
+ {
+-    // Discard the color space and pass the color components to QColor. This
+-    // is a good option as long as QColor is color-unmanaged: we preserve the
+-    // exact RGB value from the color picker, which is predictable. Further,
+-    // painting with the color will reproduce the same color on-screen, as
+-    // long as the the same screen is used for selecting the color.
+-    NSColor *componentColor = [[mColorPanel color] colorUsingType:NSColorTypeComponentBased];
+-    switch (componentColor.colorSpace.colorSpaceModel)
+-    {
+-    case NSColorSpaceModelGray: {
+-        CGFloat white = 0, alpha = 0;
+-        [componentColor getWhite:&white alpha:&alpha];
+-        mQtColor.setRgbF(white, white, white, alpha);
+-    } break;
+-    case NSColorSpaceModelRGB: {
+-        CGFloat red = 0, green = 0, blue = 0, alpha = 0;
+-        [componentColor getRed:&red green:&green blue:&blue alpha:&alpha];
+-        mQtColor.setRgbF(red, green, blue, alpha);
+-    } break;
+-    case NSColorSpaceModelCMYK: {
++    NSColor *color = [mColorPanel color];
++    NSString *colorSpaceName = [color colorSpaceName];
++    if (colorSpaceName == NSDeviceCMYKColorSpace) {
+         CGFloat cyan = 0, magenta = 0, yellow = 0, black = 0, alpha = 0;
+-        [componentColor getCyan:&cyan magenta:&magenta yellow:&yellow black:&black alpha:&alpha];
++        [color getCyan:&cyan magenta:&magenta yellow:&yellow black:&black alpha:&alpha];
+         mQtColor.setCmykF(cyan, magenta, yellow, black, alpha);
+-    } break;
+-    default:
+-        qWarning("QNSColorPanelDelegate: Unsupported color space model");
+-    break;
++    } else if (colorSpaceName == NSCalibratedRGBColorSpace || colorSpaceName == NSDeviceRGBColorSpace)  {
++        CGFloat red = 0, green = 0, blue = 0, alpha = 0;
++        [color getRed:&red green:&green blue:&blue alpha:&alpha];
++        mQtColor.setRgbF(red, green, blue, alpha);
++    } else if (colorSpaceName == NSNamedColorSpace) {
++        NSColor *tmpColor = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
++        CGFloat red = 0, green = 0, blue = 0, alpha = 0;
++        [tmpColor getRed:&red green:&green blue:&blue alpha:&alpha];
++        mQtColor.setRgbF(red, green, blue, alpha);
++    } else {
++        NSColorSpace *colorSpace = [color colorSpace];
++        if ([colorSpace colorSpaceModel] == NSCMYKColorSpaceModel && [color numberOfComponents] == 5){
++            CGFloat components[5];
++            [color getComponents:components];
++            mQtColor.setCmykF(components[0], components[1], components[2], components[3], components[4]);
++        } else {
++            NSColor *tmpColor = [color colorUsingColorSpaceName:NSCalibratedRGBColorSpace];
++            CGFloat red = 0, green = 0, blue = 0, alpha = 0;
++            [tmpColor getRed:&red green:&green blue:&blue alpha:&alpha];
++            mQtColor.setRgbF(red, green, blue, alpha);
++        }
+     }
+-
+     if (mHelper)
+         emit mHelper->currentColorChanged(mQtColor);
+ }
+-- 
+2.21.0
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/qtbase-sdk-10.12-mac.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/qtbase-sdk-10.12-mac.patch
new file mode 100644
index 000000000000..3638268de7af
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtbase.patch.d/qtbase-sdk-10.12-mac.patch
@@ -0,0 +1,77 @@
+diff --git a/mkspecs/common/macx.conf b/mkspecs/common/macx.conf
+--- a/mkspecs/common/macx.conf
++++ b/mkspecs/common/macx.conf
+@@ -10,7 +10,7 @@ QMAKE_APPLE_DEVICE_ARCHS = x86_64
+ 
+ # Should be 10.15, but as long as the CI builds with
+ # older SDKs we have to keep this.
+-QT_MAC_SDK_VERSION_MIN = 10.14
++QT_MAC_SDK_VERSION_MIN = 10.12
+ 
+ QT_MAC_SDK_VERSION_MAX = 10.15
+ 
+diff --git a/src/corelib/kernel/qcore_mac.mm b/src/corelib/kernel/qcore_mac.mm
+--- a/src/corelib/kernel/qcore_mac.mm
++++ b/src/corelib/kernel/qcore_mac.mm
+@@ -261,16 +261,10 @@ QMacAutoReleasePool::QMacAutoReleasePool()
+ 
+ #ifdef QT_DEBUG
+     void *poolFrame = nullptr;
+-    if (__builtin_available(macOS 10.14, iOS 12.0, tvOS 12.0, watchOS 5.0, *)) {
+-        void *frame;
+-        if (backtrace_from_fp(__builtin_frame_address(0), &frame, 1))
+-            poolFrame = frame;
+-    } else {
+         static const int maxFrames = 3;
+         void *callstack[maxFrames];
+         if (backtrace(callstack, maxFrames) == maxFrames)
+             poolFrame = callstack[maxFrames - 1];
+-    }
+ 
+     if (poolFrame) {
+         Dl_info info;
+diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp
+--- a/src/gui/rhi/qrhi.cpp
++++ b/src/gui/rhi/qrhi.cpp
+@@ -4251,7 +4251,7 @@ QRhi *QRhi::create(Implementation impl, QRhiInitParams *params, Flags flags, QRh
+         break;
+ #endif
+     case Metal:
+-#if defined(Q_OS_MACOS) || defined(Q_OS_IOS)
++#if 0
+         r->d = new QRhiMetal(static_cast<QRhiMetalInitParams *>(params),
+                              static_cast<QRhiMetalNativeHandles *>(importDevice));
+         break;
+diff --git a/src/gui/rhi/rhi.pri b/src/gui/rhi/rhi.pri
+--- a/src/gui/rhi/rhi.pri
++++ b/src/gui/rhi/rhi.pri
+@@ -43,7 +43,7 @@ win32 {
+     LIBS += -ld3d11 -ldxgi -ldxguid
+ }
+ 
+-macos|ios {
++false {
+     HEADERS += \
+         rhi/qrhimetal_p.h \
+         rhi/qrhimetal_p_p.h
+diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm
+--- a/src/plugins/platforms/cocoa/qcocoadrag.mm
++++ b/src/plugins/platforms/cocoa/qcocoadrag.mm
+@@ -133,7 +133,7 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
+     NSImage *dragImage = [NSImage imageFromQImage:pm.toImage()];
+     Q_ASSERT(dragImage);
+ 
+-    QMacPasteboard dragBoard(CFStringRef(NSPasteboardNameDrag), QMacInternalPasteboardMime::MIME_DND);
++    QMacPasteboard dragBoard((CFStringRef) NSDragPboard, QMacInternalPasteboardMime::MIME_DND);
+     m_drag->mimeData()->setData(QLatin1String("application/x-qt-mime-type-name"), QByteArray("dummy"));
+     dragBoard.setMimeData(m_drag->mimeData(), QMacPasteboard::LazyRequest);
+ 
+@@ -144,7 +144,7 @@ Qt::DropAction QCocoaDrag::drag(QDrag *o)
+     CGFloat flippedY = dragImage.size.height - hotSpot.y();
+     event_location.y -= flippedY;
+     NSSize mouseOffset_unused = NSMakeSize(0.0, 0.0);
+-    NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSPasteboardNameDrag];
++    NSPasteboard *pboard = [NSPasteboard pasteboardWithName:NSDragPboard];
+ 
+     [theWindow dragImage:dragImage
+         at:event_location
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtdeclarative.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtdeclarative.patch
new file mode 100644
index 000000000000..d9c721e6946c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtdeclarative.patch
@@ -0,0 +1,114 @@
+diff --git a/src/particles/particles.pro b/src/particles/particles.pro
+index aaaa83419a..58aee00036 100644
+--- a/src/particles/particles.pro
++++ b/src/particles/particles.pro
+@@ -20,6 +20,6 @@ QMLTYPES_FILENAME = plugins.qmltypes
+ QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQuick/Particles.2
+ QML_IMPORT_NAME = QtQuick.Particles
+ IMPORT_VERSION = 2.$$QT_MINOR_VERSION
+-CONFIG += qmltypes install_qmltypes install_metatypes
++CONFIG += qmltypes install_qmltypes
+ 
+ load(qt_module)
+diff --git a/src/qml/qml.pro b/src/qml/qml.pro
+index e39a8319b6..90c0331278 100644
+--- a/src/qml/qml.pro
++++ b/src/qml/qml.pro
+@@ -72,6 +72,6 @@ QMLTYPES_FILENAME = plugins.qmltypes
+ QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQml
+ QML_IMPORT_NAME = QtQml
+ IMPORT_VERSION = 2.$$QT_MINOR_VERSION
+-CONFIG += qmltypes install_qmltypes install_metatypes
++CONFIG += qmltypes install_qmltypes
+ 
+ load(qt_module)
+diff --git a/src/qmlmodels/qmlmodels.pro b/src/qmlmodels/qmlmodels.pro
+index 4ac093556d..112e2c2be0 100644
+--- a/src/qmlmodels/qmlmodels.pro
++++ b/src/qmlmodels/qmlmodels.pro
+@@ -68,6 +68,6 @@ QMLTYPES_FILENAME = plugins.qmltypes
+ QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQml/Models.2
+ QML_IMPORT_NAME = QtQml.Models
+ IMPORT_VERSION = 2.$$QT_MINOR_VERSION
+-CONFIG += qmltypes install_qmltypes install_metatypes
++CONFIG += qmltypes install_qmltypes
+ 
+ load(qt_module)
+diff --git a/src/qmltest/qmltest.pro b/src/qmltest/qmltest.pro
+index c2e8068fc6..79dba368f7 100644
+--- a/src/qmltest/qmltest.pro
++++ b/src/qmltest/qmltest.pro
+@@ -34,7 +34,7 @@ QMLTYPES_FILENAME = plugins.qmltypes
+ QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/Qt/test/qtestroot
+ QML_IMPORT_NAME = Qt.test.qtestroot
+ QML_IMPORT_VERSION = 1.0
+-CONFIG += qmltypes install_qmltypes install_metatypes
++CONFIG += qmltypes install_qmltypes
+ 
+ # Install qmldir
+ qmldir.files = $$PWD/qmldir
+diff --git a/src/qmlworkerscript/qmlworkerscript.pro b/src/qmlworkerscript/qmlworkerscript.pro
+index 84466062e1..79885455cc 100644
+--- a/src/qmlworkerscript/qmlworkerscript.pro
++++ b/src/qmlworkerscript/qmlworkerscript.pro
+@@ -23,6 +23,6 @@ QMLTYPES_FILENAME = plugins.qmltypes
+ QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQml/WorkerScript.2
+ QML_IMPORT_NAME = QtQml.WorkerScript
+ IMPORT_VERSION = 2.$$QT_MINOR_VERSION
+-CONFIG += qmltypes install_qmltypes install_metatypes
++CONFIG += qmltypes install_qmltypes
+ 
+ load(qt_module)
+diff --git a/src/quick/quick.pro b/src/quick/quick.pro
+index f2d49cf939..c401b04c4e 100644
+--- a/src/quick/quick.pro
++++ b/src/quick/quick.pro
+@@ -52,4 +52,4 @@ QMLTYPES_FILENAME = plugins.qmltypes
+ QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQuick.2
+ QML_IMPORT_NAME = QtQuick
+ IMPORT_VERSION = 2.$$QT_MINOR_VERSION
+-CONFIG += qmltypes install_qmltypes install_metatypes
++CONFIG += qmltypes install_qmltypes
+diff --git a/src/quickshapes/quickshapes.pro b/src/quickshapes/quickshapes.pro
+index 4dbd3e5e46..0c6b186fc8 100644
+--- a/src/quickshapes/quickshapes.pro
++++ b/src/quickshapes/quickshapes.pro
+@@ -36,4 +36,4 @@ QMLTYPES_FILENAME = plugins.qmltypes
+ QMLTYPES_INSTALL_DIR = $$[QT_INSTALL_QML]/QtQuick/Shapes
+ QML_IMPORT_NAME = QtQuick.Shapes
+ IMPORT_VERSION = 1.$$QT_MINOR_VERSION
+-CONFIG += qmltypes install_qmltypes install_metatypes
++CONFIG += qmltypes install_qmltypes
+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/qmlcache.prf b/tools/qmlcachegen/qmlcache.prf
+index 537eaf62ea..e21de58f64 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.15/qtscript.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtscript.patch
new file mode 100644
index 000000000000..5508dec1280e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtscript.patch
@@ -0,0 +1,13 @@
+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.15/qtserialport.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtserialport.patch
new file mode 100644
index 000000000000..f25524e80bcf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtserialport.patch
@@ -0,0 +1,22 @@
+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.15/qttools.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qttools.patch
new file mode 100644
index 000000000000..8ae12198ca25
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qttools.patch
@@ -0,0 +1,15 @@
+--- 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.15/qtwebengine-darwin-no-platform-check.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebengine-darwin-no-platform-check.patch
new file mode 100644
index 000000000000..44df09299251
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebengine-darwin-no-platform-check.patch
@@ -0,0 +1,37 @@
+diff a/configure.pri b/configure.pri
+--- a/configure.pri
++++ b/configure.pri
+@@ -439,8 +439,6 @@ defineTest(qtwebengine_isWindowsPlatformSupported) {
+ 
+ defineTest(qtwebengine_isMacOsPlatformSupported) {
+     !qtwebengine_isMinXcodeVersion(10, 0, 0) {
+-        qtwebengine_platformError("requires at least version 10.0.0, but using Xcode version $${QMAKE_XCODE_VERSION}.")
+-        return(false)
+     }
+     !clang|intel_icc {
+         qtwebengine_platformError("requires Clang.")
+@@ -449,12 +447,6 @@ defineTest(qtwebengine_isMacOsPlatformSupported) {
+     # We require macOS 10.13 (darwin version 17.0.0) or newer.
+     darwin_major_version = $$section(QMAKE_HOST.version, ., 0, 0)
+     lessThan(darwin_major_version, 17) {
+-        qtwebengine_platformError("requires macOS version 10.13 or newer.")
+-        return(false)
+-    }
+-    !qtwebengine_isMinOSXSDKVersion(10, 13): {
+-        qtwebengine_platformError("requires a macOS SDK version of 10.13 or newer. Current version is $${WEBENGINE_OSX_SDK_PRODUCT_VERSION}.")
+-        return(false)
+     }
+     return(true)
+ }
+diff a/src/buildtools/config/mac_osx.pri b/src/buildtools/config/mac_osx.pri
+--- a/src/buildtools/config/mac_osx.pri
++++ b/src/buildtools/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}\'")
+ }
+ 
+ # chromium/build/mac/find_sdk.py expects the SDK version (mac_sdk_min) in Major.Minor format.
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebengine-mac-dont-set-dsymutil-path.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebengine-mac-dont-set-dsymutil-path.patch
new file mode 100644
index 000000000000..dcdf5f57ffdc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebengine-mac-dont-set-dsymutil-path.patch
@@ -0,0 +1,12 @@
+diff a/src/3rdparty/chromium/build/toolchain/mac/BUILD.gn b/src/3rdparty/chromium/build/toolchain/mac/BUILD.gn
+--- a/src/3rdparty/chromium/build/toolchain/mac/BUILD.gn
++++ b/src/3rdparty/chromium/build/toolchain/mac/BUILD.gn
+@@ -184,8 +184,6 @@ template("mac_toolchain") {
+     # If dSYMs are enabled, this flag will be added to the link tools.
+     if (_enable_dsyms) {
+       dsym_switch = " -Wcrl,dsym,{{root_out_dir}} "
+-      dsym_switch += "-Wcrl,dsymutilpath," +
+-                     "${prefix}dsymutil" + " "
+ 
+       dsym_output_dir =
+           "{{root_out_dir}}/{{target_output_name}}{{output_extension}}.dSYM"
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebkit-darwin-no-qos-classes.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebkit-darwin-no-qos-classes.patch
new file mode 100644
index 000000000000..a7087f517623
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebkit-darwin-no-qos-classes.patch
@@ -0,0 +1,11 @@
+diff --git a/Source/cmake/OptionsQt.cmake b/Source/cmake/OptionsQt.cmake
+--- a/Source/cmake/OptionsQt.cmake
++++ b/Source/cmake/OptionsQt.cmake
+@@ -683,7 +683,6 @@ if (WIN32 AND COMPILER_IS_GCC_OR_CLANG)
+ endif ()
+ 
+ if (APPLE)
+-    SET_AND_EXPOSE_TO_BUILD(HAVE_QOS_CLASSES 1)
+ endif ()
+ 
+ if (ENABLE_MATHML)
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebkit-darwin-no-readline.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebkit-darwin-no-readline.patch
new file mode 100644
index 000000000000..26d189d86019
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebkit-darwin-no-readline.patch
@@ -0,0 +1,45 @@
+diff --git a/Source/JavaScriptCore/shell/CMakeLists.txt b/Source/JavaScriptCore/shell/CMakeLists.txt
+--- a/Source/JavaScriptCore/shell/CMakeLists.txt
++++ b/Source/JavaScriptCore/shell/CMakeLists.txt
+@@ -9,7 +9,6 @@ set(JSC_LIBRARIES
+ )
+ 
+ if (WTF_OS_MAC_OS_X)
+-    list(APPEND JSC_LIBRARIES edit)
+ endif ()
+ 
+ if ("${JavaScriptCore_LIBRARY_TYPE}" MATCHES "STATIC")
+diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h
+--- a/Source/WTF/wtf/Platform.h
++++ b/Source/WTF/wtf/Platform.h
+@@ -563,7 +563,6 @@
+ #if PLATFORM(IOS)
+ 
+ #define HAVE_NETWORK_EXTENSION 1
+-#define HAVE_READLINE 1
+ #if USE(APPLE_INTERNAL_SDK)
+ #define USE_CFNETWORK 1
+ #endif
+@@ -650,7 +649,6 @@
+ #define HAVE_MADV_DONTNEED 1
+ #define HAVE_MERGESORT 1
+ #define HAVE_PTHREAD_SETNAME_NP 1
+-#define HAVE_READLINE 1
+ #define HAVE_SYS_TIMEB_H 1
+ 
+ #if !PLATFORM(GTK) && !PLATFORM(QT)
+diff --git a/Source/WTF/wtf/PlatformMac.cmake b/Source/WTF/wtf/PlatformMac.cmake
+--- a/Source/WTF/wtf/PlatformMac.cmake
++++ b/Source/WTF/wtf/PlatformMac.cmake
+@@ -2,11 +2,9 @@ set(WTF_LIBRARY_TYPE SHARED)
+ 
+ find_library(COCOA_LIBRARY Cocoa)
+ find_library(COREFOUNDATION_LIBRARY CoreFoundation)
+-find_library(READLINE_LIBRARY Readline)
+ list(APPEND WTF_LIBRARIES
+     ${COREFOUNDATION_LIBRARY}
+     ${COCOA_LIBRARY}
+-    ${READLINE_LIBRARY}
+     libicucore.dylib
+ )
+ 
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebkit-icu68.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebkit-icu68.patch
new file mode 100644
index 000000000000..73463d7567a3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebkit-icu68.patch
@@ -0,0 +1,170 @@
+Regressed by https://github.com/unicode-org/icu/commit/c3fe7e09d844
+
+In file included from Source/WebCore/platform/text/TextAllInOne.cpp:31:
+Source/WebCore/platform/text/TextCodecICU.cpp:311:42: error: use of undeclared identifier 'TRUE'
+        ucnv_setFallback(m_converterICU, TRUE);
+                                         ^
+In file included from Source/WebCore/platform/text/TextAllInOne.cpp:40:
+In file included from Source/WebCore/platform/text/icu/UTextProvider.cpp:27:
+Source/WebCore/platform/text/icu/UTextProvider.h:83:28: error: use of undeclared identifier 'TRUE'
+            isAccessible = TRUE;
+                           ^
+Source/WebCore/platform/text/icu/UTextProvider.h:88:28: error: use of undeclared identifier 'FALSE'
+            isAccessible = FALSE;
+                           ^
+Source/WebCore/platform/text/icu/UTextProvider.h:97:28: error: use of undeclared identifier 'TRUE'
+            isAccessible = TRUE;
+                           ^
+Source/WebCore/platform/text/icu/UTextProvider.h:102:28: error: use of undeclared identifier 'FALSE'
+            isAccessible = FALSE;
+                           ^
+In file included from Source/WebCore/platform/text/TextAllInOne.cpp:41:
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:103:20: error: use of undeclared identifier 'TRUE'
+            return TRUE;
+                   ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:108:20: error: use of undeclared identifier 'FALSE'
+            return FALSE;
+                   ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:114:20: error: use of undeclared identifier 'TRUE'
+            return TRUE;
+                   ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:119:20: error: use of undeclared identifier 'FALSE'
+            return FALSE;
+                   ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:147:12: error: use of undeclared identifier 'TRUE'
+    return TRUE;
+           ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:339:16: error: use of undeclared identifier 'FALSE'
+        return FALSE;
+               ^
+Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp:359:12: error: use of undeclared identifier 'TRUE'
+    return TRUE;
+           ^
+In file included from Source/WebCore/platform/text/TextAllInOne.cpp:42:
+Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp:128:16: error: use of undeclared identifier 'FALSE'
+        return FALSE;
+               ^
+Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp:148:12: error: use of undeclared identifier 'TRUE'
+    return TRUE;
+           ^
+
+--- a/Source/WebCore/platform/text/TextCodecICU.cpp
++++ b/Source/WebCore/platform/text/TextCodecICU.cpp
+@@ -308,7 +308,7 @@ void TextCodecICU::createICUConverter() const
+     m_converterICU = ucnv_open(m_canonicalConverterName, &err);
+     ASSERT(U_SUCCESS(err));
+     if (m_converterICU)
+-        ucnv_setFallback(m_converterICU, TRUE);
++        ucnv_setFallback(m_converterICU, true);
+ }
+ 
+ int TextCodecICU::decodeToBuffer(UChar* target, UChar* targetLimit, const char*& source, const char* sourceLimit, int32_t* offsets, bool flush, UErrorCode& err)
+--- a/Source/WebCore/platform/text/icu/UTextProvider.h
++++ b/Source/WebCore/platform/text/icu/UTextProvider.h
+@@ -80,12 +80,12 @@ inline bool uTextAccessInChunkOrOutOfRange(UText* text
+             // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
+             ASSERT(offset < std::numeric_limits<int32_t>::max());
+             text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
+-            isAccessible = TRUE;
++            isAccessible = true;
+             return true;
+         }
+         if (nativeIndex >= nativeLength && text->chunkNativeLimit == nativeLength) {
+             text->chunkOffset = text->chunkLength;
+-            isAccessible = FALSE;
++            isAccessible = false;
+             return true;
+         }
+     } else {
+@@ -94,12 +94,12 @@ inline bool uTextAccessInChunkOrOutOfRange(UText* text
+             // Ensure chunk offset is well formed if computed offset exceeds int32_t range.
+             ASSERT(offset < std::numeric_limits<int32_t>::max());
+             text->chunkOffset = offset < std::numeric_limits<int32_t>::max() ? static_cast<int32_t>(offset) : 0;
+-            isAccessible = TRUE;
++            isAccessible = true;
+             return true;
+         }
+         if (nativeIndex <= 0 && !text->chunkNativeStart) {
+             text->chunkOffset = 0;
+-            isAccessible = FALSE;
++            isAccessible = false;
+             return true;
+         }
+     }
+--- a/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
++++ b/Source/WebCore/platform/text/icu/UTextProviderLatin1.cpp
+@@ -100,23 +100,23 @@ static UBool uTextLatin1Access(UText* uText, int64_t i
+         if (index < uText->chunkNativeLimit && index >= uText->chunkNativeStart) {
+             // Already inside the buffer. Set the new offset.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return TRUE;
++            return true;
+         }
+         if (index >= length && uText->chunkNativeLimit == length) {
+             // Off the end of the buffer, but we can't get it.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return FALSE;
++            return false;
+         }
+     } else {
+         if (index <= uText->chunkNativeLimit && index > uText->chunkNativeStart) {
+             // Already inside the buffer. Set the new offset.
+             uText->chunkOffset = static_cast<int32_t>(index - uText->chunkNativeStart);
+-            return TRUE;
++            return true;
+         }
+         if (!index && !uText->chunkNativeStart) {
+             // Already at the beginning; can't go any farther.
+             uText->chunkOffset = 0;
+-            return FALSE;
++            return false;
+         }
+     }
+     
+@@ -144,7 +144,7 @@ static UBool uTextLatin1Access(UText* uText, int64_t i
+ 
+     uText->nativeIndexingLimit = uText->chunkLength;
+ 
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextLatin1Extract(UText* uText, int64_t start, int64_t limit, UChar* dest, int32_t destCapacity, UErrorCode* status)
+@@ -336,7 +336,7 @@ static int64_t uTextLatin1ContextAwareNativeLength(UTe
+ static UBool uTextLatin1ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
+ {
+     if (!text->context)
+-        return FALSE;
++        return false;
+     int64_t nativeLength = uTextLatin1ContextAwareNativeLength(text);
+     UBool isAccessible;
+     if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
+@@ -356,7 +356,7 @@ static UBool uTextLatin1ContextAwareAccess(UText* text
+         ASSERT(newContext == UTextProviderContext::PriorContext);
+         textLatin1ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
+     }
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextLatin1ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
+--- a/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
++++ b/Source/WebCore/platform/text/icu/UTextProviderUTF16.cpp
+@@ -125,7 +125,7 @@ static inline int64_t uTextUTF16ContextAwareNativeLeng
+ static UBool uTextUTF16ContextAwareAccess(UText* text, int64_t nativeIndex, UBool forward)
+ {
+     if (!text->context)
+-        return FALSE;
++        return false;
+     int64_t nativeLength = uTextUTF16ContextAwareNativeLength(text);
+     UBool isAccessible;
+     if (uTextAccessInChunkOrOutOfRange(text, nativeIndex, nativeLength, forward, isAccessible))
+@@ -145,7 +145,7 @@ static UBool uTextUTF16ContextAwareAccess(UText* text,
+         ASSERT(newContext == UTextProviderContext::PriorContext);
+         textUTF16ContextAwareSwitchToPriorContext(text, nativeIndex, nativeLength, forward);
+     }
+-    return TRUE;
++    return true;
+ }
+ 
+ static int32_t uTextUTF16ContextAwareExtract(UText*, int64_t, int64_t, UChar*, int32_t, UErrorCode* errorCode)
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebkit.patch b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebkit.patch
new file mode 100644
index 000000000000..b94a4b76cbab
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/qtwebkit.patch
@@ -0,0 +1,12 @@
+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.15/srcs.nix b/nixpkgs/pkgs/development/libraries/qt-5/5.15/srcs.nix
new file mode 100644
index 000000000000..70e9c3a80225
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/srcs.nix
@@ -0,0 +1,342 @@
+# DO NOT EDIT! This file is generated automatically.
+# Command: ./maintainers/scripts/fetch-kde-qt.sh pkgs/development/libraries/qt-5/5.15
+{ fetchurl, mirror }:
+
+{
+  qt3d = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qt3d-everywhere-src-5.15.2.tar.xz";
+      sha256 = "03ed6a48c813c75296c19f5d721184ab168280b69d2656cf16f877d3d4c55c1d";
+      name = "qt3d-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtactiveqt = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtactiveqt-everywhere-src-5.15.2.tar.xz";
+      sha256 = "868161fee0876d17079cd5bed58d1667bf19ffd0018cbe515129f11510ad2a5c";
+      name = "qtactiveqt-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtandroidextras = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtandroidextras-everywhere-src-5.15.2.tar.xz";
+      sha256 = "5813278690d89a9c232eccf697fc280034de6f9f02a7c40d95ad5fcf8ac8dabd";
+      name = "qtandroidextras-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtbase = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtbase-everywhere-src-5.15.2.tar.xz";
+      sha256 = "909fad2591ee367993a75d7e2ea50ad4db332f05e1c38dd7a5a274e156a4e0f8";
+      name = "qtbase-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtcharts = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtcharts-everywhere-src-5.15.2.tar.xz";
+      sha256 = "e0750e4195bd8a8b9758ab4d98d437edbe273cd3d289dd6a8f325df6d13f3d11";
+      name = "qtcharts-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtconnectivity = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtconnectivity-everywhere-src-5.15.2.tar.xz";
+      sha256 = "0380327871f76103e5b8c2a305988d76d352b6a982b3e7b3bc3cdc184c64bfa0";
+      name = "qtconnectivity-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtdatavis3d = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtdatavis3d-everywhere-src-5.15.2.tar.xz";
+      sha256 = "226a6575d573ad78aca459709722c496c23aee526aa0c38eb7c93b0bea1eb6fd";
+      name = "qtdatavis3d-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtdeclarative = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtdeclarative-everywhere-src-5.15.2.tar.xz";
+      sha256 = "c600d09716940f75d684f61c5bdaced797f623a86db1627da599027f6c635651";
+      name = "qtdeclarative-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtdoc = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtdoc-everywhere-src-5.15.2.tar.xz";
+      sha256 = "a47809f00f1bd690ca4e699cb32ffe7717d43da84e0167d1f562210da7714ce4";
+      name = "qtdoc-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtgamepad = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtgamepad-everywhere-src-5.15.2.tar.xz";
+      sha256 = "c77611f7898326d69176ad67a9b886f617cdedc368ec29f223d63537d25b075c";
+      name = "qtgamepad-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtgraphicaleffects = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtgraphicaleffects-everywhere-src-5.15.2.tar.xz";
+      sha256 = "ec8d67f64967d5046410490b549c576f9b9e8b47ec68594ae84aa8870173dfe4";
+      name = "qtgraphicaleffects-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtimageformats = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtimageformats-everywhere-src-5.15.2.tar.xz";
+      sha256 = "bf8285c7ce04284527ab823ddc7cf48a1bb79131db3a7127342167f4814253d7";
+      name = "qtimageformats-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtlocation = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtlocation-everywhere-src-5.15.2.tar.xz";
+      sha256 = "984fcb09e108df49a8dac35d5ce6dffc49caafd2acb1c2f8a5173a6a21f392a0";
+      name = "qtlocation-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtlottie = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtlottie-everywhere-src-5.15.2.tar.xz";
+      sha256 = "cec6095ab8f714e609d2ad3ea8c4fd819461ce8793adc42abe37d0f6dc432517";
+      name = "qtlottie-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtmacextras = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtmacextras-everywhere-src-5.15.2.tar.xz";
+      sha256 = "6959b0f2cec71cd66800f36cab797430860e55fa33c9c23698d6a08fc2b8776e";
+      name = "qtmacextras-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtmultimedia = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtmultimedia-everywhere-src-5.15.2.tar.xz";
+      sha256 = "0c3758810e5131aabcf76e4965e4c18b8911af54d9edd9305d2a8278d8346df5";
+      name = "qtmultimedia-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtnetworkauth = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtnetworkauth-everywhere-src-5.15.2.tar.xz";
+      sha256 = "fcc2ec42faa68561efa8f00cd72e662fbc06563ebc6de1dc42d96bb2997acd85";
+      name = "qtnetworkauth-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtpurchasing = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtpurchasing-everywhere-src-5.15.2.tar.xz";
+      sha256 = "87120d319ff2f8106e78971f7296d72a66dfe91e763d213199aea55046e93227";
+      name = "qtpurchasing-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtquick3d = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtquick3d-everywhere-src-5.15.2.tar.xz";
+      sha256 = "5b0546323365ce34e4716f22f305ebb4902e222c1a0910b65ee448443c2f94bb";
+      name = "qtquick3d-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtquickcontrols = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtquickcontrols-everywhere-src-5.15.2.tar.xz";
+      sha256 = "c393fb7384b1f047f10e91a6832cf3e6a4c2a41408b8cb2d05af2283e8549fb5";
+      name = "qtquickcontrols-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtquickcontrols2 = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtquickcontrols2-everywhere-src-5.15.2.tar.xz";
+      sha256 = "671b6ce5f4b8ecc94db622d5d5fb29ef4ff92819be08e5ea55bfcab579de8919";
+      name = "qtquickcontrols2-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtquicktimeline = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtquicktimeline-everywhere-src-5.15.2.tar.xz";
+      sha256 = "b9c247227607437acec7c7dd18ad46179d20369c9d22bdb1e9fc128dfb832a28";
+      name = "qtquicktimeline-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtremoteobjects = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtremoteobjects-everywhere-src-5.15.2.tar.xz";
+      sha256 = "6781b6bc90888254ea77ce812736dac00c67fa4eeb3095f5cd65e4b9c15dcfc2";
+      name = "qtremoteobjects-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtscript = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtscript-everywhere-src-5.15.2.tar.xz";
+      sha256 = "a299715369afbd1caa4d7fa2875d442eab91adcaacafce54a36922442624673e";
+      name = "qtscript-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtscxml = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtscxml-everywhere-src-5.15.2.tar.xz";
+      sha256 = "60b9590b9a41c60cee7b8a8c8410ee4625f0389c1ff8d79883ec5a985638a7dc";
+      name = "qtscxml-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtsensors = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtsensors-everywhere-src-5.15.2.tar.xz";
+      sha256 = "3f0011f9e9942cad119146b54d960438f4568a22a274cdad4fae06bb4e0e4839";
+      name = "qtsensors-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtserialbus = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtserialbus-everywhere-src-5.15.2.tar.xz";
+      sha256 = "aeeb7e5c0d3f8503215b22e1a84c0002ca67cf63862f6e3c6ef44a67ca31bd88";
+      name = "qtserialbus-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtserialport = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtserialport-everywhere-src-5.15.2.tar.xz";
+      sha256 = "59c559d748417306bc1b2cf2315c1e63eed011ace38ad92946af71f23e2ef79d";
+      name = "qtserialport-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtspeech = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtspeech-everywhere-src-5.15.2.tar.xz";
+      sha256 = "c810fb9eecb08026434422a32e79269627f3bc2941be199e86ec410bdfe883f5";
+      name = "qtspeech-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtsvg = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtsvg-everywhere-src-5.15.2.tar.xz";
+      sha256 = "8bc3c2c1bc2671e9c67d4205589a8309b57903721ad14c60ea21a5d06acb585e";
+      name = "qtsvg-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qttools = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qttools-everywhere-src-5.15.2.tar.xz";
+      sha256 = "c189d0ce1ff7c739db9a3ace52ac3e24cb8fd6dbf234e49f075249b38f43c1cc";
+      name = "qttools-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qttranslations = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qttranslations-everywhere-src-5.15.2.tar.xz";
+      sha256 = "d5788e86257b21d5323f1efd94376a213e091d1e5e03b45a95dd052b5f570db8";
+      name = "qttranslations-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtvirtualkeyboard = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtvirtualkeyboard-everywhere-src-5.15.2.tar.xz";
+      sha256 = "9a3193913be30f09a896e3b8c2f9696d2e9b3f88a63ae9ca8c97a2786b68cf55";
+      name = "qtvirtualkeyboard-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtwayland = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtwayland-everywhere-src-5.15.2.tar.xz";
+      sha256 = "193732229ff816f3aaab9a5e2f6bed71ddddbf1988ce003fe8dd84a92ce9aeb5";
+      name = "qtwayland-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtwebchannel = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtwebchannel-everywhere-src-5.15.2.tar.xz";
+      sha256 = "127fe79c43b386713f151ed7d411cd81e45e29f9c955584f29736f78c9303ec1";
+      name = "qtwebchannel-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtwebengine = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtwebengine-everywhere-src-5.15.2.tar.xz";
+      sha256 = "c8afca0e43d84f7bd595436fbe4d13a5bbdb81ec5104d605085d07545b6f91e0";
+      name = "qtwebengine-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtwebglplugin = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtwebglplugin-everywhere-src-5.15.2.tar.xz";
+      sha256 = "81e782b517ed29e10bea1aa90c9f59274c98a910f2c8b105fa78368a36b41446";
+      name = "qtwebglplugin-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtwebsockets = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtwebsockets-everywhere-src-5.15.2.tar.xz";
+      sha256 = "a0b42d85dd34ff6e2d23400e02f83d8b85bcd80e60efd1521d12d9625d4a233f";
+      name = "qtwebsockets-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtwebview = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtwebview-everywhere-src-5.15.2.tar.xz";
+      sha256 = "be9f46167e4977ead5ef5ecf883fdb812a4120f2436383583792f65557e481e7";
+      name = "qtwebview-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtwinextras = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtwinextras-everywhere-src-5.15.2.tar.xz";
+      sha256 = "65b8272005dec00791ab7d81ab266d1e3313a3bbd8e54e546d984cf4c4ab550e";
+      name = "qtwinextras-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtx11extras = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtx11extras-everywhere-src-5.15.2.tar.xz";
+      sha256 = "7014702ee9a644a5a93da70848ac47c18851d4f8ed622b29a72eed9282fc6e3e";
+      name = "qtx11extras-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+  qtxmlpatterns = {
+    version = "5.15.2";
+    src = fetchurl {
+      url = "${mirror}/official_releases/qt/5.15/5.15.2/submodules/qtxmlpatterns-everywhere-src-5.15.2.tar.xz";
+      sha256 = "76ea2162a7c349188d7e7e4f6c77b78e8a205494c90fee3cea3487a1ae2cf2fa";
+      name = "qtxmlpatterns-everywhere-src-5.15.2.tar.xz";
+    };
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/README.md b/nixpkgs/pkgs/development/libraries/qt-5/README.md
new file mode 100644
index 000000000000..b2ef74d0aef1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/README.md
@@ -0,0 +1,81 @@
+# Qt 5 Maintainer's Notes
+
+## Minor Updates
+
+Let `$major` be the major version number, e.g. `5.9`.
+
+1. Change the version number in the `$major/fetch.sh`.
+2. Run `./maintainers/scripts/fetch-kde-qt.sh pkgs/development/libraries/qt-5/$major`
+   from the top of the Nixpkgs tree.
+
+See below if it is necessary to update any patches.
+
+## Major Updates
+
+Let `$major` be the new major version number, e.g. `5.10`.
+
+1. Copy the subdirectory from the previous major version to `$major`.
+2. Change the version number in `$major/fetch.sh`.
+3. Run `./maintainers/scripts/fetch-kde-qt.sh pkgs/development/libraries/qt-5/$major`
+   from the top of the Nixpkgs tree.
+4. Add a top-level attribute in `pkgs/top-level/all-packages.nix` for the new
+   major version.
+5. Change the `qt5` top-level attribute to point to the new major version.
+6. If the previous major version is _not_ a long-term support release,
+   remove it from Nixpkgs.
+
+See below if it is necessary to update any patches.
+
+## Patches
+
+Nixpkgs maintains several patches for Qt which cannot be submitted upstream. To
+facilitate maintenance, a fork of the upstream repository is created for each patched module:
+
+- [qtbase](https://github.com/ttuegel/qtbase)
+- [qtwebkit](https://github.com/ttuegel/qtwebkit)
+- [qttools](https://github.com/ttuegel/qttools)
+- [qtscript](https://github.com/ttuegel/qtscript)
+- [qtserialport](https://github.com/ttuegel/qtserialport)
+- [qtdeclarative](https://github.com/ttuegel/qtdeclarative)
+- [qtwebengine](https://github.com/ttuegel/qtwebengine)
+
+In each repository, the patches are contained in a branch named `nixpkgs/$major`
+for each major version. Please make a pull request to add or update any patch
+which will be maintained in Nixpkgs.
+
+The forked repository for each module is used to create a single patch in
+Nixpkgs. To recreate the patch for module `$module` (e.g. `qtbase`) at version
+`$version` (e.g. `5.9.1`) in the branch `$major` (e.g. `5.9`),
+
+1. Clone the fork for `$module` from the list above.
+2. Checkout the active branch, `git checkout nixpkgs/$major`.
+3. Compare the patched branch to the release tag,
+   `git diff v$version > $module.patch`.
+4. Copy `$module.patch` into the Nixpkgs tree.
+
+### Minor Version Updates
+
+To update module `$module` to version `$version` from an older version in the
+same branch `$major`,
+
+1. Clone the fork for `$module` from the list above.
+2. Checkout the active branch, `git checkout nixpkgs/$major`.
+3. Merge the new version into the active branch,
+   `git merge --no-ff v$version`.
+4. Fix any conflicts.
+5. Open a pull request for the changes.
+6. Follow the instructions above to recreate the module patch in Nixpkgs.
+
+### Major Version Updates
+
+To update module `$module` from `$oldversion` in branch `$oldmajor` to version
+`$version` in branch `$major`,
+
+1. Clone the fork for `$module` from the list above.
+2. Checkout a new branch for the new major version,
+   `git checkout -b nixpkgs/$major nixpkgs/$oldmajor`.
+3. Rebase the patches from `$oldversion` onto the new branch,
+   `git rebase v$oldversion --onto v$version`.
+4. Fix any conflicts.
+5. Open a pull request for the changes.
+6. Follow the instructions above to recreate the module patch in Nixpkgs.
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..6aaeda052d70
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qmake-libtool.sh
@@ -0,0 +1,25 @@
+# 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
+            set +e
+            framework_libs=$(grep '^dependency_libs' "$la" | grep -Eo -- '-framework +\w+' | tr '\n' ' ')
+            set -e
+            sed -i "$la" \
+                -e '/^dependency_libs/ s,\(/[^ ]\+\)/lib\([^/ ]\+\)\.so,-L\1 -l\2,g' \
+                -e '/^dependency_libs/ s,-framework \+\w\+,,g'
+            if [ ! -z "$framework_libs" ]; then
+                if grep '^inherited_linker_flags=' $la >/dev/null; then
+                    sed -i "$la" -e "s/^\(inherited_linker_flags='[^']*\)/\1 $framework_libs/"
+                else
+                    echo "inherited_linker_flags='$framework_libs'" >> "$la"
+                fi
+            fi
+        done
+    fi
+}
+
+fixupOutputHooks+=('fixQmakeLibtool $prefix')
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qt-builtin-paths.sh b/nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qt-builtin-paths.sh
new file mode 100644
index 000000000000..4ca11a223de2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qt-builtin-paths.sh
@@ -0,0 +1,64 @@
+# fixQtBuiltinPaths
+#
+# Usage: fixQtBuiltinPaths _dir_ _pattern_
+#
+# Fix Qt builtin paths in files matching _pattern_ under _dir_.
+#
+fixQtBuiltinPaths() {
+    local dir="$1"
+    local pattern="$2"
+    local bin="${!outputBin}"
+    local dev="${!outputDev}"
+    local doc="${!outputDoc}"
+    local lib="${!outputLib}"
+
+    if [ -d "$dir" ]; then
+        find "$dir" -name "$pattern" | while read pr_; do
+            if grep -q '\$\$\[QT_' "${pr_:?}"; then
+                echo "fixQtBuiltinPaths: Fixing Qt builtin paths in \`${pr_:?}'..."
+                sed -i "${pr_:?}" \
+                    -e "s|\\\$\\\$\\[QT_HOST_BINS[^]]*\\]|$dev/bin|g" \
+                    -e "s|\\\$\\\$\\[QT_HOST_DATA[^]]*\\]/mkspecs|$dev/mkspecs|g" \
+                    -e "s|\\\$\\\$\\[QT_HOST_PREFIX[^]]*\\]|$dev|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_ARCHDATA[^]]*\\]|$lib|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_BINS[^]]*\\]|$bin/bin|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_CONFIGURATION[^]]*\\]|$bin|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_DATA[^]]*\\]|$lib|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_DOCS[^]]*\\]|$doc/share/doc|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_EXAMPLES[^]]*\\]|$doc/examples|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_HEADERS[^]]*\\]|$dev/include|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_LIBS[^]]*\\]|$lib/lib|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_LIBEXECS[^]]*\\]|$lib/libexec|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_PLUGINS[^]]*\\]|$bin/$qtPluginPrefix|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_PREFIX[^]]*\\]|$lib|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_TESTS[^]]*\\]|$dev/tests|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_TRANSLATIONS[^]]*\\]|$lib/translations|g" \
+                    -e "s|\\\$\\\$\\[QT_INSTALL_QML[^]]*\\]|$bin/$qtQmlPrefix|g"
+            fi
+        done
+    elif [ -e "$dir" ]; then
+        if grep -q '\$\$\[QT_' "${dir:?}"; then
+            echo "fixQtBuiltinPaths: Fixing Qt builtin paths in \`${dir:?}'..."
+            sed -i "${dir:?}" \
+                -e "s|\\\$\\\$\\[QT_HOST_BINS[^]]*\\]|$dev/bin|g" \
+                -e "s|\\\$\\\$\\[QT_HOST_DATA[^]]*\\]/mkspecs|$dev/mkspecs|g" \
+                -e "s|\\\$\\\$\\[QT_HOST_PREFIX[^]]*\\]|$dev|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_ARCHDATA[^]]*\\]|$lib|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_BINS[^]]*\\]|$bin/bin|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_CONFIGURATION[^]]*\\]|$bin|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_DATA[^]]*\\]|$lib|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_DOCS[^]]*\\]|$doc/share/doc|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_EXAMPLES[^]]*\\]|$doc/examples|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_HEADERS[^]]*\\]|$dev/include|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_LIBS[^]]*\\]|$lib/lib|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_LIBEXECS[^]]*\\]|$lib/libexec|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_PLUGINS[^]]*\\]|$bin/$qtPluginPrefix|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_PREFIX[^]]*\\]|$lib|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_TESTS[^]]*\\]|$dev/tests|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_TRANSLATIONS[^]]*\\]|$lib/translations|g" \
+                -e "s|\\\$\\\$\\[QT_INSTALL_QML[^]]*\\]|$bin/$qtQmlPrefix|g"
+        fi
+    else
+        echo "fixQtBuiltinPaths: Warning: \`$dir' does not exist"
+    fi
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qt-module-paths.sh b/nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qt-module-paths.sh
new file mode 100644
index 000000000000..33682f6f3c69
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/hooks/fix-qt-module-paths.sh
@@ -0,0 +1,36 @@
+# fixQtModulePaths
+#
+# Usage: fixQtModulePaths _dir_
+#
+# Find Qt module definitions in directory _dir_ and patch the module paths.
+#
+fixQtModulePaths () {
+    local dir="$1"
+    local bin="${!outputBin}"
+    local dev="${!outputDev}"
+    local lib="${!outputLib}"
+
+    if [ -d "$dir" ]; then
+        find "$dir" -name 'qt_*.pri' | while read pr; do
+            if grep -q '\$\$QT_MODULE_' "${pr:?}"; then
+                echo "fixQtModulePaths: Fixing module paths in \`${pr:?}'..."
+                sed -i "${pr:?}" \
+                    -e "s|\\\$\\\$QT_MODULE_LIB_BASE|$lib/lib|g" \
+                    -e "s|\\\$\\\$QT_MODULE_HOST_LIB_BASE|$lib/lib|g" \
+                    -e "s|\\\$\\\$QT_MODULE_INCLUDE_BASE|$dev/include|g" \
+                    -e "s|\\\$\\\$QT_MODULE_BIN_BASE|$dev/bin|g"
+            fi
+        done
+    elif [ -e "$dir" ]; then
+        echo "fixQtModulePaths: Warning: \`$dir' is not a directory"
+    else
+        echo "fixQtModulePaths: Warning: \`$dir' does not exist"
+    fi
+
+    if [ "z$bin" != "z$dev" ]; then
+        if [ -d "$bin/bin" ]; then
+            mkdir -p "$dev/bin"
+            lndir -silent "$bin/bin" "$dev/bin"
+        fi
+    fi
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/hooks/move-qt-dev-tools.sh b/nixpkgs/pkgs/development/libraries/qt-5/hooks/move-qt-dev-tools.sh
new file mode 100644
index 000000000000..85489c85105b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/hooks/move-qt-dev-tools.sh
@@ -0,0 +1,34 @@
+updateToolPath() {
+    local tool="$1"
+    local target="$2"
+    local original="${!outputBin}/$tool"
+    local actual="${!outputDev}/$tool"
+    if grep -q "$original" "$target"; then
+        echo "updateToolPath: Updating \`$original' in \`$target\'..."
+        sed -i "$target" -e "s|$original|$actual|"
+    fi
+}
+
+moveQtDevTools() {
+    if [ -n "$devTools" ]; then
+        for tool in $devTools; do
+            moveToOutput "$tool" "${!outputDev}"
+        done
+
+        if [ -d "${!outputDev}/mkspecs" ]; then
+            find "${!outputDev}/mkspecs" -name '*.pr?' | while read pr_; do
+                for tool in $devTools; do
+                    updateToolPath "$tool" "$pr_"
+                done
+            done
+        fi
+
+        if [ -d "${!outputDev}/lib/cmake" ]; then
+            find "${!outputDev}/lib/cmake" -name '*.cmake' | while read cmake; do
+                for tool in $devTools; do
+                    updateToolPath "$tool" "$cmake"
+                done
+            done
+        fi
+    fi
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh b/nixpkgs/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
new file mode 100644
index 000000000000..741225a5aa81
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/hooks/qmake-hook.sh
@@ -0,0 +1,46 @@
+. @fix_qmake_libtool@
+
+qmakeFlags=( ${qmakeFlags-} )
+
+qmakePrePhase() {
+    qmakeFlags_orig=( "${qmakeFlags[@]}" )
+
+    # These flags must be added _before_ the flags specified in the derivation.
+    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:?}" \
+    )
+
+    if [ -n "@debug@" ]; then
+        qmakeFlags+=( "CONFIG+=debug" )
+    else
+        qmakeFlags+=( "CONFIG+=release" )
+    fi
+
+    qmakeFlags+=( "${qmakeFlags_orig[@]}" )
+}
+prePhases+=" qmakePrePhase"
+
+qmakeConfigurePhase() {
+    runHook preConfigure
+
+    echo "QMAKEPATH=$QMAKEPATH"
+    echo qmake "${qmakeFlags[@]}"
+    qmake "${qmakeFlags[@]}"
+
+    if ! [[ -v enableParallelBuilding ]]; then
+        enableParallelBuilding=1
+        echo "qmake: enabled parallel building"
+    fi
+
+    runHook postConfigure
+}
+
+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
new file mode 100644
index 000000000000..1b57d676e1fc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/hooks/qtbase-setup-hook.sh
@@ -0,0 +1,112 @@
+if [[ -n "${__nix_qtbase-}" ]]; then
+    # Throw an error if a different version of Qt was already set up.
+    if [[ "$__nix_qtbase" != "@dev@" ]]; then
+        echo >&2 "Error: detected mismatched Qt dependencies:"
+        echo >&2 "    @dev@"
+        echo >&2 "    $__nix_qtbase"
+        exit 1
+    fi
+else # Only set up Qt once.
+__nix_qtbase="@dev@"
+
+qtPluginPrefix=@qtPluginPrefix@
+qtQmlPrefix=@qtQmlPrefix@
+qtDocPrefix=@qtDocPrefix@
+
+. @fix_qt_builtin_paths@
+. @fix_qt_module_paths@
+
+# Disable debug symbols if qtbase was built without debugging.
+# This stops -dev paths from leaking into other outputs.
+if [ -z "@debug@" ]; then
+    NIX_CFLAGS_COMPILE="${NIX_CFLAGS_COMPILE-}${NIX_CFLAGS_COMPILE:+ }-DQT_NO_DEBUG"
+fi
+
+# Integration with CMake:
+# Set the CMake build type corresponding to how qtbase was built.
+if [ -n "@debug@" ]; then
+    cmakeBuildType="Debug"
+else
+    cmakeBuildType="Release"
+fi
+
+providesQtRuntime() {
+    [ -d "$1/$qtPluginPrefix" ] || [ -d "$1/$qtQmlPrefix" ]
+}
+
+# Build tools are often confused if QMAKE is unset.
+QMAKE=@dev@/bin/qmake
+export QMAKE
+
+QMAKEPATH=
+export QMAKEPATH
+
+QMAKEMODULES=
+export QMAKEMODULES
+
+declare -Ag qmakePathSeen=()
+qmakePathHook() {
+    # Skip this path if we have seen it before.
+    # MUST use 'if' because 'qmakePathSeen[$]' may be unset.
+    if [ -n "${qmakePathSeen[$1]-}" ]; then return; fi
+    qmakePathSeen[$1]=1
+    if [ -d "$1/mkspecs" ]
+    then
+        QMAKEMODULES="${QMAKEMODULES}${QMAKEMODULES:+:}/mkspecs"
+        QMAKEPATH="${QMAKEPATH}${QMAKEPATH:+:}$1"
+    fi
+}
+envBuildHostHooks+=(qmakePathHook)
+
+# Propagate any runtime dependency of the building package.
+# Each dependency is propagated to the user environment and as a build
+# input so that it will be re-propagated to the user environment by any
+# package depending on the building package. (This is necessary in case
+# the building package does not provide runtime dependencies itself and so
+# would not be propagated to the user environment.)
+declare -Ag qtEnvHostTargetSeen=()
+qtEnvHostTargetHook() {
+    # Skip this path if we have seen it before.
+    # MUST use 'if' because 'qmakePathSeen[$]' may be unset.
+    if [ -n "${qtEnvHostTargetSeen[$1]-}" ]; then return; fi
+    qtEnvHostTargetSeen[$1]=1
+    if providesQtRuntime "$1" && [ "z${!outputBin}" != "z${!outputDev}" ]
+    then
+        propagatedBuildInputs+=" $1"
+    fi
+}
+envHostTargetHooks+=(qtEnvHostTargetHook)
+
+postPatchMkspecs() {
+    # Prevent this hook from running multiple times
+    dontPatchMkspecs=1
+
+    local bin="${!outputBin}"
+    local dev="${!outputDev}"
+    local doc="${!outputDoc}"
+    local lib="${!outputLib}"
+
+    moveToOutput "mkspecs" "$dev"
+
+    if [ -d "$dev/mkspecs/modules" ]; then
+        fixQtModulePaths "$dev/mkspecs/modules"
+    fi
+
+    if [ -d "$dev/mkspecs" ]; then
+        fixQtBuiltinPaths "$dev/mkspecs" '*.pr?'
+    fi
+}
+if [ -z "${dontPatchMkspecs-}" ]; then
+    postPhases="${postPhases-}${postPhases:+ }postPatchMkspecs"
+fi
+
+qtPreHook() {
+    # Check that wrapQtAppsHook is used, or it is explicitly disabled.
+    if [[ -z "$__nix_wrapQtAppsHook" && -z "$dontWrapQtApps" ]]; then
+        echo >&2 "Error: wrapQtAppsHook is not used, and dontWrapQtApps is not set."
+        exit 1
+    fi
+}
+prePhases+=" qtPreHook"
+
+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
new file mode 100644
index 000000000000..c320a7974471
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/hooks/qttools-setup-hook.sh
@@ -0,0 +1 @@
+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
new file mode 100644
index 000000000000..ce4d78fbb50f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/hooks/wrap-qt-apps-hook.sh
@@ -0,0 +1,107 @@
+if [[ -z "${__nix_wrapQtAppsHook-}" ]]; then
+__nix_wrapQtAppsHook=1  # Don't run this hook more than once.
+
+# Inherit arguments given in mkDerivation
+qtWrapperArgs=( ${qtWrapperArgs-} )
+
+qtHostPathSeen=()
+
+qtUnseenHostPath() {
+    for pkg in "${qtHostPathSeen[@]}"
+    do
+        if [ "${pkg:?}" == "$1" ]
+        then
+            return 1
+        fi
+    done
+
+    qtHostPathSeen+=("$1")
+    return 0
+}
+
+qtHostPathHook() {
+    qtUnseenHostPath "$1" || return 0
+
+    local pluginDir="$1/${qtPluginPrefix:?}"
+    if [ -d "$pluginDir" ]
+    then
+        qtWrapperArgs+=(--prefix QT_PLUGIN_PATH : "$pluginDir")
+    fi
+
+    local qmlDir="$1/${qtQmlPrefix:?}"
+    if [ -d "$qmlDir" ]
+    then
+        qtWrapperArgs+=(--prefix QML2_IMPORT_PATH : "$qmlDir")
+    fi
+}
+addEnvHooks "$hostOffset" qtHostPathHook
+
+makeQtWrapper() {
+    local original="$1"
+    local wrapper="$2"
+    shift 2
+    makeWrapper "$original" "$wrapper" "${qtWrapperArgs[@]}" "$@"
+}
+
+wrapQtApp() {
+    local program="$1"
+    shift 1
+    wrapProgram "$program" "${qtWrapperArgs[@]}" "$@"
+}
+
+qtOwnPathsHook() {
+    local xdgDataDir="${!outputBin}/share"
+    if [ -d "$xdgDataDir" ]
+    then
+        qtWrapperArgs+=(--prefix XDG_DATA_DIRS : "$xdgDataDir")
+    fi
+
+    local xdgConfigDir="${!outputBin}/etc/xdg"
+    if [ -d "$xdgConfigDir" ]
+    then
+        qtWrapperArgs+=(--prefix XDG_CONFIG_DIRS : "$xdgConfigDir")
+    fi
+
+    qtHostPathHook "${!outputBin}"
+}
+
+preFixupPhases+=" qtOwnPathsHook"
+
+# Note: $qtWrapperArgs still gets defined even if ${dontWrapQtApps-} is set.
+wrapQtAppsHook() {
+    # skip this hook when requested
+    [ -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/sbin" "$prefix/libexec"  )
+    echo "wrapping Qt applications in ${targetDirs[@]}"
+
+    for targetDir in "${targetDirs[@]}"
+    do
+        [ -d "$targetDir" ] || continue
+
+        find "$targetDir" ! -type d -executable -print0 | while IFS= read -r -d '' file
+        do
+            patchelf --print-interpreter "$file" >/dev/null 2>&1 || continue
+
+            if [ -f "$file" ]
+            then
+                echo "wrapping $file"
+                wrapQtApp "$file"
+            elif [ -h "$file" ]
+            then
+                target="$(readlink -e "$file")"
+                echo "wrapping $file -> $target"
+                rm "$file"
+                makeQtWrapper "$target" "$file"
+            fi
+        done
+    done
+}
+
+fixupOutputHooks+=(wrapQtAppsHook)
+
+fi
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/mkDerivation.nix b/nixpkgs/pkgs/development/libraries/qt-5/mkDerivation.nix
new file mode 100644
index 000000000000..98f9a05fac7c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/mkDerivation.nix
@@ -0,0 +1,17 @@
+{ lib, debug, wrapQtAppsHook }:
+
+let inherit (lib) optional; in
+
+mkDerivation:
+
+args:
+
+let
+  args_ = {
+
+    nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ wrapQtAppsHook ];
+
+  };
+in
+
+mkDerivation (args // args_)
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qt3d.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qt3d.nix
new file mode 100644
index 000000000000..63a516476f27
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qt3d.nix
@@ -0,0 +1,7 @@
+{ qtModule, qtbase, qtdeclarative }:
+
+qtModule {
+  pname = "qt3d";
+  qtInputs = [ qtbase qtdeclarative ];
+  outputs = [ "out" "dev" "bin" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix
new file mode 100644
index 000000000000..04a89558c3d0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix
@@ -0,0 +1,357 @@
+{ stdenv, lib
+, src, patches, version, qtCompatVersion
+
+, coreutils, bison, flex, gdb, gperf, lndir, perl, pkg-config, python3
+, which
+  # darwin support
+, libiconv, libobjc, xcbuild, AGL, AppKit, ApplicationServices, Carbon, Cocoa, CoreAudio, CoreBluetooth
+, CoreLocation, CoreServices, DiskArbitration, Foundation, OpenGL, MetalKit, IOKit
+
+, dbus, fontconfig, freetype, glib, harfbuzz, icu, libX11, libXcomposite
+, libXcursor, libXext, libXi, libXrender, libinput, libjpeg, libpng
+, libxcb, libxkbcommon, libxml2, libxslt, openssl, pcre16, pcre2, sqlite, udev
+, xcbutil, xcbutilimage, xcbutilkeysyms, xcbutilrenderutil, xcbutilwm
+, zlib
+
+  # optional dependencies
+, cups ? null, libmysqlclient ? null, postgresql ? null
+, withGtk3 ? false, dconf ? null, gtk3 ? null
+
+  # options
+, libGLSupported ? !stdenv.isDarwin
+, libGL
+, buildExamples ? false
+, buildTests ? false
+, debug ? false
+, developerBuild ? false
+, decryptSslTraffic ? false
+}:
+
+assert withGtk3 -> dconf != null;
+assert withGtk3 -> gtk3 != null;
+
+let
+  compareVersion = v: builtins.compareVersions version v;
+  qmakeCacheName = if compareVersion "5.12.4" < 0 then ".qmake.cache" else ".qmake.stash";
+  debugSymbols = debug || developerBuild;
+in
+
+stdenv.mkDerivation {
+  pname = "qtbase";
+  inherit qtCompatVersion src version;
+  debug = debugSymbols;
+
+  propagatedBuildInputs = [
+    libxml2 libxslt openssl sqlite zlib
+
+    # Text rendering
+    harfbuzz icu
+
+    # Image formats
+    libjpeg libpng
+    (if compareVersion "5.9.0" < 0 then pcre16 else pcre2)
+  ] ++ (
+    if stdenv.isDarwin then [
+      # TODO: move to buildInputs, this should not be propagated.
+      AGL AppKit ApplicationServices Carbon Cocoa CoreAudio CoreBluetooth
+      CoreLocation CoreServices DiskArbitration Foundation OpenGL
+      libobjc libiconv MetalKit IOKit
+    ] else [
+      dbus glib udev
+
+      # Text rendering
+      fontconfig freetype
+
+      # X11 libs
+      libX11 libXcomposite libXext libXi libXrender libxcb libxkbcommon xcbutil
+      xcbutilimage xcbutilkeysyms xcbutilrenderutil xcbutilwm
+    ] ++ lib.optional libGLSupported libGL
+  );
+
+  buildInputs = [ python3 ]
+    ++ lib.optionals (!stdenv.isDarwin)
+    (
+      [ libinput ]
+      ++ lib.optional withGtk3 gtk3
+    )
+    ++ lib.optional developerBuild gdb
+    ++ lib.optional (cups != null) cups
+    ++ lib.optional (libmysqlclient != null) libmysqlclient
+    ++ lib.optional (postgresql != null) postgresql;
+
+  nativeBuildInputs = [ bison flex gperf lndir perl pkg-config which ]
+    ++ lib.optionals stdenv.isDarwin [ xcbuild ];
+
+  propagatedNativeBuildInputs = [ lndir ];
+
+  outputs = [ "bin" "dev" "out" ];
+
+  inherit patches;
+
+  fix_qt_builtin_paths = ../hooks/fix-qt-builtin-paths.sh;
+  fix_qt_module_paths = ../hooks/fix-qt-module-paths.sh;
+  preHook = ''
+    . "$fix_qt_builtin_paths"
+    . "$fix_qt_module_paths"
+    . ${../hooks/move-qt-dev-tools.sh}
+    . ${../hooks/fix-qmake-libtool.sh}
+  '';
+
+  postPatch = ''
+    for prf in qml_plugin.prf qt_plugin.prf qt_docs.prf qml_module.prf create_cmake.prf; do
+        substituteInPlace "mkspecs/features/$prf" \
+            --subst-var qtPluginPrefix \
+            --subst-var qtQmlPrefix \
+            --subst-var qtDocPrefix
+    done
+
+    substituteInPlace configure --replace /bin/pwd pwd
+    substituteInPlace src/corelib/global/global.pri --replace /bin/ls ${coreutils}/bin/ls
+    sed -e 's@/\(usr\|opt\)/@/var/empty/@g' -i mkspecs/*/*.conf
+
+    sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5Config.cmake.in
+    sed -i '/PATHS.*NO_DEFAULT_PATH/ d' src/corelib/Qt5CoreMacros.cmake
+    sed -i 's/NO_DEFAULT_PATH//' src/gui/Qt5GuiConfigExtras.cmake.in
+    sed -i '/PATHS.*NO_DEFAULT_PATH/ d' mkspecs/features/data/cmake/Qt5BasicConfig.cmake.in
+  '' + (
+    if stdenv.isDarwin then ''
+        sed -i \
+            -e 's|/usr/bin/xcode-select|xcode-select|' \
+            -e 's|/usr/bin/xcrun|xcrun|' \
+            -e 's|/usr/bin/xcodebuild|xcodebuild|' \
+            -e 's|QMAKE_CONF_COMPILER=`getXQMakeConf QMAKE_CXX`|QMAKE_CXX="clang++"\nQMAKE_CONF_COMPILER="clang++"|' \
+            ./configure
+            substituteInPlace ./mkspecs/common/mac.conf \
+                --replace "/System/Library/Frameworks/OpenGL.framework/" "${OpenGL}/Library/Frameworks/OpenGL.framework/" \
+                --replace "/System/Library/Frameworks/AGL.framework/" "${AGL}/Library/Frameworks/AGL.framework/"
+    '' else lib.optionalString libGLSupported ''
+      sed -i mkspecs/common/linux.conf \
+          -e "/^QMAKE_INCDIR_OPENGL/ s|$|${libGL.dev or libGL}/include|" \
+          -e "/^QMAKE_LIBDIR_OPENGL/ s|$|${libGL.out}/lib|"
+    '' + lib.optionalString (stdenv.hostPlatform.isx86_32 && stdenv.cc.isGNU) ''
+      sed -i mkspecs/common/gcc-base-unix.conf \
+          -e "/^QMAKE_LFLAGS_SHLIB/ s/-shared/-shared -static-libgcc/"
+    ''
+  );
+
+  qtPluginPrefix = "lib/qt-${qtCompatVersion}/plugins";
+  qtQmlPrefix = "lib/qt-${qtCompatVersion}/qml";
+  qtDocPrefix = "share/doc/qt-${qtCompatVersion}";
+
+  setOutputFlags = false;
+  preConfigure = ''
+    export LD_LIBRARY_PATH="$PWD/lib:$PWD/plugins/platforms''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
+    ${lib.optionalString (compareVersion "5.9.0" < 0) ''
+    # We need to set LD to CXX or otherwise we get nasty compile errors
+    export LD=$CXX
+    ''}
+
+    NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PREFIX=\"$qtPluginPrefix\""
+  '';
+
+  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
+    NIX_OUTPUT_DOC = $dev/$qtDocPrefix
+    NIX_OUTPUT_QML = $bin/$qtQmlPrefix
+    NIX_OUTPUT_PLUGIN = $bin/$qtPluginPrefix
+    EOF
+    }
+
+    find . -name '.qmake.conf' | while read conf; do
+        qmakeCacheInjectNixOutputs "$(dirname $conf)"
+    done
+  '';
+
+  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");
+
+  prefixKey = "-prefix ";
+
+  # PostgreSQL autodetection fails sporadically because Qt omits the "-lpq" flag
+  # if dependency paths contain the string "pq", which can occur in the hash.
+  # To prevent these failures, we need to override PostgreSQL detection.
+  PSQL_LIBS = lib.optionalString (postgresql != null) "-L${postgresql.lib}/lib -lpq";
+
+  # 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"
+
+    "-release"
+    "-shared"
+    "-accessibility"
+    "-optimized-qmake"
+    "-strip"
+    "-system-proxies"
+    "-pkg-config"
+
+    "-gui"
+    "-widgets"
+    "-opengl desktop"
+    "-icu"
+    "-L" "${icu.out}/lib"
+    "-I" "${icu.dev}/include"
+    "-pch"
+  ] ++ lib.optional debugSymbols "-debug"
+    ++ lib.optionals (compareVersion "5.11.0" < 0) [
+    "-qml-debug"
+  ] ++ lib.optionals (compareVersion "5.9.0" < 0) [
+    "-c++11"
+    "-no-reduce-relocations"
+  ] ++ lib.optionals developerBuild [
+    "-developer-build"
+    "-no-warnings-are-errors"
+  ] ++ (if (!stdenv.hostPlatform.isx86_64) then [
+    "-no-sse2"
+  ] else lib.optionals (compareVersion "5.9.0" >= 0) [
+    "-sse2"
+    "${lib.optionalString (!stdenv.hostPlatform.sse3Support)   "-no"}-sse3"
+    "${lib.optionalString (!stdenv.hostPlatform.ssse3Support)  "-no"}-ssse3"
+    "${lib.optionalString (!stdenv.hostPlatform.sse4_1Support) "-no"}-sse4.1"
+    "${lib.optionalString (!stdenv.hostPlatform.sse4_2Support) "-no"}-sse4.2"
+    "${lib.optionalString (!stdenv.hostPlatform.avxSupport)    "-no"}-avx"
+    "${lib.optionalString (!stdenv.hostPlatform.avx2Support)   "-no"}-avx2"
+    ]
+  ) ++ [
+    "-no-mips_dsp"
+    "-no-mips_dspr2"
+  ] ++ [
+    "-system-zlib"
+    "-L" "${zlib.out}/lib"
+    "-I" "${zlib.dev}/include"
+    "-system-libjpeg"
+    "-L" "${libjpeg.out}/lib"
+    "-I" "${libjpeg.dev}/include"
+    "-system-harfbuzz"
+    "-L" "${harfbuzz.out}/lib"
+    "-I" "${harfbuzz.dev}/include"
+    "-system-pcre"
+    "-openssl-linked"
+    "-L" "${openssl.out}/lib"
+    "-I" "${openssl.dev}/include"
+    "-system-sqlite"
+    ''-${if libmysqlclient != null then "plugin" else "no"}-sql-mysql''
+    ''-${if postgresql != null then "plugin" else "no"}-sql-psql''
+
+    "-make libs"
+    "-make tools"
+    ''-${lib.optionalString (!buildExamples) "no"}make examples''
+    ''-${lib.optionalString (!buildTests) "no"}make tests''
+  ] ++ lib.optional (compareVersion "5.15.0" < 0) "-v"
+    ++ (
+      if stdenv.isDarwin then [
+      "-platform macx-clang"
+      "-no-fontconfig"
+      "-qt-freetype"
+      "-qt-libpng"
+      "-no-framework"
+    ] else [
+      "-${lib.optionalString (compareVersion "5.9.0" < 0) "no-"}rpath"
+    ] ++ lib.optional (compareVersion "5.15.0" < 0) "-system-xcb"
+      ++ [
+      "-xcb"
+      "-qpa xcb"
+      "-L" "${libX11.out}/lib"
+      "-I" "${libX11.out}/include"
+      "-L" "${libXext.out}/lib"
+      "-I" "${libXext.out}/include"
+      "-L" "${libXrender.out}/lib"
+      "-I" "${libXrender.out}/include"
+
+      "-libinput"
+
+      ''-${lib.optionalString (cups == null) "no-"}cups''
+      "-dbus-linked"
+      "-glib"
+    ] ++ lib.optional (compareVersion "5.15.0" < 0) "-system-libjpeg"
+      ++ [
+      "-system-libpng"
+    ] ++ lib.optional withGtk3 "-gtk"
+      ++ lib.optional (compareVersion "5.9.0" >= 0) "-inotify"
+      ++ lib.optionals (compareVersion "5.10.0" >= 0) [
+      # Without these, Qt stops working on kernels < 3.17. See:
+      # https://github.com/NixOS/nixpkgs/issues/38832
+      "-no-feature-renameat2"
+      "-no-feature-getentropy"
+    ] ++ lib.optionals (compareVersion "5.12.1" < 0) [
+      # use -xkbcommon and -xkbcommon-evdev for versions before 5.12.1
+      "-system-xkbcommon"
+      "-xkbcommon-evdev"
+    ] ++ lib.optionals (cups != null) [
+      "-L" "${cups.lib}/lib"
+      "-I" "${cups.dev}/include"
+    ] ++ lib.optionals (libmysqlclient != null) [
+      "-L" "${libmysqlclient}/lib"
+      "-I" "${libmysqlclient}/include"
+    ]
+  );
+
+  # Move selected outputs.
+  postInstall = ''
+    moveToOutput "mkspecs" "$dev"
+  '';
+
+  devTools = [
+    "bin/fixqt4headers.pl"
+    "bin/moc"
+    "bin/qdbuscpp2xml"
+    "bin/qdbusxml2cpp"
+    "bin/qlalr"
+    "bin/qmake"
+    "bin/rcc"
+    "bin/syncqt.pl"
+    "bin/uic"
+  ];
+
+  postFixup = ''
+    # Don't retain build-time dependencies like gdb.
+    sed '/QMAKE_DEFAULT_.*DIRS/ d' -i $dev/mkspecs/qconfig.pri
+    fixQtModulePaths "''${!outputDev}/mkspecs/modules"
+    fixQtBuiltinPaths "''${!outputDev}" '*.pr?'
+
+    # Move development tools to $dev
+    moveQtDevTools
+    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"
+  '';
+
+  dontStrip = debugSymbols;
+
+  setupHook = ../hooks/qtbase-setup-hook.sh;
+
+  meta = with lib; {
+    homepage = "https://www.qt.io/";
+    description = "A cross-platform application framework for C++";
+    license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ];
+    maintainers = with maintainers; [ qknight ttuegel periklis bkchr ];
+    platforms = platforms.unix;
+    broken = stdenv.isDarwin && (compareVersion "5.9.0" < 0);
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtcharts.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtcharts.nix
new file mode 100644
index 000000000000..f5d034bcc327
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtcharts.nix
@@ -0,0 +1,7 @@
+{ qtModule, qtbase, qtdeclarative }:
+
+qtModule {
+  pname = "qtcharts";
+  qtInputs = [ qtbase qtdeclarative ];
+  outputs = [ "out" "dev" "bin" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtconnectivity.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtconnectivity.nix
new file mode 100644
index 000000000000..ae3aa25427c8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtconnectivity.nix
@@ -0,0 +1,8 @@
+{ qtModule, lib, stdenv, qtbase, qtdeclarative, bluez }:
+
+qtModule {
+  pname = "qtconnectivity";
+  qtInputs = [ qtbase qtdeclarative ];
+  buildInputs = lib.optional stdenv.isLinux bluez;
+  outputs = [ "out" "dev" "bin" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtdeclarative.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtdeclarative.nix
new file mode 100644
index 000000000000..89f2672c26dd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtdeclarative.nix
@@ -0,0 +1,24 @@
+{ qtModule, lib, python3, qtbase, qtsvg }:
+
+qtModule {
+  pname = "qtdeclarative";
+  qtInputs = [ qtbase qtsvg ];
+  nativeBuildInputs = [ python3 ];
+  outputs = [ "out" "dev" "bin" ];
+  preConfigure = ''
+    NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QML2_IMPORT_PREFIX=\"$qtQmlPrefix\""
+  '';
+  configureFlags = lib.optionals (lib.versionAtLeast qtbase.version "5.11.0") [ "-qml-debug" ];
+  devTools = [
+    "bin/qml"
+    "bin/qmlcachegen"
+    "bin/qmleasing"
+    "bin/qmlimportscanner"
+    "bin/qmllint"
+    "bin/qmlmin"
+    "bin/qmlplugindump"
+    "bin/qmlprofiler"
+    "bin/qmlscene"
+    "bin/qmltestrunner"
+  ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtdoc.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtdoc.nix
new file mode 100644
index 000000000000..4ef4915000e5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtdoc.nix
@@ -0,0 +1,7 @@
+{ qtModule, qtdeclarative }:
+
+qtModule {
+  pname = "qtdoc";
+  qtInputs = [ qtdeclarative ];
+  outputs = [ "out" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtgamepad.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtgamepad.nix
new file mode 100644
index 000000000000..2e266060a341
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtgamepad.nix
@@ -0,0 +1,9 @@
+{ qtModule, qtbase, qtdeclarative, pkg-config }:
+
+qtModule {
+  pname = "qtgamepad";
+  qtInputs = [ qtbase qtdeclarative ];
+  buildInputs = [ ];
+  nativeBuildInputs = [ pkg-config ];
+  outputs = [ "out" "dev" "bin" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtgraphicaleffects.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtgraphicaleffects.nix
new file mode 100644
index 000000000000..c90280090b8e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtgraphicaleffects.nix
@@ -0,0 +1,7 @@
+{ qtModule, qtdeclarative }:
+
+qtModule {
+  pname = "qtgraphicaleffects";
+  qtInputs = [ qtdeclarative ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtimageformats.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtimageformats.nix
new file mode 100644
index 000000000000..52fa4d4ba8ff
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtimageformats.nix
@@ -0,0 +1,7 @@
+{ qtModule, qtbase, libtiff }:
+
+qtModule {
+  pname = "qtimageformats";
+  qtInputs = [ qtbase ];
+  propagatedBuildInputs = [ libtiff ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtlocation.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtlocation.nix
new file mode 100644
index 000000000000..687571f18d29
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtlocation.nix
@@ -0,0 +1,13 @@
+{ lib, stdenv, qtModule, qtbase, qtmultimedia }:
+
+qtModule {
+  pname = "qtlocation";
+  qtInputs = [ qtbase qtmultimedia ];
+  outputs = [ "bin" "out" "dev" ];
+  qmakeFlags = lib.optional stdenv.isDarwin [
+     # boost uses std::auto_ptr which has been disabled in clang with libcxx
+     # This flag re-enables this feature
+     # https://libcxx.llvm.org/docs/UsingLibcxx.html#c-17-specific-configuration-macros
+     "QMAKE_CXXFLAGS+=-D_LIBCPP_ENABLE_CXX17_REMOVED_AUTO_PTR"
+  ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtmacextras.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtmacextras.nix
new file mode 100644
index 000000000000..30e363cff59a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtmacextras.nix
@@ -0,0 +1,10 @@
+{ lib, qtModule, qtbase }:
+
+qtModule {
+  pname = "qtmacextras";
+  qtInputs = [ qtbase ];
+  meta = with lib; {
+    maintainers = with maintainers; [ periklis ];
+    platforms = platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix
new file mode 100644
index 000000000000..baf5c30e73c4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix
@@ -0,0 +1,24 @@
+{ qtModule
+, lib
+, stdenv
+, qtbase
+, qtdeclarative
+, pkg-config
+, alsa-lib
+, gstreamer
+, gst-plugins-base
+, libpulseaudio
+, wayland
+}:
+
+qtModule {
+  pname = "qtmultimedia";
+  qtInputs = [ qtbase qtdeclarative ];
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ gstreamer gst-plugins-base libpulseaudio ]
+    ++ lib.optional (stdenv.isLinux) alsa-lib
+    ++ lib.optional (lib.versionAtLeast qtbase.version "5.14.0" && stdenv.isLinux) wayland;
+  outputs = [ "bin" "dev" "out" ];
+  qmakeFlags = [ "GST_VERSION=1.0" ];
+  NIX_LDFLAGS = lib.optionalString (stdenv.isDarwin) "-lobjc";
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtnetworkauth.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtnetworkauth.nix
new file mode 100644
index 000000000000..148ed890fc9e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtnetworkauth.nix
@@ -0,0 +1,6 @@
+{ qtModule, qtbase }:
+
+qtModule {
+  pname = "qtnetworkauth";
+  qtInputs = [ qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtquickcontrols.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtquickcontrols.nix
new file mode 100644
index 000000000000..6c85a91fb78c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtquickcontrols.nix
@@ -0,0 +1,6 @@
+{ qtModule, qtdeclarative }:
+
+qtModule {
+  pname = "qtquickcontrols";
+  qtInputs = [ qtdeclarative ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtquickcontrols2.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtquickcontrols2.nix
new file mode 100644
index 000000000000..a50ad9e2a304
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtquickcontrols2.nix
@@ -0,0 +1,7 @@
+{ qtModule, qtdeclarative }:
+
+qtModule {
+  pname = "qtquickcontrols2";
+  qtInputs = [ qtdeclarative ];
+  outputs = [ "out" "dev" "bin" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtscript.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtscript.nix
new file mode 100644
index 000000000000..e7ce86b74a68
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtscript.nix
@@ -0,0 +1,6 @@
+{ qtModule, qtbase, qttools }:
+
+qtModule {
+  pname = "qtscript";
+  qtInputs = [ qtbase qttools ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtscxml.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtscxml.nix
new file mode 100644
index 000000000000..cf9af0bc7543
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtscxml.nix
@@ -0,0 +1,7 @@
+{ qtModule, qtbase, qtdeclarative }:
+
+qtModule {
+  pname = "qtscxml";
+  qtInputs = [ qtbase qtdeclarative ];
+  outputs = [ "out" "dev" "bin" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtsensors.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtsensors.nix
new file mode 100644
index 000000000000..3fbd032b968f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtsensors.nix
@@ -0,0 +1,7 @@
+{ qtModule, qtbase, qtdeclarative }:
+
+qtModule {
+  pname = "qtsensors";
+  qtInputs = [ qtbase qtdeclarative ];
+  outputs = [ "out" "dev" "bin" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtserialbus.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtserialbus.nix
new file mode 100644
index 000000000000..4fd6d7cb83c3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtserialbus.nix
@@ -0,0 +1,6 @@
+{ qtModule, qtbase, qtserialport }:
+
+qtModule {
+  pname = "qtserialbus";
+  qtInputs = [ qtbase qtserialport ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtserialport.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtserialport.nix
new file mode 100644
index 000000000000..89d96eb29124
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtserialport.nix
@@ -0,0 +1,7 @@
+{ qtModule, stdenv, lib, qtbase, systemd }:
+
+qtModule {
+  pname = "qtserialport";
+  qtInputs = [ qtbase ];
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isLinux "-DNIXPKGS_LIBUDEV=\"${lib.getLib systemd}/lib/libudev\"";
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtspeech.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtspeech.nix
new file mode 100644
index 000000000000..d2748ba8d4c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtspeech.nix
@@ -0,0 +1,7 @@
+{ qtModule }:
+
+qtModule {
+  pname = "qtspeech";
+  qtInputs = [ ];
+  outputs = [ "out" "dev" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtsvg.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtsvg.nix
new file mode 100644
index 000000000000..59c7cf67448c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtsvg.nix
@@ -0,0 +1,7 @@
+{ qtModule, qtbase }:
+
+qtModule {
+  pname = "qtsvg";
+  qtInputs = [ qtbase ];
+  outputs = [ "out" "dev" "bin" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qttools.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qttools.nix
new file mode 100644
index 000000000000..27008f6714ed
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qttools.nix
@@ -0,0 +1,42 @@
+{ qtModule, stdenv, lib, qtbase, qtdeclarative }:
+
+qtModule {
+  pname = "qttools";
+  qtInputs = [ qtbase qtdeclarative ];
+  outputs = [ "out" "dev" "bin" ];
+
+  # fixQtBuiltinPaths overwrites a builtin path we should keep
+  postPatch = ''
+    sed -i "src/linguist/linguist.pro" \
+        -e '/^cmake_linguist_config_version_file.input =/ s|$$\[QT_HOST_DATA.*\]|${lib.getDev qtbase}|'
+    sed -i "src/qtattributionsscanner/qtattributionsscanner.pro" \
+        -e '/^cmake_qattributionsscanner_config_version_file.input =/ s|$$\[QT_HOST_DATA.*\]|${lib.getDev qtbase}|'
+  '';
+
+  devTools = [
+    "bin/qcollectiongenerator"
+    "bin/linguist"
+    "bin/assistant"
+    "bin/qdoc"
+    "bin/lconvert"
+    "bin/designer"
+    "bin/qtattributionsscanner"
+    "bin/lrelease"
+    "bin/lrelease-pro"
+    "bin/pixeltool"
+    "bin/lupdate"
+    "bin/lupdate-pro"
+    "bin/qtdiag"
+    "bin/qhelpgenerator"
+    "bin/qtplugininfo"
+    "bin/qthelpconverter"
+    "bin/lprodump"
+    "bin/qdistancefieldgenerator"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "bin/macdeployqt"
+  ];
+
+  NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin ''-DNIXPKGS_QMLIMPORTSCANNER="${qtdeclarative.dev}/bin/qmlimportscanner"'';
+
+  setupHook = ../hooks/qttools-setup-hook.sh;
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qttranslations.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qttranslations.nix
new file mode 100644
index 000000000000..f49a4eb9a85d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qttranslations.nix
@@ -0,0 +1,6 @@
+{ qtModule, qttools }:
+
+qtModule {
+  pname = "qttranslations";
+  qtInputs = [ qttools ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtvirtualkeyboard.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtvirtualkeyboard.nix
new file mode 100644
index 000000000000..77f1948dbf43
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtvirtualkeyboard.nix
@@ -0,0 +1,6 @@
+{ qtModule, qtbase, qtdeclarative, qtsvg, hunspell  }:
+
+qtModule {
+  pname = "qtvirtualkeyboard";
+  qtInputs = [ qtbase qtdeclarative qtsvg hunspell ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwayland.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwayland.nix
new file mode 100644
index 000000000000..1bd1adedaf04
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwayland.nix
@@ -0,0 +1,9 @@
+{ qtModule, qtbase, qtquickcontrols, wayland, pkg-config }:
+
+qtModule {
+  pname = "qtwayland";
+  qtInputs = [ qtbase qtquickcontrols ];
+  buildInputs = [ wayland ];
+  nativeBuildInputs = [ pkg-config ];
+  outputs = [ "out" "dev" "bin" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebchannel.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebchannel.nix
new file mode 100644
index 000000000000..f49e9e234901
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebchannel.nix
@@ -0,0 +1,8 @@
+{ qtModule, qtbase, qtdeclarative }:
+
+qtModule {
+  pname = "qtwebchannel";
+  qtInputs = [ qtbase qtdeclarative ];
+  outputs = [ "out" "dev" "bin" ];
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
new file mode 100644
index 000000000000..03247487749a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
@@ -0,0 +1,243 @@
+{ qtModule
+, qtdeclarative, qtquickcontrols, qtlocation, qtwebchannel
+
+, bison, coreutils, flex, git, gperf, ninja, pkg-config, python2, which
+, nodejs, qtbase, perl
+
+, xorg, libXcursor, libXScrnSaver, libXrandr, libXtst
+, fontconfig, freetype, harfbuzz, icu, dbus, libdrm
+, zlib, minizip, libjpeg, libpng, libtiff, libwebp, libopus
+, jsoncpp, protobuf, libvpx, srtp, snappy, nss, libevent
+, alsa-lib
+, libcap
+, pciutils
+, systemd
+, pipewire_0_2
+, enableProprietaryCodecs ? true
+, gn
+, cctools, libobjc, libunwind, sandbox, xnu
+, ApplicationServices, AVFoundation, Foundation, ForceFeedback, GameController, AppKit
+, ImageCaptureCore, CoreBluetooth, IOBluetooth, CoreWLAN, Quartz, Cocoa, LocalAuthentication
+, cups, openbsm, runCommand, xcbuild, writeScriptBin
+, ffmpeg ? null
+, lib, stdenv, fetchpatch
+, version ? null
+, qtCompatVersion
+}:
+
+qtModule {
+  pname = "qtwebengine";
+  qtInputs = [ qtdeclarative qtquickcontrols qtlocation qtwebchannel ];
+  nativeBuildInputs = [
+    bison coreutils flex git gperf ninja pkg-config python2 which gn nodejs
+  ] ++ lib.optional stdenv.isDarwin xcbuild;
+  doCheck = true;
+  outputs = [ "bin" "dev" "out" ];
+
+  enableParallelBuilding = true;
+
+  # Don’t use the gn setup hook
+  dontUseGnConfigure = true;
+
+  # ninja builds some components with -Wno-format,
+  # which cannot be set at the same time as -Wformat-security
+  hardeningDisable = [ "format" ];
+
+  postPatch = ''
+    # Patch Chromium build tools
+    (
+      cd src/3rdparty/chromium;
+
+      # Manually fix unsupported shebangs
+      substituteInPlace third_party/harfbuzz-ng/src/src/update-unicode-tables.make \
+        --replace "/usr/bin/env -S make -f" "/usr/bin/make -f" || true
+
+      # TODO: be more precise
+      patchShebangs .
+    )
+  ''
+  # Prevent Chromium build script from making the path to `clang` relative to
+  # the build directory.  `clang_base_path` is the value of `QMAKE_CLANG_DIR`
+  # from `src/core/config/mac_osx.pri`.
+  + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace ./src/3rdparty/chromium/build/toolchain/mac/BUILD.gn \
+      --replace 'prefix = rebase_path("$clang_base_path/bin/", root_build_dir)' 'prefix = "$clang_base_path/bin/"'
+  ''
+  # Patch library paths in Qt sources
+  + ''
+    sed -i \
+      -e "s,QLibraryInfo::location(QLibraryInfo::DataPath),QLatin1String(\"$out\"),g" \
+      -e "s,QLibraryInfo::location(QLibraryInfo::TranslationsPath),QLatin1String(\"$out/translations\"),g" \
+      -e "s,QLibraryInfo::location(QLibraryInfo::LibraryExecutablesPath),QLatin1String(\"$out/libexec\"),g" \
+      src/core/web_engine_library_info.cpp
+  ''
+  # Patch library paths in Chromium sources
+  + lib.optionalString (!stdenv.isDarwin) ''
+    sed -i -e '/lib_loader.*Load/s!"\(libudev\.so\)!"${lib.getLib systemd}/lib/\1!' \
+      src/3rdparty/chromium/device/udev_linux/udev?_loader.cc
+
+    sed -i -e '/libpci_loader.*Load/s!"\(libpci\.so\)!"${pciutils}/lib/\1!' \
+      src/3rdparty/chromium/gpu/config/gpu_info_collector_linux.cc
+  '' + lib.optionalString stdenv.isDarwin (
+  (if (lib.versionAtLeast qtCompatVersion "5.14") then ''
+    substituteInPlace src/buildtools/config/mac_osx.pri \
+      --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"'
+  '' else ''
+    substituteInPlace src/core/config/mac_osx.pri \
+      --replace 'QMAKE_CLANG_DIR = "/usr"' 'QMAKE_CLANG_DIR = "${stdenv.cc}"'
+  '')
+   # Following is required to prevent a build error:
+   # ninja: error: '/nix/store/z8z04p0ph48w22rqzx7ql67gy8cyvidi-SDKs/MacOSX10.12.sdk/usr/include/mach/exc.defs', needed by 'gen/third_party/crashpad/crashpad/util/mach/excUser.c', missing and no known rule to make it
+  + ''
+    substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/BUILD.gn \
+      --replace '$sysroot/usr' "${xnu}"
+  ''
+  # Apple has some secret stuff they don't share with OpenBSM
+  + (if (lib.versionAtLeast qtCompatVersion "5.14") then ''
+  substituteInPlace src/3rdparty/chromium/base/mac/mach_port_rendezvous.cc \
+    --replace "audit_token_to_pid(request.trailer.msgh_audit)" "request.trailer.msgh_audit.val[5]"
+  substituteInPlace src/3rdparty/chromium/third_party/crashpad/crashpad/util/mach/mach_message.cc \
+    --replace "audit_token_to_pid(audit_trailer->msgh_audit)" "audit_trailer->msgh_audit.val[5]"
+  '' else ''
+  substituteInPlace src/3rdparty/chromium/base/mac/mach_port_broker.mm \
+    --replace "audit_token_to_pid(msg.trailer.msgh_audit)" "msg.trailer.msgh_audit.val[5]"
+  ''));
+
+  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.gcc.arch or "" == "sandybridge") [
+    # it fails when compiled with -march=sandybridge https://github.com/NixOS/nixpkgs/pull/59148#discussion_r276696940
+    # TODO: investigate and fix properly
+    "-march=westmere"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "-DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_12"
+    "-DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_12"
+
+    #
+    # Prevent errors like
+    # /nix/store/xxx-apple-framework-CoreData/Library/Frameworks/CoreData.framework/Headers/NSEntityDescription.h:51:7:
+    # error: pointer to non-const type 'id' with no explicit ownership
+    #     id** _kvcPropertyAccessors;
+    #
+    # TODO remove when new Apple SDK is in
+    #
+    "-fno-objc-arc"
+  ];
+
+  preConfigure = ''
+    export NINJAFLAGS=-j$NIX_BUILD_CORES
+
+    if [ -d "$PWD/tools/qmake" ]; then
+        QMAKEPATH="$PWD/tools/qmake''${QMAKEPATH:+:}$QMAKEPATH"
+    fi
+  '';
+
+  qmakeFlags = [ "--" "-system-ffmpeg" ]
+    ++ lib.optional (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) "-webengine-webrtc-pipewire"
+    ++ lib.optional enableProprietaryCodecs "-proprietary-codecs";
+
+  propagatedBuildInputs = [
+    # Image formats
+    libjpeg libpng libtiff libwebp
+
+    # Video formats
+    srtp libvpx
+
+    # Audio formats
+    libopus
+
+    # Text rendering
+    harfbuzz icu
+
+    libevent
+    ffmpeg
+  ] ++ lib.optionals (!stdenv.isDarwin) [
+    dbus zlib minizip snappy nss protobuf jsoncpp
+
+    # Audio formats
+    alsa-lib
+
+    # Text rendering
+    fontconfig freetype
+
+    libcap
+    pciutils
+
+    # X11 libs
+    xorg.xrandr libXScrnSaver libXcursor libXrandr xorg.libpciaccess libXtst
+    xorg.libXcomposite xorg.libXdamage libdrm xorg.libxkbfile
+
+  ] ++ lib.optionals (stdenv.isLinux && (lib.versionAtLeast qtCompatVersion "5.15")) [
+    # Pipewire
+    pipewire_0_2
+  ]
+
+  # FIXME These dependencies shouldn't be needed but can't find a way
+  # around it. Chromium pulls this in while bootstrapping GN.
+  ++ lib.optionals stdenv.isDarwin [
+    libobjc
+    cctools
+
+    # frameworks
+    ApplicationServices
+    AVFoundation
+    Foundation
+    ForceFeedback
+    GameController
+    AppKit
+    ImageCaptureCore
+    CoreBluetooth
+    IOBluetooth
+    CoreWLAN
+    Quartz
+    Cocoa
+    LocalAuthentication
+
+    openbsm
+    libunwind
+  ];
+
+  buildInputs = lib.optionals stdenv.isDarwin [
+    cups
+    sandbox
+
+    # `sw_vers` is used by `src/3rdparty/chromium/build/config/mac/sdk_info.py`
+    # to get some information about the host platform.
+    (writeScriptBin "sw_vers" ''
+      #!${stdenv.shell}
+
+      while [ $# -gt 0 ]; do
+        case "$1" in
+          -buildVersion) echo "17E199";;
+        *) break ;;
+
+        esac
+        shift
+      done
+    '')
+  ];
+
+  dontUseNinjaBuild = true;
+  dontUseNinjaInstall = true;
+
+  postInstall = lib.optionalString stdenv.isLinux ''
+    cat > $out/libexec/qt.conf <<EOF
+    [Paths]
+    Prefix = ..
+    EOF
+  '' + lib.optionalString (lib.versions.majorMinor qtCompatVersion == "5.15") ''
+    # Fix for out-of-sync QtWebEngine and Qt releases (since 5.15.3)
+    sed 's/${lib.head (lib.splitString "-" version)} /${qtCompatVersion} /' -i "$out"/lib/cmake/*/*Config.cmake
+  '';
+
+  requiredSystemFeatures = [ "big-parallel" ];
+
+  meta = with lib; {
+    description = "A web engine based on the Chromium web browser";
+    maintainers = with maintainers; [ matthewbauer ];
+    platforms = platforms.unix;
+    # This build takes a long time; particularly on slow architectures
+    timeout = 24 * 3600;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebglplugin.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebglplugin.nix
new file mode 100644
index 000000000000..d8fd7a692370
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebglplugin.nix
@@ -0,0 +1,6 @@
+{ qtModule, qtbase, qtwebsockets }:
+
+qtModule {
+  pname = "qtwebglplugin";
+  qtInputs = [ qtbase qtwebsockets ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebkit.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
new file mode 100644
index 000000000000..dc9f5ccb9eb2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
@@ -0,0 +1,73 @@
+{ qtModule, stdenv, lib, fetchurl
+, qtbase, qtdeclarative, qtlocation, qtmultimedia, qtsensors, qtwebchannel
+, fontconfig, libwebp, libxml2, libxslt
+, sqlite, systemd, glib, gst_all_1, cmake
+, bison, flex, gdb, gperf, perl, pkg-config, python2, ruby
+, ICU, OpenGL
+}:
+
+let
+  hyphen = stdenv.mkDerivation rec {
+    pname = "hyphen";
+    version = "2.8.8";
+    src = fetchurl {
+      url = "http://dev-www.libreoffice.org/src/5ade6ae2a99bc1e9e57031ca88d36dad-hyphen-${version}.tar.gz";
+      sha256 = "304636d4eccd81a14b6914d07b84c79ebb815288c76fe027b9ebff6ff24d5705";
+    };
+    postPatch = ''
+      patchShebangs tests
+    '';
+    buildInputs = [ perl ];
+  };
+  usingAnnulenWebkitFork = lib.versionAtLeast qtbase.version "5.11.0";
+in
+qtModule {
+  pname = "qtwebkit";
+  qtInputs = [ qtbase qtdeclarative qtlocation qtsensors ]
+    ++ lib.optional (stdenv.isDarwin && lib.versionAtLeast qtbase.version "5.9.0") qtmultimedia
+    ++ lib.optional usingAnnulenWebkitFork qtwebchannel;
+  buildInputs = [ fontconfig libwebp libxml2 libxslt sqlite glib gst_all_1.gstreamer gst_all_1.gst-plugins-base ]
+    ++ lib.optionals stdenv.isDarwin [ ICU OpenGL ]
+    ++ lib.optional usingAnnulenWebkitFork hyphen;
+  nativeBuildInputs = [
+    bison flex gdb gperf perl pkg-config python2 ruby
+  ] ++ lib.optional usingAnnulenWebkitFork cmake;
+
+  cmakeFlags = lib.optionals usingAnnulenWebkitFork ([ "-DPORT=Qt" ]
+    ++ lib.optionals stdenv.isDarwin [
+      "-DQt5Multimedia_DIR=${lib.getDev qtmultimedia}/lib/cmake/Qt5Multimedia"
+      "-DQt5MultimediaWidgets_DIR=${lib.getDev qtmultimedia}/lib/cmake/Qt5MultimediaWidgets"
+      "-DMACOS_FORCE_SYSTEM_XML_LIBRARIES=OFF"
+    ]);
+
+  # QtWebKit overrides qmake's default_pre and default_post features,
+  # so its custom qmake files must be found first at the front of QMAKEPATH.
+  preConfigure = lib.optionalString (!usingAnnulenWebkitFork) ''
+    QMAKEPATH="$PWD/Tools/qmake''${QMAKEPATH:+:}$QMAKEPATH"
+    fixQtBuiltinPaths . '*.pr?'
+    # Fix hydra's "Log limit exceeded"
+    export qmakeFlags="$qmakeFlags CONFIG+=silent"
+  '';
+
+  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
+  ++ lib.optional stdenv.cc.isGNU "-Wno-class-memaccess"
+  # with clang this warning blows the log over Hydra's limit
+  ++ lib.optional stdenv.isDarwin "-Wno-inconsistent-missing-override"
+  ++ lib.optional (!stdenv.isDarwin) ''-DNIXPKGS_LIBUDEV="${lib.getLib systemd}/lib/libudev"'';
+
+  doCheck = false; # fails 13 out of 13 tests (ctest)
+
+  # Hack to avoid TMPDIR in RPATHs.
+  preFixup = ''
+    rm -rf "$(pwd)"
+    mkdir "$(pwd)"
+  '';
+
+  meta = {
+    maintainers = with lib.maintainers; [ abbradar periklis ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebsockets.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebsockets.nix
new file mode 100644
index 000000000000..540fcade73c9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebsockets.nix
@@ -0,0 +1,7 @@
+{ qtModule, qtbase, qtdeclarative }:
+
+qtModule {
+  pname = "qtwebsockets";
+  qtInputs = [ qtbase qtdeclarative ];
+  outputs = [ "out" "dev" "bin" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebview.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebview.nix
new file mode 100644
index 000000000000..14f7937a2e24
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebview.nix
@@ -0,0 +1,12 @@
+{ lib, stdenv, qtModule, qtdeclarative, qtwebengine, CoreFoundation, WebKit }:
+
+qtModule {
+  pname = "qtwebview";
+  qtInputs = [ qtdeclarative qtwebengine ];
+  buildInputs = lib.optional stdenv.isDarwin [
+    CoreFoundation
+    WebKit
+  ];
+  outputs = [ "out" "dev" "bin" ];
+  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework CoreFoundation -framework WebKit";
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtx11extras.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtx11extras.nix
new file mode 100644
index 000000000000..ad743523bb00
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtx11extras.nix
@@ -0,0 +1,6 @@
+{ qtModule, qtbase }:
+
+qtModule {
+  pname = "qtx11extras";
+  qtInputs = [ qtbase ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtxmlpatterns.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtxmlpatterns.nix
new file mode 100644
index 000000000000..c602b1e39d2d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtxmlpatterns.nix
@@ -0,0 +1,7 @@
+{ qtModule, qtbase, qtdeclarative }:
+
+qtModule {
+  pname = "qtxmlpatterns";
+  qtInputs = [ qtbase qtdeclarative ];
+  devTools = [ "bin/xmlpatterns" "bin/xmlpatternsvalidator" ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/qt-env.nix b/nixpkgs/pkgs/development/libraries/qt-5/qt-env.nix
new file mode 100644
index 000000000000..b4a201c08cc4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/qt-env.nix
@@ -0,0 +1,21 @@
+{ buildEnv, qtbase }: name: paths:
+
+buildEnv {
+  inherit name;
+  paths = [ qtbase ] ++ paths;
+
+  pathsToLink = [ "/bin" "/mkspecs" "/include" "/lib" "/share" ];
+  extraOutputsToInstall = [ "out" "dev" ];
+
+  postBuild = ''
+    rm "$out/bin/qmake"
+    cp "${qtbase.dev}/bin/qmake" "$out/bin"
+    cat >"$out/bin/qt.conf" <<EOF
+    [Paths]
+    Prefix = $out
+    Plugins = ${qtbase.qtPluginPrefix}
+    Qml2Imports = ${qtbase.qtQmlPrefix}
+    Documentation = ${qtbase.qtDocPrefix}
+    EOF
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/qtModule.nix b/nixpkgs/pkgs/development/libraries/qt-5/qtModule.nix
new file mode 100644
index 000000000000..767cbc91142d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-5/qtModule.nix
@@ -0,0 +1,60 @@
+{ lib, mkDerivation, perl }:
+
+let inherit (lib) licenses maintainers platforms; in
+
+{ self, srcs, patches }:
+
+args:
+
+let
+  inherit (args) pname;
+  version = args.version or srcs.${pname}.version;
+  src = args.src or srcs.${pname}.src;
+in
+
+mkDerivation (args // {
+  inherit pname version src;
+  patches = args.patches or patches.${pname} or [];
+
+  nativeBuildInputs = (args.nativeBuildInputs or []) ++ [ perl self.qmake ];
+  propagatedBuildInputs = args.qtInputs ++ (args.propagatedBuildInputs or []);
+
+  outputs = args.outputs or [ "out" "dev" ];
+  setOutputFlags = args.setOutputFlags or false;
+
+  preHook = ''
+    . ${./hooks/move-qt-dev-tools.sh}
+    . ${./hooks/fix-qt-builtin-paths.sh}
+  '';
+
+  preConfigure = ''
+    ${args.preConfigure or ""}
+
+    fixQtBuiltinPaths . '*.pr?'
+  '';
+
+  dontWrapQtApps = args.dontWrapQtApps or true;
+
+  postFixup = ''
+    if [ -d "''${!outputDev}/lib/pkgconfig" ]; then
+        find "''${!outputDev}/lib/pkgconfig" -name '*.pc' | while read pc; do
+            sed -i "$pc" \
+                -e "/^prefix=/ c prefix=''${!outputLib}" \
+                -e "/^exec_prefix=/ c exec_prefix=''${!outputBin}" \
+                -e "/^includedir=/ c includedir=''${!outputDev}/include"
+        done
+    fi
+
+    moveQtDevTools
+
+    ${args.postFixup or ""}
+  '';
+
+  meta = {
+    homepage = "http://www.qt.io";
+    description = "A cross-platform application framework for C++";
+    license = with licenses; [ fdl13 gpl2 lgpl21 lgpl3 ];
+    maintainers = with maintainers; [ qknight ttuegel periklis bkchr ];
+    platforms = platforms.unix;
+  } // (args.meta or {});
+})
diff --git a/nixpkgs/pkgs/development/libraries/qt-mobility/default.nix b/nixpkgs/pkgs/development/libraries/qt-mobility/default.nix
new file mode 100644
index 000000000000..60c1d2754d70
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qt-mobility/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv, fetchFromGitHub, qt4, libX11, coreutils, bluez, perl }:
+# possible additional dependencies: pulseaudio udev networkmanager immerson qmf
+
+stdenv.mkDerivation rec {
+  version = "1.2.0";
+  pname = "qt-mobility";
+  src = fetchFromGitHub {
+    owner = "qtproject";
+    repo = "qt-mobility";
+    rev = "v${version}";
+    sha256 = "14713pbscysd6d0b9rgm7gg145jzwvgdn22778pf2v13qzvfmy1i";
+  };
+
+  NIX_CFLAGS_COMPILE="-fpermissive";
+
+  configurePhase = ''
+    ./configure -prefix $out
+  '';
+
+  # we need to prevent the 'make install' to want to write to ${qt4}!
+  # according to thiago#qt@freenode these are used for the QML engine
+  preBuild = ''
+    for i in connectivity contacts feedback gallery location multimedia organizer publishsubscribe sensors serviceframework systeminfo; do
+      substituteInPlace plugins/declarative/$i/Makefile --replace "${qt4}/lib/qt4/imports/" "$out/lib/qt4/imports/"
+    done
+  '';
+
+  # Features files (*.prf) are not installed on nixos
+  # https://bugreports.qt-project.org/browse/QTMOBILITY-1085
+  #  - features/mobility.prf (/tmp/nix-build-9kh12nhf9cyplfwiws96gz414v6wgl67-qt-mobility-1.2.0.drv-0/qt-mobility-opensource-src-1.2.0)
+
+  patchPhase = ''
+    # required to make the configure script work
+    substituteInPlace configure --replace "/bin/pwd" "${coreutils}/bin/pwd"
+
+    # required to make /include generator work
+    substituteInPlace bin/syncheaders --replace "/usr/bin/perl" "${perl}/bin/perl"
+
+    # required to make the -prefix variable parsing work
+    substituteInPlace bin/pathhelper --replace "/usr/bin/perl" "${perl}/bin/perl"
+  '';
+
+  buildInputs = [ qt4 libX11 bluez perl ];
+
+  meta = with lib; {
+    description = "Qt Mobility";
+    homepage = "http://qt.nokia.com/products/qt-addons/mobility";
+    maintainers = [ maintainers.qknight ];
+    platforms = platforms.linux;
+    license = with licenses; [ bsd3 fdl13 gpl3 lgpl21 ];
+  };
+}
+
+
diff --git a/nixpkgs/pkgs/development/libraries/qtfeedback/default.nix b/nixpkgs/pkgs/development/libraries/qtfeedback/default.nix
new file mode 100644
index 000000000000..a329ece074ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qtfeedback/default.nix
@@ -0,0 +1,48 @@
+{ lib
+, mkDerivation
+, fetchFromGitHub
+, perl
+, qmake
+, qtbase
+, qtdeclarative
+}:
+
+mkDerivation rec {
+  pname = "qtfeedback";
+  version = "unstable-2018-09-03";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "qt";
+    repo = "qtfeedback";
+    rev = "a14bd0bb1373cde86e09e3619fb9dc70f34c71f2";
+    sha256 = "0kiiffvriagql1cark6g1qxy7l9c3q3s13cx3s2plbz19nlnikj7";
+  };
+
+  nativeBuildInputs = [
+    perl
+    qmake
+  ];
+
+  buildInputs = [
+    qtdeclarative
+  ];
+
+  qmakeFlags = [ "CONFIG+=git_build" ];
+
+  doCheck = true;
+
+  postFixup = ''
+    # Drop QMAKE_PRL_BUILD_DIR because it references the build dir
+    find "$out/lib" -type f -name '*.prl' \
+      -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \;
+  '';
+
+  meta = with lib; {
+    description = "Qt Tactile Feedback";
+    homepage = "https://github.com/qt/qtfeedback";
+    license = with licenses; [ lgpl3Only /* or */ gpl2Plus ];
+    maintainers = with maintainers; [ dotlambda OPNA2608 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qtinstaller/default.nix b/nixpkgs/pkgs/development/libraries/qtinstaller/default.nix
new file mode 100644
index 000000000000..0fd21a1a2968
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qtinstaller/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, fetchurl, qtdeclarative , qttools, qtbase, qmake }:
+
+stdenv.mkDerivation rec {
+  pname = "qtinstaller";
+
+  propagatedBuildInputs = [ qtdeclarative qttools ];
+  nativeBuildInputs = [ qmake ];
+
+  version = "2.0.3";
+  src = fetchurl {
+    url = "http://download.qt.io/official_releases/qt-installer-framework/${version}/qt-installer-framework-opensource-${version}-src.tar.gz";
+    sha256 = "003gwjg02isw8qjyka377g1ahlisfyi44l6xfa4hvvdgqqq0hy2f";
+    name = "qt-installer-framework-opensource-src-${version}.tar.gz";
+  };
+
+  outputs = [ "out" "dev" "doc" ];
+
+  setOutputFlags = false;
+  NIX_QT_SUBMODULE = true;
+  dontWrapQtApps = true;
+
+  installPhase = ''
+    mkdir -p $out/{bin,lib,share/qt-installer-framework}
+    cp -a bin/{archivegen,binarycreator,devtool,installerbase,repogen} $out/bin
+    cp -a lib/{libinstaller.so*,lib7z.a} $out/lib
+    cp -a examples $out/share/qt-installer-framework/
+  '';
+
+  postFixup = ''
+    moveToOutput "bin/archivegen" "$out"
+    moveToOutput "bin/binarycreator" "$out"
+    moveToOutput "bin/devtool" "$out"
+    moveToOutput "bin/installerbase" "$out"
+    moveToOutput "bin/repogen" "$out"
+    moveToOutput "share" "$doc"
+    moveToOutput "lib/libinstaller.so" "$out"
+    moveToOutput "lib/libinstaller.so.1" "$out"
+    moveToOutput "lib/libinstaller.so.1.0" "$out"
+    moveToOutput "lib/libinstaller.so.1.0.0" "$out"
+  '';
+
+  meta = {
+    description = "Qt installer framework";
+    inherit (qtbase.meta) platforms license homepage;
+  };
+}
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
new file mode 100644
index 000000000000..0d3528e92f8a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qtkeychain/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, qtbase, qttools
+, CoreFoundation, Security
+, libsecret
+}:
+
+stdenv.mkDerivation rec {
+  pname = "qtkeychain";
+  version = "0.12.0";            # verify after nix-build with `grep -R "set(PACKAGE_VERSION " result/`
+
+  src = fetchFromGitHub {
+    owner = "frankosterfeld";
+    repo = "qtkeychain";
+    rev = "v${version}";
+    sha256 = "0gi1nx4bcc1vwfw41cif3xi2i59229vy0kc2r5959d8n6yv31kfr"; # v0.9.1
+  };
+
+  dontWrapQtApps = true;
+
+  patches = [ ./0002-Fix-install-name-Darwin.patch ];
+
+  cmakeFlags = [ "-DQT_TRANSLATIONS_DIR=share/qt/translations" ];
+
+  nativeBuildInputs = [ cmake ]
+    ++ lib.optionals (!stdenv.isDarwin) [ pkg-config ] # for finding libsecret
+  ;
+
+  buildInputs = lib.optionals (!stdenv.isDarwin) [ libsecret ]
+    ++ [ qtbase qttools ]
+    ++ lib.optionals stdenv.isDarwin [
+      CoreFoundation Security
+    ]
+  ;
+
+  meta = {
+    description = "Platform-independent Qt API for storing passwords securely";
+    homepage = "https://github.com/frankosterfeld/qtkeychain";
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qtpbfimageplugin/default.nix b/nixpkgs/pkgs/development/libraries/qtpbfimageplugin/default.nix
new file mode 100644
index 000000000000..9dbc2491ad95
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qtpbfimageplugin/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchFromGitHub, qmake, qtbase, protobuf }:
+
+stdenv.mkDerivation rec {
+  pname = "qtpbfimageplugin";
+  version = "2.3";
+
+  src = fetchFromGitHub {
+    owner = "tumic0";
+    repo = "QtPBFImagePlugin";
+    rev = version;
+    sha256 = "063agzcrcihasqqk2yqxqxg9xknjs99y6vx3n1v7md7dqnfv4iva";
+  };
+
+  nativeBuildInputs = [ qmake ];
+  buildInputs = [ qtbase protobuf ];
+
+  dontWrapQtApps = true;
+
+  postPatch = ''
+    # Fix plugin dir
+    substituteInPlace pbfplugin.pro \
+      --replace "\$\$[QT_INSTALL_PLUGINS]" "$out/$qtPluginPrefix"
+  '' + lib.optionalString stdenv.isDarwin ''
+    # Fix darwin build
+    substituteInPlace pbfplugin.pro \
+      --replace '$$PROTOBUF/lib/libprotobuf-lite.a' '${protobuf}/lib/libprotobuf-lite.dylib'
+  '';
+
+  meta = with lib; {
+    description = "Qt image plugin for displaying Mapbox vector tiles";
+    longDescription = ''
+      QtPBFImagePlugin is a Qt image plugin that enables applications capable of
+      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";
+    license = licenses.lgpl3Only;
+    maintainers = with maintainers; [ sikmir ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qtscriptgenerator/default.nix b/nixpkgs/pkgs/development/libraries/qtscriptgenerator/default.nix
new file mode 100644
index 000000000000..0164f8884a27
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qtscriptgenerator/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchurl, qt4 }:
+
+stdenv.mkDerivation {
+  name = "qtscriptgenerator-0.1.0";
+  src = fetchurl {
+    url = "https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/qtscriptgenerator/qtscriptgenerator-src-0.1.0.tar.gz";
+    sha256 = "0h8zjh38n2wfz7jld0jz6a09y66dbsd2jhm4f2024qfgcmxcabj6";
+  };
+  buildInputs = [ qt4 ];
+
+  patches = [ ./qtscriptgenerator.gcc-4.4.patch ./qt-4.8.patch ];
+
+  postPatch = ''
+    # remove phonon stuff which causes errors (thanks to Gentoo bug reports)
+    sed -i "/typesystem_phonon.xml/d" generator/generator.qrc
+    sed -i "/qtscript_phonon/d" qtbindings/qtbindings.pro
+  '';
+
+  configurePhase = ''
+    ( cd generator; qmake )
+    ( cd qtbindings; qmake )
+  '';
+
+  buildPhase = ''
+    makeFlags="SHELL=$SHELL ''${enableParallelBuilding:+-j$NIX_BUILD_CORES -l$NIX_BUILD_CORES}"
+    make $makeFlags -C generator
+
+    # Set QTDIR, see https://code.google.com/archive/p/qtscriptgenerator/issues/38
+    ( cd generator; QTDIR=${qt4} ./generator )
+    make $makeFlags -C qtbindings
+  '';
+
+  installPhase = ''
+    mkdir -p $out/lib/qt4/plugins/script
+    cp -av plugins/script/* $out/lib/qt4/plugins/script
+  '';
+
+  enableParallelBuilding = true;
+
+  hardeningDisable = [ "format" ];
+
+  meta = {
+    description = "QtScript bindings generator";
+    homepage = "https://code.qt.io/cgit/qt-labs/qtscriptgenerator.git/";
+    inherit (qt4.meta) platforms;
+    license = lib.licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qtscriptgenerator/qt-4.8.patch b/nixpkgs/pkgs/development/libraries/qtscriptgenerator/qt-4.8.patch
new file mode 100644
index 000000000000..8fe643e2c98f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qtscriptgenerator/qt-4.8.patch
@@ -0,0 +1,23 @@
+Origin: http://src.fedoraproject.org/gitweb/?p=qtscriptgenerator.git;a=blob_plain;f=qtscriptgenerator-src-0.1.0-no_QFileOpenEvent.patch;h=f397b5ab13bcfc268e6d7b7ba4c6bc66ae38b5c0;hb=HEAD
+diff -up qtscriptgenerator-src-0.1.0/generator/typesystem_gui-common.xml.no_QFileOpenEvent qtscriptgenerator-src-0.1.0/generator/typesystem_gui-common.xml
+--- qtscriptgenerator-src-0.1.0/generator/typesystem_gui-common.xml.no_QFileOpenEvent	2011-12-22 11:34:52.615149619 -0600
++++ qtscriptgenerator-src-0.1.0/generator/typesystem_gui-common.xml	2011-12-22 11:35:31.808659632 -0600
+@@ -2233,7 +2233,6 @@
+     
+                
+   </object-type>
+-  <object-type name="QFileOpenEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FileOpen"/>
+   <object-type name="QFocusEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FocusIn || %1-&gt;type() == QEvent::FocusOut">
+         <modify-function signature="reason()const">
+             <remove/>
+diff -up qtscriptgenerator-src-0.1.0/generator/typesystem_gui.xml.no_QFileOpenEvent qtscriptgenerator-src-0.1.0/generator/typesystem_gui.xml
+--- qtscriptgenerator-src-0.1.0/generator/typesystem_gui.xml.no_QFileOpenEvent	2009-02-20 05:42:24.000000000 -0600
++++ qtscriptgenerator-src-0.1.0/generator/typesystem_gui.xml	2011-12-22 11:33:43.058019203 -0600
+@@ -2555,7 +2555,6 @@
+     
+                
+   </object-type>
+-  <object-type name="QFileOpenEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FileOpen"/>
+   <object-type name="QFocusEvent" polymorphic-id-expression="%1-&gt;type() == QEvent::FocusIn || %1-&gt;type() == QEvent::FocusOut">
+         <modify-function signature="reason()const">
+             <remove/>
diff --git a/nixpkgs/pkgs/development/libraries/qtscriptgenerator/qtscriptgenerator.gcc-4.4.patch b/nixpkgs/pkgs/development/libraries/qtscriptgenerator/qtscriptgenerator.gcc-4.4.patch
new file mode 100644
index 000000000000..c0a710efb157
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qtscriptgenerator/qtscriptgenerator.gcc-4.4.patch
@@ -0,0 +1,11 @@
+diff -uNr generator.orig/parser/rpp/pp.h generator/parser/rpp/pp.h
+--- qtscriptgenerator-src-0.1.0/generator.orig/parser/rpp/pp.h	2008-12-05 11:01:44.000000000 +0100
++++ qtscriptgenerator-src-0.1.0/generator/parser/rpp/pp.h	2008-12-13 10:42:22.000000000 +0100
+@@ -30,6 +30,7 @@
+ #include <cctype>
+ 
+ #include <fcntl.h>
++#include <cstdio>
+ 
+ #ifdef HAVE_MMAP
+ #  include <sys/mman.h>
diff --git a/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix b/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix
new file mode 100644
index 000000000000..7290b3830d07
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, qmake4Hook , qt4, libX11, libXext }:
+
+stdenv.mkDerivation rec {
+  pname = "qtstyleplugin-kvantum-qt4";
+  version = "0.16.0";
+
+  src = fetchFromGitHub {
+    owner = "tsujan";
+    repo = "Kvantum";
+    rev = "V${version}";
+    sha256 = "05ihjslnv7rrp4giwvvyaiig0dpfmw3jijfaadzax8jhbyscmxsq";
+  };
+
+  nativeBuildInputs = [ qmake4Hook ];
+  buildInputs = [ qt4 libX11 libXext ];
+
+  postUnpack = "sourceRoot=\${sourceRoot}/Kvantum";
+
+  buildPhase = ''
+    qmake kvantum.pro
+    make
+  '';
+
+  installPhase = ''
+    mkdir $TMP/kvantum
+    make INSTALL_ROOT="$TMP/kvantum" install
+    mv $TMP/kvantum/usr/ $out
+    mv $TMP/kvantum/${qt4}/lib $out
+  '';
+
+  meta = with lib; {
+    description = "SVG-based Qt4 theme engine";
+    homepage = "https://github.com/tsujan/Kvantum";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bugworm ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix b/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
new file mode 100644
index 000000000000..4589a2fde18f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchFromGitHub, qmake, qtbase, qtsvg, qtx11extras, kwindowsystem
+, libX11, libXext, qttools, wrapQtAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "qtstyleplugin-kvantum";
+  version = "0.20.1";
+
+  src = fetchFromGitHub {
+    owner = "tsujan";
+    repo = "Kvantum";
+    rev = "V${version}";
+    sha256 = "0rj7zfm2h6812ga1xypism8a48jj669nh10jmhpf2mjriyaar3di";
+  };
+
+  nativeBuildInputs = [
+    qmake qttools wrapQtAppsHook
+  ];
+  buildInputs = [
+    qtbase qtsvg qtx11extras kwindowsystem libX11 libXext
+  ];
+
+  sourceRoot = "source/Kvantum";
+
+  postPatch = ''
+    # Fix plugin dir
+    substituteInPlace style/style.pro \
+      --replace "\$\$[QT_INSTALL_PLUGINS]" "$out/$qtPluginPrefix"
+  '';
+
+  meta = with lib; {
+    description = "SVG-based Qt5 theme engine plus a config tool and extra themes";
+    homepage = "https://github.com/tsujan/Kvantum";
+    license = licenses.gpl3Plus;
+    platforms = platforms.linux;
+    broken = lib.versionOlder qtbase.version "5.14";
+    maintainers = [ maintainers.bugworm ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qtstyleplugins/default.nix b/nixpkgs/pkgs/development/libraries/qtstyleplugins/default.nix
new file mode 100644
index 000000000000..ebc7bc081933
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qtstyleplugins/default.nix
@@ -0,0 +1,37 @@
+{ lib, mkDerivation, fetchFromGitHub, fetchpatch, qmake, pkg-config, gtk2 }:
+
+mkDerivation {
+  pname = "qtstyleplugins";
+  version = "unstable-2017-03-11";
+
+  src = fetchFromGitHub {
+    owner = "qt";
+    repo = "qtstyleplugins";
+    rev = "335dbece103e2cbf6c7cf819ab6672c2956b17b3";
+    sha256 = "085wyn85nrmzr8nv5zv7fi2kqf8rp1gnd30h72s30j55xvhmxvmy";
+  };
+
+  patches = [
+    (fetchpatch rec {
+      name = "0001-fix-build-against-Qt-5.15.patch";
+      url = "https://aur.archlinux.org/cgit/aur.git/plain/${name}?h=qt5-styleplugins";
+      sha256 = "j0CgfutqFawy11IqFnlrkfMsMD01NjX/MkfVEVxj1QM=";
+    })
+    (fetchpatch rec {
+      name = "0002-fix-gtk2-background.patch";
+      url = "https://aur.archlinux.org/cgit/aur.git/plain/${name}?h=qt5-styleplugins";
+      sha256 = "qUOkNckrSUEzXY1PUZKfbiCjhNyB5ZBw2IN/j32GKM4=";
+    })
+  ];
+
+  nativeBuildInputs = [ pkg-config qmake ];
+  buildInputs = [ gtk2 ];
+
+  meta = with lib; {
+    description = "Additional style plugins for Qt5, including BB10, GTK, Cleanlooks, Motif, Plastique";
+    homepage = "http://blog.qt.io/blog/2012/10/30/cleaning-up-styles-in-qt5-and-adding-fusion/";
+    license = licenses.lgpl21;
+    maintainers = [ ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qtutilities/default.nix b/nixpkgs/pkgs/development/libraries/qtutilities/default.nix
new file mode 100644
index 000000000000..99cf50a7ba04
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qtutilities/default.nix
@@ -0,0 +1,33 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, cpp-utilities
+, qttools
+, qtbase
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "qtutilities";
+  version = "6.3.3";
+
+  src = fetchFromGitHub {
+    owner = "Martchus";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-RoI1huVei4SmAUhuYruzgod0/qIlnrZSHEMceQc2jzc=";
+  };
+
+  buildInputs = [ qtbase cpp-utilities ];
+  nativeBuildInputs = [ cmake qttools ];
+
+  dontWrapQtApps = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/Martchus/qtutilities";
+    description = "Common C++ classes and routines used by @Martchus' applications featuring argument parser, IO and conversion utilities";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ doronbehar ];
+    platforms   = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qtwebkit-plugins/default.nix b/nixpkgs/pkgs/development/libraries/qtwebkit-plugins/default.nix
new file mode 100644
index 000000000000..dd6a7606f6e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qtwebkit-plugins/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, qmake, qtwebkit, hunspell }:
+
+stdenv.mkDerivation {
+  pname = "qtwebkit-plugins";
+  version = "unstable-2017-01-25";
+
+  src = fetchFromGitHub {
+    owner = "QupZilla";
+    repo = "qtwebkit-plugins";
+    rev = "b58ee9d5b31977491662aa4e8bee16404638bf14";
+    sha256 = "04wvlhdj45g1v1a3zl0pkf9r72i22h1br10lhhrgad7ypym974gw";
+  };
+
+  nativeBuildInputs = [ qmake ];
+
+  buildInputs = [ qtwebkit hunspell ];
+
+  dontWrapQtApps = true;
+
+  postPatch = ''
+    sed -i "s,-lhunspell,-lhunspell-${lib.versions.majorMinor hunspell.version}," src/spellcheck/spellcheck.pri
+    sed -i "s,\$\$\[QT_INSTALL_PLUGINS\],$out/$qtPluginPrefix," src/src.pro
+  '';
+
+  meta = with lib; {
+    description = "Spell checking plugin using Hunspell and HTML5 Notifications plugin for QtWebKit";
+    homepage = "https://github.com/QupZilla/qtwebkit-plugins";
+    license = licenses.gpl3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/quazip/default.nix b/nixpkgs/pkgs/development/libraries/quazip/default.nix
new file mode 100644
index 000000000000..4184f3276c06
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/quazip/default.nix
@@ -0,0 +1,26 @@
+{ fetchFromGitHub, lib, stdenv, zlib, qtbase, cmake, fixDarwinDylibNames }:
+
+stdenv.mkDerivation rec {
+  pname = "quazip";
+  version = "1.1";
+
+  src = fetchFromGitHub {
+    owner = "stachenov";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "06srglrj6jvy5ngmidlgx03i0d5w91yhi7sf846wql00v8rvhc5h";
+  };
+
+  buildInputs = [ zlib qtbase ];
+  nativeBuildInputs = [ cmake ]
+    ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
+
+  dontWrapQtApps = true;
+
+  meta = with lib; {
+    description = "Provides access to ZIP archives from Qt programs";
+    license = licenses.lgpl21Plus;
+    homepage = "https://stachenov.github.io/quazip/"; # Migrated from http://quazip.sourceforge.net/
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/quesoglc/default.nix b/nixpkgs/pkgs/development/libraries/quesoglc/default.nix
new file mode 100644
index 000000000000..1a4fcca9d9b0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/quesoglc/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, libGLU, libGL, glew, freetype, fontconfig, fribidi, libX11 }:
+stdenv.mkDerivation rec {
+  pname = "quesoglc";
+  version = "0.7.2";
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.bz2";
+    sha256 = "0cf9ljdzii5d4i2m23gdmf3kn521ljcldzq69lsdywjid3pg5zjl";
+  };
+  buildInputs = [ libGLU libGL glew freetype fontconfig fribidi libX11 ];
+  # FIXME: Configure fails to use system glew.
+  meta = with lib; {
+    description = "A free implementation of the OpenGL Character Renderer";
+    longDescription = ''
+      QuesoGLC is a free (as in free speech) implementation of the OpenGL
+      Character Renderer (GLC). QuesoGLC is based on the FreeType library,
+      provides Unicode support and is designed to be easily ported to any
+      platform that supports both FreeType and the OpenGL API.
+    '';
+    homepage = "http://quesoglc.sourceforge.net/";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ astsmtl ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/quickder/default.nix b/nixpkgs/pkgs/development/libraries/quickder/default.nix
new file mode 100644
index 000000000000..28933f96fa1c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/quickder/default.nix
@@ -0,0 +1,52 @@
+{ lib, stdenv, fetchFromGitHub, python2Packages, hexio
+, cmake, bash, arpa2cm, git, asn2quickder }:
+
+stdenv.mkDerivation rec {
+  pname = "quickder";
+  version = "1.3.0";
+
+  src = fetchFromGitHub {
+    sha256 = "15lxv8vcjnsjxg7ywcac5p6mj5vf5pxq1219yap653ci4f1liqfr";
+    rev = "version-${version}";
+    owner = "vanrein";
+    repo = "quick-der";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = with python2Packages; [
+    arpa2cm
+    asn1ate
+    hexio
+    pyparsing
+    python
+    six
+    asn1ate
+    asn2quickder
+  ];
+
+  postPatch = ''
+    substituteInPlace ./CMakeLists.txt \
+      --replace "get_version_from_git" "set (Quick-DER_VERSION 1.2) #"
+    substituteInPlace ./CMakeLists.txt \
+      --replace \$\{ARPA2CM_TOOLCHAIN_DIR} "$out/share/ARPA2CM/toolchain/"
+    patchShebangs python/scripts/
+  '';
+
+  cmakeFlags = [
+    "-DNO_TESTING=ON"
+    "-DARPA2CM_TOOLCHAIN_DIR=$out/share/ARPA2CM/toolchain/"
+  ];
+
+  preConfigure = ''
+    export PREFIX=$out
+  '';
+
+  meta = with lib; {
+    description = "Quick (and Easy) DER, a Library for parsing ASN.1";
+    homepage = "https://github.com/vanrein/quick-der";
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ leenaars ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/quickfix/default.nix b/nixpkgs/pkgs/development/libraries/quickfix/default.nix
new file mode 100644
index 000000000000..6644b9885c25
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/quickfix/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, autoconf, automake, libtool }:
+
+stdenv.mkDerivation rec {
+  pname = "quickfix";
+  version = "1.15.1";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev =  "v${version}";
+    sha256 = "1fgpwgvyw992mbiawgza34427aakn5zrik3sjld0i924a9d17qwg";
+  };
+
+  patches = [
+    # Improved C++17 compatibility
+    (fetchpatch {
+      url = "https://github.com/quickfix/quickfix/commit/a46708090444826c5f46a5dbf2ba4b069b413c58.diff";
+      sha256 = "1wlk4j0wmck0zm6a70g3nrnq8fz0id7wnyxn81f7w048061ldhyd";
+    })
+    ./disableUnitTests.patch
+  ];
+
+  # autoreconfHook does not work
+  nativeBuildInputs = [ autoconf automake libtool ];
+
+  enableParallelBuilding = true;
+
+  preConfigure = ''
+    ./bootstrap
+  '';
+
+  # More hacking out of the unittests
+  preBuild = ''
+    substituteInPlace Makefile --replace 'UnitTest++' ' '
+  '';
+
+  meta = with lib; {
+    description = "QuickFIX C++ Fix Engine Library";
+    homepage = "http://www.quickfixengine.org";
+    license = licenses.free; # similar to BSD 4-clause
+    maintainers = with maintainers; [ bhipple ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/quickfix/disableUnitTests.patch b/nixpkgs/pkgs/development/libraries/quickfix/disableUnitTests.patch
new file mode 100644
index 000000000000..41a2f698e55f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/quickfix/disableUnitTests.patch
@@ -0,0 +1,65 @@
+diff -u -r source-baseline-patchPhase/configure.ac source/configure.ac
+--- source-baseline-patchPhase/configure.ac	1970-01-01 00:00:01.000000000 +0000
++++ source/configure.ac	2021-01-12 22:49:28.948861699 +0000
+@@ -43,7 +43,7 @@
+ 
+ AC_CANONICAL_HOST
+ 
+-build_no_unit_test = no
++build_no_unit_test = yes
+ 
+ # Detect the target system
+ case "${host_os}" in
+@@ -344,8 +344,6 @@
+     examples/Makefile
+     examples/executor/Makefile
+     examples/executor/C++/Makefile
+-    examples/ordermatch/Makefile
+-    examples/ordermatch/test/Makefile
+     examples/tradeclient/Makefile
+     examples/tradeclientgui/Makefile
+     examples/tradeclientgui/banzai/Makefile
+diff -u -r source-baseline-patchPhase/examples/Makefile.am source/examples/Makefile.am
+--- source-baseline-patchPhase/examples/Makefile.am	1970-01-01 00:00:01.000000000 +0000
++++ source/examples/Makefile.am	2021-01-12 22:51:55.782568550 +0000
+@@ -1,3 +1,3 @@
+-SUBDIRS = executor ordermatch tradeclient tradeclientgui
++SUBDIRS = executor tradeclient tradeclientgui
+ 
+-EXTRA_DIST = examples.dsw configure configure.in bootstrap Makefile.am
+\ No newline at end of file
++EXTRA_DIST = examples.dsw configure configure.in bootstrap Makefile.am
+diff -u -r source-baseline-patchPhase/src/Makefile.am source/src/Makefile.am
+--- source-baseline-patchPhase/src/Makefile.am	1970-01-01 00:00:01.000000000 +0000
++++ source/src/Makefile.am	2021-01-12 22:53:02.593432380 +0000
+@@ -15,27 +15,23 @@
+ if NO_UNIT_TEST
+ noinst_PROGRAMS =
+ else
+-noinst_PROGRAMS = at ut pt
++noinst_PROGRAMS = at pt
+ endif
+ 
+ at_SOURCES = at.cpp at_application.h
+-ut_SOURCES = ut.cpp
+ pt_SOURCES = pt.cpp
+ 
+ EXTRA_DIST = getopt.c getopt-repl.h
+ 
+ at_LDADD = C++/libquickfix.la
+-ut_LDADD = C++/test/libquickfixcpptest.la C++/libquickfix.la
+ pt_LDADD = C++/libquickfix.la
+ 
+ INCLUDES =-IC++ -IC++/test -I../UnitTest++/src
+-LDFLAGS =-L../UnitTest++ -lUnitTest++
++ 
+ 
+ all-local:
+-	rm -f ../test/ut ../test/pt ../test/at ../test/ut_debug
+-	ln -s ../src/ut ../test/ut
++	rm -rf ../test/pt ../test/at ../test/ut_debug
+ 	ln -s ../src/pt ../test/pt
+ 	ln -s ../src/at ../test/at
+-	ln -s ../src/.libs/ut ../test/ut_debug
+ 
+ clean-local:
diff --git a/nixpkgs/pkgs/development/libraries/qwt/6.nix b/nixpkgs/pkgs/development/libraries/qwt/6.nix
new file mode 100644
index 000000000000..1f2518fc7380
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qwt/6.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, qtbase, qtsvg, qttools, qmake }:
+
+stdenv.mkDerivation rec {
+  name = "qwt-6.1.6";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/qwt/${name}.tar.bz2";
+    sha256 = "sha256-mUYNMcEV7kEXsBddiF9HwsWQ14QgbwmBXcBY++Xt4fY=";
+  };
+
+  propagatedBuildInputs = [ qtbase qtsvg qttools ];
+  nativeBuildInputs = [ qmake ];
+
+  postPatch = ''
+    sed -e "s|QWT_INSTALL_PREFIX.*=.*|QWT_INSTALL_PREFIX = $out|g" -i qwtconfig.pri
+  '';
+
+  qmakeFlags = [ "-after doc.path=$out/share/doc/${name}" ];
+
+  dontWrapQtApps = true;
+
+  meta = with lib; {
+    description = "Qt widgets for technical applications";
+    homepage = "http://qwt.sourceforge.net/";
+    # LGPL 2.1 plus a few exceptions (more liberal)
+    license = lib.licenses.qwt;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.bjornfor ];
+    branch = "6";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qwt/6_qt4.nix b/nixpkgs/pkgs/development/libraries/qwt/6_qt4.nix
new file mode 100644
index 000000000000..61903af93fac
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qwt/6_qt4.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, qt4, qmake4Hook, AGL }:
+
+stdenv.mkDerivation rec {
+  name = "qwt-6.1.5";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/qwt/${name}.tar.bz2";
+    sha256 = "0hf0mpca248xlqn7xnzkfj8drf19gdyg5syzklvq8pibxiixwxj0";
+  };
+
+  buildInputs = [
+    qt4
+  ] ++ lib.optionals stdenv.isDarwin [ AGL ];
+
+  nativeBuildInputs = [ qmake4Hook ];
+
+  enableParallelBuilding = true;
+
+  postPatch = ''
+    sed -e "s|QWT_INSTALL_PREFIX.*=.*|QWT_INSTALL_PREFIX = $out|g" -i qwtconfig.pri
+  '';
+
+  # qwt.framework output includes a relative reference to itself, which breaks dependents
+  preFixup =
+    lib.optionalString stdenv.isDarwin ''
+      echo "Attempting to repair qwt"
+      install_name_tool -id "$out/lib/qwt.framework/Versions/6/qwt" "$out/lib/qwt.framework/Versions/6/qwt"
+    '';
+
+  qmakeFlags = [ "-after doc.path=$out/share/doc/${name}" ];
+
+  meta = with lib; {
+    description = "Qt widgets for technical applications";
+    homepage = "http://qwt.sourceforge.net/";
+    # LGPL 2.1 plus a few exceptions (more liberal)
+    license = lib.licenses.qwt;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = [ maintainers.bjornfor ];
+    branch = "6";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qwt/default.nix b/nixpkgs/pkgs/development/libraries/qwt/default.nix
new file mode 100644
index 000000000000..a5dcfedb8491
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qwt/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, qt4, qmake4Hook }:
+
+stdenv.mkDerivation rec {
+  pname = "qwt";
+  version = "5.2.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/qwt/${pname}-${version}.tar.bz2";
+    sha256 = "1dqa096mm6n3bidfq2b67nmdsvsw4ndzzd1qhl6hn8skcwqazzip";
+  };
+
+  propagatedBuildInputs = [ qt4 ];
+  nativeBuildInputs = [ qmake4Hook ];
+
+  postPatch = ''
+    sed -e "s@\$\$\[QT_INSTALL_PLUGINS\]@$out/lib/qt4/plugins@" -i designer/designer.pro
+    sed -e "s|INSTALLBASE.*=.*|INSTALLBASE = $out|g" -i qwtconfig.pri
+  '';
+
+  preConfigure = ''
+    qmakeFlags="$qmakeFlags INSTALLBASE=$out -after doc.path=$out/share/doc/${pname}-${version}"
+  '';
+
+  meta = with lib; {
+    description = "Qt widgets for technical applications";
+    homepage = "http://qwt.sourceforge.net/";
+    # LGPL 2.1 plus a few exceptions (more liberal)
+    license = lib.licenses.qwt;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qxmpp/default.nix b/nixpkgs/pkgs/development/libraries/qxmpp/default.nix
new file mode 100644
index 000000000000..4867c67277d8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qxmpp/default.nix
@@ -0,0 +1,46 @@
+{ mkDerivation
+, lib
+, fetchFromGitHub
+, cmake
+, pkg-config
+, withGstreamer ? true
+, gst_all_1
+}:
+
+mkDerivation rec {
+  pname = "qxmpp";
+  version = "1.4.0";
+
+  src = fetchFromGitHub {
+    owner = "qxmpp-project";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1knpq1jkwk0lxdwczbmzf7qrjvlxba9yr40nbq9s5nqkcx6q1c3i";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ] ++ lib.optionals withGstreamer [
+    pkg-config
+  ];
+  buildInputs = lib.optionals withGstreamer (with gst_all_1; [
+    gstreamer
+    gst-plugins-bad
+    gst-plugins-base
+    gst-plugins-good
+  ]);
+  cmakeFlags = [
+    "-DBUILD_EXAMPLES=false"
+    "-DBUILD_TESTS=false"
+  ] ++ lib.optionals withGstreamer [
+    "-DWITH_GSTREAMER=ON"
+  ];
+
+  meta = with lib; {
+    description = "Cross-platform C++ XMPP client and server library";
+    homepage = "https://github.com/qxmpp-project/qxmpp";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ astro ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/qxt/default.nix b/nixpkgs/pkgs/development/libraries/qxt/default.nix
new file mode 100644
index 000000000000..9d035ce9d89a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/qxt/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, which, coreutils, fetchzip, qt4 }:
+
+stdenv.mkDerivation rec {
+  pname = "qxt";
+  version = "0.6.2";
+
+  src = fetchzip {
+    url = "https://bitbucket.org/libqxt/libqxt/get/v${version}.tar.gz";
+    sha256 = "0zmqfn0h8cpky7wgaaxlfh0l89r9r0isi87587kaicyap7a6kxwz";
+  };
+
+  buildInputs = [ qt4 which ];
+
+  patchPhase = ''
+    patchShebangs configure
+    substituteInPlace configure --replace "/bin/pwd" "${coreutils}/bin/pwd"
+  '';
+
+  prefixKey = "-prefix ";
+
+  meta = {
+    homepage = "http://libqxt.org";
+    description = "An extension library for Qt";
+    longDescription = ''
+      An extension library for Qt providing a suite of cross-platform utility
+      classes to add functionality not readily available in the Qt toolkit by Qt
+      Development Frameworks, Nokia.
+    '';
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ forkk ];
+    broken = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rabbitmq-c/default.nix b/nixpkgs/pkgs/development/libraries/rabbitmq-c/default.nix
new file mode 100644
index 000000000000..3d8fa0f95d93
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rabbitmq-c/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, cmake, openssl, popt, xmlto }:
+
+stdenv.mkDerivation rec {
+  pname = "rabbitmq-c";
+  version = "0.11.0";
+
+  src = fetchFromGitHub {
+    owner = "alanxz";
+    repo = "rabbitmq-c";
+    rev = "v${version}";
+    sha256 = "sha256-u1uOrZRiQOU/6vlLdQHypBRSCo3zw7FC1AI9v3NlBVE=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ openssl popt xmlto ];
+
+  meta = with lib; {
+    description = "RabbitMQ C AMQP client library";
+    homepage = "https://github.com/alanxz/rabbitmq-c";
+    license = licenses.mit;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rabbitmq-java-client/default.nix b/nixpkgs/pkgs/development/libraries/rabbitmq-java-client/default.nix
new file mode 100644
index 000000000000..e5657bcb3c30
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rabbitmq-java-client/default.nix
@@ -0,0 +1,31 @@
+{ fetchurl, lib, stdenv, ant, jdk, jre, python, makeWrapper }:
+
+stdenv.mkDerivation {
+  name = "rabbitmq-java-client-3.3.4";
+
+  src = fetchurl {
+    url = "https://www.rabbitmq.com/releases/rabbitmq-java-client/v3.3.4/rabbitmq-java-client-3.3.4.tar.gz";
+    sha256 = "03kspkgzzjsbq6f8yl2zj5m30qwgxv3l58hrbf6gcgxb5rpfk6sh";
+  };
+
+  nativeBuildInputs = [ makeWrapper ];
+  buildInputs = [ ant jdk python ];
+
+  buildPhase = "ant dist";
+
+  installPhase = ''
+    mkdir -p $out/bin $out/share/java
+    cp build/lib/*.jar lib/*.jar $out/share/java
+
+    # There is a script in the source archive, but ours is cleaner
+    makeWrapper ${jre}/bin/java $out/bin/PerfTest \
+      --add-flags "-Djava.awt.headless=true -cp $out/share/java/\* com.rabbitmq.examples.PerfTest"
+  '';
+
+  meta = with lib; {
+    description = "RabbitMQ Java client library which allows Java code to interface to AMQP servers";
+    homepage = "https://www.rabbitmq.com/java-client.html";
+    license = with licenses; [ mpl11 gpl2 ];
+    platforms = platforms.linux;
+  };
+}
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..4614c1498146
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/raft-canonical/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, file, libuv, lz4 }:
+
+stdenv.mkDerivation rec {
+  pname = "raft-canonical";
+  version = "0.11.2";
+
+  src = fetchFromGitHub {
+    owner = "canonical";
+    repo = "raft";
+    rev = "v${version}";
+    sha256 = "050dwy34jh8dihfwfm0r1by2i3sy9crapipp9idw32idm79y4izb";
+  };
+
+  nativeBuildInputs = [ autoreconfHook file pkg-config ];
+  buildInputs = [ libuv lz4 ];
+
+  enableParallelBuilding = true;
+
+  preConfigure = ''
+    substituteInPlace configure --replace /usr/bin/ " "
+  '';
+
+  doCheck = true;
+
+  outputs = [ "dev" "out" ];
+
+  meta = with 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;
+    platforms = platforms.linux;
+    maintainers = with 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..8e99ca1be354
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/randomx/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "randomX";
+  version = "1.1.8";
+
+  nativeBuildInputs = [ cmake ];
+
+  src = fetchFromGitHub {
+    owner = "tevador";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "13h2cw8drq7xn3v8fbpxrlsl8zq3fs8gd2pc1pv28ahr9qqjz1gc";
+  };
+
+  meta = with 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/rang/default.nix b/nixpkgs/pkgs/development/libraries/rang/default.nix
new file mode 100644
index 000000000000..79ab52fc8351
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rang/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+stdenv.mkDerivation rec {
+  pname = "rang";
+  version = "v3.1.0";
+  src = fetchFromGitHub {
+    "owner" = "agauniyal";
+    repo = "rang";
+    "rev" = "cabe04d6d6b05356fa8f9741704924788f0dd762";
+    "sha256" = "0v2pz0l2smagr3j4abjccshg4agaccfz79m5ayvrvqq5d4rlds0s";
+  };
+  nativeBuildInputs = [ cmake ];
+  meta = with lib; {
+    description =
+      "A Minimal, Header only Modern c++ library for terminal goodies";
+    homepage = "https://agauniyal.github.io/rang/";
+    license = licenses.unlicense;
+    maintainers = [ maintainers.HaoZeke ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/range-v3/default.nix b/nixpkgs/pkgs/development/libraries/range-v3/default.nix
new file mode 100644
index 000000000000..4b5f277fc531
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/range-v3/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "range-v3";
+  version = "0.11.0";
+
+  src = fetchFromGitHub {
+    owner = "ericniebler";
+    repo = "range-v3";
+    rev = version;
+    sha256 = "18230bg4rq9pmm5f8f65j444jpq56rld4fhmpham8q3vr1c1bdjh";
+  };
+
+  patches = [
+    ./gcc10.patch
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  # Building the tests currently fails on AArch64 due to internal compiler
+  # errors (with GCC 9.2):
+  cmakeFlags = lib.optional stdenv.isAarch64 "-DRANGE_V3_TESTS=OFF";
+
+  doCheck = !stdenv.isAarch64;
+  checkTarget = "test";
+
+  meta = with lib; {
+    description = "Experimental range library for C++11/14/17";
+    homepage = "https://github.com/ericniebler/range-v3";
+    changelog = "https://github.com/ericniebler/range-v3/releases/tag/${version}";
+    license = licenses.boost;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ primeos ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/range-v3/gcc10.patch b/nixpkgs/pkgs/development/libraries/range-v3/gcc10.patch
new file mode 100644
index 000000000000..caebf0a63162
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/range-v3/gcc10.patch
@@ -0,0 +1,133 @@
+From a91f0e1be27a31c446452a753001d4518ef83a6b Mon Sep 17 00:00:00 2001
+From: Eric Niebler <eniebler@boost.org>
+Date: Mon, 17 Aug 2020 17:48:09 -0700
+Subject: [PATCH] work around premature instantiation problem on gcc; fixes
+ #1545
+
+---
+ include/range/v3/view/chunk.hpp |  6 +++---
+ include/range/v3/view/split.hpp | 26 +++++++++++++-------------
+ 2 files changed, 16 insertions(+), 16 deletions(-)
+
+diff --git a/include/range/v3/view/chunk.hpp b/include/range/v3/view/chunk.hpp
+index 0c03cf1eb..b8df13303 100644
+--- a/include/range/v3/view/chunk.hpp
++++ b/include/range/v3/view/chunk.hpp
+@@ -313,8 +313,8 @@ namespace ranges
+ 
+             public:
+                 inner_view() = default;
+-                constexpr explicit inner_view(chunk_view_ & view) noexcept
+-                  : rng_{&view}
++                constexpr explicit inner_view(chunk_view_ * view) noexcept
++                  : rng_{view}
+                 {}
+                 CPP_auto_member
+                 constexpr auto CPP_fun(size)()(
+@@ -338,7 +338,7 @@ namespace ranges
+             constexpr inner_view read() const
+             {
+                 RANGES_EXPECT(!done());
+-                return inner_view{*rng_};
++                return inner_view{rng_};
+             }
+             constexpr bool done() const
+             {
+diff --git a/include/range/v3/view/split.hpp b/include/range/v3/view/split.hpp
+index facf1b37f..496220e4a 100644
+--- a/include/range/v3/view/split.hpp
++++ b/include/range/v3/view/split.hpp
+@@ -389,19 +389,19 @@ namespace ranges
+             split_outer_iterator() = default;
+ 
+             CPP_member
+-            constexpr explicit CPP_ctor(split_outer_iterator)(Parent & parent)(
++            constexpr explicit CPP_ctor(split_outer_iterator)(Parent * parent)(
+                 /// \pre
+                 requires (!forward_range<Base>))
+-              : parent_(&parent)
++              : parent_(parent)
+             {}
+ 
+             CPP_member
+-            constexpr CPP_ctor(split_outer_iterator)(Parent & parent,
++            constexpr CPP_ctor(split_outer_iterator)(Parent * parent,
+                                                      iterator_t<Base> current)(
+                 /// \pre
+                 requires forward_range<Base>)
+               : Current{std::move(current)}
+-              , parent_(&parent)
++              , parent_(parent)
+             {}
+ 
+             template(bool Other)(
+@@ -519,7 +519,7 @@ namespace ranges
+                                               ranges::equal_to> &&
+         (forward_range<V> || detail::tiny_range<Pattern>)
+ #endif
+-            struct RANGES_EMPTY_BASES split_view
++    struct RANGES_EMPTY_BASES split_view
+       : view_interface<split_view<V, Pattern>, is_finite<V>::value ? finite : unknown>
+       , private detail::split_view_base<iterator_t<V>>
+     {
+@@ -537,17 +537,17 @@ namespace ranges
+ #if RANGES_CXX_IF_CONSTEXPR < RANGES_CXX_IF_CONSTEXPR_17
+         outer_iterator<simple_view<V>()> begin_(std::true_type)
+         {
+-            return outer_iterator<simple_view<V>()>{*this, ranges::begin(base_)};
++            return outer_iterator<simple_view<V>()>{this, ranges::begin(base_)};
+         }
+         outer_iterator<false> begin_(std::false_type)
+         {
+             this->curr_ = ranges::begin(base_);
+-            return outer_iterator<false>{*this};
++            return outer_iterator<false>{this};
+         }
+ 
+         outer_iterator<simple_view<V>()> end_(std::true_type) const
+         {
+-            return outer_iterator<true>{*this, ranges::end(base_)};
++            return outer_iterator<true>{this, ranges::end(base_)};
+         }
+         default_sentinel_t end_(std::false_type) const
+         {
+@@ -580,11 +580,11 @@ namespace ranges
+         {
+ #if RANGES_CXX_IF_CONSTEXPR >= RANGES_CXX_IF_CONSTEXPR_17
+             if constexpr(forward_range<V>)
+-                return outer_iterator<simple_view<V>()>{*this, ranges::begin(base_)};
++                return outer_iterator<simple_view<V>()>{this, ranges::begin(base_)};
+             else
+             {
+                 this->curr_ = ranges::begin(base_);
+-                return outer_iterator<false>{*this};
++                return outer_iterator<false>{this};
+             }
+ #else
+             return begin_(meta::bool_<forward_range<V>>{});
+@@ -596,7 +596,7 @@ namespace ranges
+                 /// \pre
+                 requires forward_range<V> && forward_range<const V>)
+         {
+-            return {*this, ranges::begin(base_)};
++            return {this, ranges::begin(base_)};
+         }
+         CPP_member
+         constexpr auto end() //
+@@ -604,14 +604,14 @@ namespace ranges
+                 /// \pre
+                 requires forward_range<V> && common_range<V>)
+         {
+-            return outer_iterator<simple_view<V>()>{*this, ranges::end(base_)};
++            return outer_iterator<simple_view<V>()>{this, ranges::end(base_)};
+         }
+         constexpr auto end() const
+         {
+ #if RANGES_CXX_IF_CONSTEXPR >= RANGES_CXX_IF_CONSTEXPR_17
+             if constexpr(forward_range<V> && forward_range<const V> &&
+                          common_range<const V>)
+-                return outer_iterator<true>{*this, ranges::end(base_)};
++                return outer_iterator<true>{this, ranges::end(base_)};
+             else
+                 return default_sentinel;
+ #else
diff --git a/nixpkgs/pkgs/development/libraries/rapidcheck/default.nix b/nixpkgs/pkgs/development/libraries/rapidcheck/default.nix
new file mode 100644
index 000000000000..4df98c3026e5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rapidcheck/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, cmake, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "rapidcheck";
+  version = "unstable-2020-12-19";
+
+  src = fetchFromGitHub {
+    owner = "emil-e";
+    repo  = "rapidcheck";
+    rev   = "b78f89288c7e086d06e2a1e10b605d8375517a8a";
+    sha256 = "0fj11gbhkaxbsgix2im7vdfvr26l75b8djk462sfw8xrwrfkjbdz";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  # Install the extras headers
+  postInstall = ''
+    cp -r $src/extras $out
+    chmod -R +w $out/extras
+    rm $out/extras/CMakeLists.txt
+    rm $out/extras/**/CMakeLists.txt
+  '';
+
+  meta = with lib; {
+    description = "A C++ framework for property based testing inspired by QuickCheck";
+    inherit (src.meta) homepage;
+    maintainers = with maintainers; [ jb55 ];
+    license = licenses.bsd2;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rapidjson/default.nix b/nixpkgs/pkgs/development/libraries/rapidjson/default.nix
new file mode 100644
index 000000000000..1211892890ad
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rapidjson/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, lib, fetchFromGitHub, fetchpatch, pkg-config, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "rapidjson";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "miloyip";
+    repo = "rapidjson";
+    rev = "v${version}";
+    sha256 = "1jixgb8w97l9gdh3inihz7avz7i770gy2j2irvvlyrq3wi41f5ab";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://src.fedoraproject.org/rpms/rapidjson/raw/48402da9f19d060ffcd40bf2b2e6987212c58b0c/f/rapidjson-1.1.0-c++20.patch";
+      sha256 = "1qm62iad1xfsixv1li7qy475xc7gc04hmi2q21qdk6l69gk7mf82";
+    })
+  ];
+
+  nativeBuildInputs = [ pkg-config cmake ];
+
+  preConfigure = ''
+    substituteInPlace CMakeLists.txt --replace "-Werror" ""
+    substituteInPlace example/CMakeLists.txt --replace "-Werror" ""
+  '';
+
+  meta = with lib; {
+    description = "Fast JSON parser/generator for C++ with both SAX/DOM style API";
+    homepage = "http://rapidjson.org/";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ cstrahan ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rapidxml/default.nix b/nixpkgs/pkgs/development/libraries/rapidxml/default.nix
new file mode 100644
index 000000000000..e5ae16087cbd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rapidxml/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, unzip }:
+
+stdenv.mkDerivation rec {
+  pname = "rapidxml";
+  version = "1.13";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/${pname}/${pname}-${version}.zip";
+    sha256 = "0w9mbdgshr6sh6a5jr10lkdycjyvapbj7wxwz8hbp0a96y3biw63";
+  };
+
+  nativeBuildInputs = [ unzip ];
+
+  installPhase = ''
+    mkdir -p $out/include/${pname}
+    cp * $out/include/${pname}
+  '';
+
+  meta = with lib; {
+    description = "Fast XML DOM-style parser in C++";
+    homepage = "http://rapidxml.sourceforge.net/";
+    license = licenses.boost;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ cpages ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rarian/default.nix b/nixpkgs/pkgs/development/libraries/rarian/default.nix
new file mode 100644
index 000000000000..b8995e6a2c48
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rarian/default.nix
@@ -0,0 +1,25 @@
+{lib, stdenv, fetchurl, pkg-config, perlPackages, libxml2, libxslt, docbook_xml_dtd_42, gnome}:
+let
+  pname = "rarian";
+  version = "0.8.1";
+in stdenv.mkDerivation rec {
+  name = "${pname}-${version}";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.gz";
+    sha256 = "aafe886d46e467eb3414e91fa9e42955bd4b618c3e19c42c773026b205a84577";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libxml2 libxslt ]
+    ++ (with perlPackages; [ perl XMLParser ]);
+  configureFlags = [ "--with-xml-catalog=${docbook_xml_dtd_42}/xml/dtd/docbook/docbook.cat" ];
+
+  meta = with lib; {
+    description = "Documentation metadata library based on the proposed Freedesktop.org spec";
+    homepage = "https://rarian.freedesktop.org/";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/raylib/default.nix b/nixpkgs/pkgs/development/libraries/raylib/default.nix
new file mode 100644
index 000000000000..9843141fc008
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/raylib/default.nix
@@ -0,0 +1,55 @@
+{ stdenv, lib, fetchFromGitHub, fetchpatch, cmake,
+  mesa, libGLU, glfw,
+  libX11, libXi, libXcursor, libXrandr, libXinerama,
+  alsaSupport ? stdenv.hostPlatform.isLinux, alsa-lib,
+  pulseSupport ? stdenv.hostPlatform.isLinux, libpulseaudio,
+  sharedLib ? true,
+  includeEverything ? true
+}:
+
+stdenv.mkDerivation rec {
+  pname = "raylib";
+  version = "3.7.0";
+
+  src = fetchFromGitHub {
+    owner = "raysan5";
+    repo = pname;
+    rev = version;
+    sha256 = "1w8v747hqy0ils6zmy8sm056f24ybjhn9bamqzlxvbqhvh9vvly1";
+  };
+
+  patches = [
+    # fixes incorrect version being set by cmake
+    (fetchpatch {
+      url = "https://github.com/raysan5/raylib/commit/204aa4c46fdd6986aa0130eeba658562c540759f.patch";
+      sha256 = "10pl7828iy4kadach0wy4fs95vr7k08z3mxw90j8dm9xak1ri8fz";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [
+    mesa libGLU glfw libX11 libXi libXcursor libXrandr libXinerama
+  ] ++ lib.optional alsaSupport alsa-lib
+    ++ lib.optional pulseSupport libpulseaudio;
+
+  # https://github.com/raysan5/raylib/wiki/CMake-Build-Options
+  cmakeFlags = [
+    "-DUSE_EXTERNAL_GLFW=ON"
+    "-DBUILD_EXAMPLES=OFF"
+  ] ++ lib.optional includeEverything "-DINCLUDE_EVERYTHING=ON"
+    ++ lib.optional sharedLib "-DBUILD_SHARED_LIBS=ON";
+
+  # fix libasound.so/libpulse.so not being found
+  preFixup = ''
+    ${lib.optionalString alsaSupport "patchelf --add-needed ${alsa-lib}/lib/libasound.so $out/lib/libraylib.so.${version}"}
+    ${lib.optionalString pulseSupport "patchelf --add-needed ${libpulseaudio}/lib/libpulse.so $out/lib/libraylib.so.${version}"}
+  '';
+
+  meta = with lib; {
+    description = "A simple and easy-to-use library to enjoy videogames programming";
+    homepage = "https://www.raylib.com/";
+    license = licenses.zlib;
+    maintainers = with maintainers; [ adamlwgriffiths ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rdkafka/default.nix b/nixpkgs/pkgs/development/libraries/rdkafka/default.nix
new file mode 100644
index 000000000000..41a5526fc5e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rdkafka/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, zlib, zstd, pkg-config, python3, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "rdkafka";
+  version = "1.7.0";
+
+  src = fetchFromGitHub {
+    owner = "edenhill";
+    repo = "librdkafka";
+    rev = "v${version}";
+    sha256 = "sha256-NLlg9S3bn5rAFyRa1ETeQGhFJYb/1y2ZiDylOy7xNbY=";
+  };
+
+  nativeBuildInputs = [ pkg-config python3 ];
+
+  buildInputs = [ zlib zstd openssl ];
+
+  NIX_CFLAGS_COMPILE = "-Wno-error=strict-overflow";
+
+  postPatch = ''
+    patchShebangs .
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "librdkafka - Apache Kafka C/C++ client library";
+    homepage = "https://github.com/edenhill/librdkafka";
+    license = licenses.bsd2;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ commandodev ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/re2/default.nix b/nixpkgs/pkgs/development/libraries/re2/default.nix
new file mode 100644
index 000000000000..9b7a2e910117
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/re2/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "re2";
+  version = "2021-04-01";
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "re2";
+    rev = version;
+    sha256 = "1iia0883lssj7ckbsr0n7yb3gdw24c8wnl2q5hhzlml23h4ipbh3";
+  };
+
+  preConfigure = ''
+    substituteInPlace Makefile --replace "/usr/local" "$out"
+    # we're using gnu sed, even on darwin
+    substituteInPlace Makefile  --replace "SED_INPLACE=sed -i '''" "SED_INPLACE=sed -i"
+  '';
+
+  buildFlags = lib.optionals stdenv.hostPlatform.isStatic [ "static" ];
+
+  preCheck = "patchShebangs runtests";
+  doCheck = true;
+  checkTarget = "test";
+
+  installTargets = lib.optionals stdenv.hostPlatform.isStatic [ "static-install" ];
+
+  doInstallCheck = true;
+  installCheckTarget = "testinstall";
+
+  meta = {
+    homepage = "https://github.com/google/re2";
+    description = "An efficient, principled regular expression library";
+    license = lib.licenses.bsd3;
+    platforms = with lib.platforms; all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/readline/5.x.nix b/nixpkgs/pkgs/development/libraries/readline/5.x.nix
new file mode 100644
index 000000000000..b2eab66387f5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/5.x.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl, ncurses }:
+
+stdenv.mkDerivation {
+  name = "readline-5.2";
+
+  src = fetchurl {
+    url = "mirror://gnu/readline/readline-5.2.tar.gz";
+    sha256 = "0icz4hqqq8mlkwrpczyaha94kns0am9z0mh3a2913kg2msb8vs0j";
+  };
+
+  propagatedBuildInputs = [ncurses];
+
+  patches = lib.optional stdenv.isDarwin ./shobj-darwin.patch;
+
+  meta = with lib; {
+    branch = "5";
+    platforms = platforms.unix;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/readline/6.2.nix b/nixpkgs/pkgs/development/libraries/readline/6.2.nix
new file mode 100644
index 000000000000..98db664dd8fc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/6.2.nix
@@ -0,0 +1,63 @@
+{ fetchurl, lib, stdenv, ncurses
+}:
+
+stdenv.mkDerivation (rec {
+  name = "readline-6.2";
+
+  src = fetchurl {
+    url = "mirror://gnu/readline/${name}.tar.gz";
+    sha256 = "10ckm2bd2rkxhvdmj7nmbsylmihw0abwcsnxf8y27305183rd9kr";
+  };
+
+  propagatedBuildInputs = [ncurses];
+
+  patchFlags = [ "-p0" ];
+  patches =
+    [ ./link-against-ncurses.patch
+      ./no-arch_only.patch
+      ./clang.patch
+    ]
+    ++
+    (let
+       patch = nr: sha256:
+         fetchurl {
+           url = "mirror://gnu/readline/${name}-patches/readline62-${nr}";
+           inherit sha256;
+         };
+     in
+       import ./readline-6.2-patches.nix patch);
+
+  meta = {
+    description = "Library for interactive line editing";
+
+    longDescription = ''
+      The GNU Readline library provides a set of functions for use by
+      applications that allow users to edit command lines as they are
+      typed in.  Both Emacs and vi editing modes are available.  The
+      Readline library includes additional functions to maintain a
+      list of previously-entered command lines, to recall and perhaps
+      reedit those lines, and perform csh-like history expansion on
+      previous commands.
+
+      The history facilities are also placed into a separate library,
+      the History library, as part of the build process.  The History
+      library may be used without Readline in applications which
+      desire its capabilities.
+    '';
+
+    homepage = "https://savannah.gnu.org/projects/readline/";
+
+    license = lib.licenses.gpl3Plus;
+
+    maintainers = [ ];
+    branch = "6.2";
+    platforms = lib.platforms.unix;
+  };
+}
+
+//
+
+# Don't run the native `strip' when cross-compiling.
+(if stdenv.hostPlatform != stdenv.buildPlatform
+ then { dontStrip = true; }
+ else { }))
diff --git a/nixpkgs/pkgs/development/libraries/readline/6.3.nix b/nixpkgs/pkgs/development/libraries/readline/6.3.nix
new file mode 100644
index 000000000000..2f63c4a3043c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/6.3.nix
@@ -0,0 +1,62 @@
+{ fetchurl, lib, stdenv, ncurses }:
+
+stdenv.mkDerivation {
+  name = "readline-6.3p08";
+
+  src = fetchurl {
+    url = "mirror://gnu/readline/readline-6.3.tar.gz";
+    sha256 = "0hzxr9jxqqx5sxsv9vmlxdnvlr9vi4ih1avjb869hbs6p5qn1fjn";
+  };
+
+  outputs = [ "out" "dev" "man" "doc" "info" ];
+
+  propagatedBuildInputs = [ncurses];
+
+  patchFlags = [ "-p0" ];
+
+  configureFlags = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
+    # This test requires running host code
+    "bash_cv_wcwidth_broken=no";
+
+  patches =
+    [ ./link-against-ncurses.patch
+      ./no-arch_only-6.3.patch
+    ] ++ lib.optional stdenv.hostPlatform.useAndroidPrebuilt ./android.patch
+    ++
+    (let
+       patch = nr: sha256:
+         fetchurl {
+           url = "mirror://gnu/readline/readline-6.3-patches/readline63-${nr}";
+           inherit sha256;
+         };
+     in
+       import ./readline-6.3-patches.nix patch);
+
+  meta = with lib; {
+    description = "Library for interactive line editing";
+
+    longDescription = ''
+      The GNU Readline library provides a set of functions for use by
+      applications that allow users to edit command lines as they are
+      typed in.  Both Emacs and vi editing modes are available.  The
+      Readline library includes additional functions to maintain a
+      list of previously-entered command lines, to recall and perhaps
+      reedit those lines, and perform csh-like history expansion on
+      previous commands.
+
+      The history facilities are also placed into a separate library,
+      the History library, as part of the build process.  The History
+      library may be used without Readline in applications which
+      desire its capabilities.
+    '';
+
+    homepage = "https://savannah.gnu.org/projects/readline/";
+
+    license = licenses.gpl3Plus;
+
+    maintainers = [ ];
+
+    platforms = platforms.unix;
+    branch = "6.3";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/readline/7.0.nix b/nixpkgs/pkgs/development/libraries/readline/7.0.nix
new file mode 100644
index 000000000000..25ef4b97a863
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/7.0.nix
@@ -0,0 +1,62 @@
+{ fetchurl, lib, stdenv, ncurses
+}:
+
+stdenv.mkDerivation rec {
+  pname = "readline";
+  version = "7.0p${toString (builtins.length upstreamPatches)}";
+
+  src = fetchurl {
+    url = "mirror://gnu/readline/readline-${meta.branch}.tar.gz";
+    sha256 = "0d13sg9ksf982rrrmv5mb6a2p4ys9rvg9r71d6il0vr8hmql63bm";
+  };
+
+  outputs = [ "out" "dev" "man" "doc" "info" ];
+
+  propagatedBuildInputs = [ncurses];
+
+  patchFlags = [ "-p0" ];
+
+  upstreamPatches =
+    (let
+       patch = nr: sha256:
+         fetchurl {
+           url = "mirror://gnu/readline/readline-${meta.branch}-patches/readline70-${nr}";
+           inherit sha256;
+         };
+     in
+       import ./readline-7.0-patches.nix patch);
+
+  patches =
+    [ ./link-against-ncurses.patch
+      ./no-arch_only-6.3.patch
+    ]
+    ++ upstreamPatches;
+
+  meta = with lib; {
+    description = "Library for interactive line editing";
+
+    longDescription = ''
+      The GNU Readline library provides a set of functions for use by
+      applications that allow users to edit command lines as they are
+      typed in.  Both Emacs and vi editing modes are available.  The
+      Readline library includes additional functions to maintain a
+      list of previously-entered command lines, to recall and perhaps
+      reedit those lines, and perform csh-like history expansion on
+      previous commands.
+
+      The history facilities are also placed into a separate library,
+      the History library, as part of the build process.  The History
+      library may be used without Readline in applications which
+      desire its capabilities.
+    '';
+
+    homepage = "https://savannah.gnu.org/projects/readline/";
+
+    license = licenses.gpl3Plus;
+
+    maintainers = [ ];
+
+    platforms = platforms.unix;
+    branch = "7.0";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/readline/8.1.nix b/nixpkgs/pkgs/development/libraries/readline/8.1.nix
new file mode 100644
index 000000000000..35835c1a1436
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/8.1.nix
@@ -0,0 +1,62 @@
+{ fetchurl, stdenv, lib, ncurses
+}:
+
+stdenv.mkDerivation rec {
+  pname = "readline";
+  version = "8.1p${toString (builtins.length upstreamPatches)}";
+
+  src = fetchurl {
+    url = "mirror://gnu/readline/readline-${meta.branch}.tar.gz";
+    sha256 = "00ibp0n9crbwx15k9vvckq5wsipw98b1px8pd8i34chy2gpb9kpq";
+  };
+
+  outputs = [ "out" "dev" "man" "doc" "info" ];
+
+  propagatedBuildInputs = [ncurses];
+
+  patchFlags = [ "-p0" ];
+
+  upstreamPatches =
+    (let
+       patch = nr: sha256:
+         fetchurl {
+           url = "mirror://gnu/readline/readline-${meta.branch}-patches/readline81-${nr}";
+           inherit sha256;
+         };
+     in
+       import ./readline-8.1-patches.nix patch);
+
+  patches =
+    [ ./link-against-ncurses.patch
+      ./no-arch_only-6.3.patch
+    ]
+    ++ upstreamPatches;
+
+  meta = with lib; {
+    description = "Library for interactive line editing";
+
+    longDescription = ''
+      The GNU Readline library provides a set of functions for use by
+      applications that allow users to edit command lines as they are
+      typed in.  Both Emacs and vi editing modes are available.  The
+      Readline library includes additional functions to maintain a
+      list of previously-entered command lines, to recall and perhaps
+      reedit those lines, and perform csh-like history expansion on
+      previous commands.
+
+      The history facilities are also placed into a separate library,
+      the History library, as part of the build process.  The History
+      library may be used without Readline in applications which
+      desire its capabilities.
+    '';
+
+    homepage = "https://savannah.gnu.org/projects/readline/";
+
+    license = licenses.gpl3Plus;
+
+    maintainers = with maintainers; [ dtzWill ];
+
+    platforms = platforms.unix;
+    branch = "8.1";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/readline/android.patch b/nixpkgs/pkgs/development/libraries/readline/android.patch
new file mode 100644
index 000000000000..7e81774be369
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/android.patch
@@ -0,0 +1,16 @@
+diff --git histlib.h histlib.h
+index c938a10..925ab72 100644
+--- histlib.h
++++ histlib.h
+@@ -51,9 +51,9 @@
+ #endif
+ 
+ #ifndef member
+-#  ifndef strchr
++#  if !defined (strchr) && !defined (__STDC__)
+ extern char *strchr ();
+-#  endif
++#  endif /* !strchr && !__STDC__ */
+ #define member(c, s) ((c) ? ((char *)strchr ((s), (c)) != (char *)NULL) : 0)
+ #endif
+ 
diff --git a/nixpkgs/pkgs/development/libraries/readline/clang.patch b/nixpkgs/pkgs/development/libraries/readline/clang.patch
new file mode 100644
index 000000000000..42bb0be09c39
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/clang.patch
@@ -0,0 +1,13 @@
+diff --git a/support/shobj-conf b/support/shobj-conf
+index 5a63e80..4b2a741 100644
+--- support/shobj-conf
++++ support/shobj-conf
+@@ -189,7 +189,7 @@ darwin*|macosx*)
+ 	darwin[789]*|darwin10*)	SHOBJ_LDFLAGS=''
+ 			SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
+ 			;;
+-	*)		SHOBJ_LDFLAGS='-dynamic'
++	*)		SHOBJ_LDFLAGS='-dynamiclib'
+ 			SHLIB_XLDFLAGS='-arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
+ 			;;
+ 	esac
diff --git a/nixpkgs/pkgs/development/libraries/readline/link-against-ncurses.patch b/nixpkgs/pkgs/development/libraries/readline/link-against-ncurses.patch
new file mode 100644
index 000000000000..0fd0598f4650
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/link-against-ncurses.patch
@@ -0,0 +1,18 @@
+This patch is to make sure that `libncurses' is among the `NEEDED'
+dependencies of `libreadline.so' and `libhistory.so'.
+
+Failing to do that, applications linking against Readline are
+forced to explicitly link against libncurses as well; in addition,
+this trick doesn't work when using GNU ld's `--as-needed'.
+
+--- shlib/Makefile.in	2009-01-06 18:03:22.000000000 +0100
++++ shlib/Makefile.in	2009-07-27 14:43:25.000000000 +0200
+@@ -84,7 +84,7 @@ SHOBJ_LDFLAGS = @SHOBJ_LDFLAGS@
+ SHOBJ_XLDFLAGS = @SHOBJ_XLDFLAGS@
+ SHOBJ_LIBS = @SHOBJ_LIBS@
+ 
+-SHLIB_XLDFLAGS = @LDFLAGS@ @SHLIB_XLDFLAGS@
++SHLIB_XLDFLAGS = @LDFLAGS@ @SHLIB_XLDFLAGS@ -lncurses
+ SHLIB_LIBS = @SHLIB_LIBS@
+ 
+ SHLIB_DOT = @SHLIB_DOT@
diff --git a/nixpkgs/pkgs/development/libraries/readline/no-arch_only-6.3.patch b/nixpkgs/pkgs/development/libraries/readline/no-arch_only-6.3.patch
new file mode 100644
index 000000000000..7c46dbad962a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/no-arch_only-6.3.patch
@@ -0,0 +1,13 @@
+diff -ru -x '*~' readline-6.3-orig/support/shobj-conf readline-6.3/support/shobj-conf
+--- support/shobj-conf	2014-02-24 03:06:29.000000000 +0100
++++ support/shobj-conf	2014-07-22 11:18:52.000000000 +0200
+@@ -194,9 +194,6 @@
+ 	# Darwin 8 == Mac OS X 10.4; Mac OS X 10.N == Darwin N+4
+ 	*)
+ 		case "${host_os}" in
+-		darwin[89]*|darwin1[012]*)
+-			SHOBJ_ARCHFLAGS='-arch_only `/usr/bin/arch`'
+-			;;
+ 		 *) 	# Mac OS X 10.9 (Mavericks) and later
+ 			SHOBJ_ARCHFLAGS=
+ 			# for 32 and 64bit universal library
diff --git a/nixpkgs/pkgs/development/libraries/readline/no-arch_only.patch b/nixpkgs/pkgs/development/libraries/readline/no-arch_only.patch
new file mode 100644
index 000000000000..b23eab5d9d73
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/no-arch_only.patch
@@ -0,0 +1,14 @@
+diff -ru -x '*~' readline-6.2-orig/support/shobj-conf readline-6.2/support/shobj-conf
+--- support/shobj-conf	2009-10-28 14:20:21.000000000 +0100
++++ support/shobj-conf	2014-07-01 13:03:28.000000000 +0200
+@@ -168,8 +168,8 @@
+ 	SHLIB_LIBVERSION='$(SHLIB_MAJOR)$(SHLIB_MINOR).$(SHLIB_LIBSUFF)'
+ 	SHLIB_LIBSUFF='dylib'
+ 
+-	SHOBJ_LDFLAGS='-dynamiclib -dynamic -undefined dynamic_lookup -arch_only `/usr/bin/arch`'
+-	SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
++	SHOBJ_LDFLAGS='-dynamiclib -dynamic -undefined dynamic_lookup'
++	SHLIB_XLDFLAGS='-dynamiclib -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
+ 
+ 	SHLIB_LIBS='-lncurses'	# see if -lcurses works on MacOS X 10.1 
+ 	;;
diff --git a/nixpkgs/pkgs/development/libraries/readline/readline-6.2-patches.nix b/nixpkgs/pkgs/development/libraries/readline/readline-6.2-patches.nix
new file mode 100644
index 000000000000..9fdcb3743b72
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/readline-6.2-patches.nix
@@ -0,0 +1,9 @@
+# Automatically generated by `update-patch-set.sh'; do not edit.
+
+patch: [
+(patch "001" "1qxl74f4n0hv4a807byrgbk4ixd8m50apj3922q2ss9pfi0nra1q")
+(patch "002" "1m670g2xzib6r81315q9r24nh9brmxkpq07acch1fwxmih94jqqy")
+(patch "003" "0x13c9wir4r44v2vdg96y0ahn8kl3wcmb5y0xn15yvid6pzk28fb")
+(patch "004" "0xjlkxfssfsd6jwbqhfjs4hybcps0b9zgz8v86vbhnzag4j39g89")
+(patch "005" "1x61bjl3wgs1gwla9b3y1hh12m1j5qlbis22258mljjl9mg900pg")
+]
diff --git a/nixpkgs/pkgs/development/libraries/readline/readline-6.3-patches.nix b/nixpkgs/pkgs/development/libraries/readline/readline-6.3-patches.nix
new file mode 100644
index 000000000000..d0aaaf38f706
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/readline-6.3-patches.nix
@@ -0,0 +1,12 @@
+# Automatically generated by `update-patch-set.sh'; do not edit.
+
+patch: [
+(patch "001" "0vqlj22mkbn3x42qx2iqir7capx462dhagbzdw6hwxgfxavbny8s")
+(patch "002" "19g0l6vlfcqzwfwjj1slkmxzndjp4543hwrf26g8z216lp3h9qrr")
+(patch "003" "0bx53k876w8vwf4h2s6brr1i46ym87gi71bh8zl89n0gn3cbshgc")
+(patch "004" "1k2m8dg1awmjhmivdbx1c25866gfbpg0fy4845n8cw15zc3bjis5")
+(patch "005" "0jr7c28bzn882as5i54l53bhi723s1nkvzmwlh3rj6ld4bwqhxw7")
+(patch "006" "0mp5zgx50792gigkmjap3d0zpdv5qanii8djab7j6z69qsrpl8sw")
+(patch "007" "1sjv9w0mglh395i6hlq3ck7wdxvi2wyddlyb2j0jwg7cmnibayad")
+(patch "008" "11rpqhsxd132gc8455v51ma3a5zshznb0mh2p0zc5skcab7r7h1v")
+]
diff --git a/nixpkgs/pkgs/development/libraries/readline/readline-7.0-patches.nix b/nixpkgs/pkgs/development/libraries/readline/readline-7.0-patches.nix
new file mode 100644
index 000000000000..c34ef2bf97bb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/readline-7.0-patches.nix
@@ -0,0 +1,9 @@
+# Automatically generated by `update-patch-set.sh'; do not edit.
+
+patch: [
+(patch "001" "0xm3sxvwmss7ddyfb11n6pgcqd1aglnpy15g143vzcf75snb7hcs")
+(patch "002" "0n1dxmqsbjgrfxb1hgk5c6lsraw4ncbnzxlsx7m35nym6lncjiw7")
+(patch "003" "1027kmymniizcy0zbdlrczxfx3clxcdln5yq05q9yzlc6y9slhwy")
+(patch "004" "0r3bbaf12iz8m02z6p3fzww2m365fhn71xmzab2p62gj54s6h9gr")
+(patch "005" "0lxpa4f72y2nsgj6fgrhjk2nmmxvccys6aciwfxwchb5f21rq5fa")
+]
diff --git a/nixpkgs/pkgs/development/libraries/readline/readline-8.1-patches.nix b/nixpkgs/pkgs/development/libraries/readline/readline-8.1-patches.nix
new file mode 100644
index 000000000000..b8019fb33502
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/readline-8.1-patches.nix
@@ -0,0 +1,4 @@
+# Automatically generated by `update-patch-set.sh'; do not edit.
+
+patch: [
+]
diff --git a/nixpkgs/pkgs/development/libraries/readline/shobj-darwin.patch b/nixpkgs/pkgs/development/libraries/readline/shobj-darwin.patch
new file mode 100644
index 000000000000..a9199ca3e89a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readline/shobj-darwin.patch
@@ -0,0 +1,11 @@
+--- a/support/shobj-conf.orig	2006-04-11 06:15:43.000000000 -0700
++++ b/support/shobj-conf	2007-11-08 01:15:43.000000000 -0800
+@@ -171,7 +171,7 @@
+ 	SHLIB_LIBSUFF='dylib'
+ 
+ 	case "${host_os}" in
+-	darwin[78]*)	SHOBJ_LDFLAGS=''
++	darwin[789]*)	SHOBJ_LDFLAGS=''
+ 			SHLIB_XLDFLAGS='-dynamiclib -arch_only `/usr/bin/arch` -install_name $(libdir)/$@ -current_version $(SHLIB_MAJOR)$(SHLIB_MINOR) -compatibility_version $(SHLIB_MAJOR) -v'
+ 			;;
+ 	*)		SHOBJ_LDFLAGS='-dynamic'
diff --git a/nixpkgs/pkgs/development/libraries/readosm/default.nix b/nixpkgs/pkgs/development/libraries/readosm/default.nix
new file mode 100644
index 000000000000..f177dc768a69
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/readosm/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, expat, zlib, geos, libspatialite }:
+
+stdenv.mkDerivation rec {
+  pname = "readosm";
+  version = "1.1.0a";
+
+  src = fetchurl {
+    url = "https://www.gaia-gis.it/gaia-sins/readosm-sources/${pname}-${version}.tar.gz";
+    sha256 = "0igif2bxf4dr82glxz9gyx5mmni0r2dsnx9p9k6pxv3c4lfhaz6v";
+  };
+
+  buildInputs = [ expat zlib geos libspatialite ];
+
+  configureFlags = [ "--disable-freexl" ];
+
+  enableParallelBuilding = true;
+
+  meta = {
+    description = "An open source library to extract valid data from within an Open Street Map input file";
+    homepage = "https://www.gaia-gis.it/fossil/readosm";
+    license = with lib.licenses; [ mpl11 gpl2Plus lgpl21Plus ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/relibc/default.nix b/nixpkgs/pkgs/development/libraries/relibc/default.nix
new file mode 100644
index 000000000000..5f27f902fa9b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/relibc/default.nix
@@ -0,0 +1,78 @@
+{ lib, stdenvNoCC, buildPackages, makeRustPlatform }:
+
+let
+  rpath = lib.makeLibraryPath [
+    buildPackages.stdenv.cc.libc
+    "$out"
+  ];
+  bootstrapCrossRust = stdenvNoCC.mkDerivation {
+    name = "binary-redox-rust";
+
+    src = buildPackages.fetchzip {
+      name = "redox-rust-toolchain.tar.gz";
+      url = "https://www.dropbox.com/s/qt7as0j7cwnin8z/redox-rust-toolchain.tar.gz?dl=1";
+      sha256 = "1g17qp2q6b88p04yclkw6amm374pqlakrmw9kd86vw8z4g70jkxm";
+    };
+
+    dontBuild = true;
+    dontPatchELF = true;
+    dontStrip = true;
+    installPhase = ''
+      mkdir $out/
+      cp -r * $out/
+
+      find $out/ -executable -type f -exec patchelf \
+          --set-interpreter "${buildPackages.stdenv.cc.libc}/lib/ld-linux-x86-64.so.2" \
+          --set-rpath "${rpath}" \
+          "{}" \;
+      find $out/ -name "*.so" -type f -exec patchelf \
+          --set-rpath "${rpath}" \
+          "{}" \;
+    '';
+
+    meta.platforms = with lib; platforms.redox ++ platforms.linux;
+  };
+
+  redoxRustPlatform = buildPackages.makeRustPlatform {
+    rustc = bootstrapCrossRust;
+    cargo = bootstrapCrossRust;
+  };
+
+in
+redoxRustPlatform.buildRustPackage rec {
+  pname = "relibc";
+  version = "latest";
+
+  LD_LIBRARY_PATH = "${buildPackages.zlib}/lib";
+
+  src = buildPackages.fetchgit {
+    url = "https://gitlab.redox-os.org/redox-os/relibc/";
+    rev = "5af8e3ca35ad401014a867ac1a0cc3b08dee682b";
+    sha256 = "1j4wsga9psl453031izkl3clkvm31d1wg4y8f3yqqvhml2aliws5";
+    fetchSubmodules = true;
+  };
+
+  RUSTC_BOOTSTRAP = 1;
+
+  dontInstall = true;
+  dontFixup = true;
+  doCheck = false;
+
+  postBuild = ''
+    mkdir -p $out
+    DESTDIR=$out make install
+  '';
+
+  # TODO: should be hostPlatform
+  TARGET = buildPackages.rust.toRustTargetSpec stdenvNoCC.targetPlatform;
+
+  cargoSha256 = "1fzz7ba3ga57x1cbdrcfrdwwjr70nh4skrpxp4j2gak2c3scj6rz";
+
+  meta = with lib; {
+    homepage = "https://gitlab.redox-os.org/redox-os/relibc";
+    description = "C Library in Rust for Redox and Linux";
+    license = licenses.mit;
+    maintainers = [ maintainers.aaronjanse ];
+    platforms = platforms.redox;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rep-gtk/default.nix b/nixpkgs/pkgs/development/libraries/rep-gtk/default.nix
new file mode 100644
index 000000000000..433da05d088f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rep-gtk/default.nix
@@ -0,0 +1,40 @@
+{ lib
+, stdenv
+, fetchurl
+, autoreconfHook
+, gtk2
+, librep
+, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "rep-gtk";
+  version = "0.90.8.3";
+
+  src = fetchurl {
+    url = "https://download.tuxfamily.org/librep/${pname}/${pname}_${version}.tar.xz";
+    sha256 = "0hgkkywm8zczir3lqr727bn7ybgg71x9cwj1av8fykkr8pdpard9";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+  ];
+  buildInputs = [
+    gtk2
+    librep
+  ];
+
+  patchPhase = ''
+    sed -e 's|installdir=$(repexecdir)|installdir=$(libdir)/rep|g' -i Makefile.in
+  '';
+
+  meta = with lib; {
+    homepage = "http://sawfish.tuxfamily.org";
+    description = "GTK bindings for librep";
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.AndersonTorres ];
+    platforms = platforms.unix;
+  };
+}
+# TODO: investigate fetchFromGithub
diff --git a/nixpkgs/pkgs/development/libraries/rep-gtk/setup-hook.sh b/nixpkgs/pkgs/development/libraries/rep-gtk/setup-hook.sh
new file mode 100644
index 000000000000..4d875b693304
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rep-gtk/setup-hook.sh
@@ -0,0 +1,5 @@
+addRepDLLoadPath () {
+    addToSearchPath REP_DL_LOAD_PATH $1/lib/rep
+}
+
+addEnvHooks "$hostOffset" addRepDLLoadPath
diff --git a/nixpkgs/pkgs/development/libraries/reproc/default.nix b/nixpkgs/pkgs/development/libraries/reproc/default.nix
new file mode 100644
index 000000000000..cd5bc5b7dcee
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/reproc/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, lib, fetchFromGitHub, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "reproc";
+  version = "14.2.3";
+
+  src = fetchFromGitHub {
+    owner = "DaanDeMeyer";
+    repo = "reproc";
+    rev = "v${version}";
+    sha256 = "sha256-bdZ7czkeoSl5znGit0AYQ9D4K8qE2Co+F2Z4jLJuQok=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DCMAKE_INSTALL_LIBDIR=lib"
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DREPROC++=ON"
+    "-DREPROC_TEST=ON"
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/DaanDeMeyer/reproc";
+    description = "A cross-platform (C99/C++11) process library";
+    license = licenses.mit;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/resolv_wrapper/default.nix b/nixpkgs/pkgs/development/libraries/resolv_wrapper/default.nix
new file mode 100644
index 000000000000..69ec01747484
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/resolv_wrapper/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, fetchurl, cmake, pkg-config }:
+
+stdenv.mkDerivation rec {
+  name = "resolv_wrapper-1.1.7";
+
+  src = fetchurl {
+    url = "mirror://samba/cwrap/${name}.tar.gz";
+    sha256 = "sha256-Rgrn/V5TSFvn3ZmlXFki8csWNrnoghmB1JrRZQfIoHQ=";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  meta = with lib; {
+    description = "A wrapper for the user, group and hosts NSS API";
+    homepage = "https://git.samba.org/?p=uid_wrapper.git;a=summary;";
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/retro-gtk/default.nix b/nixpkgs/pkgs/development/libraries/retro-gtk/default.nix
new file mode 100644
index 000000000000..3ab3ffcda0d3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/retro-gtk/default.nix
@@ -0,0 +1,70 @@
+{ lib
+, stdenv
+, fetchurl
+, cmake
+, meson
+, ninja
+, pkg-config
+, epoxy
+, glib
+, gtk3
+, libpulseaudio
+, libsamplerate
+, gobject-introspection
+, vala
+, gtk-doc
+}:
+
+stdenv.mkDerivation rec {
+  pname = "retro-gtk";
+  version = "1.0.2";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/retro-gtk/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1lnb7dwcj3lrrvdzd85dxwrlid28xf4qdbrgfjyg1wn1z6sv063i";
+  };
+
+  patches = [
+    # https://gitlab.gnome.org/GNOME/retro-gtk/-/merge_requests/150
+    ./gio-unix.patch
+  ];
+
+  nativeBuildInputs = [
+    gobject-introspection
+    gtk-doc
+    meson
+    ninja
+    pkg-config
+    vala
+  ];
+
+  buildInputs = [
+    epoxy
+    glib
+    gtk3
+    libpulseaudio
+    libsamplerate
+  ];
+
+  meta = with lib; {
+    description = "The GTK Libretro frontend framework";
+    longDescription = ''
+      Libretro is a plugin format design to implement video game
+      console emulators, video games and similar multimedia
+      software. Such plugins are called Libretro cores.
+
+      RetroGTK is a framework easing the use of Libretro cores in
+      conjunction with GTK.
+
+      It encourages the cores to be installed in a well defined
+      centralized place — namely the libretro subdirectory of your lib
+      directory — and it recommends them to come with Libretro core
+      descriptors.
+    '';
+    homepage = "https://gitlab.gnome.org/GNOME/retro-gtk";
+    changelog = "https://gitlab.gnome.org/GNOME/retro-gtk/-/blob/master/NEWS";
+    license = licenses.gpl3Plus;
+    maintainers = [ maintainers.DamienCassou ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/retro-gtk/gio-unix.patch b/nixpkgs/pkgs/development/libraries/retro-gtk/gio-unix.patch
new file mode 100644
index 000000000000..91f561c6504f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/retro-gtk/gio-unix.patch
@@ -0,0 +1,11 @@
+--- a/retro-gtk/meson.build 2021-03-21 20:25:51.000000000 +0100
++++ b/retro-gtk/meson.build 2021-05-23 17:36:46.793693816 +0200
+@@ -103,6 +103,7 @@
+ retro_gtk_deps = [
+   epoxy,
+   gio,
++  gio_unix,
+   glib,
+   gmodule,
+   gobject,
+   
diff --git a/nixpkgs/pkgs/development/libraries/rinutils/default.nix b/nixpkgs/pkgs/development/libraries/rinutils/default.nix
new file mode 100644
index 000000000000..35e48140fdd3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rinutils/default.nix
@@ -0,0 +1,21 @@
+{
+  stdenv, lib, fetchurl,
+  cmake, perl,
+}:
+
+stdenv.mkDerivation rec {
+  pname = "rinutils";
+  version = "0.8.0";
+
+  meta = with lib; {
+    homepage = "https://github.com/shlomif/rinutils";
+    license = licenses.mit;
+  };
+
+  src = fetchurl {
+    url = "https://github.com/shlomif/${pname}/releases/download/${version}/${pname}-${version}.tar.xz";
+    sha256 = "1q09aihm5m42xiq2prpa9mf0srwiirzgzblkp5nl74i7zg6pg5hx";
+  };
+
+  nativeBuildInputs = [ cmake perl ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/rlog/default.nix b/nixpkgs/pkgs/development/libraries/rlog/default.nix
new file mode 100644
index 000000000000..88a96209993b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rlog/default.nix
@@ -0,0 +1,17 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  name = "rlog-1.4";
+
+  src = fetchurl {
+    url = "http://rlog.googlecode.com/files/rlog-1.4.tar.gz";
+    sha256 = "0y9zg0pd7vmnskwac1qdyzl282z7kb01nmn57lsg2mjdxgnywf59";
+  };
+
+  meta = {
+    homepage = "https://www.arg0.net/rlog";
+    description = "A C++ logging library used in encfs";
+    platforms = lib.platforms.linux;
+    license = lib.licenses.lgpl3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rlottie/default.nix b/nixpkgs/pkgs/development/libraries/rlottie/default.nix
new file mode 100644
index 000000000000..f1d3ffd02124
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rlottie/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "rlottie";
+  version = "0.2";
+
+  src = fetchFromGitHub {
+    owner = "Samsung";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "10bxr1zf9wxl55d4cw2j02r6sgqln7mbxplhhfvhw0z92fi40kr3";
+  };
+
+  nativeBuildInputs = [ meson ninja pkg-config ];
+
+  meta = with lib; {
+    homepage = "https://github.com/Samsung/rlottie";
+    description = "A platform independent standalone c++ library for rendering vector based animations and art in realtime";
+    license = with licenses; [ mit bsd3 mpl11 ftl ];
+    platforms = platforms.all;
+    maintainers = with maintainers; [ CRTified ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rnnoise-plugin/default.nix b/nixpkgs/pkgs/development/libraries/rnnoise-plugin/default.nix
new file mode 100644
index 000000000000..e68f74e28960
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rnnoise-plugin/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, SDL2, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "rnnoise-plugin";
+  version = "0.91";
+
+  src = fetchFromGitHub {
+    owner = "werman";
+    repo = "noise-suppression-for-voice";
+    rev = "v${version}";
+    sha256 = "11pwisbcks7g0mdgcrrv49v3ci1l6m26bbb7f67xz4pr1hai5dwc";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ];
+
+  meta = with lib; {
+    description = "A real-time noise suppression plugin for voice based on Xiph's RNNoise";
+    homepage = "https://github.com/werman/noise-suppression-for-voice";
+    license = licenses.gpl3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ panaeon henrikolsson ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rnnoise/default.nix b/nixpkgs/pkgs/development/libraries/rnnoise/default.nix
new file mode 100644
index 000000000000..ad587f0f5839
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rnnoise/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, lib, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation (rec {
+  pname = "rnnoise";
+  version = "2021-01-22";
+
+  src = fetchFromGitHub {
+    owner = "xiph";
+    repo = "rnnoise";
+    rev = "1cbdbcf1283499bbb2230a6b0f126eb9b236defd";
+    sha256 = "1y0rzgmvy8bf9a431garpm2w177s6ajgf79y5ymw4yb0pik57rwb";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  postInstall = ''
+    install -Dt $out/bin examples/.libs/rnnoise_demo
+  '';
+
+  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
new file mode 100644
index 000000000000..a0a068dc1422
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/robin-map/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "robin-map";
+  version = "0.6.3";
+
+  src = fetchFromGitHub {
+    owner = "Tessil";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1li70vwsksva9c4yly90hjafgqfixi1g6d52qq9p6r60vqc4pkjj";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://github.com/Tessil/robin-map";
+    description = "C++ implementation of a fast hash map and hash set using robin hood hashing";
+    license = licenses.mit;
+    maintainers = with maintainers; [ goibhniu jtojnar ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rocclr/default.nix b/nixpkgs/pkgs/development/libraries/rocclr/default.nix
new file mode 100644
index 000000000000..cf085d50edb0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rocclr/default.nix
@@ -0,0 +1,64 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, rocm-cmake
+, clang
+, rocm-comgr
+, rocm-opencl-runtime
+, rocm-runtime
+, rocm-thunk
+, libelf
+, libglvnd
+, libX11
+, numactl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "rocclr";
+  version = "4.1.0";
+
+  src = fetchFromGitHub {
+    owner = "ROCm-Developer-Tools";
+    repo = "ROCclr";
+    rev = "rocm-${version}";
+    hash = "sha256-2DI/PL29aiZcxOrGZBzXwAnNgZQpSDjyyGKgl+vDErk=";
+  };
+
+  nativeBuildInputs = [ cmake rocm-cmake ];
+
+  buildInputs = [ clang rocm-comgr rocm-runtime rocm-thunk ];
+
+  propagatedBuildInputs = [ libelf libglvnd libX11 numactl ];
+
+  prePatch = ''
+    substituteInPlace CMakeLists.txt \
+      --replace 'set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ''${CMAKE_CURRENT_BINARY_DIR}/lib)' \
+        'set (CMAKE_LIBRARY_OUTPUT_DIRECTORY ''${CMAKE_INSTALL_LIBDIR})'
+    substituteInPlace device/comgrctx.cpp \
+      --replace "libamd_comgr.so" "${rocm-comgr}/lib/libamd_comgr.so"
+  '';
+
+  cmakeFlags = [
+    "-DOPENCL_DIR=${rocm-opencl-runtime.src}"
+  ];
+
+  preFixup = ''
+    # Work around broken cmake files
+    ln -s $out/include/compiler/lib/include/* $out/include
+    ln -s $out/include/elf/elfio $out/include/elfio
+
+    substituteInPlace $out/lib/cmake/rocclr/ROCclrConfig.cmake \
+      --replace "/build/source/build" "$out"
+  '';
+
+  meta = with lib; {
+    description = "Radeon Open Compute common language runtime";
+    homepage = "https://github.com/ROCm-Developer-Tools/ROCclr";
+    license = licenses.mit;
+    maintainers = with maintainers; [ ];
+    # rocclr seems to have some AArch64 ifdefs, but does not seem
+    # to be supported yet by the build infrastructure. Recheck in
+    # the future.
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rocksdb/default.nix b/nixpkgs/pkgs/development/libraries/rocksdb/default.nix
new file mode 100644
index 000000000000..cfac0519c2aa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rocksdb/default.nix
@@ -0,0 +1,68 @@
+{ lib, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, ninja
+, bzip2
+, lz4
+, snappy
+, zlib
+, zstd
+, enableJemalloc ? false, jemalloc
+, enableLite ? false
+, enableShared ? !stdenv.hostPlatform.isStatic
+}:
+
+stdenv.mkDerivation rec {
+  pname = "rocksdb";
+  version = "6.23.3";
+
+  src = fetchFromGitHub {
+    owner = "facebook";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-SsDqhjdCdtIGNlsMj5kfiuS3zSGwcxi4KV71d95h7yk=";
+  };
+
+  nativeBuildInputs = [ cmake ninja ];
+
+  propagatedBuildInputs = [ bzip2 lz4 snappy zlib zstd ];
+
+  buildInputs = lib.optional enableJemalloc jemalloc;
+
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=deprecated-copy -Wno-error=pessimizing-move";
+
+  cmakeFlags = [
+    "-DPORTABLE=1"
+    "-DWITH_JEMALLOC=${if enableJemalloc then "1" else "0"}"
+    "-DWITH_JNI=0"
+    "-DWITH_BENCHMARK_TOOLS=0"
+    "-DWITH_TESTS=1"
+    "-DWITH_TOOLS=0"
+    "-DWITH_BZ2=1"
+    "-DWITH_LZ4=1"
+    "-DWITH_SNAPPY=1"
+    "-DWITH_ZLIB=1"
+    "-DWITH_ZSTD=1"
+    "-DWITH_GFLAGS=0"
+    "-DUSE_RTTI=1"
+    "-DROCKSDB_INSTALL_ON_WINDOWS=YES" # harmless elsewhere
+    (lib.optional
+        (stdenv.hostPlatform.isx86 && stdenv.hostPlatform.isLinux)
+        "-DFORCE_SSE42=1")
+    (lib.optional enableLite "-DROCKSDB_LITE=1")
+    "-DFAIL_ON_WARNINGS=${if stdenv.hostPlatform.isMinGW then "NO" else "YES"}"
+  ] ++ lib.optional (!enableShared) "-DROCKSDB_BUILD_SHARED=0";
+
+  # otherwise "cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]"
+  hardeningDisable = lib.optional stdenv.hostPlatform.isWindows "format";
+
+  meta = with lib; {
+    homepage = "https://rocksdb.org";
+    description = "A library that provides an embeddable, persistent key-value store for fast storage";
+    changelog = "https://github.com/facebook/rocksdb/raw/v${version}/HISTORY.md";
+    license = licenses.asl20;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ adev magenbluten ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rocm-comgr/default.nix b/nixpkgs/pkgs/development/libraries/rocm-comgr/default.nix
new file mode 100644
index 000000000000..95fe28ce9fd3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rocm-comgr/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchFromGitHub, cmake, clang, device-libs, lld, llvm }:
+
+stdenv.mkDerivation rec {
+  pname = "rocm-comgr";
+  version = "4.1.0";
+
+  src = fetchFromGitHub {
+    owner = "RadeonOpenCompute";
+    repo = "ROCm-CompilerSupport";
+    rev = "rocm-${version}";
+    hash = "sha256-LbQqyJxRqb6vpXiYSkRlF1FeqXJJXktPafGmYDDK02U=";
+  };
+
+  sourceRoot = "source/lib/comgr";
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ clang device-libs lld llvm ];
+
+  cmakeFlags = [
+    "-DCLANG=${clang}/bin/clang"
+    "-DCMAKE_BUILD_TYPE=Release"
+    "-DCMAKE_C_COMPILER=${clang}/bin/clang"
+    "-DCMAKE_CXX_COMPILER=${clang}/bin/clang++"
+    "-DCMAKE_PREFIX_PATH=${llvm}/lib/cmake/llvm"
+    "-DLLD_INCLUDE_DIRS=${lld.src}/include"
+    "-DLLVM_TARGETS_TO_BUILD=\"AMDGPU;X86\""
+  ];
+
+  # The comgr build tends to link against the static LLVM libraries
+  # *and* the dynamic library. Linking against both causes errors
+  # about command line options being registered twice. This patch
+  # removes the static library linking.
+  patchPhase = ''
+    sed -e '/^llvm_map_components_to_libnames/,/[[:space:]]*Symbolize)/d' \
+        -i CMakeLists.txt
+  '';
+
+  meta = with lib; {
+    description = "APIs for compiling and inspecting AMDGPU code objects";
+    homepage = "https://github.com/RadeonOpenCompute/ROCm-CompilerSupport/tree/amd-stg-open/lib/comgr";
+    license = licenses.ncsa;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rocm-device-libs/default.nix b/nixpkgs/pkgs/development/libraries/rocm-device-libs/default.nix
new file mode 100644
index 000000000000..383d91bd08c1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rocm-device-libs/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, clang
+, clang-unwrapped
+, lld
+, llvm
+}:
+
+stdenv.mkDerivation rec {
+  pname = "rocm-device-libs";
+  version = "4.1.0";
+
+  src = fetchFromGitHub {
+    owner = "RadeonOpenCompute";
+    repo = "ROCm-Device-Libs";
+    rev = "rocm-${version}";
+    hash = "sha256-9p6PIXdHFIgHgNWZzqVz5O9i2Np0z/iyxodG2cLrpGs=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ clang lld llvm ];
+
+  cmakeBuildType = "Release";
+
+  cmakeFlags = [
+    "-DCMAKE_PREFIX_PATH=${llvm}/lib/cmake/llvm;${clang-unwrapped}/lib/cmake/clang"
+    "-DLLVM_TARGETS_TO_BUILD='AMDGPU;X86'"
+    "-DCLANG=${clang}/bin/clang"
+  ];
+
+  meta = with lib; {
+    description = "Set of AMD-specific device-side language runtime libraries";
+    homepage = "https://github.com/RadeonOpenCompute/ROCm-Device-Libs";
+    license = licenses.ncsa;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rocm-opencl-icd/default.nix b/nixpkgs/pkgs/development/libraries/rocm-opencl-icd/default.nix
new file mode 100644
index 000000000000..0a9d124561e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rocm-opencl-icd/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, rocm-opencl-runtime }:
+
+stdenv.mkDerivation rec {
+  pname = "rocm-opencl-icd";
+  version = rocm-opencl-runtime.version;
+
+  dontUnpack = true;
+
+  installPhase = ''
+    mkdir -p $out/etc/OpenCL/vendors
+    echo "${rocm-opencl-runtime}/lib/libamdocl64.so" > $out/etc/OpenCL/vendors/amdocl64.icd
+  '';
+
+  meta = with lib; {
+    description = "OpenCL ICD definition for AMD GPUs using the ROCm stack";
+    license = licenses.mit;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rocm-opencl-runtime/default.nix b/nixpkgs/pkgs/development/libraries/rocm-opencl-runtime/default.nix
new file mode 100644
index 000000000000..40ffcae79246
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rocm-opencl-runtime/default.nix
@@ -0,0 +1,83 @@
+{ lib, stdenv
+, fetchFromGitHub
+, addOpenGLRunpath
+, cmake
+, rocm-cmake
+, clang
+, clang-unwrapped
+, glew
+, libglvnd
+, libX11
+, lld
+, llvm
+, mesa
+, python2
+, rocclr
+, rocm-comgr
+, rocm-device-libs
+, rocm-runtime
+, rocm-thunk
+}:
+
+stdenv.mkDerivation rec {
+  pname = "rocm-opencl-runtime";
+  version = "4.1.0";
+
+  src = fetchFromGitHub {
+    owner = "RadeonOpenCompute";
+    repo = "ROCm-OpenCL-Runtime";
+    rev = "rocm-${version}";
+    hash = "sha256-+6h1E5uWNKjjaeO5ZIi854CWYi0QGQ5mVUHdi9+4vX4=";
+  };
+
+  nativeBuildInputs = [ cmake rocm-cmake ];
+
+  buildInputs = [
+    clang
+    clang-unwrapped
+    glew
+    libglvnd
+    libX11
+    lld
+    llvm
+    mesa
+    python2
+    rocclr
+    rocm-comgr
+    rocm-device-libs
+    rocm-runtime
+    rocm-thunk
+  ];
+
+  cmakeFlags = [
+    "-DAMDGPU_TARGET_TRIPLE='amdgcn-amd-amdhsa'"
+    "-DCLANG_OPTIONS_APPEND=-Wno-bitwise-conditional-parentheses"
+    "-DClang_DIR=${clang-unwrapped}/lib/cmake/clang"
+    "-DLIBROCclr_STATIC_DIR=${rocclr}/lib/cmake"
+    "-DLLVM_DIR=${llvm.out}/lib/cmake/llvm"
+    "-DUSE_COMGR_LIBRARY='yes'"
+  ];
+
+  dontStrip = true;
+
+  # Remove clinfo, which is already provided through the
+  # `clinfo` package.
+  postInstall = ''
+    rm -rf $out/bin
+  '';
+
+  # Fix the ICD installation path for NixOS
+  postPatch = ''
+    substituteInPlace khronos/icd/loader/linux/icd_linux.c \
+      --replace 'ICD_VENDOR_PATH' '"${addOpenGLRunpath.driverLink}/etc/OpenCL/vendors/"'
+    echo 'add_dependencies(amdocl64 OpenCL)' >> amdocl/CMakeLists.txt
+  '';
+
+  meta = with lib; {
+    description = "OpenCL runtime for AMD GPUs, part of the ROCm stack";
+    homepage = "https://github.com/RadeonOpenCompute/ROCm-OpenCL-Runtime";
+    license = with licenses; [ asl20 mit ];
+    maintainers = with maintainers; [ ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rocm-runtime/default.nix b/nixpkgs/pkgs/development/libraries/rocm-runtime/default.nix
new file mode 100644
index 000000000000..eb4ce3c19fb6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rocm-runtime/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv
+, fetchFromGitHub
+, addOpenGLRunpath
+, clang-unwrapped
+, cmake
+, xxd
+, elfutils
+, llvm
+, rocm-device-libs
+, rocm-thunk }:
+
+stdenv.mkDerivation rec {
+  pname = "rocm-runtime";
+  version = "4.1.0";
+
+  src = fetchFromGitHub {
+    owner = "RadeonOpenCompute";
+    repo = "ROCR-Runtime";
+    rev = "rocm-${version}";
+    hash = "sha256-Jxg3n203tV0L+UrmeQEuzX0TKpFu5An2cnuEA/F/SNY=";
+  };
+
+  sourceRoot = "source/src";
+
+  nativeBuildInputs = [ cmake xxd ];
+
+  buildInputs = [ clang-unwrapped elfutils llvm ];
+
+  cmakeFlags = [
+   "-DBITCODE_DIR=${rocm-device-libs}/amdgcn/bitcode"
+   "-DCMAKE_PREFIX_PATH=${rocm-thunk}"
+  ];
+
+  postPatch = ''
+    patchShebangs image/blit_src/create_hsaco_ascii_file.sh
+  '';
+
+  fixupPhase = ''
+    rm -rf $out/hsa
+  '';
+
+  meta = with lib; {
+    description = "Platform runtime for ROCm";
+    homepage = "https://github.com/RadeonOpenCompute/ROCR-Runtime";
+    license = with licenses; [ ncsa ];
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rocm-thunk/default.nix b/nixpkgs/pkgs/development/libraries/rocm-thunk/default.nix
new file mode 100644
index 000000000000..770dd16740ca
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rocm-thunk/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+, numactl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "rocm-thunk";
+  version = "4.1.0";
+
+  src = fetchFromGitHub {
+    owner = "RadeonOpenCompute";
+    repo = "ROCT-Thunk-Interface";
+    rev = "rocm-${version}";
+    hash = "sha256-gdto7BbrSRa3UiRNvTW1KLkHyjrcxdah4+L+1Gdm0wA=";
+  };
+
+  preConfigure = ''
+    export cmakeFlags="$cmakeFlags "
+  '';
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = [ numactl ];
+
+  postInstall = ''
+    cp -r $src/include $out
+  '';
+
+  meta = with lib; {
+    description = "Radeon open compute thunk interface";
+    homepage = "https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface";
+    license = with licenses; [ bsd2 mit ];
+    maintainers = with maintainers; [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rote/default.nix b/nixpkgs/pkgs/development/libraries/rote/default.nix
new file mode 100644
index 000000000000..e5fb04626836
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rote/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, ncurses }:
+
+stdenv.mkDerivation rec {
+  pname = "rote";
+  version = "0.2.8";
+
+  src = fetchurl {
+    sha256 = "05v1lw99jv4cwxl7spyi7by61j2scpdsvx809x5cga7dm5dhlmky";
+    url = "mirror://sourceforge/rote/${pname}-${version}.tar.gz";
+  };
+
+  buildInputs = [ ncurses ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Our Own Terminal Emulation Library";
+    longDescription = ''
+      ROTE is a simple C library for VT102 terminal emulation. It allows the
+      programmer to set up virtual 'screens' and send them data. The virtual
+      screens will emulate the behavior of a VT102 terminal, interpreting
+      escape sequences, control characters and such. The library supports
+      ncurses as well so that you may render the virtual screen to the real
+      screen when you need to.
+    '';
+    homepage = "http://rote.sourceforge.net/";
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rttr/default.nix b/nixpkgs/pkgs/development/libraries/rttr/default.nix
new file mode 100644
index 000000000000..b0f4f2a567a2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rttr/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, cmake, ninja }:
+
+stdenv.mkDerivation rec {
+  pname = "rttr";
+  version = "0.9.6";
+
+  src = fetchFromGitHub {
+    owner = "${pname}org";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1yxad8sj40wi75hny8w6imrsx8wjasjmsipnlq559n4b6kl84ijp";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    ninja
+  ];
+
+  cmakeFlags = [
+    "-DBUILD_EXAMPLES=OFF"
+    "-DBUILD_UNIT_TESTS=OFF"
+    "-DBUILD_PACKAGE=OFF"
+  ];
+
+  meta = with lib; {
+    description = "C++ Reflection Library";
+    homepage = "https://www.rttr.org";
+    license = licenses.mit;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rubberband/default.nix b/nixpkgs/pkgs/development/libraries/rubberband/default.nix
new file mode 100644
index 000000000000..7fc8fe98db29
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rubberband/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl, pkg-config, libsamplerate, libsndfile, fftw
+, vamp-plugin-sdk, ladspaH }:
+
+stdenv.mkDerivation rec {
+  pname = "rubberband";
+  version = "1.9.0";
+
+  src = fetchurl {
+    url = "https://breakfastquay.com/files/releases/${pname}-${version}.tar.bz2";
+    sha256 = "4f5b9509364ea876b4052fc390c079a3ad4ab63a2683aad09662fb905c2dc026";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libsamplerate libsndfile fftw vamp-plugin-sdk ladspaH ];
+
+  meta = with lib; {
+    description = "High quality software library for audio time-stretching and pitch-shifting";
+    homepage = "https://breakfastquay.com/rubberband/";
+    # commercial license available as well, see homepage. You'll get some more optimized routines
+    license = licenses.gpl2Plus;
+    maintainers = [ maintainers.goibhniu maintainers.marcweber ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/rustc-demangle/add-Cargo.lock.patch b/nixpkgs/pkgs/development/libraries/rustc-demangle/add-Cargo.lock.patch
new file mode 100644
index 000000000000..66e8bead8a26
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rustc-demangle/add-Cargo.lock.patch
@@ -0,0 +1,73 @@
+diff --git a/Cargo.lock b/Cargo.lock
+new file mode 100644
+index 0000000..0268b3b
+--- /dev/null
++++ b/Cargo.lock
+@@ -0,0 +1,67 @@
++# This file is automatically @generated by Cargo.
++# It is not intended for manual editing.
++version = 3
++
++[[package]]
++name = "arbitrary"
++version = "1.0.1"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "237430fd6ed3740afe94eefcc278ae21e050285be882804e0d6e8695f0c94691"
++
++[[package]]
++name = "cc"
++version = "1.0.69"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "e70cc2f62c6ce1868963827bd677764c62d07c3d9a3e1fb1177ee1a9ab199eb2"
++
++[[package]]
++name = "compiler_builtins"
++version = "0.1.49"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "20b1438ef42c655665a8ab2c1c6d605a305f031d38d9be689ddfef41a20f3aa2"
++
++[[package]]
++name = "libfuzzer-sys"
++version = "0.4.2"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "36a9a84a6e8b55dfefb04235e55edb2b9a2a18488fcae777a6bdaa6f06f1deb3"
++dependencies = [
++ "arbitrary",
++ "cc",
++ "once_cell",
++]
++
++[[package]]
++name = "once_cell"
++version = "1.8.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56"
++
++[[package]]
++name = "rustc-demangle"
++version = "0.1.20"
++dependencies = [
++ "compiler_builtins",
++ "rustc-std-workspace-core",
++]
++
++[[package]]
++name = "rustc-demangle-capi"
++version = "0.1.0"
++dependencies = [
++ "rustc-demangle",
++]
++
++[[package]]
++name = "rustc-demangle-fuzz"
++version = "0.0.0"
++dependencies = [
++ "libfuzzer-sys",
++ "rustc-demangle",
++]
++
++[[package]]
++name = "rustc-std-workspace-core"
++version = "1.0.0"
++source = "registry+https://github.com/rust-lang/crates.io-index"
++checksum = "1956f5517128a2b6f23ab2dadf1a976f4f5b27962e7724c2bf3d45e539ec098c"
diff --git a/nixpkgs/pkgs/development/libraries/rustc-demangle/default.nix b/nixpkgs/pkgs/development/libraries/rustc-demangle/default.nix
new file mode 100644
index 000000000000..be02fedfde71
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/rustc-demangle/default.nix
@@ -0,0 +1,34 @@
+{ rustPlatform, fetchFromGitHub, rust, lib, stdenv }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "rustc-demangle";
+  version = "0.1.20";
+
+  src = fetchFromGitHub {
+    owner = "alexcrichton";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-elxclyuLmr3N66s+pR4/6OU98k1oXI2wKVJtzWPY8FI=";
+  };
+
+  cargoPatches = [
+    # generated using `cargo generate-lockfile` since repo is missing lockfile
+    ./add-Cargo.lock.patch
+  ];
+  cargoSha256 = "sha256-1tW5TOap5MstxTXAFij3IB8TIpI+FryEX9TXlVXjRl4=";
+  cargoBuildFlags = "-p rustc-demangle-capi";
+  postInstall = ''
+    mkdir -p $out/lib
+    cp target/${rust.toRustTargetSpec stdenv.hostPlatform}/release/librustc_demangle.so $out/lib
+    cp -R crates/capi/include $out
+  '';
+
+  meta = with lib; {
+    description = "Rust symbol demangling";
+    homepage = "https://github.com/alexcrichton/rustc-demangle";
+    license = with licenses; [ asl20 mit ];
+    # upstream supports other platforms, but maintainer can only test on linux
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ _1000teslas ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/s2geometry/default.nix b/nixpkgs/pkgs/development/libraries/s2geometry/default.nix
new file mode 100644
index 000000000000..afd5ffa0a0a2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/s2geometry/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, lib, fetchFromGitHub, fetchpatch, cmake, pkg-config, openssl, gtest }:
+
+stdenv.mkDerivation rec {
+  pname = "s2geometry";
+  version = "0.9.0";
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "s2geometry";
+    rev = "v${version}";
+    sha256 = "1mx61bnn2f6bd281qlhn667q6yfg1pxzd2js88l5wpkqlfzzhfaz";
+  };
+
+  patches = [
+    # Fix build https://github.com/google/s2geometry/issues/165
+    (fetchpatch {
+      url = "https://github.com/google/s2geometry/commit/a4dddf40647c68cd0104eafc31e9c8fb247a6308.patch";
+      sha256 = "0fp3w4bg7pgf5vv4vacp9g06rbqzhxc2fg6i5appp93q6phiinvi";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ openssl gtest ];
+
+  meta = with lib; {
+    description = "Computational geometry and spatial indexing on the sphere";
+    homepage = "http://s2geometry.io/";
+    license = licenses.asl20;
+    maintainers = [ maintainers.Thra11 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/s2n-tls/default.nix b/nixpkgs/pkgs/development/libraries/s2n-tls/default.nix
new file mode 100644
index 000000000000..be4b9710533b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/s2n-tls/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchFromGitHub, cmake, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "s2n-tls";
+  version = "1.0.16";
+
+  src = fetchFromGitHub {
+    owner = "aws";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-gF4VhNEq/gpxXqOKvBtWZ5iZ3Jf98vSuSZYUu8r1jKA=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  outputs = [ "out" "dev"];
+
+  buildInputs = [ openssl ]; # s2n-config has find_dependency(LibCrypto).
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DCMAKE_SKIP_BUILD_RPATH=OFF"
+    "-DUNSAFE_TREAT_WARNINGS_AS_ERRORS=OFF" # disable -Werror
+  ];
+
+  propagatedBuildInputs = [ openssl ]; # s2n-config has find_dependency(LibCrypto).
+
+  postInstall = ''
+    substituteInPlace $out/lib/s2n/cmake/shared/s2n-targets.cmake \
+      --replace 'INTERFACE_INCLUDE_DIRECTORIES "''${_IMPORT_PREFIX}/include"' 'INTERFACE_INCLUDE_DIRECTORIES ""'
+  '';
+
+  meta = with lib; {
+    description = "C99 implementation of the TLS/SSL protocols";
+    homepage = "https://github.com/aws/s2n-tls";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ orivej ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/safefile/default.nix b/nixpkgs/pkgs/development/libraries/safefile/default.nix
new file mode 100644
index 000000000000..2865ab06319f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/safefile/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, path, runtimeShell }:
+stdenv.mkDerivation rec {
+  pname = "safefile";
+  version = "1.0.5";
+
+  src = fetchurl {
+    url = "http://research.cs.wisc.edu/mist/${pname}/releases/${pname}-${version}.tar.gz";
+    sha256 = "1y0gikds2nr8jk8smhrl617njk23ymmpxyjb2j1xbj0k82xspv78";
+  };
+
+  passthru = {
+    updateScript = ''
+      #!${runtimeShell}
+      cd ${toString ./.}
+      ${toString path}/pkgs/build-support/upstream-updater/update-walker.sh default.nix
+    '';
+  };
+
+  meta = {
+    description = "File open routines to safely open a file when in the presence of an attack";
+    license = lib.licenses.asl20 ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.all;
+    homepage = "https://research.cs.wisc.edu/mist/safefile/";
+    updateWalker = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sbc/default.nix b/nixpkgs/pkgs/development/libraries/sbc/default.nix
new file mode 100644
index 000000000000..edab4037a154
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sbc/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, pkg-config, libsndfile }:
+
+stdenv.mkDerivation rec {
+  pname = "sbc";
+  version = "1.4";
+
+  src = fetchurl {
+    url = "https://www.kernel.org/pub/linux/bluetooth/${pname}-${version}.tar.xz";
+    sha256 = "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libsndfile ];
+
+  meta = with lib; {
+    description = "SubBand Codec Library";
+    homepage = "http://www.bluez.org/";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sblim-sfcc/default.nix b/nixpkgs/pkgs/development/libraries/sblim-sfcc/default.nix
new file mode 100644
index 000000000000..351eb5c15479
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sblim-sfcc/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, curl }:
+
+stdenv.mkDerivation rec {
+  pname = "sblim-sfcc";
+  version = "2.2.9"; # this is technically 2.2.9-preview
+
+  src = fetchFromGitHub {
+    owner  = "kkaempf";
+    repo   = "sblim-sfcc";
+    rev    = "514a76af2020fd6dc6fc380df76cbe27786a76a2";
+    sha256 = "06c1mskl9ixbf26v88w0lvn6v2xd6n5f0jd5mckqrn9j4vmh70hs";
+  };
+
+  buildInputs = [ curl ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Small Footprint CIM Client Library";
+    homepage    = "https://sourceforge.net/projects/sblim/";
+    license     = licenses.cpl10;
+    maintainers = with maintainers; [ deepfire ];
+    platforms   = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/schroedinger/default.nix b/nixpkgs/pkgs/development/libraries/schroedinger/default.nix
new file mode 100644
index 000000000000..2b49bfeb498e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/schroedinger/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, orc, pkg-config, fetchpatch, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "schroedinger";
+  version = "1.0.11";
+
+  src = fetchurl {
+    url = "https://download.videolan.org/contrib/${pname}-${version}.tar.gz";
+    sha256 = "04prr667l4sn4zx256v1z36a0nnkxfdqyln48rbwlamr6l3jlmqy";
+  };
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
+  buildInputs = [ orc ];
+
+  doCheck = (!stdenv.isDarwin);
+
+  patchFlags = [ "-p0" ];
+  patches = [
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/macports/macports-ports/master/multimedia/schroedinger/files/patch-testsuite-Makefile.am.diff";
+      sha256 = "0cc8ymvgjgwy7ghca2dd8m8pxpinf27s2i8krf2m3fzv2ckq09v3";
+    })
+  ];
+
+  meta = with lib; {
+    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/astronomy/cfitsio/darwin-rpath-universal.patch b/nixpkgs/pkgs/development/libraries/science/astronomy/cfitsio/darwin-rpath-universal.patch
new file mode 100644
index 000000000000..af38abf329ea
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/astronomy/cfitsio/darwin-rpath-universal.patch
@@ -0,0 +1,21 @@
+diff -ruN cfitsio/configure cfitsio-rpath-universal/configure
+--- cfitsio/configure	2018-05-09 21:16:00.000000000 +0200
++++ cfitsio-rpath-universal/configure	2018-05-31 12:02:25.000000000 +0200
+@@ -4727,16 +4727,7 @@
+     SHLIB_SUFFIX=".dylib"
+     CFITSIO_SHLIB="lib\${PACKAGE}.\${CFITSIO_SONAME}.\${CFITSIO_MAJOR}.\${CFITSIO_MINOR}\${SHLIB_SUFFIX}"
+     CFITSIO_SHLIB_SONAME="lib\${PACKAGE}.\${CFITSIO_SONAME}\${SHLIB_SUFFIX}"
+-    case $host in
+-        *darwin[56789]*)
+-            SHLIB_LD="$CC -dynamiclib -install_name lib\${PACKAGE}.\${CFITSIO_SONAME}\${SHLIB_SUFFIX} -compatibility_version \${CFITSIO_SONAME} -current_version \${CFITSIO_SONAME}.\${CFITSIO_MAJOR}.\${CFITSIO_MINOR}"
+-            ;;
+-        *)
+-            # Build 'Universal' binaries (i386 & x86_64 architectures) and
+-            # use rpath token on Darwin 10.x or newer:
+-            SHLIB_LD="$CC -dynamiclib $C_UNIV_SWITCH -headerpad_max_install_names -install_name @rpath/lib\${PACKAGE}.\${CFITSIO_SONAME}\${SHLIB_SUFFIX} -compatibility_version \${CFITSIO_SONAME} -current_version \${CFITSIO_SONAME}.\${CFITSIO_MAJOR}.\${CFITSIO_MINOR}"
+-            ;;
+-    esac
++    SHLIB_LD="$CC -dynamiclib -install_name ${out}/lib/lib\${PACKAGE}.\${CFITSIO_SONAME}\${SHLIB_SUFFIX} -compatibility_version \${CFITSIO_SONAME} -current_version \${CFITSIO_SONAME}.\${CFITSIO_MAJOR}.\${CFITSIO_MINOR}"
+ 
+     lhea_shlib_cflags="-fPIC -fno-common"
+     ;;
diff --git a/nixpkgs/pkgs/development/libraries/science/astronomy/cfitsio/default.nix b/nixpkgs/pkgs/development/libraries/science/astronomy/cfitsio/default.nix
new file mode 100644
index 000000000000..a3263f653b75
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/astronomy/cfitsio/default.nix
@@ -0,0 +1,40 @@
+{ fetchurl, lib, stdenv, bzip2 }:
+stdenv.mkDerivation rec {
+  pname = "cfitsio";
+  version = "3.49";
+
+  src = fetchurl {
+    url = "https://heasarc.gsfc.nasa.gov/FTP/software/fitsio/c/cfitsio-${version}.tar.gz";
+    sha256 = "1cyl1qksnkl3cq1fzl4dmjvkd6329b57y9iqyv44wjakbh6s4rav";
+  };
+
+  buildInputs = [ bzip2 ];
+
+  patches = [ ./darwin-rpath-universal.patch ];
+
+  configureFlags = [ "--with-bzip2=${bzip2.out}" ];
+
+  hardeningDisable = [ "format" ];
+
+  # Shared-only build
+  buildFlags = [ "shared" ];
+  postPatch = '' sed -e '/^install:/s/libcfitsio.a //' -e 's@/bin/@@g' -i Makefile.in
+   '';
+
+  meta = with lib; {
+    homepage = "https://heasarc.gsfc.nasa.gov/fitsio/";
+    description = "Library for reading and writing FITS data files";
+    longDescription =
+      '' CFITSIO is a library of C and Fortran subroutines for reading and
+         writing data files in FITS (Flexible Image Transport System) data
+         format.  CFITSIO provides simple high-level routines for reading and
+         writing FITS files that insulate the programmer from the internal
+         complexities of the FITS format.  CFITSIO also provides many
+         advanced features for manipulating and filtering the information in
+         FITS files.
+      '';
+    license = licenses.mit;
+    maintainers = [ maintainers.xbreak ];
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/default.nix b/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/default.nix
new file mode 100644
index 000000000000..eb0f34db26f5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/default.nix
@@ -0,0 +1,56 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, cmake
+, cfitsio
+, libusb1
+, zlib
+, boost
+, libnova
+, curl
+, libjpeg
+, gsl
+, fftw
+}:
+
+stdenv.mkDerivation rec {
+  pname = "indilib";
+  version = "1.9.1";
+
+  src = fetchFromGitHub {
+    owner = "indilib";
+    repo = "indi";
+    rev = "v${version}";
+    sha256 = "sha256-qXGTHyXhJrApexQL31fba0ZvnHEyTsY3Tb7aB4GpGn4=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  buildInputs = [
+    curl
+    cfitsio
+    libusb1
+    zlib
+    boost
+    libnova
+    libjpeg
+    gsl
+    fftw
+  ];
+
+  cmakeFlags = [
+    "-DCMAKE_INSTALL_LIBDIR=lib"
+    "-DUDEVRULES_INSTALL_DIR=lib/udev/rules.d"
+  ];
+
+  meta = with lib; {
+    homepage = "https://www.indilib.org/";
+    description = "Implementation of the INDI protocol for POSIX operating systems";
+    changelog = "https://github.com/indilib/indi/releases/tag/v${version}";
+    license = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ hjones2199 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/indi-3rdparty.nix b/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/indi-3rdparty.nix
new file mode 100644
index 000000000000..5909a06cfb59
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/indi-3rdparty.nix
@@ -0,0 +1,78 @@
+{ stdenv
+, lib
+, cmake
+, cfitsio
+, libusb1
+, zlib
+, boost
+, libnova
+, curl
+, libjpeg
+, gsl
+, fftw
+, indilib
+, libgphoto2
+, libraw
+, libftdi1
+, libdc1394
+, gpsd
+, ffmpeg
+, version
+, src
+, withFirmware ? false
+, firmware ? null
+}:
+
+stdenv.mkDerivation rec {
+  pname = "indi-3rdparty";
+
+  inherit version src;
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [
+    indilib libnova curl cfitsio libusb1 zlib boost gsl gpsd
+    libjpeg libgphoto2 libraw libftdi1 libdc1394 ffmpeg fftw
+  ] ++ lib.optionals withFirmware [
+    firmware
+  ];
+
+  postPatch = ''
+    for f in indi-qsi/CMakeLists.txt \
+             indi-dsi/CMakeLists.txt \
+             indi-armadillo-platypus/CMakeLists.txt
+    do
+      substituteInPlace $f \
+        --replace "/lib/udev/rules.d" "lib/udev/rules.d" \
+        --replace "/etc/udev/rules.d" "lib/udev/rules.d" \
+        --replace "/lib/firmware" "lib/firmware"
+    done
+  '';
+
+  cmakeFlags = [
+    "-DINDI_DATA_DIR=share/indi"
+    "-DCMAKE_INSTALL_LIBDIR=lib"
+    "-DUDEVRULES_INSTALL_DIR=lib/udev/rules.d"
+    "-DRULES_INSTALL_DIR=lib/udev/rules.d"
+    # Pentax, Atik, and SX cmakelists are currently broken
+    "-DWITH_PENTAX=off"
+    "-DWITH_ATIK=off"
+    "-DWITH_SX=off"
+  ] ++ lib.optionals (!withFirmware) [
+    "-DWITH_APOGEE=off"
+    "-DWITH_DSI=off"
+    "-DWITH_QHY=off"
+    "-DWITH_ARMADILLO=off"
+    "-DWITH_FISHCAMP=off"
+    "-DWITH_SBIG=off"
+  ];
+
+  meta = with lib; {
+    homepage = "https://www.indilib.org/";
+    description = "Third party drivers for the INDI astronomical software suite";
+    changelog = "https://github.com/indilib/indi-3rdparty/releases/tag/v${version}";
+    license = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ hjones2199 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/indi-firmware.nix b/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/indi-firmware.nix
new file mode 100644
index 000000000000..d23673ac37ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/indi-firmware.nix
@@ -0,0 +1,66 @@
+{ stdenv
+, lib
+, cmake
+, cfitsio
+, libusb1
+, zlib
+, boost
+, libnova
+, curl
+, libjpeg
+, gsl
+, fftw
+, indilib
+, libgphoto2
+, libraw
+, libftdi1
+, libdc1394
+, gpsd
+, ffmpeg
+, version
+, src
+}:
+
+stdenv.mkDerivation rec {
+  pname = "indi-firmware";
+
+  inherit version src;
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [
+    indilib libnova curl cfitsio libusb1 zlib boost gsl gpsd
+    libjpeg libgphoto2 libraw libftdi1 libdc1394 ffmpeg fftw
+  ];
+
+  cmakeFlags = [
+    "-DINDI_DATA_DIR=\${CMAKE_INSTALL_PREFIX}/share/indi"
+    "-DCMAKE_INSTALL_LIBDIR=lib"
+    "-DUDEVRULES_INSTALL_DIR=lib/udev/rules.d"
+    "-DRULES_INSTALL_DIR=lib/udev/rules.d"
+    "-DFIRMWARE_INSTALL_DIR=\${CMAKE_INSTALL_PREFIX}/lib/firmware"
+    "-DCONF_DIR=etc"
+    "-DBUILD_LIBS=1"
+    "-DWITH_PENTAX=off"
+  ];
+
+  postPatch = ''
+    for f in libfishcamp/CMakeLists.txt libsbig/CMakeLists.txt
+    do
+      substituteInPlace $f --replace "/lib/firmware" "lib/firmware"
+    done
+  '';
+
+  postFixup = ''
+    rm $out/lib/udev/rules.d/99-fli.rules
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.indilib.org/";
+    description = "Third party firmware for the INDI astronomical software suite";
+    changelog = "https://github.com/indilib/indi-3rdparty/releases/tag/v${version}";
+    license = licenses.lgpl2Plus;
+    maintainers = with maintainers; [ hjones2199 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/indi-full.nix b/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/indi-full.nix
new file mode 100644
index 000000000000..4ac9a122fd2f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/indi-full.nix
@@ -0,0 +1,30 @@
+{ stdenv, lib, callPackage, fetchFromGitHub, indilib }:
+
+let
+  indi-version = "1.9.1";
+  indi-3rdparty-src = fetchFromGitHub {
+    owner = "indilib";
+    repo = "indi-3rdparty";
+    rev = "v${indi-version}";
+    sha256 = "sha256-F0O4WUYdUL6IjJyON/XJp78v4n5rj0unm1xTzEsEH0k=";
+  };
+  indi-firmware = callPackage ./indi-firmware.nix {
+    version = indi-version;
+    src = indi-3rdparty-src;
+  };
+  indi-3rdparty = callPackage ./indi-3rdparty.nix {
+    version = indi-version;
+    src = indi-3rdparty-src;
+    withFirmware = stdenv.isx86_64;
+    firmware = indi-firmware;
+  };
+in
+callPackage ./indi-with-drivers.nix {
+  pname = "indi-full";
+  version = indi-version;
+  extraDrivers = [
+    indi-3rdparty
+  ] ++ lib.optionals stdenv.isx86_64 [
+    indi-firmware
+  ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/indi-with-drivers.nix b/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/indi-with-drivers.nix
new file mode 100644
index 000000000000..5ec1acdf21e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/astronomy/indilib/indi-with-drivers.nix
@@ -0,0 +1,10 @@
+{ buildEnv, indilib ? indilib, pname ? "indi-with-drivers", version ? null, extraDrivers ? null }:
+
+buildEnv {
+  name = "${pname}-${version}";
+  paths = [
+    indilib
+  ]
+  ++ extraDrivers;
+  inherit (indilib) meta;
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/astronomy/libnova/default.nix b/nixpkgs/pkgs/development/libraries/science/astronomy/libnova/default.nix
new file mode 100644
index 000000000000..f6a8d01ab845
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/astronomy/libnova/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchgit, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "libnova";
+  version = "0.16";
+
+  # pull from git repo because upstream stopped tarball releases after v0.15
+  src = fetchgit {
+    url = "https://git.code.sf.net/p/libnova/${pname}";
+    rev = "v${version}";
+    sha256 = "0icwylwkixihzni0kgl0j8dx3qhqvym6zv2hkw2dy6v9zvysrb1b";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+
+  meta = with lib; {
+    description = "Celestial Mechanics, Astrometry and Astrodynamics Library";
+    homepage = "http://libnova.sf.net";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ hjones2199 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/astronomy/stellarsolver/default.nix b/nixpkgs/pkgs/development/libraries/science/astronomy/stellarsolver/default.nix
new file mode 100644
index 000000000000..c3a63c637c34
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/astronomy/stellarsolver/default.nix
@@ -0,0 +1,30 @@
+{ lib, mkDerivation, fetchFromGitHub, cmake,
+  qtbase, cfitsio, gsl, wcslib, withTester ? false }:
+
+mkDerivation rec {
+  pname = "stellarsolver";
+  version = "1.5";
+
+  src = fetchFromGitHub {
+    owner = "rlancaste";
+    repo = pname;
+    rev = version;
+    sha256 = "12j20j9qbkkx55ix4nm1iw7wd36hamkpidbwhcnmj4yk5fqlyq4y";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ qtbase cfitsio gsl wcslib ];
+
+  cmakeFlags = [
+    "-DBUILD_TESTER=${if withTester then "on" else "off"}"
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/rlancaste/stellarsolver";
+    description = "Astrometric plate solving library";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ hjones2199 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/astronomy/wcslib/default.nix b/nixpkgs/pkgs/development/libraries/science/astronomy/wcslib/default.nix
new file mode 100644
index 000000000000..6adf52514710
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/astronomy/wcslib/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, flex }:
+
+stdenv.mkDerivation rec {
+  pname = "wcslib";
+  version = "7.7";
+
+  src = fetchurl {
+    url = "ftp://ftp.atnf.csiro.au/pub/software/wcslib/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-pwjmtOkOLNZCdDRxW1kbucPUAFyZcl7ElLjgvtLeU1U=";
+  };
+
+  nativeBuildInputs = [ flex ];
+
+  enableParallelBuilding = true;
+
+  outputs = [ "out" "man" ];
+
+  meta = with lib; {
+    homepage = "https://www.atnf.csiro.au/people/mcalabre/WCS/";
+    description = "World Coordinate System library for astronomy";
+    longDescription = ''
+      Library for world coordinate systems for spherical geometries
+      and their conversion to image coordinate systems. This is the
+      standard library for this purpose in astronomy.
+    '';
+    maintainers = with maintainers; [ hjones2199 ];
+    license = licenses.lgpl3Plus;
+    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
new file mode 100644
index 000000000000..d4610d60415b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/benchmark/papi/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv
+, fetchurl
+}:
+
+stdenv.mkDerivation rec {
+  version = "6.0.0.1";
+  pname = "papi";
+
+  src = fetchurl {
+    url = "https://bitbucket.org/icl/papi/get/papi-${lib.replaceStrings ["."] ["-"] version}-t.tar.gz";
+    sha256 = "1jd67yadyffzxwsqlylsi0bx8ishb0cgj2ziz1wdslaz6ylvyf9j";
+  };
+
+  setSourceRoot = ''
+    sourceRoot=$(echo */src)
+  '';
+
+  doCheck = true;
+  checkTarget = "test";
+
+  meta = with lib; {
+    homepage = "https://icl.utk.edu/papi/";
+    description = "Library providing access to various hardware performance counters";
+    license = licenses.bsdOriginal;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ costrouc zhaofengli ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/EBTKS/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/EBTKS/default.nix
new file mode 100644
index 000000000000..2a832fc7c37a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/biology/EBTKS/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, cmake, libminc }:
+
+stdenv.mkDerivation rec {
+  pname = "EBTKS";
+  version  = "unstable-2017-09-23";
+
+  src = fetchFromGitHub {
+    owner  = "BIC-MNI";
+    repo   = pname;
+    rev    = "67e4e197d8a32d6462c9bdc7af44d64ebde4fb5c";
+    sha256 = "1a1qw6i47fs1izx60l1ysabpmyx9j5sjnbdv8b47wi2xcc9i3hpq";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libminc ];
+
+  cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/cmake" ];
+
+  meta = with lib; {
+    homepage = "https://github.com/BIC-MNI/${pname}";
+    description = "Library for working with MINC files";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license   = licenses.free;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/bicgl/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/bicgl/default.nix
new file mode 100644
index 000000000000..bc2de6e882f9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/biology/bicgl/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, cmake, libminc, bicpl, freeglut, mesa_glu }:
+
+stdenv.mkDerivation rec {
+  pname = "bicgl";
+  version = "unstable-2018-04-06";
+
+  owner = "BIC-MNI";
+
+  src = fetchFromGitHub {
+    inherit owner;
+    repo   = pname;
+    rev    = "61a035751c9244fcca1edf94d6566fa2a709ce90";
+    sha256 = "0lzirdi1mf4yl8srq7vjn746sbydz7h0wjh7wy8gycy6hq04qrg4";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libminc bicpl freeglut mesa_glu ];
+
+  cmakeFlags = [
+    "-DLIBMINC_DIR=${libminc}/lib/cmake"
+    "-DBICPL_DIR=${bicpl}/lib"
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/${owner}/${pname}";
+    description = "Brain Imaging Centre graphics library";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license   = licenses.free;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/bicpl/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/bicpl/default.nix
new file mode 100644
index 000000000000..5cf63e342242
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/biology/bicpl/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, cmake, libminc, netpbm }:
+
+stdenv.mkDerivation rec {
+  pname = "bicpl";
+  version = "unstable-2020-10-15";
+
+  # current master is significantly ahead of most recent release, so use Git version:
+  src = fetchFromGitHub {
+    owner  = "BIC-MNI";
+    repo   = pname;
+    rev    = "a58af912a71a4c62014975b89ef37a8e72de3c9d";
+    sha256 = "0iw0pmr8xrifbx5l8a0xidfqbm1v8hwzqrw0lcmimxlzdihyri0g";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libminc netpbm ];
+
+  cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/cmake" ];
+
+  doCheck = false;
+  # internal_volume_io.h: No such file or directory
+
+  meta = with lib; {
+    homepage = "https://github.com/BIC-MNI/bicpl";
+    description = "Brain Imaging Centre programming library";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license   = licenses.free;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/bpp-core/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/bpp-core/default.nix
new file mode 100644
index 000000000000..d1eb096e08e6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/biology/bpp-core/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "bpp-core";
+  version = "2.4.1";
+
+  src = fetchFromGitHub { owner = "BioPP";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0ma2cl677l7s0n5sffh66cy9lxp5wycm50f121g8rx85p95vkgwv";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  preCheck = ''
+    export LD_LIBRARY_PATH=$(pwd)/src
+  '';
+
+  postFixup = ''
+    substituteInPlace $out/lib/cmake/bpp-core/bpp-core-targets.cmake  \
+      --replace 'set(_IMPORT_PREFIX' '#set(_IMPORT_PREFIX'
+  '';
+  # prevents cmake from exporting incorrect INTERFACE_INCLUDE_DIRECTORIES
+  # of form /nix/store/.../nix/store/.../include,
+  # probably due to relative vs absolute path issue
+
+  doCheck = !stdenv.isDarwin;
+
+  meta = with lib; {
+    homepage = "http://biopp.univ-montp2.fr/wiki/index.php/Main_Page";
+    changelog = "https://github.com/BioPP/bpp-core/blob/master/ChangeLog";
+    description = "C++ bioinformatics libraries and tools";
+    maintainers = with maintainers; [ bcdarwin ];
+    license = licenses.cecill20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/bpp-phyl/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/bpp-phyl/default.nix
new file mode 100644
index 000000000000..8ff6ad433fb5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/biology/bpp-phyl/default.nix
@@ -0,0 +1,32 @@
+{ stdenv, fetchFromGitHub, cmake, bpp-core, bpp-seq }:
+
+stdenv.mkDerivation rec {
+  pname = "bpp-phyl";
+
+  inherit (bpp-core) version;
+
+  src = fetchFromGitHub {
+    owner = "BioPP";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "192zks6wyk903n06c2lbsscdhkjnfwms8p7jblsmk3lvjhdipb20";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ bpp-core bpp-seq ];
+
+  preCheck = ''
+    export LD_LIBRARY_PATH=$(pwd)/src
+  '';
+
+  postFixup = ''
+    substituteInPlace $out/lib/cmake/${pname}/${pname}-targets.cmake  \
+      --replace 'set(_IMPORT_PREFIX' '#set(_IMPORT_PREFIX'
+  '';
+
+  doCheck = !stdenv.isDarwin;
+
+  meta = bpp-core.meta // {
+    changelog = "https://github.com/BioPP/bpp-phyl/blob/master/ChangeLog";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/bpp-popgen/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/bpp-popgen/default.nix
new file mode 100644
index 000000000000..af5d1d00d4d9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/biology/bpp-popgen/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub, cmake, bpp-core, bpp-seq }:
+
+stdenv.mkDerivation rec {
+  pname = "bpp-popgen";
+
+  inherit (bpp-core) version;
+
+  src = fetchFromGitHub {
+    owner = "BioPP";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0bz0fhrq3dri6a0hvfc3zlvrns8mrzzlnicw5pyfa812gc1qwfvh";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ bpp-core bpp-seq ];
+
+  preCheck = ''
+    export LD_LIBRARY_PATH=$(pwd)/src
+  '';
+
+  postFixup = ''
+    substituteInPlace $out/lib/cmake/${pname}/${pname}-targets.cmake  \
+      --replace 'set(_IMPORT_PREFIX' '#set(_IMPORT_PREFIX'
+  '';
+  # prevents cmake from exporting incorrect INTERFACE_INCLUDE_DIRECTORIES
+  # of form /nix/store/.../nix/store/.../include,
+  # probably due to relative vs absolute path issue
+
+  doCheck = !stdenv.isDarwin;
+
+  meta = bpp-core.meta // {
+    changelog = "https://github.com/BioPP/bpp-popgen/blob/master/ChangeLog";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/bpp-seq/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/bpp-seq/default.nix
new file mode 100644
index 000000000000..ef3f3d5756e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/biology/bpp-seq/default.nix
@@ -0,0 +1,35 @@
+{ stdenv, fetchFromGitHub, cmake, bpp-core }:
+
+stdenv.mkDerivation rec {
+  pname = "bpp-seq";
+
+  inherit (bpp-core) version;
+
+  src = fetchFromGitHub {
+    owner = "BioPP";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1mc09g8jswzsa4wgrfv59jxn15ys3q8s0227p1j838wkphlwn2qk";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ bpp-core ];
+
+  preCheck = ''
+    export LD_LIBRARY_PATH=$(pwd)/src
+  '';
+
+  postFixup = ''
+    substituteInPlace $out/lib/cmake/${pname}/${pname}-targets.cmake  \
+      --replace 'set(_IMPORT_PREFIX' '#set(_IMPORT_PREFIX'
+  '';
+  # prevents cmake from exporting incorrect INTERFACE_INCLUDE_DIRECTORIES
+  # of form /nix/store/.../nix/store/.../include,
+  # probably due to relative vs absolute path issue
+
+  doCheck = !stdenv.isDarwin;
+
+  meta = bpp-core.meta // {
+    changelog = "https://github.com/BioPP/bpp-seq/blob/master/ChangeLog";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/elastix/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/elastix/default.nix
new file mode 100644
index 000000000000..55ee5ab4fb66
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/biology/elastix/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, itk, python3, Cocoa }:
+
+stdenv.mkDerivation rec {
+  pname    = "elastix";
+  version = "5.0.1";
+
+  src = fetchFromGitHub {
+    owner  = "SuperElastix";
+    repo   = pname;
+    rev    = version;
+    sha256 = "1mx8kkak2d3ibfrxrh8jkmh2zkdlgl9h578wiw3617zcwaa97bxw";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "install-executables.patch";  # https://github.com/SuperElastix/elastix/issues/305
+      url = "https://github.com/SuperElastix/elastix/commit/8e26cdc0d66f6030c7be085fdc424d84d4fc7546.patch";
+      sha256 = "12y9wbpi9jlarnw6fk4iby97jxvx5g4daq9zqblbcmn51r134bj5";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake python3 ];
+  buildInputs = [ itk ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
+
+  doCheck = !stdenv.isDarwin;  # usual dynamic linker issues
+
+  preCheck = "
+    export LD_LIBRARY_PATH=$(pwd)/bin
+  ";
+
+  meta = with lib; {
+    homepage = "http://elastix.isi.uu.nl/";
+    description = "Image registration toolkit based on ITK";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.x86_64;  # libitkpng linker issues with ITK 5.1
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/gifticlib/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/gifticlib/default.nix
new file mode 100644
index 000000000000..306324129cbd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/biology/gifticlib/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, cmake, expat, nifticlib, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "gifticlib";
+  version = "unstable-2020-07-07";
+
+  src = fetchFromGitHub {
+    owner = "NIFTI-Imaging";
+    repo = "gifti_clib";
+    rev = "5eae81ba1e87ef3553df3b6ba585f12dc81a0030";
+    sha256 = "0gcab06gm0irjnlrkpszzd4wr8z0fi7gx8f7966gywdp2jlxzw19";
+  };
+
+  cmakeFlags = [ "-DUSE_SYSTEM_NIFTI=ON" "-DDOWNLOAD_TEST_DATA=OFF" ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ expat nifticlib zlib ];
+
+  # without the test data, this is only a few basic tests
+  doCheck = !stdenv.isDarwin;
+  checkPhase = ''
+    runHook preCheck
+    ctest -LE 'NEEDS_DATA'
+    runHook postCheck
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.nitrc.org/projects/gifti";
+    description = "Medical imaging geometry format C API";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license = licenses.publicDomain;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix
new file mode 100644
index 000000000000..3233a29449aa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, zlib, bzip2, xz, curl, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "htslib";
+  version = "1.11";
+
+  src = fetchurl {
+    url = "https://github.com/samtools/htslib/releases/download/${version}/${pname}-${version}.tar.bz2";
+    sha256 = "1mrq4mihzx37yqhj3sfz6da6mw49niia808bzsw2gkkgmadxvyng";
+  };
+
+  # perl is only used during the check phase.
+  nativeBuildInputs = [ perl ];
+
+  buildInputs = [ zlib bzip2 xz curl ];
+
+  configureFlags = [ "--enable-libcurl" ]; # optional but strongly recommended
+
+  installFlags = [ "prefix=$(out)" ];
+
+  preCheck = ''
+    patchShebangs test/
+  '';
+
+  enableParallelBuilding = true;
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A C library for reading/writing high-throughput sequencing data";
+    license = licenses.mit;
+    homepage = "http://www.htslib.org/";
+    platforms = platforms.unix;
+    maintainers = [ maintainers.mimame ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/mirtk/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/mirtk/default.nix
new file mode 100644
index 000000000000..d2615b391ffc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/biology/mirtk/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, gtest, fetchFromGitHub, cmake, boost, eigen, python3, vtk, zlib, tbb }:
+
+stdenv.mkDerivation rec {
+  version = "2.0.0";
+  pname = "mirtk";
+
+  src = fetchFromGitHub {
+    owner = "BioMedIA";
+    repo = "MIRTK";
+    rev = "v${version}";
+    sha256 = "0i2v97m66ir5myvi5b123r7zcagwy551b73s984gk7lksl5yiqxk";
+    fetchSubmodules = true;
+  };
+
+  cmakeFlags = [
+    "-DWITH_VTK=ON"
+    "-DBUILD_ALL_MODULES=ON"
+    "-DWITH_TBB=ON"
+  ];
+
+  doCheck = true;
+
+  checkPhase = ''
+    ctest -E '(Polynomial|ConvolutionFunction|Downsampling|EdgeTable|InterpolateExtrapolateImage)'
+  '';
+  # testPolynomial - segfaults for some reason
+  # testConvolutionFunction, testDownsampling - main not called correctly
+  # testEdgeTable, testInterpolateExtrapolateImageFunction - setup fails
+
+  postInstall = ''
+    install -Dm644 -t "$out/share/bash-completion/completions/mirtk" share/completion/bash/mirtk
+  '';
+
+  nativeBuildInputs = [ cmake gtest ];
+  buildInputs = [ boost eigen python3 vtk zlib tbb ];
+
+  meta = with lib; {
+    homepage = "https://github.com/BioMedIA/MIRTK";
+    description = "Medical image registration library and tools";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.linux;
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/nifticlib/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/nifticlib/default.nix
new file mode 100644
index 000000000000..fee2ea8772b4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/biology/nifticlib/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, cmake, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "nifticlib";
+  version = "3.0.1";
+
+  src = fetchFromGitHub {
+    owner = "NIFTI-Imaging";
+    repo = "nifti_clib";
+    rev = "v${version}";
+    sha256 = "0hamm6nvbjdjjd5md4jahzvn5559frigxaiybnjkh59ckxwb1hy4";
+  };
+
+  cmakeFlags = [ "-DDOWNLOAD_TEST_DATA=OFF" ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zlib ];
+
+  checkPhase = ''
+    runHook preCheck
+    ctest -LE 'NEEDS_DATA'
+    runHook postCheck
+  '';
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://nifti-imaging.github.io";
+    description = "Medical imaging format C API";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license = licenses.publicDomain;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/oobicpl/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/oobicpl/default.nix
new file mode 100644
index 000000000000..7f1112311d6b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/biology/oobicpl/default.nix
@@ -0,0 +1,39 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, libminc
+, bicpl
+, arguments
+, pcre-cpp }:
+
+stdenv.mkDerivation rec {
+  pname = "oobicpl";
+  version = "unstable-2020-08-12";
+
+  src = fetchFromGitHub {
+    owner  = "BIC-MNI";
+    repo   = pname;
+    rev    = "a9409da8a5bb4925438f32aff577b6333faec28b";
+    sha256 = "0b4chjhr32wbb1sash8cq1jfnr7rzdq84hif8anlrjqd3l0gw357";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ libminc bicpl arguments pcre-cpp ];
+
+  cmakeFlags = [
+    "-DLIBMINC_DIR=${libminc}/lib/cmake"
+    "-DBICPL_DIR=${bicpl}/lib"
+    "-DARGUMENTS_DIR=${arguments}/lib"
+    "-DOOBICPL_BUILD_SHARED_LIBS=TRUE"
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/BIC-MNI/oobicpl";
+    description = "Brain Imaging Centre object-oriented programming library (and tools)";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.unix;
+    license   = licenses.free;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/chemistry/avogadrolibs/default.nix b/nixpkgs/pkgs/development/libraries/science/chemistry/avogadrolibs/default.nix
new file mode 100644
index 000000000000..1130f5c44e70
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/chemistry/avogadrolibs/default.nix
@@ -0,0 +1,68 @@
+{ lib, stdenv, fetchFromGitHub, cmake, zlib, eigen, libGL, doxygen, spglib
+, mmtf-cpp, glew, python3, libarchive, libmsym, msgpack, qttools, wrapQtAppsHook
+}:
+
+let
+  pythonWP = python3.withPackages (p: with p; [ openbabel-bindings numpy ]);
+
+  # Pure data repositories
+  moleculesRepo = fetchFromGitHub {
+    owner = "OpenChemistry";
+    repo = "molecules";
+    rev = "1.0.0";
+    sha256 = "guY6osnpv7Oqt+HE1BpIqL10POp+x8GAci2kY0bLmqg=";
+  };
+  crystalsRepo = fetchFromGitHub {
+    owner = "OpenChemistry";
+    repo = "crystals";
+    rev = "1.0.1";
+    sha256 = "sH/WuvLaYu6akOc3ssAKhnxD8KNoDxuafDSozHqJZC4=";
+  };
+
+in stdenv.mkDerivation rec {
+  pname = "avogadrolibs";
+  version = "1.94.0";
+
+  src = fetchFromGitHub {
+    owner = "OpenChemistry";
+    repo = pname;
+    rev = version;
+    sha256 = "6bChJhqrjOxeEWZBNToq3JExHPu7DUMsEHWBDe75zAo=";
+  };
+
+  postUnpack = ''
+    cp -r ${moleculesRepo} molecules
+    cp -r ${crystalsRepo} crystals
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    wrapQtAppsHook
+  ];
+
+  buildInputs = [
+    eigen
+    zlib
+    libGL
+    spglib
+    mmtf-cpp
+    glew
+    libarchive
+    libmsym
+    msgpack
+    qttools
+  ];
+
+  postFixup = ''
+    substituteInPlace $out/lib/cmake/${pname}/AvogadroLibsConfig.cmake \
+      --replace "''${AvogadroLibs_INSTALL_PREFIX}/$out" "''${AvogadroLibs_INSTALL_PREFIX}"
+  '';
+
+  meta = with lib; {
+    description = "Molecule editor and visualizer";
+    maintainers = with maintainers; [ sheepforce ];
+    homepage = "https://github.com/OpenChemistry/avogadrolibs";
+    platforms = platforms.linux;
+    license = licenses.gpl2Only;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/chemistry/libmsym/default.nix b/nixpkgs/pkgs/development/libraries/science/chemistry/libmsym/default.nix
new file mode 100644
index 000000000000..8c605f3e07d4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/chemistry/libmsym/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, lib, fetchFromGitHub, cmake } :
+
+stdenv.mkDerivation rec {
+  pname = "libmsym";
+  version = "0.2.3";
+
+  src = fetchFromGitHub  {
+    owner = "mcodev31";
+    repo = pname;
+    rev = "v${version}";
+    sha256= "k+OEwrA/saupP/wX6Ii5My0vffiJ0X9xMCTrliMSMik=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = " molecular point group symmetry lib";
+    homepage = "https://github.com/rcsb/mmtf-cpp";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.sheepforce ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/chemistry/mmtf-cpp/default.nix b/nixpkgs/pkgs/development/libraries/science/chemistry/mmtf-cpp/default.nix
new file mode 100644
index 000000000000..ec1fed68ff93
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/chemistry/mmtf-cpp/default.nix
@@ -0,0 +1,25 @@
+{ stdenv, lib, fetchFromGitHub, cmake, msgpack } :
+
+stdenv.mkDerivation rec {
+  pname = "mmtf-cpp";
+  version = "1.0.0";
+
+  src = fetchFromGitHub  {
+    owner = "rcsb";
+    repo = pname;
+    rev = "v${version}";
+    sha256= "17ylramda69plf5w0v5hxbl4ggkdi5s15z55cv0pljl12yvyva8l";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ msgpack ];
+
+  meta = with lib; {
+    description = "A library of exchange-correlation functionals with arbitrary-order derivatives";
+    homepage = "https://github.com/rcsb/mmtf-cpp";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.sheepforce ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/chemistry/molequeue/default.nix b/nixpkgs/pkgs/development/libraries/science/chemistry/molequeue/default.nix
new file mode 100644
index 000000000000..1e8ca2d961d3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/chemistry/molequeue/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, cmake, qttools, wrapQtAppsHook }:
+
+stdenv.mkDerivation rec {
+  pname = "molequeue";
+  version = "0.9.0";
+
+  src = fetchFromGitHub {
+    owner = "OpenChemistry";
+    repo = pname;
+    rev = version;
+    sha256 = "+NoY8YVseFyBbxc3ttFWiQuHQyy1GN8zvV1jGFjmvLg=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    wrapQtAppsHook
+  ];
+
+  buildInputs = [ qttools ];
+
+  postFixup = ''
+    substituteInPlace $out/lib/cmake/molequeue/MoleQueueConfig.cmake \
+      --replace "''${MoleQueue_INSTALL_PREFIX}/$out" "''${MoleQueue_INSTALL_PREFIX}"
+  '';
+
+  meta = with lib; {
+    description = "Desktop integration of high performance computing resources";
+    maintainers = with maintainers; [ sheepforce ];
+    homepage = "https://github.com/OpenChemistry/molequeue";
+    platforms = platforms.linux;
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/chemistry/xcfun/default.nix b/nixpkgs/pkgs/development/libraries/science/chemistry/xcfun/default.nix
new file mode 100644
index 000000000000..7f8ef3dc47d7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/chemistry/xcfun/default.nix
@@ -0,0 +1,30 @@
+{ stdenv, lib, fetchFromGitHub, cmake, gfortran, python3 } :
+
+stdenv.mkDerivation rec {
+  pname = "xcfun";
+  version = "2.1.1";
+
+  src = fetchFromGitHub  {
+    owner = "dftlibs";
+    repo = pname;
+    rev = "v${version}";
+    sha256= "1bj70cnhbh6ziy02x988wwl7cbwaq17ld7qwhswqkgnnx8rpgxid";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    gfortran
+  ];
+
+  propagatedBuildInputs = [ (python3.withPackages (p: with p; [ pybind11 ])) ];
+
+  cmakeFlags = [ "-DXCFUN_MAX_ORDER=3" ];
+
+  meta = with lib; {
+    description = "A library of exchange-correlation functionals with arbitrary-order derivatives";
+    homepage = "https://github.com/dftlibs/xcfun";
+    license = licenses.mpl20;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.sheepforce ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/electronics/qcsxcad/default.nix b/nixpkgs/pkgs/development/libraries/science/electronics/qcsxcad/default.nix
new file mode 100644
index 000000000000..a20f6973384a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/electronics/qcsxcad/default.nix
@@ -0,0 +1,47 @@
+{ lib
+, mkDerivation
+, fetchFromGitHub
+, cmake
+, csxcad
+, tinyxml
+, vtkWithQt5
+, qtbase
+}:
+
+mkDerivation {
+  pname = "qcsxcad";
+  version = "unstable-2020-01-04";
+
+  src = fetchFromGitHub {
+    owner = "thliebig";
+    repo = "QCSXCAD";
+    rev = "0dabbaf2bc1190adec300871cf309791af842c8e";
+    sha256 = "11kbh0mxbdfh7s5azqin3i2alic5ihmdfj0jwgnrhlpjk4cbf9rn";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  cmakeFlags = [
+    "-DCSXCAD_ROOT_DIR=${csxcad}"
+    "-DENABLE_RPATH=OFF"
+  ];
+
+  buildInputs = [
+    csxcad
+    tinyxml
+    vtkWithQt5
+    qtbase
+  ];
+
+  meta = with lib; {
+    description = "Qt library for CSXCAD";
+    homepage = "https://github.com/thliebig/QCSXCAD";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [ matthuszagh ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/QuadProgpp/default.nix b/nixpkgs/pkgs/development/libraries/science/math/QuadProgpp/default.nix
new file mode 100644
index 000000000000..703a7f2e3441
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/QuadProgpp/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "QuadProgpp";
+  version = "4b6bd65f09fbff99c172a86d6e96ca74449b323f";
+
+  src = fetchFromGitHub {
+    owner = "liuq";
+    repo = "QuadProgpp";
+    rev = version;
+    sha256 = "02r0dlk2yjpafknvm945vbgs4sl26w2i1gw3pllar9hi364y8hnx";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://github.com/liuq/QuadProgpp";
+    license = licenses.mit;
+    description = ''
+      A C++ library for Quadratic Programming which implements the
+      Goldfarb-Idnani active-set dual method.
+    '';
+    maintainers = with maintainers; [ ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/amd-blis/default.nix b/nixpkgs/pkgs/development/libraries/science/math/amd-blis/default.nix
new file mode 100644
index 000000000000..1eea35a34e76
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/amd-blis/default.nix
@@ -0,0 +1,70 @@
+{ lib, stdenv
+, fetchFromGitHub
+, perl
+, python3
+
+# Enable BLAS interface with 64-bit integer width.
+, blas64 ? false
+
+# Target architecture. "amd64" compiles kernels for all Zen
+# generations. To build kernels for specific Zen generations,
+# use "zen", "zen2", or "zen3".
+, withArchitecture ? "amd64"
+
+# Enable OpenMP-based threading.
+, withOpenMP ? true
+}:
+
+let
+  threadingSuffix = if withOpenMP then "-mt" else "";
+  blasIntSize = if blas64 then "64" else "32";
+in stdenv.mkDerivation rec {
+  pname = "amd-blis";
+  version = "3.0";
+
+  src = fetchFromGitHub {
+    owner = "amd";
+    repo = "blis";
+    rev = version;
+    hash = "sha256-bbbeo1yOKse9pzbsB6lQ7pULKdzu3G7zJzTUgPXiMZY=";
+  };
+
+  inherit blas64;
+
+  nativeBuildInputs = [
+    perl
+    python3
+  ];
+
+  # Tests currently fail with non-Zen CPUs due to a floating point
+  # exception in one of the generic kernels. Try to re-enable the
+  # next release.
+  doCheck = false;
+
+  enableParallelBuilding = true;
+
+  configureFlags = [
+    "--enable-cblas"
+    "--blas-int-size=${blasIntSize}"
+  ] ++ lib.optionals withOpenMP [ "--enable-threading=openmp" ]
+    ++ [ withArchitecture ];
+
+  postPatch = ''
+    patchShebangs configure build/flatten-headers.py
+  '';
+
+  postInstall = ''
+    ln -s $out/lib/libblis${threadingSuffix}.so.3 $out/lib/libblas.so.3
+    ln -s $out/lib/libblis${threadingSuffix}.so.3 $out/lib/libcblas.so.3
+    ln -s $out/lib/libblas.so.3 $out/lib/libblas.so
+    ln -s $out/lib/libcblas.so.3 $out/lib/libcblas.so
+  '';
+
+  meta = with lib; {
+    description = "BLAS-compatible library optimized for AMD CPUs";
+    homepage = "https://developer.amd.com/amd-aocl/blas-library/";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.danieldk ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/amd-libflame/add-lapacke.diff b/nixpkgs/pkgs/development/libraries/science/math/amd-libflame/add-lapacke.diff
new file mode 100644
index 000000000000..3e3ef1e60ff5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/amd-libflame/add-lapacke.diff
@@ -0,0 +1,34 @@
+diff --git a/Makefile b/Makefile
+index 5549ce30..ac2ee51e 100644
+--- a/Makefile
++++ b/Makefile
+@@ -583,14 +583,14 @@ endif
+ 
+ # --- Shared library linker rules ---
+ 
+-$(LIBFLAME_SO_PATH): $(MK_ALL_FLAMEC_OBJS)
++$(LIBFLAME_SO_PATH): $(MK_ALL_FLAMEC_OBJS) $(LAPACKE_A_PATH)
+ ifeq ($(ENABLE_VERBOSE),yes)
+ ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
+ 	$(CAT) $(AR_OBJ_LIST_FILE) | xargs -n$(AR_CHUNK_SIZE) $(AR) $(ARFLAGS) $(LIBFLAME_A)
+ ifeq ($(OS_NAME),Darwin)
+-	$(LINKER) $(SOFLAGS) -o $@ -Wl,-force_load,$(LIBFLAME_A) $(LDFLAGS)
++	$(LINKER) $(SOFLAGS) -o $@ -Wl,-force_load,$(LIBFLAME_A),$(LAPACKE_A_PATH) $(LDFLAGS)
+ else
+-	$(LINKER) $(SOFLAGS) -o $@ -Wl,--whole-archive,$(LIBFLAME_A),--no-whole-archive $(LDFLAGS)
++	$(LINKER) $(SOFLAGS) -o $@ -Wl,--whole-archive,$(LIBFLAME_A),$(LAPACKE_A_PATH)--no-whole-archive $(LDFLAGS)
+ endif
+ else
+ #	NOTE: Can't use $^ automatic variable as long as $(AR_OBJ_LIST_FILE) is in
+@@ -602,9 +602,9 @@ else
+ ifeq ($(FLA_ENABLE_MAX_ARG_LIST_HACK),yes)
+ 	@$(CAT) $(AR_OBJ_LIST_FILE) | xargs -n$(AR_CHUNK_SIZE) $(AR) $(ARFLAGS) $(LIBFLAME_A)
+ ifeq ($(OS_NAME),Darwin)
+-	@$(LINKER) $(SOFLAGS) -o $@ -Wl,-force_load,$(LIBFLAME_A) $(LDFLAGS)
++	@$(LINKER) $(SOFLAGS) -o $@ -Wl,-force_load,$(LIBFLAME_A),$(LAPACKE_A_PATH) $(LDFLAGS)
+ else
+-	@$(LINKER) $(SOFLAGS) -o $@ -Wl,--whole-archive,$(LIBFLAME_A),--no-whole-archive $(LDFLAGS)
++	@$(LINKER) $(SOFLAGS) -o $@ -Wl,--whole-archive,$(LIBFLAME_A),$(LAPACKE_A_PATH),--no-whole-archive $(LDFLAGS)
+ endif
+ else
+ #	NOTE: Can't use $^ automatic variable as long as $(AR_OBJ_LIST_FILE) is in
diff --git a/nixpkgs/pkgs/development/libraries/science/math/amd-libflame/default.nix b/nixpkgs/pkgs/development/libraries/science/math/amd-libflame/default.nix
new file mode 100644
index 000000000000..f17124db47bb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/amd-libflame/default.nix
@@ -0,0 +1,72 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, gfortran
+, python3
+, amd-blis
+
+, withOpenMP ? true
+}:
+
+stdenv.mkDerivation rec {
+  pname = "amd-libflame";
+  version = "3.0";
+
+  src = fetchFromGitHub {
+    owner = "amd";
+    repo = "libflame";
+    rev = version;
+    hash = "sha256-jESae5NqANw90RBbIHH2oGEq5/mudc4IONv50P/AeQ0=";
+  };
+
+  patches = [
+    # The LAPACKE interface is compiled as a separate static library,
+    # we want the main dynamic library to provide LAPACKE symbols.
+    # This patch adds lapacke.a to the shared library as well.
+    ./add-lapacke.diff
+  ];
+
+  nativeBuildInputs = [ gfortran python3 ];
+
+  buildInputs = [ amd-blis ];
+
+  configureFlags = [
+    # Build a dynamic library with a LAPACK interface.
+    "--disable-static-build"
+    "--enable-dynamic-build"
+    "--enable-lapack2flame"
+
+    # Use C BLAS interface.
+    "--enable-cblas-interfaces"
+
+    # Avoid overloading maximum number of arguments.
+    "--enable-max-arg-list-hack"
+
+    # libflame by default leaves BLAS symbols unresolved and leaves it
+    # up to the application to explicitly link to a BLAS. This is
+    # problematic for us, since then the BLAS library becomes an
+    # implicit dependency. Moreover, since the point of the AMD forks
+    # is to optimized for recent AMD CPUs, link against AMD BLIS.
+    "LDFLAGS=-lcblas"
+  ]
+  ++ lib.optionals withOpenMP [ "--enable-multithreading=openmp" ];
+
+  enableParallelBuilding = true;
+
+  postPatch = ''
+    patchShebangs build
+  '';
+
+  postInstall = ''
+    ln -s $out/lib/libflame.so.${version} $out/lib/liblapack.so.3
+    ln -s $out/lib/libflame.so.${version} $out/lib/liblapacke.so.3
+  '';
+
+  meta = with lib; {
+    description = "LAPACK-compatible linear algebra library optimized for AMD CPUs";
+    homepage = "https://developer.amd.com/amd-aocl/blas-library/";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ danieldk ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/arpack/default.nix b/nixpkgs/pkgs/development/libraries/science/math/arpack/default.nix
new file mode 100644
index 000000000000..a26a3bb6d8d9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/arpack/default.nix
@@ -0,0 +1,63 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake
+, gfortran, blas, lapack, eigen }:
+
+stdenv.mkDerivation rec {
+  pname = "arpack";
+  version = "3.8.0";
+
+  src = fetchFromGitHub {
+    owner = "opencollab";
+    repo = "arpack-ng";
+    rev = version;
+    sha256 = "sha256-nc710iLRqy/p3EaVgbEoCRzNJ9GpKqqQp33tbn7R6lA=";
+  };
+
+  patches = [
+    # https://github.com/opencollab/arpack-ng/pull/301
+    (fetchpatch {
+      name = "pkg-config-paths.patch";
+      url = "https://github.com/opencollab/arpack-ng/commit/47fc83cb371a9cc8a8c058097de5e0298cd548f5.patch";
+      excludes = [ "CHANGES" ];
+      sha256 = "1aijvrfsxkgzqmkzq2dmaj8q3jdpg2hwlqpfl8ddk9scv17gh9m8";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = assert (blas.isILP64 == lapack.isILP64); [
+    gfortran
+    blas
+    lapack
+    eigen
+  ];
+
+  doCheck = true;
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DINTERFACE64=${if blas.isILP64 then "1" else "0"}"
+  ];
+
+  preCheck = if stdenv.isDarwin then ''
+    export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}`pwd`/lib:${blas}/lib:${lapack}/lib
+  '' else ''
+    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}`pwd`/lib
+  '' + ''
+    # Prevent tests from using all cores
+    export OMP_NUM_THREADS=2
+  '';
+
+  postFixup = lib.optionalString stdenv.isDarwin ''
+    install_name_tool -change libblas.dylib ${blas}/lib/libblas.dylib $out/lib/libarpack.dylib
+  '';
+
+  meta = {
+    homepage = "https://github.com/opencollab/arpack-ng";
+    description = ''
+      A collection of Fortran77 subroutines to solve large scale eigenvalue
+      problems.
+    '';
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ ttuegel dotlambda ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/blas/default.nix b/nixpkgs/pkgs/development/libraries/science/math/blas/default.nix
new file mode 100644
index 000000000000..85a73ccd5697
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/blas/default.nix
@@ -0,0 +1,71 @@
+{ lib, stdenv, fetchurl, gfortran }:
+
+stdenv.mkDerivation rec {
+  pname = "blas";
+  version = "3.10.0";
+
+  src = fetchurl {
+    url = "http://www.netlib.org/blas/${pname}-${version}.tgz";
+    sha256 = "sha256-LjYNmcm9yEB6YYiMQKqFP7QhlCDruCZNtIbLiGBGirM=";
+  };
+
+  buildInputs = [ gfortran ];
+
+  configurePhase = ''
+    echo >make.inc  "SHELL = ${stdenv.shell}"
+    echo >>make.inc "PLAT = _LINUX"
+    echo >>make.inc "FORTRAN = gfortran"
+    echo >>make.inc "OPTS = -O2 -fPIC"
+    echo >>make.inc "DRVOPTS = $$(OPTS)"
+    echo >>make.inc "NOOPT = -O0 -fPIC"
+    echo >>make.inc "LOADER = gfortran"
+    echo >>make.inc "LOADOPTS ="
+    echo >>make.inc "AR = gfortran"
+    echo >>make.inc "ARFLAGS = -shared -o"
+    echo >>make.inc "RANLIB = echo"
+    echo >>make.inc "BLASLIB = libblas.so.${version}"
+  '';
+
+  buildPhase = ''
+    make
+    echo >>make.inc "ARFLAGS = "
+    echo >>make.inc "BLASLIB = libblas.a"
+    echo >>make.inc "AR = ar rcs"
+    echo >>make.inc "RANLIB = ranlib"
+    make
+  '';
+
+  installPhase =
+    # FreeBSD's stdenv doesn't use Coreutils.
+    let dashD = if stdenv.isFreeBSD then "" else "-D"; in
+    (lib.optionalString stdenv.isFreeBSD "mkdir -p $out/lib ;")
+    + ''
+    install ${dashD} -m755 libblas.a "$out/lib/libblas.a"
+    install ${dashD} -m755 libblas.so.${version} "$out/lib/libblas.so.${version}"
+    ln -s libblas.so.${version} "$out/lib/libblas.so.3"
+    ln -s libblas.so.${version} "$out/lib/libblas.so"
+    # Write pkg-config alias.
+    # See also openblas/default.nix
+    mkdir $out/lib/pkgconfig
+    cat <<EOF > $out/lib/pkgconfig/blas.pc
+Name: blas
+Version: ${version}
+Description: blas provided by the BLAS package.
+Libs: -L$out/lib -lblas
+EOF
+  '';
+
+  preFixup = lib.optionalString stdenv.isDarwin ''
+    for fn in $(find $out/lib -name "*.so*"); do
+      if [ -L "$fn" ]; then continue; fi
+      install_name_tool -id "$fn" "$fn"
+    done
+  '';
+
+  meta = {
+    description = "Basic Linear Algebra Subprograms";
+    license = lib.licenses.publicDomain;
+    homepage = "http://www.netlib.org/blas/";
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/blis/default.nix b/nixpkgs/pkgs/development/libraries/science/math/blis/default.nix
new file mode 100644
index 000000000000..26659ffc1661
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/blis/default.nix
@@ -0,0 +1,64 @@
+{ lib, stdenv
+, fetchFromGitHub
+, perl
+, python3
+
+# Enable BLAS interface with 64-bit integer width.
+, blas64 ? false
+
+# Target architecture. x86_64 builds Intel and AMD kernels.
+, withArchitecture ? "x86_64"
+
+# Enable OpenMP-based threading.
+, withOpenMP ? true
+}:
+
+let
+  blasIntSize = if blas64 then "64" else "32";
+in stdenv.mkDerivation rec {
+  pname = "blis";
+  version = "0.8.1";
+
+  src = fetchFromGitHub {
+    owner = "flame";
+    repo = "blis";
+    rev = version;
+    sha256 = "sha256-D5T/itq9zyD5TkeJ4Ae1vS4yEWU51omyJoIkKQ2NLhY=";
+  };
+
+  inherit blas64;
+
+  nativeBuildInputs = [
+    perl
+    python3
+  ];
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  configureFlags = [
+    "--enable-cblas"
+    "--blas-int-size=${blasIntSize}"
+  ] ++ lib.optionals withOpenMP [ "--enable-threading=openmp" ]
+    ++ [ withArchitecture ];
+
+  postPatch = ''
+    patchShebangs configure build/flatten-headers.py
+  '';
+
+  postInstall = ''
+    ln -s $out/lib/libblis.so.3 $out/lib/libblas.so.3
+    ln -s $out/lib/libblis.so.3 $out/lib/libcblas.so.3
+    ln -s $out/lib/libblas.so.3 $out/lib/libblas.so
+    ln -s $out/lib/libcblas.so.3 $out/lib/libcblas.so
+  '';
+
+  meta = with lib; {
+    description = "BLAS-compatible linear algebra library";
+    homepage = "https://github.com/flame/blis";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.danieldk ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/brial/default.nix b/nixpkgs/pkgs/development/libraries/science/math/brial/default.nix
new file mode 100644
index 000000000000..870568c9ac95
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/brial/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, pkg-config
+, boost
+, m4ri
+, gd
+}:
+
+stdenv.mkDerivation rec {
+  version = "1.2.10";
+  pname = "brial";
+
+  src = fetchFromGitHub {
+    owner = "BRiAl";
+    repo = "BRiAl";
+    rev = version;
+    sha256 = "1qg6ssp87rb8p37kahxmm88fbxqg6r540cky5v7wq7l19n2b1bss";
+  };
+
+  # FIXME package boost-test and enable checks
+  doCheck = false;
+
+  configureFlags = [
+    "--with-boost-unit-test-framework=no"
+  ];
+
+  buildInputs = [
+    boost
+    m4ri
+    gd
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/BRiAl/BRiAl";
+    description = "Legacy version of PolyBoRi maintained by sagemath developers";
+    license = licenses.gpl2Plus;
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/caffe2/default.nix b/nixpkgs/pkgs/development/libraries/science/math/caffe2/default.nix
new file mode 100644
index 000000000000..fe9a8b671459
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/caffe2/default.nix
@@ -0,0 +1,143 @@
+{ stdenv, lib, config, fetchFromGitHub
+, cmake
+, glog, gflags, gtest
+, protobuf, snappy
+, python, future, six, python-protobuf, numpy, pydot
+, eigen
+, doxygen
+, useCuda ? (config.cudaSupport or false), cudatoolkit ? null
+, useCudnn ? (config.cudnnSupport or false), cudnn ? null
+, useOpenmp ? false, openmp ? null
+, useOpencv3 ? true, opencv3 ? null
+, useLeveldb ? false, leveldb ? null
+, useLmdb ? true, lmdb ? null
+, useRocksdb ? false, rocksdb ? null
+, useZeromq ? false, zeromq ? null
+, useMpi ? false, mpi ? null
+# TODO: distributed computations
+#, useGloo ? false
+#, useNccl ? false
+#, useNnpack ? false
+}:
+
+assert useCuda -> cudatoolkit != null;
+assert useCudnn -> (useCuda && cudnn != null);
+assert useOpencv3 -> opencv3 != null;
+assert useLeveldb -> leveldb != null;
+assert useLmdb -> lmdb != null;
+assert useRocksdb -> rocksdb != null;
+assert useZeromq -> zeromq != null;
+assert useMpi -> mpi != null;
+
+let
+  # Third party modules that caffe2 holds as git submodules.
+  # Download them and create symlinks from caffe2/third_party.
+  installExtraSrc = extra: ''
+    rmdir "third_party/${extra.dst}"
+    ln -s "${extra.src}" "third_party/${extra.dst}"
+  '';
+
+  cub = {
+    src = fetchFromGitHub {
+      owner  = "NVlabs";
+      repo   = "cub";
+      rev    = "v1.7.4";
+      sha256 = "0ksd5n1lxqhm5l5cd2lps4cszhjkf6gmzahaycs7nxb06qci8c66";
+    };
+    dst = "cub";
+  };
+
+  pybind11 = {
+    src = fetchFromGitHub {
+      owner  = "pybind";
+      repo   = "pybind11";
+      rev    = "86e2ad4f77442c3350f9a2476650da6bee253c52";
+      sha256 = "05gi58dirvc8fgm0avpydvidzsbh2zrzgfaq671ym09f6dz0bcgz";
+    };
+    dst = "pybind11";
+  };
+
+  ccVersion = lib.getVersion stdenv.cc;
+in
+
+stdenv.mkDerivation rec {
+  pname = "caffe2";
+  version = "0.8.1";
+  src = fetchFromGitHub {
+    owner = "caffe2";
+    repo = "caffe2";
+    rev = "v${version}";
+    sha256 = "18y7zjc69j6n5642l9caddl641b0djf3pjn4wacdsc1wk1jiyqk8";
+  };
+
+  nativeBuildInputs = [ cmake doxygen gtest ];
+  outputs = [ "bin" "out" ];
+  propagatedBuildOutputs = [ ]; # otherwise propagates out -> bin cycle
+
+  buildInputs = [ glog gflags protobuf snappy eigen ]
+    ++ lib.optional useCuda cudatoolkit
+    ++ lib.optional useCudnn cudnn
+    ++ lib.optional useOpenmp openmp
+    ++ lib.optional useOpencv3 opencv3
+    ++ lib.optional useLeveldb leveldb
+    ++ lib.optional useLmdb lmdb
+    ++ lib.optional useRocksdb rocksdb
+    ++ lib.optional useZeromq zeromq
+  ;
+  propagatedBuildInputs = [ numpy future six python-protobuf pydot ];
+
+  patches = lib.optional (stdenv.cc.isGNU && lib.versionAtLeast ccVersion "7.0.0") [
+    ./fix_compilation_on_gcc7.patch
+  ] ++ lib.optional stdenv.cc.isClang [ ./update_clang_cvtsh_bugfix.patch ];
+
+  cmakeFlags = [ "-DBUILD_TEST=OFF"
+                 "-DBUILD_PYTHON=ON"
+                 ''-DUSE_CUDA=${if useCuda then "ON"else "OFF"}''
+                 ''-DUSE_OPENMP=${if useOpenmp then "ON"else "OFF"}''
+                 ''-DUSE_OPENCV=${if useOpencv3 then "ON"else "OFF"}''
+                 ''-DUSE_MPI=${if useMpi then "ON"else "OFF"}''
+                 ''-DUSE_LEVELDB=${if useLeveldb then "ON"else "OFF"}''
+                 ''-DUSE_LMDB=${if useLmdb then "ON"else "OFF"}''
+                 ''-DUSE_ROCKSDB=${if useRocksdb then "ON"else "OFF"}''
+                 ''-DUSE_ZMQ=${if useZeromq  then "ON"else "OFF"}''
+                 "-DUSE_GLOO=OFF"
+                 "-DUSE_NNPACK=OFF"
+                 "-DUSE_NCCL=OFF"
+                 "-DUSE_REDIS=OFF"
+                 "-DUSE_FFMPEG=OFF"
+               ]
+               ++ lib.optional useCuda [
+                 "-DCUDA_TOOLKIT_ROOT_DIR=${cudatoolkit}"
+                 "-DCUDA_FAST_MATH=ON"
+                 "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/gcc"
+               ];
+
+  preConfigure = ''
+    ${installExtraSrc cub}
+    ${installExtraSrc pybind11}
+    # XXX hack
+    export NIX_CFLAGS_COMPILE="-I ${eigen}/include/eigen3/ $NIX_CFLAGS_COMPILE"
+  '';
+
+  postInstall = ''
+    moveToOutput "bin" "$bin"
+    mkdir -p $out/lib/${python.libPrefix}
+    ln -s $out/ $out/${python.sitePackages}
+  '';
+
+  doCheck = false;
+
+  meta = {
+    homepage = "https://caffe2.ai/";
+    description = "A new lightweight, modular, and scalable deep learning framework";
+    longDescription = ''
+      Caffe2 aims to provide an easy and straightforward way for you to experiment
+      with deep learning and leverage community contributions of new models and
+      algorithms. You can bring your creations to scale using the power of GPUs in the
+      cloud or to the masses on mobile with Caffe2's cross-platform libraries.
+    '';
+    platforms = with lib.platforms; linux;
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ yuriaisaka ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/caffe2/fix_compilation_on_gcc7.patch b/nixpkgs/pkgs/development/libraries/science/math/caffe2/fix_compilation_on_gcc7.patch
new file mode 100644
index 000000000000..f319f20233a2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/caffe2/fix_compilation_on_gcc7.patch
@@ -0,0 +1,46 @@
+diff --git a/caffe2/operators/recurrent_network_op.cc b/caffe2/operators/recurrent_network_op.cc
+index dd4fded..5995e8a 100644
+--- a/caffe2/operators/recurrent_network_op.cc
++++ b/caffe2/operators/recurrent_network_op.cc
+@@ -1,4 +1,4 @@
+-#include "recurrent_network_op.h"
++#include "caffe2/operators/recurrent_network_op.h"
+ #include "caffe2/core/workspace.h"
+ 
+ namespace caffe2 {
+diff --git a/caffe2/operators/recurrent_network_op.h b/caffe2/operators/recurrent_network_op.h
+index 55328e5..ea898bc 100644
+--- a/caffe2/operators/recurrent_network_op.h
++++ b/caffe2/operators/recurrent_network_op.h
+@@ -762,8 +762,8 @@ class AccumulateInputGradientOp : public Operator<Context> {
+   USE_OPERATOR_CONTEXT_FUNCTIONS;
+ 
+   bool RunOnDevice() override {
+-    const auto t =
+-        OperatorBase::Input<Tensor<CPUContext>>(0).template data<int32_t>()[0];
++    const auto& t0 = OperatorBase::Input<Tensor<CPUContext>>(0);
++    const auto t = t0.template data<int32_t>()[0];
+     auto& og = Input(1);
+     auto* g = Output(0);
+ 
+diff --git a/caffe2/queue/queue_ops.h b/caffe2/queue/queue_ops.h
+index f2c0a33..642343f 100644
+--- a/caffe2/queue/queue_ops.h
++++ b/caffe2/queue/queue_ops.h
+@@ -17,13 +17,10 @@ class CreateBlobsQueueOp final : public Operator<Context> {
+         name(operator_def.output().Get(0)) {}
+ 
+   bool RunOnDevice() override {
+-    const auto capacity =
+-        OperatorBase::template GetSingleArgument<int>("capacity", 1);
+-    const auto numBlobs =
+-        OperatorBase::template GetSingleArgument<int>("num_blobs", 1);
++    const auto capacity = GetSingleArgument("capacity", 1);
++    const auto numBlobs = GetSingleArgument("num_blobs", 1);
+     const auto enforceUniqueName =
+-        OperatorBase::template GetSingleArgument<int>(
+-            "enforce_unique_name", false);
++        GetSingleArgument("enforce_unique_name", false);
+     const auto fieldNames =
+         OperatorBase::template GetRepeatedArgument<std::string>("field_names");
+     CAFFE_ENFORCE_EQ(this->OutputSize(), 1);
diff --git a/nixpkgs/pkgs/development/libraries/science/math/caffe2/update_clang_cvtsh_bugfix.patch b/nixpkgs/pkgs/development/libraries/science/math/caffe2/update_clang_cvtsh_bugfix.patch
new file mode 100644
index 000000000000..d908cb6ba80b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/caffe2/update_clang_cvtsh_bugfix.patch
@@ -0,0 +1,55 @@
+diff --git a/caffe2/perfkernels/cvtsh_ss_bugfix.h b/caffe2/perfkernels/cvtsh_ss_bugfix.h
+index bd06681..00172b7 100644
+--- a/caffe2/perfkernels/cvtsh_ss_bugfix.h
++++ b/caffe2/perfkernels/cvtsh_ss_bugfix.h
+@@ -1,10 +1,36 @@
++/**
++ * Copyright (c) 2016-present, Facebook, Inc.
++ *
++ * Licensed under the Apache License, Version 2.0 (the "License");
++ * you may not use this file except in compliance with the License.
++ * You may obtain a copy of the License at
++ *
++ *     http://www.apache.org/licenses/LICENSE-2.0
++ *
++ * Unless required by applicable law or agreed to in writing, software
++ * distributed under the License is distributed on an "AS IS" BASIS,
++ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
++ * See the License for the specific language governing permissions and
++ * limitations under the License.
++ */
++
+ #pragma once
+ 
+-#if defined(__APPLE__) && (__clang_major__ < 8)
++// Apple clang was fixed in 8.1
++#if defined(__apple_build_version__) && ((__clang_major__ < 8) || ((__clang_major__ == 8) && (__clang_minor__ < 1)))
++#define __APPLE_NEED_FIX 1
++#endif
++
++// Regular clang was fixed in 3.9
++#if defined(__clang__) && (__clang_major__ < 4) && (__clang_minor__ < 9)
++#define __CLANG_NEED_FIX 1
++#endif
++
++#if __APPLE_NEED_FIX || __CLANG_NEED_FIX
+ 
+ #include <emmintrin.h>
+ 
+-// This version of apple clang has a bug that _cvtsh_ss is not defined, see
++// This version of clang has a bug that _cvtsh_ss is not defined, see
+ // https://reviews.llvm.org/D16177
+ static __inline float
+     __attribute__((__always_inline__, __nodebug__, __target__("f16c")))
+@@ -15,7 +41,10 @@ _cvtsh_ss(unsigned short a)
+   return r[0];
+ }
+ 
+-#endif // defined(__APPLE__) && (__clang_major__ < 8)
++#endif // __APPLE_NEED_FIX || __CLANG_NEED_FIX
++
++#undef __APPLE_NEED_FIX
++#undef __CLANG_NEED_FIX
+ 
+ #ifdef _MSC_VER
+ 
diff --git a/nixpkgs/pkgs/development/libraries/science/math/cholmod-extra/default.nix b/nixpkgs/pkgs/development/libraries/science/math/cholmod-extra/default.nix
new file mode 100644
index 000000000000..38d1b126ea4e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/cholmod-extra/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, gfortran, suitesparse, blas, lapack }:
+stdenv.mkDerivation rec {
+  pname = "cholmod-extra";
+  version = "1.2.0";
+
+  src = fetchFromGitHub {
+    repo = pname;
+    owner = "jluttine";
+    rev = version;
+    sha256 = "0hz1lfp0zaarvl0dv0zgp337hyd8np41kmdpz5rr3fc6yzw7vmkg";
+  };
+
+  buildInputs = [ suitesparse gfortran blas lapack ];
+
+  makeFlags = [
+    "BLAS=-lcblas"
+  ];
+
+  installFlags = [
+    "INSTALL_LIB=$(out)/lib"
+    "INSTALL_INCLUDE=$(out)/include"
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/jluttine/cholmod-extra";
+    description = "A set of additional routines for SuiteSparse CHOLMOD Module";
+    license = with licenses; [ gpl2Plus ];
+    maintainers = with maintainers; [ jluttine ];
+    platforms = with platforms; unix;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/clblas/default.nix b/nixpkgs/pkgs/development/libraries/science/math/clblas/default.nix
new file mode 100644
index 000000000000..fcb49d70a3b1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/clblas/default.nix
@@ -0,0 +1,69 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, gfortran
+, blas
+, boost
+, python3
+, ocl-icd
+, opencl-headers
+, Accelerate, CoreGraphics, CoreVideo, OpenCL
+}:
+
+stdenv.mkDerivation rec {
+  pname = "clblas";
+  version = "2.12";
+
+  src = fetchFromGitHub {
+    owner = "clMathLibraries";
+    repo = "clBLAS";
+    rev = "v${version}";
+    sha256 = "154mz52r5hm0jrp5fqrirzzbki14c1jkacj75flplnykbl36ibjs";
+  };
+
+  patches = [ ./platform.patch ];
+
+  postPatch = ''
+    sed -i -re 's/(set\(\s*Boost_USE_STATIC_LIBS\s+).*/\1OFF\ \)/g' src/CMakeLists.txt
+  '';
+
+  preConfigure = ''
+    cd src
+  '';
+
+  cmakeFlags = [
+     "-DBUILD_TEST=OFF"
+  ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [
+    gfortran
+    blas
+    python3
+    boost
+  ] ++ lib.optionals (!stdenv.isDarwin) [
+    ocl-icd
+    opencl-headers
+  ] ++ lib.optionals stdenv.isDarwin [
+    Accelerate
+    CoreGraphics
+    CoreVideo
+  ];
+  propagatedBuildInputs = lib.optionals stdenv.isDarwin [
+    OpenCL
+  ];
+
+  strictDeps = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/clMathLibraries/clBLAS";
+    description = "A software library containing BLAS functions written in OpenCL";
+    longDescription = ''
+      This package contains a library of BLAS functions on top of OpenCL.
+    '';
+    license = licenses.asl20;
+    maintainers = with maintainers; [ artuuge ];
+    platforms = platforms.unix;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/clblas/platform.patch b/nixpkgs/pkgs/development/libraries/science/math/clblas/platform.patch
new file mode 100644
index 000000000000..87404a426a4b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/clblas/platform.patch
@@ -0,0 +1,34 @@
+diff --git a/src/library/tools/ktest/config.cpp b/src/library/tools/ktest/config.cpp
+index 8b20128..faf9bde 100644
+--- a/src/library/tools/ktest/config.cpp
++++ b/src/library/tools/ktest/config.cpp
+@@ -24,8 +24,6 @@
+ 
+ using namespace clMath;
+ 
+-static const char DEFAULT_PLATFORM_NAME[] = "AMD Accelerated Parallel Processing";
+-
+ Config::Config() :
+     defaultConfig_(""),
+     cpp_("ktest.cpp"),
+@@ -35,7 +33,10 @@ Config::Config() :
+     hasFuncID_(false), hasSubdims_(false),
+     skipAccuracy_(false)
+ {
+-    setPlatform(DEFAULT_PLATFORM_NAME);
++    platform_ = NULL;
++    setPlatform("");
++
++    device_ = NULL;
+     setDevice("");
+ 
+     memset(&kargs_, 0, sizeof(kargs_));
+@@ -262,7 +263,7 @@ Config::setPlatform(const std::string& name)
+             continue;
+         }
+         if (name.empty()) {
+-            found = (strcmp(pname, DEFAULT_PLATFORM_NAME) == 0);
++	    found = true;
+         }
+         else {
+             found = (strcmp(pname, name.c_str()) == 0);
diff --git a/nixpkgs/pkgs/development/libraries/science/math/cliquer/default.nix b/nixpkgs/pkgs/development/libraries/science/math/cliquer/default.nix
new file mode 100644
index 000000000000..0d8bafffb44f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/cliquer/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  version = "1.22";
+  pname = "cliquer";
+
+  # autotoolized version of the original cliquer
+  src = fetchFromGitHub {
+    owner = "dimpase";
+    repo = "autocliquer";
+    rev = "v${version}";
+    sha256 = "00gcmrhi2fjn8b246w5a3b0pl7p6haxy5wjvd9kcqib1xanz59z4";
+  };
+
+  doCheck = true;
+
+  buildInputs = [
+    autoreconfHook
+  ];
+
+  meta = with lib; {
+    homepage = "https://users.aalto.fi/~pat/cliquer.html";
+    downloadPage = src.meta.homepage; # autocliquer
+    description = "Routines for clique searching";
+    longDescription = ''
+      Cliquer is a set of C routines for finding cliques in an arbitrary weighted graph.
+      It uses an exact branch-and-bound algorithm developed by Patric Östergård.
+      It is designed with the aim of being efficient while still being flexible and
+      easy to use.
+    '';
+    license = licenses.gpl2Plus;
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+  };
+}
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..60a3afb50774
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/clmagma/default.nix
@@ -0,0 +1,75 @@
+{ lib, stdenv, fetchurl, gfortran, opencl-headers, clblas, ocl-icd, mkl, intel-ocl }:
+
+with 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 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
new file mode 100644
index 000000000000..d2a5a8c2a790
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/cudnn/default.nix
@@ -0,0 +1,50 @@
+{ callPackage, cudatoolkit_10_0, cudatoolkit_10_1, cudatoolkit_10_2, cudatoolkit_11_0, cudatoolkit_11_1, cudatoolkit_11_2 }:
+
+let
+  generic = args: callPackage (import ./generic.nix (removeAttrs args ["cudatoolkit"])) {
+    inherit (args) cudatoolkit;
+  };
+
+in rec {
+  cudnn_cudatoolkit_10_0 = generic rec {
+    version = "7.4.2";
+    cudatoolkit = cudatoolkit_10_0;
+    srcName = "cudnn-${cudatoolkit.majorVersion}-linux-x64-v7.4.2.24.tgz";
+    sha256 = "18ys0apiz9afid2s6lvy9qbyi8g66aimb2a7ikl1f3dm09mciprf";
+  };
+
+  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_2 = generic rec {
+    version = "7.6.5";
+    cudatoolkit = cudatoolkit_10_2;
+    srcName = "cudnn-${cudatoolkit.majorVersion}-linux-x64-v7.6.5.32.tgz";
+    sha256 = "084c13vzjdkb5s1996yilybg6dgav1lscjr1xdcgvlmfrbr6f0k0";
+  };
+
+  cudnn_cudatoolkit_10 = cudnn_cudatoolkit_10_2;
+
+  cudnn_cudatoolkit_11_0 = generic rec {
+    version = "8.1.1";
+    cudatoolkit = cudatoolkit_11_0;
+    # 8.1.0 is compatible with CUDA 11.0, 11.1, and 11.2:
+    # https://docs.nvidia.com/deeplearning/cudnn/support-matrix/index.html#cudnn-cuda-hardware-versions
+    srcName = "cudnn-11.2-linux-x64-v8.1.1.33.tgz";
+    hash = "sha256-mKh4TpKGLyABjSDCgbMNSgzZUfk2lPZDPM9K6cUCumo=";
+  };
+
+  cudnn_cudatoolkit_11_1 = cudnn_cudatoolkit_11_0.override {
+    cudatoolkit = cudatoolkit_11_1;
+  };
+
+  cudnn_cudatoolkit_11_2 = cudnn_cudatoolkit_11_0.override {
+    cudatoolkit = cudatoolkit_11_2;
+  };
+
+  cudnn_cudatoolkit_11 = cudnn_cudatoolkit_11_2;
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix b/nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix
new file mode 100644
index 000000000000..f5a4fac1a908
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix
@@ -0,0 +1,83 @@
+{ version
+, srcName
+, hash ? null
+, sha256 ? null
+}:
+
+assert (hash != null) || (sha256 != null);
+
+{ stdenv
+, lib
+, cudatoolkit
+, fetchurl
+, addOpenGLRunpath
+, # The distributed version of CUDNN includes both dynamically liked .so files,
+  # as well as statically linked .a files.  However, CUDNN is quite large
+  # (multiple gigabytes), so you can save some space in your nix store by
+  # removing the statically linked libraries if you are not using them.
+  #
+  # Setting this to true removes the statically linked .a files.
+  # Setting this to false keeps these statically linked .a files.
+  removeStatic ? false
+}:
+
+stdenv.mkDerivation {
+  name = "cudatoolkit-${cudatoolkit.majorVersion}-cudnn-${version}";
+
+  inherit version;
+
+  src = let
+    hash_ = if hash != null then { inherit hash; } else { inherit sha256; };
+  in fetchurl ({
+    # URL from NVIDIA docker containers: https://gitlab.com/nvidia/cuda/blob/centos7/7.0/runtime/cudnn4/Dockerfile
+    url = "https://developer.download.nvidia.com/compute/redist/cudnn/v${version}/${srcName}";
+  } // hash_);
+
+  nativeBuildInputs = [ addOpenGLRunpath ];
+
+  installPhase = ''
+    runHook preInstall
+
+    function fixRunPath {
+      p=$(patchelf --print-rpath $1)
+      patchelf --set-rpath "''${p:+$p:}${lib.makeLibraryPath [ stdenv.cc.cc ]}:\$ORIGIN/" $1
+    }
+
+    for lib in lib64/lib*.so; do
+      fixRunPath $lib
+    done
+
+    mkdir -p $out
+    cp -a include $out/include
+    cp -a lib64 $out/lib64
+  '' + lib.optionalString removeStatic ''
+    rm -f $out/lib64/*.a
+  '' + ''
+    runHook postInstall
+  '';
+
+  # Set RUNPATH so that libcuda in /run/opengl-driver(-32)/lib can be found.
+  # See the explanation in addOpenGLRunpath.
+  postFixup = ''
+    for lib in $out/lib/lib*.so; do
+      addOpenGLRunpath $lib
+    done
+  '';
+
+  propagatedBuildInputs = [
+    cudatoolkit
+  ];
+
+  passthru = {
+    inherit cudatoolkit;
+    majorVersion = lib.versions.major version;
+  };
+
+  meta = with lib; {
+    description = "NVIDIA CUDA Deep Neural Network library (cuDNN)";
+    homepage = "https://developer.nvidia.com/cudnn";
+    license = licenses.unfree;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ mdaiter ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/cutensor/default.nix b/nixpkgs/pkgs/development/libraries/science/math/cutensor/default.nix
new file mode 100644
index 000000000000..1b5895b02bb3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/cutensor/default.nix
@@ -0,0 +1,37 @@
+{ callPackage
+, cudatoolkit_10_1, cudatoolkit_10_2
+, cudatoolkit_11_0, cudatoolkit_11_1, cudatoolkit_11_2
+}:
+
+rec {
+  cutensor_cudatoolkit_10_1 = callPackage ./generic.nix rec {
+    version = "1.2.2.5";
+    libPath = "lib/10.1";
+    cudatoolkit = cudatoolkit_10_1;
+    # 1.2.2 is compatible with CUDA 11.0, 11.1, and 11.2:
+    # ephemeral doc at https://developer.nvidia.com/cutensor/downloads
+    sha256 = "1dl9bd71frhac9cb8lvnh71zfsnqxbxbfhndvva2zf6nh0my4klm";
+  };
+
+  cutensor_cudatoolkit_10_2 = cutensor_cudatoolkit_10_1.override {
+    libPath = "lib/10.2";
+    cudatoolkit = cudatoolkit_10_2;
+  };
+
+  cutensor_cudatoolkit_10 = cutensor_cudatoolkit_10_2;
+
+  cutensor_cudatoolkit_11_0 = cutensor_cudatoolkit_10_2.override {
+    libPath = "lib/11";
+    cudatoolkit = cudatoolkit_11_0;
+  };
+
+  cutensor_cudatoolkit_11_1 = cutensor_cudatoolkit_11_0.override {
+    cudatoolkit = cudatoolkit_11_1;
+  };
+
+  cutensor_cudatoolkit_11_2 = cutensor_cudatoolkit_11_0.override {
+    cudatoolkit = cudatoolkit_11_2;
+  };
+
+  cutensor_cudatoolkit_11 = cutensor_cudatoolkit_11_2;
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/cutensor/generic.nix b/nixpkgs/pkgs/development/libraries/science/math/cutensor/generic.nix
new file mode 100644
index 000000000000..0b2bd31b2c30
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/cutensor/generic.nix
@@ -0,0 +1,69 @@
+{ stdenv
+, lib
+, libPath
+, cudatoolkit
+, fetchurl
+, autoPatchelfHook
+, addOpenGLRunpath
+
+, version
+, sha256
+}:
+
+let
+  mostOfVersion = builtins.concatStringsSep "."
+    (lib.take 3 (lib.versions.splitVersion version));
+in
+
+stdenv.mkDerivation {
+  pname = "cudatoolkit-${cudatoolkit.majorVersion}-cutensor";
+  inherit version;
+
+  src = fetchurl {
+    url = "https://developer.download.nvidia.com/compute/cutensor/${mostOfVersion}/local_installers/libcutensor-${stdenv.hostPlatform.parsed.kernel.name}-${stdenv.hostPlatform.parsed.cpu.name}-${version}.tar.gz";
+    inherit sha256;
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+    addOpenGLRunpath
+  ];
+
+  buildInputs = [
+    stdenv.cc.cc.lib
+  ];
+
+  propagatedBuildInputs = [
+    cudatoolkit
+  ];
+
+  # Set RUNPATH so that libcuda in /run/opengl-driver(-32)/lib can be found.
+  # See the explanation in addOpenGLRunpath.
+  installPhase = ''
+    mkdir -p "$out" "$dev"
+    mv include "$dev"
+    mv ${libPath} "$out/lib"
+
+    function finalRPathFixups {
+      for lib in $out/lib/lib*.so; do
+        addOpenGLRunpath $lib
+      done
+    }
+    postFixupHooks+=(finalRPathFixups)
+  '';
+
+  passthru = {
+    inherit cudatoolkit;
+    majorVersion = lib.versions.major version;
+  };
+
+  meta = with lib; {
+    description = "cuTENSOR: A High-Performance CUDA Library For Tensor Primitives";
+    homepage = "https://developer.nvidia.com/cutensor";
+    license = licenses.unfree;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ obsidian-systems-maintenance ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/ecos/default.nix b/nixpkgs/pkgs/development/libraries/science/math/ecos/default.nix
new file mode 100644
index 000000000000..b60bd1fe76c1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/ecos/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "ecos";
+  version = "2.0.7";
+
+  src = fetchFromGitHub {
+    owner = "embotech";
+    repo = "ecos";
+    rev = version;
+    sha256 = "1hsndim5kjvcwk5svqa4igawzahj982180xj1d7yd0dbjlgxc7w7";
+  };
+
+  buildPhase = ''
+    make all shared
+  '';
+
+  doCheck = true;
+  checkPhase = ''
+    make test
+    ./runecos
+  '';
+
+  installPhase = ''
+    mkdir -p $out/lib
+    cp lib*.a lib*.so $out/lib
+    cp -r include $out/
+  '';
+
+  meta = with lib; {
+    description = "A lightweight conic solver for second-order cone programming";
+    homepage = "https://www.embotech.com/ECOS";
+    downloadPage = "https://github.com/embotech/ecos/releases";
+    license = licenses.gpl3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ bhipple ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix b/nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix
new file mode 100644
index 000000000000..e80607ab9556
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix
@@ -0,0 +1,261 @@
+{ lib, stdenv
+, fetchurl
+, fetchpatch
+, boost
+, cmake
+, doxygen
+, eigen
+, mpi4py
+, numpy
+, pkg-config
+, pybind11
+, pytest
+, pythonPackages
+, six
+, sympy
+, gtest
+, hdf5
+, mpi
+, ply
+, python
+, scotch
+, setuptools
+, sphinx
+, suitesparse
+, swig
+, zlib
+, blas
+, lapack
+}:
+let
+  version = "2019.1.0";
+
+  dijitso = pythonPackages.buildPythonPackage {
+    pname = "dijitso";
+    inherit version;
+    src = fetchurl {
+      url = "https://bitbucket.org/fenics-project/dijitso/downloads/dijitso-${version}.tar.gz";
+      sha256 = "1ncgbr0bn5cvv16f13g722a0ipw6p9y6p4iasxjziwsp8kn5x97a";
+    };
+    propagatedBuildInputs = [ numpy six ];
+    checkInputs = [ pytest ];
+    preCheck = ''
+      export HOME=$PWD
+    '';
+    checkPhase = ''
+      runHook preCheck
+      py.test test/
+      runHook postCheck
+    '';
+    meta = {
+      description = "Distributed just-in-time shared library building";
+      homepage = "https://fenicsproject.org/";
+      platforms = lib.platforms.all;
+      license = lib.licenses.lgpl3;
+    };
+  };
+
+  fiat = pythonPackages.buildPythonPackage {
+    pname = "fiat";
+    inherit version;
+    src = fetchurl {
+      url = "https://bitbucket.org/fenics-project/fiat/downloads/fiat-${version}.tar.gz";
+      sha256 = "1sbi0fbr7w9g9ajr565g3njxrc3qydqjy3334vmz5xg0rd3106il";
+    };
+    propagatedBuildInputs = [ numpy six sympy ];
+    checkInputs = [ pytest ];
+
+    preCheck = ''
+      # Workaround pytest 4.6.3 issue.
+      # See: https://bitbucket.org/fenics-project/fiat/pull-requests/59
+      rm test/unit/test_quadrature.py
+      rm test/unit/test_reference_element.py
+      rm test/unit/test_fiat.py
+    '';
+    checkPhase = ''
+      runHook preCheck
+      py.test test/unit/
+      runHook postCheck
+    '';
+    meta = {
+      description = "Automatic generation of finite element basis functions";
+      homepage = "https://fenicsproject.org/";
+      platforms = lib.platforms.all;
+      license = lib.licenses.lgpl3;
+    };
+  };
+
+  ufl = pythonPackages.buildPythonPackage {
+    pname = "ufl";
+    inherit version;
+    src = fetchurl {
+      url = "https://bitbucket.org/fenics-project/ufl/downloads/ufl-${version}.tar.gz";
+      sha256 = "04daxwg4y9c51sdgvwgmlc82nn0fjw7i2vzs15ckdc7dlazmcfi1";
+    };
+    propagatedBuildInputs = [ numpy six ];
+    checkInputs = [ pytest ];
+    checkPhase = ''
+      runHook preCheck
+      py.test test/
+      runHook postCheck
+    '';
+    meta = {
+      description = "A domain-specific language for finite element variational forms";
+      homepage = "https://fenicsproject.org/";
+      platforms = lib.platforms.all;
+      license = lib.licenses.lgpl3;
+    };
+  };
+
+  ffc = pythonPackages.buildPythonPackage {
+    pname = "ffc";
+    inherit version;
+    src = fetchurl {
+      url = "https://bitbucket.org/fenics-project/ffc/downloads/ffc-${version}.tar.gz";
+      sha256 = "1zdg6pziss4va74pd7jjl8sc3ya2gmhpypccmyd8p7c66ji23y2g";
+    };
+    nativeBuildInputs = [
+      pybind11
+    ];
+    propagatedBuildInputs = [
+      dijitso
+      fiat
+      numpy
+      six
+      sympy
+      ufl
+      setuptools
+    ];
+    checkInputs = [ pytest ];
+    preCheck = ''
+      export HOME=$PWD
+      rm test/unit/ufc/finite_element/test_evaluate.py
+    '';
+    checkPhase = ''
+      runHook preCheck
+      py.test test/unit/
+      runHook postCheck
+    '';
+    meta = {
+      description = "A compiler for finite element variational forms";
+      homepage = "https://fenicsproject.org/";
+      platforms = lib.platforms.all;
+      license = lib.licenses.lgpl3;
+    };
+  };
+  dolfin = stdenv.mkDerivation {
+    pname = "dolfin";
+    inherit version;
+    src = fetchurl {
+      url = "https://bitbucket.org/fenics-project/dolfin/downloads/dolfin-${version}.tar.gz";
+      sha256 = "0kbyi4x5f6j4zpasch0swh0ch81w2h92rqm1nfp3ydi4a93vky33";
+    };
+    patches = [
+      (fetchpatch {
+        name = "fix-double-prefix.patch";
+        url = "https://bitbucket.org/josef_kemetmueller/dolfin/commits/328e94acd426ebaf2243c072b806be3379fd4340/raw";
+        sha256 = "1zj7k3y7vsx0hz3gwwlxhq6gdqamqpcw90d4ishwx5ps5ckcsb9r";
+      })
+    ];
+    propagatedBuildInputs = [
+      dijitso
+      fiat
+      numpy
+      six
+      ufl
+    ];
+    nativeBuildInputs = [
+      cmake
+      doxygen
+      pkg-config
+    ];
+    buildInputs = [
+      boost
+      dijitso
+      eigen
+      ffc
+      fiat
+      hdf5
+      mpi
+      numpy
+      blas
+      lapack
+      ply
+      python
+      scotch
+      six
+      sphinx
+      suitesparse
+      swig
+      sympy
+      ufl
+      zlib
+    ];
+    cmakeFlags = [
+      "-DDOLFIN_CXX_FLAGS=-std=c++11"
+      "-DDOLFIN_AUTO_DETECT_MPI=ON"
+      "-DDOLFIN_ENABLE_CHOLMOD=ON"
+      "-DDOLFIN_ENABLE_DOCS=ON"
+      "-DDOLFIN_ENABLE_HDF5=ON"
+      "-DDOLFIN_ENABLE_MPI=ON"
+      "-DDOLFIN_ENABLE_SCOTCH=ON"
+      "-DDOLFIN_ENABLE_UMFPACK=ON"
+      "-DDOLFIN_ENABLE_ZLIB=ON"
+      "-DDOLFIN_SKIP_BUILD_TESTS=ON" # Otherwise SCOTCH is not found
+      # TODO: Enable the following features
+      "-DDOLFIN_ENABLE_PARMETIS=OFF"
+      "-DDOLFIN_ENABLE_PETSC=OFF"
+      "-DDOLFIN_ENABLE_SLEPC=OFF"
+      "-DDOLFIN_ENABLE_TRILINOS=OFF"
+    ];
+    installCheckPhase = ''
+      source $out/share/dolfin/dolfin.conf
+      make runtests
+    '';
+    meta = {
+      description = "The FEniCS Problem Solving Environment in Python and C++";
+      homepage = "https://fenicsproject.org/";
+      license = lib.licenses.lgpl3;
+    };
+  };
+  python-dolfin = pythonPackages.buildPythonPackage rec {
+    pname = "dolfin";
+    inherit version;
+    disabled = pythonPackages.isPy27;
+    src = dolfin.src;
+    sourceRoot = "${pname}-${version}/python";
+    nativeBuildInputs = [
+      pybind11
+      cmake
+    ];
+    dontUseCmakeConfigure = true;
+    preConfigure = ''
+      export CMAKE_PREFIX_PATH=${pybind11}/share/cmake/pybind11:$CMAKE_PREFIX_PATH
+      substituteInPlace setup.py --replace "pybind11==2.2.4" "pybind11"
+      substituteInPlace dolfin/jit/jit.py \
+        --replace 'pkg-config.exists("dolfin")' 'pkg-config.exists("${dolfin}/lib/pkgconfig/dolfin.pc")' \
+        --replace 'pkg-config.parse("dolfin")' 'pkg-config.parse("${dolfin}/lib/pkgconfig/dolfin.pc")'
+    '';
+    buildInputs = [
+      dolfin
+      boost
+    ];
+
+    propagatedBuildInputs = [
+      dijitso
+      ffc
+      mpi4py
+      numpy
+      ufl
+      pythonPackages.pkgconfig
+      pythonPackages.pybind11
+    ];
+    doCheck = false; # Tries to orte_ess_init and call ssh to localhost
+    meta = {
+      description = "Python bindings for the DOLFIN FEM compiler";
+      homepage = "https://fenicsproject.org/";
+      platforms = lib.platforms.all;
+      license = lib.licenses.lgpl3;
+    };
+  };
+in python-dolfin
diff --git a/nixpkgs/pkgs/development/libraries/science/math/flintqs/default.nix b/nixpkgs/pkgs/development/libraries/science/math/flintqs/default.nix
new file mode 100644
index 000000000000..c956eae4f710
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/flintqs/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, gmp
+}:
+
+stdenv.mkDerivation rec {
+  version = "1.0";
+  pname = "flintqs";
+
+  src = fetchFromGitHub {
+    owner = "sagemath";
+    repo = "FlintQS";
+    rev = "v${version}";
+    sha256 = "1f0lnayz6j6qgasx8pbq61d2fqam0wwhsmh6h15l4vq58l1vvbwj";
+  };
+
+  preAutoreconf = ''
+    touch ChangeLog
+  '';
+
+  buildInputs = [
+    gmp
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/sagemath/FlintQS";
+    description = "Highly optimized multi-polynomial quadratic sieve for integer factorization";
+    license = with licenses; [ gpl2 ];
+    maintainers = teams.sage.members;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/ipopt/default.nix b/nixpkgs/pkgs/development/libraries/science/math/ipopt/default.nix
new file mode 100644
index 000000000000..d1d7a9b9f342
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/ipopt/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, unzip, blas, lapack, gfortran }:
+
+assert (!blas.isILP64) && (!lapack.isILP64);
+
+stdenv.mkDerivation rec {
+  pname = "ipopt";
+  version = "3.12.13";
+
+  src = fetchurl {
+    url = "https://www.coin-or.org/download/source/Ipopt/Ipopt-${version}.zip";
+    sha256 = "0kzf05aypx8q5mr3sciclk926ans0yi2d2chjdxxgpi3sza609dx";
+  };
+
+  CXXDEFS = [ "-DHAVE_RAND" "-DHAVE_CSTRING" "-DHAVE_CSTDIO" ];
+
+  configureFlags = [
+    "--with-blas-lib=-lblas"
+    "--with-lapack-lib=-llapack"
+  ];
+
+  nativeBuildInputs = [ unzip ];
+
+  buildInputs = [ gfortran blas lapack ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A software package for large-scale nonlinear optimization";
+    homepage = "https://projects.coin-or.org/Ipopt";
+    license = licenses.epl10;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/itpp/default.nix b/nixpkgs/pkgs/development/libraries/science/math/itpp/default.nix
new file mode 100644
index 000000000000..81303a3653ec
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/itpp/default.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv
+, fetchurl
+, cmake
+, gtest
+, blas
+, fftw
+, liblapack
+, gfortran
+}:
+
+stdenv.mkDerivation rec {
+  pname = "it++";
+  version = "4.3.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/itpp/itpp-${version}.tar.bz2";
+    sha256 = "0xxqag9wi0lg78xgw7b40rp6wxqp5grqlbs9z0ifvdfzqlhpcwah";
+  };
+
+  nativeBuildInputs = [ cmake gfortran ];
+  buildInputs = [
+    fftw
+    liblapack
+
+    # NOTE: OpenBLAS doesn't work here because IT++ doesn't pass aligned
+    # buffers, which causes segfaults in the optimized kernels :-(
+    blas
+  ];
+
+  cmakeFlags = [
+    "-DBLAS_FOUND:BOOL=TRUE"
+    "-DBLAS_LIBRARIES:STRING=${blas}/lib/libblas.so"
+    "-DLAPACK_FOUND:BOOL=TRUE"
+    "-DLAPACK_LIBRARIES:STRING=${liblapack}/lib/liblapack.so"
+    "-DGTEST_DIR:PATH=${gtest.src}/googletest"
+  ];
+
+  doCheck = true;
+
+  checkPhase = ''
+    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/itpp
+    export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/itpp
+    ./gtests/itpp_gtests
+  '';
+
+  meta = with lib; {
+    description = "IT++ is a C++ library of mathematical, signal processing and communication classes and functions";
+    homepage = http://itpp.sourceforge.net/;
+    license = licenses.gpl3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ andrew-d ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/lcalc/default.nix b/nixpkgs/pkgs/development/libraries/science/math/lcalc/default.nix
new file mode 100644
index 000000000000..3f0cf45062f1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/lcalc/default.nix
@@ -0,0 +1,97 @@
+{ lib, stdenv
+, fetchurl
+, fetchpatch
+, pari
+}:
+
+stdenv.mkDerivation rec {
+  version = "1.23";
+  pname = "lcalc";
+
+  src = fetchurl {
+    # original at http://oto.math.uwaterloo.ca/~mrubinst/L_function_public/CODE/L-${version}.tar.gz, no longer available
+    # "newer" version at google code https://code.google.com/archive/p/l-calc/source/default/source
+    url = "mirror://sageupstream/lcalc/lcalc-${version}.tar.bz2";
+    sha256 = "1c6dsdshgxhqppjxvxhp8yhpxaqvnz3d1mlh26r571gkq8z2bm43";
+  };
+
+  preConfigure = "cd src";
+
+  buildInputs = [
+    pari
+  ];
+
+  patches = [
+    # Port to newer pari
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/pari-2.7.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "1x3aslldm8njjm7p9g9s9w2c91kphnci2vpkxkrcxfihw3ayss6c";
+    })
+
+    # Uncomment the definition of lcalc_to_double(const long double& x).
+    # (Necessary for GCC >= 4.6.0, cf. https://trac.sagemath.org/ticket/10892)
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/Lcommon.h.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "0g4ybvsrcv48rmlh1xjnkms19jp25k58azv6ds1f2cm34hxs8fdx";
+    })
+
+    # Include also <time.h> in Lcommandline_numbertheory.h (at least required
+    # on Cygwin, cf. https://trac.sagemath.org/ticket/9845)
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/time.h.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "1brf04n11kkc43ylagf8dm32j5r2g9zv51dp5wag1mpm4p04l7cl";
+    })
+
+    # Fix for gcc >4.6
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/lcalc-1.23_default_parameters_1.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "0i2yvxm5fx4z0v6m4srgh8rj98kijmlvyirlxf1ky0bp2si6bpka";
+    })
+
+    # gcc 5.1
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/lcalc-1.23_default_parameters_2.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "0dqwmxpm9wb53qbypsyfkgsvk2f8nf67sydphd4dkc2vw4yz6vlh";
+    })
+
+    # based on gentoos makefile patch -- fix paths, adhere to flags
+    ./makefile.patch
+
+    # (fetchpatch {
+    #   name = "default-double.patch";
+    #   url = "https://github.com/dimpase/lcalc/pull/1/commits/0500c67b6aa1f492715591669f6647c8f7a3ea59.patch";
+    #   sha256 = "0dqwmxpm9wb53qbypsyfkgsvk2f8nf67sydphd4dkc2vw4yz6vla";
+    # })
+
+    (fetchpatch {
+      name = "c++11.patch";
+      url = "https://raw.githubusercontent.com/archlinux/svntogit-community/3607b97df5a8c231191115b0cb5c62426b339e71/trunk/lcalc-c++11.patch";
+      sha256 = "1ccrl61lv2vvx8ggldq54m5d0n1iy6mym7qz0i8nj6yj0dshnpk3";
+    })
+  ] ++ lib.optional stdenv.isDarwin
+  (fetchpatch {
+    url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/clang.patch";
+    sha256 = "0bb7656z6cp6i4p2qj745cmq0lhh52v2akl9whi760dynfdxbl18";
+  });
+
+  postPatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace src/Makefile --replace g++ c++
+  '';
+
+  installFlags = [
+    "DESTDIR=$(out)"
+  ];
+
+  makeFlags = [
+    "PARI_DEFINE=-DINCLUDE_PARI"
+    "PARI_PREFIX=${pari}"
+  ];
+
+  meta = with lib; {
+    homepage = "http://oto.math.uwaterloo.ca/~mrubinst/L_function_public/L.html";
+    description = "A program for calculating with L-functions";
+    license = with licenses; [ gpl2 ];
+    maintainers = teams.sage.members;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/lcalc/makefile.patch b/nixpkgs/pkgs/development/libraries/science/math/lcalc/makefile.patch
new file mode 100644
index 000000000000..5c22cf0b84e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/lcalc/makefile.patch
@@ -0,0 +1,113 @@
+diff --git a/src/Makefile b/src/Makefile
+index 84e4e88..56ca676 100644
+--- a/src/Makefile
++++ b/src/Makefile
+@@ -58,7 +58,7 @@ ifeq ($(G5),TRUE)
+    #MACHINE_SPECIFIC_FLAGS = -mpowerpc -mpowerpc64 -m64
+ endif
+ 
+-CCFLAGS =  -Wa,-W -O3 $(OPENMP_FLAG) -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
++CCFLAGS = $(CXXFLAGS) $(OPENMP_FLAG) $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS)
+ #CCFLAGS =  -Wa,-W -O3 $(OPENMP_FLAG)  $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
+ #CCFLAGS =  -Wa,-W -O2 -fno-exceptions -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MACHINE_SPECIFIC_FLAGS) $(EXTRA)
+ 
+@@ -68,12 +68,12 @@ CCFLAGS =  -Wa,-W -O3 $(OPENMP_FLAG) -Wno-deprecated $(PREPROCESSOR_DEFINE) $(MA
+ 
+ ifeq ($(PARI_DEFINE),-DINCLUDE_PARI)
+     #location of pari.h.
+-    LOCATION_PARI_H = /usr/local/include/pari #usual location
++    LOCATION_PARI_H = $(PARI_PREFIX)/include/pari #usual location
+ 
+     #location of libpari.a or of libpari.so
+     #depending on whether static or dynamic libraries are being used.
+     #On mac os x it's the former, on linux I think usually the latter.
+-    LOCATION_PARI_LIBRARY = /usr/local/lib #usual location
++    LOCATION_PARI_LIBRARY = $(PARI_PREFIX)/lib #usual location
+ else
+     #supplied as a dummy so as to avoid more ifeq's below
+     LOCATION_PARI_H = .
+@@ -89,24 +89,24 @@ INCLUDEFILES= -I../include
+ 
+ ifeq ($(OS_NAME),Darwin)
+     LDFLAGS2 =
+-    DYN_OPTION=dynamiclib
++    DYN_OPTION=-dynamiclib
+ else
+-    LDFLAGS1 = -Xlinker -export-dynamic #not sure why pari calls these when linking but on the web I found
++    LDFLAGS1 = #not sure why pari calls these when linking but on the web I found
+     #'Libtool provides the `-export-dynamic' link flag (see section Link mode), which does this declaration.
+     #You need to use this flag if you are linking a shared library that will be dlopened'
+     #see notes below
+     #ifeq ($(PARI_DEFINE),-DINCLUDE_PARI)
+-       LDFLAGS2 = $(LDFLAGS1) -Xlinker -rpath -Xlinker $(LOCATION_PARI_LIBRARY)
++       LDFLAGS2 = $(LDFLAGS)
+     #else
+     #    LDFLAGS2 = $(LDFLAGS1)
+     #endif
+-    DYN_OPTION=shared
++    DYN_OPTION=$(LDFLAGS) -shared -Wl,-soname,libLfunction.so
+ endif
+ 
+ ifeq ($(PARI_DEFINE),-DINCLUDE_PARI)
+-    LDFLAGS = $(LDFLAGS2) -L$(LOCATION_PARI_LIBRARY) -lpari
++    MYLDFLAGS = $(LDFLAGS2) -L$(LOCATION_PARI_LIBRARY) -lpari
+ else
+-    LDFLAGS = $(LDFLAGS2)
++    MYLDFLAGS = $(LDFLAGS2)
+ endif
+ 
+ 
+@@ -129,7 +129,8 @@ endif
+ #become clear which libraries the computer can find.
+ 
+ 
+-INSTALL_DIR= /usr/local
++INSTALL_DIR= $(DESTDIR)
++LIB_DIR ?=lib
+ 
+ #object files for the libLfunction library
+ OBJ_L = Lglobals.o Lgamma.o Lriemannsiegel.o Lriemannsiegel_blfi.o Ldokchitser.o
+@@ -141,9 +142,8 @@ OBJECTS = $(OBJ3)
+ 
+ all:
+ #	make print_vars
+-	make libLfunction.so
+-	make lcalc
+-	make examples
++	${MAKE} libLfunction.so
++	${MAKE} lcalc
+ #	make find_L
+ #	make test
+ 
+@@ -151,7 +151,7 @@ print_vars:
+ 	@echo OS_NAME = $(OS_NAME)
+ 
+ lcalc: $(OBJECTS)
+-	$(CC) $(CCFLAGS) $(INCLUDEFILES) $(OBJECTS) $(LDFLAGS) -o lcalc $(GMP_FLAGS)
++	$(CC) $(CCFLAGS) $(INCLUDEFILES) $(OBJECTS) $(MYLDFLAGS) -o lcalc $(GMP_FLAGS)
+ 
+ examples:
+ 	$(CC) $(CCFLAGS) $(INCLUDEFILES) example_programs/example.cc libLfunction.so -o example_programs/example $(GMP_FLAGS)
+@@ -262,15 +262,18 @@ Lcommandline.o: ../include/Lcommandline_values_zeros.h
+ 
+ 
+ libLfunction.so: $(OBJ_L)
+-	g++ -$(DYN_OPTION)  -o libLfunction.so $(OBJ_L)
++	g++ $(DYN_OPTION) -o libLfunction.so $(OBJ_L)
+ 
+ clean:
+ 	rm -f *.o lcalc libLfunction.so example_programs/example
+ 
+ install:
+-	cp -f lcalc $(INSTALL_DIR)/bin/.
+-	cp -f libLfunction.so $(INSTALL_DIR)/lib/.
+-	cp -rf ../include $(INSTALL_DIR)/include/Lfunction
++	install -d $(INSTALL_DIR)/bin
++	install -d $(INSTALL_DIR)/$(LIB_DIR)
++	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/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/libbraiding/default.nix b/nixpkgs/pkgs/development/libraries/science/math/libbraiding/default.nix
new file mode 100644
index 000000000000..cc5d3baf3442
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/libbraiding/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  version = "1.1";
+  pname = "libbraiding";
+
+  src = fetchFromGitHub {
+    owner = "miguelmarco";
+    repo = "libbraiding";
+    rev = version;
+    sha256 = "1n1j58y9jaiv0ya0y4fpfb3b05wv0h6k2babpnk2zifjw26xr366";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+
+  # no tests included for now (2018-08-05), but can't hurt to activate
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/miguelmarco/libbraiding/";
+    description = "C++ library for computations on braid groups";
+    longDescription = ''
+      A library to compute several properties of braids, including centralizer and conjugacy check.
+    '';
+    license = licenses.gpl3;
+    maintainers = teams.sage.members;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/libhomfly/default.nix b/nixpkgs/pkgs/development/libraries/science/math/libhomfly/default.nix
new file mode 100644
index 000000000000..b756109aa8fc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/libhomfly/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, boehmgc
+}:
+
+stdenv.mkDerivation rec {
+  version = "1.02r5";
+  pname = "llibhomfly";
+
+  src = fetchFromGitHub {
+    owner = "miguelmarco";
+    repo = "libhomfly";
+    rev = version;
+    sha256 = "1szv8iwlhvmy3saigi15xz8vgch92p2lbsm6440v5s8vxj455bvd";
+  };
+
+  buildInputs = [
+    boehmgc
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/miguelmarco/libhomfly/";
+    description = "Library to compute the homfly polynomial of knots and links";
+    license = licenses.unlicense;
+    maintainers = teams.sage.members;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix b/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix
new file mode 100644
index 000000000000..f81a02303a60
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix
@@ -0,0 +1,61 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, gfortran
+, cmake
+, shared ? true
+}:
+
+stdenv.mkDerivation rec {
+  pname = "liblapack";
+  version = "3.10.0";
+
+  src = fetchFromGitHub {
+    owner = "Reference-LAPACK";
+    repo = "lapack";
+    rev = "v${version}";
+    sha256 = "sha256-ewYUM+M7jDO5LLnB4joiKkqgXjEDmWbFZbgad8x98gc=";
+  };
+
+  nativeBuildInputs = [ gfortran cmake ];
+
+  # Configure stage fails on aarch64-darwin otherwise, due to either clang 11 or gfortran 10.
+  hardeningDisable = lib.optionals (stdenv.isDarwin && stdenv.isAarch64) [ "stackprotector" ];
+
+  cmakeFlags = [
+    "-DCMAKE_Fortran_FLAGS=-fPIC"
+    "-DLAPACKE=ON"
+    "-DCBLAS=ON"
+    "-DBUILD_TESTING=ON"
+  ] ++ lib.optional shared "-DBUILD_SHARED_LIBS=ON";
+
+  doCheck = true;
+
+  # Some CBLAS related tests fail on Darwin:
+  #  14 - CBLAS-xscblat2 (Failed)
+  #  15 - CBLAS-xscblat3 (Failed)
+  #  17 - CBLAS-xdcblat2 (Failed)
+  #  18 - CBLAS-xdcblat3 (Failed)
+  #  20 - CBLAS-xccblat2 (Failed)
+  #  21 - CBLAS-xccblat3 (Failed)
+  #  23 - CBLAS-xzcblat2 (Failed)
+  #  24 - CBLAS-xzcblat3 (Failed)
+  #
+  # Upstream issue to track:
+  # * https://github.com/Reference-LAPACK/lapack/issues/440
+  ctestArgs = lib.optionalString stdenv.isDarwin "-E '^(CBLAS-(x[sdcz]cblat[23]))$'";
+
+  checkPhase = ''
+    runHook preCheck
+    ctest ${ctestArgs}
+    runHook postCheck
+  '';
+
+  meta = with lib; {
+    description = "Linear Algebra PACKage";
+    homepage = "http://www.netlib.org/lapack/";
+    maintainers = with maintainers; [ ];
+    license = licenses.bsd3;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/liblbfgs/default.nix b/nixpkgs/pkgs/development/libraries/science/math/liblbfgs/default.nix
new file mode 100644
index 000000000000..3c194648c2a3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/liblbfgs/default.nix
@@ -0,0 +1,18 @@
+{ lib, stdenv, fetchurl }:
+stdenv.mkDerivation rec {
+  pname = "liblbfgs";
+  version = "1.10";
+
+  configureFlags = [ "--enable-sse2" ];
+  src = fetchurl {
+    url = "https://github.com/downloads/chokkan/liblbfgs/liblbfgs-${version}.tar.gz";
+    sha256 = "1kv8d289rbz38wrpswx5dkhr2yh4fg4h6sszkp3fawxm09sann21";
+  };
+
+  meta = {
+    description = "Library of Limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS)";
+    homepage = "http://www.chokkan.org/software/liblbfgs/";
+    license = lib.licenses.mit;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/libtorch/bin.nix b/nixpkgs/pkgs/development/libraries/science/math/libtorch/bin.nix
new file mode 100644
index 000000000000..efbd071ecd79
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/libtorch/bin.nix
@@ -0,0 +1,123 @@
+{ callPackage
+, stdenv
+, fetchzip
+, lib
+
+, addOpenGLRunpath
+, patchelf
+, fixDarwinDylibNames
+
+, cudaSupport
+, cudatoolkit_11_1
+, cudnn_cudatoolkit_11_1
+}:
+
+let
+  # The binary libtorch distribution statically links the CUDA
+  # toolkit. This means that we do not need to provide CUDA to
+  # this derivation. However, we should ensure on version bumps
+  # that the CUDA toolkit for `passthru.tests` is still
+  # up-to-date.
+  version = "1.9.0";
+  device = if cudaSupport then "cuda" else "cpu";
+  srcs = import ./binary-hashes.nix version;
+  unavailable = throw "libtorch is not available for this platform";
+in stdenv.mkDerivation {
+  inherit version;
+  pname = "libtorch";
+
+  src = fetchzip srcs."${stdenv.targetPlatform.system}-${device}" or unavailable;
+
+  nativeBuildInputs =
+    if stdenv.isDarwin then [ fixDarwinDylibNames ]
+    else [ patchelf ] ++ lib.optionals cudaSupport [ addOpenGLRunpath ];
+
+  dontBuild = true;
+  dontConfigure = true;
+  dontStrip = true;
+
+  installPhase = ''
+    # Copy headers and CMake files.
+    mkdir -p $dev
+    cp -r include $dev
+    cp -r share $dev
+
+    install -Dm755 -t $out/lib lib/*${stdenv.hostPlatform.extensions.sharedLibrary}*
+
+    # We do not care about Java support...
+    rm -f $out/lib/lib*jni* 2> /dev/null || true
+
+    # Fix up library paths for split outputs
+    substituteInPlace $dev/share/cmake/Torch/TorchConfig.cmake \
+      --replace \''${TORCH_INSTALL_PREFIX}/lib "$out/lib" \
+
+    substituteInPlace \
+      $dev/share/cmake/Caffe2/Caffe2Targets-release.cmake \
+      --replace \''${_IMPORT_PREFIX}/lib "$out/lib" \
+  '';
+
+  postFixup = let
+    rpath = lib.makeLibraryPath [ stdenv.cc.cc.lib ];
+  in lib.optionalString stdenv.isLinux ''
+    find $out/lib -type f \( -name '*.so' -or -name '*.so.*' \) | while read lib; do
+      echo "setting rpath for $lib..."
+      patchelf --set-rpath "${rpath}:$out/lib" "$lib"
+      ${lib.optionalString cudaSupport ''
+        addOpenGLRunpath "$lib"
+      ''}
+    done
+  '' + lib.optionalString stdenv.isDarwin ''
+    install_name_tool -change @rpath/libshm.dylib $out/lib/libshm.dylib $out/lib/libtorch_python.dylib
+    install_name_tool -change @rpath/libc10.dylib $out/lib/libc10.dylib $out/lib/libtorch_python.dylib
+    install_name_tool -change @rpath/libiomp5.dylib $out/lib/libiomp5.dylib $out/lib/libtorch_python.dylib
+    install_name_tool -change @rpath/libtorch.dylib $out/lib/libtorch.dylib $out/lib/libtorch_python.dylib
+    install_name_tool -change @rpath/libtorch_cpu.dylib $out/lib/libtorch_cpu.dylib $out/lib/libtorch_python.dylib
+
+    install_name_tool -change @rpath/libc10.dylib $out/lib/libc10.dylib $out/lib/libtorch.dylib
+    install_name_tool -change @rpath/libiomp5.dylib $out/lib/libiomp5.dylib $out/lib/libtorch.dylib
+    install_name_tool -change @rpath/libtorch_cpu.dylib $out/lib/libtorch_cpu.dylib $out/lib/libtorch.dylib
+
+    install_name_tool -change @rpath/libc10.dylib $out/lib/libc10.dylib $out/lib/libtorch_cpu.dylib
+    install_name_tool -change @rpath/libiomp5.dylib $out/lib/libiomp5.dylib $out/lib/libtorch_cpu.dylib
+    install_name_tool -change @rpath/libtensorpipe.dylib $out/lib/libtensorpipe.dylib $out/lib/libtorch_cpu.dylib
+
+    install_name_tool -change @rpath/libc10.dylib $out/lib/libc10.dylib $out/lib/libcaffe2_observers.dylib
+    install_name_tool -change @rpath/libiomp5.dylib $out/lib/libiomp5.dylib $out/lib/libcaffe2_observers.dylib
+    install_name_tool -change @rpath/libtorch.dylib $out/lib/libtorch.dylib $out/lib/libcaffe2_observers.dylib
+    install_name_tool -change @rpath/libtorch_cpu.dylib $out/lib/libtorch_cpu.dylib $out/lib/libcaffe2_observers.dylib
+
+    install_name_tool -change @rpath/libc10.dylib $out/lib/libc10.dylib $out/lib/libcaffe2_module_test_dynamic.dylib
+    install_name_tool -change @rpath/libiomp5.dylib $out/lib/libiomp5.dylib $out/lib/libcaffe2_module_test_dynamic.dylib
+    install_name_tool -change @rpath/libtorch.dylib $out/lib/libtorch.dylib $out/lib/libcaffe2_module_test_dynamic.dylib
+    install_name_tool -change @rpath/libtorch_cpu.dylib $out/lib/libtorch_cpu.dylib $out/lib/libcaffe2_module_test_dynamic.dylib
+
+    install_name_tool -change @rpath/libc10.dylib $out/lib/libc10.dylib $out/lib/libcaffe2_detectron_ops.dylib
+    install_name_tool -change @rpath/libiomp5.dylib $out/lib/libiomp5.dylib $out/lib/libcaffe2_detectron_ops.dylib
+    install_name_tool -change @rpath/libtorch.dylib $out/lib/libtorch.dylib $out/lib/libcaffe2_detectron_ops.dylib
+    install_name_tool -change @rpath/libtorch_cpu.dylib $out/lib/libtorch_cpu.dylib $out/lib/libcaffe2_detectron_ops.dylib
+
+    install_name_tool -change @rpath/libc10.dylib $out/lib/libc10.dylib $out/lib/libshm.dylib
+    install_name_tool -change @rpath/libiomp5.dylib $out/lib/libiomp5.dylib $out/lib/libshm.dylib
+    install_name_tool -change @rpath/libtorch.dylib $out/lib/libtorch.dylib $out/lib/libshm.dylib
+    install_name_tool -change @rpath/libtorch_cpu.dylib $out/lib/libtorch_cpu.dylib $out/lib/libshm.dylib
+
+    install_name_tool -change @rpath/libiomp5.dylib $out/lib/libiomp5.dylib $out/lib/libtorch_global_deps.dylib
+    install_name_tool -change @rpath/libtorch_cpu.dylib $out/lib/libtorch_cpu.dylib $out/lib/libtorch_global_deps.dylib
+  '';
+
+  outputs = [ "out" "dev" ];
+
+  passthru.tests.cmake = callPackage ./test {
+    inherit cudaSupport;
+    cudatoolkit = cudatoolkit_11_1;
+    cudnn = cudnn_cudatoolkit_11_1;
+  };
+
+  meta = with lib; {
+    description = "C++ API of the PyTorch machine learning framework";
+    homepage = "https://pytorch.org/";
+    license = licenses.unfree; # Includes CUDA and Intel MKL.
+    maintainers = with maintainers; [ danieldk ];
+    platforms = with platforms; linux ++ darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/libtorch/binary-hashes.nix b/nixpkgs/pkgs/development/libraries/science/math/libtorch/binary-hashes.nix
new file mode 100644
index 000000000000..6ded62fb87c3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/libtorch/binary-hashes.nix
@@ -0,0 +1,14 @@
+version: {
+  x86_64-darwin-cpu = {
+    url = "https://download.pytorch.org/libtorch/cpu/libtorch-macos-${version}.zip";
+    hash = "sha256-TOJ+iQpqazta46y4IzIbfEGMjz/fz+pRDV8fKqriB6Q=";
+  };
+  x86_64-linux-cpu = {
+    url = "https://download.pytorch.org/libtorch/cpu/libtorch-cxx11-abi-shared-with-deps-${version}%2Bcpu.zip";
+    hash = "sha256-gZMNLCzW3j+eplBqWo6lVvuHS5iRqtMD8NL3MoszsVg=";
+  };
+  x86_64-linux-cuda = {
+    url = "https://download.pytorch.org/libtorch/cu111/libtorch-cxx11-abi-shared-with-deps-${version}%2Bcu111.zip";
+    hash = "sha256-dRu4F8k2SAbtghwrPJNyX0u3tsODCbXfi9EqUdf4xYc=";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/libtorch/test/CMakeLists.txt b/nixpkgs/pkgs/development/libraries/science/math/libtorch/test/CMakeLists.txt
new file mode 100644
index 000000000000..4e96704a4c17
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/libtorch/test/CMakeLists.txt
@@ -0,0 +1,5 @@
+cmake_minimum_required(VERSION 3.0)
+find_package(Torch REQUIRED)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${TORCH_CXX_FLAGS}")
+add_executable(test test.cpp)
+target_link_libraries(test "${TORCH_LIBRARIES}")
diff --git a/nixpkgs/pkgs/development/libraries/science/math/libtorch/test/default.nix b/nixpkgs/pkgs/development/libraries/science/math/libtorch/test/default.nix
new file mode 100644
index 000000000000..eaea649d4340
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/libtorch/test/default.nix
@@ -0,0 +1,50 @@
+{ lib
+, stdenv
+, cmake
+, libtorch-bin
+, linkFarm
+, symlinkJoin
+
+, cudaSupport
+, cudatoolkit
+, cudnn
+}:
+let
+  cudatoolkit_joined = symlinkJoin {
+    name = "${cudatoolkit.name}-unsplit";
+    paths = [ cudatoolkit.out cudatoolkit.lib ];
+  };
+
+  # We do not have access to /run/opengl-driver/lib in the sandbox,
+  # so use a stub instead.
+  cudaStub = linkFarm "cuda-stub" [{
+    name = "libcuda.so.1";
+    path = "${cudatoolkit}/lib/stubs/libcuda.so";
+  }];
+
+in stdenv.mkDerivation {
+  pname = "libtorch-test";
+  version = libtorch-bin.version;
+
+  src = ./.;
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ libtorch-bin ] ++
+    lib.optionals cudaSupport [ cudnn ];
+
+  cmakeFlags = lib.optionals cudaSupport
+    [ "-DCUDA_TOOLKIT_ROOT_DIR=${cudatoolkit_joined}" ];
+
+  doCheck = true;
+
+  installPhase = ''
+    touch $out
+  '';
+
+  checkPhase = lib.optionalString cudaSupport ''
+    LD_LIBRARY_PATH=${cudaStub}''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH \
+  '' + ''
+    ./test
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/libtorch/test/test.cpp b/nixpkgs/pkgs/development/libraries/science/math/libtorch/test/test.cpp
new file mode 100644
index 000000000000..ca238fba521d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/libtorch/test/test.cpp
@@ -0,0 +1,20 @@
+#undef NDEBUG
+#include <cassert>
+
+#include <iostream>
+
+#include <torch/torch.h>
+
+int main() {
+  torch::Tensor tensor = torch::eye(3);
+
+  float checkData[] = {
+    1, 0, 0,
+    0, 1, 0,
+    0, 0, 1
+  };
+
+  torch::Tensor check = torch::from_blob(checkData, {3, 3});
+
+  assert(tensor.allclose(check));
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/lrs/default.nix b/nixpkgs/pkgs/development/libraries/science/math/lrs/default.nix
new file mode 100644
index 000000000000..063fead11650
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/lrs/default.nix
@@ -0,0 +1,25 @@
+{lib, stdenv, fetchurl, gmp}:
+
+stdenv.mkDerivation rec {
+  pname = "lrs";
+  version = "7.0";
+
+  src = fetchurl {
+    url = "http://cgm.cs.mcgill.ca/~avis/C/lrslib/archive/lrslib-070.tar.gz";
+    sha256 = "1zjdmkjracz695k73c2pvipc0skpyn1wzagkhilsvcw9pqljpwg9";
+  };
+
+  buildInputs = [ gmp ];
+
+  preBuild = ''
+    export makeFlags="$makeFlags prefix=$out";
+  '';
+
+  meta = {
+    description = "Implementation of the reverse search algorithm for vertex enumeration/convex hull problems";
+    license = lib.licenses.gpl2 ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
+    homepage = "http://cgm.cs.mcgill.ca/~avis/C/lrs.html";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/m4ri/default.nix b/nixpkgs/pkgs/development/libraries/science/math/m4ri/default.nix
new file mode 100644
index 000000000000..26e26e4ffdbc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/m4ri/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv
+, fetchFromBitbucket
+, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  version = "20200125";
+  pname = "m4ri";
+
+  src = fetchFromBitbucket {
+    owner = "malb";
+    repo = "m4ri";
+    rev = "release-${version}";
+    sha256 = "1dxgbv6zdyki3h61qlv7003wzhy6x14zmcaz9x19md1i7ng07w1k";
+  };
+
+  doCheck = true;
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+
+  meta = with lib; {
+    homepage = "https://malb.bitbucket.io/m4ri/";
+    description = "Library to do fast arithmetic with dense matrices over F_2";
+    license = licenses.gpl2Plus;
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/m4rie/default.nix b/nixpkgs/pkgs/development/libraries/science/math/m4rie/default.nix
new file mode 100644
index 000000000000..38a633e58c71
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/m4rie/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv
+, fetchFromBitbucket
+, autoreconfHook
+, m4ri
+}:
+
+stdenv.mkDerivation rec {
+  version = "20200115";
+  pname = "m4rie";
+
+  src = fetchFromBitbucket {
+    owner = "malb";
+    repo = "m4rie";
+    rev = "release-${version}";
+    sha256 = "0s8if80x5d6mikbcfsbbxg347136spahp9f3x8i1hflbwl8xj9k8";
+  };
+
+  doCheck = true;
+
+  buildInputs = [
+    m4ri
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+
+  meta = with lib; {
+    homepage = "https://malb.bitbucket.io/m4rie/";
+    description = "Library for matrix multiplication, reduction and inversion over GF(2^k) for 2 <= k <= 10";
+    longDescription = ''
+      M4RIE is a library for fast arithmetic with dense matrices over small finite fields of even characteristic.
+      It uses the M4RI library, implementing the same operations over the finite field F2.
+    '';
+    license = licenses.gpl2Plus;
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/magma/default.nix b/nixpkgs/pkgs/development/libraries/science/math/magma/default.nix
new file mode 100644
index 000000000000..c5960dddf517
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/magma/default.nix
@@ -0,0 +1,89 @@
+{ lib, stdenv, fetchurl, cmake, gfortran, ninja, cudatoolkit, libpthreadstubs, lapack, blas }:
+
+assert let majorIs = lib.versions.major cudatoolkit.version;
+       in majorIs == "9" || majorIs == "10" || majorIs == "11";
+
+let
+  version = "2.5.4";
+
+  # We define a specific set of CUDA compute capabilities here,
+  # because CUDA 11 does not support compute capability 3.0. Also,
+  # we use it to enable newer capabilities that are not enabled
+  # by magma by default. The list of supported architectures
+  # can be found in magma's top-level CMakeLists.txt.
+  cudaCapabilities = rec {
+    cuda9 = [
+      "Kepler"  # 3.0, 3.5
+      "Maxwell" # 5.0
+      "Pascal"  # 6.0
+      "Volta"   # 7.0
+    ];
+
+    cuda10 = [
+      "Turing"  # 7.5
+    ] ++ cuda9;
+
+    cuda11 = [
+      "sm_35"   # sm_30 is not supported by CUDA 11
+      "Maxwell" # 5.0
+      "Pascal"  # 6.0
+      "Volta"   # 7.0
+      "Turing"  # 7.5
+      "Ampere"  # 8.0
+    ];
+  };
+
+  capabilityString = lib.strings.concatStringsSep ","
+    cudaCapabilities."cuda${lib.versions.major cudatoolkit.version}";
+
+in stdenv.mkDerivation {
+  pname = "magma";
+  inherit version;
+  src = fetchurl {
+    url = "https://icl.cs.utk.edu/projectsfiles/magma/downloads/magma-${version}.tar.gz";
+    sha256 = "0rrvd21hczxlm8awc9z54fj7iqpjmsb518fy32s6ghz0g90znd3p";
+    name = "magma-${version}.tar.gz";
+  };
+
+  nativeBuildInputs = [ gfortran cmake ninja ];
+
+  buildInputs = [ cudatoolkit libpthreadstubs lapack blas ];
+
+  cmakeFlags = [ "-DGPU_TARGET=${capabilityString}" ];
+
+  doCheck = false;
+
+  preConfigure = ''
+    export CC=${cudatoolkit.cc}/bin/gcc CXX=${cudatoolkit.cc}/bin/g++
+  '';
+
+  enableParallelBuilding=true;
+  buildFlags = [ "magma" "magma_sparse" ];
+
+  # MAGMA's default CMake setup does not care about installation. So we copy files directly.
+  installPhase = ''
+    mkdir -p $out
+    mkdir -p $out/include
+    mkdir -p $out/lib
+    mkdir -p $out/lib/pkgconfig
+    cp -a ../include/*.h $out/include
+    #cp -a sparse-iter/include/*.h $out/include
+    cp -a lib/*.so $out/lib
+    cat ../lib/pkgconfig/magma.pc.in                   | \
+    sed -e s:@INSTALL_PREFIX@:"$out":          | \
+    sed -e s:@CFLAGS@:"-I$out/include":    | \
+    sed -e s:@LIBS@:"-L$out/lib -lmagma -lmagma_sparse": | \
+    sed -e s:@MAGMA_REQUIRED@::                       \
+        > $out/lib/pkgconfig/magma.pc
+  '';
+
+  meta = with lib; {
+    description = "Matrix Algebra on GPU and Multicore Architectures";
+    license = licenses.bsd3;
+    homepage = "http://icl.cs.utk.edu/magma/index.html";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ tbenst ];
+  };
+
+  passthru.cudatoolkit = cudatoolkit;
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/metis/default.nix b/nixpkgs/pkgs/development/libraries/science/math/metis/default.nix
new file mode 100644
index 000000000000..da79f6d62499
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/metis/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, unzip, cmake }:
+
+stdenv.mkDerivation rec {
+  name = "metis";
+  version = "5.1.0";
+
+  src = fetchurl {
+    url = "http://glaros.dtc.umn.edu/gkhome/fetch/sw/metis/metis-${version}.tar.gz";
+    sha256 = "1cjxgh41r8k6j029yxs8msp3z6lcnpm16g5pvckk35kc7zhfpykn";
+  };
+
+  cmakeFlags = [ "-DGKLIB_PATH=../GKlib" ];
+  nativeBuildInputs = [ unzip cmake ];
+
+  meta = {
+    description = "Serial graph partitioning and fill-reducing matrix ordering";
+    homepage = "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview";
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/mkl/default.nix b/nixpkgs/pkgs/development/libraries/science/math/mkl/default.nix
new file mode 100644
index 000000000000..1f60f4d95388
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/mkl/default.nix
@@ -0,0 +1,201 @@
+{ lib
+, stdenv
+, callPackage
+, stdenvNoCC
+, fetchurl
+, rpmextract
+, undmg
+, darwin
+, validatePkgConfig
+, enableStatic ? stdenv.hostPlatform.isStatic
+}:
+
+/*
+  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.
+*/
+let
+  # Release notes and download URLs are here:
+  # https://registrationcenter.intel.com/en/products/
+  version = "${mklVersion}.${rel}";
+
+  # Darwin is pinned to 2019.3 because the DMG does not unpack; see here for details:
+  # https://github.com/matthewbauer/undmg/issues/4
+  mklVersion = if stdenvNoCC.isDarwin then "2019.3" else "2021.1.1";
+  rel = if stdenvNoCC.isDarwin then "199" else "52";
+
+  # Intel openmp uses its own versioning.
+  openmpVersion = if stdenvNoCC.isDarwin then "19.0.3" else "19.1.3";
+  openmpRel = "189";
+
+  # Thread Building Blocks release.
+  tbbRel = "119";
+
+  shlibExt = stdenvNoCC.hostPlatform.extensions.sharedLibrary;
+
+  oneapi-mkl = fetchurl {
+    url = "https://yum.repos.intel.com/oneapi/intel-oneapi-mkl-${mklVersion}-${mklVersion}-${rel}.x86_64.rpm";
+    hash = "sha256-G2Y7iX3UN2YUJhxcMM2KmhONf0ls9owpGlOo8hHOfqA=";
+  };
+
+  oneapi-mkl-common = fetchurl {
+    url = "https://yum.repos.intel.com/oneapi/intel-oneapi-mkl-common-${mklVersion}-${mklVersion}-${rel}.noarch.rpm";
+    hash = "sha256-HrMt2OcPIRxM8EL8SPjYTyuHJnC7RhPFUrvLhRH+7vc=";
+  };
+
+  oneapi-mkl-common-devel = fetchurl {
+    url = "https://yum.repos.intel.com/oneapi/intel-oneapi-mkl-common-devel-${mklVersion}-${mklVersion}-${rel}.noarch.rpm";
+    hash = "sha256-XDE2WFJzEcpujFmO2AvqQdipZMvKB6/G+ksBe2sE438=";
+  };
+
+  oneapi-mkl-devel = fetchurl {
+    url = "https://yum.repos.intel.com/oneapi/intel-oneapi-mkl-devel-${mklVersion}-${mklVersion}-${rel}.x86_64.rpm";
+    hash = "sha256-GhUJZ0Vr/ZXp10maie29/5ryU7zzX3F++wRCuuFcE0s=";
+  };
+
+  oneapi-openmp = fetchurl {
+    url = "https://yum.repos.intel.com/oneapi/intel-oneapi-openmp-${mklVersion}-${mklVersion}-${openmpRel}.x86_64.rpm";
+    hash = "sha256-yP2c4aQAFNRffjLoIZgWXLcNXbiez8smsgu2wXitefU=";
+  };
+
+  oneapi-tbb = fetchurl {
+    url = "https://yum.repos.intel.com/oneapi/intel-oneapi-tbb-${mklVersion}-${mklVersion}-${tbbRel}.x86_64.rpm";
+    hash = "sha256-K1BvhGoGVU2Zwy5vg2ZvJWBrSdh5uQwo0znt5039X0A=";
+  };
+
+in stdenvNoCC.mkDerivation ({
+  pname = "mkl";
+  inherit version;
+
+  dontUnpack = stdenvNoCC.isLinux;
+
+  nativeBuildInputs = [ validatePkgConfig ] ++ (if stdenvNoCC.isDarwin
+    then
+      [ undmg darwin.cctools ]
+    else
+      [ rpmextract ]);
+
+  buildPhase = if stdenvNoCC.isDarwin then ''
+    for f in Contents/Resources/pkg/*.tgz; do
+      tar xzvf $f
+    done
+  '' else ''
+    rpmextract ${oneapi-mkl}
+    rpmextract ${oneapi-mkl-common}
+    rpmextract ${oneapi-mkl-common-devel}
+    rpmextract ${oneapi-mkl-devel}
+    rpmextract ${oneapi-openmp}
+    rpmextract ${oneapi-tbb}
+  '';
+
+  installPhase = if stdenvNoCC.isDarwin then ''
+    for f in $(find . -name 'mkl*.pc') ; do
+      bn=$(basename $f)
+      substituteInPlace $f \
+        --replace "prefix=<INSTALLDIR>/mkl" "prefix=$out" \
+        --replace $\{MKLROOT} "$out" \
+        --replace "lib/intel64_lin" "lib" \
+        --replace "lib/intel64" "lib"
+    done
+    for f in $(find opt/intel -name 'mkl*iomp.pc') ; do
+      substituteInPlace $f \
+        --replace "../compiler/lib" "lib"
+    done
+
+    mkdir -p $out/lib
+
+    cp -r compilers_and_libraries_${version}/mac/mkl/include $out/
+
+    cp -r compilers_and_libraries_${version}/licensing/mkl/en/license.txt $out/lib/
+    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 ''
+    for f in $(find . -name 'mkl*.pc') ; do
+      bn=$(basename $f)
+      substituteInPlace $f \
+        --replace $\{MKLROOT} "$out" \
+        --replace "lib/intel64" "lib"
+
+      sed -r -i "s|^prefix=.*|prefix=$out|g" $f
+    done
+
+    for f in $(find opt/intel -name 'mkl*iomp.pc') ; do
+      substituteInPlace $f --replace "../compiler/lib" "lib"
+    done
+
+    # License
+    install -Dm0655 -t $out/share/doc/mkl opt/intel/oneapi/mkl/2021.1.1/licensing/en/license.txt
+
+    # Dynamic libraries
+    install -Dm0755 -t $out/lib opt/intel/oneapi/mkl/${mklVersion}/lib/intel64/*.so*
+    install -Dm0755 -t $out/lib opt/intel/oneapi/compiler/2021.1.1/linux/compiler/lib/intel64_lin/*.so*
+    install -Dm0755 -t $out/lib opt/intel/oneapi/tbb/2021.1.1/lib/intel64/gcc4.8/*.so*
+
+    # Headers
+    cp -r opt/intel/oneapi/mkl/${mklVersion}/include $out/
+  '' +
+    (if enableStatic then ''
+      install -Dm0644 -t $out/lib opt/intel/oneapi/mkl/${mklVersion}/lib/intel64/*.a
+      install -Dm0644 -t $out/lib/pkgconfig opt/intel/oneapi/mkl/2021.1.1/tools/pkgconfig/*.pc
+    '' else ''
+      cp opt/intel/oneapi/mkl/${mklVersion}/lib/intel64/*.so* $out/lib
+      install -Dm0644 -t $out/lib/pkgconfig opt/intel/oneapi/mkl/2021.1.1/tools/pkgconfig/*dynamic*.pc
+    '') + ''
+    # Setup symlinks for blas / lapack
+    ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libblas${shlibExt}
+    ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libcblas${shlibExt}
+    ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapack${shlibExt}
+    ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapacke${shlibExt}
+  '' + lib.optionalString stdenvNoCC.hostPlatform.isLinux ''
+    ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libblas${shlibExt}".3"
+    ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/libcblas${shlibExt}".3"
+    ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapack${shlibExt}".3"
+    ln -s $out/lib/libmkl_rt${shlibExt} $out/lib/liblapacke${shlibExt}".3"
+  '';
+
+  # 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 = 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
+  '';
+
+  # Per license agreement, do not modify the binary
+  dontStrip = true;
+  dontPatchELF = true;
+
+  passthru.tests = {
+    pkg-config-dynamic-iomp = callPackage ./test { enableStatic = false; execution = "iomp"; };
+    pkg-config-static-iomp = callPackage ./test { enableStatic = true; execution = "iomp"; };
+    pkg-config-dynamic-seq = callPackage ./test { enableStatic = false; execution = "seq"; };
+    pkg-config-static-seq = callPackage ./test { enableStatic = true; execution = "seq"; };
+  };
+
+  meta = with lib; {
+    description = "Intel OneAPI Math Kernel Library";
+    longDescription = ''
+      Intel OneAPI Math Kernel Library (Intel oneMKL) optimizes code with minimal
+      effort for future generations of Intel processors. It is compatible with your
+      choice of compilers, languages, operating systems, and linking and
+      threading models.
+    '';
+    homepage = "https://software.intel.com/en-us/mkl";
+    license = licenses.issl;
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+    maintainers = with maintainers; [ bhipple ];
+  };
+} // lib.optionalAttrs stdenvNoCC.isDarwin {
+  src = fetchurl {
+    url = "http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/15235/m_mkl_${version}.dmg";
+    sha256 = "14b3ciz7995sqcd6jz7hc8g2x4zwvqxmgxgni46vrlb7n523l62f";
+  };
+})
diff --git a/nixpkgs/pkgs/development/libraries/science/math/mkl/test/default.nix b/nixpkgs/pkgs/development/libraries/science/math/mkl/test/default.nix
new file mode 100644
index 000000000000..cb3355260d12
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/mkl/test/default.nix
@@ -0,0 +1,41 @@
+{ stdenv
+, pkg-config
+, mkl
+
+, enableStatic ? false
+, execution ? "seq"
+}:
+
+let
+  linkType = if enableStatic then "static" else "dynamic";
+in stdenv.mkDerivation {
+  pname = "mkl-test";
+  version = mkl.version;
+
+  src = ./.;
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ (mkl.override { inherit enableStatic; }) ];
+
+  doCheck = true;
+
+  buildPhase = ''
+    # Check regular Nix build.
+    gcc test.c -o test $(pkg-config --cflags --libs mkl-${linkType}-ilp64-${execution})
+
+    # Clear flags to ensure that we are purely relying on options
+    # provided by pkg-config.
+    NIX_CFLAGS_COMPILE="" \
+    NIX_LDFLAGS="" \
+      gcc test.c -o test $(pkg-config --cflags --libs mkl-${linkType}-ilp64-${execution})
+  '';
+
+  installPhase = ''
+    touch $out
+  '';
+
+  checkPhase = ''
+    ./test
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/mkl/test/test.c b/nixpkgs/pkgs/development/libraries/science/math/mkl/test/test.c
new file mode 100644
index 000000000000..9413ac0c68e9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/mkl/test/test.c
@@ -0,0 +1,12 @@
+#include <assert.h>
+
+#include <mkl_cblas.h>
+
+int main() {
+  float u[] = {1., 2., 3.};
+  float v[] = {4., 5., 6.};
+
+  float dp = cblas_sdot(3, u, 1, v, 1);
+
+  assert(dp == 32.);
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/mongoose/default.nix b/nixpkgs/pkgs/development/libraries/science/math/mongoose/default.nix
new file mode 100644
index 000000000000..7dd52f3b663d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/mongoose/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "mongoose";
+  version = "2.0.4";
+
+  outputs = [ "bin" "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "ScottKolo";
+    repo = "Mongoose";
+    rev = "v${version}";
+    sha256 = "0ymwd4n8p8s0ndh1vcbmjcsm0x2cc2b7v3baww5y6as12873bcrh";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  meta = with lib; {
+    description = "Graph Coarsening and Partitioning Library";
+    homepage = "https://github.com/ScottKolo/Mongoose";
+    license = licenses.gpl3;
+    maintainers = with maintainers; [];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/nccl/default.nix b/nixpkgs/pkgs/development/libraries/science/math/nccl/default.nix
new file mode 100644
index 000000000000..5036ad890799
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/nccl/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchFromGitHub, which, cudatoolkit, addOpenGLRunpath }:
+
+stdenv.mkDerivation rec {
+  name = "nccl-${version}-cuda-${cudatoolkit.majorVersion}";
+  version = "2.7.8-1";
+
+  src = fetchFromGitHub {
+    owner = "NVIDIA";
+    repo = "nccl";
+    rev = "v${version}";
+    sha256 = "0xxiwaw239dc9g015fka3k1nvm5zyl00dzgxnwzkang61dys9wln";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ which addOpenGLRunpath ];
+
+  buildInputs = [ cudatoolkit ];
+
+  preConfigure = ''
+    patchShebangs src/collectives/device/gen_rules.sh
+  '';
+
+  makeFlags = [
+    "CUDA_HOME=${cudatoolkit}"
+    "PREFIX=$(out)"
+  ];
+
+  postFixup = ''
+    moveToOutput lib/libnccl_static.a $dev
+
+    # Set RUNPATH so that libnvidia-ml in /run/opengl-driver(-32)/lib can be found.
+    # See the explanation in addOpenGLRunpath.
+    addOpenGLRunpath $out/lib/lib*.so
+  '';
+
+  NIX_CFLAGS_COMPILE = [ "-Wno-unused-function" ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Multi-GPU and multi-node collective communication primitives for NVIDIA GPUs";
+    homepage = "https://developer.nvidia.com/nccl";
+    license = licenses.bsd3;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ mdaiter orivej ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix b/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix
new file mode 100644
index 000000000000..5d3c3f40f1d4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix
@@ -0,0 +1,243 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, perl, which
+# Most packages depending on openblas expect integer width to match
+# pointer width, but some expect to use 32-bit integers always
+# (for compatibility with reference BLAS).
+, blas64 ? null
+# Multi-threaded applications must not call a threaded OpenBLAS
+# (the only exception is when an application uses OpenMP as its
+# *only* form of multi-threading). See
+#     https://github.com/xianyi/OpenBLAS/wiki/Faq/4bded95e8dc8aadc70ce65267d1093ca7bdefc4c#multi-threaded
+#     https://github.com/xianyi/OpenBLAS/issues/2543
+# This flag builds a single-threaded OpenBLAS using the flags
+# stated in thre.
+, singleThreaded ? false
+, buildPackages
+# Select a specific optimization target (other than the default)
+# See https://github.com/xianyi/OpenBLAS/blob/develop/TargetList.txt
+, target ? null
+# Select whether DYNAMIC_ARCH is enabled or not.
+, dynamicArch ? null
+# enable AVX512 optimized kernels.
+# These kernels have been a source of trouble in the past.
+# Use with caution.
+, enableAVX512 ? false
+, enableStatic ? stdenv.hostPlatform.isStatic
+, enableShared ? !stdenv.hostPlatform.isStatic
+}:
+
+with lib;
+
+let blas64_ = blas64; in
+
+let
+  setTarget = x: if target == null then x else target;
+  setDynamicArch = x: if dynamicArch == null then x else dynamicArch;
+
+  # To add support for a new platform, add an element to this set.
+  configs = {
+    armv6l-linux = {
+      BINARY = 32;
+      TARGET = setTarget "ARMV6";
+      DYNAMIC_ARCH = setDynamicArch false;
+      USE_OPENMP = true;
+    };
+
+    armv7l-linux = {
+      BINARY = 32;
+      TARGET = setTarget "ARMV7";
+      DYNAMIC_ARCH = setDynamicArch false;
+      USE_OPENMP = true;
+    };
+
+    aarch64-darwin = {
+      BINARY = 64;
+      TARGET = setTarget "VORTEX";
+      DYNAMIC_ARCH = setDynamicArch true;
+      USE_OPENMP = false;
+      MACOSX_DEPLOYMENT_TARGET = "11.0";
+    };
+
+    aarch64-linux = {
+      BINARY = 64;
+      TARGET = setTarget "ARMV8";
+      DYNAMIC_ARCH = setDynamicArch true;
+      USE_OPENMP = true;
+    };
+
+    i686-linux = {
+      BINARY = 32;
+      TARGET = setTarget "P2";
+      DYNAMIC_ARCH = setDynamicArch true;
+      USE_OPENMP = true;
+    };
+
+    x86_64-darwin = {
+      BINARY = 64;
+      TARGET = setTarget "ATHLON";
+      DYNAMIC_ARCH = setDynamicArch true;
+      NO_AVX512 = !enableAVX512;
+      USE_OPENMP = false;
+      MACOSX_DEPLOYMENT_TARGET = "10.7";
+    };
+
+    x86_64-linux = {
+      BINARY = 64;
+      TARGET = setTarget "ATHLON";
+      DYNAMIC_ARCH = setDynamicArch true;
+      NO_AVX512 = !enableAVX512;
+      USE_OPENMP = !stdenv.hostPlatform.isMusl;
+    };
+
+    powerpc64le-linux = {
+      BINARY = 64;
+      TARGET = setTarget "POWER5";
+      DYNAMIC_ARCH = setDynamicArch true;
+      USE_OPENMP = !stdenv.hostPlatform.isMusl;
+    };
+
+    riscv64-linux = {
+      BINARY = 64;
+      TARGET = setTarget "RISCV64_GENERIC";
+      DYNAMIC_ARCH = setDynamicArch false;
+      USE_OPENMP = true;
+    };
+  };
+in
+
+let
+  config =
+    configs.${stdenv.hostPlatform.system}
+    or (throw "unsupported system: ${stdenv.hostPlatform.system}");
+in
+
+let
+  blas64 =
+    if blas64_ != null
+      then blas64_
+      else hasPrefix "x86_64" stdenv.hostPlatform.system;
+  # Convert flag values to format OpenBLAS's build expects.
+  # `toString` is almost what we need other than bools,
+  # which we need to map {true -> 1, false -> 0}
+  # (`toString` produces empty string `""` for false instead of `0`)
+  mkMakeFlagValue = val:
+    if !builtins.isBool val then toString val
+    else if val then "1" else "0";
+  mkMakeFlagsFromConfig = mapAttrsToList (var: val: "${var}=${mkMakeFlagValue val}");
+
+  shlibExt = stdenv.hostPlatform.extensions.sharedLibrary;
+
+in
+stdenv.mkDerivation rec {
+  pname = "openblas";
+  version = "0.3.15";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "xianyi";
+    repo = "OpenBLAS";
+    rev = "v${version}";
+    sha256 = "1qjr02cqncv20abdp1yzr55n7smhx6h9chqvb0xbp18byynvj87w";
+  };
+
+  # remove both patches when updating to 0.3.16
+  patches = [
+    (fetchpatch {
+      name = "riscv64-imin-fix-wrong-comparison.patch";
+      url = "https://github.com/xianyi/OpenBLAS/commit/1e0192a5ccac28fc0c749f49d36ec7eda9757428.patch";
+      sha256 = "0kjkmrj8023vcjxhgin5dqs5w3gf93hzhwdhg0vsjhdra2ghkwzj";
+    })
+    (fetchpatch {
+      name = "riscv64-generic-use-generic-kernel-for-dsdot.patch";
+      url = "https://github.com/xianyi/OpenBLAS/commit/3521cd48cbfb3d50f6ae9a10377382d37075c696.patch";
+      sha256 = "0ljwbldff4db377s8rzmqxrszilqdivy656yqvfq46x5338v3gi0";
+    })
+  ];
+
+  inherit blas64;
+
+  # Some hardening features are disabled due to sporadic failures in
+  # OpenBLAS-based programs. The problem may not be with OpenBLAS itself, but
+  # with how these flags interact with hardening measures used downstream.
+  # In either case, OpenBLAS must only be used by trusted code--it is
+  # inherently unsuitable for security-conscious applications--so there should
+  # be no objection to disabling these hardening measures.
+  hardeningDisable = [
+    # don't modify or move the stack
+    "stackprotector" "pic"
+    # don't alter index arithmetic
+    "strictoverflow"
+    # don't interfere with dynamic target detection
+    "relro" "bindnow"
+  ];
+
+  nativeBuildInputs = [
+    perl
+    which
+  ];
+
+  depsBuildBuild = [
+    buildPackages.gfortran
+    buildPackages.stdenv.cc
+  ];
+
+  makeFlags = mkMakeFlagsFromConfig (config // {
+    FC = "${stdenv.cc.targetPrefix}gfortran";
+    CC = "${stdenv.cc.targetPrefix}${if stdenv.cc.isClang then "clang" else "cc"}";
+    PREFIX = placeholder "out";
+    NUM_THREADS = 64;
+    INTERFACE64 = blas64;
+    NO_STATIC = !enableStatic;
+    NO_SHARED = !enableShared;
+    CROSS = stdenv.hostPlatform != stdenv.buildPlatform;
+    HOSTCC = "cc";
+    # Makefile.system only checks defined status
+    # This seems to be a bug in the openblas Makefile:
+    # on x86_64 it expects NO_BINARY_MODE=
+    # but on aarch64 it expects NO_BINARY_MODE=0
+    NO_BINARY_MODE = if stdenv.isx86_64
+        then toString (stdenv.hostPlatform != stdenv.buildPlatform)
+        else stdenv.hostPlatform != stdenv.buildPlatform;
+  } // (lib.optionalAttrs singleThreaded {
+    # As described on https://github.com/xianyi/OpenBLAS/wiki/Faq/4bded95e8dc8aadc70ce65267d1093ca7bdefc4c#multi-threaded
+    USE_THREAD = false;
+    USE_LOCKING = true; # available with openblas >= 0.3.7
+    USE_OPENMP = false; # openblas will refuse building with both USE_OPENMP=1 and USE_THREAD=0
+  }));
+
+  doCheck = true;
+  checkTarget = "tests";
+
+  postInstall = ''
+    # Write pkgconfig aliases. Upstream report:
+    # https://github.com/xianyi/OpenBLAS/issues/1740
+    for alias in blas cblas lapack; do
+      cat <<EOF > $out/lib/pkgconfig/$alias.pc
+Name: $alias
+Version: ${version}
+Description: $alias provided by the OpenBLAS package.
+Cflags: -I$out/include
+Libs: -L$out/lib -lopenblas
+EOF
+    done
+
+    # Setup symlinks for blas / lapack
+    ln -s $out/lib/libopenblas${shlibExt} $out/lib/libblas${shlibExt}
+    ln -s $out/lib/libopenblas${shlibExt} $out/lib/libcblas${shlibExt}
+    ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapack${shlibExt}
+    ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapacke${shlibExt}
+  '' + lib.optionalString stdenv.hostPlatform.isLinux ''
+    ln -s $out/lib/libopenblas${shlibExt} $out/lib/libblas${shlibExt}.3
+    ln -s $out/lib/libopenblas${shlibExt} $out/lib/libcblas${shlibExt}.3
+    ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapack${shlibExt}.3
+    ln -s $out/lib/libopenblas${shlibExt} $out/lib/liblapacke${shlibExt}.3
+  '';
+
+  meta = with lib; {
+    description = "Basic Linear Algebra Subprograms";
+    license = licenses.bsd3;
+    homepage = "https://github.com/xianyi/OpenBLAS";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ ttuegel ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix b/nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix
new file mode 100644
index 000000000000..34ebc36ebb92
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "openlibm";
+  version = "0.7.5";
+  src = fetchurl {
+    url = "https://github.com/JuliaLang/openlibm/archive/v${version}.tar.gz";
+    sha256 = "sha256-vpg7nh5A5pbou7frj2N208oK5nWubYKTZUA4Ww7uwVs=";
+  };
+
+  makeFlags = [ "prefix=$(out)" ];
+
+  meta = {
+    description = "High quality system independent, portable, open source libm implementation";
+    homepage = "https://openlibm.org/";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ttuegel ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/openspecfun/default.nix b/nixpkgs/pkgs/development/libraries/science/math/openspecfun/default.nix
new file mode 100644
index 000000000000..4422a908838f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/openspecfun/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, gfortran }:
+
+stdenv.mkDerivation rec {
+  pname = "openspecfun";
+  version = "0.5.5";
+  src = fetchFromGitHub {
+    owner = "JuliaLang";
+    repo = "openspecfun";
+    rev = "v${version}";
+    sha256 = "sha256-fX2wc8LHUcF5nN/hiA60ZZ7emRTs0SznOm/0q6lD+Ko=";
+  };
+
+  makeFlags = [ "prefix=$(out)" ];
+
+  nativeBuildInputs = [ gfortran ];
+
+  meta = {
+    description = "A collection of special mathematical functions";
+    homepage = "https://github.com/JuliaLang/openspecfun";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ttuegel ];
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/or-tools/default.nix b/nixpkgs/pkgs/development/libraries/science/math/or-tools/default.nix
new file mode 100644
index 000000000000..741c6f4898b6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/or-tools/default.nix
@@ -0,0 +1,117 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, abseil-cpp
+, bzip2
+, zlib
+, lsb-release
+, which
+, protobuf
+, cbc
+, ensureNewerSourcesForZipFilesHook
+, python
+, swig4
+}:
+
+stdenv.mkDerivation rec {
+  pname = "or-tools";
+  version = "9.0";
+  disabled = python.pythonOlder "3.6";  # not supported upstream
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "or-tools";
+    rev = "v${version}";
+    sha256 = "0yihrsg8wj4b82xwg1hbn97my8zqd7xhw7dk7wm2axsyvqd6m3b3";
+  };
+
+  # 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
+  # dependencies straight from nixpkgs and use the make build method.
+
+  # Cbc is linked against bzip2 and declares this in its pkgs-config file,
+  # but this makefile doesn't use pkgs-config, so we also have to add lbz2
+  configurePhase = ''
+    substituteInPlace makefiles/Makefile.third_party.unix.mk \
+      --replace 'COINUTILS_LNK = $(STATIC_COINUTILS_LNK)' \
+                'COINUTILS_LNK = $(STATIC_COINUTILS_LNK) -lbz2'
+
+    cat <<EOF > Makefile.local
+      UNIX_ABSL_DIR=${abseil-cpp}
+      UNIX_PROTOBUF_DIR=${protobuf}
+      UNIX_CBC_DIR=${cbc}
+      USE_SCIP=OFF
+    EOF
+  '';
+
+  # Many of these 'samples' (which are really the tests) require using SCIP, and or-tools 8.1
+  # will just crash if SCIP is not found because it doesn't fall back to using one of
+  # the available solvers: https://github.com/google/or-tools/blob/b77bd3ac69b7f3bb02f55b7bab6cbb4bab3917f2/ortools/linear_solver/linear_solver.cc#L427
+  # We don't compile with SCIP because it does not have an open source license.
+  # See https://github.com/google/or-tools/issues/2395
+  preBuild = ''
+    for file in ortools/linear_solver/samples/*.cc; do
+      if grep -q SCIP_MIXED_INTEGER_PROGRAMMING $file; then
+        substituteInPlace $file --replace SCIP_MIXED_INTEGER_PROGRAMMING CBC_MIXED_INTEGER_PROGRAMMING
+      fi;
+    done
+
+    substituteInPlace ortools/linear_solver/samples/simple_mip_program.cc \
+      --replace 'SCIP' 'CBC'
+  '';
+  makeFlags = [
+    "prefix=${placeholder "out"}"
+    "PROTOBUF_PYTHON_DESC=${python.pkgs.protobuf}/${python.sitePackages}/google/protobuf/descriptor_pb2.py"
+  ];
+  buildFlags = [ "cc" "pypi_archive" ];
+
+  doCheck = true;
+  checkTarget = "test_cc";
+
+  installTargets = [ "install_cc" ];
+  # The upstream install_python target installs to $HOME.
+  postInstall = ''
+    mkdir -p "$python/${python.sitePackages}"
+    (cd temp_python/ortools; PYTHONPATH="$python/${python.sitePackages}:$PYTHONPATH" python setup.py install '--prefix=$python')
+  '';
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [
+    cmake
+    lsb-release
+    swig4
+    which
+    ensureNewerSourcesForZipFilesHook
+    python.pkgs.setuptools
+    python.pkgs.wheel
+  ];
+  buildInputs = [
+    zlib
+    bzip2
+    python
+  ];
+  propagatedBuildInputs = [
+    abseil-cpp
+    protobuf
+
+    python.pkgs.protobuf
+    python.pkgs.six
+    python.pkgs.absl-py
+    python.pkgs.mypy-protobuf
+  ];
+
+  outputs = [ "out" "python" ];
+
+  meta = with lib; {
+    homepage = "https://github.com/google/or-tools";
+    license = licenses.asl20;
+    description = ''
+      Google's software suite for combinatorial optimization.
+    '';
+    maintainers = with maintainers; [ andersk ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/osi/default.nix b/nixpkgs/pkgs/development/libraries/science/math/osi/default.nix
new file mode 100644
index 000000000000..b61cd8406064
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/osi/default.nix
@@ -0,0 +1,42 @@
+{ stdenv, lib, fetchurl, gfortran, pkg-config
+, blas, zlib, bzip2
+, withGurobi ? false, gurobi
+, withCplex ? false, cplex }:
+
+stdenv.mkDerivation rec {
+  pname = "osi";
+  version = "0.108.6";
+
+  src = fetchurl {
+    url = "https://www.coin-or.org/download/source/Osi/Osi-${version}.tgz";
+    sha256 = "1n2jlpq4aikbp0ncs16f7q1pj7yk6kny1bh4fmjaqnwrjw63zvsp";
+  };
+
+  buildInputs =
+    [ blas zlib bzip2 ]
+    ++ lib.optional withGurobi gurobi
+    ++ lib.optional withCplex cplex;
+  nativeBuildInputs = [ gfortran pkg-config ];
+  configureFlags =
+    lib.optionals withGurobi [ "--with-gurobi-incdir=${gurobi}/include" "--with-gurobi-lib=-lgurobi${gurobi.libSuffix}" ]
+    ++ lib.optionals withCplex [ "--with-cplex-incdir=${cplex}/cplex/include/ilcplex" "--with-cplex-lib=-lcplex${cplex.libSuffix}" ];
+
+  NIX_LDFLAGS =
+    lib.optionalString withCplex "-L${cplex}/cplex/bin/${cplex.libArch}";
+
+  # Compile errors
+  NIX_CFLAGS_COMPILE = "-Wno-cast-qual";
+  hardeningDisable = [ "format" ];
+
+  enableParallelBuilding = true;
+
+  passthru = { inherit withGurobi withCplex; };
+
+  meta = with lib; {
+    description = "An abstract base class to a generic linear programming (LP) solver";
+    homepage = "https://github.com/coin-or/Osi";
+    license = licenses.epl10;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/osqp/default.nix b/nixpkgs/pkgs/development/libraries/science/math/osqp/default.nix
new file mode 100644
index 000000000000..00f2726f60fe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/osqp/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "osqp";
+  version = "0.6.0";
+
+  src = fetchFromGitHub {
+    owner = "oxfordcontrol";
+    repo = "osqp";
+    rev = "v${version}";
+    sha256 = "1gwk1bqsk0rd85zf7xplbwq822y5pnxjmqc14jj6knqbab9afvrs";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "A quadratic programming solver using operator splitting";
+    homepage = "https://osqp.org";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ taktoa ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/p4est-sc/default.nix b/nixpkgs/pkgs/development/libraries/science/math/p4est-sc/default.nix
new file mode 100644
index 000000000000..338101b80b56
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/p4est-sc/default.nix
@@ -0,0 +1,71 @@
+{ lib, stdenv, fetchFromGitHub
+, autoreconfHook, pkg-config
+, p4est-sc-debugEnable ? true, p4est-sc-mpiSupport ? true
+, mpi, openssh, zlib
+}:
+
+let
+  dbg = if debugEnable then "-dbg" else "";
+  debugEnable = p4est-sc-debugEnable;
+  mpiSupport = p4est-sc-mpiSupport;
+  isOpenmpi = mpiSupport && mpi.pname == "openmpi";
+in
+stdenv.mkDerivation {
+  pname = "p4est-sc${dbg}";
+  version = "unstable-2021-06-14";
+
+  # fetch an untagged snapshot of the prev3-develop branch
+  src = fetchFromGitHub {
+    owner = "cburstedde";
+    repo = "libsc";
+    rev = "1ae814e3fb1cc5456652e0d77550386842cb9bfb";
+    sha256 = "14vm0b162jh8399pgpsikbwq4z5lkrw9vfzy3drqykw09n6nc53z";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  propagatedBuildInputs = [ zlib ]
+    ++ lib.optional mpiSupport mpi
+    ++ lib.optional isOpenmpi openssh
+  ;
+  inherit debugEnable mpiSupport;
+
+  postPatch = ''
+    echo "dist_scaclocal_DATA += config/sc_v4l2.m4" >> Makefile.am
+  '';
+  preConfigure = ''
+    echo "2.8.0" > .tarball-version
+    ${if mpiSupport then "unset CC" else ""}
+  '';
+
+  configureFlags = [ "--enable-pthread=-pthread" ]
+    ++ lib.optional debugEnable "--enable-debug"
+    ++ lib.optional mpiSupport "--enable-mpi"
+  ;
+
+  dontDisableStatic = true;
+  enableParallelBuilding = true;
+  makeFlags = [ "V=0" ];
+
+  preCheck = ''
+    export OMPI_MCA_rmaps_base_oversubscribe=1
+    export HYDRA_IFACE=lo
+  '';
+
+  # disallow Darwin checks due to prototype incompatibility of qsort_r
+  # to be fixed in a future version of the source code
+  doCheck = !stdenv.isDarwin && stdenv.hostPlatform == stdenv.buildPlatform;
+
+  meta = {
+    branch = "prev3-develop";
+    description = "Support for parallel scientific applications";
+    longDescription = ''
+      The SC library provides support for parallel scientific applications.
+      Its main purpose is to support the p4est software library, hence
+      this package is called p4est-sc, but it works standalone, too.
+    '';
+    homepage = "https://www.p4est.org/";
+    downloadPage = "https://github.com/cburstedde/libsc.git";
+    license = lib.licenses.lgpl21Plus;
+    maintainers = [ lib.maintainers.cburstedde ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/p4est/default.nix b/nixpkgs/pkgs/development/libraries/science/math/p4est/default.nix
new file mode 100644
index 000000000000..68c71ab59be1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/p4est/default.nix
@@ -0,0 +1,58 @@
+{ lib, stdenv, fetchFromGitHub
+, autoreconfHook, pkg-config
+, p4est-withMetis ? true, metis
+, p4est-sc
+}:
+
+let
+  inherit (p4est-sc) debugEnable mpiSupport;
+  dbg = if debugEnable then "-dbg" else "";
+  withMetis = p4est-withMetis;
+in
+stdenv.mkDerivation {
+  pname = "p4est${dbg}";
+  version = "unstable-2021-06-22";
+
+  # fetch an untagged snapshot of the prev3-develop branch
+  src = fetchFromGitHub {
+    owner = "cburstedde";
+    repo = "p4est";
+    rev = "7423ac5f2b2b64490a7a92e5ddcbd251053c4dee";
+    sha256 = "0vffnf48rzw6d0as4c3x1f31b4kapmdzr1hfj5rz5ngah72gqrph";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  propagatedBuildInputs = [ p4est-sc ];
+  buildInputs = lib.optional withMetis metis;
+  inherit debugEnable mpiSupport withMetis;
+
+  patches = [ ./p4est-metis.patch ];
+  postPatch = ''
+    sed -i -e "s:\(^\s*ACLOCAL_AMFLAGS.*\)\s@P4EST_SC_AMFLAGS@\s*$:\1 -I ${p4est-sc}/share/aclocal:" Makefile.am
+  '';
+  preConfigure = ''
+    echo "2.8.0" > .tarball-version
+    ${if mpiSupport then "unset CC" else ""}
+  '';
+
+  configureFlags = p4est-sc.configureFlags
+    ++ [ "--with-sc=${p4est-sc}" ]
+    ++ lib.optional withMetis "--with-metis"
+  ;
+
+  inherit (p4est-sc) makeFlags dontDisableStatic enableParallelBuilding preCheck doCheck;
+
+  meta = {
+    branch = "prev3-develop";
+    description = "Parallel AMR on Forests of Octrees";
+    longDescription = ''
+      The p4est software library provides algorithms for parallel AMR.
+      AMR refers to Adaptive Mesh Refinement, a technique in scientific
+      computing to cover the domain of a simulation with an adaptive mesh.
+    '';
+    homepage = "https://www.p4est.org/";
+    downloadPage = "https://github.com/cburstedde/p4est.git";
+    license = lib.licenses.gpl2Plus;
+    maintainers = [ lib.maintainers.cburstedde ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/p4est/p4est-metis.patch b/nixpkgs/pkgs/development/libraries/science/math/p4est/p4est-metis.patch
new file mode 100644
index 000000000000..46b8dc8af08c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/p4est/p4est-metis.patch
@@ -0,0 +1,26 @@
+diff --git a/src/p4est_connectivity.c b/src/p4est_connectivity.c
+index 95339136..c93528f2 100644
+--- a/src/p4est_connectivity.c
++++ b/src/p4est_connectivity.c
+@@ -3715,6 +3715,7 @@ p4est_connectivity_reorder_newid (sc_MPI_Comm comm, int k,
+                                   sc_array_t * newid)
+ {
+   const int           n = (int) conn->num_trees;
++  int                 metis_n;
+   int                *xadj;
+   int                *adjncy;
+   int                *part;
+@@ -3862,10 +3863,12 @@ p4est_connectivity_reorder_newid (sc_MPI_Comm comm, int k,
+ 
+     P4EST_GLOBAL_INFO ("Entering metis\n");
+     /* now call metis */
++    metis_n = n;
+     P4EST_EXECUTE_ASSERT_INT
+-      (METIS_PartGraphRecursive (&n, &ncon, xadj, adjncy, NULL, NULL,
++      (METIS_PartGraphRecursive (&metis_n, &ncon, xadj, adjncy, NULL, NULL,
+                                  NULL, &k, NULL, NULL, NULL, &volume, part),
+        METIS_OK);
++    P4EST_ASSERT (metis_n == n);
+     P4EST_GLOBAL_INFO ("Done metis\n");
+ 
+     P4EST_GLOBAL_STATISTICSF ("metis volume %d\n", volume);
diff --git a/nixpkgs/pkgs/development/libraries/science/math/parmetis/default.nix b/nixpkgs/pkgs/development/libraries/science/math/parmetis/default.nix
new file mode 100644
index 000000000000..db70bf8dd7a4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/parmetis/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv
+, fetchurl
+, cmake
+, mpi
+}:
+
+stdenv.mkDerivation rec {
+  pname = "parmetis";
+  version = "4.0.3";
+
+  src = fetchurl {
+    url = "http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/parmetis-${version}.tar.gz";
+    sha256 = "0pvfpvb36djvqlcc3lq7si0c5xpb2cqndjg8wvzg35ygnwqs5ngj";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ mpi ];
+
+  # metis and GKlib are packaged with distribution
+  # AUR https://aur.archlinux.org/packages/parmetis/ has reported that
+  # it easier to build with the included packages as opposed to using the metis
+  # package. Compilation time is short.
+  configurePhase = ''
+    make config metis_path=$PWD/metis gklib_path=$PWD/metis/GKlib prefix=$out
+  '';
+
+  meta = with lib; {
+    description = "An MPI-based parallel library that implements a variety of algorithms for partitioning unstructured graphs, meshes, and for computing fill-reducing orderings of sparse matrices";
+    homepage = "http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview";
+    platforms = platforms.all;
+    license = licenses.unfree;
+    maintainers = [ maintainers.costrouc ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/petsc/default.nix b/nixpkgs/pkgs/development/libraries/science/math/petsc/default.nix
new file mode 100644
index 000000000000..cbd5fa879ee7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/petsc/default.nix
@@ -0,0 +1,77 @@
+{ lib
+, stdenv
+, fetchurl
+, darwin
+, gfortran
+, python3
+, blas
+, lapack
+, mpi                   # generic mpi dependency
+, openssh               # required for openmpi tests
+, petsc-withp4est ? true
+, p4est
+, zlib                  # propagated by p4est but required by petsc
+}:
+
+# This version of PETSc does not support a non-MPI p4est build
+assert petsc-withp4est -> p4est.mpiSupport;
+
+stdenv.mkDerivation rec {
+  pname = "petsc";
+  version = "3.14.3";
+
+  src = fetchurl {
+    url = "http://ftp.mcs.anl.gov/pub/petsc/release-snapshots/petsc-${version}.tar.gz";
+    sha256 = "sha256-1rdyLNSH8jMkmIg88uHMN3ZXqTHAtzU1adybJEZzJ9M=";
+  };
+
+  mpiSupport = !withp4est || p4est.mpiSupport;
+  withp4est = petsc-withp4est;
+
+  nativeBuildInputs = [ python3 gfortran ];
+  buildInputs = [ blas lapack ]
+    ++ lib.optional mpiSupport mpi
+    ++ lib.optional (mpiSupport && mpi.pname == "openmpi") openssh
+    ++ lib.optional withp4est p4est
+  ;
+
+  prePatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace config/install.py \
+      --replace /usr/bin/install_name_tool ${darwin.cctools}/bin/install_name_tool
+  '';
+
+  preConfigure = ''
+    export FC="${gfortran}/bin/gfortran" F77="${gfortran}/bin/gfortran"
+    patchShebangs ./lib/petsc/bin
+    configureFlagsArray=(
+      $configureFlagsArray
+      ${if !mpiSupport then ''
+        "--with-mpi=0"
+      '' else ''
+        "--CC=mpicc"
+        "--with-cxx=mpicxx"
+        "--with-fc=mpif90"
+        "--with-mpi=1"
+      ''}
+      ${if withp4est then ''
+        "--with-p4est=1"
+        "--with-zlib-include=${zlib.dev}/include"
+        "--with-zlib-lib=-L${zlib}/lib -lz"
+      '' else ""}
+      "--with-blas=1"
+      "--with-lapack=1"
+    )
+  '';
+
+  configureScript = "python ./configure";
+
+  enableParallelBuilding = true;
+  doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
+
+  meta = with lib; {
+    description = "Portable Extensible Toolkit for Scientific computation";
+    homepage = "https://www.mcs.anl.gov/petsc/index.html";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ wucke13 cburstedde ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/planarity/default.nix b/nixpkgs/pkgs/development/libraries/science/math/planarity/default.nix
new file mode 100644
index 000000000000..a257b84ca54b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/planarity/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv
+, fetchFromGitHub
+, fetchpatch
+, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "planarity";
+  version = "3.0.0.5";
+
+  src = fetchFromGitHub {
+    owner = "graph-algorithms";
+    repo = "edge-addition-planarity-suite";
+    rev = "Version_${version}";
+    sha256 = "01cm7ay1njkfsdnmnvh5zwc7wg7x189hq1vbfhh9p3ihrbnmqzh8";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+
+  doCheck = true;
+
+  patches = [
+    # declare variables declared in headers as extern, not yet merged upstream
+    (fetchpatch {
+      url = "https://github.com/graph-algorithms/edge-addition-planarity-suite/pull/3.patch";
+      sha256 = "1nqjc4clr326imz4jxqxcxv2hgh1sjgzll27k5cwkdin8lnmmil8";
+    })
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/graph-algorithms/edge-addition-planarity-suite";
+    description = "A library for implementing graph algorithms";
+    license = licenses.bsd3;
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix b/nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix
new file mode 100644
index 000000000000..d4f16d230e60
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "primesieve";
+  version = "7.6";
+
+  nativeBuildInputs = [cmake];
+
+  src = fetchurl {
+    url = "https://github.com/kimwalisch/primesieve/archive/v${version}.tar.gz";
+    sha256 = "sha256-SFZp6Pmmx05SiUfSdN9wXxPKrydtRg0PA3uNvAycCpk=";
+  };
+
+  meta = with lib; {
+    description = "Fast C/C++ prime number generator";
+    homepage = "https://primesieve.org/";
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/rankwidth/default.nix b/nixpkgs/pkgs/development/libraries/science/math/rankwidth/default.nix
new file mode 100644
index 000000000000..c00d579702cc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/rankwidth/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv
+, fetchurl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "rankwidth";
+  version = "0.9";
+
+  src = fetchurl {
+    url = "mirror://sageupstream/rw/rw-${version}.tar.gz";
+    sha256 = "sha256-weA1Bv4lzfy0KMBR/Fay0q/7Wwb7o/LOdWYxRmvvtEE=";
+  };
+
+  configureFlags = [
+    "--enable-executable=no" # no igraph dependency
+  ];
+
+  # check phase is empty for now (as of version 0.9)
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Calculates rank-width and rank-decompositions";
+    license = with licenses; [ gpl2Plus ];
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/rubiks/default.nix b/nixpkgs/pkgs/development/libraries/science/math/rubiks/default.nix
new file mode 100644
index 000000000000..b4b670884989
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/rubiks/default.nix
@@ -0,0 +1,81 @@
+{ lib, stdenv
+, fetchurl
+, fetchpatch
+, coreutils
+}:
+
+stdenv.mkDerivation rec {
+  pname = "rubiks";
+  version = "20070912";
+
+  src = fetchurl {
+    url = "mirror://sageupstream/rubiks/rubiks-${version}.tar.bz2";
+    sha256 = "0zdmkb0j1kyspdpsszzb2k3279xij79jkx0dxd9f3ix1yyyg3yfq";
+  };
+
+  preConfigure = ''
+    export INSTALL="${coreutils}/bin/install"
+  '';
+
+  # everything is done in `make install`
+  buildPhase = "true";
+
+  installFlags = [
+    "PREFIX=$(out)"
+  ];
+
+  patches = [
+    # Fix makefiles which use all the variables in all the wrong ways and
+    # hardcode values for some variables.
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/rubiks/patches/dietz-cu2-Makefile.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "1ry3w1mk9q4jqd91zlaa1bdiiplld4hpfjaldbhlmzlgrrc99qmq";
+    })
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/rubiks/patches/dietz-mcube-Makefile.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "0zsbh6k3kqdg82fv0kzghr1x7pafisv943gmssqscp107bhg77bz";
+    })
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/rubiks/patches/dietz-solver-Makefile.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "0vhw70ylnmydgjhwx8jjlb2slccj4pfqn6vzirkyz1wp8apsmfhp";
+    })
+    (fetchpatch {
+      url = "https://git.sagemath.org/sage.git/plain/build/pkgs/rubiks/patches/reid-Makefile.patch?id=07d6c37d18811e2b377a9689790a7c5e24da16ba";
+      sha256 = "1r311sn012xs135s0d21qwsig2kld7rdcq19nm0zbnklviid57df";
+    })
+  ];
+
+  meta = with lib; {
+    homepage = "https://wiki.sagemath.org/spkg/rubiks";
+    description = "Several programs for working with Rubik's cubes";
+    # The individual websites are no longer available
+    longDescription = ''
+      There are several programs for working with Rubik's cubes, by three
+      different people. Look inside the directories under /src to see
+      specific info and licensing. In summary the three contributers are:
+
+
+      Michael Reid (GPL) http://www.math.ucf.edu/~reid/Rubik/optimal_solver.html
+          optimal - uses many pre-computed tables to find an optimal
+                    solution to the 3x3x3 Rubik's cube
+
+
+      Dik T. Winter (MIT License)
+          cube    - uses Kociemba's algorithm to iteratively find a short
+                    solution to the 3x3x3 Rubik's cube
+          size222 - solves a 2x2x2 Rubik's cube
+
+
+      Eric Dietz (GPL) http://www.wrongway.org/?rubiksource
+          cu2   - A fast, non-optimal 2x2x2 solver
+          cubex - A fast, non-optimal 3x3x3 solver
+          mcube - A fast, non-optimal 4x4x4 solver
+    '';
+    license = with licenses; [
+      gpl2 # Michael Reid's and Eric Dietz software
+      mit # Dik T. Winter's software
+    ];
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix b/nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix
new file mode 100644
index 000000000000..3b84a9d99cbe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv, fetchFromGitHub, cmake, openssh
+, gfortran, mpi, blas, lapack
+} :
+
+assert (!blas.isILP64) && (!lapack.isILP64);
+
+stdenv.mkDerivation rec {
+  pname = "scalapack";
+  version = "2.1.0";
+
+  src = fetchFromGitHub {
+    owner = "Reference-ScaLAPACK";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1c10d18gj3kvpmyv5q246x35hjxaqn4ygy1cygaydhyxnm4klzdj";
+  };
+
+  nativeBuildInputs = [ cmake openssh ];
+  buildInputs = [ mpi gfortran blas lapack ];
+
+  doCheck = true;
+
+  preConfigure = ''
+    cmakeFlagsArray+=(
+      -DBUILD_SHARED_LIBS=ON -DBUILD_STATIC_LIBS=OFF
+      -DLAPACK_LIBRARIES="-llapack"
+      -DBLAS_LIBRARIES="-lblas"
+      )
+  '';
+
+  # Increase individual test timeout from 1500s to 10000s because hydra's builds
+  # sometimes fail due to this
+  checkFlagsArray = [ "ARGS=--timeout 10000" ];
+
+  preCheck = ''
+    # make sure the test starts even if we have less than 4 cores
+    export OMPI_MCA_rmaps_base_oversubscribe=1
+
+    # Fix to make mpich run in a sandbox
+    export HYDRA_IFACE=lo
+
+    # Run single threaded
+    export OMP_NUM_THREADS=1
+
+    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}`pwd`/lib
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.netlib.org/scalapack/";
+    description = "Library of high-performance linear algebra routines for parallel distributed memory machines";
+    license = licenses.bsd3;
+    platforms = [ "x86_64-linux" ];
+    maintainers = with maintainers; [ costrouc markuskowa ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/scs/default.nix b/nixpkgs/pkgs/development/libraries/science/math/scs/default.nix
new file mode 100644
index 000000000000..96f543e430f0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/scs/default.nix
@@ -0,0 +1,52 @@
+{ lib, stdenv, fetchFromGitHub, blas, lapack, gfortran, fixDarwinDylibNames }:
+
+assert (!blas.isILP64) && (!lapack.isILP64);
+
+stdenv.mkDerivation rec {
+  pname = "scs";
+  version = "2.1.1";
+
+  src = fetchFromGitHub {
+    owner = "cvxgrp";
+    repo = "scs";
+    rev = version;
+    sha256 = "14g5m3lcvrbwpq1bq0liq00jh0gm1947lg3z4jfsp43f6p5alb20";
+  };
+
+  # Actually link and add libgfortran to the rpath
+  postPatch = ''
+    substituteInPlace scs.mk \
+      --replace "#-lgfortran" "-lgfortran" \
+      --replace "gcc" "cc"
+  '';
+
+  nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames;
+
+  buildInputs = [ blas lapack gfortran.cc.lib ];
+
+  doCheck = true;
+
+  # Test demo requires passing data and seed; numbers chosen arbitrarily.
+  postCheck = ''
+    ./out/demo_socp_indirect 42 0.42 0.42 42
+  '';
+
+  installPhase = ''
+    runHook preInstall
+    mkdir -p $out/lib
+    cp -r include $out/
+    cp out/*.a out/*.so out/*.dylib $out/lib/
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Splitting Conic Solver";
+    longDescription = ''
+      Numerical optimization package for solving large-scale convex cone problems
+    '';
+    homepage = "https://github.com/cvxgrp/scs";
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = [ maintainers.bhipple ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/spooles/default.nix b/nixpkgs/pkgs/development/libraries/science/math/spooles/default.nix
new file mode 100644
index 000000000000..6f4ddb3f787e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/spooles/default.nix
@@ -0,0 +1,52 @@
+{ lib, stdenv, fetchurl, gfortran, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "spooles";
+  version = "2.2";
+
+  src = fetchurl {
+    url = "http://www.netlib.org/linalg/spooles/spooles.${version}.tgz";
+    sha256 = "1pf5z3vvwd8smbpibyabprdvcmax0grzvx2y0liy98c7x6h5jid8";
+  };
+
+  sourceRoot = ".";
+
+  patches = [
+    ./spooles.patch
+  ];
+
+  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
+    substituteInPlace makefile --replace '-Wl,-soname' '-Wl,-install_name'
+  '';
+
+  buildPhase = ''
+    make lib
+  '';
+
+  installPhase = ''
+    mkdir -p $out/lib $out/include/spooles
+    cp libspooles.a libspooles.so.2.2 $out/lib/
+    ln -s libspooles.so.2.2 $out/lib/libspooles.so.2
+    ln -s libspooles.so.2 $out/lib/libspooles.so
+    for h in *.h; do
+      if [ $h != 'MPI.h' ]; then
+         cp $h $out/include/spooles
+         d=`basename $h .h`
+         if [ -d $d ]; then
+            mkdir $out/include/spooles/$d
+            cp $d/*.h $out/include/spooles/$d
+         fi
+      fi
+    done
+  '';
+
+  nativeBuildInputs = [ perl ];
+
+  meta = with lib; {
+    homepage = "http://www.netlib.org/linalg/spooles/";
+    description = "Library for solving sparse real and complex linear systems of equations";
+    license = licenses.publicDomain;
+    maintainers = with maintainers; [ gebner ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/spooles/spooles.patch b/nixpkgs/pkgs/development/libraries/science/math/spooles/spooles.patch
new file mode 100644
index 000000000000..71fb4a7f44e1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/spooles/spooles.patch
@@ -0,0 +1,188 @@
+diff --git a/I2Ohash/src/util.c b/I2Ohash/src/util.c
+index 72d082e..f32f667 100644
+--- a/I2Ohash/src/util.c
++++ b/I2Ohash/src/util.c
+@@ -39,9 +39,10 @@ fflush(stdout) ;
+ */
+ loc1 = (key1 + 1) % hashtable->nlist ;
+ loc2 = (key2 + 1) % hashtable->nlist ;
+-loc  = (loc1*loc2) % hashtable->nlist ;
++long int loc3  = (long int)loc1*(long int)loc2 % hashtable->nlist ;
++loc =(int) loc3;
+ #if MYDEBUG > 0
+-fprintf(stdout, "\n loc1 = %d, loc2 = %d, loc3 = %d", loc1, loc2, loc) ;
++fprintf(stdout, "\n loc1 = %d, loc2 = %d, loc3 = %ld, loc = %d", loc1, loc2, loc3, loc) ;
+ fflush(stdout) ;
+ #endif
+ /*
+@@ -158,9 +159,10 @@ fflush(stdout) ;
+ #endif
+ loc1 = (key1 + 1) % hashtable->nlist ;
+ loc2 = (key2 + 1) % hashtable->nlist ;
+-loc  = (loc1*loc2) % hashtable->nlist ;
++long int loc3  = (long int)loc1*(long int)loc2 % hashtable->nlist ;
++loc =(int) loc3;
+ #if MYDEBUG > 0
+-fprintf(stdout, "\n loc1 = %d, loc2 = %d, loc3 = %d", loc1, loc2, loc) ;
++fprintf(stdout, "\n loc1 = %d, loc2 = %d, loc3 = %ld, loc = %d", loc1, loc2, loc3, loc) ;
+ fflush(stdout) ;
+ #endif
+ /*
+diff --git a/MPI/makefile b/MPI/makefile
+index 0c09f86..d25e70a 100644
+--- a/MPI/makefile
++++ b/MPI/makefile
+@@ -2,7 +2,7 @@ all_drivers :
+ 	cd drivers ; make drivers
+ 
+ lib :
+-	cd src ; make spoolesMPI.a
++	cd src ; make makeLib
+ 
+ clean :
+ 	cd src ; make clean
+diff --git a/MPI/src/makefile b/MPI/src/makefile
+index f7650b7..71e4c49 100644
+--- a/MPI/src/makefile
++++ b/MPI/src/makefile
+@@ -42,3 +42,8 @@ $(OBJ).a : \
+ 
+ clean :
+ 	- rm -f *.a *.o
++
++makeLib :
++	perl ../../makeLib > makeG
++	make -f makeG
++	rm -f makeG
+diff --git a/MT/makefile b/MT/makefile
+index 9b86a32..d25e70a 100644
+--- a/MT/makefile
++++ b/MT/makefile
+@@ -2,7 +2,7 @@ all_drivers :
+ 	cd drivers ; make drivers
+ 
+ lib :
+-	cd src ; make spoolesMT.a
++	cd src ; make makeLib
+ 
+ clean :
+ 	cd src ; make clean
+diff --git a/Make.inc b/Make.inc
+index f99eb8f..2de8a25 100644
+--- a/Make.inc
++++ b/Make.inc
+@@ -12,7 +12,7 @@
+ # for solaris
+ #
+ # CC = gcc
+-  CC = /usr/lang-4.0/bin/cc
++#  CC = /usr/lang-4.0/bin/cc
+ #
+ # for sgi
+ #
+@@ -28,7 +28,7 @@
+ # 
+ # OPTLEVEL = 
+ # OPTLEVEL = -g -v
+-  OPTLEVEL = -O
++  OPTLEVEL = -O3
+ # OPTLEVEL = -xO5 -v
+ # OPTLEVEL = -O3
+ # OPTLEVEL = -O4
+@@ -43,7 +43,7 @@
+ #  set any load flags
+ #
+ #  LDFLAGS = -Wl,+parallel -Wl,+tm,spp2000 # for hp exemplar
+-   LDFLAGS =
++#   LDFLAGS =
+ #
+ #---------------------------------------------------------------------
+ #
+@@ -103,7 +103,7 @@
+ #  MPI install library
+ #
+ # MPI_INSTALL_DIR = 
+-  MPI_INSTALL_DIR = /usr/local/mpich-1.0.13
++#  MPI_INSTALL_DIR = /usr/lib/openmpi
+ #
+ #---------------------------------------------------------------------
+ #
+@@ -142,6 +142,6 @@
+ #  MPI include path
+ #
+ # MPI_INCLUDE_DIR = 
+-  MPI_INCLUDE_DIR = -I$(MPI_INSTALL_DIR)/include
++#  MPI_INCLUDE_DIR = -I/usr/include/mpi
+ #
+ #---------------------------------------------------------------------
+diff --git a/Utilities/src/iohb.c b/Utilities/src/iohb.c
+index ac38f7b..ac34034 100644
+--- a/Utilities/src/iohb.c
++++ b/Utilities/src/iohb.c
+@@ -1725,7 +1725,7 @@ static void upcase(char* S)
+ 
+ static void IOHBTerminate(char* message) 
+ {
+-   fprintf(stderr,message);
++   fputs(message, stderr);
+    exit(1);
+ }
+ 
+diff --git a/makeLib b/makeLib
+index 1780f39..7697b06 100755
+--- a/makeLib
++++ b/makeLib
+@@ -64,14 +64,19 @@ foreach $src ( @srcnames ) {
+    $srcname = " \\\n     " . $src ;
+    print $srcname ;
+ }
++print "\n\n.SUFFIXES: .c .o .lo .a .so" ;
+ print "\n\nOBJ_FILES = \$\{SRC:.c=.o\}" ;
++print "\n\nLOBJ_FILES = \$\{SRC:.c=.lo\}" ;
+ print "\n\n" ;
+ print <<'EOF' ;
+ .c.o :
+-	$(PURIFY) $(CC) -c $(CFLAGS) $*.c -o $(OBJ)_$*.o
++	$(PURIFY) $(CC) -c $(CFLAGS) $*.c -o $(OBJ)_$*.o $(MPI_INCLUDE_DIR)
+ 
+-../../spooles.a : ${OBJ_FILES}
+-	$(AR) $(ARFLAGS) ../../spooles.a $(OBJ)_*.o
++.c.lo :
++	$(PURIFY) $(CC) -c $(CFLAGS) $*.c -fPIC -DPIC -o $(OBJ)_$*.lo $(MPI_INCLUDE_DIR)
++
++../../libspooles.a : ${OBJ_FILES} ${LOBJ_FILES}
++	$(AR) $(ARFLAGS) ../../libspooles.a $(OBJ)_*.o
+ 	rm -f $(OBJ)_*.o
+-	$(RANLIB) ../../spooles.a
++	$(RANLIB) ../../libspooles.a
+ EOF
+diff --git a/makefile b/makefile
+index f014c7d..7c8042a 100755
+--- a/makefile
++++ b/makefile
+@@ -124,7 +124,9 @@ lib :
+ 	cd ZV               ; make lib
+ 	cd misc             ; make lib
+ #cd MPI              ; make lib
+-#cd MT               ; make lib
++	cd MT               ; make lib
++	$(CC) -shared */*/*.lo -Wl,-soname,libspooles.so.2.2 -o libspooles.so.2.2 -lpthread -lm
++	ln -s libspooles.so.2.2 libspooles.so
+ 
+ global :
+ 	cd A2/src             ; make -f makeGlobalLib
+diff --git a/timings.h b/timings.h
+index 23df189..685800b 100644
+--- a/timings.h
++++ b/timings.h
+@@ -2,9 +2,8 @@
+ #define _TIMINGS_
+ #include <sys/time.h>
+ static struct timeval  TV ;
+-static struct timezone TZ ;
+ #define MARKTIME(t) \
+-   gettimeofday(&TV, &TZ) ; \
++   gettimeofday(&TV, NULL) ; \
+    t = (TV.tv_sec + 0.000001*TV.tv_usec)
+ #endif
+ 
diff --git a/nixpkgs/pkgs/development/libraries/science/math/suitesparse-graphblas/default.nix b/nixpkgs/pkgs/development/libraries/science/math/suitesparse-graphblas/default.nix
new file mode 100644
index 000000000000..151a0eef8916
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/suitesparse-graphblas/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, gnum4
+}:
+
+stdenv.mkDerivation rec {
+  pname = "suitesparse-graphblas";
+  version = "4.0.3";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchFromGitHub {
+    owner = "DrTimothyAldenDavis";
+    repo = "GraphBLAS";
+    rev = "v${version}";
+    sha256 = "sha256-Bf3+w/kQtFpeUGp2zWVqja535EbaUw7DbhCw54B6A8k=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    gnum4
+  ];
+
+  meta = with lib; {
+    description = "Graph algorithms in the language of linear algebra";
+    homepage = "http://faculty.cse.tamu.edu/davis/GraphBLAS.html";
+    license = licenses.asl20;
+    maintainers = with maintainers; [];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.2.nix b/nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.2.nix
new file mode 100644
index 000000000000..b8ce3eca888c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.2.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchurl, gfortran, blas, lapack }:
+
+let
+  int_t = if blas.isILP64 then "int64_t" else "int32_t";
+in
+stdenv.mkDerivation rec {
+  version = "4.2.1";
+  pname = "suitesparse";
+  src = fetchurl {
+    url = "http://www.cise.ufl.edu/research/sparse/SuiteSparse/SuiteSparse-${version}.tar.gz" ;
+    sha256 = "1ga69637x7kdkiy3w3lq9dvva7220bdangv2lch2wx1hpi83h0p8";
+  };
+
+  nativeBuildInputs = [ gfortran ];
+  buildInputs = [ blas lapack ];
+
+  preConfigure = ''
+    mkdir -p $out/lib
+    mkdir -p $out/include
+
+    sed -i "SuiteSparse_config/SuiteSparse_config.mk" \
+        -e 's/METIS .*$/METIS =/' \
+        -e 's/METIS_PATH .*$/METIS_PATH =/' \
+        -e '/CHOLMOD_CONFIG/ s/$/-DNPARTITION -DLONGBLAS=${int_t}/' \
+        -e '/UMFPACK_CONFIG/ s/$/-DLONGBLAS=${int_t}/'
+  '';
+
+  makeFlags = [
+    "PREFIX=\"$(out)\""
+    "INSTALL_LIB=$(out)/lib"
+    "INSTALL_INCLUDE=$(out)/include"
+    "BLAS=-lblas"
+    "LAPACK=-llapack"
+  ];
+
+  meta = with lib; {
+    homepage = "http://faculty.cse.tamu.edu/davis/suitesparse.html";
+    description = "A suite of sparse matrix algorithms";
+    license = with licenses; [ bsd2 gpl2Plus lgpl21Plus ];
+    maintainers = with maintainers; [ ttuegel ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.4.nix b/nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.4.nix
new file mode 100644
index 000000000000..1ebac6ac445d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.4.nix
@@ -0,0 +1,100 @@
+{ lib, stdenv, fetchurl, gfortran, blas, lapack
+, enableCuda ? false, cudatoolkit
+}:
+
+let
+  version = "4.4.4";
+  name = "suitesparse-${version}";
+
+  int_t = if blas.isILP64 then "int64_t" else "int32_t";
+  SHLIB_EXT = stdenv.hostPlatform.extensions.sharedLibrary;
+in
+stdenv.mkDerivation {
+  inherit name;
+
+  src = fetchurl {
+    url = "http://faculty.cse.tamu.edu/davis/SuiteSparse/SuiteSparse-${version}.tar.gz";
+    sha256 = "1zdn1y0ij6amj7smmcslkqgbqv9yy5cwmbyzqc9v6drzdzllgbpj";
+  };
+
+  preConfigure = ''
+    mkdir -p $out/lib
+    mkdir -p $out/include
+
+    sed -i "SuiteSparse_config/SuiteSparse_config.mk" \
+        -e 's/METIS .*$/METIS =/' \
+        -e 's/METIS_PATH .*$/METIS_PATH =/' \
+        -e '/CHOLMOD_CONFIG/ s/$/-DNPARTITION -DLONGBLAS=${int_t}/' \
+        -e '/UMFPACK_CONFIG/ s/$/-DLONGBLAS=${int_t}/'
+  ''
+  + lib.optionalString stdenv.isDarwin ''
+    sed -i "SuiteSparse_config/SuiteSparse_config.mk" \
+        -e 's/^[[:space:]]*\(LIB = -lm\) -lrt/\1/'
+  ''
+  + lib.optionalString enableCuda ''
+    sed -i "SuiteSparse_config/SuiteSparse_config.mk" \
+        -e 's|^[[:space:]]*\(CUDA_ROOT     =\)|CUDA_ROOT = ${cudatoolkit}|' \
+        -e 's|^[[:space:]]*\(GPU_BLAS_PATH =\)|GPU_BLAS_PATH = $(CUDA_ROOT)|' \
+        -e 's|^[[:space:]]*\(GPU_CONFIG    =\)|GPU_CONFIG = -I$(CUDA_ROOT)/include -DGPU_BLAS -DCHOLMOD_OMP_NUM_THREADS=$(NIX_BUILD_CORES) |' \
+        -e 's|^[[:space:]]*\(CUDA_PATH     =\)|CUDA_PATH = $(CUDA_ROOT)|' \
+        -e 's|^[[:space:]]*\(CUDART_LIB    =\)|CUDART_LIB = $(CUDA_ROOT)/lib64/libcudart.so|' \
+        -e 's|^[[:space:]]*\(CUBLAS_LIB    =\)|CUBLAS_LIB = $(CUDA_ROOT)/lib64/libcublas.so|' \
+        -e 's|^[[:space:]]*\(CUDA_INC_PATH =\)|CUDA_INC_PATH = $(CUDA_ROOT)/include/|' \
+        -e 's|^[[:space:]]*\(NV20          =\)|NV20 = -arch=sm_20 -Xcompiler -fPIC|' \
+        -e 's|^[[:space:]]*\(NV30          =\)|NV30 = -arch=sm_30 -Xcompiler -fPIC|' \
+        -e 's|^[[:space:]]*\(NV35          =\)|NV35 = -arch=sm_35 -Xcompiler -fPIC|' \
+        -e 's|^[[:space:]]*\(NVCC          =\) echo|NVCC = $(CUDA_ROOT)/bin/nvcc|' \
+        -e 's|^[[:space:]]*\(NVCCFLAGS     =\)|NVCCFLAGS = $(NV20) -O3 -gencode=arch=compute_20,code=sm_20 -gencode=arch=compute_30,code=sm_30 -gencode=arch=compute_35,code=sm_35 -gencode=arch=compute_60,code=sm_60|'
+  '';
+
+  makeFlags = [
+    "PREFIX=\"$(out)\""
+    "INSTALL_LIB=$(out)/lib"
+    "INSTALL_INCLUDE=$(out)/include"
+    "BLAS=-lblas"
+    "LAPACK=-llapack"
+  ];
+
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin " -DNTIMER";
+
+  postInstall = ''
+    # Build and install shared library
+    (
+        cd "$(mktemp -d)"
+        for i in "$out"/lib/lib*.a; do
+          ar -x $i
+        done
+        ${if enableCuda then cudatoolkit else stdenv.cc.outPath}/bin/${if enableCuda then "nvcc" else "cc"} *.o ${if stdenv.isDarwin then "-dynamiclib" else "--shared"} -o "$out/lib/libsuitesparse${SHLIB_EXT}" -lblas ${lib.optionalString enableCuda "-lcublas"}
+    )
+    for i in umfpack cholmod amd camd colamd spqr; do
+      ln -s libsuitesparse${SHLIB_EXT} "$out"/lib/lib$i${SHLIB_EXT}
+    done
+
+    # Install documentation
+    outdoc=$out/share/doc/${name}
+    mkdir -p $outdoc
+    cp -r AMD/Doc $outdoc/amd
+    cp -r BTF/Doc $outdoc/bft
+    cp -r CAMD/Doc $outdoc/camd
+    cp -r CCOLAMD/Doc $outdoc/ccolamd
+    cp -r CHOLMOD/Doc $outdoc/cholmod
+    cp -r COLAMD/Doc $outdoc/colamd
+    cp -r CXSparse/Doc $outdoc/cxsparse
+    cp -r KLU/Doc $outdoc/klu
+    cp -r LDL/Doc $outdoc/ldl
+    cp -r RBio/Doc $outdoc/rbio
+    cp -r SPQR/Doc $outdoc/spqr
+    cp -r UMFPACK/Doc $outdoc/umfpack
+  '';
+
+  nativeBuildInputs = [ gfortran ];
+  buildInputs = [ blas lapack ];
+
+  meta = with lib; {
+    homepage = "http://faculty.cse.tamu.edu/davis/suitesparse.html";
+    description = "A suite of sparse matrix algorithms";
+    license = with licenses; [ bsd2 gpl2Plus lgpl21Plus ];
+    maintainers = with maintainers; [ ttuegel ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/suitesparse/default.nix b/nixpkgs/pkgs/development/libraries/science/math/suitesparse/default.nix
new file mode 100644
index 000000000000..e053d5bcf342
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/suitesparse/default.nix
@@ -0,0 +1,74 @@
+{ lib, stdenv
+, fetchFromGitHub
+, gfortran
+, blas, lapack
+, metis
+, fixDarwinDylibNames
+, gmp
+, mpfr
+, enableCuda ? false
+, cudatoolkit
+}:
+
+stdenv.mkDerivation rec {
+  pname = "suitesparse";
+  version = "5.9.0";
+
+  outputs = [ "out" "dev" "doc" ];
+
+  src = fetchFromGitHub {
+    owner = "DrTimothyAldenDavis";
+    repo = "SuiteSparse";
+    rev = "v${version}";
+    sha256 = "sha256-tvwpSVgZrfYZHXHN8OQF0Y/aJM03JHGPFok7hUqPE/4=";
+  };
+
+  nativeBuildInputs = [
+  ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
+
+  # Use compatible indexing for lapack and blas used
+  buildInputs = assert (blas.isILP64 == lapack.isILP64); [
+    blas lapack
+    metis
+    gfortran.cc.lib
+    gmp
+    mpfr
+  ] ++ lib.optional enableCuda cudatoolkit;
+
+  preConfigure = ''
+    # Mongoose and GraphBLAS are packaged separately
+    sed -i "Makefile" -e '/GraphBLAS\|Mongoose/d'
+  '';
+
+  makeFlags = [
+    "INSTALL=${placeholder "out"}"
+    "INSTALL_INCLUDE=${placeholder "dev"}/include"
+    "JOBS=$(NIX_BUILD_CORES)"
+    "MY_METIS_LIB=-lmetis"
+  ] ++ lib.optionals blas.isILP64 [
+    "CFLAGS=-DBLAS64"
+  ] ++ lib.optionals enableCuda [
+    "CUDA_PATH=${cudatoolkit}"
+    "CUDART_LIB=${cudatoolkit.lib}/lib/libcudart.so"
+    "CUBLAS_LIB=${cudatoolkit}/lib/libcublas.so"
+  ] ++ lib.optionals stdenv.isDarwin [
+    # Unless these are set, the build will attempt to use `Accelerate` on darwin, see:
+    # https://github.com/DrTimothyAldenDavis/SuiteSparse/blob/v5.9.0/SuiteSparse_config/SuiteSparse_config.mk#L368
+    "BLAS=-lblas"
+    "LAPACK=-llapack"
+  ]
+  ;
+
+  buildFlags = [
+    # Build individual shared libraries, not demos
+    "library"
+  ];
+
+  meta = with lib; {
+    homepage = "http://faculty.cse.tamu.edu/davis/suitesparse.html";
+    description = "A suite of sparse matrix algorithms";
+    license = with licenses; [ bsd2 gpl2Plus lgpl21Plus ];
+    maintainers = with maintainers; [ ttuegel ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/superlu/add-superlu-lib-as-dependency-for-the-unit-tests.patch b/nixpkgs/pkgs/development/libraries/science/math/superlu/add-superlu-lib-as-dependency-for-the-unit-tests.patch
new file mode 100644
index 000000000000..29d86238af08
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/superlu/add-superlu-lib-as-dependency-for-the-unit-tests.patch
@@ -0,0 +1,7 @@
+--- a/TESTING/MATGEN/CMakeLists.txt
++++ b/TESTING/MATGEN/CMakeLists.txt
+@@ -97,3 +97,4 @@ if(enable_complex16)
+ endif()
+ 
+ add_library(matgen ${sources})
++target_link_libraries(matgen superlu)
diff --git a/nixpkgs/pkgs/development/libraries/science/math/superlu/default.nix b/nixpkgs/pkgs/development/libraries/science/math/superlu/default.nix
new file mode 100644
index 000000000000..26dd00d96069
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/superlu/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, cmake,
+  gfortran, blas, lapack}:
+
+assert (!blas.isILP64) && (!lapack.isILP64);
+
+stdenv.mkDerivation rec {
+  version = "5.2.1";
+  pname = "superlu";
+
+  src = fetchurl {
+    url = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/superlu_${version}.tar.gz";
+    sha256 = "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8";
+  };
+
+  nativeBuildInputs = [ cmake gfortran ];
+
+  propagatedBuildInputs = [ blas ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=true"
+    "-DUSE_XSDK_DEFAULTS=true"
+  ];
+
+  patches = [
+    ./add-superlu-lib-as-dependency-for-the-unit-tests.patch
+  ];
+
+  doCheck = true;
+  checkTarget = "test";
+
+  meta = {
+    homepage = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/";
+    license = "http://crd-legacy.lbl.gov/~xiaoye/SuperLU/License.txt";
+    description = "A library for the solution of large, sparse, nonsymmetric systems of linear equations";
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/sympow/clean-extra-logfile-output-from-pari.patch b/nixpkgs/pkgs/development/libraries/science/math/sympow/clean-extra-logfile-output-from-pari.patch
new file mode 100644
index 000000000000..cbcf18b4cdb2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/sympow/clean-extra-logfile-output-from-pari.patch
@@ -0,0 +1,39 @@
+commit 433a8b99da9d71e96434bd421c2468cbda29d37c
+Author: Mauricio Collares <mauricio@collares.org>
+Date:   Tue Mar 2 22:07:11 2021 -0300
+
+    trim logfile information from pari 2.13 output
+    
+    Pari (since commit 609fb01faf827d91dfa9136849a647a3bbfe8036) prints
+    extra logfile information such as
+    
+      [logfile is "/tmp/nix-shell.2BquN9/home/.sympow/datafiles/P02HM.txt"]
+    
+    which messes up sympow's parsing. This commit reuses the same trimming
+    mechanism already in sympow to trim this new message.
+
+diff --git a/Configure b/Configure
+index 1ef9756..776bec2 100755
+--- a/Configure
++++ b/Configure
+@@ -322,7 +322,7 @@ echo "datafiles/param_data: \$(OTHERb)" >> $FILE
+ echo "	\$(MKDIR) -p datafiles" >> $FILE
+ echo "	\$(TOUCH) datafiles/param_data" >> $FILE
+ echo "	\$(SH) armd.sh" >> $FILE
+-echo "	\$(SED) -i -e '/logfile =/d' datafiles/*.txt" >> $FILE
++echo "	\$(SED) -i -e '/logfile /d' datafiles/*.txt" >> $FILE
+ echo "sympow.1: sympow" >> $FILE
+ echo "	\$(HELP2MAN) \$(H2MFLAGS) -s 1 -n \"SYMPOW program\" -I sympow.h2m -o \$@ ./\$<" >> $FILE
+ echo "clean:" >> $FILE
+diff --git a/generate.c b/generate.c
+index dbb811f..783320c 100644
+--- a/generate.c
++++ b/generate.c
+@@ -148,6 +148,7 @@ static void trimit(char *A)
+    " -e '"
+      "/^\?/d"                           ";"
+      "/^(/d"                            ";"
++	   "/logfile /d"                      ";"
+ 	   "/Warning:/d"                      ";"
+ 	   "/^About to find TOO_BIG/d"        ";"
+ 	   "/^Now working backwards/d"        ";"
diff --git a/nixpkgs/pkgs/development/libraries/science/math/sympow/default.nix b/nixpkgs/pkgs/development/libraries/science/math/sympow/default.nix
new file mode 100644
index 000000000000..c31c705d39d0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/sympow/default.nix
@@ -0,0 +1,76 @@
+{ lib, stdenv
+, fetchFromGitLab
+, makeWrapper
+, which
+, autoconf
+, help2man
+, file
+, pari
+}:
+
+stdenv.mkDerivation rec {
+  version = "2.023.6";
+  pname = "sympow";
+
+  src = fetchFromGitLab {
+    group = "rezozer";
+    owner = "forks";
+    repo = "sympow";
+    rev = "v${version}";
+    sha256 = "132l0xv00ld1svvv9wh99wfra4zzjv2885h2sq0dsl98wiyvi5zl";
+  };
+
+  patches = [ ./clean-extra-logfile-output-from-pari.patch ];
+
+  postUnpack = ''
+    patchShebangs .
+  '';
+
+  nativeBuildInputs = [
+    makeWrapper
+    which
+    autoconf
+    help2man
+    file
+    pari
+  ];
+
+  configurePhase = ''
+    runHook preConfigure
+    export PREFIX="$out"
+    export VARPREFIX="$out" # see comment on postInstall
+    ./Configure # doesn't take any options
+    runHook postConfigure
+  '';
+
+  # Usually, sympow has 3 levels of caching: statically distributed in /usr/,
+  # shared in /var and per-user in ~/.sympow. The shared cache assumes trust in
+  # other users and a shared /var is not compatible with nix's approach, so we
+  # set VARPREFIX to the read-only $out. This effectively disables shared
+  # caching. See https://trac.sagemath.org/ticket/3360#comment:36 and sympow's
+  # README for more details on caching.
+  # sympow will complain at runtime about the lack of write-permissions on the
+  # shared cache. We pass the `-quiet` flag by default to disable this.
+  postInstall = ''
+    wrapProgram "$out/bin/sympow" --add-flags '-quiet'
+  '';
+
+  # Example from the README as a sanity check.
+  doInstallCheck = true;
+  installCheckPhase = ''
+    export HOME="$TMP/home"
+    mkdir -p "$HOME"
+    "$out/bin/sympow" -sp 2p16 -curve "[1,2,3,4,5]" | grep '8.3705'
+  '';
+
+  meta = with lib; {
+    description = "Compute special values of symmetric power elliptic curve L-functions";
+    license = {
+      shortName = "sympow";
+      fullName = "Custom, BSD-like. See COPYING file.";
+      free = true;
+    };
+    maintainers = teams.sage.members;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/tensorflow-lite/default.nix b/nixpkgs/pkgs/development/libraries/science/math/tensorflow-lite/default.nix
new file mode 100644
index 000000000000..cf2346bad271
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/tensorflow-lite/default.nix
@@ -0,0 +1,181 @@
+{ stdenv
+, bash
+, abseil-cpp
+, fetchFromGitHub
+, fetchFromGitLab
+, fetchpatch
+, fetchurl
+, flatbuffers
+, hostPlatform
+, lib
+, zlib
+}:
+let
+  tflite-eigen = fetchFromGitLab {
+    owner = "libeigen";
+    repo = "eigen";
+    rev = "3d9051ea84a5089b277c88dac456b3b1576bfa7f";
+    sha256 = "1y3f2jvimb5i904f4n37h23cv2pkdlbz8656s0kga1y7c0p50wif";
+  };
+
+  gemmlowp-src = fetchFromGitHub {
+    owner = "google";
+    repo = "gemmlowp";
+    rev = "fda83bdc38b118cc6b56753bd540caa49e570745";
+    sha256 = "1sbp8kmr2azwlvfbzryy1frxi99jhsh1nc93bdbxdf8zdgpv0kxl";
+  };
+
+  neon-2-sse-src = fetchFromGitHub {
+    owner = "intel";
+    repo = "ARM_NEON_2_x86_SSE";
+    rev = "1200fe90bb174a6224a525ee60148671a786a71f";
+    sha256 = "0fhxch711ck809dpq1myxz63jiiwfcnxvj45ww0kg8s0pqpn5kv6";
+  };
+
+  farmhash-src = fetchFromGitHub {
+    owner = "google";
+    repo = "farmhash";
+    rev = "816a4ae622e964763ca0862d9dbd19324a1eaf45";
+    sha256 = "1mqxsljq476n1hb8ilkrpb39yz3ip2hnc7rhzszz4sri8ma7qzp6";
+  };
+
+  fft2d-src = fetchurl {
+    url = "http://www.kurims.kyoto-u.ac.jp/~ooura/fft2d.tgz";
+    sha256 = "ada7e99087c4ed477bfdf11413f2ba8db8a840ba9bbf8ac94f4f3972e2a7cec9";
+  };
+
+  fp16-src = fetchFromGitHub {
+    owner = "Maratyszcza";
+    repo = "FP16";
+    rev = "4dfe081cf6bcd15db339cf2680b9281b8451eeb3";
+    sha256 = "06a8dfl3a29r93nxpp6hpywsajz5d555n3sqd3i6krybb6swnvh7";
+  };
+
+  ruy-src = fetchFromGitHub {
+    owner = "google";
+    repo = "ruy";
+    rev = "23633b37099b614a2f836ef012cafc8087fdb98c";
+    sha256 = "14k9hz6ss8qy8nsajk6lrq25f6qxrldxky31ijw0dpqnfnnswrx4";
+  };
+
+  cpuinfo-src = fetchFromGitHub {
+    owner = "pytorch";
+    repo = "cpuinfo";
+    rev = "5916273f79a21551890fd3d56fc5375a78d1598d";
+    sha256 = "0q6760xdxsg18acdv8vq3yrq7ksr7wsm8zbyan01zf2khnb6fw4x";
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "tensorflow-lite";
+  version = "2.5.0";
+
+  src = fetchFromGitHub {
+    owner = "tensorflow";
+    repo = "tensorflow";
+    rev = "v${version}";
+    sha256 = "1jdw2i1rq06zqd6aabh7bbm0avsg4pygnfmd7gviv0blhih9054l";
+  };
+
+  patches = [
+    # TODO: remove on the next version bump
+    (fetchpatch {
+      name = "include-schema-conversion-utils-source.patch";
+      url = "https://github.com/tensorflow/tensorflow/commit/f3c4f4733692150fd6174f2cd16438cfaba2e5ab.patch";
+      sha256 = "0zx4hbz679kn79f30159rl1mq74dg45cvaawii0cyv48z472yy4k";
+    })
+    # TODO: remove on the next version bump
+    (fetchpatch {
+      name = "cxxstandard-var.patch";
+      url = "https://github.com/tensorflow/tensorflow/commit/9b128ae4200e10b4752f903492d1e7d11957ed5c.patch";
+      sha256 = "1q0izdwdji5fbyqll6k4dmkzfykyvvz5cvc6hysdj285nkn2wy6h";
+    })
+  ];
+
+  buildInputs = [ zlib flatbuffers ];
+
+  dontConfigure = true;
+
+  postPatch = ''
+    substituteInPlace ./tensorflow/lite/tools/make/Makefile \
+      --replace /bin/bash ${bash}/bin/bash \
+      --replace /bin/sh ${bash}/bin/sh
+  '';
+
+  makefile = "tensorflow/lite/tools/make/Makefile";
+
+  preBuild =
+    let
+      includes =
+        lib.concatMapStringsSep
+          " "
+          (subdir: "-I $PWD/tensorflow/lite/tools/make/downloads/${subdir}")
+          [
+            "neon_2_sse"
+            "gemmlowp"
+            "absl"
+            "fp16/include"
+            "farmhash/src"
+            "ruy"
+            "cpuinfo"
+            "cpuinfo/src"
+            "cpuinfo/include"
+            "cpuinfo/deps/clog/include"
+            "eigen"
+          ];
+    in
+    ''
+      # enter the vendoring lair of doom
+
+      prefix="$PWD/tensorflow/lite/tools/make/downloads"
+
+      mkdir -p "$prefix"
+
+      tar xzf ${fft2d-src} -C "$prefix"
+
+      ln -s ${ruy-src} "$prefix/ruy"
+      ln -s ${gemmlowp-src} "$prefix/gemmlowp"
+      ln -s ${neon-2-sse-src} "$prefix/neon_2_sse"
+      ln -s ${farmhash-src} "$prefix/farmhash"
+      ln -s ${cpuinfo-src} "$prefix/cpuinfo"
+      ln -s ${fp16-src} "$prefix/fp16"
+      ln -s ${tflite-eigen} "$prefix/eigen"
+
+      # tensorflow lite is using the *source* of flatbuffers
+      ln -s ${flatbuffers.src} "$prefix/flatbuffers"
+
+      # tensorflow lite expects to compile abseil into `libtensorflow-lite.a`
+      ln -s ${abseil-cpp.src} "$prefix/absl"
+
+      # set CXXSTANDARD=c++17 here because abseil-cpp in nixpkgs is set as
+      # such and would be used in dependents like libedgetpu
+      buildFlagsArray+=(
+        INCLUDES="-I $PWD ${includes}"
+        CXXSTANDARD="-std=c++17"
+        TARGET_TOOLCHAIN_PREFIX=""
+        -j$NIX_BUILD_CORES
+        all)
+    '';
+
+  installPhase = ''
+    mkdir "$out"
+
+    # copy the static lib and binaries into the output dir
+    cp -r ./tensorflow/lite/tools/make/gen/linux_${hostPlatform.uname.processor}/{bin,lib} "$out"
+
+    find ./tensorflow/lite -type f -name '*.h' | while read f; do
+      path="$out/include/''${f/.\//}"
+      install -D "$f" "$path"
+
+      # remove executable bit from headers
+      chmod -x "$path"
+    done
+  '';
+
+  meta = with lib; {
+    description = "An open source deep learning framework for on-device inference.";
+    homepage = "https://www.tensorflow.org/lite";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ cpcloud ];
+    platforms = [ "x86_64-linux" "aarch64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/tensorflow-lite/eigen_include_dir.patch b/nixpkgs/pkgs/development/libraries/science/math/tensorflow-lite/eigen_include_dir.patch
new file mode 100644
index 000000000000..6fa3c703efa9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/tensorflow-lite/eigen_include_dir.patch
@@ -0,0 +1,45 @@
+diff --git a/CMakeLists.txt b/CMakeLists.txt
+index 28103856e..a36909c0e 100644
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -449,13 +449,6 @@ install(FILES
+   DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel
+   )
+ 
+-if(EIGEN_BUILD_PKGCONFIG)
+-    configure_file(eigen3.pc.in eigen3.pc @ONLY)
+-    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eigen3.pc
+-        DESTINATION ${PKGCONFIG_INSTALL_DIR}
+-        )
+-endif()
+-
+ install(DIRECTORY Eigen DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel)
+ 
+ add_subdirectory(doc EXCLUDE_FROM_ALL)
+@@ -570,8 +563,15 @@ set ( EIGEN_VERSION_MAJOR  ${EIGEN_WORLD_VERSION} )
+ set ( EIGEN_VERSION_MINOR  ${EIGEN_MAJOR_VERSION} )
+ set ( EIGEN_VERSION_PATCH  ${EIGEN_MINOR_VERSION} )
+ set ( EIGEN_DEFINITIONS "")
+-set ( EIGEN_INCLUDE_DIR "${CMAKE_INSTALL_PREFIX}/${INCLUDE_INSTALL_DIR}" )
+ set ( EIGEN_ROOT_DIR ${CMAKE_INSTALL_PREFIX} )
++GNUInstallDirs_get_absolute_install_dir(EIGEN_INCLUDE_DIR INCLUDE_INSTALL_DIR)
++
++if(EIGEN_BUILD_PKGCONFIG)
++    configure_file(eigen3.pc.in eigen3.pc @ONLY)
++    install(FILES ${CMAKE_CURRENT_BINARY_DIR}/eigen3.pc
++        DESTINATION ${PKGCONFIG_INSTALL_DIR}
++        )
++endif()
+ 
+ # Interface libraries require at least CMake 3.0
+ if (NOT CMAKE_VERSION VERSION_LESS 3.0)
+diff --git a/eigen3.pc.in b/eigen3.pc.in
+index 3368a3aa1..d6778bf06 100644
+--- a/eigen3.pc.in
++++ b/eigen3.pc.in
+@@ -6,4 +6,4 @@ Description: A C++ template library for linear algebra: vectors, matrices, and r
+ Requires:
+ Version: @EIGEN_VERSION_NUMBER@
+ Libs:
+-Cflags: -I${prefix}/@INCLUDE_INSTALL_DIR@
++Cflags: -I@EIGEN_INCLUDE_DIR@
diff --git a/nixpkgs/pkgs/development/libraries/science/math/tensorflow/bin.nix b/nixpkgs/pkgs/development/libraries/science/math/tensorflow/bin.nix
new file mode 100644
index 000000000000..d42026c13cf9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/tensorflow/bin.nix
@@ -0,0 +1,71 @@
+{ lib, stdenv
+, fetchurl
+, addOpenGLRunpath
+, cudaSupport ? false, symlinkJoin, cudatoolkit, cudnn, nvidia_x11
+}:
+
+with lib;
+let
+  broken = !stdenv.isLinux && !stdenv.isDarwin;
+
+  tfType = if cudaSupport then "gpu" else "cpu";
+
+  system =
+    if stdenv.isLinux then "linux"
+    else "darwin";
+
+  platform =  "x86_64";
+
+  rpath = makeLibraryPath ([stdenv.cc.libc stdenv.cc.cc.lib]
+                           ++ optionals cudaSupport [ cudatoolkit.out cudatoolkit.lib cudnn nvidia_x11 ]);
+
+  packages = import ./binary-hashes.nix;
+
+  patchLibs =
+    if stdenv.isDarwin
+    then ''
+      install_name_tool -id $out/lib/libtensorflow.dylib $out/lib/libtensorflow.dylib
+      install_name_tool -id $out/lib/libtensorflow_framework.dylib $out/lib/libtensorflow_framework.dylib
+    ''
+    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 {
+  pname = "libtensorflow";
+  inherit (packages) version;
+
+  src = fetchurl packages."${tfType}-${system}-${platform}";
+
+  nativeBuildInputs = optional cudaSupport addOpenGLRunpath;
+
+  # Patch library to use our libc, libstdc++ and others
+  buildCommand = ''
+    mkdir -pv $out
+    tar -C $out -xzf $src
+    chmod -R +w $out
+    ${patchLibs}
+
+    # Write pkg-config file.
+    mkdir $out/lib/pkgconfig
+    cat > $out/lib/pkgconfig/tensorflow.pc << EOF
+    Name: TensorFlow
+    Version: ${version}
+    Description: Library for computation using data flow graphs for scalable machine learning
+    Requires:
+    Libs: -L$out/lib -ltensorflow
+    Cflags: -I$out/include/tensorflow
+    EOF
+  '';
+
+  meta = {
+    description = "C API for TensorFlow";
+    homepage = "https://www.tensorflow.org/install/lang_c";
+    license = licenses.asl20;
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/tensorflow/binary-hashes.nix b/nixpkgs/pkgs/development/libraries/science/math/tensorflow/binary-hashes.nix
new file mode 100644
index 000000000000..b606e45477a9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/tensorflow/binary-hashes.nix
@@ -0,0 +1,15 @@
+{
+version = "2.4.0";
+"cpu-linux-x86_64" = {
+  url = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-2.4.0.tar.gz";
+  sha256 = "022p5jjwmb8rhyyis3cpk2lw45apl2vz49m2rgxmd75h783x1gjk";
+};
+"gpu-linux-x86_64" = {
+  url = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-2.4.0.tar.gz";
+  sha256 = "1fclvbrn3fs8qmhmh3lzni7s7wl1w30a071b4gzh9ifnxdhip6lq";
+};
+"cpu-darwin-x86_64" = {
+  url = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-darwin-x86_64-2.4.0.tar.gz";
+  sha256 = "09x096nslg04c8sr7bd5v68a5gfinc0f1h36lbzn8bahs8b1agi3";
+};
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/math/tensorflow/prefetcher.sh b/nixpkgs/pkgs/development/libraries/science/math/tensorflow/prefetcher.sh
new file mode 100755
index 000000000000..d571d38f7719
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/tensorflow/prefetcher.sh
@@ -0,0 +1,26 @@
+#!/usr/bin/env bash
+
+# ./prefetcher.sh 2.4.0 binary-hashes.nix
+
+version="$1"
+hashfile="$2"
+rm -f $hashfile
+echo "{" >> $hashfile
+echo "version = \"$version\";" >> $hashfile
+for sys in "linux" "darwin"; do
+    for tfpref in "cpu" "gpu"; do
+        for platform in "x86_64"; do
+            if [ $sys = "darwin" ] && [ $tfpref = "gpu" ]; then
+               continue
+            fi
+            url=https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-$tfpref-$sys-$platform-$version.tar.gz
+            hash=$(nix-prefetch-url $url)
+            echo "\"${tfpref}-${sys}-${platform}\" = {" >> $hashfile
+            echo "  url = \"$url\";" >> $hashfile
+            echo "  sha256 = \"$hash\";" >> $hashfile
+            echo "};" >> $hashfile
+        done
+    done
+done
+echo "}" >> $hashfile
+
diff --git a/nixpkgs/pkgs/development/libraries/science/math/zn_poly/default.nix b/nixpkgs/pkgs/development/libraries/science/math/zn_poly/default.nix
new file mode 100644
index 000000000000..8f3e1aba350e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/math/zn_poly/default.nix
@@ -0,0 +1,74 @@
+{ stdenv
+, lib
+, fetchFromGitLab
+, fetchpatch
+, gmp
+, python2
+, tune ? false # tune to hardware, impure
+}:
+
+stdenv.mkDerivation rec {
+  version = "0.9.1";
+  pname = "zn_poly";
+
+  # sage has picked up the maintenance (bug fixes and building, not development)
+  # from the original, now unmaintained project which can be found at
+  # http://web.maths.unsw.edu.au/~davidharvey/code/zn_poly/
+  src = fetchFromGitLab {
+    owner = "sagemath";
+    repo = "zn_poly";
+    rev = version;
+    sha256 = "0ra5vy585bqq7g3317iw6fp44iqgqvds3j0l1va6mswimypq4vxb";
+  };
+
+  buildInputs = [
+    gmp
+  ];
+
+  nativeBuildInputs = [
+    python2 # needed by ./configure to create the makefile
+  ];
+
+  # name of library file ("libzn_poly.so")
+  libbasename = "libzn_poly";
+  libext = stdenv.targetPlatform.extensions.sharedLibrary;
+
+  makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
+
+  # Tuning (either autotuning or with hand-written paramters) is possible
+  # but not implemented here.
+  # It seems buggy anyways (see homepage).
+  buildFlags = [ "all" "${libbasename}${libext}" ];
+
+  configureFlags = lib.optionals (!tune) [
+    "--disable-tuning"
+  ];
+
+  patches = [
+    # fix format-security by not passing variables directly to printf
+    # https://gitlab.com/sagemath/zn_poly/merge_requests/1
+    (fetchpatch {
+      name = "format-security.patch";
+      url = "https://gitlab.com/timokau/zn_poly/commit/1950900a80ec898d342b8bcafa148c8027649766.patch";
+      sha256 = "1gks9chvsfpc6sg5h3nqqfia4cgvph7jmj9dw67k7dk7kv9y0rk1";
+    })
+  ];
+
+  # `make install` fails to install some header files and the lib file.
+  installPhase = ''
+    mkdir -p "$out/include/zn_poly"
+    mkdir -p "$out/lib"
+    cp "${libbasename}"*"${libext}" "$out/lib"
+    cp include/*.h "$out/include/zn_poly"
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "http://web.maths.unsw.edu.au/~davidharvey/code/zn_poly/";
+    description = "Polynomial arithmetic over Z/nZ";
+    license = with licenses; [ gpl3 ];
+    maintainers = teams.sage.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/networking/ns-3/default.nix b/nixpkgs/pkgs/development/libraries/science/networking/ns-3/default.nix
new file mode 100644
index 000000000000..1419a154d90e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/networking/ns-3/default.nix
@@ -0,0 +1,110 @@
+{ stdenv
+, fetchFromGitLab
+, python
+, wafHook
+
+# for binding generation
+, castxml ? null
+
+# can take a long time, generates > 30000 images/graphs
+, enableDoxygen ? false
+
+# e.g. "optimized" or "debug". If not set, use default one
+, build_profile ? null
+
+# --enable-examples
+, withExamples ? false
+
+# very long
+, withManual ? false, doxygen ? null, graphviz ? null, imagemagick ? null
+# for manual, tetex is used to get the eps2pdf binary
+# texlive to get latexmk. building manual still fails though
+, dia, tetex ? null, ghostscript ? null, texlive ? null
+
+# generates python bindings
+, pythonSupport ? false, ncurses ? null
+
+# All modules can be enabled by choosing 'all_modules'.
+# we include here the DCE mandatory ones
+, modules ? [ "core" "network" "internet" "point-to-point" "point-to-point-layout" "fd-net-device" "netanim" ]
+, lib
+}:
+
+let
+  pythonEnv = python.withPackages(ps:
+    lib.optional withManual ps.sphinx
+    ++ lib.optionals pythonSupport (with ps;[ pybindgen pygccxml ])
+  );
+in
+stdenv.mkDerivation rec {
+  pname = "ns-3";
+  version = "34";
+
+  src = fetchFromGitLab {
+    owner = "nsnam";
+    repo   = "ns-3-dev";
+    rev    = "ns-3.${version}";
+    sha256 = "sha256-udP7U+pHnNUdo35d9sN1o+aR9ctw9fgU3UunCjisGUI=";
+  };
+
+  nativeBuildInputs = [ wafHook python ];
+
+  outputs = [ "out" ] ++ lib.optional pythonSupport "py";
+
+  # ncurses is a hidden dependency of waf when checking python
+  buildInputs = lib.optionals pythonSupport [ castxml ncurses ]
+    ++ lib.optional enableDoxygen [ doxygen graphviz imagemagick ]
+    ++ lib.optional withManual [ dia tetex ghostscript texlive.combined.scheme-medium ];
+
+  propagatedBuildInputs = [ pythonEnv ];
+
+  postPatch = ''
+    patchShebangs doc/ns3_html_theme/get_version.sh
+  '';
+
+  wafConfigureFlags = with lib; [
+      "--enable-modules=${concatStringsSep "," modules}"
+      "--with-python=${pythonEnv.interpreter}"
+  ]
+  ++ optional (build_profile != null) "--build-profile=${build_profile}"
+  ++ optional withExamples " --enable-examples "
+  ++ optional doCheck " --enable-tests "
+  ;
+
+  doCheck = true;
+
+  buildTargets = "build"
+    + lib.optionalString enableDoxygen " doxygen"
+    + lib.optionalString withManual "sphinx";
+
+  # to prevent fatal error: 'backward_warning.h' file not found
+  CXXFLAGS = "-D_GLIBCXX_PERMIT_BACKWARD_HASH";
+
+  postBuild = with lib; let flags = concatStringsSep ";" (
+      optional enableDoxygen "./waf doxygen"
+      ++ optional withManual "./waf sphinx"
+    );
+    in "${flags}"
+  ;
+
+  postInstall = ''
+    moveToOutput "${pythonEnv.libPrefix}" "$py"
+  '';
+
+  # we need to specify the proper interpreter else ns3 can check against a
+  # different version
+  checkPhase =  ''
+    ${pythonEnv.interpreter} ./test.py --nowaf
+  '';
+
+  # strictoverflow prevents clang from discovering pyembed when bindings
+  hardeningDisable = [ "fortify" "strictoverflow"];
+
+  meta = with lib; {
+    homepage = "http://www.nsnam.org";
+    license = licenses.gpl3;
+    description = "A discrete time event network simulator";
+    platforms = with platforms; unix;
+    maintainers = with maintainers; [ teto rgrunbla ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/robotics/edgetpu-compiler/default.nix b/nixpkgs/pkgs/development/libraries/science/robotics/edgetpu-compiler/default.nix
new file mode 100644
index 000000000000..adf8bdd54b72
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/robotics/edgetpu-compiler/default.nix
@@ -0,0 +1,58 @@
+{ autoPatchelfHook
+, dpkg
+, fetchurl
+, lib
+, libcxx
+, stdenv
+}:
+stdenv.mkDerivation rec {
+  pname = "edgetpu-compiler";
+  version = "15.0";
+
+  src = fetchurl rec {
+    url = "https://packages.cloud.google.com/apt/pool/${pname}_${version}_amd64_${sha256}.deb";
+    sha256 = "ce03822053c2bddbb8640eaa988396ae66f9bc6b9d6d671914acd1727c2b445a";
+  };
+
+  nativeBuildInputs = [
+    autoPatchelfHook
+    dpkg
+  ];
+
+  buildInputs = [
+    libcxx
+  ];
+
+  unpackPhase = ''
+    mkdir bin pkg
+
+    dpkg -x $src pkg
+
+    rm -r pkg/usr/share/lintian
+
+    cp pkg/usr/bin/edgetpu_compiler_bin/edgetpu_compiler ./bin
+    cp -r pkg/usr/share .
+
+    rm -r pkg
+  '';
+
+  dontConfigure = true;
+  dontBuild = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out
+    cp -r ./{bin,share} $out
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "A command line tool that compiles a TensorFlow Lite model into an Edge TPU compatible file.";
+    homepage = "https://coral.ai/docs/edgetpu/compiler";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ cpcloud ];
+    platforms = [ "x86_64-linux" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/science/robotics/ispike/default.nix b/nixpkgs/pkgs/development/libraries/science/robotics/ispike/default.nix
new file mode 100644
index 000000000000..b3eed2e326e6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/science/robotics/ispike/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, cmake, boost }:
+
+stdenv.mkDerivation rec {
+  pname = "ispike";
+  version = "2.1.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/ispike/${pname}-${version}.tar.gz";
+    sha256 = "0khrxp43bi5kisr8j4lp9fl4r5marzf7b4inys62ac108sfb28lp";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost ];
+
+  meta = {
+    description = "Spiking neural interface between iCub and a spiking neural simulator";
+    homepage = "https://sourceforge.net/projects/ispike/";
+    license = lib.licenses.lgpl3;
+    platforms = lib.platforms.linux;
+    maintainers = [ lib.maintainers.nico202 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/scmccid/default.nix b/nixpkgs/pkgs/development/libraries/scmccid/default.nix
new file mode 100644
index 000000000000..f6b9194a608c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/scmccid/default.nix
@@ -0,0 +1,41 @@
+{lib, stdenv, fetchurl, patchelf, libusb-compat-0_1}:
+
+assert stdenv ? cc && stdenv.cc.libc != null;
+
+stdenv.mkDerivation rec {
+  pname = "scmccid";
+  version = "5.0.11";
+
+  src = if stdenv.hostPlatform.system == "i686-linux" then (fetchurl {
+      url = "http://www.scmmicro.com/support/download/scmccid_${version}_linux.tar.gz";
+      sha256 = "1r5wkarhzl09ncgj55baizf573czw0nplh1pgddzx9xck66kh5bm";
+    })
+    else if stdenv.hostPlatform.system == "x86_64-linux" then (fetchurl {
+        url = "http://www.scmmicro.com/support/download/scmccid_${version}_linux_x64.tar.gz";
+        sha256 = "0k9lzlk01sl4ycfqgrqqy3bildz0mcr1r0kkicgjz96l4s0jgz0i";
+    })
+    else throw "Architecture not supported";
+
+  nativeBuildInputs = [ patchelf ];
+
+  installPhase = ''
+    RPATH=${libusb-compat-0_1.out}/lib:${stdenv.cc.libc.out}/lib
+
+    for a in proprietary/*/Contents/Linux/*.so*; do
+        if ! test -L $a; then
+            patchelf --set-rpath $RPATH $a
+        fi
+    done
+
+    mkdir -p $out/pcsc/drivers
+    cp -R proprietary/* $out/pcsc/drivers
+  '';
+
+  meta = {
+    homepage = "http://www.scmmicro.com/support/pc-security-support/downloads.html";
+    description = "PCSC drivers for linux, for the SCM SCR3310 v2.0 card and others";
+    license = lib.licenses.unfree;
+    maintainers = with lib.maintainers; [viric];
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/scriptaculous/default.nix b/nixpkgs/pkgs/development/libraries/scriptaculous/default.nix
new file mode 100644
index 000000000000..e3c8ea00f446
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/scriptaculous/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, unzip, ... }:
+
+stdenv.mkDerivation rec {
+  pname = "scriptaculous";
+  version = "1.9.0";
+
+  src = fetchurl {
+    url = "https://script.aculo.us/dist/scriptaculous-js-${version}.zip";
+    sha256 = "1xpnk3cq8n07lxd69k5jxh48s21zh41ihq10z4a6lcnk238rp8qz";
+  };
+
+  nativeBuildInputs = [ unzip ];
+
+  installPhase = ''
+    mkdir $out
+    cp src/*.js $out
+  '';
+
+  meta = with lib; {
+    description = "A set of JavaScript libraries to enhance the user interface of web sites";
+    longDescription = ''
+      script.aculo.us provides you with
+      easy-to-use, cross-browser user
+      interface JavaScript libraries to make
+      your web sites and web applications fly.
+    '';
+    homepage = "https://script.aculo.us/";
+    downloadPage = "https://script.aculo.us/dist/";
+    license = licenses.mit;
+    maintainers = with maintainers; [ das_j ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/seasocks/default.nix b/nixpkgs/pkgs/development/libraries/seasocks/default.nix
new file mode 100644
index 000000000000..8c5b4e87d9bb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/seasocks/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, cmake, python, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "seasocks";
+  version = "1.4.4";
+
+  src = fetchFromGitHub {
+    owner = "mattgodbolt";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1f9a3mx3yjmr5qry4rc1c7mrx3348iifxm7d8sj8yd41kqnzmfv4";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zlib python ];
+
+  meta = with lib; {
+    homepage = "https://github.com/mattgodbolt/seasocks";
+    description = "Tiny embeddable C++ HTTP and WebSocket server";
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ fredeb ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sentencepiece/default.nix b/nixpkgs/pkgs/development/libraries/sentencepiece/default.nix
new file mode 100644
index 000000000000..52747b1033b8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sentencepiece/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, fetchFromGitHub
+, stdenv
+, cmake
+, gperftools
+
+, withGPerfTools ? true
+}:
+
+stdenv.mkDerivation rec {
+  pname = "sentencepiece";
+  version = "0.1.96";
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-jo8XlQJsnWpeeezDjNNhh6T473XMqe8fsApUr82Y3BU=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = lib.optionals withGPerfTools [ gperftools ];
+
+  outputs = [ "bin" "dev" "out" ];
+
+  meta = with lib; {
+    homepage = "https://github.com/google/sentencepiece";
+    description = "Unsupervised text tokenizer for Neural Network-based text generation";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ danieldk pashashocky ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sentry-native/default.nix b/nixpkgs/pkgs/development/libraries/sentry-native/default.nix
new file mode 100644
index 000000000000..af2a5e64d119
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sentry-native/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, cmake, curl, breakpad, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "sentry-native";
+  version = "0.4.12";
+
+  src = fetchFromGitHub {
+    owner = "getsentry";
+    repo = "sentry-native";
+    rev = version;
+    sha256 = "sha256-ut864o4LHmuHYJszFz7LFoIiSvf6a0S42xmV51CVBQ0=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ curl breakpad pkg-config ];
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=RelWithDebInfo"
+    "-DSENTRY_BREAKPAD_SYSTEM=On"
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/getsentry/sentry-native";
+    description = "Sentry SDK for C, C++ and native applications.";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ wheelsandmetal ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/serd/default.nix b/nixpkgs/pkgs/development/libraries/serd/default.nix
new file mode 100644
index 000000000000..b122a3121e4e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/serd/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, pkg-config, python3, wafHook }:
+
+stdenv.mkDerivation rec {
+  pname = "serd";
+  version = "0.30.10";
+
+  src = fetchurl {
+    url = "https://download.drobilla.net/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-r/qA3ux4kh+GM15vw/GLgK7+z0JPaldV6fL6DrBxDt8=";
+  };
+
+  nativeBuildInputs = [ pkg-config python3 wafHook ];
+
+  meta = with lib; {
+    homepage = "http://drobilla.net/software/serd";
+    description = "A lightweight C library for RDF syntax which supports reading and writing Turtle and NTriples";
+    license = licenses.mit;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/serf/default.nix b/nixpkgs/pkgs/development/libraries/serf/default.nix
new file mode 100644
index 000000000000..2549704c1a8c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/serf/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchurl, apr, scons, openssl, aprutil, zlib, libkrb5
+, pkg-config, libiconv }:
+
+stdenv.mkDerivation rec {
+  pname = "serf";
+  version = "1.3.9";
+
+  src = fetchurl {
+    url = "https://www.apache.org/dist/serf/${pname}-${version}.tar.bz2";
+    sha256 = "1k47gbgpp52049andr28y28nbwh9m36bbb0g8p0aka3pqlhjv72l";
+  };
+
+  nativeBuildInputs = [ pkg-config scons ];
+  buildInputs = [ apr openssl aprutil zlib libiconv ]
+    ++ lib.optional (!stdenv.isCygwin) libkrb5;
+
+  patches = [ ./scons.patch ];
+
+  prefixKey = "PREFIX=";
+
+  preConfigure = ''
+    sconsFlags+=" APR=$(echo ${apr.dev}/bin/*-config)"
+    sconsFlags+=" APU=$(echo ${aprutil.dev}/bin/*-config)"
+    sconsFlags+=" CC=$CC"
+    sconsFlags+=" OPENSSL=${openssl}"
+    sconsFlags+=" ZLIB=${zlib}"
+  '' + lib.optionalString (!stdenv.isCygwin) ''
+    sconsFlags+=" GSSAPI=${libkrb5.dev}"
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "HTTP client library based on APR";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ orivej raskin ];
+    platforms = platforms.linux ++ platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/serf/scons.patch b/nixpkgs/pkgs/development/libraries/serf/scons.patch
new file mode 100644
index 000000000000..acfece7ef5fe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/serf/scons.patch
@@ -0,0 +1,43 @@
+diff --git a/SConstruct b/SConstruct
+index 4358a23..6ce7776 100644
+--- a/SConstruct
++++ b/SConstruct
+@@ -55,7 +55,7 @@ def RawListVariable(key, help, default):
+ # To be used to ensure a PREFIX directory is only created when installing.
+ def createPathIsDirCreateWithTarget(target):
+   def my_validator(key, val, env):
+-    build_targets = (map(str, BUILD_TARGETS))
++    build_targets = (list(map(str, BUILD_TARGETS)))
+     if target in build_targets:
+       return PathVariable.PathIsDirCreate(key, val, env)
+     else:
+@@ -155,6 +155,7 @@ if sys.platform == 'win32':
+ env = Environment(variables=opts,
+                   tools=('default', 'textfile',),
+                   CPPPATH=['.', ],
++                  ENV=os.environ,
+                   )
+ 
+ env.Append(BUILDERS = {
+@@ -163,9 +164,9 @@ env.Append(BUILDERS = {
+               suffix='.def', src_suffix='.h')
+   })
+ 
+-match = re.search('SERF_MAJOR_VERSION ([0-9]+).*'
+-                  'SERF_MINOR_VERSION ([0-9]+).*'
+-                  'SERF_PATCH_VERSION ([0-9]+)',
++match = re.search(b'SERF_MAJOR_VERSION ([0-9]+).*'
++                  b'SERF_MINOR_VERSION ([0-9]+).*'
++                  b'SERF_PATCH_VERSION ([0-9]+)',
+                   env.File('serf.h').get_contents(),
+                   re.DOTALL)
+ MAJOR, MINOR, PATCH = [int(x) for x in match.groups()]
+@@ -183,7 +184,7 @@ CALLOUT_OKAY = not (env.GetOption('clean') or env.GetOption('help'))
+ 
+ unknown = opts.UnknownVariables()
+ if unknown:
+-  print 'Warning: Used unknown variables:', ', '.join(unknown.keys())
++  print('Warning: Used unknown variables:', ', '.join(list(unknown.keys())))
+ 
+ apr = str(env['APR'])
+ apu = str(env['APU'])
diff --git a/nixpkgs/pkgs/development/libraries/serialdv/default.nix b/nixpkgs/pkgs/development/libraries/serialdv/default.nix
new file mode 100644
index 000000000000..d1d9c6299b35
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/serialdv/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "serialdv";
+  version ="1.1.4";
+
+  src = fetchFromGitHub {
+    owner = "f4exb";
+    repo = "serialdv";
+    rev = "v${version}";
+    sha256 = "0d88h2wjhf79nisiv96bq522hkbknzm88wsv0q9k33mzmrwnrx93";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "C++ Minimal interface to encode and decode audio with AMBE3000 based devices in packet mode over a serial link";
+    homepage = "https://github.com/f4exb/serialdv";
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ alkeryn ];
+    license = licenses.gpl3;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/sfml/default.nix b/nixpkgs/pkgs/development/libraries/sfml/default.nix
new file mode 100644
index 000000000000..7ed5070ebb08
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sfml/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchzip, cmake, libX11, freetype, libjpeg, openal, flac, libvorbis
+, glew, libXrandr, libXrender, udev, xcbutilimage
+, IOKit, Foundation, AppKit, OpenAL
+}:
+
+stdenv.mkDerivation rec {
+  pname = "sfml";
+  version = "2.5.1";
+
+  src = fetchzip {
+    url = "https://github.com/SFML/SFML/archive/${version}.tar.gz";
+    sha256 = "0abr8ri2ssfy9ylpgjrr43m6rhrjy03wbj9bn509zqymifvq5pay";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ freetype libjpeg openal flac libvorbis glew ]
+    ++ lib.optional stdenv.isLinux udev
+    ++ lib.optionals (!stdenv.isDarwin) [ libX11 libXrandr libXrender xcbutilimage ]
+    ++ lib.optionals stdenv.isDarwin [ IOKit Foundation AppKit OpenAL ];
+
+  cmakeFlags = [ "-DSFML_INSTALL_PKGCONFIG_FILES=yes"
+                 "-DSFML_MISC_INSTALL_PREFIX=share/SFML"
+                 "-DSFML_BUILD_FRAMEWORKS=no"
+                 "-DSFML_USE_SYSTEM_DEPS=yes" ];
+
+  meta = with lib; {
+    homepage = "https://www.sfml-dev.org/";
+    description = "Simple and fast multimedia library";
+    longDescription = ''
+      SFML is a simple, fast, cross-platform and object-oriented multimedia API.
+      It provides access to windowing, graphics, audio and network.
+      It is written in C++, and has bindings for various languages such as C, .Net, Ruby, Python.
+    '';
+    license = licenses.zlib;
+    maintainers = [ maintainers.astsmtl ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sfsexp/default.nix b/nixpkgs/pkgs/development/libraries/sfsexp/default.nix
new file mode 100644
index 000000000000..7c3fbb9f39e4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sfsexp/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "sfsexp";
+  version = "1.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/sexpr/sexpr-${version}.tar.gz";
+    sha256 = "18gdwxjja0ip378hlzs8sp7q2g6hrmy7x10yf2wnxfmmylbpqn8k";
+  };
+
+  meta = with lib; {
+    description = "Small, fast s-expression library";
+    homepage = "http://sexpr.sourceforge.net/";
+    maintainers = with maintainers; [ jb55 ];
+    license = licenses.gpl3;
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/shapelib/default.nix b/nixpkgs/pkgs/development/libraries/shapelib/default.nix
new file mode 100644
index 000000000000..abb27a132c23
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/shapelib/default.nix
@@ -0,0 +1,17 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "shapelib-1.5.0";
+
+  src = fetchurl {
+    url = "https://download.osgeo.org/shapelib/${name}.tar.gz";
+    sha256 = "1qfsgb8b3yiqwvr6h9m81g6k9fjhfys70c22p7kzkbick20a9h0z";
+  };
+
+  meta = with lib; {
+    description = "C Library for reading, writing and updating ESRI Shapefiles";
+    homepage = "http://shapelib.maptools.org/";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.ehmry ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sharness/default.nix b/nixpkgs/pkgs/development/libraries/sharness/default.nix
new file mode 100644
index 000000000000..43a102686e9c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sharness/default.nix
@@ -0,0 +1,51 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, fetchurl
+, perl
+, perlPackages
+, sharnessExtensions ? {} }:
+
+stdenv.mkDerivation rec {
+  pname = "sharness";
+  version = "1.1.0-dev";
+
+  src = fetchFromGitHub {
+    owner = "chriscool";
+    repo = pname;
+    rev = "3f238a740156dd2082f4bd60ced205e05894d367"; # 2020-12-09
+    sha256 = "FCYskpIqkrpNaWCi2LkhEkiow4/rXLe+lfEWNUthLUg=";
+  };
+
+  # Used for testing
+  nativeBuildInputs = [ perl perlPackages.IOTty ];
+
+  outputs = [ "out" "doc" ];
+
+  makeFlags = [ "prefix=$(out)" ];
+
+  extensions = lib.mapAttrsToList (k: v: "${k}.sh ${v}") sharnessExtensions;
+
+  postInstall = lib.optionalString (sharnessExtensions != {}) ''
+    extDir=$out/share/sharness/sharness.d
+    mkdir -p "$extDir"
+    linkExtensions() {
+      set -- $extensions
+      while [ $# -ge 2 ]; do
+        ln -s "$2" "$extDir/$1"
+        shift 2
+      done
+    }
+    linkExtensions
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Portable shell library to write, run and analyze automated tests adhering to Test Anything Protocol (TAP)";
+    homepage = "https://github.com/chriscool/sharness";
+    license = licenses.gpl2Only;
+    maintainers = [ maintainers.spacefrogg ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/shhmsg/default.nix b/nixpkgs/pkgs/development/libraries/shhmsg/default.nix
new file mode 100644
index 000000000000..704df3dc5eff
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/shhmsg/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "shhmsg-1.4.2";
+
+  src = fetchurl {
+    url = "https://shh.thathost.com/pub-unix/files/${name}.tar.gz";
+    sha256 = "0ax02fzqpaxr7d30l5xbndy1s5vgg1ag643c7zwiw2wj1czrxil8";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile --replace "gcc" "${stdenv.cc.targetPrefix}cc"
+  '';
+
+  installFlags = [ "INSTBASEDIR=$(out)" ];
+
+  meta = with lib; {
+    description = "A library for displaying messages";
+    homepage = "https://shh.thathost.com/pub-unix/";
+    license = licenses.artistic1;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/shhopt/default.nix b/nixpkgs/pkgs/development/libraries/shhopt/default.nix
new file mode 100644
index 000000000000..664d4f3330a0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/shhopt/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "shhopt";
+  version = "1.1.7";
+
+  src = fetchurl {
+    url = "https://shh.thathost.com/pub-unix/files/${pname}-${version}.tar.gz";
+    sha256 = "0yd6bl6qw675sxa81nxw6plhpjf9d2ywlm8a5z66zyjf28sl7sds";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile --replace "gcc" "${stdenv.cc.targetPrefix}cc"
+  '';
+
+  installFlags = [ "INSTBASEDIR=$(out)" ];
+
+  meta = with lib; {
+    description = "A library for parsing command line options";
+    homepage = "https://shh.thathost.com/pub-unix/";
+    license = licenses.artistic1;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/shibboleth-sp/default.nix b/nixpkgs/pkgs/development/libraries/shibboleth-sp/default.nix
new file mode 100644
index 000000000000..f3b80c0b548f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/shibboleth-sp/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchgit, autoreconfHook, boost, fcgi, openssl, opensaml-cpp, log4shib, pkg-config, xercesc, xml-security-c, xml-tooling-c }:
+
+stdenv.mkDerivation rec {
+  pname = "shibboleth-sp";
+  version = "3.0.4.1";
+
+  src = fetchgit {
+    url = "https://git.shibboleth.net/git/cpp-sp.git";
+    rev = version;
+    sha256 = "1qb4dbz5gk10b9w1rf6f4vv7c2wb3a8bfzif6yiaq96ilqad7gdr";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ boost fcgi openssl opensaml-cpp log4shib xercesc xml-security-c xml-tooling-c ];
+
+  configureFlags = [
+    "--without-apxs"
+    "--with-xmltooling=${xml-tooling-c}"
+    "--with-saml=${opensaml-cpp}"
+    "--with-fastcgi"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage    = "https://shibboleth.net/products/service-provider.html";
+    description = "Enables SSO and Federation web applications written with any programming language or framework";
+    platforms   = platforms.unix;
+    license     = licenses.asl20;
+    maintainers = [ maintainers.jammerful ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/signond/default.nix b/nixpkgs/pkgs/development/libraries/signond/default.nix
new file mode 100644
index 000000000000..7e986ed2635e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/signond/default.nix
@@ -0,0 +1,30 @@
+{ mkDerivation, lib, fetchFromGitLab, qmake, doxygen }:
+
+mkDerivation rec {
+  pname = "signond";
+  version = "8.60";
+
+  src = fetchFromGitLab {
+    owner = "accounts-sso";
+    repo = pname;
+    rev = "VERSION_${version}";
+    sha256 = "pFpeJ13ut5EoP37W33WrYL2LzkX/k7ZKJcRpPO5l8i4=";
+  };
+
+  nativeBuildInputs = [
+    qmake
+    doxygen
+  ];
+
+  preConfigure = ''
+    substituteInPlace src/signond/signond.pro \
+      --replace "/etc" "@out@/etc"
+  '';
+
+  meta = with lib; {
+    homepage = "https://gitlab.com/accounts-sso/signond";
+    description = "Signon Daemon for Qt";
+    maintainers = with maintainers; [ freezeboy  ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/silgraphite/graphite2.nix b/nixpkgs/pkgs/development/libraries/silgraphite/graphite2.nix
new file mode 100644
index 000000000000..b047d6870746
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/silgraphite/graphite2.nix
@@ -0,0 +1,48 @@
+{ lib
+, stdenv
+, fetchurl
+, pkg-config
+, freetype
+, cmake
+, static ? stdenv.hostPlatform.isStatic
+}:
+
+stdenv.mkDerivation rec {
+  version = "1.3.14";
+  pname = "graphite2";
+
+  src = fetchurl {
+    url = "https://github.com/silnrsi/graphite/releases/download/"
+      + "${version}/graphite2-${version}.tgz";
+    sha256 = "1790ajyhk0ax8xxamnrk176gc9gvhadzy78qia4rd8jzm89ir7gr";
+  };
+
+  nativeBuildInputs = [ pkg-config cmake ];
+  buildInputs = [ freetype ];
+
+  patches = lib.optionals stdenv.isDarwin [ ./macosx.patch ];
+
+  cmakeFlags = lib.optionals static [
+    "-DBUILD_SHARED_LIBS=OFF"
+  ];
+
+  # Remove a test that fails to statically link (undefined reference to png and
+  # freetype symbols)
+  postConfigure = lib.optionalString static ''
+    sed -e '/freetype freetype.c/d' -i ../tests/examples/CMakeLists.txt
+  '';
+
+  preCheck = ''
+    export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD/src/
+    export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/src/
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "An advanced font engine";
+    maintainers = [ maintainers.raskin ];
+    platforms = platforms.unix;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/silgraphite/macosx.patch b/nixpkgs/pkgs/development/libraries/silgraphite/macosx.patch
new file mode 100644
index 000000000000..7929c1967c82
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/silgraphite/macosx.patch
@@ -0,0 +1,13 @@
+--- a/src/CMakeLists.txt
++++ b/src/CMakeLists.txt
+@@ -102,7 +102,8 @@ set_target_properties(graphite2 PROPERTIES  PUBLIC_HEADER "${GRAPHITE_HEADERS}"
+                                             VERSION ${GRAPHITE_VERSION}
+                                             LT_VERSION_CURRENT ${GRAPHITE_API_CURRENT}
+                                             LT_VERSION_REVISION ${GRAPHITE_API_REVISION}
+-                                            LT_VERSION_AGE ${GRAPHITE_API_AGE})
++                                            LT_VERSION_AGE ${GRAPHITE_API_AGE}
++                                            INSTALL_NAME_DIR ${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX})
+ 
+ if (${CMAKE_BUILD_TYPE} STREQUAL "ClangASN")
+     set(GRAPHITE_LINK_FLAGS "-fsanitize=address")
+
diff --git a/nixpkgs/pkgs/development/libraries/simdjson/default.nix b/nixpkgs/pkgs/development/libraries/simdjson/default.nix
new file mode 100644
index 000000000000..3ee1a1d0689e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/simdjson/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "simdjson";
+  version = "0.9.7";
+
+  src = fetchFromGitHub {
+    owner = "simdjson";
+    repo = "simdjson";
+    rev = "v${version}";
+    sha256 = "sha256-3ZLEp2RQhQ7QsRGLimWlZQM8PMTv07NlFoe64ES2+Ug=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    "-DSIMDJSON_JUST_LIBRARY=ON"
+  ] ++ lib.optional stdenv.hostPlatform.isStatic "-DSIMDJSON_BUILD_STATIC=ON";
+
+  meta = with lib; {
+    homepage = "https://simdjson.org/";
+    description = "Parsing gigabytes of JSON per second";
+    license = licenses.asl20;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ chessai ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/simgear/default.nix b/nixpkgs/pkgs/development/libraries/simgear/default.nix
new file mode 100644
index 000000000000..6167d63544f4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/simgear/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchurl, plib, freeglut, xorgproto, libX11, libXext, libXi
+, libICE, libSM, libXt, libXmu, libGLU, libGL, boost, zlib, libjpeg, freealut
+, openscenegraph, openal, expat, cmake, apr, xz
+, curl
+}:
+let
+  version = "2020.3.11";
+  shortVersion = builtins.substring 0 6 version;
+in
+stdenv.mkDerivation rec {
+  pname = "simgear";
+  inherit version;
+
+  src = fetchurl {
+    url = "mirror://sourceforge/flightgear/release-${shortVersion}/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-u438vCo7AUPR/88B0alh5WbvId0z2cx2jW2apYcdTzw=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ plib freeglut xorgproto libX11 libXext libXi
+                  libICE libSM libXt libXmu libGLU libGL boost zlib libjpeg freealut
+                  openscenegraph openal expat apr curl xz ];
+
+  meta = with lib; {
+    description = "Simulation construction toolkit";
+    homepage = "https://gitorious.org/fg/simgear";
+    maintainers = with maintainers; [ raskin ];
+    platforms = platforms.linux;
+    license = licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/simpleitk/default.nix b/nixpkgs/pkgs/development/libraries/simpleitk/default.nix
new file mode 100644
index 000000000000..2ae8b28b64f2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/simpleitk/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, cmake, swig, lua, itk }:
+
+stdenv.mkDerivation rec {
+  pname = "simpleitk";
+  version = "2.0.2";
+
+  src = fetchFromGitHub {
+    owner = "SimpleITK";
+    repo = "SimpleITK";
+    rev = "v${version}";
+    sha256 = "1q51jmd6skrr31avxlrxx433lawc838ilzrj5vvv38a9f4gl45v8";
+  };
+
+  nativeBuildInputs = [ cmake swig ];
+  buildInputs = [ lua itk ];
+
+  # 2.0.0: linker error building examples
+  cmakeFlags = [ "-DBUILD_EXAMPLES=OFF" "-DBUILD_SHARED_LIBS=ON" ];
+
+  meta = with lib; {
+    homepage = "https://www.simpleitk.org";
+    description = "Simplified interface to ITK";
+    maintainers = with maintainers; [ bcdarwin ];
+    platforms = platforms.linux;
+    license = licenses.asl20;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/skalibs/default.nix b/nixpkgs/pkgs/development/libraries/skalibs/default.nix
new file mode 100644
index 000000000000..09530db0532c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/skalibs/default.nix
@@ -0,0 +1,33 @@
+{ skawarePackages }:
+
+with skawarePackages;
+
+buildPackage {
+  pname = "skalibs";
+  version = "2.10.0.3";
+  sha256 = "0ka6n5rnxd5sn5lycarf596d5wlak5s535zqqlz0rnhdcnpb105p";
+
+  description = "A set of general-purpose C programming libraries";
+
+  outputs = [ "lib" "dev" "doc" "out" ];
+
+  configureFlags = [
+    # assume /dev/random works
+    "--enable-force-devr"
+    "--libdir=\${lib}/lib"
+    "--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 = ''
+    rm -rf sysdeps.cfg
+    rm libskarnet.*
+
+    mv doc $doc/share/doc/skalibs/html
+  '';
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/slang/default.nix b/nixpkgs/pkgs/development/libraries/slang/default.nix
new file mode 100644
index 000000000000..a3db5ce0d3be
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/slang/default.nix
@@ -0,0 +1,82 @@
+{ lib, stdenv, fetchurl
+, libiconv
+, libpng
+, ncurses
+, pcre
+, readline
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "slang";
+  version = "2.3.2";
+
+  src = fetchurl {
+    url = "https://www.jedsoft.org/releases/slang/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-/J47D8T2fDwfbUPJDBalxC0Re44oRXxbRoMbi1064xo=";
+  };
+
+  outputs = [ "out" "dev" "man" "doc" ];
+
+  patches = [ ./terminfo-dirs.patch ];
+
+  # Fix some wrong hardcoded paths
+  preConfigure = ''
+    sed -ie "s|/usr/lib/terminfo|${ncurses.out}/lib/terminfo|" configure
+    sed -ie "s|/usr/lib/terminfo|${ncurses.out}/lib/terminfo|" src/sltermin.c
+    sed -ie "s|/bin/ln|ln|" src/Makefile.in
+    sed -ie "s|-ltermcap|-lncurses|" ./configure
+  '';
+
+  configureFlags = [
+    "--with-pcre=${pcre.dev}"
+    "--with-png=${libpng.dev}"
+    "--with-readline=${readline.dev}"
+    "--with-z=${zlib.dev}"
+  ];
+
+  buildInputs = [
+    libpng
+    pcre
+    readline
+    zlib
+  ] ++ lib.optionals (stdenv.isDarwin) [ libiconv ];
+
+  propagatedBuildInputs = [ ncurses ];
+
+  # slang 2.3.2 does not support parallel building
+  enableParallelBuilding = false;
+
+  postInstall = ''
+    find "$out"/lib/ -name '*.so' -exec chmod +x "{}" \;
+    sed '/^Libs:/s/$/ -lncurses/' -i "$dev"/lib/pkgconfig/slang.pc
+  '';
+
+  meta = with lib; {
+    description = "A small, embeddable multi-platform programming library";
+    longDescription = ''
+      S-Lang is an interpreted language that was designed from the start to be
+      easily embedded into a program to provide it with a powerful extension
+      language. Examples of programs that use S-Lang as an extension language
+      include the jed text editor and the slrn newsreader. Although S-Lang does
+      not exist as a separate application, it is distributed with a quite
+      capable program called slsh ("slang-shell") that embeds the interpreter
+      and allows one to execute S-Lang scripts, or simply experiment with S-Lang
+      at an interactive prompt. Many of the the examples in this document are
+      presented in the context of one of the above applications.
+
+      S-Lang is also a programmer's library that permits a programmer to develop
+      sophisticated platform-independent software. In addition to providing the
+      S-Lang interpreter, the library provides facilities for screen management,
+      keymaps, low-level terminal I/O, etc. However, this document is concerned
+      only with the extension language and does not address these other features
+      of the S-Lang library. For information about the other components of the
+      library, the reader is referred to the S-Lang Library C Programmer's
+      Guide.
+    '';
+    homepage = "http://www.jedsoft.org/slang/";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/slang/terminfo-dirs.patch b/nixpkgs/pkgs/development/libraries/slang/terminfo-dirs.patch
new file mode 100644
index 000000000000..2229b759a3d4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/slang/terminfo-dirs.patch
@@ -0,0 +1,172 @@
+commit c7aa0c07b6522fbbb47ef47bd22f47f1611e7423
+Author: John E. Davis <jed@jedsoft.org>
+Date:   Wed Nov 28 00:46:28 2018 -0500
+
+    pre2.3.3-5: Added support for TERMINFO_DIRS env var
+
+Modified: removed changes to changelog and version number.
+
+diff --git a/src/sltermin.c b/src/sltermin.c
+index a06d0e4..65d3bbc 100644
+--- a/src/sltermin.c
++++ b/src/sltermin.c
+@@ -133,6 +133,9 @@ static FILE *open_terminfo (char *file, SLterminfo_Type *h)
+    unsigned char buf[12];
+    int magic;
+ 
++#ifdef SLANG_UNTIC
++   (void) fprintf (stdout,"# Trying %s\n", file);
++#endif
+    /* Alan Cox reported a security problem here if the application using the
+     * library is setuid.  So, I need to make sure open the file as a normal
+     * user.  Unfortunately, there does not appear to be a portable way of
+@@ -269,10 +272,73 @@ static char *read_string_table (FILE *fp, SLterminfo_Type *t)
+  * are implemented by multiple links to the same compiled file.
+  */
+ 
++static FILE *try_open_tidir (SLterminfo_Type *ti, const char *tidir, const char *term)
++{
++   char file[1024];
++
++   if (sizeof (file) > strlen (tidir) + 5 + strlen (term))
++     {
++	FILE *fp;
++
++	sprintf (file, "%s/%c/%s", tidir, *term, term);
++	if (NULL != (fp = open_terminfo (file, ti)))
++	  return fp;
++
++	sprintf (file, "%s/%02x/%s", tidir, (unsigned char)*term, term);
++	if (NULL != (fp = open_terminfo (file, ti)))
++	  return fp;
++     }
++
++   return NULL;
++}
++
++static FILE *try_open_env (SLterminfo_Type *ti, const char *term, const char *envvar)
++{
++   char *tidir;
++
++   if (NULL == (tidir = _pSLsecure_getenv (envvar)))
++     return NULL;
++
++   return try_open_tidir (ti, tidir, term);
++}
++
++static FILE *try_open_home (SLterminfo_Type *ti, const char *term)
++{
++   char home_ti[1024];
++   char *env;
++
++   if (NULL == (env = _pSLsecure_getenv ("HOME")))
++     return NULL;
++
++   strncpy (home_ti, env, sizeof (home_ti) - 11);
++   home_ti [sizeof(home_ti) - 11] = 0;
++   strcat (home_ti, "/.terminfo");
++
++   return try_open_tidir (ti, home_ti, term);
++}
++
++static FILE *try_open_env_path (SLterminfo_Type *ti, const char *term, const char *envvar)
++{
++   char tidir[1024];
++   char *env;
++   unsigned int i;
++
++   if (NULL == (env = _pSLsecure_getenv (envvar)))
++     return NULL;
++
++   i = 0;
++   while (-1 != SLextract_list_element (env, i, ':', tidir, sizeof(tidir)))
++     {
++	FILE *fp = try_open_tidir (ti, tidir, term);
++	if (fp != NULL) return fp;
++	i++;
++     }
++
++   return NULL;
++}
++
+ static SLCONST char *Terminfo_Dirs [] =
+ {
+-   "", /* $TERMINFO */
+-   "", /* $HOME/.terminfo */
+ #ifdef MISC_TERMINFO_DIRS
+    MISC_TERMINFO_DIRS,
+ #endif
+@@ -287,6 +353,23 @@ static SLCONST char *Terminfo_Dirs [] =
+    NULL,
+ };
+ 
++static FILE *try_open_hardcoded (SLterminfo_Type *ti, const char *term)
++{
++   const char *tidir, **tidirs;
++
++   tidirs = Terminfo_Dirs;
++   while (NULL != (tidir = *tidirs++))
++     {
++	FILE *fp;
++
++	if ((*tidir != 0)
++	    && (NULL != (fp = try_open_tidir (ti, tidir, term))))
++	  return fp;
++     }
++
++   return NULL;
++}
++
+ void _pSLtt_tifreeent (SLterminfo_Type *t)
+ {
+    if (t == NULL)
+@@ -305,11 +388,7 @@ void _pSLtt_tifreeent (SLterminfo_Type *t)
+ 
+ SLterminfo_Type *_pSLtt_tigetent (SLCONST char *term)
+ {
+-   SLCONST char **tidirs, *tidir;
+    FILE *fp = NULL;
+-   char file[1024];
+-   static char home_ti [1024];
+-   char *env;
+    SLterminfo_Type *ti;
+ 
+    if (
+@@ -341,33 +420,10 @@ SLterminfo_Type *_pSLtt_tigetent (SLCONST char *term)
+    /* If we are on a termcap based system, use termcap */
+    if (0 == tcap_getent (term, ti)) return ti;
+ 
+-   if (NULL != (env = _pSLsecure_getenv ("TERMINFO")))
+-     Terminfo_Dirs[0] = env;
+-
+-   if (NULL != (env = _pSLsecure_getenv ("HOME")))
+-     {
+-	strncpy (home_ti, env, sizeof (home_ti) - 11);
+-	home_ti [sizeof(home_ti) - 11] = 0;
+-	strcat (home_ti, "/.terminfo");
+-	Terminfo_Dirs [1] = home_ti;
+-     }
+-
+-   tidirs = Terminfo_Dirs;
+-   while (NULL != (tidir = *tidirs++))
+-     {
+-	if (*tidir == 0)
+-	  continue;
+-
+-	if (sizeof (file) > strlen (tidir) + 5 + strlen (term))
+-	  {
+-	     sprintf (file, "%s/%c/%s", tidir, *term, term);
+-	     if (NULL != (fp = open_terminfo (file, ti)))
+-	       break;
+-	     sprintf (file, "%s/%02x/%s", tidir, (unsigned char)*term, term);
+-	     if (NULL != (fp = open_terminfo (file, ti)))
+-	       break;
+-	  }
+-     }
++   fp = try_open_env_path (ti, term, "TERMINFO_DIRS");
++   if (fp == NULL) fp = try_open_env (ti, term, "TERMINFO");
++   if (fp == NULL) fp = try_open_home (ti, term);
++   if (fp == NULL) fp = try_open_hardcoded (ti, term);
+ 
+ #ifdef SLANG_UNTIC
+    fp_open_label:
diff --git a/nixpkgs/pkgs/development/libraries/slib/catalog-in-library-vicinity.patch b/nixpkgs/pkgs/development/libraries/slib/catalog-in-library-vicinity.patch
new file mode 100644
index 000000000000..9b803a35fbdd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/slib/catalog-in-library-vicinity.patch
@@ -0,0 +1,29 @@
+Write the catalog in under `(library-vicinity)', which is a subdir of $out,
+rather than under `(implementation-vicinity)', which is a subdir of ${scheme}.
+
+The downside is that we can't build an SLIB for several Schemes at the
+same time.
+
+--- slib/mklibcat.scm	2007-12-24 05:47:34.000000000 +0100
++++ slib/mklibcat.scm	2009-09-29 14:08:28.000000000 +0200
+@@ -17,7 +17,7 @@
+ ;promotional, or sales literature without prior written consent in
+ ;each case.
+ 
+-(let ((catpath (in-vicinity (implementation-vicinity) "slibcat")))
++(let ((catpath (in-vicinity (library-vicinity) "slibcat")))
+   (and (file-exists? catpath) (delete-file catpath))
+   (call-with-output-file catpath
+     (lambda (op)
+
+--- slib/require.scm	2009-08-03 04:09:47.000000000 +0200
++++ slib/require.scm	2009-09-29 14:13:56.000000000 +0200
+@@ -74,7 +74,7 @@
+ 
+ (define (catalog:get feature)
+   (if (not *catalog*)
+-      (let ((slibcat (catalog:try-read (implementation-vicinity) "slibcat")))
++      (let ((slibcat (catalog:try-read (library-vicinity) "slibcat")))
+ 	(cond ((not (catalog/require-version-match? slibcat))
+ 	       (slib:load-source (in-vicinity (library-vicinity) "mklibcat"))
+ 	       (set! slibcat
diff --git a/nixpkgs/pkgs/development/libraries/slib/default.nix b/nixpkgs/pkgs/development/libraries/slib/default.nix
new file mode 100644
index 000000000000..56c4eccf434c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/slib/default.nix
@@ -0,0 +1,54 @@
+{ fetchurl, lib, stdenv, unzip, scheme, texinfo }:
+
+stdenv.mkDerivation rec {
+  pname = "slib";
+  version = "3b5";
+
+  src = fetchurl {
+    url = "https://groups.csail.mit.edu/mac/ftpdir/scm/${pname}-${version}.zip";
+    sha256 = "0q0p2d53p8qw2592yknzgy2y1p5a9k7ppjx0cfrbvk6242c4mdpq";
+  };
+
+  patches = [ ./catalog-in-library-vicinity.patch ];
+
+  nativeBuildInputs = [ unzip ];
+  buildInputs = [ scheme texinfo ];
+
+  postInstall = ''
+    ln -s mklibcat{.scm,}
+    SCHEME_LIBRARY_PATH="$out/lib/slib" make catalogs
+
+    sed -i "$out/bin/slib" \
+        -e "/^SCHEME_LIBRARY_PATH/i export PATH=\"${scheme}/bin:\$PATH\""
+  '';
+
+  # There's no test suite (?!).
+  doCheck = false;
+
+  setupHook = ./setup-hook.sh;
+
+  meta = {
+    description = "The SLIB Portable Scheme Library";
+
+    longDescription = ''
+      SLIB is a portable library for the programming language Scheme.  It
+      provides a platform independent framework for using packages of Scheme
+      procedures and syntax.  As distributed, SLIB contains useful packages
+      for all Scheme implementations.  Its catalog can be transparently
+      extended to accommodate packages specific to a site, implementation,
+      user, or directory.
+
+      SLIB supports Bigloo, Chez, ELK 3.0, Gambit 4.0, Guile, JScheme, Kawa,
+      Larceny, MacScheme, MIT/GNU Scheme, Pocket Scheme, RScheme, scheme->C,
+      Scheme48, SCM, SCM Mac, scsh, sisc, Stk, T3.1, umb-scheme, and VSCM.
+    '';
+
+    # Public domain + permissive (non-copyleft) licensing of some files.
+    license = lib.licenses.publicDomain;
+
+    homepage = "http://people.csail.mit.edu/jaffer/SLIB";
+
+    maintainers = [ ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/slib/setup-hook.sh b/nixpkgs/pkgs/development/libraries/slib/setup-hook.sh
new file mode 100644
index 000000000000..3c7e91e81886
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/slib/setup-hook.sh
@@ -0,0 +1,13 @@
+addSlibPath () {
+    if test -f "$1/lib/slib/slibcat"
+    then
+	export SCHEME_LIBRARY_PATH="$1/lib/slib/"
+	echo "SLIB found in \`$1'; setting \$SCHEME_LIBRARY_PATH to \`$SCHEME_LIBRARY_PATH'"
+
+	# This is needed so that `(load-from-path "slib/guile.init")' works.
+	export GUILE_LOAD_PATH="$1/lib:$GUILE_LOAD_PATH"
+	echo "SLIB: setting \$GUILE_LOAD_PATH to \`$GUILE_LOAD_PATH'"
+    fi
+}
+
+addEnvHooks "$hostOffset" addSlibPath
diff --git a/nixpkgs/pkgs/development/libraries/smarty3-i18n/default.nix b/nixpkgs/pkgs/development/libraries/smarty3-i18n/default.nix
new file mode 100644
index 000000000000..e617ba58e8b4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/smarty3-i18n/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchFromGitHub, ... }:
+
+stdenv.mkDerivation rec {
+  pname = "smarty-i18n";
+  version = "1.0";
+
+  src = fetchFromGitHub {
+    owner = "kikimosha";
+    repo = "smarty3-i18n";
+    rev = version;
+    sha256 = "0rjxq4wka73ayna3hb5dxc5pgc8bw8p5fy507yc6cv2pl4h4nji2";
+  };
+
+  installPhase = ''
+    mkdir $out
+    cp block.t.php $out
+  '';
+
+  meta = with lib; {
+    description = "gettext for the smarty3 framework";
+    license = licenses.lgpl21;
+    homepage = "https://github.com/kikimosha/smarty3-i18n";
+    maintainers = with maintainers; [ das_j ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/smarty3/default.nix b/nixpkgs/pkgs/development/libraries/smarty3/default.nix
new file mode 100644
index 000000000000..c3c4f8610c70
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/smarty3/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, ... }:
+
+stdenv.mkDerivation rec {
+  pname = "smarty3";
+  version = "3.1.39";
+
+  src = fetchFromGitHub {
+    owner = "smarty-php";
+    repo = "smarty";
+    rev = "v${version}";
+    sha256 = "0n5hmnw66gxqikp6frgfd9ywsvr2azyg5nl7ix89digqlzcljkbg";
+  };
+
+  installPhase = ''
+    mkdir $out
+    cp -r libs/* $out
+  '';
+
+  meta = with lib; {
+    description = "Smarty 3 template engine";
+    longDescription = ''
+      Smarty is a template engine for PHP, facilitating the
+      separation of presentation (HTML/CSS) from application
+      logic. This implies that PHP code is application
+      logic, and is separated from the presentation.
+    '';
+    homepage = "https://www.smarty.net";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ das_j ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/smesh/default.nix b/nixpkgs/pkgs/development/libraries/smesh/default.nix
new file mode 100644
index 000000000000..8494799333be
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/smesh/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, ninja, opencascade
+, Cocoa }:
+
+stdenv.mkDerivation rec {
+  pname = "smesh";
+  version = "6.7.6";
+
+  src = fetchFromGitHub {
+    owner = "tpaviot";
+    repo = "smesh";
+    rev = version;
+    sha256 = "1b07j3bw3lnxk8dk3x1kkl2mbsmfwi98si84054038lflaaijzi0";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "fix-build-with-clang.patch";
+      url = "https://github.com/tpaviot/smesh/commit/e32c430f526f1637ec5973c9723acbc5be571ae3.patch";
+      sha256 = "0s4j5rb70g3jvvkgfbrxv7q52wk6yjyjiaya61gy2j64khplcjlb";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ninja ];
+  buildInputs = [ opencascade ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
+
+  meta = with lib; {
+    description = "Extension to OCE providing advanced meshing features";
+    homepage = "https://github.com/tpaviot/smesh";
+    license = licenses.lgpl21;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ gebner ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/smooth/default.nix b/nixpkgs/pkgs/development/libraries/smooth/default.nix
new file mode 100644
index 000000000000..8e55c8f4128a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/smooth/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, pkg-config
+
+, gtk3
+, curl
+, libxml2
+}:
+
+stdenv.mkDerivation rec {
+  pname = "smooth";
+  version = "0.9.8";
+
+  src = fetchFromGitHub {
+    owner = "enzo1982";
+    repo = "smooth";
+    rev = "v${version}";
+    sha256 = "sha256-4092Od/wCWe4br80Ry6mr8GpUIUeeF6sk3unELdfQJU=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+
+  makeFlags = [
+    "prefix=$(out)"
+  ];
+
+  buildInputs = [
+    gtk3
+    curl
+    libxml2
+  ];
+
+  meta = with lib; {
+    description = "The smooth Class Library";
+    license = licenses.artistic2;
+    homepage = "http://www.smooth-project.org/";
+    maintainers = with maintainers; [ shamilton ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/smpeg/default.nix b/nixpkgs/pkgs/development/libraries/smpeg/default.nix
new file mode 100644
index 000000000000..83b4b2193c03
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/smpeg/default.nix
@@ -0,0 +1,51 @@
+{ lib, stdenv, fetchsvn, SDL, autoconf, automake, libtool, gtk2, m4, pkg-config, libGLU, libGL, makeWrapper }:
+
+stdenv.mkDerivation rec {
+  name = "smpeg-svn${version}";
+  version = "390";
+
+  src = fetchsvn {
+    url = "svn://svn.icculus.org/smpeg/trunk";
+    rev = version;
+    sha256 = "0ynwn7ih5l2b1kpzpibns9bb9wzfjak7mgrb1ji0dkn2q5pv6lr0";
+  };
+
+  patches = [
+    ./format.patch
+    ./gcc6.patch
+    ./libx11.patch
+  ];
+
+  enableParallelBuilding = true;
+
+  buildInputs = [ SDL gtk2 libGLU libGL ];
+
+  nativeBuildInputs = [ autoconf automake libtool m4 pkg-config makeWrapper ];
+
+  preConfigure = ''
+    touch NEWS AUTHORS ChangeLog
+    sh autogen.sh
+  '';
+
+  postInstall = ''
+    sed -i -e 's,"SDL.h",<SDL/SDL.h>,' \
+    -e 's,"SDL_mutex.h",<SDL/SDL_mutex.h>,' \
+    -e 's,"SDL_audio.h",<SDL/SDL_audio.h>,' \
+    -e 's,"SDL_thread.h",<SDL/SDL_thread.h>,' \
+    -e 's,"SDL_types.h",<SDL/SDL_types.h>,' \
+      $out/include/smpeg/*.h
+
+    wrapProgram $out/bin/smpeg-config \
+      --prefix PATH ":" "${pkg-config}/bin" \
+      --prefix PKG_CONFIG_PATH ":" "${SDL.dev}/lib/pkgconfig"
+  '';
+
+  NIX_LDFLAGS = "-lX11";
+
+  meta = {
+    homepage = "http://icculus.org/smpeg/";
+    description = "MPEG decoding library";
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/smpeg/format.patch b/nixpkgs/pkgs/development/libraries/smpeg/format.patch
new file mode 100644
index 000000000000..8486dee5cda4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/smpeg/format.patch
@@ -0,0 +1,11 @@
+--- a/plaympeg.c	2014-09-04 08:55:10.646132150 +0200
++++ b/plaympeg.c	2014-09-04 08:56:57.465210820 +0200
+@@ -262,7 +262,7 @@
+       answer[i] = c;
+     }
+     answer[i] = 0;
+-    fprintf(stderr, answer + 4);
++    fprintf(stderr, "%s", answer + 4);
+   }
+   while(answer[3] == '-');
+ 
diff --git a/nixpkgs/pkgs/development/libraries/smpeg/gcc6.patch b/nixpkgs/pkgs/development/libraries/smpeg/gcc6.patch
new file mode 100644
index 000000000000..165feb4428c2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/smpeg/gcc6.patch
@@ -0,0 +1,33 @@
+--- a/audio/hufftable.cpp
++++ b/audio/hufftable.cpp
+@@ -9,6 +9,7 @@
+ #include "config.h"
+ #endif
+ 
++#include <climits>
+ #include "MPEGaudio.h"
+ 
+ static const unsigned int
+@@ -550,11 +551,11 @@ htd33[ 31][2]={{ 16,  1},{  8,  1},{  4,
+ 
+ const HUFFMANCODETABLE MPEGaudio::ht[HTN]=
+ {
+-  { 0, 0-1, 0-1, 0,  0, htd33},
++  { 0, UINT_MAX, UINT_MAX, 0,  0, htd33},
+   { 1, 2-1, 2-1, 0,  7,htd01},
+   { 2, 3-1, 3-1, 0, 17,htd02},
+   { 3, 3-1, 3-1, 0, 17,htd03},
+-  { 4, 0-1, 0-1, 0,  0, htd33},
++  { 4, UINT_MAX, UINT_MAX, 0,  0, htd33},
+   { 5, 4-1, 4-1, 0, 31,htd05},
+   { 6, 4-1, 4-1, 0, 31,htd06},
+   { 7, 6-1, 6-1, 0, 71,htd07},
+@@ -564,7 +565,7 @@ const HUFFMANCODETABLE MPEGaudio::ht[HTN
+   {11, 8-1, 8-1, 0,127,htd11},
+   {12, 8-1, 8-1, 0,127,htd12},
+   {13,16-1,16-1, 0,511,htd13},
+-  {14, 0-1, 0-1, 0,  0, htd33},
++  {14, UINT_MAX, UINT_MAX, 0,  0, htd33},
+   {15,16-1,16-1, 0,511,htd15},
+   {16,16-1,16-1, 1,511,htd16},
+   {17,16-1,16-1, 2,511,htd16},
diff --git a/nixpkgs/pkgs/development/libraries/smpeg/libx11.patch b/nixpkgs/pkgs/development/libraries/smpeg/libx11.patch
new file mode 100644
index 000000000000..8611073780f3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/smpeg/libx11.patch
@@ -0,0 +1,25 @@
+Index: smpeg-0.4.5+cvs20030824/Makefile.am
+===================================================================
+--- smpeg-0.4.5+cvs20030824.orig/Makefile.am
++++ smpeg-0.4.5+cvs20030824/Makefile.am
+@@ -74,7 +74,7 @@
+ 
+ # Sources for gtv
+ gtv_SOURCES = gtv.c gtv.h
+-gtv_LDADD = @GTK_LIBS@ libsmpeg.la
++gtv_LDADD = @GTK_LIBS@ @X11_LIBS@ libsmpeg.la
+ 
+ # Sources for glmovie
+ glmovie_SOURCES = glmovie-tile.c glmovie.c glmovie.h
+Index: smpeg-0.4.5+cvs20030824/configure.in
+===================================================================
+--- smpeg-0.4.5+cvs20030824.orig/configure.in
++++ smpeg-0.4.5+cvs20030824/configure.in
+@@ -215,6 +215,7 @@
+         CFLAGS="$CFLAGS $GTK_CFLAGS"
+     fi
+     AC_SUBST(GTK_LIBS)
++    PKG_CHECK_MODULES([X11], [x11])
+ fi
+ AM_CONDITIONAL(HAVE_GTK, test x$have_gtk = xyes)
+ 
diff --git a/nixpkgs/pkgs/development/libraries/smpeg2/default.nix b/nixpkgs/pkgs/development/libraries/smpeg2/default.nix
new file mode 100644
index 000000000000..d57cc91f26e2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/smpeg2/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv
+, autoconf
+, automake
+, darwin
+, fetchsvn
+, makeWrapper
+, pkg-config
+, SDL2
+}:
+
+stdenv.mkDerivation rec {
+  pname = "smpeg2";
+  version = "unstable-2017-10-18";
+
+  src = fetchsvn {
+    url = "svn://svn.icculus.org/smpeg/trunk";
+    rev = "413";
+    sha256 = "193amdwgxkb1zp7pgr72fvrdhcg3ly72qpixfxxm85rzz8g2kr77";
+  };
+
+  patches = [
+    ./hufftable-uint_max.patch
+  ];
+
+  nativeBuildInputs = [ autoconf automake makeWrapper pkg-config ];
+
+  buildInputs = [ SDL2 ]
+    ++ lib.optional stdenv.isDarwin darwin.libobjc;
+
+  preConfigure = ''
+    sh autogen.sh
+  '';
+
+  postInstall = ''
+    wrapProgram $out/bin/smpeg2-config \
+      --prefix PATH ":" "${pkg-config}/bin" \
+      --prefix PKG_CONFIG_PATH ":" "${SDL2.dev}/lib/pkgconfig"
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "http://icculus.org/smpeg/";
+    description = "SDL2 MPEG Player Library";
+    license = licenses.lgpl2;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ orivej ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/smpeg2/hufftable-uint_max.patch b/nixpkgs/pkgs/development/libraries/smpeg2/hufftable-uint_max.patch
new file mode 100644
index 000000000000..165feb4428c2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/smpeg2/hufftable-uint_max.patch
@@ -0,0 +1,33 @@
+--- a/audio/hufftable.cpp
++++ b/audio/hufftable.cpp
+@@ -9,6 +9,7 @@
+ #include "config.h"
+ #endif
+ 
++#include <climits>
+ #include "MPEGaudio.h"
+ 
+ static const unsigned int
+@@ -550,11 +551,11 @@ htd33[ 31][2]={{ 16,  1},{  8,  1},{  4,
+ 
+ const HUFFMANCODETABLE MPEGaudio::ht[HTN]=
+ {
+-  { 0, 0-1, 0-1, 0,  0, htd33},
++  { 0, UINT_MAX, UINT_MAX, 0,  0, htd33},
+   { 1, 2-1, 2-1, 0,  7,htd01},
+   { 2, 3-1, 3-1, 0, 17,htd02},
+   { 3, 3-1, 3-1, 0, 17,htd03},
+-  { 4, 0-1, 0-1, 0,  0, htd33},
++  { 4, UINT_MAX, UINT_MAX, 0,  0, htd33},
+   { 5, 4-1, 4-1, 0, 31,htd05},
+   { 6, 4-1, 4-1, 0, 31,htd06},
+   { 7, 6-1, 6-1, 0, 71,htd07},
+@@ -564,7 +565,7 @@ const HUFFMANCODETABLE MPEGaudio::ht[HTN
+   {11, 8-1, 8-1, 0,127,htd11},
+   {12, 8-1, 8-1, 0,127,htd12},
+   {13,16-1,16-1, 0,511,htd13},
+-  {14, 0-1, 0-1, 0,  0, htd33},
++  {14, UINT_MAX, UINT_MAX, 0,  0, htd33},
+   {15,16-1,16-1, 0,511,htd15},
+   {16,16-1,16-1, 1,511,htd16},
+   {17,16-1,16-1, 2,511,htd16},
diff --git a/nixpkgs/pkgs/development/libraries/snack/default.nix b/nixpkgs/pkgs/development/libraries/snack/default.nix
new file mode 100644
index 000000000000..8c97d0224c66
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/snack/default.nix
@@ -0,0 +1,36 @@
+# alsa-lib vorbis-tools python can be made optional
+
+{ lib, stdenv, fetchurl, python, tcl, tk, vorbis-tools, pkg-config, xlibsWrapper }:
+
+stdenv.mkDerivation rec {
+  pname = "snack";
+  version = "2.2.10";
+
+  src = fetchurl {
+    url = "https://www.speech.kth.se/snack/dist/${pname}${version}.tar.gz";
+    sha256 = "07p89jv9qnjqkszws9sssq93ayvwpdnkcxrvyicbm4mb8x2pdzjb";
+  };
+
+  configureFlags = [ "--with-tcl=${tcl}/lib" "--with-tk=${tk}/lib" ];
+
+  postUnpack = ''sourceRoot="$sourceRoot/unix"'';
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ python tcl tk vorbis-tools xlibsWrapper ];
+
+  hardeningDisable = [ "format" ];
+
+  postInstall = "aoeu";
+
+  installPhase = ''
+    mkdir -p $out
+    make install DESTDIR="$out"
+  '';
+
+  meta = {
+    description = "The Snack Sound Toolkit (Tcl)";
+    homepage = "https://www.speech.kth.se/snack/";
+    license = lib.licenses.gpl2;
+    broken = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/snap7/default.nix b/nixpkgs/pkgs/development/libraries/snap7/default.nix
new file mode 100644
index 000000000000..3419c4c6c2a6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/snap7/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, lib, fetchFromGitHub, fetchzip, p7zip }:
+
+stdenv.mkDerivation rec {
+  pname = "snap7";
+  version = "1.4.2";
+
+  src = fetchzip {
+    url = "mirror://sourceforge/snap7/${version}/snap7-full-${version}.7z";
+    sha256 = "1n5gs8bwb6g9vfllf3x12r5yzqzapmlq1bmc6hl854b8vkg30y8c";
+    postFetch = ''
+      ${p7zip}/bin/7z x $downloadedFile
+      mkdir $out
+      cp -r snap7-full-${version}/* $out/
+    '';
+  };
+
+  outputs = [ "out" "dev" "doc" ];
+
+  makefile = "x86_64_linux.mk";
+  makeFlags = [ "LibInstall=$(out)/lib" ];
+
+  preBuild = "cd build/unix";
+  preInstall = ''
+    mkdir -p $out/lib
+    mkdir -p $dev/include
+    mkdir -p $doc/share
+    cp $src/examples/cpp/snap7.h $dev/include
+    cp -r $src/doc $doc/share/
+  '';
+
+  meta = with lib; {
+    homepage = "http://snap7.sourceforge.net/";
+    description = "Step7 Open Source Ethernet Communication Suite";
+    license = licenses.lgpl3;
+    maintainers = with maintainers; [ freezeboy ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/snappy/default.nix b/nixpkgs/pkgs/development/libraries/snappy/default.nix
new file mode 100644
index 000000000000..ece425e85c41
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/snappy/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchFromGitHub, cmake
+, static ? stdenv.hostPlatform.isStatic
+}:
+
+stdenv.mkDerivation rec {
+  pname = "snappy";
+  version = "1.1.8";
+
+  src = fetchFromGitHub {
+    owner = "google";
+    repo = "snappy";
+    rev = version;
+    sha256 = "1j0kslq2dvxgkcxl1gakhvsa731yrcvcaipcp5k8k7ayicvkv9jv";
+  };
+
+  patches = [ ./disable-benchmark.patch ];
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=${if static then "OFF" else "ON"}"
+    "-DCMAKE_SKIP_BUILD_RPATH=OFF"
+  ];
+
+  postInstall = ''
+    substituteInPlace "$out"/lib/cmake/Snappy/SnappyTargets.cmake \
+      --replace 'INTERFACE_INCLUDE_DIRECTORIES "''${_IMPORT_PREFIX}/include"' 'INTERFACE_INCLUDE_DIRECTORIES "'$dev'"'
+  '';
+
+  checkTarget = "test";
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://google.github.io/snappy/";
+    license = licenses.bsd3;
+    description = "Compression/decompression library for very high speeds";
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/snappy/disable-benchmark.patch b/nixpkgs/pkgs/development/libraries/snappy/disable-benchmark.patch
new file mode 100644
index 000000000000..c891c13fe74c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/snappy/disable-benchmark.patch
@@ -0,0 +1,5 @@
+--- a/snappy-test.cc
++++ b/snappy-test.cc
+@@ -46 +46 @@
+-DEFINE_bool(run_microbenchmarks, true,
++DEFINE_bool(run_microbenchmarks, false,
diff --git a/nixpkgs/pkgs/development/libraries/soci/default.nix b/nixpkgs/pkgs/development/libraries/soci/default.nix
new file mode 100644
index 000000000000..2c87d421babe
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/soci/default.nix
@@ -0,0 +1,31 @@
+{ cmake
+, fetchFromGitHub
+, sqlite
+, lib, stdenv
+}:
+
+stdenv.mkDerivation rec {
+  pname = "soci";
+  version = "4.0.1";
+
+  src = fetchFromGitHub {
+    owner = "SOCI";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-d4GtxDaB+yGfyCnbvnLRUYcrPSMkUF7Opu6+SZd8opM=";
+  };
+
+  # Do not build static libraries
+  cmakeFlags = [ "-DSOCI_STATIC=OFF" "-DCMAKE_CXX_STANDARD=11" ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ sqlite ];
+
+  meta = with lib; {
+    description = "Database access library for C++";
+    homepage = "http://soci.sourceforge.net/";
+    license = licenses.boost;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ jluttine ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/socket_wrapper/default.nix b/nixpkgs/pkgs/development/libraries/socket_wrapper/default.nix
new file mode 100644
index 000000000000..e1ba9dbc1e61
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/socket_wrapper/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, fetchurl, cmake, pkg-config }:
+
+stdenv.mkDerivation rec {
+  name = "socket_wrapper-1.2.5";
+
+  src = fetchurl {
+    url = "mirror://samba/cwrap/${name}.tar.gz";
+    sha256 = "1wb3gq0rj5h92mhq6f1hb2qy4ypkxvn8y87ag88c7gc71nkpa1fx";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  meta = with lib; {
+    description = "A library passing all socket communications through unix sockets";
+    homepage = "https://git.samba.org/?p=socket_wrapper.git;a=summary;";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sofia-sip/default.nix b/nixpkgs/pkgs/development/libraries/sofia-sip/default.nix
new file mode 100644
index 000000000000..c9db54fd59c4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sofia-sip/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, glib, openssl, pkg-config, autoreconfHook, SystemConfiguration }:
+
+stdenv.mkDerivation rec {
+  pname = "sofia-sip";
+  version = "1.13.3";
+
+  src = fetchFromGitHub {
+    owner = "freeswitch";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-qMgZpLo/BHGJbJ0DDN8COHAhU3ujWgVK9oZOnnMwKas=";
+  };
+
+  buildInputs = [ glib openssl ] ++ lib.optional stdenv.isDarwin SystemConfiguration;
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  meta = with lib; {
+    description = "Open-source SIP User-Agent library, compliant with the IETF RFC3261 specification";
+    homepage = "https://github.com/freeswitch/sofia-sip";
+    platforms = platforms.unix;
+    license = licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/soil/default.nix b/nixpkgs/pkgs/development/libraries/soil/default.nix
new file mode 100644
index 000000000000..dcec1c897b3b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/soil/default.nix
@@ -0,0 +1,45 @@
+{ stdenv, lib
+, Carbon
+, fetchzip
+, libGL
+, libX11
+}:
+
+stdenv.mkDerivation {
+  name = "soil";
+
+  src = fetchzip {
+    url = "https://web.archive.org/web/20200104042737id_/http://www.lonesock.net/files/soil.zip";
+    sha256 = "1c05nwbnfdgwaz8ywn7kg2xrcvrcbpdyhcfkkiiwk69zvil0pbgd";
+  };
+
+  buildInputs = if stdenv.hostPlatform.isDarwin then [
+    Carbon
+  ] else [
+    libGL
+    libX11
+  ];
+
+  buildPhase = ''
+    cd src
+    $CC $NIX_CFLAGS_COMPILE -c *.c
+    $AR rcs libSOIL.a *.o
+  '';
+  installPhase = ''
+    mkdir -p $out/lib $out/include/SOIL
+    cp libSOIL.a $out/lib/
+    cp SOIL.h $out/include/SOIL/
+  '';
+
+  meta = with lib; {
+    description = "Simple OpenGL Image Library";
+    longDescription = ''
+      SOIL is a tiny C library used primarily for uploading textures
+      into OpenGL.
+    '';
+    homepage = "https://www.lonesock.net/soil.html";
+    license = licenses.publicDomain;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ r-burns ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sonic/default.nix b/nixpkgs/pkgs/development/libraries/sonic/default.nix
new file mode 100644
index 000000000000..ba3164db11aa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sonic/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchFromGitHub, fftw, installShellFiles }:
+
+stdenv.mkDerivation {
+  pname = "sonic-unstable";
+  version = "2020-12-27";
+
+  src = fetchFromGitHub {
+    owner = "waywardgeek";
+    repo = "sonic";
+    rev = "4a052d9774387a9d9b4af627f6a74e1694419960";
+    sha256 = "0ah54nizb6iwcx277w104wsfnx05vrp4sh56d2pfxhf8xghg54m6";
+  };
+
+  makeFlags = [ "PREFIX=${placeholder "out"}" "CC=${stdenv.cc.targetPrefix}cc" ];
+
+  nativeBuildInputs = [ installShellFiles ];
+
+  buildInputs = [ fftw ];
+
+  postInstall = ''
+    installManPage sonic.1
+  '' + lib.optionalString stdenv.isDarwin ''
+    install_name_tool -id $out/lib/libsonic.so.0.3.0 $out/lib/libsonic.so.0.3.0
+  '';
+
+  meta = with lib; {
+    description = "Simple library to speed up or slow down speech";
+    homepage = "https://github.com/waywardgeek/sonic";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ aske ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sope/default.nix b/nixpkgs/pkgs/development/libraries/sope/default.nix
new file mode 100644
index 000000000000..df0aeeac3236
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sope/default.nix
@@ -0,0 +1,50 @@
+{ gnustep, lib, fetchFromGitHub , libxml2, openssl
+, openldap, mariadb, libmysqlclient, postgresql }:
+with lib;
+
+gnustep.stdenv.mkDerivation rec {
+  pname = "sope";
+  version = "5.2.0";
+
+  src = fetchFromGitHub {
+    owner = "inverse-inc";
+    repo = pname;
+    rev = "SOPE-${version}";
+    sha256 = "14s9rcnglkwl0nmbmpdxxbiqqnr3m8n7x69idm1crgbbjkj4gi68";
+  };
+
+  hardeningDisable = [ "format" ];
+  nativeBuildInputs = [ gnustep.make ];
+  buildInputs = flatten ([ gnustep.base libxml2 openssl ]
+    ++ optional (openldap != null) openldap
+    ++ optionals (mariadb != null) [ libmysqlclient mariadb ]
+    ++ optional (postgresql != null) postgresql);
+
+  postPatch = ''
+    # Exclude NIX_ variables
+    sed -i 's/grep GNUSTEP_/grep ^GNUSTEP_/g' configure
+  '';
+
+  preConfigure = ''
+    export DESTDIR="$out"
+  '';
+
+  configureFlags = [ "--prefix=" "--disable-debug" "--enable-xml" "--with-ssl=ssl" ]
+    ++ optional (openldap != null) "--enable-openldap"
+    ++ optional (mariadb != null) "--enable-mysql"
+    ++ optional (postgresql != null) "--enable-postgresql";
+
+  # Yes, this is ugly.
+  preFixup = ''
+    cp -rlPa $out/nix/store/*/* $out
+    rm -rf $out/nix/store
+  '';
+
+  meta = {
+    description = "An extensive set of frameworks which form a complete Web application server environment";
+    license = licenses.publicDomain;
+    homepage = "https://github.com/inverse-inc/sope";
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ ajs124 das_j ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/soprano/default.nix b/nixpkgs/pkgs/development/libraries/soprano/default.nix
new file mode 100644
index 000000000000..46520714c510
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/soprano/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, cmake, qt4, clucene_core, librdf_redland, libiodbc
+, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "soprano";
+  version = "2.9.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/soprano/${pname}-${version}.tar.bz2";
+    sha256 = "1rg0x7yg0a1cbnxz7kqk52580wla8jbnj4d4r3j7l7g7ajyny1k4";
+  };
+
+  patches = [ ./find-virtuoso.patch ];
+
+  # We disable the Java backend, since we do not need them and they make the closure size much bigger
+  buildInputs = [ qt4 clucene_core librdf_redland libiodbc ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  meta = {
+    homepage = "http://soprano.sourceforge.net/";
+    description = "An object-oriented C++/Qt4 framework for RDF data";
+    license = "LGPL";
+    maintainers = with lib.maintainers; [ sander ];
+    inherit (qt4.meta) platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/soprano/find-virtuoso.patch b/nixpkgs/pkgs/development/libraries/soprano/find-virtuoso.patch
new file mode 100644
index 000000000000..95a2c7e96565
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/soprano/find-virtuoso.patch
@@ -0,0 +1,86 @@
+From: Yury G. Kudryashov <urkud.urkud@gmail.com>
+Subject: [PATCH] Find virtuoso if virtuoso-t is in PATH
+
+---
+ backends/virtuoso/virtuosobackend.cpp |   31 ++++++++++++++++++++++---------
+ backends/virtuoso/virtuosobackend.h   |    2 +-
+ 2 files changed, 23 insertions(+), 10 deletions(-)
+
+diff --git a/backends/virtuoso/virtuosobackend.cpp b/backends/virtuoso/virtuosobackend.cpp
+index c245101..249958a 100644
+--- a/backends/virtuoso/virtuosobackend.cpp
++++ b/backends/virtuoso/virtuosobackend.cpp
+@@ -28,6 +28,7 @@
+ #include "odbcconnectionpool.h"
+ 
+ #include "sopranodirs.h"
++#include "soprano-config.h"
+ 
+ #include <QtCore/QDebug>
+ #include <QtCore/QtPlugin>
+@@ -210,19 +211,19 @@ Soprano::BackendFeatures Soprano::Virtuoso::BackendPlugin::supportedFeatures() c
+ 
+ bool Soprano::Virtuoso::BackendPlugin::isAvailable() const
+ {
+-#ifndef Q_OS_WIN
+-    if ( findVirtuosoDriver().isEmpty() ) {
+-        qDebug() << Q_FUNC_INFO << "could not find Virtuoso ODBC driver";
+-        return false;
+-    }
+-#endif
+-
+     QString virtuosoBin = locateVirtuosoBinary();
+     if ( virtuosoBin.isEmpty() ) {
+         qDebug() << Q_FUNC_INFO << "could not find virtuoso-t binary";
+         return false;
+     }
+ 
++#ifndef Q_OS_WIN
++    if ( findVirtuosoDriver( virtuosoBin ).isEmpty() ) {
++        qDebug() << Q_FUNC_INFO << "could not find Virtuoso ODBC driver";
++        return false;
++    }
++#endif
++
+     QString vs = determineVirtuosoVersion( virtuosoBin );
+     if ( vs.isEmpty() ) {
+         qDebug() << Q_FUNC_INFO << "Failed to determine version of the Virtuoso server at" << virtuosoBin;
+@@ -267,9 +268,21 @@ QString Soprano::Virtuoso::BackendPlugin::locateVirtuosoBinary()
+ 
+ #ifndef Q_OS_WIN
+ // static
+-QString Soprano::Virtuoso::BackendPlugin::findVirtuosoDriver()
++QString Soprano::Virtuoso::BackendPlugin::findVirtuosoDriver( const QString &virtuosoBinHint )
+ {
+-    return Soprano::findLibraryPath( "virtodbc_r", QStringList(), QStringList() << QLatin1String( "virtuoso/plugins/" ) << QLatin1String( "odbc/" ) );
++    QString virtuosoBin;
++    if (virtuosoBinHint.isEmpty())
++        virtuosoBin = locateVirtuosoBinary();
++    else
++        virtuosoBin = virtuosoBinHint;
++
++    QDir virtuosoBinDir = QFileInfo(virtuosoBin).absoluteDir();
++    return Soprano::findLibraryPath( "virtodbc_r",
++            QStringList()
++			<< virtuosoBinDir.absoluteFilePath("../lib"SOPRANO_LIB_SUFFIX)
++			<< virtuosoBinDir.absoluteFilePath("../lib"),
++            QStringList() << QLatin1String( "virtuoso/plugins/" ) <<
++            QLatin1String( "odbc/" ) );
+ }
+ #endif
+ 
+diff --git a/backends/virtuoso/virtuosobackend.h b/backends/virtuoso/virtuosobackend.h
+index 646b9f8..535fbb9 100644
+--- a/backends/virtuoso/virtuosobackend.h
++++ b/backends/virtuoso/virtuosobackend.h
+@@ -52,7 +52,7 @@ namespace Soprano {
+ 
+ #ifndef Q_OS_WIN
+         private:
+-            static QString findVirtuosoDriver();
++            static QString findVirtuosoDriver(const QString &virtuosoBinHint = QString());
+ #endif
+         };
+     }
+-- 
+tg: (2321148..) t/find-virtuoso (depends on: master)
diff --git a/nixpkgs/pkgs/development/libraries/soqt/default.nix b/nixpkgs/pkgs/development/libraries/soqt/default.nix
new file mode 100644
index 000000000000..fe7901bddd58
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/soqt/default.nix
@@ -0,0 +1,29 @@
+{ fetchFromGitHub, lib, stdenv, coin3d, qtbase, cmake, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "soqt";
+  version = "2020-12-05-unstable";
+
+  src = fetchFromGitHub {
+    owner = "coin3d";
+    repo = "soqt";
+    # rev = "SoQt-${version}";
+    rev = "fb8f655632bb9c9c60e0ff9fa69a5ba22d3ff99d";
+    sha256 = "sha256-YoBq8P3Tag2Sepqxf/qIcJDBhH/gladBmDUj78aacZs=";
+    fetchSubmodules = true;
+  };
+
+  buildInputs = [ coin3d qtbase ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  dontWrapQtApps = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/coin3d/soqt";
+    license = licenses.bsd3;
+    description = "Glue between Coin high-level 3D visualization library and Qt";
+    maintainers = with maintainers; [ gebner viric ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sord/default.nix b/nixpkgs/pkgs/development/libraries/sord/default.nix
new file mode 100644
index 000000000000..820c577908ab
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sord/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, python3, serd, pcre, wafHook }:
+
+stdenv.mkDerivation rec {
+  pname = "sord";
+  version = "unstable-2021-01-12";
+
+  # Commit picked in mitigation of #109729
+  src = fetchFromGitHub {
+    owner = "drobilla";
+    repo = pname;
+    rev = "d2efdb2d026216449599350b55c2c85c0d3efb89";
+    sha256 = "hHTwK+K6cj9MGO77a1IXiUZtEbXZ08cLGkYZ5eMOIVA=";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ pkg-config python3 wafHook ];
+  buildInputs = [ pcre ];
+  propagatedBuildInputs = [ serd ];
+
+  meta = with lib; {
+    homepage = "http://drobilla.net/software/sord";
+    description = "A lightweight C library for storing RDF data in memory";
+    license = licenses.mit;
+    maintainers = [ maintainers.goibhniu ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/soundtouch/default.nix b/nixpkgs/pkgs/development/libraries/soundtouch/default.nix
new file mode 100644
index 000000000000..b29095f7e199
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/soundtouch/default.nix
@@ -0,0 +1,27 @@
+{stdenv, lib, fetchFromGitLab, autoconf, automake, libtool}:
+
+stdenv.mkDerivation rec {
+  pname = "soundtouch";
+  version = "2.2";
+
+  src = fetchFromGitLab {
+    owner = pname;
+    repo = pname;
+    rev = version;
+    sha256 = "12i6yg8vvqwyk412lxl2krbfby6hnxld8qxy0k4m5xp4g94jiq4p";
+  };
+
+  nativeBuildInputs = [ autoconf automake libtool ];
+
+  preConfigure = "./bootstrap";
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A program and library for changing the tempo, pitch and playback rate of audio";
+    homepage = "https://www.surina.net/soundtouch/";
+    license = licenses.lgpl21Plus;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ orivej ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/soxt/default.nix b/nixpkgs/pkgs/development/libraries/soxt/default.nix
new file mode 100644
index 000000000000..5ea23aae8791
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/soxt/default.nix
@@ -0,0 +1,24 @@
+{ fetchhg, lib, stdenv, cmake, coin3d, motif, xlibsWrapper, libXmu, libGLU, libGL }:
+
+stdenv.mkDerivation {
+  pname = "soxt";
+  version = "unstable-2019-06-14";
+
+  src = fetchhg {
+    url = "https://bitbucket.org/Coin3D/soxt";
+    rev = "85e135bb266fbb17e47fc336b876a576a239c15c";
+    sha256 = "0vk5cgn53yqf7csqdnlnyyhi4mbgx4wlsq70613p5fgxlvxzhcym";
+    fetchSubrepos = true;
+  };
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ coin3d motif xlibsWrapper libGLU libGL libXmu ];
+
+  meta = with lib; {
+    homepage = "https://bitbucket.org/Coin3D/coin/wiki/Home";
+    license = licenses.bsd3;
+    description = "A GUI binding for using Open Inventor with Xt/Motif";
+    maintainers = with maintainers; [ tmplt ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/spandsp/3.nix b/nixpkgs/pkgs/development/libraries/spandsp/3.nix
new file mode 100644
index 000000000000..ceb53e05744e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spandsp/3.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, audiofile, libtiff, autoreconfHook }:
+stdenv.mkDerivation rec {
+  version = "3.0.0";
+  pname = "spandsp";
+  src = fetchFromGitHub {
+    owner = "freeswitch";
+    repo = pname;
+    rev = "6ec23e5a7e411a22d59e5678d12c4d2942c4a4b6"; # upstream does not seem to believe in tags
+    sha256 = "03w0s99y3zibi5fnvn8lk92dggfgrr0mz5255745jfbz28b2d5y7";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ autoreconfHook ];
+  propagatedBuildInputs = [ audiofile libtiff ];
+
+  meta = {
+    description = "A portable and modular SIP User-Agent with audio and video support";
+    homepage = "https://github.com/freeswitch/spandsp";
+    platforms = with lib.platforms; unix;
+    maintainers = with lib.maintainers; [ ajs124 misuzu ];
+    license = lib.licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/spandsp/default.nix b/nixpkgs/pkgs/development/libraries/spandsp/default.nix
new file mode 100644
index 000000000000..240c86534335
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spandsp/default.nix
@@ -0,0 +1,22 @@
+{lib, stdenv, fetchurl, audiofile, libtiff}:
+stdenv.mkDerivation rec {
+  version = "0.0.6";
+  pname = "spandsp";
+  src=fetchurl {
+    url = "https://www.soft-switch.org/downloads/spandsp/spandsp-${version}.tar.gz";
+    sha256 = "0rclrkyspzk575v8fslzjpgp4y2s4x7xk3r55ycvpi4agv33l1fc";
+  };
+
+  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 lib.platforms; linux;
+    maintainers = with lib.maintainers; [raskin];
+    license = lib.licenses.gpl2;
+    downloadPage = "http://www.soft-switch.org/downloads/spandsp/";
+    updateWalker = true;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sparsehash/default.nix b/nixpkgs/pkgs/development/libraries/sparsehash/default.nix
new file mode 100644
index 000000000000..41b765bcb07d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sparsehash/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  name = "sparsehash-2.0.4";
+
+  src = fetchFromGitHub {
+    owner = "sparsehash";
+    repo = "sparsehash";
+    rev = name;
+    sha256 = "1pf1cjvcjdmb9cd6gcazz64x0cd2ndpwh6ql2hqpypjv725xwxy7";
+  };
+
+  meta = with lib; {
+    homepage = "https://github.com/sparsehash/sparsehash";
+    description = "An extremely memory-efficient hash_map implementation";
+    platforms = platforms.all;
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ pSub ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/spatialite-tools/default.nix b/nixpkgs/pkgs/development/libraries/spatialite-tools/default.nix
new file mode 100644
index 000000000000..265769f872f4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spatialite-tools/default.nix
@@ -0,0 +1,52 @@
+{ lib
+, stdenv
+, fetchurl
+, pkg-config
+, geos
+, expat
+, librttopo
+, libspatialite
+, libxml2
+, minizip
+, proj
+, readosm
+, sqlite
+}:
+
+stdenv.mkDerivation rec {
+  pname = "spatialite-tools";
+  version = "5.0.1";
+
+  src = fetchurl {
+    url = "https://www.gaia-gis.it/gaia-sins/spatialite-tools-sources/${pname}-${version}.tar.gz";
+    sha256 = "sha256-lgTCBeh/A3eJvFIwLGbM0TccPpjHTo7E4psHUt41Fxw=";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [
+    expat
+    geos
+    librttopo
+    libspatialite
+    libxml2
+    minizip
+    proj
+    readosm
+    sqlite
+  ];
+
+  configureFlags = [ "--disable-freexl" ];
+
+  enableParallelBuilding = true;
+
+  NIX_LDFLAGS = "-lsqlite3";
+
+  meta = with lib; {
+    description = "A complete sqlite3-compatible CLI front-end for libspatialite";
+    homepage = "https://www.gaia-gis.it/fossil/spatialite-tools";
+    license = with licenses; [ mpl11 gpl2Plus lgpl21Plus ];
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ dotlambda ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/spdk/default.nix b/nixpkgs/pkgs/development/libraries/spdk/default.nix
new file mode 100644
index 000000000000..eec08f3cc2d0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spdk/default.nix
@@ -0,0 +1,52 @@
+{ lib, stdenv
+, fetchurl
+, fetchFromGitHub
+, fetchpatch
+, ncurses
+, python3
+, cunit
+, dpdk
+, libaio
+, libbsd
+, libuuid
+, numactl
+, openssl
+}:
+
+stdenv.mkDerivation rec {
+  pname = "spdk";
+  version = "21.04";
+
+  src = fetchFromGitHub {
+    owner = "spdk";
+    repo = "spdk";
+    rev = "v${version}";
+    sha256 = "sha256-Xmmgojgtt1HwTqG/1ZOJVo1BcdAH0sheu40d73OJ68w=";
+  };
+
+  nativeBuildInputs = [
+    python3
+  ];
+
+  buildInputs = [
+    cunit dpdk libaio libbsd libuuid numactl openssl ncurses
+  ];
+
+  postPatch = ''
+    patchShebangs .
+  '';
+
+  configureFlags = [ "--with-dpdk=${dpdk}" ];
+
+  NIX_CFLAGS_COMPILE = "-mssse3"; # Necessary to compile.
+  # otherwise does not find strncpy when compiling
+  NIX_LDFLAGS = "-lbsd";
+
+  meta = with lib; {
+    description = "Set of libraries for fast user-mode storage";
+    homepage = "https://spdk.io/";
+    license = licenses.bsd3;
+    platforms =  [ "x86_64-linux" ];
+    maintainers = with maintainers; [ orivej ];
+  };
+}
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
new file mode 100644
index 000000000000..0c75bdb9dd84
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spdlog/default.nix
@@ -0,0 +1,60 @@
+{ lib, stdenv, fetchFromGitHub, cmake, fmt }:
+
+let
+  generic = { version, sha256 }:
+    stdenv.mkDerivation {
+      pname = "spdlog";
+      inherit version;
+
+      src = fetchFromGitHub {
+        owner  = "gabime";
+        repo   = "spdlog";
+        rev    = "v${version}";
+        inherit sha256;
+      };
+
+      nativeBuildInputs = [ cmake ];
+      # spdlog <1.3 uses a bundled version of fmt
+      propagatedBuildInputs = lib.optional (lib.versionAtLeast version "1.3") fmt;
+
+      cmakeFlags = [
+        "-DSPDLOG_BUILD_SHARED=${if stdenv.hostPlatform.isStatic then "OFF" else "ON"}"
+        "-DSPDLOG_BUILD_STATIC=${if stdenv.hostPlatform.isStatic then "ON" else "OFF"}"
+        "-DSPDLOG_BUILD_EXAMPLE=OFF"
+        "-DSPDLOG_BUILD_BENCH=OFF"
+        "-DSPDLOG_BUILD_TESTS=ON"
+        "-DSPDLOG_FMT_EXTERNAL=ON"
+      ];
+
+      outputs = [ "out" "doc" ]
+        # spdlog <1.4 is header only, no need to split libraries and headers
+        ++ lib.optional (lib.versionAtLeast version "1.4") "dev";
+
+      postInstall = ''
+        mkdir -p $out/share/doc/spdlog
+        cp -rv ../example $out/share/doc/spdlog
+      '';
+
+      doCheck = true;
+      preCheck = "export LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH";
+
+      meta = with lib; {
+        description    = "Very fast, header only, C++ logging library";
+        homepage       = "https://github.com/gabime/spdlog";
+        license        = licenses.mit;
+        maintainers    = with maintainers; [ obadz ];
+        platforms      = platforms.all;
+      };
+    };
+in
+{
+  spdlog_1 = generic {
+    version = "1.8.5";
+    sha256 = "sha256-D29jvDZQhPscaOHlrzGN1s7/mXlcsovjbqYpXd7OM50=";
+  };
+
+  spdlog_0 = generic {
+    version = "0.17.0";
+    sha256 = "112kfh4fbpm5cvrmgbgz4d8s802db91mhyjpg7cwhlywffnzkwr9";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/speech-tools/default.nix b/nixpkgs/pkgs/development/libraries/speech-tools/default.nix
new file mode 100644
index 000000000000..8706b8789227
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/speech-tools/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv, fetchurl, alsa-lib, ncurses }:
+
+stdenv.mkDerivation rec {
+  name = "speech_tools-${version}.0";
+  version = "2.5";
+
+  src = fetchurl {
+    url = "http://www.festvox.org/packed/festival/${version}/${name}-release.tar.gz";
+    sha256 = "1k2xh13miyv48gh06rgsq2vj25xwj7z6vwq9ilsn8i7ig3nrgzg4";
+  };
+
+  buildInputs = [ alsa-lib ncurses ];
+
+  preConfigure = ''
+    sed -e s@/usr/bin/@@g -i $( grep -rl '/usr/bin/' . )
+    sed -re 's@/bin/(rm|printf|uname)@\1@g' -i $( grep -rl '/bin/' . )
+
+    # c99 makes isnan valid for float and double
+    substituteInPlace include/EST_math.h \
+      --replace '__isnanf(X)' 'isnan(X)'
+  '';
+
+  installPhase = ''
+    mkdir -p "$out"/{bin,lib}
+    for d in bin lib; do
+      for i in ./$d/*; do
+        test "$(basename "$i")" = "Makefile" ||
+          cp -r "$(readlink -f $i)" "$out/$d"
+      done
+    done
+  '';
+
+  doCheck = true;
+
+  checkTarget = "test";
+
+  meta = with lib; {
+    description = "Text-to-speech engine";
+    maintainers = with maintainers; [ raskin ];
+    platforms = platforms.linux;
+    license = licenses.free;
+  };
+
+  passthru = {
+    updateInfo = {
+      downloadPage = "http://www.festvox.org/packed/festival/";
+    };
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/speechd/default.nix b/nixpkgs/pkgs/development/libraries/speechd/default.nix
new file mode 100644
index 000000000000..80034a5a9cf0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/speechd/default.nix
@@ -0,0 +1,128 @@
+{ lib, stdenv
+, substituteAll
+, pkg-config
+, fetchurl
+, fetchpatch
+, python3Packages
+, gettext
+, itstool
+, libtool
+, texinfo
+, util-linux
+, autoreconfHook
+, glib
+, dotconf
+, libsndfile
+, withLibao ? true, libao
+, withPulse ? false, libpulseaudio
+, withAlsa ? false, alsa-lib
+, withOss ? false
+, withFlite ? true, flite
+# , withFestival ? false, festival-freebsoft-utils
+, withEspeak ? true, espeak, sonic, pcaudiolib
+, withPico ? true, svox
+# , withIvona ? false, libdumbtts
+}:
+
+let
+  inherit (lib) optional optionals;
+  inherit (python3Packages) python pyxdg wrapPython;
+
+  # speechd hard-codes espeak, even when built without support for it.
+  selectedDefaultModule =
+    if withEspeak then
+      "espeak-ng"
+    else if withPico then
+      "pico"
+    else if withFlite then
+      "flite"
+    else
+      throw "You need to enable at least one output module.";
+in stdenv.mkDerivation rec {
+  pname = "speech-dispatcher";
+  version = "0.10.2";
+
+  src = fetchurl {
+    url = "https://github.com/brailcom/speechd/releases/download/${version}/${pname}-${version}.tar.gz";
+    sha256 = "sha256-sGMZ8gHhXlbGKWZTr1vPwwDLNI6XLVF9+LBurHfq4tw=";
+  };
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      utillinux = util-linux;
+    })
+
+    # Fix build with Glib 2.68
+    # https://github.com/brailcom/speechd/pull/462
+    (fetchpatch {
+      url = "https://github.com/brailcom/speechd/commit/a2faab416e42cbdf3d73f98578a89eb7a235e25a.patch";
+      sha256 = "8Q7tUdKKBBtgXZZnj59OcJOkrCNeBR9gkBjhKlpW0hQ=";
+    })
+  ];
+
+  nativeBuildInputs = [
+    pkg-config
+    autoreconfHook
+    gettext
+    libtool
+    itstool
+    texinfo
+    wrapPython
+  ];
+
+  buildInputs = [
+    glib
+    dotconf
+    libsndfile
+    libao
+    libpulseaudio
+    alsa-lib
+    python
+  ] ++ optionals withEspeak [
+    espeak
+    sonic
+    pcaudiolib
+  ] ++ optional withFlite flite
+    ++ optional withPico svox
+    # TODO: add flint/festival support with festival-freebsoft-utils package
+    # ++ optional withFestival festival-freebsoft-utils
+    # TODO: add Ivona support with libdumbtts package
+    # ++ optional withIvona libdumbtts
+  ;
+
+  pythonPath = [ pyxdg ];
+
+  configureFlags = [
+    # Audio method falls back from left to right.
+    "--with-default-audio-method=\"libao,pulse,alsa,oss\""
+    "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
+  ] ++ optional withPulse "--with-pulse"
+    ++ optional withAlsa "--with-alsa"
+    ++ optional withLibao "--with-libao"
+    ++ optional withOss "--with-oss"
+    ++ optional withEspeak "--with-espeak-ng"
+    ++ optional withPico "--with-pico"
+    # ++ optional withFestival "--with-flint"
+    # ++ optional withIvona "--with-ivona"
+  ;
+
+  postPatch = ''
+    substituteInPlace config/speechd.conf --replace "DefaultModule espeak" "DefaultModule ${selectedDefaultModule}"
+    substituteInPlace src/modules/pico.c --replace "/usr/share/pico/lang" "${svox}/share/pico/lang"
+  '';
+
+  postInstall = ''
+    wrapPythonPrograms
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Common interface to speech synthesis";
+    homepage = "https://devel.freebsoft.org/speechd";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ berce ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/speechd/fix-paths.patch b/nixpkgs/pkgs/development/libraries/speechd/fix-paths.patch
new file mode 100644
index 000000000000..acf7e5e08f4f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/speechd/fix-paths.patch
@@ -0,0 +1,11 @@
+--- a/speech-dispatcherd.service.in
++++ b/speech-dispatcherd.service.in
+@@ -19,7 +19,7 @@
+ [Service]
+ Type=forking
+ ExecStart=@bindir@/speech-dispatcher -d
+-ExecReload=/bin/kill -HUP $MAINPID
++ExecReload=@utillinux@/bin/kill -HUP $MAINPID
+ 
+ [Install]
+ WantedBy=multi-user.target
diff --git a/nixpkgs/pkgs/development/libraries/speex/default.nix b/nixpkgs/pkgs/development/libraries/speex/default.nix
new file mode 100644
index 000000000000..9633f435fb8e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/speex/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, fftw, speexdsp }:
+
+stdenv.mkDerivation rec {
+  name = "speex-1.2.0";
+
+  src = fetchurl {
+    url = "http://downloads.us.xiph.org/releases/speex/${name}.tar.gz";
+    sha256 = "150047wnllz4r94whb9r73l5qf0z5z3rlhy98bawfbblmkq8mbpa";
+  };
+
+  postPatch = ''
+    sed -i '/AC_CONFIG_MACRO_DIR/i PKG_PROG_PKG_CONFIG' configure.ac
+  '';
+
+  outputs = [ "out" "dev" "doc" ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ fftw speexdsp ];
+
+  # TODO: Remove this will help with immediate backward compatability
+  propagatedBuildInputs = [ speexdsp ];
+
+  configureFlags = [
+    "--with-fft=gpl-fftw3"
+  ];
+
+  meta = with lib; {
+    homepage = "https://www.speex.org/";
+    description = "An Open Source/Free Software patent-free audio compression format designed for speech";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/speexdsp/build-fix.patch b/nixpkgs/pkgs/development/libraries/speexdsp/build-fix.patch
new file mode 100644
index 000000000000..13cd5e7d21a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/speexdsp/build-fix.patch
@@ -0,0 +1,24 @@
+diff --git a/libspeexdsp/Makefile.am b/libspeexdsp/Makefile.am
+index d0499b9..42e8d50 100644
+--- a/libspeexdsp/Makefile.am
++++ b/libspeexdsp/Makefile.am
+@@ -29,7 +29,7 @@ noinst_HEADERS = 	arch.h 	bfin.h \
+ 	pseudofloat.h smallft.h vorbis_psy.h resample_sse.h resample_neon.h
+ 
+ libspeexdsp_la_LDFLAGS = -no-undefined -version-info @SPEEXDSP_LT_CURRENT@:@SPEEXDSP_LT_REVISION@:@SPEEXDSP_LT_AGE@
+-libspeexdsp_la_LIBADD = $(LIBM)
++libspeexdsp_la_LIBADD = @FFT_LIBS@ $(LIBM)
+ 
+ if BUILD_EXAMPLES
+ noinst_PROGRAMS = testdenoise testecho testjitter testresample
+diff --git a/speexdsp.pc.in b/speexdsp.pc.in
+index 6c6d26f..d40d856 100644
+--- a/speexdsp.pc.in
++++ b/speexdsp.pc.in
+@@ -11,5 +11,5 @@ Version: @PACKAGE_VERSION@
+ Requires: @FFT_PKGCONFIG@
+ Conflicts:
+ Libs: -L${libdir} -lspeexdsp
+-Libs.private: @LIBM@
++Libs.private: @FFT_LIBS@ @LIBM@
+ Cflags: -I${includedir}
diff --git a/nixpkgs/pkgs/development/libraries/speexdsp/default.nix b/nixpkgs/pkgs/development/libraries/speexdsp/default.nix
new file mode 100644
index 000000000000..643a83c47005
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/speexdsp/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, fftw }:
+
+stdenv.mkDerivation rec {
+  pname = "speexdsp";
+  version = "1.2.0";
+
+  src = fetchurl {
+    url = "https://downloads.xiph.org/releases/speex/${pname}-${version}.tar.gz";
+    sha256 = "0wa7sqpk3x61zz99m7lwkgr6yv62ml6lfgs5xja65vlvdzy44838";
+  };
+
+  patches = [ ./build-fix.patch ];
+  postPatch = "sed '3i#include <stdint.h>' -i ./include/speex/speexdsp_config_types.h.in";
+
+  outputs = [ "out" "dev" "doc" ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ fftw ];
+
+  configureFlags = [
+    "--with-fft=gpl-fftw3"
+  ] ++ lib.optional stdenv.isAarch64 "--disable-neon";
+
+  meta = with lib; {
+    homepage = "https://www.speex.org/";
+    description = "An Open Source/Free Software patent-free audio compression format designed for speech";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/spglib/default.nix b/nixpkgs/pkgs/development/libraries/spglib/default.nix
new file mode 100644
index 000000000000..9f50c80bf7a1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spglib/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, lib, fetchFromGitHub, cmake } :
+
+stdenv.mkDerivation rec {
+  pname = "spglib";
+  version = "1.16.2";
+
+  src = fetchFromGitHub {
+    owner = "atztogo";
+    repo = "spglib";
+    rev = "v${version}";
+    sha256 = "1sbrk26xyvlhqxxv9cq2ycxwbiafgmh7lf221377zpqq8q3iavd7";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  checkTarget = "check";
+  doCheck = true;
+
+  meta = with lib; {
+    description = "C library for finding and handling crystal symmetries";
+    homepage = "https://atztogo.github.io/spglib/";
+    license = licenses.bsd3;
+    maintainers = [ maintainers.markuskowa ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sphinxbase/default.nix b/nixpkgs/pkgs/development/libraries/sphinxbase/default.nix
new file mode 100644
index 000000000000..a7d59cd8bf6f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sphinxbase/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv
+, fetchurl
+, bison
+, pkg-config
+, python27 # >= 2.6
+, swig2 # 2.0
+, multipleOutputs ? false #Uses incomplete features of nix!
+}:
+
+stdenv.mkDerivation (rec {
+  name = "sphinxbase-5prealpha";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/cmusphinx/${name}.tar.gz";
+    sha256 = "0vr4k8pv5a8nvq9yja7kl13b5lh0f9vha8fc8znqnm8bwmcxnazp";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ swig2 python27 bison ];
+
+  meta = {
+    description = "Support Library for Pocketsphinx";
+    homepage = "http://cmusphinx.sourceforge.net";
+    license = lib.licenses.bsd2;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ ];
+  };
+
+} // (lib.optionalAttrs multipleOutputs {
+  outputs = [ "out" "lib" "headers" ];
+
+  postInstall = ''
+    mkdir -p $lib
+    cp -av $out/lib* $lib
+
+    mkdir -p $headers
+    cp -av $out/include $headers
+  '';
+}))
diff --git a/nixpkgs/pkgs/development/libraries/spice-gtk/default.nix b/nixpkgs/pkgs/development/libraries/spice-gtk/default.nix
new file mode 100644
index 000000000000..3d76e67f67ad
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spice-gtk/default.nix
@@ -0,0 +1,135 @@
+{ lib, stdenv
+, fetchurl
+, acl
+, cyrus_sasl
+, docbook_xsl
+, epoxy
+, gettext
+, gobject-introspection
+, gst_all_1
+, gtk-doc
+, gtk3
+, json-glib
+, libcacard
+, libdrm
+, libjpeg_turbo
+, libopus
+, libsoup
+, libusb1
+, lz4
+, meson
+, ninja
+, openssl
+, perl
+, phodav
+, pixman
+, pkg-config
+, polkit
+, python3
+, spice-protocol
+, usbredir
+, usbutils
+, vala
+, zlib
+, withPolkit ? true
+}:
+
+# If this package is built with polkit support (withPolkit=true),
+# usb redirection reqires spice-client-glib-usb-acl-helper to run setuid root.
+# The helper confirms via polkit that the user has an active session,
+# then adds a device acl entry for that user.
+# Example NixOS config to create a setuid wrapper for the helper:
+# security.wrappers.spice-client-glib-usb-acl-helper.source =
+#   "${pkgs.spice-gtk}/bin/spice-client-glib-usb-acl-helper";
+# On non-NixOS installations, make a setuid copy of the helper
+# outside the store and adjust PATH to find the setuid version.
+
+# If this package is built without polkit support (withPolkit=false),
+# usb redirection requires read-write access to usb devices.
+# This can be granted by adding users to a custom group like "usb"
+# and using a udev rule to put all usb devices in that group.
+# Example NixOS config:
+#  users.groups.usb = {};
+#  users.users.dummy.extraGroups = [ "usb" ];
+#  services.udev.extraRules = ''
+#    KERNEL=="*", SUBSYSTEMS=="usb", MODE="0664", GROUP="usb"
+#  '';
+
+stdenv.mkDerivation rec {
+  pname = "spice-gtk";
+  version = "0.37";
+
+  outputs = [ "out" "dev" "devdoc" "man" ];
+
+  src = fetchurl {
+    url = "https://www.spice-space.org/download/gtk/${pname}-${version}.tar.bz2";
+    sha256 = "1drvj8y35gnxbnrxsipwi15yh0vs9ixzv4wslz6r3lra8w3bfa0z";
+  };
+
+  postPatch = ''
+    # get rid of absolute path to helper in store so we can use a setuid wrapper
+    substituteInPlace src/usb-acl-helper.c \
+      --replace 'ACL_HELPER_PATH"/' '"'
+  '';
+
+  nativeBuildInputs = [
+    docbook_xsl
+    gettext
+    gobject-introspection
+    gtk-doc
+    libsoup
+    meson
+    ninja
+    perl
+    pkg-config
+    python3
+    python3.pkgs.pyparsing
+    python3.pkgs.six
+    vala
+  ];
+
+  propagatedBuildInputs = [
+    gst_all_1.gst-plugins-base gst_all_1.gst-plugins-good
+  ];
+
+  buildInputs = [
+    cyrus_sasl
+    epoxy
+    gtk3
+    json-glib
+    libcacard
+    libdrm
+    libjpeg_turbo
+    libopus
+    libusb1
+    lz4
+    openssl
+    phodav
+    pixman
+    spice-protocol
+    usbredir
+    zlib
+  ] ++ lib.optionals withPolkit [ polkit acl usbutils ] ;
+
+  PKG_CONFIG_POLKIT_GOBJECT_1_POLICYDIR = "${placeholder "out"}/share/polkit-1/actions";
+
+  mesonFlags = [
+    "-Dcelt051=disabled"
+    "-Dpulse=disabled" # is deprecated upstream
+  ];
+
+  meta = with lib; {
+    description = "GTK 3 SPICE widget";
+    longDescription = ''
+      spice-gtk is a GTK 3 SPICE widget. It features glib-based
+      objects for SPICE protocol parsing and a gtk widget for embedding
+      the SPICE display into other applications such as virt-manager.
+      Python bindings are available too.
+    '';
+
+    homepage = "https://www.spice-space.org/";
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.xeji ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/spice-protocol/default.nix b/nixpkgs/pkgs/development/libraries/spice-protocol/default.nix
new file mode 100644
index 000000000000..12eb03b6d63f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spice-protocol/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchurl, meson, ninja }:
+
+stdenv.mkDerivation rec {
+  pname = "spice-protocol";
+  version = "0.14.3";
+
+  src = fetchurl {
+    url = "https://www.spice-space.org/download/releases/${pname}-${version}.tar.xz";
+    sha256 = "0yj8k7gcirrsf21w0q6146n5g4nzn2pqky4p90n5760m5ayfb1pr";
+  };
+
+  nativeBuildInputs = [ meson ninja ];
+
+  postInstall = ''
+    mkdir -p $out/lib
+    ln -sv ../share/pkgconfig $out/lib/pkgconfig
+  '';
+
+  meta = with lib; {
+    description = "Protocol headers for the SPICE protocol";
+    homepage = "https://www.spice-space.org/";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ bluescreen303 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/spice/default.nix b/nixpkgs/pkgs/development/libraries/spice/default.nix
new file mode 100644
index 000000000000..33677303ddcb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spice/default.nix
@@ -0,0 +1,98 @@
+{ lib, stdenv
+, fetchurl
+, meson
+, ninja
+, pkg-config
+, pixman
+, alsa-lib
+, openssl
+, libXrandr
+, libXfixes
+, libXext
+, libXrender
+, libXinerama
+, libjpeg
+, zlib
+, spice-protocol
+, python3
+, glib
+, cyrus_sasl
+, libcacard
+, lz4
+, libopus
+, gst_all_1
+, orc
+}:
+
+stdenv.mkDerivation rec {
+  pname = "spice";
+  version = "0.15.0";
+
+  src = fetchurl {
+    url = "https://www.spice-space.org/download/releases/spice-server/${pname}-${version}.tar.bz2";
+    sha256 = "1xd0xffw0g5vvwbq4ksmm3jjfq45f9dw20xpmi82g1fj9f7wy85k";
+  };
+
+  postPatch = ''
+    patchShebangs build-aux
+  '';
+
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+    spice-protocol
+    python3
+    python3.pkgs.six
+    python3.pkgs.pyparsing
+  ];
+
+  buildInputs = [
+    alsa-lib
+    cyrus_sasl
+    glib
+    gst_all_1.gst-plugins-base
+    libXext
+    libXfixes
+    libXinerama
+    libXrandr
+    libXrender
+    libcacard
+    libjpeg
+    libopus
+    lz4
+    openssl
+    orc
+    pixman
+    python3.pkgs.pyparsing
+    zlib
+  ];
+
+  NIX_CFLAGS_COMPILE = "-fno-stack-protector";
+
+  mesonFlags = [
+    "-Dgstreamer=1.0"
+    "-Dcelt051=disabled"
+  ];
+
+  postInstall = ''
+    ln -s spice-server $out/include/spice
+  '';
+
+  meta = with lib; {
+    description = "Complete open source solution for interaction with virtualized desktop devices";
+    longDescription = ''
+      The Spice project aims to provide a complete open source solution for interaction
+      with virtualized desktop devices.The Spice project deals with both the virtualized
+      devices and the front-end. Interaction between front-end and back-end is done using
+      VD-Interfaces. The VD-Interfaces (VDI) enable both ends of the solution to be easily
+      utilized by a third-party component.
+    '';
+    homepage = "https://www.spice-space.org/";
+    license = licenses.lgpl21;
+
+    maintainers = [ maintainers.bluescreen303 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/spirv-headers/default.nix b/nixpkgs/pkgs/development/libraries/spirv-headers/default.nix
new file mode 100644
index 000000000000..9d464f7300ae
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/spirv-headers/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "spirv-headers";
+  version = "1.5.3";
+
+  src = fetchFromGitHub {
+    owner = "KhronosGroup";
+    repo = "SPIRV-Headers";
+    rev = version;
+    sha256 = "069sivqajp7z4p44lmrz23lvf237xpkjxd4lzrg27836pwqcz9bj";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    inherit (src.meta) homepage;
+    description = "Machine-readable components of the Khronos SPIR-V Registry";
+    license = licenses.mit;
+    maintainers = [ maintainers.ralith ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sqlcipher/default.nix b/nixpkgs/pkgs/development/libraries/sqlcipher/default.nix
new file mode 100644
index 000000000000..1874e3d82552
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sqlcipher/default.nix
@@ -0,0 +1,38 @@
+{ stdenv, lib, fetchFromGitHub, openssl, tcl, installShellFiles, buildPackages, readline ? null, ncurses ? null }:
+
+assert readline != null -> ncurses != null;
+
+stdenv.mkDerivation rec {
+  pname = "sqlcipher";
+  version = "4.4.3";
+
+  src = fetchFromGitHub {
+    owner = "sqlcipher";
+    repo = "sqlcipher";
+    rev = "v${version}";
+    sha256 = "sha256-E23PTNnVZbBQtHL0YjUwHNVUA76XS8rlARBOVvX6zZw=";
+  };
+
+  nativeBuildInputs = [ installShellFiles tcl ];
+  buildInputs = [ readline ncurses openssl ];
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
+
+  configureFlags = [ "--enable-threadsafe" "--disable-tcl" ];
+
+  CFLAGS = [ "-DSQLITE_ENABLE_COLUMN_METADATA=1" "-DSQLITE_SECURE_DELETE=1" "-DSQLITE_ENABLE_UNLOCK_NOTIFY=1" "-DSQLITE_HAS_CODEC" ];
+  LDFLAGS = lib.optional (readline != null) "-lncurses";
+  BUILD_CC = "$(CC_FOR_BUILD)";
+
+  doCheck = false; # fails. requires tcl?
+
+  postInstall = ''
+    installManPage sqlcipher.1
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.zetetic.net/sqlcipher/";
+    description = "SQLite extension that provides 256 bit AES encryption of database files";
+    platforms = platforms.unix;
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sqlite/archive-version.nix b/nixpkgs/pkgs/development/libraries/sqlite/archive-version.nix
new file mode 100644
index 000000000000..75d70680fbf9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sqlite/archive-version.nix
@@ -0,0 +1,11 @@
+lib: version:
+
+with lib;
+
+let
+  fragments = splitVersion version;
+  major = head fragments;
+  minor = concatMapStrings (fixedWidthNumber 2) (tail fragments);
+in
+
+major + minor + "00"
diff --git a/nixpkgs/pkgs/development/libraries/sqlite/default.nix b/nixpkgs/pkgs/development/libraries/sqlite/default.nix
new file mode 100644
index 000000000000..e2331d89751a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sqlite/default.nix
@@ -0,0 +1,95 @@
+{ lib, stdenv, fetchurl, zlib, interactive ? false, readline ? null, ncurses ? null
+, python3Packages
+}:
+
+assert interactive -> readline != null && ncurses != null;
+
+with lib;
+
+let
+  archiveVersion = import ./archive-version.nix lib;
+in
+
+stdenv.mkDerivation rec {
+  pname = "sqlite";
+  version = "3.35.5";
+
+  # NB! Make sure to update ./tools.nix src (in the same directory).
+  src = fetchurl {
+    url = "https://sqlite.org/2021/sqlite-autoconf-${archiveVersion version}.tar.gz";
+    sha256 = "9StypcMZw+UW7XqS4SMTmm6Hrwii3EPXdXck9hMubbA=";
+  };
+
+  outputs = [ "bin" "dev" "out" ];
+  separateDebugInfo = stdenv.isLinux;
+
+  buildInputs = [ zlib ] ++ optionals interactive [ readline ncurses ];
+
+  # required for aarch64 but applied for all arches for simplicity
+  preConfigure = ''
+    patchShebangs configure
+  '';
+
+  configureFlags = [ "--enable-threadsafe" ] ++ optional interactive "--enable-readline";
+
+  NIX_CFLAGS_COMPILE = toString [
+    "-DSQLITE_ENABLE_COLUMN_METADATA"
+    "-DSQLITE_ENABLE_DBSTAT_VTAB"
+    "-DSQLITE_ENABLE_JSON1"
+    "-DSQLITE_ENABLE_FTS3"
+    "-DSQLITE_ENABLE_FTS3_PARENTHESIS"
+    "-DSQLITE_ENABLE_FTS3_TOKENIZER"
+    "-DSQLITE_ENABLE_FTS4"
+    "-DSQLITE_ENABLE_FTS5"
+    "-DSQLITE_ENABLE_RTREE"
+    "-DSQLITE_ENABLE_STMT_SCANSTATUS"
+    "-DSQLITE_ENABLE_UNLOCK_NOTIFY"
+    "-DSQLITE_SOUNDEX"
+    "-DSQLITE_SECURE_DELETE"
+    "-DSQLITE_MAX_VARIABLE_NUMBER=250000"
+    "-DSQLITE_MAX_EXPR_DEPTH=10000"
+  ];
+
+  # Test for features which may not be available at compile time
+  preBuild = ''
+    # Use pread(), pread64(), pwrite(), pwrite64() functions for better performance if they are available.
+    if cc -Werror=implicit-function-declaration -x c - -o "$TMPDIR/pread_pwrite_test" <<< \
+      ''$'#include <unistd.h>\nint main()\n{\n  pread(0, NULL, 0, 0);\n  pwrite(0, NULL, 0, 0);\n  return 0;\n}'; then
+      export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -DUSE_PREAD"
+    fi
+    if cc -Werror=implicit-function-declaration -x c - -o "$TMPDIR/pread64_pwrite64_test" <<< \
+      ''$'#include <unistd.h>\nint main()\n{\n  pread64(0, NULL, 0, 0);\n  pwrite64(0, NULL, 0, 0);\n  return 0;\n}'; then
+      export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -DUSE_PREAD64"
+    elif cc -D_LARGEFILE64_SOURCE -Werror=implicit-function-declaration -x c - -o "$TMPDIR/pread64_pwrite64_test" <<< \
+      ''$'#include <unistd.h>\nint main()\n{\n  pread64(0, NULL, 0, 0);\n  pwrite64(0, NULL, 0, 0);\n  return 0;\n}'; then
+      export NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE -DUSE_PREAD64 -D_LARGEFILE64_SOURCE"
+    fi
+
+    # Necessary for FTS5 on Linux
+    export NIX_LDFLAGS="$NIX_LDFLAGS -lm"
+
+    echo ""
+    echo "NIX_CFLAGS_COMPILE = $NIX_CFLAGS_COMPILE"
+    echo ""
+  '';
+
+  postInstall = ''
+    # Do not contaminate dependent libtool-based projects with sqlite dependencies.
+    sed -i $out/lib/libsqlite3.la -e "s/dependency_libs=.*/dependency_libs='''/"
+  '';
+
+  doCheck = false; # fails to link against tcl
+
+  passthru.tests = {
+    inherit (python3Packages) sqlalchemy;
+  };
+
+  meta = {
+    description = "A self-contained, serverless, zero-configuration, transactional SQL database engine";
+    downloadPage = "https://sqlite.org/download.html";
+    homepage = "https://www.sqlite.org/";
+    license = licenses.publicDomain;
+    maintainers = with maintainers; [ eelco np ];
+    platforms = platforms.unix ++ platforms.windows;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sqlite/sqlar.nix b/nixpkgs/pkgs/development/libraries/sqlite/sqlar.nix
new file mode 100644
index 000000000000..9063879b7e37
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sqlite/sqlar.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, fuse, zlib
+, withFuse ? true }:
+
+stdenv.mkDerivation {
+  pname = "sqlar";
+  version = "2018-01-07";
+
+  src = fetchurl {
+    url = "https://www.sqlite.org/sqlar/tarball/4824e73896/sqlar-src-4824e73896.tar.gz";
+    sha256 = "09pikkbp93gqypn3da9zi0dzc47jyypkwc9vnmfzhmw7kpyv8nm9";
+  };
+
+  postPatch = ''
+    substituteInPlace Makefile \
+      --replace 'gcc' '${stdenv.cc.targetPrefix}cc'
+  '';
+
+  buildInputs = [ zlib ]
+    ++ lib.optional withFuse fuse;
+
+  buildFlags = [ "CFLAGS=-Wno-error" "sqlar" ]
+    ++ lib.optional withFuse "sqlarfs";
+
+  installPhase = ''
+    install -D -t $out/bin sqlar
+  '' + lib.optionalString withFuse ''
+    install -D -t $out/bin sqlarfs
+  '';
+
+  meta = with lib; {
+    homepage = "https://sqlite.org/sqlar";
+    description = "SQLite Archive utilities";
+    license = licenses.bsd2;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sqlite/tools.nix b/nixpkgs/pkgs/development/libraries/sqlite/tools.nix
new file mode 100644
index 000000000000..6c89a8496e8d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sqlite/tools.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchurl, unzip, sqlite, tcl, Foundation }:
+
+let
+  archiveVersion = import ./archive-version.nix lib;
+  mkTool = { pname, makeTarget, description, homepage }: stdenv.mkDerivation rec {
+    inherit pname;
+    version = "3.35.5";
+
+    src = assert version == sqlite.version; fetchurl {
+      url = "https://sqlite.org/2021/sqlite-src-${archiveVersion version}.zip";
+      sha256 = "049vdpk50sba786345ibmlxnkzk5zp4xj859658ancswb6jyrgpl";
+    };
+
+    nativeBuildInputs = [ unzip ];
+    buildInputs = [ tcl ] ++ lib.optional stdenv.isDarwin Foundation;
+
+    makeFlags = [ makeTarget ];
+
+    installPhase = "install -Dt $out/bin ${makeTarget}";
+
+    meta = with lib; {
+      inherit description homepage;
+      downloadPage = http://sqlite.org/download.html;
+      license = licenses.publicDomain;
+      maintainers = with maintainers; [ johnazoidberg ];
+      platforms = platforms.unix;
+    };
+  };
+in
+{
+  sqldiff = mkTool {
+    pname = "sqldiff";
+    makeTarget = "sqldiff";
+    description = "A tool that displays the differences between SQLite databases";
+    homepage = "https://www.sqlite.org/sqldiff.html";
+  };
+  sqlite-analyzer = mkTool {
+    pname = "sqlite-analyzer";
+    makeTarget = "sqlite3_analyzer";
+    description = "A tool that shows statistics about SQLite databases";
+    homepage = "https://www.sqlite.org/sqlanalyze.html";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sqlitecpp/default.nix b/nixpkgs/pkgs/development/libraries/sqlitecpp/default.nix
new file mode 100644
index 000000000000..60724aaa8046
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sqlitecpp/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, cmake, sqlite, cppcheck, gtest }:
+
+stdenv.mkDerivation rec {
+  pname = "sqlitecpp";
+  version = "3.1.1";
+
+  src = fetchFromGitHub {
+    owner = "SRombauts";
+    repo = pname;
+    rev = version;
+    sha256 = "1c2yyipiqswi5sf9xmpsgw6l1illzmcpkjm56agk6kl2hay23lgr";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  checkInputs = [ cppcheck gtest ];
+  buildInputs = [ sqlite ];
+  doCheck = true;
+
+  cmakeFlags = [
+    "-DSQLITECPP_INTERNAL_SQLITE=OFF"
+    "-DSQLITECPP_BUILD_TESTS=ON"
+  ];
+
+  meta = with lib; {
+    homepage = "https://srombauts.github.io/SQLiteCpp/";
+    description = "C++ SQLite3 wrapper";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.jbedo maintainers.doronbehar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/srt/default.nix b/nixpkgs/pkgs/development/libraries/srt/default.nix
new file mode 100644
index 000000000000..49c761231015
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/srt/default.nix
@@ -0,0 +1,38 @@
+{ lib, stdenv, fetchFromGitHub, cmake, openssl
+}:
+
+with lib;
+stdenv.mkDerivation rec {
+  pname = "srt";
+  version = "1.4.3";
+
+  src = fetchFromGitHub {
+    owner = "Haivision";
+    repo = "srt";
+    rev = "v${version}";
+    sha256 = "1f60vlfxhh9bhafws82c3301whjlz5gy92jz9a9ymwfg5h53bv1j";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  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
+    "-UCMAKE_INSTALL_LIBDIR"
+  ];
+
+  meta = {
+    description = "Secure, Reliable, Transport";
+    homepage    = "https://github.com/Haivision/srt";
+    license     = licenses.mpl20;
+    maintainers = with maintainers; [ nh2 ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/srtp/default.nix b/nixpkgs/pkgs/development/libraries/srtp/default.nix
new file mode 100644
index 000000000000..0dbfef2c6394
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/srtp/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config
+, openssl ? null, libpcap ? null
+}:
+
+with lib;
+stdenv.mkDerivation rec {
+  pname = "libsrtp";
+  version = "2.3.0";
+
+  src = fetchFromGitHub {
+    owner = "cisco";
+    repo = "libsrtp";
+    rev = "v${version}";
+    sha256 = "1f7i3jdh1wzdv7zjlz7gs3xw5jqig9zw8z9awsqqcp54f94xdpvd";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  # libsrtp.pc references -lcrypto -lpcap without -L
+  propagatedBuildInputs = [ openssl libpcap ];
+
+  configureFlags = [
+    "--disable-debug"
+  ] ++ optional (openssl != null) "--enable-openssl";
+
+  buildFlags = [ "shared_library" ];
+
+  postInstall = ''
+    rm -rf $out/bin
+  '';
+
+  meta = {
+    homepage = "https://github.com/cisco/libsrtp";
+    description = "Secure RTP (SRTP) Reference Implementation";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/startup-notification/default.nix b/nixpkgs/pkgs/development/libraries/startup-notification/default.nix
new file mode 100644
index 000000000000..001123ead60f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/startup-notification/default.nix
@@ -0,0 +1,23 @@
+{lib, stdenv, fetchurl, libX11, libxcb, pkg-config, xcbutil}:
+
+stdenv.mkDerivation rec {
+  pname = "libstartup-notification";
+  version = "0.12";
+  src = fetchurl {
+    url = "https://www.freedesktop.org/software/startup-notification/releases/startup-notification-${version}.tar.gz";
+    sha256 = "3c391f7e930c583095045cd2d10eb73a64f085c7fde9d260f2652c7cb3cfbe4a";
+  };
+
+  configureFlags = lib.optionals (stdenv.buildPlatform != stdenv.targetPlatform) [
+    "lf_cv_sane_realloc=yes"
+  ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libX11 libxcb xcbutil ];
+
+  meta = {
+    homepage = "http://www.freedesktop.org/software/startup-notification";
+    description = "Application startup notification and feedback library";
+    license = lib.licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/stb/default.nix b/nixpkgs/pkgs/development/libraries/stb/default.nix
new file mode 100644
index 000000000000..a3020e14d3e1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/stb/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation {
+  pname = "stb";
+  version = "20180211";
+
+  src = fetchFromGitHub {
+    owner = "nothings";
+    repo = "stb";
+    rev = "e6afb9cbae4064da8c3e69af3ff5c4629579c1d2";
+    sha256 = "079nsn9bnb8c0vfq26g5l53q6gzx19a5x9q2nb55mpcljxsgxnmf";
+  };
+
+  dontBuild = true;
+
+  installPhase = ''
+    mkdir -p $out/include/stb
+    cp *.h $out/include/stb/
+  '';
+
+  meta = with lib; {
+    description = "Single-file public domain libraries for C/C++";
+    homepage = "https://github.com/nothings/stb";
+    license = licenses.publicDomain;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ jfrankenau ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/stfl/default.nix b/nixpkgs/pkgs/development/libraries/stfl/default.nix
new file mode 100644
index 000000000000..20676c16b9c6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/stfl/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl, ncurses, libiconv }:
+
+stdenv.mkDerivation rec {
+  name = "stfl-0.24";
+
+  src = fetchurl {
+    url = "http://www.clifford.at/stfl/${name}.tar.gz";
+    sha256 = "1460d5lc780p3q38l3wc9jfr2a7zlyrcra0li65aynj738cam9yl";
+  };
+
+  buildInputs = [ ncurses libiconv ];
+
+  buildPhase = ''
+    sed -i s/gcc/cc/g Makefile
+    sed -i s%ncursesw/ncurses.h%ncurses.h% stfl_internals.h
+  '' + ( lib.optionalString stdenv.isDarwin ''
+    sed -i s/-soname/-install_name/ Makefile
+  '' ) + ''
+    make
+  '';
+
+  installPhase = ''
+    DESTDIR=$out prefix=\"\" make install
+
+    # some programs rely on libstfl.so.0 to be present, so link it
+    ln -s $out/lib/libstfl.so.0.24 $out/lib/libstfl.so.0
+  '';
+
+  meta = {
+    homepage    = "http://www.clifford.at/stfl/";
+    description = "A library which implements a curses-based widget set for text terminals";
+    maintainers = with lib.maintainers; [ lovek323 ];
+    license     = lib.licenses.lgpl3;
+    platforms   = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/stlport/default.nix b/nixpkgs/pkgs/development/libraries/stlport/default.nix
new file mode 100644
index 000000000000..75004b87ee72
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/stlport/default.nix
@@ -0,0 +1,27 @@
+{lib, stdenv, fetchurl}:
+
+stdenv.mkDerivation rec {
+  pname = "STLport";
+  version = "5.2.1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/stlport/${pname}-${version}.tar.bz2";
+    sha256 = "1jbgak1m1qk7d4gyn1p2grbws2icsf7grbs3dh44ai9ck1xh0nvm";
+  };
+
+  # fix hardcoded /usr/bin; not recognizing the standard --disable-static flag
+  configurePhase = ''
+    echo Preconf: build/Makefiles/gmake/*/sys.mak
+    for f in build/Makefiles/gmake/*/sys.mak; do
+      substituteInPlace "$f" --replace /usr/bin/ ""
+    done
+    ./configure --prefix=$out
+  '';
+
+  meta = {
+    description = "An implementation of the C++ Standard Library";
+    homepage = "https://sourceforge.net/projects/stlport/";
+    license = lib.licenses.free; # seems BSD-like
+    broken = true; # probably glibc-2.20 -related issue
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/stxxl/default.nix b/nixpkgs/pkgs/development/libraries/stxxl/default.nix
new file mode 100644
index 000000000000..eec4f722d411
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/stxxl/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, cmake
+, parallel ? true
+}:
+
+let
+  mkFlag = optset: flag: if optset then "-D${flag}=ON" else "-D${flag}=OFF";
+in
+
+stdenv.mkDerivation rec {
+  pname = "stxxl";
+  version = "1.4.1";
+
+  src = fetchurl {
+    url = "https://github.com/stxxl/stxxl/archive/${version}.tar.gz";
+    sha256 = "54006a5fccd1435abc2f3ec201997a4d7dacddb984d2717f62191798e5372f6c";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DBUILD_STATIC_LIBS=OFF"
+    (mkFlag parallel "USE_GNU_PARALLEL")
+  ];
+
+  passthru = {
+    inherit parallel;
+  };
+
+  meta = with lib; {
+    description = "An implementation of the C++ standard template library STL for external memory (out-of-core) computations";
+    homepage = "https://github.com/stxxl/stxxl";
+    license = licenses.boost;
+    maintainers = with maintainers; [ ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/subunit/default.nix b/nixpkgs/pkgs/development/libraries/subunit/default.nix
new file mode 100644
index 000000000000..9cc61d200086
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/subunit/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, pkg-config, check, cppunit, perl, python3Packages }:
+
+# NOTE: for subunit python library see pkgs/top-level/python-packages.nix
+
+stdenv.mkDerivation rec {
+  pname = "subunit";
+  version = "1.4.0";
+
+  src = fetchurl {
+    url = "https://launchpad.net/subunit/trunk/${version}/+download/${pname}-${version}.tar.gz";
+    sha256 = "1h7i5ifcx20qkya24j11nbwa829klw7dvnlljdgivgvcx6b20y80";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ check cppunit perl python3Packages.wrapPython ];
+
+  propagatedBuildInputs = with python3Packages; [ testtools testscenarios ];
+
+  postFixup = "wrapPythonPrograms";
+
+  meta = with lib; {
+    description = "A streaming protocol for test results";
+    homepage = "https://launchpad.net/subunit";
+    license = licenses.asl20;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sundials/default.nix b/nixpkgs/pkgs/development/libraries/sundials/default.nix
new file mode 100644
index 000000000000..f04b22abe8c6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sundials/default.nix
@@ -0,0 +1,73 @@
+{ lib, stdenv
+, cmake
+, fetchurl
+, python
+, blas
+, lapack
+, gfortran
+, suitesparse
+, lapackSupport ? true
+, kluSupport ? true
+}:
+
+stdenv.mkDerivation rec {
+  pname = "sundials";
+  version = "5.7.0";
+
+  outputs = [ "out" "examples" ];
+
+  src = fetchurl {
+    url = "https://github.com/LLNL/sundials/releases/download/v${version}/sundials-${version}.tar.gz";
+    hash = "sha256-SNp7qoFS3bIq7RsC2C0du0+/6iKs9nY0ARqgMDoQCkM=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [
+    python
+  ]
+    ++ lib.optionals (lapackSupport)
+    # Check that the same index size is used for both libraries
+    (assert (blas.isILP64 == lapack.isILP64); [
+      gfortran
+      blas
+      lapack
+    ])
+  # KLU support is based on Suitesparse.
+  # It is tested upstream according to the section 1.1.4 of
+  # [INSTALL_GUIDE.pdf](https://raw.githubusercontent.com/LLNL/sundials/master/INSTALL_GUIDE.pdf)
+  ++ lib.optionals (kluSupport) [
+    suitesparse
+  ];
+
+  cmakeFlags = [
+    "-DEXAMPLES_INSTALL_PATH=${placeholder "examples"}/share/examples"
+  ] ++ lib.optionals (lapackSupport) [
+    "-DENABLE_LAPACK=ON"
+    "-DLAPACK_LIBRARIES=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
+  ] ++ lib.optionals (kluSupport) [
+    "-DENABLE_KLU=ON"
+    "-DKLU_INCLUDE_DIR=${suitesparse.dev}/include"
+    "-DKLU_LIBRARY_DIR=${suitesparse}/lib"
+  ] ++ [(
+    # Use the correct index type according to lapack and blas used. They are
+    # already supposed to be compatible but we check both for extra safety. 64
+    # should be the default but we prefer to be explicit, for extra safety.
+    if blas.isILP64 then
+      "-DSUNDIALS_INDEX_SIZE=64"
+    else
+      "-DSUNDIALS_INDEX_SIZE=32"
+  )]
+  ;
+
+  doCheck = true;
+  checkTarget = "test";
+
+  meta = with lib; {
+    description = "Suite of nonlinear differential/algebraic equation solvers";
+    homepage    = "https://computation.llnl.gov/projects/sundials";
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ idontgetoutmuch ];
+    license     = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/svrcore/default.nix b/nixpkgs/pkgs/development/libraries/svrcore/default.nix
new file mode 100644
index 000000000000..fbc17a5e7b21
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/svrcore/default.nix
@@ -0,0 +1,20 @@
+{ lib, stdenv, fetchurl, pkg-config, nss, nspr }:
+
+stdenv.mkDerivation rec {
+  pname = "svrcore";
+  version = "4.0.4";
+
+  src = fetchurl {
+    url = "mirror://mozilla/directory/svrcore/releases/${version}/src/${pname}-${version}.tar.bz2";
+    sha256 = "0n3alg6bxml8952fb6h0bi0l29farvq21q6k20gy2ba90m3znwj7";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ nss nspr ];
+
+  meta = with lib; {
+    description = "Secure PIN handling using NSS crypto";
+    license = licenses.mpl11;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/swiften/build-fix.patch b/nixpkgs/pkgs/development/libraries/swiften/build-fix.patch
new file mode 100644
index 000000000000..01814cadfbd4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/swiften/build-fix.patch
@@ -0,0 +1,32 @@
+diff -wbBur swift-4.0.2/Swift/QtUI/UserSearch/QtUserSearchWindow.h swift-4.0.2.my/Swift/QtUI/UserSearch/QtUserSearchWindow.h
+--- swift-4.0.2/Swift/QtUI/UserSearch/QtUserSearchWindow.h	2018-04-06 13:06:46.000000000 +0300
++++ swift-4.0.2.my/Swift/QtUI/UserSearch/QtUserSearchWindow.h	2019-10-08 20:52:23.171475337 +0300
+@@ -9,6 +9,7 @@
+ #include <set>
+ 
+ #include <QWizard>
++#include <QAbstractItemModel>
+ 
+ #include <Swiften/Base/Override.h>
+ 
+diff -wbBur swift-4.0.2/Swiften/Network/PlatformNATTraversalWorker.cpp swift-4.0.2.my/Swiften/Network/PlatformNATTraversalWorker.cpp
+--- swift-4.0.2/Swiften/Network/PlatformNATTraversalWorker.cpp	2018-04-06 13:06:46.000000000 +0300
++++ swift-4.0.2.my/Swiften/Network/PlatformNATTraversalWorker.cpp	2019-10-08 21:12:25.284754131 +0300
+@@ -157,7 +157,7 @@
+         miniUPnPInterface = new MiniUPnPInterface();
+         miniUPnPSupported = miniUPnPInterface->isAvailable();
+     }
+-    SWIFT_LOG(debug) << "UPnP NAT traversal supported: " << miniUPnPSupported << std::endl;
++//    SWIFT_LOG(debug) << "UPnP NAT traversal supported: " << miniUPnPSupported << std::endl;
+     if (miniUPnPSupported) {
+         return miniUPnPInterface;
+     }
+@@ -168,7 +168,7 @@
+         natPMPInterface = new NATPMPInterface();
+         natPMPSupported = natPMPInterface->isAvailable();
+     }
+-    SWIFT_LOG(debug) << "NAT-PMP NAT traversal supported: " << natPMPSupported << std::endl;
++//    SWIFT_LOG(debug) << "NAT-PMP NAT traversal supported: " << natPMPSupported << std::endl;
+     if (natPMPSupported) {
+         return natPMPInterface;
+     }
diff --git a/nixpkgs/pkgs/development/libraries/swiften/default.nix b/nixpkgs/pkgs/development/libraries/swiften/default.nix
new file mode 100644
index 000000000000..980d034682f5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/swiften/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, python, fetchurl, openssl, boost, sconsPackages }:
+stdenv.mkDerivation rec {
+  pname = "swiften";
+  version = "4.0.2";
+
+  nativeBuildInputs = [ sconsPackages.scons_3_1_2 ];
+  buildInputs           = [ python ];
+  propagatedBuildInputs = [ openssl boost ];
+
+  src = fetchurl {
+    url    = "https://swift.im/downloads/releases/swift-${version}/swift-${version}.tar.gz";
+    sha256 = "0w0aiszjd58ynxpacwcgf052zpmbpcym4dhci64vbfgch6wryz0w";
+  };
+
+  patches = [ ./scons.patch ./build-fix.patch ];
+
+  sconsFlags = [
+    "openssl=${openssl.dev}"
+    "boost_includedir=${boost.dev}/include"
+    "boost_libdir=${boost.out}/lib"
+    "boost_bundled_enable=false"
+    "max_jobs=1"
+    "optimize=1"
+    "debug=0"
+    "swiften_dll=1"
+  ];
+  preInstall = ''
+    installTargets="$out"
+    installFlags+=" SWIFTEN_INSTALLDIR=$out"
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "An XMPP library for C++, used by the Swift client";
+    homepage    = "http://swift.im/swiften.html";
+    license     = licenses.gpl2Plus;
+    platforms   = platforms.linux;
+    maintainers = [ maintainers.twey ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/swiften/scons.patch b/nixpkgs/pkgs/development/libraries/swiften/scons.patch
new file mode 100644
index 000000000000..d956767696d0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/swiften/scons.patch
@@ -0,0 +1,9 @@
+--- a/BuildTools/SCons/SConscript.boot
++++ b/BuildTools/SCons/SConscript.boot
+@@ -129,5 +129 @@ vars.Add(PathVariable("sparkle_public_dsa_key", "Optional path to a public DSA k
+-env_ENV = {
+-    'PATH' : os.environ['PATH'],
+-    'LD_LIBRARY_PATH' : os.environ.get("LD_LIBRARY_PATH", ""),
+-    'TERM' : os.environ.get("TERM", ""),
+-}
++env_ENV = os.environ
diff --git a/nixpkgs/pkgs/development/libraries/swiftshader/default.nix b/nixpkgs/pkgs/development/libraries/swiftshader/default.nix
new file mode 100644
index 000000000000..2c508a3735f9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/swiftshader/default.nix
@@ -0,0 +1,63 @@
+{ lib, stdenv, fetchgit, python3, cmake, jq, libX11, libXext, zlib }:
+
+stdenv.mkDerivation rec {
+  pname = "swiftshader";
+  version = "2020-11-06";
+
+  src = fetchgit {
+    url = "https://swiftshader.googlesource.com/SwiftShader";
+    rev = "4ed9d3498dcffa987acba1a8007ff8dec336f263";
+    sha256 = "1gz2zflfacxf34s78djddf93brn9kyxj4byc4p2ip1pin43lh2lg";
+  };
+
+  nativeBuildInputs = [ cmake python3 jq ];
+  buildInputs = [ libX11 libXext zlib ];
+
+  # Make sure we include the drivers and icd files in the output as the cmake
+  # generated install command only puts in the spirv-tools stuff.
+  installPhase = ''
+    runHook preInstall
+
+    #
+    # Vulkan driver
+    #
+    vk_so_path="$out/lib/libvk_swiftshader.so"
+    mkdir -p "$(dirname "$vk_so_path")"
+    mv Linux/libvk_swiftshader.so "$vk_so_path"
+
+    vk_icd_json="$out/share/vulkan/icd.d/vk_swiftshader_icd.json"
+    mkdir -p "$(dirname "$vk_icd_json")"
+    jq ".ICD.library_path = \"$vk_so_path\"" <Linux/vk_swiftshader_icd.json >"$vk_icd_json"
+
+    #
+    # GL driver
+    #
+    gl_so_path="$out/lib/libEGL.so"
+    mkdir -p "$(dirname "$gl_so_path")"
+    mv Linux/libEGL.so "$gl_so_path"
+
+    gl_icd_json="$out/share/glvnd/egl_vendor.d/swiftshader.json"
+    mkdir -p "$(dirname "$gl_icd_json")"
+    cat >"$gl_icd_json" <<EOF
+    {
+      "file_format_version" : "1.0.0",
+      "ICD" : {
+          "library_path" : "$gl_so_path"
+      }
+    }
+    EOF
+
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description =
+      "A high-performance CPU-based implementation of the Vulkan, OpenGL ES, and Direct3D 9 graphics APIs";
+    homepage = "https://opensource.google/projects/swiftshader";
+    license = licenses.asl20;
+    # Should be possible to support Darwin by changing the install phase with
+    # 's/Linux/Darwin/' and 's/so/dylib/' or something similar.
+    platforms = [ "i686-linux" "x86_64-linux" "armv7l-linux" "mipsel-linux" ];
+    maintainers = with maintainers; [ expipiplus1 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/sword/default.nix b/nixpkgs/pkgs/development/libraries/sword/default.nix
new file mode 100644
index 000000000000..35c1e6e15e29
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sword/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchurl, pkg-config, icu, clucene_core, curl }:
+
+stdenv.mkDerivation rec {
+
+  pname = "sword";
+  version = "1.8.1";
+
+  src = fetchurl {
+    url = "https://www.crosswire.org/ftpmirror/pub/sword/source/v1.8/${pname}-${version}.tar.gz";
+    sha256 = "14syphc47g6svkbg018nrsgq4z6hid1zydax243g8dx747vsi6nf";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ icu clucene_core curl ];
+
+  prePatch = ''
+    patchShebangs .;
+  '';
+
+  configureFlags = [ "--without-conf" "--enable-tests=no" ];
+  CXXFLAGS = [
+    "-Wno-unused-but-set-variable"
+    # compat with icu61+ https://github.com/unicode-org/icu/blob/release-64-2/icu4c/readme.html#L554
+    "-DU_USING_ICU_NAMESPACE=1"
+  ];
+
+  meta = with lib; {
+    description = "A software framework that allows research manipulation of Biblical texts";
+    homepage = "http://www.crosswire.org/sword/";
+    longDescription = ''
+      The SWORD Project is the CrossWire Bible Society's free Bible software
+      project. Its purpose is to create cross-platform open-source tools --
+      covered by the GNU General Public License -- that allow programmers and
+      Bible societies to write new Bible software more quickly and easily. We
+      also create Bible study software for all readers, students, scholars, and
+      translators of the Bible, and have a growing collection of many hundred
+      texts in around 100 languages.
+    '';
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ piotr AndersonTorres ];
+    platforms = platforms.unix;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/sycl-info/default.nix b/nixpkgs/pkgs/development/libraries/sycl-info/default.nix
new file mode 100644
index 000000000000..9d86017e084e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/sycl-info/default.nix
@@ -0,0 +1,57 @@
+{ lib, stdenv
+, fetchFromGitHub
+, installShellFiles
+, cmake
+, ninja
+, ocl-icd
+, opencl-headers
+, lyra
+, nlohmann_json
+, ronn
+, doctest
+}:
+
+stdenv.mkDerivation rec {
+  pname = "sycl-info";
+  version = "unstable-2019-11-19";
+
+  src = fetchFromGitHub {
+    owner = "codeplaysoftware";
+    repo = "sycl-info";
+    rev = "b47d498ee2d6b77ec21972de5882e8e12efecd6c";
+    sha256 = "0fy0y1rcfb11p3vijd8wym6xkaicav49pv2bv2l18rma929n1m1m";
+  };
+
+  buildInputs = [
+    nlohmann_json
+    ronn
+    opencl-headers
+    ocl-icd
+    doctest
+    lyra
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    ninja
+  ];
+
+  cmakeFlags = [
+    "-DBUILD_TESTING=ON"
+    "-DBUILD_DOCS=ON"
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DLYRA_INCLUDE_DIRS=${lib.getDev lyra}/include"
+  ];
+
+  # Required for ronn to compile the manpage.
+  RUBYOPT = "-KU -E utf-8:utf-8";
+
+  meta = with lib;
+    {
+      homepage = "https://github.com/codeplaysoftware/sycl-info";
+      description = "Tool to show information about available SYCL implementations";
+      platforms = platforms.linux;
+      license = licenses.asl20;
+      maintainers = with maintainers; [ davidtwco ];
+    };
+}
diff --git a/nixpkgs/pkgs/development/libraries/symengine/default.nix b/nixpkgs/pkgs/development/libraries/symengine/default.nix
new file mode 100644
index 000000000000..01ec3a4fba29
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/symengine/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, gmp
+, flint
+, mpfr
+, libmpc
+}:
+
+stdenv.mkDerivation rec {
+  pname = "symengine";
+  version = "0.7.0";
+
+  src = fetchFromGitHub {
+    owner = "symengine";
+    repo = "symengine";
+    rev = "v${version}";
+    sha256 = "sha256-aoitTT9fwTIs3ovfqQjKGgrU+kT5mj+vDHt5lg49JHU=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ gmp flint mpfr libmpc ];
+
+  cmakeFlags = [
+    "-DWITH_FLINT=ON"
+    "-DINTEGER_CLASS=flint"
+    "-DWITH_SYMENGINE_THREAD_SAFE=yes"
+    "-DWITH_MPC=yes"
+    "-DBUILD_FOR_DISTRIBUTION=yes"
+  ];
+
+  doCheck = true;
+
+  checkPhase = ''
+    ctest
+  '';
+
+  meta = with lib; {
+    description = "A fast symbolic manipulation library";
+    homepage = "https://github.com/symengine/symengine";
+    platforms = platforms.unix ++ platforms.windows;
+    license = licenses.bsd3;
+    maintainers = [ maintainers.costrouc ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/szip/default.nix b/nixpkgs/pkgs/development/libraries/szip/default.nix
new file mode 100644
index 000000000000..f6d0c619c770
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/szip/default.nix
@@ -0,0 +1,16 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "szip";
+  version = "2.1.1";
+  src = fetchurl {
+    url = "https://support.hdfgroup.org/ftp/lib-external/szip/${version}/src/szip-${version}.tar.gz";
+    sha256 = "04nlhkzzf1gihvrfbzc6rq4kc13p92ly39dzrb4y4jrd9y5rbvi1";
+  };
+
+  meta = {
+    description = "Compression library that can be used with the hdf5 library";
+    homepage = "https://www.hdfgroup.org/doc_resource/SZIP/";
+    license = lib.licenses.unfree;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/t1lib/default.nix b/nixpkgs/pkgs/development/libraries/t1lib/default.nix
new file mode 100644
index 000000000000..5bd4b02b61d9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/t1lib/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchurl, fetchpatch, libX11, libXaw }:
+
+let
+  getPatch = { name, sha256 }: fetchpatch {
+    inherit name sha256;
+    url = "https://projects.archlinux.org/svntogit/packages.git/plain/trunk/${name}"
+      + "?h=packages/t1lib&id=643a4c2c58e70072b5bc1e9e4624162517b58357";
+  };
+
+  patches = map getPatch [
+    { name = "lib-cleanup.diff"; sha256 = "1w3q1y4zk0y4mf2s2x9z4cd8d4af8i868c8837p40mz3dqrai4zp"; }
+    { name = "format-security.diff"; sha256 = "0cca94bif9dsc6iwpcnk1504gb3sl3nsqhni85c21q9aywyz26l3"; }
+    { name = "CVE-2011-0764.diff"; sha256 = "1j0y3f38im7srpqjg9jvx8as6sxkz8gw7hglcxnxl9qylx8mr2jh"; }
+    { name = "CVE-2011-1552_1553_1554.patch"; sha256 = "16cyq6jhyhh8912j8hapx9pq4rzxk36ljlkxlnyi7i3wr8iz1dir"; }
+    { name = "CVE-2010-2642.patch"; sha256 = "175zvyr9v1xs22k2svgxqjcpz5nihfa7j46hn9nzvkqcrhm5m9y8"; }
+      # this ^ also fixes CVE-2011-5244
+  ];
+in
+stdenv.mkDerivation {
+  name = "t1lib-5.1.2";
+
+  src = fetchurl {
+    url = "mirror://metalab/libs/graphics/t1lib-5.1.2.tar.gz";
+    sha256 = "0nbvjpnmcznib1nlgg8xckrmsw3haa154byds2h90y2g0nsjh4w2";
+  };
+  inherit patches;
+
+  buildInputs = [ libX11 libXaw ];
+  buildFlags = [ "without_doc" ];
+
+  postInstall = lib.optionalString (!stdenv.isDarwin) "chmod +x $out/lib/*.so.*"; # ??
+
+  meta = with lib; {
+    description = "A type 1 font rasterizer library for UNIX/X11";
+    homepage = "http://www.t1lib.org/";
+    license = with licenses; [ gpl2 lgpl2 ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tachyon/default.nix b/nixpkgs/pkgs/development/libraries/tachyon/default.nix
new file mode 100644
index 000000000000..fa6ca0141815
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tachyon/default.nix
@@ -0,0 +1,81 @@
+{ lib, stdenv
+, fetchurl
+, Carbon ? null
+, libjpeg ? null
+, libpng ? null
+, withJpegSupport ? true # support jpeg output
+, withPngSupport ? true # support png output
+}:
+
+assert withJpegSupport -> libjpeg != null;
+assert withPngSupport -> libpng != null;
+assert stdenv.isDarwin -> Carbon != null;
+
+stdenv.mkDerivation rec {
+  pname = "tachyon";
+  version = "0.99b6";
+  src = fetchurl {
+    url = "http://jedi.ks.uiuc.edu/~johns/tachyon/files/${version}/${pname}-${version}.tar.gz";
+    sha256 = "15wv2748ngk2iid798a774sjxhhijq7kjm32yl897x54fsfazp7l";
+  };
+  buildInputs = lib.optionals stdenv.isDarwin [
+    Carbon
+  ] ++ lib.optionals withJpegSupport [
+    libjpeg
+  ] ++ lib.optionals withPngSupport [
+    libpng
+  ];
+  preBuild = ''
+    cd unix
+  '' + lib.optionalString withJpegSupport ''
+    export USEJPEG=" -DUSEJPEG"
+    export JPEGLIB=" -ljpeg"
+  '' + lib.optionalString withPngSupport ''
+    export USEPNG=" -DUSEPNG"
+    export PNGLIB=" -lpng -lz"
+  '';
+  arch = if stdenv.hostPlatform.system == "x86_64-linux"   then "linux-64-thr"  else
+         if stdenv.hostPlatform.system == "i686-linux"     then "linux-thr"     else
+         # 2021-03-29: multithread (-DTHR -D_REENTRANT) was disabled on linux-arm
+         # because it caused Sage's 3D plotting tests to hang indefinitely.
+         # see https://github.com/NixOS/nixpkgs/pull/117465
+         if stdenv.hostPlatform.system == "aarch64-linux"  then "linux-arm"     else
+         if stdenv.hostPlatform.system == "armv7l-linux"   then "linux-arm"     else
+         if stdenv.hostPlatform.system == "x86_64-darwin"  then "macosx-thr"    else
+         if stdenv.hostPlatform.system == "i686-darwin"    then "macosx-64-thr" else
+         if stdenv.hostPlatform.system == "i686-cygwin"    then "win32"         else
+         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 ];
+
+  patches = [
+    # Remove absolute paths in Make-config (and unset variables so they can be set in preBuild)
+    ./no-absolute-paths.patch
+    # Include new targets (like arm)
+    ./make-archs.patch
+  ];
+  postPatch = ''
+    # Ensure looks for nix-provided Carbon, not system frameworks
+    substituteInPlace unix/Make-arch \
+      --replace '-F/System/Library/Frameworks' ""
+  '';
+
+  installPhase = ''
+    cd ../compile/${arch}
+    mkdir -p "$out"/{bin,lib,include,share/doc/tachyon,share/tachyon}
+    cp tachyon "$out"/bin
+    cp libtachyon.* "$out/lib"
+    cd ../..
+    cp src/*.h "$out/include/"
+    cp Changes Copyright README "$out/share/doc/tachyon"
+    cp -r scenes "$out/share/tachyon/scenes"
+  '';
+  meta = {
+    description = "A Parallel / Multiprocessor Ray Tracing System";
+    license = lib.licenses.bsd3;
+    maintainers = [lib.maintainers.raskin];
+    platforms = with lib.platforms; linux ++ cygwin ++ darwin;
+    homepage = "http://jedi.ks.uiuc.edu/~johns/tachyon/";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tachyon/make-archs.patch b/nixpkgs/pkgs/development/libraries/tachyon/make-archs.patch
new file mode 100644
index 000000000000..ee81681e101f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tachyon/make-archs.patch
@@ -0,0 +1,37 @@
+diff --git a/unix/Make-arch b/unix/Make-arch
+index 08afb85..dbeb691 100644
+--- a/unix/Make-arch
++++ b/unix/Make-arch
+@@ -920,6 +920,15 @@ macosx:
+ 	"RANLIB = ranlib" \
+ 	"LIBS = -L. -ltachyon $(MISCLIB)"
+ 
++macosx-64:
++	$(MAKE) all \
++	"ARCH = macosx" \
++	"CFLAGS = -Os -m64 -ffast-math -DBsd $(MISCFLAGS)" \
++	"ARFLAGS = r" \
++	"STRIP = strip" \
++	"RANLIB = ranlib" \
++	"LIBS = -L. -ltachyon $(MISCLIB)"
++
+ macosx-thr:
+ 	$(MAKE) all \
+ 	"ARCH = macosx-thr" \
+@@ -1209,6 +1218,16 @@ linux-thr:
+ 	"RANLIB = ranlib" \
+ 	"LIBS = -L. -ltachyon $(MISCLIB) -lm -lpthread"
+ 
++# Linux Arm using gcc
++linux-arm:
++	$(MAKE) all \
++	"ARCH = linux-arm" \
++	"CFLAGS = -Wall -O3 -fomit-frame-pointer -ffast-math -DLinux $(MISCFLAGS)" \
++	"ARFLAGS = r" \
++	"STRIP = strip" \
++	"RANLIB = ranlib" \
++	"LIBS = -L. -ltachyon $(MISCLIB) -lm -lpthread"
++
+ # Linux x86 using gcc, threads, and OpenGL
+ linux-thr-ogl:
+ 	$(MAKE) all \
diff --git a/nixpkgs/pkgs/development/libraries/tachyon/no-absolute-paths.patch b/nixpkgs/pkgs/development/libraries/tachyon/no-absolute-paths.patch
new file mode 100644
index 000000000000..8ebc6560405b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tachyon/no-absolute-paths.patch
@@ -0,0 +1,60 @@
+diff --git a/unix/Make-config b/unix/Make-config
+--- a/unix/Make-config
++++ b/unix/Make-config
+@@ -18,7 +18,7 @@
+ # Bourne Shell Configuration:
+ #   set SHELL=/bin/sh or wherever your bourne shell is
+ ##########################################################################
+-SHELL=/bin/sh
++# SHELL=/bin/sh
+ 
+ 
+ 
+@@ -30,7 +30,7 @@
+ 
+ # The following line should be set to -Ixxx where xxx is your X11 include path
+ # Sun puts X11 in /usr/openwin/xxx
+-X11INC= -I/usr/openwin/include
++# X11INC= -I/usr/openwin/include
+ 
+ # Others typically use /usr/X11 or /usr/X11R6
+ #X11INC= -I/usr/X11
+@@ -105,9 +105,9 @@
+ ##########################################################################
+ # Customize MPI directories and includes as-needed.
+ # A typical MPICH installation location:
+-MPIDIR=/usr/local/mpi
+-MPIINC=$(MPIDIR)/include
+-MPILIB=$(MPIDIR)/lib
++# MPIDIR=/usr/local/mpi
++# MPIINC=$(MPIDIR)/include
++# MPILIB=$(MPIDIR)/lib
+ 
+ # MPI defines and any flags needed by the local installation.
+ # Always list -DMPI at a minimum.  
+@@ -166,9 +166,9 @@
+ #   http://www.ijg.org/files/
+ ##########################################################################
+ # Uncomment the following lines to disable JPEG support
+-USEJPEG=
+-JPEGINC=
+-JPEGLIB=
++# USEJPEG=
++# JPEGINC=
++# JPEGLIB=
+ 
+ # Uncomment the following lines to enable JPEG support
+ #USEJPEG= -DUSEJPEG
+@@ -186,9 +186,9 @@
+ #   http://www.libpng.org/
+ ##########################################################################
+ # Uncomment the following lines to disable PNG support
+-USEPNG=
+-PNGINC=
+-PNGLIB=
++# USEPNG=
++# PNGINC=
++# PNGLIB=
+ 
+ # Uncomment the following lines to enable PNG support
+ #USEPNG= -DUSEPNG
diff --git a/nixpkgs/pkgs/development/libraries/taglib-extras/default.nix b/nixpkgs/pkgs/development/libraries/taglib-extras/default.nix
new file mode 100644
index 000000000000..acb52cc53dbf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/taglib-extras/default.nix
@@ -0,0 +1,23 @@
+{lib, stdenv, fetchurl, cmake, taglib, zlib}:
+
+stdenv.mkDerivation rec {
+  pname = "taglib-extras";
+  version = "1.0.1";
+  src = fetchurl {
+    url = "https://ftp.rz.uni-wuerzburg.de/pub/unix/kde/taglib-extras/${version}/src/${pname}-${version}.tar.gz";
+    sha256 = "0cln49ws9svvvals5fzxjxlzqm0fzjfymn7yfp4jfcjz655nnm7y";
+  };
+  buildInputs = [ taglib ];
+  nativeBuildInputs = [ cmake zlib ];
+
+  # Workaround for upstream bug https://bugs.kde.org/show_bug.cgi?id=357181
+  preConfigure = ''
+    sed -i -e 's/STRLESS/VERSION_LESS/g' cmake/modules/FindTaglib.cmake
+  '';
+
+  meta = with lib; {
+    description = "Additional taglib plugins";
+    platforms = platforms.unix;
+    license = licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/taglib-sharp/default.nix b/nixpkgs/pkgs/development/libraries/taglib-sharp/default.nix
new file mode 100644
index 000000000000..78a4026455e6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/taglib-sharp/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, which, pkg-config, mono }:
+
+stdenv.mkDerivation rec {
+  pname = "taglib-sharp";
+  version = "2.1.0.0";
+
+  src = fetchFromGitHub {
+    owner = "mono";
+    repo = "taglib-sharp";
+    rev = "taglib-sharp-${version}";
+    sha256 = "12pk4z6ag8w7kj6vzplrlasq5lwddxrww1w1ya5ivxrfki15h5cp";
+  };
+
+  nativeBuildInputs = [ pkg-config autoreconfHook which ];
+  buildInputs = [ mono ];
+
+  dontStrip = true;
+
+  configureFlags = [ "--disable-docs" ];
+
+  meta = with lib; {
+    description = "Library for reading and writing metadata in media files";
+    homepage = "https://github.com/mono/taglib-sharp";
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/taglib/default.nix b/nixpkgs/pkgs/development/libraries/taglib/default.nix
new file mode 100644
index 000000000000..5f136a5e6b64
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/taglib/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "taglib";
+  version = "1.12";
+
+  src = fetchFromGitHub {
+    owner = "taglib";
+    repo = "taglib";
+    rev = "v${version}";
+    sha256 = "sha256-omErajnYgxbflsbe6pS2KsexZcXisso0WGYnmIud7WA=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ zlib ];
+
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
+
+  meta = with lib; {
+    homepage = "https://taglib.org/";
+    repositories.git = "git://github.com/taglib/taglib.git";
+    description = "A library for reading and editing audio file metadata";
+    longDescription = ''
+      TagLib is a library for reading and editing the meta-data of several
+      popular audio formats. Currently it supports both ID3v1 and ID3v2 for MP3
+      files, Ogg Vorbis comments and ID3 tags and Vorbis comments in FLAC, MPC,
+      Speex, WavPack, TrueAudio, WAV, AIFF, MP4 and ASF files.
+    '';
+    license = with licenses; [ lgpl3 mpl11 ];
+    maintainers = with maintainers; [ ttuegel ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tagparser/default.nix b/nixpkgs/pkgs/development/libraries/tagparser/default.nix
new file mode 100644
index 000000000000..deeb7552069f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tagparser/default.nix
@@ -0,0 +1,33 @@
+{ stdenv
+, pkgs
+, fetchFromGitHub
+, cmake
+, cpp-utilities
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "tagparser";
+  version = "9.4.0";
+
+  src = fetchFromGitHub {
+    owner = "Martchus";
+    repo = "tagparser";
+    rev = "v${version}";
+    sha256 = "097dq9di19d3mvnlrav3fm78gzjni5babswyv10xnrxfhnf14f6x";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [
+    cpp-utilities zlib
+  ];
+
+  meta = with pkgs.lib; {
+    homepage = "https://github.com/Martchus/tagparser";
+    description = "C++ library for reading and writing MP4/M4A/AAC (iTunes), ID3, Vorbis, Opus, FLAC and Matroska tags";
+    license = licenses.gpl2;
+    maintainers = [ maintainers.matthiasbeyer ];
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/talloc/default.nix b/nixpkgs/pkgs/development/libraries/talloc/default.nix
new file mode 100644
index 000000000000..07d830f00ce7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/talloc/default.nix
@@ -0,0 +1,65 @@
+{ lib, stdenv
+, fetchurl
+, python3
+, pkg-config
+, readline
+, libxslt
+, docbook-xsl-nons
+, docbook_xml_dtd_42
+, fixDarwinDylibNames
+, wafHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "talloc";
+  version = "2.3.3";
+
+  src = fetchurl {
+    url = "mirror://samba/talloc/${pname}-${version}.tar.gz";
+    sha256 = "sha256-a+lbI2i9CvHEzXqIFG62zuoY5Gw//JMwv2JitA0diqo=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    fixDarwinDylibNames
+    python3
+    wafHook
+    docbook-xsl-nons
+    docbook_xml_dtd_42
+  ];
+
+  buildInputs = [
+    python3
+    readline
+    libxslt
+  ];
+
+  wafPath = "buildtools/bin/waf";
+
+  wafConfigureFlags = [
+    "--enable-talloc-compat1"
+    "--bundled-libraries=NONE"
+    "--builtin-libraries=replace"
+  ];
+
+  # python-config from build Python gives incorrect values when cross-compiling.
+  # If python-config is not found, the build falls back to using the sysconfig
+  # module, which works correctly in all cases.
+  PYTHON_CONFIG = "/invalid";
+
+  # this must not be exported before the ConfigurePhase otherwise waf whines
+  preBuild = lib.optionalString stdenv.hostPlatform.isMusl ''
+    export NIX_CFLAGS_LINK="-no-pie -shared";
+  '';
+
+  postInstall = ''
+    ${stdenv.cc.targetPrefix}ar q $out/lib/libtalloc.a bin/default/talloc.c.[0-9]*.o
+  '';
+
+  meta = with lib; {
+    description = "Hierarchical pool based memory allocator with destructors";
+    homepage = "https://tdb.samba.org/";
+    license = licenses.gpl3;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tbb/default.nix b/nixpkgs/pkgs/development/libraries/tbb/default.nix
new file mode 100644
index 000000000000..7aef5ba74768
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tbb/default.nix
@@ -0,0 +1,86 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchFromGitHub
+, fixDarwinDylibNames
+}:
+
+stdenv.mkDerivation rec {
+  pname = "tbb";
+  version = "2020.3";
+
+  src = fetchFromGitHub {
+    owner = "oneapi-src";
+    repo = "oneTBB";
+    rev = "v${version}";
+    sha256 = "prO2O5hd+Wz5iA0vfrqmyHFr0Ptzk64so5KpSpvuKmU=";
+  };
+
+  patches = [
+    # Fixes build with Musl.
+    (fetchurl {
+      url = "https://github.com/openembedded/meta-openembedded/raw/39185eb1d1615e919e3ae14ae63b8ed7d3e5d83f/meta-oe/recipes-support/tbb/tbb/GLIBC-PREREQ-is-not-defined-on-musl.patch";
+      sha256 = "gUfXQ9OZQ82qD6brgauBCsKdjLvyHafMc18B+KxZoYs=";
+    })
+
+    # Fixes build with Musl.
+    (fetchurl {
+      url = "https://github.com/openembedded/meta-openembedded/raw/39185eb1d1615e919e3ae14ae63b8ed7d3e5d83f/meta-oe/recipes-support/tbb/tbb/0001-mallinfo-is-glibc-specific-API-mark-it-so.patch";
+      sha256 = "fhorfqO1hHKZ61uq+yTR7eQ8KYdyLwpM3K7WpwJpV74=";
+    })
+  ];
+
+  nativeBuildInputs = lib.optionals stdenv.isDarwin [
+    fixDarwinDylibNames
+  ];
+
+  makeFlags = lib.optionals stdenv.cc.isClang [
+    "compiler=clang"
+  ];
+
+  enableParallelBuilding = true;
+
+  installPhase = ''
+    runHook preInstall
+
+    mkdir -p $out/lib
+    cp "build/"*release*"/"*${stdenv.hostPlatform.extensions.sharedLibrary}* $out/lib/
+    mv include $out/
+    rm $out/include/index.html
+
+    runHook postInstall
+  '';
+
+  postInstall = let
+    pcTemplate = fetchurl {
+      url = "https://github.com/oneapi-src/oneTBB/raw/master/integration/pkg-config/tbb.pc.in";
+      sha256 = "2pCad9txSpNbzac0vp/VY3x7HNySaYkbH3Rx8LK53pI=";
+    };
+  in ''
+    # Generate pkg-config file based on upstream template.
+    # It should not be necessary with tbb after 2021.2.
+    mkdir -p "$out/lib/pkgconfig"
+    substitute "${pcTemplate}" "$out/lib/pkgconfig/tbb.pc" \
+      --subst-var-by CMAKE_INSTALL_PREFIX "$out" \
+      --subst-var-by CMAKE_INSTALL_LIBDIR "lib" \
+      --subst-var-by CMAKE_INSTALL_INCLUDEDIR "include" \
+      --subst-var-by TBB_VERSION "${version}" \
+      --subst-var-by TBB_LIB_NAME "tbb"
+  '';
+
+  meta = with lib; {
+    description = "Intel Thread Building Blocks C++ Library";
+    homepage = "http://threadingbuildingblocks.org/";
+    license = licenses.asl20;
+    longDescription = ''
+      Intel Threading Building Blocks offers a rich and complete approach to
+      expressing parallelism in a C++ program. It is a library that helps you
+      take advantage of multi-core processor performance without having to be a
+      threading expert. Intel TBB is not just a threads-replacement library. It
+      represents a higher-level, task-based parallelism that abstracts platform
+      details and threading mechanisms for scalability and performance.
+    '';
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ thoughtpolice dizfer ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tclap/default.nix b/nixpkgs/pkgs/development/libraries/tclap/default.nix
new file mode 100644
index 000000000000..eb49efa6c871
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tclap/default.nix
@@ -0,0 +1,18 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "tclap";
+  version = "1.2.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/tclap/${pname}-${version}.tar.gz";
+    sha256 = "sha256-Y0xbWduxzLydal9t5JSiV+KaP1nctvwwRF/zm0UYhXQ=";
+  };
+
+  meta = with lib; {
+    homepage = "http://tclap.sourceforge.net/";
+    description = "Templatized C++ Command Line Parser Library";
+    platforms = platforms.all;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tcllib/default.nix b/nixpkgs/pkgs/development/libraries/tcllib/default.nix
new file mode 100644
index 000000000000..90c4528a6454
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tcllib/default.nix
@@ -0,0 +1,18 @@
+{ lib, fetchurl, tcl }:
+
+tcl.mkTclDerivation rec {
+  pname = "tcllib";
+  version = "1.20";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/tcllib/tcllib-${version}.tar.gz";
+    sha256 = "0wax281h6ksz974a5qpfgf9y34lmlpd8i87lkm1w94ybbd3rgc73";
+  };
+
+  meta = {
+    homepage = "https://sourceforge.net/projects/tcllib/";
+    description = "Tcl-only library of standard routines for Tcl";
+    license = lib.licenses.tcltk;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tcltls/default.nix b/nixpkgs/pkgs/development/libraries/tcltls/default.nix
new file mode 100644
index 000000000000..8883ad5dd440
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tcltls/default.nix
@@ -0,0 +1,25 @@
+{ lib, fetchurl, tcl, openssl }:
+
+tcl.mkTclDerivation rec {
+  pname = "tcltls";
+  version = "1.7.21";
+
+  src = fetchurl {
+    url = "https://core.tcl-lang.org/tcltls/uv/tcltls-${version}.tar.gz";
+    sha256 = "0xf1rfsnn4k9j1bd2a1p8ir0xr4a3phgr9lcgbazh4084l2y8sl0";
+  };
+
+  buildInputs = [ openssl ];
+
+  configureFlags = [
+    "--with-ssl-dir=${openssl.dev}"
+  ];
+
+  meta = {
+    homepage = "https://core.tcl-lang.org/tcltls/index";
+    description = "An OpenSSL / RSA-bsafe Tcl extension";
+    maintainers = [ lib.maintainers.agbrooks ];
+    license = lib.licenses.tcltk;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tclx/default.nix b/nixpkgs/pkgs/development/libraries/tclx/default.nix
new file mode 100644
index 000000000000..a8cf2a44fab6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tclx/default.nix
@@ -0,0 +1,24 @@
+{ lib, fetchurl, tcl }:
+
+tcl.mkTclDerivation rec {
+  name = "tclx-${version}.${patch}";
+  version = "8.4";
+  patch = "1";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/tclx/tclx${version}.${patch}.tar.bz2";
+    sha256 = "1v2qwzzidz0is58fd1p7wfdbscxm3ip2wlbqkj5jdhf6drh1zd59";
+  };
+
+  # required in order for tclx to properly detect tclx.tcl at runtime
+  postInstall = ''
+    ln -s $prefix/lib/tclx${version} $prefix/lib/tclx${version}/tclx${version}
+  '';
+
+  meta = {
+    homepage = "http://tclx.sourceforge.net/";
+    description = "Tcl extensions";
+    license = lib.licenses.tcltk;
+    maintainers = with lib.maintainers; [ kovirobi ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tdb/default.nix b/nixpkgs/pkgs/development/libraries/tdb/default.nix
new file mode 100644
index 000000000000..2e2e09be1083
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tdb/default.nix
@@ -0,0 +1,59 @@
+{ lib, stdenv
+, fetchurl
+, pkg-config
+, wafHook
+, python3
+, readline
+, libxslt
+, docbook-xsl-nons
+, docbook_xml_dtd_45
+}:
+
+stdenv.mkDerivation rec {
+  pname = "tdb";
+  version = "1.4.3";
+
+  src = fetchurl {
+    url = "mirror://samba/tdb/${pname}-${version}.tar.gz";
+    sha256 = "06waz0k50c7v3chd08mzp2rv7w4k4q9isbxx3vhlfpx1vy9q61f8";
+  };
+
+  nativeBuildInputs = [
+    python3
+    pkg-config
+    wafHook
+    libxslt
+    docbook-xsl-nons
+    docbook_xml_dtd_45
+  ];
+
+  buildInputs = [
+    python3
+    readline # required to build python
+  ];
+
+  wafPath = "buildtools/bin/waf";
+
+  wafConfigureFlags = [
+    "--bundled-libraries=NONE"
+    "--builtin-libraries=replace"
+  ];
+
+  # python-config from build Python gives incorrect values when cross-compiling.
+  # If python-config is not found, the build falls back to using the sysconfig
+  # module, which works correctly in all cases.
+  PYTHON_CONFIG = "/invalid";
+
+  meta = with lib; {
+    description = "The trivial database";
+    longDescription = ''
+      TDB is a Trivial Database. In concept, it is very much like GDBM,
+      and BSD's DB except that it allows multiple simultaneous writers
+      and uses locking internally to keep writers from trampling on each
+      other. TDB is also extremely small.
+    '';
+    homepage = "https://tdb.samba.org/";
+    license = licenses.lgpl3Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tdlib/default.nix b/nixpkgs/pkgs/development/libraries/tdlib/default.nix
new file mode 100644
index 000000000000..895faa8847ac
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tdlib/default.nix
@@ -0,0 +1,26 @@
+{ fetchFromGitHub, gperf, openssl, readline, zlib, cmake, lib, stdenv }:
+
+stdenv.mkDerivation rec {
+  version = "1.7.0";
+  pname = "tdlib";
+
+  src = fetchFromGitHub {
+    owner = "tdlib";
+    repo = "td";
+
+    rev = "v${version}";
+
+    sha256 = "sha256-sZzp9k7KDnqftcSGSgXkIy0siCksGPBmRckySU/J0TU=";
+  };
+
+  buildInputs = [ gperf openssl readline zlib ];
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Cross-platform library for building Telegram clients";
+    homepage = "https://core.telegram.org/tdlib/";
+    license = [ licenses.boost ];
+    platforms = platforms.unix;
+    maintainers = [ maintainers.vyorkin ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tecla/default.nix b/nixpkgs/pkgs/development/libraries/tecla/default.nix
new file mode 100644
index 000000000000..a0a1ac0360e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tecla/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  name = "tecla-1.6.3";
+
+  src = fetchurl {
+    url = "https://www.astro.caltech.edu/~mcs/tecla/lib${name}.tar.gz";
+    sha256 = "06pfq5wa8d25i9bdjkp4xhms5101dsrbg82riz7rz1a0a32pqxgj";
+  };
+
+  postPatch = ''
+    substituteInPlace install-sh \
+      --replace "stripprog=" "stripprog=\$STRIP # "
+  '';
+
+  meta = {
+    homepage = "https://www.astro.caltech.edu/~mcs/tecla/";
+    description = "Command-line editing library";
+    license = "as-is";
+
+    platforms = lib.platforms.unix;
+    maintainers = [ lib.maintainers.peti ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/telepathy/farstream/default.nix b/nixpkgs/pkgs/development/libraries/telepathy/farstream/default.nix
new file mode 100644
index 000000000000..2885f3cbb12d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/telepathy/farstream/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, pkg-config, telepathy-glib, farstream, dbus-glib }:
+
+stdenv.mkDerivation rec {
+  name = "${pname}-0.6.2";
+  pname = "telepathy-farstream";
+
+  src = fetchurl {
+    url = "https://telepathy.freedesktop.org/releases/${pname}/${name}.tar.gz";
+    sha256 = "02ky12bb92prr5f6xmvmfq4yz2lj33li6nj4829a98hk5pr9k83g";
+  };
+
+  propagatedBuildInputs = [ dbus-glib telepathy-glib farstream ];
+  nativeBuildInputs = [ pkg-config ];
+
+  meta = with lib; {
+    description = "GObject-based C library that uses Telepathy GLib, Farstream and GStreamer to handle the media streaming part of channels of type Call";
+    homepage = "https://telepathy.freedesktop.org/wiki/Components/Telepathy-Farstream/";
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/telepathy/glib/default.nix b/nixpkgs/pkgs/development/libraries/telepathy/glib/default.nix
new file mode 100644
index 000000000000..9ab269aaacfc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/telepathy/glib/default.nix
@@ -0,0 +1,59 @@
+{ lib
+, stdenv
+, fetchurl
+, dbus-glib
+, glib
+, python3
+, pkg-config
+, libxslt
+, gobject-introspection
+, vala
+, glibcLocales
+}:
+
+stdenv.mkDerivation rec {
+  pname = "telepathy-glib";
+  version = "0.24.2";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "${meta.homepage}/releases/telepathy-glib/${pname}-${version}.tar.gz";
+    sha256 = "sKN013HN0IESXzjDq9B5ZXZCMBxxpUPVVeK/IZGSc/A=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    libxslt
+    gobject-introspection
+    vala
+  ];
+
+  buildInputs = [
+    glibcLocales
+    python3
+  ];
+
+  propagatedBuildInputs = [
+    dbus-glib
+    glib
+  ];
+
+  configureFlags = [
+    "--enable-vala-bindings"
+  ];
+
+  LC_ALL = "en_US.UTF-8";
+
+  enableParallelBuilding = true;
+
+  preConfigure = ''
+    substituteInPlace telepathy-glib/telepathy-glib.pc.in --replace Requires.private Requires
+  '';
+
+  meta = with lib; {
+    homepage = "https://telepathy.freedesktop.org";
+    platforms = platforms.unix;
+    license = with licenses; [ bsd2 bsd3 lgpl21Plus ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/telepathy/qt/default.nix b/nixpkgs/pkgs/development/libraries/telepathy/qt/default.nix
new file mode 100644
index 000000000000..dbbaca7e11a7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/telepathy/qt/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, cmake, qtbase, pkg-config, python3Packages, dbus-glib, dbus
+, telepathy-farstream, telepathy-glib }:
+
+let
+  inherit (python3Packages) python dbus-python;
+in stdenv.mkDerivation rec {
+  name = "telepathy-qt-0.9.8";
+
+  src = fetchurl {
+    url = "https://telepathy.freedesktop.org/releases/telepathy-qt/${name}.tar.gz";
+    sha256 = "bf8e2a09060addb80475a4938105b9b41d9e6837999b7a00e5351783857e18ad";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config python ];
+  propagatedBuildInputs = [ qtbase telepathy-farstream telepathy-glib ];
+  buildInputs = [ dbus-glib ];
+  checkInputs = [ dbus.daemon dbus-python ];
+
+  # No point in building tests if they are not run
+  # On 0.9.7, they do not even build with QT4
+  cmakeFlags = lib.optional (!doCheck) "-DENABLE_TESTS=OFF";
+
+  dontWrapQtApps = true;
+
+  doCheck = false; # giving up for now
+
+  meta = with lib; {
+    description = "Telepathy Qt bindings";
+    homepage = "https://telepathy.freedesktop.org/components/telepathy-qt/";
+    license = licenses.lgpl21;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/template-glib/default.nix b/nixpkgs/pkgs/development/libraries/template-glib/default.nix
new file mode 100644
index 000000000000..c0ee2c1d3506
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/template-glib/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, glib, gobject-introspection, flex, bison, vala, gettext, gnome, gtk-doc, docbook_xsl, docbook_xml_dtd_43 }:
+let
+  version = "3.34.0";
+  pname = "template-glib";
+in
+stdenv.mkDerivation {
+  name = "${pname}-${version}";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "1z9xkin5fyfh071ma9y045jcw83hgx33dfbjraw6cxk0qdmfysr1";
+  };
+
+  buildInputs = [ meson ninja pkg-config gettext flex bison vala glib gtk-doc docbook_xsl docbook_xml_dtd_43 ];
+  nativeBuildInputs = [ glib gobject-introspection ];
+
+  mesonFlags = [
+    "-Denable_gtk_doc=true"
+  ];
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    description = "A library for template expansion which supports calling into GObject Introspection from templates";
+    homepage = "https://gitlab.gnome.org/GNOME/template-glib";
+    license = licenses.lgpl21Plus;
+    maintainers = teams.gnome.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tepl/default.nix b/nixpkgs/pkgs/development/libraries/tepl/default.nix
new file mode 100644
index 000000000000..f561efb473c5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tepl/default.nix
@@ -0,0 +1,61 @@
+{ lib, stdenv
+, fetchurl
+, meson
+, ninja
+, amtk
+, gnome
+, gobject-introspection
+, gtk3
+, gtksourceview4
+, icu
+, pkg-config
+}:
+
+stdenv.mkDerivation rec {
+  pname = "tepl";
+  version = "6.00.0";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "0qvs7s86gqyyrzi0r5fbrj8zczlgv8xhdjswgbgc1afwjnl9fqx8";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    gobject-introspection
+    pkg-config
+  ];
+
+  buildInputs = [
+    icu
+  ];
+
+  propagatedBuildInputs = [
+    amtk
+    gtksourceview4
+    gtk3
+  ];
+
+  doCheck = false;
+  # TODO: one test fails because of
+  # (./test-file-metadata:20931): Tepl-WARNING **: 14:41:36.942: GVfs metadata
+  # is not supported. Fallback to TeplMetadataManager. Either GVfs is not
+  # correctly installed or GVfs metadata are not supported on this platform. In
+  # the latter case, you should configure Tepl with --disable-gvfs-metadata.
+
+  passthru.updateScript = gnome.updateScript {
+    packageName = pname;
+    versionPolicy = "odd-unstable";
+  };
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Projects/Tepl";
+    description = "Text editor product line";
+    maintainers = teams.gnome.members ++ [ maintainers.manveru ];
+    license = licenses.lgpl3Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/termbox/default.nix b/nixpkgs/pkgs/development/libraries/termbox/default.nix
new file mode 100644
index 000000000000..51c2ca1c8084
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/termbox/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "termbox";
+  version = "1.1.4";
+  src = fetchFromGitHub {
+    owner = "termbox";
+    repo = "termbox";
+    rev = "v${version}";
+    sha256 = "075swv6ajx8m424dbmgbf6fs6nd5q004gjpvx48gkxmnf9spvykl";
+  };
+
+  makeFlags = [ "prefix=${placeholder "out"}" ];
+
+  meta = with lib; {
+    description = "Library for writing text-based user interfaces";
+    license = licenses.mit;
+    homepage = "https://github.com/termbox/termbox#readme";
+    downloadPage = "https://github.com/termbox/termbox/releases";
+    maintainers = with maintainers; [ fgaz ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tevent/default.nix b/nixpkgs/pkgs/development/libraries/tevent/default.nix
new file mode 100644
index 000000000000..568751f48aa3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tevent/default.nix
@@ -0,0 +1,52 @@
+{ lib, stdenv
+, fetchurl
+, python3
+, pkg-config
+, readline
+, talloc
+, libxslt
+, docbook-xsl-nons
+, docbook_xml_dtd_42
+, which
+, wafHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "tevent";
+  version = "0.10.2";
+
+  src = fetchurl {
+    url = "mirror://samba/tevent/${pname}-${version}.tar.gz";
+    sha256 = "15k6i8ad5lpxfjsjyq9h64zlyws8d3cm0vwdnaw8z1xjwli7hhpq";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    which
+    python3
+    libxslt
+    docbook-xsl-nons
+    docbook_xml_dtd_42
+    wafHook
+  ];
+
+  buildInputs = [
+    python3
+    readline # required to build python
+    talloc
+  ];
+
+  wafPath = "buildtools/bin/waf";
+
+  wafConfigureFlags = [
+    "--bundled-libraries=NONE"
+    "--builtin-libraries=replace"
+  ];
+
+  meta = with lib; {
+    description = "An event system based on the talloc memory management library";
+    homepage = "https://tevent.samba.org/";
+    license = licenses.lgpl3Plus;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tezos-rust-libs/default.nix b/nixpkgs/pkgs/development/libraries/tezos-rust-libs/default.nix
new file mode 100644
index 000000000000..67826f07a433
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tezos-rust-libs/default.nix
@@ -0,0 +1,37 @@
+{ lib, fetchFromGitLab, rustPlatform }:
+
+rustPlatform.buildRustPackage rec {
+  pname = "tezos-rust-libs";
+  version = "1.0";
+
+  src = fetchFromGitLab {
+    owner = "tezos";
+    repo = "tezos-rust-libs";
+    rev = "v${version}";
+    sha256 = "1ffkzbvb0ls4wk9205g3xh2c26cmwnl68x43gh6dm9z4xsic94v5";
+  };
+
+  cargoSha256 = "0dgyqfr3dvvdwdi1wvpd7v9j21740jy4zwrwiwknw7csb4bq9wfx";
+
+  preBuild = ''
+    mkdir .cargo
+    mv cargo-config .cargo/config
+  '';
+
+  postInstall = ''
+    cp -r rustc-bls12-381/include $out/include
+    cp -r librustzcash/include $out
+    cp -r $out/lib $out/tmp
+    mkdir $out/lib/tezos-rust-libs
+    mv $out/tmp/ $out/lib/tezos-rust-libs/
+  '';
+
+  doCheck = true;
+
+  meta = {
+    homepage = "https://gitlab.com/tezos/tezos-rust-libs";
+    description = "Tezos: all rust dependencies and their dependencies";
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.ulrikstrid ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/theft/default.nix b/nixpkgs/pkgs/development/libraries/theft/default.nix
new file mode 100644
index 000000000000..3d39075dd26a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/theft/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  version = "0.4.5";
+  pname = "theft";
+
+  src = fetchFromGitHub {
+    owner  = "silentbicycle";
+    repo   = "theft";
+    rev    = "v${version}";
+    sha256 = "1n2mkawfl2bpd4pwy3mdzxwlqjjvb5bdrr2x2gldlyqdwbk7qjhd";
+  };
+
+  preConfigure = "patchShebangs ./scripts/mk_bits_lut";
+
+  doCheck = true;
+  checkTarget = "test";
+
+  installFlags = [ "PREFIX=$(out)" ];
+
+  # fix the libtheft.pc file to use the right installation
+  # directory. should be fixed upstream, too
+  postInstall = ''
+    install -m644 vendor/greatest.h $out/include/
+
+    substituteInPlace $out/lib/pkgconfig/libtheft.pc \
+      --replace "/usr/local" "$out"
+  '';
+
+  meta = with lib; {
+    description = "A C library for property-based testing";
+    homepage    = "https://github.com/silentbicycle/theft/";
+    platforms   = platforms.unix;
+    license     = licenses.isc;
+    maintainers = with maintainers; [ kquick thoughtpolice ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/thrift/0.10.nix b/nixpkgs/pkgs/development/libraries/thrift/0.10.nix
new file mode 100644
index 000000000000..001de25e9963
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/thrift/0.10.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchurl, boost, zlib, libevent, openssl, python3, pkg-config, bison
+, flex
+}:
+
+stdenv.mkDerivation rec {
+  pname = "thrift";
+  version = "0.10.0";
+
+  src = fetchurl {
+    url = "https://archive.apache.org/dist/thrift/${version}/${pname}-${version}.tar.gz";
+    sha256 = "02x1xw0l669idkn6xww39j60kqxzcbmim4mvpb5h9nz8wqnx1292";
+  };
+
+  #enableParallelBuilding = true; problems on hydra
+
+  # Workaround to make the python wrapper not drop this package:
+  # pythonFull.buildEnv.override { extraLibs = [ thrift ]; }
+  pythonPath = [];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    boost zlib libevent openssl bison flex (python3.withPackages (ps: [ps.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;
+
+  meta = with lib; {
+    description = "Library for scalable cross-language services";
+    homepage = "http://thrift.apache.org/";
+    license = licenses.asl20;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = [ maintainers.bjornfor ];
+    knownVulnerabilities = [
+      "CVE-2018-1320"
+      "CVE-2018-11798"
+      "CVE-2019-0205"
+      "CVE-2019-0210"
+      "CVE-2020-13949"
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/thrift/default.nix b/nixpkgs/pkgs/development/libraries/thrift/default.nix
new file mode 100644
index 000000000000..6460be99fd47
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/thrift/default.nix
@@ -0,0 +1,75 @@
+{ lib, stdenv, fetchurl, boost, zlib, libevent, openssl, python3, cmake, pkg-config
+, bison, flex
+, static ? stdenv.hostPlatform.isStatic
+}:
+
+stdenv.mkDerivation rec {
+  pname = "thrift";
+  version = "0.14.2";
+
+  src = fetchurl {
+    url = "https://archive.apache.org/dist/thrift/${version}/${pname}-${version}.tar.gz";
+    sha256 = "sha256-QZG/wLdJDiDMafn03G6ZH7thLUVRqp7vHb9/TEfOVU0=";
+  };
+
+  # Workaround to make the python wrapper not drop this package:
+  # pythonFull.buildEnv.override { extraLibs = [ thrift ]; }
+  pythonPath = [];
+
+  nativeBuildInputs = [ cmake pkg-config bison flex ];
+  buildInputs = [ boost zlib libevent openssl ]
+    ++ lib.optionals (!static) [ (python3.withPackages (ps: [ps.twisted])) ];
+
+  preConfigure = "export PY_PREFIX=$out";
+
+  cmakeFlags = [
+    "-DBUILD_JAVASCRIPT:BOOL=OFF"
+    "-DBUILD_NODEJS:BOOL=OFF"
+
+    # 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"}"
+  ] ++ lib.optionals static [
+    "-DWITH_STATIC_LIB:BOOL=ON"
+    "-DOPENSSL_USE_STATIC_LIBS=ON"
+  ];
+
+  disabledTests = [
+    "PythonTestSSLSocket"
+  ] ++ lib.optionals stdenv.isDarwin [
+    # tests that hang up in the darwin sandbox
+    "SecurityTest"
+    "SecurityFromBufferTest"
+    "python_test"
+
+    # tests that fail in the darwin sandbox when trying to use network
+    "UnitTests"
+    "TInterruptTest"
+    "TServerIntegrationTest"
+    "processor"
+    "TNonblockingServerTest"
+    "TNonblockingSSLServerTest"
+    "StressTest"
+    "StressTestConcurrent"
+    "StressTestNonBlocking"
+    "PythonThriftTNonblockingServer"
+  ];
+
+  doCheck = !static;
+  checkPhase = ''
+    runHook preCheck
+
+    ${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH=$PWD/lib ctest -E "($(echo "$disabledTests" | tr " " "|"))"
+
+    runHook postCheck
+  '';
+  enableParallelChecking = false;
+
+  meta = with lib; {
+    description = "Library for scalable cross-language services";
+    homepage = "http://thrift.apache.org/";
+    license = licenses.asl20;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ti-rpc/default.nix b/nixpkgs/pkgs/development/libraries/ti-rpc/default.nix
new file mode 100644
index 000000000000..044c09a5bc48
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ti-rpc/default.nix
@@ -0,0 +1,51 @@
+{ fetchurl, lib, stdenv, autoreconfHook, libkrb5 }:
+
+stdenv.mkDerivation rec {
+  pname = "libtirpc";
+  version = "1.2.7-rc4";
+
+  src = fetchurl {
+    url = "http://git.linux-nfs.org/?p=steved/libtirpc.git;a=snapshot;h=5ca4ca92f629d9d83e83544b9239abaaacf0a527;sf=tgz";
+    sha256 = "0w26yf9bwkpqj52sqd3n250dg9jlqnr8bjv0kc4fl5hkrv8akj8i";
+    name = "${pname}-${version}.tar.gz";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  postPatch = ''
+    sed '1i#include <stdint.h>' -i src/xdr_sizeof.c
+  '';
+
+  KRB5_CONFIG = "${libkrb5.dev}/bin/krb5-config";
+  nativeBuildInputs = [ autoreconfHook ];
+  propagatedBuildInputs = [ libkrb5 ];
+
+  preConfigure = ''
+    sed -es"|/etc/netconfig|$out/etc/netconfig|g" -i doc/Makefile.in tirpc/netconfig.h
+  '';
+
+  preInstall = "mkdir -p $out/etc";
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://sourceforge.net/projects/libtirpc/";
+    description = "The transport-independent Sun RPC implementation (TI-RPC)";
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ abbradar ];
+    longDescription = ''
+       Currently, NFS commands use the SunRPC routines provided by the
+       glibc.  These routines do not support IPv6 addresses.  Ulrich
+       Drepper, who is the maintainer of the glibc, refuses any change in
+       the glibc concerning the RPC.  He wants the RPC to become a separate
+       library.  Other OS (NetBSD, FreeBSD, Solarix, HP-UX, AIX) have
+       migrated their SunRPC library to a TI-RPC (Transport Independent
+       RPC) implementation.  This implementation allows the support of
+       other transports than UDP and TCP over IPv4.  FreeBSD provides a
+       TI-RPC library ported from NetBSD with improvements.  This library
+       already supports IPv6.  So, the FreeBSD release 5.2.1 TI-RPC has
+       been ported to replace the SunRPC of the glibc.
+    '';
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ticpp/default.nix b/nixpkgs/pkgs/development/libraries/ticpp/default.nix
new file mode 100644
index 000000000000..20de3d7f2b89
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ticpp/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation {
+  pname = "ticpp";
+  version = "unstable-2019-01-09";
+
+  src = fetchFromGitHub {
+    owner = "wxFormBuilder";
+    repo = "ticpp";
+    rev = "eb79120ea16b847ce9f483a298a394050f463d6b";
+    sha256 = "0xk4cy0xbkr6326cqd1vd6b2x0rfsx4iz2sq8f5jz3yl3slxgjm2";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [ "-DBUILD_TICPP_DLL=1" ];
+
+  installPhase = ''
+    cd ..
+    mkdir -p $out/lib
+    install build/*.{a,so} $out/lib
+    mkdir -p $out/include
+    install *.h $out/include
+  '';
+
+  meta = {
+    description = "Interface to TinyXML";
+    license = lib.licenses.mit;
+    homepage = "https://github.com/wxFormBuilder/ticpp";
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/tidyp/default.nix b/nixpkgs/pkgs/development/libraries/tidyp/default.nix
new file mode 100644
index 000000000000..c2a8ae0337ac
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tidyp/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "tidyp";
+  version = "1.04";
+
+  src = fetchurl {
+    # downloads from a legacy GitHub download page from ~11 years ago
+    # project does not work with autoconf anymore and the configure script cannot be generated from the source download
+    url = "https://github.com/downloads/petdance/tidyp/${pname}-${version}.tar.gz";
+    sha256 = "0f5ky0ih4vap9c6j312jn73vn8m2bj69pl2yd3a5nmv35k9zmc10";
+  };
+
+  hardeningDisable = [ "format" ];
+
+  meta = with lib; {
+    description = "A program that can validate your HTML, as well as modify it to be more clean and standard";
+    homepage = "http://tidyp.com/";
+    platforms = platforms.all;
+    maintainers = with maintainers; [ pSub ];
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tiledb/default.nix b/nixpkgs/pkgs/development/libraries/tiledb/default.nix
new file mode 100644
index 000000000000..6bc0d3ef7534
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tiledb/default.nix
@@ -0,0 +1,85 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, zlib
+, lz4
+, bzip2
+, zstd
+, spdlog_0
+, tbb
+, openssl
+, boost
+, libpqxx
+, clang-tools
+, catch2
+, python
+, gtest
+, doxygen
+, fixDarwinDylibNames
+}:
+
+stdenv.mkDerivation rec {
+  pname = "tiledb";
+  version = "2.3.3";
+
+  src = fetchFromGitHub {
+    owner = "TileDB-Inc";
+    repo = "TileDB";
+    rev = version;
+    sha256 = "sha256-3Z5+QUzo2f24q11j6s8KX2vHLFkipFvGk2VFComWW/o=";
+  };
+
+  # (bundled) blosc headers have a warning on some archs that it will be using
+  # unaccelerated routines.
+  cmakeFlags = [
+    "-DTILEDB_WERROR=0"
+  ];
+
+  nativeBuildInputs = [
+    clang-tools
+    cmake
+    python
+    doxygen
+  ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+
+  checkInputs = [
+    gtest
+  ];
+
+  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" ];
+
+  postInstall = lib.optionalString stdenv.isDarwin ''
+    install_name_tool -add_rpath ${tbb}/lib $out/lib/libtiledb.dylib
+  '';
+
+  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 = platforms.unix;
+    maintainers = with maintainers; [ rakesh4g ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/timezonemap/default.nix b/nixpkgs/pkgs/development/libraries/timezonemap/default.nix
new file mode 100644
index 000000000000..372b0e74b06f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/timezonemap/default.nix
@@ -0,0 +1,65 @@
+{ lib, stdenv
+, autoreconfHook
+, fetchbzr
+, pkg-config
+, gtk3
+, glib
+, file
+, gobject-introspection
+, json-glib
+, libsoup
+}:
+
+stdenv.mkDerivation rec {
+  pname = "timezonemap";
+  version = "0.4.5";
+
+  src = fetchbzr {
+    url = "lp:timezonemap";
+    rev = "58";
+    sha256 = "1qdp5f9zd8c02bf0mq4w15rlhz2g51phml5qg9asdyfd1715f8n0";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    autoreconfHook
+    gobject-introspection
+  ];
+
+  buildInputs = [
+    gtk3
+    glib
+    json-glib
+    libsoup
+  ];
+
+  configureFlags = [
+    "CFLAGS=-Wno-error"
+    "--sysconfdir=/etc"
+    "--localstatedir=/var"
+  ];
+
+  installFlags = [
+    "sysconfdir=${placeholder "out"}/etc"
+    "localstatedir=\${TMPDIR}"
+  ];
+
+  preConfigure = ''
+    for f in {configure,m4/libtool.m4}; do
+      substituteInPlace $f\
+        --replace /usr/bin/file ${file}/bin/file
+    done
+  '';
+
+  postPatch = ''
+    sed "s|/usr/share/libtimezonemap|$out/share/libtimezonemap|g" -i ./src/tz.h
+  '';
+
+  meta = with lib; {
+    homepage = "https://launchpad.net/timezonemap";
+    description = "A GTK+3 Timezone Map Widget";
+    license = licenses.gpl2;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.mkg20001 ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tinycbor/default.nix b/nixpkgs/pkgs/development/libraries/tinycbor/default.nix
new file mode 100644
index 000000000000..d03e20cb7e21
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tinycbor/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "tinycbor";
+  version = "0.5.3";
+
+  src = fetchFromGitHub {
+    owner = "intel";
+    repo = "tinycbor";
+    rev = "v${version}";
+    sha256 = "11y6liyd3fvc28d3dinii16sxgwgg2p29p41snc4h82dvvx5bb2b";
+  };
+
+  makeFlags = [ "prefix=$(out)" ];
+
+  meta = with lib; {
+    description = "Concise Binary Object Representation (CBOR) Library";
+    homepage = "https://github.com/intel/tinycbor";
+    license = licenses.mit;
+    maintainers = with maintainers; [ oxzi ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tinycdb/default.nix b/nixpkgs/pkgs/development/libraries/tinycdb/default.nix
new file mode 100644
index 000000000000..63e710643919
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tinycdb/default.nix
@@ -0,0 +1,55 @@
+{ stdenv, lib, fetchurl }:
+let
+  isCross = stdenv.buildPlatform != stdenv.hostPlatform;
+  cross = "${stdenv.hostPlatform.config}";
+  static = stdenv.hostPlatform.isStatic;
+
+  cc = if !isCross then "cc" else "${cross}-cc";
+  ar = if !isCross then "ar" else "${cross}-ar";
+  ranlib = if !isCross then "ranlib" else "${cross}-ranlib";
+in stdenv.mkDerivation rec {
+  postPatch = ''
+    sed -i 's,set --, set -x; set --,' Makefile
+  '';
+  pname = "tinycdb";
+  version = "0.78";
+  # In general, static library (.a) goes to "dev", shared (.so) to
+  # "lib". In case of static build, there is no .so library, so "lib"
+  # output is useless and empty.
+  outputs = [ "out" "dev" "man" ] ++ lib.optional (!static) "lib";
+  separateDebugInfo = true;
+  makeFlags =
+    [ "prefix=$(out)" "CC=${cc}" "AR=${ar}" "RANLIB=${ranlib}" "static"
+  ] ++ lib.optional (!static) "shared";
+  postInstall = ''
+    mkdir -p $dev/lib $out/bin
+    mv $out/lib/libcdb.a $dev/lib
+    rmdir $out/lib
+  '' + (if static then ''
+    cp cdb $out/bin/cdb
+  '' else ''
+    mkdir -p $lib/lib
+    cp libcdb.so* $lib/lib
+    cp cdb-shared $out/bin/cdb
+  '');
+
+  src = fetchurl {
+    url = "http://www.corpit.ru/mjt/tinycdb/${pname}-${version}.tar.gz";
+    sha256 = "0g6n1rr3lvyqc85g6z44lw9ih58f2k1i3v18yxlqvnla5m1qyrsh";
+  };
+
+  meta = with lib; {
+
+    description = "utility to manipulate constant databases (cdb)";
+
+    longDescription = ''
+      tinycdb is a small, fast and reliable utility and subroutine
+      library for creating and reading constant databases. The database
+      structure is tuned for fast reading.
+    '';
+
+    homepage = "https://www.corpit.ru/mjt/tinycdb.html";
+    license = licenses.publicDomain;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tinyobjloader/default.nix b/nixpkgs/pkgs/development/libraries/tinyobjloader/default.nix
new file mode 100644
index 000000000000..113e5f5ae95a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tinyobjloader/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "tinyobjloader";
+  version = "1.0.7";
+
+  src = fetchFromGitHub {
+    owner = "tinyobjloader";
+    repo = "tinyobjloader";
+    rev = "v${version}";
+    sha256 = "sha256-BNffbicnLTGK2GQ2/bB328LFU9fqHxrpAVj2hJaekWc=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://github.com/tinyobjloader/tinyobjloader";
+    description = "Tiny but powerful single file wavefront obj loader";
+    license = licenses.mit;
+    maintainers = [ maintainers.ivar ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tinyxml-2/default.nix b/nixpkgs/pkgs/development/libraries/tinyxml-2/default.nix
new file mode 100644
index 000000000000..1e2eea7ac899
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tinyxml-2/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "tinyxml-2";
+  version = "6.0.0";
+
+  src = fetchFromGitHub {
+    repo = "tinyxml2";
+    owner = "leethomason";
+    rev = version;
+    sha256 = "031fmhpah449h3rkyamzzdpzccrrfrvjb4qn6vx2vjm47jwc54qv";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = {
+    description = "A simple, small, efficient, C++ XML parser";
+    homepage = "http://www.grinninglizard.com/tinyxml2/index.html";
+    platforms = lib.platforms.unix;
+    license = lib.licenses.zlib;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2-add-pkgconfig.patch b/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2-add-pkgconfig.patch
new file mode 100644
index 000000000000..ca89685a458f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2-add-pkgconfig.patch
@@ -0,0 +1,13 @@
+--- a/tinyxml.pc	1970-01-01 01:00:00.000000000 +0100
++++ b/tinyxml.pc	2012-12-29 08:52:07.512266072 +0100
+@@ -0,0 +1,10 @@
++prefix=@out@
++exec_prefix=${prefix}
++libdir=${exec_prefix}/lib
++includedir=${prefix}/include
++
++Name: TinyXML
++Description: A simple, small, C++ XML parser
++Version: @version@
++Libs: -L${libdir} -ltinyxml
++Cflags: -I${includedir}
diff --git a/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2-cxx.patch b/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2-cxx.patch
new file mode 100644
index 000000000000..e55d0be43bcc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2-cxx.patch
@@ -0,0 +1,17 @@
+diff -u a/Makefile b/Makefile
+--- a/Makefile	2011-05-14 22:24:57.000000000 -0400
++++ b/Makefile	2016-04-01 14:53:05.000000000 -0400
+@@ -19,9 +19,9 @@
+ 
+ #****************************************************************************
+ 
+-CC     := gcc
+-CXX    := g++
+-LD     := g++
++CC     ?= gcc
++CXX    ?= g++
++LD     ?= g++
+ AR     := ar rc
+ RANLIB := ranlib
+ 
+Common subdirectories: a/docs and b/docs
diff --git a/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2-entity.patch b/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2-entity.patch
new file mode 100644
index 000000000000..3164261291ba
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2-entity.patch
@@ -0,0 +1,64 @@
+? entity.patch
+Index: a/tinyxml.cpp
+===================================================================
+RCS file: b/tinyxml.cpp,v
+retrieving revision 1.105
+diff -u -r1.105 a/tinyxml.cpp
+--- tinyxml.cpp	5 Jun 2010 19:06:57 -0000	1.105
++++ tinyxml.cpp	19 Jul 2010 21:24:16 -0000
+@@ -57,30 +57,7 @@
+ 	{
+ 		unsigned char c = (unsigned char) str[i];
+ 
+-		if (    c == '&' 
+-		     && i < ( (int)str.length() - 2 )
+-			 && str[i+1] == '#'
+-			 && str[i+2] == 'x' )
+-		{
+-			// Hexadecimal character reference.
+-			// Pass through unchanged.
+-			// &#xA9;	-- copyright symbol, for example.
+-			//
+-			// The -1 is a bug fix from Rob Laveaux. It keeps
+-			// an overflow from happening if there is no ';'.
+-			// There are actually 2 ways to exit this loop -
+-			// while fails (error case) and break (semicolon found).
+-			// However, there is no mechanism (currently) for
+-			// this function to return an error.
+-			while ( i<(int)str.length()-1 )
+-			{
+-				outString->append( str.c_str() + i, 1 );
+-				++i;
+-				if ( str[i] == ';' )
+-					break;
+-			}
+-		}
+-		else if ( c == '&' )
++		if ( c == '&' )
+ 		{
+ 			outString->append( entity[0].str, entity[0].strLength );
+ 			++i;
+Index: a/xmltest.cpp
+===================================================================
+RCS file: b/xmltest.cpp,v
+retrieving revision 1.89
+diff -u -r1.89 a/xmltest.cpp
+--- xmltest.cpp	5 Jun 2010 17:41:52 -0000	1.89
++++ xmltest.cpp	19 Jul 2010 21:24:16 -0000
+@@ -1340,6 +1340,16 @@
+ 		}*/
+ 	}
+ 
++	#ifdef TIXML_USE_STL
++	{
++		TiXmlDocument xml;
++		xml.Parse("<foo>foo&amp;#xa+bar</foo>");
++		std::string str;
++		str << xml;
++		XmlTest( "Entity escaping", "<foo>foo&amp;#xa+bar</foo>", str.c_str() );
++	}
++	#endif
++
+ 	/*  1417717 experiment
+ 	{
+ 		TiXmlDocument xml;
diff --git a/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2.nix b/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2.nix
new file mode 100644
index 000000000000..e8c5dd1dacdf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2.nix
@@ -0,0 +1,80 @@
+{ lib, stdenv, fetchurl, unzip }:
+
+let
+  version = "2.6.2";
+  SHLIB_EXT = stdenv.hostPlatform.extensions.sharedLibrary;
+in stdenv.mkDerivation {
+  pname = "tinyxml";
+  inherit version;
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/tinyxml/tinyxml/${version}/tinyxml_2_6_2.zip";
+    sha256 = "04nmw6im2d1xp12yir8va93xns5iz816pwi25n9cql3g3i8bjsxc";
+  };
+
+  patches = [
+    # add pkg-config file
+    ./2.6.2-add-pkgconfig.patch
+
+    # https://sourceforge.net/tracker/index.php?func=detail&aid=3031828&group_id=13559&atid=313559
+    ./2.6.2-entity.patch
+
+    # Use CC, CXX, and LD from environment
+    ./2.6.2-cxx.patch
+  ];
+
+  preConfigure = "export LD=${stdenv.cc.targetPrefix}c++";
+
+  hardeningDisable = [ "format" ];
+
+  NIX_CFLAGS_COMPILE =
+    lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.9";
+
+  nativeBuildInputs = [ unzip ];
+  buildPhase = ''
+    # use STL (xbmc requires it)
+    sed '1i#define TIXML_USE_STL 1' -i tinyxml.h
+    sed '1i#define TIXML_USE_STL 1' -i xmltest.cpp
+
+    # build xmltest
+    make
+
+    # build the lib as a shared library
+    ''${CXX} -Wall -O2 -shared -fpic tinyxml.cpp \
+    tinyxmlerror.cpp tinyxmlparser.cpp      \
+    tinystr.cpp -o libtinyxml${SHLIB_EXT}
+  '';
+
+  doCheck = true;
+  checkPhase = ''
+    ./xmltest
+    result=$?
+    if [[ $result != 0 ]] ; then
+      exit $result
+    fi
+  '';
+
+  installPhase = ''
+    mkdir -pv $out/include/
+    mkdir -pv $out/lib/pkgconfig/
+    mkdir -pv $out/share/doc/tinyxml/
+
+    cp -v libtinyxml${SHLIB_EXT} $out/lib/
+    cp -v *.h $out/include/
+
+    substituteInPlace tinyxml.pc --replace "@out@" "$out"
+    substituteInPlace tinyxml.pc --replace "@version@" "${version}"
+    cp -v tinyxml.pc $out/lib/pkgconfig/
+
+    cp -v docs/* $out/share/doc/tinyxml/
+  '' + lib.optionalString stdenv.isDarwin ''
+    install_name_tool -id $out/lib/libtinyxml.dylib $out/lib/libtinyxml.dylib
+  '';
+
+  meta = {
+    description = "Simple, small, C++ XML parser that can be easily integrating into other programs";
+    homepage = "http://www.grinninglizard.com/tinyxml/index.html";
+    license = lib.licenses.free;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tix/default.nix b/nixpkgs/pkgs/development/libraries/tix/default.nix
new file mode 100644
index 000000000000..c42847ef5335
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tix/default.nix
@@ -0,0 +1,54 @@
+{ lib, stdenv, fetchurl, tcl, tk, fetchpatch } :
+
+tcl.mkTclDerivation {
+  version = "8.4.3";
+  pname = "tix";
+  src = fetchurl {
+     url = "mirror://sourceforge/tix/tix/8.4.3/Tix8.4.3-src.tar.gz";
+     sha256 = "1jq3dkyk9mqkj4cg7mdk5r0cclqsby9l2b7wrysi0zk5yw7h8bsn";
+  };
+  patches = [
+  (fetchpatch {
+    name = "tix-8.4.3-tcl8.5.patch";
+    url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-tcltk/tix/files/tix-8.4.3-tcl8.5.patch?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d";
+    sha256 = "0wzqmcxxq0rqpnjgxz10spw92yhfygnlwv0h8pcx2ycnqiljz6vj";
+    })
+  ] ++ lib.optional (tcl.release == "8.6")
+  (fetchpatch {
+    name = "tix-8.4.3-tcl8.6.patch";
+    url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-tcltk/tix/files/tix-8.4.3-tcl8.6.patch?id=56bd759df1d0c750a065b8c845e93d5dfa6b549d";
+    sha256 = "1jaz0l22xj7x1k4rb9ia6i1psnbwk4pblgq4gfvya7gg7fbb7r36";
+    })
+  ;
+  buildInputs = [ tk ];
+  # the configure script expects to find the location of the sources of
+  # tcl and tk in {tcl,tk}Config.sh
+  # In fact, it only needs some private headers. We copy them in
+  # the private_headers folders and trick the configure script into believing
+  # the sources are here.
+  preConfigure = ''
+    mkdir -p private_headers/generic
+    < ${tcl}/lib/tclConfig.sh sed "s@TCL_SRC_DIR=.*@TCL_SRC_DIR=private_headers@" > tclConfig.sh
+    < ${tk}/lib/tkConfig.sh sed "s@TK_SRC_DIR=.*@TK_SRC_DIR=private_headers@" > tkConfig.sh
+    for i in ${tcl}/include/* ${tk.dev}/include/*; do
+      ln -s $i private_headers/generic;
+    done;
+    '';
+  addTclConfigureFlags = false;
+  configureFlags = [
+    "--with-tclconfig=."
+    "--with-tkinclude=${tk.dev}/include"
+    "--with-tkconfig=."
+    "--libdir=\${prefix}/lib"
+  ];
+
+  meta = with lib; {
+    description = "A widget library for Tcl/Tk";
+    homepage    = "http://tix.sourceforge.net/";
+    platforms   = platforms.all;
+    license     = with licenses; [
+      bsd2 # tix
+      gpl2 # patches from portage
+    ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tk/8.5.nix b/nixpkgs/pkgs/development/libraries/tk/8.5.nix
new file mode 100644
index 000000000000..3058af46ab57
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tk/8.5.nix
@@ -0,0 +1,10 @@
+{ callPackage, fetchurl, tcl, ... } @ args:
+
+callPackage ./generic.nix (args // {
+
+  src = fetchurl {
+    url = "mirror://sourceforge/tcl/tk${tcl.version}-src.tar.gz";
+    sha256 = "0an3wqkjzlyyq6l9l3nawz76axsrsppbyylx0zk9lkv7llrala03";
+  };
+
+})
diff --git a/nixpkgs/pkgs/development/libraries/tk/8.6.nix b/nixpkgs/pkgs/development/libraries/tk/8.6.nix
new file mode 100644
index 000000000000..fdffbeba2c93
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tk/8.6.nix
@@ -0,0 +1,12 @@
+{ callPackage, fetchurl, tcl, lib, stdenv, ... } @ args:
+
+callPackage ./generic.nix (args // {
+
+  src = fetchurl {
+    url = "mirror://sourceforge/tcl/tk${tcl.version}.1-src.tar.gz"; # TODO: remove '.1' for v8.6.10 or v8.7.x
+    sha256 = "1d7bfkxpacy33w5nahf73lkwxqpff44w1jplg7i2gmwgiaawvjwg";
+  };
+
+  patches = [ ./different-prefix-with-tcl.patch ] ++ lib.optionals stdenv.isDarwin [ ./Fix-bad-install_name-for-libtk8.6.dylib.patch ];
+
+})
diff --git a/nixpkgs/pkgs/development/libraries/tk/Fix-bad-install_name-for-libtk8.6.dylib.patch b/nixpkgs/pkgs/development/libraries/tk/Fix-bad-install_name-for-libtk8.6.dylib.patch
new file mode 100644
index 000000000000..528a75e1c91f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tk/Fix-bad-install_name-for-libtk8.6.dylib.patch
@@ -0,0 +1,29 @@
+From f90278dac42135acd55200b7d2153f44d72fec53 Mon Sep 17 00:00:00 2001
+From: Josef Knedl <josef.kemetmueller@aon.at>
+Date: Wed, 24 Feb 2016 00:37:40 +0100
+Subject: [PATCH] Fix bad install_name for libtk8.6.dylib
+
+This follows: https://trac.macports.org/ticket/37395
+and https://trac.macports.org/changeset/100816
+Alternative would be to use Quartz build instead:
+https://sourceforge.net/p/tktoolkit/bugs/3048/
+---
+ unix/Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/unix/Makefile.in b/unix/Makefile.in
+index f21fdbb..1b89256 100644
+--- a/unix/Makefile.in
++++ b/unix/Makefile.in
+@@ -283,7 +283,7 @@ CC_SEARCH_FLAGS	= @CC_SEARCH_FLAGS@
+ LD_SEARCH_FLAGS	= @LD_SEARCH_FLAGS@
+ 
+ # support for embedded libraries on Darwin / Mac OS X
+-DYLIB_INSTALL_DIR	= ${LIB_RUNTIME_DIR}
++DYLIB_INSTALL_DIR	= $(libdir)
+ 
+ # support for building the Aqua resource file
+ TK_RSRC_FILE		= @TK_RSRC_FILE@
+-- 
+2.7.1
+
diff --git a/nixpkgs/pkgs/development/libraries/tk/different-prefix-with-tcl.patch b/nixpkgs/pkgs/development/libraries/tk/different-prefix-with-tcl.patch
new file mode 100644
index 000000000000..aee46e149b1a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tk/different-prefix-with-tcl.patch
@@ -0,0 +1,25 @@
+diff --git a/generic/tkWindow.c b/generic/tkWindow.c
+index b5cbbab..96b5501 100644
+--- a/generic/tkWindow.c
++++ b/generic/tkWindow.c
+@@ -988,6 +988,7 @@ TkCreateMainWindow(
+ 
+     Tcl_SetVar2(interp, "tk_patchLevel", NULL, TK_PATCH_LEVEL, TCL_GLOBAL_ONLY);
+     Tcl_SetVar2(interp, "tk_version",    NULL, TK_VERSION,     TCL_GLOBAL_ONLY);
++    Tcl_SetVar2(interp, "tk_library",    NULL, TK_LIBRARY,     TCL_GLOBAL_ONLY);
+ 
+     tsdPtr->numMainWindows++;
+     return tkwin;
+diff --git a/unix/Makefile.in b/unix/Makefile.in
+index f21fdbb..c61b0df 100644
+--- a/unix/Makefile.in
++++ b/unix/Makefile.in
+@@ -1029,7 +1029,7 @@ tkVisual.o: $(GENERIC_DIR)/tkVisual.c
+ 	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkVisual.c
+ 
+ tkWindow.o: $(GENERIC_DIR)/tkWindow.c
+-	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkWindow.c
++	$(CC) -c $(CC_SWITCHES) -DTK_LIBRARY=\"${TK_LIBRARY}\" $(GENERIC_DIR)/tkWindow.c
+ 
+ tkButton.o: $(GENERIC_DIR)/tkButton.c
+ 	$(CC) -c $(CC_SWITCHES) $(GENERIC_DIR)/tkButton.c
diff --git a/nixpkgs/pkgs/development/libraries/tk/generic.nix b/nixpkgs/pkgs/development/libraries/tk/generic.nix
new file mode 100644
index 000000000000..b829d846be56
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tk/generic.nix
@@ -0,0 +1,61 @@
+{ stdenv, lib, src, pkg-config, tcl, libXft, patches ? []
+, enableAqua ? stdenv.isDarwin, darwin
+, ... }:
+
+tcl.mkTclDerivation {
+  name = "tk-${tcl.version}";
+
+  inherit src patches;
+
+  outputs = [ "out" "man" "dev" ];
+
+  setOutputFlags = false;
+
+  preConfigure = ''
+    configureFlagsArray+=(--mandir=$man/share/man --enable-man-symlinks)
+    cd unix
+  '';
+
+  postPatch = ''
+    for file in $(find library/demos/. -type f ! -name "*.*"); do
+      substituteInPlace $file --replace "exec wish" "exec $out/bin/wish"
+    done
+  '';
+
+  postInstall = ''
+    ln -s $out/bin/wish* $out/bin/wish
+    cp ../{unix,generic}/*.h $out/include
+    ln -s $out/lib/libtk${tcl.release}${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libtk${stdenv.hostPlatform.extensions.sharedLibrary}
+  ''
+  + lib.optionalString (stdenv.isDarwin) ''
+    cp ../macosx/*.h $out/include
+  '';
+
+  configureFlags = [
+    "--enable-threads"
+  ] ++ lib.optional stdenv.is64bit "--enable-64bit"
+    ++ lib.optional enableAqua "--enable-aqua";
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = lib.optional enableAqua (with darwin.apple_sdk.frameworks; [ Cocoa ]);
+
+  propagatedBuildInputs = [ libXft ];
+
+  doCheck = false; # fails. can't find itself
+
+  inherit tcl;
+
+  passthru = rec {
+    inherit (tcl) release version;
+    libPrefix = "tk${tcl.release}";
+    libdir = "lib/${libPrefix}";
+  };
+
+  meta = with lib; {
+    description = "A widget toolkit that provides a library of basic elements for building a GUI in many different programming languages";
+    homepage = "https://www.tcl.tk/";
+    license = licenses.tcltk;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ lovek323 vrthra ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tkrzw/default.nix b/nixpkgs/pkgs/development/libraries/tkrzw/default.nix
new file mode 100644
index 000000000000..e8163c5282c7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tkrzw/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "tkrzw";
+  version = "0.9.51";
+  # TODO: defeat multi-output reference cycles
+
+  src = fetchurl {
+    url = "https://dbmx.net/tkrzw/pkg/tkrzw-${version}.tar.gz";
+    hash = "sha256-UqF2cJ/r8OksAKyHw6B9UiBFIXgKeDmD2ZyJ+iPkY2w=";
+  };
+
+  enableParallelBuilding = true;
+
+  doCheck = false; # memory intensive
+
+  meta = with lib; {
+    description = "A set of implementations of DBM";
+    homepage = "https://dbmx.net/tkrzw/";
+    maintainers = with maintainers; [ ehmry ];
+    license = licenses.asl20;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tl-expected/default.nix b/nixpkgs/pkgs/development/libraries/tl-expected/default.nix
new file mode 100644
index 000000000000..4915fd7e700d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tl-expected/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "tl-expected-unstable";
+  version = "2019-11-11"; # 5 commits ahead of version 1.0.0
+
+  src = fetchFromGitHub {
+    owner = "TartanLlama";
+    repo = "expected";
+    rev = "1d9c5d8c0da84b8ddc54bd3d90d632eec95c1f13";
+    fetchSubmodules = true;
+    sha256 = "0rzfn9yyg70zwpxbmv22qy0015baymi2rdd65ixmcb31fgnap68i";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "C++11/14/17 std::expected with functional-style extensions";
+    homepage = "https://tl.tartanllama.xyz/en/latest/api/expected.html";
+    license = licenses.cc0;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ primeos ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tllist/default.nix b/nixpkgs/pkgs/development/libraries/tllist/default.nix
new file mode 100644
index 000000000000..ed957f95776c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tllist/default.nix
@@ -0,0 +1,46 @@
+{ stdenv
+, lib
+, fetchFromGitea
+, meson
+, ninja
+}:
+
+stdenv.mkDerivation rec {
+  pname = "tllist";
+  version = "1.0.5";
+
+  src = fetchFromGitea {
+    domain = "codeberg.org";
+    owner = "dnkl";
+    repo = "tllist";
+    rev = version;
+    sha256 = "wJEW7haQBtCR2rffKOFyqH3aq0eBr6H8T6gnBs2bNRg=";
+  };
+
+  nativeBuildInputs = [ meson ninja ];
+
+  mesonBuildType = "release";
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://codeberg.org/dnkl/tllist";
+    changelog = "https://codeberg.org/dnkl/tllist/releases/tag/${version}";
+    description = "C header file only implementation of a typed linked list";
+    longDescription = ''
+      Most C implementations of linked list are untyped. That is, their data
+      carriers are typically void *. This is error prone since your compiler
+      will not be able to help you correct your mistakes (oh, was it a
+      pointer-to-a-pointer... I thought it was just a pointer...).
+
+      tllist addresses this by using pre-processor macros to implement dynamic
+      types, where the data carrier is typed to whatever you want; both
+      primitive data types are supported as well as aggregated ones such as
+      structs, enums and unions.
+    '';
+
+    license = licenses.mit;
+    maintainers = with maintainers; [ fionera AndersonTorres ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tnt/default.nix b/nixpkgs/pkgs/development/libraries/tnt/default.nix
new file mode 100644
index 000000000000..f4787271c039
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tnt/default.nix
@@ -0,0 +1,25 @@
+{lib, stdenv, fetchurl, unzip}:
+
+stdenv.mkDerivation {
+  pname = "tnt";
+  version = "3.0.12";
+
+  src = fetchurl {
+    url = "https://math.nist.gov/tnt/tnt_3_0_12.zip";
+    sha256 = "1bzkfdb598584qlc058n8wqq9vbz714gr5r57401rsa9qaxhk5j7";
+  };
+
+  nativeBuildInputs = [ unzip ];
+
+  installPhase = ''
+      mkdir -p $out/include
+      cp *.h $out/include
+  '';
+
+  meta = {
+    homepage = "https://math.nist.gov/tnt/";
+    description = "Template Numerical Toolkit: C++ headers for array and matrices";
+    license = lib.licenses.publicDomain;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tntdb/default.nix b/nixpkgs/pkgs/development/libraries/tntdb/default.nix
new file mode 100644
index 000000000000..a21a71b89bfd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tntdb/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, cxxtools, postgresql, libmysqlclient, sqlite, zlib, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "tntdb";
+  version = "1.3";
+
+  src = fetchurl {
+    url = "http://www.tntnet.org/download/${pname}-${version}.tar.gz";
+    sha256 = "0js79dbvkic30bzw1pf26m64vs2ssw2sbj55w1dc0sy69dlv4fh9";
+  };
+
+  buildInputs = [ cxxtools postgresql libmysqlclient sqlite zlib openssl ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "http://www.tntnet.org/tntdb.html";
+    description = "C++ library which makes accessing SQL databases easy and robust";
+    platforms = platforms.linux ;
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.juliendehos ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tntnet/default.nix b/nixpkgs/pkgs/development/libraries/tntnet/default.nix
new file mode 100644
index 000000000000..a80b923e2358
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tntnet/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl, cxxtools, zlib, openssl, zip }:
+
+stdenv.mkDerivation rec {
+  pname = "tntnet";
+  version = "2.2.1";
+
+  src = fetchurl {
+    url = "http://www.tntnet.org/download/${pname}-${version}.tar.gz";
+    sha256 = "08bmak9mpbamwwl3h9p8x5qzwqlm9g3jh70y0ml5hk7hiv870cf8";
+  };
+
+  buildInputs = [ cxxtools zlib openssl zip ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "http://www.tntnet.org/tntnet.html";
+    description = "Web server which allows users to develop web applications using C++";
+    platforms = platforms.linux ;
+    license = licenses.lgpl21;
+    maintainers = [ maintainers.juliendehos ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tokyo-cabinet/default.nix b/nixpkgs/pkgs/development/libraries/tokyo-cabinet/default.nix
new file mode 100644
index 000000000000..4b3c8a363eb4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tokyo-cabinet/default.nix
@@ -0,0 +1,44 @@
+{ fetchurl, lib, stdenv, zlib, bzip2 }:
+
+stdenv.mkDerivation rec {
+  pname = "tokyocabinet";
+  version = "1.4.48";
+
+  src = fetchurl {
+    url = "https://dbmx.net/tokyocabinet/${pname}-${version}.tar.gz";
+    sha256 = "140zvr0n8kvsl0fbn2qn3f2kh3yynfwnizn4dgbj47m975yg80x0";
+  };
+
+  buildInputs = [ zlib bzip2 ];
+
+  postInstall =
+    '' sed -i "$out/lib/pkgconfig/tokyocabinet.pc" \
+           -e 's|-lz|-L${zlib.out}/lib -lz|g;
+               s|-lbz2|-L${bzip2.out}/lib -lbz2|g'
+    '';
+
+  meta = {
+    description = "Tokyo Cabinet: a modern implementation of DBM";
+
+    longDescription =
+      '' Tokyo Cabinet is a library of routines for managing a database. The
+         database is a simple data file containing records, each is a pair of
+         a key and a value.  Every key and value is serial bytes with
+         variable length.  Both binary data and character string can be used
+         as a key and a value.  There is neither concept of data tables nor
+         data types.  Records are organized in hash table, B+ tree, or
+         fixed-length array.
+
+         Tokyo Cabinet is developed as the successor of GDBM and QDBM on the
+         following purposes.  They are achieved and Tokyo Cabinet replaces
+         conventional DBM products: improves space efficiency, improves time
+         efficiency, improves parallelism, improves usability, improves
+         robustness, supports 64-bit architecture.
+      '';
+
+    license = lib.licenses.lgpl2Plus;
+
+    maintainers = [ ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tokyo-tyrant/default.nix b/nixpkgs/pkgs/development/libraries/tokyo-tyrant/default.nix
new file mode 100644
index 000000000000..6431e6a1a7a5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tokyo-tyrant/default.nix
@@ -0,0 +1,41 @@
+{ fetchurl, lib, stdenv, tokyocabinet, pkg-config }:
+
+stdenv.mkDerivation rec {
+  name = "tokyotyrant-1.1.41";
+
+  src = fetchurl {
+    url = "https://fallabs.com/tokyotyrant/${name}.tar.gz";
+    sha256 = "13xqcinhydqmh7231qlir6pymacjwcf98drybkhd9597kzxp1bs2";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ tokyocabinet ];
+
+  doCheck = false;                                # FIXME
+
+  meta = {
+    description = "Network interface of the Tokyo Cabinet DBM";
+
+    longDescription =
+      '' Tokyo Tyrant is a package of network interface to the DBM called
+         Tokyo Cabinet.  Though the DBM has high performance, you might
+         bother in case that multiple processes share the same database, or
+         remote processes access the database.  Thus, Tokyo Tyrant is
+         provided for concurrent and remote connections to Tokyo Cabinet.  It
+         is composed of the server process managing a database and its access
+         library for client applications.
+
+         Tokyo Tyrant is written in the C language, and provided as API of C,
+         Perl, and Ruby.  Tokyo Tyrant is available on platforms which have
+         API conforming to C99 and POSIX.  Tokyo Tyrant is a free software
+         licensed under the GNU Lesser General Public License.
+       '';
+
+    homepage = "https://fallabs.com/tokyotyrant/";
+
+    license = lib.licenses.lgpl21Plus;
+
+    platforms = lib.platforms.gnu ++ lib.platforms.linux;         # arbitrary choice
+    maintainers = [ ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/totem-pl-parser/default.nix b/nixpkgs/pkgs/development/libraries/totem-pl-parser/default.nix
new file mode 100644
index 000000000000..1a180be283fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/totem-pl-parser/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, gettext, libxml2, gobject-introspection, gnome, glib }:
+
+stdenv.mkDerivation rec {
+  pname = "totem-pl-parser";
+  version = "3.26.6";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "wN8PaNXPnX2kPIHH8T8RFYNYNo+Ywi1Hci870EvTrBw=";
+  };
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  strictDeps = true;
+  depsBuildBuild = [ pkg-config ];
+  nativeBuildInputs = [ meson ninja pkg-config gettext glib gobject-introspection ];
+  buildInputs = [ libxml2 glib ];
+
+  mesonFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+    "-Dintrospection=false"
+  ];
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Apps/Videos";
+    description = "Simple GObject-based library to parse and save a host of playlist formats";
+    maintainers = teams.gnome.members;
+    license = licenses.lgpl2;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tpm2-tss/default.nix b/nixpkgs/pkgs/development/libraries/tpm2-tss/default.nix
new file mode 100644
index 000000000000..a272cf8b9340
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tpm2-tss/default.nix
@@ -0,0 +1,74 @@
+{ stdenv, lib, fetchFromGitHub
+, autoreconfHook, autoconf-archive, pkg-config, doxygen, perl
+, openssl, json_c, curl, libgcrypt
+, cmocka, uthash, ibm-sw-tpm2, iproute2, procps, which
+}:
+
+stdenv.mkDerivation rec {
+  pname = "tpm2-tss";
+  version = "3.0.3";
+
+  src = fetchFromGitHub {
+    owner = "tpm2-software";
+    repo = pname;
+    rev = version;
+    sha256 = "106yhsjwjadxsl9dqxywg287mdwsksman02hdalhav18vcnvnlpj";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook autoconf-archive pkg-config doxygen perl
+  ];
+  buildInputs = [ openssl json_c curl libgcrypt ];
+  checkInputs = [
+    cmocka uthash ibm-sw-tpm2 iproute2 procps which
+  ];
+
+  preAutoreconf = "./bootstrap";
+
+  enableParallelBuilding = true;
+
+  patches = [
+    # Do not rely on dynamic loader path
+    # TCTI loader relies on dlopen(), this patch prefixes all calls with the output directory
+    ./no-dynamic-loader-path.patch
+  ];
+
+  postPatch = ''
+    patchShebangs script
+    substituteInPlace src/tss2-tcti/tctildr-dl.c \
+      --replace '@PREFIX@' $out/lib/
+    substituteInPlace ./test/unit/tctildr-dl.c \
+      --replace ', "libtss2' ", \"$out/lib/libtss2" \
+      --replace ', "foo' ", \"$out/lib/foo" \
+      --replace ', TEST_TCTI_NAME' ", \"$out/lib/\"TEST_TCTI_NAME"
+  '';
+
+  configureFlags = [
+    "--enable-unit"
+    "--enable-integration"
+  ];
+
+  doCheck = true;
+  preCheck = ''
+    # Since we rewrote the load path in the dynamic loader for the TCTI
+    # The various tcti implementation should be placed in their target directory
+    # before we could run tests
+    installPhase
+    # install already done, dont need another one
+    dontInstall=1
+  '';
+
+  postInstall = ''
+    # Do not install the upstream udev rules, they rely on specific
+    # users/groups which aren't guaranteed to exist on the system.
+    rm -R $out/lib/udev
+  '';
+
+  meta = with lib; {
+    description = "OSS implementation of the TCG TPM2 Software Stack (TSS2)";
+    homepage = "https://github.com/tpm2-software/tpm2-tss";
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ delroth ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tpm2-tss/no-dynamic-loader-path.patch b/nixpkgs/pkgs/development/libraries/tpm2-tss/no-dynamic-loader-path.patch
new file mode 100644
index 000000000000..86cdcd1541e6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tpm2-tss/no-dynamic-loader-path.patch
@@ -0,0 +1,39 @@
+diff --git a/src/tss2-tcti/tctildr-dl.c b/src/tss2-tcti/tctildr-dl.c
+index b364695c..b13be3ef 100644
+--- a/src/tss2-tcti/tctildr-dl.c
++++ b/src/tss2-tcti/tctildr-dl.c
+@@ -85,7 +85,15 @@ handle_from_name(const char *file,
+     if (handle == NULL) {
+         return TSS2_TCTI_RC_BAD_REFERENCE;
+     }
+-    *handle = dlopen(file, RTLD_NOW);
++    size = snprintf(file_xfrm,
++                    sizeof (file_xfrm),
++                    "@PREFIX@%s",
++                    file);
++    if (size >= sizeof (file_xfrm)) {
++        LOG_ERROR("TCTI name truncated in transform.");
++        return TSS2_TCTI_RC_BAD_VALUE;
++    }
++    *handle = dlopen(file_xfrm, RTLD_NOW);
+     if (*handle != NULL) {
+         return TSS2_RC_SUCCESS;
+     } else {
+@@ -94,7 +102,7 @@ handle_from_name(const char *file,
+     /* 'name' alone didn't work, try libtss2-tcti-<name>.so.0 */
+     size = snprintf(file_xfrm,
+                     sizeof (file_xfrm),
+-                    TCTI_NAME_TEMPLATE_0,
++                    "@PREFIX@" TCTI_NAME_TEMPLATE_0,
+                     file);
+     if (size >= sizeof (file_xfrm)) {
+         LOG_ERROR("TCTI name truncated in transform.");
+@@ -109,7 +117,7 @@ handle_from_name(const char *file,
+     /* libtss2-tcti-<name>.so.0 didn't work, try libtss2-tcti-<name>.so */
+     size = snprintf(file_xfrm,
+                     sizeof (file_xfrm),
+-                    TCTI_NAME_TEMPLATE,
++                    "@PREFIX@" TCTI_NAME_TEMPLATE,
+                     file);
+     if (size >= sizeof (file_xfrm)) {
+         LOG_ERROR("TCTI name truncated in transform.");
diff --git a/nixpkgs/pkgs/development/libraries/tracker-miners/default.nix b/nixpkgs/pkgs/development/libraries/tracker-miners/default.nix
new file mode 100644
index 000000000000..a5553dd0d00a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tracker-miners/default.nix
@@ -0,0 +1,141 @@
+{ lib, stdenv
+, fetchurl
+, substituteAll
+, asciidoc
+, docbook-xsl-nons
+, docbook_xml_dtd_45
+, gettext
+, itstool
+, libxslt
+, gexiv2
+, tracker
+, meson
+, ninja
+, pkg-config
+, vala
+, wrapGAppsHook
+, bzip2
+, dbus
+, evolution-data-server
+, exempi
+, giflib
+, glib
+, gnome
+, gst_all_1
+, icu
+, json-glib
+, libcue
+, libexif
+, libgsf
+, libgxps
+, libiptcdata
+, libjpeg
+, libosinfo
+, libpng
+, libseccomp
+, libsoup
+, libtiff
+, libuuid
+, libxml2
+, networkmanager
+, poppler
+, systemd
+, taglib
+, upower
+, totem-pl-parser
+}:
+
+stdenv.mkDerivation rec {
+  pname = "tracker-miners";
+  version = "3.1.1";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-5NNhNRsVbyhipSRBX76/BTnHgc2HxmKWYvAmW0gDuLg=";
+  };
+
+  nativeBuildInputs = [
+    asciidoc
+    docbook-xsl-nons
+    docbook_xml_dtd_45
+    gettext
+    itstool
+    libxslt
+    meson
+    ninja
+    pkg-config
+    vala
+    wrapGAppsHook
+  ];
+
+  # TODO: add libenca, libosinfo
+  buildInputs = [
+    bzip2
+    dbus
+    evolution-data-server
+    exempi
+    giflib
+    glib
+    gexiv2
+    totem-pl-parser
+    tracker
+    gst_all_1.gst-plugins-base
+    gst_all_1.gstreamer
+    icu
+    json-glib
+    libcue
+    libexif
+    libgsf
+    libgxps
+    libiptcdata
+    libjpeg
+    libosinfo
+    libpng
+    libseccomp
+    libsoup
+    libtiff
+    libuuid
+    libxml2
+    networkmanager
+    poppler
+    systemd
+    taglib
+    upower
+  ];
+
+  mesonFlags = [
+    # TODO: tests do not like our sandbox
+    "-Dfunctional_tests=false"
+
+    # libgrss is unmaintained and has no new releases since 2015, and an open
+    # security issue since then. Despite a patch now being availab, we're opting
+    # to be safe due to the general state of the project
+    "-Dminer_rss=false"
+  ];
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      inherit asciidoc;
+    })
+  ];
+
+  postInstall = ''
+    glib-compile-schemas "$out/share/glib-2.0/schemas"
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Projects/Tracker";
+    description = "Desktop-neutral user information store, search tool and indexer";
+    maintainers = teams.gnome.members;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tracker-miners/fix-paths.patch b/nixpkgs/pkgs/development/libraries/tracker-miners/fix-paths.patch
new file mode 100644
index 000000000000..8661648eacdf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tracker-miners/fix-paths.patch
@@ -0,0 +1,13 @@
+diff --git a/docs/manpages/meson.build b/docs/manpages/meson.build
+index 0b8a64863..a09db59f0 100644
+--- a/docs/manpages/meson.build
++++ b/docs/manpages/meson.build
+@@ -43,7 +43,7 @@ foreach m : daemon_manpages + cli_manpages
+     command: [xsltproc,
+               '--output', '@OUTPUT@',
+               '--stringparam', 'man.authors.section.enabled', '0',
+-              '/etc/asciidoc/docbook-xsl/manpage.xsl', '@INPUT@'],
++              '@asciidoc@/etc/asciidoc/docbook-xsl/manpage.xsl', '@INPUT@'],
+     input: xml,
+     output: manpage,
+     install: true,
diff --git a/nixpkgs/pkgs/development/libraries/tracker/default.nix b/nixpkgs/pkgs/development/libraries/tracker/default.nix
new file mode 100644
index 000000000000..0ee5e0fa5672
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tracker/default.nix
@@ -0,0 +1,149 @@
+{ lib, stdenv
+, fetchurl
+, fetchpatch
+, gettext
+, meson
+, ninja
+, pkg-config
+, asciidoc
+, gobject-introspection
+, python3
+, gtk-doc
+, docbook-xsl-nons
+, docbook_xml_dtd_45
+, libxml2
+, glib
+, wrapGAppsNoGuiHook
+, vala
+, sqlite
+, libxslt
+, libstemmer
+, gnome
+, icu
+, libuuid
+, libsoup
+, json-glib
+, systemd
+, dbus
+, substituteAll
+}:
+
+stdenv.mkDerivation rec {
+  pname = "tracker";
+  version = "3.1.1";
+
+  outputs = [ "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-Q3bi6YRUBm9E96JC5FuZs7/kwDtn+rGauw7Vhsp0iuc=";
+  };
+
+  patches = [
+    (substituteAll {
+      src = ./fix-paths.patch;
+      inherit asciidoc;
+    })
+
+    # Add missing build target dependencies to fix parallel building of docs.
+    # TODO: Upstream this.
+    ./fix-docs.patch
+
+    # Fix 32bit datetime issue, use this upstream patch until 3.1.2 lands
+    # https://gitlab.gnome.org/GNOME/tracker/-/merge_requests/401
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/tracker/merge_requests/401.patch";
+      sha256 = "QEf+ciGkkCzanmtGO0aig6nAxd+NxjvuNi4RbNOwZEA=";
+    })
+  ];
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    vala
+    pkg-config
+    asciidoc
+    gettext
+    libxslt
+    wrapGAppsNoGuiHook
+    gobject-introspection
+    gtk-doc
+    docbook-xsl-nons
+    docbook_xml_dtd_45
+    python3 # for data-generators
+    systemd # used for checks to install systemd user service
+    dbus # used for checks and pkg-config to install dbus service/s
+  ];
+
+  buildInputs = [
+    glib
+    libxml2
+    sqlite
+    icu
+    libsoup
+    libuuid
+    json-glib
+    libstemmer
+  ];
+
+  checkInputs = with python3.pkgs; [
+    pygobject3
+    tappy
+  ];
+
+  mesonFlags = [
+    "-Ddocs=true"
+  ];
+
+  doCheck = true;
+
+  postPatch = ''
+    patchShebangs utils/g-ir-merge/g-ir-merge
+    patchShebangs utils/data-generators/cc/generate
+    patchShebangs tests/functional-tests/test-runner.sh.in
+    patchShebangs tests/functional-tests/*.py
+    patchShebangs examples/python/endpoint.py
+  '';
+
+  preCheck = ''
+    # (tracker-store:6194): Tracker-CRITICAL **: 09:34:07.722: Cannot initialize database: Could not open sqlite3 database:'/homeless-shelter/.cache/tracker/meta.db': unable to open database file
+    export HOME=$(mktemp -d)
+
+    # Our gobject-introspection patches make the shared library paths absolute
+    # in the GIR files. When running functional tests, the library is not yet installed,
+    # though, so we need to replace the absolute path with a local one during build.
+    # We are using a symlink that will be overridden during installation.
+    mkdir -p $out/lib
+    ln -s $PWD/src/libtracker-sparql/libtracker-sparql-3.0.so $out/lib/libtracker-sparql-3.0.so.0
+  '';
+
+  checkPhase = ''
+    runHook preCheck
+
+    dbus-run-session \
+      --config-file=${dbus.daemon}/share/dbus-1/session.conf \
+      meson test --print-errorlogs
+
+    runHook postCheck
+  '';
+
+  postCheck = ''
+    # Clean up out symlinks
+    rm -r $out/lib
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "none";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://wiki.gnome.org/Projects/Tracker";
+    description = "Desktop-neutral user information store, search tool and indexer";
+    maintainers = teams.gnome.members;
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tracker/fix-docs.patch b/nixpkgs/pkgs/development/libraries/tracker/fix-docs.patch
new file mode 100644
index 000000000000..a6ff84cda3e5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tracker/fix-docs.patch
@@ -0,0 +1,28 @@
+diff --git a/docs/reference/libtracker-sparql/examples/meson.build b/docs/reference/libtracker-sparql/examples/meson.build
+index 1cb1d9f3f..313c72345 100644
+--- a/docs/reference/libtracker-sparql/examples/meson.build
++++ b/docs/reference/libtracker-sparql/examples/meson.build
+@@ -1,20 +1,20 @@
+ executable(
+   'readonly-example',
+   'readonly-example.c',
+-  dependencies: tracker_sparql_dep,
++  dependencies: [tracker_common_dep, tracker_sparql_dep],
+   build_by_default: true
+ )
+ 
+ executable(
+   'writeonly-example',
+   'writeonly-example.c',
+-  dependencies: tracker_sparql_dep,
++  dependencies: [tracker_common_dep, tracker_sparql_dep],
+   build_by_default: true
+ )
+ 
+ executable(
+   'writeonly-with-blank-nodes-example',
+   'writeonly-with-blank-nodes-example.c',
+-  dependencies: tracker_sparql_dep,
++  dependencies: [tracker_common_dep, tracker_sparql_dep],
+   build_by_default: true
+ )
diff --git a/nixpkgs/pkgs/development/libraries/tracker/fix-paths.patch b/nixpkgs/pkgs/development/libraries/tracker/fix-paths.patch
new file mode 100644
index 000000000000..5e4d8657f7bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tracker/fix-paths.patch
@@ -0,0 +1,13 @@
+diff --git a/docs/manpages/meson.build b/docs/manpages/meson.build
+index f90c757cf..40d9c939d 100644
+--- a/docs/manpages/meson.build
++++ b/docs/manpages/meson.build
+@@ -32,7 +32,7 @@ foreach m : manpages
+     command: [xsltproc,
+               '--output', '@OUTPUT@',
+               '--stringparam', 'man.authors.section.enabled', '0',
+-              '/etc/asciidoc/docbook-xsl/manpage.xsl', '@INPUT@'],
++              '@asciidoc@/etc/asciidoc/docbook-xsl/manpage.xsl', '@INPUT@'],
+     input: xml,
+     output: manpage,
+     install: true,
diff --git a/nixpkgs/pkgs/development/libraries/tre/default.nix b/nixpkgs/pkgs/development/libraries/tre/default.nix
new file mode 100644
index 000000000000..9ac026ee94b8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tre/default.nix
@@ -0,0 +1,24 @@
+{lib, stdenv, fetchurl, fetchpatch}:
+
+stdenv.mkDerivation rec {
+  pname = "tre";
+  version = "0.8.0";
+  src = fetchurl {
+    url = "https://laurikari.net/tre/${pname}-${version}.tar.gz";
+    sha256 = "1pd7qsa7vc3ybdc6h2gr4pm9inypjysf92kab945gg4qa6jp11my";
+  };
+
+  patches = [
+    (fetchpatch {
+      url = "https://sources.debian.net/data/main/t/tre/0.8.0-6/debian/patches/03-cve-2016-8859";
+      sha256 = "0navhizym6qxd4gngrsslbij8x9r3s67p1jzzhvsnq6ky49j7w3p";
+    })
+  ];
+
+  meta = {
+    description = "Lightweight and robust POSIX compliant regexp matching library";
+    homepage = "https://laurikari.net/tre/";
+    platforms = lib.platforms.unix;
+    license = lib.licenses.bsd2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tremor/default.nix b/nixpkgs/pkgs/development/libraries/tremor/default.nix
new file mode 100644
index 000000000000..16e1a78d396e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tremor/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitLab, autoreconfHook, pkg-config, libogg }:
+
+stdenv.mkDerivation {
+  name = "tremor-unstable-2018-03-16";
+
+  src = fetchFromGitLab {
+    owner = "xiph";
+    repo = "tremor";
+    domain = "gitlab.xiph.org";
+    rev = "562307a4a7082e24553f3d2c55dab397a17c4b4f";
+    sha256 = "0m07gq4zfgigsiz8b518xyb19v7qqp76qmp7lb262825vkqzl3zq";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  propagatedBuildInputs = [ libogg ];
+
+  preConfigure = ''
+    sed -i /XIPH_PATH_OGG/d configure
+  '';
+
+  meta = {
+    homepage = "https://xiph.org/tremor/";
+    description = "Fixed-point version of the Ogg Vorbis decoder";
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/trompeloeil/default.nix b/nixpkgs/pkgs/development/libraries/trompeloeil/default.nix
new file mode 100644
index 000000000000..8a6f03dd99ea
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/trompeloeil/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "trompeloeil";
+  version = "41";
+
+  src = fetchFromGitHub {
+    owner = "rollbear";
+    repo = "trompeloeil";
+    rev = "v${version}";
+    sha256 = "sha256-NsWRN520K4FLp+8W83bXT6pgQEADYFnWiB6gy3MjsWY=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Header only C++14 mocking framework";
+    homepage = "https://github.com/rollbear/trompeloeil";
+    license = licenses.boost;
+    maintainers = [ maintainers.bjornfor ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tsocks/default.nix b/nixpkgs/pkgs/development/libraries/tsocks/default.nix
new file mode 100644
index 000000000000..728c6e71f7fb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tsocks/default.nix
@@ -0,0 +1,36 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "tsocks";
+  version = "1.8beta5";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/tsocks/${pname}-${version}.tar.gz";
+    sha256 = "0ixkymiph771dcdzvssi9dr2pk1bzaw9zv85riv3xl40mzspx7c4";
+  };
+
+  patches = [ ./poll.patch ];
+
+  preConfigure = ''
+    sed -i -e "s,\\\/usr,"$(echo $out|sed -e "s,\\/,\\\\\\\/,g")",g" tsocks
+    substituteInPlace tsocks --replace /usr $out
+    export configureFlags="$configureFlags --libdir=$out/lib"
+  '';
+
+  preBuild = ''
+    # We don't need the saveme binary, it is in fact never stored and we're
+    # never injecting stuff into ld.so.preload anyway
+    sed -i \
+      -e "s,TARGETS=\(.*\)..SAVE.\(.*\),TARGETS=\1\2," \
+      -e "/SAVE/d" Makefile
+  '';
+
+  meta = with lib; {
+    description = "Transparent SOCKS v4 proxying library";
+    homepage = "http://tsocks.sourceforge.net/";
+    license = lib.licenses.gpl2;
+    maintainers = with maintainers; [ edwtjo phreedom ];
+    platforms = platforms.unix;
+    broken = stdenv.hostPlatform.isDarwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/tsocks/poll.patch b/nixpkgs/pkgs/development/libraries/tsocks/poll.patch
new file mode 100644
index 000000000000..2bfeb9f779ca
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tsocks/poll.patch
@@ -0,0 +1,26 @@
+From Ingo Hadan <ingo.hadan@sdm.de> Fri, 02 Apr 2010 21:08:50 +0200
+From: Julien Moutinho <julm+tsocks@autogeree.net>
+Date: Fri, 26 Apr 2013 01:57:26 +0200
+Subject: tsocks fails if socksified application uses poll(2) (e.g. subversion-1.5)
+
+---
+diff --git a/tsocks.c b/tsocks.c
+index 9cfdfff..470babd 100644
+--- a/tsocks.c
++++ b/tsocks.c
+@@ -657,10 +657,11 @@ int poll(POLL_SIGNATURE) {
+              * be ready for writing), otherwise we'll just let the select loop
+              * come around again (since we can't flag it for read, we don't know
+              * if there is any data to be read and can't be bothered checking) */
+-            if (conn->selectevents & WRITE) {
+-               setevents |= POLLOUT; 
++            if (conn->selectevents & POLLOUT) {
++               ufds[i].revents |= POLLOUT; 
+                nevents++;
+             }
++            ufds[i].events = conn->selectevents;
+          }
+       }
+    } while (nevents == 0);
+
+
diff --git a/nixpkgs/pkgs/development/libraries/tweeny/default.nix b/nixpkgs/pkgs/development/libraries/tweeny/default.nix
new file mode 100644
index 000000000000..0afc82321d8c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/tweeny/default.nix
@@ -0,0 +1,31 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "tweeny";
+  version = "3.2.0";
+
+  src = fetchFromGitHub {
+    owner = "mobius3";
+    repo = "tweeny";
+    rev = "v${version}";
+    sha256 = "sha256-VmvOMK+FjYZXKH9kPUT2L7pmJMPSr5eXptCcoGWK+qo=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A modern C++ tweening library";
+    license = licenses.mit;
+    homepage = "http://mobius3.github.io/tweeny";
+    maintainers = [ maintainers.doronbehar ];
+    platforms = with platforms; darwin ++ linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/twolame/default.nix b/nixpkgs/pkgs/development/libraries/twolame/default.nix
new file mode 100644
index 000000000000..3537dd3029b6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/twolame/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub
+, autoreconfHook, pkg-config
+, libsndfile }:
+
+stdenv.mkDerivation {
+
+  pname = "twolame";
+  version = "2017-09-27";
+
+  src = fetchFromGitHub {
+    owner = "njh";
+    repo = "twolame";
+    rev = "977c8ac55d8ca6d5f35d1d413a119dac2b3b0333";
+    sha256 = "1rq3yc8ygzdqid9zk6pixmm4w9sk2vrlx217lhn5bjaglv7iyf7x";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ libsndfile ];
+
+  doCheck = false; # fails with "../build-scripts/test-driver: line 107: -Mstrict: command not found"
+
+  meta = with lib;{
+    description = "A MP2 encoder";
+    longDescription = ''
+      TwoLAME is an optimised MPEG Audio Layer 2 (MP2) encoder based on
+      tooLAME by Mike Cheng, which in turn is based upon the ISO dist10
+      code and portions of LAME.
+    '';
+    homepage = "https://www.twolame.org/";
+    license = with licenses; [ lgpl2Plus ];
+    platforms = with platforms; unix;
+    maintainers = with maintainers; [ AndersonTorres ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ubus/default.nix b/nixpkgs/pkgs/development/libraries/ubus/default.nix
new file mode 100644
index 000000000000..4bbec39291a9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ubus/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, cmake, fetchgit, libubox, libjson }:
+
+stdenv.mkDerivation {
+  pname = "ubus";
+  version = "unstable-2021-02-15";
+
+  src = fetchgit {
+    url = "https://git.openwrt.org/project/ubus.git";
+    rev = "2537be01858710e714c329153760c64fe3f8a73e";
+    sha256 = "03ljxsn4w87bfrilccxhrkzqmd30hy6ihkvsinw0i3l7rpp5m4a7";
+  };
+
+  cmakeFlags = [ "-DBUILD_LUA=OFF" ];
+  buildInputs = [ libubox libjson ];
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "OpenWrt system message/RPC bus";
+    homepage = "https://git.openwrt.org/?p=project/ubus.git;a=summary";
+    license = licenses.lgpl21Only;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ petabyteboy ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/uci/default.nix b/nixpkgs/pkgs/development/libraries/uci/default.nix
new file mode 100644
index 000000000000..49aba6cd1831
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/uci/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, cmake, fetchgit, pkg-config, libubox }:
+
+stdenv.mkDerivation {
+  pname = "uci";
+  version = "unstable-2021-04-14";
+
+  src = fetchgit {
+    url = "https://git.openwrt.org/project/uci.git";
+    rev = "4b3db1179747b6a6779029407984bacef851325c";
+    sha256 = "1zflxazazzkrycpflzfg420kzp7kgy4dlz85cms279vk07dc1d52";
+  };
+
+  hardeningDisable = [ "all" ];
+  cmakeFlags = [ "-DBUILD_LUA=OFF" ];
+  buildInputs = [ libubox ];
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  meta = with lib; {
+    description = "OpenWrt Unified Configuration Interface";
+    homepage = "https://git.openwrt.org/?p=project/uci.git;a=summary";
+    license = licenses.lgpl21Only;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ petabyteboy ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ucl/default.nix b/nixpkgs/pkgs/development/libraries/ucl/default.nix
new file mode 100644
index 000000000000..43f7ddf63af9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ucl/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation {
+  name = "ucl-1.03";
+  src = fetchurl {
+    url = "https://www.oberhumer.com/opensource/ucl/download/ucl-1.03.tar.gz";
+    sha256 = "b865299ffd45d73412293369c9754b07637680e5c826915f097577cd27350348";
+  };
+
+  # needed to successfully compile with gcc 6
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-std=c90";
+
+  meta = {
+    homepage = "http://www.oberhumer.com/opensource/ucl/";
+    description = "Portable lossless data compression library";
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ucommon/default.nix b/nixpkgs/pkgs/development/libraries/ucommon/default.nix
new file mode 100644
index 000000000000..7306243bca9d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ucommon/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchurl, pkg-config
+, openssl ? null, zlib ? null, gnutls ? null
+}:
+
+let
+  xor = a: b: (a || b) && (!(a && b));
+in
+
+assert xor (openssl != null) (gnutls != null);
+assert !(xor (openssl != null) (zlib != null));
+
+stdenv.mkDerivation rec {
+  pname = "ucommon";
+  version = "7.0.0";
+
+  src = fetchurl {
+    url = "mirror://gnu/commoncpp/${pname}-${version}.tar.gz";
+    sha256 = "6ac9f76c2af010f97e916e4bae1cece341dc64ca28e3881ff4ddc3bc334060d7";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  # disable flaky networking test
+  postPatch = ''
+    substituteInPlace test/stream.cpp \
+      --replace 'ifndef UCOMMON_SYSRUNTIME' 'if 0'
+  '';
+
+  # ucommon.pc has link time depdendencies on -lssl, -lcrypto, -lz, -lgnutls
+  propagatedBuildInputs = [ openssl zlib gnutls ];
+
+  doCheck = true;
+
+  meta = {
+    description = "C++ library to facilitate using C++ design patterns";
+    homepage = "https://www.gnu.org/software/commoncpp/";
+    license = lib.licenses.lgpl3Plus;
+
+    maintainers = with lib.maintainers; [ ];
+    platforms = lib.platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ucx/default.nix b/nixpkgs/pkgs/development/libraries/ucx/default.nix
new file mode 100644
index 000000000000..7e1f36f0f96e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ucx/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, doxygen
+, numactl, rdma-core, libbfd, libiberty, perl, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "ucx";
+  version = "1.11.0";
+
+  src = fetchFromGitHub {
+    owner = "openucx";
+    repo = "ucx";
+    rev = "v${version}";
+    sha256 = "1ww5a9m1jbjjhsjlvjvlcvcv0sv388irfx8xdh0pd9w03xv754d0";
+  };
+
+  nativeBuildInputs = [ autoreconfHook doxygen ];
+
+  buildInputs = [ numactl rdma-core libbfd libiberty perl zlib ];
+
+  configureFlags = [
+    "--with-rdmacm=${rdma-core}"
+    "--with-dc"
+    "--with-rc"
+    "--with-dm"
+    "--with-verbs=${rdma-core}"
+  ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Unified Communication X library";
+    homepage = "http://www.openucx.org";
+    license = licenses.bsd3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.markuskowa ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/udns/default.nix b/nixpkgs/pkgs/development/libraries/udns/default.nix
new file mode 100644
index 000000000000..fc0b4a42b55d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/udns/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchurl }:
+
+# this expression is mostly based on debian's packaging
+# https://tracker.debian.org/media/packages/u/udns/rules-0.4-1
+
+stdenv.mkDerivation rec {
+  pname = "udns";
+  version = "0.4";
+
+  configurePhase = "./configure --enable-ipv6";
+
+  buildPhase = "make staticlib sharedlib rblcheck_s dnsget_s";
+
+  src = fetchurl {
+    url = "http://www.corpit.ru/mjt/udns/${pname}-${version}.tar.gz";
+    sha256 = "0447fv1hmb44nnchdn6p5pd9b44x8p5jn0ahw6crwbqsg7f0hl8i";
+  };
+
+  installPhase = ''
+    mkdir -p $out/bin
+    mkdir -p $out/include
+    mkdir -p $out/lib
+    mkdir -p $out/share/man/man1
+    mkdir -p $out/share/man/man3
+    cp dnsget_s $out/bin/dnsget
+    cp rblcheck_s $out/bin/rblcheck
+    cp udns.h $out/include/
+    cp libudns.a $out/lib/
+    cp libudns.so.0 $out/lib/
+    ln -rs $out/lib/libudns.so.0 $out/lib/libudns.so
+    cp dnsget.1 rblcheck.1 $out/share/man/man1
+    cp udns.3 $out/share/man/man3
+  '';
+
+  # keep man3
+  outputDevdoc = "out";
+
+  meta = with lib; {
+    homepage = "http://www.corpit.ru/mjt/udns.html";
+    description = "Async-capable DNS stub resolver library";
+    license = licenses.lgpl21Plus;
+    maintainers = [ maintainers.womfoo ];
+    platforms = platforms.linux;
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/udunits/default.nix b/nixpkgs/pkgs/development/libraries/udunits/default.nix
new file mode 100644
index 000000000000..b8ea203ef176
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/udunits/default.nix
@@ -0,0 +1,49 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, bison
+, expat
+, file
+, flex
+, texinfo
+}:
+
+stdenv.mkDerivation rec {
+  pname = "udunits";
+  version = "unstable-2021-03-17";
+
+  src = fetchFromGitHub {
+    owner = "Unidata";
+    repo = "UDUNITS-2";
+    rev = "c83da987387db1174cd2266b73dd5dd556f4476b";
+    hash = "sha256-+HW21+r65OroCxMK2/B5fe7zHs4hD4xyoJK2bhdJGyQ=";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    texinfo
+    bison
+    flex
+    file
+  ];
+  buildInputs = [
+    expat
+  ];
+
+  meta = with lib; {
+    homepage = "https://www.unidata.ucar.edu/software/udunits/";
+    description = "A C-based package for the programatic handling of units of physical quantities";
+    longDescription = ''
+      The UDUNITS package supports units of physical quantities. Its C library
+      provides for arithmetic manipulation of units and for conversion of
+      numeric values between compatible units. The package contains an extensive
+      unit database, which is in XML format and user-extendable. The package
+      also contains a command-line utility for investigating units and
+      converting values.
+    '';
+    license = licenses.asl20;
+    maintainers = with maintainers; [ AndersonTorres pSub ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/uhttpmock/default.nix b/nixpkgs/pkgs/development/libraries/uhttpmock/default.nix
new file mode 100644
index 000000000000..5420eb204e3d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/uhttpmock/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, lib, fetchFromGitLab, autoconf, gtk-doc, automake, libtool, pkg-config, glib, libsoup, gobject-introspection }:
+
+stdenv.mkDerivation rec {
+  version="0.5.0";
+  pname = "uhttpmock";
+
+  src = fetchFromGitLab {
+    repo = "uhttpmock";
+    owner = "uhttpmock";
+    rev = version;
+    sha256 = "0kkf670abkq5ikm3mqls475lydfsd9by1kv5im4k757xrl1br1d4";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ autoconf gtk-doc automake libtool glib libsoup gobject-introspection ];
+
+  preConfigure = "./autogen.sh";
+
+  meta = with lib; {
+    description = "Project for mocking web service APIs which use HTTP or HTTPS";
+    homepage = "https://gitlab.com/groups/uhttpmock/";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/uid_wrapper/default.nix b/nixpkgs/pkgs/development/libraries/uid_wrapper/default.nix
new file mode 100644
index 000000000000..ec7626a7e8bc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/uid_wrapper/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, fetchurl, cmake, pkg-config }:
+
+stdenv.mkDerivation rec {
+  name = "uid_wrapper-1.2.8";
+
+  src = fetchurl {
+    url = "mirror://samba/cwrap/${name}.tar.gz";
+    sha256 = "0swm9d8l69dw7nbrw6xh7rdy7cfrqflw3hxshicsrhd9v03iwvqf";
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  meta = with lib; {
+    description = "A wrapper for the user, group and hosts NSS API";
+    homepage = "https://git.samba.org/?p=uid_wrapper.git;a=summary;";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/umockdev/default.nix b/nixpkgs/pkgs/development/libraries/umockdev/default.nix
new file mode 100644
index 000000000000..2dac161bb4a4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/umockdev/default.nix
@@ -0,0 +1,73 @@
+{ stdenv
+, lib
+, docbook-xsl-nons
+, fetchurl
+, fetchpatch
+, glib
+, gobject-introspection
+, gtk-doc
+, libgudev
+, meson
+, ninja
+, pkg-config
+, python3
+, systemd
+, usbutils
+, vala
+, which
+}:
+
+stdenv.mkDerivation rec {
+  pname = "umockdev";
+  version = "0.15.4";
+
+  outputs = [ "bin" "out" "dev" "devdoc" ];
+
+  src = fetchurl {
+    url = "https://github.com/martinpitt/umockdev/releases/download/${version}/${pname}-${version}.tar.xz";
+    sha256 = "09k8jwvsphd97hcagf0zaf0hwzlzq2r8jfgbmvj55k7ylrg8hjxg";
+  };
+
+  patches = [
+    # Fix build with Vala 0.52
+    (fetchpatch {
+      url = "https://github.com/martinpitt/umockdev/commit/a236f0b55fbb6ff50a6429da9d404703d6637d94.patch";
+      sha256 = "sZs9Ove1r7te/a9vmWUmFetLVhyzhHmx7ijhkK/2S5o=";
+    })
+  ];
+
+  nativeBuildInputs = [
+    docbook-xsl-nons
+    gobject-introspection
+    gtk-doc
+    meson
+    ninja
+    pkg-config
+    vala
+  ];
+
+  buildInputs = [
+    glib
+    systemd
+    libgudev
+  ];
+
+  checkInputs = [
+    python3
+    which
+    usbutils
+  ];
+
+  mesonFlags = [
+    "-Dgtk_doc=true"
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Mock hardware devices for creating unit tests";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ flokli ];
+    platforms = with platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/unibilium/default.nix b/nixpkgs/pkgs/development/libraries/unibilium/default.nix
new file mode 100644
index 000000000000..f5fd4f82bae2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/unibilium/default.nix
@@ -0,0 +1,27 @@
+{ stdenv, lib, fetchFromGitHub, libtool, pkg-config, perl, ncurses }:
+
+stdenv.mkDerivation rec {
+  pname = "unibilium-unstable";
+
+  version = "20190811";
+
+  src = fetchFromGitHub {
+    owner = "neovim";
+    repo = "unibilium";
+    rev = "92d929fabaf94ea4feb48149bbc3bbea77c4fab0";
+    sha256 = "1l8p3fpdymba62x1f5d990v72z3m5f5g2yf505g0rlf2ysc5r1di";
+  };
+
+  makeFlags = [ "PREFIX=$(out)" ]
+    ++ lib.optional stdenv.isDarwin "LIBTOOL=${libtool}/bin/libtool";
+
+  nativeBuildInputs = [ pkg-config perl ];
+  buildInputs = [ libtool ncurses ];
+
+  meta = with lib; {
+    description = "A very basic terminfo library";
+    license = licenses.lgpl3Plus;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ pSub ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/unicap/default.nix b/nixpkgs/pkgs/development/libraries/unicap/default.nix
new file mode 100644
index 000000000000..17e91f7e2365
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/unicap/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, libusb-compat-0_1, libraw1394, dcraw, intltool, perl, v4l-utils }:
+
+stdenv.mkDerivation rec {
+  pname = "libunicap";
+  version="0.9.12";
+
+  src = fetchurl {
+    url = "https://www.unicap-imaging.org/downloads/${pname}-${version}.tar.gz";
+    sha256 = "05zcnnm4dfc6idihfi0fq5xka6x86zi89wip2ca19yz768sd33s9";
+  };
+
+  buildInputs = [ libusb-compat-0_1 libraw1394 dcraw intltool perl v4l-utils ];
+
+  patches = [
+    # Debian has a patch that fixes the build.
+    (fetchurl {
+      url = "https://sources.debian.net/data/main/u/unicap/0.9.12-2/debian/patches/1009_v4l1.patch";
+      sha256 = "1lgypmhdj681m7d1nmzgvh19cz8agj2f31wlnfib0ha8i3g5hg5w";
+    })
+  ];
+
+  postPatch = ''
+    find . -type f -exec sed -e '/linux\/types\.h/d' -i '{}' ';'
+    sed -e 's@/etc/udev@'"$out"'/&@' -i data/Makefile.*
+  '';
+
+  meta = with lib; {
+    description = "Universal video capture API";
+    homepage = "http://www.unicap-imaging.org/";
+    maintainers = [ maintainers.raskin ];
+    license = licenses.gpl2Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/unicorn/default.nix b/nixpkgs/pkgs/development/libraries/unicorn/default.nix
new file mode 100644
index 000000000000..0a760c07a97e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/unicorn/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv
+, fetchFromGitHub
+, pkg-config
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "unicorn";
+  version = "1.0.3";
+
+  src = fetchFromGitHub {
+    owner = "unicorn-engine";
+    repo = pname;
+    rev = version;
+    sha256 = "079azb1df4nwsnsck36b200rnf03aqilw30h3fiaqi1ixash957k";
+  };
+
+  nativeBuildInputs = [ pkg-config cmake ];
+
+  meta = with lib; {
+    description = "Lightweight multi-platform CPU emulator library";
+    homepage = "http://www.unicorn-engine.org";
+    license = licenses.gpl2Only;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ thoughtpolice luc65r ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/unittest-cpp/default.nix b/nixpkgs/pkgs/development/libraries/unittest-cpp/default.nix
new file mode 100644
index 000000000000..d185d32c816f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/unittest-cpp/default.nix
@@ -0,0 +1,27 @@
+{lib, stdenv, fetchFromGitHub, cmake}:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "unittest-cpp";
+  version = "2.0.0";
+
+  src = fetchFromGitHub {
+    owner = "unittest-cpp";
+    repo = "unittest-cpp";
+    rev = "v${version}";
+    sha256 = "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  doCheck = false;
+
+  meta = {
+    homepage = "https://github.com/unittest-cpp/unittest-cpp";
+    description = "Lightweight unit testing framework for C++";
+    license = licenses.mit;
+    maintainers = [];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/unixODBC/default.nix b/nixpkgs/pkgs/development/libraries/unixODBC/default.nix
new file mode 100644
index 000000000000..2ab717782e51
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/unixODBC/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "unixODBC";
+  version = "2.3.9";
+
+  src = fetchurl {
+    urls = [
+      "ftp://ftp.unixodbc.org/pub/unixODBC/${pname}-${version}.tar.gz"
+      "http://www.unixodbc.org/${pname}-${version}.tar.gz"
+    ];
+    sha256 = "sha256-UoM+rD1oHIsMmlpl8uvXRbOpZPII/HSPl35EAVoxsgc=";
+  };
+
+  configureFlags = [ "--disable-gui" "--sysconfdir=/etc" ];
+
+  meta = with lib; {
+    description = "ODBC driver manager for Unix";
+    homepage = "http://www.unixodbc.org/";
+    license = licenses.lgpl2;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/unixODBCDrivers/default.nix b/nixpkgs/pkgs/development/libraries/unixODBCDrivers/default.nix
new file mode 100644
index 000000000000..14f41b015e9c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/unixODBCDrivers/default.nix
@@ -0,0 +1,177 @@
+{ fetchurl, stdenv, unixODBC, cmake, postgresql, mariadb, sqlite, zlib, libxml2, dpkg, lib, openssl, libkrb5, libuuid, patchelf, libiconv, fetchFromGitHub }:
+
+# I haven't done any parameter tweaking.. So the defaults provided here might be bad
+
+{
+  psql = stdenv.mkDerivation rec {
+    pname = "psqlodbc";
+    version = "10.01.0000";
+
+    src = fetchurl {
+      url = "http://ftp.postgresql.org/pub/odbc/versions/src/${pname}-${version}.tar.gz";
+      sha256 = "1cyams7157f3gry86x64xrplqi2vyqrq3rqka59gv4lb4rpl7jl7";
+    };
+
+    buildInputs = [ unixODBC postgresql ];
+
+    passthru = {
+      fancyName = "PostgreSQL";
+      driver = "lib/psqlodbcw.so";
+    };
+
+    meta = with lib; {
+      description = "Official PostgreSQL ODBC Driver";
+      homepage =  "https://odbc.postgresql.org/";
+      license = licenses.lgpl2;
+      platforms = platforms.linux;
+    };
+  };
+
+  mariadb = stdenv.mkDerivation rec {
+    pname = "mariadb-connector-odbc";
+    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 openssl libiconv ];
+
+    preConfigure = ''
+      # we don't want to build a .pkg
+      sed -i 's/ADD_SUBDIRECTORY(osxinstall)//g' CMakeLists.txt
+    '';
+
+    cmakeFlags = [
+      "-DWITH_OPENSSL=ON"
+      # on darwin this defaults to ON but we want to build against unixODBC
+      "-DWITH_IODBC=OFF"
+    ];
+
+    passthru = {
+      fancyName = "MariaDB";
+      driver = if stdenv.isDarwin then "lib/libmaodbc.dylib" else "lib/libmaodbc.so";
+    };
+
+    meta = with lib; {
+      description = "MariaDB ODBC database driver";
+      homepage =  "https://downloads.mariadb.org/connector-odbc/";
+      license = licenses.gpl2;
+      platforms = platforms.linux ++ platforms.darwin;
+    };
+  };
+
+  mysql = stdenv.mkDerivation rec {
+    pname = "mysql-connector-odbc";
+    majorVersion = "5.3";
+    version = "${majorVersion}.6";
+
+    src = fetchurl {
+      url = "https://dev.mysql.com/get/Downloads/Connector-ODBC/${majorVersion}/${pname}-${version}-src.tar.gz";
+      sha256 = "1smi4z49i4zm7cmykjkwlxxzqvn7myngsw5bc35z6gqxmi8c55xr";
+    };
+
+    nativeBuildInputs = [ cmake ];
+    buildInputs = [ unixODBC mariadb ];
+
+    cmakeFlags = [ "-DWITH_UNIXODBC=1" ];
+
+    passthru = {
+      fancyName = "MySQL";
+      driver = "lib/libmyodbc3-3.51.12.so";
+    };
+
+    meta = with lib; {
+      description = "MariaDB ODBC database driver";
+      homepage = "https://dev.mysql.com/downloads/connector/odbc/";
+      license = licenses.gpl2;
+      platforms = platforms.linux;
+      broken = true;
+    };
+  };
+
+  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}" "--with-sqlite3=${sqlite.dev}" ];
+
+    installTargets = [ "install-3" ];
+
+    # move libraries to $out/lib where they're expected to be
+    postInstall = ''
+      mkdir -p "$out/lib"
+      mv "$out"/*.* "$out/lib"
+    '';
+
+    passthru = {
+      fancyName = "SQLite";
+      driver = "lib/libsqlite3odbc.so";
+    };
+
+    meta = with lib; {
+      description = "ODBC driver for SQLite";
+      homepage = "http://www.ch-werner.de/sqliteodbc";
+      license = licenses.bsd2;
+      platforms = platforms.linux;
+      maintainers = with maintainers; [ vlstill ];
+    };
+  };
+
+  msodbcsql17 = stdenv.mkDerivation rec {
+    pname = "msodbcsql17";
+    version = "${versionMajor}.${versionMinor}.${versionAdditional}-1";
+
+    versionMajor = "17";
+    versionMinor = "7";
+    versionAdditional = "1.1";
+
+    src = fetchurl {
+      url = "https://packages.microsoft.com/debian/10/prod/pool/main/m/msodbcsql17/msodbcsql${versionMajor}_${version}_amd64.deb";
+      sha256 = "0vwirnp56jibm3qf0kmi4jnz1w7xfhnsfr8imr0c9hg6av4sk3a6";
+    };
+
+    nativeBuildInputs = [ dpkg patchelf ];
+
+    unpackPhase = "dpkg -x $src ./";
+    buildPhase = "";
+
+    installPhase = ''
+      mkdir -p $out
+      mkdir -p $out/lib
+      cp -r opt/microsoft/msodbcsql${versionMajor}/lib64 opt/microsoft/msodbcsql${versionMajor}/share $out/
+    '';
+
+    postFixup = ''
+      patchelf --set-rpath ${lib.makeLibraryPath [ unixODBC openssl.out libkrb5 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}";
+    };
+
+    meta = with lib; {
+      description = "ODBC Driver 17 for SQL Server";
+      homepage = "https://docs.microsoft.com/en-us/sql/connect/odbc/linux-mac/installing-the-microsoft-odbc-driver-for-sql-server?view=sql-server-2017";
+      license = licenses.unfree;
+      platforms = platforms.linux;
+      maintainers = with maintainers; [ spencerjanssen ];
+    };
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/unqlite/default.nix b/nixpkgs/pkgs/development/libraries/unqlite/default.nix
new file mode 100644
index 000000000000..c0e405c8849c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/unqlite/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "unqlite";
+  version = "1.1.9";
+
+  src = fetchFromGitHub {
+    owner = "symisc";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-WLsyGEt7Xe6ZrOGMO7+3TU2sBgDTSmfD1WzD70pcDjo=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://unqlite.org/";
+    description = "Self-contained, serverless, zero-conf, transactional NoSQL DB library";
+    longDescription = ''
+      UnQLite is a in-process software library which implements a
+      self-contained, serverless, zero-configuration, transactional NoSQL
+      database engine. UnQLite is a document store database similar to MongoDB,
+      Redis, CouchDB etc. as well a standard Key/Value store similar to
+      BerkeleyDB, LevelDB, etc.
+
+      UnQLite is an embedded NoSQL (Key/Value store and Document-store) database
+      engine. Unlike most other NoSQL databases, UnQLite does not have a
+      separate server process. UnQLite reads and writes directly to ordinary
+      disk files. A complete database with multiple collections, is contained in
+      a single disk file. The database file format is cross-platform, you can
+      freely copy a database between 32-bit and 64-bit systems or between
+      big-endian and little-endian architectures.
+    '';
+    maintainers = with maintainers; [ AndersonTorres ];
+    license = licenses.bsd2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/urdfdom-headers/default.nix b/nixpkgs/pkgs/development/libraries/urdfdom-headers/default.nix
new file mode 100644
index 000000000000..91fc747b84a6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/urdfdom-headers/default.nix
@@ -0,0 +1,31 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, validatePkgConfig }:
+
+stdenv.mkDerivation rec {
+  pname = "urdfdom-headers";
+  version = "1.0.5";
+
+  src = fetchFromGitHub {
+    owner = "ros";
+    repo = "urdfdom_headers";
+    rev = version;
+    sha256 = "1abzhcyv2vad8l36vy0fcz9kpgns834la7hf9zal962bwycqnkmg";
+  };
+
+  patches = [
+    # Fix CMake relative install dir assumptions (https://github.com/ros/urdfdom_headers/pull/66)
+    (fetchpatch {
+      url = "https://github.com/ros/urdfdom_headers/commit/990fd233b1a3ff68872a3552f3ea5ccbe105848c.patch";
+      sha256 = "1hxf2kw3mkll3fzvsby104b2m854bdpiy9gr3r9ysmw2r537gqdy";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake validatePkgConfig ];
+
+  meta = with lib; {
+    description = "URDF (U-Robot Description Format) headers provides core data structure headers for URDF";
+    homepage = "https://github.com/ros/urdfdom_headers";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ lopsided98 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/urdfdom/default.nix b/nixpkgs/pkgs/development/libraries/urdfdom/default.nix
new file mode 100644
index 000000000000..1b75851c93d0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/urdfdom/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, pkg-config, validatePkgConfig
+, tinyxml, boost, urdfdom-headers, console-bridge }:
+
+stdenv.mkDerivation rec {
+  pname = "urdfdom";
+  version = "1.0.4";
+
+  src = fetchFromGitHub {
+    owner = "ros";
+    repo = pname;
+    rev = version;
+    sha256 = "0wambq06d7dvja25zcv4agc055q9rmf3xkrnxy8lsf4nic7ra2rr";
+  };
+
+  patches = [
+    # Fix CMake saying console-bridge 1.0 is incompatible
+    (fetchpatch {
+      url = "https://github.com/ros/urdfdom/commit/6faba176d41cf39114785a3e029013f941ed5a0e.patch";
+      sha256 = "1pn9hcg5wkkc7y28sbkxvffqxgvazzsp3g1xmz6h055v4f9ikjbs";
+    })
+    # Fix CMake relative install dir assumptions (https://github.com/ros/urdfdom/pull/142)
+    (fetchpatch {
+      url = "https://github.com/ros/urdfdom/commit/707c97c3d1f739ba0ab6e93e1bf7cd01d68a8c07.patch";
+      sha256 = "10bv7sv7gfy6lj8z5bkw7v291y12fbrrxsiqxqjxg4i65rfg92ng";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config validatePkgConfig ];
+  buildInputs = [ tinyxml boost ];
+  propagatedBuildInputs = [ urdfdom-headers console-bridge ];
+
+  meta = with lib; {
+    description = "Provides core data structures and a simple XML parser for populating the class data structures from an URDF file";
+    homepage = "https://github.com/ros/urdfdom";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ lopsided98 ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/uri/default.nix b/nixpkgs/pkgs/development/libraries/uri/default.nix
new file mode 100644
index 000000000000..48a80aacdf59
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/uri/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, cmake, doxygen }:
+
+stdenv.mkDerivation rec {
+  name = "uri-${version}";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "cpp-netlib";
+    repo = "uri";
+    rev = "v${version}";
+    sha256 = "148361pixrm94q6v04k13s1msa04bx9yc3djb0lxpa7dlw19vhcd";
+  };
+
+  NIX_CFLAGS_COMPILE = "-Wno-error=parentheses";
+
+  nativeBuildInputs = [ cmake doxygen ];
+
+  cmakeFlags = [
+    "-DUri_BUILD_TESTS=OFF" "-DUri_BUILD_DOCS=ON" "-DBUILD_SHARED_LIBS=ON"
+  ];
+
+  postBuild = "make doc";
+
+  postInstall = ''
+    install -vd $out/share/doc
+    cp -vR html $out/share/doc
+  '';
+
+  meta = {
+    description = "C++ URI library";
+    homepage = "https://cpp-netlib.org";
+    license = lib.licenses.boost;
+    platforms = lib.platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/uriparser/default.nix b/nixpkgs/pkgs/development/libraries/uriparser/default.nix
new file mode 100644
index 000000000000..db36e31ae874
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/uriparser/default.nix
@@ -0,0 +1,33 @@
+{ lib, stdenv, fetchurl, cmake, gtest }:
+
+stdenv.mkDerivation rec {
+  pname = "uriparser";
+  version = "0.9.5";
+
+  # Release tarball differs from source tarball
+  src = fetchurl {
+    url = "https://github.com/uriparser/uriparser/releases/download/${pname}-${version}/${pname}-${version}.tar.bz2";
+    sha256 = "0v30qr5hl3xybl9nzwaw46kblwn94w5xpri22wanrrpjlzmn306x";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    "-DURIPARSER_BUILD_DOCS=OFF"
+  ];
+
+  checkInputs = [ gtest ];
+  doCheck = stdenv.targetPlatform.system == stdenv.hostPlatform.system;
+
+  meta = with lib; {
+    homepage = "https://uriparser.github.io/";
+    description = "Strictly RFC 3986 compliant URI parsing library";
+    longDescription = ''
+      uriparser is a strictly RFC 3986 compliant URI parsing and handling library written in C.
+      API documentation is available on uriparser website.
+    '';
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ bosu ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/usbredir/default.nix b/nixpkgs/pkgs/development/libraries/usbredir/default.nix
new file mode 100644
index 000000000000..502c50db1220
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/usbredir/default.nix
@@ -0,0 +1,53 @@
+{ lib
+, stdenv
+, cmake
+, fetchFromGitLab
+, pkg-config
+, meson
+, ninja
+, glib
+, libusb1
+}:
+
+stdenv.mkDerivation rec {
+  pname = "usbredir";
+  version = "0.10.0";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.freedesktop.org";
+    owner = "spice";
+    repo = "usbredir";
+    rev = "${pname}-${version}";
+    sha256 = "1dz8jms9l6gg2hw0k6p1p1lnchc9mcgmskgvm5gbdvw3j7wrhdbz";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+  ];
+
+  buildInputs = [
+    glib
+  ];
+
+  propagatedBuildInputs = [
+    libusb1
+  ];
+
+  mesonFlags = [
+    "-Dgit_werror=disabled"
+    "-Dtools=enabled"
+    "-Dfuzzing=disabled"
+  ];
+
+  outputs = [ "out" "dev" ];
+
+  meta = with lib; {
+    description = "USB traffic redirection protocol";
+    homepage = "https://www.spice-space.org/usbredir.html";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ offline ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/usrsctp/default.nix b/nixpkgs/pkgs/development/libraries/usrsctp/default.nix
new file mode 100644
index 000000000000..64b1debc0ce5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/usrsctp/default.nix
@@ -0,0 +1,23 @@
+{ stdenv, lib, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "usrsctp";
+  version = "0.9.5.0";
+
+  src = fetchFromGitHub {
+    owner = "sctplab";
+    repo = "usrsctp";
+    rev = version;
+    sha256 = "10ndzkip8blgkw572n3dicl6mgjaa7kygwn3vls80liq92vf1sa9";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://github.com/sctplab/usrsctp";
+    description = "A portable SCTP userland stack";
+    maintainers = with maintainers; [ misuzu ];
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ustr/default.nix b/nixpkgs/pkgs/development/libraries/ustr/default.nix
new file mode 100644
index 000000000000..2b04d8c0c5b7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ustr/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "ustr";
+  version = "1.0.4";
+
+  src = fetchurl {
+    url = "http://www.and.org/ustr/${version}/${pname}-${version}.tar.bz2";
+    sha256 = "1i623ygdj7rkizj7985q9d6vj5amwg686aqb5j3ixpkqkyp6xbrx";
+  };
+
+  # Fixes bogus warnings that failed libsemanage
+  patches = [ ./va_args.patch ];
+
+  # Work around gcc5 switch to gnu11
+  NIX_CFLAGS_COMPILE = "-std=gnu89";
+
+  # Fix detection of stdint.h
+  postPatch = ''
+    sed -i 's,\(have_stdint_h\)=0,\1=1,g' Makefile
+    sed -i 's,\(USTR_CONF_HAVE_STDINT_H\) 0,\1 1,g' ustr-import.in
+  '';
+
+  preBuild = ''
+    makeFlagsArray+=("prefix=$out")
+    makeFlagsArray+=("LDCONFIG=echo")
+    makeFlagsArray+=("HIDE=")
+  '';
+
+  # Remove debug libraries
+  postInstall = ''
+    find $out/lib -name \*debug\* -delete
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.and.org/ustr/";
+    description = "Micro String API for C language";
+    license = licenses.bsd2;
+    maintainers = [ maintainers.phreedom ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/ustr/va_args.patch b/nixpkgs/pkgs/development/libraries/ustr/va_args.patch
new file mode 100644
index 000000000000..f75b537485d8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/ustr/va_args.patch
@@ -0,0 +1,23 @@
+diff --git a/ustr-compiler.h b/ustr-compiler.h
+index 9e71276..c5f847a 100644
+--- a/ustr-compiler.h
++++ b/ustr-compiler.h
+@@ -11,17 +11,11 @@
+ #define USTR_CONF_HAVE_ATTR_FMT 1
+ #endif
+ 
++#include <stdarg.h>
+ /* We assume this is enough,
+  * C99 specifies that va_copy() exists and is a macro */
+-#ifdef va_copy
+ # define USTR_CONF_HAVE_VA_COPY 1
+ # define USTR__VA_COPY(x, y)   va_copy(x, y)
+-#elif __va_copy
+-# define USTR_CONF_HAVE_VA_COPY 1
+-# define USTR__VA_COPY(x, y) __va_copy(x, y)
+-#else
+-# define USTR_CONF_HAVE_VA_COPY 0
+-#endif
+ 
+ #ifndef USTR_CONF_HAVE_ATTR_NONNULL
+ #if defined(__GNUC__) && (__GNUC__ > 3) /* not sure */
diff --git a/nixpkgs/pkgs/development/libraries/utf8cpp/default.nix b/nixpkgs/pkgs/development/libraries/utf8cpp/default.nix
new file mode 100644
index 000000000000..30129992c73d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/utf8cpp/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "utf8cpp";
+  version = "3.1.2";
+
+  src = fetchFromGitHub {
+    owner = "nemtrif";
+    repo = "utfcpp";
+    rev = "v${version}";
+    fetchSubmodules = true;
+    sha256 = "sha256-l5sneFsuvPDIRni2x+aR9fmQ9bzXNnIiP9EzZ63sNtg=";
+  };
+
+  cmakeFlags = [
+    "-DCMAKE_BUILD_TYPE=None"
+    "-DCMAKE_INSTALL_LIBDIR=lib"
+    "-DINSTALL_GTEST=OFF"
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "https://github.com/nemtrif/utfcpp";
+    description = "UTF-8 with C++ in a Portable Way";
+    license = licenses.free;
+    maintainers = with maintainers; [ jobojeha ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/utf8proc/default.nix b/nixpkgs/pkgs/development/libraries/utf8proc/default.nix
new file mode 100644
index 000000000000..b78999e96a76
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/utf8proc/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "utf8proc";
+  version = "2.6.1";
+
+  src = fetchFromGitHub {
+    owner = "JuliaStrings";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "1zqc6airkzkssbjxanx5v8blfk90180gc9id0dx8ncs54f1ib8w7";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DUTF8PROC_ENABLE_TESTING=ON"
+    "-DCMAKE_SKIP_BUILD_RPATH=OFF"
+  ];
+
+  # the pkg-config file is not created in the cmake installation
+  # process, so we use the Makefile and install it manually
+  # see https://github.com/JuliaStrings/utf8proc/issues/198
+  preConfigure = "make libutf8proc.pc prefix=$out";
+  postInstall = "install -Dm644 ../libutf8proc.pc -t $out/lib/pkgconfig/";
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A clean C library for processing UTF-8 Unicode data";
+    homepage = "https://juliastrings.github.io/utf8proc/";
+    license = licenses.mit;
+    platforms = platforms.all;
+    maintainers = [ maintainers.ftrvxmtrx ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/uthash/default.nix b/nixpkgs/pkgs/development/libraries/uthash/default.nix
new file mode 100644
index 000000000000..97c6d10191f3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/uthash/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchurl, perl }:
+
+stdenv.mkDerivation rec {
+  pname = "uthash";
+  version = "2.1.0";
+
+  src = fetchurl {
+    url = "https://github.com/troydhanson/uthash/archive/v${version}.tar.gz";
+    sha256 = "17k6k97n20jpi9zj3lzvqfw8pv670r6rdqrjf8vrbx6hcj7csb0m";
+  };
+
+  dontBuild = false;
+
+  doCheck = true;
+  checkInputs = [ perl ];
+  checkTarget = "-C tests/";
+
+  installPhase = ''
+    mkdir -p "$out/include"
+    cp ./src/* "$out/include/"
+  '';
+
+  meta = with lib; {
+    description = "A hash table for C structures";
+    homepage    = "http://troydhanson.github.io/uthash";
+    license     = licenses.bsd2; # it's one-clause, actually, as it's source-only
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/uthenticode/default.nix b/nixpkgs/pkgs/development/libraries/uthenticode/default.nix
new file mode 100644
index 000000000000..9957eccd4267
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/uthenticode/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, lib, fetchFromGitHub, fetchpatch, cmake, gtest, openssl, pe-parse }:
+
+stdenv.mkDerivation rec {
+  pname = "uthenticode";
+  version = "1.0.4";
+
+  src = fetchFromGitHub {
+    owner = "trailofbits";
+    repo = "uthenticode";
+    rev = "v${version}";
+    sha256 = "16j91cki63zk4d7wzwvq8al98l8hmvcdil3vfp44ink4q4bfswkx";
+  };
+
+  patches = [
+    # adds USE_SYSTEM_GTEST cmake flag, the patch won't be necessary in next versions
+    (fetchpatch {
+      url = "https://github.com/trailofbits/uthenticode/commit/7a4c5499c8e5ea7bfae1c620e1f96c112866b1dd.patch";
+      sha256 = "17637j5zwp71jmi803mv1z04arld3k3kmrm8nvrkpg08q5kizh28";
+    })
+  ];
+
+  cmakeFlags = [ "-DBUILD_TESTS=1" "-DUSE_SYSTEM_GTEST=1" ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ pe-parse openssl gtest ];
+
+  doCheck = true;
+  checkPhase = "test/uthenticode_test";
+
+  meta = with lib; {
+    description = "A small cross-platform library for verifying Authenticode digital signatures.";
+    homepage = "https://github.com/trailofbits/uthenticode";
+    license = licenses.mit;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ arturcygan ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/utmps/default.nix b/nixpkgs/pkgs/development/libraries/utmps/default.nix
new file mode 100644
index 000000000000..be74748cb369
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/utmps/default.nix
@@ -0,0 +1,31 @@
+{ skawarePackages }:
+
+with skawarePackages;
+
+buildPackage {
+  pname = "utmps";
+  version = "0.1.0.2";
+  sha256 = "1vjza7m65ziq54q0sv46kb3lss9cmxkkv0n9h3i8505x0h2hlvlb";
+
+  description = "A secure utmpx and wtmp implementation";
+
+  configureFlags = [
+    "--libdir=\${lib}/lib"
+    "--dynlibdir=\${lib}/lib"
+    "--bindir=\${bin}/bin"
+    "--includedir=\${dev}/include"
+    "--with-sysdeps=${skalibs.lib}/lib/skalibs/sysdeps"
+    "--with-include=${skalibs.dev}/include"
+    "--with-lib=${skalibs.lib}/lib"
+    "--with-dynlib=${skalibs.lib}/lib"
+  ];
+
+  postInstall = ''
+    # remove all execline executables from build directory
+    rm $(find -type f -mindepth 1 -maxdepth 1 -executable)
+    rm libutmps.*
+
+    mv doc $doc/share/doc/utmps/html
+    mv examples $doc/share/doc/utmps/examples
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/v8/5_x.nix b/nixpkgs/pkgs/development/libraries/v8/5_x.nix
new file mode 100644
index 000000000000..441a5559b527
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/v8/5_x.nix
@@ -0,0 +1,199 @@
+{ stdenv, lib, fetchgit, fetchFromGitHub, gyp, readline, python, which, icu
+, patchelf, coreutils, xcbuild
+, doCheck ? false
+, static ? false
+}:
+
+assert readline != null;
+
+let
+  arch = if stdenv.isx86_64 then "x64"
+            else if stdenv.isi686 then "ia32"
+            else if stdenv.isAarch64 then "arm64"
+            else if stdenv.isAarch32 then "arm"
+            else throw "Unknown architecture for v8";
+  git_url = "https://chromium.googlesource.com";
+  clangFlag = if stdenv.isDarwin then "1" else "0";
+  sharedFlag = if static then "static_library" else "shared_library";
+
+  deps = {
+    build = fetchgit {
+      url = "${git_url}/chromium/src/build.git";
+      rev = "2c67d4d74b6b3673228fab191918500a582ef3b0";
+      sha256 = "0jc7hci5yh792pw0ahjfxrk5xzllnlrv9llmwlgcgn2x8x6bn34q";
+    };
+    "tools/gyp" = fetchgit {
+      url = "${git_url}/external/gyp.git";
+      rev = "e7079f0e0e14108ab0dba58728ff219637458563";
+      sha256 = "0yd1ds13z0r9d2sb67f9i1gjn1zgzwyfv96qqqp6pn5pcfbialg6";
+    };
+    "third_party/icu" = fetchgit {
+      url = "${git_url}/chromium/deps/icu.git";
+      rev = "b5ecbb29a26532f72ef482569b223d5a51fd50bf";
+      sha256 = "0ld47wdnk8grcba221z67l3pnphv9zwifk4y44f5b946w3iwmpns";
+    };
+    buildtools = fetchgit {
+      url = "${git_url}/chromium/buildtools.git";
+      rev = "60f7f9a8b421ebf9a46041dfa2ff11c0fe59c582";
+      sha256 = "0i10bw7yhslklqwcx5krs3k05sicb73cpwd0mkaz96yxsvmkvjq0";
+    };
+    "base/trace_event/common" = fetchgit {
+      url = "${git_url}/chromium/src/base/trace_event/common.git";
+      rev = "315bf1e2d45be7d53346c31cfcc37424a32c30c8";
+      sha256 = "1pp2ygvp20j6g4868hrmiw0j704kdvsi9d9wx2gbk7w79rc36695";
+    };
+    "platform/inspector_protocol" = fetchgit {
+      url = "${git_url}/chromium/src/third_party/WebKit/Source/platform/inspector_protocol.git";
+      rev = "f49542089820a34a9a6e33264e09b73779407512";
+      sha256 = "1lwpass3p4rpp2kjmxxxpkqyv4lznxhf4i0yy7mmrd7jkpc7kn8k";
+    };
+    "tools/mb" = fetchgit {
+      url = "${git_url}/chromium/src/tools/mb.git";
+      rev = "0c4dc43c454f26936ddf3074ab8e9a41e3dc03a3";
+      sha256 = "0f96qphbmwn1pprv0a6xf68p01s1jzx2sz6pmadqbrs1dgh1xwnk";
+    };
+    "tools/swarming_client" = fetchgit {
+      url = "${git_url}/external/swarming.client.git";
+      rev = "7f63a272f7d9785ce41b6d10bb3106c49a968e57";
+      sha256 = "1pmb8bq4qifjf2dzz8c4jdwhlvwgrl9ycjaalcyh1sbh4lx3yvv2";
+    };
+    "testing/gtest" = fetchgit {
+      url = "${git_url}/external/github.com/google/googletest.git";
+      rev = "6f8a66431cb592dad629028a50b3dd418a408c87";
+      sha256 = "0bdba2lr6pg15bla9600zg0r0vm4lnrx0wqz84p376wfdxra24vw";
+    };
+    "testing/gmock" = fetchgit {
+      url = "${git_url}/external/googlemock.git";
+      rev = "0421b6f358139f02e102c9c332ce19a33faf75be";
+      sha256 = "1xiky4v98maxs8fg1avcd56y0alv3hw8qyrlpd899zgzbq2k10pp";
+    };
+    "test/benchmarks/data" = fetchgit {
+      url = "${git_url}/v8/deps/third_party/benchmarks.git";
+      rev = "05d7188267b4560491ff9155c5ee13e207ecd65f";
+      sha256 = "0ad2ay14bn67d61ks4dmzadfnhkj9bw28r4yjdjjyzck7qbnzchl";
+    };
+    "test/mozilla/data" = fetchgit {
+      url = "${git_url}/v8/deps/third_party/mozilla-tests.git";
+      rev = "f6c578a10ea707b1a8ab0b88943fe5115ce2b9be";
+      sha256 = "0rfdan76yfawqxbwwb35aa57b723j3z9fx5a2w16nls02yk2kqyn";
+    };
+    "test/simdjs/data" = fetchgit {
+      url = "${git_url}/external/github.com/tc39/ecmascript_simd.git";
+      rev = "baf493985cb9ea7cdbd0d68704860a8156de9556";
+      sha256 = "178r0k40a58c1187gfzqz2i6as34l8cliy1g1x870wyy0qcvlq2q";
+    };
+    "test/test262/data" = fetchgit {
+      url = "${git_url}/external/github.com/tc39/test262.git";
+      rev = "88bc7fe7586f161201c5f14f55c9c489f82b1b67";
+      sha256 = "0gc7fmaqrgwb6rl02jnrm3synpwzzg0dfqy3zm386r1qcisl93xs";
+    };
+    "test/test262/harness" = fetchgit {
+      url = "${git_url}/external/github.com/test262-utils/test262-harness-py.git";
+      rev = "cbd968f54f7a95c6556d53ba852292a4c49d11d8";
+      sha256 = "094c3600a4wh1m3fvvlivn290kik1pzzvwabq77lk8bh4jkkv7ki";
+    };
+    "tools/clang" = fetchgit {
+      url = "${git_url}/chromium/src/tools/clang.git";
+      rev = "496622ab4aaa5be7e5a9b80617013cb02f45dc87";
+      sha256 = "1gkhk2bzpxwzkirzcqfixxpprbr8mn6rk00krm25daarm3smydmf";
+    };
+  };
+
+in
+
+stdenv.mkDerivation rec {
+  pname = "v8";
+  version = "5.4.232";
+
+  inherit doCheck;
+
+  src = fetchFromGitHub {
+    owner = "v8";
+    repo = "v8";
+    rev = version;
+    sha256 = "1nqxbkz75m8xrjih0sj3f3iqvif4192vxdaxzy8r787rihjwg9nx";
+  };
+
+  postUnpack = ''
+    ${lib.concatStringsSep "\n" (
+      lib.mapAttrsToList (n: v: ''
+        mkdir -p $sourceRoot/${n}
+        cp -r ${v}/* $sourceRoot/${n}
+      '') deps)}
+  '';
+
+  # Patch based off of:
+  # https://github.com/cowboyd/libv8/tree/v5.1.281.67.0/patches
+  patches = lib.optional (!doCheck) ./libv8-5.4.232.patch;
+
+  postPatch = ''
+    sed -i 's,#!/usr/bin/env python,#!${python}/bin/python,' gypfiles/gyp_v8
+    sed -i 's,/bin/echo,${coreutils}/bin/echo,' gypfiles/standalone.gypi
+    sed -i '/CR_CLANG_REVISION/ d' gypfiles/standalone.gypi
+    sed -i 's/-Wno-format-pedantic//g' gypfiles/standalone.gypi
+  '';
+
+  configurePhase = ''
+    PYTHONPATH="tools/generate_shim_headers:$PYTHONPATH" \
+    PYTHONPATH="$(toPythonPath ${gyp}):$PYTHONPATH" \
+      gypfiles/gyp_v8 \
+        -f make \
+        --generator-output="out" \
+        -Dflock_index=0 \
+        -Dclang=${clangFlag} \
+        -Dv8_enable_i18n_support=1 \
+        -Duse_system_icu=1 \
+        -Dcomponent=${sharedFlag} \
+        -Dconsole=readline \
+        -Dv8_target_arch=${arch} \
+        -Dv8_use_external_startup_data=0
+  '';
+
+  nativeBuildInputs = [ which ];
+  buildInputs = [ readline python icu ]
+    ++ lib.optional stdenv.isDarwin xcbuild
+    ++ lib.optional stdenv.isLinux patchelf;
+
+  NIX_CFLAGS_COMPILE = "-Wno-error=strict-overflow -Wno-error=unused-function -Wno-error=attributes"
+    + lib.optionalString stdenv.cc.isClang " -Wno-error=unused-lambda-capture";
+
+  buildFlags = [
+    "LINK=c++"
+    "-C out"
+    "builddir=$(CURDIR)/Release"
+    "BUILDTYPE=Release"
+  ];
+
+  enableParallelBuilding = true;
+
+  dontUpdateAutotoolsGnuConfigScripts = if stdenv.isAarch64 then true else null;
+
+  # the `libv8_libplatform` target is _only_ built as a static library,
+  # and is expected to be statically linked in when needed.
+  # see the following link for further commentary:
+  # https://github.com/cowboyd/therubyracer/issues/391
+  installPhase = ''
+    install -vD out/Release/d8 "$out/bin/d8"
+    install -vD out/Release/mksnapshot "$out/bin/mksnapshot"
+    ${if static then ""
+    else if stdenv.isDarwin then ''
+    install -vD out/Release/libv8.dylib "$out/lib/libv8.dylib"
+    install_name_tool -change /usr/local/lib/libv8.dylib $out/lib/libv8.dylib -change /usr/lib/libgcc_s.1.dylib ${stdenv.cc.cc.lib}/lib/libgcc_s.1.dylib $out/bin/d8
+    install_name_tool -id $out/lib/libv8.dylib -change /usr/lib/libgcc_s.1.dylib ${stdenv.cc.cc.lib}/lib/libgcc_s.1.dylib $out/lib/libv8.dylib
+    '' else ''
+    install -vD out/Release/lib.target/libv8.so "$out/lib/libv8.so"
+    ''}
+    mkdir -p "$out/include"
+    cp -vr include/*.h "$out/include"
+    cp -vr include/libplatform "$out/include"
+    mkdir -p "$out/lib"
+    cp -v  out/Release/*.a "$out/lib"
+  '';
+
+  meta = with lib; {
+    description = "Google's open source JavaScript engine";
+    maintainers = with maintainers; [ cstrahan proglodyte ];
+    platforms = platforms.linux ++ platforms.darwin;
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/v8/darwin.patch b/nixpkgs/pkgs/development/libraries/v8/darwin.patch
new file mode 100644
index 000000000000..629d5e4dc392
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/v8/darwin.patch
@@ -0,0 +1,22 @@
+diff --git a/toolchain/gcc_toolchain.gni b/toolchain/gcc_toolchain.gni
+index 80e2a362a..df138c87b 100644
+--- a/build/toolchain/gcc_toolchain.gni
++++ b/build/toolchain/gcc_toolchain.gni
+@@ -355,6 +355,8 @@ template("gcc_toolchain") {
+         # AIX does not support either -D (deterministic output) or response
+         # files.
+         command = "$ar -X64 {{arflags}} -r -c -s {{output}} {{inputs}}"
++      } else if (current_os == "mac") {
++        command = "$ar {{arflags}} -r -c -s {{output}} {{inputs}}"
+       } else {
+         rspfile = "{{output}}.rsp"
+         rspfile_content = "{{inputs}}"
+@@ -546,7 +548,7 @@ template("gcc_toolchain") {
+ 
+       start_group_flag = ""
+       end_group_flag = ""
+-      if (current_os != "aix") {
++      if (current_os != "aix" && current_os != "mac") {
+         # the "--start-group .. --end-group" feature isn't available on the aix ld.
+         start_group_flag = "-Wl,--start-group"
+         end_group_flag = "-Wl,--end-group "
diff --git a/nixpkgs/pkgs/development/libraries/v8/default.nix b/nixpkgs/pkgs/development/libraries/v8/default.nix
new file mode 100644
index 000000000000..7c463aa01228
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/v8/default.nix
@@ -0,0 +1,155 @@
+{ stdenv, lib, fetchgit, fetchFromGitHub
+, gn, ninja, python, pythonPackages, glib, pkg-config, icu
+, xcbuild, darwin
+, fetchpatch
+}:
+
+let
+  git_url = "https://chromium.googlesource.com";
+
+  # This data is from the DEPS file in the root of a V8 checkout
+  deps = {
+    "base/trace_event/common" = fetchgit {
+      url    = "${git_url}/chromium/src/base/trace_event/common.git";
+      rev    = "dab187b372fc17e51f5b9fad8201813d0aed5129";
+      sha256 = "0dmpj9hj4xv3xb0fl1kb9hm4bhpbs2s5csx3z8cgjd5vwvhdzig4";
+    };
+    build = fetchgit {
+      url    = "${git_url}/chromium/src/build.git";
+      rev    = "26e9d485d01d6e0eb9dadd21df767a63494c8fea";
+      sha256 = "1jjvsgj0cs97d26i3ba531ic1f9gqan8x7z4aya8yl8jx02l342q";
+    };
+    "third_party/googletest/src" = fetchgit {
+      url    = "${git_url}/external/github.com/google/googletest.git";
+      rev    = "e3f0319d89f4cbf32993de595d984183b1a9fc57";
+      sha256 = "18xz71l2xjrqsc0q317whgw4xi1i5db24zcj7v04f5g6r1hyf1a5";
+    };
+    "third_party/icu" = fetchgit {
+      url    = "${git_url}/chromium/deps/icu.git";
+      rev    = "f2223961702f00a8833874b0560d615a2cc42738";
+      sha256 = "0z5p53kbrjfkjn0i12dpk55cp8976j2zk7a4wk88423s2c5w87zl";
+    };
+    "third_party/jinja2" = fetchgit {
+      url    = "${git_url}/chromium/src/third_party/jinja2.git";
+      rev    = "b41863e42637544c2941b574c7877d3e1f663e25";
+      sha256 = "1qgilclkav67m6cl2xq2kmzkswrkrb2axc2z8mw58fnch4j1jf1r";
+    };
+    "third_party/markupsafe" = fetchgit {
+      url    = "${git_url}/chromium/src/third_party/markupsafe.git";
+      rev    = "8f45f5cfa0009d2a70589bcda0349b8cb2b72783";
+      sha256 = "168ppjmicfdh4i1l0l25s86mdbrz9fgxmiq1rx33x79mph41scfz";
+    };
+    "third_party/zlib" = fetchgit {
+      url    = "${git_url}/chromium/src/third_party/zlib.git";
+      rev    = "156be8c52f80cde343088b4a69a80579101b6e67";
+      sha256 = "0hxbkkzmlv714fjq2jlp5dd2jc339xyh6gkjx1sz3srwv33mlk92";
+    };
+  };
+
+in
+
+stdenv.mkDerivation rec {
+  pname = "v8";
+  version = "8.4.255";
+
+  doCheck = true;
+
+  patches = [
+    # Remove unrecognized clang debug flags
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/saiarcot895/chromium-ubuntu-build/663dbfc492fd2f8ba28d9af40fb3b1327e6aa56e/debian/patches/revert-Xclang-instcombine-lower-dbg-declare.patch";
+      sha256 = "07qp4bjgbwbdrzqslvl2bgbzr3v97b9isbp0539x3lc8cy3h02g1";
+    })
+    ./darwin.patch
+    ./gcc_arm.patch  # Fix building zlib with gcc on aarch64, from https://gist.github.com/Adenilson/d973b6fd96c7709d33ddf08cf1dcb149
+  ];
+
+  src = fetchFromGitHub {
+    owner = "v8";
+    repo = "v8";
+    rev = version;
+    sha256 = "07ymw4kqbz7kv311gpk5bs5q90wj73n2q7jkyfhqk4hvhs1q5bw7";
+  };
+
+  postUnpack = ''
+    ${lib.concatStringsSep "\n" (
+      lib.mapAttrsToList (n: v: ''
+        mkdir -p $sourceRoot/${n}
+        cp -r ${v}/* $sourceRoot/${n}
+      '') deps)}
+    chmod u+w -R .
+  '';
+
+  postPatch = lib.optionalString stdenv.isAarch64 ''
+    substituteInPlace build/toolchain/linux/BUILD.gn \
+      --replace 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""'
+  '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace build/config/compiler/compiler.gni \
+      --replace 'strip_absolute_paths_from_debug_symbols = true' \
+                'strip_absolute_paths_from_debug_symbols = false'
+    substituteInPlace build/config/compiler/BUILD.gn \
+      --replace 'current_toolchain == host_toolchain || !use_xcode_clang' \
+                'false'
+  '';
+
+  gnFlags = [
+    "use_custom_libcxx=false"
+    "is_clang=${lib.boolToString stdenv.cc.isClang}"
+    "use_sysroot=false"
+    # "use_system_icu=true"
+    "clang_use_chrome_plugins=false"
+    "is_component_build=false"
+    "v8_use_external_startup_data=false"
+    "v8_monolithic=true"
+    "is_debug=true"
+    "is_official_build=false"
+    "treat_warnings_as_errors=false"
+    "v8_enable_i18n_support=true"
+    "use_gold=false"
+    "init_stack_vars=false"
+    # ''custom_toolchain="//build/toolchain/linux/unbundle:default"''
+    ''host_toolchain="//build/toolchain/linux/unbundle:default"''
+    ''v8_snapshot_toolchain="//build/toolchain/linux/unbundle:default"''
+  ] ++ lib.optional stdenv.cc.isClang ''clang_base_path="${stdenv.cc}"'';
+
+  NIX_CFLAGS_COMPILE = "-O2";
+  FORCE_MAC_SDK_MIN = stdenv.targetPlatform.sdkVer or "10.12";
+
+  nativeBuildInputs = [
+    gn
+    ninja
+    pkg-config
+    python
+  ] ++ lib.optionals stdenv.isDarwin [
+    xcbuild
+    darwin.DarwinTools
+    pythonPackages.setuptools
+  ];
+  buildInputs = [ glib icu ];
+
+  ninjaFlags = [ ":d8" "v8_monolith" ];
+
+  enableParallelBuilding = true;
+
+  installPhase = ''
+    install -D d8 $out/bin/d8
+    install -D obj/libv8_monolith.a $out/lib/libv8.a
+    cp -r ../../include $out
+
+    mkdir -p $out/lib/pkgconfig
+    cat > $out/lib/pkgconfig/v8.pc << EOF
+    Name: v8
+    Description: V8 JavaScript Engine
+    Version: ${version}
+    Libs: -L$out/lib -lv8 -pthread
+    Cflags: -I$out/include
+    EOF
+  '';
+
+  meta = with lib; {
+    description = "Google's open source JavaScript engine";
+    maintainers = with maintainers; [ cstrahan proglodyte matthewbauer ];
+    platforms = platforms.unix;
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/v8/gcc_arm.patch b/nixpkgs/pkgs/development/libraries/v8/gcc_arm.patch
new file mode 100644
index 000000000000..09579561fd8d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/v8/gcc_arm.patch
@@ -0,0 +1,31 @@
+diff --git a/third_party/zlib/contrib/optimizations/insert_string.h b/third_party/zlib/contrib/optimizations/insert_string.h
+index 1826601..d123305 100644
+--- a/third_party/zlib/contrib/optimizations/insert_string.h
++++ b/third_party/zlib/contrib/optimizations/insert_string.h
+@@ -26,15 +26,23 @@
+   #define _cpu_crc32_u32 _mm_crc32_u32
+ 
+ #elif defined(CRC32_ARMV8_CRC32)
+-  #if defined(__clang__)
++  #if defined(__GNUC__) || defined(__clang__)
+     #undef TARGET_CPU_WITH_CRC
+-    #define __crc32cw __builtin_arm_crc32cw
++    #if defined(__clang__)
++      #define __crc32cw __builtin_arm_crc32cw
++    #elif defined(__GNUC__)
++      #define __crc32cw __builtin_aarch64_crc32cw
++    #endif
+   #endif
+ 
+   #define _cpu_crc32_u32 __crc32cw
+ 
+   #if defined(__aarch64__)
+-    #define TARGET_CPU_WITH_CRC __attribute__((target("crc")))
++    #if defined(__clang__)
++      #define TARGET_CPU_WITH_CRC __attribute__((target("crc")))
++    #elif defined(__GNUC__)
++      #define TARGET_CPU_WITH_CRC __attribute__((target("+crc")))
++    #endif
+   #else  // !defined(__aarch64__)
+     #define TARGET_CPU_WITH_CRC __attribute__((target("armv8-a,crc")))
+   #endif  // defined(__aarch64__)
diff --git a/nixpkgs/pkgs/development/libraries/v8/libv8-5.4.232.patch b/nixpkgs/pkgs/development/libraries/v8/libv8-5.4.232.patch
new file mode 100644
index 000000000000..16c227cfe38d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/v8/libv8-5.4.232.patch
@@ -0,0 +1,97 @@
+From c9f42d1314c6026efcfcc01824f4e2fdfd05ebcf Mon Sep 17 00:00:00 2001
+From: Ben Sklaroff <bsklaroff@gmail.com>
+Date: Sat, 23 Jul 2016 18:16:55 -0400
+Subject: [PATCH] libv8-5.4.232
+
+---
+ Makefile                 |  5 +----
+ gypfiles/all.gyp         | 32 --------------------------------
+ gypfiles/standalone.gypi |  5 ++++-
+ 3 files changed, 5 insertions(+), 37 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index 5ea5c58..d1b2d73 100644
+--- a/Makefile
++++ b/Makefile
+@@ -261,11 +261,8 @@ GYPFILES = third_party/icu/icu.gypi third_party/icu/icu.gyp \
+ 	   gypfiles/shim_headers.gypi gypfiles/features.gypi \
+            gypfiles/standalone.gypi \
+ 	   gypfiles/toolchain.gypi gypfiles/all.gyp gypfiles/mac/asan.gyp \
+-	   test/cctest/cctest.gyp test/fuzzer/fuzzer.gyp \
+-	   test/unittests/unittests.gyp src/v8.gyp \
+-	   tools/parser-shell.gyp testing/gmock.gyp testing/gtest.gyp \
+ 	   buildtools/third_party/libc++abi/libc++abi.gyp \
+-	   buildtools/third_party/libc++/libc++.gyp samples/samples.gyp \
++	   buildtools/third_party/libc++/libc++.gyp \
+ 	   src/third_party/vtune/v8vtune.gyp src/d8.gyp
+ 
+ # If vtunejit=on, the v8vtune.gyp will be appended.
+diff --git a/gypfiles/all.gyp b/gypfiles/all.gyp
+index ff1bea4..96820a0 100644
+--- a/gypfiles/all.gyp
++++ b/gypfiles/all.gyp
+@@ -16,38 +16,6 @@
+             '../tools/parser-shell.gyp:parser-shell',
+           ],
+         }],
+-        # These items don't compile for Android on Mac.
+-        ['host_os!="mac" or OS!="android"', {
+-          'dependencies': [
+-            '../samples/samples.gyp:*',
+-            '../test/cctest/cctest.gyp:*',
+-            '../test/fuzzer/fuzzer.gyp:*',
+-            '../test/unittests/unittests.gyp:*',
+-            ],
+-        }],
+-        ['test_isolation_mode != "noop"', {
+-          'dependencies': [
+-            '../test/bot_default.gyp:*',
+-            '../test/benchmarks/benchmarks.gyp:*',
+-            '../test/default.gyp:*',
+-            '../test/ignition.gyp:*',
+-            '../test/intl/intl.gyp:*',
+-            '../test/message/message.gyp:*',
+-            '../test/mjsunit/mjsunit.gyp:*',
+-            '../test/mozilla/mozilla.gyp:*',
+-            '../test/optimize_for_size.gyp:*',
+-            '../test/perf.gyp:*',
+-            '../test/preparser/preparser.gyp:*',
+-            '../test/simdjs/simdjs.gyp:*',
+-            '../test/test262/test262.gyp:*',
+-            '../test/webkit/webkit.gyp:*',
+-            '../tools/check-static-initializers.gyp:*',
+-            '../tools/gcmole/run_gcmole.gyp:*',
+-            '../tools/jsfunfuzz/jsfunfuzz.gyp:*',
+-            '../tools/run-deopt-fuzzer.gyp:*',
+-            '../tools/run-valgrind.gyp:*',
+-          ],
+-        }],
+       ]
+     }
+   ]
+diff --git a/gypfiles/standalone.gypi b/gypfiles/standalone.gypi
+index 89f06a0..a43976d 100644
+--- a/gypfiles/standalone.gypi
++++ b/gypfiles/standalone.gypi
+@@ -506,6 +506,9 @@
+       }],  # fastbuild!=0
+     ],
+     'target_conditions': [
++      ['_type=="static_library"', {
++        'standalone_static_library': 1,
++      }],
+       ['v8_code == 0', {
+         'defines!': [
+           'DEBUG',
+@@ -770,7 +773,7 @@
+           [ 'visibility=="hidden" and v8_enable_backtrace==0', {
+             'cflags': [ '-fvisibility=hidden' ],
+           }],
+-          [ 'component=="shared_library"', {
++          [ 'component=="shared_library" or component=="static_library" and (v8_target_arch=="x64" or v8_target_arch=="arm64" or v8_target_arch=="arm")', {
+             'cflags': [ '-fPIC', ],
+           }],
+           [ 'clang==0 and coverage==1', {
+-- 
+2.9.0
+
diff --git a/nixpkgs/pkgs/development/libraries/v8/plv8_6_x.nix b/nixpkgs/pkgs/development/libraries/v8/plv8_6_x.nix
new file mode 100644
index 000000000000..71e14a82c3e5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/v8/plv8_6_x.nix
@@ -0,0 +1,189 @@
+# NOTE: this expression is NOT exported from the top-level of all-packages.nix,
+# it is exclusively used by the 'plv8' PostgreSQL extension.
+# Since plv8 2.3.2, plv8 no longer requires this specific version, but as of
+# 2019-08-29, nixpkgs does not have v8 6.x, and v8_5 is bumped to 5.4.232, which
+# is a bit outdated.  plv8 3.x is planned to support v8 7.x
+
+{ stdenv, lib, fetchgit, fetchFromGitHub, gn, ninja, python, glib, pkg-config
+, doCheck ? false
+, snapshot ? true
+}:
+
+let
+  arch = if stdenv.isAarch32
+         then if stdenv.is64bit
+              then"arm64"
+              else "arm"
+         else if stdenv.is64bit
+              then"x64"
+              else "ia32";
+  git_url = "https://chromium.googlesource.com";
+
+  # This data is from the DEPS file in the root of a V8 checkout
+  deps = {
+    "base/trace_event/common" = fetchgit {
+      url    = "${git_url}/chromium/src/base/trace_event/common.git";
+      rev    = "0e9a47d74970bee1bbfc063c47215406f8918699";
+      sha256 = "07rbzrlscp8adh4z86yl5jxdnvgkc3xs950xldpk318wf9i3bh6c";
+    };
+    build = fetchgit {
+      url    = "${git_url}/chromium/src/build.git";
+      rev    = "9338ce52d0b9bcef34c38285fbd5023b62739fac";
+      sha256 = "1s2sa8dy3waidsirjylc82ggb18l1108bczjc8z0v4ywyj4k0cvh";
+    };
+    buildtools = fetchgit {
+      url    = "${git_url}/chromium/buildtools.git";
+      rev    = "505de88083136eefd056e5ee4ca0f01fe9b33de8";
+      sha256 = "0vj216nhb803bggsl0hnyagj8njrm96pn8sim6xcnqb7nhz1vabw";
+    };
+    "test/benchmarks/data" = fetchgit {
+      url    = "${git_url}/v8/deps/third_party/benchmarks.git";
+      rev    = "05d7188267b4560491ff9155c5ee13e207ecd65f";
+      sha256 = "0ad2ay14bn67d61ks4dmzadfnhkj9bw28r4yjdjjyzck7qbnzchl";
+    };
+    "test/mozilla/data" = fetchgit {
+      url    = "${git_url}/v8/deps/third_party/mozilla-tests.git";
+      rev    = "f6c578a10ea707b1a8ab0b88943fe5115ce2b9be";
+      sha256 = "0rfdan76yfawqxbwwb35aa57b723j3z9fx5a2w16nls02yk2kqyn";
+    };
+    "test/test262/data" = fetchgit {
+      url    = "${git_url}/external/github.com/tc39/test262.git";
+      rev    = "5d4c667b271a9b39d0de73aef5ffe6879c6f8811";
+      sha256 = "0q9iwb2nkybf9np95wgf5m372aw2lhx9wlsw41a2a80kbkvb2kqg";
+    };
+    "test/test262/harness" = fetchgit {
+      url    = "${git_url}/external/github.com/test262-utils/test262-harness-py.git";
+      rev    = "0f2acdd882c84cff43b9d60df7574a1901e2cdcd";
+      sha256 = "00brj5avp43yamc92kinba2mg3a2x1rcd7wnm7z093l73idprvkp";
+    };
+    "test/wasm-js" = fetchgit {
+      url    = "${git_url}/external/github.com/WebAssembly/spec.git";
+      rev    = "a7e226a92e660a3d5413cfea4269824f513259d2";
+      sha256 = "0z3aybj3ykajwh2bv5fwd6pwqjjsq8dnwrqc2wncb6r9xcjwbgxp";
+    };
+    "testing/gtest" = fetchgit {
+      url    = "${git_url}/external/github.com/google/googletest.git";
+      rev    = "6f8a66431cb592dad629028a50b3dd418a408c87";
+      sha256 = "0bdba2lr6pg15bla9600zg0r0vm4lnrx0wqz84p376wfdxra24vw";
+    };
+    "third_party/icu" = fetchgit {
+      url    = "${git_url}/chromium/deps/icu.git";
+      rev    = "741688ebf328da9adc52505248bf4e2ef868722c";
+      sha256 = "02ifm18qjlrkn5nm2rxkf9yz9bdlyq7c65jfjndv63vi1drqh1r9";
+    };
+    "third_party/instrumented_libraries" = fetchgit {
+      url    = "${git_url}/chromium/src/third_party/instrumented_libraries.git";
+      rev    = "28417458ac4dc79f68915079d0f283f682504cc0";
+      sha256 = "1qf5c2946n37p843yriv7xawi6ss6samabghq43s49cgd4wq8dc3";
+    };
+    "third_party/jinja2" = fetchgit {
+      url    = "${git_url}/chromium/src/third_party/jinja2.git";
+      rev    = "d34383206fa42d52faa10bb9931d6d538f3a57e0";
+      sha256 = "0d9hyw0bvp3p0dbwy833cm9vdqxcam0qbm9jc561ynphddxlkmgd";
+    };
+    "third_party/markupsafe" = fetchgit {
+      url    = "${git_url}/chromium/src/third_party/markupsafe.git";
+      rev    = "8f45f5cfa0009d2a70589bcda0349b8cb2b72783";
+      sha256 = "168ppjmicfdh4i1l0l25s86mdbrz9fgxmiq1rx33x79mph41scfz";
+    };
+    "tools/clang" = fetchgit {
+      url    = "${git_url}/chromium/src/tools/clang.git";
+      rev    = "8688d267571de76a56746324dcc249bf4232b85a";
+      sha256 = "0krq4zz1vnwp064bm517gwr2napy18wyccdh8w5s4qgkjwwxd63s";
+    };
+    "tools/gyp" = fetchgit {
+      url    = "${git_url}/external/gyp.git";
+      rev    = "d61a9397e668fa9843c4aa7da9e79460fe590bfb";
+      sha256 = "1z081h72mjy285jb1kj5xd0pb4p12n9blvsimsavyn3ldmswv0r0";
+    };
+    "tools/luci-go" = fetchgit {
+      url    = "${git_url}/chromium/src/tools/luci-go.git";
+      rev    = "45a8a51fda92e123619a69e7644d9c64a320b0c1";
+      sha256 = "0r7736gqk7r0i7ig0b5ib10d9q8a8xzsmc0f0fbkm9k78v847vpj";
+    };
+    "tools/swarming_client" = fetchgit {
+      url    = "${git_url}/infra/luci/client-py.git";
+      rev    = "4bd9152f8a975d57c972c071dfb4ddf668e02200";
+      sha256 = "03zk91gzvqv01g1vbl8d7h8al7vs4ymrrdc8ipg9wpq52yh65smh";
+    };
+  };
+
+in
+
+stdenv.mkDerivation rec {
+  pname = "v8";
+  version = "6.4.388.40";
+
+  inherit doCheck;
+
+  src = fetchFromGitHub {
+    owner = "v8";
+    repo = "v8";
+    rev = version;
+    sha256 = "1lq239cgqyidrynz8g3wbdv70ymzv6s0ppad8s219gb3jnizm16a";
+  };
+
+  postUnpack = ''
+    ${lib.concatStringsSep "\n" (
+      lib.mapAttrsToList (n: v: ''
+        mkdir -p $sourceRoot/${n}
+        cp -r ${v}/* $sourceRoot/${n}
+      '') deps)}
+  '';
+
+  prePatch = ''
+    # use our gn, not the bundled one
+    sed -i -e 's#gn_path = .*#gn_path = "${gn}/bin/gn"#' tools/mb/mb.py
+
+    # disable tests
+    if [ "$doCheck" = "" ]; then sed -i -e '/"test:gn_all",/d' BUILD.gn; fi
+
+    # disable sysroot usage
+    chmod u+w build/config build/config/sysroot.gni
+    sed -i build/config/sysroot.gni \
+        -e '/use_sysroot =/ { s#\(use_sysroot =\).*#\1 false#; :a  n; /current_cpu/ { s/^/#/; ba };  }'
+
+    # patch shebangs (/usr/bin/env)
+    patchShebangs tools/dev/v8gen.py
+  '';
+
+  configurePhase = ''
+    tools/dev/v8gen.py -vv ${arch}.release -- \
+        is_component_build=true               \
+        ${if snapshot then "v8_use_external_startup_data=false" else "v8_use_snapshot=false"} \
+        is_clang=false                        \
+        linux_use_bundled_binutils=false      \
+        treat_warnings_as_errors=false        \
+        use_custom_libcxx=false               \
+        use_custom_libcxx_for_host=false
+  '';
+
+  nativeBuildInputs = [ gn ninja pkg-config ];
+  buildInputs = [ python glib ];
+
+  buildPhase = ''
+    ninja -C out.gn/${arch}.release/
+  '';
+
+  enableParallelBuilding = true;
+
+  installPhase = ''
+    install -vD out.gn/${arch}.release/d8 "$out/bin/d8"
+    install -vD out.gn/${arch}.release/mksnapshot "$out/bin/mksnapshot"
+    mkdir -p "$out/lib"
+    for f in libicui18n.so libicuuc.so libv8_libbase.so libv8_libplatform.so libv8.so; do
+        install -vD out.gn/${arch}.release/$f "$out/lib/$f"
+    done
+    install -vD out.gn/${arch}.release/icudtl.dat "$out/lib/icudtl.dat"
+    mkdir -p "$out/include"
+    cp -vr include/*.h "$out/include"
+    cp -vr include/libplatform "$out/include"
+  '';
+
+  meta = with lib; {
+    description = "Google's open source JavaScript engine";
+    maintainers = with maintainers; [ cstrahan proglodyte ];
+    platforms = platforms.linux;
+    license = licenses.bsd3;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/v8/update.sh b/nixpkgs/pkgs/development/libraries/v8/update.sh
new file mode 100755
index 000000000000..f046bb8e6885
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/v8/update.sh
@@ -0,0 +1,47 @@
+#!/usr/bin/env nix-shell
+#! nix-shell -i bash -p curl -p nix-prefetch-git
+VERSION_OVERVIEW=https://omahaproxy.appspot.com/all?os=linux
+TARGET_CHANNEL=beta
+FILE_PATH=6_x.nix
+
+set -eo pipefail
+
+v8_version=$(curl -s "$VERSION_OVERVIEW" | awk -F "," "\$2 ~ /${TARGET_CHANNEL}/ { print \$11 }")
+
+echo "Using V8 version --> $v8_version"
+sed -e "s#\\(version = \\)\"[0-9\.]*\"#\1\"$v8_version\"#" -i ${FILE_PATH}
+
+sha256=$(nix-prefetch-git --no-deepClone https://github.com/v8/v8.git "refs/tags/${v8_version}" \
+    | sed -ne '/sha256/ { s#.*: "\(.*\)".*#\1#; p }')
+sed -e "/repo = \"v8\"/ { n;n; s#\".*\"#\"${sha256}\"# }" -i ${FILE_PATH}
+
+deps="$(mktemp)"
+
+curl -s -o "$deps" "https://raw.githubusercontent.com/v8/v8/${v8_version}/DEPS"
+echo $deps
+
+sed -ne '/= fetchgit {/ { s/.*"\(.*\)".*/\1/; p }' < ${FILE_PATH} | while read dep; do
+    echo "Processing dependency --> $dep"
+    escaped_dep=$(echo "$dep" | sed -e 's#/#\\/#g')
+    dep_rev=$(sed -ne "/\"v8\/${escaped_dep}\":/ { n; s#.*+ \"##; s#\".*##;  p }" "$deps")
+
+    if [ "$dep_rev" = "" ]; then
+        echo "Failed to resolve dependency $dep, not listed in DEPS file"
+        rm -f "$deps"
+        exit 2
+    fi
+
+    repo_url=$(sed -ne "/\"${escaped_dep}\" = fetchgit/ { n; s/.*\"\(.*\)\".*/\1/; s#\${git_url}#https://chromium.googlesource.com#; p }"  ${FILE_PATH})
+    sha256=$(nix-prefetch-git --no-deepClone "$repo_url" "$dep_rev" 2>/dev/null | sed -ne '/sha256/ { s#.*: "\(.*\)".*#\1#; p }')
+
+    if [ "$sha256" = "" ]; then
+        echo "Failed to get sha256 via nix-prefetch-git $repo_url $dep_rev"
+        rm -f "$deps"
+        exit 2
+    fi
+
+    sed -e "/\"${escaped_dep}\" = fetchgit/ { n; n; s/\".*\"/\"${dep_rev}\"/; n; s/\".*\"/\"${sha256}\"/  }" -i ${FILE_PATH}
+done
+
+rm -f "$deps"
+echo done.
diff --git a/nixpkgs/pkgs/development/libraries/vaapi-intel-hybrid/default.nix b/nixpkgs/pkgs/development/libraries/vaapi-intel-hybrid/default.nix
new file mode 100644
index 000000000000..00e9a2042b7a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vaapi-intel-hybrid/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, cmrt, libdrm, libva, libX11, libGL, wayland }:
+
+stdenv.mkDerivation rec {
+  pname = "intel-hybrid-driver";
+  version = "1.0.2";
+
+  src = fetchurl {
+    url = "https://github.com/01org/intel-hybrid-driver/archive/${version}.tar.gz";
+    sha256 = "0ywdhbvzwzzrq4qhylnw1wc8l3j67h26l0cs1rncwhw05s3ndk8n";
+  };
+
+  patches = [
+    # driver_init: load libva-x11.so for any ABI version
+    (fetchurl {
+      url = "https://github.com/01org/intel-hybrid-driver/pull/26.diff";
+      sha256 = "1ql4mbi5x1d2a5c8mkjvciaq60zj8nhx912992winbhfkyvpb3gx";
+    })
+  ];
+
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  buildInputs = [ cmrt libdrm libva libX11 libGL wayland ];
+
+  enableParallelBuilding = true;
+
+  configureFlags = [
+    "--enable-drm"
+    "--enable-x11"
+    "--enable-wayland"
+  ];
+
+  postPatch = ''
+    patchShebangs ./src/shaders/gpp.py
+  '';
+
+  preConfigure = ''
+    sed -i -e "s,LIBVA_DRIVERS_PATH=.*,LIBVA_DRIVERS_PATH=$out/lib/dri," configure
+  '';
+
+  meta = with lib; {
+    homepage = "https://01.org/linuxmedia";
+    description = "Intel driver for the VAAPI library with partial HW acceleration";
+    license = licenses.mit;
+    maintainers = with maintainers; [ tadfisher ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vaapi-intel/default.nix b/nixpkgs/pkgs/development/libraries/vaapi-intel/default.nix
new file mode 100644
index 000000000000..f21a947a533f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vaapi-intel/default.nix
@@ -0,0 +1,53 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, gnum4, pkg-config, python3
+, intel-gpu-tools, libdrm, libva, libX11, libGL, wayland, libXext
+, enableHybridCodec ? false, vaapi-intel-hybrid
+}:
+
+stdenv.mkDerivation rec {
+  pname = "intel-vaapi-driver";
+  version = "2.4.1";
+
+  src = fetchFromGitHub {
+    owner  = "intel";
+    repo   = "intel-vaapi-driver";
+    rev    = version;
+    sha256 = "1cidki3av9wnkgwi7fklxbg3bh6kysf8w3fk2qadjr05a92mx3zp";
+  };
+
+  # Set the correct install path:
+  LIBVA_DRIVERS_PATH = "${placeholder "out"}/lib/dri";
+
+  postInstall = lib.optionalString enableHybridCodec ''
+    ln -s ${vaapi-intel-hybrid}/lib/dri/* $out/lib/dri/
+  '';
+
+  configureFlags = [
+    "--enable-x11"
+    "--enable-wayland"
+  ] ++ lib.optional enableHybridCodec "--enable-hybrid-codec";
+
+  nativeBuildInputs = [ autoreconfHook gnum4 pkg-config python3 ];
+
+  buildInputs = [ intel-gpu-tools libdrm libva libX11 libXext libGL wayland ]
+    ++ lib.optional enableHybridCodec vaapi-intel-hybrid;
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    homepage = "https://01.org/linuxmedia";
+    license = licenses.mit;
+    description = "VA-API user mode driver for Intel GEN Graphics family";
+    longDescription = ''
+      This VA-API video driver backend provides a bridge to the GEN GPUs through
+      the packaging of buffers and commands to be sent to the i915 driver for
+      exercising both hardware and shader functionality for video decode,
+      encode, and processing.
+      VA-API is an open-source library and API specification, which provides
+      access to graphics hardware acceleration capabilities for video
+      processing. It consists of a main library and driver-specific acceleration
+      backends for each supported hardware vendor.
+    '';
+    platforms = [ "x86_64-linux" "i686-linux" ];
+    maintainers = with maintainers; [ primeos ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vaapi-vdpau/default.nix b/nixpkgs/pkgs/development/libraries/vaapi-vdpau/default.nix
new file mode 100644
index 000000000000..fd38eba73974
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vaapi-vdpau/default.nix
@@ -0,0 +1,40 @@
+{ lib, stdenv, fetchurl, fetchpatch, libvdpau, libGLU, libGL, libva, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "libva-vdpau-driver";
+  version = "0.7.4";
+
+  src = fetchurl {
+    url = "https://www.freedesktop.org/software/vaapi/releases/${pname}/${pname}-${version}.tar.bz2";
+    sha256 = "1fcvgshzyc50yb8qqm6v6wn23ghimay23ci0p8sm8gxcy211jp0m";
+  };
+
+  patches = [
+    (fetchpatch { url = "https://src.fedoraproject.org/rpms/libva-vdpau-driver/raw/0ad71107e28a60ea453ac70e895cf64342bd58d0/f/libva-vdpau-driver-0.7.4-glext-85.patch";
+                  sha256 = "0f0v7cl7kna3jcfnxw48b9mfl0hpacw72df9vym96sa2206vqlb0"; })
+    (fetchpatch { url = "https://src.fedoraproject.org/rpms/libva-vdpau-driver/raw/0ad71107e28a60ea453ac70e895cf64342bd58d0/f/libva-vdpau-driver-0.7.4-drop-h264-api.patch";
+                  sha256 = "0q5w83jbf4qqmhwf54h906pzxgvhqv7g2vrkw7jzgnrxhhj9sj60"; })
+    (fetchpatch { url = "https://src.fedoraproject.org/rpms/libva-vdpau-driver/raw/0ad71107e28a60ea453ac70e895cf64342bd58d0/f/libva-vdpau-driver-0.7.4-fix_type.patch";
+                  sha256 = "0s5dk6aa4sm0iyicnf2fwfsrqbvr58nbp77mhjg5bvwlar7znqv7"; })
+    (fetchpatch { url = "https://src.fedoraproject.org/rpms/libva-vdpau-driver/raw/0ad71107e28a60ea453ac70e895cf64342bd58d0/f/sigfpe-crash.patch";
+                  sha256 = "15snqf60ib0xb3cnav5b2r55qv8lv2fa4p6jwxajh8wbvqpw0ibz"; })
+    (fetchpatch { url = "https://src.fedoraproject.org/rpms/libva-vdpau-driver/raw/0ad71107e28a60ea453ac70e895cf64342bd58d0/f/implement-vaquerysurfaceattributes.patch";
+                  sha256 = "1dapx3bqqblw6l2iqqw1yff6qifam8q4m2rq343kwb3dqhy2ymy5"; })
+    (fetchpatch { url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/x11-libs/libva-vdpau-driver/files/libva-vdpau-driver-0.7.4-include-linux-videodev2.h.patch";
+                  sha256 = "1m4is6lk580mppsx2mvdv1xifj6gvx724si4qynsm9qrdfdc9fby"; })
+  ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libvdpau libGLU libGL libva ];
+
+  postPatch = ''
+    sed -i -e "s,LIBVA_DRIVERS_PATH=.*,LIBVA_DRIVERS_PATH=$out/lib/dri," configure
+  '';
+
+  meta = with lib; {
+    homepage = "https://cgit.freedesktop.org/vaapi/vdpau-driver";
+    license = licenses.gpl2Plus;
+    description = "VDPAU driver for the VAAPI library";
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/valhalla/default.nix b/nixpkgs/pkgs/development/libraries/valhalla/default.nix
new file mode 100644
index 000000000000..6eac19bcb2cd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/valhalla/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
+, zlib, curl, protobuf, prime-server, boost, sqlite, libspatialite
+, luajit, geos, python3, zeromq }:
+
+stdenv.mkDerivation rec {
+  pname = "valhalla";
+  version = "3.1.0";
+
+  src = fetchFromGitHub {
+    owner = "valhalla";
+    repo = "valhalla";
+    rev = version;
+    sha256 = "04vxvzy6hnhdvb9lh1p5vqzzi2drv0g4l2gnbdp44glipbzgd4dr";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [
+    zlib curl protobuf prime-server boost sqlite libspatialite
+    luajit geos python3 zeromq
+  ];
+
+  cmakeFlags = [
+    "-DENABLE_TESTS=OFF"
+    "-DENABLE_BENCHMARKS=OFF"
+  ];
+
+  meta = with lib; {
+    description = "Open Source Routing Engine for OpenStreetMap";
+    homepage = "https://valhalla.readthedocs.io/";
+    license = licenses.mit;
+    maintainers = [ maintainers.Thra11 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vapoursynth-mvtools/default.nix b/nixpkgs/pkgs/development/libraries/vapoursynth-mvtools/default.nix
new file mode 100644
index 000000000000..76ce9a36c713
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vapoursynth-mvtools/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook,
+  vapoursynth, nasm, fftwFloat
+}:
+
+stdenv.mkDerivation rec {
+  pname = "vapoursynth-mvtools";
+  version = "23";
+
+  src = fetchFromGitHub {
+    owner  = "dubhater";
+    repo   = "vapoursynth-mvtools";
+    rev    = "v${version}";
+    sha256 = "0lngkvxnzn82rz558nvl96rvclrck07ja1pny7wcfixp9b68ppkn";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [
+    autoreconfHook
+    nasm vapoursynth fftwFloat
+  ];
+
+  configureFlags = [ "--libdir=$(out)/lib/vapoursynth" ];
+
+  meta = with lib; {
+    description = "A set of filters for motion estimation and compensation";
+    homepage = "https://github.com/dubhater/vapoursynth-mvtools";
+    license  = licenses.gpl2;
+    maintainers = with maintainers; [ rnhmjoj ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vapoursynth/0001-Call-weak-function-to-allow-adding-preloaded-plugins.patch b/nixpkgs/pkgs/development/libraries/vapoursynth/0001-Call-weak-function-to-allow-adding-preloaded-plugins.patch
new file mode 100644
index 000000000000..0937ac6e3084
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vapoursynth/0001-Call-weak-function-to-allow-adding-preloaded-plugins.patch
@@ -0,0 +1,74 @@
+From 9b05a6f331506afa5aca8865677af83403d2a32d Mon Sep 17 00:00:00 2001
+From: Tadeo Kondrak <me@tadeo.ca>
+Date: Mon, 25 Jan 2021 11:17:44 -0700
+Subject: [PATCH] Call weak function to allow adding preloaded plugins after
+ compile
+
+---
+ src/core/vscore.cpp | 19 +++++++++++++++++++
+ src/core/vscore.h   |  5 +++++
+ 2 files changed, 24 insertions(+)
+
+diff --git a/src/core/vscore.cpp b/src/core/vscore.cpp
+index 2d29844d..35c509ed 100644
+--- a/src/core/vscore.cpp
++++ b/src/core/vscore.cpp
+@@ -1229,6 +1229,20 @@ void VSCore::destroyFilterInstance(VSNode *node) {
+     freeDepth--;
+ }
+ 
++extern "C" {
++void __attribute__((weak)) VSLoadPluginsNix(void (*load)(void *data, const char *path), void *data);
++
++struct VSLoadPluginsNixCallbackData {
++    VSCore *core;
++    const char *filter;
++};
++
++static void VSLoadPluginsNixCallback(void *data, const char *path) {
++    auto callbackData = static_cast<VSLoadPluginsNixCallbackData *>(data);
++    callbackData->core->loadAllPluginsInPath(path, callbackData->filter);
++}
++}
++
+ VSCore::VSCore(int threads) :
+     coreFreed(false),
+     numFilterInstances(1),
+@@ -1351,6 +1365,11 @@ VSCore::VSCore(int threads) :
+     } // If neither exists, an empty string will do.
+ #endif
+ 
++    if (VSLoadPluginsNix != nullptr) {
++        VSLoadPluginsNixCallbackData data{this, filter.c_str()};
++        VSLoadPluginsNix(VSLoadPluginsNixCallback, &data);
++    }
++
+     VSMap *settings = readSettings(configFile);
+     const char *error = vs_internal_vsapi.getError(settings);
+     if (error) {
+diff --git a/src/core/vscore.h b/src/core/vscore.h
+index 74df8a84..3efac811 100644
+--- a/src/core/vscore.h
++++ b/src/core/vscore.h
+@@ -582,6 +582,9 @@ public:
+     VSFunction() : functionData(nullptr), func(nullptr) {}
+ };
+ 
++extern "C" {
++static void VSLoadPluginsNixCallback(void *data, const char *path);
++}
+ 
+ struct VSPlugin {
+ private:
+@@ -683,6 +686,8 @@ public:
+ 
+     explicit VSCore(int threads);
+     void freeCore();
++
++    friend void VSLoadPluginsNixCallback(void *data, const char *path);
+ };
+ 
+ #endif // VSCORE_H
+-- 
+2.30.0
+
diff --git a/nixpkgs/pkgs/development/libraries/vapoursynth/default.nix b/nixpkgs/pkgs/development/libraries/vapoursynth/default.nix
new file mode 100644
index 000000000000..37d82b0b4bd9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vapoursynth/default.nix
@@ -0,0 +1,67 @@
+{ lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook, makeWrapper
+, runCommandCC, runCommand, vapoursynth, writeText, patchelf, buildEnv
+, zimg, libass, python3, libiconv
+, ApplicationServices
+, ocrSupport ? false, tesseract
+, imwriSupport ? true, imagemagick
+}:
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "vapoursynth";
+  version = "R54";
+
+  src = fetchFromGitHub {
+    owner  = "vapoursynth";
+    repo   = "vapoursynth";
+    rev    = version;
+    sha256 = "01jym2rq28j0g792yagk9dvm411gwmk6qgj9rgrg7ckpxmw27w2s";
+  };
+
+  patches = [
+    ./0001-Call-weak-function-to-allow-adding-preloaded-plugins.patch
+  ];
+
+  nativeBuildInputs = [ pkg-config autoreconfHook makeWrapper ];
+  buildInputs = [
+    zimg libass
+    (python3.withPackages (ps: with ps; [ sphinx cython ]))
+  ] ++ optionals stdenv.isDarwin [ libiconv ApplicationServices ]
+    ++ optional ocrSupport   tesseract
+    ++ optional imwriSupport imagemagick;
+
+  configureFlags = [
+    (optionalString (!ocrSupport)   "--disable-ocr")
+    (optionalString (!imwriSupport) "--disable-imwri")
+  ];
+
+  enableParallelBuilding = true;
+
+  passthru = rec {
+    # If vapoursynth is added to the build inputs of mpv and then
+    # used in the wrapping of it, we want to know once inside the
+    # wrapper, what python3 version was used to build vapoursynth so
+    # the right python3.sitePackages will be used there.
+    inherit python3;
+
+    withPlugins = import ./plugin-interface.nix {
+      inherit lib python3 buildEnv writeText runCommandCC stdenv runCommand
+        vapoursynth makeWrapper withPlugins;
+    };
+  };
+
+  postInstall = ''
+    wrapProgram $out/bin/vspipe \
+        --prefix PYTHONPATH : $out/${python3.sitePackages}
+  '';
+
+  meta = with lib; {
+    description = "A video processing framework with the future in mind";
+    homepage    = "http://www.vapoursynth.com/";
+    license     = licenses.lgpl21;
+    platforms   = platforms.x86_64;
+    maintainers = with maintainers; [ rnhmjoj sbruder tadeokondrak ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/vapoursynth/editor.nix b/nixpkgs/pkgs/development/libraries/vapoursynth/editor.nix
new file mode 100644
index 000000000000..5cd4b4608ecb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vapoursynth/editor.nix
@@ -0,0 +1,59 @@
+{ lib, mkDerivation, fetchFromBitbucket, makeWrapper, runCommand
+, python3, vapoursynth
+, qmake, qtbase, qtwebsockets
+}:
+
+let
+  unwrapped = mkDerivation rec {
+    pname = "vapoursynth-editor";
+    version = "R19";
+
+    src = fetchFromBitbucket {
+      owner = "mystery_keeper";
+      repo = pname;
+      rev = lib.toLower version;
+      sha256 = "1zlaynkkvizf128ln50yvzz3b764f5a0yryp6993s9fkwa7djb6n";
+    };
+
+    nativeBuildInputs = [ qmake ];
+    buildInputs = [ qtbase vapoursynth qtwebsockets ];
+
+    dontWrapQtApps = true;
+
+    preConfigure = "cd pro";
+
+    preFixup = ''
+      cd ../build/release*
+      mkdir -p $out/bin
+      for bin in vsedit{,-job-server{,-watcher}}; do
+          mv $bin $out/bin
+          wrapQtApp $out/bin/$bin
+      done
+    '';
+
+    passthru = { inherit withPlugins; };
+
+    meta = with lib; {
+      description = "Cross-platform editor for VapourSynth scripts";
+      homepage = "https://bitbucket.org/mystery_keeper/vapoursynth-editor";
+      license = licenses.mit;
+      maintainers = with maintainers; [ tadeokondrak ];
+      platforms = platforms.all;
+    };
+  };
+
+  withPlugins = plugins: let
+    vapoursynthWithPlugins = vapoursynth.withPlugins plugins;
+  in runCommand "${unwrapped.name}-with-plugins" {
+    buildInputs = [ makeWrapper ];
+    passthru = { withPlugins = plugins': withPlugins (plugins ++ plugins'); };
+  } ''
+    mkdir -p $out/bin
+    for bin in vsedit{,-job-server{,-watcher}}; do
+        makeWrapper ${unwrapped}/bin/$bin $out/bin/$bin \
+            --prefix PYTHONPATH : ${vapoursynthWithPlugins}/${python3.sitePackages} \
+            --prefix LD_LIBRARY_PATH : ${vapoursynthWithPlugins}/lib
+    done
+  '';
+in
+  withPlugins []
diff --git a/nixpkgs/pkgs/development/libraries/vapoursynth/plugin-interface.nix b/nixpkgs/pkgs/development/libraries/vapoursynth/plugin-interface.nix
new file mode 100644
index 000000000000..95df3c97747f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vapoursynth/plugin-interface.nix
@@ -0,0 +1,113 @@
+{ lib, python3, buildEnv, writeText, runCommandCC, stdenv, runCommand
+, vapoursynth, makeWrapper, withPlugins }:
+
+plugins: let
+  pythonEnvironment = python3.buildEnv.override {
+    extraLibs = plugins;
+  };
+
+  getRecursivePropagatedBuildInputs = pkgs: lib.flatten
+    (map
+      (pkg: let cleanPropagatedBuildInputs = lib.filter lib.isDerivation pkg.propagatedBuildInputs;
+        in cleanPropagatedBuildInputs ++ (getRecursivePropagatedBuildInputs cleanPropagatedBuildInputs))
+      pkgs);
+
+  deepPlugins = lib.unique (plugins ++ (getRecursivePropagatedBuildInputs plugins));
+
+  pluginsEnv = buildEnv {
+    name = "vapoursynth-plugins-env";
+    pathsToLink = [ "/lib/vapoursynth" ];
+    paths = deepPlugins;
+  };
+
+  pluginLoader = let
+    source = writeText "vapoursynth-nix-plugins.c" ''
+      void VSLoadPluginsNix(void (*load)(void *data, const char *path), void *data) {
+      ${lib.concatMapStringsSep "" (path: "load(data, \"${path}/lib/vapoursynth\");") deepPlugins}
+      }
+    '';
+  in
+  runCommandCC "vapoursynth-plugin-loader" {
+    executable = true;
+    preferLocalBuild = true;
+    allowSubstitutes = false;
+  } ''
+    mkdir -p $out/lib
+    $CC -shared -fPIC ${source} -o "$out/lib/libvapoursynth-nix-plugins${ext}"
+  '';
+
+  ext = stdenv.targetPlatform.extensions.sharedLibrary;
+in
+runCommand "${vapoursynth.name}-with-plugins" {
+  nativeBuildInputs = [ makeWrapper ];
+  passthru = {
+    inherit python3;
+    withPlugins = plugins': withPlugins (plugins ++ plugins');
+  };
+} ''
+  mkdir -p \
+    $out/bin \
+    $out/lib/pkgconfig \
+    $out/lib/vapoursynth \
+    $out/${python3.sitePackages}
+
+  for textFile in \
+      lib/pkgconfig/vapoursynth{,-script}.pc \
+      lib/libvapoursynth.la \
+      lib/libvapoursynth-script.la \
+      ${python3.sitePackages}/vapoursynth.la
+  do
+      substitute ${vapoursynth}/$textFile $out/$textFile \
+          --replace "${vapoursynth}" "$out"
+  done
+
+  for binaryPlugin in ${pluginsEnv}/lib/vapoursynth/*; do
+      ln -s $binaryPlugin $out/''${binaryPlugin#"${pluginsEnv}/"}
+  done
+
+  for pythonPlugin in ${pythonEnvironment}/${python3.sitePackages}/*; do
+      ln -s $pythonPlugin $out/''${pythonPlugin#"${pythonEnvironment}/"}
+  done
+
+  for binaryFile in \
+      lib/libvapoursynth${ext} \
+      lib/libvapoursynth-script${ext}.0.0.0
+  do
+    old_rpath=$(patchelf --print-rpath ${vapoursynth}/$binaryFile)
+    new_rpath="$old_rpath:$out/lib"
+    patchelf \
+        --set-rpath "$new_rpath" \
+        --output $out/$binaryFile \
+        ${vapoursynth}/$binaryFile
+    patchelf \
+        --add-needed libvapoursynth-nix-plugins${ext} \
+        $out/$binaryFile
+  done
+
+  for binaryFile in \
+      ${python3.sitePackages}/vapoursynth${ext} \
+      bin/.vspipe-wrapped
+  do
+      old_rpath=$(patchelf --print-rpath ${vapoursynth}/$binaryFile)
+      new_rpath="''${old_rpath//"${vapoursynth}"/"$out"}"
+      patchelf \
+          --set-rpath "$new_rpath" \
+          --output $out/$binaryFile \
+          ${vapoursynth}/$binaryFile
+  done
+
+  ln -s \
+      ${pluginLoader}/lib/libvapoursynth-nix-plugins${ext} \
+      $out/lib/libvapoursynth-nix-plugins${ext}
+  ln -s ${vapoursynth}/include $out/include
+  ln -s ${vapoursynth}/lib/vapoursynth/* $out/lib/vapoursynth
+  ln -s \
+      libvapoursynth-script${ext}.0.0.0 \
+      $out/lib/libvapoursynth-script${ext}
+  ln -s \
+      libvapoursynth-script${ext}.0.0.0 \
+      $out/lib/libvapoursynth-script${ext}.0
+
+  makeWrapper $out/bin/.vspipe-wrapped $out/bin/vspipe \
+      --prefix PYTHONPATH : $out/${python3.sitePackages}
+''
diff --git a/nixpkgs/pkgs/development/libraries/vc/0.7.nix b/nixpkgs/pkgs/development/libraries/vc/0.7.nix
new file mode 100644
index 000000000000..dd5b03f2dc50
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vc/0.7.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "Vc";
+  version = "0.7.5";
+
+  src = fetchFromGitHub {
+    owner = "VcDevel";
+    repo = "Vc";
+    rev = version;
+    sha256 = "190s4r2n3jsivl4j2m288j3rqmgjj6gl308hi9mzwyhcfn17q8br";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  postPatch = ''
+    sed -i '/OptimizeForArchitecture()/d' cmake/VcMacros.cmake
+    sed -i '/AutodetectHostArchitecture()/d' print_target_architecture.cmake
+  '';
+
+  meta = with lib; {
+    description = "Library for multiprecision complex arithmetic with exact rounding";
+    homepage = "https://github.com/VcDevel/Vc";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vc/default.nix b/nixpkgs/pkgs/development/libraries/vc/default.nix
new file mode 100644
index 000000000000..40347940ff04
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vc/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "Vc";
+  version = "1.4.1";
+
+  src = fetchFromGitHub {
+    owner = "VcDevel";
+    repo = "Vc";
+    rev = version;
+    sha256 = "09nf6j1hyq2yv0c1cmnv4ff5243ylsajy1xj3dz8c2qqcm14y6cm";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  postPatch = ''
+    sed -i '/OptimizeForArchitecture()/d' cmake/VcMacros.cmake
+    sed -i '/AutodetectHostArchitecture()/d' print_target_architecture.cmake
+  '';
+
+  meta = with lib; {
+    description = "Library for multiprecision complex arithmetic with exact rounding";
+    homepage = "https://github.com/VcDevel/Vc";
+    license = licenses.bsd3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vcdimager/default.nix b/nixpkgs/pkgs/development/libraries/vcdimager/default.nix
new file mode 100644
index 000000000000..5c3140a177c3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vcdimager/default.nix
@@ -0,0 +1,26 @@
+{ stdenv, lib, fetchurl, pkg-config, libcdio, libxml2, popt
+, libiconv, darwin }:
+
+stdenv.mkDerivation rec {
+  pname = "vcdimager";
+  version = "2.0.1";
+
+  src = fetchurl {
+    url = "mirror://gnu/vcdimager/${pname}-${version}.tar.gz";
+    sha256 = "0ypnb1vp49nmzp5571ynlz6n1gh90f23w3z4x95hb7c2p7pmylb7";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ libxml2 popt libiconv ]
+             ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ IOKit DiskArbitration ]);
+
+  propagatedBuildInputs = [ libcdio ];
+
+  meta = with lib; {
+    homepage = "https://www.gnu.org/software/vcdimager/";
+    description = "Full-featured mastering suite for authoring, disassembling and analyzing Video CDs and Super Video CDs";
+    platforms = platforms.unix;
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vcg/default.nix b/nixpkgs/pkgs/development/libraries/vcg/default.nix
new file mode 100644
index 000000000000..d8c83bf54a8a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vcg/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, eigen }:
+
+stdenv.mkDerivation rec {
+  pname = "vcg";
+  version = "1.0.1";
+
+  src = fetchFromGitHub {
+    owner = "cnr-isti-vclab";
+    repo = "vcglib";
+    rev = "v${version}";
+    sha256 = "0jh8jc8rn7rci8qr3q03q574fk2hsc3rllysck41j8xkr3rmxz2f";
+  };
+
+  propagatedBuildInputs = [ eigen ];
+
+  installPhase = ''
+    mkdir -p $out/include
+    cp -r vcg wrap $out/include
+    find $out -name \*.h -exec sed -i 's,<eigenlib/,<eigen3/,g' {} \;
+  '';
+
+  meta = with lib; {
+    homepage = "http://vcg.isti.cnr.it/vcglib/install.html";
+    description = "C++ library for manipulation, processing and displaying with OpenGL of triangle and tetrahedral meshes";
+    license = licenses.gpl3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vid-stab/default.nix b/nixpkgs/pkgs/development/libraries/vid-stab/default.nix
new file mode 100644
index 000000000000..d224c2f3be58
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vid-stab/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, cmake, openmp }:
+
+stdenv.mkDerivation rec {
+  pname = "vid.stab";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "georgmartius";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0a3frpm2kdbx7vszhg64p3alisag73bcspl7fp3a2f1kgq7rbh38";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = lib.optionals stdenv.cc.isClang [ openmp ];
+
+  meta = with lib; {
+    description = "Video stabilization library";
+    homepage = "http://public.hronopik.de/vid.stab/";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ codyopel ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vigra/default.nix b/nixpkgs/pkgs/development/libraries/vigra/default.nix
new file mode 100644
index 000000000000..56402172d9ff
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vigra/default.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchurl, boost, cmake, fftw, fftwSinglePrec, hdf5, ilmbase
+, libjpeg, libpng, libtiff, openexr, python2Packages }:
+
+let
+  inherit (python2Packages) python numpy;
+  # Might want to use `python2.withPackages(ps: [ps.numpy]);` here...
+in stdenv.mkDerivation rec {
+  pname = "vigra";
+  version = "1.11.1";
+
+  src = fetchurl {
+    url = "https://github.com/ukoethe/vigra/archive/Version-${lib.replaceChars ["."] ["-"] version}.tar.gz";
+    sha256 = "03i5wfscv83jb8vnwwhfmm8yfiniwkvk13myzhr1kbwbs9884wdj";
+  };
+
+  NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR";
+
+  # Fixes compilation with clang (on darwin) see https://github.com/ukoethe/vigra/issues/414
+  patches =
+    let clangPatch = fetchurl { url = "https://github.com/ukoethe/vigra/commit/81958d302494e137f98a8b1d7869841532f90388.patch";
+                                sha256 = "1i1w6smijgb5z8bg9jaq84ccy00k2sxm87s37lgjpyix901gjlgi"; };
+    in [ clangPatch ];
+
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost fftw fftwSinglePrec hdf5 ilmbase libjpeg libpng
+                  libtiff numpy openexr python ];
+
+  preConfigure = "cmakeFlags+=\" -DVIGRANUMPY_INSTALL_DIR=$out/lib/${python.libPrefix}/site-packages\"";
+
+  cmakeFlags = [ "-DWITH_OPENEXR=1" ]
+            ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-linux")
+                  [ "-DCMAKE_CXX_FLAGS=-fPIC" "-DCMAKE_C_FLAGS=-fPIC" ];
+
+  # fails with "./test_watersheds3d: error while loading shared libraries: libvigraimpex.so.11: cannot open shared object file: No such file or directory"
+  doCheck = false;
+
+  meta = with lib; {
+    description = "Novel computer vision C++ library with customizable algorithms and data structures";
+    homepage = "https://hci.iwr.uni-heidelberg.de/vigra";
+    license = licenses.mit;
+    maintainers = [ maintainers.viric ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/virglrenderer/default.nix b/nixpkgs/pkgs/development/libraries/virglrenderer/default.nix
new file mode 100644
index 000000000000..4c4af6b2c1f8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/virglrenderer/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, cmake, meson, ninja, pkg-config, python3
+, libGLU, epoxy, libX11, libdrm, mesa
+}:
+
+stdenv.mkDerivation rec {
+  pname = "virglrenderer";
+  version = "0.9.1";
+
+  src = fetchurl {
+    url = "https://gitlab.freedesktop.org/virgl/virglrenderer/-/archive/virglrenderer-${version}/virglrenderer-virglrenderer-${version}.tar.bz2";
+    sha256 = "1h76a1ylhh4niq33sa5knx033sr4k2816vibh4m58j54y7qc6346";
+  };
+
+  buildInputs = [ libGLU epoxy libX11 libdrm mesa ];
+
+  nativeBuildInputs = [ cmake meson ninja pkg-config python3 ];
+
+  dontUseCmakeConfigure = true;
+
+  meta = with lib; {
+    description = "A virtual 3D GPU library that allows a qemu guest to use the host GPU for accelerated 3D rendering";
+    homepage = "https://virgil3d.github.io/";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.xeji ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vmime/default.nix b/nixpkgs/pkgs/development/libraries/vmime/default.nix
new file mode 100644
index 000000000000..3f33df66339e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vmime/default.nix
@@ -0,0 +1,31 @@
+{lib, stdenv, fetchFromGitHub
+, gsasl, gnutls, pkg-config, cmake, zlib, libtasn1, libgcrypt, gtk3
+# this will not work on non-nixos systems
+, sendmailPath ? "/run/wrappers/bin/sendmail"
+}:
+
+stdenv.mkDerivation rec {
+  pname = "vmime";
+  version = "0.9.2";
+  src = fetchFromGitHub {
+    owner = "kisli";
+    repo = "vmime";
+    rev = "v${version}";
+    sha256 = "1304n50ny2av8bagjpgz55ag0nd7m313akm9bb73abjn6h5nzacv";
+  };
+
+  buildInputs = [ gsasl gnutls zlib libtasn1 libgcrypt gtk3 ];
+  nativeBuildInputs = [ pkg-config cmake ];
+
+  cmakeFlags = [
+    "-DVMIME_SENDMAIL_PATH=${sendmailPath}"
+  ];
+
+  meta = {
+    homepage = "https://www.vmime.org/";
+    description = "Free mail library for C++";
+    license = lib.licenses.gpl3;
+    maintainers = with lib.maintainers; [viric];
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vmmlib/default.nix b/nixpkgs/pkgs/development/libraries/vmmlib/default.nix
new file mode 100644
index 000000000000..4aa525feb193
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vmmlib/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, boost, lapack
+, Accelerate, CoreGraphics, CoreVideo
+}:
+
+stdenv.mkDerivation rec {
+  version = "1.6.2";
+  pname = "vmmlib";
+
+  src = fetchFromGitHub {
+    owner = "VMML";
+    repo = "vmmlib";
+    rev = "release-${version}";
+    sha256 = "0sn6jl1r5k6ka0vkjsdnn14hb95dqq8158dapby6jk72wqj9kdml";
+  };
+
+  patches = [
+    ./disable-cpack.patch   #disable the need of cpack/rpm
+  ];
+
+  nativeBuildInputs = [ pkg-config cmake ];
+  buildInputs = [ boost lapack ]
+    ++ lib.optionals stdenv.isDarwin [ Accelerate CoreGraphics CoreVideo ];
+
+  doCheck = !stdenv.isDarwin;
+
+  checkTarget = "test";
+
+  meta = with lib; {
+    description = "A vector and matrix math library implemented using C++ templates";
+
+    longDescription = ''vmmlib is a vector and matrix math library implemented
+            using C++ templates. Its basic functionality includes a vector
+            and a matrix class, with additional functionality for the
+            often-used 3d and 4d vectors and 3x3 and 4x4 matrices.
+            More advanced functionality include solvers, frustum
+            computations and frustum culling classes, and spatial data structures'';
+
+    license     = licenses.bsd2;
+    homepage    = "https://github.com/VMML/vmmlib/";
+    maintainers = [ maintainers.adev ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vmmlib/disable-cpack.patch b/nixpkgs/pkgs/development/libraries/vmmlib/disable-cpack.patch
new file mode 100644
index 000000000000..8b9a7983a928
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vmmlib/disable-cpack.patch
@@ -0,0 +1,11 @@
+diff -ur a/CMakeLists.txt b/CMakeLists.txt
+--- a/CMakeLists.txt	1970-01-01 00:00:01.000000000 +0000
++++ b/CMakeLists.txt	2016-02-19 08:49:30.053759000 +0000
+@@ -178,6 +178,5 @@
+ install(FILES ${DOCS} DESTINATION share/vmmlib COMPONENT dev)
+ 
+ include(DoxygenRule) # must be after all targets
+-include(CPackConfig)
+ include(CTest)
+-include(PackageConfig)
++
diff --git a/nixpkgs/pkgs/development/libraries/vo-aacenc/default.nix b/nixpkgs/pkgs/development/libraries/vo-aacenc/default.nix
new file mode 100644
index 000000000000..fb8dd43fe032
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vo-aacenc/default.nix
@@ -0,0 +1,19 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "vo-aacenc";
+  version = "0.1.3";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/opencore-amr/fdk-aac/${pname}-${version}.tar.gz";
+    sha256 = "sha256-5Rp0d6NZ8Y33xPgtGV2rThTnQUy9SM95zBlfxEaFDzY=";
+  };
+
+  meta = with lib; {
+    description = "VisualOn AAC encoder library";
+    homepage    = "https://sourceforge.net/projects/opencore-amr/";
+    license     = licenses.asl20;
+    maintainers = [ maintainers.baloo ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vo-amrwbenc/default.nix b/nixpkgs/pkgs/development/libraries/vo-amrwbenc/default.nix
new file mode 100644
index 000000000000..dccbd1349d2c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vo-amrwbenc/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl, autoreconfHook }:
+
+let
+    version = "0.1.3";
+in
+stdenv.mkDerivation {
+  name = "vo-amrwbenc-${version}";
+  version = "0.1.3";
+  buildInputs = [ autoreconfHook ];
+  src = fetchurl {
+    url = "https://github.com/mstorsjo/vo-amrwbenc/archive/v${version}.tar.gz";
+    sha256 = "85c79997ba7ddb9c95b5ddbe9ea032e27595390f3cbd686ed46a69e485cc053c";
+  };
+
+  meta = {
+    homepage = "https://sourceforge.net/projects/opencore-amr/";
+    description = "VisualOn Adaptive Multi Rate Wideband (AMR-WB) encoder";
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.Esteth ];
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/volk/default.nix b/nixpkgs/pkgs/development/libraries/volk/default.nix
new file mode 100644
index 000000000000..40ae88bf71bb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/volk/default.nix
@@ -0,0 +1,42 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, cmake
+, python3
+, enableModTool ? true
+, removeReferencesTo
+}:
+
+stdenv.mkDerivation rec {
+  pname = "volk";
+  version = "2.5.0";
+
+  src = fetchFromGitHub {
+    owner = "gnuradio";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "XvX6emv30bSB29EFm6aC+j8NGOxWqHCNv0Hxtdrq/jc=";
+    fetchSubmodules = true;
+  };
+
+  cmakeFlags = lib.optionals (!enableModTool) [ "-DENABLE_MODTOOL=OFF" ];
+  postInstall = lib.optionalString (!stdenv.isDarwin) ''
+    ${removeReferencesTo}/bin/remove-references-to -t ${stdenv.cc} $(readlink -f $out/lib/libvolk.so)
+  '';
+
+  nativeBuildInputs = [
+    cmake
+    python3
+    python3.pkgs.Mako
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    homepage = "http://libvolk.org/";
+    description = "The Vector Optimized Library of Kernels";
+    license = licenses.gpl3Plus;
+    maintainers = with maintainers; [ doronbehar ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/volume-key/default.nix b/nixpkgs/pkgs/development/libraries/volume-key/default.nix
new file mode 100644
index 000000000000..ce2f7c20d3cb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/volume-key/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchgit, autoreconfHook, pkg-config, gettext, python3
+, ncurses, swig, glib, util-linux, cryptsetup, nss, gpgme
+, autoconf, automake, libtool
+, buildPackages
+}:
+
+stdenv.mkDerivation rec {
+  pname = "volume_key";
+  version = "0.3.11";
+
+  src = fetchgit {
+    url = "https://pagure.io/volume_key.git";
+    rev = "volume_key-${version}";
+    sha256 = "1sqdbcih1c39bjiv4mm1m7acc3lfh2i2hf2r9i7rk8adfzq8awma";
+  };
+
+  outputs = [ "out" "man" "dev" "py" ];
+
+  nativeBuildInputs = [ autoconf automake libtool pkg-config gettext swig ];
+
+  buildInputs = [ autoreconfHook glib cryptsetup nss util-linux gpgme ncurses ];
+
+  configureFlags = [
+    "--with-gpgme-prefix=${gpgme.dev}"
+  ];
+
+  preConfigure = ''
+    export PYTHON="${buildPackages.python3}/bin/python"
+    export PYTHON3_CONFIG="${python3}/bin/python3-config"
+  '';
+
+  makeFlags = [
+    "pyexecdir=$(py)/${python3.sitePackages}"
+    "pythondir=$(py)/${python3.sitePackages}"
+  ];
+
+  doCheck = false; # fails 1 out of 1 tests, needs `certutil`
+
+  meta = with lib; {
+    description = "A library for manipulating storage volume encryption keys and storing them separately from volumes to handle forgotten passphrases, and the associated command-line tool";
+    homepage = "https://pagure.io/volume_key/";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vrb/default.nix b/nixpkgs/pkgs/development/libraries/vrb/default.nix
new file mode 100644
index 000000000000..1ebc37cdf2f3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vrb/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "vrb";
+  version = "0.5.1";
+
+  src = fetchurl {
+    url = "http://vrb.sourceforge.net/download/${pname}-${version}.tar.bz2";
+    sha256 = "d579ed1998ef2d78e2ef8481a748d26e1fa12cdda806d2e31d8ec66ffb0e289f";
+  };
+
+  patches = [
+    ./removed_options.patch
+    ./unused-but-set-variable.patch
+  ];
+
+  postPatch = ''
+    patchShebangs configure
+  '';
+
+  postInstall = ''
+    mkdir -p $out/share/man/man3
+    cp -p vrb/man/man3/*.3 $out/share/man/man3/
+  '';
+
+  meta = with lib; {
+    description = "A virtual ring buffer library written in C";
+    license     = licenses.lgpl21;
+    homepage    = "http://vrb.sourceforge.net/";
+    maintainers = [ maintainers.bobvanderlinden ];
+    platforms   = platforms.linux;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/vrb/removed_options.patch b/nixpkgs/pkgs/development/libraries/vrb/removed_options.patch
new file mode 100644
index 000000000000..eda88e751843
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vrb/removed_options.patch
@@ -0,0 +1,13 @@
+--- a/configure	2010-10-05 16:32:59.000000000 +0200
++++ b/configure	2010-10-05 16:33:08.000000000 +0200
+@@ -341,8 +341,8 @@
+     pgm_warn=( "${pgm_warn[@]}" -Winline )
+ fi
+ 
+-lib_feat=( -fomit-frame-pointer -funsigned-char -funsigned-bitfields -fgnu-linker -frerun-loop-opt -finline -finline-functions -fmove-all-movables )
+-pgm_feat=( -fomit-frame-pointer -funsigned-char -funsigned-bitfields -fgnu-linker -frerun-loop-opt -finline -finline-functions -fmove-all-movables )
++lib_feat=( -fomit-frame-pointer -funsigned-char -funsigned-bitfields -frerun-loop-opt -finline -finline-functions )
++pgm_feat=( -fomit-frame-pointer -funsigned-char -funsigned-bitfields -frerun-loop-opt -finline -finline-functions )
+ 
+ lib_cp_opt=( -pipe )
+ pgm_cp_opt=( -pipe )
diff --git a/nixpkgs/pkgs/development/libraries/vrb/unused-but-set-variable.patch b/nixpkgs/pkgs/development/libraries/vrb/unused-but-set-variable.patch
new file mode 100644
index 000000000000..43429255e8cd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vrb/unused-but-set-variable.patch
@@ -0,0 +1,19 @@
+--- a/vrb/src/bin/vbuf.c1	2011-06-13 22:14:24.000000000 +0200
++++ b/vrb/src/bin/vbuf.c	2011-06-13 22:14:43.000000000 +0200
+@@ -426,7 +426,6 @@
+     int			opt_progress		;
+     int			output_fd		;
+     int			poll_time		;
+-    int			poll_num		;
+     int			poll_write		;
+     int			poll_read		;
+ 
+@@ -861,7 +860,7 @@
+ 	    poll_time = display_time - get_time_ms();
+ 	    if ( poll_time < 0 ) poll_time = 0;
+ 	}
+-	poll_num = poll( poll_list, 2, poll_time );
++	poll( poll_list, 2, poll_time );
+ 
+ 	//-----------------------
+ 	// Check for poll events.
diff --git a/nixpkgs/pkgs/development/libraries/vrpn/default.nix b/nixpkgs/pkgs/development/libraries/vrpn/default.nix
new file mode 100644
index 000000000000..f9eed6b2f747
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vrpn/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, unzip, cmake, libGLU, libGL }:
+
+stdenv.mkDerivation rec {
+  name    = "${pname}-${date}";
+  pname   = "vrpn";
+  date    = "2016-08-27";
+
+  src = fetchFromGitHub {
+    owner  = "vrpn";
+    repo   = "vrpn";
+    rev    = "9fa0ab3676a43527301c9efd3637f80220eb9462";
+    sha256 = "032q295d68w34rk5q8nfqdd29s55n00bfik84y7xzkjrpspaprlh";
+  };
+
+  nativeBuildInputs = [ cmake unzip ];
+  buildInputs = [ libGLU libGL ];
+
+  doCheck = false; # FIXME: test failure
+  checkTarget = "test";
+
+  meta = with lib; {
+    description = "Virtual Reality Peripheral Network";
+    longDescription = ''
+      The Virtual-Reality Peripheral Network (VRPN) is a set of classes
+      within a library and a set of servers that are designed to implement
+      a network-transparent interface between application programs and the
+      set of physical devices (tracker, etc.) used in a virtual-reality
+      (VR) system.
+    '';
+    homepage    = "https://github.com/vrpn/vrpn";
+    license     = licenses.boost; # see https://github.com/vrpn/vrpn/wiki/License
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ ludo ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vsqlite/default.nix b/nixpkgs/pkgs/development/libraries/vsqlite/default.nix
new file mode 100644
index 000000000000..6981de6aa074
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vsqlite/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchurl, boost, sqlite }:
+
+stdenv.mkDerivation rec {
+  pname = "vsqlite";
+  version = "0.3.13";
+
+  src = fetchurl {
+    url = "https://evilissimo.fedorapeople.org/releases/vsqlite--/0.3.13/vsqlite++-${version}.tar.gz";
+    sha256 = "17fkj0d2jh0xkjpcayhs1xvbnh1d69f026i7vs1zqnbiwbkpz237";
+  };
+
+  buildInputs = [ boost sqlite ];
+
+  prePatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace Makefile.in \
+        --replace '-Wl,--as-needed' "" \
+        --replace '-Wl,-soname -Wl,libvsqlitepp.so.3' \
+                  "-Wl,-install_name,$out/lib/libvsqlitepp.3.dylib"
+  '';
+
+  meta = with lib; {
+    homepage = "http://vsqlite.virtuosic-bytes.com/";
+    description = "C++ wrapper library for sqlite";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vte/2.90.nix b/nixpkgs/pkgs/development/libraries/vte/2.90.nix
new file mode 100644
index 000000000000..55ef86c88a0e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vte/2.90.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchurl, intltool, pkg-config, glib, gtk3, ncurses, gobject-introspection }:
+
+stdenv.mkDerivation rec {
+  versionMajor = "0.36";
+  versionMinor = "3";
+  moduleName   = "vte";
+
+  name = "${moduleName}-${versionMajor}.${versionMinor}";
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${moduleName}/${versionMajor}/${name}.tar.xz";
+    sha256 = "54e5b07be3c0f7b158302f54ee79d4de1cb002f4259b6642b79b1e0e314a959c";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ gobject-introspection intltool glib gtk3 ncurses ];
+
+  configureFlags = [ "--enable-introspection" ];
+
+  enableParallelBuilding = true;
+
+  postInstall = ''
+    substituteInPlace $out/lib/libvte2_90.la --replace "-lncurses" "-L${ncurses.out}/lib -lncurses"
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.gnome.org/";
+    description = "A library implementing a terminal emulator widget for GTK";
+    longDescription = ''
+      VTE is a library (libvte) implementing a terminal emulator widget for
+      GTK, and a minimal sample application (vte) using that.  Vte is
+      mainly used in gnome-terminal, but can also be used to embed a
+      console/terminal in games, editors, IDEs, etc. VTE supports Unicode and
+      character set conversion, as well as emulating any terminal known to
+      the system's terminfo database.
+    '';
+    license = licenses.lgpl2;
+    maintainers = with maintainers; [ astsmtl antono ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vte/default.nix b/nixpkgs/pkgs/development/libraries/vte/default.nix
new file mode 100644
index 000000000000..c3631cccbe01
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vte/default.nix
@@ -0,0 +1,105 @@
+{ stdenv
+, lib
+, fetchurl
+, fetchpatch
+, gettext
+, pkg-config
+, meson
+, ninja
+, gnome
+, glib
+, gtk3
+, gobject-introspection
+, vala
+, python3
+, libxml2
+, gnutls
+, gperf
+, pango
+, pcre2
+, fribidi
+, zlib
+, icu
+, systemd
+}:
+
+stdenv.mkDerivation rec {
+  pname = "vte";
+  version = "0.64.1";
+
+  outputs = [ "out" "dev" ];
+
+  src = fetchurl {
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-EvtBqf+OA8XxcRtGVgkQpLmzECrsPp52Cc7vTfqYqio=";
+  };
+
+  patches = [
+    # VTE needs a small patch to work with musl:
+    # https://gitlab.gnome.org/GNOME/vte/issues/72
+    # Taken from https://git.alpinelinux.org/aports/tree/community/vte3
+    (fetchpatch {
+      name = "0001-Add-W_EXITCODE-macro-for-non-glibc-systems.patch";
+      url = "https://git.alpinelinux.org/aports/plain/community/vte3/fix-W_EXITCODE.patch?id=4d35c076ce77bfac7655f60c4c3e4c86933ab7dd";
+      sha256 = "FkVyhsM0mRUzZmS2Gh172oqwcfXv6PyD6IEgjBhy2uU=";
+    })
+  ];
+
+  nativeBuildInputs = [
+    gettext
+    gobject-introspection
+    gperf
+    libxml2
+    meson
+    ninja
+    pkg-config
+    vala
+    python3
+  ];
+
+  buildInputs = [
+    fribidi
+    gnutls
+    pcre2
+    zlib
+    icu
+    systemd
+  ];
+
+  propagatedBuildInputs = [
+    # Required by vte-2.91.pc.
+    gtk3
+    glib
+    pango
+  ];
+
+  postPatch = ''
+    patchShebangs perf/*
+    patchShebangs src/box_drawing_generate.sh
+    patchShebangs src/parser-seq.py
+    patchShebangs src/modes.py
+  '';
+
+  passthru = {
+    updateScript = gnome.updateScript {
+      packageName = pname;
+      versionPolicy = "odd-unstable";
+    };
+  };
+
+  meta = with lib; {
+    homepage = "https://www.gnome.org/";
+    description = "A library implementing a terminal emulator widget for GTK";
+    longDescription = ''
+      VTE is a library (libvte) implementing a terminal emulator widget for
+      GTK, and a minimal sample application (vte) using that.  Vte is
+      mainly used in gnome-terminal, but can also be used to embed a
+      console/terminal in games, editors, IDEs, etc. VTE supports Unicode and
+      character set conversion, as well as emulating any terminal known to
+      the system's terminfo database.
+    '';
+    license = licenses.lgpl3Plus;
+    maintainers = with maintainers; [ astsmtl antono ] ++ teams.gnome.members;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vtk/7.x.nix b/nixpkgs/pkgs/development/libraries/vtk/7.x.nix
new file mode 100644
index 000000000000..860f17639454
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vtk/7.x.nix
@@ -0,0 +1,14 @@
+import ./generic.nix {
+  majorVersion = "7.1";
+  minorVersion = "1";
+  sourceSha256 = "0nm7xwwj7rnsxjdv2ssviys8nhci4n9iiiqm2y14s520hl2dsp1d";
+  patchesToFetch = [{
+   url = "https://gitlab.kitware.com/vtk/vtk/-/commit/706f1b397df09a27ab8981ab9464547028d0c322.diff";
+   sha256 = "1q3pi5h40g05pzpbqp75xlgzvbfvyw8raza51svmi7d8dlslqybx";
+ }
+ {
+    url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sci-libs/vtk/files/vtk-8.2.0-gcc-10.patch?id=c4256f68d3589570443075eccbbafacf661f785f";
+    sha256 = "sha256:0bpwrdfmi15grsg4jy7bzj2z6511a0c160cmw5lsi65aabyh7cl5";
+  }
+  ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/vtk/8.x.nix b/nixpkgs/pkgs/development/libraries/vtk/8.x.nix
new file mode 100644
index 000000000000..ad84ec163cfa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vtk/8.x.nix
@@ -0,0 +1,18 @@
+import ./generic.nix {
+  majorVersion = "8.2";
+  minorVersion = "0";
+  sourceSha256 = "1fspgp8k0myr6p2a6wkc21ldcswb4bvmb484m12mxgk1a9vxrhrl";
+  patchesToFetch = [{
+   url = "https://gitlab.kitware.com/vtk/vtk/-/commit/257b9d7b18d5f3db3fe099dc18f230e23f7dfbab.diff";
+   sha256 = "0qdahp4f4gcaznr28j06d5fyxiis774ys0p335aazf7h51zb8rzy";
+  }
+  {
+    url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/sci-libs/vtk/files/vtk-8.2.0-gcc-10.patch?id=c4256f68d3589570443075eccbbafacf661f785f";
+    sha256 = "sha256:0bpwrdfmi15grsg4jy7bzj2z6511a0c160cmw5lsi65aabyh7cl5";
+  }
+  {
+    url = "https://gitlab.kitware.com/vtk/vtk/-/merge_requests/6943.diff";
+    sha256 = "sha256:1nzdw3f6bsri04y528zj2klqkb9p8s4lnl9g5zvm119m1cmyhn04";
+  }
+  ];
+}
diff --git a/nixpkgs/pkgs/development/libraries/vtk/9.x.nix b/nixpkgs/pkgs/development/libraries/vtk/9.x.nix
new file mode 100644
index 000000000000..e99ba34999e7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vtk/9.x.nix
@@ -0,0 +1,5 @@
+import ./generic.nix {
+  majorVersion = "9.0";
+  minorVersion = "1";
+  sourceSha256 = "1ir2lq9i45ls374lcmjzw0nrm5l5hnm1w47lg8g8d0n2j7hsaf8v";
+}
diff --git a/nixpkgs/pkgs/development/libraries/vtk/generic.nix b/nixpkgs/pkgs/development/libraries/vtk/generic.nix
new file mode 100644
index 000000000000..482e6be7bbcf
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vtk/generic.nix
@@ -0,0 +1,99 @@
+{ majorVersion, minorVersion, sourceSha256, patchesToFetch ? [] }:
+{ stdenv, lib, fetchurl, cmake, libGLU, libGL, libX11, xorgproto, libXt, libpng, libtiff
+, fetchpatch
+, enableQt ? false, wrapQtAppsHook, qtbase, qtx11extras, qttools
+, enablePython ? false, pythonInterpreter ? throw "vtk: Python support requested, but no python interpreter was given."
+# Darwin support
+, Cocoa, CoreServices, DiskArbitration, IOKit, CFNetwork, Security, GLUT, OpenGL
+, ApplicationServices, CoreText, IOSurface, ImageIO, xpc, libobjc
+}:
+
+let
+  inherit (lib) optionalString optionals optional;
+
+  pythonMajor = lib.substring 0 1 pythonInterpreter.pythonVersion;
+
+in stdenv.mkDerivation rec {
+  pname = "vtk${optionalString enableQt "-qvtk"}";
+  version = "${majorVersion}.${minorVersion}";
+
+  src = fetchurl {
+    url = "https://www.vtk.org/files/release/${majorVersion}/VTK-${version}.tar.gz";
+    sha256 = sourceSha256;
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ libpng libtiff ]
+    ++ optionals enableQt [ qtbase qtx11extras qttools ]
+    ++ optionals stdenv.isLinux [
+      libGLU
+      libGL
+      libX11
+      xorgproto
+      libXt
+    ] ++ optionals stdenv.isDarwin [
+      xpc
+      Cocoa
+      CoreServices
+      DiskArbitration
+      IOKit
+      CFNetwork
+      Security
+      ApplicationServices
+      CoreText
+      IOSurface
+      ImageIO
+      OpenGL
+      GLUT
+    ] ++ optional enablePython [
+      pythonInterpreter
+    ];
+  propagatedBuildInputs = optionals stdenv.isDarwin [ libobjc ];
+
+  patches = map fetchpatch patchesToFetch;
+
+  preBuild = ''
+    export LD_LIBRARY_PATH="$(pwd)/lib";
+  '';
+
+  dontWrapQtApps = true;
+
+  # Shared libraries don't work, because of rpath troubles with the current
+  # nixpkgs cmake approach. It wants to call a binary at build time, just
+  # 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_PNG=ON"
+    "-DVTK_USE_SYSTEM_TIFF=1"
+    "-DOPENGL_INCLUDE_DIR=${libGL}/include"
+    "-DCMAKE_INSTALL_LIBDIR=lib"
+    "-DCMAKE_INSTALL_INCLUDEDIR=include"
+    "-DCMAKE_INSTALL_BINDIR=bin"
+  ]
+    ++ optionals enableQt [ "-DVTK_Group_Qt:BOOL=ON" ]
+    ++ optionals stdenv.isDarwin [ "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks" ]
+    ++ optionals enablePython [
+      "-DVTK_WRAP_PYTHON:BOOL=ON"
+      "-DVTK_PYTHON_VERSION:STRING=${pythonMajor}"
+    ];
+
+  postPatch = optionalString stdenv.isDarwin ''
+    sed -i 's|COMMAND vtkHashSource|COMMAND "DYLD_LIBRARY_PATH=''${VTK_BINARY_DIR}/lib" ''${VTK_BINARY_DIR}/bin/vtkHashSource-${majorVersion}|' ./Parallel/Core/CMakeLists.txt
+    sed -i 's/fprintf(output, shift)/fprintf(output, "%s", shift)/' ./ThirdParty/libxml2/vtklibxml2/xmlschemas.c
+    sed -i 's/fprintf(output, shift)/fprintf(output, "%s", shift)/g' ./ThirdParty/libxml2/vtklibxml2/xpath.c
+  '';
+
+  meta = with lib; {
+    description = "Open source libraries for 3D computer graphics, image processing and visualization";
+    homepage = "https://www.vtk.org/";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ knedlsepp tfmoraes lheckemann ];
+    platforms = with platforms; unix;
+    # /nix/store/xxxxxxx-apple-framework-Security/Library/Frameworks/Security.framework/Headers/Authorization.h:192:7: error: variably modified 'bytes' at file scope
+    broken = stdenv.isDarwin && (lib.versions.major majorVersion == "7" || lib.versions.major majorVersion == "8");
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vulkan-headers/default.nix b/nixpkgs/pkgs/development/libraries/vulkan-headers/default.nix
new file mode 100644
index 000000000000..e9b9112c8fd7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vulkan-headers/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+stdenv.mkDerivation rec {
+  pname = "vulkan-headers";
+  version = "1.2.182.0";
+
+  nativeBuildInputs = [ cmake ];
+
+  src = fetchFromGitHub {
+    owner = "KhronosGroup";
+    repo = "Vulkan-Headers";
+    rev = "sdk-${version}";
+    sha256 = "03j0kzq2qxhy0y82l10m8am26zrms2sjrdb1dcbpv9zh5vkxhcla";
+  };
+
+  meta = with lib; {
+    description = "Vulkan Header files and API registry";
+    homepage    = "https://www.lunarg.com";
+    platforms   = platforms.linux;
+    license     = licenses.asl20;
+    maintainers = [ maintainers.ralith ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vulkan-loader/default.nix b/nixpkgs/pkgs/development/libraries/vulkan-loader/default.nix
new file mode 100644
index 000000000000..21239b9b4368
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vulkan-loader/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libX11, libxcb
+, libXrandr, wayland, vulkan-headers, addOpenGLRunpath }:
+
+stdenv.mkDerivation rec {
+  pname = "vulkan-loader";
+  version = "1.2.182.0";
+
+  src = (assert version == vulkan-headers.version;
+    fetchFromGitHub {
+      owner = "KhronosGroup";
+      repo = "Vulkan-Loader";
+      rev = "sdk-${version}";
+      sha256 = "0gmr9q3a6s8xvaa74fs9zbi9c305i2b3rx768qvl79nhbdj8nc02";
+    });
+
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ libX11 libxcb libXrandr vulkan-headers wayland ];
+
+  cmakeFlags = [
+    "-DSYSCONFDIR=${addOpenGLRunpath.driverLink}/share"
+    "-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include"
+  ];
+
+  outputs = [ "out" "dev" ];
+
+  doInstallCheck = true;
+
+  installCheckPhase = ''
+    grep -q "${vulkan-headers}/include" $dev/lib/pkgconfig/vulkan.pc || {
+      echo vulkan-headers include directory not found in pkg-config file
+      exit 1
+    }
+  '';
+
+  meta = with lib; {
+    description = "LunarG Vulkan loader";
+    homepage    = "https://www.lunarg.com";
+    platforms   = platforms.linux;
+    license     = licenses.asl20;
+    maintainers = [ maintainers.ralith ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/vxl/default.nix b/nixpkgs/pkgs/development/libraries/vxl/default.nix
new file mode 100644
index 000000000000..d87adabf56c6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/vxl/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchFromGitHub, unzip, cmake, libtiff, expat, zlib, libpng, libjpeg }:
+stdenv.mkDerivation {
+  pname = "vxl";
+  version = "1.17.0-nix1";
+
+  src = fetchFromGitHub {
+    owner = "vxl";
+    repo = "vxl";
+    rev = "777c0beb7c8b30117400f6fc9a6d63bf8cb7c67a";
+    sha256 = "0xpkwwb93ka6c3da8zjhfg9jk5ssmh9ifdh1by54sz6c7mbp55m8";
+  };
+
+  nativeBuildInputs = [ cmake unzip ];
+  buildInputs = [ libtiff expat zlib libpng libjpeg ];
+
+  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"
+  ] ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [
+    "-DCMAKE_CXX_FLAGS=-fPIC"
+    "-DCMAKE_C_FLAGS=-fPIC"
+  ];
+
+  meta = {
+    description = "C++ Libraries for Computer Vision Research and Implementation";
+    homepage = "http://vxl.sourceforge.net/";
+    license = "VXL License";
+    maintainers = with lib.maintainers; [viric];
+    platforms = with lib.platforms; linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/waffle/default.nix b/nixpkgs/pkgs/development/libraries/waffle/default.nix
new file mode 100644
index 000000000000..e6d8a98b5335
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/waffle/default.nix
@@ -0,0 +1,71 @@
+{ stdenv
+, fetchFromGitLab
+, lib
+, cmake
+, meson
+, ninja
+, bash-completion
+, libGL
+, libglvnd
+, makeWrapper
+, pkg-config
+, python3
+, x11Support ? true, libxcb, libX11
+, waylandSupport ? true, wayland, wayland-protocols
+, useGbm ? true, mesa, udev
+}:
+
+stdenv.mkDerivation rec {
+  pname = "waffle";
+  version = "1.7.0";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.freedesktop.org";
+    owner = "mesa";
+    repo = "waffle";
+    rev = "v${version}";
+    sha256 = "iY+dAgXutD/uDFocwd9QXjq502IOsk+3RQMA2S/CMV4=";
+  };
+
+  buildInputs = [
+    bash-completion
+    libGL
+  ] ++ lib.optionals (with stdenv.hostPlatform; isUnix && !isDarwin) [
+    libglvnd
+  ] ++ lib.optionals x11Support [
+    libX11
+    libxcb
+  ] ++ lib.optionals waylandSupport [
+    wayland
+    wayland-protocols
+  ] ++ lib.optionals useGbm [
+    udev
+    mesa
+  ];
+
+  dontUseCmakeConfigure = true;
+
+  nativeBuildInputs = [
+    cmake
+    makeWrapper
+    meson
+    ninja
+    pkg-config
+    python3
+  ];
+
+  PKG_CONFIG_BASH_COMPLETION_COMPLETIONSDIR= "${placeholder "out"}/share/bash-completion/completions";
+
+  postInstall = ''
+    wrapProgram $out/bin/wflinfo \
+      --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libGL libglvnd ]}
+  '';
+
+  meta = with lib; {
+    description = "A cross-platform C library that allows one to defer selection of an OpenGL API and window system until runtime";
+    homepage = "http://www.waffle-gl.org/";
+    license = licenses.bsd2;
+    platforms = platforms.mesaPlatforms;
+    maintainers = with maintainers; [ Flakebi ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wasilibc/default.nix b/nixpkgs/pkgs/development/libraries/wasilibc/default.nix
new file mode 100644
index 000000000000..56ed7367b2b2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wasilibc/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub, lib }:
+
+stdenv.mkDerivation {
+  pname = "wasilibc";
+  version = "20190712";
+  src = fetchFromGitHub {
+    owner = "CraneStation";
+    repo = "wasi-libc";
+    rev = "8df0d4cd6a559b58d4a34b738a5a766b567448cf";
+    sha256 = "1n4gvgzacpagar2mx8g9950q0brnhwz7jg2q44sa5mnjmlnkiqhh";
+  };
+  makeFlags = [
+    "WASM_CC=${stdenv.cc.targetPrefix}cc"
+    "WASM_NM=${stdenv.cc.targetPrefix}nm"
+    "WASM_AR=${stdenv.cc.targetPrefix}ar"
+    "INSTALL_DIR=${placeholder "out"}"
+  ];
+
+  postInstall = ''
+    mv $out/lib/*/* $out/lib
+    ln -s $out/share/wasm32-wasi/undefined-symbols.txt $out/lib/wasi.imports
+  '';
+
+  meta = with lib; {
+    description = "WASI libc implementation for WebAssembly";
+    homepage    = "https://wasi.dev";
+    platforms   = platforms.wasi;
+    maintainers = [ maintainers.matthewbauer ];
+    license = with licenses; [ asl20 mit llvm-exception ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wavpack/default.nix b/nixpkgs/pkgs/development/libraries/wavpack/default.nix
new file mode 100644
index 000000000000..e3527ac32a46
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wavpack/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, libiconv }:
+
+stdenv.mkDerivation rec {
+  pname = "wavpack";
+  version = "5.4.0";
+
+  enableParallelBuilding = true;
+
+  nativeBuildInputs = [ autoreconfHook ];
+  buildInputs = lib.optional stdenv.isDarwin libiconv;
+
+  src = fetchFromGitHub {
+    owner = "dbry";
+    repo = "WavPack";
+    rev = version;
+    sha256 = "1b6szk2vmnqnv5w7h8yc1iazjlidlraq1lwjbmc3fi0snbn6qj44";
+  };
+
+  meta = with lib; {
+    description = "Hybrid audio compression format";
+    homepage    = "https://www.wavpack.com/";
+    changelog   = "https://github.com/dbry/WavPack/releases/tag/${version}";
+    license     = licenses.bsd3;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ codyopel ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wayland/0001-add-placeholder-for-nm.patch b/nixpkgs/pkgs/development/libraries/wayland/0001-add-placeholder-for-nm.patch
new file mode 100644
index 000000000000..f6745e6f9433
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wayland/0001-add-placeholder-for-nm.patch
@@ -0,0 +1,25 @@
+From 378623b0e39b12bb04d3a3a1e08e64b31bd7d99d Mon Sep 17 00:00:00 2001
+From: Florian Klink <flokli@flokli.de>
+Date: Fri, 27 Nov 2020 10:22:20 +0100
+Subject: [PATCH] add placeholder for @nm@
+
+---
+ egl/meson.build | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/egl/meson.build b/egl/meson.build
+index dee9b1d..e477546 100644
+--- a/egl/meson.build
++++ b/egl/meson.build
+@@ -11,7 +11,7 @@ wayland_egl = library(
+ 
+ executable('wayland-egl-abi-check', 'wayland-egl-abi-check.c')
+ 
+-nm_path = find_program('nm').path()
++nm_path = find_program('@nm@').path()
+ 
+ test(
+ 	'wayland-egl symbols check',
+-- 
+2.29.2
+
diff --git a/nixpkgs/pkgs/development/libraries/wayland/default.nix b/nixpkgs/pkgs/development/libraries/wayland/default.nix
new file mode 100644
index 000000000000..08741c29dd6d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wayland/default.nix
@@ -0,0 +1,125 @@
+{ lib
+, stdenv
+, fetchurl
+, fetchpatch
+, substituteAll
+, meson
+, pkg-config
+, ninja
+, wayland-scanner
+, expat
+, libxml2
+, withLibraries ? stdenv.isLinux
+, libffi
+, withDocumentation ? withLibraries && stdenv.hostPlatform == stdenv.buildPlatform
+, graphviz-nox
+, doxygen
+, libxslt
+, xmlto
+, python3
+, docbook_xsl
+, docbook_xml_dtd_45
+, docbook_xml_dtd_42
+}:
+
+# Documentation is only built when building libraries.
+assert withDocumentation -> withLibraries;
+
+let
+  isCross = stdenv.buildPlatform != stdenv.hostPlatform;
+in
+stdenv.mkDerivation rec {
+  pname = "wayland";
+  version = "1.19.0";
+
+  src = fetchurl {
+    url = "https://wayland.freedesktop.org/releases/${pname}-${version}.tar.xz";
+    sha256 = "05bd2vphyx8qwa1mhsj1zdaiv4m4v94wrlssrn0lad8d601dkk5s";
+  };
+
+  patches = [
+    # Picked from upstream 'main' branch for Darwin support.
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/wayland/wayland/-/commit/f452e41264387dee4fd737cbf1af58b34b53941b.patch";
+      sha256 = "00mk32a01vgn31sm3wk4p8mfwvqv3xv02rxvdj1ygnzgb1ac62r7";
+    })
+    (substituteAll {
+      src = ./0001-add-placeholder-for-nm.patch;
+      nm = "${stdenv.cc.targetPrefix}nm";
+    })
+  ];
+
+  postPatch = lib.optionalString withDocumentation ''
+    patchShebangs doc/doxygen/gen-doxygen.py
+  '';
+
+  outputs = [ "out" "bin" "dev" ] ++ lib.optionals withDocumentation [ "doc" "man" ];
+  separateDebugInfo = true;
+
+  mesonFlags = [
+    "-Dlibraries=${lib.boolToString withLibraries}"
+    "-Ddocumentation=${lib.boolToString withDocumentation}"
+  ];
+
+  depsBuildBuild = [
+    pkg-config
+  ];
+
+  nativeBuildInputs = [
+    meson
+    pkg-config
+    ninja
+  ] ++ lib.optionals isCross [
+    wayland-scanner
+  ] ++ lib.optionals withDocumentation [
+    (graphviz-nox.override { pango = null; }) # To avoid an infinite recursion
+    doxygen
+    libxslt
+    xmlto
+    python3
+    docbook_xml_dtd_45
+  ];
+
+  buildInputs = [
+    expat
+    libxml2
+  ] ++ lib.optionals withLibraries [
+    libffi
+  ] ++ lib.optionals withDocumentation [
+    docbook_xsl
+    docbook_xml_dtd_45
+    docbook_xml_dtd_42
+  ];
+
+  postFixup = ''
+    # The pkg-config file is required for cross-compilation:
+    mkdir -p $bin/lib/pkgconfig/
+    cat <<EOF > $bin/lib/pkgconfig/wayland-scanner.pc
+    wayland_scanner=$bin/bin/wayland-scanner
+
+    Name: Wayland Scanner
+    Description: Wayland scanner
+    Version: ${version}
+    EOF
+  '';
+
+  meta = with lib; {
+    description = "Core Wayland window system code and protocol";
+    longDescription = ''
+      Wayland is a project to define a protocol for a compositor to talk to its
+      clients as well as a library implementation of the protocol.
+      The wayland protocol is essentially only about input handling and buffer
+      management, but also handles drag and drop, selections, window management
+      and other interactions that must go through the compositor (but not
+      rendering).
+    '';
+    homepage = "https://wayland.freedesktop.org/";
+    license = licenses.mit; # Expat version
+    platforms = if withLibraries then platforms.linux else platforms.unix;
+    maintainers = with maintainers; [ primeos codyopel qyliss ];
+    # big sur doesn't support gcc stdenv and wayland doesn't build with clang
+    broken = stdenv.isDarwin;
+  };
+
+  passthru.version = version;
+}
diff --git a/nixpkgs/pkgs/development/libraries/wayland/protocols.nix b/nixpkgs/pkgs/development/libraries/wayland/protocols.nix
new file mode 100644
index 000000000000..7f3ec5f3d597
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wayland/protocols.nix
@@ -0,0 +1,44 @@
+{ lib, stdenv, fetchurl
+, pkg-config
+, meson, ninja, wayland-scanner
+, python3, wayland
+}:
+
+stdenv.mkDerivation rec {
+  pname = "wayland-protocols";
+  version = "1.21";
+
+  doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
+
+  src = fetchurl {
+    url = "https://wayland.freedesktop.org/releases/${pname}-${version}.tar.xz";
+    sha256 = "1rfdlkzz67qsb955zqb8jbw3m22pl6ppvrvfq8bqiqcb5n24b6dr";
+  };
+
+  postPatch = lib.optionalString doCheck ''
+    patchShebangs tests/
+  '';
+
+  depsBuildBuild = [ pkg-config ];
+  nativeBuildInputs = [ meson ninja wayland-scanner ];
+  checkInputs = [ python3 wayland ];
+
+  mesonFlags = [ "-Dtests=${lib.boolToString doCheck}" ];
+
+  meta = {
+    description = "Wayland protocol extensions";
+    longDescription = ''
+      wayland-protocols contains Wayland protocols that add functionality not
+      available in the Wayland core protocol. Such protocols either add
+      completely new functionality, or extend the functionality of some other
+      protocol either in Wayland core, or some other protocol in
+      wayland-protocols.
+    '';
+    homepage    = "https://gitlab.freedesktop.org/wayland/wayland-protocols";
+    license     = lib.licenses.mit; # Expat version
+    platforms   = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ primeos ];
+  };
+
+  passthru.version = version;
+}
diff --git a/nixpkgs/pkgs/development/libraries/waylandpp/default.nix b/nixpkgs/pkgs/development/libraries/waylandpp/default.nix
new file mode 100644
index 000000000000..0aa77b771e48
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/waylandpp/default.nix
@@ -0,0 +1,45 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+, pugixml
+, wayland
+, libGL
+, libffi
+, buildPackages
+, docSupport ? true
+, doxygen ? null
+}:
+
+assert docSupport -> doxygen != null;
+
+with lib;
+stdenv.mkDerivation rec {
+  pname = "waylandpp";
+  version = "0.2.8";
+
+  src = fetchFromGitHub {
+    owner = "NilsBrause";
+    repo = pname;
+    rev = version;
+    sha256 = "1kxiqab48p0n97pwg8c2zx56wqq32m3rcq7qd2pjj33ipcanb3qq";
+  };
+
+  cmakeFlags = [
+    "-DCMAKE_INSTALL_DATADIR=${placeholder "dev"}"
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+    "-DWAYLAND_SCANNERPP=${buildPackages.waylandpp}/bin/wayland-scanner++"
+  ];
+
+  nativeBuildInputs = [ cmake pkg-config ] ++ optional docSupport doxygen;
+  buildInputs = [ pugixml wayland libGL libffi ];
+
+  outputs = [ "bin" "dev" "lib" "out" ] ++ optionals docSupport [ "doc" "devman" ];
+
+  meta = with lib; {
+    description = "Wayland C++ binding";
+    homepage = "https://github.com/NilsBrause/waylandpp/";
+    license = with licenses; [ bsd2 hpnd ];
+    maintainers = with maintainers; [ minijackson ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/webkit2-sharp/default.nix b/nixpkgs/pkgs/development/libraries/webkit2-sharp/default.nix
new file mode 100644
index 000000000000..b8a476b3b332
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/webkit2-sharp/default.nix
@@ -0,0 +1,49 @@
+{
+  stdenv,
+  autoreconfHook,
+  fetchFromGitHub,
+  gtk-sharp-3_0,
+  lib,
+  libxslt,
+  mono,
+  pkg-config,
+  webkitgtk,
+}:
+
+stdenv.mkDerivation rec {
+  pname = "webkit2-sharp";
+  version = "a59fd76dd730432c76b12ee6347ea66567107ab9";
+
+  src = fetchFromGitHub {
+    owner = "hbons";
+    repo = "webkit2-sharp";
+    rev = version;
+    sha256 = "sha256:0a7vx81zvzn2wq4q2mqrxvlps1mqk28lm1gpfndqryxm4iiw28vc";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    libxslt
+    mono
+    pkg-config
+  ];
+
+  buildInputs = [
+    gtk-sharp-3_0
+    webkitgtk
+  ];
+
+  ac_cv_path_MONODOCER = "no";
+  installFlagsArray = ["GAPIXMLDIR=/tmp/gapixml"];
+
+  passthru = {
+    inherit webkitgtk;
+  };
+
+  meta = {
+    description = "C# bindings for WebKit 2 with GTK+ 3";
+    homepage = "https://github.com/hbons/webkit2-sharp";
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ kevincox ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/webkitgtk/428774.patch b/nixpkgs/pkgs/development/libraries/webkitgtk/428774.patch
new file mode 100644
index 000000000000..85da185dc4e4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/webkitgtk/428774.patch
@@ -0,0 +1,86 @@
+diff -aru a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWOriginStore.cpp b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWOriginStore.cpp
+--- a/Source/WebKit/NetworkProcess/ServiceWorker/WebSWOriginStore.cpp	2021-02-26 04:57:15.000000000 -0500
++++ b/Source/WebKit/NetworkProcess/ServiceWorker/WebSWOriginStore.cpp	2021-05-16 14:45:32.000000000 -0400
+@@ -87,7 +87,7 @@
+     if (!m_store.createSharedMemoryHandle(handle))
+         return;
+ 
+-#if OS(DARWIN) || OS(WINDOWS)
++#if (OS(DARWIN) || OS(WINDOWS)) && !USE(UNIX_DOMAIN_SOCKETS)
+     uint64_t dataSize = handle.size();
+ #else
+     uint64_t dataSize = 0;
+diff -aru a/Source/WebKit/Platform/IPC/IPCSemaphore.cpp b/Source/WebKit/Platform/IPC/IPCSemaphore.cpp
+--- a/Source/WebKit/Platform/IPC/IPCSemaphore.cpp	2021-02-26 04:57:15.000000000 -0500
++++ b/Source/WebKit/Platform/IPC/IPCSemaphore.cpp	2021-05-16 15:54:53.000000000 -0400
+@@ -26,8 +26,6 @@
+ #include "config.h"
+ #include "IPCSemaphore.h"
+ 
+-#if !OS(DARWIN)
+-
+ namespace IPC {
+ 
+ Semaphore::Semaphore() = default;
+@@ -46,5 +44,3 @@
+ }
+ 
+ }
+-
+-#endif
+diff -aru a/Source/WebKit/Platform/IPC/IPCSemaphore.h b/Source/WebKit/Platform/IPC/IPCSemaphore.h
+--- a/Source/WebKit/Platform/IPC/IPCSemaphore.h	2021-02-26 04:57:15.000000000 -0500
++++ b/Source/WebKit/Platform/IPC/IPCSemaphore.h	2021-05-16 14:46:13.000000000 -0400
+@@ -29,7 +29,7 @@
+ #include <wtf/Optional.h>
+ #include <wtf/Seconds.h>
+ 
+-#if OS(DARWIN)
++#if PLATFORM(COCOA)
+ #include <mach/semaphore.h>
+ #include <wtf/MachSendRight.h>
+ #endif
+@@ -51,7 +51,7 @@
+     void encode(Encoder&) const;
+     static Optional<Semaphore> decode(Decoder&);
+ 
+-#if OS(DARWIN)
++#if PLATFORM(COCOA)
+     explicit Semaphore(MachSendRight&&);
+ 
+     void signal();
+@@ -64,7 +64,7 @@
+ #endif
+ 
+ private:
+-#if OS(DARWIN)
++#if PLATFORM(COCOA)
+     void destroy();
+     MachSendRight m_sendRight;
+     semaphore_t m_semaphore { SEMAPHORE_NULL };
+Only in b/Source/WebKit/Platform/IPC: IPCSemaphore.h.orig
+diff -aru a/Source/WebKit/Platform/SharedMemory.h b/Source/WebKit/Platform/SharedMemory.h
+--- a/Source/WebKit/Platform/SharedMemory.h	2021-02-26 04:57:15.000000000 -0500
++++ b/Source/WebKit/Platform/SharedMemory.h	2021-05-16 14:45:32.000000000 -0400
+@@ -75,7 +75,7 @@
+ 
+         bool isNull() const;
+ 
+-#if OS(DARWIN) || OS(WINDOWS)
++#if (OS(DARWIN) || OS(WINDOWS)) && !USE(UNIX_DOMAIN_SOCKETS)
+         size_t size() const { return m_size; }
+ #endif
+ 
+diff -aru a/Source/WebKit/UIProcess/VisitedLinkStore.cpp b/Source/WebKit/UIProcess/VisitedLinkStore.cpp
+--- a/Source/WebKit/UIProcess/VisitedLinkStore.cpp	2021-02-26 04:57:16.000000000 -0500
++++ b/Source/WebKit/UIProcess/VisitedLinkStore.cpp	2021-05-16 14:45:32.000000000 -0400
+@@ -119,7 +119,7 @@
+         return;
+ 
+     // FIXME: Get the actual size of data being sent from m_linkHashStore and send it in the SharedMemory::IPCHandle object.
+-#if OS(DARWIN) || OS(WINDOWS)
++#if (OS(DARWIN) || OS(WINDOWS)) && !USE(UNIX_DOMAIN_SOCKETS)
+     uint64_t dataSize = handle.size();
+ #else
+     uint64_t dataSize = 0;
+Only in b/Source/WebKit/WebProcess/WebPage/CoordinatedGraphics: DrawingAreaCoordinatedGraphics.cpp.orig
diff --git a/nixpkgs/pkgs/development/libraries/webkitgtk/default.nix b/nixpkgs/pkgs/development/libraries/webkitgtk/default.nix
new file mode 100644
index 000000000000..90ad985cfb81
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/webkitgtk/default.nix
@@ -0,0 +1,230 @@
+{ lib, stdenv
+, runCommand
+, fetchurl
+, fetchpatch
+, perl
+, python3
+, ruby
+, bison
+, gperf
+, cmake
+, ninja
+, pkg-config
+, 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
+, apple_sdk
+, libGL
+, libGLU
+, mesa
+, libintl
+, libmanette
+, openjpeg
+, enableGeoLocation ? true
+, geoclue2
+, sqlite
+, enableGLES ? true
+, gst-plugins-base
+, gst-plugins-bad
+, woff2
+, bubblewrap
+, libseccomp
+, systemd
+, xdg-dbus-proxy
+, substituteAll
+, glib
+, addOpenGLRunpath
+}:
+
+assert enableGeoLocation -> geoclue2 != null;
+
+stdenv.mkDerivation rec {
+  pname = "webkitgtk";
+  version = "2.32.3";
+
+  outputs = [ "out" "dev" ];
+
+  separateDebugInfo = stdenv.isLinux;
+
+  src = fetchurl {
+    url = "https://webkitgtk.org/releases/${pname}-${version}.tar.xz";
+    sha256 = "sha256-wfSW9axlTv5M72L71PL77u8mWgfF50GeXSkAv+6lLLw=";
+  };
+
+  patches = lib.optionals stdenv.isLinux [
+    (substituteAll {
+      src = ./fix-bubblewrap-paths.patch;
+      inherit (builtins) storeDir;
+      inherit (addOpenGLRunpath) driverLink;
+    })
+    ./libglvnd-headers.patch
+  ] ++ lib.optionals stdenv.isDarwin [
+    # https://bugs.webkit.org/show_bug.cgi?id=225856
+    (fetchpatch {
+      url = "https://bug-225856-attachments.webkit.org/attachment.cgi?id=428797";
+      sha256 = "sha256-ffo5p2EyyjXe3DxdrvAcDKqxwnoqHtYBtWod+1fOjMU=";
+      excludes = [ "Source/WebCore/ChangeLog" ];
+    })
+
+    # https://bugs.webkit.org/show_bug.cgi?id=225850
+    ./428774.patch # https://bug-225850-attachments.webkit.org/attachment.cgi?id=428774
+    (fetchpatch {
+      url = "https://bug-225850-attachments.webkit.org/attachment.cgi?id=428776";
+      sha256 = "sha256-ryNRYMsk72SL0lNdh6eaAdDV3OT8KEqVq1H0j581jmQ=";
+      excludes = [ "Source/WTF/ChangeLog" ];
+    })
+    (fetchpatch {
+      url = "https://bug-225850-attachments.webkit.org/attachment.cgi?id=428778";
+      sha256 = "sha256-78iP+T2vaIufO8TmIPO/tNDgmBgzlDzalklrOPrtUeo=";
+      excludes = [ "Source/WebKit/ChangeLog" ];
+    })
+  ];
+
+  preConfigure = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+    # Ignore gettext in cmake_prefix_path so that find_program doesn't
+    # pick up the wrong gettext. TODO: Find a better solution for
+    # this, maybe make cmake not look up executables in
+    # CMAKE_PREFIX_PATH.
+    cmakeFlags+=" -DCMAKE_IGNORE_PATH=${lib.getBin gettext}/bin"
+  '';
+
+  nativeBuildInputs = [
+    bison
+    cmake
+    gettext
+    gobject-introspection
+    gperf
+    ninja
+    perl
+    perl.pkgs.FileCopyRecursive # used by copy-user-interface-resources.pl
+    pkg-config
+    python3
+    ruby
+    glib # for gdbus-codegen
+  ] ++ lib.optionals stdenv.isLinux [
+    wayland # for wayland-scanner
+  ];
+
+  buildInputs = [
+    at-spi2-core
+    enchant2
+    epoxy
+    gnutls
+    gst-plugins-bad
+    gst-plugins-base
+    harfbuzz
+    libGL
+    libGLU
+    mesa # for libEGL headers
+    libgcrypt
+    libidn
+    libintl
+  ] ++ lib.optionals stdenv.isLinux [
+    libmanette
+  ] ++ [
+    libnotify
+    libpthreadstubs
+    libsecret
+    libtasn1
+    libwebp
+    libxkbcommon
+    libxml2
+    libxslt
+    nettle
+    openjpeg
+    p11-kit
+    pcre
+    sqlite
+    woff2
+  ] ++ (with xorg; [
+    libXdamage
+    libXdmcp
+    libXt
+    libXtst
+  ]) ++ lib.optionals stdenv.isDarwin [
+    libedit
+    readline
+  ] ++ lib.optional (stdenv.isDarwin && !stdenv.isAarch64) (
+    # Pull a header that contains a definition of proc_pid_rusage().
+    # (We pick just that one because using the other headers from `sdk` is not
+    # compatible with our C++ standard library. This header is already in
+    # the standard library on aarch64)
+    runCommand "${pname}_headers" {} ''
+      install -Dm444 "${lib.getDev apple_sdk.sdk}"/include/libproc.h "$out"/include/libproc.h
+    ''
+  ) ++ lib.optionals stdenv.isLinux [
+    bubblewrap
+    libseccomp
+    systemd
+    wayland
+    xdg-dbus-proxy
+  ] ++ lib.optional enableGeoLocation geoclue2;
+
+  propagatedBuildInputs = [
+    gtk3
+    libsoup
+  ];
+
+  cmakeFlags = [
+    "-DENABLE_INTROSPECTION=ON"
+    "-DPORT=GTK"
+    "-DUSE_LIBHYPHEN=OFF"
+    "-DUSE_WPE_RENDERER=OFF"
+  ] ++ lib.optionals stdenv.isDarwin [
+    "-DENABLE_GAMEPAD=OFF"
+    "-DENABLE_GTKDOC=OFF"
+    "-DENABLE_MINIBROWSER=OFF"
+    "-DENABLE_QUARTZ_TARGET=ON"
+    "-DENABLE_VIDEO=ON"
+    "-DENABLE_WEBGL=OFF"
+    "-DENABLE_WEB_AUDIO=OFF"
+    "-DENABLE_X11_TARGET=OFF"
+    "-DUSE_APPLE_ICU=OFF"
+    "-DUSE_OPENGL_OR_ES=OFF"
+    "-DUSE_SYSTEM_MALLOC=ON"
+  ] ++ lib.optionals (!stdenv.isLinux) [
+    "-DUSE_SYSTEMD=OFF"
+  ] ++ lib.optional (stdenv.isLinux && enableGLES) "-DENABLE_GLES2=ON";
+
+  postPatch = ''
+    patchShebangs .
+  '' + lib.optionalString stdenv.isDarwin ''
+    # It needs malloc_good_size.
+    sed 22i'#include <malloc/malloc.h>' -i Source/WTF/wtf/FastMalloc.h
+    # <CommonCrypto/CommonRandom.h> needs CCCryptorStatus.
+    sed 43i'#include <CommonCrypto/CommonCryptor.h>' -i Source/WTF/wtf/RandomDevice.cpp
+  '';
+
+  requiredSystemFeatures = [ "big-parallel" ];
+
+  meta = with lib; {
+    description = "Web content rendering engine, GTK port";
+    homepage = "https://webkitgtk.org/";
+    license = licenses.bsd2;
+    platforms = platforms.linux ++ platforms.darwin;
+    maintainers = teams.gnome.members;
+  };
+}
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..d502958f4f1a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/webkitgtk/fix-bubblewrap-paths.patch
@@ -0,0 +1,16 @@
+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
+@@ -724,6 +724,12 @@
+         "--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",
++        "--ro-bind-try", "@driverLink@/lib", "@driverLink@/lib",
++        "--ro-bind-try", "@driverLink@/share", "@driverLink@/share",
+     };
+     // We would have to parse ld config files for more info.
+     bindPathVar(sandboxArgs, "LD_LIBRARY_PATH");
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..8d7f2477b55a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/webkitgtk/libglvnd-headers.patch
@@ -0,0 +1,12 @@
+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/webrtc-audio-processing/default.nix b/nixpkgs/pkgs/development/libraries/webrtc-audio-processing/default.nix
new file mode 100644
index 000000000000..d757789fc268
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/webrtc-audio-processing/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, darwin }:
+
+stdenv.mkDerivation rec {
+  name = "webrtc-audio-processing-0.3.1";
+
+  src = fetchurl {
+    url = "https://freedesktop.org/software/pulseaudio/webrtc-audio-processing/${name}.tar.xz";
+    sha256 = "1gsx7k77blfy171b6g3m0k0s0072v6jcawhmx1kjs9w5zlwdkzd0";
+  };
+
+  patches = [ ./enable-riscv.patch ];
+
+  buildInputs = lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ ApplicationServices ]);
+
+  patchPhase = lib.optionalString stdenv.hostPlatform.isMusl ''
+    substituteInPlace webrtc/base/checks.cc --replace 'defined(__UCLIBC__)' 1
+  '';
+
+  meta = with lib; {
+    homepage = "http://www.freedesktop.org/software/pulseaudio/webrtc-audio-processing";
+    description = "A more Linux packaging friendly copy of the AudioProcessing module from the WebRTC project";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/webrtc-audio-processing/enable-riscv.patch b/nixpkgs/pkgs/development/libraries/webrtc-audio-processing/enable-riscv.patch
new file mode 100644
index 000000000000..d61c33548a73
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/webrtc-audio-processing/enable-riscv.patch
@@ -0,0 +1,18 @@
+diff --git a/webrtc/typedefs.h b/webrtc/typedefs.h
+index d875490..ce1f3e8 100644
+--- a/webrtc/typedefs.h
++++ b/webrtc/typedefs.h
+@@ -26,6 +26,13 @@
+ #elif defined(__aarch64__)
+ #define WEBRTC_ARCH_64_BITS
+ #define WEBRTC_ARCH_LITTLE_ENDIAN
++#elif defined(__riscv) || defined(__riscv__)
++#define WEBRTC_ARCH_LITTLE_ENDIAN
++#if __riscv_xlen == 64
++#define WEBRTC_ARCH_64_BITS
++#else
++#define WEBRTC_ARCH_32_BITS
++#endif
+ #elif defined(_M_IX86) || defined(__i386__)
+ #define WEBRTC_ARCH_X86_FAMILY
+ #define WEBRTC_ARCH_X86
diff --git a/nixpkgs/pkgs/development/libraries/websocket++/default.nix b/nixpkgs/pkgs/development/libraries/websocket++/default.nix
new file mode 100644
index 000000000000..5c9271f2a85a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/websocket++/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "websocket++";
+  version = "0.8.1";
+
+  src = fetchFromGitHub {
+    owner = "zaphoyd";
+    repo = "websocketpp";
+    rev = version;
+    sha256 = "12ffczcrryh74c1xssww35ic6yiy2l2xgdd30lshiq9wnzl2brgy";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    homepage = "https://www.zaphoyd.com/websocketpp/";
+    description = "C++/Boost Asio based websocket client/server library";
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ andir ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wiiuse/default.nix b/nixpkgs/pkgs/development/libraries/wiiuse/default.nix
new file mode 100644
index 000000000000..d5d34fb618d6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wiiuse/default.nix
@@ -0,0 +1,38 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, bluez
+, libobjc
+, Foundation
+, IOBluetooth
+}:
+stdenv.mkDerivation rec {
+
+  pname = "WiiUse";
+  version = "0.15.5";
+
+  src = fetchFromGitHub {
+    owner = "wiiuse";
+    repo = "wiiuse";
+    rev = version;
+    sha256 = "05gc3s0wxx7ga4g32yyibyxdh46rm9bbslblrc72ynrjxq98sg13";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = lib.optionals stdenv.hostPlatform.isLinux [ bluez ]
+    ++ lib.optionals stdenv.hostPlatform.isDarwin [ libobjc Foundation IOBluetooth ];
+
+  propagatedBuildInputs = lib.optionals stdenv.hostPlatform.isLinux [ bluez ];
+
+  cmakeFlags = [ "-DBUILD_EXAMPLE_SDL=OFF" ];
+
+  meta = with lib; {
+    description = "Feature complete cross-platform Wii Remote access library";
+    license = licenses.gpl3Plus;
+    homepage = "https://github.com/wiiuse/wiiuse";
+    maintainers = with maintainers; [ shamilton ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wildmidi/default.nix b/nixpkgs/pkgs/development/libraries/wildmidi/default.nix
new file mode 100644
index 000000000000..7983806a3090
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wildmidi/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv, fetchFromGitHub, cmake, alsa-lib, freepats }:
+
+stdenv.mkDerivation rec {
+  pname = "wildmidi";
+  version = "0.4.4";
+
+  src = fetchFromGitHub {
+    owner = "Mindwerks";
+    repo = "wildmidi";
+    rev = "${pname}-${version}";
+    sha256 = "08fbbsvw6pkwwqarjwcvdp8mq4zn5sgahf025hynwc6rvf4sp167";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ alsa-lib stdenv.cc.libc/*couldn't find libm*/ ];
+
+  preConfigure = ''
+    substituteInPlace CMakeLists.txt \
+      --replace /etc/wildmidi $out/etc
+  '';
+
+  postInstall = ''
+    mkdir "$out"/etc
+    echo "dir ${freepats}" > "$out"/etc/wildmidi.cfg
+    echo "source ${freepats}/freepats.cfg" >> "$out"/etc/wildmidi.cfg
+  '';
+
+  meta = with lib; {
+    description = "Software MIDI player and library";
+    longDescription = ''
+      WildMIDI is a simple software midi player which has a core softsynth
+      library that can be use with other applications.
+    '';
+    homepage = "http://wildmidi.sourceforge.net/";
+    # The library is LGPLv3, the wildmidi executable is GPLv3
+    license = licenses.lgpl3;
+    platforms = platforms.linux;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wiredtiger/default.nix b/nixpkgs/pkgs/development/libraries/wiredtiger/default.nix
new file mode 100644
index 000000000000..b6064c42b5c9
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wiredtiger/default.nix
@@ -0,0 +1,67 @@
+{ lib, stdenv, fetchFromGitHub, automake, autoconf, libtool
+
+# Optional Dependencies
+, lz4 ? null, snappy ? null, zlib ? null, bzip2 ? null, db ? null
+, gperftools ? null, leveldb ? null
+}:
+
+with lib;
+let
+  mkFlag = trueStr: falseStr: cond: name: val: "--"
+    + (if cond then trueStr else falseStr)
+    + name
+    + optionalString (val != null && cond != false) "=${val}";
+  mkEnable = mkFlag "enable-" "disable-";
+  mkWith = mkFlag "with-" "without-";
+
+  shouldUsePkg = pkg: if pkg != null && lib.meta.availableOn stdenv.hostPlatform pkg then pkg else null;
+
+  optLz4 = shouldUsePkg lz4;
+  optSnappy = shouldUsePkg snappy;
+  optZlib = shouldUsePkg zlib;
+  optBzip2 = shouldUsePkg bzip2;
+  optDb = shouldUsePkg db;
+  optGperftools = shouldUsePkg gperftools;
+  optLeveldb = shouldUsePkg leveldb;
+in
+stdenv.mkDerivation rec {
+  pname = "wiredtiger";
+  version = "3.2.1";
+
+  src = fetchFromGitHub {
+    repo = "wiredtiger";
+    owner = "wiredtiger";
+    rev = version;
+    sha256 = "04j2zw8b9jym43r682rh4kpdippxx7iw3ry16nxlbybzar9kgk83";
+  };
+
+  nativeBuildInputs = [ automake autoconf libtool ];
+  buildInputs = [ optLz4 optSnappy optZlib optBzip2 optDb optGperftools optLeveldb ];
+
+  configureFlags = [
+    (mkWith   false                   "attach"     null)
+    (mkWith   true                    "builtins"   "")
+    (mkEnable (optBzip2 != null)      "bzip2"      null)
+    (mkEnable false                   "diagnostic" null)
+    (mkEnable false                   "java"       null)
+    (mkEnable (optLeveldb != null)    "leveldb"    null)
+    (mkEnable false                   "python"     null)
+    (mkEnable (optSnappy != null)     "snappy"     null)
+    (mkEnable (optLz4 != null)        "lz4"        null)
+    (mkEnable (optGperftools != null) "tcmalloc"   null)
+    (mkEnable (optZlib != null)       "zlib"       null)
+    (mkWith   (optDb != null)         "berkeleydb" optDb)
+    (mkWith   false                   "helium"     null)
+  ];
+
+  preConfigure = ''
+    ./autogen.sh
+  '';
+
+  meta = {
+    homepage = "http://wiredtiger.com/";
+    description = "";
+    license = licenses.gpl2;
+    platforms = intersectLists platforms.unix platforms.x86_64;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wlroots/0.12.nix b/nixpkgs/pkgs/development/libraries/wlroots/0.12.nix
new file mode 100644
index 000000000000..c21205beabc3
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wlroots/0.12.nix
@@ -0,0 +1,59 @@
+{ lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config, wayland
+, libGL, wayland-protocols, libinput, libxkbcommon, pixman
+, xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa
+, libpng, ffmpeg
+}:
+
+# Fixed version derivation.
+# nixpkgs-update: no auto update
+stdenv.mkDerivation rec {
+  pname = "wlroots";
+  version = "0.12.0";
+
+  src = fetchFromGitHub {
+    owner = "swaywm";
+    repo = "wlroots";
+    rev = version;
+    sha256 = "01j38lmgs2c6fq68v8b75pkilia2wsgzgp46ivfbi9hhx47kgcfn";
+  };
+
+  # $out for the library and $examples for the example programs (in examples):
+  outputs = [ "out" "examples" ];
+
+  nativeBuildInputs = [ meson ninja pkg-config wayland ];
+
+  buildInputs = [
+    libGL wayland wayland-protocols libinput libxkbcommon pixman
+    xcbutilwm libX11 libcap xcbutilimage xcbutilerrors mesa
+    libpng ffmpeg
+  ];
+
+  mesonFlags = [ "-Dlogind-provider=systemd" "-Dlibseat=disabled" ];
+
+  CFLAGS = "-Wno-error=deprecated-declarations";
+
+  postFixup = ''
+    # Install ALL example programs to $examples:
+    # screencopy dmabuf-capture input-inhibitor layer-shell idle-inhibit idle
+    # screenshot output-layout multi-pointer rotation tablet touch pointer
+    # simple
+    mkdir -p $examples/bin
+    cd ./examples
+    for binary in $(find . -executable -type f -printf '%P\n' | grep -vE '\.so'); do
+      cp "$binary" "$examples/bin/wlroots-$binary"
+    done
+  '';
+
+  meta = with lib; {
+    description = "A modular Wayland compositor library";
+    longDescription = ''
+      Pluggable, composable, unopinionated modules for building a Wayland
+      compositor; or about 50,000 lines of code you were going to write anyway.
+    '';
+    inherit (src.meta) homepage;
+    changelog = "https://github.com/swaywm/wlroots/releases/tag/${version}";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ primeos synthetica ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wlroots/default.nix b/nixpkgs/pkgs/development/libraries/wlroots/default.nix
new file mode 100644
index 000000000000..c22999dd6f0e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wlroots/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config, wayland-scanner
+, libGL, wayland, wayland-protocols, libinput, libxkbcommon, pixman
+, xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa
+, libpng, ffmpeg, xcbutilrenderutil, xwayland, seatd
+}:
+
+stdenv.mkDerivation rec {
+  pname = "wlroots";
+  version = "0.14.1";
+
+  src = fetchFromGitHub {
+    owner = "swaywm";
+    repo = "wlroots";
+    rev = version;
+    sha256 = "1sshp3lvlkl1i670kxhwsb4xzxl8raz6769kqvgmxzcb63ns9ay1";
+  };
+
+  # $out for the library and $examples for the example programs (in examples):
+  outputs = [ "out" "examples" ];
+
+  depsBuildBuild = [ pkg-config ];
+
+  nativeBuildInputs = [ meson ninja pkg-config wayland-scanner ];
+
+  buildInputs = [
+    libGL wayland wayland-protocols libinput libxkbcommon pixman
+    xcbutilwm libX11 libcap xcbutilimage xcbutilerrors mesa
+    libpng ffmpeg xcbutilrenderutil xwayland seatd
+  ];
+
+  postFixup = ''
+    # Install ALL example programs to $examples:
+    # screencopy dmabuf-capture input-inhibitor layer-shell idle-inhibit idle
+    # screenshot output-layout multi-pointer rotation tablet touch pointer
+    # simple
+    mkdir -p $examples/bin
+    cd ./examples
+    for binary in $(find . -executable -type f -printf '%P\n' | grep -vE '\.so'); do
+      cp "$binary" "$examples/bin/wlroots-$binary"
+    done
+  '';
+
+  meta = with lib; {
+    description = "A modular Wayland compositor library";
+    longDescription = ''
+      Pluggable, composable, unopinionated modules for building a Wayland
+      compositor; or about 50,000 lines of code you were going to write anyway.
+    '';
+    inherit (src.meta) homepage;
+    changelog = "https://github.com/swaywm/wlroots/releases/tag/${version}";
+    license     = licenses.mit;
+    platforms   = platforms.linux;
+    maintainers = with maintainers; [ primeos synthetica ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wolfssl/default.nix b/nixpkgs/pkgs/development/libraries/wolfssl/default.nix
new file mode 100644
index 000000000000..d696961a4eb0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wolfssl/default.nix
@@ -0,0 +1,53 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, autoreconfHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "wolfssl";
+  version = "4.8.1";
+
+  src = fetchFromGitHub {
+    owner = "wolfSSL";
+    repo = "wolfssl";
+    rev = "v${version}-stable";
+    sha256 = "1w9gs9cq2yhj5s3diz3x1l15pgrc1pbm00jccizvcjyibmwyyf2h";
+  };
+
+  # Almost same as Debian but for now using --enable-all --enable-reproducible-build instead of --enable-distro to ensure options.h gets installed
+  configureFlags = [
+    "--enable-all"
+    "--enable-base64encode"
+    "--enable-pkcs11"
+    "--enable-reproducible-build"
+    "--enable-tls13"
+  ];
+
+  outputs = [
+    "dev"
+    "doc"
+    "lib"
+    "out"
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+  ];
+
+  postInstall = ''
+     # fix recursive cycle:
+     # wolfssl-config points to dev, dev propagates bin
+     moveToOutput bin/wolfssl-config "$dev"
+     # moveToOutput also removes "$out" so recreate it
+     mkdir -p "$out"
+  '';
+
+  meta = with lib; {
+    description = "A small, fast, portable implementation of TLS/SSL for embedded devices";
+    homepage = "https://www.wolfssl.com/";
+    platforms = platforms.all;
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ fab ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wt/default.nix b/nixpkgs/pkgs/development/libraries/wt/default.nix
new file mode 100644
index 000000000000..cb3ceeae2f1c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wt/default.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv, fetchFromGitHub, cmake, boost, pkg-config, doxygen, qt48Full, libharu
+, pango, fcgi, firebird, libmysqlclient, postgresql, graphicsmagick, glew, openssl
+, pcre, harfbuzz
+}:
+
+let
+  generic =
+    { version, sha256 }:
+    stdenv.mkDerivation {
+      pname = "wt";
+      inherit version;
+
+      src = fetchFromGitHub {
+        owner = "emweb";
+        repo = "wt";
+        rev = version;
+        inherit sha256;
+      };
+
+      nativeBuildInputs = [ cmake pkg-config ];
+      buildInputs = [
+        boost doxygen qt48Full libharu
+        pango fcgi firebird libmysqlclient postgresql graphicsmagick glew
+        openssl pcre harfbuzz
+      ];
+
+      cmakeFlags = [
+        "-DWT_CPP_11_MODE=-std=c++11"
+        "--no-warn-unused-cli"
+      ]
+      ++ lib.optionals (graphicsmagick != null) [
+        "-DWT_WRASTERIMAGE_IMPLEMENTATION=GraphicsMagick"
+        "-DGM_PREFIX=${graphicsmagick}"
+      ]
+      ++ lib.optional (libmysqlclient != null)
+        "-DMYSQL_PREFIX=${libmysqlclient}";
+
+      meta = with lib; {
+        homepage = "https://www.webtoolkit.eu/wt";
+        description = "C++ library for developing web applications";
+        platforms = platforms.linux;
+        license = licenses.gpl2;
+        maintainers = with maintainers; [ juliendehos willibutz ];
+      };
+    };
+in {
+  wt3 = generic {
+    version = "3.5.0";
+    sha256 = "1xcwzldbval5zrf7f3n2gkpscagg51cw2jp6p3q1yh6bi59haida";
+  };
+
+  wt4 = generic {
+    version = "4.5.0";
+    sha256 = "16svzdma2mc2ggnpy5z7m1ggzhd5nrccmmj8xnc7bd1dd3486xwv";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wtk/builder.sh b/nixpkgs/pkgs/development/libraries/wtk/builder.sh
new file mode 100644
index 000000000000..86f2719537cd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wtk/builder.sh
@@ -0,0 +1,27 @@
+source $stdenv/setup
+
+mkdir unzipped
+pushd unzipped
+unzip $src || true
+popd
+
+mkdir -p $out
+mv unzipped/* $out/
+
+# Remove crap in the root directory.
+for file in $out/*
+do
+  if test -f $file ; then
+    rm $file
+  fi
+done
+
+# Set the dynamic linker.
+rpath=
+for i in $libraries; do
+    rpath=$rpath${rpath:+:}$i/lib
+done
+find $out -type f -perm -0100 \
+    -exec patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" {} \;
+find $out -type f -perm -0100 \
+    -exec patchelf --set-rpath "$rpath" {} \;
diff --git a/nixpkgs/pkgs/development/libraries/wtk/default.nix b/nixpkgs/pkgs/development/libraries/wtk/default.nix
new file mode 100644
index 000000000000..94dea0edae1d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wtk/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, requireFile, unzip, xorg }:
+
+assert stdenv.hostPlatform.system == "i686-linux";
+
+stdenv.mkDerivation rec {
+  pname = "sun-java-wtk";
+  version = "2.5.2_01";
+
+  src = requireFile {
+    url = "http://java.sun.com/products/sjwtoolkit/download.html";
+    name = "sun_java_wireless_toolkit-${version}-linuxi486.bin.sh";
+    sha256 = "1cjb9c27847wv0hq3j645ckn4di4vsfvp29fr4zmdqsnvk4ahvj1";
+  };
+
+  builder = ./builder.sh;
+
+  nativeBuildInputs = [ unzip ];
+
+  libraries = [ xorg.libXpm xorg.libXt xorg.libX11 xorg.libICE xorg.libSM stdenv.cc.cc ];
+
+  meta = {
+    homepage = "http://java.sun.com/products/sjwtoolkit/download.html";
+    description = "Sun Java Wireless Toolkit 2.5.2_01 for CLDC";
+    license = lib.licenses.unfree;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wxSVG/default.nix b/nixpkgs/pkgs/development/libraries/wxSVG/default.nix
new file mode 100644
index 000000000000..f83f7e408977
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wxSVG/default.nix
@@ -0,0 +1,43 @@
+{ lib
+, stdenv
+, fetchurl
+, cairo
+, ffmpeg
+, libexif
+, pango
+, pkg-config
+, wxGTK
+}:
+
+stdenv.mkDerivation rec {
+  pname = "wxSVG";
+  version = "1.5.22";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/project/wxsvg/wxsvg/${version}/wxsvg-${version}.tar.bz2";
+    hash = "sha256-DeFozZ8MzTCbhkDBtuifKpBpg7wS7+dbDFzTDx6v9Sk=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+  ];
+  buildInputs = [
+    cairo
+    ffmpeg
+    libexif
+    pango
+    wxGTK
+  ];
+
+  meta = with lib; {
+    homepage = "http://wxsvg.sourceforge.net/";
+    description = "A SVG manipulation library built with wxWidgets";
+    longDescription = ''
+      wxSVG is C++ library to create, manipulate and render Scalable Vector
+      Graphics (SVG) files with the wxWidgets toolkit.
+    '';
+    license = with licenses; gpl2Plus;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = wxGTK.meta.platforms;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wxsqlite3/default.nix b/nixpkgs/pkgs/development/libraries/wxsqlite3/default.nix
new file mode 100644
index 000000000000..d1f6903961b7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wxsqlite3/default.nix
@@ -0,0 +1,36 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, wxGTK
+, sqlite
+, Cocoa
+, setfile
+, rez
+, derez
+}:
+
+stdenv.mkDerivation rec {
+  pname = "wxsqlite3";
+  version = "4.6.4";
+
+  src = fetchFromGitHub {
+    owner = "utelle";
+    repo = "wxsqlite3";
+    rev = "v${version}";
+    sha256 = "sha256-fIm8xbNP7pjzvfBn7NgYmUtbVVh2aiaXQVANJQnrWCs=";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  buildInputs = [ wxGTK sqlite ]
+    ++ lib.optionals stdenv.isDarwin [ Cocoa setfile rez derez ];
+
+  meta = with lib; {
+    homepage = "https://utelle.github.io/wxsqlite3/";
+    description = "A C++ wrapper around the public domain SQLite 3.x for wxWidgets";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ vrthra ];
+    license = with licenses; [ lgpl3Plus gpl3Plus ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wxsqliteplus/default.nix b/nixpkgs/pkgs/development/libraries/wxsqliteplus/default.nix
new file mode 100644
index 000000000000..7cf5484bef77
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wxsqliteplus/default.nix
@@ -0,0 +1,37 @@
+{ lib, stdenv, fetchFromGitHub, wxGTK, wxsqlite3, sqlite }:
+
+stdenv.mkDerivation rec {
+  pname = "wxsqliteplus";
+  version = "0.3.6";
+
+  src = fetchFromGitHub {
+    owner = "guanlisheng";
+    repo = "wxsqliteplus";
+    rev = "v${version}";
+    sha256 = "0mgfq813pli56mar7pdxlhwjf5k10j196rs3jd0nc8b6dkzkzlnf";
+  };
+
+  buildInputs = [ wxGTK wxsqlite3 sqlite ];
+
+  makeFlags = [
+    "LDFLAGS=-L${wxsqlite3}/lib"
+  ];
+
+  preBuild = ''
+    sed -ie 's|all: $(LIBPREFIX)wxsqlite$(LIBEXT)|all: |g' Makefile
+    sed -ie 's|wxsqliteplus$(EXEEXT): $(WXSQLITEPLUS_OBJECTS) $(LIBPREFIX)wxsqlite$(LIBEXT)|wxsqliteplus$(EXEEXT):  $(WXSQLITEPLUS_OBJECTS) |g' Makefile
+    sed -ie 's|-lwxsqlite |-lwxcode_gtk2u_wxsqlite3-3.0 |g' Makefile
+  '';
+
+  installPhase = ''
+    install -D wxsqliteplus $out/bin/wxsqliteplus
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/guanlisheng/wxsqliteplus";
+    description = "A simple SQLite database browser built with wxWidgets";
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ vrthra ];
+    license = licenses.gpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wxwidgets/2.8/default.nix b/nixpkgs/pkgs/development/libraries/wxwidgets/2.8/default.nix
new file mode 100644
index 000000000000..8029477708df
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wxwidgets/2.8/default.nix
@@ -0,0 +1,76 @@
+{ lib, stdenv, fetchurl, pkg-config, gtk2, libXinerama, libSM, libXxf86vm, xorgproto
+, libX11, cairo
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
+, withMesa ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
+, libGLU ? null, libGL ? null
+, compat24 ? false, compat26 ? true, unicode ? true,
+}:
+
+assert withMesa -> libGLU != null && libGL != null;
+
+with lib;
+
+stdenv.mkDerivation rec {
+  version = "2.8.12.1";
+  pname = "wxGTK";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/wxpython/wxPython-src-${version}.tar.bz2";
+    sha256 = "1l1w4i113csv3bd5r8ybyj0qpxdq83lj6jrc5p7cc10mkwyiagqz";
+  };
+
+  buildInputs = [ gtk2 libXinerama libSM libXxf86vm xorgproto libX11 cairo ]
+    ++ optional withMesa libGLU;
+
+  nativeBuildInputs = [ pkg-config ];
+
+  hardeningDisable = [ "format" ];
+
+  configureFlags = [
+    "--enable-gtk2"
+    (if compat24 then "--enable-compat24" else "--disable-compat24")
+    (if compat26 then "--enable-compat26" else "--disable-compat26")
+    "--disable-precomp-headers"
+    (if unicode then "--enable-unicode" else "")
+    "--enable-mediactrl"
+    "--enable-graphics_ctx"
+  ] ++ optional withMesa "--with-opengl";
+
+  # These variables are used by configure to find some dependencies.
+  SEARCH_INCLUDE =
+    "${libXinerama.dev}/include ${libSM.dev}/include ${libXxf86vm.dev}/include";
+  SEARCH_LIB =
+    "${libXinerama.out}/lib ${libSM.out}/lib ${libXxf86vm.out}/lib "
+    + 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";
+
+  preConfigure = "
+    substituteInPlace configure --replace 'SEARCH_INCLUDE=' 'DUMMY_SEARCH_INCLUDE='
+    substituteInPlace configure --replace 'SEARCH_LIB=' 'DUMMY_SEARCH_LIB='
+    substituteInPlace configure --replace /usr /no-such-path
+  ";
+
+  postBuild = "(cd contrib/src && make)";
+
+  postInstall = "
+    (cd contrib/src && make install)
+    (cd $out/include && ln -s wx-*/* .)
+  ";
+
+  passthru = {
+    inherit compat24 compat26 unicode;
+    gtk = gtk2;
+  };
+
+  enableParallelBuilding = true;
+
+  meta = {
+    platforms = platforms.linux;
+    license = licenses.wxWindows;
+    homepage = "https://www.wxwidgets.org/";
+    description = "a C++ library that lets developers create applications for Windows, macOS, Linux and other platforms with a single code base";
+    longDescription = "wxWidgets gives you a single, easy-to-use API for writing GUI applications on multiple platforms that still utilize the native platform's controls and utilities. Link with the appropriate library for your platform and compiler, and your application will adopt the look and feel appropriate to that platform. On top of great GUI functionality, wxWidgets gives you: online help, network programming, streams, clipboard and drag and drop, multithreading, image loading and saving in a variety of popular formats, database support, HTML viewing and printing, and much more.";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wxwidgets/2.9/default.nix b/nixpkgs/pkgs/development/libraries/wxwidgets/2.9/default.nix
new file mode 100644
index 000000000000..5674f076beca
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wxwidgets/2.9/default.nix
@@ -0,0 +1,84 @@
+{ lib, stdenv, fetchurl, pkg-config, gtk2, libXinerama, libSM, libXxf86vm, xorgproto
+, setfile
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
+, withMesa ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
+, libGLU ? null, libGL ? null
+, compat24 ? false, compat26 ? true, unicode ? true
+, Carbon ? null, Cocoa ? null, Kernel ? null, QuickTime ? null, AGL ? null
+}:
+
+assert withMesa -> libGLU != null && libGL != null;
+
+with lib;
+
+stdenv.mkDerivation rec {
+  pname = "wxwidgets";
+  version = "2.9.4";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/wxwindows/wxWidgets-${version}.tar.bz2";
+    sha256 = "04jda4bns7cmp7xy68qz112yg0lribpc6xs5k9gilfqcyhshqlvc";
+  };
+
+  patches = [
+    (fetchurl { # https://trac.wxwidgets.org/ticket/17942
+      url = "https://trac.wxwidgets.org/raw-attachment/ticket/17942/"
+          + "fix_assertion_using_hide_in_destroy.diff";
+      sha256 = "009y3dav79wiig789vkkc07g1qdqprg1544lih79199kb1h64lvy";
+    })
+  ];
+
+  buildInputs =
+    [ gtk2 libXinerama libSM libXxf86vm xorgproto ]
+    ++ optional withMesa libGLU
+    ++ optionals stdenv.isDarwin [ setfile Carbon Cocoa Kernel QuickTime ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  propagatedBuildInputs = optional stdenv.isDarwin AGL;
+
+  configureFlags =
+    [ "--enable-gtk2" "--disable-precomp-headers"
+      (if compat24 then "--enable-compat24" else "--disable-compat24")
+      (if compat26 then "--enable-compat26" else "--disable-compat26") ]
+    ++ optional unicode "--enable-unicode"
+    ++ optional withMesa "--with-opengl"
+    ++ optionals stdenv.isDarwin
+      # allow building on 64-bit
+      [ "--with-cocoa" "--enable-universal-binaries" "--with-macosx-version-min=10.7" ];
+
+  SEARCH_LIB = "${libGLU.out}/lib ${libGL.out}/lib ";
+
+  preConfigure = "
+    substituteInPlace configure --replace 'SEARCH_INCLUDE=' 'DUMMY_SEARCH_INCLUDE='
+    substituteInPlace configure --replace 'SEARCH_LIB=' 'DUMMY_SEARCH_LIB='
+    substituteInPlace configure --replace /usr /no-such-path
+  " + optionalString stdenv.isDarwin ''
+    substituteInPlace configure --replace \
+      'ac_cv_prog_SETFILE="/Developer/Tools/SetFile"' \
+      'ac_cv_prog_SETFILE="${setfile}/bin/SetFile"'
+    substituteInPlace configure --replace \
+      "-framework System" \
+      -lSystem
+  '';
+
+  postInstall = "
+    (cd $out/include && ln -s wx-*/* .)
+  ";
+
+  passthru = {
+    inherit compat24 compat26 unicode;
+    gtk = gtk2;
+  };
+
+  enableParallelBuilding = true;
+
+  meta = {
+    platforms = with platforms; darwin ++ linux;
+    license = licenses.wxWindows;
+    homepage = "https://www.wxwidgets.org/";
+    description = "a C++ library that lets developers create applications for Windows, macOS, Linux and other platforms with a single code base";
+    longDescription = "wxWidgets gives you a single, easy-to-use API for writing GUI applications on multiple platforms that still utilize the native platform's controls and utilities. Link with the appropriate library for your platform and compiler, and your application will adopt the look and feel appropriate to that platform. On top of great GUI functionality, wxWidgets gives you: online help, network programming, streams, clipboard and drag and drop, multithreading, image loading and saving in a variety of popular formats, database support, HTML viewing and printing, and much more.";
+    badPlatforms = [ "x86_64-darwin" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wxwidgets/3.0/default.nix b/nixpkgs/pkgs/development/libraries/wxwidgets/3.0/default.nix
new file mode 100644
index 000000000000..30e807cde057
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wxwidgets/3.0/default.nix
@@ -0,0 +1,95 @@
+{ lib, stdenv, fetchFromGitHub, fetchurl, pkg-config
+, libXinerama, libSM, libXxf86vm
+, gtk2, gtk3
+, xorgproto, gst_all_1, setfile
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
+, withMesa ? libGLSupported
+, libGLU, libGL
+, compat24 ? false, compat26 ? true, unicode ? true
+, withGtk2 ? true
+, withWebKit ? false, webkitgtk
+, AGL, Carbon, Cocoa, Kernel, QTKit
+}:
+
+with lib;
+
+assert assertMsg (withGtk2 -> withWebKit == false) "wxGTK30: You cannot enable withWebKit when using withGtk2.";
+
+stdenv.mkDerivation rec {
+  pname = "wxwidgets";
+  version = "3.0.5";
+
+  src = fetchFromGitHub {
+    owner = "wxWidgets";
+    repo = "wxWidgets";
+    rev = "v${version}";
+    sha256 = "1l33629ifx2dl2j71idqbd2qb6zb1d566ijpkvz6irrr50s6gbx7";
+  };
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [
+    libXinerama libSM libXxf86vm xorgproto gst_all_1.gstreamer gst_all_1.gst-plugins-base
+  ] ++ optional withGtk2 gtk2
+    ++ optional (!withGtk2) gtk3
+    ++ optional withMesa libGLU
+    ++ optional withWebKit webkitgtk
+    ++ optionals stdenv.isDarwin [ setfile Carbon Cocoa Kernel QTKit ];
+
+  propagatedBuildInputs = optional stdenv.isDarwin AGL;
+
+  patches = [
+    (fetchurl { # https://trac.wxwidgets.org/ticket/17942
+      url = "https://trac.wxwidgets.org/raw-attachment/ticket/17942/"
+          + "fix_assertion_using_hide_in_destroy.diff";
+      sha256 = "009y3dav79wiig789vkkc07g1qdqprg1544lih79199kb1h64lvy";
+    })
+  ];
+
+  configureFlags =
+    [ "--disable-precomp-headers" "--enable-mediactrl"
+      (if compat24 then "--enable-compat24" else "--disable-compat24")
+      (if compat26 then "--enable-compat26" else "--disable-compat26") ]
+    ++ optional unicode "--enable-unicode"
+    ++ optional withMesa "--with-opengl"
+    ++ optionals stdenv.isDarwin
+      # allow building on 64-bit
+      [ "--with-cocoa" "--enable-universal-binaries" "--with-macosx-version-min=10.7" ]
+    ++ optionals withWebKit
+      ["--enable-webview" "--enable-webview-webkit"];
+
+  SEARCH_LIB = "${libGLU.out}/lib ${libGL.out}/lib ";
+
+  preConfigure = "
+    substituteInPlace configure --replace 'SEARCH_INCLUDE=' 'DUMMY_SEARCH_INCLUDE='
+    substituteInPlace configure --replace 'SEARCH_LIB=' 'DUMMY_SEARCH_LIB='
+    substituteInPlace configure --replace /usr /no-such-path
+  " + optionalString stdenv.isDarwin ''
+    substituteInPlace configure --replace \
+      'ac_cv_prog_SETFILE="/Developer/Tools/SetFile"' \
+      'ac_cv_prog_SETFILE="${setfile}/bin/SetFile"'
+    substituteInPlace configure --replace \
+      "-framework System" \
+      -lSystem
+  '';
+
+  postInstall = "
+    (cd $out/include && ln -s wx-*/* .)
+  ";
+
+  passthru = {
+    inherit compat24 compat26 unicode;
+    gtk = if withGtk2 then gtk2 else gtk3;
+  };
+
+  enableParallelBuilding = true;
+
+  meta = {
+    platforms = with platforms; darwin ++ linux;
+    license = licenses.wxWindows;
+    homepage = "https://www.wxwidgets.org/";
+    description = "a C++ library that lets developers create applications for Windows, macOS, Linux and other platforms with a single code base";
+    longDescription = "wxWidgets gives you a single, easy-to-use API for writing GUI applications on multiple platforms that still utilize the native platform's controls and utilities. Link with the appropriate library for your platform and compiler, and your application will adopt the look and feel appropriate to that platform. On top of great GUI functionality, wxWidgets gives you: online help, network programming, streams, clipboard and drag and drop, multithreading, image loading and saving in a variety of popular formats, database support, HTML viewing and printing, and much more.";
+    badPlatforms = [ "x86_64-darwin" ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wxwidgets/3.0/mac.nix b/nixpkgs/pkgs/development/libraries/wxwidgets/3.0/mac.nix
new file mode 100644
index 000000000000..22e818409913
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wxwidgets/3.0/mac.nix
@@ -0,0 +1,69 @@
+{ lib, stdenv, fetchzip, expat, libiconv, libjpeg, libpng, libtiff, zlib
+# darwin only attributes
+, derez, rez, setfile
+, AGL, Cocoa, Kernel, WebKit
+}:
+
+stdenv.mkDerivation rec {
+  version = "3.0.5.1";
+  pname = "wxmac";
+
+  src = fetchzip {
+    url = "https://github.com/wxWidgets/wxWidgets/archive/v${version}.tar.gz";
+    sha256 = "19mqglghjjqjgz4rbybn3qdgn2cz9xc511nq1pvvli9wx2k8syl1";
+  };
+
+  buildInputs = [
+    expat libiconv libjpeg libpng libtiff zlib
+    derez rez setfile
+    AGL Cocoa Kernel WebKit
+  ];
+
+  postPatch = ''
+    substituteInPlace configure --replace "-framework System" -lSystem
+  '';
+
+  configureFlags = [
+    "wx_cv_std_libfullpath=/var/empty"
+    "--with-macosx-version-min=10.7"
+    "--enable-unicode"
+    "--with-osx_cocoa"
+    "--enable-std_string"
+    "--enable-display"
+    "--with-opengl"
+    "--with-libjpeg"
+    "--with-libtiff"
+    "--without-liblzma"
+    "--with-libpng"
+    "--with-zlib"
+    "--enable-dnd"
+    "--enable-clipboard"
+    "--enable-webkit"
+    "--enable-svg"
+    "--enable-graphics_ctx"
+    "--enable-controls"
+    "--enable-dataviewctrl"
+    "--with-expat"
+    "--disable-precomp-headers"
+    "--disable-mediactrl"
+  ];
+
+  checkPhase = ''
+    ./wx-config --libs
+  '';
+
+  NIX_CFLAGS_COMPILE = "-Wno-undef";
+
+  doCheck = true;
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    platforms = platforms.darwin;
+    license = licenses.wxWindows;
+    maintainers = [ maintainers.lnl7 ];
+    homepage = "https://www.wxwidgets.org/";
+    description = "a C++ library that lets developers create applications for Windows, macOS, Linux and other platforms with a single code base";
+    longDescription = "wxWidgets gives you a single, easy-to-use API for writing GUI applications on multiple platforms that still utilize the native platform's controls and utilities. Link with the appropriate library for your platform and compiler, and your application will adopt the look and feel appropriate to that platform. On top of great GUI functionality, wxWidgets gives you: online help, network programming, streams, clipboard and drag and drop, multithreading, image loading and saving in a variety of popular formats, database support, HTML viewing and printing, and much more.";
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/wxwidgets/3.1/default.nix b/nixpkgs/pkgs/development/libraries/wxwidgets/3.1/default.nix
new file mode 100644
index 000000000000..cab0197c9390
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/wxwidgets/3.1/default.nix
@@ -0,0 +1,138 @@
+{ lib, stdenv
+, fetchFromGitHub
+, fetchurl
+, pkg-config
+, libXinerama
+, libSM
+, libXxf86vm
+, libXtst
+, gtk2
+, GConf ? null
+, gtk3
+, xorgproto
+, gst_all_1
+, setfile
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
+, withMesa ? libGLSupported
+, libGLU ? null
+, libGL ? null
+, compat28 ? false
+, compat30 ? true
+, unicode ? true
+, withGtk2 ? true
+, withWebKit ? false
+, webkitgtk ? null
+, AGL ? null
+, Carbon ? null
+, Cocoa ? null
+, Kernel ? null
+, QTKit ? null
+}:
+
+with lib;
+
+assert withMesa -> libGLU != null && libGL != null;
+assert withWebKit -> webkitgtk != null;
+
+assert assertMsg (withGtk2 -> withWebKit == false) "wxGTK31: You cannot enable withWebKit when using withGtk2.";
+
+stdenv.mkDerivation rec {
+  version = "3.1.4";
+  pname = "wxwidgets";
+
+  src = fetchFromGitHub {
+    owner = "wxWidgets";
+    repo = "wxWidgets";
+    rev = "v${version}";
+    sha256 = "1fwzrk6w5k0vs8kqdq5lpzdbp5c09hx740wg6mi6vgmc1r67dv67";
+    fetchSubmodules = true;
+  };
+
+  buildInputs = [
+    libXinerama
+    libSM
+    libXxf86vm
+    libXtst
+    xorgproto
+    gst_all_1.gstreamer
+    gst_all_1.gst-plugins-base
+  ] ++ optionals withGtk2 [ gtk2 GConf ]
+  ++ optional (!withGtk2) gtk3
+  ++ optional withMesa libGLU
+  ++ optional withWebKit webkitgtk
+  ++ optionals stdenv.isDarwin [ setfile Carbon Cocoa Kernel QTKit ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  propagatedBuildInputs = optional stdenv.isDarwin AGL;
+
+  patches = [
+    (fetchurl {
+      # https://trac.wxwidgets.org/ticket/17942
+      url = "https://trac.wxwidgets.org/raw-attachment/ticket/17942/"
+        + "fix_assertion_using_hide_in_destroy.diff";
+      sha256 = "009y3dav79wiig789vkkc07g1qdqprg1544lih79199kb1h64lvy";
+    })
+  ];
+
+  configureFlags =
+    [
+      "--disable-precomp-headers"
+      "--enable-mediactrl"
+      (if compat28 then "--enable-compat28" else "--disable-compat28")
+      (if compat30 then "--enable-compat30" else "--disable-compat30")
+    ]
+    ++ optional unicode "--enable-unicode"
+    ++ optional withMesa "--with-opengl"
+    ++ optionals stdenv.isDarwin
+      # allow building on 64-bit
+      [ "--with-cocoa" "--enable-universal-binaries" "--with-macosx-version-min=10.7" ]
+    ++ optionals withWebKit
+      [ "--enable-webview" "--enable-webviewwebkit" ];
+
+  SEARCH_LIB = "${libGLU.out}/lib ${libGL.out}/lib ";
+
+  preConfigure = "
+    substituteInPlace configure --replace 'SEARCH_INCLUDE=' 'DUMMY_SEARCH_INCLUDE='
+    substituteInPlace configure --replace 'SEARCH_LIB=' 'DUMMY_SEARCH_LIB='
+    substituteInPlace configure --replace /usr /no-such-path
+  " + optionalString stdenv.isDarwin ''
+    substituteInPlace configure --replace \
+      'ac_cv_prog_SETFILE="/Developer/Tools/SetFile"' \
+      'ac_cv_prog_SETFILE="${setfile}/bin/SetFile"'
+    substituteInPlace configure --replace \
+      "-framework System" \
+      -lSystem
+  '';
+
+  postInstall = "
+    (cd $out/include && ln -s wx-*/* .)
+  ";
+
+  passthru = {
+    inherit compat28 compat30 unicode;
+    gtk = if withGtk2 then gtk2 else gtk3;
+  };
+
+  enableParallelBuilding = true;
+
+  meta = {
+    platforms = with platforms; darwin ++ linux;
+    license = licenses.wxWindows;
+    homepage = "https://www.wxwidgets.org/";
+    description = "A C++ library that lets developers create applications for Windows, macOS, Linux and other platforms with a single code base";
+    longDescription = ''
+      WxWidgets gives you a single, easy-to-use API for
+      writing GUI applications on multiple platforms that still utilize the
+      native platform's controls and utilities. Link with the appropriate library
+      for your platform and compiler, and your application will adopt the look
+      and feel appropriate to that platform. On top of great GUI functionality,
+      wxWidgets gives you: online help, network programming, streams, clipboard
+      and drag and drop, multithreading, image loading and saving in a variety of
+      popular formats, database support, HTML viewing and printing, and much
+      more.
+    '';
+    badPlatforms = [ "x86_64-darwin" ];
+    maintainers = with maintainers; [ tfmoraes ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/x264/default.nix b/nixpkgs/pkgs/development/libraries/x264/default.nix
new file mode 100644
index 000000000000..5b82c594b086
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/x264/default.nix
@@ -0,0 +1,46 @@
+{ stdenv, lib, fetchurl, nasm
+, enableShared ? !stdenv.hostPlatform.isStatic
+ }:
+
+stdenv.mkDerivation rec {
+  pname = "x264";
+  version = "20191217-2245";
+
+  src = fetchurl {
+    url = "https://download.videolan.org/x264/snapshots/x264-snapshot-${version}-stable.tar.bz2";
+    sha256 = "0q214q4rhbhigyx3dfhp6d5v5gzln01cxccl153ps5ih567mqjdj";
+  };
+
+  # Upstream ./configure greps for (-mcpu|-march|-mfpu) in CFLAGS, which in nix
+  # is put in the cc wrapper anyway.
+  patches = [ ./disable-arm-neon-default.patch ];
+
+  postPatch = ''
+    patchShebangs .
+  '';
+
+  enableParallelBuilding = true;
+
+  outputs = [ "out" "lib" "dev" ];
+
+  preConfigure = lib.optionalString (stdenv.buildPlatform.isx86_64 || stdenv.hostPlatform.isi686) ''
+    # `AS' is set to the binutils assembler, but we need nasm
+    unset AS
+  '' + lib.optionalString (stdenv.hostPlatform.isAarch64 || stdenv.hostPlatform.isAarch32) ''
+    export AS=$CC
+  '';
+
+  configureFlags = lib.optional enableShared "--enable-shared"
+    ++ lib.optional (!stdenv.isi686) "--enable-pic"
+    ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--cross-prefix=${stdenv.cc.targetPrefix}";
+
+  nativeBuildInputs = lib.optional (stdenv.hostPlatform.isx86_64 || stdenv.hostPlatform.isi686) nasm;
+
+  meta = with lib; {
+    description = "Library for encoding H264/AVC video streams";
+    homepage    = "http://www.videolan.org/developers/x264.html";
+    license     = licenses.gpl2;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ spwhitt tadeokondrak ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/x264/disable-arm-neon-default.patch b/nixpkgs/pkgs/development/libraries/x264/disable-arm-neon-default.patch
new file mode 100644
index 000000000000..6971944abb4f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/x264/disable-arm-neon-default.patch
@@ -0,0 +1,13 @@
+diff -Naur x264-snapshot-20190517-2245-stable-orig/configure x264-snapshot-20190517-2245-stable/configure
+--- x264-snapshot-20190517-2245-stable-orig/configure	2020-01-03 19:51:03.041037657 -0500
++++ x264-snapshot-20190517-2245-stable/configure	2020-01-03 19:52:15.075034609 -0500
+@@ -930,9 +930,6 @@
+ fi
+ 
+ if [ $asm = auto -a $ARCH = ARM ] ; then
+-    # set flags so neon is built by default
+-    [ $compiler == CL ] || echo $CFLAGS | grep -Eq '(-mcpu|-march|-mfpu)' || CFLAGS="$CFLAGS -mcpu=cortex-a8 -mfpu=neon"
+-
+     cc_check '' '' '__asm__("add r0, r1, r2");' && define HAVE_ARM_INLINE_ASM
+     if [ $compiler = CL ] && cpp_check '' '' 'defined(_M_ARM) && _M_ARM >= 7' ; then
+         define HAVE_ARMV6
diff --git a/nixpkgs/pkgs/development/libraries/x265/default.nix b/nixpkgs/pkgs/development/libraries/x265/default.nix
new file mode 100644
index 000000000000..495bbc4aaabb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/x265/default.nix
@@ -0,0 +1,104 @@
+{ lib, stdenv, fetchFromBitbucket, cmake, nasm, numactl
+, numaSupport ? stdenv.hostPlatform.isLinux && (stdenv.hostPlatform.isx86 || stdenv.hostPlatform.isAarch64)  # Enabled by default on NUMA platforms
+, debugSupport ? false # Run-time sanity checks (debugging)
+, werrorSupport ? false # Warnings as errors
+, ppaSupport ? false # PPA profiling instrumentation
+, vtuneSupport ? false # Vtune profiling instrumentation
+, custatsSupport ? false # Internal profiling of encoder work
+, cliSupport ? true # Build standalone CLI application
+, unittestsSupport ? false # Unit tests
+}:
+
+let
+  mkFlag = optSet: flag: if optSet then "-D${flag}=ON" else "-D${flag}=OFF";
+  inherit (stdenv) is64bit;
+
+  cmakeFlagsAll = [
+    "-DSTATIC_LINK_CRT=OFF"
+    (mkFlag debugSupport "CHECKED_BUILD")
+    (mkFlag ppaSupport "ENABLE_PPA")
+    (mkFlag vtuneSupport "ENABLE_VTUNE")
+    (mkFlag custatsSupport "DETAILED_CU_STATS")
+    (mkFlag unittestsSupport "ENABLE_TESTS")
+    (mkFlag werrorSupport "WARNINGS_AS_ERRORS")
+  ] ++ lib.optionals stdenv.hostPlatform.isPower [
+    "-DENABLE_ALTIVEC=OFF"
+  ];
+
+  version = "3.4";
+
+  src = fetchFromBitbucket {
+    owner = "multicoreware";
+    repo = "x265_git";
+    rev = version;
+    sha256 = "1jzgv2hxhcwmsdf6sbgyzm88a46dp09ll1fqj92g9vckvh9a7dsn";
+  };
+
+  buildLib = has12Bit: stdenv.mkDerivation rec {
+    name = "libx265-${if has12Bit then "12" else "10"}-${version}";
+    inherit src;
+
+    postPatch = ''
+      sed -i 's/unknown/${version}/g' source/cmake/version.cmake
+      sed -i 's/0.0/${version}/g' source/cmake/version.cmake
+    '';
+
+    cmakeLibFlags = [
+      "-DENABLE_CLI=OFF"
+      "-DENABLE_SHARED=OFF"
+      "-DENABLE_HDR10_PLUS=ON"
+      "-DEXPORT_C_API=OFF"
+      "-DHIGH_BIT_DEPTH=ON"
+    ];
+    cmakeFlags = [(mkFlag has12Bit "MAIN12")] ++ cmakeLibFlags ++ cmakeFlagsAll;
+
+    preConfigure = ''
+      cd source
+    '';
+
+    nativeBuildInputs = [cmake nasm] ++ lib.optional numaSupport numactl;
+  };
+
+  libx265-10 = buildLib false;
+  libx265-12 = buildLib true;
+in
+
+stdenv.mkDerivation rec {
+  pname = "x265";
+  inherit version src;
+
+  postPatch = ''
+    sed -i 's/unknown/${version}/g' source/cmake/version.cmake
+    sed -i 's/0.0/${version}/g' source/cmake/version.cmake
+  '';
+
+  cmakeFlags = [
+    "-DENABLE_SHARED=ON"
+    "-DHIGH_BIT_DEPTH=OFF"
+    "-DENABLE_HDR10_PLUS=OFF"
+  ] ++ lib.optionals (is64bit && !(stdenv.isAarch64 && stdenv.isLinux)) [
+    "-DEXTRA_LIB=${libx265-10}/lib/libx265.a;${libx265-12}/lib/libx265.a"
+    "-DLINKED_10BIT=ON"
+    "-DLINKED_12BIT=ON"
+  ] ++ [
+    (mkFlag cliSupport "ENABLE_CLI")
+  ] ++ cmakeFlagsAll;
+
+  preConfigure = ''
+    cd source
+  '';
+
+  postInstall = ''
+    rm $out/lib/*.a
+  '';
+
+  nativeBuildInputs = [ cmake nasm ] ++ lib.optional numaSupport numactl;
+
+  meta = with lib; {
+    description = "Library for encoding h.265/HEVC video streams";
+    homepage    = "http://x265.org";
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ codyopel ];
+    platforms   = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xalanc/default.nix b/nixpkgs/pkgs/development/libraries/xalanc/default.nix
new file mode 100644
index 000000000000..b757b737f976
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xalanc/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchurl, xercesc, getopt }:
+
+let
+  platform = if stdenv.isLinux then "linux" else
+             if stdenv.isDarwin then "macosx" else
+             throw "Unsupported platform";
+in stdenv.mkDerivation rec {
+  pname = "xalan-c";
+  version = "1.11";
+
+  src = fetchurl {
+    url = "http://www.eu.apache.org/dist/xalan/xalan-c/sources/xalan_c-${version}-src.tar.gz";
+    sha256 = "0a3a2b15vpacnqgpp6fiy1pwyc8q6ywzvyb5445f6wixfdspypjg";
+  };
+
+  configurePhase = ''
+    export XALANCROOT=`pwd`/c
+    cd `pwd`/c
+    mkdir -p $out
+    ./runConfigure -p ${platform} -c cc -x c++ -P$out
+  '';
+
+  buildInputs = [ xercesc getopt ];
+
+  meta = {
+    homepage = "http://xalan.apache.org/";
+    description = "A XSLT processor for transforming XML documents";
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
+    maintainers = [ lib.maintainers.jagajaga ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xapian/default.nix b/nixpkgs/pkgs/development/libraries/xapian/default.nix
new file mode 100644
index 000000000000..e2d049cd7b3c
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xapian/default.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchurl, autoreconfHook
+, libuuid, zlib }:
+
+let
+  generic = version: sha256: stdenv.mkDerivation {
+    pname = "xapian";
+    inherit version;
+    passthru = { inherit version; };
+
+    src = fetchurl {
+      url = "https://oligarchy.co.uk/xapian/${version}/xapian-core-${version}.tar.xz";
+      inherit sha256;
+    };
+
+    outputs = [ "out" "man" "doc" ];
+
+    buildInputs = [ libuuid zlib ];
+    nativeBuildInputs = [ autoreconfHook ];
+
+    doCheck = true;
+    AUTOMATED_TESTING = true; # https://trac.xapian.org/changeset/8be35f5e1/git
+
+    patches = lib.optionals stdenv.isDarwin [ ./skip-flaky-darwin-test.patch ];
+
+    # the configure script thinks that Darwin has ___exp10
+    # but it’s not available on my systems (or hydra apparently)
+    postConfigure = lib.optionalString stdenv.isDarwin ''
+      substituteInPlace config.h \
+        --replace "#define HAVE___EXP10 1" "#undef HAVE___EXP10"
+    '';
+
+    meta = with lib; {
+      description = "Search engine library";
+      homepage = "https://xapian.org/";
+      license = licenses.gpl2Plus;
+      maintainers = with maintainers; [ ];
+      platforms = platforms.unix;
+    };
+  };
+in {
+  xapian_1_4 = generic "1.4.18" "sha256-GW3btK0QRQEA8JkaWZ5O2UTLrZLkpv6BO+bc4WAkS3c=";
+}
diff --git a/nixpkgs/pkgs/development/libraries/xapian/skip-flaky-darwin-test.patch b/nixpkgs/pkgs/development/libraries/xapian/skip-flaky-darwin-test.patch
new file mode 100644
index 000000000000..d763a2a2b434
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xapian/skip-flaky-darwin-test.patch
@@ -0,0 +1,33 @@
+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
+@@ -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));
+ 
+     /* 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
+@@ -53,6 +53,7 @@
+ }
+ 
+ DEFINE_TESTCASE(bigoaddvalue1, writable) {
++    SKIP_TEST("Fails in darwin nix build environment");
+     // O(n*n) is bad, but O(n*log(n)) is acceptable.
+     test_scalability(bigoaddvalue1_helper, 5000, O_N_LOG_N);
+     return true;
+diff -Naur xapian-core.old/tests/api_serialise.cc xapian-core.new/tests/api_serialise.cc
+--- xapian-core.old/tests/api_serialise.cc
++++ xapian-core.new/tests/api_serialise.cc
+@@ -110,6 +110,7 @@
+ 
+ // Test for serialising a document obtained from a database.
+ DEFINE_TESTCASE(serialise_document2, writable) {
++    SKIP_TEST("Fails in darwin nix build environment");
+     Xapian::Document origdoc;
+     origdoc.add_term("foo", 2);
+     origdoc.add_posting("foo", 10);
diff --git a/nixpkgs/pkgs/development/libraries/xapian/tools/omega/default.nix b/nixpkgs/pkgs/development/libraries/xapian/tools/omega/default.nix
new file mode 100644
index 000000000000..79e5786f0488
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xapian/tools/omega/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, pkg-config, xapian, perl, pcre, zlib, libmagic }:
+
+stdenv.mkDerivation rec {
+  pname = "xapian-omega";
+  inherit (xapian) version;
+
+  src = fetchurl {
+    url = "https://oligarchy.co.uk/xapian/${version}/xapian-omega-${version}.tar.xz";
+    sha256 = "0zji8ckp4h5xdy2wbir3lvk680w1g1l4h5swmaxsx7ah12lkrjcr";
+  };
+
+  buildInputs = [ xapian perl pcre zlib libmagic ];
+  nativeBuildInputs = [ pkg-config ];
+
+  meta = with lib; {
+    description = "Indexer and CGI search front-end built on Xapian library";
+    homepage = "https://xapian.org/";
+    license = licenses.gpl2Plus;
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xavs/default.nix b/nixpkgs/pkgs/development/libraries/xavs/default.nix
new file mode 100644
index 000000000000..11d73a9decb7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xavs/default.nix
@@ -0,0 +1,48 @@
+{ lib, stdenv, fetchsvn }:
+
+stdenv.mkDerivation rec {
+  pname = "xavs";
+  version = "55";
+
+  src = fetchsvn {
+    url = "https://svn.code.sf.net/p/xavs/code/trunk";
+    rev = version;
+    sha256 = "0drw16wm95dqszpl7j33y4gckz0w0107lnz6wkzb66f0dlbv48cf";
+  };
+
+  enableParallelBuilding = true;
+
+  patchPhase = ''
+    patchShebangs configure
+    patchShebangs config.sub
+    patchShebangs version.sh
+    patchShebangs tools/countquant_xavs.pl
+    patchShebangs tools/patcheck
+    patchShebangs tools/regression-test.pl
+    patchShebangs tools/xavs-format
+    '' + lib.optionalString stdenv.isDarwin ''
+    substituteInPlace config.guess --replace 'uname -p' 'uname -m'
+    substituteInPlace configure \
+      --replace '-O4' '-O3' \
+      --replace ' -s ' ' ' \
+      --replace 'LDFLAGS -s' 'LDFLAGS' \
+      --replace '-dynamiclib' ' ' \
+      --replace '-falign-loops=16' ' '
+    substituteInPlace Makefile --replace '-Wl,-soname,' ' '
+    '';
+
+  configureFlags = [
+    "--enable-pic"
+    "--enable-shared"
+    # Bug preventing compilation with assembly enabled
+    "--disable-asm"
+  ];
+
+  meta = with lib; {
+    description = "AVS encoder and decoder";
+    homepage    = "http://xavs.sourceforge.net/";
+    license     = licenses.lgpl2;
+    platforms   = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ codyopel ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xbase/default.nix b/nixpkgs/pkgs/development/libraries/xbase/default.nix
new file mode 100644
index 000000000000..dd5cd21d405f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xbase/default.nix
@@ -0,0 +1,35 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "xbase";
+  version = "3.1.2";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xdb/xbase64-${version}.tar.gz";
+    sha256 = "17287kz1nmmm64y7zp9nhhl7slzlba09h6cc83w4mvsqwd9w882r";
+  };
+
+  prePatch = "find . -type f -not -name configure -print0 | xargs -0 chmod -x";
+  patches = [
+    ./xbase-fixes.patch
+    (fetchurl {
+      url = "http://sources.gentoo.org/cgi-bin/viewvc.cgi/gentoo-x86/dev-db/xbase/files/xbase-3.1.2-gcc47.patch?revision=1.1";
+      sha256 = "1kpcrkkcqdwl609yd0qxlvp743icz3vni13993sz6fkgn5lah8yl";
+    })
+    (fetchurl {
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-db/xbase/files/xbase-3.1.2-gcc6.patch";
+      sha256 = "1994pqiip5njkcmm5czb1bg6zdldkx1mpandgmvzqrja0iacf953";
+    })
+    (fetchurl {
+      url = "https://gitweb.gentoo.org/repo/gentoo.git/plain/dev-db/xbase/files/xbase-3.1.2-gcc7.patch";
+      sha256 = "1304gn9dbdv8xf61crkg0fc8cal0h4qkyhlbqa8y618w134cxh1q";
+    })
+  ];
+
+  meta = with lib; {
+    homepage = "http://linux.techass.com/projects/xdb/";
+    description = "C++ class library formerly known as XDB";
+    platforms = platforms.linux;
+    license = licenses.lgpl2;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xbase/xbase-fixes.patch b/nixpkgs/pkgs/development/libraries/xbase/xbase-fixes.patch
new file mode 100644
index 000000000000..a23658049b98
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xbase/xbase-fixes.patch
@@ -0,0 +1,34 @@
+diff --git a/xbase64/xbase64.cpp b/xbase64/xbase64.cpp
+index fc5613d..2449535 100644
+--- a/xbase64/xbase64.cpp
++++ b/xbase64/xbase64.cpp
+@@ -51,6 +51,7 @@
+ #include <xbase64/xbase64.h>
+ #include <ctype.h>
+ #include <string.h>
++#include <cerrno>
+ 
+ //#include <xbase64/xbexcept.h>
+ 
+diff --git a/xbase64/xblock.cpp b/xbase64/xblock.cpp
+index c44cbb9..3554fc1 100644
+--- a/xbase64/xblock.cpp
++++ b/xbase64/xblock.cpp
+@@ -53,6 +53,7 @@
+ #endif
+ 
+ #include <xbase64/xbase64.h>
++#include <cerrno>
+ 
+ #ifdef HAVE_IO_H     // windows locking
+ #include <io.h>
+diff --git a/xbase64/xbnode.cpp b/xbase64/xbnode.cpp
+index 5e688c1..3c652b3 100644
+--- a/xbase64/xbnode.cpp
++++ b/xbase64/xbnode.cpp
+@@ -1,4 +1,4 @@
+-#include "xbNode.h"

++#include "xbnode.h"

+ 

+ void xbNodeLink::AddNode(xbNodeLink* node)

+ {

diff --git a/nixpkgs/pkgs/development/libraries/xcb-imdkit/default.nix b/nixpkgs/pkgs/development/libraries/xcb-imdkit/default.nix
new file mode 100644
index 000000000000..b2e56c8193b5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xcb-imdkit/default.nix
@@ -0,0 +1,41 @@
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, extra-cmake-modules
+, uthash
+, xcbutil
+, xcbutilkeysyms
+, xorgproto
+}:
+
+stdenv.mkDerivation rec {
+  pname = "xcb-imdkit";
+  version = "1.0.3";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = "xcb-imdkit";
+    rev = version;
+    sha256 = "sha256-IPuTRSgmrnCJRgGWcE4JRaxd0sGCcHrKRnn2B1OdDMU=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    extra-cmake-modules
+    xorgproto
+    uthash
+  ];
+
+  buildInputs = [
+    xcbutil
+    xcbutilkeysyms
+  ];
+
+  meta = with lib; {
+    description = "input method development support for xcb";
+    homepage = "https://github.com/fcitx/xcb-imdkit";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ poscat ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xcb-util-cursor/HEAD.nix b/nixpkgs/pkgs/development/libraries/xcb-util-cursor/HEAD.nix
new file mode 100644
index 000000000000..f296f59d408b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xcb-util-cursor/HEAD.nix
@@ -0,0 +1,42 @@
+{ lib, stdenv, fetchgit, autoconf, automake, libtool, pkg-config
+, xorg, gnum4, libxcb, gperf }:
+
+stdenv.mkDerivation {
+  pname = "xcb-util-cursor-0.1.1-3-unstable";
+  version = "2017-04-05";
+
+  src = fetchgit {
+    url    = "http://anongit.freedesktop.org/git/xcb/util-cursor.git";
+    rev    = "f03cc278c6cce0cf721adf9c3764d3c5fba63392";
+    sha256 = "127zfmihd8nqlj8jjaja06xb84xdgl263w0av1xnprx05mkbkcyc";
+  };
+
+  meta = with lib; {
+    description = "XCB cursor library (libxcursor port)";
+    homepage    = "https://cgit.freedesktop.org/xcb/util-cursor";
+    license     = licenses.mit;
+    maintainers = with maintainers; [ lovek323 ];
+    platforms   = platforms.linux ++ platforms.darwin;
+  };
+
+  outputs = [ "out" "dev" ];
+
+  buildInputs = [
+    autoconf
+    automake
+    gnum4
+    gperf
+    libtool
+    libxcb
+    pkg-config
+    xorg.utilmacros
+    xorg.xcbutilimage
+    xorg.xcbutilrenderutil
+  ];
+
+  configurePhase = ''
+    sed -i '15 i\
+      LT_INIT' configure.ac
+    ${stdenv.shell} autogen.sh --prefix="$out"
+  '';
+}
diff --git a/nixpkgs/pkgs/development/libraries/xcb-util-cursor/m4/ax_compare_version.m4 b/nixpkgs/pkgs/development/libraries/xcb-util-cursor/m4/ax_compare_version.m4
new file mode 100644
index 000000000000..e22b50fd9fdc
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xcb-util-cursor/m4/ax_compare_version.m4
@@ -0,0 +1,174 @@
+# ===========================================================================
+#           http://autoconf-archive.cryp.to/ax_compare_version.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_COMPARE_VERSION(VERSION_A, OP, VERSION_B, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
+#
+# DESCRIPTION
+#
+#   This macro compares two version strings. Due to the various number of
+#   minor-version numbers that can exist, and the fact that string
+#   comparisons are not compatible with numeric comparisons, this is not
+#   necessarily trivial to do in a autoconf script. This macro makes doing
+#   these comparisons easy.
+#
+#   The six basic comparisons are available, as well as checking equality
+#   limited to a certain number of minor-version levels.
+#
+#   The operator OP determines what type of comparison to do, and can be one
+#   of:
+#
+#    eq  - equal (test A == B)
+#    ne  - not equal (test A != B)
+#    le  - less than or equal (test A <= B)
+#    ge  - greater than or equal (test A >= B)
+#    lt  - less than (test A < B)
+#    gt  - greater than (test A > B)
+#
+#   Additionally, the eq and ne operator can have a number after it to limit
+#   the test to that number of minor versions.
+#
+#    eq0 - equal up to the length of the shorter version
+#    ne0 - not equal up to the length of the shorter version
+#    eqN - equal up to N sub-version levels
+#    neN - not equal up to N sub-version levels
+#
+#   When the condition is true, shell commands ACTION-IF-TRUE are run,
+#   otherwise shell commands ACTION-IF-FALSE are run. The environment
+#   variable 'ax_compare_version' is always set to either 'true' or 'false'
+#   as well.
+#
+#   Examples:
+#
+#     AX_COMPARE_VERSION([3.15.7],[lt],[3.15.8])
+#     AX_COMPARE_VERSION([3.15],[lt],[3.15.8])
+#
+#   would both be true.
+#
+#     AX_COMPARE_VERSION([3.15.7],[eq],[3.15.8])
+#     AX_COMPARE_VERSION([3.15],[gt],[3.15.8])
+#
+#   would both be false.
+#
+#     AX_COMPARE_VERSION([3.15.7],[eq2],[3.15.8])
+#
+#   would be true because it is only comparing two minor versions.
+#
+#     AX_COMPARE_VERSION([3.15.7],[eq0],[3.15])
+#
+#   would be true because it is only comparing the lesser number of minor
+#   versions of the two values.
+#
+#   Note: The characters that separate the version numbers do not matter. An
+#   empty string is the same as version 0. OP is evaluated by autoconf, not
+#   configure, so must be a string, not a variable.
+#
+#   The author would like to acknowledge Guido Draheim whose advice about
+#   the m4_case and m4_ifvaln functions make this macro only include the
+#   portions necessary to perform the specific comparison specified by the
+#   OP argument in the final configure script.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Tim Toolan <toolan@ele.uri.edu>
+#
+#   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.
+
+dnl #########################################################################
+AC_DEFUN([AX_COMPARE_VERSION], [
+  AC_PROG_AWK
+
+  # Used to indicate true or false condition
+  ax_compare_version=false
+
+  # Convert the two version strings to be compared into a format that
+  # allows a simple string comparison.  The end result is that a version
+  # string of the form 1.12.5-r617 will be converted to the form
+  # 0001001200050617.  In other words, each number is zero padded to four
+  # digits, and non digits are removed.
+  AS_VAR_PUSHDEF([A],[ax_compare_version_A])
+  A=`echo "$1" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
+                     -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/[[^0-9]]//g'`
+
+  AS_VAR_PUSHDEF([B],[ax_compare_version_B])
+  B=`echo "$3" | sed -e 's/\([[0-9]]*\)/Z\1Z/g' \
+                     -e 's/Z\([[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([[0-9]][[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/Z\([[0-9]][[0-9]][[0-9]]\)Z/Z0\1Z/g' \
+                     -e 's/[[^0-9]]//g'`
+
+  dnl # In the case of le, ge, lt, and gt, the strings are sorted as necessary
+  dnl # then the first line is used to determine if the condition is true.
+  dnl # The sed right after the echo is to remove any indented white space.
+  m4_case(m4_tolower($2),
+  [lt],[
+    ax_compare_version=`echo "x$A
+x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/false/;s/x${B}/true/;1q"`
+  ],
+  [gt],[
+    ax_compare_version=`echo "x$A
+x$B" | sed 's/^ *//' | sort | sed "s/x${A}/false/;s/x${B}/true/;1q"`
+  ],
+  [le],[
+    ax_compare_version=`echo "x$A
+x$B" | sed 's/^ *//' | sort | sed "s/x${A}/true/;s/x${B}/false/;1q"`
+  ],
+  [ge],[
+    ax_compare_version=`echo "x$A
+x$B" | sed 's/^ *//' | sort -r | sed "s/x${A}/true/;s/x${B}/false/;1q"`
+  ],[
+    dnl Split the operator from the subversion count if present.
+    m4_bmatch(m4_substr($2,2),
+    [0],[
+      # A count of zero means use the length of the shorter version.
+      # Determine the number of characters in A and B.
+      ax_compare_version_len_A=`echo "$A" | $AWK '{print(length)}'`
+      ax_compare_version_len_B=`echo "$B" | $AWK '{print(length)}'`
+
+      # Set A to no more than B's length and B to no more than A's length.
+      A=`echo "$A" | sed "s/\(.\{$ax_compare_version_len_B\}\).*/\1/"`
+      B=`echo "$B" | sed "s/\(.\{$ax_compare_version_len_A\}\).*/\1/"`
+    ],
+    [[0-9]+],[
+      # A count greater than zero means use only that many subversions
+      A=`echo "$A" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
+      B=`echo "$B" | sed "s/\(\([[0-9]]\{4\}\)\{m4_substr($2,2)\}\).*/\1/"`
+    ],
+    [.+],[
+      AC_WARNING(
+        [illegal OP numeric parameter: $2])
+    ],[])
+
+    # Pad zeros at end of numbers to make same length.
+    ax_compare_version_tmp_A="$A`echo $B | sed 's/./0/g'`"
+    B="$B`echo $A | sed 's/./0/g'`"
+    A="$ax_compare_version_tmp_A"
+
+    # Check for equality or inequality as necessary.
+    m4_case(m4_tolower(m4_substr($2,0,2)),
+    [eq],[
+      test "x$A" = "x$B" && ax_compare_version=true
+    ],
+    [ne],[
+      test "x$A" != "x$B" && ax_compare_version=true
+    ],[
+      AC_WARNING([illegal OP parameter: $2])
+    ])
+  ])
+
+  AS_VAR_POPDEF([A])dnl
+  AS_VAR_POPDEF([B])dnl
+
+  dnl # Execute ACTION-IF-TRUE / ACTION-IF-FALSE.
+  if test "$ax_compare_version" = "true" ; then
+    m4_ifvaln([$4],[$4],[:])dnl
+    m4_ifvaln([$5],[else $5])dnl
+  fi
+]) dnl AX_COMPARE_VERSION
diff --git a/nixpkgs/pkgs/development/libraries/xcb-util-cursor/m4/xcb_util_common.m4 b/nixpkgs/pkgs/development/libraries/xcb-util-cursor/m4/xcb_util_common.m4
new file mode 100644
index 000000000000..f9463d37fcaa
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xcb-util-cursor/m4/xcb_util_common.m4
@@ -0,0 +1,44 @@
+# XCB_UTIL_COMMON(xcb-required-version, xcb-proto-required-version)
+# -----------------------------------------------------------------
+#
+# Defines default options for xcb-util libraries.  xorg/util/macros >=
+# 1.6.0 is  required for  cross-platform compiler  flags and  to build
+# library documentation.
+#
+AC_DEFUN([XCB_UTIL_COMMON], [
+m4_ifndef([AX_COMPARE_VERSION],
+          [m4_fatal([could not find AX_COMPARE_VERSION in macros search path])])
+
+AC_REQUIRE([AC_PROG_LIBTOOL])
+
+# Define header files and pkgconfig paths
+xcbincludedir='${includedir}/xcb'
+AC_SUBST(xcbincludedir)
+pkgconfigdir='${libdir}/pkgconfig'
+AC_SUBST(pkgconfigdir)
+
+# Check xcb version
+PKG_CHECK_MODULES(XCB, xcb >= [$1])
+
+# Check version of xcb-proto that xcb was compiled against
+xcbproto_required=[$2]
+
+AC_MSG_CHECKING([whether libxcb was compiled against xcb-proto >= $xcbproto_required])
+xcbproto_version=`$PKG_CONFIG --variable=xcbproto_version xcb`
+AX_COMPARE_VERSION([$xcbproto_version],[ge],[$xcbproto_required], xcbproto_ok="yes",
+                   xcbproto_ok="no")
+AC_MSG_RESULT([$xcbproto_ok])
+
+if test $xcbproto_ok = no; then
+   AC_MSG_ERROR([libxcb was compiled against xcb-proto $xcbproto_version; it needs to be compiled against version $xcbproto_required or higher])
+fi
+
+# Call macros from Xorg util-macros
+m4_ifndef([XORG_MACROS_VERSION],
+          [m4_fatal([must install xorg-macros 1.6.0 or later before running autoconf/autogen])])
+
+XORG_MACROS_VERSION([1.6.0])
+XORG_DEFAULT_OPTIONS
+XORG_ENABLE_DEVEL_DOCS
+XORG_WITH_DOXYGEN
+]) # XCB_UTIL_COMMON
diff --git a/nixpkgs/pkgs/development/libraries/xcb-util-cursor/m4/xcb_util_m4_with_include_path.m4 b/nixpkgs/pkgs/development/libraries/xcb-util-cursor/m4/xcb_util_m4_with_include_path.m4
new file mode 100644
index 000000000000..a3ddce4a706f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xcb-util-cursor/m4/xcb_util_m4_with_include_path.m4
@@ -0,0 +1,24 @@
+# XCB_UTIL_M4_WITH_INCLUDE_PATH
+# ------------------------------
+#
+# This macro attempts to locate an m4 macro processor which supports
+# -I option and is only useful for modules relying on M4 in order to
+# expand macros in source code files.
+#
+# M4: variable holding the path to an usable m4 program.
+#
+# This macro  requires Autoconf 2.62  or later  as it is  relying upon
+# AC_PATH_PROGS_FEATURE_CHECK  macro. NOTE:  As  soon  as the  minimum
+# required version of Autoconf for Xorg  is bumped to 2.62, this macro
+# is supposed to be shipped with xorg/util/macros.
+#
+AC_DEFUN([XCB_UTIL_M4_WITH_INCLUDE_PATH], [
+AC_CACHE_CHECK([for m4 that supports -I option], [ac_cv_path_M4],
+   [AC_PATH_PROGS_FEATURE_CHECK([M4], [m4 gm4],
+       [[$ac_path_M4 -I. /dev/null > /dev/null 2>&1 && \
+         ac_cv_path_M4=$ac_path_M4 ac_path_M4_found=:]],
+   [AC_MSG_ERROR([could not find m4 that supports -I option])],
+   [$PATH:/usr/gnu/bin])])
+
+AC_SUBST([M4], [$ac_cv_path_M4])
+]) # XCB_UTIL_M4_WITH_INCLUDE_PATH
diff --git a/nixpkgs/pkgs/development/libraries/xdg-dbus-proxy/default.nix b/nixpkgs/pkgs/development/libraries/xdg-dbus-proxy/default.nix
new file mode 100644
index 000000000000..21d6b6fa73e8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xdg-dbus-proxy/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv
+, fetchurl
+, pkg-config
+, libxslt
+, docbook_xsl
+, docbook_xml_dtd_43
+, dbus
+, glib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "xdg-dbus-proxy";
+  version = "0.1.2";
+
+  src = fetchurl {
+    url = "https://github.com/flatpak/xdg-dbus-proxy/releases/download/${version}/${pname}-${version}.tar.xz";
+    sha256 = "03sj1h0c2l08xa8phw013fnxr4fgav7l2mkjhzf9xk3dykwxcj8p";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    libxslt
+    docbook_xsl
+    docbook_xml_dtd_43
+  ];
+
+  buildInputs = [
+    glib
+  ];
+
+  checkInputs = [
+    dbus
+  ];
+
+  configureFlags = [
+    "--enable-man"
+  ];
+
+  # dbus[2345]: Failed to start message bus: Failed to open "/etc/dbus-1/session.conf": No such file or directory
+  doCheck = false;
+
+  meta = with lib; {
+    description = "DBus proxy for Flatpak and others";
+    homepage = "https://github.com/flatpak/xdg-dbus-proxy";
+    license = licenses.lgpl21Plus;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xdg-desktop-portal-gtk/default.nix b/nixpkgs/pkgs/development/libraries/xdg-desktop-portal-gtk/default.nix
new file mode 100644
index 000000000000..93a308a658da
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xdg-desktop-portal-gtk/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, pkg-config
+, libxml2
+, xdg-desktop-portal
+, gtk3
+, gnome
+, glib
+, wrapGAppsHook
+, gsettings-desktop-schemas
+}:
+
+stdenv.mkDerivation rec {
+  pname = "xdg-desktop-portal-gtk";
+  version = "1.8.0";
+
+  src = fetchFromGitHub {
+    owner = "flatpak";
+    repo = pname;
+    rev = version;
+    sha256 = "0987fwsdgkcd3mh3scvg2kyg4ay1rr5w16js4pl3pavw9yhl9lbi";
+  };
+
+  nativeBuildInputs = [
+    autoreconfHook
+    libxml2
+    pkg-config
+    wrapGAppsHook
+    xdg-desktop-portal
+  ];
+
+  buildInputs = [
+    glib
+    gsettings-desktop-schemas # settings exposed by settings portal
+    gtk3
+    gnome.gnome-desktop
+    gnome.gnome-settings-daemon # schemas needed for settings api (mostly useless now that fonts were moved to g-d-s)
+  ];
+
+  meta = with lib; {
+    description = "Desktop integration portals for sandboxed apps";
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.linux;
+    license = licenses.lgpl2Plus;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xdg-desktop-portal-wlr/default.nix b/nixpkgs/pkgs/development/libraries/xdg-desktop-portal-wlr/default.nix
new file mode 100644
index 000000000000..4f842e5de186
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xdg-desktop-portal-wlr/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub, makeWrapper
+, meson, ninja, pkg-config, wayland-protocols
+, pipewire, wayland, systemd, libdrm, inih, scdoc, grim, slurp }:
+
+stdenv.mkDerivation rec {
+  pname = "xdg-desktop-portal-wlr";
+  version = "0.4.0";
+
+  src = fetchFromGitHub {
+    owner = "emersion";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256:13fbzh8bjnhk4xs8j9bpc01q3hy27zpbf0gkk1fnh3hm5pnyfyiv";
+  };
+
+  nativeBuildInputs = [ meson ninja pkg-config wayland-protocols makeWrapper ];
+  buildInputs = [ pipewire wayland systemd libdrm inih scdoc ];
+
+  mesonFlags = [
+    "-Dsd-bus-provider=libsystemd"
+  ];
+
+  postInstall = ''
+    wrapProgram $out/libexec/xdg-desktop-portal-wlr --prefix PATH ":" ${lib.makeBinPath [ grim slurp ]}
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/emersion/xdg-desktop-portal-wlr";
+    description = "xdg-desktop-portal backend for wlroots";
+    maintainers = with maintainers; [ minijackson ];
+    platforms = platforms.linux;
+    license = licenses.mit;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix b/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix
new file mode 100644
index 000000000000..2b425300b31e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix
@@ -0,0 +1,83 @@
+{ lib, stdenv
+, fetchFromGitHub
+, nixosTests
+, substituteAll
+, autoreconfHook
+, pkg-config
+, libxml2
+, glib
+, pipewire
+, flatpak
+, gsettings-desktop-schemas
+, acl
+, dbus
+, fuse
+, libportal
+, geoclue2
+, json-glib
+, wrapGAppsHook
+}:
+
+stdenv.mkDerivation rec {
+  pname = "xdg-desktop-portal";
+  version = "1.8.1";
+
+  outputs = [ "out" "installedTests" ];
+
+  src = fetchFromGitHub {
+    owner = "flatpak";
+    repo = pname;
+    rev = version;
+    sha256 = "sha256-tuRKCBj9ELC7yFPs/Sut/EdO+L8nwW3S8NWU+XedAF8=";
+  };
+
+  patches = [
+    # Hardcode paths used by x-d-p itself.
+    (substituteAll {
+      src = ./fix-paths.patch;
+      inherit flatpak;
+    })
+  ];
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+    libxml2
+    wrapGAppsHook
+  ];
+
+  buildInputs = [
+    glib
+    pipewire
+    flatpak
+    acl
+    dbus
+    geoclue2
+    fuse
+    libportal
+    gsettings-desktop-schemas
+    json-glib
+  ];
+
+  configureFlags = [
+    "--enable-installed-tests"
+  ];
+
+  makeFlags = [
+    "installed_testdir=${placeholder "installedTests"}/libexec/installed-tests/xdg-desktop-portal"
+    "installed_test_metadir=${placeholder "installedTests"}/share/installed-tests/xdg-desktop-portal"
+  ];
+
+  passthru = {
+    tests = {
+      installedTests = nixosTests.installed-tests.xdg-desktop-portal;
+    };
+  };
+
+  meta = with lib; {
+    description = "Desktop integration portals for sandboxed apps";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ jtojnar ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/fix-paths.patch b/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/fix-paths.patch
new file mode 100644
index 000000000000..98e26e88b5ce
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/fix-paths.patch
@@ -0,0 +1,13 @@
+diff --git a/src/notification.c b/src/notification.c
+index 5412609..4243e98 100644
+--- a/src/notification.c
++++ b/src/notification.c
+@@ -366,7 +366,7 @@
+   int status;
+   g_autofree char *err = NULL;
+   g_autoptr(GError) error = NULL;
+-  const char *icon_validator = LIBEXECDIR "/flatpak-validate-icon";
++  const char *icon_validator = "@flatpak@/libexec/flatpak-validate-icon";
+   const char *args[6];
+ 
+   if (G_IS_THEMED_ICON (icon))
diff --git a/nixpkgs/pkgs/development/libraries/xed/default.nix b/nixpkgs/pkgs/development/libraries/xed/default.nix
new file mode 100644
index 000000000000..395b399d8fe2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xed/default.nix
@@ -0,0 +1,46 @@
+{ lib, stdenv, fetchFromGitHub, python3Packages }:
+
+let
+  # mbuild is a custom build system used only to build xed
+  mbuild = python3Packages.buildPythonPackage rec {
+    pname = "mbuild";
+    version = "0.2496-dev";
+
+    src = fetchFromGitHub {
+      owner = "intelxed";
+      repo = "mbuild";
+      rev = "3e8eb33aada4153c21c4261b35e5f51f6e2019e8";
+      sha256 = "0yamgzkzw4v6x1a857psw9f7i62ydgd0zaqrf33dbdg8hfd2mq3q";
+    };
+  };
+
+in stdenv.mkDerivation rec {
+  pname = "xed";
+  version = "12.0.1";
+
+  src = fetchFromGitHub {
+    owner = "intelxed";
+    repo = "xed";
+    rev = version;
+    sha256 = "07zfff8zf29c2n0wal87hiqfq3cwcjn80zz78mz0nyjfj09nd39f";
+  };
+
+  nativeBuildInputs = [ mbuild ];
+
+  buildPhase = ''
+    patchShebangs mfile.py
+
+    # this will build, test and install
+    ./mfile.py test --prefix $out
+  '';
+
+  dontInstall = true; # already installed during buildPhase
+
+  meta = with lib; {
+    description = "Intel X86 Encoder Decoder (Intel XED)";
+    homepage    = "https://intelxed.github.io/";
+    license     = licenses.apsl20;
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ arturcygan ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xercesc/default.nix b/nixpkgs/pkgs/development/libraries/xercesc/default.nix
new file mode 100644
index 000000000000..f5109a1ebd6a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xercesc/default.nix
@@ -0,0 +1,22 @@
+{ lib, stdenv, fetchurl }:
+
+stdenv.mkDerivation rec {
+  pname = "xerces-c";
+  version = "3.2.3";
+
+  src = fetchurl {
+    url = "mirror://apache/xerces/c/3/sources/${pname}-${version}.tar.gz";
+    sha256 = "0zicsydx6s7carwr7q0csgkg1xncibd6lfp5chg2v2gvn54zr5pv";
+  };
+
+  # Disable SSE2 extensions on platforms for which they are not enabled by default
+  configureFlags = [ "--disable-sse2" ];
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "https://xerces.apache.org/xerces-c/";
+    description = "Validating XML parser written in a portable subset of C++";
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xgboost/default.nix b/nixpkgs/pkgs/development/libraries/xgboost/default.nix
new file mode 100644
index 000000000000..26872565de8f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xgboost/default.nix
@@ -0,0 +1,58 @@
+{ config
+, stdenv
+, lib
+, fetchFromGitHub
+, cmake
+, gtest
+, doCheck ? true
+, cudaSupport ? config.cudaSupport or false
+, cudatoolkit
+, ncclSupport ? false
+, nccl
+, llvmPackages
+}:
+
+assert ncclSupport -> cudaSupport;
+
+stdenv.mkDerivation rec {
+  pname = "xgboost";
+  version = "1.4.1";
+
+  src = fetchFromGitHub {
+    owner = "dmlc";
+    repo = pname;
+    rev = "v${version}";
+    fetchSubmodules = true;
+    sha256 = "12b1417dg8jqyxd72kg5a3xhg5h11vz0k7bkv72mzrv83jvgn5ci";
+  };
+
+  nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.isDarwin llvmPackages.openmp;
+
+  buildInputs = [ gtest ] ++ lib.optional cudaSupport cudatoolkit
+                ++ lib.optional ncclSupport nccl;
+
+  cmakeFlags = lib.optionals doCheck [ "-DGOOGLE_TEST=ON" ]
+    ++ lib.optionals cudaSupport [ "-DUSE_CUDA=ON" "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc" ]
+    ++ lib.optionals ncclSupport [ "-DUSE_NCCL=ON" ];
+
+  inherit doCheck;
+
+  installPhase = let
+    libname = "libxgboost${stdenv.hostPlatform.extensions.sharedLibrary}";
+  in ''
+    runHook preInstall
+    mkdir -p $out
+    cp -r ../include $out
+    install -Dm755 ../lib/${libname} $out/lib/${libname}
+    install -Dm755 ../xgboost $out/bin/xgboost
+    runHook postInstall
+  '';
+
+  meta = with lib; {
+    description = "Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) Library";
+    homepage = "https://github.com/dmlc/xgboost";
+    license = licenses.asl20;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xine-lib/default.nix b/nixpkgs/pkgs/development/libraries/xine-lib/default.nix
new file mode 100644
index 000000000000..70fdf24dd9f4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xine-lib/default.nix
@@ -0,0 +1,80 @@
+{ lib
+, stdenv
+, fetchurl
+, aalib
+, alsa-lib
+, ffmpeg
+, flac
+, libGL
+, libGLU
+, libcaca
+, libcdio
+, libmng
+, libmpcdec
+, libpulseaudio
+, libtheora
+, libv4l
+, libvorbis
+, ncurses
+, perl
+, pkg-config
+, speex
+, vcdimager
+, xorg
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "xine-lib";
+  version = "1.2.11";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xine/xine-lib-${version}.tar.xz";
+    sha256 = "sha256-71GyHRDdoQRfp9cRvZFxz9rwpaKHQjO88W/98o7AcAU=";
+  };
+
+  nativeBuildInputs = [
+    pkg-config
+    perl
+  ];
+  buildInputs = [
+    aalib
+    alsa-lib
+    ffmpeg
+    flac
+    libGL
+    libGLU
+    libcaca
+    libcdio
+    libmng
+    libmpcdec
+    libpulseaudio
+    libtheora
+    libv4l
+    libvorbis
+    ncurses
+    perl
+    speex
+    vcdimager
+    zlib
+  ] ++ (with xorg; [
+    libX11
+    libXext
+    libXinerama
+    libXv
+    libxcb
+  ]);
+
+  enableParallelBuilding = true;
+
+  NIX_LDFLAGS = "-lxcb-shm";
+
+
+  meta = with lib; {
+    homepage = "http://www.xinehq.de/";
+    description = "A high-performance, portable and reusable multimedia playback engine";
+    license = with licenses; [ gpl2Plus lgpl2Plus ];
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xlibs-wrapper/default.nix b/nixpkgs/pkgs/development/libraries/xlibs-wrapper/default.nix
new file mode 100644
index 000000000000..5340306de79a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xlibs-wrapper/default.nix
@@ -0,0 +1,21 @@
+{lib, stdenv, packages}:
+
+stdenv.mkDerivation {
+  name = "xlibs-wrapper";
+
+  dontBuild = true;
+
+  installPhase = "mkdir -p $out";
+  unpackPhase = "sourceRoot=.";
+
+  propagatedBuildInputs = packages;
+
+  preferLocalBuild = true;
+
+  # For compatability with XFree86.
+  passthru.buildClientLibs = true;
+
+  meta = {
+    platforms = lib.platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xlslib/default.nix b/nixpkgs/pkgs/development/libraries/xlslib/default.nix
new file mode 100644
index 000000000000..77a11b531100
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xlslib/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchurl, autoreconfHook, unzip }:
+
+stdenv.mkDerivation rec {
+  pname = "xlslib";
+  version = "2.5.0";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xlslib/xlslib-package-${version}.zip";
+    sha256 = "1wx3jbpkz2rvgs45x6mwawamd1b2llb0vn29b5sr0rfxzx9d1985";
+  };
+
+  nativeBuildInputs = [ unzip autoreconfHook ];
+
+  setSourceRoot = "export sourceRoot=xlslib/xlslib";
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "C++/C library to construct Excel .xls files in code";
+    homepage = "https://sourceforge.net/projects/xlslib/";
+    license = licenses.bsd2;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xml-security-c/default.nix b/nixpkgs/pkgs/development/libraries/xml-security-c/default.nix
new file mode 100644
index 000000000000..7548a45e5d41
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xml-security-c/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchurl, xalanc, xercesc, openssl, pkg-config }:
+
+stdenv.mkDerivation rec {
+  pname = "xml-security-c";
+  version = "2.0.2";
+
+  src = fetchurl {
+    url = "https://www.apache.org/dist/santuario/c-library/${pname}-${version}.tar.gz";
+    sha256 = "1prh5sxzipkqglpsh53iblbr7rxi54wbijxdjiahzjmrijqa40y3";
+  };
+
+  configureFlags = [
+    "--with-openssl"
+    "--with-xerces"
+    "--with-xalan"
+  ];
+
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ xalanc xercesc openssl ];
+
+  meta = {
+    homepage = "http://santuario.apache.org/";
+    description = "C++ Implementation of W3C security standards for XML";
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.unix;
+    maintainers = [ lib.maintainers.jagajaga ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xml-tooling-c/default.nix b/nixpkgs/pkgs/development/libraries/xml-tooling-c/default.nix
new file mode 100644
index 000000000000..9cf3ddb92190
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xml-tooling-c/default.nix
@@ -0,0 +1,26 @@
+{ lib, stdenv, fetchgit, autoreconfHook, pkg-config
+, boost, curl, openssl, log4shib, xercesc, xml-security-c
+}:
+
+stdenv.mkDerivation rec {
+  pname = "xml-tooling-c";
+  version = "3.0.4";
+
+  src = fetchgit {
+    url = "https://git.shibboleth.net/git/cpp-xmltooling.git";
+    rev = version;
+    sha256 = "0frj4w70l06nva6dvdcivgm1ax69rqbjdzzbgp0sxhiqhddslbas";
+  };
+
+  buildInputs = [ boost curl openssl log4shib xercesc xml-security-c ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "A low-level library that provides a high level interface to XML processing for OpenSAML 2";
+    platforms   = platforms.unix;
+    license     = licenses.asl20;
+    maintainers = [ maintainers.jammerful ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xmlrpc-c/default.nix b/nixpkgs/pkgs/development/libraries/xmlrpc-c/default.nix
new file mode 100644
index 000000000000..2cb64fe6eb24
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xmlrpc-c/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchurl, curl, libxml2 }:
+
+stdenv.mkDerivation rec {
+  pname = "xmlrpc-c";
+  version = "1.51.07";
+
+  src = fetchurl {
+    url = "mirror://sourceforge/xmlrpc-c/${pname}-${version}.tgz";
+    sha256 = "sha256-hNIK4z+SdYL4IdYcC5GUrvvx15JFkKE/qdpa4WmK3tk=";
+  };
+
+  buildInputs = [ curl libxml2 ];
+
+  configureFlags = [
+    "--enable-libxml2-backend"
+  ];
+
+  # Build and install the "xmlrpc" tool (like the Debian package)
+  postInstall = ''
+    (cd tools/xmlrpc && make && make install)
+  '';
+
+  hardeningDisable = [ "format" ];
+
+  meta = with lib; {
+    description = "A lightweight RPC library based on XML and HTTP";
+    homepage = "http://xmlrpc-c.sourceforge.net/";
+    # <xmlrpc-c>/doc/COPYING also lists "Expat license",
+    # "ABYSS Web Server License" and "Python 1.5.2 License"
+    license = licenses.bsd3;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.bjornfor ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xmlsec/default.nix b/nixpkgs/pkgs/development/libraries/xmlsec/default.nix
new file mode 100644
index 000000000000..2dceaeda6490
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xmlsec/default.nix
@@ -0,0 +1,81 @@
+{ stdenv, fetchurl, libxml2, gnutls, libxslt, pkg-config, libgcrypt, libtool
+# nss_3_53 is used instead of the latest due to a number of issues:
+# https://github.com/lsh123/xmlsec/issues?q=is%3Aissue+is%3Aopen+nss
+, openssl, nss_3_53, lib, runCommandCC, writeText }:
+
+lib.fix (self:
+stdenv.mkDerivation rec {
+  pname = "xmlsec";
+  version = "1.2.32";
+
+  src = fetchurl {
+    url = "https://www.aleksey.com/xmlsec/download/xmlsec1-${version}.tar.gz";
+    sha256 = "sha256-44NwKFMjYATlsI5CS4r+m1P+nzGqp6U4LznZUz63wEM=";
+  };
+
+  patches = [
+    ./lt_dladdsearchdir.patch
+  ] ++ lib.optionals stdenv.isDarwin [ ./remove_bsd_base64_decode_flag.patch ];
+  postPatch = ''
+    substituteAllInPlace src/dl.c
+  '';
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ pkg-config ];
+
+  buildInputs = [ libxml2 gnutls libxslt libgcrypt libtool openssl nss_3_53 ];
+
+  enableParallelBuilding = true;
+  doCheck = true;
+  checkInputs = [ nss_3_53.tools ];
+  preCheck = ''
+  substituteInPlace tests/testrun.sh \
+    --replace 'timestamp=`date +%Y%m%d_%H%M%S`' 'timestamp=19700101_000000' \
+    --replace 'TMPFOLDER=/tmp' '$(mktemp -d)'
+  '';
+
+  # enable deprecated soap headers required by lasso
+  # https://dev.entrouvert.org/issues/18771
+  configureFlags = [ "--enable-soap" ];
+
+  # otherwise libxmlsec1-gnutls.so won't find libgcrypt.so, after #909
+  NIX_LDFLAGS = "-lgcrypt";
+
+  postInstall = ''
+    moveToOutput "bin/xmlsec1-config" "$dev"
+    moveToOutput "lib/xmlsec1Conf.sh" "$dev"
+  '';
+
+  passthru.tests.libxmlsec1-crypto = runCommandCC "libxmlsec1-crypto-test"
+    {
+      nativeBuildInputs = [ pkg-config ];
+      buildInputs = [ self libxml2 libxslt libtool ];
+    } ''
+    $CC $(pkg-config --cflags --libs xmlsec1) -o crypto-test ${writeText "crypto-test.c" ''
+      #include <xmlsec/xmlsec.h>
+      #include <xmlsec/crypto.h>
+
+      int main(int argc, char **argv) {
+        return xmlSecInit() ||
+          xmlSecCryptoDLLoadLibrary(argc > 1 ? argv[1] : 0) ||
+          xmlSecCryptoInit();
+      }
+    ''}
+
+    for crypto in "" gcrypt gnutls nss openssl; do
+      ./crypto-test $crypto
+    done
+    touch $out
+  '';
+
+  meta = {
+    homepage = "http://www.aleksey.com/xmlsec";
+    downloadPage = "https://www.aleksey.com/xmlsec/download.html";
+    description = "XML Security Library in C based on libxml2";
+    license = lib.licenses.mit;
+    platforms = with lib.platforms; linux ++ darwin;
+    updateWalker = true;
+  };
+}
+)
diff --git a/nixpkgs/pkgs/development/libraries/xmlsec/lt_dladdsearchdir.patch b/nixpkgs/pkgs/development/libraries/xmlsec/lt_dladdsearchdir.patch
new file mode 100644
index 000000000000..17dedb0d6c81
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xmlsec/lt_dladdsearchdir.patch
@@ -0,0 +1,16 @@
+diff --git a/src/dl.c b/src/dl.c
+index b13f9d46..d761855b 100644
+--- a/src/dl.c
++++ b/src/dl.c
+@@ -346,6 +346,11 @@ xmlSecCryptoDLInit(void) {
+         xmlSecIOError("lt_dlinit", NULL, NULL);
+         return(-1);
+     }
++    ret = lt_dladdsearchdir("@out@/lib");
++    if(ret != 0) {
++      xmlSecIOError("lt_dladdsearchdir", NULL, NULL);
++      return(-1);
++    }
+ #endif /* XMLSEC_DL_LIBLTDL */
+ 
+     return(0);
diff --git a/nixpkgs/pkgs/development/libraries/xmlsec/remove_bsd_base64_decode_flag.patch b/nixpkgs/pkgs/development/libraries/xmlsec/remove_bsd_base64_decode_flag.patch
new file mode 100644
index 000000000000..700fad7e3dd4
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xmlsec/remove_bsd_base64_decode_flag.patch
@@ -0,0 +1,12 @@
+--- a/tests/testEnc.sh	2020-04-20 14:30:32.000000000 -0400
++++ b/tests/testEnc.sh	2020-10-21 22:09:25.000000000 -0400
+@@ -405,9 +405,6 @@
+             else
+                 # generate binary file out of base64
+                 DECODE="-d"
+-                if [ "`uname`" = "Darwin" ]; then
+-		    DECODE="-D"
+-                fi
+                 cat "$topfolder/$base_test_name.data" | base64 $DECODE > $tmpfile.3
+                 execEncTest "$res_success" \
+                     "" \
diff --git a/nixpkgs/pkgs/development/libraries/xsd/default.nix b/nixpkgs/pkgs/development/libraries/xsd/default.nix
new file mode 100644
index 000000000000..2d614ee0e731
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xsd/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchurl, xercesc }:
+
+let
+in
+stdenv.mkDerivation rec {
+  pname = "xsd";
+  version = "4.0.0";
+
+  src = fetchurl {
+    url = "https://codesynthesis.com/download/xsd/4.0/xsd-4.0.0+dep.tar.bz2";
+    sha256 = "05wqhmd5cd4pdky8i8qysnh96d2h16ly8r73whmbxkajiyf2m9gc";
+  };
+
+  patches = [ ./xsdcxx.patch ];
+
+  postPatch = ''
+    patchShebangs .
+  '';
+
+  enableParallelBuilding = true;
+
+  buildFlags = [
+    "LDFLAGS=-L${xercesc}/lib"
+    "CPPFLAGS=-I${xercesc}/include"
+  ];
+  installFlags = buildFlags ++ [
+    "install_prefix=${placeholder "out"}"
+  ];
+
+  buildInputs = [ xercesc ];
+
+  meta = {
+    homepage = "http://www.codesynthesis.com/products/xsd";
+    description = "An open-source, cross-platform W3C XML Schema to C++ data binding compiler";
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
+    maintainers = [ lib.maintainers.jagajaga ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xsd/xsdcxx.patch b/nixpkgs/pkgs/development/libraries/xsd/xsdcxx.patch
new file mode 100644
index 000000000000..88a893c6e602
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xsd/xsdcxx.patch
@@ -0,0 +1,126 @@
+--- xsd-4.0.0+dep/xsd/doc/xsd.1~	2014-09-14 12:25:36.862267587 +0000
++++ xsd-4.0.0+dep/xsd/doc/xsd.1	2014-09-14 12:28:25.728229892 +0000
+@@ -1,16 +1,16 @@
+ .\" Process this file with
+-.\" groff -man -Tascii xsd.1
++.\" groff -man -Tascii xsdcxx.1
+ .\"
+ .TH XSD 1 "July 2014" "XSD 4.0.0"
+ .SH NAME
+-xsd \- W3C XML Schema to C++ Compiler
++xsdcxx \- W3C XML Schema to C++ Compiler
+ .\"
+ .\"
+ .\"
+ .\"--------------------------------------------------------------------
+ .SH SYNOPSIS
+ .\"--------------------------------------------------------------------
+-.B xsd
++.B xsdcxx
+ .I command
+ .B [
+ .I options
+@@ -20,19 +20,19 @@
+ .I file
+ .B ...]
+ .in
+-.B xsd help
++.B xsdcxx help
+ .B [
+ .I command
+ .B ]
+ .in
+-.B xsd version
++.B xsdcxx version
+ .\"
+ .\"
+ .\"
+ .\"--------------------------------------------------------------------
+ .SH DESCRIPTION
+ .\"--------------------------------------------------------------------
+-.B xsd
++.B xsdcxx
+ generates vocabulary-specific, statically-typed C++ mapping from W3C XML
+ Schema definitions. Particular mapping to produce is selected by a
+ .IR command .
+@@ -96,7 +96,7 @@
+ .PP
+ .RS
+ .RS 3
+-.B xsd help
++.B xsdcxx help
+ .I command
+ .RE
+ .PP
+@@ -206,7 +206,7 @@
+ \fIfilename\fP \fInamespace\fP
+ 
+ For example, if you have file \fBhello\.xsd\fP with namespace
+-\fBhttp://example\.com/hello\fP and you run \fBxsd\fP on this file, then the
++\fBhttp://example\.com/hello\fP and you run \fBxsdcxx\fP on this file, then the
+ string in question will be:
+ 
+ \fBhello\.xsd\. http://example\.com/hello\fP
+@@ -1632,7 +1632,7 @@
+ .\"
+ .SH DIAGNOSTICS
+ If the input file is not a valid W3C XML Schema definition,
+-.B xsd
++.B xsdcxx
+ will issue diagnostic messages to
+ .B STDERR
+ and exit with non-zero exit code.
+--- xsd-4.0.0+dep/xsd/doc/xsd.xhtml~	2014-09-14 12:28:37.731513138 +0000
++++ xsd-4.0.0+dep/xsd/doc/xsd.xhtml	2014-09-14 12:30:11.277789610 +0000
+@@ -50,19 +50,19 @@
+ 
+   <h1>NAME</h1>
+ 
+-  <p>xsd - W3C XML Schema to C++ Compiler</p>
++  <p>xsdcxx - W3C XML Schema to C++ Compiler</p>
+ 
+   <h1>SYNOPSIS</h1>
+ 
+   <dl id="synopsis">
+-    <dt><code><b>xsd</b> <i>command</i> [<i>options</i>] <i>file</i> [<i>file</i> ...]</code></dt>
+-    <dt><code><b>xsd help</b> [<i>command</i>]</code></dt>
+-    <dt><code><b>xsd version</b></code></dt>
++    <dt><code><b>xsdcxx</b> <i>command</i> [<i>options</i>] <i>file</i> [<i>file</i> ...]</code></dt>
++    <dt><code><b>xsdcxx help</b> [<i>command</i>]</code></dt>
++    <dt><code><b>xsdcxx version</b></code></dt>
+   </dl>
+ 
+   <h1>DESCRIPTION</h1>
+ 
+-  <p><code><b>xsd</b></code> generates vocabulary-specific, statically-typed
++  <p><code><b>xsdcxx</b></code> generates vocabulary-specific, statically-typed
+   C++ mapping from W3C XML Schema definitions. Particular mapping to
+   produce is selected by a <code><i>command</i></code>. Each mapping has
+   a number of mapping-specific <code><i>options</i></code> that should
+@@ -104,7 +104,7 @@
+ 
+     <dt><code><b>help</b></code></dt>
+     <dd>Print usage information and exit. Use
+-      <p><code><b>xsd help</b> <i>command</i></code></p>
++      <p><code><b>xsdcxx help</b> <i>command</i></code></p>
+       for command-specific help.
+     </dd>
+ 
+@@ -219,7 +219,7 @@
+ 
+   <p>For example, if you have file <code><b>hello.xsd</b></code> with
+   namespace <code><b>http://example.com/hello</b></code> and you run
+-  <code><b>xsd</b></code> on this file, then the string in question will
++  <code><b>xsdcxx</b></code> on this file, then the string in question will
+   be:</p>
+ 
+   <p><code><b>hello.xsd. http://example.com/hello</b></code></p>
+@@ -1530,7 +1530,7 @@
+   <h1>DIAGNOSTICS</h1>
+ 
+   <p>If the input file is not a valid W3C XML Schema definition,
+-    <code><b>xsd</b></code> will issue diagnostic messages to STDERR
++    <code><b>xsdcxx</b></code> will issue diagnostic messages to STDERR
+     and exit with non-zero exit code.</p>
+ 
+   <h1>BUGS</h1>
diff --git a/nixpkgs/pkgs/development/libraries/xsimd/default.nix b/nixpkgs/pkgs/development/libraries/xsimd/default.nix
new file mode 100644
index 000000000000..745ee9ee3fce
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xsimd/default.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv, fetchFromGitHub, cmake, gtest }:
+let
+  version = "7.5.0";
+
+  darwin_src = fetchFromGitHub {
+    owner = "xtensor-stack";
+    repo = "xsimd";
+    rev = version;
+    sha256 = "eGAdRSYhf7rbFdm8g1Tz1ZtSVu44yjH/loewblhv9Vs=";
+    # Avoid requiring apple_sdk. We're doing this here instead of in the patchPhase
+    # because this source is directly used in arrow-cpp.
+    # pyconfig.h defines _GNU_SOURCE to 1, so we need to stamp that out too.
+    # Upstream PR with a better fix: https://github.com/xtensor-stack/xsimd/pull/463
+    postFetch = ''
+      mkdir $out
+      tar -xf $downloadedFile --directory=$out --strip-components=1
+      substituteInPlace $out/include/xsimd/types/xsimd_scalar.hpp \
+        --replace 'defined(__APPLE__)' 0 \
+        --replace 'defined(_GNU_SOURCE)' 0
+    '';
+  };
+
+  src = fetchFromGitHub {
+    owner = "xtensor-stack";
+    repo = "xsimd";
+    rev = version;
+    sha256 = "0c9pq5vz43j99z83w3b9qylfi66mn749k1afpv5cwfxggbxvy63f";
+  };
+in stdenv.mkDerivation {
+  pname = "xsimd";
+  inherit version;
+  src = if stdenv.hostPlatform.isDarwin then darwin_src else src;
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [ "-DBUILD_TESTS=ON" ];
+
+  doCheck = true;
+  checkInputs = [ gtest ];
+  checkTarget = "xtest";
+  GTEST_FILTER = let
+      # Upstream Issue: https://github.com/xtensor-stack/xsimd/issues/456
+      filteredTests = lib.optionals stdenv.hostPlatform.isDarwin [
+        "error_gamma_test/sse_double.gamma"
+        "error_gamma_test/avx_double.gamma"
+      ];
+    in "-${builtins.concatStringsSep ":" filteredTests}";
+
+  meta = with lib; {
+    description = "C++ wrappers for SIMD intrinsics";
+    homepage = "https://github.com/xtensor-stack/xsimd";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ tobim ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xtensor/default.nix b/nixpkgs/pkgs/development/libraries/xtensor/default.nix
new file mode 100644
index 000000000000..fe978998d637
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xtensor/default.nix
@@ -0,0 +1,36 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, gtest
+, xsimd
+, xtl
+}:
+stdenv.mkDerivation rec {
+  pname = "xtensor";
+  version = "0.23.10";
+
+  src = fetchFromGitHub {
+    owner = "xtensor-stack";
+    repo = "xtensor";
+    rev = version;
+    sha256 = "1ayrhyh9x33b87ic01b4jzxc8x27yxpxzya5x54ikazvz8p71n14";
+  };
+
+  nativeBuildInputs = [ cmake ];
+  propagatedBuildInputs = [ xtl xsimd ];
+
+  cmakeFlags = [ "-DBUILD_TESTS=ON" ];
+
+  doCheck = true;
+  checkInputs = [ gtest ];
+  checkTarget = "xtest";
+
+  meta = with lib; {
+    description = "Multi-dimensional arrays with broadcasting and lazy computing.";
+    homepage = "https://github.com/xtensor-stack/xtensor";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ cpcloud ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xtl/default.nix b/nixpkgs/pkgs/development/libraries/xtl/default.nix
new file mode 100644
index 000000000000..fb50105cffa2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xtl/default.nix
@@ -0,0 +1,33 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, cmake
+, gtest
+}:
+stdenv.mkDerivation rec {
+  pname = "xtl";
+  version = "0.7.2";
+
+  src = fetchFromGitHub {
+    owner = "xtensor-stack";
+    repo = "xtl";
+    rev = version;
+    sha256 = "177ym67sz544wdylksfkkpi6bqn34kagycfnb3cv0nkmpipqj9lg";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  cmakeFlags = [ "-DBUILD_TESTS=ON" ];
+
+  doCheck = true;
+  checkInputs = [ gtest ];
+  checkTarget = "xtest";
+
+  meta = with lib; {
+    description = "Basic tools (containers, algorithms) used by other quantstack packages";
+    homepage = "https://github.com/xtensor-stack/xtl";
+    license = licenses.bsd3;
+    maintainers = with maintainers; [ cpcloud ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xvidcore/default.nix b/nixpkgs/pkgs/development/libraries/xvidcore/default.nix
new file mode 100644
index 000000000000..57f2403cfe3f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xvidcore/default.nix
@@ -0,0 +1,47 @@
+{ lib, stdenv, fetchurl, yasm, autoconf, automake, libtool }:
+
+with lib;
+stdenv.mkDerivation rec {
+  pname = "xvidcore";
+  version = "1.3.7";
+
+  src = fetchurl {
+    url = "https://downloads.xvid.com/downloads/${pname}-${version}.tar.bz2";
+    sha256 = "1xyg3amgg27zf7188kss7y248s0xhh1vv8rrk0j9bcsd5nasxsmf";
+  };
+
+  preConfigure = ''
+    # Configure script is not in the root of the source directory
+    cd build/generic
+  '' + optionalString stdenv.isDarwin ''
+    # Undocumented darwin hack
+    substituteInPlace configure --replace "-no-cpp-precomp" ""
+  '';
+
+  configureFlags = [ ]
+    # Undocumented darwin hack (assembly is probably disabled due to an
+    # issue with nasm, however yasm is now used)
+    ++ optional stdenv.isDarwin "--enable-macosx_module --disable-assembly";
+
+  nativeBuildInputs = [ ]
+    ++ optional (!stdenv.isDarwin) yasm;
+
+  buildInputs = [ ]
+    # Undocumented darwin hack
+    ++ optionals stdenv.isDarwin [ autoconf automake libtool ];
+
+  # Don't remove static libraries (e.g. 'libs/*.a') on darwin.  They're needed to
+  # compile ffmpeg (and perhaps other things).
+  postInstall = optionalString (!stdenv.isDarwin) ''
+    rm $out/lib/*.a
+  '';
+
+  meta = {
+    description = "MPEG-4 video codec for PC";
+    homepage    = "https://www.xvid.com/";
+    license     = licenses.gpl2;
+    maintainers = with maintainers; [ codyopel lovek323 ];
+    platforms   = platforms.all;
+  };
+}
+
diff --git a/nixpkgs/pkgs/development/libraries/xxHash/default.nix b/nixpkgs/pkgs/development/libraries/xxHash/default.nix
new file mode 100644
index 000000000000..fbeadc2b353a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xxHash/default.nix
@@ -0,0 +1,39 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "xxHash";
+  version = "0.8.0";
+
+  src = fetchFromGitHub {
+    owner = "Cyan4973";
+    repo = "xxHash";
+    rev = "v${version}";
+    sha256 = "0hpbzdd6kfki5f61g103vp7pfczqkdj0js63avl0ss552jfb8h96";
+  };
+
+  # Upstream Makefile does not anticipate that user may not want to
+  # build .so library.
+  postPatch = lib.optionalString stdenv.hostPlatform.isStatic ''
+    sed -i 's/lib: libxxhash.a libxxhash/lib: libxxhash.a/' Makefile
+    sed -i '/LIBXXH) $(DESTDIR/ d' Makefile
+  '';
+
+  outputs = [ "out" "dev" ];
+
+  makeFlags = [ "PREFIX=$(dev)" "EXEC_PREFIX=$(out)" ];
+
+  meta = with lib; {
+    description = "Extremely fast hash algorithm";
+    longDescription = ''
+      xxHash is an Extremely fast Hash algorithm, running at RAM speed limits.
+      It successfully completes the SMHasher test suite which evaluates
+      collision, dispersion and randomness qualities of hash functions. Code is
+      highly portable, and hashes are identical on all platforms (little / big
+      endian).
+    '';
+    homepage = "https://github.com/Cyan4973/xxHash";
+    license = with licenses; [ bsd2 gpl2 ];
+    maintainers = with maintainers; [ orivej ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/xylib/default.nix b/nixpkgs/pkgs/development/libraries/xylib/default.nix
new file mode 100644
index 000000000000..f7d7eed7e70e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/xylib/default.nix
@@ -0,0 +1,21 @@
+{ lib, stdenv, fetchurl, boost, zlib, bzip2, wxGTK30 }:
+
+stdenv.mkDerivation rec {
+  pname = "xylib";
+  version = "1.6";
+
+  src = fetchurl {
+    url = "https://github.com/wojdyr/xylib/releases/download/v${version}/${pname}-${version}.tar.bz2";
+    sha256 = "1iqfrfrk78mki5csxysw86zm35ag71w0jvim0f12nwq1z8rwnhdn";
+  };
+
+  buildInputs = [ boost zlib bzip2 wxGTK30 ];
+
+  meta = with lib; {
+    description = "Portable library for reading files that contain x-y data from powder diffraction, spectroscopy and other experimental methods";
+    license = licenses.lgpl21;
+    homepage = "http://xylib.sourceforge.net/";
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ pSub ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/yajl/default.nix b/nixpkgs/pkgs/development/libraries/yajl/default.nix
new file mode 100644
index 000000000000..645329f83cdb
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/yajl/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "yajl";
+  version = "2.1.0";
+
+  src = fetchFromGitHub {
+    owner = "lloyd";
+    repo = "yajl";
+    rev = version;
+    sha256 = "00yj06drb6izcxfxfqlhimlrb089kka0w0x8k27pyzyiq7qzcvml";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = {
+    description = "Yet Another JSON Library";
+    longDescription = ''
+      YAJL is a small event-driven (SAX-style) JSON parser written in ANSI
+      C, and a small validating JSON generator.
+    '';
+    homepage = "http://lloyd.github.com/yajl/";
+    license = lib.licenses.isc;
+    platforms = with lib.platforms; linux ++ darwin;
+    maintainers = with lib.maintainers; [ maggesi ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/yder/default.nix b/nixpkgs/pkgs/development/libraries/yder/default.nix
new file mode 100644
index 000000000000..49544a374682
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/yder/default.nix
@@ -0,0 +1,54 @@
+{ stdenv
+, lib
+, fetchFromGitHub
+, cmake
+, orcania
+, systemd
+, check
+, subunit
+, withSystemd ? stdenv.isLinux
+}:
+
+stdenv.mkDerivation rec {
+  pname = "yder";
+  version = "1.4.14";
+
+  src = fetchFromGitHub {
+    owner = "babelouest";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-4FSUBFqrxTbqg2EKYuXv4gUeE40ViNZRk5gHv+C2p9o=";
+  };
+
+  patches = [
+    # We set CMAKE_INSTALL_LIBDIR to the absolute path in $out, so
+    # prefix and exec_prefix cannot be $out, too
+    ./fix-pkgconfig.patch
+  ];
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ orcania ]
+    ++ lib.optional withSystemd systemd;
+
+  checkInputs = [ check subunit ];
+
+  cmakeFlags = [
+    "-DBUILD_YDER_TESTING=on"
+  ] ++ lib.optional (!withSystemd) "-DWITH_JOURNALD=off";
+
+  doCheck = true;
+
+  preCheck = ''
+    export LD_LIBRARY_PATH="$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH"
+    export DYLD_FALLBACK_LIBRARY_PATH="$(pwd):$DYLD_FALLBACK_LIBRARY_PATH"
+  '';
+
+  meta = with lib; {
+    description = "Logging library for C applications";
+    homepage = "https://github.com/babelouest/yder";
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ johnazoidberg ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/yder/fix-pkgconfig.patch b/nixpkgs/pkgs/development/libraries/yder/fix-pkgconfig.patch
new file mode 100644
index 000000000000..61a67c5897b8
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/yder/fix-pkgconfig.patch
@@ -0,0 +1,9 @@
+--- i/libyder.pc.in
++++ w/libyder.pc.in
+@@ -1,7 +1,5 @@
+-prefix=@CMAKE_INSTALL_PREFIX@
+-exec_prefix=@CMAKE_INSTALL_PREFIX@
+-libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
+-includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@
++libdir=@CMAKE_INSTALL_LIBDIR@
++includedir=@CMAKE_INSTALL_INCLUDEDIR@
diff --git a/nixpkgs/pkgs/development/libraries/yojimbo/default.nix b/nixpkgs/pkgs/development/libraries/yojimbo/default.nix
new file mode 100644
index 000000000000..b72820c77a68
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/yojimbo/default.nix
@@ -0,0 +1,43 @@
+{ lib, stdenv, fetchFromGitHub, premake5, doxygen, libsodium, mbedtls }:
+
+stdenv.mkDerivation {
+  pname = "yojimbo";
+  version = "1.1";
+
+  src = fetchFromGitHub {
+    owner = "networkprotocol";
+    repo = "yojimbo";
+    rev = "e02219c102d9b440290539036992d77608eab3b0";
+    sha256 = "0jn25ddv73hwjals883a910m66kwj6glxxhnmn96bpzsvsaimnkr";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ premake5 doxygen ];
+  propagatedBuildInputs = [ libsodium mbedtls ];
+
+  postBuild = ''
+    premake5 docs
+  '';
+
+  installPhase = ''
+    install -Dm555 -t $out/lib bin/libyojimbo.a
+    install -Dm444 -t $out/include yojimbo.h
+    mkdir -p $out/share/doc/yojimbo
+    cp -r docs/html $out/share/doc/yojimbo
+  '';
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "A network library for client/server games with dedicated servers";
+    longDescription = ''
+      yojimbo is a network library for client/server games with dedicated servers.
+      It's designed around the networking requirements of competitive multiplayer games like first person shooters.
+      As such it provides a time critical networking layer on top of UDP, with a client/server architecture supporting up to 64 players per-dedicated server instance.
+    '';
+    homepage = "https://github.com/networkprotocol/yojimbo";
+    license = licenses.bsd3;
+    platforms = platforms.x86_64;
+    maintainers = with maintainers; [ paddygord ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/yubico-pam/default.nix b/nixpkgs/pkgs/development/libraries/yubico-pam/default.nix
new file mode 100644
index 000000000000..e417de5e1ff0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/yubico-pam/default.nix
@@ -0,0 +1,34 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, pkg-config
+, asciidoc
+, libxslt
+, docbook_xsl
+, pam
+, yubikey-personalization
+, libyubikey
+, libykclient
+}:
+
+stdenv.mkDerivation rec {
+  pname = "yubico-pam";
+  version = "2.27";
+  src = fetchFromGitHub {
+    owner = "Yubico";
+    repo = pname;
+    rev = version;
+    sha256 = "0hb773zlf11xz4bwmsqv2mq5d4aq2g0crdr5cp9xwc4ivi5gd4kg";
+  };
+
+  nativeBuildInputs = [ autoreconfHook pkg-config asciidoc libxslt docbook_xsl ];
+  buildInputs = [ pam yubikey-personalization libyubikey libykclient ];
+
+  meta = with lib; {
+    description = "Yubico PAM module";
+    homepage = "https://developers.yubico.com/yubico-pam";
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ dtzWill ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/zchunk/default.nix b/nixpkgs/pkgs/development/libraries/zchunk/default.nix
new file mode 100644
index 000000000000..c2ddda7a6c5f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zchunk/default.nix
@@ -0,0 +1,51 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, argp-standalone
+, curl
+, meson
+, ninja
+, pkg-config
+, zstd
+}:
+
+stdenv.mkDerivation rec {
+  pname = "zchunk";
+  version = "1.1.16";
+
+  src = fetchFromGitHub {
+    owner = "zchunk";
+    repo = pname;
+    rev = version;
+    hash = "sha256-+8FkivLTZXdu0+1wu+7T98y6rQzIHbG9l15Abrbln1o=";
+  };
+
+  nativeBuildInputs = [
+    meson
+    ninja
+    pkg-config
+  ];
+
+  buildInputs = [
+    curl
+    zstd
+  ] ++ lib.optional stdenv.isDarwin argp-standalone;
+
+  outputs = [ "out" "lib" "dev" ];
+
+  meta = with lib; {
+    homepage = "https://github.com/zchunk/zchunk";
+    description = "File format designed for highly efficient deltas while maintaining good compression";
+    longDescription = ''
+      zchunk is a compressed file format that splits the file into independent
+      chunks. This allows you to only download changed chunks when downloading a
+      new version of the file, and also makes zchunk files efficient over rsync.
+
+      zchunk files are protected with strong checksums to verify that the file
+      you downloaded is, in fact, the file you wanted.
+    '';
+    license = licenses.bsd2;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/zeitgeist/default.nix b/nixpkgs/pkgs/development/libraries/zeitgeist/default.nix
new file mode 100644
index 000000000000..de1953622e93
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zeitgeist/default.nix
@@ -0,0 +1,89 @@
+{ lib, stdenv
+, fetchFromGitLab
+, fetchpatch
+, pkg-config
+, glib
+, sqlite
+, gobject-introspection
+, vala
+, autoconf
+, automake
+, libtool
+, gettext
+, dbus
+, gtk3
+, json-glib
+, librdf_raptor2
+, pythonSupport ? true
+, python3
+}:
+
+stdenv.mkDerivation rec {
+  pname = "zeitgeist";
+  version = "1.0.3";
+
+  outputs = [ "out" "lib" "dev" "man" ] ++ lib.optional pythonSupport "py";
+
+  src = fetchFromGitLab {
+    domain = "gitlab.freedesktop.org";
+    owner = pname;
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "0y6fyzxl5np4yskcxibd0p03h619w9ir907nhf40h02y0pk1kgkp";
+  };
+
+  patches = [
+    # Fix build with Vala 0.52
+    (fetchpatch {
+      url = "https://gitlab.freedesktop.org/zeitgeist/zeitgeist/commit/64ac3a6f94cd299e5e14945dc31b48f009dec152.patch";
+      sha256 = "Dw1kNE3JoFdmgcQ0eFoFLYvmxlPjXNj56Jkn2meINz4=";
+    })
+  ];
+
+  nativeBuildInputs = [
+    autoconf
+    automake
+    libtool
+    pkg-config
+    gettext
+    gobject-introspection
+    vala
+    python3
+  ];
+
+  buildInputs = [
+    glib
+    sqlite
+    dbus
+    gtk3
+    json-glib
+    librdf_raptor2
+    python3.pkgs.rdflib
+  ];
+
+  configureFlags = [
+    "--disable-telepathy"
+  ];
+
+  enableParallelBuilding = true;
+
+  postPatch = ''
+    patchShebangs data/ontology2code
+  '';
+
+  preConfigure = ''
+    NOCONFIGURE=1 ./autogen.sh
+  '';
+
+  postFixup = lib.optionalString pythonSupport ''
+    moveToOutput lib/${python3.libPrefix} "$py"
+  '';
+
+  meta = with lib; {
+    description = "A service which logs the users’s activities and events";
+    homepage = "https://zeitgeist.freedesktop.org/";
+    maintainers = teams.freedesktop.members ++ (with maintainers; [ ]);
+    license = licenses.lgpl21Plus;
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/zeroc-ice/3.6.nix b/nixpkgs/pkgs/development/libraries/zeroc-ice/3.6.nix
new file mode 100644
index 000000000000..e8082e50447a
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zeroc-ice/3.6.nix
@@ -0,0 +1,59 @@
+{ stdenv, lib, fetchFromGitHub
+, mcpp, bzip2, expat, openssl, db5
+, darwin, libiconv, Security
+, zeroc-ice # to share meta
+, cpp11 ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "zeroc-ice";
+  version = "3.6.5";
+
+  src = fetchFromGitHub {
+    owner = "zeroc-ice";
+    repo = "ice";
+    rev = "v${version}";
+    sha256 = "073h7v1f2sw77cr1a6xxa5l9j547pz24sxa9qdjc4zki0ivcnq15";
+  };
+
+  buildInputs = [ mcpp bzip2 expat openssl db5 ]
+    ++ lib.optionals stdenv.isDarwin [ darwin.cctools libiconv Security ];
+
+  postUnpack = ''
+    sourceRoot=$sourceRoot/cpp
+  '';
+
+  prePatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace config/Make.rules.Darwin \
+        --replace xcrun ""
+  '';
+
+  patches = [
+    # Fixes compilation warning about uninitialied variables (in test code)
+    ./uninitialized-variable-warning.patch
+  ];
+
+  preBuild = ''
+    makeFlagsArray+=(
+      "prefix=$out"
+      "OPTIMIZE=yes"
+      "USR_DIR_INSTALL=yes"
+      "CONFIGS=${if cpp11 then "cpp11-shared" else "shared"}"
+      "SKIP=slice2py" # provided by a separate package
+    )
+  '';
+
+  # cannot find -lIceXML (linking bin/transformdb)
+  enableParallelBuilding = false;
+
+  outputs = [ "out" "bin" "dev" ];
+
+  postInstall = ''
+    mkdir -p $bin $dev/share
+    mv $out/bin $bin
+    mv $out/share/Ice-* $dev/share/ice
+    rm -rf $out/share/slice
+  '';
+
+  inherit (zeroc-ice) meta;
+}
diff --git a/nixpkgs/pkgs/development/libraries/zeroc-ice/default.nix b/nixpkgs/pkgs/development/libraries/zeroc-ice/default.nix
new file mode 100644
index 000000000000..fcd836348556
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zeroc-ice/default.nix
@@ -0,0 +1,88 @@
+{ stdenv, lib, fetchFromGitHub
+, bzip2, expat, libedit, lmdb, openssl
+, darwin, libiconv, Security
+, python3 # for tests only
+, cpp11 ? false
+}:
+
+let
+  zeroc_mcpp = stdenv.mkDerivation rec {
+    pname = "zeroc-mcpp";
+    version = "2.7.2.14";
+
+    src = fetchFromGitHub {
+      owner = "zeroc-ice";
+      repo = "mcpp";
+      rev = "v${version}";
+      sha256 = "1psryc2ql1cp91xd3f8jz84mdaqvwzkdq2pr96nwn03ds4cd88wh";
+    };
+
+    configureFlags = [ "--enable-mcpplib" ];
+    installFlags = [ "PREFIX=$(out)" ];
+  };
+
+in stdenv.mkDerivation rec {
+  pname = "zeroc-ice";
+  version = "3.7.6";
+
+  src = fetchFromGitHub {
+    owner = "zeroc-ice";
+    repo = "ice";
+    rev = "v${version}";
+    sha256 = "0zc8gmlzl2f38m1fj6pv2vm8ka7fkszd6hx2lb8gfv65vn3m4sk4";
+  };
+
+  buildInputs = [ zeroc_mcpp bzip2 expat libedit lmdb openssl ]
+    ++ lib.optionals stdenv.isDarwin [ darwin.cctools libiconv Security ];
+
+  NIX_CFLAGS_COMPILE = "-Wno-error=class-memaccess -Wno-error=deprecated-copy";
+
+  prePatch = lib.optionalString stdenv.isDarwin ''
+    substituteInPlace Make.rules.Darwin \
+        --replace xcrun ""
+  '';
+
+  preBuild = ''
+    makeFlagsArray+=(
+      "prefix=$out"
+      "OPTIMIZE=yes"
+      "USR_DIR_INSTALL=yes"
+      "LANGUAGES=cpp"
+      "CONFIGS=${if cpp11 then "cpp11-shared" else "shared"}"
+      "SKIP=slice2py" # provided by a separate package
+    )
+  '';
+
+  enableParallelBuilding = true;
+
+  outputs = [ "out" "bin" "dev" ];
+
+  doCheck = true;
+  checkInputs = with python3.pkgs; [ passlib ];
+  checkPhase = with lib; let
+    # these tests require network access so we need to skip them.
+    brokenTests = map escapeRegex [
+      "Ice/udp" "Glacier2" "IceGrid/simple" "IceStorm" "IceDiscovery/simple"
+    ];
+    # matches CONFIGS flag in makeFlagsArray
+    configFlag = optionalString cpp11 "--config=cpp11-shared";
+  in ''
+    runHook preCheck
+    ${python3.interpreter} ./cpp/allTests.py ${configFlag} --rfilter='${concatStringsSep "|" brokenTests}'
+    runHook postCheck
+  '';
+
+  postInstall = ''
+    mkdir -p $bin $dev/share
+    mv $out/bin $bin
+    mv $out/share/ice $dev/share
+  '';
+
+  meta = with lib; {
+    homepage = "https://www.zeroc.com/ice.html";
+    description = "The internet communications engine";
+    license = licenses.gpl2Only;
+    platforms = platforms.unix;
+    maintainers = with maintainers; [ abbradar ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/zeroc-ice/uninitialized-variable-warning.patch b/nixpkgs/pkgs/development/libraries/zeroc-ice/uninitialized-variable-warning.patch
new file mode 100644
index 000000000000..878dee26bb83
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zeroc-ice/uninitialized-variable-warning.patch
@@ -0,0 +1,20 @@
+diff --git a/test/Glacier2/dynamicFiltering/TestControllerI.h b/test/Glacier2/dynamicFiltering/TestControllerI.h
+index 7e21639..1279200 100644
+--- a/test/Glacier2/dynamicFiltering/TestControllerI.h
++++ b/test/Glacier2/dynamicFiltering/TestControllerI.h
+@@ -21,13 +21,12 @@ struct SessionTuple
+ {
+     Glacier2::SessionPrx session;
+     Glacier2::SessionControlPrx sessionControl;
+-    bool configured;
++    bool configured = false;
+
+     SessionTuple() {}
+     SessionTuple(Glacier2::SessionPrx s, Glacier2::SessionControlPrx control):
+         session(s),
+-        sessionControl(control),
+-        configured(false)
++        sessionControl(control)
+     {}
+
+     SessionTuple&
diff --git a/nixpkgs/pkgs/development/libraries/zeromq/4.x.nix b/nixpkgs/pkgs/development/libraries/zeromq/4.x.nix
new file mode 100644
index 000000000000..b37dfbdd7077
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zeromq/4.x.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, cmake, asciidoc, pkg-config, libsodium
+, enableDrafts ? false }:
+
+stdenv.mkDerivation rec {
+  pname = "zeromq";
+  version = "4.3.4";
+
+  src = fetchFromGitHub {
+    owner = "zeromq";
+    repo = "libzmq";
+    rev = "v${version}";
+    sha256 = "sha256-epOEyHOswUGVwzz0FLxhow/zISmZHxsIgmpOV8C8bQM=";
+  };
+
+  nativeBuildInputs = [ cmake asciidoc pkg-config ];
+  buildInputs = [ libsodium ];
+
+  doCheck = false; # fails all the tests (ctest)
+
+  cmakeFlags = lib.optional enableDrafts "-DENABLE_DRAFTS=ON";
+
+  meta = with lib; {
+    branch = "4";
+    homepage = "http://www.zeromq.org";
+    description = "The Intelligent Transport Layer";
+    license = licenses.gpl3;
+    platforms = platforms.all;
+    maintainers = with maintainers; [ fpletz ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/zimg/default.nix b/nixpkgs/pkgs/development/libraries/zimg/default.nix
new file mode 100644
index 000000000000..76334bb3532f
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zimg/default.nix
@@ -0,0 +1,25 @@
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
+
+stdenv.mkDerivation rec {
+  pname = "zimg";
+  version = "3.0.2";
+
+  src = fetchFromGitHub {
+    owner  = "sekrit-twc";
+    repo   = "zimg";
+    rev    = "release-${version}";
+    sha256 = "19qim6vyfas0m09piiw0pw7i0xjzi8vs6bx716gz472nflsg1604";
+  };
+
+  nativeBuildInputs = [ autoreconfHook ];
+
+  enableParallelBuilding = true;
+
+  meta = with lib; {
+    description = "Scaling, colorspace conversion and dithering library";
+    homepage    = "https://github.com/sekrit-twc/zimg";
+    license     = licenses.wtfpl;
+    platforms   = platforms.linux ++ platforms.darwin;
+    maintainers = with maintainers; [ rnhmjoj ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/zimlib/default.nix b/nixpkgs/pkgs/development/libraries/zimlib/default.nix
new file mode 100644
index 000000000000..9f8e357d3ab0
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zimlib/default.nix
@@ -0,0 +1,55 @@
+{ lib, stdenv, fetchFromGitHub
+, meson, ninja, pkg-config
+, python3
+, icu
+, libuuid
+, xapian
+, xz
+, zstd
+, gtest
+}:
+
+stdenv.mkDerivation rec {
+  pname = "zimlib";
+  version = "6.3.2";
+
+  src = fetchFromGitHub {
+    owner = "openzim";
+    repo = "libzim";
+    rev = version;
+    sha256 = "sha256-xlYu74akK9WFy86hcQe7zp11TImwl8llgDIZBRgmbAI=";
+  };
+
+  nativeBuildInputs = [
+    meson
+    pkg-config
+    ninja
+    python3
+  ];
+
+  propagatedBuildInputs = [
+    icu
+    libuuid
+    xapian
+    xz
+    zstd
+  ];
+
+  postPatch = ''
+    patchShebangs scripts
+  '';
+
+  checkInputs = [
+    gtest
+  ];
+
+  doCheck = true;
+
+  meta = with lib; {
+    description = "Library for reading and writing ZIM files";
+    homepage =  "https://www.openzim.org/wiki/Zimlib";
+    license = licenses.gpl2;
+    maintainers = with maintainers; [ ajs124 ];
+    platforms = platforms.linux;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/zlib-ng/default.nix b/nixpkgs/pkgs/development/libraries/zlib-ng/default.nix
new file mode 100644
index 000000000000..4323d8adda05
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zlib-ng/default.nix
@@ -0,0 +1,34 @@
+{ lib, stdenv, fetchFromGitHub
+, cmake, pkg-config
+, withZlibCompat ? false
+}:
+
+stdenv.mkDerivation rec {
+  pname = "zlib-ng";
+  version = "2.0.5";
+
+  src = fetchFromGitHub {
+    owner = "zlib-ng";
+    repo = "zlib-ng";
+    rev = version;
+    sha256 = "sha256-KvV1XtPoagqPmijdr20eejsXWG7PRjMUwGPLXazqUHM=";
+  };
+
+  outputs = [ "out" "dev" "bin" ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  cmakeFlags = [
+    "-DCMAKE_INSTALL_PREFIX=/"
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DINSTALL_UTILS=ON"
+  ] ++ lib.optionals withZlibCompat [ "-DZLIB_COMPAT=ON" ];
+
+  meta = with lib; {
+    description = "zlib data compression library for the next generation systems";
+    homepage    = "https://github.com/zlib-ng/zlib-ng";
+    license     = licenses.zlib;
+    platforms   = platforms.all;
+    maintainers = with maintainers; [ izorkin ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/zlib/default.nix b/nixpkgs/pkgs/development/libraries/zlib/default.nix
new file mode 100644
index 000000000000..a9fadf46c4b2
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zlib/default.nix
@@ -0,0 +1,135 @@
+{ lib, stdenv
+, fetchurl
+, shared ? !stdenv.hostPlatform.isStatic
+, static ? true
+# If true, a separate .static ouput is created and the .a is moved there.
+# 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.
+, splitStaticOutput ? shared && static
+}:
+
+# Without either the build will actually still succeed because the build
+# system makes an arbitrary choice, but we shouldn't be so indecisive.
+assert shared || static;
+
+# Note: this package is used for bootstrapping fetchurl, and thus
+# cannot use fetchpatch! All mutable patches (generated by GitHub or
+# cgit) that are needed here should be included directly in Nixpkgs as
+# files.
+
+assert splitStaticOutput -> static;
+
+stdenv.mkDerivation (rec {
+  name = "zlib-${version}";
+  version = "1.2.11";
+
+  src = fetchurl {
+    urls =
+      [ "https://www.zlib.net/fossils/${name}.tar.gz"  # stable archive path
+        "mirror://sourceforge/libpng/zlib/${version}/${name}.tar.gz"
+      ];
+    sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1";
+  };
+
+  patches = lib.optional stdenv.hostPlatform.isCygwin ./disable-cygwin-widechar.patch;
+
+  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
+    substituteInPlace configure \
+      --replace '/usr/bin/libtool' '${stdenv.cc.targetPrefix}ar' \
+      --replace 'AR="libtool"' 'AR="${stdenv.cc.targetPrefix}ar"' \
+      --replace 'ARFLAGS="-o"' 'ARFLAGS="-r"'
+  '';
+
+  outputs = [ "out" "dev" ]
+    ++ lib.optional splitStaticOutput "static";
+  setOutputFlags = false;
+  outputDoc = "dev"; # single tiny man3 page
+
+  # For zlib's ./configure (as of verion 1.2.11), the order
+  # of --static/--shared flags matters!
+  # `--shared --static` builds only static libs, while
+  # `--static --shared` builds both.
+  # So we use the latter order to be able to build both.
+  # Also, giving just `--shared` builds both,
+  # giving just `--static` builds only static,
+  # and giving nothing builds both.
+  # So we have 3 possible ways to build both:
+  # `--static --shared`, `--shared` and giving nothing.
+  # Of these, we choose `--shared`, only because that's
+  # what we did in the past and we can avoid mass rebuilds this way.
+  # As a result, we pass `--static` only when we want just static.
+  configureFlags = lib.optional (static && !shared) "--static"
+                   ++ lib.optional shared "--shared";
+
+  # Note we don't need to set `dontDisableStatic`, because static-disabling
+  # works by grepping for `enable-static` in the `./configure` script
+  # (see `pkgs/stdenv/generic/setup.sh`), and zlib's handwritten one does
+  # not have such.
+  # It wouldn't hurt setting `dontDisableStatic = static && !splitStaticOutput`
+  # here (in case zlib ever switches to autoconf in the future),
+  # but we don't do it simply to avoid mass rebuilds.
+
+  postInstall = lib.optionalString splitStaticOutput ''
+    moveToOutput lib/libz.a "$static"
+  ''
+    # jww (2015-01-06): Sometimes this library install as a .so, even on
+    # Darwin; others time it installs as a .dylib.  I haven't yet figured out
+    # what causes this difference.
+  + lib.optionalString stdenv.hostPlatform.isDarwin ''
+    for file in $out/lib/*.so* $out/lib/*.dylib* ; do
+      ${stdenv.cc.bintools.targetPrefix}install_name_tool -id "$file" $file
+    done
+  ''
+    # Non-typical naming confuses libtool which then refuses to use zlib's DLL
+    # in some cases, e.g. when compiling libpng.
+  + lib.optionalString (stdenv.hostPlatform.libc == "msvcrt" && shared) ''
+    ln -s zlib1.dll $out/bin/libz.dll
+  '';
+
+  # As zlib takes part in the stdenv building, we don't want references
+  # to the bootstrap-tools libgcc (as uses to happen on arm/mips)
+  NIX_CFLAGS_COMPILE = lib.optionalString (!stdenv.hostPlatform.isDarwin) "-static-libgcc";
+
+  # We don't strip on static cross-compilation because of reports that native
+  # stripping corrupted the target library; see commit 12e960f5 for the report.
+  dontStrip = stdenv.hostPlatform != stdenv.buildPlatform && static;
+  configurePlatforms = [];
+
+  installFlags = lib.optionals (stdenv.hostPlatform.libc == "msvcrt") [
+    "BINARY_PATH=$(out)/bin"
+    "INCLUDE_PATH=$(dev)/include"
+    "LIBRARY_PATH=$(out)/lib"
+  ];
+
+  enableParallelBuilding = true;
+  doCheck = true;
+
+  makeFlags = [
+    "PREFIX=${stdenv.cc.targetPrefix}"
+  ] ++ lib.optionals (stdenv.hostPlatform.libc == "msvcrt") [
+    "-f" "win32/Makefile.gcc"
+  ] ++ lib.optionals shared [
+    # Note that as of writing (zlib 1.2.11), this flag only has an effect
+    # for Windows as it is specific to `win32/Makefile.gcc`.
+    "SHARED_MODE=1"
+  ];
+
+  passthru = {
+    inherit version;
+  };
+
+  meta = with lib; {
+    homepage = "https://zlib.net";
+    description = "Lossless data-compression library";
+    license = licenses.zlib;
+    platforms = platforms.all;
+  };
+} // lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
+  preConfigure = ''
+    export CHOST=${stdenv.hostPlatform.config}
+  '';
+} // lib.optionalAttrs (stdenv.hostPlatform.libc == "msvcrt") {
+  dontConfigure = true;
+})
diff --git a/nixpkgs/pkgs/development/libraries/zlib/disable-cygwin-widechar.patch b/nixpkgs/pkgs/development/libraries/zlib/disable-cygwin-widechar.patch
new file mode 100644
index 000000000000..3de4978c3066
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zlib/disable-cygwin-widechar.patch
@@ -0,0 +1,13 @@
+diff --git a/gzguts.h b/gzguts.h
+index 990a4d2..6378d46 100644
+--- a/gzguts.h
++++ b/gzguts.h
+@@ -39,7 +39,7 @@
+ #  include <io.h>
+ #endif
+ 
+-#if defined(_WIN32) || defined(__CYGWIN__)
++#if defined(_WIN32)
+ #  define WIDECHAR
+ #endif
+ 
diff --git a/nixpkgs/pkgs/development/libraries/zlog/default.nix b/nixpkgs/pkgs/development/libraries/zlog/default.nix
new file mode 100644
index 000000000000..b115cf7b675b
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zlog/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  version = "1.2.15";
+  pname = "zlog";
+
+  src = fetchFromGitHub {
+    owner = "HardySimpson";
+    repo = pname;
+    rev = version;
+    sha256 = "10hzifgpml7jm43y6v8c8q0cr9ziyx9qxznafxyw6glhnlqnb7pb";
+  };
+
+  makeFlags = [ "PREFIX=${placeholder "out"}" ];
+
+  meta = with lib; {
+    description= "Reliable, high-performance, thread safe, flexible, clear-model, pure C logging library";
+    homepage = "https://hardysimpson.github.io/zlog/";
+    license = licenses.lgpl21;
+    platforms = platforms.unix;
+    maintainers = [ maintainers.matthiasbeyer ];
+  };
+
+}
diff --git a/nixpkgs/pkgs/development/libraries/zmqpp/default.nix b/nixpkgs/pkgs/development/libraries/zmqpp/default.nix
new file mode 100644
index 000000000000..733573b3e237
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zmqpp/default.nix
@@ -0,0 +1,27 @@
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, zeromq }:
+
+stdenv.mkDerivation rec {
+  pname = "zmqpp";
+  version = "4.2.0";
+
+  src = fetchFromGitHub {
+    owner = "zeromq";
+    repo = "zmqpp";
+    rev = version;
+    sha256 = "08v34q3sd8g1b95k73n7jwryb0xzwca8ib9dz8ngczqf26j8k72i";
+  };
+
+  outputs = [ "out" "dev" ];
+
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  propagatedBuildInputs = [ zeromq ];
+
+  meta = with 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/zookeeper_mt/default.nix b/nixpkgs/pkgs/development/libraries/zookeeper_mt/default.nix
new file mode 100644
index 000000000000..8b9f6b70cfe5
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zookeeper_mt/default.nix
@@ -0,0 +1,56 @@
+{ lib, stdenv
+, fetchurl
+, autoreconfHook
+, jre
+, openssl
+, pkg-config
+# We depend on ZooKeeper for the Jute compiler.
+, zookeeper
+}:
+
+stdenv.mkDerivation rec {
+  pname = "zookeeper_mt";
+  version = lib.getVersion zookeeper;
+
+  src = fetchurl {
+    url = "mirror://apache/zookeeper/${zookeeper.pname}-${version}/apache-${zookeeper.pname}-${version}.tar.gz";
+    sha512 = "90643aa0ae1b9bf1f5e137dfbcee7e3c53db15e5038d7e406e4a1c345d6a0531bf7afa2b03f99d419ebd0fe892f127a7abfe582f786034ba823e53a0a9246bfb";
+  };
+
+  sourceRoot = "apache-${zookeeper.pname}-${version}/zookeeper-client/zookeeper-client-c";
+
+  nativeBuildInputs = [
+    autoreconfHook
+    pkg-config
+    jre
+  ];
+
+  buildInputs = [
+    openssl
+    zookeeper
+  ];
+
+  # Generate the C marshallers/unmarshallers for the Jute-encoded
+  # definitions.
+  preConfigure = ''
+    mkdir generated
+    cd generated
+    java -cp ${zookeeper}/lib/${zookeeper.pname}-jute-${version}.jar \
+        org.apache.jute.compiler.generated.Rcc -l c \
+        ../../../zookeeper-jute/src/main/resources/zookeeper.jute
+    cd ..
+  '';
+
+  configureFlags = [
+    # We're not going to start test servers in the sandbox anyway.
+    "--without-cppunit"
+  ];
+
+  meta = with lib; {
+    homepage = "https://zookeeper.apache.org";
+    description = "Apache Zookeeper";
+    license = licenses.asl20;
+    maintainers = with maintainers; [ commandodev ztzg ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/zxcvbn-c/default.nix b/nixpkgs/pkgs/development/libraries/zxcvbn-c/default.nix
new file mode 100644
index 000000000000..e74bb9ddc32e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zxcvbn-c/default.nix
@@ -0,0 +1,24 @@
+{ lib, stdenv, fetchFromGitHub }:
+stdenv.mkDerivation rec {
+  pname = "zxcvbn-c";
+  version = "2.4";
+
+  src = fetchFromGitHub {
+    owner = "tsyrogit";
+    repo = "zxcvbn-c";
+    rev = "v${version}";
+    sha256 = "12ksdnpxlqlmg9zhyyk3bspcf0sfj5zk735vr4ry635qi7gzcaas";
+  };
+
+  installPhase = ''
+    install -D -t $out/lib libzxcvbn.so*
+  '';
+
+  meta = with lib; {
+    homepage = "https://github.com/tsyrogit/zxcvbn-c";
+    description = "A C/C++ implementation of the zxcvbn password strength estimation";
+    license = licenses.mit;
+    platforms = platforms.linux;
+    maintainers = with maintainers; [ xurei ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/zxing-cpp/default.nix b/nixpkgs/pkgs/development/libraries/zxing-cpp/default.nix
new file mode 100644
index 000000000000..aa7db78c4c32
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zxing-cpp/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, pkg-config
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "zxing-cpp";
+  version = "1.1.1";
+
+  src = fetchFromGitHub {
+    owner = "nu-book";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-N2FTzsjxm3EE5Wqz7xt+FS4zQ60Ow4WbdX6Eo08ktek=";
+  };
+
+  nativeBuildInputs = [
+    cmake
+    pkg-config
+  ];
+
+  cmakeFlags = [
+    "-DBUILD_EXAMPLES=OFF"
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/nu-book/zxing-cpp";
+    description = "C++ port of zxing (a Java barcode image processing library)";
+    longDescription = ''
+      ZXing-C++ ("zebra crossing") is an open-source, multi-format 1D/2D barcode
+      image processing library implemented in C++.
+
+      It was originally ported from the Java ZXing Library but has been
+      developed further and now includes many improvements in terms of quality
+      and performance. It can both read and write barcodes in a number of
+      formats.
+    '';
+    license = licenses.asl20;
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = with platforms; unix;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/zydis/default.nix b/nixpkgs/pkgs/development/libraries/zydis/default.nix
new file mode 100644
index 000000000000..dd3f4b916314
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zydis/default.nix
@@ -0,0 +1,23 @@
+{ lib, stdenv, fetchFromGitHub, cmake }:
+
+stdenv.mkDerivation rec {
+  pname = "zydis";
+  version = "3.1.0";
+
+  src = fetchFromGitHub {
+    owner = "zyantific";
+    repo = "zydis";
+    rev = "bfee99f49274a0eec3ffea16ede3a5bda9cda88f";
+    sha256 = "0x2lpc33ynd0zzirdxp2lycvg3545wh1ssgy4qlv81471iwwzv6b";
+    fetchSubmodules = true;
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  meta = with lib; {
+    description = "Fast and lightweight x86/x86-64 disassembler library";
+    license = licenses.mit;
+    maintainers = [ maintainers.jbcrail ];
+    platforms = platforms.all;
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/zziplib/default.nix b/nixpkgs/pkgs/development/libraries/zziplib/default.nix
new file mode 100644
index 000000000000..90758db16edd
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/zziplib/default.nix
@@ -0,0 +1,81 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, cmake
+, perl
+, pkg-config
+, python3
+, xmlto
+, zip
+, zlib
+}:
+
+stdenv.mkDerivation rec {
+  pname = "zziplib";
+  version = "0.13.72";
+
+  src = fetchFromGitHub {
+    owner = "gdraheim";
+    repo = pname;
+    rev = "v${version}";
+    hash = "sha256-Ht3fBgdrTm4mCi5uhgQPNtpGzADoRVOpSuGPsIS6y0Q=";
+  };
+
+  patches = [
+    # apply https://github.com/gdraheim/zziplib/pull/113
+    (fetchpatch {
+      url = "https://github.com/gdraheim/zziplib/commit/82a7773cd17828a3b0a4f5f552ae80c1cc8777c7.diff";
+      sha256 = "0ifqdzxwb5d19mziy9j6lhl8wj95jpxzm0d2c6y3bgwa931avd3y";
+    })
+    (fetchpatch {
+      url = "https://github.com/gdraheim/zziplib/commit/1cd611514c5f9559eb9dfc191d678dfc991f66db.diff";
+      sha256 = "11w9qa46xq49l113k266dnv8izzdk1fq4y54yy5w8zps8zd3xfny";
+    })
+    (fetchpatch {
+      url = "https://github.com/gdraheim/zziplib/commit/e47b1e1da952a92f917db6fb19485b8a0b1a42f3.diff";
+      sha256 = "0d032hkmi3s3db12z2zbppl2swa3gdpbj0c6w13ylv2g2ixglrwg";
+    })
+  ];
+
+  nativeBuildInputs = [
+    cmake
+    perl
+    pkg-config
+    python3
+    xmlto
+    zip
+  ];
+  buildInputs = [
+    zlib
+  ];
+
+  # test/zziptests.py requires network access
+  # (https://github.com/gdraheim/zziplib/issues/24)
+  cmakeFlags = [
+    "-DZZIP_TESTCVE=OFF"
+    "-DBUILD_SHARED_LIBS=True"
+    "-DBUILD_STATIC_LIBS=False"
+    "-DBUILD_TESTS=OFF"
+    "-DMSVC_STATIC_RUNTIME=OFF"
+    "-DZZIPSDL=OFF"
+    "-DZZIPTEST=OFF"
+    "-DZZIPWRAP=OFF"
+    "-DBUILDTESTS=OFF"
+  ];
+
+  meta = with lib; {
+    homepage = "https://github.com/gdraheim/zziplib";
+    description = "Library to extract data from files archived in a zip file";
+    longDescription = ''
+      The zziplib library is intentionally lightweight, it offers the ability to
+      easily extract data from files archived in a single zip file.
+      Applications can bundle files into a single zip archive and access them.
+      The implementation is based only on the (free) subset of compression with
+      the zlib algorithm which is actually used by the zip/unzip tools.
+    '';
+    license = with licenses; [ lgpl2Plus mpl11 ];
+    maintainers = with maintainers; [ AndersonTorres ];
+    platforms = python3.meta.platforms;
+  };
+}