about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-01-26 18:06:19 +0000
committerAlyssa Ross <hi@alyssa.is>2021-01-26 18:21:18 +0000
commit7ac6743433dd45ceaead2ca96f6356dc0d064ce6 (patch)
treeb68ec89d7d2a8d2b6e6b1ff94ba26d6af4096350 /nixpkgs/pkgs/development/libraries
parentc5c7451dbef37b51f52792d6395a670ef5183d27 (diff)
parent891f607d5301d6730cb1f9dcf3618bcb1ab7f10e (diff)
downloadnixlib-7ac6743433dd45ceaead2ca96f6356dc0d064ce6.tar
nixlib-7ac6743433dd45ceaead2ca96f6356dc0d064ce6.tar.gz
nixlib-7ac6743433dd45ceaead2ca96f6356dc0d064ce6.tar.bz2
nixlib-7ac6743433dd45ceaead2ca96f6356dc0d064ce6.tar.lz
nixlib-7ac6743433dd45ceaead2ca96f6356dc0d064ce6.tar.xz
nixlib-7ac6743433dd45ceaead2ca96f6356dc0d064ce6.tar.zst
nixlib-7ac6743433dd45ceaead2ca96f6356dc0d064ce6.zip
Merge commit '891f607d5301d6730cb1f9dcf3618bcb1ab7f10e'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries')
-rw-r--r--nixpkgs/pkgs/development/libraries/AntTweakBar/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/CGAL/4.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/CGAL/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/CoinMP/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/LAStools/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/LASzip/LASzip2.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/LASzip/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/NSPlist/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/PlistCpp/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2_gfx/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2_image/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2_mixer/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2_net/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL2_ttf/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_Pango/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_gfx/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_gpu/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_image/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_mixer/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_net/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_sixel/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_stretch/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/SDL_ttf/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/Xaw3d/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/a52dec/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/aalib/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/abseil-cpp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/accounts-qt/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/accountsservice/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/ace/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/acl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/afflib/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/aften/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/agda-prelude/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/functional-linear-algebra/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/iowa-stdlib/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/agda/standard-library/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/agg/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/alembic/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/alkimia/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/allegro/5.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/allegro/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/alure/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/alure2/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/amdvlk/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/aml/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/amrnb/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/amrwb/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/amtk/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/apache-activemq/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/appstream-glib/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/appstream/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/apr-util/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/apr/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/aqbanking/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/aqbanking/gwenhywfar.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/aqbanking/libchipcard.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/aravis/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/arb/default.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/argp-standalone/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/argtable/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/arguments/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/aribb25/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/armadillo/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/arrayfire/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/asio/generic.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/aspell/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/aspell/dictionaries.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/assimp/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/at-spi2-atk/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/at-spi2-core/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/atk/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/atkmm/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/attr/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/aubio/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/audiality2/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/jamomacore/default.nix25
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/libbass/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/libbs2b/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/libgme/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/libinstpatch/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/libmysofa/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/libsmf/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/lilv/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/lv2/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/lvtk/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/mbelib/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/ntk/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/qm-dsp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/raul/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/rtaudio/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/rtmidi/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/sratom/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/suil/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/zita-convolver/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/audio/zita-resampler/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/audiofile/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/avahi/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/avro-c++/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/avro-c/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/aws-c-cal/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/aws-c-common/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/aws-c-event-stream/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/aws-c-io/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/aws-checksums/default.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/aws-sdk-cpp/cmake-dirs.patch10
-rw-r--r--nixpkgs/pkgs/development/libraries/aws-sdk-cpp/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/ayatana-ido/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/babl/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/bamf/default.nix8
-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.nix83
-rw-r--r--nixpkgs/pkgs/development/libraries/bcg729/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/bctoolbox/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/beecrypt/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/beignet/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/belcard/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/belle-sip/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/belr/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/biblesync/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/bobcat/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/boehm-gc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/boolstuff/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/boost-process/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/1.67.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/1.71.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/boost/generic.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/bootil/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/boringssl/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/botan/generic.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/box2d/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/boxfort/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/brigand/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/buddy/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/bullet/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/bullet/roboschool-fork.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/bulletml/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/bwidget/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/bzrtp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/c-ares/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/c-blosc/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/caf/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cairo/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/cairomm/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/capnproto/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/capstone/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/catch/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/catch2/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/ccrtp/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/cctz/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/cddlib/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/cdk/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/cdo/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/cegui/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/celt/generic.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/cereal/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ceres-solver/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/cfitsio/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/cgui/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/check/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/chipmunk/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/chmlib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/chromaprint/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/cimg/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/civetweb/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/classads/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/clearsilver/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/clfft/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/clipp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/clipper/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cln/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cloog-ppl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/cloog/0.18.0.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/cloog/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/clucene-core/2.x.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/clucene-core/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/clutter-gst/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/clutter-gtk/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/clutter/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/cm256cc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cmark-gfm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cmark/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cminpack/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/cmocka/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cmrt/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/codec2/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cogl/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/coin3d/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/comedilib/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/concurrencykit/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/cpp-hocon/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/cpp-ipfs-api/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/cpp-netlib/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/cpp-utilities/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/cppcms/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/cppdb/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/cpptest/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/cppunit/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cpputest/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/cppzmq/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cracklib/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/crc32c/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/crcpp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cre2/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/criterion/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/crypto++/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/csfml/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/ctl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/ctpl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/ctpp2/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/ctypes_sh/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/cudd/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/curlcpp/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/curlpp/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/cutee/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cutelyst/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/cwiid/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/cxx-prettyprint/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/cxxtest/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/cxxtools/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/cyrus-sasl/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/czmq/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/dav1d/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/db/db-4.8.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/db/db-5.3.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/db/db-6.0.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/db/db-6.2.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/db/generic.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus-cplusplus/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus-glib/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus-sharp-glib/dbus-sharp-glib-1.0.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus-sharp-glib/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus-sharp/dbus-sharp-1.0.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus-sharp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/dbus/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/dbxml/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/dclib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/dclxvi/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/dconf/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/dee/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/directfb/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/discord-rpc/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/dleyna-connector-dbus/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/dleyna-core/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/dleyna-renderer/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/dleyna-server/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/dlib/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/docopt_cpp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/doctest/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/dotconf/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/dotnetfx35/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/dotnetfx40/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/double-conversion/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/dqlite/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/draco/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/drumstick/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/dssi/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/duckdb/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/dxflib/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/dyncall/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/easyloggingpp/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/eccodes/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/eclib/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/editline/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/egl-wayland/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/eigen/2.0.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/eigen/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/elementary-cmake-modules/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/elf-header/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/embree/2.x.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/embree/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/enchant/1.x.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/enchant/2.x.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/enet/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/entt/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/epoxy/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/ethash/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/eventlog/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/exempi/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/exiv2/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/exosip/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/expat/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/faac/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/faad2/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/farbfeld/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/farstream/default.nix8
-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.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/fastpbkdf2/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/faudio/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/fcft/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/fcgi/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/fcppt/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/fdk-aac/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/fflas-ffpack/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpeg-full/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpeg-sixel/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpeg/generic.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/ffmpegthumbnailer/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ffms/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/fftw/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/filter-audio/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/flann/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/flatbuffers/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/flatcc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/flatpak/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/flint/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/flite/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/fltk/1.4.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/fltk/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/fmt/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/folks/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/folly/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/fontconfig/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/forge/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/fox/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/fox/fox-1.6.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/fplll/20160331.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/fplll/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/frame/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/freealut/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/freeglut/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/freenect/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/freetds/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/freetype/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/frei0r/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/fribidi/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/fstrcmp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/fstrm/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/ftgl/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/funambol/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gaia/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/galario/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/gamenetworkingsockets/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/gamin/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/ganv/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/garmintools/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gbenchmark/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/gcab/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/gcc/libstdc++/5.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gcr/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gd/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gdal/2.4.0.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/gdal/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/gdal/gdal-1_11.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gdata-sharp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gdbm/0001-Remove-duplicate-assignments.patch25
-rw-r--r--nixpkgs/pkgs/development/libraries/gdbm/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gdcm/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/gdk-pixbuf/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/gdk-pixbuf/xlib.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gdl/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gdome2/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gecode/3.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gecode/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gegl/4.0.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/gegl/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/geis/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/genann/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gensio/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/geoclue/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/geocode-glib/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/geoip/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/geos/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/getdata/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/getdns/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gettext/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gexiv2/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gf2x/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/gfbgraph/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gflags/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ggz_base_libs/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/giblib/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/giflib/4.1.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/giflib/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/giflib/libungif.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gio-sharp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/git2/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/givaro/3.7.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/givaro/3.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/givaro/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/gjs/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/gl2ps/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/glbinding/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gle/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/glew/1.10.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/glew/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/glfw/2.x.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/glfw/3.x.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/glib-networking/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/glib-testing/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/glib/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/2.32-25.patch.gz (renamed from nixpkgs/pkgs/development/libraries/glibc/2.32-10.patch.gz)bin24498 -> 42959 bytes
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/common.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/glibc/locales.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/glibmm/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/glm/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/globalarrays/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/globalplatform/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/globalplatform/gppcscconnectionplugin.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/glog/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/gloox/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/glpk/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/glui/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gmime/2.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gmime/3.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gmm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gmp/4.3.2.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gmp/5.1.x.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gmp/6.x.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gmtk/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gnet/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gnome-menus/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gnome-online-accounts/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gnome-sharp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gnome-video-effects/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gnu-config/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gnu-efi/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gnutls-kdh/generic.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gnutls/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gobject-introspection/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/goffice/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gom/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/goocanvas/2.x.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/goocanvas/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/goocanvasmm/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gperftools/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/gpgme/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/gpgme/fix-clang-autoconf-undeclared-warning.patch36
-rw-r--r--nixpkgs/pkgs/development/libraries/grail/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/grantlee/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/graphene-hardened-malloc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/graphene/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/grib-api/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/grilo-plugins/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/grilo/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/grpc/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/gsasl/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gsettings-desktop-schemas/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gsettings-qt/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gsignond/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gsignond/plugins/lastfm.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gsignond/plugins/mail.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gsignond/plugins/oauth.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gsignond/plugins/sasl.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gsl/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gsl/gsl-1_16.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gsm/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/gsmlib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gsoap/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gsound/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gspell/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/gss/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gssdp/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/devtools/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/gstreamermm/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gstreamer/vaapi/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gtdialog/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/gtest/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gthree/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-engine-bluecurve/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-engine-murrine/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-engines/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-layer-shell/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-mac-integration/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-sharp-beans/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-sharp/2.0.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk-sharp/3.0.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/2.x.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gtk/3.x.nix114
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkd/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkdatabox/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkimageview/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkmathview/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkmm/2.x.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkmm/3.x.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gtksourceview/3.x.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gtksourceview/4.x.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gtksourceviewmm/4.x.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gtksourceviewmm/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkspell/3.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkspell/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gtkspellmm/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/gts/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/gumbo/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/gupnp-av/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gupnp-dlna/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gupnp-igd/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gupnp/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/gusb/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/gvfs/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/half/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/hamlib/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/harfbuzz/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/hawknl/default.nix6
-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/hidapi/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/highfive/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/hiredis/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/hivex/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/hotpatch/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/howard-hinnant-date/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/hpx/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/hspell/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/htmlcxx/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/http-parser/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/hunspell/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/hunspell/dictionaries.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/hwloc/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/hyena/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/hyperscan/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/hyphen/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/icu/base.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/id3lib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/idnkit/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/igraph/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ijs/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/iksemel/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/ilbc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ilixi/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/ilmbase/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/iml/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/imlib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/imlib2/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/impy/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/inchi/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/incrtcl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/indicator-application/gtk2.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/indicator-application/gtk3.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/indilib/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/inih/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/iniparser/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/intel-gmmlib/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/intel-media-driver/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/intel-media-sdk/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/ip2location-c/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/irrlicht/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/irrlicht/mac.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/isl/0.11.1.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/isl/0.14.1.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/isl/0.17.1.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/isl/0.20.0.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/iso-codes/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/itk/4.x.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/itk/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/itktcl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/jabcode/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/jama/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/jansson/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/java/commons/bcel/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/java/commons/bsf/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/java/commons/compress/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/java/commons/fileupload/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/java/commons/io/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/java/commons/lang/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/java/commons/logging/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/java/commons/math/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/java/cup/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/java/dbus-java/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/java/geoipjava/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/java/gwt-dragdrop/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/java/gwt-widgets/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/java/hsqldb/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/java/httpunit/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/java/hydra-ant-logger/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/java/jdom/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/java/jflex/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/java/junit/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/java/junixsocket/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/java/libmatthew-java/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/java/lombok/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/java/lucene/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/java/mockobjects/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/java/rhino/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/java/saxon/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/java/smack/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/java/swt/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/jbig2dec/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/jbigkit/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/jcal/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/jemalloc/common.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/jemalloc/jemalloc450.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/jitterentropy/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/jose/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/json-c/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/json-glib/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/jsoncpp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/jsonrpc-glib/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/judy/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/jxrlib/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/kde-frameworks/kirigami2.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/kerberos/heimdal.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/kerberos/krb5.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/keybinder/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/keybinder3/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/keystone/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/khronos-ocl-icd-loader/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/kissfft/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/kmsxx/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/kpmcore/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/kyotocabinet/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/l-smash/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/lame/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/frog.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/frogdata.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/libfolia.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/mbt.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/ticcutils.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/timbl.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/timblserver.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/ucto.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/languagemachines/uctodata.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/lasem/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/lasso/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/lcms/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/lcms2/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ldacbt/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ldb/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ldns/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/leatherman/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/lensfun/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/leptonica/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/lesstif/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/leveldb/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/levmar/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/lib3ds/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/lib3mf/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libAfterImage/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libHX/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libLAS/default.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/libaacs/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libaal/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libabigail/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libabw/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libaccounts-glib/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libaec/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libagar/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libagar/libagar_test.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libamqpcpp/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libantlr3c/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libao/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libaom/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libaosd/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libappindicator/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libarchive/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/libargon2/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libasr/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libass/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libassuan/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libast/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libasyncns/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libatomic_ops/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/libaudclient/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libav/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libavc1394/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libavif/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libayatana-appindicator/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libayatana-indicator/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libb2/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libb64/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libbacktrace/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libbap/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libbdplus/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libbfd/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libbladeRF/default.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/libblockdev/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libblocksruntime/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libbluedevil/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/libbluray/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libbsd/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libbson/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libburn/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libbytesize/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libcaca/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libcacard/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libcanberra/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libcangjie/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libcbor/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libcdaudio/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libcddb/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libcdio-paranoia/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libcdio/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libcdr/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libcec/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libcec/platform.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libcef/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libcello/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libchamplain/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libchardet/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libchewing/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libchop/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libcint/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libck/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libclc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libcli/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libcloudproviders/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libclthreads/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libclxclient/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libcmis/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libco-canonical/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libcollectdclient/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libcommuni/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libconfig/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libconfuse/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libcouchbase/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libcrafter/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libcredis/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libcrossguid/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libcryptui/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libcsptr/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libctb/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libctemplate/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libcue/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libcutl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libdaemon/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libdap/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libdatrie/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libdazzle/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libdbi-drivers/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libdbi/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libdbusmenu-qt/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libdbusmenu/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libdc1394/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libde265/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libdevil/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libdigidoc/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libdigidocpp/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libdiscid/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libdivecomputer/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libdivsufsort/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libdmtx/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libdnet/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libdrm/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libdv/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libdvbpsi/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libdvdcss/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libdvdnav/4.2.1.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libdvdnav/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libdvdread/4.9.9.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libdvdread/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libdwarf/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libdwg/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libdynd/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libe-book/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libe57format/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libeatmydata/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libeb/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libebml/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libebur128/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libechonest/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/libedit/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libee/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libelf-freebsd/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libelf/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libelfin/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libepc/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/liberfa/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/liberio/default.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/libesmtp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libestr/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libetpan/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libev/default.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/libevdev/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libevdevplus/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libevent/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/libewf/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/libexecinfo/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libexif/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libextractor/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/libexttextcat/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libf2c/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libfakekey/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libfaketime/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libff/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libffcall/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libffi/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libfido2/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libfilezilla/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/libfishsound/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libfive/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libfixposix/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libfm/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libfprint/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libfpx/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libfreefare/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libfsm/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libftdi/1.x.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libfyaml/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libgadu/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libgaminggear/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libgcrypt/1.5.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libgcrypt/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/libgda/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libgdamm/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libgdata/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libgdiplus/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libgee/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libgeotiff/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libgepub/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libgig/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libgit2-glib/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libgksu/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libglvnd/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libgnome-keyring/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libgnomekbd/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libgnurl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libgpg-error/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libgphoto2/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libgpiod/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libgpod/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libgringotts/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libgroove/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/libgrss/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libgsf/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libgssglue/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libgtop/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libgudev/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libguestfs/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libgumath/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libgweather/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libgxps/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libhandy/0.x.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libhandy/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/libhangul/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libharu/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/libhdhomerun/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libheif/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libhttpseverywhere/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libiberty/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libibmad/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libibumad/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libical/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libicns/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libid3tag/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libidn/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libidn2/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libiec61883/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libieee1284/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libiio/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libimagequant/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libime/default.nix63
-rw-r--r--nixpkgs/pkgs/development/libraries/libimobiledevice/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libindicator/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libinfinity/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/libinjection/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libinklevel/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libinotify-kqueue/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libinput/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libiodbc/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libipfix/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libipt/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libiptcdata/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libircclient/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libirecovery/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libiscsi/default.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/libisds/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libisoburn/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libisofs/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libite/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libivykis/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libixp-hg/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libjcat/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libjpeg/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libjreen/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/libjson-rpc-cpp/default.nix72
-rw-r--r--nixpkgs/pkgs/development/libraries/libjson/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libkate/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libkeyfinder/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libkml/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libksba/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libksi/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libktorrent/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/liblangtag/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/liblastfm/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/liblastfmSF/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/liblaxjson/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/liblcf/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/liblinear/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/liblinphone/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/liblo/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/liblockfile/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/liblogging/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/liblognorm/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/liblouis/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/liblqr-1/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/liblscp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libltc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/liblxi/default.nix34
-rw-r--r--nixpkgs/pkgs/development/libraries/libmad/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libmanette/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libmatchbox/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libmatheval/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libmatroska/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libmaxminddb/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libmbim/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmcrypt/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libmd/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmediaart/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libmediainfo/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libmemcached/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libmesode/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmhash/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmicrodns/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libmicrohttpd/0.9.72.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libmicrohttpd/generic.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libmikmod/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libmilter/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libminc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmkv/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libmms/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libmng/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmnl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libmodbus/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmodplug/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmodule/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libmodulemd/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmongo-client/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libmowgli/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmp3splt/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmpack/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libmpc/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libmpcdec/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libmpeg2/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libmrss/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libmspack/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libmtp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libmusicbrainz/5.x.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libmusicbrainz/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/libmwaw/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libmx/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libmypaint/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libmysqlconnectorcpp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libnabo/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/libnatpmp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libnats-c/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/libnatspec/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libndctl/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libndp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libndtypes/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libnest2d/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libnet/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libnetfilter_acct/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libnetfilter_conntrack/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libnetfilter_cthelper/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libnetfilter_cttimeout/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libnetfilter_log/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libnetfilter_queue/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libnfc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libnfnetlink/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libnfs/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libnftnl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libngspice/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libnice/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libnih/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libnixxml/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libnotify/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libnova/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libnsl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libnxml/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/liboauth/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libodfgen/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libofa/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libofx/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libogg/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/liboggz/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/liboil/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libomxil-bellagio/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/liboop/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libopcodes/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libopenaptx/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/liboping/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libopus/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libopusenc/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libosinfo/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libosmium/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libosmpbf/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libossp-uuid/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libotr/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libow/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libowfat/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libp11/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libpam-wrapper/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libpaper/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libpar2/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libpcap/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libpeas/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libpfm/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libpgf/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libphonenumber/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libpinyin/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libpipeline/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libplacebo/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/libplist/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/libpng/12.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libpng/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libpointmatcher/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libportal/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libproxy/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libpseudo/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libpsl/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libpst/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libqalculate/default.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/libqb/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libqglviewer/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libqmi/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libquotient/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libr3/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libraspberrypi/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libraw/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libraw1394/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/librdf/raptor.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/librdf/raptor2.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/librdf/rasqal.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/librdf/redland.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/libre/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/librealsense/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libredwg/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/librelp/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/librem/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/librep/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libresample/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libressl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/librest/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/librevenge/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/librevisa/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/librime/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libroxml/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/librseq/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/librsvg/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/librsync/0.9.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/librsync/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/librtprocess/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libs3/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libsamplerate/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libsass/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libschrift/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/libscrypt/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libsearpc/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libseccomp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libsecret/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libserialport/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libshout/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libsidplayfp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libsieve/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libsigcxx/1.2.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libsigcxx/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libsignal-protocol-c/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libsignon-glib/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libsigsegv/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libsixel/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libskk/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libslirp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libsmartcols/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libsmi/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libsnark/default.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/libsndfile/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libsodium/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libsolv/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libsoundio/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libsoup/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libspatialindex/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libspatialite/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libspectre/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libspectrum/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libspf2/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libspiro/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libspotify/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/libsrs2/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libssh/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libssh2/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libstatgrab/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libstroke/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libstrophe/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libsurvive/default.nix40
-rw-r--r--nixpkgs/pkgs/development/libraries/libsvm/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libsystemtap/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libtap/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libtar/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libtasn1/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libtcod/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/libtelnet/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libtermkey/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libthai/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libtheora/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libthreadar/default.nix4
-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/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libtifiles2/default.nix38
-rw-r--r--nixpkgs/pkgs/development/libraries/libtiger/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libtins/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/libtomcrypt/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libtommath/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.1.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.2.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libtoxcore/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libtoxcore/new-api.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libtsm/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libu2f-host/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libu2f-server/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libubox/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libuchardet/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libucl/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libuecc/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libui/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libuinputplus/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libunarr/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libunibreak/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libuninameslist/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libunique/3.x.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libunique/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libunistring/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libunity/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libunwind/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/liburcu/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/liburing/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libusb-compat/0.1.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libusb1/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libusbmuxd/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libuv/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libuvc/default.nix30
-rw-r--r--nixpkgs/pkgs/development/libraries/libva/1.0.0.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libva/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libva/utils.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libvdpau-va-gl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libvdpau/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libversion/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libviper/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libvirt-glib/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libvirt/0001-meson-patch-in-an-install-prefix-for-building-on-nix.patch340
-rw-r--r--nixpkgs/pkgs/development/libraries/libvirt/5.9.0.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libvirt/default.nix137
-rw-r--r--nixpkgs/pkgs/development/libraries/libvisio/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libvisual/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libvmaf/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/libvmi/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libvncserver/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libvorbis/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libvpx/1_8.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libvpx/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libvterm-neovim/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libvterm/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libwacom/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libwebp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libwebsockets/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libwhereami/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libwmf/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libwnck/3.x.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libwnck/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/libwpd/0.8.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libwpd/default.nix10
-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.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libwps/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libx86/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libx86/src-for-default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libx86emu/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libxc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libxcomp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libxdg-basedir/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libxkbcommon/default.nix35
-rw-r--r--nixpkgs/pkgs/development/libraries/libxkbcommon/libxkbcommon_7.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libxklavier/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libxl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libxls/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libxmi/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libxml2/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/libxmlb/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libxmlxx/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libxmlxx/v3.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libxmp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libxslt/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/libxsmm/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libyaml-cpp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libyaml/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libykclient/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libykneomgr/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libyubikey/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libzapojit/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/libzdb/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libzen/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/libzip/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/libzmf/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/libzra/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/lief/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/lightning/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/lightstep-tracer-cpp/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/lime/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/linbox/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/linenoise-ng/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/linenoise/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/liquid-dsp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/liquidfun/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/lirc/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/live555/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/lmdb/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/lmdbxx/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/log4cplus/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/log4cpp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/log4cxx/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/log4shib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/loki/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/loudmouth/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/lrdf/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/luabind/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/lucene++/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/luksmeta/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/lyra/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/lzo/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/mac/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/mailcore2/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/malcontent/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/malcontent/ui.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/mapnik/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/marisa/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/marl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/martyr/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/matio/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/mbedtls/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/mdds/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/medfile/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/mediastreamer/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/mediastreamer/msopenh264.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/menu-cache/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/mesa-glu/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/mesa/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/metal/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/microsoft_gsl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/mimalloc/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/mimetic/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/miniball/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/minixml/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/minizip/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/minizip2/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/mlt/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/mlt/qt-5.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/mm-common/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/mongoc/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/mono-addins/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/motif/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/movit/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/mp4v2/default.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/mp4v2/fix-build-clang.patch13
-rw-r--r--nixpkgs/pkgs/development/libraries/mpfi/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/mpfr/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/mpich/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/mpir/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/mps/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/msgpack/generic.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/msgpuck/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/msilbc/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/mtdev/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/mtxclient/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/multipart-parser-c/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/mumlib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/muparser/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/muparserx/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/mutest/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/mygui/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/mypaint-brushes/1.0.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/mypaint-brushes/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/mysocketw/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/mythes/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/nanoflann/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/nanomsg/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/nco/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/ncurses/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ndi/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ndn-cxx/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ndpi/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/neardal/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/neatvnc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/neon/0.29.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/neon/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/netcdf-cxx4/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/netcdf-fortran/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/netcdf/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/nettle/generic.nix8
-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.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/nghttp2/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/ngt/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/nix-plugins/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/nlopt/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/notcurses/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/notify-sharp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/npapi-sdk/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/npth/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/nspr/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/nss/3.44.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/nss/3.53.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/nss/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/nss_wrapper/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/nsss/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ntbtls/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/ntdb/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ntirpc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ntrack/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/nuraft/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/nuspell/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/nv-codec-headers/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/nvidia-optical-flow-sdk/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/nvidia-texture-tools/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/nvidia-video-sdk/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/oatpp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ocl-icd/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ode/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/odpic/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/ogdf/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/ogre/1.9.x.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/ogre/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/ogrepaged/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/ois/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/olm/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/oniguruma/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/opae/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/openal-soft/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/openbabel/2.nix31
-rw-r--r--nixpkgs/pkgs/development/libraries/openbabel/default.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/openbr/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/opencascade-occt/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/opencascade/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/opencl-clang/default.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/opencl-clhpp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/opencl-headers/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/opencollada/default.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/opencolorio/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/opencore-amr/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/opencsg/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/openct/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/opencv/3.x.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/opencv/4.x.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/opencv/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/opendbx/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/opendht/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/opendkim/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/opendmarc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/openexr/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/openexrid-unstable/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/openfst/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/openfx/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/opengrm-ngram/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/openh264/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/openhmd/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/openimagedenoise/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/openjpeg/2.x.nix26
-rw-r--r--nixpkgs/pkgs/development/libraries/openjpeg/fix-cmake-config-includedir.patch11
-rw-r--r--nixpkgs/pkgs/development/libraries/openjpeg/generic.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/openldap/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/openmpi/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/openpa/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/opensaml-cpp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/openscenegraph/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/openslp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/openssl/chacha.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/openssl/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/opensubdiv/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/opentracing-cpp/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/openvdb/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/openwsman/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/openxr-loader/default.nix5
-rw-r--r--nixpkgs/pkgs/development/libraries/openzwave/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/oracle-instantclient/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/orcania/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ortp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/osip/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/osm-gps-map/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/p11-kit/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/packr/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/pagmo2/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/pango/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/pangolin/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/pangomm/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/pangoxsl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/partio/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/pc-ble-driver/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/pcaudiolib/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/pcg-c/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/pcl/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/pcre/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/pcre2/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/pdal/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/pdf2xml/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/pe-parse/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/phash/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/phonetisaurus/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/phonon/backends/vlc.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/phonon/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/physfs/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/apfel/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/apfelgrid/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/applgrid/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/cernlib/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/fastjet-contrib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/fastjet/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/fastnlo/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/geant4/default.nix21
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/hepmc2/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/hepmc3/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/herwig/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/hoppet/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/lhapdf/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/lhapdf/pdf_sets.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/mela/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/nlojet/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/pythia/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/rivet/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/thepeg/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/physics/yoda/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/pipewire/0.2.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/pipewire/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/pixman/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/pkcs11helper/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/pkger/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/plib/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/plplot/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/pmdk/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/pmix/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/png++/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/pocketsphinx/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/poco/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/podofo/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/polkit-qt-1/qt-4.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/polkit-qt-1/qt-5.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/polkit/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/poly2tri-c/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/poppler/0.61.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/poppler/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/popt/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/portaudio/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/portmidi/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/ppl/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/precice/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/prison/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/proj-datumgrid/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/proj/5.2.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/proj/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/prometheus-client-c/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/prometheus-cpp/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/prometheus-cpp/prometheus-cpp.pc.in10
-rw-r--r--nixpkgs/pkgs/development/libraries/properties-cpp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/generic-v3.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/protobuf/generic.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/protobufc/generic.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/prototypejs/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/protozero/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/pslib/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/psol/generic.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/psqlodbc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/pstreams/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/ptex/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/pth/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/pupnp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/pxlib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/pyotherside/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/python-qt/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qca-qt5/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/qca2/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/qgnomeplatform/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qhull/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qimageblitz/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/qjson/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/qmlbox2d/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qmltermwidget/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/qoauth/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qpdf/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qrcodegen/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qrencode/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/qrupdate/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/qscintilla/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-3/default.nix24
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-4.x/4.8/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.12/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.14/default.nix20
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtconnectivity.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtgamepad.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtlocation.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtmacextras.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtwayland.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebkit.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebview.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qt-mobility/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qtinstaller/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/qtkeychain/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/qtpbfimageplugin/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qtscriptgenerator/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/qtstyleplugins/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qtutilities/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/qtwebkit-plugins/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/quazip/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/quesoglc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/quickder/default.nix4
-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.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qwt/6_qt4.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/qwt/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/qxt/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/rabbitmq-c/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/rabbitmq-java-client/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/raft-canonical/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/randomx/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/rang/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/range-v3/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/rapidcheck/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/rapidjson/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/rapidxml/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/rarian/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/rdkafka/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/re2/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/5.x.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/6.2.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/6.3.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/7.0.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/readline/8.0.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/readosm/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/redkite/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/rep-gtk/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/resolv_wrapper/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/rlog/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/rlottie/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/rnnoise-plugin/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/robin-map/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/rocclr/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/rocksdb/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/rocm-comgr/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/rocm-device-libs/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/rocm-opencl-icd/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/rocm-opencl-runtime/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/rocm-runtime/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/rocm-thunk/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/rote/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/rttr/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/rubberband/default.nix19
-rw-r--r--nixpkgs/pkgs/development/libraries/s2n/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/safefile/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/sbc/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/sblim-sfcc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/schroedinger/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/benchmark/papi/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/EBTKS/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/bicgl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/bicpl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/bpp-core/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/bpp-seq/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/elastix/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/gifticlib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/mirtk/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/nifticlib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/biology/oobicpl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/electronics/qcsxcad/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/QuadProgpp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/amd-blis/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/amd-libflame/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/arpack/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/blas/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/blis/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/brial/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/caffe2/default.nix43
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/cholmod-extra/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/clblas/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/cliquer/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/clmagma/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/ecos/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/flintqs/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/ipopt/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/itpp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/lcalc/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/libbraiding/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/libhomfly/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/liblbfgs/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/libtorch/bin.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/lrs/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/m4ri/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/m4rie/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/magma/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/metis/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/mongoose/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/nccl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/openspecfun/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/or-tools/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/osi/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/osqp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/parmetis/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/petsc/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/planarity/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/rankwidth/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/rubiks/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/scs/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/spooles/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/suitesparse-graphblas/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.2.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.4.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/suitesparse/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/superlu/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/sympow/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/tensorflow/bin.nix28
-rw-r--r--nixpkgs/pkgs/development/libraries/science/math/tensorflow/binary-hashes.nix20
-rwxr-xr-xnixpkgs/pkgs/development/libraries/science/math/tensorflow/prefetcher.sh6
-rw-r--r--nixpkgs/pkgs/development/libraries/science/networking/ns-3/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/science/robotics/ispike/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/scmccid/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/scriptaculous/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/seasocks/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/sentencepiece/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/serd/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/serf/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/serialdv/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/sfml/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/sfsexp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/shapelib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/shhmsg/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/shhopt/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/shibboleth-sp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/silgraphite/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/silgraphite/graphite2.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/simdjson/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/simgear/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/simpleitk/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/skalibs/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/slang/default.nix62
-rw-r--r--nixpkgs/pkgs/development/libraries/slib/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/smarty3-i18n/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/smarty3/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/smesh/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/smpeg/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/smpeg2/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/snack/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/snappy/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/soci/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/socket_wrapper/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/sofia-sip/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/sonic/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/soprano/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/soqt/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/sord/default.nix18
-rw-r--r--nixpkgs/pkgs/development/libraries/soxt/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/spandsp/3.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/spandsp/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/sparsehash/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/spatialite-tools/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/spdk/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/spdlog/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/speech-tools/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/speechd/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/speex/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/speexdsp/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/sphinxbase/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/spice-gtk/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/spice-protocol/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/spice/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/spirv-headers/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/sqlcipher/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/sqlite/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/sqlite/sqlar.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/sqlite/tools.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/srt/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/srtp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/startup-notification/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/stb/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/stellarsolver/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/stfl/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/stlport/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/stxxl/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/subunit/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/sundials/default.nix69
-rw-r--r--nixpkgs/pkgs/development/libraries/svrcore/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/swiften/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/swiftshader/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/sword/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/sycl-info/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/symengine/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/szip/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/t1lib/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/tachyon/default.nix22
-rw-r--r--nixpkgs/pkgs/development/libraries/taglib-extras/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/taglib-sharp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/taglib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/talloc/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/tbb/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/tclap/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/tcllib/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/tcltls/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/tclx/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/tdb/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/tdlib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/tecla/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/telepathy/farstream/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/telepathy/glib/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/telepathy/qt/default.nix9
-rw-r--r--nixpkgs/pkgs/development/libraries/template-glib/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/tepl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/termbox/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/tevent/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/theft/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/thrift/0.10.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/thrift/default.nix14
-rw-r--r--nixpkgs/pkgs/development/libraries/ti-rpc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/ticpp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/tidyp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/tiledb/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/timezonemap/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/tinycbor/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/tinyobjloader/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/tinyxml-2/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/tinyxml/2.6.2.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/tix/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/tk/8.6.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/tk/generic.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/tl-expected/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/tnt/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/tntdb/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/tntnet/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/tokyo-cabinet/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/tokyo-tyrant/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/totem-pl-parser/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/tracker-miners/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/tracker/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/tre/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/tremor/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/trompeloeil/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/tsocks/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/tweeny/default.nix3
-rw-r--r--nixpkgs/pkgs/development/libraries/twolame/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/ubus/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/uci/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/ucl/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/ucommon/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/ucx/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/udns/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/udunits/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/uhttpmock/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/uid_wrapper/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/umockdev/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/unibilium/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/unicap/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/unicorn/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/unittest-cpp/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/unixODBC/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/unixODBCDrivers/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/unqlite/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/uri/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/uriparser/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/usbredir/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/ustr/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/utf8cpp/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/utf8proc/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/uthash/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/uthenticode/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/utmps/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/v8/5_x.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/v8/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/v8/plv8_6_x.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/vaapi-intel-hybrid/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/vaapi-intel/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/vaapi-vdpau/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/vapoursynth-mvtools/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/vapoursynth/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/vapoursynth/editor.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/vc/0.7.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/vc/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/vcdimager/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/vcg/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/vid-stab/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/vigra/default.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/virglrenderer/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/vmime/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/vmmlib/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/vo-amrwbenc/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/volume-key/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/vrb/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/vrpn/default.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/vsqlite/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/vte/2.90.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/vte/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/vtk/7.x.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/vtk/8.x.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/vtk/generic.nix7
-rw-r--r--nixpkgs/pkgs/development/libraries/vulkan-headers/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/vulkan-loader/default.nix23
-rw-r--r--nixpkgs/pkgs/development/libraries/vxl/default.nix13
-rw-r--r--nixpkgs/pkgs/development/libraries/waffle/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/wasilibc/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/wavpack/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/wayland/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/wayland/protocols.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/waylandpp/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/wcslib/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/webkitgtk/default.nix17
-rw-r--r--nixpkgs/pkgs/development/libraries/webrtc-audio-processing/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/websocket++/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/wildmidi/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/wiredtiger/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/wlroots/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/wolfssl/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/wt/default.nix16
-rw-r--r--nixpkgs/pkgs/development/libraries/wtk/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/wxSVG/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/wxsqlite3/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/wxsqliteplus/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/wxwidgets/2.8/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/wxwidgets/2.9/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/wxwidgets/3.0/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/wxwidgets/3.0/mac.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/wxwidgets/3.1/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/x264/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/x265/default.nix15
-rw-r--r--nixpkgs/pkgs/development/libraries/xalanc/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/xapian/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/xapian/tools/omega/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/xavs/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/xbase/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/xcb-imdkit/default.nix41
-rw-r--r--nixpkgs/pkgs/development/libraries/xcb-util-cursor/HEAD.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/xdg-dbus-proxy/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/xdg-desktop-portal-gtk/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/xdg-desktop-portal-wlr/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/xed/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/xercesc/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/xgboost/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/xine-lib/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/xlibs-wrapper/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/xlslib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/xml-security-c/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/xml-tooling-c/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/xmlrpc-c/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/xmlsec/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/xsd/default.nix29
-rw-r--r--nixpkgs/pkgs/development/libraries/xvidcore/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/xxHash/default.nix11
-rw-r--r--nixpkgs/pkgs/development/libraries/xylib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/yajl/default.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/yojimbo/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/yubico-pam/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/zchunk/default.nix10
-rw-r--r--nixpkgs/pkgs/development/libraries/zeitgeist/default.nix12
-rw-r--r--nixpkgs/pkgs/development/libraries/zeroc-ice/3.6.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/zeroc-ice/default.nix2
-rw-r--r--nixpkgs/pkgs/development/libraries/zeromq/4.x.nix8
-rw-r--r--nixpkgs/pkgs/development/libraries/zimg/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/zimlib/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/zlib/default.nix32
-rw-r--r--nixpkgs/pkgs/development/libraries/zlog/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/zmqpp/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/zookeeper_mt/default.nix6
-rw-r--r--nixpkgs/pkgs/development/libraries/zxcvbn-c/default.nix4
-rw-r--r--nixpkgs/pkgs/development/libraries/zziplib/default.nix4
1895 files changed, 8652 insertions, 6949 deletions
diff --git a/nixpkgs/pkgs/development/libraries/AntTweakBar/default.nix b/nixpkgs/pkgs/development/libraries/AntTweakBar/default.nix
index ab9440c30345..c26672c1dabc 100644
--- a/nixpkgs/pkgs/development/libraries/AntTweakBar/default.nix
+++ b/nixpkgs/pkgs/development/libraries/AntTweakBar/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, xorg, libGLU, libGL }:
+{ lib, stdenv, fetchurl, unzip, xorg, libGLU, libGL }:
 
 stdenv.mkDerivation {
   name = "AntTweakBar-1.16";
@@ -26,8 +26,8 @@ stdenv.mkDerivation {
       to interactively tweak parameters on-screen
     '';
     homepage = "http://anttweakbar.sourceforge.net/";
-    license = stdenv.lib.licenses.zlib;
-    maintainers = [ stdenv.lib.maintainers.razvan ];
-    platforms = stdenv.lib.platforms.linux;
+    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
index ad900744f545..7028572174ff 100644
--- a/nixpkgs/pkgs/development/libraries/CGAL/4.nix
+++ b/nixpkgs/pkgs/development/libraries/CGAL/4.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, boost, gmp, mpfr }:
+{ lib, stdenv, fetchFromGitHub, cmake, boost, gmp, mpfr }:
 
 stdenv.mkDerivation rec {
   version = "4.14.2";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Computational Geometry Algorithms Library";
     homepage = "http://cgal.org";
     license = with licenses; [ gpl3Plus lgpl3Plus];
diff --git a/nixpkgs/pkgs/development/libraries/CGAL/default.nix b/nixpkgs/pkgs/development/libraries/CGAL/default.nix
index ca3503489868..7ff9ac43343e 100644
--- a/nixpkgs/pkgs/development/libraries/CGAL/default.nix
+++ b/nixpkgs/pkgs/development/libraries/CGAL/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , boost
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Computational Geometry Algorithms Library";
     homepage = "http://cgal.org";
     license = with licenses; [ gpl3Plus lgpl3Plus];
diff --git a/nixpkgs/pkgs/development/libraries/CoinMP/default.nix b/nixpkgs/pkgs/development/libraries/CoinMP/default.nix
index 7adb6e6437e7..d34b465f135a 100644
--- a/nixpkgs/pkgs/development/libraries/CoinMP/default.nix
+++ b/nixpkgs/pkgs/development/libraries/CoinMP/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "CoinMP";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "format" ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/LAStools/default.nix b/nixpkgs/pkgs/development/libraries/LAStools/default.nix
index c231361acb55..61a39aa8e76d 100644
--- a/nixpkgs/pkgs/development/libraries/LAStools/default.nix
+++ b/nixpkgs/pkgs/development/libraries/LAStools/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "LAStools";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     cmake
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Software for rapid LiDAR processing";
     homepage = http://lastools.org/;
     license = licenses.unfree;
diff --git a/nixpkgs/pkgs/development/libraries/LASzip/LASzip2.nix b/nixpkgs/pkgs/development/libraries/LASzip/LASzip2.nix
index 2eb309631289..b080153826ad 100644
--- a/nixpkgs/pkgs/development/libraries/LASzip/LASzip2.nix
+++ b/nixpkgs/pkgs/development/libraries/LASzip/LASzip2.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake }:
+{ lib, stdenv, fetchurl, cmake }:
 
 stdenv.mkDerivation rec {
   version = "2.2.0";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Turn quickly bulky LAS files into compact LAZ files without information loss";
     homepage = "https://laszip.org";
     license = licenses.lgpl2;
diff --git a/nixpkgs/pkgs/development/libraries/LASzip/default.nix b/nixpkgs/pkgs/development/libraries/LASzip/default.nix
index 0300aa37f0f9..f170ea44c0ee 100644
--- a/nixpkgs/pkgs/development/libraries/LASzip/default.nix
+++ b/nixpkgs/pkgs/development/libraries/LASzip/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   version = "3.4.3";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Turn quickly bulky LAS files into compact LAZ files without information loss";
     homepage = "https://laszip.org";
-    license = stdenv.lib.licenses.lgpl2;
-    maintainers = [ stdenv.lib.maintainers.michelk ];
-    platforms = stdenv.lib.platforms.unix;
+    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
index bfee99619840..1b8ae939ecaa 100644
--- a/nixpkgs/pkgs/development/libraries/NSPlist/default.nix
+++ b/nixpkgs/pkgs/development/libraries/NSPlist/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation {
   name = "NSPlist-713decf";
@@ -10,9 +10,9 @@ stdenv.mkDerivation {
     sha256 = "0v4yfiwfd08hmh2ydgy6pnmlzjbd96k78dsla9pfd56ka89aw74r";
   };
 
-  buildInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     maintainers = with maintainers; [ matthewbauer ];
     description = "Parses .plist files";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/PlistCpp/default.nix b/nixpkgs/pkgs/development/libraries/PlistCpp/default.nix
index f7703b731b99..f7c47805748e 100644
--- a/nixpkgs/pkgs/development/libraries/PlistCpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/PlistCpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, boost, NSPlist, pugixml }:
+{ lib, stdenv, fetchFromGitHub, cmake, boost, NSPlist, pugixml }:
 
 stdenv.mkDerivation {
   name = "PlistCpp-11615d";
@@ -10,10 +10,10 @@ stdenv.mkDerivation {
     sha256 = "10jn6bvm9vn6492zix2pd724v5h4lccmkqg3lxfw8r0qg3av0yzv";
   };
 
-  buildInputs = [ cmake boost NSPlist pugixml ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost NSPlist pugixml ];
 
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     maintainers = with maintainers; [ matthewbauer ];
     description = "CPP bindings for Plist";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/SDL/default.nix b/nixpkgs/pkgs/development/libraries/SDL/default.nix
index 61609a90dd02..b51bc3f7cdd8 100644
--- a/nixpkgs/pkgs/development/libraries/SDL/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, config, fetchurl, fetchpatch, pkgconfig, audiofile, libcap, libiconv
-, libGLSupported ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+{ 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, alsaLib
 , x11Support ? !stdenv.isCygwin && !stdenv.hostPlatform.isAndroid
@@ -11,7 +11,7 @@
 # NOTE: When editing this expression see if the same change applies to
 # SDL2 expression too
 
-with stdenv.lib;
+with lib;
 
 let
   extraPropagatedBuildInputs = [ ]
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
   outputBin = "dev"; # sdl-config
 
-  nativeBuildInputs = [ pkgconfig ]
+  nativeBuildInputs = [ pkg-config ]
     ++ optional stdenv.isLinux libcap;
 
   propagatedBuildInputs = [ libiconv ] ++ extraPropagatedBuildInputs;
@@ -124,7 +124,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A cross-platform multimedia library";
     homepage    = "http://www.libsdl.org/";
     maintainers = with maintainers; [ lovek323 ];
diff --git a/nixpkgs/pkgs/development/libraries/SDL2/default.nix b/nixpkgs/pkgs/development/libraries/SDL2/default.nix
index 31624bee2fb3..5212421a7b8e 100644
--- a/nixpkgs/pkgs/development/libraries/SDL2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL2/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, config, fetchurl, pkgconfig
-, libGLSupported ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+{ lib, stdenv, config, fetchurl, pkg-config
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
 , openglSupport ? libGLSupported, libGL
 , alsaSupport ? stdenv.isLinux && !stdenv.hostPlatform.isAndroid, alsaLib
 , x11Support ? !stdenv.isCygwin && !stdenv.hostPlatform.isAndroid
@@ -21,7 +21,7 @@
 # NOTE: When editing this expression see if the same change applies to
 # SDL expression too
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "SDL2";
@@ -47,9 +47,9 @@ stdenv.mkDerivation rec {
       --replace 'WAYLAND_SCANNER=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`' 'WAYLAND_SCANNER=`pkg-config --variable=wayland_scanner wayland-scanner`'
   '';
 
-  depsBuildBuild = [ pkgconfig ];
+  depsBuildBuild = [ pkg-config ];
 
-  nativeBuildInputs = [ pkgconfig ] ++ optionals waylandSupport [ wayland ];
+  nativeBuildInputs = [ pkg-config ] ++ optionals waylandSupport [ wayland ];
 
   propagatedBuildInputs = dlopenPropagatedBuildInputs;
 
@@ -126,7 +126,7 @@ stdenv.mkDerivation rec {
 
   passthru = { inherit openglSupport; };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A cross-platform multimedia library";
     homepage = "http://www.libsdl.org/";
     license = licenses.zlib;
diff --git a/nixpkgs/pkgs/development/libraries/SDL2_gfx/default.nix b/nixpkgs/pkgs/development/libraries/SDL2_gfx/default.nix
index 1ed56c6750ff..2da2189b1a87 100644
--- a/nixpkgs/pkgs/development/libraries/SDL2_gfx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL2_gfx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, darwin, fetchurl, SDL2 }:
+{ lib, stdenv, darwin, fetchurl, SDL2 }:
 
 stdenv.mkDerivation rec {
   pname = "SDL2_gfx";
@@ -10,12 +10,12 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ SDL2 ]
-    ++ stdenv.lib.optional stdenv.isDarwin darwin.libobjc;
+    ++ lib.optional stdenv.isDarwin darwin.libobjc;
 
   configureFlags = [(if stdenv.isi686 || stdenv.isx86_64 then "--enable-mmx" else "--disable-mmx")]
-     ++ stdenv.lib.optional stdenv.isDarwin "--disable-sdltest";
+     ++ lib.optional stdenv.isDarwin "--disable-sdltest";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SDL graphics drawing primitives and support functions";
 
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/SDL2_image/default.nix b/nixpkgs/pkgs/development/libraries/SDL2_image/default.nix
index 00de774ba6e3..96f85ddb0ea5 100644
--- a/nixpkgs/pkgs/development/libraries/SDL2_image/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL2_image/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL2, libpng, libjpeg, libtiff, libungif, libwebp, libXpm, zlib, Foundation }:
+{ lib, stdenv, fetchurl, SDL2, libpng, libjpeg, libtiff, libungif, libwebp, libXpm, zlib, Foundation }:
 
 stdenv.mkDerivation rec {
   pname = "SDL2_image";
@@ -10,14 +10,14 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ SDL2 libpng libjpeg libtiff libungif libwebp libXpm zlib ]
-    ++ stdenv.lib.optional stdenv.isDarwin Foundation;
+    ++ lib.optional stdenv.isDarwin Foundation;
 
 
-  configureFlags = stdenv.lib.optional stdenv.isDarwin "--disable-sdltest";
+  configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest";
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SDL image library";
     homepage = "http://www.libsdl.org/projects/SDL_image/";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/SDL2_mixer/default.nix b/nixpkgs/pkgs/development/libraries/SDL2_mixer/default.nix
index af0da7dc6270..7e1d097ba5cb 100644
--- a/nixpkgs/pkgs/development/libraries/SDL2_mixer/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL2_mixer/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , pkg-config
 , AudioToolbox
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkg-config ];
 
-  buildInputs = stdenv.lib.optionals stdenv.isDarwin [
+  buildInputs = lib.optionals stdenv.isDarwin [
     AudioToolbox
     AudioUnit
     CoreServices
@@ -51,12 +51,12 @@ stdenv.mkDerivation rec {
     "--disable-music-mp3-mpg123-shared"
     "--disable-music-opus-shared"
     "--disable-music-midi-fluidsynth-shared"
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.isDarwin [
     "--disable-sdltest"
     "--disable-smpegtest"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SDL multi-channel audio mixer library";
     platforms = platforms.unix;
     homepage = "https://www.libsdl.org/projects/SDL_mixer/";
diff --git a/nixpkgs/pkgs/development/libraries/SDL2_net/default.nix b/nixpkgs/pkgs/development/libraries/SDL2_net/default.nix
index 0bec12cdb24b..fe6cb9445a39 100644
--- a/nixpkgs/pkgs/development/libraries/SDL2_net/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL2_net/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, darwin, fetchurl, SDL2 }:
+{ lib, stdenv, darwin, fetchurl, SDL2 }:
 
 stdenv.mkDerivation rec {
   pname = "SDL2_net";
@@ -9,13 +9,13 @@ stdenv.mkDerivation rec {
     sha256 = "08cxc1bicmyk89kiks7izw1rlx5ng5n6xpy8fy0zxni3b9z8mkhm";
   };
 
-  buildInputs = stdenv.lib.optional stdenv.isDarwin darwin.libobjc;
+  buildInputs = lib.optional stdenv.isDarwin darwin.libobjc;
 
-  configureFlags = stdenv.lib.optional stdenv.isDarwin "--disable-sdltest";
+  configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest";
 
   propagatedBuildInputs = [ SDL2 ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SDL multiplatform networking library";
     homepage = "https://www.libsdl.org/projects/SDL_net";
     license = licenses.zlib;
diff --git a/nixpkgs/pkgs/development/libraries/SDL2_ttf/default.nix b/nixpkgs/pkgs/development/libraries/SDL2_ttf/default.nix
index 571c953a81bc..e23b3fb92150 100644
--- a/nixpkgs/pkgs/development/libraries/SDL2_ttf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL2_ttf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, darwin, fetchurl, SDL2, freetype, libGL }:
+{ lib, stdenv, darwin, fetchurl, SDL2, freetype, libGL }:
 
 stdenv.mkDerivation rec {
   pname = "SDL2_ttf";
@@ -9,12 +9,12 @@ stdenv.mkDerivation rec {
     sha256 = "0cyd48dipc0m399qy8s03lci8b0bpiy8xlkvrm2ia7wcv0dfpv59";
   };
 
-  configureFlags = stdenv.lib.optional stdenv.isDarwin "--disable-sdltest";
+  configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest";
 
   buildInputs = [ SDL2 freetype libGL ]
-    ++ stdenv.lib.optional stdenv.isDarwin darwin.libobjc;
+    ++ lib.optional stdenv.isDarwin darwin.libobjc;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SDL TrueType library";
     platforms = platforms.unix;
     license = licenses.zlib;
diff --git a/nixpkgs/pkgs/development/libraries/SDL_Pango/default.nix b/nixpkgs/pkgs/development/libraries/SDL_Pango/default.nix
index 9340b9f70915..83afeaf2d67b 100644
--- a/nixpkgs/pkgs/development/libraries/SDL_Pango/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL_Pango/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchpatch, fetchurl, SDL, autoreconfHook, pango, pkgconfig }:
+{ lib, stdenv, fetchpatch, fetchurl, SDL, autoreconfHook, pango, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "SDL_Pango";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "197baw1dsg0p4pljs5k0fshbyki00r4l49m1drlpqw6ggawx6xbz";
   };
 
-  patches = [ 
+  patches = [
     (fetchpatch {
       url = "https://sources.debian.org/data/main/s/sdlpango/0.1.2-6/debian/patches/api_additions.patch";
       sha256 = "00p5ry5gd3ixm257p9i2c4jg0qj8ipk8nf56l7c9fma8id3zxyld";
@@ -19,10 +19,10 @@ stdenv.mkDerivation rec {
 
   preConfigure = "autoreconf -i -f";
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
   buildInputs = [ SDL pango ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Connects the Pango rendering engine to SDL";
     license = licenses.lgpl21Plus;
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/SDL_gfx/default.nix b/nixpkgs/pkgs/development/libraries/SDL_gfx/default.nix
index 3696e485ad72..f5a3d8635531 100644
--- a/nixpkgs/pkgs/development/libraries/SDL_gfx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL_gfx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL }:
+{ lib, stdenv, fetchurl, SDL }:
 
 stdenv.mkDerivation rec {
   pname = "SDL_gfx";
@@ -12,28 +12,28 @@ stdenv.mkDerivation rec {
   buildInputs = [ SDL ] ;
 
   configureFlags = [ "--disable-mmx" ]
-    ++ stdenv.lib.optional stdenv.isDarwin "--disable-sdltest";
+    ++ lib.optional stdenv.isDarwin "--disable-sdltest";
 
-  meta = with stdenv.lib; {
+  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.
+    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:
+      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)
+        * 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.
-       '';
+      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;
diff --git a/nixpkgs/pkgs/development/libraries/SDL_gpu/default.nix b/nixpkgs/pkgs/development/libraries/SDL_gpu/default.nix
index f15009c2f5d9..dc52e6afeea7 100644
--- a/nixpkgs/pkgs/development/libraries/SDL_gpu/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL_gpu/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, SDL2, libGLU }:
+{ lib, stdenv, fetchFromGitHub, cmake, SDL2, libGLU }:
 
 stdenv.mkDerivation {
   pname = "SDL_gpu-unstable";
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
     sed -ie '213s#''${OUTPUT_DIR}/lib#''${CMAKE_INSTALL_LIBDIR}#' src/CMakeLists.txt
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/SDL_image/default.nix b/nixpkgs/pkgs/development/libraries/SDL_image/default.nix
index 968fc3d38af8..2e5841b3f482 100644
--- a/nixpkgs/pkgs/development/libraries/SDL_image/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL_image/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, SDL, libpng, libjpeg, libtiff, libungif, libXpm }:
+{ lib, stdenv, fetchurl, fetchpatch, SDL, libpng, libjpeg, libtiff, libungif, libXpm }:
 
 stdenv.mkDerivation rec {
   pname = "SDL_image";
@@ -22,11 +22,11 @@ stdenv.mkDerivation rec {
     "--disable-jpg-shared"
     "--disable-png-shared"
     "--disable-tif-shared"
-  ] ++ stdenv.lib.optional stdenv.isDarwin "--disable-sdltest";
+  ] ++ lib.optional stdenv.isDarwin "--disable-sdltest";
 
   buildInputs = [ SDL libpng libjpeg libtiff libungif libXpm ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SDL image library";
     homepage    = "http://www.libsdl.org/projects/SDL_image/";
     maintainers = with maintainers; [ lovek323 ];
diff --git a/nixpkgs/pkgs/development/libraries/SDL_mixer/default.nix b/nixpkgs/pkgs/development/libraries/SDL_mixer/default.nix
index e52273052b53..7f5e38f39b8d 100644
--- a/nixpkgs/pkgs/development/libraries/SDL_mixer/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL_mixer/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     ++ lib.optional enableNativeMidi " --enable-music-native-midi-gpl"
     ++ lib.optionals stdenv.isDarwin [ "--disable-sdltest" "--disable-smpegtest" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SDL multi-channel audio mixer library";
     homepage    = "http://www.libsdl.org/projects/SDL_mixer/";
     maintainers = with maintainers; [ lovek323 ];
diff --git a/nixpkgs/pkgs/development/libraries/SDL_net/default.nix b/nixpkgs/pkgs/development/libraries/SDL_net/default.nix
index a24020da0157..f55332a0ee0e 100644
--- a/nixpkgs/pkgs/development/libraries/SDL_net/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL_net/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL }:
+{ lib, stdenv, fetchurl, SDL }:
 
 stdenv.mkDerivation rec {
   pname = "SDL_net";
@@ -9,11 +9,11 @@ stdenv.mkDerivation rec {
     sha256 = "1d5c9xqlf4s1c01gzv6cxmg0r621pq9kfgxcg3197xw4p25pljjz";
   };
 
-  configureFlags = stdenv.lib.optional stdenv.isDarwin "--disable-sdltest";
+  configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest";
 
   propagatedBuildInputs = [ SDL ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SDL networking library";
     platforms = platforms.unix;
     license = licenses.zlib;
diff --git a/nixpkgs/pkgs/development/libraries/SDL_sixel/default.nix b/nixpkgs/pkgs/development/libraries/SDL_sixel/default.nix
index 8d37124d3117..1bc4c8ba35c0 100644
--- a/nixpkgs/pkgs/development/libraries/SDL_sixel/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL_sixel/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkgconfig, libsixel }:
+{ lib, stdenv, fetchFromGitHub, pkg-config, libsixel }:
 
 stdenv.mkDerivation {
   pname = "SDL_sixel";
@@ -13,10 +13,10 @@ stdenv.mkDerivation {
 
   configureFlags = [ "--enable-video-sixel" ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libsixel ];
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/SDL_stretch/default.nix b/nixpkgs/pkgs/development/libraries/SDL_stretch/default.nix
index 1f068c9e9768..e6318b84859e 100644
--- a/nixpkgs/pkgs/development/libraries/SDL_stretch/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL_stretch/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL }:
+{ lib, stdenv, fetchurl, SDL }:
 
 stdenv.mkDerivation rec {
   pname = "SDL_stretch";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ SDL ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
      description = "Stretch Functions For SDL";
      homepage = "http://sdl-stretch.sourceforge.net/";
      license = licenses.lgpl2;
diff --git a/nixpkgs/pkgs/development/libraries/SDL_ttf/default.nix b/nixpkgs/pkgs/development/libraries/SDL_ttf/default.nix
index cd6355c9ce2b..5d353e3a6c0d 100644
--- a/nixpkgs/pkgs/development/libraries/SDL_ttf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/SDL_ttf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, SDL, freetype }:
+{ lib, stdenv, fetchurl, fetchpatch, SDL, freetype }:
 
 stdenv.mkDerivation rec {
   pname = "SDL_ttf";
@@ -21,9 +21,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ SDL freetype ];
 
-  configureFlags = stdenv.lib.optional stdenv.isDarwin "--disable-sdltest";
+  configureFlags = lib.optional stdenv.isDarwin "--disable-sdltest";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SDL TrueType library";
     license = licenses.zlib;
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/Xaw3d/default.nix b/nixpkgs/pkgs/development/libraries/Xaw3d/default.nix
index d26a910638e9..88501ca1ee60 100644
--- a/nixpkgs/pkgs/development/libraries/Xaw3d/default.nix
+++ b/nixpkgs/pkgs/development/libraries/Xaw3d/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl
-, imake, gccmakedep, bison, flex, pkgconfig
+{ lib, stdenv, fetchurl
+, imake, gccmakedep, bison, flex, pkg-config
 , xlibsWrapper, libXmu, libXpm, libXp }:
 
 stdenv.mkDerivation {
@@ -9,13 +9,13 @@ stdenv.mkDerivation {
     sha256 = "0i653s8g25cc0mimkwid9366bqkbyhdyjhckx7bw77j20hzrkfid";
   };
   dontUseImakeConfigure = true;
-  nativeBuildInputs = [ pkgconfig bison flex imake gccmakedep ];
+  nativeBuildInputs = [ pkg-config bison flex imake gccmakedep ];
   buildInputs = [ libXpm libXp ];
   propagatedBuildInputs = [ xlibsWrapper libXmu ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "3D widget set based on the Athena Widget set";
-    platforms = stdenv.lib.platforms.unix;
+    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
index 7cbb36994013..faa819ec5615 100644
--- a/nixpkgs/pkgs/development/libraries/a52dec/default.nix
+++ b/nixpkgs/pkgs/development/libraries/a52dec/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   pname = "a52dec";
@@ -15,11 +15,11 @@ stdenv.mkDerivation rec {
 
   # fails 1 out of 1 tests with "BAD GLOBAL SYMBOLS" on i686
   # which can also be fixed with
-  # hardeningDisable = stdenv.lib.optional stdenv.isi686 "pic";
+  # hardeningDisable = lib.optional stdenv.isi686 "pic";
   # but it's better to disable tests than loose ASLR on i686
   doCheck = !stdenv.isi686;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "ATSC A/52 stream decoder";
     homepage = "https://liba52.sourceforge.net/";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/aalib/default.nix b/nixpkgs/pkgs/development/libraries/aalib/default.nix
index 94453264419c..b007e71ce44d 100644
--- a/nixpkgs/pkgs/development/libraries/aalib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/aalib/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, ncurses, automake}:
+{lib, stdenv, fetchurl, ncurses, automake}:
 
 stdenv.mkDerivation {
   name = "aalib-1.4rc5";
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
   outputs = [ "bin" "dev" "out" "man" "info" ];
   setOutputFlags = false; # Doesn't support all the flags
 
-  patches = stdenv.lib.optionals stdenv.isDarwin [ ./darwin.patch ];
+  patches = lib.optionals stdenv.isDarwin [ ./darwin.patch ];
 
   # The fuloong2f is not supported by aalib still
   preConfigure = ''
@@ -35,7 +35,7 @@ stdenv.mkDerivation {
 
   meta = {
     description = "ASCII art graphics library";
-    platforms = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.lgpl2;
+    platforms = lib.platforms.unix;
+    license = lib.licenses.lgpl2;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/abseil-cpp/default.nix b/nixpkgs/pkgs/development/libraries/abseil-cpp/default.nix
index 45e73410d28e..95d1b873edd3 100644
--- a/nixpkgs/pkgs/development/libraries/abseil-cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/abseil-cpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "abseil-cpp";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/accounts-qt/default.nix b/nixpkgs/pkgs/development/libraries/accounts-qt/default.nix
index 4e2e33b852e8..dcfe4a4ef27b 100644
--- a/nixpkgs/pkgs/development/libraries/accounts-qt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/accounts-qt/default.nix
@@ -1,4 +1,4 @@
-{ mkDerivation, lib, fetchFromGitLab, doxygen, glib, libaccounts-glib, pkgconfig, qmake }:
+{ mkDerivation, lib, fetchFromGitLab, doxygen, glib, libaccounts-glib, pkg-config, qmake }:
 
 mkDerivation rec {
   pname = "accounts-qt";
@@ -12,7 +12,7 @@ mkDerivation rec {
   };
 
   propagatedBuildInputs = [ glib libaccounts-glib ];
-  nativeBuildInputs = [ doxygen pkgconfig qmake ];
+  nativeBuildInputs = [ doxygen pkg-config qmake ];
 
   # Hack to avoid TMPDIR in RPATHs.
   preFixup = ''rm -rf "$(pwd)" '';
diff --git a/nixpkgs/pkgs/development/libraries/accountsservice/default.nix b/nixpkgs/pkgs/development/libraries/accountsservice/default.nix
index 6bd76c62b974..f87a0bbe68ba 100644
--- a/nixpkgs/pkgs/development/libraries/accountsservice/default.nix
+++ b/nixpkgs/pkgs/development/libraries/accountsservice/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
 , substituteAll
-, pkgconfig
+, pkg-config
 , glib
 , shadow
 , gobject-introspection
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
     gobject-introspection
     meson
     ninja
-    pkgconfig
+    pkg-config
     python3
   ];
 
@@ -84,7 +84,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "D-Bus interface for user account query and manipulation";
     homepage = "https://www.freedesktop.org/wiki/Software/AccountsService";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/ace/default.nix b/nixpkgs/pkgs/development/libraries/ace/default.nix
index 49c8e14a74f4..85df0b433539 100644
--- a/nixpkgs/pkgs/development/libraries/ace/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ace/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libtool, perl }:
+{ lib, stdenv, fetchurl, pkg-config, libtool, perl }:
 
 stdenv.mkDerivation rec {
   pname = "ace";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  nativeBuildInputs = [ pkgconfig libtool ];
+  nativeBuildInputs = [ pkg-config libtool ];
   buildInputs = [ perl ];
 
   NIX_CFLAGS_COMPILE = [
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     > include/makeinclude/platform_macros.GNU
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "ADAPTIVE Communication Environment";
     homepage = "http://www.dre.vanderbilt.edu/~schmidt/ACE.html";
     license = licenses.doc;
diff --git a/nixpkgs/pkgs/development/libraries/acl/default.nix b/nixpkgs/pkgs/development/libraries/acl/default.nix
index 6e863e4eebab..2161ad9e59c3 100644
--- a/nixpkgs/pkgs/development/libraries/acl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/acl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gettext, attr }:
+{ 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
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     patchShebangs .
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://savannah.nongnu.org/projects/acl";
     description = "Library and tools for manipulating access control lists";
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/afflib/default.nix b/nixpkgs/pkgs/development/libraries/afflib/default.nix
index 030ff73f97f8..b89683ac0539 100644
--- a/nixpkgs/pkgs/development/libraries/afflib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/afflib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, zlib, curl, expat, fuse, openssl
+{ lib, stdenv, fetchFromGitHub, zlib, curl, expat, fuse, openssl
 , autoreconfHook, python3
 }:
 
@@ -15,14 +15,14 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook ];
   buildInputs = [ zlib curl expat openssl python3 ]
-    ++ stdenv.lib.optionals stdenv.isLinux [ fuse ];
+    ++ lib.optionals stdenv.isLinux [ fuse ];
 
   meta = {
     homepage = "http://afflib.sourceforge.net/";
     description = "Advanced forensic format library";
-    platforms = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.bsdOriginal;
-    maintainers = [ stdenv.lib.maintainers.raskin ];
+    platforms = lib.platforms.unix;
+    license = lib.licenses.bsdOriginal;
+    maintainers = [ lib.maintainers.raskin ];
     inherit version;
     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
index a1d4c2259091..1ae5ffb17ad3 100644
--- a/nixpkgs/pkgs/development/libraries/aften/default.nix
+++ b/nixpkgs/pkgs/development/libraries/aften/default.nix
@@ -1,21 +1,21 @@
-{ stdenv, fetchurl, cmake }:
+{ 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";
-	};
+  pname = "aften";
+  version = "0.0.8";
+  src = fetchurl {
+    url = "mirror://sourceforge/aften/${pname}-${version}.tar.bz2";
+    sha256 = "02hc5x9vkgng1v9bzvza9985ifrjd7fjr7nlpvazp4mv6dr89k47";
+  };
 
-	nativeBuildInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
-	cmakeFlags = [ "-DSHARED=ON" ];
+  cmakeFlags = [ "-DSHARED=ON" ];
 
-	meta = {
-		description = "An audio encoder which generates compressed audio streams based on ATSC A/52 specification";
-		homepage = "http://aften.sourceforge.net/";
-		license = stdenv.lib.licenses.lgpl2;
-		platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
-	};
+  meta = {
+    description = "An audio encoder which generates compressed audio streams based on ATSC A/52 specification";
+    homepage = "http://aften.sourceforge.net/";
+    license = lib.licenses.lgpl2;
+    platforms = [ "i686-linux" "x86_64-linux" "x86_64-darwin" ];
+  };
 }
diff --git a/nixpkgs/pkgs/development/libraries/agda/agda-prelude/default.nix b/nixpkgs/pkgs/development/libraries/agda/agda-prelude/default.nix
index f13cc6982365..79bb783cc9ff 100644
--- a/nixpkgs/pkgs/development/libraries/agda/agda-prelude/default.nix
+++ b/nixpkgs/pkgs/development/libraries/agda/agda-prelude/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, mkDerivation, fetchFromGitHub }:
+{ lib, stdenv, mkDerivation, fetchFromGitHub }:
 
 mkDerivation rec {
   version = "compat-2.6.1";
@@ -18,11 +18,11 @@ mkDerivation rec {
     cd ..
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/UlfNorell/agda-prelude";
     description = "Programming library for Agda";
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.mit;
+    platforms = lib.platforms.unix;
     maintainers = with maintainers; [ mudri alexarice turion ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/agda/functional-linear-algebra/default.nix b/nixpkgs/pkgs/development/libraries/agda/functional-linear-algebra/default.nix
index dbcdaac532ec..7ec892bfe023 100644
--- a/nixpkgs/pkgs/development/libraries/agda/functional-linear-algebra/default.nix
+++ b/nixpkgs/pkgs/development/libraries/agda/functional-linear-algebra/default.nix
@@ -13,7 +13,7 @@ mkDerivation rec {
     sha256 = "09ri3jmgp9jjwi1mzv4c3w6rvcmyx6spa2qxpwlcn0f4bmfva6wm";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/ryanorendorff/functional-linear-algebra";
     description = ''
       Formalizing linear algebra in Agda by representing matrices as functions
diff --git a/nixpkgs/pkgs/development/libraries/agda/iowa-stdlib/default.nix b/nixpkgs/pkgs/development/libraries/agda/iowa-stdlib/default.nix
index 55cd6a742e54..2ebb3f66ed08 100644
--- a/nixpkgs/pkgs/development/libraries/agda/iowa-stdlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/agda/iowa-stdlib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, mkDerivation, fetchFromGitHub }:
+{ lib, stdenv, mkDerivation, fetchFromGitHub }:
 
 mkDerivation (rec {
   version = "1.5.0";
@@ -22,10 +22,10 @@ mkDerivation (rec {
   meta = {
     homepage = "https://github.com/cedille/ial";
     description = "Agda standard library developed at Iowa";
-    license = stdenv.lib.licenses.free;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.free;
+    platforms = lib.platforms.unix;
     # broken since Agda 2.6.1
     broken = true;
-    maintainers = with stdenv.lib.maintainers; [ alexarice turion ];
+    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
index e43e1bad3b6c..1d8dc03bbde9 100644
--- a/nixpkgs/pkgs/development/libraries/agda/standard-library/default.nix
+++ b/nixpkgs/pkgs/development/libraries/agda/standard-library/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, mkDerivation, fetchFromGitHub, ghcWithPackages }:
+{ lib, stdenv, mkDerivation, fetchFromGitHub, ghcWithPackages }:
 
 mkDerivation rec {
   pname = "standard-library";
@@ -16,11 +16,11 @@ mkDerivation rec {
     runhaskell GenerateEverything.hs
   '';
 
-  meta = with stdenv.lib; {
+  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 = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.unix;
+    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
index d65ff369064e..89585d908da4 100644
--- a/nixpkgs/pkgs/development/libraries/agg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/agg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoconf, automake, libtool, pkgconfig
+{ lib, stdenv, fetchurl, autoconf, automake, libtool, pkg-config
 , freetype, SDL, libX11 }:
 
 stdenv.mkDerivation rec {
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
     url = "http://www.antigrain.com/${name}.tar.gz";
     sha256 = "07wii4i824vy9qsvjsgqxppgqmfdxq0xa87i5yk53fijriadq7mb";
   };
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ autoconf automake libtool freetype SDL libX11 ];
 
   postPatch = ''
@@ -40,8 +40,8 @@ stdenv.mkDerivation rec {
       of course, AGG can do much more than that.
     '';
 
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
     homepage = "http://www.antigrain.com/";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/alembic/default.nix b/nixpkgs/pkgs/development/libraries/alembic/default.nix
index 126300aa1945..cdcf4b7b8a49 100644
--- a/nixpkgs/pkgs/development/libraries/alembic/default.nix
+++ b/nixpkgs/pkgs/development/libraries/alembic/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, unzip, cmake, openexr, hdf5-threadsafe }:
+{ lib, stdenv, fetchFromGitHub, unzip, cmake, openexr, hdf5-threadsafe }:
 
 stdenv.mkDerivation rec
 {
@@ -17,8 +17,6 @@ stdenv.mkDerivation rec
   nativeBuildInputs = [ unzip cmake ];
   buildInputs = [ openexr hdf5-threadsafe ];
 
-  enableParallelBuilding = true;
-
   buildPhase = ''
     cmake -DUSE_HDF5=ON -DCMAKE_INSTALL_PREFIX=$out/ -DUSE_TESTS=OFF .
 
@@ -36,7 +34,7 @@ stdenv.mkDerivation rec
     mv $out/include $dev/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An open framework for storing and sharing scene data";
     homepage = "http://alembic.io/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/alkimia/default.nix b/nixpkgs/pkgs/development/libraries/alkimia/default.nix
index d7d8c268928f..18c40c5b5fb3 100644
--- a/nixpkgs/pkgs/development/libraries/alkimia/default.nix
+++ b/nixpkgs/pkgs/development/libraries/alkimia/default.nix
@@ -5,11 +5,11 @@
 
 mkDerivation rec {
   pname = "alkimia";
-  version = "8.0.2";
+  version = "8.0.4";
 
   src = fetchurl {
     url = "mirror://kde/stable/alkimia/${version}/${pname}-${version}.tar.xz";
-    sha256 = "0al5k9irmg9gsjc234qxjsqfzgzsavl18pspqk78mkp8zlv7fvv1";
+    sha256 = "sha256-AASnBo3/CqLLb0f3DSHBKQc74R8u2yHxRRK8RHBIfR8=";
   };
 
   nativeBuildInputs = [ extra-cmake-modules doxygen graphviz ];
diff --git a/nixpkgs/pkgs/development/libraries/allegro/5.nix b/nixpkgs/pkgs/development/libraries/allegro/5.nix
index fd612170910e..ca1446dd9352 100644
--- a/nixpkgs/pkgs/development/libraries/allegro/5.nix
+++ b/nixpkgs/pkgs/development/libraries/allegro/5.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchFromGitHub, fetchpatch, texinfo, libXext, xorgproto, libX11
+{ lib, stdenv, fetchFromGitHub, fetchpatch, texinfo, libXext, xorgproto, libX11
 , libXpm, libXt, libXcursor, alsaLib, cmake, zlib, libpng, libvorbis
 , libXxf86dga, libXxf86misc
 , libXxf86vm, openal, libGLU, libGL, libjpeg, flac
 , libXi, libXfixes, freetype, libopus, libtheora
-, physfs, enet, pkgconfig, gtk2, pcre, libpulseaudio, libpthreadstubs
+, physfs, enet, pkg-config, gtk2, pcre, libpulseaudio, libpthreadstubs
 , libXdmcp
 }:
 
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     libXxf86vm openal libGLU libGL
     libjpeg flac
     libXi libXfixes
-    enet libtheora freetype physfs libopus pkgconfig gtk2 pcre libXdmcp
+    enet libtheora freetype physfs libopus pkg-config gtk2 pcre libXdmcp
     libpulseaudio libpthreadstubs
   ];
 
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [ "-DCMAKE_SKIP_RPATH=ON" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A game programming library";
     homepage = "https://liballeg.org/";
     license = licenses.zlib;
diff --git a/nixpkgs/pkgs/development/libraries/allegro/default.nix b/nixpkgs/pkgs/development/libraries/allegro/default.nix
index 99d75225036e..9fefbe01ace0 100644
--- a/nixpkgs/pkgs/development/libraries/allegro/default.nix
+++ b/nixpkgs/pkgs/development/libraries/allegro/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, texinfo6_5, libXext, xorgproto, libX11
+{ lib, stdenv, fetchurl, texinfo6_5, libXext, xorgproto, libX11
 , libXpm, libXt, libXcursor, alsaLib, cmake, zlib, libpng, libvorbis
 , libXxf86dga, libXxf86misc
 , libXxf86vm, openal, libGLU, libGL }:
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [ "-DCMAKE_SKIP_RPATH=ON" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A game programming library";
     homepage = "https://liballeg.org/";
     license = licenses.free; # giftware
diff --git a/nixpkgs/pkgs/development/libraries/alure/default.nix b/nixpkgs/pkgs/development/libraries/alure/default.nix
index 59926f52b078..9ff83dcec404 100644
--- a/nixpkgs/pkgs/development/libraries/alure/default.nix
+++ b/nixpkgs/pkgs/development/libraries/alure/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, openal }:
+{ lib, stdenv, fetchurl, cmake, openal }:
 
 stdenv.mkDerivation rec {
   pname = "alure";
@@ -9,9 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "0w8gsyqki21s1qb2s5ac1kj08i6nc937c0rr08xbw9w9wvd6lpj6";
   };
 
-  buildInputs = [ cmake openal ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ openal ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A utility library to help manage common tasks with OpenAL applications";
     homepage = "https://kcat.strangesoft.net/alure.html";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/alure2/default.nix b/nixpkgs/pkgs/development/libraries/alure2/default.nix
index 6da95a772648..fa42c4fd53a3 100644
--- a/nixpkgs/pkgs/development/libraries/alure2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/alure2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, openal, libvorbis, opusfile, libsndfile }:
+{ lib, stdenv, fetchFromGitHub, cmake, openal, libvorbis, opusfile, libsndfile }:
 
 stdenv.mkDerivation rec {
   pname = "alure2";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
   buildInputs = [ openal libvorbis opusfile libsndfile ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/amdvlk/default.nix b/nixpkgs/pkgs/development/libraries/amdvlk/default.nix
index f6859c943642..fb48ef73905b 100644
--- a/nixpkgs/pkgs/development/libraries/amdvlk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/amdvlk/default.nix
@@ -5,7 +5,7 @@
 , ninja
 , patchelf
 , perl
-, pkgconfig
+, pkg-config
 , python3
 , expat
 , libdrm
@@ -50,7 +50,7 @@ in stdenv.mkDerivation rec {
     ninja
     patchelf
     perl
-    pkgconfig
+    pkg-config
     python3
   ];
 
@@ -66,7 +66,7 @@ in stdenv.mkDerivation rec {
   cmakeDir = "../drivers/xgl";
 
   # LTO is disabled in gcc for i686 as of #66528
-  cmakeFlags = stdenv.lib.optionals stdenv.is32bit ["-DXGL_ENABLE_LTO=OFF"];
+  cmakeFlags = lib.optionals stdenv.is32bit ["-DXGL_ENABLE_LTO=OFF"];
 
   installPhase = ''
     install -Dm755 -t $out/lib icd/amdvlk${suffix}.so
@@ -83,7 +83,7 @@ in stdenv.mkDerivation rec {
   # Keep the rpath, otherwise vulkaninfo and vkcube segfault
   dontPatchELF = true;
 
-  meta = with stdenv.lib; {
+  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}";
diff --git a/nixpkgs/pkgs/development/libraries/aml/default.nix b/nixpkgs/pkgs/development/libraries/aml/default.nix
index 8b4eccb9ffff..899dafde76f2 100644
--- a/nixpkgs/pkgs/development/libraries/aml/default.nix
+++ b/nixpkgs/pkgs/development/libraries/aml/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, meson, pkg-config, ninja }:
+{ lib, stdenv, fetchFromGitHub, meson, pkg-config, ninja }:
 
 stdenv.mkDerivation rec {
   pname = "aml";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ meson pkg-config ninja ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Another main loop";
     inherit (src.meta) homepage;
     license = licenses.isc;
diff --git a/nixpkgs/pkgs/development/libraries/amrnb/default.nix b/nixpkgs/pkgs/development/libraries/amrnb/default.nix
index aaee86c62ef7..b226c9e36d24 100644
--- a/nixpkgs/pkgs/development/libraries/amrnb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/amrnb/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, unzip}:
+{lib, stdenv, fetchurl, unzip}:
 
 stdenv.mkDerivation {
   name = "amrnb-11.0.0.0";
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
   configureFlags = [ "--cache-file=config.cache" "--with-downloader=true" ];
 
   postConfigure = ''
-    cp $srcAmr 26104-b00.zip 
+    cp $srcAmr 26104-b00.zip
   '';
 
   meta = {
@@ -26,6 +26,6 @@ stdenv.mkDerivation {
     # 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 = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/amrwb/default.nix b/nixpkgs/pkgs/development/libraries/amrwb/default.nix
index e6581d549115..776065b28bc7 100644
--- a/nixpkgs/pkgs/development/libraries/amrwb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/amrwb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip }:
+{ lib, stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation rec {
   pname = "amrwb";
@@ -28,6 +28,6 @@ stdenv.mkDerivation rec {
     # 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 = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/amtk/default.nix b/nixpkgs/pkgs/development/libraries/amtk/default.nix
index e514b8b5c31b..f144f847bcf0 100644
--- a/nixpkgs/pkgs/development/libraries/amtk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/amtk/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , gtk3
-, pkgconfig
+, pkg-config
 , gobject-introspection
 , gnome3
 , dbus
@@ -13,12 +13,12 @@ stdenv.mkDerivation rec {
   version = "5.2.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0y3hmmflw4i0y0yb9a8rlihbv3cbwnvdcf1n5jycwzpq9jxla1c2";
   };
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     dbus
     gobject-introspection
   ];
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
 
   passthru.updateScript = gnome3.updateScript { packageName = pname; };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://wiki.gnome.org/Projects/Amtk";
     description = "Actions, Menus and Toolbars Kit for GTK applications";
     maintainers = [ maintainers.manveru ];
diff --git a/nixpkgs/pkgs/development/libraries/apache-activemq/default.nix b/nixpkgs/pkgs/development/libraries/apache-activemq/default.nix
index 8490541546b5..976387d49eb0 100644
--- a/nixpkgs/pkgs/development/libraries/apache-activemq/default.nix
+++ b/nixpkgs/pkgs/development/libraries/apache-activemq/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "apache-activemq";
@@ -23,8 +23,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://activemq.apache.org/";
     description = "Messaging and Integration Patterns server written in Java";
-    license = stdenv.lib.licenses.asl20;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.unix;
   };
 
 }
diff --git a/nixpkgs/pkgs/development/libraries/appstream-glib/default.nix b/nixpkgs/pkgs/development/libraries/appstream-glib/default.nix
index 8e77f6aa34e3..1cd9fb2c8b76 100644
--- a/nixpkgs/pkgs/development/libraries/appstream-glib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/appstream-glib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , substituteAll
 , docbook_xml_dtd_42
@@ -19,7 +19,7 @@
 , libxslt
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , pngquant
 }:
 stdenv.mkDerivation rec {
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
   src = fetchFromGitHub {
     owner = "hughsie";
     repo = "appstream-glib";
-    rev = stdenv.lib.replaceStrings [ "." "-" ] [ "_" "_" ] name;
+    rev = lib.replaceStrings [ "." "-" ] [ "_" "_" ] name;
     sha256 = "12s7d3nqjs1fldnppbg2mkjg4280f3h8yzj3q1hiz3chh1w0vjbx";
   };
 
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
     libxslt
     meson
     ninja
-    pkgconfig
+    pkg-config
   ];
 
   buildInputs = [
@@ -84,7 +84,7 @@ stdenv.mkDerivation rec {
     moveToOutput "share/installed-tests" "$installedTests"
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/appstream/default.nix b/nixpkgs/pkgs/development/libraries/appstream/default.nix
index 820e73832462..1e3c2bcd2eb5 100644
--- a/nixpkgs/pkgs/development/libraries/appstream/default.nix
+++ b/nixpkgs/pkgs/development/libraries/appstream/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig, gettext
+{ lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config, gettext
 , xmlto, docbook_xsl, docbook_xml_dtd_45, libxslt
 , libstemmer, glib, xapian, libxml2, libyaml, gobject-introspection
 , pcre, itstool, gperf, vala, lmdb, libsoup
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [
-    meson ninja pkgconfig gettext
+    meson ninja pkg-config gettext
     libxslt xmlto docbook_xsl docbook_xml_dtd_45
     gobject-introspection itstool vala
   ];
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
     "-Dvapi=true"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Software metadata handling library";
     homepage    = "https://www.freedesktop.org/wiki/Distributions/AppStream/";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/apr-util/default.nix b/nixpkgs/pkgs/development/libraries/apr-util/default.nix
index ba12e2d0385a..51e9271b7d7c 100644
--- a/nixpkgs/pkgs/development/libraries/apr-util/default.nix
+++ b/nixpkgs/pkgs/development/libraries/apr-util/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, apr, expat, gnused
+{ lib, stdenv, fetchurl, makeWrapper, apr, expat, gnused
 , sslSupport ? true, openssl
 , bdbSupport ? true, db
 , ldapSupport ? !stdenv.isCygwin, openldap
@@ -10,7 +10,7 @@ assert sslSupport -> openssl != null;
 assert bdbSupport -> db != null;
 assert ldapSupport -> openldap != null;
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   name = "apr-util-1.6.1";
@@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
     inherit sslSupport bdbSupport ldapSupport;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://apr.apache.org/";
     description = "A companion library to APR, the Apache Portable Runtime";
     maintainers = [ maintainers.eelco ];
diff --git a/nixpkgs/pkgs/development/libraries/apr/default.nix b/nixpkgs/pkgs/development/libraries/apr/default.nix
index ce33c0534fa4..c7a1073d137a 100644
--- a/nixpkgs/pkgs/development/libraries/apr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/apr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "apr-1.7.0";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1spp6r2a3xcl5yajm9safhzyilsdzgagc2dadif8x6z9nbq4iqg2";
   };
 
-  patches = stdenv.lib.optionals stdenv.isDarwin [ ./is-this-a-compiler-bug.patch ];
+  patches = lib.optionals stdenv.isDarwin [ ./is-this-a-compiler-bug.patch ];
 
   # This test needs the net
   postPatch = ''
@@ -23,22 +23,22 @@ stdenv.mkDerivation rec {
       configureFlagsArray+=("--with-installbuilddir=$dev/share/build")
     '';
 
-  configureFlags = stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
+  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"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform.system == "i686-cygwin") [
+  ] ++ 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=stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-DAPR_IOVEC_DEFINED";
+  CPPFLAGS=lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "-DAPR_IOVEC_DEFINED";
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://apr.apache.org/";
     description = "The Apache Portable Runtime library";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/aqbanking/default.nix b/nixpkgs/pkgs/development/libraries/aqbanking/default.nix
index 37bc175fede0..1e11661b0098 100644
--- a/nixpkgs/pkgs/development/libraries/aqbanking/default.nix
+++ b/nixpkgs/pkgs/development/libraries/aqbanking/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, gmp, gwenhywfar, libtool, libxml2, libxslt
-, pkgconfig, gettext, xmlsec, zlib
+{ lib, stdenv, fetchurl, gmp, gwenhywfar, libtool, libxml2, libxslt
+, pkg-config, gettext, xmlsec, zlib
 }:
 
 let
@@ -25,9 +25,9 @@ in stdenv.mkDerivation rec {
 
   buildInputs = [ gmp gwenhywfar libtool libxml2 libxslt xmlsec zlib ];
 
-  nativeBuildInputs = [ pkgconfig gettext ];
+  nativeBuildInputs = [ pkg-config gettext ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An interface to banking tasks, file formats and country information";
     homepage = "https://www.aquamaniac.de/";
     hydraPlatforms = [];
diff --git a/nixpkgs/pkgs/development/libraries/aqbanking/gwenhywfar.nix b/nixpkgs/pkgs/development/libraries/aqbanking/gwenhywfar.nix
index 4c5192574d86..d240e7e3a9dc 100644
--- a/nixpkgs/pkgs/development/libraries/aqbanking/gwenhywfar.nix
+++ b/nixpkgs/pkgs/development/libraries/aqbanking/gwenhywfar.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gnutls, openssl, libgcrypt, libgpgerror, pkgconfig, gettext
+{ lib, stdenv, fetchurl, gnutls, openssl, libgcrypt, libgpgerror, pkg-config, gettext
 , which
 
 # GUI support
@@ -34,7 +34,7 @@ in stdenv.mkDerivation rec {
     isRelative = path: builtins.substring 0 1 path != "/";
     mkSearchPath = path: ''
       p; g; s,\<PLUGINDIR\>,"${path}",g;
-    '' + stdenv.lib.optionalString (isRelative path) ''
+    '' + lib.optionalString (isRelative path) ''
       s/AddPath(\(.*\));/AddRelPath(\1, GWEN_PathManager_RelModeHome);/g
     '';
 
@@ -42,7 +42,7 @@ in stdenv.mkDerivation rec {
     sed -i -e '/GWEN_PathManager_DefinePath.*GWEN_PM_PLUGINDIR/,/^#endif/ {
       /^#if/,/^#endif/ {
         H; /^#endif/ {
-          ${stdenv.lib.concatMapStrings mkSearchPath pluginSearchPaths}
+          ${lib.concatMapStrings mkSearchPath pluginSearchPaths}
         }
       }
     }' src/gwenhywfar.c
@@ -53,11 +53,11 @@ in stdenv.mkDerivation rec {
       configure
   '';
 
-  nativeBuildInputs = [ pkgconfig gettext which ];
+  nativeBuildInputs = [ pkg-config gettext which ];
 
   buildInputs = [ gtk2 gtk3 qt5.qtbase gnutls openssl libgcrypt libgpgerror ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/aqbanking/libchipcard.nix b/nixpkgs/pkgs/development/libraries/aqbanking/libchipcard.nix
index 0e01480a4bdf..f483f232e37b 100644
--- a/nixpkgs/pkgs/development/libraries/aqbanking/libchipcard.nix
+++ b/nixpkgs/pkgs/development/libraries/aqbanking/libchipcard.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, gwenhywfar, pcsclite, zlib }:
+{ lib, stdenv, fetchurl, pkg-config, gwenhywfar, pcsclite, zlib }:
 
 let
   inherit ((import ./sources.nix).libchipcard) sha256 releaseId version;
@@ -11,7 +11,7 @@ in stdenv.mkDerivation rec {
     inherit sha256;
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ gwenhywfar pcsclite zlib ];
 
@@ -19,7 +19,7 @@ in stdenv.mkDerivation rec {
 
   configureFlags = [ "--with-gwen-dir=${gwenhywfar}" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for access to chipcards";
     homepage = "https://www.aquamaniac.de/rdm/projects/libchipcard";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/aravis/default.nix b/nixpkgs/pkgs/development/libraries/aravis/default.nix
index 40a96553fbe2..a915723e2ca7 100644
--- a/nixpkgs/pkgs/development/libraries/aravis/default.nix
+++ b/nixpkgs/pkgs/development/libraries/aravis/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, gtk-doc, intltool
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, gtk-doc, intltool
 , audit, glib, libusb1, libxml2
 , wrapGAppsHook
 , gstreamer ? null
@@ -19,11 +19,11 @@
 
 let
   gstreamerAtLeastVersion1 =
-    stdenv.lib.all
-      (pkg: pkg != null && stdenv.lib.versionAtLeast (stdenv.lib.getVersion pkg) "1.0")
+    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 -> stdenv.lib.all (pkg: pkg != null) [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad ];
+  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 -> gnome3 != null;
@@ -46,29 +46,29 @@ in
 
     nativeBuildInputs = [
       autoreconfHook
-      pkgconfig
+      pkg-config
       intltool
       gtk-doc
-    ] ++ stdenv.lib.optional enableViewer wrapGAppsHook;
+    ] ++ lib.optional enableViewer wrapGAppsHook;
 
     buildInputs =
       [ glib libxml2 ]
-      ++ stdenv.lib.optional enableUsb libusb1
-      ++ stdenv.lib.optional enablePacketSocket audit
-      ++ stdenv.lib.optionals (enableViewer || enableGstPlugin) [ gstreamer gst-plugins-base gst-plugins-good gst-plugins-bad ]
-      ++ stdenv.lib.optionals (enableViewer) [ libnotify gtk3 gnome3.adwaita-icon-theme ];
+      ++ 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 gnome3.adwaita-icon-theme ];
 
-    preAutoreconf = ''./autogen.sh'';
+    preAutoreconf = "./autogen.sh";
 
     configureFlags =
-      stdenv.lib.optional enableUsb "--enable-usb"
-        ++ stdenv.lib.optional enablePacketSocket "--enable-packet-socket"
-        ++ stdenv.lib.optional enableViewer "--enable-viewer"
-        ++ stdenv.lib.optional enableGstPlugin
+      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")
-        ++ stdenv.lib.optional enableCppTest "--enable-cpp-test"
-        ++ stdenv.lib.optional enableFastHeartbeat "--enable-fast-heartbeat"
-        ++ stdenv.lib.optional enableAsan "--enable-asan";
+        ++ 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 .
@@ -82,9 +82,9 @@ in
         Implements the gigabit ethernet and USB3 protocols used by industrial cameras.
       '';
       homepage = "https://aravisproject.github.io/docs/aravis-0.5";
-      license = stdenv.lib.licenses.lgpl2;
+      license = lib.licenses.lgpl2;
       maintainers = [];
-      platforms = stdenv.lib.platforms.unix;
+      platforms = lib.platforms.unix;
     };
   }
 
diff --git a/nixpkgs/pkgs/development/libraries/arb/default.nix b/nixpkgs/pkgs/development/libraries/arb/default.nix
index a9fb5de0bd9f..1c356b59d8a7 100644
--- a/nixpkgs/pkgs/development/libraries/arb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/arb/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, mpir, gmp, mpfr, flint}:
+{lib, stdenv, fetchFromGitHub, mpir, gmp, mpfr, flint}:
 stdenv.mkDerivation rec {
   pname = "arb";
   version = "2.17.0";
@@ -16,12 +16,11 @@ stdenv.mkDerivation rec {
     "--with-flint=${flint}"
   ];
   doCheck = true;
-  meta = with stdenv.lib; {
-    inherit version;
-    description = ''A library for arbitrary-precision interval arithmetic'';
-    homepage = "http://arblib.org/";
-    license = stdenv.lib.licenses.lgpl21Plus;
+  meta = with lib; {
+    description = "A library for arbitrary-precision interval arithmetic";
+    homepage = "https://arblib.org/";
+    license = lib.licenses.lgpl21Plus;
     maintainers = teams.sage.members;
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/argp-standalone/default.nix b/nixpkgs/pkgs/development/libraries/argp-standalone/default.nix
index f961c577aa7d..33b253718a7f 100644
--- a/nixpkgs/pkgs/development/libraries/argp-standalone/default.nix
+++ b/nixpkgs/pkgs/development/libraries/argp-standalone/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch }:
+{ lib, stdenv, fetchurl, fetchpatch }:
 
 let
   patch-argp-fmtstream = fetchpatch {
@@ -28,12 +28,12 @@ stdenv.mkDerivation {
   };
 
   patches =
-       stdenv.lib.optionals stdenv.hostPlatform.isDarwin [ patch-argp-fmtstream ]
-    ++ stdenv.lib.optionals stdenv.hostPlatform.isLinux [ patch-throw-in-funcdef patch-shared ];
+       lib.optionals stdenv.hostPlatform.isDarwin [ patch-argp-fmtstream ]
+    ++ lib.optionals stdenv.hostPlatform.isLinux [ patch-throw-in-funcdef patch-shared ];
 
-  patchFlags = stdenv.lib.optional stdenv.hostPlatform.isDarwin "-p0";
+  patchFlags = lib.optional stdenv.hostPlatform.isDarwin "-p0";
 
-  preConfigure = stdenv.lib.optionalString stdenv.hostPlatform.isLinux "export CFLAGS='-fgnu89-inline'";
+  preConfigure = lib.optionalString stdenv.hostPlatform.isLinux "export CFLAGS='-fgnu89-inline'";
 
   postInstall = ''
     mkdir -p $out/lib $out/include
@@ -47,7 +47,7 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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;
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
index cb0c65e97e3b..85dafde83c27 100644
--- a/nixpkgs/pkgs/development/libraries/arguments/default.nix
+++ b/nixpkgs/pkgs/development/libraries/arguments/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "arguments";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   doCheck = false;
   # internal_volume_io.h: No such file or directory
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/${owner}/${pname}";
     description = "Library for argument handling for MINC programs";
     maintainers = with maintainers; [ bcdarwin ];
diff --git a/nixpkgs/pkgs/development/libraries/aribb25/default.nix b/nixpkgs/pkgs/development/libraries/aribb25/default.nix
index ceae86985456..3e171d757973 100644
--- a/nixpkgs/pkgs/development/libraries/aribb25/default.nix
+++ b/nixpkgs/pkgs/development/libraries/aribb25/default.nix
@@ -3,7 +3,7 @@
 , fetchFromGitLab
 , fetchpatch
 , autoreconfHook
-, pkgconfig
+, pkg-config
 , pcsclite
 , PCSC
 , xcbuild
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     autoreconfHook
-    pkgconfig
+    pkg-config
   ] ++ lib.optional stdenv.isDarwin xcbuild;
   buildInputs = if stdenv.isDarwin then [ PCSC ] else [ pcsclite ];
 
@@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
   buildFlags =
     lib.optional stdenv.isDarwin "pcsclite_CFLAGS=-I${PCSC}/Library/Frameworks/PCSC.framework/Headers";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://code.videolan.org/videolan/aribb25";
     description = "Sample implementation of the ARIB STD-B25 standard";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/armadillo/default.nix b/nixpkgs/pkgs/development/libraries/armadillo/default.nix
index 450182138a40..6696e5720e32 100644
--- a/nixpkgs/pkgs/development/libraries/armadillo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/armadillo/default.nix
@@ -1,12 +1,12 @@
-{ stdenv, fetchurl, cmake, blas, lapack, superlu, hdf5 }:
+{ lib, stdenv, fetchurl, cmake, blas, lapack, superlu, hdf5 }:
 
 stdenv.mkDerivation rec {
   pname = "armadillo";
-  version = "10.1.2";
+  version = "10.2.0";
 
   src = fetchurl {
     url = "mirror://sourceforge/arma/armadillo-${version}.tar.xz";
-    sha256 = "0pb3ypdaiiw0895x1zzzjvkrfp39bsl3s4f6zb5bzv4wbjv7kvwn";
+    sha256 = "sha256-gvhNUmyNpyJAqwXLErPz8eZ00gzLOOAI5L9TNVsapoo=";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./use-unix-config-on-OS-X.patch ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ linear algebra library";
     homepage = "http://arma.sourceforge.net";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/arrayfire/default.nix b/nixpkgs/pkgs/development/libraries/arrayfire/default.nix
index 9dd4b1b93a9d..c636d672332c 100644
--- a/nixpkgs/pkgs/development/libraries/arrayfire/default.nix
+++ b/nixpkgs/pkgs/development/libraries/arrayfire/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchFromGitHub, cmake, pkgconfig
+{ lib, stdenv, fetchurl, fetchFromGitHub, cmake, pkg-config
 , opencl-clhpp, ocl-icd, fftw, fftwFloat
 , blas, lapack, boost, mesa, libGLU, libGL
 , freeimage, python, clfft, clblas
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     "-DAF_BUILD_OPENCL=OFF"
     "-DAF_BUILD_EXAMPLES=OFF"
     "-DBUILD_TESTING=OFF"
-  ] ++ stdenv.lib.optional cudaSupport "-DCMAKE_LIBRARY_PATH=${cudatoolkit}/lib/stubs";
+  ] ++ lib.optional cudaSupport "-DCMAKE_LIBRARY_PATH=${cudatoolkit}/lib/stubs";
 
   patches = [ ./no-download.patch ];
 
@@ -32,15 +32,13 @@ stdenv.mkDerivation rec {
     cp -R --no-preserve=mode,ownership ${opencl-clhpp}/include/CL/cl2.hpp ./build/include/CL/cl2.hpp
   '';
 
-  preBuild = stdenv.lib.optionalString cudaSupport ''
+  preBuild = lib.optionalString cudaSupport ''
     export CUDA_PATH="${cudatoolkit}"
   '';
 
-  enableParallelBuilding = true;
-
   nativeBuildInputs = [
     cmake
-    pkgconfig
+    pkg-config
     python
   ];
 
@@ -50,11 +48,11 @@ stdenv.mkDerivation rec {
     libGLU libGL
     mesa freeimage
     boost.out boost.dev
-  ] ++ (stdenv.lib.optional stdenv.isLinux ocl-icd)
-    ++ (stdenv.lib.optional cudaSupport cudatoolkit)
-    ++ (stdenv.lib.optional buildDocs doxygen);
+  ] ++ (lib.optional stdenv.isLinux ocl-icd)
+    ++ (lib.optional cudaSupport cudatoolkit)
+    ++ (lib.optional buildDocs doxygen);
 
-  meta = with stdenv.lib; {
+  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.";
diff --git a/nixpkgs/pkgs/development/libraries/asio/generic.nix b/nixpkgs/pkgs/development/libraries/asio/generic.nix
index d83a48e61b8a..8bcc12ae2b3a 100644
--- a/nixpkgs/pkgs/development/libraries/asio/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/asio/generic.nix
@@ -1,8 +1,8 @@
-{stdenv, fetchurl, boost, openssl
+{lib, stdenv, fetchurl, boost, openssl
 , version, sha256, ...
 }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation {
   pname = "asio";
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
     homepage = "http://asio.sourceforge.net/";
     description = "Cross-platform C++ library for network and low-level I/O programming";
     license = licenses.boost;
-    broken = stdenv.isDarwin && stdenv.lib.versionOlder version "1.16.1";
+    broken = stdenv.isDarwin && lib.versionOlder version "1.16.1";
     platforms = platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/aspell/default.nix b/nixpkgs/pkgs/development/libraries/aspell/default.nix
index 68faef7e7862..01acced98f6f 100644
--- a/nixpkgs/pkgs/development/libraries/aspell/default.nix
+++ b/nixpkgs/pkgs/development/libraries/aspell/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, fetchzip, perl
+{ lib, stdenv, fetchurl, fetchpatch, fetchzip, perl
 , searchNixProfiles ? true
 }:
 
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     sha256 = "1wi60ankalmh8ds7nplz434jd7j94gdvbahdwsr539rlad8pxdzr";
   };
 
-  patches = stdenv.lib.optional searchNixProfiles ./data-dirs-from-nix-profiles.patch;
+  patches = lib.optional searchNixProfiles ./data-dirs-from-nix-profiles.patch;
 
   postPatch = ''
     patch interfaces/cc/aspell.h < ${./clang.patch}
@@ -51,8 +51,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Spell checker for many languages";
     homepage = "http://aspell.net/";
-    license = stdenv.lib.licenses.lgpl2Plus;
+    license = lib.licenses.lgpl2Plus;
     maintainers = [ ];
-    platforms = with stdenv.lib.platforms; all;
+    platforms = with lib.platforms; all;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/aspell/dictionaries.nix b/nixpkgs/pkgs/development/libraries/aspell/dictionaries.nix
index d40f4b5aae42..3923416c4a35 100644
--- a/nixpkgs/pkgs/development/libraries/aspell/dictionaries.nix
+++ b/nixpkgs/pkgs/development/libraries/aspell/dictionaries.nix
@@ -49,7 +49,7 @@ let
 
       meta = {
         description = "Aspell dictionary for ${fullName}";
-        platforms = stdenv.lib.platforms.all;
+        platforms = lib.platforms.all;
       } // (args.meta or {});
     } // removeAttrs args [ "meta" ]);
 
diff --git a/nixpkgs/pkgs/development/libraries/assimp/default.nix b/nixpkgs/pkgs/development/libraries/assimp/default.nix
index c1972aa1ca81..a2cd3a2a4571 100644
--- a/nixpkgs/pkgs/development/libraries/assimp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/assimp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, boost, zlib }:
+{ lib, stdenv, fetchFromGitHub, cmake, boost, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "assimp";
@@ -11,9 +11,10 @@ stdenv.mkDerivation rec {
     sha256 = "00vxzfcrs856qnyk806wqr67nmpjk06mjby0fqmyhm6i1jj2hg1w";
   };
 
-  buildInputs = [ cmake boost zlib ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost zlib ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library to import various 3D model formats";
     homepage = "http://assimp.sourceforge.net/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/at-spi2-atk/default.nix b/nixpkgs/pkgs/development/libraries/at-spi2-atk/default.nix
index 04f8c266131b..1e5a1d3fd64c 100644
--- a/nixpkgs/pkgs/development/libraries/at-spi2-atk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/at-spi2-atk/default.nix
@@ -1,9 +1,9 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 
 , at-spi2-core
 , atk
@@ -19,11 +19,11 @@ stdenv.mkDerivation rec {
   version = "2.38.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "z6AIpa+CKzauYofxgYLEDJHdaZxV+qOGBYge0XXKRk8=";
   };
 
-  nativeBuildInputs = [ meson ninja pkgconfig ];
+  nativeBuildInputs = [ meson ninja pkg-config ];
   buildInputs = [ at-spi2-core atk dbus glib libxml2 ];
 
   doCheck = false; # fails with "No test data file provided"
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/at-spi2-core/default.nix b/nixpkgs/pkgs/development/libraries/at-spi2-core/default.nix
index ba77020ec703..7e1181cf3bdf 100644
--- a/nixpkgs/pkgs/development/libraries/at-spi2-core/default.nix
+++ b/nixpkgs/pkgs/development/libraries/at-spi2-core/default.nix
@@ -1,9 +1,9 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , gobject-introspection
 , gsettings-desktop-schemas
 , makeWrapper
@@ -23,13 +23,13 @@ stdenv.mkDerivation rec {
   version = "2.38.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "hONsP+ZoYhM/X+Ipdyt2qiUm4Q3lAUo3ePL6Rs5VDaU=";
   };
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ meson ninja pkgconfig gobject-introspection makeWrapper ];
+  nativeBuildInputs = [ meson ninja pkg-config gobject-introspection makeWrapper ];
   buildInputs = [ libX11 libXtst libXi ];
   # In atspi-2.pc dbus-1 glib-2.0
   propagatedBuildInputs = [ dbus glib ];
@@ -51,11 +51,11 @@ stdenv.mkDerivation rec {
   postFixup = ''
     # Cannot use wrapGAppsHook'due to a dependency cycle
     wrapProgram $out/libexec/at-spi-bus-launcher \
-      --prefix GIO_EXTRA_MODULES : "${stdenv.lib.getLib dconf}/lib/gio/modules" \
+      --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 stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/atk/default.nix b/nixpkgs/pkgs/development/libraries/atk/default.nix
index aa132515b3e9..53eb4459770d 100644
--- a/nixpkgs/pkgs/development/libraries/atk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/atk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, meson, ninja, gettext, pkgconfig, glib
+{ lib, stdenv, fetchurl, meson, ninja, gettext, pkg-config, glib
 , fixDarwinDylibNames, gobject-introspection, gnome3
 }:
 
@@ -11,14 +11,14 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "1217cmmykjgkkim0zr1lv5j13733m4w5vipmy4ivw0ll6rz28xpv";
   };
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ meson ninja pkgconfig gettext gobject-introspection glib ]
-    ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+  nativeBuildInputs = [ meson ninja pkg-config gettext gobject-introspection glib ]
+    ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
   propagatedBuildInputs = [
     # Required by atk.pc
@@ -52,10 +52,10 @@ stdenv.mkDerivation rec {
 
     homepage = "http://library.gnome.org/devel/atk/";
 
-    license = stdenv.lib.licenses.lgpl2Plus;
+    license = lib.licenses.lgpl2Plus;
 
-    maintainers = with stdenv.lib.maintainers; [ raskin ];
-    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    maintainers = with lib.maintainers; [ raskin ];
+    platforms = lib.platforms.linux ++ lib.platforms.darwin;
   };
 
 }
diff --git a/nixpkgs/pkgs/development/libraries/atkmm/default.nix b/nixpkgs/pkgs/development/libraries/atkmm/default.nix
index cc45dc5a8d88..e9c63eb650f7 100644
--- a/nixpkgs/pkgs/development/libraries/atkmm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/atkmm/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, atk, glibmm, pkgconfig, gnome3 }:
+{ lib, stdenv, fetchurl, atk, glibmm, pkg-config, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "atkmm";
   version = "2.28.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0fnxrspxkhhbrjphqrpvl3zjm66n50s4cywrrrwkhbflgy8zqk2c";
   };
 
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ atk glibmm ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   doCheck = true;
 
@@ -25,8 +25,8 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "C++ wrappers for ATK accessibility toolkit";
-    license = stdenv.lib.licenses.lgpl21Plus;
+    license = lib.licenses.lgpl21Plus;
     homepage = "https://gtkmm.org";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/attr/default.nix b/nixpkgs/pkgs/development/libraries/attr/default.nix
index d69d475f7370..b7c9287b68bc 100644
--- a/nixpkgs/pkgs/development/libraries/attr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/attr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gettext }:
+{ lib, stdenv, fetchurl, gettext }:
 
 # Note: this package is used for bootstrapping fetchurl, and thus
 # cannot use fetchpatch! All mutable patches (generated by GitHub or
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://savannah.nongnu.org/projects/attr/";
     description = "Library and tools for manipulating extended attributes";
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/aubio/default.nix b/nixpkgs/pkgs/development/libraries/aubio/default.nix
index bd1d86520c0c..7aa4859ef0ed 100644
--- a/nixpkgs/pkgs/development/libraries/aubio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/aubio/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, alsaLib, fftw, libjack2, libsamplerate
-, libsndfile, pkgconfig, python, wafHook
+{ lib, stdenv, fetchurl, alsaLib, fftw, libjack2, libsamplerate
+, libsndfile, pkg-config, python, wafHook
 }:
 
 stdenv.mkDerivation rec {
@@ -10,10 +10,10 @@ stdenv.mkDerivation rec {
     sha256 = "1npks71ljc48w6858l9bq30kaf5nph8z0v61jkfb70xb9np850nl";
   };
 
-  nativeBuildInputs = [ pkgconfig python wafHook ];
+  nativeBuildInputs = [ pkg-config python wafHook ];
   buildInputs = [ alsaLib fftw libjack2 libsamplerate libsndfile ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for audio labelling";
     homepage = "https://aubio.org/";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/audiality2/default.nix b/nixpkgs/pkgs/development/libraries/audiality2/default.nix
index a311c5f5479f..e0ab0accdfde 100644
--- a/nixpkgs/pkgs/development/libraries/audiality2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audiality2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , pkg-config
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     jack2
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A realtime scripted modular audio engine for video games and musical applications";
     homepage = "http://audiality.org";
     license = licenses.zlib;
diff --git a/nixpkgs/pkgs/development/libraries/audio/jamomacore/default.nix b/nixpkgs/pkgs/development/libraries/audio/jamomacore/default.nix
deleted file mode 100644
index 7c9b3ef67c9b..000000000000
--- a/nixpkgs/pkgs/development/libraries/audio/jamomacore/default.nix
+++ /dev/null
@@ -1,25 +0,0 @@
-{ stdenv, fetchFromGitHub, pkgconfig, alsaLib, portaudio, portmidi, libsndfile, cmake, libxml2 }:
-
-stdenv.mkDerivation rec {
-  version = "1.0-beta.1";
-  pname = "JamomaCore";
-
-  src = fetchFromGitHub {
-    owner = "jamoma";
-    repo = "JamomaCore";
-    rev = "v${version}";
-    sha256 = "1hb9b6qc18rsvzvixgllknn756m6zwcn22c79rdibbyz1bhrcnln";
-  };
-
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ alsaLib portaudio portmidi libsndfile cmake libxml2 ];
-
-  meta = {
-    description = "A C++ platform for building dynamic and reflexive systems with an emphasis on audio and media";
-    homepage = "http://www.jamoma.org";
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = [ stdenv.lib.maintainers.magnetophon ];
-    platforms = stdenv.lib.platforms.linux;
-    broken = true; # 2018-04-10
-  };
-}
diff --git a/nixpkgs/pkgs/development/libraries/audio/libbass/default.nix b/nixpkgs/pkgs/development/libraries/audio/libbass/default.nix
index 593854bb280d..2e10dbd88150 100644
--- a/nixpkgs/pkgs/development/libraries/audio/libbass/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/libbass/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, unzip, fetchurl }:
+{ lib, stdenv, unzip, fetchurl }:
 
 # Upstream changes files in-place, to update:
 # 1. Check latest version at http://www.un4seen.com/
@@ -55,7 +55,7 @@ let
         install -m644 -t $out/include/ ${bass.h}
       '';
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       description = "Shareware audio library";
       homepage = "https://www.un4seen.com/";
       license = licenses.unfreeRedistributable;
@@ -63,4 +63,4 @@ let
     };
   };
 
-in stdenv.lib.mapAttrs dropBass allBass
+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
index bc98dab4ab62..11135b14fd48 100644
--- a/nixpkgs/pkgs/development/libraries/audio/libbs2b/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/libbs2b/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libsndfile }:
+{ lib, stdenv, fetchurl, pkg-config, libsndfile }:
 
 stdenv.mkDerivation rec {
   pname = "libbs2b";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0vz442kkjn2h0dlxppzi4m5zx8qfyrivq581n06xzvnyxi5rg6a7";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libsndfile ];
 
   hardeningDisable = [ "format" ];
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://bs2b.sourceforge.net/";
     description = "Bauer stereophonic-to-binaural DSP library";
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.unix;
+    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
index 3ac8293986d8..927bd00656e6 100644
--- a/nixpkgs/pkgs/development/libraries/audio/libgme/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/libgme/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchFromBitbucket, cmake, removeReferencesTo }:
+{ lib, stdenv, fetchFromBitbucket, cmake, removeReferencesTo }:
 let
   version = "0.6.3";
 in stdenv.mkDerivation {
   pname = "libgme";
   inherit version;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A collection of video game music chip emulators";
     homepage = "https://bitbucket.org/mpyne/game-music-emu/overview";
     license = licenses.lgpl21;
@@ -20,15 +20,13 @@ in stdenv.mkDerivation {
     sha256 = "100ahb4n4pvgcry9xzlf2fr4j57n5h9x7pvyhhxys4dcy8axqqsy";
   };
 
-  buildInputs = [ cmake ];
-
-  nativeBuildInputs = [ removeReferencesTo ];
+  nativeBuildInputs = [ cmake removeReferencesTo ];
 
   # It used to reference it, in the past, but thanks to the postFixup hook, now
   # it doesn't.
   disallowedReferences = [ stdenv.cc.cc ];
 
-  postFixup = stdenv.lib.optionalString stdenv.isLinux ''
+  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
index 3968794d2dc7..29781446c8fe 100644
--- a/nixpkgs/pkgs/development/libraries/audio/libinstpatch/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/libinstpatch/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkg-config, glib, libsndfile }:
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, glib, libsndfile }:
 
 stdenv.mkDerivation rec {
   pname = "libinstpatch";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     "-DLIB_SUFFIX=" # Install in $out/lib.
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.swamiproject.org/";
     description = "MIDI instrument patch files support library";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/audio/libmysofa/default.nix b/nixpkgs/pkgs/development/libraries/audio/libmysofa/default.nix
index c2b2725c19cc..9c636e0205df 100644
--- a/nixpkgs/pkgs/development/libraries/audio/libmysofa/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/libmysofa/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, zlib }:
+{ lib, stdenv, fetchFromGitHub, cmake, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "libmysofa";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [ "-DBUILD_TESTS=OFF" "-DCODE_COVERAGE=OFF" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Reader for AES SOFA files to get better HRTFs";
     homepage = "https://github.com/hoene/libmysofa";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/audio/libsmf/default.nix b/nixpkgs/pkgs/development/libraries/audio/libsmf/default.nix
index d521b7e76abb..0c173a6a99e0 100644
--- a/nixpkgs/pkgs/development/libraries/audio/libsmf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/libsmf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, glib, pkgconfig }:
+{ lib, stdenv, fetchurl, autoreconfHook, glib, pkg-config }:
 
 stdenv.mkDerivation rec {
   version = "1.3";
@@ -8,10 +8,10 @@ stdenv.mkDerivation rec {
     sha256 = "1527pcc1vd0l5iks2yw8m0bymcrnih2md5465lwpzw0wgy4rky7n";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ glib ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A C library for reading and writing Standard MIDI Files";
     homepage = "https://github.com/stump/libsmf";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/audio/lilv/default.nix b/nixpkgs/pkgs/development/libraries/audio/lilv/default.nix
index e8008058626a..79f09f48464f 100644
--- a/nixpkgs/pkgs/development/libraries/audio/lilv/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/lilv/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, lv2, pkgconfig, python3, serd, sord, sratom, wafHook }:
+{ lib, stdenv, fetchurl, lv2, pkg-config, python3, serd, sord, sratom, wafHook }:
 
 stdenv.mkDerivation rec {
   pname = "lilv";
@@ -11,11 +11,11 @@ stdenv.mkDerivation rec {
 
   patches = [ ./lilv-pkgconfig.patch ];
 
-  nativeBuildInputs = [ pkgconfig python3 wafHook ];
+  nativeBuildInputs = [ pkg-config python3 wafHook ];
   buildInputs = [ serd sord sratom ];
   propagatedBuildInputs = [ lv2 ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://drobilla.net/software/lilv";
     description = "A C library to make the use of LV2 plugins";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/audio/lv2/default.nix b/nixpkgs/pkgs/development/libraries/audio/lv2/default.nix
index dac985846469..45caf0b36c50 100644
--- a/nixpkgs/pkgs/development/libraries/audio/lv2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/lv2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gtk2, libsndfile, pkgconfig, python3, wafHook }:
+{ lib, stdenv, fetchurl, gtk2, libsndfile, pkg-config, python3, wafHook }:
 
 stdenv.mkDerivation rec {
   pname = "lv2";
@@ -9,12 +9,12 @@ stdenv.mkDerivation rec {
     sha256 = "0gs7401xz23q9vajqr31aa2db8dvssgyh5zrvr4ipa6wig7yb8wh";
   };
 
-  nativeBuildInputs = [ pkgconfig wafHook ];
+  nativeBuildInputs = [ pkg-config wafHook ];
   buildInputs = [ gtk2 libsndfile python3 ];
 
-  wafConfigureFlags = stdenv.lib.optionals stdenv.isDarwin [ "--lv2dir=${placeholder "out"}/lib/lv2" ];
+  wafConfigureFlags = lib.optionals stdenv.isDarwin [ "--lv2dir=${placeholder "out"}/lib/lv2" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://lv2plug.in";
     description = "A plugin standard for audio systems";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/audio/lvtk/default.nix b/nixpkgs/pkgs/development/libraries/audio/lvtk/default.nix
index 6bc487e26162..cecae743da05 100644
--- a/nixpkgs/pkgs/development/libraries/audio/lvtk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/lvtk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, boost, gtkmm2, lv2, pkgconfig, python, wafHook }:
+{ lib, stdenv, fetchurl, boost, gtkmm2, lv2, pkg-config, python, wafHook }:
 
 stdenv.mkDerivation rec {
   pname = "lvtk";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "03nbj2cqcklqwh50zj2gwm07crh5iwqbpxbpzwbg5hvgl4k4rnjd";
   };
 
-  nativeBuildInputs = [ pkgconfig python wafHook ];
+  nativeBuildInputs = [ pkg-config python wafHook ];
   buildInputs = [ boost gtkmm2 lv2 ];
 
   enableParallelBuilding = true;
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     "--boost-libs=${boost.out}/lib"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A set C++ wrappers around the LV2 C API";
     homepage = "https://lvtk.org/";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/audio/mbelib/default.nix b/nixpkgs/pkgs/development/libraries/audio/mbelib/default.nix
index 1fda3a919264..f13f6d7063cb 100644
--- a/nixpkgs/pkgs/development/libraries/audio/mbelib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/mbelib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "mbelib";
@@ -13,15 +13,13 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  enableParallelBuilding = true;
-
   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 stdenv.lib; {
+  meta = with lib; {
     description = "P25 Phase 1 and ProVoice vocoder";
     homepage = https://github.com/szechyjs/mbelib;
     license = licenses.isc;
diff --git a/nixpkgs/pkgs/development/libraries/audio/ntk/default.nix b/nixpkgs/pkgs/development/libraries/audio/ntk/default.nix
index f039e574d547..ecb0215a2287 100644
--- a/nixpkgs/pkgs/development/libraries/audio/ntk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/ntk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cairo, libjpeg, libXft, pkgconfig, python2, wafHook }:
+{ lib, stdenv, fetchFromGitHub, cairo, libjpeg, libXft, pkg-config, python2, wafHook }:
 
 stdenv.mkDerivation rec {
   pname = "ntk";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "0j38mhnfqy6swcrnc5zxcwlqi8b1pgklyghxk6qs1lf4japv2zc0";
   };
 
-  nativeBuildInputs = [ pkgconfig wafHook ];
+  nativeBuildInputs = [ pkg-config wafHook ];
   buildInputs = [
     cairo libjpeg libXft python2
   ];
@@ -19,8 +19,8 @@ stdenv.mkDerivation rec {
     description = "Fork of FLTK 1.3.0 with additional functionality";
     version = version;
     homepage = "http://non.tuxfamily.org/";
-    license = stdenv.lib.licenses.lgpl21;
-    maintainers = with stdenv.lib.maintainers; [ magnetophon nico202 ];
-    platforms = stdenv.lib.platforms.linux;
+    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
index a93b031a4d15..3d8e15f97cdb 100644
--- a/nixpkgs/pkgs/development/libraries/audio/qm-dsp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/qm-dsp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 , kissfft
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = "-I${kissfft}/include/kissfft";
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/audio/raul/default.nix b/nixpkgs/pkgs/development/libraries/audio/raul/default.nix
index 8acd6d3c6664..a0089e310441 100644
--- a/nixpkgs/pkgs/development/libraries/audio/raul/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/raul/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, boost, gtk2, pkgconfig, python, wafHook }:
+{ lib, stdenv, fetchgit, boost, gtk2, pkg-config, python, wafHook }:
 
 stdenv.mkDerivation rec {
   pname = "raul";
@@ -12,10 +12,10 @@ stdenv.mkDerivation rec {
     sha256 = "1z37jb6ghc13b8nv8a8hcg669gl8vh4ni9djvfgga9vcz8rmcg8l";
   };
 
-  nativeBuildInputs = [ pkgconfig wafHook ];
+  nativeBuildInputs = [ pkg-config wafHook ];
   buildInputs = [ boost gtk2 python ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A C++ utility library primarily aimed at audio/musical applications";
     homepage = "http://drobilla.net/software/raul";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/audio/rtaudio/default.nix b/nixpkgs/pkgs/development/libraries/audio/rtaudio/default.nix
index 53efa598079b..820ea1e49b9e 100644
--- a/nixpkgs/pkgs/development/libraries/audio/rtaudio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/rtaudio/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoconf, automake, libtool, libjack2,  alsaLib, pulseaudio, rtmidi }:
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, libjack2,  alsaLib, pulseaudio, rtmidi }:
 
 stdenv.mkDerivation rec {
   version = "5.1.0";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     ./configure
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A set of C++ classes that provide a cross platform API for realtime audio input/output";
     homepage =  "http://www.music.mcgill.ca/~gary/rtaudio/";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/audio/rtmidi/default.nix b/nixpkgs/pkgs/development/libraries/audio/rtmidi/default.nix
index d30b1ce6c64c..f6208bab6c60 100644
--- a/nixpkgs/pkgs/development/libraries/audio/rtmidi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/rtmidi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoconf, automake, libtool, libjack2, alsaLib, pkgconfig }:
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, libjack2, alsaLib, pkg-config }:
 
 stdenv.mkDerivation rec {
   version = "4.0.0";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ autoconf automake libtool libjack2 alsaLib ];
 
   preConfigure = ''
@@ -24,8 +24,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A set of C++ classes that provide a cross platform API for realtime MIDI input/output";
     homepage =  "http://www.music.mcgill.ca/~gary/rtmidi/";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.magnetophon ];
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.magnetophon ];
+    platforms = with lib.platforms; linux ++ darwin;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/audio/sratom/default.nix b/nixpkgs/pkgs/development/libraries/audio/sratom/default.nix
index cec50290d09e..464e79f6c2dd 100644
--- a/nixpkgs/pkgs/development/libraries/audio/sratom/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/sratom/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, lv2, pkgconfig, python3, serd, sord, wafHook }:
+{ lib, stdenv, fetchurl, lv2, pkg-config, python3, serd, sord, wafHook }:
 
 stdenv.mkDerivation rec {
   pname = "sratom";
@@ -9,10 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "0vh0biy3ngpzzgdml309c2mqz8xq9q0hlblczb4c6alhp0a8yv0l";
   };
 
-  nativeBuildInputs = [ pkgconfig wafHook python3 ];
+  nativeBuildInputs = [ pkg-config wafHook python3 ];
   buildInputs = [ lv2 serd sord ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://drobilla.net/software/sratom";
     description = "A library for serialising LV2 atoms to/from RDF";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/audio/suil/default.nix b/nixpkgs/pkgs/development/libraries/audio/suil/default.nix
index c2496840b7d4..0f4dd0f62c47 100644
--- a/nixpkgs/pkgs/development/libraries/audio/suil/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/suil/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, gtk2, lv2, pkgconfig, python, serd, sord, sratom
+{ stdenv, lib, fetchurl, gtk2, lv2, pkg-config, python, serd, sord, sratom
 , wafHook
 , withQt4 ? true, qt4 ? null
 , withQt5 ? false, qt5 ? null }:
@@ -17,12 +17,12 @@ stdenv.mkDerivation rec {
     sha256 = "0z4v01pjw4wh65x38w6icn28wdwxz13ayl8hvn4p1g9kmamp1z06";
   };
 
-  nativeBuildInputs = [ pkgconfig wafHook ];
+  nativeBuildInputs = [ pkg-config wafHook ];
   buildInputs = [ gtk2 lv2 python serd sord sratom ]
     ++ (lib.optionals withQt4 [ qt4 ])
     ++ (lib.optionals withQt5 (with qt5; [ qtbase qttools ]));
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://drobilla.net/software/suil";
     description = "A lightweight C library for loading and wrapping LV2 plugin UIs";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix b/nixpkgs/pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix
index 0e49a6265120..4d033d99d295 100644
--- a/nixpkgs/pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/vamp-plugin-sdk/default.nix
@@ -1,7 +1,7 @@
 # set VAMP_PATH ?
 # plugins availible on sourceforge and http://www.vamp-plugins.org/download.html (various licenses)
 
-{ stdenv, fetchFromGitHub, pkgconfig, libsndfile }:
+{ lib, stdenv, fetchFromGitHub, pkg-config, libsndfile }:
 
 stdenv.mkDerivation rec {
   pname = "vamp-plugin-sdk";
@@ -14,12 +14,12 @@ stdenv.mkDerivation rec {
     sha256 = "1lhmskcyk7qqfikmasiw7wjry74gc8g5q6a3j1iya84yd7ll0cz6";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libsndfile ];
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix b/nixpkgs/pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix
index c819f355e0b8..45f5fcfe3a44 100644
--- a/nixpkgs/pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/zita-alsa-pcmi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl , alsaLib, }:
+{ lib, stdenv, fetchurl , alsaLib, }:
 
 stdenv.mkDerivation rec {
   pname = "zita-alsa-pcmi";
@@ -57,8 +57,8 @@ stdenv.mkDerivation rec {
     description = "The successor of clalsadrv, provides easy access to ALSA PCM devices";
     version = version;
     homepage = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html";
-    license = stdenv.lib.licenses.gpl3;
-    maintainers = [ stdenv.lib.maintainers.magnetophon ];
-    platforms = stdenv.lib.platforms.linux;
+    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
index 2b7d89b30a17..3b77bf549ca6 100644
--- a/nixpkgs/pkgs/development/libraries/audio/zita-convolver/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/zita-convolver/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fftwFloat }:
+{ lib, stdenv, fetchurl, fftwFloat }:
 
 stdenv.mkDerivation rec {
   pname = "zita-convolver";
@@ -22,15 +22,15 @@ stdenv.mkDerivation rec {
 
   postInstall = ''
     # create lib link for building apps
-    ln -s $out/lib/libzita-convolver.so.${version} $out/lib/libzita-convolver.so.${stdenv.lib.versions.major version}
+    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 = stdenv.lib.licenses.gpl2;
-    maintainers = [ stdenv.lib.maintainers.magnetophon ];
-    platforms = stdenv.lib.platforms.linux;
+    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
index 2881e5662180..88e81d733b32 100644
--- a/nixpkgs/pkgs/development/libraries/audio/zita-resampler/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audio/zita-resampler/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "zita-resampler";
@@ -26,8 +26,8 @@ stdenv.mkDerivation rec {
     description = "Resample library by Fons Adriaensen";
     version = version;
     homepage = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html";
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = [ stdenv.lib.maintainers.magnetophon ];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl2;
+    maintainers = [ lib.maintainers.magnetophon ];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/audiofile/default.nix b/nixpkgs/pkgs/development/libraries/audiofile/default.nix
index 86531a6ad25d..88b1840955d3 100644
--- a/nixpkgs/pkgs/development/libraries/audiofile/default.nix
+++ b/nixpkgs/pkgs/development/libraries/audiofile/default.nix
@@ -14,9 +14,9 @@ stdenv.mkDerivation rec {
   name = "audiofile-0.3.6";
 
   buildInputs =
-    stdenv.lib.optionals stdenv.isLinux [
+    lib.optionals stdenv.isLinux [
       alsaLib
-    ] ++ stdenv.lib.optionals stdenv.isDarwin [
+    ] ++ lib.optionals stdenv.isDarwin [
       CoreServices AudioUnit
     ];
 
@@ -84,7 +84,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for reading and writing audio files in various formats";
     homepage    = "http://www.68k.org/~michael/audiofile/";
     license     = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/avahi/default.nix b/nixpkgs/pkgs/development/libraries/avahi/default.nix
index a560cc39d162..dd54ba79db72 100644
--- a/nixpkgs/pkgs/development/libraries/avahi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/avahi/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, fetchpatch, stdenv, pkgconfig, libdaemon, dbus, perlPackages
+{ fetchurl, fetchpatch, lib, stdenv, pkg-config, libdaemon, dbus, perlPackages
 , expat, gettext, intltool, glib, libiconv, writeShellScriptBin, libevent
 , gtk3Support ? false, gtk3 ? null
 , qt4 ? null
@@ -13,11 +13,11 @@ assert qt4Support -> qt4 != null;
 
 let
   # despite the configure script claiming it supports $PKG_CONFIG, it doesnt respect it
-  pkgconfig-helper = writeShellScriptBin "pkg-config" ''exec $PKG_CONFIG "$@"'';
+  pkg-config-helper = writeShellScriptBin "pkg-config" ''exec $PKG_CONFIG "$@"'';
 in
 
 stdenv.mkDerivation rec {
-  name = "avahi${stdenv.lib.optionalString withLibdnssdCompat "-compat"}-${version}";
+  name = "avahi${lib.optionalString withLibdnssdCompat "-compat"}-${version}";
   version = "0.8";
 
   src = fetchurl {
@@ -36,32 +36,32 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libdaemon dbus glib expat libiconv libevent ]
     ++ (with perlPackages; [ perl XMLParser ])
-    ++ (stdenv.lib.optional gtk3Support gtk3)
-    ++ (stdenv.lib.optional qt4Support qt4)
-    ++ (stdenv.lib.optional qt5Support qt5);
+    ++ (lib.optional gtk3Support gtk3)
+    ++ (lib.optional qt4Support qt4)
+    ++ (lib.optional qt5Support qt5);
 
   propagatedBuildInputs =
-    stdenv.lib.optionals withPython (with python.pkgs; [ python pygobject3 dbus-python ]);
+    lib.optionals withPython (with python.pkgs; [ python pygobject3 dbus-python ]);
 
-  nativeBuildInputs = [ pkgconfig pkgconfig-helper gettext intltool glib ];
+  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"
-      (stdenv.lib.enableFeature gtk3Support "gtk3")
+      (lib.enableFeature gtk3Support "gtk3")
       "--${if qt4Support then "enable" else "disable"}-qt4"
       "--${if qt5Support then "enable" else "disable"}-qt5"
-      (stdenv.lib.enableFeature withPython "python")
+      (lib.enableFeature withPython "python")
       "--localstatedir=/var" "--with-distro=none"
       # A systemd unit is provided by the avahi-daemon NixOS module
       "--with-systemdsystemunitdir=no" ]
-    ++ stdenv.lib.optional withLibdnssdCompat "--enable-compat-libdns_sd"
+    ++ lib.optional withLibdnssdCompat "--enable-compat-libdns_sd"
     # autoipd won't build on darwin
-    ++ stdenv.lib.optional stdenv.isDarwin "--disable-autoipd";
+    ++ lib.optional stdenv.isDarwin "--disable-autoipd";
 
   NIX_CFLAGS_COMPILE = "-DAVAHI_SERVICE_DIR=\"/etc/avahi/services\"";
 
-  preBuild = stdenv.lib.optionalString stdenv.isDarwin ''
+  preBuild = lib.optionalString stdenv.isDarwin ''
     sed -i '20 i\
     #define __APPLE_USE_RFC_2292' \
     avahi-core/socket.c
@@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
 
   postInstall =
     # Maintain compat for mdnsresponder and howl
-    stdenv.lib.optionalString withLibdnssdCompat ''
+    lib.optionalString withLibdnssdCompat ''
       ln -s avahi-compat-libdns_sd/dns_sd.h "$out/include/dns_sd.h"
     '';
   /*  # these don't exist (anymore?)
@@ -77,7 +77,7 @@ stdenv.mkDerivation rec {
     ln -s avahi-compat-howl.pc $out/lib/pkgconfig/howl.pc
   */
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "mDNS/DNS-SD implementation";
     homepage    = "http://avahi.org";
     license     = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/avro-c++/default.nix b/nixpkgs/pkgs/development/libraries/avro-c++/default.nix
index 3e7bc67d25b3..15e2516c1b6b 100644
--- a/nixpkgs/pkgs/development/libraries/avro-c++/default.nix
+++ b/nixpkgs/pkgs/development/libraries/avro-c++/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, boost, python2}:
+{ lib, stdenv, fetchurl, cmake, boost, python2}:
 
 let version = "1.8.2"; in
 
@@ -11,24 +11,19 @@ stdenv.mkDerivation {
     sha256 = "1ars58bfw83s8f1iqbhnqp4n9wc9cxsph0gs2a8k7r9fi09vja2k";
   };
 
-  buildInputs = [
-    cmake
-    python2
-    boost
-  ];
+  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"
   '';
 
-  enableParallelBuilding = true;
-
   meta = {
     description = "A C++ library which implements parts of the Avro Specification";
     homepage = "https://avro.apache.org/";
-    license = stdenv.lib.licenses.asl20;
-    maintainers = with stdenv.lib.maintainers; [ rasendubi ];
-    platforms = stdenv.lib.platforms.all;
+    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
index d96930f37f24..a5acd7c7898b 100644
--- a/nixpkgs/pkgs/development/libraries/avro-c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/avro-c/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, fetchurl, pkgconfig, jansson, zlib }:
+{ lib, stdenv, cmake, fetchurl, pkg-config, jansson, zlib }:
 
 let
   version = "1.9.1";
@@ -15,13 +15,11 @@ in stdenv.mkDerivation {
     patchShebangs .
   '';
 
-  nativeBuildInputs = [ pkgconfig cmake ];
+  nativeBuildInputs = [ pkg-config cmake ];
 
   buildInputs = [ jansson zlib ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A C library which implements parts of the Avro Specification";
     homepage = "https://avro.apache.org/";
     license = licenses.asl20;
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..057aad447d5e
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aws-c-cal/default.nix
@@ -0,0 +1,30 @@
+{ lib, stdenv, fetchFromGitHub, cmake, aws-c-common, openssl, Security }:
+
+stdenv.mkDerivation rec {
+  pname = "aws-c-cal";
+  version = "0.4.5";
+
+  src = fetchFromGitHub {
+    owner = "awslabs";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "04acra1mnzw9q7jycs5966akfbgnx96hkrq90nq0dhw8pvarlyv6";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ aws-c-common openssl ] ++ lib.optionals stdenv.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
index b028813558f5..23d7f9d8629a 100644
--- a/nixpkgs/pkgs/development/libraries/aws-c-common/default.nix
+++ b/nixpkgs/pkgs/development/libraries/aws-c-common/default.nix
@@ -2,17 +2,21 @@
 
 stdenv.mkDerivation rec {
   pname = "aws-c-common";
-  version = "0.3.11";
+  version = "0.4.64";
 
   src = fetchFromGitHub {
     owner = "awslabs";
     repo = pname;
     rev = "v${version}";
-    sha256 = "0a7hi4crnc3j1j39qcnd44zqdfwzw1xghcf80marx5vdf1qdzy6p";
+    sha256 = "sha256-izEZMOPHj/9EL78b/t3M0Tki6eA8eRrpG7DO2tkpf1A=";
   };
 
   nativeBuildInputs = [ cmake ];
 
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+  ];
+
   NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin
     "-Wno-nullability-extension -Wno-typedef-redefinition";
 
diff --git a/nixpkgs/pkgs/development/libraries/aws-c-event-stream/default.nix b/nixpkgs/pkgs/development/libraries/aws-c-event-stream/default.nix
index ca3203e3a6ab..4cfabc77bb2c 100644
--- a/nixpkgs/pkgs/development/libraries/aws-c-event-stream/default.nix
+++ b/nixpkgs/pkgs/development/libraries/aws-c-event-stream/default.nix
@@ -1,19 +1,20 @@
-{ lib, stdenv, fetchFromGitHub, cmake, aws-c-common, aws-checksums, libexecinfo }:
+{ lib, stdenv, fetchFromGitHub, cmake, aws-c-cal, aws-c-common, aws-c-io, aws-checksums, s2n, libexecinfo }:
 
 stdenv.mkDerivation rec {
   pname = "aws-c-event-stream";
-  version = "0.1.1";
+  version = "0.2.6";
 
   src = fetchFromGitHub {
     owner = "awslabs";
     repo = pname;
     rev = "v${version}";
-    sha256 = "0anjynfghk3inysy21wqvhxha33xsswh3lm8pr7nx7cpj6cmr37m";
+    sha256 = "1hbri4dv924ph3cxkmwkl4kdca4dvhc9qda60rdzs6355l76k23n";
   };
 
   nativeBuildInputs = [ cmake ];
 
-  buildInputs = [ aws-c-common aws-checksums ] ++ lib.optional stdenv.hostPlatform.isMusl libexecinfo;
+  buildInputs = [ aws-c-cal aws-c-common aws-c-io aws-checksums s2n ]
+    ++ lib.optional stdenv.hostPlatform.isMusl libexecinfo;
 
   cmakeFlags = [
     "-DBUILD_SHARED_LIBS:BOOL=ON"
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..e2074cc835a6
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/aws-c-io/default.nix
@@ -0,0 +1,32 @@
+{ lib, stdenv, fetchFromGitHub, cmake, aws-c-cal, aws-c-common, s2n }:
+
+stdenv.mkDerivation rec {
+  pname = "aws-c-io";
+  version = "0.7.1";
+
+  src = fetchFromGitHub {
+    owner = "awslabs";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "sha256-dDvq5clOUaPR7lOCJ/1g0lrCzVOmzwCnqHrBZfBewO4=";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = [ aws-c-cal aws-c-common s2n ];
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+    "-DCMAKE_MODULE_PATH=${aws-c-common}/lib/cmake"
+  ];
+
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-error";
+
+  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
index d4ba15e52db4..bf50401a213e 100644
--- a/nixpkgs/pkgs/development/libraries/aws-checksums/default.nix
+++ b/nixpkgs/pkgs/development/libraries/aws-checksums/default.nix
@@ -1,19 +1,24 @@
-{ lib, stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake, aws-c-common }:
 
 stdenv.mkDerivation rec {
   pname = "aws-checksums";
-  version = "0.1.7";
+  version = "0.1.10";
 
   src = fetchFromGitHub {
     owner = "awslabs";
     repo = pname;
     rev = "v${version}";
-    sha256 = "0am1hfzqir44zcx6y6c7jw74qvbsav8ppr9dahpdh3ac95cjf38a";
+    sha256 = "1f9scl5734pgjlsixspwljrrlndzhllwlfygdcr1gx5p0za08zjb";
   };
 
   nativeBuildInputs = [ cmake ];
 
-  cmakeFlags = [ "-DBUILD_SHARED_LIBS:BOOL=ON" ];
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/cmake-dirs.patch b/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/cmake-dirs.patch
index 6e4cad9e73cf..b2f12e77025c 100644
--- a/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/cmake-dirs.patch
+++ b/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/cmake-dirs.patch
@@ -1,15 +1,5 @@
-diff --git a/cmake/AWSSDKConfig.cmake b/cmake/AWSSDKConfig.cmake
-index e87252123e..5457bd5910 100644
 --- a/cmake/AWSSDKConfig.cmake
 +++ b/cmake/AWSSDKConfig.cmake
-@@ -82,6 +82,7 @@ if (AWSSDK_ROOT_DIR)
-             )
- else()
-     find_file(AWSSDK_CORE_HEADER_FILE Aws.h
-+        "/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
-         "/usr/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
-         "/usr/local/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
-         "C:/Progra~1/AWSSDK/${AWSSDK_INSTALL_INCLUDEDIR}/aws/core"
 @@ -97,14 +98,18 @@ if (NOT AWSSDK_CORE_HEADER_FILE)
      message(FATAL_ERROR "AWS SDK for C++ is missing, please install it first")
  endif()
diff --git a/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/default.nix b/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/default.nix
index 94827743bf3d..7b10fc463dd1 100644
--- a/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/aws-sdk-cpp/default.nix
@@ -1,5 +1,5 @@
-{ lib, stdenv, fetchFromGitHub, cmake, curl, openssl, zlib, fetchpatch
-, aws-c-common, aws-c-event-stream, aws-checksums
+{ lib, stdenv, fetchFromGitHub, cmake, curl, openssl, s2n, 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 ? ["*"]
@@ -9,13 +9,13 @@
 
 stdenv.mkDerivation rec {
   pname = "aws-sdk-cpp";
-  version = "1.7.90";
+  version = "1.8.121";
 
   src = fetchFromGitHub {
     owner = "awslabs";
     repo = "aws-sdk-cpp";
     rev = version;
-    sha256 = "0zpqi612qmm0n53crxiisv0vdif43ymg13kafy6vv43j2wmh66ga";
+    sha256 = "sha256-uita3HPcerxH/bnSIL3ZNUp68QXtKJLYi0pcnV7OBkQ=";
   };
 
   # FIXME: might be nice to put different APIs in different outputs
@@ -25,8 +25,8 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake curl ];
 
   buildInputs = [
-    curl openssl zlib
-    aws-c-common aws-c-event-stream aws-checksums
+    curl openssl s2n zlib
+    aws-c-cal aws-c-common aws-c-event-stream aws-c-io aws-checksums
   ] ++ lib.optionals (stdenv.isDarwin &&
                         ((builtins.elem "text-to-speech" apis) ||
                          (builtins.elem "*" apis)))
@@ -38,7 +38,8 @@ stdenv.mkDerivation rec {
   ] ++ lib.optional (!customMemoryManagement) "-DCUSTOM_MEMORY_MANAGEMENT=0"
   ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
     "-DENABLE_TESTING=OFF"
-    "-DCURL_HAS_H2=0"
+    "-DCURL_HAS_H2=1"
+    "-DCURL_HAS_TLS_PROXY=1"
   ] ++ lib.optional (apis != ["*"])
     "-DBUILD_ONLY=${lib.concatStringsSep ";" apis}";
 
@@ -53,16 +54,12 @@ stdenv.mkDerivation rec {
   postFixupHooks = [
     # This bodge is necessary so that the file that the generated -config.cmake file
     # points to an existing directory.
-    ''mkdir -p $out/include''
+    "mkdir -p $out/include"
   ];
 
   __darwinAllowLocalNetworking = true;
 
   patches = [
-    (fetchpatch {
-      url = "https://github.com/aws/aws-sdk-cpp/commit/42991ab549087c81cb630e5d3d2413e8a9cf8a97.patch";
-      sha256 = "0myq5cm3lvl5r56hg0sc0zyn1clbkd9ys0wr95ghw6bhwpvfv8gr";
-    })
     ./cmake-dirs.patch
   ];
 
diff --git a/nixpkgs/pkgs/development/libraries/ayatana-ido/default.nix b/nixpkgs/pkgs/development/libraries/ayatana-ido/default.nix
index 127fe1c97504..60417426f76c 100644
--- a/nixpkgs/pkgs/development/libraries/ayatana-ido/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ayatana-ido/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , pkg-config, autoreconfHook
 , gtk3, gobject-introspection, gtk-doc, vala
 }:
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ gtk3 ];
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/babl/default.nix b/nixpkgs/pkgs/development/libraries/babl/default.nix
index 9bb6e9e1c5e0..6e3a5abaaa65 100644
--- a/nixpkgs/pkgs/development/libraries/babl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/babl/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , gobject-introspection
 , lcms2
 , vala
@@ -10,19 +10,19 @@
 
 stdenv.mkDerivation rec {
   pname = "babl";
-  version = "0.1.82";
+  version = "0.1.84";
 
   outputs = [ "out" "dev" ];
 
   src = fetchurl {
-    url = "https://download.gimp.org/pub/babl/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1iddkwdfw1bmfl6n8y1d4kkm3rb15rzvrfri6a7cnx37mpa96bf6";
+    url = "https://download.gimp.org/pub/babl/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-5+OLhEH3f+udyCMctDSoYZCiHy82ksKBRX6Z016cNOo=";
   };
 
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     gobject-introspection
     vala
   ];
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     lcms2
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Image pixel format conversion library";
     homepage = "https://gegl.org/babl/";
     license = licenses.lgpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/bamf/default.nix b/nixpkgs/pkgs/development/libraries/bamf/default.nix
index d80413048560..95d54993e069 100644
--- a/nixpkgs/pkgs/development/libraries/bamf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/bamf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , pantheon
 , autoconf
 , automake
@@ -10,7 +10,7 @@
 , libwnck3
 , glib
 , vala
-, pkgconfig
+, pkg-config
 , libstartup_notification
 , gobject-introspection
 , gtk-doc
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
     gobject-introspection
     gtk-doc
     libtool
-    pkgconfig
+    pkg-config
     vala
     which
     wrapGAppsHook
@@ -90,7 +90,7 @@ stdenv.mkDerivation rec {
   # glib-2.62 deprecations
   NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Application matching framework";
     longDescription = ''
       Removes the headache of applications matching
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..78ef4c2f3369
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/bashup-events/generic.nix
@@ -0,0 +1,83 @@
+{
+  # general
+  lib
+, callPackage
+, runCommand
+, 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 = ''
+    install -Dt $out/bin bashup.events
+  '';
+
+  inherit doCheck;
+  checkInputs = [ shellcheck bash ];
+
+  # check based on https://github.com/bashup/events/blob/master/.dkrc
+  checkPhase = ''
+    SHELLCHECK_OPTS='-e SC2016,SC2145' ${shellcheck}/bin/shellcheck ./bashup.events
+    ${bash}/bin/bash -n ./bashup.events
+    ${bash}/bin/bash ./bashup.events
+  '';
+
+  solutions = {
+    events = {
+      inputs = [ ];
+      interpreter = "none";
+      scripts = [ "bin/bashup.events" ];
+      inherit keep;
+    } // lib.optionalAttrs (lib.isAttrs fake) { inherit fake; };
+  };
+
+  inherit doInstallCheck;
+  installCheckInputs = [ bash ];
+  installCheckPhase = installCheck "${bash}/bin/bash";
+
+  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
index f178c192de54..125512c3fed6 100644
--- a/nixpkgs/pkgs/development/libraries/bcg729/default.nix
+++ b/nixpkgs/pkgs/development/libraries/bcg729/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitLab
 , cmake
 }:
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/bctoolbox/default.nix b/nixpkgs/pkgs/development/libraries/bctoolbox/default.nix
index 655d3a5808a9..dd72b7eb41df 100644
--- a/nixpkgs/pkgs/development/libraries/bctoolbox/default.nix
+++ b/nixpkgs/pkgs/development/libraries/bctoolbox/default.nix
@@ -2,7 +2,7 @@
 , cmake
 , fetchFromGitLab
 , mbedtls
-, stdenv
+, lib, stdenv
 }:
 
 stdenv.mkDerivation rec {
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = [ "-Wno-error=stringop-truncation" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit version;
     description = "Utilities library for Linphone";
     homepage = "https://gitlab.linphone.org/BC/public/bctoolbox";
diff --git a/nixpkgs/pkgs/development/libraries/beecrypt/default.nix b/nixpkgs/pkgs/development/libraries/beecrypt/default.nix
index 2433edbfe8f3..6b86fca868f6 100644
--- a/nixpkgs/pkgs/development/libraries/beecrypt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/beecrypt/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, m4}:
+{lib, stdenv, fetchurl, m4}:
 
 stdenv.mkDerivation {
   name = "beecrypt-4.2.1";
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
   configureFlags = [ "--disable-optimized" "--enable-static" ];
 
   meta = {
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.lgpl2;
+    platforms = lib.platforms.linux;
+    license = lib.licenses.lgpl2;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/beignet/default.nix b/nixpkgs/pkgs/development/libraries/beignet/default.nix
index 89ef702f4e50..8e8e455e59a6 100644
--- a/nixpkgs/pkgs/development/libraries/beignet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/beignet/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
-, pkgconfig
+, pkg-config
 , clang-unwrapped
 , llvm
 , libdrm
@@ -30,8 +30,6 @@ stdenv.mkDerivation rec {
 
   patches = [ ./clang_llvm.patch ];
 
-  enableParallelBuilding = true;
-
   postPatch = ''
     substituteInPlace CMakeLists.txt --replace /etc/OpenCL/vendors "\''${CMAKE_INSTALL_PREFIX}/etc/OpenCL/vendors"
     patchShebangs src/git_sha1.sh
@@ -54,7 +52,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     cmake
-    pkgconfig
+    pkg-config
     python3
   ];
 
@@ -66,12 +64,10 @@ stdenv.mkDerivation rec {
       cd utests
     '';
 
-    enableParallelBuilding = true;
-
     nativeBuildInputs = [
       cmake
       python3
-      pkgconfig
+      pkg-config
       makeWrapper
     ];
 
@@ -100,7 +96,7 @@ stdenv.mkDerivation rec {
     '';
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://cgit.freedesktop.org/beignet/";
     description = "OpenCL Library for Intel Ivy Bridge and newer GPUs";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/belcard/default.nix b/nixpkgs/pkgs/development/libraries/belcard/default.nix
index 35de9fb93477..03f6e96e187d 100644
--- a/nixpkgs/pkgs/development/libraries/belcard/default.nix
+++ b/nixpkgs/pkgs/development/libraries/belcard/default.nix
@@ -2,12 +2,12 @@
 , belr
 , cmake
 , fetchFromGitLab
-, stdenv
+, lib, stdenv
 }:
 
 stdenv.mkDerivation rec {
   pname = "belcard";
-  version = "4.4.13";
+  version = "4.4.24";
 
   src = fetchFromGitLab {
     domain = "gitlab.linphone.org";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     group = "BC";
     repo = pname;
     rev = version;
-    sha256 = "16x2xp8d0a115132zhy1kpxkyj86ia7vrsnpjdg78fnbvmvysc8m";
+    sha256 = "sha256-FTHtd93LOnRek9fqvI+KBkk/+53Bwy9GKCEo0NDtops=";
   };
 
   buildInputs = [ bctoolbox belr ];
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
   # Do not build static libraries
   cmakeFlags = [ "-DENABLE_STATIC=NO" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ library to manipulate VCard standard format";
     homepage = "https://gitlab.linphone.org/BC/public/belcard";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/belle-sip/default.nix b/nixpkgs/pkgs/development/libraries/belle-sip/default.nix
index 8a028b5e0a06..e08fc1ae3ee3 100644
--- a/nixpkgs/pkgs/development/libraries/belle-sip/default.nix
+++ b/nixpkgs/pkgs/development/libraries/belle-sip/default.nix
@@ -4,7 +4,7 @@
 , fetchFromGitLab
 , libantlr3c
 , mbedtls
-, stdenv
+, lib, stdenv
 , zlib
 }:
 
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ libantlr3c mbedtls bctoolbox ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/belr/default.nix b/nixpkgs/pkgs/development/libraries/belr/default.nix
index ab3df9bae7ee..b38757525abd 100644
--- a/nixpkgs/pkgs/development/libraries/belr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/belr/default.nix
@@ -1,7 +1,7 @@
 { bctoolbox
 , cmake
 , fetchFromGitLab
-, stdenv
+, lib, stdenv
 }:
 
 stdenv.mkDerivation rec {
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   # Do not build static libraries
   cmakeFlags = [ "-DENABLE_STATIC=NO" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Belledonne Communications' language recognition library";
     homepage = "https://gitlab.linphone.org/BC/public/belr";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/biblesync/default.nix b/nixpkgs/pkgs/development/libraries/biblesync/default.nix
index 27c6637d9fee..74a938cf2a5c 100644
--- a/nixpkgs/pkgs/development/libraries/biblesync/default.nix
+++ b/nixpkgs/pkgs/development/libraries/biblesync/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkgconfig, cmake, libuuid }:
+{ lib, stdenv, fetchFromGitHub, pkg-config, cmake, libuuid }:
 
 stdenv.mkDerivation rec {
 
@@ -12,10 +12,10 @@ stdenv.mkDerivation rec {
     sha256 = "0prmd12jq2cjdhsph5v89y38j7hhd51dr3r1hivgkhczr3m5hf4s";
   };
 
-  nativeBuildInputs = [ pkgconfig cmake ];
+  nativeBuildInputs = [ pkg-config cmake ];
   buildInputs = [ libuuid ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://wiki.crosswire.org/BibleSync";
     description = "A multicast protocol to Bible software shared conavigation";
     longDescription = ''
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
       navigation, and handling of incoming packets.
     '';
     license = licenses.publicDomain;
-    maintainers = [ maintainers.AndersonTorres ]; 
-    platforms = stdenv.lib.platforms.linux;
+    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
index 5473801f85d2..06c7ac81dcd2 100644
--- a/nixpkgs/pkgs/development/libraries/bobcat/default.nix
+++ b/nixpkgs/pkgs/development/libraries/bobcat/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, icmake
+{ lib, stdenv, fetchFromGitLab, icmake
 , libmilter, libX11, openssl, readline
 , util-linux, yodl }:
 
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
     ./build install x
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Brokken's Own Base Classes And Templates";
     homepage = "https://fbb-git.gitlab.io/bobcat/";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix b/nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix
index 093c0880b066..e951bdc34e4e 100644
--- a/nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix
+++ b/nixpkgs/pkgs/development/libraries/boehm-gc/7.6.6.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, fetchpatch, pkgconfig, libatomic_ops
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, libatomic_ops
 , enableLargeConfig ? false # doc: https://github.com/ivmai/bdwgc/blob/v7.6.6/doc/README.macros#L179
 }:
 
@@ -15,12 +15,12 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ libatomic_ops ];
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   outputs = [ "out" "dev" "doc" ];
   separateDebugInfo = stdenv.isLinux;
 
-  preConfigure = stdenv.lib.optionalString (stdenv.hostPlatform.libc == "musl") ''
+  preConfigure = lib.optionalString (stdenv.hostPlatform.libc == "musl") ''
     export NIX_CFLAGS_COMPILE+=" -D_GNU_SOURCE -DUSE_MMAP -DHAVE_DL_ITERATE_PHDR"
   '';
 
@@ -66,6 +66,6 @@ stdenv.mkDerivation rec {
     license = "https://hboehm.info/gc/license.txt";
 
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/boehm-gc/default.nix b/nixpkgs/pkgs/development/libraries/boehm-gc/default.nix
index 1af63a2e4260..85ae01036ed1 100644
--- a/nixpkgs/pkgs/development/libraries/boehm-gc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/boehm-gc/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "doc" ];
   separateDebugInfo = stdenv.isLinux && stdenv.hostPlatform.libc != "musl";
 
-  preConfigure = stdenv.lib.optionalString (stdenv.hostPlatform.libc == "musl") ''
+  preConfigure = lib.optionalString (stdenv.hostPlatform.libc == "musl") ''
     export NIX_CFLAGS_COMPILE+=" -D_GNU_SOURCE -DUSE_MMAP -DHAVE_DL_ITERATE_PHDR"
   '';
 
@@ -64,6 +64,6 @@ stdenv.mkDerivation rec {
     license = "https://hboehm.info/gc/license.txt";
 
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/boolstuff/default.nix b/nixpkgs/pkgs/development/libraries/boolstuff/default.nix
index 9ec27d3e9ebc..b3d754fb5425 100644
--- a/nixpkgs/pkgs/development/libraries/boolstuff/default.nix
+++ b/nixpkgs/pkgs/development/libraries/boolstuff/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig }:
+{ lib, stdenv, fetchurl, pkg-config }:
 
 let baseurl = "https://perso.b2b2c.ca/~sarrazip/dev"; in
 
@@ -10,13 +10,13 @@ stdenv.mkDerivation rec {
     sha256 = "10qynbyw723gz2vrvn4xk2var172kvhlz3l3l80qbdsfb3d12wn0";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   meta = {
     description = "Library for operations on boolean expression binary trees";
     homepage = "${baseurl}/boolstuff.html";
     license = "GPL";
-    maintainers = [ stdenv.lib.maintainers.marcweber ];
-    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ lib.maintainers.marcweber ];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/boost-process/default.nix b/nixpkgs/pkgs/development/libraries/boost-process/default.nix
index 92e02c6ca08f..97e879809528 100644
--- a/nixpkgs/pkgs/development/libraries/boost-process/default.nix
+++ b/nixpkgs/pkgs/development/libraries/boost-process/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip }:
+{ lib, stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation {
   name = "boost-process-0.5";
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
     cp -r boost $out/include
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.highscore.de/boost/process0.5/";
     description = "Library to manage system processes";
     license = licenses.boost;
diff --git a/nixpkgs/pkgs/development/libraries/boost/1.67.nix b/nixpkgs/pkgs/development/libraries/boost/1.67.nix
index 31f545ab12be..29993ed02b8c 100644
--- a/nixpkgs/pkgs/development/libraries/boost/1.67.nix
+++ b/nixpkgs/pkgs/development/libraries/boost/1.67.nix
@@ -1,4 +1,4 @@
-{ stdenv, callPackage, fetchurl, fetchpatch, ... } @ args:
+{ lib, stdenv, callPackage, fetchurl, fetchpatch, ... } @ args:
 
 callPackage ./generic.nix (args // {
   version = "1.67.0";
@@ -9,7 +9,7 @@ callPackage ./generic.nix (args // {
       sha256 = "0x65nkwzv8fdacj8sw5njl3v63jj19dirrpklbwy6qpsncw7fc7h";
       stripLen = 1;
     })
-  ] ++ stdenv.lib.optionals stdenv.cc.isClang [
+  ] ++ lib.optionals stdenv.cc.isClang [
     # Fixes https://github.com/boostorg/atomic/issues/15
     (fetchpatch {
       url = "https://github.com/boostorg/atomic/commit/6e14ca24dab50ad4c1fa8c27c7dd6f1cb791b534.patch";
diff --git a/nixpkgs/pkgs/development/libraries/boost/1.71.nix b/nixpkgs/pkgs/development/libraries/boost/1.71.nix
index f66bd4cd6fb1..7b128e25bb60 100644
--- a/nixpkgs/pkgs/development/libraries/boost/1.71.nix
+++ b/nixpkgs/pkgs/development/libraries/boost/1.71.nix
@@ -5,7 +5,7 @@ callPackage ./generic.nix (args // rec {
 
   src = fetchurl {
     #url = "mirror://sourceforge/boost/boost_1_71_0.tar.bz2";
-    urls = [ 
+    urls = [
       "mirror://sourceforge/boost/boost_1_71_0.tar.bz2"
       "https://dl.bintray.com/boostorg/release/1.71.0/source/boost_1_71_0.tar.bz2"
     ];
diff --git a/nixpkgs/pkgs/development/libraries/boost/generic.nix b/nixpkgs/pkgs/development/libraries/boost/generic.nix
index ec3a28e2b1a3..abff1268bfae 100644
--- a/nixpkgs/pkgs/development/libraries/boost/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/boost/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, libiconv
+{ lib, stdenv, icu, expat, zlib, bzip2, python, fixDarwinDylibNames, libiconv
 , fetchpatch
 , which
 , buildPackages
@@ -14,7 +14,8 @@
 , enableNumpy ? false
 , taggedLayout ? ((enableRelease && enableDebug) || (enableSingleThreaded && enableMultiThreaded) || (enableShared && enableStatic))
 , patches ? []
-, mpi ? null
+, useMpi ? false
+, mpi
 , extraB2Args ? []
 
 # Attributes inherit from specific versions
@@ -30,9 +31,9 @@ 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 stdenv.lib; ((toolset == "clang" && !(versionOlder stdenv.cc.version "8.0.0")) -> !(versionOlder version "1.69"));
+assert with lib; ((toolset == "clang" && !(versionOlder stdenv.cc.version "8.0.0")) -> !(versionOlder version "1.69"));
 
-with stdenv.lib;
+with lib;
 let
 
   variant = concatStringsSep ","
@@ -94,7 +95,7 @@ let
     ++ optional (variant == "release") "debug-symbols=off"
     ++ optional (toolset != null) "toolset=${toolset}"
     ++ optional (!enablePython) "--without-python"
-    ++ optional (mpi != null || stdenv.hostPlatform != stdenv.buildPlatform) "--user-config=user-config.jam"
+    ++ optional (useMpi || stdenv.hostPlatform != stdenv.buildPlatform) "--user-config=user-config.jam"
     ++ optionals (stdenv.hostPlatform.libc == "msvcrt") [
     "threadapi=win32"
   ] ++ extraB2Args
@@ -140,7 +141,7 @@ stdenv.mkDerivation {
         substituteInPlace tools/build/src/tools/clang-darwin.jam \
           --replace '@rpath/$(<[1]:D=)' "$out/lib/\$(<[1]:D=)";
     fi;
-  '' + optionalString (mpi != null) ''
+  '' + optionalString useMpi ''
     cat << EOF >> user-config.jam
     using mpi : ${mpi}/bin/mpiCC ;
     EOF
@@ -150,7 +151,7 @@ stdenv.mkDerivation {
     EOF
   '';
 
-  NIX_CFLAGS_LINK = stdenv.lib.optionalString stdenv.isDarwin
+  NIX_CFLAGS_LINK = lib.optionalString stdenv.isDarwin
                       "-headerpad_max_install_names";
 
   enableParallelBuilding = true;
diff --git a/nixpkgs/pkgs/development/libraries/bootil/default.nix b/nixpkgs/pkgs/development/libraries/bootil/default.nix
index a1924f59a8db..f21362962048 100644
--- a/nixpkgs/pkgs/development/libraries/bootil/default.nix
+++ b/nixpkgs/pkgs/development/libraries/bootil/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, premake4 }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, premake4 }:
 
 stdenv.mkDerivation {
   name = "bootil-unstable-2015-12-17";
@@ -7,9 +7,9 @@ stdenv.mkDerivation {
     description = "Garry Newman's personal utility library";
     homepage = "https://github.com/garrynewman/bootil";
     # License unsure - see https://github.com/garrynewman/bootil/issues/21
-    license = stdenv.lib.licenses.free;
-    maintainers = [ stdenv.lib.maintainers.abigailbuccaneer ];
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.free;
+    maintainers = [ lib.maintainers.abigailbuccaneer ];
+    platforms = lib.platforms.all;
     # 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
index 20524cf179cf..7019d39b16c7 100644
--- a/nixpkgs/pkgs/development/libraries/boringssl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/boringssl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, cmake, perl, go }:
+{ lib, stdenv, fetchgit, cmake, perl, go }:
 
 # reference: https://boringssl.googlesource.com/boringssl/+/2661/BUILDING.md
 stdenv.mkDerivation {
@@ -12,7 +12,6 @@ stdenv.mkDerivation {
   };
 
   nativeBuildInputs = [ cmake perl go ];
-  enableParallelBuilding = true;
 
   makeFlags = [ "GOCACHE=$(TMPDIR)/go-cache" ];
 
@@ -30,7 +29,7 @@ stdenv.mkDerivation {
 
   outputs = [ "out" "bin" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Free TLS/SSL implementation";
     homepage    = "https://boringssl.googlesource.com";
     platforms   = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/botan/generic.nix b/nixpkgs/pkgs/development/libraries/botan/generic.nix
index 4d2cf7515c03..0369f603b8e1 100644
--- a/nixpkgs/pkgs/development/libraries/botan/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/botan/generic.nix
@@ -1,10 +1,11 @@
-{ stdenv, fetchurl, python, bzip2, zlib, gmp, openssl, boost
+{ lib, stdenv, fetchurl, python, bzip2, zlib, gmp, openssl, boost
 # Passed by version specific builders
 , baseVersion, revision, sha256
 , sourceExtension ? "tar.xz"
 , extraConfigureFlags ? ""
 , postPatch ? null
-, darwin
+, CoreServices
+, Security
 , ...
 }:
 
@@ -23,7 +24,7 @@ stdenv.mkDerivation rec {
   inherit postPatch;
 
   buildInputs = [ python bzip2 zlib gmp openssl boost ]
-             ++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
+    ++ 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 "" }
@@ -42,11 +43,11 @@ stdenv.mkDerivation rec {
     ln -s botan-*.pc botan.pc || true
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit version;
     description = "Cryptographic algorithms library";
     maintainers = with maintainers; [ raskin ];
-    platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin"];
+    platforms = platforms.unix;
     license = licenses.bsd2;
   };
   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
index 1672970d5051..47a1c0917f07 100644
--- a/nixpkgs/pkgs/development/libraries/box2d/default.nix
+++ b/nixpkgs/pkgs/development/libraries/box2d/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, unzip, cmake, libGLU, libGL, freeglut, libX11, xorgproto
-, libXi, pkgconfig }:
+{ lib, stdenv, fetchurl, unzip, cmake, libGLU, libGL, freeglut, libX11, xorgproto
+, libXi, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "box2d";
@@ -12,10 +12,8 @@ stdenv.mkDerivation rec {
 
   sourceRoot = "Box2D-${version}/Box2D";
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [
-    unzip cmake libGLU libGL freeglut libX11 xorgproto libXi
-  ];
+  nativeBuildInputs = [ cmake unzip pkg-config ];
+  buildInputs = [ libGLU libGL freeglut libX11 xorgproto libXi ];
 
   cmakeFlags = [
     "-DBOX2D_INSTALL=ON"
@@ -28,7 +26,7 @@ stdenv.mkDerivation rec {
       --replace 'b2_maxPolygonVertices	8' 'b2_maxPolygonVertices	15'
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "2D physics engine";
     homepage = "https://box2d.org/";
     maintainers = [ maintainers.raskin ];
diff --git a/nixpkgs/pkgs/development/libraries/boxfort/default.nix b/nixpkgs/pkgs/development/libraries/boxfort/default.nix
index 9a4e2c233561..740e43216984 100644
--- a/nixpkgs/pkgs/development/libraries/boxfort/default.nix
+++ b/nixpkgs/pkgs/development/libraries/boxfort/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, meson, ninja, python37Packages }:
+{ lib, stdenv, fetchFromGitHub, meson, ninja, python37Packages }:
 
 stdenv.mkDerivation rec {
   version = "unstable-2019-10-09";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "dev" "out" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Convenient & cross-platform sandboxing C library";
     homepage = "https://github.com/Snaipe/BoxFort";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/brigand/default.nix b/nixpkgs/pkgs/development/libraries/brigand/default.nix
index cc5564d4bb7a..eb46ccc8cd7c 100644
--- a/nixpkgs/pkgs/development/libraries/brigand/default.nix
+++ b/nixpkgs/pkgs/development/libraries/brigand/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation {
   pname = "brigand";
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  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.
diff --git a/nixpkgs/pkgs/development/libraries/buddy/default.nix b/nixpkgs/pkgs/development/libraries/buddy/default.nix
index d025b8c28ed0..a333a69ffa1b 100644
--- a/nixpkgs/pkgs/development/libraries/buddy/default.nix
+++ b/nixpkgs/pkgs/development/libraries/buddy/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, bison }:
+{ lib, stdenv, fetchurl, bison }:
 
 stdenv.mkDerivation rec {
   name = "buddy-2.4";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     description = "Binary decision diagram package";
     license = "as-is";
 
-    platforms = stdenv.lib.platforms.unix; # Once had cygwin problems
-    maintainers = [ stdenv.lib.maintainers.peti ];
+    platforms = lib.platforms.unix; # Once had cygwin problems
+    maintainers = [ lib.maintainers.peti ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/bullet/default.nix b/nixpkgs/pkgs/development/libraries/bullet/default.nix
index 1c9a10356a44..50bf56bfbd22 100644
--- a/nixpkgs/pkgs/development/libraries/bullet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/bullet/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, libGLU, libGL, freeglut
+{ lib, stdenv, fetchFromGitHub, cmake, libGLU, libGL, freeglut
 , Cocoa,  OpenGL
 }:
 
@@ -14,12 +14,12 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ cmake ];
-  buildInputs = stdenv.lib.optionals stdenv.isLinux [ libGLU libGL freeglut ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
+  buildInputs = lib.optionals stdenv.isLinux [ libGLU libGL freeglut ]
+    ++ lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
 
   patches = [ ./gwen-narrowing.patch ];
 
-  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.isDarwin ''
     sed -i 's/FIND_PACKAGE(OpenGL)//' CMakeLists.txt
     sed -i 's/FIND_LIBRARY(COCOA_LIBRARY Cocoa)//' CMakeLists.txt
   '';
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     "-DBUILD_SHARED_LIBS=ON"
     "-DBUILD_CPU_DEMOS=OFF"
     "-DINSTALL_EXTRA_LIBS=ON"
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.isDarwin [
     "-DOPENGL_FOUND=true"
     "-DOPENGL_LIBRARIES=${OpenGL}/Library/Frameworks/OpenGL.framework"
     "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks/OpenGL.framework"
@@ -38,12 +38,10 @@ stdenv.mkDerivation rec {
     "-DBUILD_UNIT_TESTS=OFF"
   ];
 
-  enableParallelBuilding = true;
-
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang
     "-Wno-error=argument-outside-range -Wno-error=c++11-narrowing";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A professional free 3D Game Multiphysics Library";
     longDescription = ''
       Bullet 3D Game Multiphysics Library provides state of the art collision
diff --git a/nixpkgs/pkgs/development/libraries/bullet/roboschool-fork.nix b/nixpkgs/pkgs/development/libraries/bullet/roboschool-fork.nix
index abb9d3e2ce3d..a3966eaa4a39 100644
--- a/nixpkgs/pkgs/development/libraries/bullet/roboschool-fork.nix
+++ b/nixpkgs/pkgs/development/libraries/bullet/roboschool-fork.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, libGLU, libGL, freeglut
+{ lib, stdenv, fetchFromGitHub, cmake, libGLU, libGL, freeglut
 , Cocoa,  OpenGL
 }:
 
@@ -18,12 +18,12 @@ stdenv.mkDerivation {
   };
 
   nativeBuildInputs = [ cmake ];
-  buildInputs = stdenv.lib.optionals stdenv.isLinux [ libGLU libGL freeglut ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
+  buildInputs = lib.optionals stdenv.isLinux [ libGLU libGL freeglut ]
+    ++ lib.optionals stdenv.isDarwin [ Cocoa OpenGL ];
 
   patches = [ ./gwen-narrowing.patch ];
 
-  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.isDarwin ''
     sed -i 's/FIND_PACKAGE(OpenGL)//' CMakeLists.txt
     sed -i 's/FIND_LIBRARY(COCOA_LIBRARY Cocoa)//' CMakeLists.txt
   '';
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
     "-DBUILD_SHARED_LIBS=ON"
     "-DBUILD_CPU_DEMOS=OFF"
     "-DINSTALL_EXTRA_LIBS=ON"
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.isDarwin [
     "-DOPENGL_FOUND=true"
     "-DOPENGL_LIBRARIES=${OpenGL}/Library/Frameworks/OpenGL.framework"
     "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks/OpenGL.framework"
@@ -42,9 +42,7 @@ stdenv.mkDerivation {
     "-DBUILD_UNIT_TESTS=OFF"
   ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A professional free 3D Game Multiphysics Library";
     longDescription = ''
       Bullet 3D Game Multiphysics Library provides state of the art collision
diff --git a/nixpkgs/pkgs/development/libraries/bulletml/default.nix b/nixpkgs/pkgs/development/libraries/bulletml/default.nix
index f64090bd53a3..3da05302ac9f 100644
--- a/nixpkgs/pkgs/development/libraries/bulletml/default.nix
+++ b/nixpkgs/pkgs/development/libraries/bulletml/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchpatch, fetchurl, bison, perl }:
+{ lib, stdenv, fetchpatch, fetchurl, bison, perl }:
 
 let
   version = "0.0.6";
@@ -58,7 +58,7 @@ in stdenv.mkDerivation {
     install -m 644 README.en "$out"/share/licenses/libbulletml
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ library to handle BulletML easily";
     longDescription = ''
       BulletML is the Bullet Markup Language. BulletML can describe the barrage
diff --git a/nixpkgs/pkgs/development/libraries/bwidget/default.nix b/nixpkgs/pkgs/development/libraries/bwidget/default.nix
index ff9e6aa038f5..f3f09497a660 100644
--- a/nixpkgs/pkgs/development/libraries/bwidget/default.nix
+++ b/nixpkgs/pkgs/development/libraries/bwidget/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, tcl }:
+{ lib, stdenv, fetchurl, tcl }:
 
 stdenv.mkDerivation rec {
   pname = "bwidget";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://sourceforge.net/projects/tcllib";
     description = "High-level widget set for Tcl/Tk";
-    license = stdenv.lib.licenses.tcltk;
-    platforms = stdenv.lib.platforms.linux;
+    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
index 3eb99549246e..0adcb327cc4d 100644
--- a/nixpkgs/pkgs/development/libraries/bzrtp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/bzrtp/default.nix
@@ -2,7 +2,7 @@
 , cmake
 , fetchFromGitLab
 , sqlite
-, stdenv
+, lib, stdenv
 }:
 
 stdenv.mkDerivation rec {
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = "-Wno-error=cast-function-type";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An opensource implementation of ZRTP keys exchange protocol";
     homepage = "https://gitlab.linphone.org/BC/public/bzrtp";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/c-ares/default.nix b/nixpkgs/pkgs/development/libraries/c-ares/default.nix
index ac0dc43c67a5..20bcf80d9e59 100644
--- a/nixpkgs/pkgs/development/libraries/c-ares/default.nix
+++ b/nixpkgs/pkgs/development/libraries/c-ares/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, writeTextDir }:
+{ lib, stdenv, fetchurl, writeTextDir }:
 
 # Note: this package is used for bootstrapping fetchurl, and thus
 # cannot use fetchpatch! All mutable patches (generated by GitHub or
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     sha256 = "0h7wjfnk2092glqcp9mqaax7xx0s13m501z1gi0gsjl2vvvd0gfp";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A C library for asynchronous DNS requests";
     homepage = "https://c-ares.haxx.se";
     license = licenses.mit;
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
 
       set_target_properties(c-ares::cares PROPERTIES
         INTERFACE_INCLUDE_DIRECTORIES "${self}/include"
-        ${stdenv.lib.optionalString stdenv.isLinux ''INTERFACE_LINK_LIBRARIES "nsl;rt"''}
+        ${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
diff --git a/nixpkgs/pkgs/development/libraries/c-blosc/default.nix b/nixpkgs/pkgs/development/libraries/c-blosc/default.nix
index 20b82df6169f..a7420e300ed4 100644
--- a/nixpkgs/pkgs/development/libraries/c-blosc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/c-blosc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "c-blosc";
@@ -13,9 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A blocking, shuffling and loss-less compression library";
     homepage = "https://www.blosc.org";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/caf/default.nix b/nixpkgs/pkgs/development/libraries/caf/default.nix
index 74ca27f2e3c0..fdc06df948d7 100644
--- a/nixpkgs/pkgs/development/libraries/caf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/caf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, openssl }:
+{ lib, stdenv, fetchFromGitHub, cmake, openssl }:
 
 stdenv.mkDerivation rec {
   pname = "actor-framework";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
     export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH''${DYLD_LIBRARY_PATH:+:}$PWD/lib
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An open source implementation of the actor model in C++";
     homepage = "http://actor-framework.org/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/cairo/default.nix b/nixpkgs/pkgs/development/libraries/cairo/default.nix
index 64d0e67b3f0f..799024f19acf 100644
--- a/nixpkgs/pkgs/development/libraries/cairo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cairo/default.nix
@@ -1,4 +1,4 @@
-{ config, stdenv, lib, fetchurl, fetchpatch, pkgconfig, autoreconfHook, gtk-doc
+{ config, lib, stdenv, fetchurl, fetchpatch, pkg-config, autoreconfHook, gtk-doc
 , pixman
 , zlibSupport ? true, zlib
 , pngSupport ? true, libpng
@@ -8,7 +8,7 @@
 , x11Support ? !stdenv.isDarwin, libX11, libXext
 , x11XrenderSupport ? x11Support, libXrender
 , xcbSupport ? !stdenv.isDarwin, libxcb # no longer experimental since 1.12
-, libGLSupported ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+, 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
@@ -57,7 +57,7 @@ in stdenv.mkDerivation rec {
   nativeBuildInputs = [
     autoreconfHook
     gtk-doc
-    pkgconfig
+    pkg-config
   ];
 
   buildInputs = optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
@@ -100,7 +100,7 @@ in stdenv.mkDerivation rec {
 
   preConfigure =
   # On FreeBSD, `-ldl' doesn't exist.
-    stdenv.lib.optionalString stdenv.isFreeBSD
+    lib.optionalString stdenv.isFreeBSD
        '' for i in "util/"*"/Makefile.in" boilerplate/Makefile.in
           do
             cat "$i" | sed -es/-ldl//g > t
diff --git a/nixpkgs/pkgs/development/libraries/cairomm/default.nix b/nixpkgs/pkgs/development/libraries/cairomm/default.nix
index 13550bf3faba..87b391d2ad0e 100644
--- a/nixpkgs/pkgs/development/libraries/cairomm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cairomm/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, pkgconfig, darwin, cairo, fontconfig, freetype, libsigcxx }:
+{ fetchurl, lib, stdenv, pkg-config, darwin, cairo, fontconfig, freetype, libsigcxx }:
 stdenv.mkDerivation rec {
   pname = "cairomm";
   version = "1.12.2";
@@ -6,22 +6,22 @@ stdenv.mkDerivation rec {
   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}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    #url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "16fmigxsaz85c3lgcls7biwyz8zy8c8h3jndfm54cxxas3a7zi25";
   };
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   propagatedBuildInputs = [ cairo libsigcxx ];
   buildInputs = [ fontconfig freetype ]
-  ++ stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+  ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
     ApplicationServices
   ]);
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A 2D graphics library with support for multiple output devices";
 
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/capnproto/default.nix b/nixpkgs/pkgs/development/libraries/capnproto/default.nix
index ad2517f25890..da6aae64db52 100644
--- a/nixpkgs/pkgs/development/libraries/capnproto/default.nix
+++ b/nixpkgs/pkgs/development/libraries/capnproto/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "capnproto";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "03f1862ljdshg7d0rg3j7jzgm3ip55kzd2y91q7p0racax3hxx6i";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage    = "http://kentonv.github.io/capnproto";
     description = "Cap'n Proto cerealization protocol";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/capstone/default.nix b/nixpkgs/pkgs/development/libraries/capstone/default.nix
index 5140205ebc8a..cce14951c8be 100644
--- a/nixpkgs/pkgs/development/libraries/capstone/default.nix
+++ b/nixpkgs/pkgs/development/libraries/capstone/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig }:
+{ lib, stdenv, fetchurl, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "capstone";
@@ -10,11 +10,11 @@ stdenv.mkDerivation rec {
   };
 
   # replace faulty macos detection
-  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.isDarwin ''
     sed -i 's/^IS_APPLE := .*$/IS_APPLE := 1/' Makefile
   '';
 
-  configurePhase = '' patchShebangs make.sh '';
+  configurePhase = "patchShebangs make.sh ";
   buildPhase = "PREFIX=$out ./make.sh";
 
   doCheck = true;
@@ -24,11 +24,11 @@ stdenv.mkDerivation rec {
     make check
   '';
 
-  installPhase = (stdenv.lib.optionalString stdenv.isDarwin "HOMEBREW_CAPSTONE=1 ")
+  installPhase = (lib.optionalString stdenv.isDarwin "HOMEBREW_CAPSTONE=1 ")
     + "PREFIX=$out ./make.sh install";
-  
+
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
   ];
 
   enableParallelBuilding = true;
@@ -36,8 +36,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Advanced disassembly library";
     homepage    = "http://www.capstone-engine.org";
-    license     = stdenv.lib.licenses.bsd3;
-    platforms   = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ thoughtpolice ris ];
+    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
index 36d4960cdccb..2aa5c788dc36 100644
--- a/nixpkgs/pkgs/development/libraries/catch/default.nix
+++ b/nixpkgs/pkgs/development/libraries/catch/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "catch";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
   checkTarget = "test";
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/catch2/default.nix b/nixpkgs/pkgs/development/libraries/catch2/default.nix
index 4e41f39b49b1..34d61a519ab3 100644
--- a/nixpkgs/pkgs/development/libraries/catch2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/catch2/default.nix
@@ -1,21 +1,21 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "catch2";
-  version = "2.13.3";
+  version = "2.13.4";
 
   src = fetchFromGitHub {
     owner = "catchorg";
     repo = "Catch2";
     rev = "v${version}";
-    sha256="0m7pwsam1nb93akgnf5fxi737pgbrbcj0y28bavhzcss7yrm4gys";
+    sha256="sha256-8tR8MCFYK5XXtJQaIuZ59PJ3h3UYbfXKkaOfcBRt1Xo=";
   };
 
   nativeBuildInputs = [ cmake ];
 
   cmakeFlags = [ "-H.." ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/ccrtp/default.nix b/nixpkgs/pkgs/development/libraries/ccrtp/default.nix
index dba16b19e3b6..39792d4fd6a1 100644
--- a/nixpkgs/pkgs/development/libraries/ccrtp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ccrtp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, ucommon, openssl, libgcrypt }:
+{ lib, stdenv, fetchurl, pkg-config, ucommon, openssl, libgcrypt }:
 
 stdenv.mkDerivation rec {
   name = "ccrtp-2.1.2";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "17ili8l7zqbbkzr1rcy4hlnazkf50mds41wg6n7bfdsx3c7cldgh";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   propagatedBuildInputs = [ ucommon openssl libgcrypt ];
 
   configureFlags = [
@@ -20,8 +20,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "An implementation of the IETF real-time transport protocol (RTP)";
     homepage = "https://www.gnu.org/software/ccrtp/";
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = with stdenv.lib.maintainers; [ marcweber ];
-    platforms = stdenv.lib.platforms.linux;
+    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
index 848927776f90..aff977edd912 100644
--- a/nixpkgs/pkgs/development/libraries/cctz/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cctz/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, darwin }:
+{ lib, stdenv, fetchFromGitHub, darwin }:
 
 stdenv.mkDerivation rec {
   pname = "cctz";
@@ -13,17 +13,17 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "PREFIX=$(out)" ];
 
-  buildInputs = stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Foundation;
+  buildInputs = lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Foundation;
 
   installTargets = [ "install_hdrs" "install_shared_lib" ];
 
-  postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
+  postInstall = lib.optionalString stdenv.isDarwin ''
     install_name_tool -id $out/lib/libcctz.so $out/lib/libcctz.so
   '';
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/google/cctz";
     description = "C++ library for translating between absolute and civil times";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/cddlib/default.nix b/nixpkgs/pkgs/development/libraries/cddlib/default.nix
index cebe6fb2bf6a..9ff54f8ebf9d 100644
--- a/nixpkgs/pkgs/development/libraries/cddlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cddlib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , gmp
 , autoreconfHook
@@ -22,9 +22,9 @@ stdenv.mkDerivation rec {
   # No actual checks yet (2018-05-05), but maybe one day.
   # Requested here: https://github.com/cddlib/cddlib/issues/25
   doCheck = true;
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit version;
-    description = ''An implementation of the Double Description Method for generating all vertices of a convex polyhedron'';
+    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;
diff --git a/nixpkgs/pkgs/development/libraries/cdk/default.nix b/nixpkgs/pkgs/development/libraries/cdk/default.nix
index 4613eefd3b90..1a4f617cf469 100644
--- a/nixpkgs/pkgs/development/libraries/cdk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cdk/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchurl, ncurses }:
+{ lib, stdenv, fetchurl, ncurses }:
 
 stdenv.mkDerivation rec {
   pname = "cdk";
-  version ="5.0-20200923";
+  version ="5.0-20210109";
 
   buildInputs = [
     ncurses
@@ -13,10 +13,10 @@ stdenv.mkDerivation rec {
       "ftp://ftp.invisible-island.net/cdk/cdk-${version}.tgz"
       "https://invisible-mirror.net/archives/cdk/cdk-${version}.tgz"
     ];
-    sha256 = "1vdakz119a13d7p7w53hk56fdmbkhv6y9xvdapcfnbnbh3l5szq0";
+    sha256 = "sha256-xBbJh793tPGycD18XkM7qUWMi+Uma/RUy/gBrYfnKTY=";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Curses development kit";
     license = licenses.bsdOriginal ;
     maintainers = [ maintainers.raskin ];
diff --git a/nixpkgs/pkgs/development/libraries/cdo/default.nix b/nixpkgs/pkgs/development/libraries/cdo/default.nix
index f582be81e86e..a038b5885c2b 100644
--- a/nixpkgs/pkgs/development/libraries/cdo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cdo/default.nix
@@ -1,7 +1,10 @@
-{ stdenv, fetchurl, curl, hdf5, netcdf
-, enable_cdi_lib ? false    # build, install and link to a CDI library [default=no]
-, enable_all_static ? false # build a completely statically linked CDO binary  [default=no]
-, enable_cxx ? false        # Use CXX as default compiler [default=no]
+{ 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 {
@@ -19,11 +22,11 @@ stdenv.mkDerivation rec {
  # Configure phase
  configureFlags = [
    "--with-netcdf=${netcdf}" "--with-hdf5=${hdf5}"]
-   ++ stdenv.lib.optional (enable_cdi_lib) "--enable-cdi-lib"
-   ++ stdenv.lib.optional (enable_all_static) "--enable-all-static"
-   ++ stdenv.lib.optional (enable_cxx) "--enable-cxx";
+   ++ lib.optional (enable_cdi_lib) "--enable-cdi-lib"
+   ++ lib.optional (enable_all_static) "--enable-all-static"
+   ++ lib.optional (enable_cxx) "--enable-cxx";
 
-  meta = with stdenv.lib; {
+  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.
diff --git a/nixpkgs/pkgs/development/libraries/cegui/default.nix b/nixpkgs/pkgs/development/libraries/cegui/default.nix
index aaa93f19131a..ba3366198c2c 100644
--- a/nixpkgs/pkgs/development/libraries/cegui/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cegui/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, ogre, freetype, boost, expat }:
+{ lib, stdenv, fetchurl, cmake, ogre, freetype, boost, expat }:
 
 stdenv.mkDerivation rec {
   pname = "cegui";
@@ -9,10 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "067562s71kfsnbp2zb2bmq8zj3jk96g5a4rcc5qc3n8nfyayhldk";
   };
 
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ ogre freetype boost expat ];
 
-  buildInputs = [ cmake ogre freetype boost expat ];
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://cegui.org.uk/";
     description = "C++ Library for creating GUIs";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/celt/generic.nix b/nixpkgs/pkgs/development/libraries/celt/generic.nix
index 6277c5cd931c..d4fe5e83658b 100644
--- a/nixpkgs/pkgs/development/libraries/celt/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/celt/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv, version, src
+{ lib, stdenv, version, src
 , liboggSupport ? true, libogg ? null # if disabled only the library will be built
 , prePatch ? ""
 , ...
@@ -15,11 +15,11 @@ stdenv.mkDerivation {
   inherit prePatch;
 
   buildInputs = []
-    ++ stdenv.lib.optional liboggSupport libogg;
+    ++ lib.optional liboggSupport libogg;
 
   doCheck = false; # fails
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Ultra-low delay audio codec";
     homepage    = "http://www.celt-codec.org/";
     license     = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/cereal/default.nix b/nixpkgs/pkgs/development/libraries/cereal/default.nix
index e17b42ea5c1d..d2321175f8bd 100644
--- a/nixpkgs/pkgs/development/libraries/cereal/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cereal/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 stdenv.mkDerivation rec {
   pname = "cereal";
   version = "1.3.0";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlagsArray = [ "-DJUST_INSTALL_CEREAL=yes" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A header-only C++11 serialization library";
     homepage    = "https://uscilab.github.io/cereal/";
     platforms   = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/ceres-solver/default.nix b/nixpkgs/pkgs/development/libraries/ceres-solver/default.nix
index 18f029c45852..14d0e38f3d9f 100644
--- a/nixpkgs/pkgs/development/libraries/ceres-solver/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ceres-solver/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , eigen
 , fetchurl
 , cmake
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ eigen glog ]
-    ++ stdenv.lib.optional runTests gflags;
+    ++ lib.optional runTests gflags;
 
   # The Basel BUILD file conflicts with the cmake build directory on
   # case-insensitive filesystems, eg. darwin.
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
 
   checkTarget = "test";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ library for modeling and solving large, complicated optimization problems";
     license = licenses.bsd3;
     homepage = "http://ceres-solver.org";
diff --git a/nixpkgs/pkgs/development/libraries/cfitsio/default.nix b/nixpkgs/pkgs/development/libraries/cfitsio/default.nix
index 1b7dc58c0d66..28bb0761777c 100644
--- a/nixpkgs/pkgs/development/libraries/cfitsio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cfitsio/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv
+{ fetchurl, lib, stdenv
 
 # Optional dependencies
 , bzip2 ? null }:
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./darwin-rpath-universal.patch ];
 
-  configureFlags = stdenv.lib.optional (bzip2 != null) "--with-bzip2=${bzip2.out}";
+  configureFlags = lib.optional (bzip2 != null) "--with-bzip2=${bzip2.out}";
 
   hardeningDisable = [ "format" ];
 
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
   postPatch = '' sed -e '/^install:/s/libcfitsio.a //' -e 's@/bin/@@g' -i Makefile.in
    '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://heasarc.gsfc.nasa.gov/fitsio/";
     description = "Library for reading and writing FITS data files";
     longDescription =
diff --git a/nixpkgs/pkgs/development/libraries/cgui/default.nix b/nixpkgs/pkgs/development/libraries/cgui/default.nix
index d6c550a8da87..1bc85d1fcd81 100644
--- a/nixpkgs/pkgs/development/libraries/cgui/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cgui/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, texinfo, allegro, perl, libX11 }:
+{ lib, stdenv, fetchurl, texinfo, allegro, perl, libX11 }:
 
 stdenv.mkDerivation rec {
   pname = "cgui";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "SYSTEM_DIR=$(out)" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A multiplatform basic GUI library";
     maintainers = [ maintainers.raskin ];
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/check/default.nix b/nixpkgs/pkgs/development/libraries/check/default.nix
index be000e457c40..37bde1caf437 100644
--- a/nixpkgs/pkgs/development/libraries/check/default.nix
+++ b/nixpkgs/pkgs/development/libraries/check/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv
+{ fetchurl, lib, stdenv
 , CoreServices
 }:
 
@@ -14,9 +14,9 @@ stdenv.mkDerivation rec {
   # Test can randomly fail: https://hydra.nixos.org/build/7243912
   doCheck = false;
 
-  buildInputs = stdenv.lib.optional stdenv.isDarwin CoreServices;
+  buildInputs = lib.optional stdenv.isDarwin CoreServices;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Unit testing framework for C";
 
     longDescription =
diff --git a/nixpkgs/pkgs/development/libraries/chipmunk/default.nix b/nixpkgs/pkgs/development/libraries/chipmunk/default.nix
index 7618476d62a0..8290e60a4850 100644
--- a/nixpkgs/pkgs/development/libraries/chipmunk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/chipmunk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, freeglut, libGLU, libGL, glfw2, glew, libX11, xorgproto
+{ lib, stdenv, fetchurl, cmake, freeglut, libGLU, libGL, glfw2, glew, libX11, xorgproto
 , libXi, libXmu, fetchpatch, libXrandr
 }:
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     cp demo/chipmunk_demos $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A fast and lightweight 2D game physics library";
     homepage = "http://chipmunk2d.net/";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/chmlib/default.nix b/nixpkgs/pkgs/development/libraries/chmlib/default.nix
index 9b95fd264446..8971acc7eddf 100644
--- a/nixpkgs/pkgs/development/libraries/chmlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/chmlib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   name = "chmlib-0.40a";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "http://www.jedrea.com/chmlib";
-    license = stdenv.lib.licenses.lgpl2;
+    license = lib.licenses.lgpl2;
     description = "A library for dealing with Microsoft ITSS/CHM format files";
     platforms = ["x86_64-linux" "i686-linux" "x86_64-darwin" "aarch64-linux"];
   };
diff --git a/nixpkgs/pkgs/development/libraries/chromaprint/default.nix b/nixpkgs/pkgs/development/libraries/chromaprint/default.nix
index 12f844aa5958..599ef02eec09 100644
--- a/nixpkgs/pkgs/development/libraries/chromaprint/default.nix
+++ b/nixpkgs/pkgs/development/libraries/chromaprint/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [ "-DBUILD_EXAMPLES=ON" "-DBUILD_TOOLS=ON" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://acoustid.org/chromaprint";
     description = "AcoustID audio fingerprinting library";
     maintainers = with maintainers; [ ehmry ];
diff --git a/nixpkgs/pkgs/development/libraries/cimg/default.nix b/nixpkgs/pkgs/development/libraries/cimg/default.nix
index 61d3996a4f5b..eb55178db0df 100644
--- a/nixpkgs/pkgs/development/libraries/cimg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cimg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "cimg";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "doc" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     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
diff --git a/nixpkgs/pkgs/development/libraries/civetweb/default.nix b/nixpkgs/pkgs/development/libraries/civetweb/default.nix
index 4092a9c9c5b8..8a3474a491f3 100644
--- a/nixpkgs/pkgs/development/libraries/civetweb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/civetweb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 }:
 
@@ -36,6 +36,6 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Embedded C/C++ web server";
     homepage = "https://github.com/civetweb/civetweb";
-    license = [ stdenv.lib.licenses.mit ];
+    license = [ lib.licenses.mit ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/cl/default.nix b/nixpkgs/pkgs/development/libraries/cl/default.nix
index aad14bead660..a4b526ea25d3 100644
--- a/nixpkgs/pkgs/development/libraries/cl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cl/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, rebar, erlang, opencl-headers, ocl-icd }:
+{lib, stdenv, fetchFromGitHub, rebar, erlang, opencl-headers, ocl-icd }:
 
 stdenv.mkDerivation rec {
   version = "1.2.4";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     cp -ruv c_src doc ebin include priv src $DIR
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/tonyrog/cl";
     description = "OpenCL binding for Erlang";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/classads/default.nix b/nixpkgs/pkgs/development/libraries/classads/default.nix
index f2377a59e7b2..ba8961c8f6c0 100644
--- a/nixpkgs/pkgs/development/libraries/classads/default.nix
+++ b/nixpkgs/pkgs/development/libraries/classads/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pcre }:
+{ lib, stdenv, fetchurl, pcre }:
 
 let version = "1.0.10"; in
 
@@ -16,11 +16,11 @@ stdenv.mkDerivation {
   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 = stdenv.lib.licenses.asl20;
-    platforms = stdenv.lib.platforms.unix;
+    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
index 8b79619dff4b..74d167144a9f 100644
--- a/nixpkgs/pkgs/development/libraries/clearsilver/default.nix
+++ b/nixpkgs/pkgs/development/libraries/clearsilver/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, python }:
+{ lib, stdenv, fetchurl, fetchpatch, python }:
 
 stdenv.mkDerivation rec {
   name = "clearsilver-0.10.5";
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  meta = with stdenv.lib; {
+  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
index 5eb5b842ecfa..91267208d2e6 100644
--- a/nixpkgs/pkgs/development/libraries/clfft/default.nix
+++ b/nixpkgs/pkgs/development/libraries/clfft/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, fftw, fftwFloat, boost166, opencl-clhpp, ocl-icd }:
+{ lib, stdenv, fetchFromGitHub, cmake, fftw, fftwFloat, boost166, opencl-clhpp, ocl-icd }:
 
 let
   version = "2.12.2";
@@ -19,7 +19,7 @@ in stdenv.mkDerivation {
 
   buildInputs = [ fftw fftwFloat boost166 opencl-clhpp ocl-icd ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library containing FFT functions written in OpenCL";
     longDescription = ''
       clFFT is a software library containing FFT functions written in OpenCL.
diff --git a/nixpkgs/pkgs/development/libraries/clipp/default.nix b/nixpkgs/pkgs/development/libraries/clipp/default.nix
index f7c8f90e8686..12b393e597d4 100644
--- a/nixpkgs/pkgs/development/libraries/clipp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/clipp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "clipp";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
       --subst-var version
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/clipper/default.nix b/nixpkgs/pkgs/development/libraries/clipper/default.nix
index ebb41fde4238..9eb34f6b6863 100644
--- a/nixpkgs/pkgs/development/libraries/clipper/default.nix
+++ b/nixpkgs/pkgs/development/libraries/clipper/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, ninja, unzip }:
+{ lib, stdenv, fetchurl, cmake, ninja, unzip }:
 
 stdenv.mkDerivation rec {
   version = "6.4.2";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ninja unzip ];
 
-  meta = with stdenv.lib; {
+  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,
diff --git a/nixpkgs/pkgs/development/libraries/cln/default.nix b/nixpkgs/pkgs/development/libraries/cln/default.nix
index 669ce90287bc..23bbd84a2096 100644
--- a/nixpkgs/pkgs/development/libraries/cln/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cln/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gmp }:
+{ lib, stdenv, fetchurl, gmp }:
 
 stdenv.mkDerivation rec {
   pname = "cln";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ gmp ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C/C++ library for numbers, a part of GiNaC";
     homepage = "https://www.ginac.de/CLN/";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/cloog-ppl/default.nix b/nixpkgs/pkgs/development/libraries/cloog-ppl/default.nix
index f7a0bd058e71..b2bd2adde43a 100644
--- a/nixpkgs/pkgs/development/libraries/cloog-ppl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cloog-ppl/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, ppl, autoreconfHook }:
+{ fetchurl, lib, stdenv, ppl, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   name = "cloog-ppl-0.15.11";
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
     # CLooG-PPL is actually a port of GLooG from PolyLib to PPL.
     homepage = "http://www.cloog.org/";
 
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
     maintainers = [ ];
 
@@ -65,6 +65,6 @@ stdenv.mkDerivation rec {
        make[3]: *** [Box.lo] Error 1
 
     */
-    platforms = stdenv.lib.platforms.unix; # Once had cygwin problems
+    platforms = lib.platforms.unix; # Once had cygwin problems
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/cloog/0.18.0.nix b/nixpkgs/pkgs/development/libraries/cloog/0.18.0.nix
index b0f69d42e8cd..c952c1a563b8 100644
--- a/nixpkgs/pkgs/development/libraries/cloog/0.18.0.nix
+++ b/nixpkgs/pkgs/development/libraries/cloog/0.18.0.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, gmp, isl }:
+{ fetchurl, lib, stdenv, gmp, isl }:
 
 stdenv.mkDerivation rec {
   name = "cloog-0.18.0";
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
 
     homepage = "http://www.cloog.org/";
 
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
     /* Leads to an ICE on Cygwin:
 
@@ -58,6 +58,6 @@ stdenv.mkDerivation rec {
        make[3]: *** [Box.lo] Error 1
 
     */
-    platforms = stdenv.lib.platforms.unix; # Once had cygwin problems
+    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
index be506cdee173..54df2df9d4d2 100644
--- a/nixpkgs/pkgs/development/libraries/cloog/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cloog/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, gmp, isl }:
+{ fetchurl, lib, stdenv, gmp, isl }:
 
 stdenv.mkDerivation rec {
   name = "cloog-0.18.4";
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
 
     homepage = "http://www.cloog.org/";
 
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
     /* Leads to an ICE on Cygwin:
 
@@ -59,6 +59,6 @@ stdenv.mkDerivation rec {
        make[3]: *** [Box.lo] Error 1
 
     */
-    platforms = stdenv.lib.platforms.unix; # Once had cygwin problems
+    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
index 3776f1eac219..9c1f3c21cd27 100644
--- a/nixpkgs/pkgs/development/libraries/clucene-core/2.x.nix
+++ b/nixpkgs/pkgs/development/libraries/clucene-core/2.x.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, cmake, boost, zlib}:
+{lib, stdenv, fetchurl, cmake, boost, zlib}:
 
 stdenv.mkDerivation rec {
   name = "clucene-core-2.3.3.4";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     "-DBUILD_CONTRIBS=ON"
     "-DBUILD_CONTRIBS_LIB=ON"
     "-DCMAKE_BUILD_WITH_INSTALL_NAME_DIR=ON"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+  ] ++ 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"
@@ -30,15 +30,15 @@ stdenv.mkDerivation rec {
     [ ./Fix-pkgconfig-file-by-adding-clucene-shared-library.patch
       ./Fixing_ZLIB_configuration_in_shared_CMakeLists.patch
       ./Install-contribs-lib.patch
-    ] ++ stdenv.lib.optionals stdenv.isDarwin [ ./fix-darwin.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 = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=c++11-narrowing";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Core library for full-featured text search engine";
     longDescription = ''
       CLucene is a high-performance, scalable, cross platform, full-featured,
diff --git a/nixpkgs/pkgs/development/libraries/clucene-core/default.nix b/nixpkgs/pkgs/development/libraries/clucene-core/default.nix
index d71d01de9e25..20b0a3b547ca 100644
--- a/nixpkgs/pkgs/development/libraries/clucene-core/default.nix
+++ b/nixpkgs/pkgs/development/libraries/clucene-core/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   name = "clucene-core-0.9.21b";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./gcc6.patch ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Core library for full-featured text search engine";
     longDescription = ''
       CLucene is a high-performance, scalable, cross platform, full-featured,
diff --git a/nixpkgs/pkgs/development/libraries/clutter-gst/default.nix b/nixpkgs/pkgs/development/libraries/clutter-gst/default.nix
index 1a9644991b61..166d4e12c252 100644
--- a/nixpkgs/pkgs/development/libraries/clutter-gst/default.nix
+++ b/nixpkgs/pkgs/development/libraries/clutter-gst/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, pkgconfig, clutter, gtk3, glib, cogl, gnome3, gdk-pixbuf }:
+{ fetchurl, lib, stdenv, pkg-config, clutter, gtk3, glib, cogl, gnome3, gdk-pixbuf }:
 
 stdenv.mkDerivation rec {
   pname = "clutter-gst";
@@ -7,12 +7,12 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "17czmpl92dzi4h3rn5rishk015yi3jwiw29zv8qan94xcmnbssgy";
   };
 
   propagatedBuildInputs = [ clutter gtk3 glib cogl gdk-pixbuf ];
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   postBuild = "rm -rf $out/share/gtk-doc";
 
@@ -27,9 +27,9 @@ stdenv.mkDerivation rec {
 
     homepage = "http://www.clutter-project.org/";
 
-    license = stdenv.lib.licenses.lgpl2Plus;
+    license = lib.licenses.lgpl2Plus;
 
-    maintainers = with stdenv.lib.maintainers; [ lethalman ];
-    platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;  # arbitrary choice
+    maintainers = with lib.maintainers; [ lethalman ];
+    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
index 973ae344dc92..0dfb8c7b9df0 100644
--- a/nixpkgs/pkgs/development/libraries/clutter-gtk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/clutter-gtk/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, pkgconfig, meson, ninja
+{ fetchurl, lib, stdenv, pkg-config, meson, ninja
 , gobject-introspection, clutter, gtk3, gnome3 }:
 
 let
@@ -10,14 +10,14 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "01ibniy4ich0fgpam53q252idm7f4fn5xg5qvizcfww90gn9652j";
   };
 
   outputs = [ "out" "dev" ];
 
   propagatedBuildInputs = [ clutter gtk3 ];
-  nativeBuildInputs = [ meson ninja pkgconfig gobject-introspection ];
+  nativeBuildInputs = [ meson ninja pkg-config gobject-introspection ];
 
   postBuild = "rm -rf $out/share/gtk-doc";
 
@@ -30,8 +30,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Clutter-GTK";
     homepage = "http://www.clutter-project.org/";
-    license = stdenv.lib.licenses.lgpl2Plus;
-    maintainers = with stdenv.lib.maintainers; [ lethalman ];
-    platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;  # arbitrary choice
+    license = lib.licenses.lgpl2Plus;
+    maintainers = with lib.maintainers; [ lethalman ];
+    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
index 8a70a872b9ef..002db004dc19 100644
--- a/nixpkgs/pkgs/development/libraries/clutter/default.nix
+++ b/nixpkgs/pkgs/development/libraries/clutter/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libGLU, libGL, libX11, libXext, libXfixes
+{ lib, stdenv, fetchurl, pkg-config, libGLU, libGL, libX11, libXext, libXfixes
 , libXdamage, libXcomposite, libXi, libxcb, cogl, pango, atk, json-glib
 , gobject-introspection, gtk3, gnome3, libinput, libgudev, libxkbcommon
 }:
@@ -11,14 +11,14 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "1rn4cd1an6a9dfda884aqpcwcgq8dgydpqvb19nmagw4b70zlj4b";
   };
 
   outputs = [ "out" "dev" ];
 
   buildInputs = [ gtk3 ];
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   propagatedBuildInputs =
     [ libX11 libGL libGLU libXext libXfixes libXdamage libXcomposite libXi cogl pango
       atk json-glib gobject-introspection libxcb libinput libgudev libxkbcommon
@@ -52,10 +52,10 @@ stdenv.mkDerivation rec {
          specific needs.
       '';
 
-    license = stdenv.lib.licenses.lgpl2Plus;
+    license = lib.licenses.lgpl2Plus;
     homepage = "http://www.clutter-project.org/";
 
-    maintainers = with stdenv.lib.maintainers; [ lethalman ];
-    platforms = stdenv.lib.platforms.mesaPlatforms;
+    maintainers = with lib.maintainers; [ lethalman ];
+    platforms = lib.platforms.mesaPlatforms;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/cm256cc/default.nix b/nixpkgs/pkgs/development/libraries/cm256cc/default.nix
index eaddcb86f546..b40aea70b410 100644
--- a/nixpkgs/pkgs/development/libraries/cm256cc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cm256cc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, boost } :
+{ lib, stdenv, fetchFromGitHub, cmake, boost } :
 
 stdenv.mkDerivation rec {
   pname = "cm256cc";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
   buildInputs = [ boost ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Fast GF(256) Cauchy MDS Block Erasure Codec in C++";
     homepage = "https://github.com/f4exb/cm256cc";
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/cmark-gfm/default.nix b/nixpkgs/pkgs/development/libraries/cmark-gfm/default.nix
index 52a02772268b..8a9534365f4e 100644
--- a/nixpkgs/pkgs/development/libraries/cmark-gfm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cmark-gfm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 stdenv.mkDerivation rec {
   pname = "cmark-gfm";
   version = "0.29.0.gfm.0";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   # tests load the library dynamically which for unknown reason failed
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/cmark/default.nix b/nixpkgs/pkgs/development/libraries/cmark/default.nix
index b132e958f67a..6061fd8f9123 100644
--- a/nixpkgs/pkgs/development/libraries/cmark/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cmark/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   version = "0.29.0";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     export LD_LIBRARY_PATH=$(readlink -f ./src)
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "CommonMark parsing and rendering library and program in C";
     homepage = "https://github.com/jgm/cmark";
     maintainers = [ maintainers.michelk ];
diff --git a/nixpkgs/pkgs/development/libraries/cminpack/default.nix b/nixpkgs/pkgs/development/libraries/cminpack/default.nix
index 3b2d748a8366..39d4849f3801 100644
--- a/nixpkgs/pkgs/development/libraries/cminpack/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cminpack/default.nix
@@ -1,8 +1,8 @@
-{stdenv, fetchurl}:
+{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";
@@ -18,9 +18,9 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "http://devernay.free.fr/hacks/cminpack/cminpack.html";
-    license = stdenv.lib.licenses.bsd3;
+    license = lib.licenses.bsd3;
     description = "Software for solving nonlinear equations and nonlinear least squares problems";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 
 }
diff --git a/nixpkgs/pkgs/development/libraries/cmocka/default.nix b/nixpkgs/pkgs/development/libraries/cmocka/default.nix
index 18c1843623f8..9bfbc410c007 100644
--- a/nixpkgs/pkgs/development/libraries/cmocka/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cmocka/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, cmake }:
+{ fetchurl, lib, stdenv, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "cmocka";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Lightweight library to simplify and generalize unit tests for C";
 
     longDescription =
diff --git a/nixpkgs/pkgs/development/libraries/cmrt/default.nix b/nixpkgs/pkgs/development/libraries/cmrt/default.nix
index 512a289152ad..43d73ba200ce 100644
--- a/nixpkgs/pkgs/development/libraries/cmrt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cmrt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, pkgconfig, libdrm, libva }:
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, libdrm, libva }:
 
 stdenv.mkDerivation rec {
   pname = "cmrt";
@@ -9,11 +9,11 @@ stdenv.mkDerivation rec {
     sha256 = "1q7651nvvcqhph5rgfhklm71zqd0c405mrh3wx0cfzvil82yj8na";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
   buildInputs = [ libdrm libva ];
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/codec2/default.nix b/nixpkgs/pkgs/development/libraries/codec2/default.nix
index 4a648b1f32a8..09ec21cc63e8 100644
--- a/nixpkgs/pkgs/development/libraries/codec2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/codec2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "codec2";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  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.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/cogl/default.nix b/nixpkgs/pkgs/development/libraries/cogl/default.nix
index f2a69e87d85e..8fd152072879 100644
--- a/nixpkgs/pkgs/development/libraries/cogl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cogl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, pkgconfig, libGL, glib, gdk-pixbuf, xorg, libintl
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, libGL, glib, gdk-pixbuf, xorg, libintl
 , pangoSupport ? true, pango, cairo, gobject-introspection, wayland, gnome3
 , mesa, automake, autoconf
 , gstreamerSupport ? true, gst_all_1 }:
@@ -10,7 +10,7 @@ in stdenv.mkDerivation rec {
   version = "1.22.8";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "0nfph4ai60ncdx7hy6hl1i1cmp761jgnyjfhagzi0iqq36qb41d8";
   };
 
@@ -33,27 +33,27 @@ in stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig libintl automake autoconf ];
+  nativeBuildInputs = [ pkg-config libintl automake autoconf ];
 
   configureFlags = [
     "--enable-introspection"
     "--enable-kms-egl-platform"
     "--enable-wayland-egl-platform"
     "--enable-wayland-egl-server"
-  ] ++ stdenv.lib.optional gstreamerSupport "--enable-cogl-gst"
-  ++ stdenv.lib.optionals (!stdenv.isDarwin) [ "--enable-gles1" "--enable-gles2" ];
+  ] ++ 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
     ]
-    ++ stdenv.lib.optionals gstreamerSupport [ gst_all_1.gstreamer
+    ++ lib.optionals gstreamerSupport [ gst_all_1.gstreamer
                                                gst_all_1.gst-plugins-base ];
 
-  buildInputs = stdenv.lib.optionals pangoSupport [ pango cairo ];
+  buildInputs = lib.optionals pangoSupport [ pango cairo ];
 
   COGL_PANGO_DEP_CFLAGS
-    = stdenv.lib.optionalString (stdenv.isDarwin && pangoSupport)
+    = 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)
@@ -64,7 +64,7 @@ in stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A small open source library for using 3D graphics hardware for rendering";
     maintainers = with maintainers; [ lovek323 ];
 
diff --git a/nixpkgs/pkgs/development/libraries/coin3d/default.nix b/nixpkgs/pkgs/development/libraries/coin3d/default.nix
index c76aaa4c8e53..3fe78e6d02e9 100644
--- a/nixpkgs/pkgs/development/libraries/coin3d/default.nix
+++ b/nixpkgs/pkgs/development/libraries/coin3d/default.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, stdenv, boost, cmake, libX11, libGL, libGLU }:
+{ fetchFromGitHub, lib, stdenv, boost, cmake, libX11, libGL, libGLU }:
 
 stdenv.mkDerivation rec {
   pname = "coin";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
   buildInputs = [ boost libX11 libGL libGLU ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/coin3d/coin";
     license = licenses.bsd3;
     description = "High-level, retained-mode toolkit for effective 3D graphics development";
diff --git a/nixpkgs/pkgs/development/libraries/comedilib/default.nix b/nixpkgs/pkgs/development/libraries/comedilib/default.nix
index 98811b97c87e..fef22dea06ae 100644
--- a/nixpkgs/pkgs/development/libraries/comedilib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/comedilib/default.nix
@@ -1,4 +1,5 @@
 { stdenv
+, lib
 , fetchFromGitHub
 , autoreconfHook
 , flex
@@ -18,7 +19,7 @@ stdenv.mkDerivation rec {
   src = fetchFromGitHub {
     owner = "Linux-Comedi";
     repo = "comedilib";
-    rev = "r${stdenv.lib.replaceStrings [ "." ] [ "_" ] version}";
+    rev = "r${lib.replaceStrings [ "." ] [ "_" ] version}";
     sha256 = "0kfs2dw62vjz8j7fgsxq6ky8r8kca726gyklbm6kljvgfh47lyfw";
   };
 
@@ -45,7 +46,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "man" "doc" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The Linux Control and Measurement Device Interface Library";
     homepage = "https://github.com/Linux-Comedi/comedilib";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/concurrencykit/default.nix b/nixpkgs/pkgs/development/libraries/concurrencykit/default.nix
index a54bc7547822..968c395d701f 100644
--- a/nixpkgs/pkgs/development/libraries/concurrencykit/default.nix
+++ b/nixpkgs/pkgs/development/libraries/concurrencykit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "concurrencykit";
@@ -8,13 +8,13 @@ stdenv.mkDerivation rec {
     url    = "http://concurrencykit.org/releases/ck-${version}.tar.gz";
     sha256 = "1pv21p7sjwwmbs2xblpy1lqk53r2i212yrqyjlr5dr3rlv87vqnp";
   };
-  
+
   #Deleting this line causes "Unknown option --disable-static"
   configurePhase = "./configure --prefix=$out";
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library of safe, high-performance concurrent data structures";
     homepage    = "http://concurrencykit.org";
     license     = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/cpp-hocon/default.nix b/nixpkgs/pkgs/development/libraries/cpp-hocon/default.nix
index 47ec7a1a6eb4..dfe7f7776703 100644
--- a/nixpkgs/pkgs/development/libraries/cpp-hocon/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cpp-hocon/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, boost, curl, leatherman }:
+{ lib, stdenv, fetchFromGitHub, cmake, boost, curl, leatherman }:
 
 stdenv.mkDerivation rec {
   pname = "cpp-hocon";
@@ -17,9 +17,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ boost curl leatherman ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit (src.meta) homepage;
     description = "A C++ port of the Typesafe Config library";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/cpp-ipfs-api/default.nix b/nixpkgs/pkgs/development/libraries/cpp-ipfs-api/default.nix
index 3c5921541a76..839ddb9b76fb 100644
--- a/nixpkgs/pkgs/development/libraries/cpp-ipfs-api/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cpp-ipfs-api/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, curl, cmake, nlohmann_json }:
+{ lib, stdenv, fetchFromGitHub, curl, cmake, nlohmann_json }:
 
 stdenv.mkDerivation {
   pname = "cpp-ipfs-api";
@@ -11,10 +11,11 @@ stdenv.mkDerivation {
     sha256 = "1z6gbd7npg4pd9wmdyzcp9h12sg84d7a43c69pp4lzqkyqg8pz1g";
   };
 
-  buildInputs = [ cmake curl ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ curl ];
   propagatedBuildInputs = [ nlohmann_json ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "IPFS C++ API client library";
     homepage = "https://github.com/vasild/cpp-ipfs-api";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/cpp-netlib/default.nix b/nixpkgs/pkgs/development/libraries/cpp-netlib/default.nix
index 50c4e05dfa1d..6085a3c849cc 100644
--- a/nixpkgs/pkgs/development/libraries/cpp-netlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cpp-netlib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, boost, openssl }:
+{ lib, stdenv, fetchFromGitHub, cmake, boost, openssl }:
 
 stdenv.mkDerivation rec {
   pname = "cpp-netlib";
@@ -12,14 +12,13 @@ stdenv.mkDerivation rec {
     fetchSubmodules = true;
   };
 
-  buildInputs = [ cmake boost openssl ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost openssl ];
 
   cmakeFlags = [
     "-DCPP-NETLIB_BUILD_SHARED_LIBS=ON"
   ];
 
-  enableParallelBuilding = true;
-
   # The test driver binary lacks an RPath to the library's libs
   preCheck = ''
     export LD_LIBRARY_PATH=$PWD/libs/network/src
@@ -28,7 +27,7 @@ stdenv.mkDerivation rec {
   # Most tests make network GET requests to various websites
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Collection of open-source libraries for high level network programming";
     homepage    = "https://cpp-netlib.org";
     license     = licenses.boost;
diff --git a/nixpkgs/pkgs/development/libraries/cpp-utilities/default.nix b/nixpkgs/pkgs/development/libraries/cpp-utilities/default.nix
index 08940b4800df..cec6feded139 100644
--- a/nixpkgs/pkgs/development/libraries/cpp-utilities/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cpp-utilities/default.nix
@@ -1,4 +1,5 @@
 { stdenv
+, lib
 , fetchFromGitHub
 , fetchpatch
 , cmake
@@ -7,13 +8,13 @@
 
 stdenv.mkDerivation rec {
   pname = "cpp-utilities";
-  version = "5.9.0";
+  version = "5.10.0";
 
   src = fetchFromGitHub {
     owner = "Martchus";
     repo = pname;
     rev = "v${version}";
-    sha256 = "0lcbvmighmc03qxcf03vqmn6188wx4dr3m9d5ldxm2v7mw5xbq82";
+    sha256 = "sha256-ZqpgnxI6Py+Xrf+MK852j+kE2JGFz15kWAXOqy+bjVc=";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -22,7 +23,7 @@ stdenv.mkDerivation rec {
   checkFlagsArray = [ "LD_LIBRARY_PATH=$(PWD)" ];
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  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.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/cppcms/default.nix b/nixpkgs/pkgs/development/libraries/cppcms/default.nix
index 0063db95770c..aceb2d61e388 100644
--- a/nixpkgs/pkgs/development/libraries/cppcms/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cppcms/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, pcre, zlib, python, openssl }:
+{ lib, stdenv, fetchurl, cmake, pcre, zlib, python, openssl }:
 
 stdenv.mkDerivation rec {
   pname = "cppcms";
@@ -9,15 +9,14 @@ stdenv.mkDerivation rec {
       sha256 = "0lmcdjzicmzhnr8pa0q3f5lgapz2cnh9w0dr56i4kj890iqwgzhh";
   };
 
-  enableParallelBuilding = true;
-
-  buildInputs = [ cmake pcre zlib python openssl ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ pcre zlib python openssl ];
 
   cmakeFlags = [
     "--no-warn-unused-cli"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://cppcms.com";
     description = "High Performance C++ Web Framework";
     platforms = platforms.linux ;
diff --git a/nixpkgs/pkgs/development/libraries/cppdb/default.nix b/nixpkgs/pkgs/development/libraries/cppdb/default.nix
index fc65dd739209..98c9c7ecac15 100644
--- a/nixpkgs/pkgs/development/libraries/cppdb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cppdb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, sqlite, libmysqlclient, postgresql, unixODBC }:
+{ lib, stdenv, fetchurl, cmake, sqlite, libmysqlclient, postgresql, unixODBC }:
 
 stdenv.mkDerivation rec {
   pname = "cppdb";
@@ -9,14 +9,13 @@ stdenv.mkDerivation rec {
       sha256 = "0blr1casmxickic84dxzfmn3lm7wrsl4aa2abvpq93rdfddfy3nn";
   };
 
-  enableParallelBuilding = true;
-
-  buildInputs = [ cmake sqlite libmysqlclient postgresql unixODBC ];
+  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 stdenv.lib; {
+  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 ;
diff --git a/nixpkgs/pkgs/development/libraries/cpptest/default.nix b/nixpkgs/pkgs/development/libraries/cpptest/default.nix
index 5ed06b99f335..654ad955ae66 100644
--- a/nixpkgs/pkgs/development/libraries/cpptest/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cpptest/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "cpptest-2.0.0";
@@ -8,11 +8,11 @@ stdenv.mkDerivation rec {
     sha256 = "0lpy3f2fjx1srh02myanlp6zfi497whlldcrnij39ghfhm0arcnm";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://cpptest.sourceforge.net/";
     description = "Simple C++ unit testing framework";
     maintainers = with maintainers; [ bosu ];
-    license = stdenv.lib.licenses.lgpl3;
+    license = lib.licenses.lgpl3;
     platforms = with platforms; linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/cppunit/default.nix b/nixpkgs/pkgs/development/libraries/cppunit/default.nix
index bf65be715755..3cafa1c75d76 100644
--- a/nixpkgs/pkgs/development/libraries/cppunit/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cppunit/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   pname = "cppunit";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "19qpqzy66bq76wcyadmi3zahk5v1ll2kig1nvg96zx9padkcdic9";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://freedesktop.org/wiki/Software/cppunit/";
     description = "C++ unit testing framework";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/cpputest/default.nix b/nixpkgs/pkgs/development/libraries/cpputest/default.nix
index d219a8e0bec1..8e3fadc7f0dc 100644
--- a/nixpkgs/pkgs/development/libraries/cpputest/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cpputest/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   version = "4.0";
@@ -12,8 +12,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://cpputest.github.io/";
     description = "Unit testing and mocking framework for C/C++";
-    platforms = stdenv.lib.platforms.linux ;
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = [ stdenv.lib.maintainers.juliendehos ];
+    platforms = lib.platforms.linux ;
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.juliendehos ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/cppzmq/default.nix b/nixpkgs/pkgs/development/libraries/cppzmq/default.nix
index fdd98cb00bf0..9237c3bd3071 100644
--- a/nixpkgs/pkgs/development/libraries/cppzmq/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cppzmq/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, zeromq }:
+{ lib, stdenv, fetchFromGitHub, cmake, zeromq }:
 
 stdenv.mkDerivation rec {
   pname = "cppzmq";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     "-DCPPZMQ_BUILD_TESTS=OFF"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/zeromq/cppzmq";
     license = licenses.bsd2;
     description = "C++ binding for 0MQ";
diff --git a/nixpkgs/pkgs/development/libraries/cracklib/default.nix b/nixpkgs/pkgs/development/libraries/cracklib/default.nix
index c10a69d72f94..13029f7739c5 100644
--- a/nixpkgs/pkgs/development/libraries/cracklib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cracklib/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) buildPackages.cracklib;
   buildInputs = [ zlib gettext ];
 
-  postPatch = stdenv.lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
+  postPatch = lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
     chmod +x util/cracklib-format
     patchShebangs util
 
diff --git a/nixpkgs/pkgs/development/libraries/crc32c/default.nix b/nixpkgs/pkgs/development/libraries/crc32c/default.nix
index b9c12b1889c2..bc46e80db9b3 100644
--- a/nixpkgs/pkgs/development/libraries/crc32c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/crc32c/default.nix
@@ -1,5 +1,6 @@
 { stdenv, lib, fetchFromGitHub, cmake, gflags
-, staticOnly ? false }:
+, staticOnly ? stdenv.hostPlatform.isStatic
+}:
 
 stdenv.mkDerivation rec {
   pname = "crc32c";
@@ -15,10 +16,10 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ gflags ];
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isAarch64 "-march=armv8-a+crc";
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isAarch64 "-march=armv8-a+crc";
   cmakeFlags = lib.optionals (!staticOnly) [ "-DBUILD_SHARED_LIBS=1"  ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/google/crc32c";
     description = "CRC32C implementation with support for CPU-specific acceleration instructions";
     license = with licenses; [ bsd3 ];
diff --git a/nixpkgs/pkgs/development/libraries/crcpp/default.nix b/nixpkgs/pkgs/development/libraries/crcpp/default.nix
index c26578804baf..9410b0715006 100644
--- a/nixpkgs/pkgs/development/libraries/crcpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/crcpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 }:
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     cp inc/CRC.h $out/include
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/d-bahr/CRCpp";
     description = "Easy to use and fast C++ CRC library";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/cre2/default.nix b/nixpkgs/pkgs/development/libraries/cre2/default.nix
index fa4f5d232aa3..d85843a54f7c 100644
--- a/nixpkgs/pkgs/development/libraries/cre2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cre2/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchFromGitHub, autoreconfHook,
-  libtool, pkgconfig, re2, texinfo }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook,
+  libtool, pkg-config, re2, texinfo }:
 
 stdenv.mkDerivation rec {
   pname = "cre2";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     autoreconfHook
     libtool
-    pkgconfig
+    pkg-config
   ];
   buildInputs = [ re2 texinfo ];
 
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     "--enable-maintainer-mode"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://marcomaggi.github.io/docs/cre2.html";
     description = "C Wrapper for RE2";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/criterion/default.nix b/nixpkgs/pkgs/development/libraries/criterion/default.nix
index 3dc4b4624048..ba436fec0a26 100644
--- a/nixpkgs/pkgs/development/libraries/criterion/default.nix
+++ b/nixpkgs/pkgs/development/libraries/criterion/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, boxfort, cmake, libcsptr, pkg-config, gettext
+{ lib, stdenv, fetchFromGitHub, boxfort, cmake, libcsptr, pkg-config, gettext
 , dyncall , nanomsg, python37Packages }:
 
 stdenv.mkDerivation rec {
@@ -13,8 +13,6 @@ stdenv.mkDerivation rec {
     fetchSubmodules = true;
   };
 
-  enableParallelBuilding = true;
-
   nativeBuildInputs = [ cmake pkg-config ];
 
   buildInputs = [
@@ -36,7 +34,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "dev" "out" ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/crypto++/default.nix b/nixpkgs/pkgs/development/libraries/crypto++/default.nix
index 3fe277481553..041e7d49d500 100644
--- a/nixpkgs/pkgs/development/libraries/crypto++/default.nix
+++ b/nixpkgs/pkgs/development/libraries/crypto++/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchFromGitHub, nasm, which }:
+{ lib, stdenv, fetchFromGitHub, nasm, which }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "crypto++";
   version = "8.2.0";
diff --git a/nixpkgs/pkgs/development/libraries/csfml/default.nix b/nixpkgs/pkgs/development/libraries/csfml/default.nix
index ab63b7a21f25..78d8bce40a36 100644
--- a/nixpkgs/pkgs/development/libraries/csfml/default.nix
+++ b/nixpkgs/pkgs/development/libraries/csfml/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, sfml }:
+{ lib, stdenv, fetchFromGitHub, cmake, sfml }:
 
 let
   version = "2.5";
@@ -13,10 +13,11 @@ stdenv.mkDerivation {
     rev   = version;
     sha256 = "071magxif5nrdddzk2z34czqmz1dfws4d7dqynb2zpn7cwhwxcpm";
   };
-  buildInputs = [ cmake sfml ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ sfml ];
   cmakeFlags = [ "-DCMAKE_MODULE_PATH=${sfml}/share/SFML/cmake/Modules/" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.sfml-dev.org/";
     description = "Simple and fast multimedia library";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/ctl/default.nix b/nixpkgs/pkgs/development/libraries/ctl/default.nix
index 71e301044766..be643e3a52c6 100644
--- a/nixpkgs/pkgs/development/libraries/ctl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ctl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, cmake, pkgconfig, ilmbase, libtiff, openexr }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, pkg-config, ilmbase, libtiff, openexr }:
 
 stdenv.mkDerivation rec {
   pname = "ctl";
@@ -19,10 +19,10 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
   buildInputs = [ libtiff ilmbase openexr ];
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/ctpl/default.nix b/nixpkgs/pkgs/development/libraries/ctpl/default.nix
index 077ac63748c6..69380c2eeeb4 100644
--- a/nixpkgs/pkgs/development/libraries/ctpl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ctpl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib }:
+{ lib, stdenv, fetchurl, pkg-config, glib }:
 
 stdenv.mkDerivation rec {
   pname = "ctpl";
@@ -9,10 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "1yr92xv9n6kgyixwg9ps4zb404ic5pgb171k4bi3mv9p6k8gv59s";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ glib ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://ctpl.tuxfamily.org/";
     description = "Template engine library written in C";
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/ctpp2/default.nix b/nixpkgs/pkgs/development/libraries/ctpp2/default.nix
index 82bbdfc2fc19..626606d0526d 100644
--- a/nixpkgs/pkgs/development/libraries/ctpp2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ctpp2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake }:
+{ lib, stdenv, fetchurl, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "ctpp2";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1z22zfw9lb86z4hcan9hlvji49c9b7vznh7gjm95gnvsh43zsgx8";
   };
 
-  buildInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   patchPhase = ''
     # include <unistd.h> to fix undefined getcwd
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # fails
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A high performance templating engine";
     homepage = "http://ctpp.havoc.ru";
     maintainers = [ maintainers.robbinch ];
diff --git a/nixpkgs/pkgs/development/libraries/ctypes_sh/default.nix b/nixpkgs/pkgs/development/libraries/ctypes_sh/default.nix
index d82296c3e66b..644c68e85d86 100644
--- a/nixpkgs/pkgs/development/libraries/ctypes_sh/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ctypes_sh/default.nix
@@ -1,6 +1,6 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
-, autoreconfHook, pkgconfig
+, autoreconfHook, pkg-config
 , zlib, libffi, elfutils, libdwarf
 }:
 
@@ -15,10 +15,10 @@ stdenv.mkDerivation rec {
     sha256 = "1wafyfhwd7nf7xdici0djpwgykizaz7jlarn0r1b4spnpjx1zbx4";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ zlib libffi elfutils libdwarf ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A foreign function interface for bash";
     homepage = "https://github.com/taviso/ctypes.sh";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/cudd/default.nix b/nixpkgs/pkgs/development/libraries/cudd/default.nix
index 6749d2e94c0f..4e8cf59fbffd 100644
--- a/nixpkgs/pkgs/development/libraries/cudd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cudd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook }:
+{ lib, stdenv, fetchurl, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "cudd";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://davidkebo.com/cudd";
     description = "Binary Decision Diagram (BDD) library";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/curlcpp/default.nix b/nixpkgs/pkgs/development/libraries/curlcpp/default.nix
index ead4d1b76bd6..9d4ae41f384f 100644
--- a/nixpkgs/pkgs/development/libraries/curlcpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/curlcpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, curl }: 
+{ lib, stdenv, fetchFromGitHub, cmake, curl }:
 
 stdenv.mkDerivation rec {
   pname = "curlcpp";
@@ -11,9 +11,10 @@ stdenv.mkDerivation rec {
     sha256 = "1zx76jcddqk4zkcdb6p7rsmkjbbjm2cj6drj0c8hdd61ms1d0f3n";
   };
 
-  buildInputs = [ cmake curl ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ curl ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://josephp91.github.io/curlcpp/";
     description = "Object oriented C++ wrapper for CURL";
     platforms = platforms.unix;
@@ -21,4 +22,3 @@ stdenv.mkDerivation rec {
     maintainers = with maintainers; [ rszibele ];
   };
 }
-
diff --git a/nixpkgs/pkgs/development/libraries/curlpp/default.nix b/nixpkgs/pkgs/development/libraries/curlpp/default.nix
index 810bd3f15dab..0aee75751d9e 100644
--- a/nixpkgs/pkgs/development/libraries/curlpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/curlpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, curl }:
+{ lib, stdenv, fetchFromGitHub, cmake, curl }:
 
 stdenv.mkDerivation rec {
   pname = "curlpp";
@@ -12,9 +12,8 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ curl ];
   nativeBuildInputs = [ cmake ];
-  enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.curlpp.org/";
     description = "C++ wrapper around libcURL";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/cutee/default.nix b/nixpkgs/pkgs/development/libraries/cutee/default.nix
index 661dc7c816c4..748d495063de 100644
--- a/nixpkgs/pkgs/development/libraries/cutee/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cutee/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "cutee";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     cp cutee $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ Unit Testing Easy Environment";
     homepage    = "http://www.codesink.org/cutee_unit_testing.html";
     license     = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/cutelyst/default.nix b/nixpkgs/pkgs/development/libraries/cutelyst/default.nix
index 1befa89c7d05..80ec1986f8cf 100644
--- a/nixpkgs/pkgs/development/libraries/cutelyst/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cutelyst/default.nix
@@ -1,19 +1,19 @@
-{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig, wrapQtAppsHook
+{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, wrapQtAppsHook
 , qtbase, libuuid, libcap, uwsgi, grantlee, pcre
 }:
 
 stdenv.mkDerivation rec {
   pname = "cutelyst";
-  version = "2.13.0";
+  version = "2.14.0";
 
   src = fetchFromGitHub {
     owner = "cutelyst";
     repo = "cutelyst";
     rev = "v${version}";
-    sha256 = "1xbw8ag3iwm69dhrsg54anrlzvvflj6pwsj42z6hrl0yckabn99z";
+    sha256 = "sha256-RidUZqDnzRrgW/7LVF+BF01zNcf1cJ/kS7OF/t1Q65c=";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig wrapQtAppsHook ];
+  nativeBuildInputs = [ cmake pkg-config wrapQtAppsHook ];
   buildInputs = [ qtbase libuuid libcap uwsgi grantlee pcre ];
 
   cmakeFlags = [
diff --git a/nixpkgs/pkgs/development/libraries/cwiid/default.nix b/nixpkgs/pkgs/development/libraries/cwiid/default.nix
index 353a5ba90611..31a5420e375c 100644
--- a/nixpkgs/pkgs/development/libraries/cwiid/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cwiid/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, bison, flex, bluez, pkgconfig, gtk2 }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, bison, flex, bluez, pkg-config, gtk2 }:
 
 stdenv.mkDerivation rec {
   name = "cwiid-${version}-git";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ bison flex bluez gtk2 ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
   NIX_LDFLAGS = "-lbluetooth";
 
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     sed -i -e "s/0.6.00/0.6.0/" $out/lib/pkgconfig/cwiid.pc
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Linux Nintendo Wiimote interface";
     homepage    = "http://cwiid.org";
     license     = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/cxx-prettyprint/default.nix b/nixpkgs/pkgs/development/libraries/cxx-prettyprint/default.nix
index 34dc30abe614..f632fca714cf 100644
--- a/nixpkgs/pkgs/development/libraries/cxx-prettyprint/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cxx-prettyprint/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "cxx-prettyprint-unstable";
@@ -17,10 +17,10 @@ stdenv.mkDerivation rec {
     cp prettyprint.hpp "$out/include"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description    = "Header only C++ library for pretty printing standard containers";
     homepage       = "https://github.com/louisdx/cxx-prettyprint";
-    license        = stdenv.lib.licenses.boost;
+    license        = lib.licenses.boost;
     platforms      = platforms.all;
 
     # This is a header-only library, no point in hydra building it:
diff --git a/nixpkgs/pkgs/development/libraries/cxxtest/default.nix b/nixpkgs/pkgs/development/libraries/cxxtest/default.nix
index e1898044efaf..1a828cc451dc 100644
--- a/nixpkgs/pkgs/development/libraries/cxxtest/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cxxtest/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildPythonApplication, fetchFromGitHub }:
+{ lib, stdenv, buildPythonApplication, fetchFromGitHub }:
 
 buildPythonApplication rec {
   pname = "cxxtest";
@@ -26,7 +26,7 @@ buildPythonApplication rec {
 
   dontWrapPythonPrograms = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://cxxtest.com";
     description = "Unit testing framework for C++";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/cxxtools/default.nix b/nixpkgs/pkgs/development/libraries/cxxtools/default.nix
index ca3c48717329..0d8d2498ae73 100644
--- a/nixpkgs/pkgs/development/libraries/cxxtools/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cxxtools/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   version = "2.2.1";
@@ -14,8 +14,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://www.tntnet.org/cxxtools.html";
     description = "Comprehensive C++ class library for Unix and Linux";
-    platforms = stdenv.lib.platforms.linux ;
-    license = stdenv.lib.licenses.lgpl21;
-    maintainers = [ stdenv.lib.maintainers.juliendehos ];
+    platforms = lib.platforms.linux ;
+    license = lib.licenses.lgpl21;
+    maintainers = [ lib.maintainers.juliendehos ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/cyrus-sasl/default.nix b/nixpkgs/pkgs/development/libraries/cyrus-sasl/default.nix
index 96778e8960be..b1a6401284ac 100644
--- a/nixpkgs/pkgs/development/libraries/cyrus-sasl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/cyrus-sasl/default.nix
@@ -2,7 +2,7 @@
 , pam, fixDarwinDylibNames, autoreconfHook, enableLdap ? false
 , buildPackages, pruneLibtoolFiles, fetchpatch }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "cyrus-sasl";
   version = "2.1.27";
diff --git a/nixpkgs/pkgs/development/libraries/czmq/default.nix b/nixpkgs/pkgs/development/libraries/czmq/default.nix
index bdf4519f9bc3..bb8ecafbb347 100644
--- a/nixpkgs/pkgs/development/libraries/czmq/default.nix
+++ b/nixpkgs/pkgs/development/libraries/czmq/default.nix
@@ -1,18 +1,18 @@
-{ stdenv, fetchurl, zeromq }:
+{ lib, stdenv, fetchurl, zeromq }:
 
 stdenv.mkDerivation rec {
-  version = "4.2.0";
+  version = "4.2.1";
   pname = "czmq";
 
   src = fetchurl {
     url = "https://github.com/zeromq/czmq/releases/download/v${version}/${pname}-${version}.tar.gz";
-    sha256 = "1szciz62sk3fm4ga9qjpxz0n0lazvphm32km95bq92ncng12kayg";
+    sha256 = "sha256-XXIKIEwqWGRdb3ZDrxXVY6cS2tmMnTLB7ZEzd9qmrDk=";
   };
 
   # Needs to be propagated for the .pc file to work
   propagatedBuildInputs = [ zeromq ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://czmq.zeromq.org/";
     description = "High-level C Binding for ZeroMQ";
     license = licenses.mpl20;
diff --git a/nixpkgs/pkgs/development/libraries/dav1d/default.nix b/nixpkgs/pkgs/development/libraries/dav1d/default.nix
index a56184e9a179..2b9357e3ef0f 100644
--- a/nixpkgs/pkgs/development/libraries/dav1d/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dav1d/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchFromGitLab
-, meson, ninja, nasm, pkgconfig
+{ lib, stdenv, fetchFromGitLab
+, meson, ninja, nasm, pkg-config
 , withTools ? false # "dav1d" binary
 , withExamples ? false, SDL2 # "dav1dplay" binary
 , useVulkan ? false, libplacebo, vulkan-loader, vulkan-headers
@@ -9,27 +9,27 @@ assert useVulkan -> withExamples;
 
 stdenv.mkDerivation rec {
   pname = "dav1d";
-  version = "0.8.0";
+  version = "0.8.1";
 
   src = fetchFromGitLab {
     domain = "code.videolan.org";
     owner = "videolan";
     repo = pname;
     rev = version;
-    sha256 = "0mjn87xjdqv0q1gj4s4f6fdmsj504mhk4qmqiyrhq2rs7yqj4csv";
+    sha256 = "1820fpmmq1vxjzjmza6ydk4fgxipb8gmcc5skybki64qn7410v7x";
   };
 
-  nativeBuildInputs = [ meson ninja nasm pkgconfig ];
+  nativeBuildInputs = [ meson ninja nasm pkg-config ];
   # TODO: doxygen (currently only HTML and not build by default).
-  buildInputs = stdenv.lib.optional withExamples SDL2
-    ++ stdenv.lib.optionals useVulkan [ libplacebo vulkan-loader vulkan-headers ];
+  buildInputs = lib.optional withExamples SDL2
+    ++ lib.optionals useVulkan [ libplacebo vulkan-loader vulkan-headers ];
 
   mesonFlags= [
-    "-Denable_tools=${stdenv.lib.boolToString withTools}"
-    "-Denable_examples=${stdenv.lib.boolToString withExamples}"
+    "-Denable_tools=${lib.boolToString withTools}"
+    "-Denable_examples=${lib.boolToString withExamples}"
   ];
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/db/db-4.8.nix b/nixpkgs/pkgs/development/libraries/db/db-4.8.nix
index dc668a233b06..5cf9200a9ab9 100644
--- a/nixpkgs/pkgs/development/libraries/db/db-4.8.nix
+++ b/nixpkgs/pkgs/development/libraries/db/db-4.8.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ... } @ args:
+{ lib, stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // {
   version = "4.8.30";
diff --git a/nixpkgs/pkgs/development/libraries/db/db-5.3.nix b/nixpkgs/pkgs/development/libraries/db/db-5.3.nix
index 1223cb897e86..0bb5c4cd6a4a 100644
--- a/nixpkgs/pkgs/development/libraries/db/db-5.3.nix
+++ b/nixpkgs/pkgs/development/libraries/db/db-5.3.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ... } @ args:
+{ lib, stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // {
   version = "5.3.28";
diff --git a/nixpkgs/pkgs/development/libraries/db/db-6.0.nix b/nixpkgs/pkgs/development/libraries/db/db-6.0.nix
index 642054b5a018..49935dd2399b 100644
--- a/nixpkgs/pkgs/development/libraries/db/db-6.0.nix
+++ b/nixpkgs/pkgs/development/libraries/db/db-6.0.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchurl, ... } @ args:
+{ lib, stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // {
   version = "6.0.20";
   sha256 = "00r2aaglq625y8r9xd5vw2y070plp88f1mb2gbq3kqsl7128lsl0";
-  license = stdenv.lib.licenses.agpl3;
+  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
index dee07a9637e6..b2c0fd7ac8fc 100644
--- a/nixpkgs/pkgs/development/libraries/db/db-6.2.nix
+++ b/nixpkgs/pkgs/development/libraries/db/db-6.2.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchurl, ... } @ args:
+{ lib, stdenv, fetchurl, ... } @ args:
 
 import ./generic.nix (args // {
   version = "6.2.23";
   sha256 = "1isxx4jfmnh913jzhp8hhfngbk6dsg46f4kjpvvc56maj64jqqa7";
-  license = stdenv.lib.licenses.agpl3;
+  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
index f439113efb3a..a564db369fba 100644
--- a/nixpkgs/pkgs/development/libraries/db/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/db/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , cxxSupport ? true
 , compat185 ? true
 , dbmSupport ? false
@@ -6,7 +6,7 @@
 # Options from inherited versions
 , version, sha256
 , extraPatches ? [ ]
-, license ? stdenv.lib.licenses.sleepycat
+, license ? lib.licenses.sleepycat
 , drvArgs ? {}
 }:
 
@@ -27,8 +27,8 @@ stdenv.mkDerivation (rec {
       (if cxxSupport then "--enable-cxx" else "--disable-cxx")
       (if compat185 then "--enable-compat185" else "--disable-compat185")
     ]
-    ++ stdenv.lib.optional dbmSupport "--enable-dbm"
-    ++ stdenv.lib.optional stdenv.isFreeBSD "--with-pic";
+    ++ lib.optional dbmSupport "--enable-dbm"
+    ++ lib.optional stdenv.isFreeBSD "--with-pic";
 
   preConfigure = ''
     cd build_unix
@@ -47,7 +47,7 @@ stdenv.mkDerivation (rec {
     make examples_c examples_cxx
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.oracle.com/technetwork/database/database-technologies/berkeleydb/index.html";
     description = "Berkeley DB";
     license = license;
diff --git a/nixpkgs/pkgs/development/libraries/dbus-cplusplus/default.nix b/nixpkgs/pkgs/development/libraries/dbus-cplusplus/default.nix
index 1c9f71311726..731c038527ce 100644
--- a/nixpkgs/pkgs/development/libraries/dbus-cplusplus/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dbus-cplusplus/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, dbus, glib, pkgconfig, expat }:
+{ lib, stdenv, fetchurl, dbus, glib, pkg-config, expat }:
 
 stdenv.mkDerivation rec {
   pname = "dbus-cplusplus";
@@ -31,12 +31,12 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ dbus glib expat ];
 
   configureFlags = [ "--disable-ecore" "--disable-tests" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://dbus-cplusplus.sourceforge.net";
     description = "C++ API for D-BUS";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/dbus-glib/default.nix b/nixpkgs/pkgs/development/libraries/dbus-glib/default.nix
index b0dd8e91960f..f56a1eaac245 100644
--- a/nixpkgs/pkgs/development/libraries/dbus-glib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dbus-glib/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, buildPackages
-, pkgconfig, expat, gettext, libiconv, dbus, glib
+{ lib, stdenv, fetchurl, buildPackages
+, pkg-config, expat, gettext, libiconv, dbus, glib
 }:
 
 stdenv.mkDerivation rec {
@@ -13,14 +13,14 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
   outputBin = "dev";
 
-  nativeBuildInputs = [ pkgconfig gettext glib ];
+  nativeBuildInputs = [ pkg-config gettext glib ];
 
   buildInputs = [ expat libiconv ];
 
   propagatedBuildInputs = [ dbus glib ];
 
   configureFlags = [ "--exec-prefix=${placeholder "dev"}" ] ++
-    stdenv.lib.optional (stdenv.buildPlatform != stdenv.hostPlatform)
+    lib.optional (stdenv.buildPlatform != stdenv.hostPlatform)
       "--with-dbus-binding-tool=${buildPackages.dbus-glib.dev}/bin/dbus-binding-tool";
 
   doCheck = false;
@@ -29,9 +29,9 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "https://dbus.freedesktop.org";
-    license = with stdenv.lib.licenses; [ afl21 gpl2 ];
+    license = with lib.licenses; [ afl21 gpl2 ];
     description = "Obsolete glib bindings for D-Bus lightweight IPC mechanism";
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.unix;
+    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
index 22c0a9137cae..f47c91ca3eaf 100644
--- 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
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, mono, dbus-sharp-1_0 }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, mono, dbus-sharp-1_0 }:
 
 stdenv.mkDerivation rec {
   pname = "dbus-sharp-glib";
@@ -12,12 +12,12 @@ stdenv.mkDerivation rec {
     sha256 = "0z8ylzby8n5sar7aywc8rngd9ap5qqznadsscp5v34cacdfz1gxm";
   };
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
   buildInputs = [ mono dbus-sharp-1_0 ];
 
   dontStrip = true;
 
-  meta = with stdenv.lib; {
+  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
index 496a109b58f1..65cd89043663 100644
--- a/nixpkgs/pkgs/development/libraries/dbus-sharp-glib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dbus-sharp-glib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkgconfig, mono, dbus-sharp-2_0, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, pkg-config, mono, dbus-sharp-2_0, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "dbus-sharp-glib";
@@ -12,12 +12,12 @@ stdenv.mkDerivation rec {
     sha256 = "0i39kfg731as6j0hlmasgj8dyw5xsak7rl2dlimi1naphhffwzm8";
   };
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
   buildInputs = [ mono dbus-sharp-2_0 ];
 
   dontStrip = true;
 
-  meta = with stdenv.lib; {
+  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
index 084beae59727..eb1b20e29eb1 100644
--- a/nixpkgs/pkgs/development/libraries/dbus-sharp/dbus-sharp-1.0.nix
+++ b/nixpkgs/pkgs/development/libraries/dbus-sharp/dbus-sharp-1.0.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, pkgconfig, mono, autoreconfHook }:
+{lib, stdenv, fetchFromGitHub, pkg-config, mono, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "dbus-sharp";
@@ -12,12 +12,12 @@ stdenv.mkDerivation rec {
     sha256 = "13qlqx9wqahfpzzl59157cjxprqcx2bd40w5gb2bs3vdx058p562";
   };
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
   buildInputs = [ mono ];
 
   dontStrip = true;
 
-  meta = with stdenv.lib; {
+  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
index 0fd638dbf8eb..c64d7bbef992 100644
--- a/nixpkgs/pkgs/development/libraries/dbus-sharp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dbus-sharp/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, pkgconfig, mono4, autoreconfHook }:
+{lib, stdenv, fetchFromGitHub, pkg-config, mono4, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "dbus-sharp";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "1g5lblrvkd0wnhfzp326by6n3a9mj2bj7a7646g0ziwgsxp5w6y7";
   };
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
 
   # Use msbuild when https://github.com/NixOS/nixpkgs/pull/43680 is merged
   # See: https://github.com/NixOS/nixpkgs/pull/46060
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   dontStrip = true;
 
-  meta = with stdenv.lib; {
+  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
index 4480d197fa7c..1f1eff189598 100644
--- a/nixpkgs/pkgs/development/libraries/dbus/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dbus/default.nix
@@ -1,7 +1,7 @@
 { stdenv
 , lib
 , fetchurl
-, pkgconfig
+, pkg-config
 , expat
 , enableSystemd ? stdenv.isLinux && !stdenv.hostPlatform.isMusl
 , systemd
@@ -57,7 +57,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "lib" "doc" "man" ];
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     docbook_xml_dtd_44
     docbook-xsl-nons
     xmlto
@@ -79,7 +79,7 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--enable-user-session"
     "--enable-xml-docs"
-    "--libexecdir=${placeholder ''out''}/libexec"
+    "--libexecdir=${placeholder "out"}/libexec"
     "--datadir=/etc"
     "--localstatedir=/var"
     "--runstatedir=/run"
@@ -87,8 +87,8 @@ stdenv.mkDerivation rec {
     "--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"
+    "--with-systemdsystemunitdir=${placeholder "out"}/etc/systemd/system"
+    "--with-systemduserunitdir=${placeholder "out"}/etc/systemd/user"
   ] ++ lib.optional (!x11Support) "--without-x"
   ++ lib.optionals (!stdenv.isDarwin) [ "--enable-apparmor" "--enable-libaudit" ];
 
@@ -103,8 +103,8 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   installFlags = [
-    "sysconfdir=${placeholder ''out''}/etc"
-    "datadir=${placeholder ''out''}/share"
+    "sysconfdir=${placeholder "out"}/etc"
+    "datadir=${placeholder "out"}/share"
   ];
 
   # it's executed from $lib by absolute path
@@ -118,7 +118,7 @@ stdenv.mkDerivation rec {
     daemon = dbus.out;
   };
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/dbxml/default.nix b/nixpkgs/pkgs/development/libraries/dbxml/default.nix
index a0005f1bf720..b4e74d036191 100644
--- a/nixpkgs/pkgs/development/libraries/dbxml/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dbxml/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, db62, xercesc, xqilla }:
+{ lib, stdenv, fetchurl, db62, xercesc, xqilla }:
 
 stdenv.mkDerivation rec {
   pname = "dbxml";
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
     cd dbxml
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.oracle.com/database/berkeley-db/xml.html";
     description = "Embeddable XML database based on Berkeley DB";
     license = licenses.agpl3;
diff --git a/nixpkgs/pkgs/development/libraries/dclib/default.nix b/nixpkgs/pkgs/development/libraries/dclib/default.nix
index a9929ea2adda..b393b74f2b2f 100644
--- a/nixpkgs/pkgs/development/libraries/dclib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dclib/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, libxml2, openssl, bzip2}:
+{lib, stdenv, fetchurl, libxml2, openssl, bzip2}:
 
 stdenv.mkDerivation {
   name = "dclib-0.3.7";
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
 
   buildInputs = [libxml2 openssl bzip2];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Peer-to-Peer file sharing client";
     homepage = "http://dcgui.berlios.de";
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/dclxvi/default.nix b/nixpkgs/pkgs/development/libraries/dclxvi/default.nix
index 802befff14cc..8d7dc5a01781 100644
--- a/nixpkgs/pkgs/development/libraries/dclxvi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dclxvi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation {
   name = "dclxvi-2013-01-27";
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
   patchPhase = ''
     substituteInPlace Makefile \
       --replace "gcc" "cc"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     substituteInPlace Makefile \
       --replace "-soname=libdclxvipairing.so" "-install_name,libdclxvipairing.so"
   '';
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
     find . -name \*.so -exec cp {} $out/lib \;
   '';
 
-  meta = with stdenv.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;
diff --git a/nixpkgs/pkgs/development/libraries/dconf/default.nix b/nixpkgs/pkgs/development/libraries/dconf/default.nix
index c9c1b9be9228..6834a605f1a5 100644
--- a/nixpkgs/pkgs/development/libraries/dconf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dconf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , meson
 , ninja
@@ -10,47 +10,47 @@
 , bash-completion
 , dbus
 , gnome3
-, libxml2
 , gtk-doc
 , docbook-xsl-nons
 , docbook_xml_dtd_42
 }:
-
+let
+  isCross = (stdenv.hostPlatform != stdenv.buildPlatform);
+in
 stdenv.mkDerivation rec {
   pname = "dconf";
   version = "0.38.0";
 
-  outputs = [ "out" "lib" "dev" "devdoc" ];
+  outputs = [ "out" "lib" "dev" ]
+    ++ lib.optional (!isCross) "devdoc";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0n2gqkp6d61h7gnnp2xnxp6w5wcl7w9ay58krrf729qd6d0hzxj5";
   };
 
   nativeBuildInputs = [
     meson
     ninja
-    vala
     pkg-config
     python3
     libxslt
-    libxml2
     glib
-    gtk-doc
     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=true"
-  ];
+    "-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;
 
@@ -66,7 +66,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://wiki.gnome.org/Projects/dconf";
     license = licenses.lgpl21Plus;
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/dee/default.nix b/nixpkgs/pkgs/development/libraries/dee/default.nix
index 594cac5002f6..3d46028ec438 100644
--- a/nixpkgs/pkgs/development/libraries/dee/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dee/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchgit
 , fetchpatch
-, pkgconfig
+, pkg-config
 , glib
 , icu
 , gobject-introspection
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
   ];
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     vala
     autoreconfHook
     gobject-introspection
@@ -57,7 +57,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/directfb/default.nix b/nixpkgs/pkgs/development/libraries/directfb/default.nix
index d333b7866655..1b0b50d28f00 100644
--- a/nixpkgs/pkgs/development/libraries/directfb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/directfb/default.nix
@@ -1,5 +1,5 @@
 { stdenv, lib, fetchFromGitHub, fetchpatch
-, autoreconfHook, perl, pkgconfig, flux, zlib
+, autoreconfHook, perl, pkg-config, flux, zlib
 , libjpeg, freetype, libpng, giflib
 , enableX11 ? true, xorg
 , enableSDL ? true, SDL }:
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  nativeBuildInputs = [ autoreconfHook perl pkgconfig flux ];
+  nativeBuildInputs = [ autoreconfHook perl pkg-config flux ];
 
   buildInputs = [ zlib libjpeg freetype giflib libpng ]
     ++ lib.optional enableSDL SDL
diff --git a/nixpkgs/pkgs/development/libraries/discord-rpc/default.nix b/nixpkgs/pkgs/development/libraries/discord-rpc/default.nix
index 3a8290a6597a..213096f5abf1 100644
--- a/nixpkgs/pkgs/development/libraries/discord-rpc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/discord-rpc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , rapidjson
@@ -23,14 +23,14 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     rapidjson
-  ] ++ stdenv.lib.optional stdenv.isDarwin AppKit;
+  ] ++ lib.optional stdenv.isDarwin AppKit;
 
   cmakeFlags = [
     "-DBUILD_SHARED_LIBS=true"
-    "-DBUILD_EXAMPLES=${stdenv.lib.boolToString buildExamples}"
+    "-DBUILD_EXAMPLES=${lib.boolToString buildExamples}"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Official library to interface with the Discord client";
     homepage = "https://github.com/discordapp/discord-rpc";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/dleyna-connector-dbus/default.nix b/nixpkgs/pkgs/development/libraries/dleyna-connector-dbus/default.nix
index ff81ab727328..a24e0b8d0144 100644
--- a/nixpkgs/pkgs/development/libraries/dleyna-connector-dbus/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dleyna-connector-dbus/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, autoreconfHook, pkgconfig, fetchFromGitHub, dbus, dleyna-core, glib }:
+{ lib, stdenv, autoreconfHook, pkg-config, fetchFromGitHub, dbus, dleyna-core, glib }:
 
 stdenv.mkDerivation rec {
   pname = "dleyna-connector-dbus";
@@ -11,10 +11,10 @@ stdenv.mkDerivation rec {
     sha256 = "0vziq5gwjm79yl2swch2mz6ias20nvfddf5cqgk9zbg25cb9m117";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ dbus dleyna-core glib ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A D-Bus API for the dLeyna services";
     homepage = "https://01.org/dleyna";
     maintainers = [ maintainers.jtojnar ];
diff --git a/nixpkgs/pkgs/development/libraries/dleyna-core/default.nix b/nixpkgs/pkgs/development/libraries/dleyna-core/default.nix
index 1f0a9bc7c597..4a4eecfdc0f2 100644
--- a/nixpkgs/pkgs/development/libraries/dleyna-core/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dleyna-core/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 , autoreconfHook
-, pkgconfig
+, pkg-config
 , gupnp
 }:
 
@@ -32,14 +32,14 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     autoreconfHook
-    pkgconfig
+    pkg-config
   ];
 
   propagatedBuildInputs = [
     gupnp
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library of utility functions that are used by the higher level dLeyna";
     homepage = "https://01.org/dleyna";
     maintainers = [ maintainers.jtojnar ];
diff --git a/nixpkgs/pkgs/development/libraries/dleyna-renderer/default.nix b/nixpkgs/pkgs/development/libraries/dleyna-renderer/default.nix
index 6b14bbc611a8..768af6a671a1 100644
--- a/nixpkgs/pkgs/development/libraries/dleyna-renderer/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dleyna-renderer/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook
-, pkgconfig
+, pkg-config
 , dleyna-connector-dbus
 , dleyna-core
 , gssdp
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     autoreconfHook
-    pkgconfig
+    pkg-config
     makeWrapper
   ];
 
@@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
       --set DLEYNA_CONNECTOR_PATH "$DLEYNA_CONNECTOR_PATH"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library to discover and manipulate Digital Media Renderers";
     homepage = "https://01.org/dleyna";
     maintainers = [ maintainers.jtojnar ];
diff --git a/nixpkgs/pkgs/development/libraries/dleyna-server/default.nix b/nixpkgs/pkgs/development/libraries/dleyna-server/default.nix
index 90c4df8e6413..a0a414abf748 100644
--- a/nixpkgs/pkgs/development/libraries/dleyna-server/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dleyna-server/default.nix
@@ -1,9 +1,9 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 , autoreconfHook
 , makeWrapper
-, pkgconfig
+, pkg-config
 , dleyna-core
 , dleyna-connector-dbus
 , gssdp
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     autoreconfHook
-    pkgconfig
+    pkg-config
     makeWrapper
   ];
 
@@ -54,7 +54,7 @@ stdenv.mkDerivation rec {
       --set DLEYNA_CONNECTOR_PATH "$DLEYNA_CONNECTOR_PATH"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library to discover, browse and manipulate Digital Media Servers";
     homepage = "https://01.org/dleyna";
     maintainers = [ maintainers.jtojnar ];
diff --git a/nixpkgs/pkgs/development/libraries/dlib/default.nix b/nixpkgs/pkgs/development/libraries/dlib/default.nix
index 43ac2530cc13..fa7d70d52131 100644
--- a/nixpkgs/pkgs/development/libraries/dlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dlib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig, libpng, libjpeg
+{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, libpng, libjpeg
 , guiSupport ? false, libX11
 
   # see http://dlib.net/compile.html
@@ -25,11 +25,10 @@ stdenv.mkDerivation rec {
     "-DUSE_DLIB_USE_CUDA=${if cudaSupport then "1" else "0"}"
     "-DUSE_AVX_INSTRUCTIONS=${if avxSupport then "yes" else "no"}" ];
 
-  enableParallelBuilding = true;
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
   buildInputs = [ libpng libjpeg ] ++ lib.optional guiSupport libX11;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A general purpose cross-platform C++ machine learning library";
     homepage = "http://www.dlib.net";
     license = licenses.boost;
diff --git a/nixpkgs/pkgs/development/libraries/docopt_cpp/default.nix b/nixpkgs/pkgs/development/libraries/docopt_cpp/default.nix
index 36b791ccc98c..f9456b8acac4 100644
--- a/nixpkgs/pkgs/development/libraries/docopt_cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/docopt_cpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, python }:
+{ lib, stdenv, fetchFromGitHub, cmake, python }:
 
 stdenv.mkDerivation rec {
   version = "0.6.3";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   checkPhase = "LD_LIBRARY_PATH=$(pwd) python ./run_tests";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++11 port of docopt";
     homepage = "https://github.com/docopt/docopt.cpp";
     license = with licenses; [ mit boost ];
diff --git a/nixpkgs/pkgs/development/libraries/doctest/default.nix b/nixpkgs/pkgs/development/libraries/doctest/default.nix
index d647d5f38880..702015e5d38f 100644
--- a/nixpkgs/pkgs/development/libraries/doctest/default.nix
+++ b/nixpkgs/pkgs/development/libraries/doctest/default.nix
@@ -1,21 +1,19 @@
-{ stdenv, fetchFromGitHub, installShellFiles, cmake }:
+{ lib, stdenv, fetchFromGitHub, installShellFiles, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "doctest";
-  version = "2.4.1";
+  version = "2.4.4";
 
   src = fetchFromGitHub {
     owner = "onqtam";
     repo = "doctest";
     rev = version;
-    sha256 = "17g7n6rjs90i0b231x5s934qnr8m80ga2yg1z344bnsdiqcjd63w";
+    hash = "sha256-NqXC5948prTCi4gsaR8bJPBTrmH+rJbHsGvwkJlpjXY=";
   };
 
   nativeBuildInputs = [ cmake ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  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.linux;
diff --git a/nixpkgs/pkgs/development/libraries/dotconf/default.nix b/nixpkgs/pkgs/development/libraries/dotconf/default.nix
index f6320a64374c..39d71eee432b 100644
--- a/nixpkgs/pkgs/development/libraries/dotconf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dotconf/default.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, stdenv, autoreconfHook }:
+{ fetchFromGitHub, lib, stdenv, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   name = "dotconf-" + version;
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoreconfHook ];
   buildInputs = [ ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A configuration parser library";
     maintainers = with maintainers; [ pSub ];
     homepage = "https://github.com/williamh/dotconf";
diff --git a/nixpkgs/pkgs/development/libraries/dotnetfx35/default.nix b/nixpkgs/pkgs/development/libraries/dotnetfx35/default.nix
index e1c59846aec5..68569b516a9b 100644
--- a/nixpkgs/pkgs/development/libraries/dotnetfx35/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dotnetfx35/default.nix
@@ -12,12 +12,12 @@ in
       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
index 701464071d03..1ffc10cfc605 100644
--- a/nixpkgs/pkgs/development/libraries/dotnetfx40/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dotnetfx40/default.nix
@@ -12,12 +12,12 @@ in
       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
index ecd5ee67cf64..2bdcc3c8a997 100644
--- a/nixpkgs/pkgs/development/libraries/double-conversion/default.nix
+++ b/nixpkgs/pkgs/development/libraries/double-conversion/default.nix
@@ -20,9 +20,7 @@ stdenv.mkDerivation rec {
     rm BUILD
   '';
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Binary-decimal and decimal-binary routines for IEEE doubles";
     homepage = "https://github.com/google/double-conversion";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/dqlite/default.nix b/nixpkgs/pkgs/development/libraries/dqlite/default.nix
index 49435ec67184..8f67259989b8 100644
--- a/nixpkgs/pkgs/development/libraries/dqlite/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dqlite/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, file, libco-canonical
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, file, libco-canonical
 , libuv, raft-canonical, sqlite-replication }:
 
 stdenv.mkDerivation rec {
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "0h7ypigj1b6xbspzc35y89jkp84v8rqiv9qgkyqlqylr7mcw952a";
   };
 
-  nativeBuildInputs = [ autoreconfHook file pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook file pkg-config ];
   buildInputs = [
     libco-canonical.dev
     libuv
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "dev" "out" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = ''
       Expose a SQLite database over the network and replicate it across a
       cluster of peers
diff --git a/nixpkgs/pkgs/development/libraries/draco/default.nix b/nixpkgs/pkgs/development/libraries/draco/default.nix
index 317742f07b3d..41ffdd16f5a9 100644
--- a/nixpkgs/pkgs/development/libraries/draco/default.nix
+++ b/nixpkgs/pkgs/development/libraries/draco/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake
+{ lib, stdenv, fetchFromGitHub, cmake
 }:
 
 stdenv.mkDerivation rec {
@@ -12,8 +12,6 @@ stdenv.mkDerivation rec {
     sha256 = "14ln4la52x38pf8syr7i5v4vd65ya4zij8zj5kgihah03cih0qcd";
   };
 
-  enableParallelBuilding = true;
-
   nativeBuildInputs = [ cmake ];
 
   cmakeFlags = [
@@ -24,7 +22,7 @@ stdenv.mkDerivation rec {
     "-DBUILD_UNITY_PLUGIN=1"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for compressing and decompressing 3D geometric meshes and point clouds";
     homepage = "https://google.github.io/draco/";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/drumstick/default.nix b/nixpkgs/pkgs/development/libraries/drumstick/default.nix
index 5cef17f11196..21572e52e235 100644
--- a/nixpkgs/pkgs/development/libraries/drumstick/default.nix
+++ b/nixpkgs/pkgs/development/libraries/drumstick/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , cmake, docbook_xml_dtd_45, docbook_xsl, doxygen, pkg-config, wrapQtAppsHook
 , alsaLib, fluidsynth, qtbase, qtsvg, libpulseaudio
 }:
@@ -23,8 +23,6 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "man" ];
 
-  enableParallelBuilding = true;
-
   nativeBuildInputs = [
     cmake docbook_xml_dtd_45 docbook_xml_dtd_45 docbook_xsl doxygen pkg-config wrapQtAppsHook
   ];
@@ -33,7 +31,7 @@ stdenv.mkDerivation rec {
     alsaLib fluidsynth libpulseaudio qtbase qtsvg
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     maintainers = with maintainers; [ solson ];
     description = "MIDI libraries for Qt5/C++";
     homepage = "http://drumstick.sourceforge.net/";
diff --git a/nixpkgs/pkgs/development/libraries/dssi/default.nix b/nixpkgs/pkgs/development/libraries/dssi/default.nix
index 779e6b077625..9ce487b1b03a 100644
--- a/nixpkgs/pkgs/development/libraries/dssi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dssi/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, ladspaH, libjack2, liblo, alsaLib, qt4, libX11, libsndfile, libSM
-, libsamplerate, libtool, autoconf, automake, xorgproto, libICE, pkgconfig
+{ lib, stdenv, fetchurl, ladspaH, libjack2, liblo, alsaLib, qt4, libX11, libsndfile, libSM
+, libsamplerate, libtool, autoconf, automake, xorgproto, libICE, pkg-config
 }:
 
 stdenv.mkDerivation rec {
@@ -13,10 +13,10 @@ stdenv.mkDerivation rec {
 
   buildInputs =
     [ ladspaH libjack2 liblo alsaLib qt4 libX11 libsndfile libSM
-      libsamplerate libtool autoconf automake xorgproto libICE pkgconfig
+      libsamplerate libtool autoconf automake xorgproto libICE pkg-config
     ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A plugin SDK for virtual instruments";
     maintainers = with maintainers;
     [
diff --git a/nixpkgs/pkgs/development/libraries/duckdb/default.nix b/nixpkgs/pkgs/development/libraries/duckdb/default.nix
index 1aedee5c3b68..60ccf5aeeb23 100644
--- a/nixpkgs/pkgs/development/libraries/duckdb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/duckdb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 }:
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/cwida/duckdb";
     description = "Embeddable SQL OLAP Database Management System";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/dxflib/default.nix b/nixpkgs/pkgs/development/libraries/dxflib/default.nix
index 1b63d8805fd9..b2cd97398c61 100644
--- a/nixpkgs/pkgs/development/libraries/dxflib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dxflib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , qmake
 }:
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     cp -pr *.so* $out/lib
     install -d -m 0755 $out/include/dxflib
     cp -pr src/*.h $out/include/dxflib
-    # Generate pkgconfig file
+    # Generate pkg-config file
     install -d -m 0755 $out/lib/pkgconfig
     cat << 'EOF' > $out/lib/pkgconfig/dxflib.pc
     prefix=${placeholder "out"}
@@ -37,8 +37,8 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   meta = {
-    maintainers = with stdenv.lib.maintainers; [raskin];
-    platforms = stdenv.lib.platforms.linux;
-    description = ''DXF file format library'';
+    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
index e792fe1e0519..0e3fa3ac7dc0 100644
--- a/nixpkgs/pkgs/development/libraries/dyncall/default.nix
+++ b/nixpkgs/pkgs/development/libraries/dyncall/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   pname = "dyncall";
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
     install -D -t $out/share/man/man3 ./*/*.3
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Highly dynamic multi-platform foreign function call interface library";
     homepage = "https://www.dyncall.org";
     license = licenses.isc;
diff --git a/nixpkgs/pkgs/development/libraries/easyloggingpp/default.nix b/nixpkgs/pkgs/development/libraries/easyloggingpp/default.nix
index 29fdd0689593..ad582d933059 100644
--- a/nixpkgs/pkgs/development/libraries/easyloggingpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/easyloggingpp/default.nix
@@ -1,22 +1,22 @@
 # 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)
-{ stdenv, fetchFromGitHub, cmake, gtest }:
+{ lib, stdenv, fetchFromGitHub, cmake, gtest }:
 stdenv.mkDerivation rec {
   pname = "easyloggingpp";
-  version = "9.96.7";
+  version = "9.97.0";
   src = fetchFromGitHub {
     owner = "muflihun";
     repo = "easyloggingpp";
     rev = "v${version}";
-    sha256 = "0nhszn0yyjwpnv7swm4vqs3i7admgbnifi5dvq5h01fk5nc8yjqz";
+    sha256 = "sha256-sFWmZMnucMuvpwDzuowni21KiD3bx0lH1Ts+yhusOYs=";
   };
 
   nativeBuildInputs = [cmake];
   buildInputs = [gtest];
   cmakeFlags = [ "-Dtest=ON" ];
   NIX_CFLAGS_COMPILE = "-std=c++11" +
-    stdenv.lib.optionalString stdenv.isLinux " -pthread";
+    lib.optionalString stdenv.isLinux " -pthread";
   postInstall = ''
     mkdir -p $out/include
     cp ../src/easylogging++.cc $out/include
@@ -24,8 +24,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "C++ logging library";
     homepage = "https://muflihun.github.io/easyloggingpp/";
-    license = stdenv.lib.licenses.mit;
-    maintainers = with stdenv.lib.maintainers; [acowley];
-    platforms = stdenv.lib.platforms.all;
+    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
index e3bed6186302..1050490a220b 100644
--- a/nixpkgs/pkgs/development/libraries/eccodes/default.nix
+++ b/nixpkgs/pkgs/development/libraries/eccodes/default.nix
@@ -1,9 +1,9 @@
-{ fetchurl, stdenv
+{ fetchurl, lib, stdenv
 , cmake, netcdf, openjpeg, libpng, gfortran
 , enablePython ? false, pythonPackages
 , enablePosixThreads ? false
 , enableOpenMPThreads ? false}:
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "eccodes";
   version = "2.12.5";
@@ -35,12 +35,10 @@ stdenv.mkDerivation rec {
                  "-DENABLE_ECCODES_OMP_THREADS=${if enableOpenMPThreads then "ON" else "OFF"}"
                ];
 
-  enableParallelBuilding = true;
-
   doCheck = true;
 
   # Only do tests that don't require downloading 120MB of testdata
-  checkPhase = stdenv.lib.optionalString (stdenv.isDarwin) ''
+  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
diff --git a/nixpkgs/pkgs/development/libraries/eclib/default.nix b/nixpkgs/pkgs/development/libraries/eclib/default.nix
index 9273fb7fd78e..4709441a1011 100644
--- a/nixpkgs/pkgs/development/libraries/eclib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/eclib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook
 , pari
@@ -29,16 +29,16 @@ stdenv.mkDerivation rec {
     pari
     ntl
     gmp
-  ] ++ stdenv.lib.optionals withFlint [
+  ] ++ lib.optionals withFlint [
     flint
   ];
   nativeBuildInputs = [
     autoreconfHook
   ];
   doCheck = true;
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit version;
-    description = ''Elliptic curve tools'';
+    description = "Elliptic curve tools";
     homepage = "https://github.com/JohnCremona/eclib";
     license = licenses.gpl2Plus;
     maintainers = teams.sage.members;
diff --git a/nixpkgs/pkgs/development/libraries/editline/default.nix b/nixpkgs/pkgs/development/libraries/editline/default.nix
index 549ef7c56bda..82f65082b946 100644
--- a/nixpkgs/pkgs/development/libraries/editline/default.nix
+++ b/nixpkgs/pkgs/development/libraries/editline/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, fetchpatch }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "editline";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "man" "doc" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://troglobit.com/editline.html";
     description = "A readline() replacement for UNIX without termcap (ncurses)";
     license = licenses.bsdOriginal;
diff --git a/nixpkgs/pkgs/development/libraries/egl-wayland/default.nix b/nixpkgs/pkgs/development/libraries/egl-wayland/default.nix
index 1509db1b80de..be22e24044d6 100644
--- a/nixpkgs/pkgs/development/libraries/egl-wayland/default.nix
+++ b/nixpkgs/pkgs/development/libraries/egl-wayland/default.nix
@@ -1,7 +1,7 @@
 { lib
 , stdenv
 , fetchFromGitHub
-, pkgconfig
+, pkg-config
 , meson
 , ninja
 , libX11
@@ -58,7 +58,7 @@ in stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
   ];
 
   buildInputs = [
diff --git a/nixpkgs/pkgs/development/libraries/eigen/2.0.nix b/nixpkgs/pkgs/development/libraries/eigen/2.0.nix
index d15275719437..a2b1ba47e2d0 100644
--- a/nixpkgs/pkgs/development/libraries/eigen/2.0.nix
+++ b/nixpkgs/pkgs/development/libraries/eigen/2.0.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, cmake }:
+{ lib, stdenv, fetchFromGitLab, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "eigen";
@@ -13,12 +13,12 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ template library for linear algebra: vectors, matrices, and related algorithms";
     license = licenses.lgpl3Plus;
     homepage = "https://eigen.tuxfamily.org";
-    maintainers = with stdenv.lib.maintainers; [ sander raskin ];
+    maintainers = with lib.maintainers; [ sander raskin ];
     branch = "2";
-    platforms = with stdenv.lib.platforms; unix;
+    platforms = with lib.platforms; unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/eigen/default.nix b/nixpkgs/pkgs/development/libraries/eigen/default.nix
index 3c6a5cc1ca65..079269521c76 100644
--- a/nixpkgs/pkgs/development/libraries/eigen/default.nix
+++ b/nixpkgs/pkgs/development/libraries/eigen/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, cmake }:
+{ lib, stdenv, fetchFromGitLab, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "eigen";
@@ -17,12 +17,12 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ template library for linear algebra: vectors, matrices, and related algorithms";
     license = licenses.lgpl3Plus;
     homepage = "https://eigen.tuxfamily.org";
     platforms = platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ sander raskin ];
+    maintainers = with lib.maintainers; [ sander raskin ];
     inherit version;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/elementary-cmake-modules/default.nix b/nixpkgs/pkgs/development/libraries/elementary-cmake-modules/default.nix
index 1fbe6f8893bf..9f340545584f 100644
--- a/nixpkgs/pkgs/development/libraries/elementary-cmake-modules/default.nix
+++ b/nixpkgs/pkgs/development/libraries/elementary-cmake-modules/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig }:
+{ stdenv, lib, fetchFromGitHub, cmake, pkg-config }:
 
 stdenv.mkDerivation {
   pname = "elementary-cmake-modules";
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
       --replace ' ''${CMAKE_ROOT}/Modules' " $out/lib/cmake"
   '';
 
-  propagatedBuildInputs = [ cmake pkgconfig ];
+  propagatedBuildInputs = [ cmake pkg-config ];
 
   setupHook = ./setup-hook.sh;
 
diff --git a/nixpkgs/pkgs/development/libraries/elf-header/default.nix b/nixpkgs/pkgs/development/libraries/elf-header/default.nix
index c1764e83c303..72166bb38ce9 100644
--- a/nixpkgs/pkgs/development/libraries/elf-header/default.nix
+++ b/nixpkgs/pkgs/development/libraries/elf-header/default.nix
@@ -35,9 +35,9 @@ stdenvNoCC.mkDerivation {
     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.
-	'';
+      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
index d8e102a0d40b..12d4e2a87ccd 100644
--- a/nixpkgs/pkgs/development/libraries/embree/2.x.nix
+++ b/nixpkgs/pkgs/development/libraries/embree/2.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig, ispc, tbb, glfw,
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, ispc, tbb, glfw,
 openimageio, libjpeg, libpng, libpthreadstubs, libX11
 }:
 
@@ -14,11 +14,11 @@ stdenv.mkDerivation {
   };
 
   cmakeFlags = [ "-DEMBREE_TUTORIALS=OFF" ];
-  enableParallelBuilding = true;
-  
-  buildInputs = [ pkgconfig cmake ispc tbb glfw openimageio libjpeg libpng libX11 libpthreadstubs ];
-  meta = with stdenv.lib; {
-    description = "High performance ray tracing kernels from Intel"; 
+
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/embree/default.nix b/nixpkgs/pkgs/development/libraries/embree/default.nix
index 650c1d4ce497..5dee84d10070 100644
--- a/nixpkgs/pkgs/development/libraries/embree/default.nix
+++ b/nixpkgs/pkgs/development/libraries/embree/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig, ispc, tbb, glfw,
+{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, ispc, tbb, glfw,
   openimageio, libjpeg, libpng, libpthreadstubs, libX11, glib }:
 
 stdenv.mkDerivation rec {
@@ -27,11 +27,11 @@ stdenv.mkDerivation rec {
   ];
 
 
-  nativeBuildInputs = [ ispc pkgconfig cmake ];
+  nativeBuildInputs = [ ispc pkg-config cmake ];
   buildInputs = [ tbb glfw openimageio libjpeg libpng libX11 libpthreadstubs ]
                 ++ lib.optionals stdenv.isDarwin [ glib ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "High performance ray tracing kernels from Intel";
     homepage = "https://embree.github.io/";
     maintainers = with maintainers; [ hodapp gebner ];
diff --git a/nixpkgs/pkgs/development/libraries/enchant/1.x.nix b/nixpkgs/pkgs/development/libraries/enchant/1.x.nix
index 0b7b4c9c8b17..172d6747aa1c 100644
--- a/nixpkgs/pkgs/development/libraries/enchant/1.x.nix
+++ b/nixpkgs/pkgs/development/libraries/enchant/1.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, aspell, pkgconfig, glib, hunspell, hspell }:
+{ lib, stdenv, fetchurl, aspell, pkg-config, glib, hunspell, hspell }:
 
 stdenv.mkDerivation rec {
   version = "1.6.1";
@@ -9,10 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "1xg3m7mniyqyff8qv46jbfwgchb6di6qxdjnd5sfir7jzv0dkw5y";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ aspell glib hunspell hspell ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Generic spell checking library";
     homepage = "https://abiword.github.io/enchant";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/enchant/2.x.nix b/nixpkgs/pkgs/development/libraries/enchant/2.x.nix
index 02215a30418b..184d5dcc0517 100644
--- a/nixpkgs/pkgs/development/libraries/enchant/2.x.nix
+++ b/nixpkgs/pkgs/development/libraries/enchant/2.x.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , aspell
 , pkg-config
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
     "--enable-relocatable" # needed for tests
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Generic spell checking library";
     homepage = "https://abiword.github.io/enchant/";
     license = licenses.lgpl21Plus; # with extra provision for non-free checkers
diff --git a/nixpkgs/pkgs/development/libraries/enet/default.nix b/nixpkgs/pkgs/development/libraries/enet/default.nix
index 61b8c1be4f2b..ef252ad19f6d 100644
--- a/nixpkgs/pkgs/development/libraries/enet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/enet/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   name = "enet-1.3.17";
@@ -11,8 +11,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://enet.bespin.org/";
     description = "Simple and robust network communication layer on top of UDP";
-    license = stdenv.lib.licenses.mit;
-    maintainers = with stdenv.lib.maintainers; [ ];
-    platforms = stdenv.lib.platforms.unix;
+    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
index 35e12eb00c7b..955dd2eeb369 100644
--- a/nixpkgs/pkgs/development/libraries/entt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/entt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 stdenv.mkDerivation rec {
   pname = "entt";
   version = "3.5.2";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/epoxy/default.nix b/nixpkgs/pkgs/development/libraries/epoxy/default.nix
index 15e634fe4b5b..7ae0e73953f4 100644
--- a/nixpkgs/pkgs/development/libraries/epoxy/default.nix
+++ b/nixpkgs/pkgs/development/libraries/epoxy/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, utilmacros, python3
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, utilmacros, python3
 , libGL, libX11
 }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "epoxy";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig utilmacros python3 ];
+  nativeBuildInputs = [ autoreconfHook pkg-config utilmacros python3 ];
   buildInputs = [ libGL libX11 ];
 
   preConfigure = optionalString stdenv.isDarwin ''
diff --git a/nixpkgs/pkgs/development/libraries/ethash/default.nix b/nixpkgs/pkgs/development/libraries/ethash/default.nix
index 05abb1f2aa51..0a10fa3c48c1 100644
--- a/nixpkgs/pkgs/development/libraries/ethash/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ethash/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchFromGitHub, cmake, gbenchmark, gtest }:
+{ lib, stdenv, fetchFromGitHub, cmake, gbenchmark, gtest }:
 
 stdenv.mkDerivation rec {
   pname = "ethash";
-  version = "0.5.2";
+  version = "0.6.0";
 
   src =
     fetchFromGitHub {
       owner = "chfast";
       repo = "ethash";
       rev = "v${version}";
-      sha256 = "0shr3m33raxy9j2mpm3q9mdbchs3nhgfaywidyxgmwqaiw1xpyif";
+      sha256 = "sha256-N30v9OZwTmDbltPPmeSa0uOGJhos1VzyS5zY9vVCWfA=";
     };
 
   nativeBuildInputs = [
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
     #"-DCMAKE_PREFIX_PATH=${gtest.dev}/lib/cmake"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "PoW algorithm for Ethereum 1.0 based on Dagger-Hashimoto";
     homepage = "https://github.com/ethereum/ethash";
     platforms = [ "x86_64-linux" ];
diff --git a/nixpkgs/pkgs/development/libraries/eventlog/default.nix b/nixpkgs/pkgs/development/libraries/eventlog/default.nix
index d80fdb2213d5..ca460aa71f6b 100644
--- a/nixpkgs/pkgs/development/libraries/eventlog/default.nix
+++ b/nixpkgs/pkgs/development/libraries/eventlog/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   name = "eventlog-0.2.12";
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
       combination of description and tag/value pairs.
     '';
     homepage = "https://www.balabit.com/support/community/products/";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/exempi/default.nix b/nixpkgs/pkgs/development/libraries/exempi/default.nix
index 5638db712451..356959b429f2 100644
--- a/nixpkgs/pkgs/development/libraries/exempi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/exempi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, expat, zlib, boost, libiconv, darwin }:
+{ lib, stdenv, fetchurl, fetchpatch, expat, zlib, boost, libiconv, darwin }:
 
 stdenv.mkDerivation rec {
   pname = "exempi";
@@ -14,11 +14,11 @@ stdenv.mkDerivation rec {
   ];
 
   buildInputs = [ expat zlib boost ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv darwin.apple_sdk.frameworks.CoreServices ];
+    ++ lib.optionals stdenv.isDarwin [ libiconv darwin.apple_sdk.frameworks.CoreServices ];
 
   doCheck = stdenv.isLinux;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/exiv2/default.nix b/nixpkgs/pkgs/development/libraries/exiv2/default.nix
index a845e8998e78..9d29afd69279 100644
--- a/nixpkgs/pkgs/development/libraries/exiv2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/exiv2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 , zlib
@@ -85,13 +85,13 @@ stdenv.mkDerivation rec {
     patchShebangs ../test/
     mkdir ../test/tmp
 
-    ${stdenv.lib.optionalString (stdenv.isAarch64 || stdenv.isAarch32) ''
+    ${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
     ''}
 
-    ${stdenv.lib.optionalString stdenv.isDarwin ''
+    ${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" ""
@@ -111,7 +111,7 @@ stdenv.mkDerivation rec {
     )
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.exiv2.org/";
     description = "A library and command-line utility to manage image metadata";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/exosip/default.nix b/nixpkgs/pkgs/development/libraries/exosip/default.nix
index 4968c38bfd33..f40dea19bb9d 100644
--- a/nixpkgs/pkgs/development/libraries/exosip/default.nix
+++ b/nixpkgs/pkgs/development/libraries/exosip/default.nix
@@ -1,25 +1,18 @@
-{ stdenv, fetchurl, libosip, openssl, pkgconfig, fetchpatch }:
+{ lib, stdenv, fetchurl, libosip, openssl, pkg-config }:
 
 stdenv.mkDerivation rec {
  pname = "libexosip2";
- version = "4.1.0";
+ version = "5.2.0";
 
  src = fetchurl {
-    url = "mirror://savannah/exosip/libeXosip2-${version}.tar.gz";
-    sha256 = "17cna8kpc8nk1si419vgr6r42k2lda0rdk50vlxrw8rzg0xp2xrw";
+    url = "mirror://savannah/exosip/${pname}-${version}.tar.gz";
+    sha256 = "09bj7cm6mk8yr68y5a09a625x10ql6an3zi4pj6y1jbkhpgqibp3";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libosip openssl ];
 
-  patches = [
-    (fetchpatch {
-      url = "https://sources.debian.net/data/main/libe/libexosip2/4.1.0-2.1/debian/patches/openssl110.patch";
-      sha256 = "01q2dax7pwh197mn18r22y38mrsky85mvs9vbkn9fpcilrdayal6";
-    })
-  ];
-
-  meta = with stdenv.lib; {
+  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
index 29d2c2b3acb9..ba9fb2b177de 100644
--- a/nixpkgs/pkgs/development/libraries/expat/default.nix
+++ b/nixpkgs/pkgs/development/libraries/expat/default.nix
@@ -18,7 +18,7 @@ in stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ]; # TODO: fix referrers
   outputBin = "dev";
 
-  configureFlags = stdenv.lib.optional stdenv.isFreeBSD "--with-pic";
+  configureFlags = lib.optional stdenv.isFreeBSD "--with-pic";
 
   outputMan = "dev"; # tiny page for a dev tool
 
@@ -29,7 +29,7 @@ in stdenv.mkDerivation rec {
     patchShebangs ./test-driver-wrapper.sh
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.libexpat.org/";
     description = "A stream-oriented XML parser library written in C";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/faac/default.nix b/nixpkgs/pkgs/development/libraries/faac/default.nix
index b2c4d3741e18..dbc56572d537 100644
--- a/nixpkgs/pkgs/development/libraries/faac/default.nix
+++ b/nixpkgs/pkgs/development/libraries/faac/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, autoreconfHook
+{ lib, stdenv, fetchurl, autoreconfHook
 , mp4v2Support ? true, mp4v2 ? null
 , drmSupport ? false # Digital Radio Mondiale
 }:
 
 assert mp4v2Support -> (mp4v2 != null);
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "faac";
   version = "1.30";
diff --git a/nixpkgs/pkgs/development/libraries/faad2/default.nix b/nixpkgs/pkgs/development/libraries/faad2/default.nix
index 90b1a182e553..0afef1c9fd82 100644
--- a/nixpkgs/pkgs/development/libraries/faad2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/faad2/default.nix
@@ -1,8 +1,8 @@
-{stdenv, fetchFromGitHub, autoreconfHook
+{lib, stdenv, fetchFromGitHub, autoreconfHook
 , drmSupport ? false # Digital Radio Mondiale
 }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "faad2";
   version = "2.10.0";
diff --git a/nixpkgs/pkgs/development/libraries/farbfeld/default.nix b/nixpkgs/pkgs/development/libraries/farbfeld/default.nix
index a528ad6f7f61..9473d09ffc55 100644
--- a/nixpkgs/pkgs/development/libraries/farbfeld/default.nix
+++ b/nixpkgs/pkgs/development/libraries/farbfeld/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, makeWrapper, file, libpng, libjpeg }:
+{ lib, stdenv, fetchgit, makeWrapper, file, libpng, libjpeg }:
 
 stdenv.mkDerivation rec {
   pname = "farbfeld";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     wrapProgram "$out/bin/2ff" --prefix PATH : "${file}/bin"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Suckless image format with conversion tools";
     license = licenses.isc;
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/farstream/default.nix b/nixpkgs/pkgs/development/libraries/farstream/default.nix
index 0ce0f56d710e..b046b7aef737 100644
--- a/nixpkgs/pkgs/development/libraries/farstream/default.nix
+++ b/nixpkgs/pkgs/development/libraries/farstream/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
 , libnice
-, pkgconfig
+, pkg-config
 , autoreconfHook
 , gstreamer
 , gst-plugins-base
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
   ];
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     autoreconfHook
     gobject-introspection
   ];
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
     gst-libav
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.freedesktop.org/wiki/Software/Farstream";
     description = "Audio/Video Communications Framework formely known as farsight";
     platforms = platforms.linux;
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
index f1bd647b06d8..c56e05e07532 100644
--- a/nixpkgs/pkgs/development/libraries/fastjson/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fastjson/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, libtool, autoconf, automake }:
+{ lib, stdenv, fetchFromGitHub, libtool, autoconf, automake }:
 
 stdenv.mkDerivation rec {
   version = "0.99.8";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     sh autogen.sh
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A fast json library for C";
     homepage = "https://github.com/rsyslog/libfastjson";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/fastpbkdf2/default.nix b/nixpkgs/pkgs/development/libraries/fastpbkdf2/default.nix
index 59056a9b9a37..ac90001fc397 100644
--- a/nixpkgs/pkgs/development/libraries/fastpbkdf2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fastpbkdf2/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchFromGitHub, openssl }:
+{ lib, stdenv, fetchFromGitHub, openssl }:
 
 stdenv.mkDerivation {
   name = "fastpbkdf2-1.0.0";
-  
+
   src = fetchFromGitHub {
     owner = "ctz";
     repo = "fastpbkdf2";
     rev = "v1.0.0";
     sha256 = "09ax0h4ik3vhvp3s98lic93l3g9f4v1jkr5k6z4g1lvm7s3lrha2";
   };
-  
+
   buildInputs = [ openssl ];
 
   preBuild = ''
@@ -22,7 +22,7 @@ stdenv.mkDerivation {
     cp fastpbkdf2.h $out/include/fastpbkdf2
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A fast PBKDF2-HMAC-{SHA1,SHA256,SHA512} implementation in C";
     homepage = "https://github.com/ctz/fastpbkdf2";
     license = licenses.cc0;
diff --git a/nixpkgs/pkgs/development/libraries/faudio/default.nix b/nixpkgs/pkgs/development/libraries/faudio/default.nix
index 02544d74782e..c030f53df26c 100644
--- a/nixpkgs/pkgs/development/libraries/faudio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/faudio/default.nix
@@ -1,23 +1,23 @@
-{ stdenv, fetchFromGitHub, cmake, SDL2}:
+{ lib, stdenv, fetchFromGitHub, cmake, SDL2}:
 
 #TODO: tests
 
 stdenv.mkDerivation rec {
   pname = "faudio";
-  version = "20.12";
+  version = "21.01";
 
   src = fetchFromGitHub {
     owner = "FNA-XNA";
     repo = "FAudio";
     rev = version;
-    sha256 = "1iwfsfbd2ji7lkk5fh0wla287gph0sadlf0pz2j0vyddpkvr0xgx";
+    sha256 = "sha256-D7nlwQnz2JPRB3JrrkyUcaaf4Ro/+Ap8sqq5Oz8naHw=";
   };
 
   nativeBuildInputs = [cmake];
 
   buildInputs = [ SDL2 ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/fcft/default.nix b/nixpkgs/pkgs/development/libraries/fcft/default.nix
index 1ce09b63cbed..fd6f26c9789f 100644
--- a/nixpkgs/pkgs/development/libraries/fcft/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fcft/default.nix
@@ -1,21 +1,28 @@
 { stdenv, lib, fetchgit, pkg-config, meson, ninja, scdoc
-,freetype, fontconfig, harfbuzz, pixman, tllist, check }:
+, freetype, fontconfig, pixman, tllist, check
+, withHarfBuzz ? true
+, harfbuzz
+}:
 
 stdenv.mkDerivation rec {
   pname = "fcft";
-  version = "2.3.1";
+  version = "2.3.2";
 
   src = fetchgit {
     url = "https://codeberg.org/dnkl/fcft.git";
     rev = version;
-    sha256 = "sha256-FD3KfaQbSEA1XdmS6YxH+c5fSsra9Ro/KKslb7Brv7U=";
+    sha256 = "0k2i57rakm4g86f7hbhkby8af0vv7v63a70lk3m58mkycpy5q2rm";
   };
 
   nativeBuildInputs = [ pkg-config meson ninja scdoc ];
-  buildInputs = [ freetype fontconfig pixman tllist harfbuzz ];
+  buildInputs = [ freetype fontconfig pixman tllist ]
+    ++ lib.optional withHarfBuzz harfbuzz;
   checkInputs = [ check ];
 
-  mesonFlags = [ "--buildtype=release" ];
+  mesonFlags = [
+    "--buildtype=release"
+    "-Dtext-shaping=${if withHarfBuzz then "enabled" else "disabled"}"
+  ];
 
   doCheck = true;
 
diff --git a/nixpkgs/pkgs/development/libraries/fcgi/default.nix b/nixpkgs/pkgs/development/libraries/fcgi/default.nix
index bde1682e3fc0..1ec666a920c3 100644
--- a/nixpkgs/pkgs/development/libraries/fcgi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fcgi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "fcgi";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   postInstall = "ln -s . $out/include/fastcgi";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A language independent, scalable, open extension to CG";
     homepage = "http://www.fastcgi.com/";
     license = "FastCGI see LICENSE.TERMS";
diff --git a/nixpkgs/pkgs/development/libraries/fcppt/default.nix b/nixpkgs/pkgs/development/libraries/fcppt/default.nix
index 22d3bd889e11..380fdcce29f3 100644
--- a/nixpkgs/pkgs/development/libraries/fcppt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fcppt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, boost, catch2, metal }:
+{ lib, stdenv, fetchFromGitHub, cmake, boost, catch2, metal }:
 stdenv.mkDerivation rec {
   pname = "fcppt";
   version = "3.5.0";
@@ -15,9 +15,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [ "-DCMAKE_SKIP_BUILD_RPATH=false" "-DENABLE_BOOST=true" "-DENABLE_EXAMPLES=true" "-DENABLE_CATCH=true" "-DENABLE_TEST=true" ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Freundlich's C++ toolkit";
     longDescription = ''
       Freundlich's C++ Toolkit (fcppt) is a collection of libraries focusing on
diff --git a/nixpkgs/pkgs/development/libraries/fdk-aac/default.nix b/nixpkgs/pkgs/development/libraries/fdk-aac/default.nix
index 53967381570d..dc64a6edce04 100644
--- a/nixpkgs/pkgs/development/libraries/fdk-aac/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fdk-aac/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , exampleSupport ? false # Example encoding program
 }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "fdk-aac";
   version = "2.0.1";
diff --git a/nixpkgs/pkgs/development/libraries/fflas-ffpack/default.nix b/nixpkgs/pkgs/development/libraries/fflas-ffpack/default.nix
index faa8ed3c70e4..fd7d89a88311 100644
--- a/nixpkgs/pkgs/development/libraries/fflas-ffpack/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fflas-ffpack/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, givaro, pkgconfig, blas, lapack
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, givaro, pkg-config, blas, lapack
 , gmpxx
 }:
 
@@ -23,15 +23,15 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     autoreconfHook
-    pkgconfig
-  ] ++ stdenv.lib.optionals doCheck checkInputs;
+    pkg-config
+  ] ++ lib.optionals doCheck checkInputs;
 
   buildInputs = [ givaro blas lapack ];
 
   configureFlags = [
     "--with-blas-libs=-lcblas"
     "--with-lapack-libs=-llapacke"
-  ] ++ stdenv.lib.optionals stdenv.isx86_64 [
+  ] ++ 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"
@@ -48,9 +48,9 @@ stdenv.mkDerivation rec {
   ];
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit version;
-    description = ''Finite Field Linear Algebra Subroutines'';
+    description = "Finite Field Linear Algebra Subroutines";
     license = licenses.lgpl21Plus;
     maintainers = teams.sage.members;
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/ffmpeg-full/default.nix b/nixpkgs/pkgs/development/libraries/ffmpeg-full/default.nix
index a2f5e366e008..916ea2772e19 100644
--- a/nixpkgs/pkgs/development/libraries/ffmpeg-full/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ffmpeg-full/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, ffmpeg, addOpenGLRunpath, fetchurl, fetchpatch, pkgconfig, perl, texinfo, yasm
+{ lib, stdenv, ffmpeg, addOpenGLRunpath, fetchurl, fetchpatch, pkg-config, perl, texinfo, yasm
 /*
  *  Licensing options (yes some are listed twice, filters and such are not listed)
  */
@@ -111,6 +111,7 @@
 , 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
@@ -183,7 +184,7 @@
 
 let
   inherit (stdenv) isCygwin isDarwin isFreeBSD isLinux isAarch64;
-  inherit (stdenv.lib) optional optionals optionalString enableFeature;
+  inherit (lib) optional optionals optionalString enableFeature;
 in
 
 /*
@@ -250,13 +251,18 @@ stdenv.mkDerivation rec {
       sha256 = "sha256-dqpmpDFETTuWHWolMoLaubU4BeDEuQaBNA0wmzL1f8o=";
       name = "fix_libsrt.patch";
     })
+    # Patch ffmpeg for svt-av1 until version 4.4
+    (fetchpatch {
+      url = "https://raw.githubusercontent.com/AOMediaCodec/SVT-AV1/v0.8.4/ffmpeg_plugin/0001-Add-ability-for-ffmpeg-to-run-svt-av1.patch";
+      sha256 = "1p4g8skr5gjw5h1648j7qrks81zx49lrnx9g0p81qgnrvxc2wwx0";
+    })
   ];
 
   prePatch = ''
     patchShebangs .
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     sed -i 's/#ifndef __MAC_10_11/#if 1/' ./libavcodec/audiotoolboxdec.c
-  '' + stdenv.lib.optionalString (frei0r != null) ''
+  '' + lib.optionalString (frei0r != null) ''
     substituteInPlace libavfilter/vf_frei0r.c \
       --replace /usr/local/lib/frei0r-1 ${frei0r}/lib/frei0r-1
     substituteInPlace doc/filters.texi \
@@ -393,6 +399,7 @@ stdenv.mkDerivation rec {
     (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")
@@ -423,13 +430,13 @@ stdenv.mkDerivation rec {
     "--enable-cross-compile"
   ];
 
-  nativeBuildInputs = [ addOpenGLRunpath perl pkgconfig texinfo yasm ];
+  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 lzma openal openjpeg libpulseaudio rav1e rtmpdump opencore-amr
+    libxcb libXv libXext lzma openal openjpeg libpulseaudio rav1e svt-av1 rtmpdump opencore-amr
     samba SDL2 soxr speex srt vid-stab vo-amrwbenc wavpack x264 x265 xavs xvidcore
     zeromq4 zlib
   ] ++ optionals openglExtlib [ libGL libGLU ]
@@ -460,7 +467,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A complete, cross-platform solution to record, convert and stream audio and video";
     homepage = "https://www.ffmpeg.org/";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/ffmpeg-sixel/default.nix b/nixpkgs/pkgs/development/libraries/ffmpeg-sixel/default.nix
index 049ef32b72fb..daa03d0293a0 100644
--- a/nixpkgs/pkgs/development/libraries/ffmpeg-sixel/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ffmpeg-sixel/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkgconfig, libsixel, yasm
+{ lib, stdenv, fetchFromGitHub, pkg-config, libsixel, yasm
 }:
 
 stdenv.mkDerivation {
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
     sha256 = "00s2lggfdj2ibpngpyqqg7360p7yb69ys1ppg59yvv0m0mxk5x3k";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [
     libsixel
     yasm
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
     mv $out/bin/ffmpeg $out/bin/ffmpeg-sixel
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/ffmpeg/generic.nix b/nixpkgs/pkgs/development/libraries/ffmpeg/generic.nix
index d763fb513545..99a084703967 100644
--- a/nixpkgs/pkgs/development/libraries/ffmpeg/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/ffmpeg/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildPackages, fetchurl, pkgconfig, addOpenGLRunpath, perl, texinfo, yasm
+{ lib, stdenv, buildPackages, fetchurl, pkg-config, addOpenGLRunpath, perl, texinfo, yasm
 , alsaLib, bzip2, fontconfig, freetype, gnutls, libiconv, lame, libass, libogg
 , libssh, libtheora, libva, libdrm, libvorbis, libvpx, lzma, libpulseaudio, soxr
 , x264, x265, xvidcore, zlib, libopus, speex, nv-codec-headers, dav1d
@@ -44,7 +44,7 @@
 
 let
   inherit (stdenv) isDarwin isFreeBSD isLinux isAarch32;
-  inherit (stdenv.lib) optional optionals optionalString enableFeature filter;
+  inherit (lib) optional optionals optionalString enableFeature filter;
 
   cmpVer = builtins.compareVersions;
   reqMin = requiredVersion: (cmpVer requiredVersion branch != 1);
@@ -77,7 +77,7 @@ stdenv.mkDerivation rec {
     inherit sha256;
   };
 
-  postPatch = ''patchShebangs .'';
+  postPatch = "patchShebangs .";
   inherit patches;
 
   outputs = [ "bin" "dev" "out" "man" ]
@@ -167,7 +167,7 @@ stdenv.mkDerivation rec {
   ] ++ optional stdenv.cc.isClang "--cc=clang");
 
   depsBuildBuild = [ buildPackages.stdenv.cc ];
-  nativeBuildInputs = [ addOpenGLRunpath perl pkgconfig texinfo yasm ];
+  nativeBuildInputs = [ addOpenGLRunpath perl pkg-config texinfo yasm ];
 
   buildInputs = [
     bzip2 fontconfig freetype gnutls libiconv lame libass libogg libssh libtheora
@@ -211,7 +211,7 @@ stdenv.mkDerivation rec {
     inherit vaapiSupport vdpauSupport;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A complete, cross-platform solution to record, convert and stream audio and video";
     homepage = "http://www.ffmpeg.org/";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/ffmpegthumbnailer/default.nix b/nixpkgs/pkgs/development/libraries/ffmpegthumbnailer/default.nix
index 6c8e689840e8..2e68dbb1d120 100644
--- a/nixpkgs/pkgs/development/libraries/ffmpegthumbnailer/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ffmpegthumbnailer/default.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, stdenv, ffmpeg_3, cmake, libpng, pkg-config, libjpeg
+{ fetchFromGitHub, lib, stdenv, ffmpeg_3, cmake, libpng, pkg-config, libjpeg
 }:
 
 stdenv.mkDerivation rec {
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ ffmpeg_3 libpng libjpeg ];
   cmakeFlags = [ "-DENABLE_THUMBNAILER=ON" ];
 
-  meta = with stdenv.lib;  {
+  meta = with lib;  {
     homepage = "https://github.com/dirkvdb/ffmpegthumbnailer";
     description = "A lightweight video thumbnailer";
     longDescription = "FFmpegthumbnailer is a lightweight video
diff --git a/nixpkgs/pkgs/development/libraries/ffms/default.nix b/nixpkgs/pkgs/development/libraries/ffms/default.nix
index ebbced19eb8e..7fa96cff7f88 100644
--- a/nixpkgs/pkgs/development/libraries/ffms/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ffms/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, zlib, ffmpeg_3, pkgconfig }:
+{ lib, stdenv, fetchFromGitHub, zlib, ffmpeg_3, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "ffms";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = "-fPIC";
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ zlib ffmpeg_3 ];
 
   # ffms includes a built-in vapoursynth plugin, see:
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     ln -s $out/lib/libffms2.so $out/lib/vapoursynth/libffms2.so
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/FFMS/ffms2/";
     description = "Libav/ffmpeg based source library for easy frame accurate access";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/fftw/default.nix b/nixpkgs/pkgs/development/libraries/fftw/default.nix
index ba7e86747a7f..f0632e1460a0 100644
--- a/nixpkgs/pkgs/development/libraries/fftw/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fftw/default.nix
@@ -46,7 +46,7 @@ stdenv.mkDerivation {
 
   checkInputs = [ perl ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Fastest Fourier Transform in the West library";
     homepage = "http://www.fftw.org/";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/filter-audio/default.nix b/nixpkgs/pkgs/development/libraries/filter-audio/default.nix
index 3438bfee07b4..a412f7070470 100644
--- a/nixpkgs/pkgs/development/libraries/filter-audio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/filter-audio/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "filter-audio";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "PREFIX=$(out)" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Lightweight audio filtering library made from webrtc code";
     license = licenses.bsd3;
     maintainers = with maintainers; [ ];
diff --git a/nixpkgs/pkgs/development/libraries/flann/default.nix b/nixpkgs/pkgs/development/libraries/flann/default.nix
index f65d283fd1d2..913393804249 100644
--- a/nixpkgs/pkgs/development/libraries/flann/default.nix
+++ b/nixpkgs/pkgs/development/libraries/flann/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, unzip, cmake, python }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, unzip, cmake, python }:
 
 stdenv.mkDerivation {
   name = "flann-1.9.1";
@@ -18,13 +18,13 @@ stdenv.mkDerivation {
     })
   ];
 
-  buildInputs = [ unzip cmake python ];
+  nativeBuildInputs = [ unzip cmake python ];
 
   meta = {
     homepage = "http://people.cs.ubc.ca/~mariusm/flann/";
-    license = stdenv.lib.licenses.bsd3;
+    license = lib.licenses.bsd3;
     description = "Fast approximate nearest neighbor searches in high dimensional spaces";
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    maintainers = with lib.maintainers; [viric];
+    platforms = with lib.platforms; linux ++ darwin;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/flatbuffers/default.nix b/nixpkgs/pkgs/development/libraries/flatbuffers/default.nix
index 424aeb8637d4..374203556a60 100644
--- a/nixpkgs/pkgs/development/libraries/flatbuffers/default.nix
+++ b/nixpkgs/pkgs/development/libraries/flatbuffers/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, cmake }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "flatbuffers";
@@ -10,20 +10,36 @@ stdenv.mkDerivation rec {
     rev = "v${version}";
     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 = stdenv.lib.optional stdenv.buildPlatform.isDarwin ''
+  preConfigure = lib.optional stdenv.buildPlatform.isDarwin ''
     rm BUILD
   '';
 
   nativeBuildInputs = [ cmake ];
-  enableParallelBuilding = true;
 
   cmakeFlags = [ "-DFLATBUFFERS_BUILD_TESTS=${if doCheck then "ON" else "OFF"}" ];
 
-  doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
+  # tests fail to compile
+  doCheck = false;
+  # doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
   checkTarget = "test";
 
-  meta = {
+  meta = with lib; {
     description = "Memory Efficient Serialization Library";
     longDescription = ''
       FlatBuffers is an efficient cross platform serialization library for
@@ -31,9 +47,9 @@ stdenv.mkDerivation rec {
       access serialized data without unpacking/parsing it first, while still
       having great forwards/backwards compatibility.
     '';
-    maintainers = [ stdenv.lib.maintainers.teh ];
-    license = stdenv.lib.licenses.asl20;
-    platforms = stdenv.lib.platforms.unix;
+    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
index 6239dba2836d..6b40814119c6 100644
--- a/nixpkgs/pkgs/development/libraries/flatcc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/flatcc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 }:
@@ -24,6 +24,6 @@ stdenv.mkDerivation rec {
   meta = {
     description = "FlatBuffers Compiler and Library in C for C ";
     homepage = "https://github.com/dvidelabs/flatcc";
-    license = [ stdenv.lib.licenses.asl20 ];
+    license = [ lib.licenses.asl20 ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/flatpak/default.nix b/nixpkgs/pkgs/development/libraries/flatpak/default.nix
index 6f8634c01ef8..1480f42750dd 100644
--- a/nixpkgs/pkgs/development/libraries/flatpak/default.nix
+++ b/nixpkgs/pkgs/development/libraries/flatpak/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
 , autoconf
@@ -196,7 +196,7 @@ stdenv.mkDerivation rec {
   in ''
     patchShebangs buildutil
     patchShebangs tests
-    PATH=${stdenv.lib.makeBinPath [vsc-py]}:$PATH patchShebangs --build variant-schema-compiler/variant-schema-compiler
+    PATH=${lib.makeBinPath [vsc-py]}:$PATH patchShebangs --build variant-schema-compiler/variant-schema-compiler
   '';
 
   preConfigure = ''
@@ -215,7 +215,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Linux application sandboxing and distribution framework";
     homepage = "https://flatpak.org/";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/flint/default.nix b/nixpkgs/pkgs/development/libraries/flint/default.nix
index 3c768fc472c7..7bfa701db739 100644
--- a/nixpkgs/pkgs/development/libraries/flint/default.nix
+++ b/nixpkgs/pkgs/development/libraries/flint/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
 , gmp
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     mpir
     mpfr
     ntl
-  ] ++ stdenv.lib.optionals withBlas [
+  ] ++ lib.optionals withBlas [
     openblas
   ];
   propagatedBuildInputs = [
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
     "--with-mpir=${mpir}"
     "--with-mpfr=${mpfr}"
     "--with-ntl=${ntl}"
-  ] ++ stdenv.lib.optionals withBlas [
+  ] ++ lib.optionals withBlas [
     "--with-blas=${openblas}"
   ];
 
@@ -52,10 +52,10 @@ stdenv.mkDerivation rec {
   doCheck = true;
   meta = {
     inherit version;
-    description = ''Fast Library for Number Theory'';
-    license = stdenv.lib.licenses.gpl2Plus;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.unix;
+    description = "Fast Library for Number Theory";
+    license = lib.licenses.gpl2Plus;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.unix;
     homepage = "http://www.flintlib.org/";
     downloadPage = "http://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
index 1db8a9fbe2f3..24927fe853ba 100644
--- a/nixpkgs/pkgs/development/libraries/flite/default.nix
+++ b/nixpkgs/pkgs/development/libraries/flite/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, alsaLib }:
+{ lib, stdenv, fetchFromGitHub, alsaLib }:
 
 stdenv.mkDerivation rec {
   pname = "flite";
@@ -11,15 +11,15 @@ stdenv.mkDerivation rec {
     sha256 = "1n0p81jzndzc1rzgm66kw9ls189ricy5v1ps11y0p2fk1p56kbjf";
   };
 
-  buildInputs = stdenv.lib.optionals stdenv.isLinux [ alsaLib ];
+  buildInputs = lib.optionals stdenv.isLinux [ alsaLib ];
 
   configureFlags = [
     "--enable-shared"
-  ] ++ stdenv.lib.optionals stdenv.isLinux [ "--with-audio=alsa" ];
+  ] ++ lib.optionals stdenv.isLinux [ "--with-audio=alsa" ];
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A small, fast run-time speech synthesis engine";
     homepage = "http://www.festvox.org/flite/";
     license = licenses.bsdOriginal;
diff --git a/nixpkgs/pkgs/development/libraries/fltk/1.4.nix b/nixpkgs/pkgs/development/libraries/fltk/1.4.nix
index c40a75edc090..2db0aea3ecf8 100644
--- a/nixpkgs/pkgs/development/libraries/fltk/1.4.nix
+++ b/nixpkgs/pkgs/development/libraries/fltk/1.4.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, xlibsWrapper, xorgproto, libXi
+{ lib, stdenv, fetchurl, pkg-config, xlibsWrapper, xorgproto, libXi
 , freeglut, libGLU, libGL, libjpeg, zlib, libXft, libpng
 , libtiff, freetype, Cocoa, AGL, GLUT
 }:
@@ -16,11 +16,11 @@ stdenv.mkDerivation {
     sha256 = "1v8wxvxcbk99i82x2v5fpqg5vj8n7g8a38g30ry7nzcjn5sf3r63";
   };
 
-  patches = stdenv.lib.optionals stdenv.isDarwin [ ./nsosv.patch ];
+  patches = lib.optionals stdenv.isDarwin [ ./nsosv.patch ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libGLU libGL libjpeg zlib libpng libXft ]
-    ++ stdenv.lib.optional stdenv.isDarwin [ AGL Cocoa GLUT ];
+    ++ lib.optional stdenv.isDarwin [ AGL Cocoa GLUT ];
 
   propagatedBuildInputs = [ xorgproto ]
     ++ (if stdenv.isDarwin
@@ -39,7 +39,7 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A C++ cross-platform lightweight GUI library";
     homepage = "https://www.fltk.org";
     platforms = platforms.linux ++ platforms.darwin;
diff --git a/nixpkgs/pkgs/development/libraries/fltk/default.nix b/nixpkgs/pkgs/development/libraries/fltk/default.nix
index ad4736533cf0..5cbd993fc646 100644
--- a/nixpkgs/pkgs/development/libraries/fltk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fltk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, xlibsWrapper, xorgproto, libXi
+{ lib, stdenv, fetchurl, pkg-config, xlibsWrapper, xorgproto, libXi
 , freeglut, libGL, libGLU, libjpeg, zlib, libXft, libpng
 , libtiff, freetype, Cocoa, AGL, GLUT
 }:
@@ -16,11 +16,11 @@ stdenv.mkDerivation {
     sha256 = "00jp24z1818k9n6nn6lx7qflqf2k13g4kxr0p8v1d37kanhb4ac7";
   };
 
-  patches = stdenv.lib.optionals stdenv.isDarwin [ ./nsosv.patch ];
+  patches = lib.optionals stdenv.isDarwin [ ./nsosv.patch ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libGLU libGL libjpeg zlib libpng libXft ]
-    ++ stdenv.lib.optional stdenv.isDarwin [ AGL Cocoa GLUT ];
+    ++ lib.optional stdenv.isDarwin [ AGL Cocoa GLUT ];
 
   propagatedBuildInputs = [ xorgproto ]
     ++ (if stdenv.isDarwin
@@ -37,7 +37,7 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A C++ cross-platform lightweight GUI library";
     homepage = "https://www.fltk.org";
     platforms = platforms.linux ++ platforms.darwin;
diff --git a/nixpkgs/pkgs/development/libraries/fmt/default.nix b/nixpkgs/pkgs/development/libraries/fmt/default.nix
index 2f490891433b..0d2983b1f846 100644
--- a/nixpkgs/pkgs/development/libraries/fmt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fmt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, cmake
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
 
@@ -28,7 +28,7 @@ let
 
       doCheck = true;
 
-      meta = with stdenv.lib; {
+      meta = with lib; {
         description = "Small, safe and fast formatting library";
         longDescription = ''
           fmt (formerly cppformat) is an open-source formatting library. It can be
diff --git a/nixpkgs/pkgs/development/libraries/folks/default.nix b/nixpkgs/pkgs/development/libraries/folks/default.nix
index 6181cb45e19e..955b7e0d16f9 100644
--- a/nixpkgs/pkgs/development/libraries/folks/default.nix
+++ b/nixpkgs/pkgs/development/libraries/folks/default.nix
@@ -1,6 +1,6 @@
 { fetchurl
-, stdenv
-, pkgconfig
+, lib, stdenv
+, pkg-config
 , meson
 , ninja
 , glib
@@ -38,13 +38,13 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1f9b52vmwnq7s51vj26w2618dn2ph5g12ibbkbyk6fvxcgd7iryn";
   };
 
   mesonFlags = [
     "-Ddocs=true"
-    "-Dtelepathy_backend=${stdenv.lib.boolToString telepathySupport}"
+    "-Dtelepathy_backend=${lib.boolToString telepathySupport}"
   ];
 
   nativeBuildInputs = [
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
     docbook_xml_dtd_43
     meson
     ninja
-    pkgconfig
+    pkg-config
     python3
     vala
   ];
@@ -71,7 +71,7 @@ stdenv.mkDerivation rec {
     nspr
     nss
     readline
-  ] ++ stdenv.lib.optional telepathySupport telepathy-glib;
+  ] ++ lib.optional telepathySupport telepathy-glib;
 
   propagatedBuildInputs = [
     glib
@@ -105,7 +105,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/folly/default.nix b/nixpkgs/pkgs/development/libraries/folly/default.nix
index 62f73a361916..51666cb8828e 100644
--- a/nixpkgs/pkgs/development/libraries/folly/default.nix
+++ b/nixpkgs/pkgs/development/libraries/folly/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , boost
@@ -19,13 +19,13 @@
 
 stdenv.mkDerivation (rec {
   pname = "folly";
-  version = "2020.09.28.00";
+  version = "2021.01.18.01";
 
   src = fetchFromGitHub {
     owner = "facebook";
     repo = "folly";
     rev = "v${version}";
-    sha256 = "1ry2nqfavcbz0jvsqw71105gbxm5hpmdi2k1w155m957jrv3n5vg";
+    sha256 = "sha256-Q70zD+8maRQp+f1fqPyhJEpjVYt3eORD85fIk7Za9lw=";
   };
 
   nativeBuildInputs = [
@@ -52,7 +52,7 @@ stdenv.mkDerivation (rec {
 
   cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An open-source C++ library developed and used at Facebook";
     homepage = "https://github.com/facebook/folly";
     license = licenses.asl20;
@@ -60,6 +60,6 @@ stdenv.mkDerivation (rec {
     platforms = [ "x86_64-linux" "x86_64-darwin" ];
     maintainers = with maintainers; [ abbradar pierreis ];
   };
-} // stdenv.lib.optionalAttrs stdenv.isDarwin {
+} // lib.optionalAttrs stdenv.isDarwin {
   LDFLAGS = "-ljemalloc";
 })
diff --git a/nixpkgs/pkgs/development/libraries/fontconfig/default.nix b/nixpkgs/pkgs/development/libraries/fontconfig/default.nix
index e08149903a2b..daedaefcf9c5 100644
--- a/nixpkgs/pkgs/development/libraries/fontconfig/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fontconfig/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchpatch
 , substituteAll
 , fetchurl
@@ -85,7 +85,7 @@ stdenv.mkDerivation rec {
     "--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}"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "--with-arch=${stdenv.hostPlatform.parsed.cpu.name}"
   ];
 
@@ -112,7 +112,7 @@ stdenv.mkDerivation rec {
     rm -r $bin/share/man/man3
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library for font customization and configuration";
     homepage = "http://fontconfig.org/";
     license = licenses.bsd2; # custom but very bsd-like
diff --git a/nixpkgs/pkgs/development/libraries/forge/default.nix b/nixpkgs/pkgs/development/libraries/forge/default.nix
index 83630aef9aa8..ba85cea73d69 100644
--- a/nixpkgs/pkgs/development/libraries/forge/default.nix
+++ b/nixpkgs/pkgs/development/libraries/forge/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
 , arrayfire, expat, fontconfig, freeimage, freetype, boost
 , mesa, libGLU, libGL, glfw3, SDL2, cudatoolkit
 }:
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     cmake
-    pkgconfig
+    pkg-config
   ];
 
   buildInputs = [
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
     arrayfire
   ];
 
-  meta = with stdenv.lib; {
+  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.
diff --git a/nixpkgs/pkgs/development/libraries/fox/default.nix b/nixpkgs/pkgs/development/libraries/fox/default.nix
index 5dacf53b259f..408518ba79ce 100644
--- a/nixpkgs/pkgs/development/libraries/fox/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fox/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, xlibsWrapper, libpng, libjpeg, libtiff, zlib, bzip2, libXcursor, libXrandr, libXft
+{ lib, stdenv, fetchurl, xlibsWrapper, libpng, libjpeg, libtiff, zlib, bzip2, libXcursor, libXrandr, libXft
 , CoreServices ? null }:
 
 stdenv.mkDerivation rec {
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   patches = [ ./clang.patch ];
 
   buildInputs = [ libpng xlibsWrapper libjpeg libtiff zlib bzip2 libXcursor libXrandr libXft ]
-    ++ stdenv.lib.optional stdenv.isDarwin CoreServices;
+    ++ lib.optional stdenv.isDarwin CoreServices;
 
   doCheck = true;
 
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "format" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ based class library for building Graphical User Interfaces";
     longDescription = ''
       FOX stands for Free Objects for X.
diff --git a/nixpkgs/pkgs/development/libraries/fox/fox-1.6.nix b/nixpkgs/pkgs/development/libraries/fox/fox-1.6.nix
index 208780a450ed..50f9e688cb9f 100644
--- a/nixpkgs/pkgs/development/libraries/fox/fox-1.6.nix
+++ b/nixpkgs/pkgs/development/libraries/fox/fox-1.6.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, xlibsWrapper, libpng, libjpeg, libtiff, zlib, bzip2, libXcursor
+{ lib, stdenv, fetchurl, xlibsWrapper, libpng, libjpeg, libtiff, zlib, bzip2, libXcursor
 , libXrandr, libGLU, libGL, libXft, libXfixes, xinput
 , CoreServices }:
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   buildInputs = [
     xlibsWrapper libpng libjpeg libtiff zlib bzip2 libXcursor libXrandr
     libXft libGLU libGL libXfixes xinput
-  ] ++ stdenv.lib.optional stdenv.isDarwin CoreServices;
+  ] ++ lib.optional stdenv.isDarwin CoreServices;
 
   doCheck = true;
 
@@ -36,8 +36,8 @@ stdenv.mkDerivation rec {
         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 = stdenv.lib.licenses.lgpl3;
+    license = lib.licenses.lgpl3;
     maintainers = [];
-    platforms = stdenv.lib.platforms.mesaPlatforms;
+    platforms = lib.platforms.mesaPlatforms;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/fplll/20160331.nix b/nixpkgs/pkgs/development/libraries/fplll/20160331.nix
index aabbfd14a78b..374aec5904d6 100644
--- a/nixpkgs/pkgs/development/libraries/fplll/20160331.nix
+++ b/nixpkgs/pkgs/development/libraries/fplll/20160331.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, autoconf, automake, libtool, gettext, autoreconfHook
+{lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, gettext, autoreconfHook
 , gmp, mpfr
 }:
 stdenv.mkDerivation rec {
@@ -14,9 +14,9 @@ stdenv.mkDerivation rec {
   buildInputs = [gmp mpfr];
   meta = {
     inherit version;
-    description = ''Lattice algorithms using floating-point arithmetic'';
-    license = stdenv.lib.licenses.lgpl21Plus;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    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
index 82d56ea2af41..3a82b566a50f 100644
--- a/nixpkgs/pkgs/development/libraries/fplll/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fplll/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 , gettext
@@ -28,8 +28,8 @@ stdenv.mkDerivation rec {
     mpfr
   ];
 
-  meta = with stdenv.lib; {
-    description = ''Lattice algorithms using floating-point arithmetic'';
+  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.
diff --git a/nixpkgs/pkgs/development/libraries/frame/default.nix b/nixpkgs/pkgs/development/libraries/frame/default.nix
index f266f07a631c..e96aa9394da9 100644
--- a/nixpkgs/pkgs/development/libraries/frame/default.nix
+++ b/nixpkgs/pkgs/development/libraries/frame/default.nix
@@ -1,5 +1,5 @@
 { enableX11 ? true
-,  stdenv, fetchurl, pkgconfig, xorg }:
+,  lib, stdenv, fetchurl, pkg-config, xorg }:
 
 stdenv.mkDerivation rec {
   pname = "frame";
@@ -9,16 +9,16 @@ stdenv.mkDerivation rec {
     sha256 = "bc2a20cd3ac1e61fe0461bd3ee8cb250dbcc1fa511fad0686d267744e9c78f3a";
   };
 
-  buildInputs = [ 
-    stdenv pkgconfig
-  ] ++ stdenv.lib.optionals enableX11 [xorg.xorgserver xorg.libX11 xorg.libXext xorg.libXi];
+  buildInputs = [
+    stdenv pkg-config
+  ] ++ lib.optionals enableX11 [xorg.xorgserver xorg.libX11 xorg.libXext xorg.libXi];
 
-  configureFlags = stdenv.lib.optional enableX11 "--with-x11";
+  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 = stdenv.lib.licenses.gpl3;
-    platforms = stdenv.lib.platforms.linux;
+    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
index 2c9a893284be..3bb6eaddfa36 100644
--- a/nixpkgs/pkgs/development/libraries/freealut/default.nix
+++ b/nixpkgs/pkgs/development/libraries/freealut/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, darwin, fetchurl, openal }:
+{ lib, stdenv, darwin, fetchurl, openal }:
 
 stdenv.mkDerivation rec {
   name = "freealut-1.1.0";
@@ -9,14 +9,14 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ openal
-  ] ++ stdenv.lib.optional stdenv.isDarwin
+  ] ++ lib.optional stdenv.isDarwin
     darwin.apple_sdk.frameworks.OpenAL
   ;
 
   meta = {
     homepage = "http://openal.org/";
     description = "Free implementation of OpenAL's ALUT standard";
-    license = stdenv.lib.licenses.lgpl2;
-    platforms = stdenv.lib.platforms.unix;
+    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
index d23147095fcf..83e3eebdcc32 100644
--- a/nixpkgs/pkgs/development/libraries/freeglut/default.nix
+++ b/nixpkgs/pkgs/development/libraries/freeglut/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libXi, libXrandr, libXxf86vm, libGL, libGLU, xlibsWrapper, cmake }:
+{ lib, stdenv, fetchurl, libXi, libXrandr, libXxf86vm, libGL, libGLU, xlibsWrapper, cmake }:
 
 let version = "3.2.1";
 in stdenv.mkDerivation {
@@ -12,9 +12,10 @@ in stdenv.mkDerivation {
 
   outputs = [ "out" "dev" ];
 
-  buildInputs = [ libXi libXrandr libXxf86vm libGL libGLU xlibsWrapper cmake ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libXi libXrandr libXxf86vm libGL libGLU xlibsWrapper ];
 
-  cmakeFlags = stdenv.lib.optionals stdenv.isDarwin [
+  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"
@@ -22,9 +23,7 @@ in stdenv.mkDerivation {
                  "-DFREEGLUT_BUILD_STATIC:BOOL=OFF"
                ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Create and manage windows containing OpenGL contexts";
     longDescription = ''
       FreeGLUT is an open source alternative to the OpenGL Utility Toolkit
diff --git a/nixpkgs/pkgs/development/libraries/freenect/default.nix b/nixpkgs/pkgs/development/libraries/freenect/default.nix
index 9021e78a5b69..2cf026514731 100644
--- a/nixpkgs/pkgs/development/libraries/freenect/default.nix
+++ b/nixpkgs/pkgs/development/libraries/freenect/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, cmake, libusb1, pkgconfig, freeglut, libGLU, libGL, libXi, libXmu
+{ stdenv, lib, fetchFromGitHub, cmake, libusb1, pkg-config, freeglut, libGLU, libGL, libXi, libXmu
 , GLUT, Cocoa
  }:
 
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ libusb1 freeglut libGLU libGL libXi libXmu ]
     ++ lib.optionals stdenv.isDarwin [ GLUT Cocoa ];
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
   meta = {
     description = "Drivers and libraries for the Xbox Kinect device on Windows, Linux, and macOS";
diff --git a/nixpkgs/pkgs/development/libraries/freetds/default.nix b/nixpkgs/pkgs/development/libraries/freetds/default.nix
index c1b9318130c1..8e6904a94b2f 100644
--- a/nixpkgs/pkgs/development/libraries/freetds/default.nix
+++ b/nixpkgs/pkgs/development/libraries/freetds/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, pkgconfig
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config
 , openssl
 , odbcSupport ? true, unixODBC ? null }:
 
@@ -17,13 +17,11 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     openssl
-  ] ++ stdenv.lib.optional odbcSupport unixODBC;
+  ] ++ lib.optional odbcSupport unixODBC;
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Libraries to natively talk to Microsoft SQL Server and Sybase databases";
     homepage    = "https://www.freetds.org";
     license     = licenses.lgpl2;
diff --git a/nixpkgs/pkgs/development/libraries/freetype/default.nix b/nixpkgs/pkgs/development/libraries/freetype/default.nix
index b87e64c2afbf..7b5fff29a286 100644
--- a/nixpkgs/pkgs/development/libraries/freetype/default.nix
+++ b/nixpkgs/pkgs/development/libraries/freetype/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , buildPackages
-, pkgconfig, which, makeWrapper
+, pkg-config, which, makeWrapper
 , zlib, bzip2, libpng, gnumake, glib
 
 , # FreeType supports LCD filtering (colloquially referred to as sub-pixel rendering).
@@ -10,13 +10,13 @@
 }:
 
 let
-  inherit (stdenv.lib) optional optionalString;
+  inherit (lib) optional optionalString;
 
 in stdenv.mkDerivation rec {
   pname = "freetype";
   version = "2.10.4";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A font rendering engine";
     longDescription = ''
       FreeType is a portable and efficient library for rendering fonts. It
@@ -39,7 +39,7 @@ in stdenv.mkDerivation rec {
   propagatedBuildInputs = [ zlib bzip2 libpng ]; # needed when linking against freetype
 
   # dependence on harfbuzz is looser than the reverse dependence
-  nativeBuildInputs = [ pkgconfig which makeWrapper ]
+  nativeBuildInputs = [ pkg-config which makeWrapper ]
     # FreeType requires GNU Make, which is not part of stdenv on FreeBSD.
     ++ optional (!stdenv.isLinux) gnumake;
 
@@ -64,7 +64,7 @@ in stdenv.mkDerivation rec {
 
   postInstall = glib.flattenInclude + ''
     substituteInPlace $dev/bin/freetype-config \
-      --replace ${buildPackages.pkgconfig} ${pkgconfig}
+      --replace ${buildPackages.pkg-config} ${pkg-config}
 
     wrapProgram "$dev/bin/freetype-config" \
       --set PKG_CONFIG_PATH "$PKG_CONFIG_PATH:$dev/lib/pkgconfig"
diff --git a/nixpkgs/pkgs/development/libraries/frei0r/default.nix b/nixpkgs/pkgs/development/libraries/frei0r/default.nix
index 2dc7275559d4..c4f993462964 100644
--- a/nixpkgs/pkgs/development/libraries/frei0r/default.nix
+++ b/nixpkgs/pkgs/development/libraries/frei0r/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoconf, cairo, opencv, pkgconfig }:
+{ lib, stdenv, fetchurl, autoconf, cairo, opencv, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "frei0r-plugins";
@@ -9,16 +9,16 @@ stdenv.mkDerivation rec {
     sha256 = "0pji26fpd0dqrx1akyhqi6729s394irl73dacnyxk58ijqq4dhp0";
   };
 
-  nativeBuildInputs = [ autoconf pkgconfig ];
+  nativeBuildInputs = [ autoconf pkg-config ];
   buildInputs = [ cairo opencv ];
 
-  postInstall = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+  postInstall = lib.optionalString stdenv.hostPlatform.isDarwin ''
     for f in $out/lib/frei0r-1/*.so* ; do
       ln -s $f "''${f%.*}.dylib"
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://frei0r.dyne.org";
     description = "Minimalist, cross-platform, shared video plugins";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/fribidi/default.nix b/nixpkgs/pkgs/development/libraries/fribidi/default.nix
index f10af240720d..27f3b825d10a 100644
--- a/nixpkgs/pkgs/development/libraries/fribidi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fribidi/default.nix
@@ -1,9 +1,9 @@
-{ stdenv
+{ lib, stdenv
 , buildPackages
 , fetchurl
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , fixDarwinDylibNames
 , python3
 }:
@@ -24,15 +24,15 @@ stdenv.mkDerivation rec {
     patchShebangs test
   '';
 
-  nativeBuildInputs = [ meson ninja pkgconfig ]
-    ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
+  nativeBuildInputs = [ meson ninja pkg-config ]
+    ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
   depsBuildBuild = [ buildPackages.stdenv.cc ];
 
   doCheck = true;
   checkInputs = [ python3 ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/fribidi/fribidi";
     description = "GNU implementation of the Unicode Bidirectional Algorithm (bidi)";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/fstrcmp/default.nix b/nixpkgs/pkgs/development/libraries/fstrcmp/default.nix
index 46b579d4abd8..c91e8517b078 100644
--- a/nixpkgs/pkgs/development/libraries/fstrcmp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fstrcmp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, libtool, ghostscript, groff, autoreconfHook }:
+{ lib, stdenv, fetchzip, libtool, ghostscript, groff, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "fstrcmp";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/fstrm/default.nix b/nixpkgs/pkgs/development/libraries/fstrm/default.nix
index 7b1adb3e3f0c..46a7118cefe4 100644
--- a/nixpkgs/pkgs/development/libraries/fstrm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/fstrm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libevent, openssl }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, libevent, openssl }:
 
 stdenv.mkDerivation rec {
   pname = "fstrm";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "bin" "out" "dev" ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ libevent openssl ];
 
   preBuild = ''
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Frame Streams implementation in C";
     homepage = "https://github.com/farsightsec/fstrm";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/ftgl/default.nix b/nixpkgs/pkgs/development/libraries/ftgl/default.nix
index a0ce9db815bc..c3fd6ffb9407 100644
--- a/nixpkgs/pkgs/development/libraries/ftgl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ftgl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, freetype, libGL, libGLU, OpenGL }:
+{ lib, stdenv, fetchurl, freetype, libGL, libGLU, OpenGL }:
 
 let
   name = "ftgl-2.1.3-rc5";
@@ -18,14 +18,14 @@ stdenv.mkDerivation {
       [ libGL libGLU ])
     ;
 
-  configureFlags = [ "--with-ft-prefix=${stdenv.lib.getDev freetype}" ];
+  configureFlags = [ "--with-ft-prefix=${lib.getDev freetype}" ];
 
   enableParallelBuilding = true;
 
   meta = {
     homepage = "https://sourceforge.net/apps/mediawiki/ftgl/";
     description = "Font rendering library for OpenGL applications";
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
 
     longDescription = ''
       FTGL is a free cross-platform Open Source C++ library that uses
@@ -34,7 +34,7 @@ stdenv.mkDerivation {
       and extruded polygon rendering modes.
     '';
 
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
     maintainers = [];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/funambol/default.nix b/nixpkgs/pkgs/development/libraries/funambol/default.nix
index 064dbb39a2f9..377aa45cf5ec 100644
--- a/nixpkgs/pkgs/development/libraries/funambol/default.nix
+++ b/nixpkgs/pkgs/development/libraries/funambol/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, zlib, curl, autoreconfHook, unzip }:
+{ lib, stdenv, fetchurl, zlib, curl, autoreconfHook, unzip }:
 
 stdenv.mkDerivation {
   name = "funambol-client-cpp-9.0.0";
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ autoreconfHook unzip ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SyncML client sdk by Funambol project";
     homepage = "http://www.funambol.com";
     license = licenses.agpl3;
diff --git a/nixpkgs/pkgs/development/libraries/gaia/default.nix b/nixpkgs/pkgs/development/libraries/gaia/default.nix
index 46ed3626d2af..088354aecb28 100644
--- a/nixpkgs/pkgs/development/libraries/gaia/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gaia/default.nix
@@ -4,7 +4,7 @@
 , libyaml
 , swig
 , eigen
-, pkgconfig
+, pkg-config
 , python2
 , wafHook
 , makeWrapper
@@ -31,15 +31,14 @@ stdenv.mkDerivation rec {
   };
 
   # Fix installation error when waf tries to put files in /etc/
-  prePatch = ''
-  '' + lib.optionalString cyclopsSupport ''
+  prePatch = "" + lib.optionalString cyclopsSupport ''
     substituteInPlace src/wscript \
       --replace "/etc/cyclops" "$out/etc/cyclops" \
       --replace "/etc/init.d" "$out/etc/init.d"
   '';
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     python2 # For wafHook
     swig
     wafHook
@@ -72,8 +71,7 @@ stdenv.mkDerivation rec {
     ++ lib.optionals (cyclopsSupport) [ "--with-cyclops" ]
   ;
 
-  postFixup = ''
-  ''
+  postFixup = ""
     + lib.optionalString pythonSupport ''
       wrapPythonPrograms
     ''
diff --git a/nixpkgs/pkgs/development/libraries/galario/default.nix b/nixpkgs/pkgs/development/libraries/galario/default.nix
index 84594b8dbeb9..888f26f2da7d 100644
--- a/nixpkgs/pkgs/development/libraries/galario/default.nix
+++ b/nixpkgs/pkgs/development/libraries/galario/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchzip
 , fetchFromGitHub
 , cmake
@@ -30,17 +30,17 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
 
   buildInputs = [ fftw fftwFloat ]
-  ++ stdenv.lib.optional enablePython pythonPackages.python
-  ++ stdenv.lib.optional stdenv.isDarwin llvmPackages.openmp
+  ++ lib.optional enablePython pythonPackages.python
+  ++ lib.optional stdenv.isDarwin llvmPackages.openmp
   ;
 
-  propagatedBuildInputs = stdenv.lib.optional enablePython [
+  propagatedBuildInputs = lib.optional enablePython [
     pythonPackages.numpy
     pythonPackages.cython
     pythonPackages.pytest
   ];
 
-  checkInputs = stdenv.lib.optional enablePython [ pythonPackages.scipy pythonPackages.pytestcov ];
+  checkInputs = lib.optional enablePython [ pythonPackages.scipy pythonPackages.pytestcov ];
 
   preConfigure = ''
     mkdir -p build/external/src
@@ -55,12 +55,12 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  postInstall = stdenv.lib.optionalString (stdenv.isDarwin && enablePython) ''
+  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 stdenv.lib; {
+  meta = with lib; {
     description = "GPU Accelerated Library for Analysing Radio Interferometer Observations";
     longDescription = ''
       Galario is a library that exploits the computing power of modern
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/default.nix b/nixpkgs/pkgs/development/libraries/gamin/default.nix
index 89096c887450..56de42d9dc5b 100644
--- a/nixpkgs/pkgs/development/libraries/gamin/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gamin/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, pkgconfig, glib, autoreconfHook }:
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, glib, autoreconfHook }:
 
 let
   cross = stdenv.hostPlatform != stdenv.buildPlatform;
@@ -10,7 +10,7 @@ in stdenv.mkDerivation (rec {
     sha256 = "18cr51y5qacvs2fc2p1bqv32rs8bzgs6l67zhasyl45yx055y218";
   };
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
 
   buildInputs = [ glib ];
 
@@ -24,15 +24,15 @@ in stdenv.mkDerivation (rec {
 
   patches = [ ./deadlock.patch ]
     ++ map fetchurl (import ./debian-patches.nix)
-    ++ stdenv.lib.optional stdenv.cc.isClang ./returnval.patch
-    ++ stdenv.lib.optional stdenv.hostPlatform.isMusl (fetchpatch {
+    ++ 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";
-    }) ++ stdenv.lib.optional (cross) ./abstract-socket-namespace.patch ;
+    }) ++ lib.optional (cross) ./abstract-socket-namespace.patch ;
 
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage    = "https://people.gnome.org/~veillard/gamin/";
     description = "A file and directory monitoring system";
     maintainers = with maintainers; [ lovek323 ];
@@ -41,7 +41,7 @@ in stdenv.mkDerivation (rec {
   };
 }
 
-// stdenv.lib.optionalAttrs stdenv.isDarwin {
+// lib.optionalAttrs stdenv.isDarwin {
   preBuild =  ''
     sed -i 's/,--version-script=.*$/\\/' libgamin/Makefile
   '';
diff --git a/nixpkgs/pkgs/development/libraries/ganv/default.nix b/nixpkgs/pkgs/development/libraries/ganv/default.nix
index cf9b04863043..bf6c030589b9 100644
--- a/nixpkgs/pkgs/development/libraries/ganv/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ganv/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, graphviz, gtk2, gtkmm2, pkgconfig, python, wafHook }:
+{ lib, stdenv, fetchgit, graphviz, gtk2, gtkmm2, pkg-config, python, wafHook }:
 
 stdenv.mkDerivation rec {
   pname = "ganv";
@@ -11,10 +11,10 @@ stdenv.mkDerivation rec {
     sha256 = "01znnalirbqxpz62fbw2c14c8xn117jc92xv6dhb3hln92k9x37f";
   };
 
-  nativeBuildInputs = [ pkgconfig wafHook ];
+  nativeBuildInputs = [ pkg-config wafHook ];
   buildInputs = [ graphviz gtk2 gtkmm2 python ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An interactive Gtk canvas widget for graph-based interfaces";
     homepage = "http://drobilla.net";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/garmintools/default.nix b/nixpkgs/pkgs/development/libraries/garmintools/default.nix
index 97449d944ec3..424e3751f407 100644
--- a/nixpkgs/pkgs/development/libraries/garmintools/default.nix
+++ b/nixpkgs/pkgs/development/libraries/garmintools/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libusb-compat-0_1 }:
+{ lib, stdenv, fetchurl, libusb-compat-0_1 }:
 stdenv.mkDerivation {
   name = "garmintools-0.10";
   src = fetchurl {
@@ -9,8 +9,8 @@ stdenv.mkDerivation {
   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 = stdenv.lib.licenses.gpl2;
+    license = lib.licenses.gpl2;
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/gbenchmark/default.nix b/nixpkgs/pkgs/development/libraries/gbenchmark/default.nix
index 0eff8eafacfc..c1f485e18d9b 100644
--- a/nixpkgs/pkgs/development/libraries/gbenchmark/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gbenchmark/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, gtest }:
+{ lib, stdenv, fetchFromGitHub, cmake, gtest }:
 
 stdenv.mkDerivation rec {
   pname = "gbenchmark";
@@ -18,10 +18,9 @@ stdenv.mkDerivation rec {
     chmod -R u+w googletest
   '';
 
-  enableParallelBuilding = true;
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A microbenchmark support library";
     homepage = "https://github.com/google/benchmark";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/gcab/default.nix b/nixpkgs/pkgs/development/libraries/gcab/default.nix
index 0034f7ed6333..0ad9f607dfea 100644
--- a/nixpkgs/pkgs/development/libraries/gcab/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gcab/default.nix
@@ -1,11 +1,11 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , gettext
 , gobject-introspection
 , gtk-doc
 , docbook_xsl
 , docbook_xml_dtd_43
-, pkgconfig
+, pkg-config
 , meson
 , ninja
 , git
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   outputs = [ "bin" "out" "dev" "devdoc" "installedTests" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "13q43iqld4l50yra45lhvkd376pn6qpk7rkx374zn8y9wsdzm9b7";
   };
 
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
     meson
     ninja
     git
-    pkgconfig
+    pkg-config
     vala
     gettext
     gobject-introspection
@@ -57,7 +57,7 @@ stdenv.mkDerivation rec {
 
   mesonFlags = [
     "-Dinstalled_tests=true"
-    "-Dinstalled_test_prefix=${placeholder ''installedTests''}"
+    "-Dinstalled_test_prefix=${placeholder "installedTests"}"
   ];
 
   doCheck = true;
@@ -73,7 +73,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GObject library to create cabinet files";
     homepage = "https://gitlab.gnome.org/GNOME/gcab";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gcc/libstdc++/5.nix b/nixpkgs/pkgs/development/libraries/gcc/libstdc++/5.nix
index 486a24defd1b..b123f799ccaa 100644
--- a/nixpkgs/pkgs/development/libraries/gcc/libstdc++/5.nix
+++ b/nixpkgs/pkgs/development/libraries/gcc/libstdc++/5.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, flex, bison, file }:
+{ lib, stdenv, fetchurl, fetchpatch, flex, bison, file }:
 
 stdenv.mkDerivation rec {
   pname = "libstdc++5";
@@ -107,7 +107,7 @@ stdenv.mkDerivation rec {
     rm -rf $out/lib/!(libstdc++*)
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://gcc.gnu.org/";
     license = licenses.lgpl3Plus;
     description = "GNU Compiler Collection, version ${version} -- C++ standard library";
diff --git a/nixpkgs/pkgs/development/libraries/gcr/default.nix b/nixpkgs/pkgs/development/libraries/gcr/default.nix
index 212b087fbe2c..8add81e27969 100644
--- a/nixpkgs/pkgs/development/libraries/gcr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gcr/default.nix
@@ -1,6 +1,6 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
-, pkgconfig
+, pkg-config
 , meson
 , ninja
 , gettext
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   version = "3.38.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1q97pba4bzjndm1vlvicyv8mrl0n589qsw71dp8jrz2payvcfk56";
   };
 
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     meson
     python3
     ninja
@@ -87,7 +87,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     platforms = platforms.linux;
     maintainers = teams.gnome.members;
     description = "GNOME crypto services (daemon and tools)";
diff --git a/nixpkgs/pkgs/development/libraries/gd/default.nix b/nixpkgs/pkgs/development/libraries/gd/default.nix
index 3b4533890a76..36a930956033 100644
--- a/nixpkgs/pkgs/development/libraries/gd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch
+{ lib, stdenv, fetchurl, fetchpatch
 , autoconf
 , automake
 , pkg-config
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
   ];
 
   # -pthread gets passed to clang, causing warnings
-  configureFlags = stdenv.lib.optional stdenv.isDarwin "--enable-werror=no";
+  configureFlags = lib.optional stdenv.isDarwin "--enable-werror=no";
 
   nativeBuildInputs = [ autoconf automake pkg-config ];
 
@@ -52,7 +52,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # fails 2 tests
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://libgd.github.io/";
     description = "A dynamic image creation library";
     license = licenses.free; # some custom license
diff --git a/nixpkgs/pkgs/development/libraries/gdal/2.4.0.nix b/nixpkgs/pkgs/development/libraries/gdal/2.4.0.nix
index d3505679e4d0..9cb9c448c1d2 100644
--- a/nixpkgs/pkgs/development/libraries/gdal/2.4.0.nix
+++ b/nixpkgs/pkgs/development/libraries/gdal/2.4.0.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, fetchpatch, unzip, libjpeg, libtiff, zlib
+{ lib, stdenv, fetchurl, fetchpatch, unzip, libjpeg, libtiff, zlib
 , postgresql, libmysqlclient, libgeotiff, pythonPackages, proj, geos, openssl
 , libpng, sqlite, libspatialite, poppler, hdf4, qhull, giflib, expat
 , libiconv, libxml2
 , netcdfSupport ? true, netcdf, hdf5, curl
 }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "gdal";
@@ -28,8 +28,8 @@ stdenv.mkDerivation rec {
   buildInputs = [ unzip libjpeg libtiff libgeotiff libpng proj openssl sqlite
     libspatialite poppler hdf4 qhull giflib expat libxml2 proj ]
   ++ (with pythonPackages; [ python numpy wrapPython ])
-  ++ stdenv.lib.optional stdenv.isDarwin libiconv
-  ++ stdenv.lib.optionals netcdfSupport [ netcdf hdf5 curl ];
+  ++ lib.optional stdenv.isDarwin libiconv
+  ++ lib.optionals netcdfSupport [ netcdf hdf5 curl ];
 
   configureFlags = [
     "--with-expat=${expat.dev}"
@@ -97,8 +97,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Translator library for raster geospatial data formats";
     homepage = "https://www.gdal.org/";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.marcweber ];
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    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
index 1295a1002328..8c02919126ba 100644
--- a/nixpkgs/pkgs/development/libraries/gdal/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gdal/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchFromGitHub, fetchpatch, unzip, libjpeg, libtiff, zlib, postgresql
+{ 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 stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "gdal";
@@ -39,8 +39,8 @@ stdenv.mkDerivation rec {
     libxml2
     postgresql
   ] ++ (with pythonPackages; [ python numpy wrapPython ])
-    ++ stdenv.lib.optional stdenv.isDarwin libiconv
-    ++ stdenv.lib.optionals netcdfSupport [ netcdf hdf5 curl ];
+    ++ lib.optional stdenv.isDarwin libiconv
+    ++ lib.optionals netcdfSupport [ netcdf hdf5 curl ];
 
   configureFlags = [
     "--with-expat=${expat.dev}"
@@ -87,8 +87,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Translator library for raster geospatial data formats";
     homepage = "https://www.gdal.org/";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.marcweber ];
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.marcweber ];
+    platforms = with lib.platforms; linux ++ darwin;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/gdal/gdal-1_11.nix b/nixpkgs/pkgs/development/libraries/gdal/gdal-1_11.nix
index 3695407b8f2f..92d17452c941 100644
--- a/nixpkgs/pkgs/development/libraries/gdal/gdal-1_11.nix
+++ b/nixpkgs/pkgs/development/libraries/gdal/gdal-1_11.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, libjpeg, libtiff, zlib
+{ lib, stdenv, fetchurl, unzip, libjpeg, libtiff, zlib
 , postgresql, mysql57, libgeotiff, python, pythonPackages, proj, geos, openssl
 , libpng }:
 
@@ -59,8 +59,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Translator library for raster geospatial data formats";
     homepage = "https://www.gdal.org/";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.marcweber ];
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    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
index 893fc4f8d27c..21cb79ba8158 100644
--- a/nixpkgs/pkgs/development/libraries/gdata-sharp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gdata-sharp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchsvn, pkgconfig, mono, dotnetPackages }:
+{ lib, stdenv, fetchsvn, pkg-config, mono, dotnetPackages }:
 
 let
   newtonsoft-json = dotnetPackages.NewtonsoftJson;
@@ -12,7 +12,7 @@ in stdenv.mkDerivation {
     sha256 = "0b0rvgg3xsbbg2fdrpz0ywsy9rcahlyfskndaagd3yzm83gi6bhk";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ mono newtonsoft-json ];
 
   sourceRoot = "svn-r1217/clients/cs";
@@ -26,7 +26,7 @@ in stdenv.mkDerivation {
 
   makeFlags = [ "PREFIX=$(out)" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://code.google.com/archive/p/google-gdata/";
 
     description = "The Google Data APIs";
diff --git a/nixpkgs/pkgs/development/libraries/gdbm/0001-Remove-duplicate-assignments.patch b/nixpkgs/pkgs/development/libraries/gdbm/0001-Remove-duplicate-assignments.patch
deleted file mode 100644
index 7583deb81098..000000000000
--- a/nixpkgs/pkgs/development/libraries/gdbm/0001-Remove-duplicate-assignments.patch
+++ /dev/null
@@ -1,25 +0,0 @@
-From 2c31a95d9e57a4308c5159c50e69b5c9178dee72 Mon Sep 17 00:00:00 2001
-From: Christian Kampka <christian@kampka.net>
-Date: Fri, 13 Nov 2020 16:52:12 +0100
-Subject: [PATCH] Remove duplicate assignments
-
----
- src/parseopt.c | 2 --
- 1 file changed, 2 deletions(-)
-
-diff --git a/src/parseopt.c b/src/parseopt.c
-index 268e080..a4c8576 100644
---- a/src/parseopt.c
-+++ b/src/parseopt.c
-@@ -255,8 +255,6 @@ print_option_descr (const char *descr, size_t lmargin, size_t rmargin)
- }
- 
- char *parseopt_program_name;
--char *parseopt_program_doc;
--char *parseopt_program_args;
- const char *program_bug_address = "<" PACKAGE_BUGREPORT ">";
- void (*parseopt_help_hook) (FILE *stream);
- 
--- 
-2.25.4
-
diff --git a/nixpkgs/pkgs/development/libraries/gdbm/default.nix b/nixpkgs/pkgs/development/libraries/gdbm/default.nix
index 3d333e503b2e..16c045cd68ef 100644
--- a/nixpkgs/pkgs/development/libraries/gdbm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gdbm/default.nix
@@ -2,17 +2,15 @@
 
 stdenv.mkDerivation rec {
   pname = "gdbm";
-  version = "1.18.1";
+  version = "1.19";
 
   src = fetchurl {
     url = "mirror://gnu/gdbm/${pname}-${version}.tar.gz";
-    sha256 = "1p4ibds6z3ccy65lkmd6lm7js0kwifvl53r0fd759fjxgr917rl6";
+    sha256 = "sha256-N+0SIUEiuXLhig2UmVA55XdIGRk573QRWx1B2IETZLw=";
   };
 
   doCheck = true; # not cross;
 
-  patches = [ ./0001-Remove-duplicate-assignments.patch ];
-
   # Linking static stubs on cygwin requires correct ordering.
   # Consider upstreaming this.
 
diff --git a/nixpkgs/pkgs/development/libraries/gdcm/default.nix b/nixpkgs/pkgs/development/libraries/gdcm/default.nix
index d05e44eae3e5..75ce95e0e46b 100644
--- a/nixpkgs/pkgs/development/libraries/gdcm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gdcm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, vtk_7, darwin
+{ lib, stdenv, fetchurl, cmake, vtk_7, darwin
 , enablePython ? false, python ? null,  swig ? null}:
 
 stdenv.mkDerivation rec {
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     "-DGDCM_BUILD_SHARED_LIBS=ON"
     "-DGDCM_USE_VTK=ON"
   ]
-  ++ stdenv.lib.optional enablePython [
+  ++ lib.optional enablePython [
     "-DGDCM_WRAP_PYTHON:BOOL=ON"
     "-DGDCM_INSTALL_PYTHONMODULE_DIR=${placeholder "out"}/${python.sitePackages}"
   ];
@@ -28,15 +28,15 @@ stdenv.mkDerivation rec {
     cd ../build
   '';
 
-  enableParallelBuilding = true;
-  buildInputs = [ cmake vtk_7 ]
-    ++ stdenv.lib.optional stdenv.isDarwin [
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ vtk_7 ]
+    ++ lib.optional stdenv.isDarwin [
       darwin.apple_sdk.frameworks.ApplicationServices
       darwin.apple_sdk.frameworks.Cocoa
-    ] ++ stdenv.lib.optional enablePython [ swig python ];
+    ] ++ lib.optional enablePython [ swig python ];
   propagatedBuildInputs = [ ];
 
-  meta = with stdenv.lib; {
+  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.
diff --git a/nixpkgs/pkgs/development/libraries/gdk-pixbuf/default.nix b/nixpkgs/pkgs/development/libraries/gdk-pixbuf/default.nix
index ad92bf13c4ce..2d8e60d06a73 100644
--- a/nixpkgs/pkgs/development/libraries/gdk-pixbuf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gdk-pixbuf/default.nix
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "man" "devdoc" "installedTests" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "05ggmzwvrxq9w4zcvmrnnd6qplsmb4n95lj4q607c7arzlf6mil3";
   };
 
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
     gobject-introspection
     makeWrapper
     glib
-  ] ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
+  ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
   propagatedBuildInputs = [
     glib
@@ -78,7 +78,7 @@ stdenv.mkDerivation rec {
   postInstall =
     # meson erroneously installs loaders with .dylib extension on Darwin.
     # Their @rpath has to be replaced before gdk-pixbuf-query-loaders looks at them.
-    stdenv.lib.optionalString stdenv.isDarwin ''
+    lib.optionalString stdenv.isDarwin ''
       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
@@ -88,13 +88,13 @@ stdenv.mkDerivation rec {
     + ''
       moveToOutput "bin" "$dev"
       moveToOutput "bin/gdk-pixbuf-thumbnailer" "$out"
-    '' + stdenv.lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
+    '' + 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
     '';
 
   # The fixDarwinDylibNames hook doesn't patch binaries.
-  preFixup = stdenv.lib.optionalString stdenv.isDarwin ''
+  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
@@ -124,7 +124,7 @@ stdenv.mkDerivation rec {
     moduleDir = "lib/gdk-pixbuf-2.0/2.10.0/loaders";
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/gdk-pixbuf/xlib.nix b/nixpkgs/pkgs/development/libraries/gdk-pixbuf/xlib.nix
index edc5ce525635..bc4c14beb458 100644
--- a/nixpkgs/pkgs/development/libraries/gdk-pixbuf/xlib.nix
+++ b/nixpkgs/pkgs/development/libraries/gdk-pixbuf/xlib.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitLab
 , meson
 , ninja
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
     "-Dgtk_doc=true"
   ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/gdl/default.nix b/nixpkgs/pkgs/development/libraries/gdl/default.nix
index 338d0b6b91b0..f924571deae1 100644
--- a/nixpkgs/pkgs/development/libraries/gdl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gdl/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, pkgconfig, libxml2, gtk3, gnome3, intltool }:
+{ lib, stdenv, fetchurl, pkg-config, libxml2, gtk3, gnome3, intltool }:
 
 stdenv.mkDerivation rec {
   pname = "gdl";
   version = "3.34.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/gdl/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/gdl/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "00ldva6wg6s4wlxmisiqzyz8ihsprra7sninx2rlqk6frpq312w5";
   };
 
-  nativeBuildInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkg-config intltool ];
   buildInputs = [ libxml2 gtk3 ];
 
   passthru = {
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Gnome docking library";
     homepage = "https://developer.gnome.org/gdl/";
     maintainers = teams.gnome.members;
diff --git a/nixpkgs/pkgs/development/libraries/gdome2/default.nix b/nixpkgs/pkgs/development/libraries/gdome2/default.nix
index e38cb7535b00..a7dd1f980138 100644
--- a/nixpkgs/pkgs/development/libraries/gdome2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gdome2/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, pkgconfig, glib, libxml2, gtk-doc}:
+{lib, stdenv, fetchurl, pkg-config, glib, libxml2, gtk-doc}:
 
 let
   pname = "gdome2";
@@ -15,12 +15,12 @@ stdenv.mkDerivation {
 
   hardeningDisable = [ "format" ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ glib libxml2 gtk-doc ];
   propagatedBuildInputs = [glib libxml2];
   patches = [ ./xml-document.patch ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://gdome2.cs.unibo.it/";
     description = "DOM C library developed for the Gnome project";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gecode/3.nix b/nixpkgs/pkgs/development/libraries/gecode/3.nix
index 545bdd12982e..5c660a99ef84 100644
--- a/nixpkgs/pkgs/development/libraries/gecode/3.nix
+++ b/nixpkgs/pkgs/development/libraries/gecode/3.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, bash, perl }:
+{ lib, stdenv, fetchurl, bash, perl }:
 
 stdenv.mkDerivation rec {
   pname = "gecode";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   preConfigure = "patchShebangs configure";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     license = licenses.mit;
     homepage = "https://www.gecode.org";
     description = "Toolkit for developing constraint-based systems";
diff --git a/nixpkgs/pkgs/development/libraries/gecode/default.nix b/nixpkgs/pkgs/development/libraries/gecode/default.nix
index 9d37199bff47..46b13e6e37f5 100644
--- a/nixpkgs/pkgs/development/libraries/gecode/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gecode/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, bison, flex, perl, gmp, mpfr, enableGist ? true, qtbase }:
+{ lib, stdenv, fetchFromGitHub, bison, flex, perl, gmp, mpfr, enableGist ? true, qtbase }:
 
 stdenv.mkDerivation rec {
   pname = "gecode";
@@ -14,9 +14,9 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
   nativeBuildInputs = [ bison flex ];
   buildInputs = [ perl gmp mpfr ]
-    ++ stdenv.lib.optional enableGist qtbase;
+    ++ lib.optional enableGist qtbase;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     license = licenses.mit;
     homepage = "https://www.gecode.org";
     description = "Toolkit for developing constraint-based systems";
diff --git a/nixpkgs/pkgs/development/libraries/gegl/4.0.nix b/nixpkgs/pkgs/development/libraries/gegl/4.0.nix
index c25f9145ea5e..af3c9d84ac7c 100644
--- a/nixpkgs/pkgs/development/libraries/gegl/4.0.nix
+++ b/nixpkgs/pkgs/development/libraries/gegl/4.0.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
-, pkgconfig
+, pkg-config
 , vala
 , gobject-introspection
 , gtk-doc
@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
   outputBin = "dev";
 
   src = fetchurl {
-    url = "https://download.gimp.org/pub/gegl/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "https://download.gimp.org/pub/gegl/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "sha256-DzceLtK5IWL+/T3edD5kjKCKahsrBQBIZ/vdx+IR5CQ=";
   };
 
@@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
   ];
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     gettext
     meson
     ninja
@@ -84,7 +84,7 @@ stdenv.mkDerivation rec {
     luajit
     openexr
     suitesparse
-  ] ++ stdenv.lib.optional stdenv.isDarwin OpenCL;
+  ] ++ lib.optional stdenv.isDarwin OpenCL;
 
   # for gegl-4.0.pc
   propagatedBuildInputs = [
@@ -118,7 +118,7 @@ stdenv.mkDerivation rec {
   # tests fail to connect to the com.apple.fonts daemon in sandboxed mode
   doCheck = !stdenv.isDarwin;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Graph-based image processing framework";
     homepage = "https://www.gegl.org";
     license = licenses.lgpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gegl/default.nix b/nixpkgs/pkgs/development/libraries/gegl/default.nix
index a99ec05d771c..bd67f3e6b7ca 100644
--- a/nixpkgs/pkgs/development/libraries/gegl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gegl/default.nix
@@ -1,6 +1,6 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
-, pkgconfig
+, pkg-config
 , babl
 , libpng
 , cairo
@@ -33,13 +33,13 @@ stdenv.mkDerivation rec {
   configureFlags = [ "--disable-docs" ];
 
   buildInputs = [ babl libpng cairo libjpeg librsvg pango gtk2 bzip2 intltool libintl ]
-    ++ stdenv.lib.optional stdenv.isDarwin OpenGL;
+    ++ lib.optional stdenv.isDarwin OpenGL;
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   doCheck = false; # fails 3 out of 19 tests
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Graph-based image processing framework";
     homepage = "https://www.gegl.org";
     license = licenses.lgpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/geis/default.nix b/nixpkgs/pkgs/development/libraries/geis/default.nix
index fd3924fec3ea..1c1d4cfe507b 100644
--- a/nixpkgs/pkgs/development/libraries/geis/default.nix
+++ b/nixpkgs/pkgs/development/libraries/geis/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl
-, pkgconfig
+{ lib, stdenv, fetchurl
+, pkg-config
 , python3Packages
 , wrapGAppsHook
 , atk
@@ -18,7 +18,7 @@
 , xorgserver
 }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "geis";
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
   pythonPath = with python3Packages;
     [ pygobject3  ];
 
-  nativeBuildInputs = [ pkgconfig wrapGAppsHook python3Packages.wrapPython];
+  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
   ];
diff --git a/nixpkgs/pkgs/development/libraries/genann/default.nix b/nixpkgs/pkgs/development/libraries/genann/default.nix
index 6529d4f363d8..f1d7373183ab 100644
--- a/nixpkgs/pkgs/development/libraries/genann/default.nix
+++ b/nixpkgs/pkgs/development/libraries/genann/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "genann";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     cp ./genann.{h,c} $out/include
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/codeplea/genann";
     description = "Simple neural network library in ANSI C";
     license = licenses.zlib;
diff --git a/nixpkgs/pkgs/development/libraries/gensio/default.nix b/nixpkgs/pkgs/development/libraries/gensio/default.nix
index b3bf33f0e881..a568078f9911 100644
--- a/nixpkgs/pkgs/development/libraries/gensio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gensio/default.nix
@@ -1,21 +1,42 @@
-{ stdenv, lib, fetchFromGitHub, autoreconfHook }:
+{ autoreconfHook
+, fetchFromGitHub
+, fetchpatch
+, lib
+, nix-update-script
+, pkg-config
+, stdenv
+}:
 
 stdenv.mkDerivation rec {
   pname = "gensio";
-  version = "2.1.7";
+  version = "2.2.1";
 
   src = fetchFromGitHub {
     owner = "cminyard";
     repo = pname;
     rev = "v${version}";
-    sha256 = "07m8rbdk05biarc9xskwcx9lghj0dff1msxasfc6hi3jywc3xaih";
+    sha256 = "083khzvyvcgi9j99hbaswglivm9s6dly6spjvisvyacavaybgwgb";
+  };
+
+  patches =  [
+    # Fix compilation without openipmi, can be dropped for the next release.
+    (fetchpatch {
+      url = "https://github.com/cminyard/gensio/commit/12f6203e6f7aa42172177d7b0870777b605af8d9.patch";
+      sha256 = "19dr4iacccc4il3asdxkag6cj2yc4bxd8p451syfxdm6289rwxic";
+    })
+  ];
+
+  passthru = {
+    updateScript = nix-update-script {
+      attrPath = pname;
+    };
   };
 
   configureFlags = [
     "--with-python=no"
   ];
 
-  buildInputs = [ autoreconfHook ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
   meta = with lib; {
     description = "General Stream I/O";
diff --git a/nixpkgs/pkgs/development/libraries/geoclue/default.nix b/nixpkgs/pkgs/development/libraries/geoclue/default.nix
index 74d778c5c555..711f1a444b38 100644
--- a/nixpkgs/pkgs/development/libraries/geoclue/default.nix
+++ b/nixpkgs/pkgs/development/libraries/geoclue/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchFromGitLab, intltool, meson, ninja, pkgconfig, gtk-doc, docbook_xsl, docbook_xml_dtd_412, glib, json-glib, libsoup, libnotify, gdk-pixbuf
+{ lib, stdenv, fetchFromGitLab, intltool, meson, ninja, pkg-config, gtk-doc, docbook_xsl, docbook_xml_dtd_412, glib, json-glib, libsoup, libnotify, gdk-pixbuf
 , modemmanager, avahi, glib-networking, python3, wrapGAppsHook, gobject-introspection, vala
 , withDemoAgent ? false
 }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "geoclue";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
 
   nativeBuildInputs = [
-    pkgconfig intltool meson ninja wrapGAppsHook python3 vala gobject-introspection
+    pkg-config intltool meson ninja wrapGAppsHook python3 vala gobject-introspection
     # devdoc
     gtk-doc docbook_xsl docbook_xml_dtd_412
   ];
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
     patchShebangs demo/install-file.py
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Geolocation framework and some data providers";
     homepage = "https://gitlab.freedesktop.org/geoclue/geoclue/wikis/home";
     maintainers = with maintainers; [ raskin ];
diff --git a/nixpkgs/pkgs/development/libraries/geocode-glib/default.nix b/nixpkgs/pkgs/development/libraries/geocode-glib/default.nix
index ec9bf2e5cb99..f401c25aa394 100644
--- a/nixpkgs/pkgs/development/libraries/geocode-glib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/geocode-glib/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, meson, ninja, pkgconfig, gettext, gtk-doc, docbook_xsl, gobject-introspection, gnome3, libsoup, json-glib, glib }:
+{ fetchurl, lib, stdenv, meson, ninja, pkg-config, gettext, gtk-doc, docbook_xsl, gobject-introspection, gnome3, libsoup, json-glib, glib }:
 
 stdenv.mkDerivation rec {
   pname = "geocode-glib";
@@ -7,11 +7,11 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" "installedTests" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/geocode-glib/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/geocode-glib/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1l8g0f13xgkrk335afr9w8k46mziwb2jnyhl07jccl5yl37q9zh1";
   };
 
-  nativeBuildInputs = [ meson ninja pkgconfig gettext gtk-doc docbook_xsl gobject-introspection ];
+  nativeBuildInputs = [ meson ninja pkg-config gettext gtk-doc docbook_xsl gobject-introspection ];
   buildInputs = [ glib libsoup json-glib ];
 
   patches = [
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A convenience library for the geocoding and reverse geocoding using Nominatim service";
     license = licenses.lgpl2Plus;
     maintainers = teams.gnome.members;
diff --git a/nixpkgs/pkgs/development/libraries/geoip/default.nix b/nixpkgs/pkgs/development/libraries/geoip/default.nix
index d55983952b8c..8747433047c6 100644
--- a/nixpkgs/pkgs/development/libraries/geoip/default.nix
+++ b/nixpkgs/pkgs/development/libraries/geoip/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook
+{ lib, stdenv, fetchFromGitHub, autoreconfHook
 , drvName ? "geoip"
 
 # in geoipDatabase, you can insert a package defining
@@ -7,7 +7,7 @@
 }:
 
 let
-  dataDir = if stdenv.lib.isDerivation geoipDatabase
+  dataDir = if lib.isDerivation geoipDatabase
     then "${toString geoipDatabase}/share/GeoIP"
     else geoipDatabase;
 in
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoreconfHook ];
 
   # Cross compilation shenanigans
-  configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+  configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "ac_cv_func_malloc_0_nonnull=yes"
     "ac_cv_func_realloc_0_nonnull=yes"
   ];
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
     find . -name Makefile.in -exec sed -i -r 's#^pkgdatadir\s*=.+$#pkgdatadir = ${dataDir}#' {} \;
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An API for GeoIP/Geolocation databases";
     maintainers = with maintainers; [ thoughtpolice raskin ];
     license     = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/geos/default.nix b/nixpkgs/pkgs/development/libraries/geos/default.nix
index 60fc4067c0c5..63806b31e251 100644
--- a/nixpkgs/pkgs/development/libraries/geos/default.nix
+++ b/nixpkgs/pkgs/development/libraries/geos/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python }:
+{ lib, stdenv, fetchurl, python }:
 
 stdenv.mkDerivation rec {
   name = "geos-3.8.1";
@@ -13,9 +13,9 @@ stdenv.mkDerivation rec {
   buildInputs = [ python ];
 
   # https://trac.osgeo.org/geos/ticket/993
-  configureFlags = stdenv.lib.optional stdenv.isAarch32 "--disable-inline";
+  configureFlags = lib.optional stdenv.isAarch32 "--disable-inline";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ port of the Java Topology Suite (JTS)";
     homepage = "https://trac.osgeo.org/geos";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/getdata/default.nix b/nixpkgs/pkgs/development/libraries/getdata/default.nix
index 28bbe61d53d8..de76924844fe 100644
--- a/nixpkgs/pkgs/development/libraries/getdata/default.nix
+++ b/nixpkgs/pkgs/development/libraries/getdata/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libtool }:
+{ lib, stdenv, fetchurl, libtool }:
 stdenv.mkDerivation rec {
   pname = "getdata";
   version = "0.10.0";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libtool ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Reference implementation of the Dirfile Standards";
     license = licenses.lgpl21Plus;
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/getdns/default.nix b/nixpkgs/pkgs/development/libraries/getdns/default.nix
index c0268c161aeb..edf0ac27ea97 100644
--- a/nixpkgs/pkgs/development/libraries/getdns/default.nix
+++ b/nixpkgs/pkgs/development/libraries/getdns/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unbound, libidn2, openssl, doxygen, cmake }:
+{ lib, stdenv, fetchurl, unbound, libidn2, openssl, doxygen, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "getdns";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ unbound libidn2 openssl doxygen ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A modern asynchronous DNS API";
     longDescription = ''
       getdns is an implementation of a modern asynchronous DNS API; the
diff --git a/nixpkgs/pkgs/development/libraries/gettext/default.nix b/nixpkgs/pkgs/development/libraries/gettext/default.nix
index ec186db515d4..c9ee5866f597 100644
--- a/nixpkgs/pkgs/development/libraries/gettext/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gettext/default.nix
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [
      "--disable-csharp" "--with-xz"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+  ] ++ 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
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
     xz.bin
   ];
   # HACK, see #10874 (and 14664)
-  buildInputs = stdenv.lib.optional (!stdenv.isLinux && !stdenv.hostPlatform.isCygwin) libiconv;
+  buildInputs = lib.optional (!stdenv.isLinux && !stdenv.hostPlatform.isCygwin) libiconv;
 
   setupHooks = [
     ../../../build-support/setup-hooks/role.bash
@@ -94,6 +94,6 @@ stdenv.mkDerivation rec {
   };
 }
 
-// stdenv.lib.optionalAttrs stdenv.isDarwin {
+// lib.optionalAttrs stdenv.isDarwin {
   makeFlags = [ "CFLAGS=-D_FORTIFY_SOURCE=0" ];
 }
diff --git a/nixpkgs/pkgs/development/libraries/gexiv2/default.nix b/nixpkgs/pkgs/development/libraries/gexiv2/default.nix
index 9b72ca3524cc..220b68fa18bc 100644
--- a/nixpkgs/pkgs/development/libraries/gexiv2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gexiv2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig, exiv2, glib, gnome3, gobject-introspection, vala, gtk-doc, docbook_xsl, docbook_xml_dtd_43 }:
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, exiv2, glib, gnome3, gobject-introspection, vala, gtk-doc, docbook_xsl, docbook_xml_dtd_43 }:
 
 stdenv.mkDerivation rec {
   pname = "gexiv2";
@@ -7,11 +7,11 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0xxxq8xdkgkn146my307jgws4qgxx477h0ybg1mqza1ycmczvsla";
   };
 
-  nativeBuildInputs = [ meson ninja pkgconfig gobject-introspection vala gtk-doc docbook_xsl docbook_xml_dtd_43 ];
+  nativeBuildInputs = [ meson ninja pkg-config gobject-introspection vala gtk-doc docbook_xsl docbook_xml_dtd_43 ];
   buildInputs = [ glib ];
   propagatedBuildInputs = [ exiv2 ];
 
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://wiki.gnome.org/Projects/gexiv2";
     description = "GObject wrapper around the Exiv2 photo metadata library";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/gf2x/default.nix b/nixpkgs/pkgs/development/libraries/gf2x/default.nix
index 14ea3021914a..3440697989ee 100644
--- a/nixpkgs/pkgs/development/libraries/gf2x/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gf2x/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
   ];
 
   meta = with lib; {
-    description = ''Routines for fast arithmetic in GF(2)[x]'';
+    description = "Routines for fast arithmetic in GF(2)[x]";
     homepage = "http://gf2x.gforge.inria.fr";
     license = licenses.gpl2Plus;
     maintainers = teams.sage.members;
diff --git a/nixpkgs/pkgs/development/libraries/gfbgraph/default.nix b/nixpkgs/pkgs/development/libraries/gfbgraph/default.nix
index 4718e6ac015a..e3550b82a965 100644
--- a/nixpkgs/pkgs/development/libraries/gfbgraph/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gfbgraph/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib, librest, gnome-online-accounts
+{ lib, stdenv, fetchurl, pkg-config, glib, librest, gnome-online-accounts
 , gnome3, libsoup, json-glib, gobject-introspection
 , gtk-doc, pkgs, docbook-xsl-nons, autoconf, automake, libtool }:
 
@@ -9,12 +9,12 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0yck7dwvjk16a52nafjpi0a39rxwmg0w833brj45acz76lgkjrb0";
   };
 
   nativeBuildInputs = [
-    pkgconfig gobject-introspection gtk-doc
+    pkg-config gobject-introspection gtk-doc
     docbook-xsl-nons autoconf automake libtool
   ];
   buildInputs = [ glib gnome-online-accounts ];
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://wiki.gnome.org/Projects/GFBGraph";
     description = "GLib/GObject wrapper for the Facebook Graph API";
     maintainers = teams.gnome.members;
diff --git a/nixpkgs/pkgs/development/libraries/gflags/default.nix b/nixpkgs/pkgs/development/libraries/gflags/default.nix
index 51c13f974336..a690d8f2e154 100644
--- a/nixpkgs/pkgs/development/libraries/gflags/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gflags/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake
+{ lib, stdenv, fetchFromGitHub, cmake
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
 
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  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.
diff --git a/nixpkgs/pkgs/development/libraries/ggz_base_libs/default.nix b/nixpkgs/pkgs/development/libraries/ggz_base_libs/default.nix
index 6003c5ea33ea..025423ecd8a4 100644
--- a/nixpkgs/pkgs/development/libraries/ggz_base_libs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ggz_base_libs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, intltool, openssl, expat, libgcrypt }:
+{ lib, stdenv, fetchurl, intltool, openssl, expat, libgcrypt }:
 
 stdenv.mkDerivation rec {
   version = "0.99.5";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     "--with-tls"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GGZ Gaming zone libraries";
     maintainers = with maintainers;
     [
diff --git a/nixpkgs/pkgs/development/libraries/giblib/default.nix b/nixpkgs/pkgs/development/libraries/giblib/default.nix
index 2cb7a9dfe545..e66f7bfe2a8c 100644
--- a/nixpkgs/pkgs/development/libraries/giblib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/giblib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, xlibsWrapper, imlib2 }:
+{ lib, stdenv, fetchurl, xlibsWrapper, imlib2 }:
 
 stdenv.mkDerivation rec {
   name = "giblib-1.2.4";
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://linuxbrit.co.uk/giblib/";
     description = "wrapper library for imlib2, and other stuff";
-    platforms = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.mit;
+    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
index 954e508152c2..c0afe067c499 100644
--- a/nixpkgs/pkgs/development/libraries/giflib/4.1.nix
+++ b/nixpkgs/pkgs/development/libraries/giflib/4.1.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation {
   name = "giflib-4.1.6";
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
 
   hardeningDisable = [ "format" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library for reading and writing gif images";
     branch = "4.1";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/giflib/default.nix b/nixpkgs/pkgs/development/libraries/giflib/default.nix
index e2ff96d366a2..9eaf7b933d43 100644
--- a/nixpkgs/pkgs/development/libraries/giflib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/giflib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, xmlto, docbook_xml_dtd_412, docbook_xsl, libxml2, fixDarwinDylibNames }:
+{ lib, stdenv, fetchurl, fetchpatch, xmlto, docbook_xml_dtd_412, docbook_xsl, libxml2, fixDarwinDylibNames }:
 
 stdenv.mkDerivation rec {
   name = "giflib-5.2.1";
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
     sha256 = "1gbrg03z1b6rlrvjyc6d41bc8j1bsr7rm8206gb1apscyii5bnii";
   };
 
-  patches = stdenv.lib.optional stdenv.hostPlatform.isDarwin
+  patches = lib.optional stdenv.hostPlatform.isDarwin
     (fetchpatch {
       # https://sourceforge.net/p/giflib/bugs/133/
       name = "darwin-soname.patch";
@@ -21,15 +21,15 @@ stdenv.mkDerivation rec {
       --replace 'PREFIX = /usr/local' 'PREFIX = ${builtins.placeholder "out"}'
   '';
 
-  nativeBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
+  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 = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.mit;
-    maintainers = with stdenv.lib.maintainers; [ ];
+    platforms = lib.platforms.unix;
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ ];
     branch = "5.2";
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/giflib/libungif.nix b/nixpkgs/pkgs/development/libraries/giflib/libungif.nix
index 30cfa0db86a6..d8c32d14fca2 100644
--- a/nixpkgs/pkgs/development/libraries/giflib/libungif.nix
+++ b/nixpkgs/pkgs/development/libraries/giflib/libungif.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation {
   name = "libungif-4.1.4";
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
 
   hardeningDisable = [ "format" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library and utilities for processing GIFs";
     platforms = platforms.unix;
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/gio-sharp/default.nix b/nixpkgs/pkgs/development/libraries/gio-sharp/default.nix
index a19febbfd66e..91fbb86bd669 100644
--- a/nixpkgs/pkgs/development/libraries/gio-sharp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gio-sharp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoconf, automake, which, pkgconfig, mono, glib, gtk-sharp-2_0 }:
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, which, pkg-config, mono, glib, gtk-sharp-2_0 }:
 
 stdenv.mkDerivation rec {
   pname = "gio-sharp";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "13pc529pjabj7lq23dbndc26ssmg5wkhc7lfvwapm87j711m0zig";
   };
 
-  nativeBuildInputs = [ pkgconfig autoconf automake which ];
+  nativeBuildInputs = [ pkg-config autoconf automake which ];
   buildInputs = [ mono glib gtk-sharp-2_0 ];
 
   dontStrip = true;
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     ./autogen-2.22.sh
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GIO API bindings";
     homepage = "https://github.com/mono/gio-sharp";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/git2/default.nix b/nixpkgs/pkgs/development/libraries/git2/default.nix
index 96b67c7ccca8..a118a611785e 100644
--- a/nixpkgs/pkgs/development/libraries/git2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/git2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkg-config, python3
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, python3
 , zlib, libssh2, openssl, pcre, http-parser
 , libiconv, Security
 }:
@@ -23,18 +23,16 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake python3 pkg-config ];
 
   buildInputs = [ zlib libssh2 openssl pcre http-parser ]
-    ++ stdenv.lib.optional stdenv.isDarwin Security;
+    ++ lib.optional stdenv.isDarwin Security;
 
-  propagatedBuildInputs = stdenv.lib.optional (!stdenv.isLinux) libiconv;
-
-  enableParallelBuilding = true;
+  propagatedBuildInputs = lib.optional (!stdenv.isLinux) libiconv;
 
   doCheck = false; # hangs. or very expensive?
 
   meta = {
     description = "The Git linkable library";
     homepage = "https://libgit2.github.com/";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = with stdenv.lib.platforms; all;
+    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
index debddc6723fb..dfd6b6b476b6 100644
--- a/nixpkgs/pkgs/development/libraries/givaro/3.7.nix
+++ b/nixpkgs/pkgs/development/libraries/givaro/3.7.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, automake, autoconf, libtool, autoreconfHook, gmpxx}:
+{lib, stdenv, fetchurl, automake, autoconf, libtool, autoreconfHook, gmpxx}:
 stdenv.mkDerivation rec {
   pname = "givaro";
   version = "3.7.2";
@@ -10,9 +10,9 @@ stdenv.mkDerivation rec {
   buildInputs = [autoconf automake libtool gmpxx];
   meta = {
     inherit version;
-    description = ''A C++ library for arithmetic and algebraic computations'';
-    license = stdenv.lib.licenses.cecill-b;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    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
index efed0926bb32..9d216b9d8e5c 100644
--- a/nixpkgs/pkgs/development/libraries/givaro/3.nix
+++ b/nixpkgs/pkgs/development/libraries/givaro/3.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, automake, autoconf, libtool, autoreconfHook, gmpxx}:
+{lib, stdenv, fetchurl, automake, autoconf, libtool, autoreconfHook, gmpxx}:
 stdenv.mkDerivation rec {
   pname = "givaro";
   version = "3.8.0";
@@ -10,9 +10,9 @@ stdenv.mkDerivation rec {
   buildInputs = [autoconf automake libtool gmpxx];
   meta = {
     inherit version;
-    description = ''A C++ library for arithmetic and algebraic computations'';
-    license = stdenv.lib.licenses.cecill-b;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    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
index 78b6b0882707..f6d6ddab4d0b 100644
--- a/nixpkgs/pkgs/development/libraries/givaro/default.nix
+++ b/nixpkgs/pkgs/development/libraries/givaro/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, automake, autoconf, libtool, autoreconfHook, gmpxx }:
+{ lib, stdenv, fetchFromGitHub, automake, autoconf, libtool, autoreconfHook, gmpxx }:
 stdenv.mkDerivation rec {
   pname = "givaro";
   version = "4.1.1";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [
     "--disable-optimization"
-  ] ++ stdenv.lib.optionals stdenv.isx86_64 [
+  ] ++ 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"
@@ -37,9 +37,9 @@ stdenv.mkDerivation rec {
 
   meta = {
     inherit version;
-    description = ''A C++ library for arithmetic and algebraic computations'';
-    license = stdenv.lib.licenses.cecill-b;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.unix;
+    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
index 9437d76335d0..a6b37c5efcc2 100644
--- a/nixpkgs/pkgs/development/libraries/gjs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gjs/default.nix
@@ -1,9 +1,9 @@
 { fetchurl
 , fetchpatch
-, stdenv
+, lib, stdenv
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , gnome3
 , gtk3
 , atk
@@ -32,7 +32,7 @@ in stdenv.mkDerivation rec {
   version = "1.66.1";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/gjs/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/gjs/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0k1ld2bc4c3zbyjpfgx15v5n02iywdvm106rys5jqr7zbr2l0hld";
   };
 
@@ -41,7 +41,7 @@ in stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     makeWrapper
     which # for locale detection
     libxml2 # for xml-stripblanks
@@ -105,7 +105,7 @@ in stdenv.mkDerivation rec {
   postFixup = ''
     wrapProgram "$installedTests/libexec/installed-tests/gjs/minijasmine" \
       --prefix XDG_DATA_DIRS : "$installedTestsSchemaDatadir" \
-      --prefix GI_TYPELIB_PATH : "${stdenv.lib.makeSearchPath "lib/girepository-1.0" testDeps}"
+      --prefix GI_TYPELIB_PATH : "${lib.makeSearchPath "lib/girepository-1.0" testDeps}"
   '';
 
   checkPhase = ''
@@ -127,7 +127,7 @@ in stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "JavaScript bindings for GNOME";
     homepage = "https://gitlab.gnome.org/GNOME/gjs/blob/master/doc/Home.md";
     license = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gl2ps/default.nix b/nixpkgs/pkgs/development/libraries/gl2ps/default.nix
index 172531f9dc7c..0203e2fde93a 100644
--- a/nixpkgs/pkgs/development/libraries/gl2ps/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gl2ps/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , cmake
 , zlib
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     freeglut
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://geuz.org/gl2ps";
     description = "An OpenGL to PostScript printing library";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/glbinding/default.nix b/nixpkgs/pkgs/development/libraries/glbinding/default.nix
index 9ce5a23f9705..1b36baa24e42 100644
--- a/nixpkgs/pkgs/development/libraries/glbinding/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glbinding/default.nix
@@ -1,4 +1,5 @@
-{ stdenv, fetchFromGitHub, cmake, libGLU, xlibsWrapper }:
+{ lib, stdenv, fetchFromGitHub, cmake, libGLU, xlibsWrapper }:
+
 stdenv.mkDerivation rec {
   pname = "glbinding";
   version = "3.1.0";
@@ -10,9 +11,10 @@ stdenv.mkDerivation rec {
     sha256 = "1avd7ssms11xx7h0cm8h4pfpk55f07f1j1ybykxfgsym2chb2z08";
   };
 
-  buildInputs = [ cmake libGLU xlibsWrapper ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libGLU xlibsWrapper ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/gle/default.nix b/nixpkgs/pkgs/development/libraries/gle/default.nix
index d656473ba807..b7a4f7f2fef1 100644
--- a/nixpkgs/pkgs/development/libraries/gle/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gle/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, freeglut, libX11, libXt, libXmu, libXi, libXext, libGL, libGLU}:
+{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];
@@ -10,9 +10,9 @@ stdenv.mkDerivation {
     sha256 = "09zs1di4dsssl9k322nzildvf41jwipbzhik9p43yb1bcfsp92nw";
   };
   meta = {
-    description = ''Tubing and extrusion library'';
-    license = stdenv.lib.licenses.gpl2 ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    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
index 139b93c039ec..29376cb25672 100644
--- a/nixpkgs/pkgs/development/libraries/glew/1.10.nix
+++ b/nixpkgs/pkgs/development/libraries/glew/1.10.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchurl, libGLU, xlibsWrapper, libXmu, libXi
+{ lib, stdenv, fetchurl, libGLU, xlibsWrapper, libXmu, libXi
 , AGL, OpenGL
 }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   name = "glew-1.10.0";
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
     "SYSTEM=${if stdenv.hostPlatform.isMinGW then "mingw" else stdenv.hostPlatform.parsed.kernel.name}"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An OpenGL extension loading library for C(++)";
     homepage = "http://glew.sourceforge.net/";
     license = licenses.free; # different files under different licenses
diff --git a/nixpkgs/pkgs/development/libraries/glew/default.nix b/nixpkgs/pkgs/development/libraries/glew/default.nix
index 3b067e6d0f30..660276530aa8 100644
--- a/nixpkgs/pkgs/development/libraries/glew/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glew/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchurl, libGLU, xlibsWrapper, libXmu, libXi
+{ lib, stdenv, fetchurl, libGLU, xlibsWrapper, libXmu, libXi
 , OpenGL
 }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   name = "glew-2.2.0";
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An OpenGL extension loading library for C(++)";
     homepage = "http://glew.sourceforge.net/";
     license = licenses.free; # different files under different licenses
diff --git a/nixpkgs/pkgs/development/libraries/glfw/2.x.nix b/nixpkgs/pkgs/development/libraries/glfw/2.x.nix
index e749ca733daa..d05fa6e5f772 100644
--- a/nixpkgs/pkgs/development/libraries/glfw/2.x.nix
+++ b/nixpkgs/pkgs/development/libraries/glfw/2.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libGLU, libGL, libX11, libXext }:
+{ lib, stdenv, fetchurl, libGLU, libGL, libX11, libXext }:
 
 stdenv.mkDerivation rec {
   name = "glfw-2.7.9";
@@ -19,13 +19,13 @@ stdenv.mkDerivation rec {
     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 stdenv.lib; { 
+  '';
+
+  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 = [ stdenv.lib.maintainers.marcweber ];
+    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
index fbc1cb818ca8..8698b71567e2 100644
--- a/nixpkgs/pkgs/development/libraries/glfw/3.x.nix
+++ b/nixpkgs/pkgs/development/libraries/glfw/3.x.nix
@@ -14,8 +14,6 @@ stdenv.mkDerivation rec {
     sha256 = "0b5lsxz1xkzip7fvbicjkxvg5ig8gbhx1zrlhandqc0rpk56bvyw";
   };
 
-  enableParallelBuilding = true;
-
   propagatedBuildInputs = [ libGL ];
 
   nativeBuildInputs = [ cmake ]
@@ -30,7 +28,7 @@ stdenv.mkDerivation rec {
     substituteInPlace src/glx_context.c --replace "libGL.so.1" "${lib.getLib libGL}/lib/libGL.so.1"
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/glib-networking/default.nix b/nixpkgs/pkgs/development/libraries/glib-networking/default.nix
index fc85b50e07f3..585897341662 100644
--- a/nixpkgs/pkgs/development/libraries/glib-networking/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glib-networking/default.nix
@@ -1,10 +1,10 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , substituteAll
 , meson
 , ninja
 , nixosTests
-, pkgconfig
+, pkg-config
 , glib
 , gettext
 , makeWrapper
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "installedTests" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "16807qwflbghp0c66jdx2gnaffvdp4bla35ppzp9dlgx6wjbxmy5";
   };
 
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     gettext
     makeWrapper
     python3 # for install_script
@@ -83,7 +83,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Network-related giomodules for glib";
     homepage = "https://gitlab.gnome.org/GNOME/glib-networking";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/glib-testing/default.nix b/nixpkgs/pkgs/development/libraries/glib-testing/default.nix
index 085dfc7344f5..bdbced24a10e 100644
--- a/nixpkgs/pkgs/development/libraries/glib-testing/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glib-testing/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitLab
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , gtk-doc
 , docbook-xsl-nons
 , docbook_xml_dtd_43
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     gtk-doc
     docbook-xsl-nons
     docbook_xml_dtd_43
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/glib/default.nix b/nixpkgs/pkgs/development/libraries/glib/default.nix
index 57f05d410fbf..0e8ed605a2d6 100644
--- a/nixpkgs/pkgs/development/libraries/glib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glib/default.nix
@@ -1,4 +1,4 @@
-{ config, stdenv, fetchurl, gettext, meson, ninja, pkgconfig, perl, python3
+{ config, lib, stdenv, fetchurl, gettext, meson, ninja, pkg-config, perl, python3
 , libiconv, zlib, libffi, pcre, libelf, gnome3, 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
@@ -11,7 +11,7 @@
 , darwin, fetchpatch
 }:
 
-with stdenv.lib;
+with lib;
 
 assert stdenv.isLinux -> util-linuxMinimal != null;
 
@@ -29,7 +29,7 @@ assert stdenv.isLinux -> util-linuxMinimal != null;
   * Support org.freedesktop.Application, including D-Bus activation from desktop files
 */
 let
-  # Some packages don't get "Cflags" from pkgconfig correctly
+  # 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.
@@ -48,7 +48,7 @@ stdenv.mkDerivation rec {
   version = "2.66.4";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/glib/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/glib/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "l9+GcOMvn9T3OSsJgOZh3WJQEgFdWDUNoeWOND9K+YQ=";
   };
 
@@ -100,7 +100,7 @@ stdenv.mkDerivation rec {
   ]);
 
   nativeBuildInputs = [
-    meson ninja pkgconfig perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45
+    meson ninja pkg-config perl python3 gettext gtk-doc docbook_xsl docbook_xml_dtd_45
   ];
 
   propagatedBuildInputs = [ zlib libffi gettext libiconv ];
@@ -110,7 +110,7 @@ stdenv.mkDerivation rec {
     # Instead we just copy them over from the native output.
     "-Dgtk_doc=${boolToString (stdenv.hostPlatform == stdenv.buildPlatform)}"
     "-Dnls=enabled"
-    "-Ddevbindir=${placeholder ''dev''}/bin"
+    "-Ddevbindir=${placeholder "dev"}/bin"
   ];
 
   NIX_CFLAGS_COMPILE = toString [
@@ -182,7 +182,7 @@ stdenv.mkDerivation rec {
     updateScript = gnome3.updateScript { packageName = "glib"; };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C library of programming buildings blocks";
     homepage    = "https://www.gtk.org/";
     license     = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/glibc/2.32-10.patch.gz b/nixpkgs/pkgs/development/libraries/glibc/2.32-25.patch.gz
index 6141f08efadb..d26ba012df60 100644
--- a/nixpkgs/pkgs/development/libraries/glibc/2.32-10.patch.gz
+++ b/nixpkgs/pkgs/development/libraries/glibc/2.32-25.patch.gz
Binary files differdiff --git a/nixpkgs/pkgs/development/libraries/glibc/common.nix b/nixpkgs/pkgs/development/libraries/glibc/common.nix
index 74f8329788a5..6637a9bb2a39 100644
--- a/nixpkgs/pkgs/development/libraries/glibc/common.nix
+++ b/nixpkgs/pkgs/development/libraries/glibc/common.nix
@@ -42,7 +42,7 @@
 
 let
   version = "2.32";
-  patchSuffix = "-10";
+  patchSuffix = "-25";
   sha256 = "0di848ibffrnwq7g2dvgqrnn4xqhj3h96csn69q4da51ymafl9qn";
 in
 
@@ -59,14 +59,14 @@ stdenv.mkDerivation ({
 
   patches =
     [
-      /* No tarballs for stable upstream branch, only https://sourceware.org/git/?p=glibc.git
+      /* No tarballs for stable upstream branch, only https://sourceware.org/git/glibc.git
          and using git or something would complicate bootstrapping.
-         Fortunately it's not too big with 2.32-10.
+         Fortunately it's not too big.
           $ git checkout release/2.32/master; git describe
-          glibc-2.32-10-g0b9460d22e
-          $ git show --reverse glibc-2.32.. | gzip -n -9 --rsyncable - > 2.32-10.patch.gz
+          glibc-2.32-25-g0d9793e82a
+          $ git show --reverse glibc-2.32.. | gzip -n -9 --rsyncable - > 2.32-25.patch.gz
        */
-      ./2.32-10.patch.gz
+      ./2.32-25.patch.gz
 
       /* Allow NixOS and Nix to handle the locale-archive. */
       ./nix-locale-archive.patch
@@ -158,7 +158,7 @@ stdenv.mkDerivation ({
       "--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.platform.gcc.float or (stdenv.hostPlatform.parsed.abi.float or "hard") == "soft"))
+         (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"
diff --git a/nixpkgs/pkgs/development/libraries/glibc/default.nix b/nixpkgs/pkgs/development/libraries/glibc/default.nix
index 150681ebda18..9043c8fd0d4f 100644
--- a/nixpkgs/pkgs/development/libraries/glibc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glibc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, callPackage
+{ lib, stdenv, callPackage
 , withLinuxHeaders ? true
 , profilingLibraries ? false
 , withGd ? false
@@ -14,7 +14,7 @@ let
 in
 
 callPackage ./common.nix { inherit stdenv; } {
-    name = "glibc" + stdenv.lib.optionalString withGd "-gd";
+    name = "glibc" + lib.optionalString withGd "-gd";
 
     inherit withLinuxHeaders profilingLibraries withGd;
 
@@ -46,15 +46,15 @@ callPackage ./common.nix { inherit stdenv; } {
     hardeningDisable = [ "stackprotector" "fortify" ]
     # XXX: Not actually musl-speciic but since only musl enables pie by default,
     #      limit rebuilds by only disabling pie w/musl
-      ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "pie";
+      ++ lib.optional stdenv.hostPlatform.isMusl "pie";
 
-    NIX_CFLAGS_COMPILE = stdenv.lib.concatStringsSep " "
+    NIX_CFLAGS_COMPILE = lib.concatStringsSep " "
       (builtins.concatLists [
-        (stdenv.lib.optionals withGd gdCflags)
+        (lib.optionals withGd gdCflags)
         # Fix -Werror build failure when building glibc with musl with GCC >= 8, see:
         # https://github.com/NixOS/nixpkgs/pull/68244#issuecomment-544307798
-        (stdenv.lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias")
-        (stdenv.lib.optionals ((stdenv.hostPlatform != stdenv.buildPlatform) || stdenv.hostPlatform.isMusl) [
+        (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
@@ -81,14 +81,14 @@ callPackage ./common.nix { inherit stdenv; } {
     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 stdenv.lib.optionalString stdenv.buildPlatform.isLinux ''
+    '' 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
-      ${stdenv.lib.getBin buildPackages.glibc}/bin/localedef \
+      ${lib.getBin buildPackages.glibc}/bin/localedef \
         --alias-file=../intl/locale.alias \
         -i locales/C \
         -f charmaps/UTF-8 \
@@ -122,7 +122,7 @@ callPackage ./common.nix { inherit stdenv; } {
     ''
       # For some reason these aren't stripped otherwise and retain reference
       # to bootstrap-tools; on cross-arm this stripping would break objects.
-    + stdenv.lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
+    + lib.optionalString (stdenv.hostPlatform == stdenv.buildPlatform) ''
 
       for i in "$out"/lib/*.a; do
           [ "$i" = "$out/lib/libm.a" ] || $STRIP -S "$i"
diff --git a/nixpkgs/pkgs/development/libraries/glibc/locales.nix b/nixpkgs/pkgs/development/libraries/glibc/locales.nix
index 0dc191974155..238cebf6209f 100644
--- a/nixpkgs/pkgs/development/libraries/glibc/locales.nix
+++ b/nixpkgs/pkgs/development/libraries/glibc/locales.nix
@@ -6,7 +6,7 @@
    https://sourceware.org/git/?p=glibc.git;a=blob;f=localedata/SUPPORTED
 */
 
-{ stdenv, buildPackages, callPackage, writeText
+{ lib, stdenv, buildPackages, callPackage, writeText
 , allLocales ? true, locales ? [ "en_US.UTF-8/UTF-8" ]
 }:
 
@@ -31,9 +31,9 @@ callPackage ./common.nix { inherit stdenv; } {
       # 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
     ''
-      + stdenv.lib.optionalString (!allLocales) ''
+      + lib.optionalString (!allLocales) ''
       # Check that all locales to be built are supported
-      echo -n '${stdenv.lib.concatMapStrings (s: s + " \\\n") locales}' \
+      echo -n '${lib.concatMapStrings (s: s + " \\\n") locales}' \
         | sort > locales-to-build.txt
       cat ../glibc-2*/localedata/SUPPORTED | grep ' \\' \
         | sort > locales-supported.txt
diff --git a/nixpkgs/pkgs/development/libraries/glibmm/default.nix b/nixpkgs/pkgs/development/libraries/glibmm/default.nix
index 53e924b1325a..19567a987212 100644
--- a/nixpkgs/pkgs/development/libraries/glibmm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glibmm/default.nix
@@ -1,23 +1,23 @@
-{ stdenv, fetchurl, pkgconfig, gnum4, glib, libsigcxx, gnome3, darwin }:
+{ lib, stdenv, fetchurl, pkg-config, gnum4, glib, libsigcxx, gnome3, darwin }:
 
 stdenv.mkDerivation rec {
   pname = "glibmm";
   version = "2.64.2";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1v6lp23fr2qh4zshcnm28sn29j3nzgsvcqj2nhmrnvamipjq4lm7";
   };
 
   outputs = [ "out" "dev" ];
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     gnum4
     glib # for glib-compile-schemas
   ];
 
-  buildInputs = stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+  buildInputs = lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
     Cocoa
   ]);
   propagatedBuildInputs = [ glib libsigcxx ];
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ interface to the GLib library";
 
     homepage = "https://gtkmm.org/";
diff --git a/nixpkgs/pkgs/development/libraries/glm/default.nix b/nixpkgs/pkgs/development/libraries/glm/default.nix
index cb0ae47acded..f5652a61c1de 100644
--- a/nixpkgs/pkgs/development/libraries/glm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchzip, cmake }:
+{ lib, stdenv, fetchurl, fetchzip, cmake }:
 
 stdenv.mkDerivation rec {
   version = "0.9.8.5";
@@ -27,14 +27,14 @@ stdenv.mkDerivation rec {
     cp ${gcc7PlatformPatch} glm/simd/platform.h
   '';
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-DGLM_COMPILER=0";
+  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 stdenv.lib; {
+  meta = with lib; {
     description = "OpenGL Mathematics library for C++";
     longDescription = ''
       OpenGL Mathematics (GLM) is a header only C++ mathematics library for
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
     homepage = "http://glm.g-truc.net/";
     license = licenses.mit;
     platforms = platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ ];
+    maintainers = with lib.maintainers; [ ];
   };
 }
 
diff --git a/nixpkgs/pkgs/development/libraries/globalarrays/default.nix b/nixpkgs/pkgs/development/libraries/globalarrays/default.nix
index 5f700f73515a..1f70946cbcec 100644
--- a/nixpkgs/pkgs/development/libraries/globalarrays/default.nix
+++ b/nixpkgs/pkgs/development/libraries/globalarrays/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchpatch, fetchFromGitHub, autoreconfHook
-, blas, gfortran, openssh, openmpi
+{ lib, stdenv, fetchpatch, fetchFromGitHub, autoreconfHook
+, blas, gfortran, openssh, mpi
 } :
 
 let
@@ -17,7 +17,7 @@ in stdenv.mkDerivation {
   };
 
   nativeBuildInputs = [ autoreconfHook ];
-  buildInputs = [ openmpi blas gfortran openssh ];
+  buildInputs = [ mpi blas gfortran openssh ];
 
   preConfigure = ''
     configureFlagsArray+=( "--enable-i8" \
@@ -30,7 +30,7 @@ in stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Global Arrays Programming Models";
     homepage = "http://hpc.pnl.gov/globalarrays/";
     maintainers = [ maintainers.markuskowa ];
diff --git a/nixpkgs/pkgs/development/libraries/globalplatform/default.nix b/nixpkgs/pkgs/development/libraries/globalplatform/default.nix
index 3ab157598a4e..a8dfa430f599 100644
--- a/nixpkgs/pkgs/development/libraries/globalplatform/default.nix
+++ b/nixpkgs/pkgs/development/libraries/globalplatform/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, zlib, openssl_1_0_2, pcsclite }:
+{ lib, stdenv, fetchurl, pkg-config, zlib, openssl_1_0_2, pcsclite }:
 
 stdenv.mkDerivation rec {
   pname = "globalplatform";
@@ -9,10 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "191s9005xbc7i90bzjk4rlw15licd6m0rls9fxli8jyymz2021zy";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ zlib openssl_1_0_2 pcsclite ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://sourceforge.net/p/globalplatform/wiki/Home/";
     description = "Library for interacting with smart card devices";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/globalplatform/gppcscconnectionplugin.nix b/nixpkgs/pkgs/development/libraries/globalplatform/gppcscconnectionplugin.nix
index 043be9e91b50..a3ea4305bea7 100644
--- a/nixpkgs/pkgs/development/libraries/globalplatform/gppcscconnectionplugin.nix
+++ b/nixpkgs/pkgs/development/libraries/globalplatform/gppcscconnectionplugin.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, globalplatform, openssl_1_0_2, pcsclite }:
+{ lib, stdenv, fetchurl, pkg-config, globalplatform, openssl_1_0_2, pcsclite }:
 
 stdenv.mkDerivation rec {
   pname = "gppcscconnectionplugin";
@@ -9,10 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "0d3vcrh9z55rbal0dchmj661pqqrav9c400bx1c46grcl1q022ad";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ globalplatform openssl_1_0_2 pcsclite ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://sourceforge.net/p/globalplatform/wiki/Home/";
     description = "GlobalPlatform pcsc connection plugin";
     license = [ licenses.lgpl3 licenses.gpl3 ];
diff --git a/nixpkgs/pkgs/development/libraries/glog/default.nix b/nixpkgs/pkgs/development/libraries/glog/default.nix
index aa846e41d550..4bb20ebfd93e 100644
--- a/nixpkgs/pkgs/development/libraries/glog/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glog/default.nix
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
   checkInputs = [ perl ];
   doCheck = false; # fails with "Mangled symbols (28 out of 380) found in demangle.dm"
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/google/glog";
     license = licenses.bsd3;
     description = "Library for application-level logging";
diff --git a/nixpkgs/pkgs/development/libraries/gloox/default.nix b/nixpkgs/pkgs/development/libraries/gloox/default.nix
index ef731b3c35a6..b01d858cfb92 100644
--- a/nixpkgs/pkgs/development/libraries/gloox/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gloox/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , zlibSupport ? true, zlib ? null
 , sslSupport ? true, openssl ? null
 , idnSupport ? true, libidn ? null
@@ -8,7 +8,7 @@ assert zlibSupport -> zlib != null;
 assert sslSupport -> openssl != null;
 assert idnSupport -> libidn != null;
 
-with stdenv.lib;
+with lib;
 
 let
   version = "1.0.24";
diff --git a/nixpkgs/pkgs/development/libraries/glpk/default.nix b/nixpkgs/pkgs/development/libraries/glpk/default.nix
index d771f7df7892..a46c84844e89 100644
--- a/nixpkgs/pkgs/development/libraries/glpk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glpk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
 , libmysqlclient
@@ -24,11 +24,11 @@ stdenv.mkDerivation rec {
 
   buildInputs =
     [ libmysqlclient
-    ] ++ stdenv.lib.optionals withGmp [
+    ] ++ lib.optionals withGmp [
       gmp
     ];
 
-  configureFlags = stdenv.lib.optionals withGmp [
+  configureFlags = lib.optionals withGmp [
     "--with-gmp"
   ];
 
@@ -59,7 +59,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The GNU Linear Programming Kit";
 
     longDescription =
diff --git a/nixpkgs/pkgs/development/libraries/glui/default.nix b/nixpkgs/pkgs/development/libraries/glui/default.nix
index d84a9227c3b8..511ec60db2fb 100644
--- a/nixpkgs/pkgs/development/libraries/glui/default.nix
+++ b/nixpkgs/pkgs/development/libraries/glui/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , freeglut
 , libGL
@@ -31,8 +31,8 @@ stdenv.mkDerivation rec {
     cp LICENSE.txt "$out/share/glui/doc"
   '';
 
-  meta = with stdenv.lib; {
-    description = ''A user interface library using OpenGL'';
+  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
index c902aac23a14..0e10d12ed1f1 100644
--- a/nixpkgs/pkgs/development/libraries/gmime/2.nix
+++ b/nixpkgs/pkgs/development/libraries/gmime/2.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib, zlib, gnupg, libgpgerror, gobject-introspection }:
+{ lib, stdenv, fetchurl, pkg-config, glib, zlib, gnupg, libgpgerror, gobject-introspection }:
 
 stdenv.mkDerivation rec {
   version = "2.6.23";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig gobject-introspection ];
+  nativeBuildInputs = [ pkg-config gobject-introspection ];
   propagatedBuildInputs = [ glib zlib libgpgerror ];
   configureFlags = [ "--enable-introspection=yes" ];
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/gmime/3.nix b/nixpkgs/pkgs/development/libraries/gmime/3.nix
index f2ba29d461e7..a8e39047256c 100644
--- a/nixpkgs/pkgs/development/libraries/gmime/3.nix
+++ b/nixpkgs/pkgs/development/libraries/gmime/3.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib, zlib, gnupg, gpgme, libidn2, libunistring, gobject-introspection
+{ lib, stdenv, fetchurl, pkg-config, glib, zlib, gnupg, gpgme, libidn2, libunistring, gobject-introspection
 , vala }:
 
 stdenv.mkDerivation rec {
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   buildInputs = [ vala gobject-introspection zlib gpgme libidn2 libunistring ];
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   propagatedBuildInputs = [ glib ];
   configureFlags = [
     "--enable-introspection=yes"
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/gmm/default.nix b/nixpkgs/pkgs/development/libraries/gmm/default.nix
index 278059465ecb..3c145b3c1e38 100644
--- a/nixpkgs/pkgs/development/libraries/gmm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gmm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "gmm";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0mhygfpsdyr0d4h3sn6g7nxn149yrlqv7r2h34yqkrpv1q4daqvi";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Generic C++ template library for sparse, dense and skyline matrices";
     homepage = "http://getfem.org/gmm.html";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gmp/4.3.2.nix b/nixpkgs/pkgs/development/libraries/gmp/4.3.2.nix
index 29310aa9f00e..ce870581f5e9 100644
--- a/nixpkgs/pkgs/development/libraries/gmp/4.3.2.nix
+++ b/nixpkgs/pkgs/development/libraries/gmp/4.3.2.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, m4, cxx ? true }:
+{ lib, stdenv, fetchurl, m4, cxx ? true }:
 
 let self = stdenv.mkDerivation rec {
   name = "gmp-4.3.2";
@@ -28,8 +28,8 @@ let self = stdenv.mkDerivation rec {
     else ''echo "Darwin host is `./config.guess`."'';
 
   configureFlags = [
-    (stdenv.lib.enableFeature cxx "cxx")
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+    (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"
   ];
@@ -65,10 +65,10 @@ let self = stdenv.mkDerivation rec {
       '';
 
     homepage = "https://gmplib.org/";
-    license = stdenv.lib.licenses.lgpl3Plus;
+    license = lib.licenses.lgpl3Plus;
 
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
     badPlatforms = [ "x86_64-darwin" ];
   };
 };
diff --git a/nixpkgs/pkgs/development/libraries/gmp/5.1.x.nix b/nixpkgs/pkgs/development/libraries/gmp/5.1.x.nix
index a514934e9645..73061a3d2efd 100644
--- a/nixpkgs/pkgs/development/libraries/gmp/5.1.x.nix
+++ b/nixpkgs/pkgs/development/libraries/gmp/5.1.x.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl, m4
+{ lib, stdenv, fetchurl, m4
 , cxx ? true
 , withStatic ? stdenv.hostPlatform.isStatic
 }:
 
-let inherit (stdenv.lib) optional; in
+let inherit (lib) optional; in
 
 let self = stdenv.mkDerivation rec {
   name = "gmp-5.1.3";
@@ -25,13 +25,13 @@ let self = stdenv.mkDerivation rec {
 
   configureFlags = [
     "--with-pic"
-    (stdenv.lib.enableFeature cxx "cxx")
+    (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
-    (stdenv.lib.enableFeature (!stdenv.isSunOS && stdenv.hostPlatform.isx86) "fat")
+    (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.
@@ -46,7 +46,7 @@ let self = stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://gmplib.org/";
     description = "GNU multiple precision arithmetic library";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gmp/6.x.nix b/nixpkgs/pkgs/development/libraries/gmp/6.x.nix
index 522976d3ab2c..bf03bf08779b 100644
--- a/nixpkgs/pkgs/development/libraries/gmp/6.x.nix
+++ b/nixpkgs/pkgs/development/libraries/gmp/6.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, m4
+{ lib, stdenv, fetchurl, m4
 , cxx ? !stdenv.hostPlatform.useAndroidPrebuilt && !stdenv.hostPlatform.isWasm
 , buildPackages
 , withStatic ? stdenv.hostPlatform.isStatic
@@ -9,7 +9,7 @@
 # cgit) that are needed here should be included directly in Nixpkgs as
 # files.
 
-let inherit (stdenv.lib) optional; in
+let inherit (lib) optional; in
 
 let self = stdenv.mkDerivation rec {
   name = "gmp-6.2.1";
@@ -30,13 +30,13 @@ let self = stdenv.mkDerivation rec {
 
   configureFlags = [
     "--with-pic"
-    (stdenv.lib.enableFeature cxx "cxx")
+    (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
-    (stdenv.lib.enableFeature (!stdenv.isSunOS && stdenv.hostPlatform.isx86) "fat")
+    (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.
@@ -54,7 +54,7 @@ let self = stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://gmplib.org/";
     description = "GNU multiple precision arithmetic library";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gmtk/default.nix b/nixpkgs/pkgs/development/libraries/gmtk/default.nix
index f6516815bb92..6f2906a8234e 100644
--- a/nixpkgs/pkgs/development/libraries/gmtk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gmtk/default.nix
@@ -1,4 +1,4 @@
-{stdenv, substituteAll, fetchFromGitHub, libtool, pkgconfig, intltool, glib, gtk3
+{lib, stdenv, substituteAll, fetchFromGitHub, libtool, pkg-config, intltool, glib, gtk3
 , libpulseaudio, mplayer, gnome_mplayer }:
 
 stdenv.mkDerivation rec {
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "1zb5m1y1gckal3140gvx31572a6xpccwfmdwa1w5lx2wdq1pwk1i";
   };
 
-  nativeBuildInputs = [ libtool pkgconfig intltool ];
+  nativeBuildInputs = [ libtool pkg-config intltool ];
   buildInputs = [ glib gtk3 libpulseaudio ];
 
   patches = [
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Common functions for gnome-mplayer and gecko-mediaplayer";
     homepage = "https://sites.google.com/site/kdekorte2/gnomemplayer";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/gnet/default.nix b/nixpkgs/pkgs/development/libraries/gnet/default.nix
index 749b021890ac..8f35407f9ddd 100644
--- a/nixpkgs/pkgs/development/libraries/gnet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gnet/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, pkgconfig, autoconf, automake, glib, libtool }:
+{lib, stdenv, fetchFromGitHub, pkg-config, autoconf, automake, glib, libtool }:
 
 stdenv.mkDerivation {
   name = "gnet-2.0.8";
@@ -9,12 +9,12 @@ stdenv.mkDerivation {
     sha256 = "1cy78kglzi235md964ikvm0rg801bx0yk9ya8zavndjnaarzqq87";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ autoconf automake glib libtool ];
 
   preConfigure = "./autogen.sh";
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/gnome-menus/default.nix b/nixpkgs/pkgs/development/libraries/gnome-menus/default.nix
index f8e25640f29a..c8e77148c6d8 100644
--- a/nixpkgs/pkgs/development/libraries/gnome-menus/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gnome-menus/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, pkgconfig, gettext, glib, gobject-introspection, gnome3 }:
+{ lib, stdenv, fetchurl, pkg-config, gettext, glib, gobject-introspection, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "gnome-menus";
   version = "3.36.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "07xvaf8s0fiv0035nk8zpzymn5www76w2a1vflrgqmp9plw8yd6r";
   };
 
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     "INTROSPECTION_TYPELIBDIR=${placeholder "out"}/lib/girepository-1.0"
   ];
 
-  nativeBuildInputs = [ pkgconfig gettext ];
+  nativeBuildInputs = [ pkg-config gettext ];
   buildInputs = [ glib gobject-introspection ];
 
   passthru = {
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/gnome-online-accounts/default.nix b/nixpkgs/pkgs/development/libraries/gnome-online-accounts/default.nix
index 342cfcbc4da2..c5846b523cd2 100644
--- a/nixpkgs/pkgs/development/libraries/gnome-online-accounts/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gnome-online-accounts/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitLab
 , pkg-config
 , vala
@@ -95,7 +95,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://wiki.gnome.org/Projects/GnomeOnlineAccounts";
     description = "Single sign-on framework for GNOME";
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/gnome-sharp/default.nix b/nixpkgs/pkgs/development/libraries/gnome-sharp/default.nix
index 5926f59cc37e..4aa510f36068 100644
--- a/nixpkgs/pkgs/development/libraries/gnome-sharp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gnome-sharp/default.nix
@@ -1,7 +1,7 @@
 { stdenv
 , lib
 , fetchFromGitHub
-, pkgconfig
+, pkg-config
 , gtk2
 , mono
 , gtk-sharp-2_0
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     sha256 = "15jsm6n0sih0nf3w8vmvik97q7l3imz4vkdzmp9k7bssiz4glj1z";
   };
 
-  nativeBuildInputs = [ pkgconfig autoconf automake libtool which ];
+  nativeBuildInputs = [ pkg-config autoconf automake libtool which ];
   buildInputs = [ gtk2 mono gtk-sharp-2_0 ]
   ++ (with gnome2; [ libart_lgpl gnome_vfs libgnome libgnomecanvas libgnomeui ]);
 
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
 
   dontStrip = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.mono-project.com/docs/gui/gtksharp/";
     description = "A .NET language binding for assorted GNOME libraries";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/gnome-video-effects/default.nix b/nixpkgs/pkgs/development/libraries/gnome-video-effects/default.nix
index dfbb2c3b1e67..a2206c19b1b4 100644
--- a/nixpkgs/pkgs/development/libraries/gnome-video-effects/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gnome-video-effects/default.nix
@@ -1,6 +1,6 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
-, pkgconfig
+, pkg-config
 , meson
 , ninja
 , gettext
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   version = "0.5.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1j6h98whgkcxrh30bwvnxvyqxrxchgpdgqhl0j71xz7x72dqxijd";
   };
 
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     gettext
   ];
 
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/gnu-config/default.nix b/nixpkgs/pkgs/development/libraries/gnu-config/default.nix
index 5acab2a70e08..74b94e68f564 100644
--- a/nixpkgs/pkgs/development/libraries/gnu-config/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gnu-config/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 let
   rev = "e78c96e5288993aaea3ec44e5c6ee755c668da79";
@@ -22,7 +22,7 @@ in stdenv.mkDerivation {
     cp ${configSub} $out/config.sub
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Attempt to guess a canonical system name";
     homepage = "https://savannah.gnu.org/projects/config";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/gnu-efi/default.nix b/nixpkgs/pkgs/development/libraries/gnu-efi/default.nix
index 402c3585d53f..ef8ef7648ebd 100644
--- a/nixpkgs/pkgs/development/libraries/gnu-efi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gnu-efi/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, buildPackages, fetchurl, fetchpatch, pciutils }:
+{ lib, stdenv, buildPackages, fetchurl, fetchpatch, pciutils }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "gnu-efi";
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GNU EFI development toolchain";
     homepage = "https://sourceforge.net/projects/gnu-efi/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/gnutls-kdh/generic.nix b/nixpkgs/pkgs/development/libraries/gnutls-kdh/generic.nix
index c6d35b682360..245b0c1e6381 100644
--- a/nixpkgs/pkgs/development/libraries/gnutls-kdh/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/gnutls-kdh/generic.nix
@@ -1,4 +1,4 @@
-{ config, lib, stdenv, zlib, lzo, libtasn1, nettle, pkgconfig, lzip
+{ 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
@@ -62,12 +62,12 @@ stdenv.mkDerivation {
     ++ [ unbound ]
     ++ lib.optional guileBindings guile;
 
-  nativeBuildInputs = [ perl pkgconfig ] ++ nativeBuildInputs;
+  nativeBuildInputs = [ perl pkg-config ] ++ nativeBuildInputs;
 
   #inherit doCheck;
   doCheck = false;
 
-  # Fixup broken libtool and pkgconfig files
+  # 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,' \
diff --git a/nixpkgs/pkgs/development/libraries/gnutls/default.nix b/nixpkgs/pkgs/development/libraries/gnutls/default.nix
index ae3775002ec9..2cd1e783ea92 100644
--- a/nixpkgs/pkgs/development/libraries/gnutls/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gnutls/default.nix
@@ -1,4 +1,4 @@
-{ config, lib, stdenv, fetchurl, zlib, lzo, libtasn1, nettle, pkgconfig, lzip
+{ config, lib, stdenv, fetchurl, zlib, lzo, libtasn1, nettle, pkg-config, lzip
 , perl, gmp, autoconf, autogen, automake, libidn, p11-kit, libiconv
 , unbound, dns-root-data, gettext, cacert, util-linux
 , guileBindings ? config.gnutls.guile or false, guile
@@ -40,7 +40,7 @@ stdenv.mkDerivation {
     ++ lib.optional stdenv.hostPlatform.isAarch32 ./fix-gnulib-tests-arm.patch;
 
   # Skip some tests:
-  #  - pkgconfig: building against the result won't work before installing (3.5.11)
+  #  - 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
@@ -76,7 +76,7 @@ stdenv.mkDerivation {
     ++ lib.optional (tpmSupport && stdenv.isLinux) trousers
     ++ lib.optional guileBindings guile;
 
-  nativeBuildInputs = [ perl pkgconfig ]
+  nativeBuildInputs = [ perl pkg-config ]
     ++ lib.optionals (isDarwin && !withSecurity) [ autoconf automake ]
     ++ lib.optionals doCheck [ which nettools util-linux ];
 
@@ -87,7 +87,7 @@ stdenv.mkDerivation {
   #   Error setting the x509 trust file: Error while reading file.
   checkInputs = [ cacert ];
 
-  # Fixup broken libtool and pkgconfig files
+  # 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,' \
diff --git a/nixpkgs/pkgs/development/libraries/gobject-introspection/default.nix b/nixpkgs/pkgs/development/libraries/gobject-introspection/default.nix
index 97b3ea9a8f10..ae65f5aed280 100644
--- a/nixpkgs/pkgs/development/libraries/gobject-introspection/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gobject-introspection/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , glib
 , flex
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
   outputBin = "dev";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "078n0q7b6z682mf4irclrksm73cyixq295mqnqifl9plwmgaai6x";
   };
 
@@ -46,12 +46,12 @@ stdenv.mkDerivation rec {
       src = ./absolute_shlib_path.patch;
       inherit nixStoreDir;
     })
-  ] ++ stdenv.lib.optionals x11Support [
+  ] ++ 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 = "${stdenv.lib.getLib cairo}/lib";
+      cairoLib = "${lib.getLib cairo}/lib";
     })
   ];
 
@@ -72,7 +72,7 @@ stdenv.mkDerivation rec {
     python3
   ];
 
-  checkInputs = stdenv.lib.optionals stdenv.isDarwin [
+  checkInputs = lib.optionals stdenv.isDarwin [
     cctools # for otool
   ];
 
@@ -117,7 +117,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  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 ]);
diff --git a/nixpkgs/pkgs/development/libraries/goffice/default.nix b/nixpkgs/pkgs/development/libraries/goffice/default.nix
index 46b40d00d780..d544dd7625dc 100644
--- a/nixpkgs/pkgs/development/libraries/goffice/default.nix
+++ b/nixpkgs/pkgs/development/libraries/goffice/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, pkgconfig, intltool, glib, gtk3, lasem
+{ fetchurl, lib, stdenv, pkg-config, intltool, glib, gtk3, lasem
 , libgsf, libxml2, libxslt, cairo, pango, librsvg, gnome3 }:
 
 stdenv.mkDerivation rec {
@@ -8,11 +8,11 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1z6f3q8fxkd1ysqrwdxdi0844zqa00vjpf07gq8mh3kal8picfd4";
   };
 
-  nativeBuildInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkg-config intltool ];
 
   propagatedBuildInputs = [
     glib gtk3 libxml2 cairo pango libgsf lasem
@@ -38,8 +38,8 @@ stdenv.mkDerivation rec {
       documents, undo/redo.
     '';
 
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/gom/default.nix b/nixpkgs/pkgs/development/libraries/gom/default.nix
index 753db22f4f9f..4b5effefa57c 100644
--- a/nixpkgs/pkgs/development/libraries/gom/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gom/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , glib
 , python3
 , sqlite
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "py" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "17ca07hpg7dqxjn0jpqim3xqcmplk2a87wbwrrlq3dd3m8381l38";
   };
 
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     gobject-introspection
     meson
     ninja
-    pkgconfig
+    pkg-config
   ];
 
   buildInputs = [
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A GObject to SQLite object mapper";
     homepage = "https://wiki.gnome.org/Projects/Gom";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/goocanvas/2.x.nix b/nixpkgs/pkgs/development/libraries/goocanvas/2.x.nix
index a744cf314e29..c4df9f1f0fd7 100644
--- a/nixpkgs/pkgs/development/libraries/goocanvas/2.x.nix
+++ b/nixpkgs/pkgs/development/libraries/goocanvas/2.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, gettext, gtk-doc, gobject-introspection, python2, gtk3, cairo, glib }:
+{ lib, stdenv, fetchurl, pkg-config, gettext, gtk-doc, gobject-introspection, python2, gtk3, cairo, glib }:
 
 let
   version = "2.0.4";
@@ -13,7 +13,7 @@ in stdenv.mkDerivation rec {
     sha256 = "141fm7mbqib0011zmkv3g8vxcjwa7hypmq71ahdyhnj2sjvy4a67";
   };
 
-  nativeBuildInputs = [ pkgconfig gettext gtk-doc python2 ];
+  nativeBuildInputs = [ pkg-config gettext gtk-doc python2 ];
   buildInputs = [ gtk3 cairo glib gobject-introspection ];
 
   configureFlags = [
@@ -22,7 +22,7 @@ in stdenv.mkDerivation rec {
   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 stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/goocanvas/default.nix b/nixpkgs/pkgs/development/libraries/goocanvas/default.nix
index 024ac363af18..c9fd5b263429 100644
--- a/nixpkgs/pkgs/development/libraries/goocanvas/default.nix
+++ b/nixpkgs/pkgs/development/libraries/goocanvas/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, gtk2, cairo, glib, pkgconfig, gnome3 }:
+{ lib, stdenv, fetchurl, gtk2, cairo, glib, pkg-config, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "goocanvas";
   version = "1.0.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
     sha256 = "07kicpcacbqm3inp7zq32ldp95mxx4kfxpaazd0x5jk7hpw2w1qw";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ gtk2 cairo glib ];
 
   passthru = {
@@ -19,10 +19,10 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  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 = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/goocanvasmm/default.nix b/nixpkgs/pkgs/development/libraries/goocanvasmm/default.nix
index d8a910d4799c..632e434631c9 100644
--- a/nixpkgs/pkgs/development/libraries/goocanvasmm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/goocanvasmm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, goocanvas2, gtkmm3, gnome3 }:
+{ lib, stdenv, fetchurl, pkg-config, goocanvas2, gtkmm3, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "goocanvasmm";
@@ -7,10 +7,10 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0vpdfrj59nwzwj8bk4s0h05iyql62pxjzsxh72g3vry07s3i3zw0";
   };
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   propagatedBuildInputs = [ gtkmm3 goocanvas2 ];
 
   enableParallelBuilding = true;
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ bindings for GooCanvas";
     homepage = "https://wiki.gnome.org/Projects/GooCanvas";
     license = licenses.lgpl2;
diff --git a/nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix b/nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix
index 7528925088e5..fdf425432817 100644
--- a/nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/google-cloud-cpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, clang-tools, grpc, curl, cmake, pkgconfig, fetchFromGitHub, doxygen, protobuf, crc32c, c-ares, fetchurl, openssl, zlib }:
+{ lib, stdenv, clang-tools, grpc, curl, cmake, pkg-config, fetchFromGitHub, doxygen, protobuf, crc32c, c-ares, fetchurl, openssl, zlib }:
 let
   googleapis = fetchFromGitHub {
     owner = "googleapis";
@@ -16,7 +16,7 @@ let
       sha256 = "02zkcq2wl831ayd9qy009xvfx7q80pgycx7mzz9vknwd0nn6dd0n";
     };
 
-    nativeBuildInputs = [ cmake pkgconfig ];
+    nativeBuildInputs = [ cmake pkg-config ];
     buildInputs = [ c-ares c-ares.cmake-config grpc openssl protobuf zlib ];
 
     postPatch = ''
@@ -40,7 +40,7 @@ in stdenv.mkDerivation rec {
   };
 
   buildInputs = [ curl crc32c c-ares c-ares.cmake-config googleapis-cpp-cmakefiles grpc protobuf ];
-  nativeBuildInputs = [ clang-tools cmake pkgconfig doxygen ];
+  nativeBuildInputs = [ clang-tools cmake pkg-config doxygen ];
 
   outputs = [ "out" "dev" ];
 
@@ -53,7 +53,7 @@ in stdenv.mkDerivation rec {
     "-DBUILD_SHARED_LIBS:BOOL=ON"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     license = with licenses; [ asl20 ];
     homepage = "https://github.com/googleapis/google-cloud-cpp";
     description = "C++ Idiomatic Clients for Google Cloud Platform services";
diff --git a/nixpkgs/pkgs/development/libraries/gperftools/default.nix b/nixpkgs/pkgs/development/libraries/gperftools/default.nix
index 91b2c2929a48..bdb4e67f85fe 100644
--- a/nixpkgs/pkgs/development/libraries/gperftools/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gperftools/default.nix
@@ -1,11 +1,20 @@
-{ stdenv, fetchurl, fetchpatch, autoreconfHook, libunwind }:
+{ stdenv
+, lib
+, fetchFromGitHub
+, fetchpatch
+, autoreconfHook
+, libunwind
+}:
 
 stdenv.mkDerivation rec {
-  name = "gperftools-2.8";
-
-  src = fetchurl {
-    url = "https://github.com/gperftools/gperftools/releases/download/${name}/${name}.tar.gz";
-    sha256 = "0gjiplvday50x695pwjrysnvm5wfvg2b0gmqf6b4bdi8sv6yl394";
+  pname = "gperftools";
+  version = "2.8.1";
+
+  src = fetchFromGitHub {
+    owner = pname;
+    repo = pname;
+    rev = "${pname}-${version}";
+    sha256 = "19bj2vlsbfwq7m826v2ccqg47kd7cb5vcz1yw2x0v5qzhaxbakk1";
   };
 
   patches = [
@@ -20,21 +29,19 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoreconfHook ];
 
   # tcmalloc uses libunwind in a way that works correctly only on non-ARM linux
-  buildInputs = stdenv.lib.optional (stdenv.isLinux && !(stdenv.isAarch64 || stdenv.isAarch32)) libunwind;
+  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 = stdenv.lib.optional (stdenv.isAarch32 || stdenv.isAarch64)
+  configureFlags = lib.optional (stdenv.isAarch32 || stdenv.isAarch64)
     "--disable-general-dynamic-tls";
 
-  prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  prePatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace Makefile.am --replace stdc++ c++
-    substituteInPlace Makefile.in --replace stdc++ c++
-    substituteInPlace libtool --replace stdc++ c++
   '';
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin
-    "-D_XOPEN_SOURCE -Wno-aligned-allocation-unavailable";
+  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
@@ -42,7 +49,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/gperftools/gperftools";
     description = "Fast, multi-threaded malloc() and nifty performance analysis tools";
     platforms = with platforms; linux ++ darwin;
diff --git a/nixpkgs/pkgs/development/libraries/gpgme/default.nix b/nixpkgs/pkgs/development/libraries/gpgme/default.nix
index 067d62a11a27..5b24955af437 100644
--- a/nixpkgs/pkgs/development/libraries/gpgme/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gpgme/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, fetchpatch
-, autoreconfHook, libgpgerror, gnupg, pkgconfig, glib, pth, libassuan
+, autoreconfHook, libgpgerror, gnupg, pkg-config, glib, pth, libassuan
 , file, which, ncurses
 , texinfo
 , buildPackages
@@ -14,11 +14,11 @@ in
 
 stdenv.mkDerivation rec {
   pname = "gpgme";
-  version = "1.15.0";
+  version = "1.15.1";
 
   src = fetchurl {
     url = "mirror://gnupg/gpgme/${pname}-${version}.tar.bz2";
-    sha256 = "0nqfipv5s4npfidsm1rs3kpq0r0av9bfqfd5r035jibx5k0jniqb";
+    sha256 = "1bg13l5s8x9p1v0jyv29n84bay27pflindpzjsc9gj7i4wdkrg7f";
   };
 
   patches = [
@@ -34,7 +34,9 @@ stdenv.mkDerivation rec {
       sha256 = "00d4sxq63601lzdp2ha1i8fvybh7dzih4531jh8bx07fab3sw65g";
     })
     # Disable python tests on Darwin as they use gpg (see configureFlags below)
-  ] ++ lib.optional stdenv.isDarwin ./disable-python-tests.patch;
+  ] ++ 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
@@ -43,7 +45,7 @@ stdenv.mkDerivation rec {
     [ libgpgerror glib libassuan pth ]
     ++ lib.optional (qtbase != null) qtbase;
 
-  nativeBuildInputs = [ pkgconfig gnupg texinfo autoreconfHook ]
+  nativeBuildInputs = [ pkg-config gnupg texinfo autoreconfHook ]
   ++ lib.optionals pythonSupport [ python swig2 which ncurses ];
 
   depsBuildBuild = [ buildPackages.stdenv.cc ];
@@ -70,7 +72,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  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";
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
index 6efc1fca39a8..b11ec3a9f5c3 100644
--- a/nixpkgs/pkgs/development/libraries/grail/default.nix
+++ b/nixpkgs/pkgs/development/libraries/grail/default.nix
@@ -1,5 +1,5 @@
 { enableX11 ? true,
-  stdenv, fetchurl, pkgconfig, xorg, python3, frame }:
+  lib, stdenv, fetchurl, pkg-config, xorg, python3, frame }:
 
 stdenv.mkDerivation rec {
   pname = "grail";
@@ -10,16 +10,16 @@ stdenv.mkDerivation rec {
     sha256 = "1wwx5ibjdz5pyd0f5cd1n91y67r68dymxpm2lgd829041xjizvay";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ python3 frame ]
-  ++ stdenv.lib.optionals enableX11 [xorg.libX11 xorg.libXtst xorg.libXext xorg.libXi xorg.libXfixes];
+  ++ lib.optionals enableX11 [xorg.libX11 xorg.libXtst xorg.libXext xorg.libXi xorg.libXfixes];
 
-  configureFlags = stdenv.lib.optional enableX11 "--with-x11";
+  configureFlags = lib.optional enableX11 "--with-x11";
 
   meta = {
     homepage = "https://launchpad.net/canonical-multitouch/grail";
     description = "Gesture Recognition And Instantiation Library";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/grantlee/default.nix b/nixpkgs/pkgs/development/libraries/grantlee/default.nix
index a8e692bdd51d..869430538e89 100644
--- a/nixpkgs/pkgs/development/libraries/grantlee/default.nix
+++ b/nixpkgs/pkgs/development/libraries/grantlee/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qt4, cmake }:
+{ lib, stdenv, fetchurl, qt4, cmake }:
 
 stdenv.mkDerivation rec {
   name = "grantlee-0.5.1";
@@ -12,7 +12,8 @@ stdenv.mkDerivation rec {
     sha256 = "1b501xbimizmbmysl1j5zgnp48qw0r2r7lhgmxvzhzlv9jzhj60r";
   };
 
-  buildInputs = [ cmake qt4 ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ qt4 ];
 
   meta = {
     description = "Qt4 port of Django template system";
@@ -26,7 +27,7 @@ stdenv.mkDerivation rec {
       and the design of Django is reused in Grantlee.'';
 
     homepage = "http://gitorious.org/grantlee";
-    license = stdenv.lib.licenses.lgpl21;
+    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
index c60b09144929..726666ec06f3 100644
--- a/nixpkgs/pkgs/development/libraries/graphene-hardened-malloc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/graphene-hardened-malloc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "graphene-hardened-malloc";
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
     popd
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/GrapheneOS/hardened_malloc";
     description = "Hardened allocator designed for modern systems";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/graphene/default.nix b/nixpkgs/pkgs/development/libraries/graphene/default.nix
index ee147d82afdb..57cad4497653 100644
--- a/nixpkgs/pkgs/development/libraries/graphene/default.nix
+++ b/nixpkgs/pkgs/development/libraries/graphene/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , nix-update-script
-, pkgconfig
+, pkg-config
 , meson
 , ninja
 , python3
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
     gtk-doc
     meson
     ninja
-    pkgconfig
+    pkg-config
     gobject-introspection
     python3
   ];
@@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A thin layer of graphic data types";
     homepage = "https://ebassi.github.com/graphene";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/grib-api/default.nix b/nixpkgs/pkgs/development/libraries/grib-api/default.nix
index db884957d1e0..182f05a8ca89 100644
--- a/nixpkgs/pkgs/development/libraries/grib-api/default.nix
+++ b/nixpkgs/pkgs/development/libraries/grib-api/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, fetchpatch, stdenv,
+{ fetchurl, fetchpatch, lib, stdenv,
   cmake, netcdf, gfortran, libpng, openjpeg,
   enablePython ? false, pythonPackages }:
 
@@ -23,16 +23,15 @@ stdenv.mkDerivation rec {
     substituteInPlace "src/grib_jasper_encoding.c" --replace "image.inmem_    = 1;" ""
   '';
 
-  buildInputs = [ cmake
-                  netcdf
-                  gfortran
+  nativeBuildInputs = [ cmake gfortran ];
+  buildInputs = [ netcdf
                   libpng
                   openjpeg
-                ] ++ stdenv.lib.optionals enablePython [
+                ] ++ lib.optionals enablePython [
                   pythonPackages.python
                 ];
 
-  propagatedBuildInputs = stdenv.lib.optionals enablePython [
+  propagatedBuildInputs = lib.optionals enablePython [
                   pythonPackages.numpy
                 ];
 
@@ -42,21 +41,19 @@ stdenv.mkDerivation rec {
                  "-DOPENJPEG_INCLUDE_DIR=${openjpeg.dev}/include/${openjpeg.incDir}"
                ];
 
-  enableParallelBuilding = true;
-
   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 = stdenv.lib.optionalString (stdenv.isDarwin) ''
+  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 stdenv.lib; {
+  meta = with lib; {
     homepage = "https://software.ecmwf.int/wiki/display/GRIB/Home";
     license = licenses.asl20;
     platforms = with platforms; linux ++ darwin;
diff --git a/nixpkgs/pkgs/development/libraries/grilo-plugins/default.nix b/nixpkgs/pkgs/development/libraries/grilo-plugins/default.nix
index 9073a501c09f..b80e6256e467 100644
--- a/nixpkgs/pkgs/development/libraries/grilo-plugins/default.nix
+++ b/nixpkgs/pkgs/development/libraries/grilo-plugins/default.nix
@@ -1,9 +1,9 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , substituteAll
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , gettext
 , gperf
 , sqlite
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
   version = "0.3.12";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0xr59gzb8gw2bgj14mjllgn8y7srh373j0fp0v16ak8nd84dzdn6";
   };
 
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
     # * chromaprint (gst-plugins-bad)
     (substituteAll {
       src = ./chromaprint-gst-plugins.patch;
-      load_plugins = stdenv.lib.concatMapStrings (plugin: ''gst_registry_scan_path(gst_registry_get(), "${plugin}/lib/gstreamer-1.0");'') (with gst_all_1; [
+      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
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     gettext
     itstool
     gperf # for lua-factory
@@ -91,7 +91,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://wiki.gnome.org/Projects/Grilo";
     description = "A collection of plugins for the Grilo framework";
     maintainers = teams.gnome.members;
diff --git a/nixpkgs/pkgs/development/libraries/grilo/default.nix b/nixpkgs/pkgs/development/libraries/grilo/default.nix
index 858e8d81fd42..fbab49273e82 100644
--- a/nixpkgs/pkgs/development/libraries/grilo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/grilo/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig, gettext, vala, glib, liboauth, gtk3
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, gettext, vala, glib, liboauth, gtk3
 , gtk-doc, docbook_xsl, docbook_xml_dtd_43
 , libxml2, gnome3, gobject-introspection, libsoup, totem-pl-parser }:
 
@@ -12,7 +12,7 @@ in stdenv.mkDerivation rec {
   outputBin = "dev";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "0ywjvh7xw4ql1q4fvl0q5n06n08pga1g1nc9l7c3x5214gr3fj6i";
   };
 
@@ -23,7 +23,7 @@ in stdenv.mkDerivation rec {
   ];
 
   nativeBuildInputs = [
-    meson ninja pkgconfig gettext gobject-introspection vala
+    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 ];
@@ -35,7 +35,7 @@ in stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/grpc/default.nix b/nixpkgs/pkgs/development/libraries/grpc/default.nix
index c41bd5ff5aa3..92cf619ab5bd 100644
--- a/nixpkgs/pkgs/development/libraries/grpc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/grpc/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchFromGitHub, fetchpatch, cmake, zlib, c-ares, pkgconfig, openssl, protobuf
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, zlib, c-ares, pkg-config, openssl, protobuf
 , gflags, abseil-cpp, libnsl
 }:
 
 stdenv.mkDerivation rec {
-  version = "1.34.0"; # N.B: if you change this, change pythonPackages.grpcio-tools to a matching version too
+  version = "1.34.1"; # N.B: if you change this, change pythonPackages.grpcio-tools to a matching version too
   pname = "grpc";
   src = fetchFromGitHub {
     owner = "grpc";
     repo = "grpc";
     rev = "v${version}";
-    sha256 = "0kipk26kg2x06mrkhb74k8vk5cn4mr89kw1f9mb04n616wkxjyxy";
+    sha256 = "0p6si9i0gg885ag2x87a7jyzhgd5lhx2bh2vjj2ra1jn6y3vg6qk";
     fetchSubmodules = true;
   };
   patches = [
@@ -20,9 +20,9 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
   buildInputs = [ zlib c-ares c-ares.cmake-config openssl protobuf gflags abseil-cpp ]
-    ++ stdenv.lib.optionals stdenv.isLinux [ libnsl ];
+    ++ lib.optionals stdenv.isLinux [ libnsl ];
 
   cmakeFlags =
     [ "-DgRPC_ZLIB_PROVIDER=package"
@@ -45,11 +45,11 @@ stdenv.mkDerivation rec {
     export LD_LIBRARY_PATH=$(pwd)''${LD_LIBRARY_PATH:+:}$LD_LIBRARY_PATH
   '';
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=unknown-warning-option";
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=unknown-warning-option";
 
   enableParallelBuilds = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The C based gRPC (C++, Python, Ruby, Objective-C, PHP, C#)";
     license = licenses.asl20;
     maintainers = [ maintainers.lnl7 maintainers.marsam ];
diff --git a/nixpkgs/pkgs/development/libraries/gsasl/default.nix b/nixpkgs/pkgs/development/libraries/gsasl/default.nix
index 4e22c38e9c84..48ee0ddd4a51 100644
--- a/nixpkgs/pkgs/development/libraries/gsasl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gsasl/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, libidn, kerberos }:
+{ fetchurl, lib, stdenv, libidn, kerberos }:
 
 stdenv.mkDerivation rec {
   name = "gsasl-1.8.0";
@@ -28,9 +28,9 @@ stdenv.mkDerivation rec {
        '';
 
     homepage = "https://www.gnu.org/software/gsasl/";
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
 
-    maintainers = with stdenv.lib.maintainers; [ shlevy ];
-    platforms = stdenv.lib.platforms.all;
+    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
index 1032f15196cc..318d07dfacc8 100644
--- a/nixpkgs/pkgs/development/libraries/gsettings-desktop-schemas/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gsettings-desktop-schemas/default.nix
@@ -1,6 +1,6 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
-, pkgconfig
+, pkg-config
 , glib
 , gobject-introspection
 , meson
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   version = "3.38.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0rwcg9sd5rv7gjwapcd1jjk6l16w0p3j7wkicq1rdch4c0kch12p";
   };
 
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     glib
     meson
     ninja
-    pkgconfig
+    pkg-config
     python3
   ];
 
@@ -57,7 +57,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  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
index cbba9c5fcea2..21b63875db6c 100644
--- a/nixpkgs/pkgs/development/libraries/gsettings-qt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gsettings-qt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, pkgconfig
+{ lib, stdenv, fetchFromGitLab, pkg-config
 , qmake, qtbase, qtdeclarative, wrapQtAppsHook
 , glib, gobject-introspection
 , genericUpdater, common-updater-scripts
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     qmake
     gobject-introspection
     wrapQtAppsHook
@@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
     versionLister = "${common-updater-scripts}/bin/list-git-tags ${src.meta.homepage}";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library to access GSettings from Qt";
     homepage = "https://gitlab.com/ubports/core/gsettings-qt";
     license = licenses.lgpl3;
diff --git a/nixpkgs/pkgs/development/libraries/gsignond/default.nix b/nixpkgs/pkgs/development/libraries/gsignond/default.nix
index b0db776bd616..92123dbc3ea5 100644
--- a/nixpkgs/pkgs/development/libraries/gsignond/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gsignond/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, pkgconfig, meson, ninja, glib, glib-networking
+{ 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 }:
@@ -26,7 +26,7 @@ unwrapped = stdenv.mkDerivation rec {
     gtk-doc
     meson
     ninja
-    pkgconfig
+    pkg-config
     vala
   ];
 
@@ -50,7 +50,7 @@ unwrapped = stdenv.mkDerivation rec {
     ./plugin-load-env.patch
   ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/gsignond/plugins/lastfm.nix b/nixpkgs/pkgs/development/libraries/gsignond/plugins/lastfm.nix
index b1a383ee5918..a05069f205fe 100644
--- a/nixpkgs/pkgs/development/libraries/gsignond/plugins/lastfm.nix
+++ b/nixpkgs/pkgs/development/libraries/gsignond/plugins/lastfm.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, pkgconfig, meson, ninja, vala, glib, gsignond, json-glib, libsoup, gobject-introspection }:
+{ lib, stdenv, fetchFromGitLab, pkg-config, meson, ninja, vala, glib, gsignond, json-glib, libsoup, gobject-introspection }:
 
 stdenv.mkDerivation {
   pname = "gsignond-plugin-lastfm";
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
     gobject-introspection
     meson
     ninja
-    pkgconfig
+    pkg-config
     vala
   ];
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation {
 
   PKG_CONFIG_GSIGNOND_GPLUGINSDIR = "${placeholder "out"}/lib/gsignond/gplugins";
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/gsignond/plugins/mail.nix b/nixpkgs/pkgs/development/libraries/gsignond/plugins/mail.nix
index 4ac6e6a6f9ff..8bce32f976ab 100644
--- a/nixpkgs/pkgs/development/libraries/gsignond/plugins/mail.nix
+++ b/nixpkgs/pkgs/development/libraries/gsignond/plugins/mail.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, pkgconfig, meson, ninja, vala, glib, gsignond, gobject-introspection }:
+{ lib, stdenv, fetchFromGitLab, pkg-config, meson, ninja, vala, glib, gsignond, gobject-introspection }:
 
 stdenv.mkDerivation rec {
   pname = "gsignond-plugin-mail";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     gobject-introspection
     meson
     ninja
-    pkgconfig
+    pkg-config
     vala
   ];
 
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   PKG_CONFIG_GSIGNOND_GPLUGINSDIR = "${placeholder "out"}/lib/gsignond/gplugins";
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/gsignond/plugins/oauth.nix b/nixpkgs/pkgs/development/libraries/gsignond/plugins/oauth.nix
index b4b16a57af41..3bf3ab194643 100644
--- a/nixpkgs/pkgs/development/libraries/gsignond/plugins/oauth.nix
+++ b/nixpkgs/pkgs/development/libraries/gsignond/plugins/oauth.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, pkgconfig, meson, ninja, glib, gsignond, check
+{ 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 }:
 
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
     gtk-doc
     meson
     ninja
-    pkgconfig
+    pkg-config
   ];
 
   buildInputs = [
@@ -38,7 +38,7 @@ stdenv.mkDerivation {
 
   PKG_CONFIG_GSIGNOND_GPLUGINSDIR = "${placeholder "out"}/lib/gsignond/gplugins";
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/gsignond/plugins/sasl.nix b/nixpkgs/pkgs/development/libraries/gsignond/plugins/sasl.nix
index 1a1f34681cea..b73559f8a532 100644
--- a/nixpkgs/pkgs/development/libraries/gsignond/plugins/sasl.nix
+++ b/nixpkgs/pkgs/development/libraries/gsignond/plugins/sasl.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, pkgconfig, meson, ninja, glib, gsignond, gsasl, check
+{ 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 {
@@ -22,7 +22,7 @@ stdenv.mkDerivation {
     gtk-doc
     meson
     ninja
-    pkgconfig
+    pkg-config
   ];
 
   buildInputs = [
@@ -35,7 +35,7 @@ stdenv.mkDerivation {
 
   PKG_CONFIG_GSIGNOND_GPLUGINSDIR = "${placeholder "out"}/lib/gsignond/gplugins";
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/gsl/default.nix b/nixpkgs/pkgs/development/libraries/gsl/default.nix
index 4a9208cff32a..04c8bcbbbecc 100644
--- a/nixpkgs/pkgs/development/libraries/gsl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gsl/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv }:
+{ fetchurl, lib, stdenv }:
 
 stdenv.mkDerivation rec {
   name = "gsl-2.6";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   # do not let -march=skylake to enable FMA (https://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html)
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isx86_64 "-mno-fma";
+  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";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "The GNU Scientific Library, a large numerical library";
     homepage = "https://www.gnu.org/software/gsl/";
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
 
     longDescription = ''
       The GNU Scientific Library (GSL) is a numerical library for C
@@ -29,6 +29,6 @@ stdenv.mkDerivation rec {
       fitting.  There are over 1000 functions in total with an
       extensive test suite.
     '';
-    platforms = stdenv.lib.platforms.unix;
+    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
index 9a31563c6cca..d26651875756 100644
--- a/nixpkgs/pkgs/development/libraries/gsl/gsl-1_16.nix
+++ b/nixpkgs/pkgs/development/libraries/gsl/gsl-1_16.nix
@@ -1,4 +1,4 @@
-{ fetchurl, fetchpatch, stdenv }:
+{ fetchurl, fetchpatch, lib, stdenv }:
 
 stdenv.mkDerivation rec {
   name = "gsl-1.16";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   # do not let -march=skylake to enable FMA (https://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html)
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isx86_64 "-mno-fma";
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isx86_64 "-mno-fma";
 
   patches = [
     (fetchpatch {
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "The GNU Scientific Library, a large numerical library";
     homepage = "https://www.gnu.org/software/gsl/";
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
 
     longDescription = ''
       The GNU Scientific Library (GSL) is a numerical library for C
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
       fitting.  There are over 1000 functions in total with an
       extensive test suite.
     '';
-    platforms = stdenv.lib.platforms.unix;
+    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
index 30cffa89938d..13088dda0c91 100644
--- a/nixpkgs/pkgs/development/libraries/gsm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gsm/default.nix
@@ -1,10 +1,11 @@
-{ stdenv, fetchurl
-, staticSupport ? false # Compile statically (support for packages that look for the static object)
+{ lib, stdenv, fetchurl
+, # Compile statically (support for packages that look for the static object)
+  staticSupport ? stdenv.hostPlatform.isStatic
 }:
 
 let
   inherit (stdenv) isDarwin;
-  inherit (stdenv.lib) optional optionalString;
+  inherit (lib) optional optionalString;
 in
 
 stdenv.mkDerivation rec {
@@ -43,7 +44,7 @@ stdenv.mkDerivation rec {
 
   parallelBuild = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Lossy speech compression codec";
     homepage    = "http://www.quut.com/gsm/";
     license     = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/gsmlib/default.nix b/nixpkgs/pkgs/development/libraries/gsmlib/default.nix
index 88bec83e624f..ec6646d98f57 100644
--- a/nixpkgs/pkgs/development/libraries/gsmlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gsmlib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
 stdenv.mkDerivation rec {
   pname = "gsmlib";
   version = "unstable-2017-10-06";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "16v8aj914ac1ipf14a867ljib3gy7fhzd9ypxnsg9l0zi8mm3ml5";
   };
   nativeBuildInputs = [ autoreconfHook ];
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library to access GSM mobile phones through GSM modems";
     homepage = "https://github.com/x-logLT/gsmlib";
     license = licenses.lgpl2;
diff --git a/nixpkgs/pkgs/development/libraries/gsoap/default.nix b/nixpkgs/pkgs/development/libraries/gsoap/default.nix
index 2614c50cca78..08b8146ac0a8 100644
--- a/nixpkgs/pkgs/development/libraries/gsoap/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gsoap/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, unzip, m4, bison, flex, openssl, zlib }:
+{ lib, stdenv, fetchurl, autoreconfHook, unzip, m4, bison, flex, openssl, zlib }:
 
 let
   majorVersion = "2.8";
@@ -24,7 +24,7 @@ in stdenv.mkDerivation rec {
       --replace 'AM_INIT_AUTOMAKE([foreign])' 'AM_INIT_AUTOMAKE([foreign subdir-objects])'
   '';
 
-  meta = with stdenv.lib; {
+  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):
diff --git a/nixpkgs/pkgs/development/libraries/gsound/default.nix b/nixpkgs/pkgs/development/libraries/gsound/default.nix
index bae1b17e5322..2a3e846d38d6 100644
--- a/nixpkgs/pkgs/development/libraries/gsound/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gsound/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, pkgconfig, glib, vala, libcanberra, gobject-introspection, libtool, gnome3 }:
+{ lib, stdenv, fetchurl, pkg-config, glib, vala, libcanberra, gobject-introspection, libtool, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "gsound";
   version = "1.0.2";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "bba8ff30eea815037e53bee727bbd5f0b6a2e74d452a7711b819a7c444e78e53";
   };
 
-  nativeBuildInputs = [ pkgconfig gobject-introspection libtool vala ];
+  nativeBuildInputs = [ pkg-config gobject-introspection libtool vala ];
   buildInputs = [ glib libcanberra ];
 
   passthru = {
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://wiki.gnome.org/Projects/GSound";
     description = "Small library for playing system sounds";
     maintainers = teams.gnome.members;
diff --git a/nixpkgs/pkgs/development/libraries/gspell/default.nix b/nixpkgs/pkgs/development/libraries/gspell/default.nix
index 37e54c825955..890fcb981181 100644
--- a/nixpkgs/pkgs/development/libraries/gspell/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gspell/default.nix
@@ -1,6 +1,6 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
-, pkgconfig
+, pkg-config
 , libxml2
 , glib
 , gtk3
@@ -19,12 +19,12 @@ stdenv.mkDerivation rec {
   outputBin = "dev";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1pdb4gbjrs8mk6r0ipw5vxyvzav1wvkjq46kiq53r3nyznfpdfyw";
   };
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     vala
     gobject-introspection
     libxml2
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
   ];
 
   propagatedBuildInputs = [
-    # required for pkgconfig
+    # required for pkg-config
     enchant2
   ];
 
@@ -48,7 +48,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A spell-checking library for GTK applications";
     homepage = "https://wiki.gnome.org/Projects/gspell";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gss/default.nix b/nixpkgs/pkgs/development/libraries/gss/default.nix
index 363e7ba7d10f..ec4e54c339b0 100644
--- a/nixpkgs/pkgs/development/libraries/gss/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gss/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , withShishi ? !stdenv.isDarwin, shishi ? null
 }:
 
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "1syyvh3k659xf1hdv9pilnnhbbhs6vfapayp4xgdcc8mfgf9v4gz";
   };
 
-  buildInputs = stdenv.lib.optional withShishi shishi;
+  buildInputs = lib.optional withShishi shishi;
 
   configureFlags = [
     "--${if withShishi != null then "enable" else "disable"}-kereberos5"
@@ -21,11 +21,11 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   # Fixup .la files
-  postInstall = stdenv.lib.optionalString withShishi ''
+  postInstall = lib.optionalString withShishi ''
     sed -i 's,\(-lshishi\),-L${shishi}/lib \1,' $out/lib/libgss.la
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.gnu.org/software/gss/";
     description = "Generic Security Service";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gssdp/default.nix b/nixpkgs/pkgs/development/libraries/gssdp/default.nix
index 0a808b71a71c..440caba25476 100644
--- a/nixpkgs/pkgs/development/libraries/gssdp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gssdp/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , gobject-introspection
 , vala
 , gtk-doc
@@ -21,14 +21,14 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "bin" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/gssdp/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/gssdp/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1s57i8a8wnnxnsfl27cq4503dkdlzbrhry5zpg23sfqfffvdqqx2";
   };
 
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     gobject-introspection
     vala
     gtk-doc
@@ -57,7 +57,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GObject-based API for handling resource discovery and announcement over SSDP";
     homepage = "http://www.gupnp.org/";
     license = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix
index 49343e79c878..313a063cae89 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/bad/default.nix
@@ -1,11 +1,11 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
 , meson
 , ninja
 , gettext
 , config
-, pkgconfig
+, pkg-config
 , python3
 , gst-plugins-base
 , orc
@@ -86,7 +86,7 @@
 assert faacSupport -> faac != null;
 
 let
-  inherit (stdenv.lib) optional optionals;
+  inherit (lib) optional optionals;
 in stdenv.mkDerivation rec {
   pname = "gst-plugins-bad";
   version = "1.18.2";
@@ -105,7 +105,7 @@ in stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     orc # for orcc
     python3
     gettext
@@ -293,7 +293,7 @@ in stdenv.mkDerivation rec {
 
   doCheck = false; # fails 20 out of 58 tests, expensive
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GStreamer Bad Plugins";
     homepage = "https://gstreamer.freedesktop.org";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix
index 4728e49c5162..bac59ac4c48c 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/base/default.nix
@@ -1,7 +1,7 @@
 { stdenv
 , fetchurl
 , lib
-, pkgconfig
+, pkg-config
 , meson
 , ninja
 , gettext
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     python3
     gettext
     orc
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix
index 0d33d28196ca..a5b4c0b827a1 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/core/default.nix
@@ -2,7 +2,7 @@
 , fetchurl
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , gettext
 , gobject-introspection
 , bison
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     gettext
     bison
     flex
@@ -77,7 +77,7 @@ stdenv.mkDerivation rec {
     "-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.isDarwin [
-    # darwin.libunwind doesn't have pkgconfig definitions so meson doesn't detect it.
+    # darwin.libunwind doesn't have pkg-config definitions so meson doesn't detect it.
     "-Dlibunwind=disabled"
     "-Dlibdw=disabled"
   ];
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/devtools/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/devtools/default.nix
index 6743a5ecd675..dc53a76bbca6 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/devtools/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/devtools/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , gstreamer
 , gst-plugins-base
 , python3
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     gobject-introspection
 
     # documentation
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
     "-Ddoc=disabled" # `hotdoc` not packaged in nixpkgs as of writing
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Integration testing infrastructure for the GStreamer framework";
     homepage = "https://gstreamer.freedesktop.org";
     license = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix
index 75e065e6d2be..ebd5f83dd15f 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/ges/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , python3
 , bash-completion
 , gst-plugins-base
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     gettext
     gobject-introspection
     gst-devtools
@@ -66,7 +66,7 @@ stdenv.mkDerivation rec {
       scripts/extract-release-date-from-doap-file.py
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for creation of audio/video non-linear editors";
     homepage = "https://gstreamer.freedesktop.org";
     license = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix
index d4c3b99c7ca9..a032f5f5b5a4 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/good/default.nix
@@ -1,9 +1,9 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , meson
 , nasm
 , ninja
-, pkgconfig
+, pkg-config
 , python3
 , gst-plugins-base
 , orc
@@ -47,7 +47,7 @@ assert gtkSupport -> gtk3 != null;
 assert raspiCameraSupport -> ((libraspberrypi != null) && stdenv.isLinux && stdenv.isAarch64);
 
 let
-  inherit (stdenv.lib) optionals;
+  inherit (lib) optionals;
 in
 stdenv.mkDerivation rec {
   pname = "gst-plugins-good";
@@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     python3
     meson
     ninja
@@ -150,7 +150,7 @@ stdenv.mkDerivation rec {
   # fails 1 tests with "Unexpected critical/warning: g_object_set_is_valid_property: object class 'GstRtpStorage' has no property named ''"
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GStreamer Good Plugins";
     homepage = "https://gstreamer.freedesktop.org";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/gstreamermm/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/gstreamermm/default.nix
index 35c278da03b1..2c683a84da4d 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/gstreamermm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/gstreamermm/default.nix
@@ -1,16 +1,16 @@
-{ stdenv, fetchurl, pkgconfig, file, glibmm, gst_all_1, gnome3 }:
+{ lib, stdenv, fetchurl, pkg-config, file, glibmm, gst_all_1, gnome3 }:
 stdenv.mkDerivation rec {
   pname = "gstreamermm";
   version = "1.10.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0q4dx9sncqbwgpzma0zvj6zssc279yl80pn8irb95qypyyggwn5y";
   };
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig file ];
+  nativeBuildInputs = [ pkg-config file ];
 
   propagatedBuildInputs = [ glibmm gst_all_1.gst-plugins-base ];
 
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ interface for GStreamer";
     homepage = "https://gstreamer.freedesktop.org/bindings/cplusplus.html";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix
index c75d439cd53f..3175cff4acaa 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/libav/default.nix
@@ -3,7 +3,7 @@
 , fetchurl
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , python3
 , gst-plugins-base
 , gettext
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     meson
     ninja
     gettext
-    pkgconfig
+    pkg-config
     python3
   ];
 
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/default.nix
index 4167b1727769..bcecd11ce2d2 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/rtsp-server/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , python3
 , gettext
 , gobject-introspection
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
     ninja
     gettext
     gobject-introspection
-    pkgconfig
+    pkg-config
     python3
 
     # documentation
@@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
       scripts/extract-release-date-from-doap-file.py
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GStreamer RTSP server";
     homepage = "https://gstreamer.freedesktop.org";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix
index 1cdc0a519300..8f35829ed384 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/ugly/default.nix
@@ -2,7 +2,7 @@
 , fetchurl
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , python3
 , gst-plugins-base
 , orc
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
     meson
     ninja
     gettext
-    pkgconfig
+    pkg-config
     python3
   ];
 
diff --git a/nixpkgs/pkgs/development/libraries/gstreamer/vaapi/default.nix b/nixpkgs/pkgs/development/libraries/gstreamer/vaapi/default.nix
index 52a6cb27894b..a90d21c28e8c 100644
--- a/nixpkgs/pkgs/development/libraries/gstreamer/vaapi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gstreamer/vaapi/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , gst-plugins-base
 , bzip2
 , libva
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     bzip2
 
     # documentation
@@ -75,7 +75,7 @@ stdenv.mkDerivation rec {
       scripts/extract-release-date-from-doap-file.py
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Set of VAAPI GStreamer Plug-ins";
     homepage = "https://gstreamer.freedesktop.org";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gtdialog/default.nix b/nixpkgs/pkgs/development/libraries/gtdialog/default.nix
index b848af6c318a..0e467b294330 100644
--- a/nixpkgs/pkgs/development/libraries/gtdialog/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gtdialog/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, cdk, unzip, gtk2, glib, ncurses, pkgconfig}:
+{lib, stdenv, fetchurl, cdk, unzip, gtk2, glib, ncurses, pkg-config}:
 let
   s = # Generated upstream information
   rec {
@@ -9,7 +9,7 @@ let
     url="https://foicica.com/gtdialog/download/gtdialog_1.4.zip";
     sha256="1lhsaz56s8m838fi6vnfcd2r6djymvy3n2pbqhii88hraapq3rfk";
   };
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [
     cdk unzip gtk2 glib ncurses
   ];
@@ -23,10 +23,10 @@ stdenv.mkDerivation {
   makeFlags = ["PREFIX=$(out)"];
   meta = {
     inherit (s) version;
-    description = ''Cross-platform helper for creating interactive dialogs'';
-    license = stdenv.lib.licenses.mit ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    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/gtest/default.nix b/nixpkgs/pkgs/development/libraries/gtest/default.nix
index 4e8ce95737d9..d15ce77213ca 100644
--- a/nixpkgs/pkgs/development/libraries/gtest/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gtest/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, ninja, fetchFromGitHub, fetchpatch }:
+{ lib, stdenv, cmake, ninja, fetchFromGitHub, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "gtest";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Google's framework for writing C++ tests";
     homepage = "https://github.com/google/googletest";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/gthree/default.nix b/nixpkgs/pkgs/development/libraries/gthree/default.nix
index 2da9847f3cb4..990e151efe44 100644
--- a/nixpkgs/pkgs/development/libraries/gthree/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gthree/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 , ninja
@@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
     "-Dexamples=false"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GObject/GTK port of three.js";
     homepage = "https://github.com/alexlarsson/gthree";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/gtk-engine-bluecurve/default.nix b/nixpkgs/pkgs/development/libraries/gtk-engine-bluecurve/default.nix
index 99ca221f5ba2..84920060c5ea 100644
--- a/nixpkgs/pkgs/development/libraries/gtk-engine-bluecurve/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gtk-engine-bluecurve/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk2 }:
+{ lib, stdenv, fetchurl, pkg-config, intltool, gtk2 }:
 
 stdenv.mkDerivation {
   name = "gtk-engine-bluecurve-1.0";
@@ -8,14 +8,14 @@ stdenv.mkDerivation {
     sha256 = "1nim3lhmbs5mw1hh76d9258c1p923854x2j6i30gmny812c7qjnm";
   };
 
-  nativeBuildInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkg-config intltool ];
 
   buildInputs = [ gtk2 ];
 
   meta = {
     description = "Original Bluecurve engine from Red Hat's artwork package";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.gnidorah ];
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
+    maintainers = [ lib.maintainers.gnidorah ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/gtk-engine-murrine/default.nix b/nixpkgs/pkgs/development/libraries/gtk-engine-murrine/default.nix
index 9acb7b25a0dd..8d40499fb626 100644
--- a/nixpkgs/pkgs/development/libraries/gtk-engine-murrine/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gtk-engine-murrine/default.nix
@@ -1,21 +1,21 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk2 }:
+{ 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}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "129cs5bqw23i76h3nmc29c9mqkm9460iwc8vkl7hs4xr07h8mip9";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ intltool gtk2 ];
 
   meta = {
     description = "A very flexible theme engine";
     homepage = "https://gitlab.gnome.org/Archive/murrine";
-    license = stdenv.lib.licenses.lgpl3;
-    platforms = stdenv.lib.platforms.linux;
+    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
index 2f56f6eb4c5c..115547a72f73 100644
--- a/nixpkgs/pkgs/development/libraries/gtk-engines/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gtk-engines/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk2 }:
+{ lib, stdenv, fetchurl, pkg-config, intltool, gtk2 }:
 
 stdenv.mkDerivation {
   name = "gtk-engines-2.20.2";
@@ -8,12 +8,12 @@ stdenv.mkDerivation {
     sha256 = "1db65pb0j0mijmswrvpgkdabilqd23x22d95hp5kwxvcramq1dhm";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ intltool gtk2 ];
 
   meta = {
     description = "Theme engines for GTK 2";
-    license = stdenv.lib.licenses.lgpl21Plus;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.lgpl21Plus;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/gtk-layer-shell/default.nix b/nixpkgs/pkgs/development/libraries/gtk-layer-shell/default.nix
index 87f9698bec0a..56693d24c7a8 100644
--- a/nixpkgs/pkgs/development/libraries/gtk-layer-shell/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gtk-layer-shell/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , meson
 , ninja
@@ -13,7 +13,7 @@
 
 stdenv.mkDerivation rec {
   pname = "gtk-layer-shell";
-  version = "0.5.1";
+  version = "0.5.2";
 
   outputs = [ "out" "dev" "devdoc" ];
 
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     owner = "wmww";
     repo = "gtk-layer-shell";
     rev = "v${version}";
-    sha256 = "1yfqfv3hn92cy9y5zgvz7qhq2ypill2z5857ki5snjimhjdz0cnw";
+    sha256 = "sha256-516N45q5EZTq5eLCqH/T/VV/AxgBsQhJ+yZdLOEeDUk=";
   };
 
   nativeBuildInputs = [
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
     "-Ddocs=true"
   ];
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/gtk-mac-integration/default.nix b/nixpkgs/pkgs/development/libraries/gtk-mac-integration/default.nix
index 5cf62b319a6b..f244a97edf24 100644
--- a/nixpkgs/pkgs/development/libraries/gtk-mac-integration/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gtk-mac-integration/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, autoreconfHook, pkgconfig, glib, gtk-doc, gtk, gobject-introspection }:
+{ lib, stdenv, fetchFromGitLab, autoreconfHook, pkg-config, glib, gtk-doc, gtk, gobject-introspection }:
 
 stdenv.mkDerivation rec {
   pname = "gtk-mac-integration";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "1w0agv4r0daklv5d2f3l0c10krravjq8bj9hsdsrpka48dbnqmap";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig gtk-doc gobject-introspection ];
+  nativeBuildInputs = [ autoreconfHook pkg-config gtk-doc gobject-introspection ];
   buildInputs = [ glib ];
   propagatedBuildInputs = [ gtk ];
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     gtkdocize
   '';
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/gtk-sharp-beans/default.nix b/nixpkgs/pkgs/development/libraries/gtk-sharp-beans/default.nix
index 2b83a8ef52e2..69ef71f1506f 100644
--- a/nixpkgs/pkgs/development/libraries/gtk-sharp-beans/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gtk-sharp-beans/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, which, pkgconfig, mono, gtk-sharp-2_0, gio-sharp }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, which, pkg-config, mono, gtk-sharp-2_0, gio-sharp }:
 
 stdenv.mkDerivation rec {
   pname = "gtk-sharp-beans";
@@ -12,12 +12,12 @@ stdenv.mkDerivation rec {
     sha256 = "04sylwdllb6gazzs2m4jjfn14mil9l3cny2q0xf0zkhczzih6ah1";
   };
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook which ];
+  nativeBuildInputs = [ pkg-config autoreconfHook which ];
   buildInputs = [ mono gtk-sharp-2_0 gio-sharp ];
 
   dontStrip = true;
 
-  meta = with stdenv.lib; {
+  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
index ed53105f7581..1e7c86530658 100644
--- a/nixpkgs/pkgs/development/libraries/gtk-sharp/2.0.nix
+++ b/nixpkgs/pkgs/development/libraries/gtk-sharp/2.0.nix
@@ -1,7 +1,7 @@
 { stdenv
 , lib
 , fetchFromGitHub
-, pkgconfig
+, pkg-config
 , mono
 , glib
 , pango
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
     popd
   '';
 
-  nativeBuildInputs = [ pkgconfig autoconf automake libtool which ];
+  nativeBuildInputs = [ pkg-config autoconf automake libtool which ];
 
   buildInputs = [
     mono glib pango gtk2 GConf libglade libgnomecanvas
@@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
     gtk = gtk2;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Graphical User Interface Toolkit for mono and .Net";
     homepage = "https://www.mono-project.com/docs/gui/gtksharp";
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/gtk-sharp/3.0.nix b/nixpkgs/pkgs/development/libraries/gtk-sharp/3.0.nix
index 49405c655e15..491656a0c682 100644
--- a/nixpkgs/pkgs/development/libraries/gtk-sharp/3.0.nix
+++ b/nixpkgs/pkgs/development/libraries/gtk-sharp/3.0.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
-, pkgconfig
+, pkg-config
 , mono
 , glib
 , pango
@@ -24,11 +24,11 @@ stdenv.mkDerivation rec {
 
   builder = ./builder.sh;
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "18n3l9zcldyvn4lwi8izd62307mkhz873039nl6awrv285qzah34";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [
     mono glib pango gtk3 GConf libglade libgnomecanvas
     libgtkhtml libgnomeui libgnomeprint libgnomeprintui gtkhtml libxml2
@@ -53,6 +53,6 @@ stdenv.mkDerivation rec {
   };
 
   meta = {
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/gtk/2.x.nix b/nixpkgs/pkgs/development/libraries/gtk/2.x.nix
index be5f8521f9c8..43b7ff5f127f 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/2.x.nix
+++ b/nixpkgs/pkgs/development/libraries/gtk/2.x.nix
@@ -1,4 +1,4 @@
-{ config, stdenv, fetchurl, pkgconfig, gettext, glib, atk, pango, cairo, perl, xorg
+{ config, lib, 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 ? null
@@ -10,7 +10,7 @@
 assert xineramaSupport -> xorg.libXinerama != null;
 assert cupsSupport -> cups != null;
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "gtk+";
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     ./hooks/drop-icon-theme-cache.sh
   ];
 
-  nativeBuildInputs = setupHooks ++ [ perl pkgconfig gettext gobject-introspection ];
+  nativeBuildInputs = setupHooks ++ [ perl pkg-config gettext gobject-introspection ];
 
   patches = [
     ./patches/2.0-immodules.cache.patch
diff --git a/nixpkgs/pkgs/development/libraries/gtk/3.x.nix b/nixpkgs/pkgs/development/libraries/gtk/3.x.nix
index 59685ca07ccb..0e5c6edc9640 100644
--- a/nixpkgs/pkgs/development/libraries/gtk/3.x.nix
+++ b/nixpkgs/pkgs/development/libraries/gtk/3.x.nix
@@ -1,9 +1,9 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
-, pkgconfig
+, pkg-config
 , gettext
-, docbook_xsl
+, docbook-xsl-nons
 , docbook_xml_dtd_43
 , gtk-doc
 , meson
@@ -48,13 +48,11 @@
 
 assert cupsSupport -> cups != null;
 
-with stdenv.lib;
-
 stdenv.mkDerivation rec {
   pname = "gtk+3";
   version = "3.24.24";
 
-  outputs = [ "out" "dev" ] ++ optional withGtkDoc "devdoc";
+  outputs = [ "out" "dev" ] ++ lib.optional withGtkDoc "devdoc";
   outputBin = "dev";
 
   setupHooks = [
@@ -63,18 +61,19 @@ stdenv.mkDerivation rec {
   ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/gtk+/${stdenv.lib.versions.majorMinor version}/gtk+-${version}.tar.xz";
+    url = "mirror://gnome/sources/gtk+/${lib.versions.majorMinor version}/gtk+-${version}.tar.xz";
     sha256 = "12ipk1d376bai9v820qzhxba93kkh5abi6mhyqr4hwjvqmkl77fc";
   };
 
   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";
     })
-  ] ++ optionals stdenv.isDarwin [
+  ] ++ 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
@@ -82,47 +81,18 @@ stdenv.mkDerivation rec {
     ./patches/3.0-darwin-x11.patch
   ];
 
-  separateDebugInfo = stdenv.isLinux;
-
-  mesonFlags = [
-    "-Dgtk_doc=${boolToString withGtkDoc}"
-    "-Dtests=false"
-    "-Dtracker3=${boolToString trackerSupport}"
-    "-Dbroadway_backend=${boolToString broadwaySupport}"
-  ];
-
-  # 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[@]}
-  '';
-
   nativeBuildInputs = [
     gettext
     gobject-introspection
     makeWrapper
     meson
     ninja
-    pkgconfig
+    pkg-config
     python3
     sassc
-  ] ++ setupHooks ++ optionals withGtkDoc [
+  ] ++ setupHooks ++ lib.optionals withGtkDoc [
     docbook_xml_dtd_43
-    docbook_xsl
+    docbook-xsl-nons
     gtk-doc
     # For xmllint
     libxml2
@@ -133,10 +103,12 @@ stdenv.mkDerivation rec {
     epoxy
     json-glib
     isocodes
-  ]
-  ++ optional stdenv.isDarwin AppKit
-  ++ optional trackerSupport tracker
-  ;
+  ] ++ lib.optionals stdenv.isDarwin [
+    AppKit
+  ] ++ lib.optionals trackerSupport [
+    tracker
+  ];
+  #TODO: colord?
 
   propagatedBuildInputs = with xorg; [
     at-spi2-atk
@@ -155,17 +127,51 @@ stdenv.mkDerivation rec {
     libXrandr
     libXrender
     pango
-  ]
-  ++ optional stdenv.isDarwin Cocoa  # explicitly propagated, always needed
-  ++ optionals waylandSupport [ mesa wayland wayland-protocols ]
-  ++ optional xineramaSupport libXinerama
-  ++ optional cupsSupport cups
-  ;
-  #TODO: colord?
+  ] ++ lib.optionals stdenv.isDarwin [
+    # explicitly propagated, always needed
+    Cocoa
+  ] ++ lib.optionals waylandSupport [
+    mesa
+    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
 
-  postInstall = optionalString (!stdenv.isDarwin) ''
+  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
@@ -178,7 +184,7 @@ stdenv.mkDerivation rec {
   '';
 
   # Wrap demos
-  postFixup =  optionalString (!stdenv.isDarwin) ''
+  postFixup =  lib.optionalString (!stdenv.isDarwin) ''
     demos=(gtk3-demo gtk3-demo-application gtk3-icon-browser gtk3-widget-factory)
 
     for program in ''${demos[@]}; do
@@ -194,7 +200,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = {
+  meta = with lib; {
     description = "A multi-platform toolkit for creating graphical user interfaces";
     longDescription = ''
       GTK is a highly usable, feature rich toolkit for creating
diff --git a/nixpkgs/pkgs/development/libraries/gtkd/default.nix b/nixpkgs/pkgs/development/libraries/gtkd/default.nix
index 5cef820db149..ccaceabd4e98 100644
--- a/nixpkgs/pkgs/development/libraries/gtkd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gtkd/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchzip, fetchpatch, atk, cairo, dmd, gdk-pixbuf, gnome3, gst_all_1, librsvg
-, glib, gtk3, gtksourceview4, libgda, libpeas, pango, pkgconfig, which, vte }:
+{ lib, stdenv, fetchzip, fetchpatch, atk, cairo, dmd, gdk-pixbuf, gnome3, 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;
@@ -15,7 +15,7 @@ in stdenv.mkDerivation rec {
     stripRoot = false;
   };
 
-  nativeBuildInputs = [ dmd pkgconfig which ];
+  nativeBuildInputs = [ dmd pkg-config which ];
   propagatedBuildInputs = [
     atk cairo gdk-pixbuf glib gstreamer gst-plugins-base gtk3 gtksourceview4
     libgda libpeas librsvg pango vte
@@ -117,7 +117,7 @@ in stdenv.mkDerivation rec {
 
   makeFlags  = [
     "prefix=${placeholder "out"}"
-    "PKG_CONFIG=${pkgconfig}/bin/${pkgconfig.targetPrefix}pkg-config"
+    "PKG_CONFIG=${pkg-config}/bin/${pkg-config.targetPrefix}pkg-config"
   ];
 
   # The .pc files does not declare an `includedir=`, so the multiple
@@ -129,7 +129,7 @@ in stdenv.mkDerivation rec {
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "D binding and OO wrapper for GTK";
     homepage = "https://gtkd.org";
     license = licenses.lgpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gtkdatabox/default.nix b/nixpkgs/pkgs/development/libraries/gtkdatabox/default.nix
index 54054270c3c6..d7cca43841e4 100644
--- a/nixpkgs/pkgs/development/libraries/gtkdatabox/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gtkdatabox/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, gtk2 }:
+{ lib, stdenv, fetchurl, pkg-config, gtk2 }:
 
 stdenv.mkDerivation rec {
   name = "gtkdatabox-0.9.3.1";
@@ -8,15 +8,15 @@ stdenv.mkDerivation rec {
     sha256 = "1rdxnjgh6v3yjqgsfmamyzpfxckzchps4kqvvz88nifmd7ckhjfh";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   propagatedBuildInputs = [ gtk2 ];
 
   meta = {
     description = "GTK widget for displaying large amounts of numerical data";
 
-    license = stdenv.lib.licenses.lgpl2;
+    license = lib.licenses.lgpl2;
 
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/gtkimageview/default.nix b/nixpkgs/pkgs/development/libraries/gtkimageview/default.nix
index babcaa993340..438f7feab6ce 100644
--- a/nixpkgs/pkgs/development/libraries/gtkimageview/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gtkimageview/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, pkgconfig, gtk2 }:
+{ fetchurl, lib, stdenv, pkg-config, gtk2 }:
 
 stdenv.mkDerivation rec {
   name = "gtkimageview-1.6.4";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1if3yh5z6nkv5wnkk0qyy9pkk03vn5rqbfk23q87kj39pqscgr37";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ gtk2 ];
 
   preConfigure = ''
@@ -31,9 +31,9 @@ stdenv.mkDerivation rec {
          interpolation; GIF animation support.
        '';
 
-    license = stdenv.lib.licenses.lgpl2Plus;
+    license = lib.licenses.lgpl2Plus;
 
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/gtkmathview/default.nix b/nixpkgs/pkgs/development/libraries/gtkmathview/default.nix
index 0c72f8501cc2..b5399553f960 100644
--- a/nixpkgs/pkgs/development/libraries/gtkmathview/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gtkmathview/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, pkgconfig, gtk2, t1lib, glib, libxml2, popt, gmetadom ? null }:
+{lib, stdenv, fetchurl, pkg-config, gtk2, t1lib, glib, libxml2, popt, gmetadom ? null }:
 
 let
   pname = "gtkmathview";
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
     sha256 = "0hwcamf5fi35frg7q6kgisc9v0prqbhsplb2gl55cg3av9sh3hqx";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ t1lib glib gmetadom libxml2 popt];
   propagatedBuildInputs = [gtk2 t1lib];
 
@@ -22,8 +22,8 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://helm.cs.unibo.it/mml-widget/";
     description = "C++ rendering engine for MathML documents";
-    license = stdenv.lib.licenses.lgpl3Plus;
-    maintainers = [ stdenv.lib.maintainers.roconnor ];
+    license = lib.licenses.lgpl3Plus;
+    maintainers = [ lib.maintainers.roconnor ];
     broken = true;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/gtkmm/2.x.nix b/nixpkgs/pkgs/development/libraries/gtkmm/2.x.nix
index 24262d263cbf..521f4ca15f30 100644
--- a/nixpkgs/pkgs/development/libraries/gtkmm/2.x.nix
+++ b/nixpkgs/pkgs/development/libraries/gtkmm/2.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, gtk2, glibmm, cairomm, pangomm, atkmm }:
+{ lib, stdenv, fetchurl, pkg-config, gtk2, glibmm, cairomm, pangomm, atkmm }:
 
 stdenv.mkDerivation rec {
   name = "gtkmm-${minVer}.5";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   propagatedBuildInputs = [ glibmm gtk2 atkmm cairomm pangomm ];
 
@@ -34,9 +34,9 @@ stdenv.mkDerivation rec {
 
     homepage = "https://gtkmm.org/";
 
-    license = stdenv.lib.licenses.lgpl2Plus;
+    license = lib.licenses.lgpl2Plus;
 
-    maintainers = with stdenv.lib.maintainers; [ raskin vcunat ];
-    platforms = stdenv.lib.platforms.unix;
+    maintainers = with lib.maintainers; [ raskin vcunat ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/gtkmm/3.x.nix b/nixpkgs/pkgs/development/libraries/gtkmm/3.x.nix
index 5794b2ddf46f..4a31acd2ff66 100644
--- a/nixpkgs/pkgs/development/libraries/gtkmm/3.x.nix
+++ b/nixpkgs/pkgs/development/libraries/gtkmm/3.x.nix
@@ -1,17 +1,17 @@
-{ stdenv, fetchurl, pkgconfig, gtk3, glibmm, cairomm, pangomm, atkmm, epoxy, gnome3 }:
+{ lib, stdenv, fetchurl, pkg-config, gtk3, glibmm, cairomm, pangomm, atkmm, epoxy, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "gtkmm";
   version = "3.24.2";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1hxdnhavjyvbcpxhd5z17l9fj4182028s66lc0s16qqqrldhjwbd";
   };
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ epoxy ];
 
   propagatedBuildInputs = [ glibmm gtk3 atkmm cairomm pangomm ];
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ interface to the GTK graphical user interface library";
 
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/gtksourceview/3.x.nix b/nixpkgs/pkgs/development/libraries/gtksourceview/3.x.nix
index d32a0eebf137..84a20154b13c 100644
--- a/nixpkgs/pkgs/development/libraries/gtksourceview/3.x.nix
+++ b/nixpkgs/pkgs/development/libraries/gtksourceview/3.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, atk, cairo, glib, gtk3, pango, vala
+{ 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 {
@@ -6,7 +6,7 @@ stdenv.mkDerivation rec {
   version = "3.24.11";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/gtksourceview/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/gtksourceview/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1zbpj283b5ycz767hqz5kdq02wzsga65pp4fykvhg8xj6x50f6v9";
   };
 
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig intltool perl gobject-introspection vala ];
+  nativeBuildInputs = [ pkg-config intltool perl gobject-introspection vala ];
 
   checkInputs = [ xvfb_run dbus ];
 
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
       make check
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://wiki.gnome.org/Projects/GtkSourceView";
     platforms = with platforms; linux ++ darwin;
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/gtksourceview/4.x.nix b/nixpkgs/pkgs/development/libraries/gtksourceview/4.x.nix
index 2041e83fb0c3..2d469c191e03 100644
--- a/nixpkgs/pkgs/development/libraries/gtksourceview/4.x.nix
+++ b/nixpkgs/pkgs/development/libraries/gtksourceview/4.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, atk, cairo, glib, gtk3, pango, fribidi, vala
+{ lib, stdenv, fetchurl, pkg-config, atk, cairo, glib, gtk3, pango, fribidi, vala
 , libxml2, perl, gettext, gnome3, gobject-introspection, dbus, xvfb_run, shared-mime-info
 , meson, ninja }:
 
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
   version = "4.8.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "06jfbfbi73j9i3qsr7sxg3yl3643bn3aydbzx6xg3v8ca0hr3880";
   };
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ meson ninja pkgconfig gettext perl gobject-introspection vala ];
+  nativeBuildInputs = [ meson ninja pkg-config gettext perl gobject-introspection vala ];
 
   checkInputs = [ xvfb_run dbus ];
 
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://wiki.gnome.org/Projects/GtkSourceView";
     platforms = with platforms; linux ++ darwin;
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/gtksourceviewmm/4.x.nix b/nixpkgs/pkgs/development/libraries/gtksourceviewmm/4.x.nix
index 1607a5819961..5e80f91abc1b 100644
--- a/nixpkgs/pkgs/development/libraries/gtksourceviewmm/4.x.nix
+++ b/nixpkgs/pkgs/development/libraries/gtksourceviewmm/4.x.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, pkgconfig, gtkmm3, glibmm, gtksourceview4, gnome3 }:
+{ lib, stdenv, fetchurl, pkg-config, gtkmm3, glibmm, gtksourceview4, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "gtksourceviewmm";
   version = "3.91.1";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "088p2ch1b4fvzl9416nw3waj0pqgp31cd5zj4lx5hzzrq2afgapy";
   };
 
@@ -16,10 +16,10 @@ stdenv.mkDerivation rec {
     };
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   propagatedBuildInputs = [ glibmm gtkmm3 gtksourceview4 ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     platforms = platforms.linux;
     homepage = "https://developer.gnome.org/gtksourceviewmm/";
     description = "C++ wrapper for gtksourceview";
diff --git a/nixpkgs/pkgs/development/libraries/gtksourceviewmm/default.nix b/nixpkgs/pkgs/development/libraries/gtksourceviewmm/default.nix
index 7bf510207ab3..7ee6b656ead1 100644
--- a/nixpkgs/pkgs/development/libraries/gtksourceviewmm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gtksourceviewmm/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, pkgconfig, gtkmm3, glibmm, gtksourceview3, gnome3 }:
+{ lib, stdenv, fetchurl, pkg-config, gtkmm3, glibmm, gtksourceview3, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "gtksourceviewmm";
   version = "3.21.3";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/gtksourceviewmm/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/gtksourceviewmm/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1danc9mp5mnb65j01qxkwj92z8jf1gns41wbgp17qh7050f0pc6v";
   };
 
@@ -16,10 +16,10 @@ stdenv.mkDerivation rec {
     };
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ glibmm gtkmm3 gtksourceview3 ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     platforms = platforms.linux;
     homepage = "https://developer.gnome.org/gtksourceviewmm/";
     description = "C++ wrapper for gtksourceview";
diff --git a/nixpkgs/pkgs/development/libraries/gtkspell/3.nix b/nixpkgs/pkgs/development/libraries/gtkspell/3.nix
index 707acfcd3820..d3a1a178856b 100644
--- a/nixpkgs/pkgs/development/libraries/gtkspell/3.nix
+++ b/nixpkgs/pkgs/development/libraries/gtkspell/3.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, gtk3, aspell, pkgconfig, enchant, isocodes, intltool, gobject-introspection, vala}:
+{lib, stdenv, fetchurl, gtk3, aspell, pkg-config, enchant, isocodes, intltool, gobject-introspection, vala}:
 
 stdenv.mkDerivation rec {
   pname = "gtkspell";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0cjp6xdcnzh6kka42w9g0w2ihqjlq8yl8hjm9wsfnixk6qwgch5h";
   };
 
-  nativeBuildInputs = [ pkgconfig intltool gobject-introspection vala ];
+  nativeBuildInputs = [ pkg-config intltool gobject-introspection vala ];
   buildInputs = [ aspell gtk3 enchant isocodes ];
   propagatedBuildInputs = [ enchant ];
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     "--enable-vala"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://gtkspell.sourceforge.net/";
     description = "Word-processor-style highlighting GtkTextView widget";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gtkspell/default.nix b/nixpkgs/pkgs/development/libraries/gtkspell/default.nix
index b6ee2c6825d6..78d9956d30a2 100644
--- a/nixpkgs/pkgs/development/libraries/gtkspell/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gtkspell/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, gtk2, aspell, pkgconfig, enchant, intltool}:
+{lib, stdenv, fetchurl, gtk2, aspell, pkg-config, enchant, intltool}:
 
 stdenv.mkDerivation {
   name = "gtkspell-2.0.16";
@@ -8,10 +8,10 @@ stdenv.mkDerivation {
     sha256 = "00hdv28bp72kg1mq2jdz1sdw2b8mb9iclsp7jdqwpck705bdriwg";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [aspell gtk2 enchant intltool];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Word-processor-style highlighting and replacement of misspelled words";
     homepage = "http://gtkspell.sourceforge.net";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/gtkspellmm/default.nix b/nixpkgs/pkgs/development/libraries/gtkspellmm/default.nix
index b3bca9bd7b6d..31380b5ab793 100644
--- a/nixpkgs/pkgs/development/libraries/gtkspellmm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gtkspellmm/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl
-, pkgconfig
+{ lib, stdenv, fetchurl
+, pkg-config
 , gtk3, glib, glibmm, gtkmm3, gtkspell3
 }:
 
@@ -17,12 +17,12 @@ stdenv.mkDerivation rec {
     gtkspell3
   ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [
     gtk3 glib glibmm gtkmm3
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ binding for the gtkspell library";
     homepage = "http://gtkspell.sourceforge.net/";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/gts/default.nix b/nixpkgs/pkgs/development/libraries/gts/default.nix
index 48bdfc9b5e1b..815dfb634c9f 100644
--- a/nixpkgs/pkgs/development/libraries/gts/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gts/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, pkgconfig, autoreconfHook, gettext, glib, buildPackages }:
+{ fetchurl, lib, stdenv, pkg-config, autoreconfHook, gettext, glib, buildPackages }:
 
 
 stdenv.mkDerivation rec {
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     autoreconfHook
     glib  # required to satisfy AM_PATH_GLIB_2_0
   ];
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # fails with "permission denied"
 
-  preBuild = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+  preBuild = lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
     pushd src
     make CC=${buildPackages.stdenv.cc}/bin/cc predicates_init
     mv predicates_init predicates_init_build
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "http://gts.sourceforge.net/";
-    license = stdenv.lib.licenses.lgpl2Plus;
+    license = lib.licenses.lgpl2Plus;
     description = "GNU Triangulated Surface Library";
 
     longDescription = ''
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
       3D surfaces meshed with interconnected triangles.
     '';
 
-    maintainers = [ stdenv.lib.maintainers.viric ];
-    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    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
index e8035d8b1cf9..91053828b586 100644
--- a/nixpkgs/pkgs/development/libraries/gumbo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gumbo/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoconf, automake, libtool }:
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool }:
 
 stdenv.mkDerivation rec {
   pname = "gumbo";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   preConfigure = "./autogen.sh";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C99 HTML parsing algorithm";
     homepage = "https://github.com/google/gumbo-parser";
     maintainers = [ maintainers.nico202 ];
diff --git a/nixpkgs/pkgs/development/libraries/gupnp-av/default.nix b/nixpkgs/pkgs/development/libraries/gupnp-av/default.nix
index 80fb9e3affff..9bf39d94aed3 100644
--- a/nixpkgs/pkgs/development/libraries/gupnp-av/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gupnp-av/default.nix
@@ -1,6 +1,6 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
-, pkgconfig
+, pkg-config
 , gobject-introspection
 , vala
 , gtk-doc
@@ -18,12 +18,12 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1p3grslwqm9bc8rmpn4l48d7v9s84nina4r9xbd932dbj8acz7b8";
   };
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     gobject-introspection
     vala
     gtk-doc
@@ -48,7 +48,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://gupnp.org/";
     description = "A collection of helpers for building AV (audio/video) applications using GUPnP";
     license = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gupnp-dlna/default.nix b/nixpkgs/pkgs/development/libraries/gupnp-dlna/default.nix
index 8fc001de3d56..e11d86f82e19 100644
--- a/nixpkgs/pkgs/development/libraries/gupnp-dlna/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gupnp-dlna/default.nix
@@ -1,6 +1,6 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
-, pkgconfig
+, pkg-config
 , gobject-introspection
 , vala
 , gtk-doc
@@ -18,12 +18,12 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0spzd2saax7w776p5laixdam6d7smyynr9qszhbmq7f14y13cghj";
   };
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     gobject-introspection
     vala
     gtk-doc
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://wiki.gnome.org/Projects/GUPnP/";
     description = "Library to ease DLNA-related bits for applications using GUPnP";
     license = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gupnp-igd/default.nix b/nixpkgs/pkgs/development/libraries/gupnp-igd/default.nix
index a8ed1f7cadd0..2dad33949f3f 100644
--- a/nixpkgs/pkgs/development/libraries/gupnp-igd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gupnp-igd/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
 , autoreconfHook
-, pkgconfig
+, pkg-config
 , gettext
 , gobject-introspection
 , gtk-doc
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "081v1vhkbz3wayv49xfiskvrmvnpx93k25am2wnarg5cifiiljlb";
   };
 
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
   ];
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     autoreconfHook
     gettext
     gobject-introspection
@@ -59,7 +59,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library to handle UPnP IGD port mapping";
     homepage = "http://www.gupnp.org/";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/gupnp/default.nix b/nixpkgs/pkgs/development/libraries/gupnp/default.nix
index 153eb681d633..fe3463eeff20 100644
--- a/nixpkgs/pkgs/development/libraries/gupnp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gupnp/default.nix
@@ -1,9 +1,9 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , gobject-introspection
 , vala
 , gtk-doc
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/gupnp/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/gupnp/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0911lv1bivsyv9wwdxm0i1w4r89j0vyyqp200gsfdnzk6v1a4x7x";
   };
 
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     gobject-introspection
     vala
     gtk-doc
@@ -85,7 +85,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.gupnp.org/";
     description = "An implementation of the UPnP specification";
     license = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/gusb/default.nix b/nixpkgs/pkgs/development/libraries/gusb/default.nix
index a2e157691459..c3ae6faecfd7 100644
--- a/nixpkgs/pkgs/development/libraries/gusb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gusb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig, gettext, gobject-introspection
+{ lib, stdenv, fetchurl, 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
 }:
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [
-    meson ninja pkgconfig gettext pythonEnv
+    meson ninja pkg-config gettext pythonEnv
     gtk-doc docbook_xsl docbook_xml_dtd_412 docbook_xml_dtd_44
     gobject-introspection vala
   ];
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # tests try to access USB
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GLib libusb wrapper";
     homepage = "https://github.com/hughsie/libgusb";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/gvfs/default.nix b/nixpkgs/pkgs/development/libraries/gvfs/default.nix
index f79ffa579c87..c30d678e02d5 100644
--- a/nixpkgs/pkgs/development/libraries/gvfs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/gvfs/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , gettext
 , dbus
 , glib
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
   version = "1.46.1";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "00r56kp8dhdn1ypyap66klymlwlh646n4f1ri797w2x6p70sc7k2";
   };
 
@@ -59,7 +59,7 @@ stdenv.mkDerivation rec {
     meson
     ninja
     python3
-    pkgconfig
+    pkg-config
     gettext
     wrapGAppsHook
     libxml2
@@ -90,7 +90,7 @@ stdenv.mkDerivation rec {
     openssh
     gsettings-desktop-schemas
     # TODO: a ligther version of libsoup to have FTP/HTTP support?
-  ] ++ stdenv.lib.optionals gnomeSupport [
+  ] ++ lib.optionals gnomeSupport [
     gnome3.libsoup
     gcr
     glib-networking # TLS support
@@ -102,13 +102,13 @@ stdenv.mkDerivation rec {
   mesonFlags = [
     "-Dsystemduserunitdir=${placeholder "out"}/lib/systemd/user"
     "-Dtmpfilesdir=no"
-  ] ++ stdenv.lib.optionals (!gnomeSupport) [
+  ] ++ lib.optionals (!gnomeSupport) [
     "-Dgcr=false"
     "-Dgoa=false"
     "-Dkeyring=false"
     "-Dhttp=false"
     "-Dgoogle=false"
-  ] ++ stdenv.lib.optionals (samba == null) [
+  ] ++ lib.optionals (samba == null) [
     # Xfce don't want samba
     "-Dsmb=false"
   ];
@@ -122,7 +122,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Virtual Filesystem support library" + optionalString gnomeSupport " (full GNOME support)";
     license = licenses.lgpl2Plus;
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/half/default.nix b/nixpkgs/pkgs/development/libraries/half/default.nix
index b0f4c3a0e9e0..5232dfa51230 100644
--- a/nixpkgs/pkgs/development/libraries/half/default.nix
+++ b/nixpkgs/pkgs/development/libraries/half/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip }:
+{ lib, stdenv, fetchzip }:
 
 stdenv.mkDerivation rec {
   version = "2.1.0";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     cp $src/{ChangeLog,LICENSE,README}.txt $out/share/doc/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ library for half precision floating point arithmetics";
     platforms = platforms.all;
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/hamlib/default.nix b/nixpkgs/pkgs/development/libraries/hamlib/default.nix
index 8ef8b55be522..98b494610057 100644
--- a/nixpkgs/pkgs/development/libraries/hamlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/hamlib/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, perl, python2, swig, gd, libxml2, tcl, libusb-compat-0_1, pkgconfig,
+{lib, stdenv, fetchurl, perl, python2, swig, gd, libxml2, tcl, libusb-compat-0_1, pkg-config,
  boost, libtool, perlPackages }:
 
 stdenv.mkDerivation rec {
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ perl perlPackages.ExtUtilsMakeMaker python2 swig gd libxml2
-                  tcl libusb-compat-0_1 pkgconfig boost libtool ];
+                  tcl libusb-compat-0_1 pkg-config boost libtool ];
 
   configureFlags = [ "--with-perl-binding" "--with-python-binding"
                      "--with-tcl-binding" "--with-rigmatrix" ];
@@ -26,9 +26,9 @@ stdenv.mkDerivation rec {
     which lets one control a radio transceiver or receiver, either from
     command line interface or in a text-oriented interactive interface.
     '';
-    license = with stdenv.lib.licenses; [ gpl2Plus lgpl2Plus ];
+    license = with lib.licenses; [ gpl2Plus lgpl2Plus ];
     homepage = "http://hamlib.sourceforge.net";
-    maintainers = with stdenv.lib.maintainers; [ relrod ];
-    platforms = with stdenv.lib.platforms; unix;
+    maintainers = with lib.maintainers; [ relrod ];
+    platforms = with lib.platforms; unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/harfbuzz/default.nix b/nixpkgs/pkgs/development/libraries/harfbuzz/default.nix
index 6c5703f521d7..b3615893b532 100644
--- a/nixpkgs/pkgs/development/libraries/harfbuzz/default.nix
+++ b/nixpkgs/pkgs/development/libraries/harfbuzz/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkgconfig, glib, freetype, cairo, libintl
+{ lib, stdenv, fetchFromGitHub, pkg-config, glib, freetype, cairo, libintl
 , meson, ninja
 , gobject-introspection
 , icu, graphite2, harfbuzz # The icu variant uses and propagates the non-icu one.
@@ -12,7 +12,7 @@
 
 let
   version = "2.7.2";
-  inherit (stdenv.lib) optional optionals optionalString;
+  inherit (lib) optional optionals optionalString;
   mesonFeatureFlag = opt: b:
     "-D${opt}=${if b then "enabled" else "disabled"}";
 in
@@ -30,7 +30,7 @@ stdenv.mkDerivation {
   postPatch = ''
     patchShebangs src/*.py
     patchShebangs test
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     # ApplicationServices.framework headers have cast-align warnings.
     substituteInPlace src/hb.hh \
       --replace '#pragma GCC diagnostic error   "-Wcast-align"' ""
@@ -50,7 +50,7 @@ stdenv.mkDerivation {
     ninja
     gobject-introspection
     libintl
-    pkgconfig
+    pkg-config
     python3
     gtk-doc
     docbook-xsl-nons
@@ -58,7 +58,7 @@ stdenv.mkDerivation {
   ];
 
   buildInputs = [ glib freetype cairo ] # recommended by upstream
-    ++ stdenv.lib.optionals withCoreText [ ApplicationServices CoreText ];
+    ++ lib.optionals withCoreText [ ApplicationServices CoreText ];
 
   propagatedBuildInputs = []
     ++ optional withGraphite2 graphite2
@@ -77,7 +77,7 @@ stdenv.mkDerivation {
     ''}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An OpenType text shaping engine";
     homepage = "https://harfbuzz.github.io/";
     maintainers = [ maintainers.eelco ];
diff --git a/nixpkgs/pkgs/development/libraries/hawknl/default.nix b/nixpkgs/pkgs/development/libraries/hawknl/default.nix
index e9d5d5d97310..0525fcd0eba6 100644
--- a/nixpkgs/pkgs/development/libraries/hawknl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/hawknl/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, unzip}:
+{lib, stdenv, fetchurl, unzip}:
 
 stdenv.mkDerivation {
   name = "hawknl-1.68";
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://hawksoft.com/hawknl/";
     description = "Free, open source, game oriented network API";
-    license = stdenv.lib.licenses.lgpl2Plus;
-    platforms = stdenv.lib.platforms.linux;
+    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/hidapi/default.nix b/nixpkgs/pkgs/development/libraries/hidapi/default.nix
index c42a35282233..6a3665809b4a 100644
--- a/nixpkgs/pkgs/development/libraries/hidapi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/hidapi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, udev, libusb1
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, udev, libusb1
 , darwin }:
 
 stdenv.mkDerivation rec {
@@ -12,16 +12,16 @@ stdenv.mkDerivation rec {
     sha256 = "1nr4z4b10vpbh3ss525r7spz4i43zim2ba5qzfl15dgdxshxxivb";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
   buildInputs = [ ]
-    ++ stdenv.lib.optionals stdenv.isLinux [ libusb1 udev ];
+    ++ lib.optionals stdenv.isLinux [ libusb1 udev ];
 
   enableParallelBuilding = true;
 
-  propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ IOKit Cocoa ]);
+  propagatedBuildInputs = lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ IOKit Cocoa ]);
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for communicating with USB and Bluetooth HID devices";
     homepage = "https://github.com/libusb/hidapi";
     maintainers = with maintainers; [ prusnak ];
diff --git a/nixpkgs/pkgs/development/libraries/highfive/default.nix b/nixpkgs/pkgs/development/libraries/highfive/default.nix
index c514a44f851a..a9db80468ee6 100644
--- a/nixpkgs/pkgs/development/libraries/highfive/default.nix
+++ b/nixpkgs/pkgs/development/libraries/highfive/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , boost
@@ -36,9 +36,9 @@ stdenv.mkDerivation rec {
     "-DHIGHFIVE_UNIT_TESTS=OFF"
     "-DHIGHFIVE_USE_INSTALL_DEPS=ON"
   ]
-  ++ (stdenv.lib.optionals mpiSupport [ "-DHIGHFIVE_PARALLEL_HDF5=ON" ]);
+  ++ (lib.optionals mpiSupport [ "-DHIGHFIVE_PARALLEL_HDF5=ON" ]);
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit version;
     description = "Header-only C++ HDF5 interface";
     license = licenses.boost;
diff --git a/nixpkgs/pkgs/development/libraries/hiredis/default.nix b/nixpkgs/pkgs/development/libraries/hiredis/default.nix
index 2f7fe184845d..d4998b51592f 100644
--- a/nixpkgs/pkgs/development/libraries/hiredis/default.nix
+++ b/nixpkgs/pkgs/development/libraries/hiredis/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "hiredis";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   PREFIX = "\${out}";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/redis/hiredis";
     description = "Minimalistic C client for Redis >= 1.2";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/hivex/default.nix b/nixpkgs/pkgs/development/libraries/hivex/default.nix
index ee22726414ac..fb77e08ca6b0 100644
--- a/nixpkgs/pkgs/development/libraries/hivex/default.nix
+++ b/nixpkgs/pkgs/development/libraries/hivex/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, autoreconfHook, makeWrapper
+{ lib, stdenv, fetchurl, pkg-config, autoreconfHook, makeWrapper
 , perlPackages, libxml2, libiconv }:
 
 stdenv.mkDerivation rec {
@@ -12,12 +12,12 @@ stdenv.mkDerivation rec {
 
   patches = [ ./hivex-syms.patch ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [
     autoreconfHook makeWrapper libxml2
   ]
   ++ (with perlPackages; [ perl IOStringy ])
-  ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv ];
+  ++ lib.optionals stdenv.isDarwin [ libiconv ];
 
   postInstall = ''
     wrapProgram $out/bin/hivexregedit \
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
         --prefix "PATH" : "$out/bin"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Windows registry hive extraction library";
     license = licenses.lgpl2;
     homepage = "https://github.com/libguestfs/hivex";
diff --git a/nixpkgs/pkgs/development/libraries/hotpatch/default.nix b/nixpkgs/pkgs/development/libraries/hotpatch/default.nix
index df3581cc8095..9857f9f281cc 100644
--- a/nixpkgs/pkgs/development/libraries/hotpatch/default.nix
+++ b/nixpkgs/pkgs/development/libraries/hotpatch/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   name = "hotpatch-0.2";
@@ -10,7 +10,6 @@ stdenv.mkDerivation rec {
     sha256 = "169vdh55wsbn6fl58lpzqx64v6ifzh7krykav33x1d9hsk98qjqh";
   };
 
-  enableParallelBuilding = true;
   doCheck = true;
 
   nativeBuildInputs = [ cmake ];
@@ -27,7 +26,7 @@ stdenv.mkDerivation rec {
     LD_LIBRARY_PATH=$(pwd)/src make test
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Hot patching executables on Linux using .so file injection";
     homepage = src.meta.homepage;
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/howard-hinnant-date/default.nix b/nixpkgs/pkgs/development/libraries/howard-hinnant-date/default.nix
index df6e43293887..2611203a3894 100644
--- a/nixpkgs/pkgs/development/libraries/howard-hinnant-date/default.nix
+++ b/nixpkgs/pkgs/development/libraries/howard-hinnant-date/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, curl, tzdata, fetchpatch, substituteAll }:
+{ lib, stdenv, fetchFromGitHub, cmake, curl, tzdata, fetchpatch, substituteAll }:
 
 stdenv.mkDerivation rec {
   pname = "howard-hinnant-date-unstable";
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/hpx/default.nix b/nixpkgs/pkgs/development/libraries/hpx/default.nix
index ba7da8f5b774..329fa99fa1cd 100644
--- a/nixpkgs/pkgs/development/libraries/hpx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/hpx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, boost, cmake, hwloc, gperftools, pkgconfig, python }:
+{ lib, stdenv, fetchFromGitHub, boost, cmake, hwloc, gperftools, pkg-config, python }:
 
 stdenv.mkDerivation rec {
   pname = "hpx";
@@ -12,15 +12,13 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ boost hwloc gperftools ];
-  nativeBuildInputs = [ cmake pkgconfig python ];
-
-  enableParallelBuilding = true;
+  nativeBuildInputs = [ cmake pkg-config python ];
 
   meta = {
     description = "C++ standard library for concurrency and parallelism";
     homepage = "https://github.com/STEllAR-GROUP/hpx";
-    license = stdenv.lib.licenses.boost;
-    platforms = [ "x86_64-linux" ]; # stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ bobakker ];
+    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
index 8501bf88b6d4..9cf98bbbdc5d 100644
--- a/nixpkgs/pkgs/development/libraries/hspell/default.nix
+++ b/nixpkgs/pkgs/development/libraries/hspell/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, zlib }:
+{ lib, stdenv, fetchurl, perl, zlib }:
 
 stdenv.mkDerivation rec {
   name = "${passthru.pname}-${passthru.version}";
@@ -15,10 +15,10 @@ stdenv.mkDerivation rec {
     sha256 = "08x7rigq5pa1pfpl30qp353hbdkpadr1zc49slpczhsn0sg36pd6";
   };
 
-  patchPhase = ''patchShebangs .'';
+  patchPhase = "patchShebangs .";
   buildInputs = [ perl zlib ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Hebrew spell checker";
     homepage = "http://hspell.ivrix.org.il/";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/htmlcxx/default.nix b/nixpkgs/pkgs/development/libraries/htmlcxx/default.nix
index ed3171da90f7..286834112f27 100644
--- a/nixpkgs/pkgs/development/libraries/htmlcxx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/htmlcxx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "htmlcxx";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./ptrdiff.patch ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://htmlcxx.sourceforge.net/";
     description = "A simple non-validating css1 and html parser for C++";
     license = licenses.lgpl2;
diff --git a/nixpkgs/pkgs/development/libraries/http-parser/default.nix b/nixpkgs/pkgs/development/libraries/http-parser/default.nix
index 203fcaa19ec8..9d1d23ede8b6 100644
--- a/nixpkgs/pkgs/development/libraries/http-parser/default.nix
+++ b/nixpkgs/pkgs/development/libraries/http-parser/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 let
   version = "2.9.4";
@@ -20,7 +20,7 @@ in stdenv.mkDerivation {
   doCheck = true;
   checkTarget = "test";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An HTTP message parser written in C";
     homepage = "https://github.com/nodejs/http-parser";
     maintainers = with maintainers; [ matthewbauer ];
diff --git a/nixpkgs/pkgs/development/libraries/hunspell/default.nix b/nixpkgs/pkgs/development/libraries/hunspell/default.nix
index 20acc49bb83e..fe4fc1e6d338 100644
--- a/nixpkgs/pkgs/development/libraries/hunspell/default.nix
+++ b/nixpkgs/pkgs/development/libraries/hunspell/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, ncurses, readline, autoreconfHook }:
+{ lib, stdenv, fetchurl, fetchpatch, ncurses, readline, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   version = "1.7.0";
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "format" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://hunspell.sourceforge.net";
     description = "Spell checker";
     longDescription = ''
@@ -58,6 +58,6 @@ stdenv.mkDerivation rec {
     '';
     platforms = platforms.all;
     license = with licenses; [ gpl2 lgpl21 mpl11 ];
-    maintainers = with stdenv.lib.maintainers; [ ];
+    maintainers = with lib.maintainers; [ ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/hunspell/dictionaries.nix b/nixpkgs/pkgs/development/libraries/hunspell/dictionaries.nix
index 2cdc30109d90..00d0933bdd70 100644
--- a/nixpkgs/pkgs/development/libraries/hunspell/dictionaries.nix
+++ b/nixpkgs/pkgs/development/libraries/hunspell/dictionaries.nix
@@ -1,6 +1,6 @@
 /* hunspell dictionaries */
 
-{ stdenv, fetchurl, fetchFromGitHub, unzip, coreutils, bash, which, zip, ispell, perl, hunspell }:
+{ lib, stdenv, fetchurl, fetchFromGitHub, unzip, coreutils, bash, which, zip, ispell, perl, hunspell }:
 
 
 let
@@ -37,7 +37,7 @@ let
         rev = "v${version}";
         sha256 = "0n9ms092k7vg7xpd3ksadxydbrizkb7js7dfxr08nbnnb9fgy0i8";
       };
-      meta = with stdenv.lib; {
+      meta = with lib; {
         description = "Hunspell dictionary for ${shortDescription} from rla";
         homepage = "https://github.com/sbosio/rla-es";
         license = with licenses; [ gpl3 lgpl3 mpl11 ];
@@ -76,7 +76,7 @@ let
         url = "https://extensions.libreoffice.org/extensions/swedish-spelling-dictionary-den-stora-svenska-ordlistan/${version}/@@download/file/${_name}.oxt";
         sha256 = "b982881cc75f5c4af1199535bd4735ee476bdc48edf63e3f05fb4f715654a7bc";
       };
-      meta = with stdenv.lib; {
+      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
@@ -118,7 +118,7 @@ let
          url = "http://www.dicollecte.org/download/fr/hunspell-french-dictionaries-v${version}.zip";
          sha256 = "0ca7084jm7zb1ikwzh1frvpb97jn27i7a5d48288h2qlfp068ik0";
       };
-      meta = with stdenv.lib; {
+      meta = with lib; {
         inherit longDescription;
         description = "Hunspell dictionary for ${shortDescription} from Dicollecte";
         homepage = "https://www.dicollecte.org/home.php?prj=fr";
@@ -132,7 +132,7 @@ let
       unpackCmd = ''
         unzip $src ${dictFileName}.dic ${dictFileName}.aff ${readmeFile}
       '';
-      postInstall = stdenv.lib.optionalString isDefault ''
+      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
@@ -148,7 +148,7 @@ let
       name = "hunspell-dict-${shortName}-wordlist-${version}";
       srcReadmeFile = "README_" + srcFileName + ".txt";
       readmeFile = "README_" + dictFileName + ".txt";
-      meta = with stdenv.lib; {
+      meta = with lib; {
         description = "Hunspell dictionary for ${shortDescription} from Wordlist";
         homepage = "http://wordlist.aspell.net/";
         license = licenses.bsd3;
@@ -175,7 +175,7 @@ let
       version = "2.4";
       name = "hunspell-dict-${shortName}-linguistico-${version}";
       readmeFile = dictFileName + "_README.txt";
-      meta = with stdenv.lib; {
+      meta = with lib; {
         description = "Hunspell dictionary for ${shortDescription}";
         homepage = "https://sourceforge.net/projects/linguistico/";
         license = licenses.gpl3;
@@ -217,7 +217,7 @@ let
         ln -sv "$out/share/hunspell/${dictFileName}.aff" "$out/share/myspell/dicts/"
       '';
 
-      meta = with stdenv.lib; {
+      meta = with lib; {
         homepage = "http://xuxen.eus/";
         description = shortDescription;
         longDescription = longDescription;
@@ -254,7 +254,7 @@ let
         ln -sv "$out/share/hunspell/${dictFileName}.aff" "$out/share/myspell/dicts/"
       '';
 
-      meta = with stdenv.lib; {
+      meta = with lib; {
         homepage = "https://www.j3e.de/ispell/igerman98/index_en.html";
         description = shortDescription;
         license = with licenses; [ gpl2 gpl3 ];
@@ -283,7 +283,7 @@ let
       buildPhase = ''
         cp -a ${sourceRoot}/* .
       '';
-      meta = with stdenv.lib; {
+      meta = with lib; {
         homepage = "https://wiki.documentfoundation.org/Development/Dictionaries";
         description = "Hunspell dictionary for ${shortDescription} from LibreOffice";
         license = license;
@@ -651,7 +651,7 @@ in rec {
     shortName = "hu-hu";
     dictFileName = "hu_HU";
     shortDescription = "Hungarian (Hungary)";
-    license = with stdenv.lib.licenses; [ mpl20 lgpl3 ];
+    license = with lib.licenses; [ mpl20 lgpl3 ];
   };
 
   /* SWEDISH */
@@ -714,7 +714,7 @@ in rec {
       unzip $src ${dictFileName}/{${dictFileName}.dic,${dictFileName}.aff,${readmeFile}}
     '';
 
-    meta = with stdenv.lib; {
+    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;
@@ -730,7 +730,7 @@ in rec {
     shortName = "ru-ru";
     dictFileName = "ru_RU";
     shortDescription = "Russian (Russian)";
-    license = with stdenv.lib.licenses; [ mpl20 lgpl3 ];
+    license = with lib.licenses; [ mpl20 lgpl3 ];
   };
 
   /* CZECH */
@@ -741,7 +741,7 @@ in rec {
     dictFileName = "cs_CZ";
     shortDescription = "Czech (Czechia)";
     readmeFile = "README_cs.txt";
-    license = with stdenv.lib.licenses; [ gpl2 ];
+    license = with lib.licenses; [ gpl2 ];
   };
 
   /* SLOVAK */
@@ -752,7 +752,7 @@ in rec {
     dictFileName = "sk_SK";
     shortDescription = "Slovak (Slovakia)";
     readmeFile = "README_sk.txt";
-    license = with stdenv.lib.licenses; [ gpl2 lgpl21 mpl11 ];
+    license = with lib.licenses; [ gpl2 lgpl21 mpl11 ];
   };
 
   /* DANISH */
@@ -776,10 +776,10 @@ in rec {
       unzip $src ${dictFileName}.dic ${dictFileName}.aff ${readmeFile} -d ${dictFileName}
     '';
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       description = "Hunspell dictionary for Danish (Denmark) from Stavekontrolden";
       homepage = "https://github.com/jeppebundsgaard/stavekontrolden";
-      license = with stdenv.lib.licenses; [ gpl2Only lgpl21Only mpl11 ];
+      license = with lib.licenses; [ gpl2Only lgpl21Only mpl11 ];
       maintainers = with maintainers; [ louisdk1 ];
     };
   };
diff --git a/nixpkgs/pkgs/development/libraries/hwloc/default.nix b/nixpkgs/pkgs/development/libraries/hwloc/default.nix
index 561a4693c1d7..6a939835cf56 100644
--- a/nixpkgs/pkgs/development/libraries/hwloc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/hwloc/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchurl, pkgconfig, expat, ncurses, pciutils, numactl
+{ lib, stdenv, fetchurl, pkg-config, expat, ncurses, pciutils, numactl
 , x11Support ? false, libX11 ? null, cairo ? null
 }:
 
 assert x11Support -> libX11 != null && cairo != null;
 
-with stdenv.lib;
+with lib;
 
 let
   version = "2.4.0";
@@ -25,11 +25,11 @@ in stdenv.mkDerivation {
   ];
 
   # XXX: libX11 is not directly needed, but needed as a propagated dep of Cairo.
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   # Filter out `null' inputs.  This allows users to `.override' the
   # derivation and set optional dependencies to `null'.
-  buildInputs = stdenv.lib.filter (x: x != null)
+  buildInputs = lib.filter (x: x != null)
    ([ expat ncurses ]
      ++  (optionals x11Support [ cairo libX11 ])
      ++  (optionals stdenv.isLinux [ numactl ]));
diff --git a/nixpkgs/pkgs/development/libraries/hyena/default.nix b/nixpkgs/pkgs/development/libraries/hyena/default.nix
index 09b7751c8284..177f6fe7909d 100644
--- a/nixpkgs/pkgs/development/libraries/hyena/default.nix
+++ b/nixpkgs/pkgs/development/libraries/hyena/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, pkgconfig, mono, gtk-sharp-2_0, monoDLLFixer }:
+{ 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}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
     sha256 = "eb7154a42b6529bb9746c39272719f3168d6363ed4bad305a916ed7d90bc8de9";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [
     mono gtk-sharp-2_0
   ];
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   inherit monoDLLFixer;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://wiki.gnome.org/Attic/Hyena";
     description = "A C# library which contains a hodge-podge of random stuff";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/hyperscan/default.nix b/nixpkgs/pkgs/development/libraries/hyperscan/default.nix
index 17246f0aa0a9..f160afb99b7c 100644
--- a/nixpkgs/pkgs/development/libraries/hyperscan/default.nix
+++ b/nixpkgs/pkgs/development/libraries/hyperscan/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchFromGitHub, cmake, ragel, python3
+{ 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: pkgconfig, pcap and pcre intentionally omitted from build inputs
-#         pcap used only in examples, pkgconfig used only to check for pcre
+# 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.
 
@@ -34,8 +34,8 @@ stdenv.mkDerivation rec {
     "-DFAT_RUNTIME=ON"
     "-DBUILD_AVX512=ON"
   ]
-  ++ stdenv.lib.optional (withStatic) "-DBUILD_STATIC_AND_SHARED=ON"
-  ++ stdenv.lib.optional (!withStatic) "-DBUILD_SHARED_LIBS=ON";
+  ++ lib.optional (withStatic) "-DBUILD_STATIC_AND_SHARED=ON"
+  ++ lib.optional (!withStatic) "-DBUILD_SHARED_LIBS=ON";
 
   postPatch = ''
     sed -i '/examples/d' CMakeLists.txt
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
       --replace "includedir=@CMAKE_INSTALL_PREFIX@/@CMAKE_INSTALL_INCLUDEDIR@" "includedir=@CMAKE_INSTALL_INCLUDEDIR@"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "High-performance multiple regex matching library";
     longDescription = ''
       Hyperscan is a high-performance multiple regex matching library.
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
 
       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 
+      expressions and for the matching of regular expressions across
       streams of data.
 
       Hyperscan is typically used in a DPI library stack.
diff --git a/nixpkgs/pkgs/development/libraries/hyphen/default.nix b/nixpkgs/pkgs/development/libraries/hyphen/default.nix
index 9251b2853f1c..ed3980f7a90d 100644
--- a/nixpkgs/pkgs/development/libraries/hyphen/default.nix
+++ b/nixpkgs/pkgs/development/libraries/hyphen/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, ... }:
+{ lib, stdenv, fetchurl, perl, ... }:
 
 let
   version = "2.8.8";
@@ -17,7 +17,7 @@ in stdenv.mkDerivation rec {
     sha256 = "01ap9pr6zzzbp4ky0vy7i1983fwyqy27pl0ld55s30fdxka3ciih";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A text hyphenation library";
     homepage = "https://sourceforge.net/projects/hunspell/files/Hyphen/";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/icu/base.nix b/nixpkgs/pkgs/development/libraries/icu/base.nix
index d8e9bd16ab89..47eea8ba1af1 100644
--- a/nixpkgs/pkgs/development/libraries/icu/base.nix
+++ b/nixpkgs/pkgs/development/libraries/icu/base.nix
@@ -30,18 +30,18 @@ let
 
       # $(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
-    '' + stdenv.lib.optionalString stdenv.isAarch32 ''
+    '' + 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" ]
-      ++ stdenv.lib.optional (stdenv.isFreeBSD || stdenv.isDarwin) "--enable-rpath"
-      ++ stdenv.lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--with-cross-build=${nativeBuildRoot}";
+      ++ lib.optional (stdenv.isFreeBSD || stdenv.isDarwin) "--enable-rpath"
+      ++ lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--with-cross-build=${nativeBuildRoot}";
 
     enableParallelBuilding = true;
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       description = "Unicode and globalization support library";
       homepage = "http://site.icu-project.org/";
       maintainers = with maintainers; [ raskin ];
@@ -57,10 +57,10 @@ let
 
     # FIXME: This fixes dylib references in the dylibs themselves, but
     # not in the programs in $out/bin.
-    nativeBuildInputs = stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+    nativeBuildInputs = lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
     # remove dependency on bootstrap-tools in early stdenv build
-    postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
+    postInstall = lib.optionalString stdenv.isDarwin ''
       sed -i 's/INSTALL_CMD=.*install/INSTALL_CMD=install/' $out/lib/icu/${version}/pkgdata.inc
     '' + (let
       replacements = [
diff --git a/nixpkgs/pkgs/development/libraries/id3lib/default.nix b/nixpkgs/pkgs/development/libraries/id3lib/default.nix
index 6889a9f573ac..31fc4fd6ba33 100644
--- a/nixpkgs/pkgs/development/libraries/id3lib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/id3lib/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, zlib}:
+{lib, stdenv, fetchurl, zlib}:
 
 stdenv.mkDerivation {
   name = "id3lib-3.8.3";
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
 
   doCheck = false; # fails to compile
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for reading, writing, and manipulating ID3v1 and ID3v2 tags";
     homepage = "http://id3lib.sourceforge.net";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/idnkit/default.nix b/nixpkgs/pkgs/development/libraries/idnkit/default.nix
index da7b9f1f2711..472a23a2b74e 100644
--- a/nixpkgs/pkgs/development/libraries/idnkit/default.nix
+++ b/nixpkgs/pkgs/development/libraries/idnkit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libiconv }:
+{ lib, stdenv, fetchurl, libiconv }:
 
 stdenv.mkDerivation rec {
   pname = "idnkit";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libiconv ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.nic.ad.jp/ja/idn/idnkit";
     description = "Provides functionalities about i18n domain name processing";
     license = "idnkit-2 license";
diff --git a/nixpkgs/pkgs/development/libraries/igraph/default.nix b/nixpkgs/pkgs/development/libraries/igraph/default.nix
index 7d8015210383..b98588eb410f 100644
--- a/nixpkgs/pkgs/development/libraries/igraph/default.nix
+++ b/nixpkgs/pkgs/development/libraries/igraph/default.nix
@@ -1,5 +1,5 @@
 { stdenv, lib, fetchFromGitHub,
-  pkgconfig, autoreconfHook,
+  pkg-config, autoreconfHook,
   flex, yacc, zlib, libxml2 }:
 
 stdenv.mkDerivation rec {
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "0cb0kp6mpmgz74kbymqw4xxads8ff7jh0n59dsm76xy6nn8hpqcz";
   };
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
   buildInputs = [ flex yacc zlib libxml2 ];
 
   # Normally, igraph wants us to call bootstrap.sh, which will call
diff --git a/nixpkgs/pkgs/development/libraries/ijs/default.nix b/nixpkgs/pkgs/development/libraries/ijs/default.nix
index 46ed422b5409..b300731ce440 100644
--- a/nixpkgs/pkgs/development/libraries/ijs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ijs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, autoreconfHook, ghostscript }:
+{ lib, stdenv, autoreconfHook, ghostscript }:
 
 stdenv.mkDerivation {
   name = "ijs-${ghostscript.version}";
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
 
   configureFlags = [ "--enable-shared" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.openprinting.org/download/ijs/";
     description = "Raster printer driver architecture";
 
diff --git a/nixpkgs/pkgs/development/libraries/iksemel/default.nix b/nixpkgs/pkgs/development/libraries/iksemel/default.nix
index 7f7645edc91f..6ba64dcaa588 100644
--- a/nixpkgs/pkgs/development/libraries/iksemel/default.nix
+++ b/nixpkgs/pkgs/development/libraries/iksemel/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, autoreconfHook, libtool, pkgconfig, gnutls, fetchFromGitHub, texinfo }:
+{ lib, stdenv, autoreconfHook, libtool, pkg-config, gnutls, fetchFromGitHub, texinfo }:
 
 stdenv.mkDerivation rec {
   pname = "iksemel";
@@ -11,10 +11,10 @@ stdenv.mkDerivation rec {
     sha256 = "1xv302p344hnpxqcgs3z6wwxhrik39ckgfw5cjyrw0dkf316z9yh";
   };
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook libtool texinfo ];
+  nativeBuildInputs = [ pkg-config autoreconfHook libtool texinfo ];
   buildInputs = [ gnutls ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "XML parser for jabber";
 
     homepage = "https://github.com/timothytylee/iksemel-1.4";
diff --git a/nixpkgs/pkgs/development/libraries/ilbc/default.nix b/nixpkgs/pkgs/development/libraries/ilbc/default.nix
index 37885c767bd3..39d7b7b61b04 100644
--- a/nixpkgs/pkgs/development/libraries/ilbc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ilbc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gawk, cmake }:
+{ lib, stdenv, fetchurl, gawk, cmake }:
 
 stdenv.mkDerivation rec {
   name = "ilbc-rfc3951";
@@ -20,6 +20,6 @@ stdenv.mkDerivation rec {
     '';
 
   meta = {
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/ilixi/default.nix b/nixpkgs/pkgs/development/libraries/ilixi/default.nix
index 6f789174ec07..b6f1c0ac78a5 100644
--- a/nixpkgs/pkgs/development/libraries/ilixi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ilixi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, directfb, libsigcxx, libxml2, fontconfig }:
+{ lib, stdenv, fetchurl, pkg-config, directfb, libsigcxx, libxml2, fontconfig }:
 
 # TODO: optional deps: baresip, FusionDale, FusionSound, SaWMan, doxygen,
 # Reflex, Wnn, NLS
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "1kmdmqf68jiv7y6as41bhbgdy70yy2i811a3l6kccbazlzpif34v";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ directfb libsigcxx libxml2 fontconfig ];
 
   configureFlags = [
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     "--with-examples"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Lightweight C++ GUI toolkit for embedded Linux systems";
     homepage = "https://github.com/ilixi/ilixi";
     license = licenses.lgpl3;
diff --git a/nixpkgs/pkgs/development/libraries/ilmbase/default.nix b/nixpkgs/pkgs/development/libraries/ilmbase/default.nix
index 68bd677cf777..219d961f9f96 100644
--- a/nixpkgs/pkgs/development/libraries/ilmbase/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ilmbase/default.nix
@@ -7,7 +7,7 @@
 
 stdenv.mkDerivation rec {
   pname = "ilmbase";
-  version = stdenv.lib.getVersion openexr;
+  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.
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     cd IlmBase
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/iml/default.nix b/nixpkgs/pkgs/development/libraries/iml/default.nix
index cf1d9018fd51..09ae213eb5d8 100644
--- a/nixpkgs/pkgs/development/libraries/iml/default.nix
+++ b/nixpkgs/pkgs/development/libraries/iml/default.nix
@@ -1,4 +1,4 @@
-{stdenv, autoreconfHook, fetchurl, gmp, blas}:
+{lib, stdenv, autoreconfHook, fetchurl, gmp, blas}:
 stdenv.mkDerivation rec {
   pname = "iml";
   version = "1.0.5";
@@ -20,10 +20,10 @@ stdenv.mkDerivation rec {
   ];
   meta = {
     inherit version;
-    description = ''Algorithms for computing exact solutions to dense systems of linear equations over the integers'';
-    license = stdenv.lib.licenses.gpl2Plus;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.unix;
+    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
index b94af22c0a76..53612f8205fe 100644
--- a/nixpkgs/pkgs/development/libraries/imlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/imlib/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, fetchpatch, libX11, libXext, xorgproto, libjpeg, libungif, libtiff, libpng}:
+{lib, stdenv, fetchurl, fetchpatch, libX11, libXext, xorgproto, libjpeg, libungif, libtiff, libpng}:
 
 stdenv.mkDerivation {
   name = "imlib-1.9.15";
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
 
   buildInputs = [libjpeg libXext libX11 xorgproto libtiff libungif libpng];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An image loading and rendering library for X11";
     platforms = platforms.unix;
     license = with licenses; [ gpl2 lgpl2 ];
diff --git a/nixpkgs/pkgs/development/libraries/imlib2/default.nix b/nixpkgs/pkgs/development/libraries/imlib2/default.nix
index 458b3d29d520..666fcab989b7 100644
--- a/nixpkgs/pkgs/development/libraries/imlib2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/imlib2/default.nix
@@ -1,14 +1,14 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 # Image file formats
 , libjpeg, libtiff, giflib, libpng, libwebp
 # imlib2 can load images from ID3 tags.
 , libid3tag
-, freetype , bzip2, pkgconfig
+, freetype , bzip2, pkg-config
 , x11Support ? true, xlibsWrapper ? null
 }:
 
 let
-  inherit (stdenv.lib) optional;
+  inherit (lib) optional;
 in
 stdenv.mkDerivation rec {
   pname = "imlib2";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     bzip2 freetype libid3tag
   ] ++ optional x11Support xlibsWrapper;
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   enableParallelBuilding = true;
 
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
     moveToOutput bin/imlib2-config "$dev"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Image manipulation library";
 
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/impy/default.nix b/nixpkgs/pkgs/development/libraries/impy/default.nix
index c865b25c0009..1f5d9070dd37 100644
--- a/nixpkgs/pkgs/development/libraries/impy/default.nix
+++ b/nixpkgs/pkgs/development/libraries/impy/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , pkg-config
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
     SDL2
   ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/inchi/default.nix b/nixpkgs/pkgs/development/libraries/inchi/default.nix
index 869011007599..6acdf340c91a 100644
--- a/nixpkgs/pkgs/development/libraries/inchi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/inchi/default.nix
@@ -1,4 +1,4 @@
-{ pkgs, fetchurl, stdenv, unzip }:
+{ pkgs, fetchurl, lib, stdenv, unzip }:
 stdenv.mkDerivation {
   pname = "inchi";
   version = "1.05";
@@ -41,7 +41,7 @@ stdenv.mkDerivation {
       install -m 644 INCHI-1-DOC/*.pdf $doc/share
     '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.inchi-trust.org/";
     description = "IUPAC International Chemical Identifier library";
     license = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/incrtcl/default.nix b/nixpkgs/pkgs/development/libraries/incrtcl/default.nix
index c08d5924b0c5..67ae5623db12 100644
--- a/nixpkgs/pkgs/development/libraries/incrtcl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/incrtcl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, writeText, tcl }:
+{ lib, stdenv, fetchurl, writeText, tcl }:
 
 stdenv.mkDerivation rec {
   pname = "incrtcl";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     rmdir $out/bin
     mv $out/lib/itcl${version}/* $out/lib
     ln -s libitcl${version}${stdenv.hostPlatform.extensions.sharedLibrary} \
-      $out/lib/libitcl${stdenv.lib.versions.major version}${stdenv.hostPlatform.extensions.sharedLibrary}
+      $out/lib/libitcl${lib.versions.major version}${stdenv.hostPlatform.extensions.sharedLibrary}
     rmdir $out/lib/itcl${version}
   '';
 
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "man" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage    = "http://incrtcl.sourceforge.net/";
     description = "Object Oriented Enhancements for Tcl/Tk";
     license     = licenses.tcltk;
diff --git a/nixpkgs/pkgs/development/libraries/indicator-application/gtk2.nix b/nixpkgs/pkgs/development/libraries/indicator-application/gtk2.nix
index 6ac74988dff4..f75ade98c6d8 100644
--- a/nixpkgs/pkgs/development/libraries/indicator-application/gtk2.nix
+++ b/nixpkgs/pkgs/development/libraries/indicator-application/gtk2.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, lib, file
-, pkgconfig, autoconf
+, pkg-config, autoconf
 , glib, dbus-glib, json-glib
 , gtk2, libindicator-gtk2, libdbusmenu-gtk2, libappindicator-gtk2 }:
 
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     sha256 = "1xqsb6c1pwawabw854f7aybjrgyhc2r1316i9lyjspci51zk5m7v";
   };
 
-  nativeBuildInputs = [ pkgconfig autoconf ];
+  nativeBuildInputs = [ pkg-config autoconf ];
 
   buildInputs = [
     glib dbus-glib json-glib
diff --git a/nixpkgs/pkgs/development/libraries/indicator-application/gtk3.nix b/nixpkgs/pkgs/development/libraries/indicator-application/gtk3.nix
index a523019e78c2..8947e33e9001 100644
--- a/nixpkgs/pkgs/development/libraries/indicator-application/gtk3.nix
+++ b/nixpkgs/pkgs/development/libraries/indicator-application/gtk3.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchbzr
-, pkgconfig, systemd, autoreconfHook
+{ lib, stdenv, fetchbzr
+, pkg-config, systemd, autoreconfHook
 , glib, dbus-glib, json-glib
 , gtk3, libindicator-gtk3, libdbusmenu-gtk3, libappindicator-gtk3 }:
 
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     sha256 = "1f0jdyqqb5g86zdpbcyn16x94yjigsfiv2kf73dvni5rp1vafbq1";
   };
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
 
   buildInputs = [
     glib dbus-glib json-glib systemd
@@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
     rm -rf $out/share/upstart
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/indilib/default.nix b/nixpkgs/pkgs/development/libraries/indilib/default.nix
index 1635827340e2..035356ac861a 100644
--- a/nixpkgs/pkgs/development/libraries/indilib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/indilib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , cfitsio
@@ -14,13 +14,13 @@
 
 stdenv.mkDerivation rec {
   pname = "indilib";
-  version = "1.8.7";
+  version = "1.8.8";
 
   src = fetchFromGitHub {
     owner = "indilib";
     repo = "indi";
     rev = "v${version}";
-    sha256 = "0cy9l1vpsnfilxslvmn88hhq8iw8cnx3xpbnl78c0dgjyfv5xmhz";
+    sha256 = "sha256-WTRfV6f764tDGKnQVd1jeYN/qXa/VRTFK0mMalc+9aU=";
   };
 
   patches = [
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
     fftw
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.indilib.org/";
     description = "Implementation of the INDI protocol for POSIX operating systems";
     license = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/inih/default.nix b/nixpkgs/pkgs/development/libraries/inih/default.nix
index 62de607f7d43..11e49f7ddc49 100644
--- a/nixpkgs/pkgs/development/libraries/inih/default.nix
+++ b/nixpkgs/pkgs/development/libraries/inih/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, meson, ninja }:
+{ lib, stdenv, fetchFromGitHub, meson, ninja }:
 
 stdenv.mkDerivation rec {
   pname = "inih";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     "-Dwith_INIReader=true"
   ];
 
-  meta = with stdenv.lib; {
+  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}";
diff --git a/nixpkgs/pkgs/development/libraries/iniparser/default.nix b/nixpkgs/pkgs/development/libraries/iniparser/default.nix
index 51c6728e8b00..8c7fdfd04d6b 100644
--- a/nixpkgs/pkgs/development/libraries/iniparser/default.nix
+++ b/nixpkgs/pkgs/development/libraries/iniparser/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "iniparser";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   patches = ./no-usr.patch;
 
-  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace Makefile \
         --replace -Wl,-soname= -Wl,-install_name,
   '';
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
     ln -s libiniparser.so.1 $out/lib/libiniparser.so
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit (src.meta) homepage;
     description = "Free standalone ini file parsing library";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/intel-gmmlib/default.nix b/nixpkgs/pkgs/development/libraries/intel-gmmlib/default.nix
index 30d572853cfd..28138f103b9d 100644
--- a/nixpkgs/pkgs/development/libraries/intel-gmmlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/intel-gmmlib/default.nix
@@ -1,24 +1,30 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , cmake
 }:
 
 stdenv.mkDerivation rec {
   pname = "intel-gmmlib";
-  version = "20.3.3";
+  version = "20.4.1";
 
   src = fetchFromGitHub {
     owner  = "intel";
     repo   = "gmmlib";
     rev    = "${pname}-${version}";
-    sha256 = "1diq1gqpfv5bawvag6bzwnd3ilhacwmwx3bl67abjvbb0m3jw4lk";
+    sha256 = "0qb0wpinfv8lg1pq1pxkl6v0kd8ax86m8zxzm6zjx91alsch1mi6";
   };
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  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
index 153e41a777cc..6e62484ac681 100644
--- a/nixpkgs/pkgs/development/libraries/intel-media-driver/default.nix
+++ b/nixpkgs/pkgs/development/libraries/intel-media-driver/default.nix
@@ -1,17 +1,18 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , cmake, pkg-config
-, libva, libpciaccess, intel-gmmlib, libX11
+, libva, libpciaccess, intel-gmmlib
+, enableX11 ? true, libX11
 }:
 
 stdenv.mkDerivation rec {
   pname = "intel-media-driver";
-  version = "20.4.5";
+  version = "21.1.0";
 
   src = fetchFromGitHub {
     owner  = "intel";
     repo   = "media-driver";
     rev    = "intel-media-${version}";
-    sha256 = "149xkhhp8q06c1jzxjs24lnbfrlvf19m0hcwld593vv4arfpbpmf";
+    sha256 = "17cgs52f42jdvfb6q3wpkxaz2b41z59jdribpgb9qmcvizsnglxc";
   };
 
   cmakeFlags = [
@@ -23,9 +24,10 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake pkg-config ];
 
-  buildInputs = [ libva libpciaccess intel-gmmlib libX11 ];
+  buildInputs = [ libva libpciaccess intel-gmmlib ]
+    ++ lib.optional enableX11 libX11;
 
-  meta = with stdenv.lib; {
+  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)
@@ -38,4 +40,9 @@ stdenv.mkDerivation rec {
     platforms = platforms.linux;
     maintainers = with maintainers; [ primeos jfrankenau ];
   };
+
+  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
+  '';
 }
diff --git a/nixpkgs/pkgs/development/libraries/intel-media-sdk/default.nix b/nixpkgs/pkgs/development/libraries/intel-media-sdk/default.nix
index 71e6d3d700ab..dd605aaae5cd 100644
--- a/nixpkgs/pkgs/development/libraries/intel-media-sdk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/intel-media-sdk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig, gtest, libdrm, libpciaccess, libva, libX11
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, gtest, libdrm, libpciaccess, libva, libX11
 , libXau, libXdmcp, libpthreadstubs }:
 
 stdenv.mkDerivation rec {
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "0qnq43qjcmzkn6v2aymzi3kycndk9xw6m5f5g5sz5x53nz556bp0";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
   buildInputs = [
     libdrm libva libpciaccess libX11 libXau libXdmcp libpthreadstubs
   ];
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Intel Media SDK";
     license = licenses.mit;
     maintainers = with maintainers; [ midchildan ];
diff --git a/nixpkgs/pkgs/development/libraries/ip2location-c/default.nix b/nixpkgs/pkgs/development/libraries/ip2location-c/default.nix
index 8387aa67161b..23801d3436da 100644
--- a/nixpkgs/pkgs/development/libraries/ip2location-c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ip2location-c/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook }:
+{ lib, stdenv, fetchurl, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "ip2location-c";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   # databases are available, downloading them for just 1 test seems excessive):
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  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,
diff --git a/nixpkgs/pkgs/development/libraries/irrlicht/default.nix b/nixpkgs/pkgs/development/libraries/irrlicht/default.nix
index 84e7fae60450..e283a2909474 100644
--- a/nixpkgs/pkgs/development/libraries/irrlicht/default.nix
+++ b/nixpkgs/pkgs/development/libraries/irrlicht/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, libGLU, libGL, unzip, libXrandr, libX11, libXxf86vm }:
+{ lib, stdenv, fetchzip, libGLU, libGL, unzip, libXrandr, libX11, libXxf86vm }:
 
 let
   common = import ./common.nix { inherit fetchzip; };
@@ -31,8 +31,8 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "http://irrlicht.sourceforge.net/";
-    license = stdenv.lib.licenses.zlib;
+    license = lib.licenses.zlib;
     description = "Open source high performance realtime 3D engine written in C++";
-    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    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
index 5f8335efab2b..b41486ce9dd6 100644
--- a/nixpkgs/pkgs/development/libraries/irrlicht/mac.nix
+++ b/nixpkgs/pkgs/development/libraries/irrlicht/mac.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, libGLU, libGL, unzip, fetchFromGitHub, cmake, Cocoa, OpenGL, IOKit }:
+{ lib, stdenv, fetchzip, libGLU, libGL, unzip, fetchFromGitHub, cmake, Cocoa, OpenGL, IOKit }:
 
 let
   common = import ./common.nix { inherit fetchzip; };
@@ -9,16 +9,16 @@ stdenv.mkDerivation rec {
   version = common.version;
 
   src = fetchFromGitHub {
-		owner = "quiark";
-		repo = "IrrlichtCMake";
-		rev = "523a5e6ef84be67c3014f7b822b97acfced536ce";
-		sha256 = "10ahnry2zl64wphs233gxhvs6c0345pyf5nwa29mc6yn49x7bidi";
+    owner = "quiark";
+    repo = "IrrlichtCMake";
+    rev = "523a5e6ef84be67c3014f7b822b97acfced536ce";
+    sha256 = "10ahnry2zl64wphs233gxhvs6c0345pyf5nwa29mc6yn49x7bidi";
   };
 
   postUnpack = ''
     cp -r ${common.src}/* $sourceRoot/
     chmod -R 777 $sourceRoot
-	'';
+  '';
 
   patches = [ ./mac_device.patch ];
   dontFixCmake = true;
@@ -36,8 +36,8 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "http://irrlicht.sourceforge.net/";
-    license = stdenv.lib.licenses.zlib;
+    license = lib.licenses.zlib;
     description = "Open source high performance realtime 3D engine written in C++";
-    platforms = stdenv.lib.platforms.darwin;
+    platforms = lib.platforms.darwin;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/isl/0.11.1.nix b/nixpkgs/pkgs/development/libraries/isl/0.11.1.nix
index 1cac0d369fed..5beffd1f0d2e 100644
--- a/nixpkgs/pkgs/development/libraries/isl/0.11.1.nix
+++ b/nixpkgs/pkgs/development/libraries/isl/0.11.1.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gmp }:
+{ lib, stdenv, fetchurl, gmp }:
 
 stdenv.mkDerivation {
   name = "isl-0.11.1"; # CLooG 0.16.3 fails to build with ISL 0.08.
@@ -15,8 +15,8 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = "https://www.kotnet.org/~skimo/isl/";
-    license = stdenv.lib.licenses.lgpl21;
+    license = lib.licenses.lgpl21;
     description = "A library for manipulating sets and relations of integer points bounded by linear constraints";
-    platforms = stdenv.lib.platforms.all;
+    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
index a97e05b0431a..8936d6c5f3be 100644
--- a/nixpkgs/pkgs/development/libraries/isl/0.14.1.nix
+++ b/nixpkgs/pkgs/development/libraries/isl/0.14.1.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gmp }:
+{ lib, stdenv, fetchurl, gmp }:
 
 stdenv.mkDerivation rec {
   name = "isl-0.14.1";
@@ -14,8 +14,8 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "https://www.kotnet.org/~skimo/isl/";
-    license = stdenv.lib.licenses.lgpl21;
+    license = lib.licenses.lgpl21;
     description = "A library for manipulating sets and relations of integer points bounded by linear constraints";
-    platforms = stdenv.lib.platforms.all;
+    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
index 018f70850881..a823b69fa27b 100644
--- a/nixpkgs/pkgs/development/libraries/isl/0.17.1.nix
+++ b/nixpkgs/pkgs/development/libraries/isl/0.17.1.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gmp }:
+{ lib, stdenv, fetchurl, gmp }:
 
 stdenv.mkDerivation rec {
   name = "isl-0.17.1";
@@ -14,8 +14,8 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "https://www.kotnet.org/~skimo/isl/";
-    license = stdenv.lib.licenses.lgpl21;
+    license = lib.licenses.lgpl21;
     description = "A library for manipulating sets and relations of integer points bounded by linear constraints";
-    platforms = stdenv.lib.platforms.all;
+    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
index 3775bdc71e02..c35588555a7f 100644
--- a/nixpkgs/pkgs/development/libraries/isl/0.20.0.nix
+++ b/nixpkgs/pkgs/development/libraries/isl/0.20.0.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gmp }:
+{ lib, stdenv, fetchurl, gmp }:
 
 stdenv.mkDerivation rec {
   name = "isl-0.20";
@@ -14,8 +14,8 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "http://isl.gforge.inria.fr/";
-    license = stdenv.lib.licenses.lgpl21;
+    license = lib.licenses.lgpl21;
     description = "A library for manipulating sets and relations of integer points bounded by linear constraints";
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/iso-codes/default.nix b/nixpkgs/pkgs/development/libraries/iso-codes/default.nix
index 8ba9ea31b801..6d770430ce56 100644
--- a/nixpkgs/pkgs/development/libraries/iso-codes/default.nix
+++ b/nixpkgs/pkgs/development/libraries/iso-codes/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, gettext, python3}:
+{lib, stdenv, fetchurl, gettext, python3}:
 
 stdenv.mkDerivation rec {
   pname = "iso-codes";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ gettext python3 ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://salsa.debian.org/iso-codes-team/iso-codes";
     description = "Various ISO codes packaged as XML files";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/itk/4.x.nix b/nixpkgs/pkgs/development/libraries/itk/4.x.nix
index 112b77650d29..54a3c33cd017 100644
--- a/nixpkgs/pkgs/development/libraries/itk/4.x.nix
+++ b/nixpkgs/pkgs/development/libraries/itk/4.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, libX11, libuuid, xz, vtk_7, Cocoa }:
+{ lib, stdenv, fetchFromGitHub, cmake, libX11, libuuid, xz, vtk_7, Cocoa }:
 
 stdenv.mkDerivation rec {
   pname = "itk";
@@ -22,16 +22,14 @@ stdenv.mkDerivation rec {
     "-DModule_ITKReview=ON"
   ];
 
-  enableParallelBuilding = true;
-
   nativeBuildInputs = [ cmake xz ];
-  buildInputs = [ libX11 libuuid vtk_7 ] ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa ];
+  buildInputs = [ libX11 libuuid vtk_7 ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
 
   meta = {
     description = "Insight Segmentation and Registration Toolkit";
     homepage = "https://www.itk.org/";
-    license = stdenv.lib.licenses.asl20;
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    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
index c0416b23dc22..ac899ce26f10 100644
--- a/nixpkgs/pkgs/development/libraries/itk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/itk/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchFromGitHub, cmake, makeWrapper
-, pkgconfig, libX11, libuuid, xz, vtk_7, Cocoa }:
+{ lib, stdenv, fetchFromGitHub, cmake, makeWrapper
+, pkg-config, libX11, libuuid, xz, vtk_7, Cocoa }:
 
 stdenv.mkDerivation rec {
   pname = "itk";
@@ -28,19 +28,17 @@ stdenv.mkDerivation rec {
     "-DModule_ITKReview=ON"
   ];
 
-  enableParallelBuilding = true;
-
   nativeBuildInputs = [ cmake xz makeWrapper ];
-  buildInputs = [ libX11 libuuid vtk_7 ] ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa ];
+  buildInputs = [ libX11 libuuid vtk_7 ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
 
   postInstall = ''
-    wrapProgram "$out/bin/h5c++" --prefix PATH ":" "${pkgconfig}/bin"
+    wrapProgram "$out/bin/h5c++" --prefix PATH ":" "${pkg-config}/bin"
   '';
 
   meta = {
     description = "Insight Segmentation and Registration Toolkit";
     homepage = "https://www.itk.org/";
-    license = stdenv.lib.licenses.asl20;
-    maintainers = with stdenv.lib.maintainers; [viric];
+    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
index 3c70369eb91e..570190a43c1e 100644
--- a/nixpkgs/pkgs/development/libraries/itktcl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/itktcl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, tcl, tk, incrtcl }:
+{ lib, stdenv, fetchurl, tcl, tk, incrtcl }:
 
 stdenv.mkDerivation rec {
   pname = "itk-tcl";
@@ -23,13 +23,13 @@ stdenv.mkDerivation rec {
     rmdir $out/bin
     mv $out/lib/itk${version}/* $out/lib
     ln -s libitk${version}${stdenv.hostPlatform.extensions.sharedLibrary} \
-      $out/lib/libitk${stdenv.lib.versions.major 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 stdenv.lib; {
+  meta = with lib; {
     homepage    = "http://incrtcl.sourceforge.net/";
     description = "Mega-widget toolkit for incr Tk";
     license     = licenses.tcltk;
diff --git a/nixpkgs/pkgs/development/libraries/jabcode/default.nix b/nixpkgs/pkgs/development/libraries/jabcode/default.nix
index c875e4a39435..36c4c8c61c53 100644
--- a/nixpkgs/pkgs/development/libraries/jabcode/default.nix
+++ b/nixpkgs/pkgs/development/libraries/jabcode/default.nix
@@ -3,7 +3,7 @@
 , lib
 , subproject ? "library" # one of "library", "reader" or  "writer"
 , zlib, libpng, libtiff
-, jabcode 
+, jabcode
 }:
 let
   subdir = lib.getAttr subproject {
diff --git a/nixpkgs/pkgs/development/libraries/jama/default.nix b/nixpkgs/pkgs/development/libraries/jama/default.nix
index 5c7473be647a..02dd4a5635b5 100644
--- a/nixpkgs/pkgs/development/libraries/jama/default.nix
+++ b/nixpkgs/pkgs/development/libraries/jama/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, unzip, tnt}:
+{lib, stdenv, fetchurl, unzip, tnt}:
 
 stdenv.mkDerivation rec {
   pname = "jama";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
       cp *.h $out/include
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://math.nist.gov/tnt/";
     description = "JAMA/C++ Linear Algebra Package: Java-like matrix C++ templates";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/jansson/default.nix b/nixpkgs/pkgs/development/libraries/jansson/default.nix
index 7ecf7579a307..85451511d7e4 100644
--- a/nixpkgs/pkgs/development/libraries/jansson/default.nix
+++ b/nixpkgs/pkgs/development/libraries/jansson/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   name = "jansson-2.13.1";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0ks7gbs0j8p4dmmi2sq129mxy5gfg0z6220i1jk020mi2zd7gwzl";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.digip.org/jansson/";
     description = "C library for encoding, decoding and manipulating JSON data";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/java/commons/bcel/default.nix b/nixpkgs/pkgs/development/libraries/java/commons/bcel/default.nix
index 4a2b030a3dbf..9d34aaf6c8e9 100644
--- a/nixpkgs/pkgs/development/libraries/java/commons/bcel/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/commons/bcel/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   version = "5.2";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   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 stdenv.lib.maintainers; [ copumpkin ];
-    license     = stdenv.lib.licenses.asl20;
-    platforms = with stdenv.lib.platforms; unix;
+    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
index 46bd3c0fd155..629ab7ec131a 100644
--- a/nixpkgs/pkgs/development/libraries/java/commons/bsf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/commons/bsf/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation {
   name = "commons-bsf-1.2";
@@ -16,8 +16,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Interface to scripting languages, including JSR-223";
     homepage = "http://commons.apache.org/proper/commons-bsf/";
-    license = stdenv.lib.licenses.asl20;
-    platforms = stdenv.lib.platforms.unix;
+    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
index 5307c635834c..79f63026e388 100644
--- a/nixpkgs/pkgs/development/libraries/java/commons/compress/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/commons/compress/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   version = "1.20";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   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 stdenv.lib.maintainers; [ copumpkin ];
-    license     = stdenv.lib.licenses.asl20;
-    platforms = with stdenv.lib.platforms; unix;
+    maintainers = with lib.maintainers; [ copumpkin ];
+    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
index cd439b503971..868f2da4e537 100644
--- a/nixpkgs/pkgs/development/libraries/java/commons/fileupload/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/commons/fileupload/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   version = "1.3.1";
@@ -17,8 +17,8 @@ stdenv.mkDerivation rec {
   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 stdenv.lib.maintainers; [ copumpkin ];
-    license     = stdenv.lib.licenses.asl20;
-    platforms = with stdenv.lib.platforms; unix;
+    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
index 10587a72ecda..0c5ac8f4dded 100644
--- a/nixpkgs/pkgs/development/libraries/java/commons/io/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/commons/io/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   version = "2.8.0";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage    = "http://commons.apache.org/proper/commons-io";
     description = "A library of utilities to assist with developing IO functionality";
-    maintainers = with stdenv.lib.maintainers; [ copumpkin ];
-    license     = stdenv.lib.licenses.asl20;
-    platforms = with stdenv.lib.platforms; unix;
+    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
index bd0f7c273e79..5009fe6cac7f 100644
--- a/nixpkgs/pkgs/development/libraries/java/commons/lang/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/commons/lang/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   version = "3.11";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage    = "http://commons.apache.org/proper/commons-lang";
     description = "Provides additional methods to manipulate standard Java library classes";
-    maintainers = with stdenv.lib.maintainers; [ copumpkin ];
-    license     = stdenv.lib.licenses.asl20;
-    platforms = with stdenv.lib.platforms; unix;
+    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
index 7c2192e4952e..d63a214e2ad7 100644
--- a/nixpkgs/pkgs/development/libraries/java/commons/logging/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/commons/logging/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation {
   name = "commons-logging-1.2";
@@ -16,8 +16,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Wrapper around a variety of logging API implementations";
     homepage = "http://commons.apache.org/proper/commons-logging";
-    license = stdenv.lib.licenses.asl20;
-    platforms = stdenv.lib.platforms.unix;
+    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
index 7c4fc5c632e2..960f12fb8bfb 100644
--- a/nixpkgs/pkgs/development/libraries/java/commons/math/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/commons/math/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   version = "3.6.1";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage    = "http://commons.apache.org/proper/commons-math/";
     description = "A library of lightweight, self-contained mathematics and statistics components";
-    maintainers = with stdenv.lib.maintainers; [ copumpkin ];
-    license     = stdenv.lib.licenses.asl20;
-    platforms = with stdenv.lib.platforms; unix;
+    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
index acf8cc9b83d9..f7732ff637af 100644
--- a/nixpkgs/pkgs/development/libraries/java/cup/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/cup/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, jdk, ant } :
+{ lib, stdenv, fetchurl, jdk, ant } :
 
 stdenv.mkDerivation rec {
   pname = "java-cup";
@@ -31,8 +31,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://www2.cs.tum.edu/projects/cup/";
     description = "LALR parser generator for Java";
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.all;
-    maintainers = [ stdenv.lib.maintainers.romildo ];
+    license = lib.licenses.mit;
+    platforms = lib.platforms.all;
+    maintainers = [ lib.maintainers.romildo ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/java/dbus-java/default.nix b/nixpkgs/pkgs/development/libraries/java/dbus-java/default.nix
index 0133138b4784..9fbcf8b020ce 100644
--- a/nixpkgs/pkgs/development/libraries/java/dbus-java/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/dbus-java/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, gettext, jdk8, libmatthew_java}:
+{lib, stdenv, fetchurl, gettext, jdk8, libmatthew_java}:
 
 let jdk = jdk8; in
 stdenv.mkDerivation {
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
   };
   JAVA_HOME=jdk;
   JAVA="${jdk}/bin/java";
-  PREFIX=''''${out}'';
+  PREFIX="\${out}";
   JAVAUNIXLIBDIR="${libmatthew_java}/lib/jni";
   JAVAUNIXJARDIR="${libmatthew_java}/share/java";
   buildInputs = [ gettext jdk ];
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
            -e "s|install: install-bin install-man install-doc|install: install-bin|" Makefile
   '';
 
-  meta = with stdenv.lib; {
+  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
index 6d4dfbfe61c6..4d9902cbbe9a 100644
--- a/nixpkgs/pkgs/development/libraries/java/geoipjava/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/geoipjava/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, jdk, unzip}:
+{lib, stdenv, fetchurl, jdk, unzip}:
 
 stdenv.mkDerivation {
   name = "GeoIPJava-1.2.5";
@@ -7,7 +7,7 @@ stdenv.mkDerivation {
     sha256 = "1gb2d0qvvq7xankz7l7ymbr3qprwk9bifpy4hlgw0sq4i6a55ypd";
   };
   buildInputs = [ jdk unzip ];
-  buildPhase = 
+  buildPhase =
     ''
       cd source
       javac $(find . -name \*.java)
@@ -20,8 +20,8 @@ stdenv.mkDerivation {
     '';
   meta = {
     description = "GeoIP Java API";
-    license = stdenv.lib.licenses.lgpl21Plus;
-    maintainers = [ stdenv.lib.maintainers.sander ];
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.lgpl21Plus;
+    maintainers = [ lib.maintainers.sander ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/java/gwt-dragdrop/default.nix b/nixpkgs/pkgs/development/libraries/java/gwt-dragdrop/default.nix
index 37d7cac0da26..34a0e8c530a4 100644
--- a/nixpkgs/pkgs/development/libraries/java/gwt-dragdrop/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/gwt-dragdrop/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation {
   name = "gwt-dnd-2.6.5";
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
     sha256 = "07zdlr8afs499asnw0dcjmw1cnjc646v91lflx5dv4qj374c97fw";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     platforms = platforms.unix;
     license = licenses.asl20;
   };
diff --git a/nixpkgs/pkgs/development/libraries/java/gwt-widgets/default.nix b/nixpkgs/pkgs/development/libraries/java/gwt-widgets/default.nix
index a968ebc5fd8e..692326a21895 100644
--- a/nixpkgs/pkgs/development/libraries/java/gwt-widgets/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/gwt-widgets/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation {
   name = "gwt-widgets-0.2.0";
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
     sha256 = "09isj4j6842rj13nv8264irkjjhvmgihmi170ciabc98911bakxb";
   };
 
-  meta = with stdenv.lib; {
+  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
index 88f32866b0d0..32b000622391 100644
--- a/nixpkgs/pkgs/development/libraries/java/hsqldb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/hsqldb/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl, unzip, makeWrapper, jre }:
+{ lib, stdenv, fetchurl, unzip, makeWrapper, jre }:
 
 stdenv.mkDerivation rec {
   pname = "hsqldb";
   version = "2.5.1";
-  underscoreMajMin = stdenv.lib.strings.replaceChars ["."] ["_"] (stdenv.lib.versions.majorMinor version);
+  underscoreMajMin = lib.strings.replaceChars ["."] ["_"] (lib.versions.majorMinor version);
 
   src = fetchurl {
     url = "mirror://sourceforge/project/hsqldb/hsqldb/hsqldb_${underscoreMajMin}/hsqldb-${version}.zip";
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
    runHook postInstall
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/java/httpunit/default.nix b/nixpkgs/pkgs/development/libraries/java/httpunit/default.nix
index 34af97605d2a..ad276fcdd636 100644
--- a/nixpkgs/pkgs/development/libraries/java/httpunit/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/httpunit/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, unzip} :
+{lib, stdenv, fetchurl, unzip} :
 
 stdenv.mkDerivation {
   name = "httpunit-1.7";
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
 
   inherit unzip;
 
-  meta = with stdenv.lib; {
+  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
index 54e85ec55897..19bc3524c590 100644
--- a/nixpkgs/pkgs/development/libraries/java/hydra-ant-logger/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/hydra-ant-logger/default.nix
@@ -1,4 +1,4 @@
-{ fetchgit, stdenv, ant, jdk }:
+{ fetchgit, lib, stdenv, ant, jdk }:
 
 stdenv.mkDerivation {
   pname = "hydra-ant-logger";
@@ -20,6 +20,6 @@ stdenv.mkDerivation {
   '';
 
   meta = {
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/java/jdom/default.nix b/nixpkgs/pkgs/development/libraries/java/jdom/default.nix
index 60558f72cfc8..4bb90dd98874 100644
--- a/nixpkgs/pkgs/development/libraries/java/jdom/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/jdom/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl} :
+{lib, stdenv, fetchurl} :
 
 stdenv.mkDerivation {
   name = "jdom-1.0";
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
     sha256 = "1igmxzcy0s25zcy9vmcw0kd13lh60r0b4qg8lnp1jic33f427pxf";
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/java/jflex/default.nix b/nixpkgs/pkgs/development/libraries/java/jflex/default.nix
index d0258d5896be..cf5b42a0ac21 100644
--- a/nixpkgs/pkgs/development/libraries/java/jflex/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/jflex/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, jre} :
+{lib, stdenv, fetchurl, jre} :
 
 stdenv.mkDerivation rec {
   name = "jflex-1.8.2";
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://www.jflex.de/";
     description = "Lexical analyzer generator for Java, written in Java";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.unix;
+    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
index c114ddeac274..1695d11cb25f 100644
--- a/nixpkgs/pkgs/development/libraries/java/junit/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/junit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, antBuild, fetchgit, perl }:
+{ lib, stdenv, antBuild, fetchgit, perl }:
 
 let
   version = "4.11";
@@ -22,7 +22,7 @@ in antBuild {
   meta = {
     homepage = "http://www.junit.org/";
     description = "A framework for repeatable tests in Java";
-    license = stdenv.lib.licenses.epl10;
+    license = lib.licenses.epl10;
     broken = true;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/java/junixsocket/default.nix b/nixpkgs/pkgs/development/libraries/java/junixsocket/default.nix
index cb88df276a57..7a7d6a933bc0 100644
--- a/nixpkgs/pkgs/development/libraries/java/junixsocket/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/junixsocket/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ant, jdk, junit }:
+{ lib, stdenv, fetchurl, ant, jdk, junit }:
 
 stdenv.mkDerivation rec {
   name = "junixsocket-1.3";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     # 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=cc" "-Dant.build.javac.source=1.6" ]
-    ++ stdenv.lib.optional stdenv.isDarwin "-DisMac=true";
+    ++ lib.optional stdenv.isDarwin "-DisMac=true";
 
   installPhase =
     ''
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A Java/JNI library for using Unix Domain Sockets from Java";
     homepage = "https://github.com/kohlschutter/junixsocket";
-    license = stdenv.lib.licenses.asl20;
-    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    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
index 8b8123dff2b3..a3cdaa37ed06 100644
--- a/nixpkgs/pkgs/development/libraries/java/libmatthew-java/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/libmatthew-java/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, jdk}:
+{lib, stdenv, fetchurl, jdk}:
 
 stdenv.mkDerivation {
   name = "libmatthew-java-0.8";
@@ -7,10 +7,10 @@ stdenv.mkDerivation {
     sha256 = "1yldkhsdzm0a41a0i881bin2jklhp85y3ah245jd6fz3npcx7l85";
   };
   JAVA_HOME=jdk;
-  PREFIX=''''${out}'';
+  PREFIX="\${out}";
   buildInputs = [ jdk ];
 
-  meta = with stdenv.lib; {
+  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
index 6d09bead53e4..ddf95ead249a 100644
--- a/nixpkgs/pkgs/development/libraries/java/lombok/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/lombok/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, jdk }:
+{ lib, stdenv, fetchurl, makeWrapper, jdk }:
 
 stdenv.mkDerivation rec {
   name = "lombok-1.18.16";
@@ -23,9 +23,9 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "A library that can write a lot of boilerplate for your Java project";
-    platforms = stdenv.lib.platforms.all;
-    license = stdenv.lib.licenses.mit;
+    platforms = lib.platforms.all;
+    license = lib.licenses.mit;
     homepage = "https://projectlombok.org/";
-    maintainers = [ stdenv.lib.maintainers.CrystalGamma ];
+    maintainers = [ lib.maintainers.CrystalGamma ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/java/lucene/default.nix b/nixpkgs/pkgs/development/libraries/java/lucene/default.nix
index c0eabe51657d..417c7b969000 100644
--- a/nixpkgs/pkgs/development/libraries/java/lucene/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/lucene/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl} :
+{lib, stdenv, fetchurl} :
 
 stdenv.mkDerivation rec {
   pname = "lucene";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "1mxaxg65f7v8n60irjwm24v7hcisbl0srmpvcy1l4scs6rjj1awh";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Java full-text search engine";
     platforms = platforms.unix;
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/java/mockobjects/default.nix b/nixpkgs/pkgs/development/libraries/java/mockobjects/default.nix
index 817c861436f8..e20d7e707e71 100644
--- a/nixpkgs/pkgs/development/libraries/java/mockobjects/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/mockobjects/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl} :
+{lib, stdenv, fetchurl} :
 
 stdenv.mkDerivation {
   name = "mockobjects-0.09";
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
     sha256 = "18rnyqfcyh0s3dwkkaszdd50ssyjx5fa1y3ii309ldqg693lfgnz";
   };
 
-  meta = with stdenv.lib; {
+  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
index d3d10f61b70f..d34787d8b1f0 100644
--- a/nixpkgs/pkgs/development/libraries/java/rhino/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/rhino/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, unzip, ant, javac, jvm }:
+{ fetchurl, lib, stdenv, unzip, ant, javac, jvm }:
 
 let
   version = "1.7R2";
@@ -43,7 +43,7 @@ stdenv.mkDerivation {
       cp -v *.jar "$out/share/java"
     '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An implementation of JavaScript written in Java";
 
     longDescription =
diff --git a/nixpkgs/pkgs/development/libraries/java/saxon/default.nix b/nixpkgs/pkgs/development/libraries/java/saxon/default.nix
index ef403be60df4..e6f2fcadbe75 100644
--- a/nixpkgs/pkgs/development/libraries/java/saxon/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/saxon/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchurl, unzip, jre }:
+{ lib, stdenv, fetchurl, unzip, jre }:
 
 let
   common = { pname, version, src, description
-           , prog ? null, jar ? null, license ? stdenv.lib.licenses.mpl20 }:
+           , prog ? null, jar ? null, license ? lib.licenses.mpl20 }:
     stdenv.mkDerivation {
       name = "${pname}-${version}";
       inherit pname version src;
@@ -26,7 +26,7 @@ let
         chmod a+x $out/bin/${prog'}
       '';
 
-      meta = with stdenv.lib; {
+      meta = with lib; {
         inherit description license;
         homepage = "http://saxon.sourceforge.net/";
         maintainers = with maintainers; [ rvl ];
@@ -44,7 +44,7 @@ in {
     };
     description = "XSLT 1.0 processor";
     # http://saxon.sourceforge.net/saxon6.5.3/conditions.html
-    license = stdenv.lib.licenses.mpl10;
+    license = lib.licenses.mpl10;
   };
 
   saxonb_8_8 = common {
diff --git a/nixpkgs/pkgs/development/libraries/java/smack/default.nix b/nixpkgs/pkgs/development/libraries/java/smack/default.nix
index c1d41e7743d5..f831bfc8b933 100644
--- a/nixpkgs/pkgs/development/libraries/java/smack/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/smack/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation {
   name = "smack-4.1.9";
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
   meta = {
     description = "A XMPP (Jabber) client library for instant messaging and presence";
     homepage = "http://www.igniterealtime.org/projects/smack/";
-    platforms = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.asl20;
+    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
index b96c91713248..bf35490f9a88 100644
--- a/nixpkgs/pkgs/development/libraries/java/swt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/java/swt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, unzip, jdk, pkgconfig, gtk2
+{ stdenv, lib, fetchurl, unzip, jdk, pkg-config, gtk2
 , libXt, libXtst, libXi, libGLU, libGL, webkitgtk, libsoup, xorg
 , pango, gdk-pixbuf, glib
 }:
@@ -35,7 +35,7 @@ in stdenv.mkDerivation rec {
 
   sourceRoot = ".";
 
-  nativeBuildInputs = [ unzip pkgconfig ];
+  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 ]) +
@@ -63,7 +63,7 @@ in stdenv.mkDerivation rec {
     cd out && jar -c * > $out/jars/swt.jar
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/jbig2dec/default.nix b/nixpkgs/pkgs/development/libraries/jbig2dec/default.nix
index 4004c9f387ef..6f9d88d63666 100644
--- a/nixpkgs/pkgs/development/libraries/jbig2dec/default.nix
+++ b/nixpkgs/pkgs/development/libraries/jbig2dec/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python3, autoreconfHook }:
+{ lib, stdenv, fetchurl, python3, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "jbig2dec";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://www.jbig2dec.com/";
     description = "Decoder implementation of the JBIG2 image compression format";
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
+    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
index c21d51bc5a7c..ab55e76f29a3 100644
--- a/nixpkgs/pkgs/development/libraries/jbigkit/default.nix
+++ b/nixpkgs/pkgs/development/libraries/jbigkit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "jbigkit-2.1";
@@ -10,8 +10,8 @@ stdenv.mkDerivation rec {
 
   makeFlags = [
     "CC=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc"
-    "AR=${stdenv.lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ar"
-    "RANLIB=${stdenv.lib.getBin stdenv.cc.bintools.bintools}/bin/${stdenv.cc.targetPrefix}ranlib"
+    "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 = ''
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/jcal/default.nix b/nixpkgs/pkgs/development/libraries/jcal/default.nix
index a40de74037a2..2b57bd4064b7 100644
--- a/nixpkgs/pkgs/development/libraries/jcal/default.nix
+++ b/nixpkgs/pkgs/development/libraries/jcal/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook
+{ lib, stdenv, fetchFromGitHub, autoreconfHook
 , readline
 }:
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   preAutoreconf = "cd sources/";
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/jemalloc/common.nix b/nixpkgs/pkgs/development/libraries/jemalloc/common.nix
index fc4f0f2fe6e8..d5fe07b00f2a 100644
--- a/nixpkgs/pkgs/development/libraries/jemalloc/common.nix
+++ b/nixpkgs/pkgs/development/libraries/jemalloc/common.nix
@@ -1,5 +1,5 @@
 { version, sha256 }:
-{ stdenv, fetchurl
+{ 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.
@@ -9,7 +9,7 @@
 , disableInitExecTls ? false
 }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "jemalloc";
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://jemalloc.net";
     description = "General purpose malloc(3) implementation";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/jemalloc/jemalloc450.nix b/nixpkgs/pkgs/development/libraries/jemalloc/jemalloc450.nix
index d328ab8016a1..85b4fb100f74 100644
--- a/nixpkgs/pkgs/development/libraries/jemalloc/jemalloc450.nix
+++ b/nixpkgs/pkgs/development/libraries/jemalloc/jemalloc450.nix
@@ -1,4 +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
index 4cafa7434b12..11f6141872db 100644
--- a/nixpkgs/pkgs/development/libraries/jitterentropy/default.nix
+++ b/nixpkgs/pkgs/development/libraries/jitterentropy/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 stdenv.mkDerivation rec {
   pname = "jitterentropy";
   version = "2.2.0";
@@ -30,8 +30,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Provides a noise source using the CPU execution timing jitter";
     homepage = "https://github.com/smuellerDD/jitterentropy-library";
-    license = with stdenv.lib.licenses; [ gpl2 bsd3 ];
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ johnazoidberg ];
+    license = with lib.licenses; [ gpl2 bsd3 ];
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ johnazoidberg ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/jose/default.nix b/nixpkgs/pkgs/development/libraries/jose/default.nix
index 4c3095681ed0..b15fead62699 100644
--- a/nixpkgs/pkgs/development/libraries/jose/default.nix
+++ b/nixpkgs/pkgs/development/libraries/jose/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkgconfig
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config
 , zlib, jansson, openssl
 }:
 
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "15ac8a656m66rd9qg4dj53smykwaagqv606h18w7fiqn0ykxl4vi";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ zlib jansson openssl ];
 
   outputs = [ "out" "dev" "man" ];
diff --git a/nixpkgs/pkgs/development/libraries/json-c/default.nix b/nixpkgs/pkgs/development/libraries/json-c/default.nix
index d72d50214348..5a77ea789afe 100644
--- a/nixpkgs/pkgs/development/libraries/json-c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/json-c/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake }:
+{ lib, stdenv, fetchurl, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "json-c";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A JSON implementation in C";
     homepage    = "https://github.com/json-c/json-c/wiki";
     maintainers = with maintainers; [ lovek323 ];
diff --git a/nixpkgs/pkgs/development/libraries/json-glib/default.nix b/nixpkgs/pkgs/development/libraries/json-glib/default.nix
index f89d4bc45341..a820d947b7f8 100644
--- a/nixpkgs/pkgs/development/libraries/json-glib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/json-glib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, glib, meson, ninja, pkgconfig, gettext
+{ lib, stdenv, fetchurl, glib, meson, ninja, pkg-config, gettext
 , gobject-introspection, fixDarwinDylibNames, gnome3
 }:
 
@@ -9,13 +9,13 @@ in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "0ixwyis47v5bkx6h8a1iqlw3638cxcv57ivxv4gw2gaig51my33j";
   };
 
   propagatedBuildInputs = [ glib ];
-  nativeBuildInputs = [ meson ninja pkgconfig gettext gobject-introspection glib ]
-    ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+  nativeBuildInputs = [ meson ninja pkg-config gettext gobject-introspection glib ]
+    ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
   outputs = [ "out" "dev" ];
 
@@ -27,7 +27,7 @@ in stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  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.lgpl2;
diff --git a/nixpkgs/pkgs/development/libraries/jsoncpp/default.nix b/nixpkgs/pkgs/development/libraries/jsoncpp/default.nix
index 73aaaec4e4c4..71b0d7b9a922 100644
--- a/nixpkgs/pkgs/development/libraries/jsoncpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/jsoncpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, python, validatePkgConfig, fetchpatch }:
+{ lib, stdenv, fetchFromGitHub, cmake, python, validatePkgConfig, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "jsoncpp";
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
     "-DJSONCPP_WITH_CMAKE_PACKAGE=ON"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit version;
     homepage = "https://github.com/open-source-parsers/jsoncpp";
     description = "A C++ library for interacting with JSON";
diff --git a/nixpkgs/pkgs/development/libraries/jsonrpc-glib/default.nix b/nixpkgs/pkgs/development/libraries/jsonrpc-glib/default.nix
index 61f357689c4d..1ec9c3da41e2 100644
--- a/nixpkgs/pkgs/development/libraries/jsonrpc-glib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/jsonrpc-glib/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, meson, ninja, glib, json-glib, pkgconfig, gobject-introspection, vala, gtk-doc, docbook_xsl, docbook_xml_dtd_43, gnome3 }:
+{ lib, stdenv, fetchurl, meson, ninja, glib, json-glib, pkg-config, gobject-introspection, vala, gtk-doc, docbook_xsl, docbook_xml_dtd_43, gnome3 }:
 stdenv.mkDerivation rec {
   pname = "jsonrpc-glib";
   version = "3.38.0";
 
   outputs = [ "out" "dev" "devdoc" ];
 
-  nativeBuildInputs = [ meson ninja pkgconfig gobject-introspection vala gtk-doc docbook_xsl docbook_xml_dtd_43 ];
+  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}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "3F8ZFKkRUrcPqPyaEe3hMUirSvZE2yejZjI4jJJ6ioI=";
   };
 
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/judy/default.nix b/nixpkgs/pkgs/development/libraries/judy/default.nix
index ad422db3d48e..037225b86e5b 100644
--- a/nixpkgs/pkgs/development/libraries/judy/default.nix
+++ b/nixpkgs/pkgs/development/libraries/judy/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation {
   name = "judy-1.0.5";
@@ -10,14 +10,14 @@ stdenv.mkDerivation {
 
   # gcc 4.8 optimisations break judy.
   # https://sourceforge.net/p/judy/mailman/message/31995144/
-  preConfigure = stdenv.lib.optionalString stdenv.cc.isGNU ''
+  preConfigure = lib.optionalString stdenv.cc.isGNU ''
     configureFlagsArray+=("CFLAGS=-fno-strict-aliasing -fno-aggressive-loop-optimizations")
   '';
 
   meta = {
     homepage = "http://judy.sourceforge.net/";
-    license = stdenv.lib.licenses.lgpl21Plus;
+    license = lib.licenses.lgpl21Plus;
     description = "State-of-the-art C library that implements a sparse dynamic array";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/jxrlib/default.nix b/nixpkgs/pkgs/development/libraries/jxrlib/default.nix
index f0f5b9d77934..78cc48d82097 100644
--- a/nixpkgs/pkgs/development/libraries/jxrlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/jxrlib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, python }:
+{ lib, stdenv, fetchFromGitHub, python }:
 
 stdenv.mkDerivation rec {
   pname = "jxrlib";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "0rk3hbh00nw0wgbfbqk1szrlfg3yq7w6ar16napww3nrlm9cj65w";
   };
 
-  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace Makefile \
       --replace '-shared' '-dynamiclib -undefined dynamic_lookup' \
       --replace '.so' '.dylib'
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "DIR_INSTALL=$(out)" "SHARED=1" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Implementation of the JPEG XR image codec standard";
     homepage = "https://jxrlib.codeplex.com";
     license = licenses.bsd2;
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
index 645d05afc2be..0aa400c644d6 100644
--- a/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/extra-cmake-modules/default.nix
@@ -1,4 +1,4 @@
-{ mkDerivation, lib, cmake, pkgconfig }:
+{ mkDerivation, lib, cmake, pkg-config }:
 
 mkDerivation {
   name = "extra-cmake-modules";
@@ -9,7 +9,7 @@ mkDerivation {
 
   outputs = [ "out" ];  # this package has no runtime components
 
-  propagatedBuildInputs = [ cmake pkgconfig ];
+  propagatedBuildInputs = [ cmake pkg-config ];
 
   setupHook = ./setup-hook.sh;
 
diff --git a/nixpkgs/pkgs/development/libraries/kde-frameworks/kirigami2.nix b/nixpkgs/pkgs/development/libraries/kde-frameworks/kirigami2.nix
index f4fc40f6d31d..751e3d7b73f1 100644
--- a/nixpkgs/pkgs/development/libraries/kde-frameworks/kirigami2.nix
+++ b/nixpkgs/pkgs/development/libraries/kde-frameworks/kirigami2.nix
@@ -1,4 +1,4 @@
-{ mkDerivation, extra-cmake-modules, qtbase, qtquickcontrols2, qttranslations }:
+{ mkDerivation, extra-cmake-modules, qtbase, qtquickcontrols2, qttranslations, qtgraphicaleffects }:
 
 mkDerivation {
   name = "kirigami2";
@@ -6,6 +6,6 @@ mkDerivation {
     broken = builtins.compareVersions qtbase.version "5.7.0" < 0;
   };
   nativeBuildInputs = [ extra-cmake-modules ];
-  buildInputs = [ qtbase qtquickcontrols2 qttranslations ];
+  buildInputs = [ qtbase qtquickcontrols2 qttranslations qtgraphicaleffects ];
   outputs = [ "out" "dev" ];
 }
diff --git a/nixpkgs/pkgs/development/libraries/kerberos/heimdal.nix b/nixpkgs/pkgs/development/libraries/kerberos/heimdal.nix
index 2eb9262d189e..804749bbdb53 100644
--- a/nixpkgs/pkgs/development/libraries/kerberos/heimdal.nix
+++ b/nixpkgs/pkgs/development/libraries/kerberos/heimdal.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, python2, perl, yacc, flex
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, python2, perl, yacc, flex
 , texinfo, perlPackages
 , openldap, libcap_ng, sqlite, openssl, db, libedit, pam
 , CoreFoundation, Security, SystemConfiguration
 }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "heimdal";
   version = "7.7.0";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./heimdal-make-missing-headers.patch ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig python2 perl yacc flex texinfo ]
+  nativeBuildInputs = [ autoreconfHook pkg-config python2 perl yacc flex texinfo ]
     ++ (with perlPackages; [ JSON ]);
   buildInputs = optionals (stdenv.isLinux) [ libcap_ng ]
     ++ [ db sqlite openssl libedit openldap pam]
diff --git a/nixpkgs/pkgs/development/libraries/kerberos/krb5.nix b/nixpkgs/pkgs/development/libraries/kerberos/krb5.nix
index 004d7d2227c1..5ef9e496b94d 100644
--- a/nixpkgs/pkgs/development/libraries/kerberos/krb5.nix
+++ b/nixpkgs/pkgs/development/libraries/kerberos/krb5.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, perl, yacc, bootstrap_cmds
+{ lib, stdenv, fetchurl, pkg-config, perl, yacc, bootstrap_cmds
 , openssl, openldap, libedit, keyutils
 
 # Extra Arguments
@@ -16,7 +16,7 @@
 let
   libOnly = type == "lib";
 in
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   name = "${type}krb5-${version}";
   majorVersion = "1.18"; # remove patches below with next upgrade
@@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
          "ac_cv_printf_positional=yes"
        ];
 
-  nativeBuildInputs = [ pkgconfig perl ]
+  nativeBuildInputs = [ pkg-config perl ]
     ++ optional (!libOnly) yacc
     # Provides the mig command used by the build scripts
     ++ optional stdenv.isDarwin bootstrap_cmds;
diff --git a/nixpkgs/pkgs/development/libraries/keybinder/default.nix b/nixpkgs/pkgs/development/libraries/keybinder/default.nix
index e3084b9733e4..663abb152804 100644
--- a/nixpkgs/pkgs/development/libraries/keybinder/default.nix
+++ b/nixpkgs/pkgs/development/libraries/keybinder/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoconf, automake, libtool, pkgconfig, gnome3
+{ lib, stdenv, fetchurl, autoconf, automake, libtool, pkg-config, gnome3
 , gtk-doc, gtk2, python2Packages, lua, gobject-introspection
 }:
 
@@ -14,7 +14,7 @@ in stdenv.mkDerivation rec {
     sha256 = "0kkplz5snycik5xknwq1s8rnmls3qsp32z09mdpmaacydcw7g3cf";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [
     autoconf automake libtool gnome3.gnome-common gtk-doc gtk2
     python pygtk lua gobject-introspection
@@ -24,7 +24,7 @@ in stdenv.mkDerivation rec {
     ./autogen.sh --prefix="$out"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for registering global key bindings";
     longDescription = ''
       keybinder is a library for registering global keyboard shortcuts.
diff --git a/nixpkgs/pkgs/development/libraries/keybinder3/default.nix b/nixpkgs/pkgs/development/libraries/keybinder3/default.nix
index 1c8dbfdcd818..e291ec56bb21 100644
--- a/nixpkgs/pkgs/development/libraries/keybinder3/default.nix
+++ b/nixpkgs/pkgs/development/libraries/keybinder3/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoconf, automake, libtool, pkgconfig, gnome3
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, pkg-config, gnome3
 , gtk-doc, gtk3, libX11, libXext, libXrender, gobject-introspection
 }:
 
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "196ibn86j54fywfwwgyh89i9wygm4vh7ls19fn20vrnm6ijlzh9r";
   };
 
-  nativeBuildInputs = [ autoconf automake libtool pkgconfig ];
+  nativeBuildInputs = [ autoconf automake libtool pkg-config ];
   buildInputs = [
     gnome3.gnome-common gtk-doc gtk3
     libX11 libXext libXrender gobject-introspection
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     ./autogen.sh --prefix="$out"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for registering global key bindings";
     homepage = "https://github.com/kupferlauncher/keybinder/";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/keystone/default.nix b/nixpkgs/pkgs/development/libraries/keystone/default.nix
index 869d7ae1b02d..70864bcf24a9 100644
--- a/nixpkgs/pkgs/development/libraries/keystone/default.nix
+++ b/nixpkgs/pkgs/development/libraries/keystone/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , pkg-config
 , cmake
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     python3
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Lightweight multi-platform, multi-architecture assembler framework";
     homepage = "https://www.keystone-engine.org";
     license = licenses.gpl2Only;
diff --git a/nixpkgs/pkgs/development/libraries/khronos-ocl-icd-loader/default.nix b/nixpkgs/pkgs/development/libraries/khronos-ocl-icd-loader/default.nix
index a42f1c0a513c..f4688f34982c 100644
--- a/nixpkgs/pkgs/development/libraries/khronos-ocl-icd-loader/default.nix
+++ b/nixpkgs/pkgs/development/libraries/khronos-ocl-icd-loader/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, opencl-headers, cmake, withTracing ? false }:
+{ lib, stdenv, fetchFromGitHub, opencl-headers, cmake, withTracing ? false }:
 
 stdenv.mkDerivation rec {
   name = "khronos-ocl-icd-loader-${version}";
@@ -11,12 +11,12 @@ stdenv.mkDerivation rec {
     sha256 = "0v2yi6d3g5qshzy6pjic09c5irwgds106yvr93q62f32psfblnmy";
   };
 
-  patches = stdenv.lib.lists.optional withTracing ./tracing.patch;
+  patches = lib.lists.optional withTracing ./tracing.patch;
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ opencl-headers ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Offical Khronos OpenCL ICD Loader";
     homepage = "https://github.com/KhronosGroup/OpenCL-ICD-Loader";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/kissfft/default.nix b/nixpkgs/pkgs/development/libraries/kissfft/default.nix
index 370f628ff7a8..5395ac4ab9c1 100644
--- a/nixpkgs/pkgs/development/libraries/kissfft/default.nix
+++ b/nixpkgs/pkgs/development/libraries/kissfft/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 }:
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
     "DATATYPE=double"
   ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/kmsxx/default.nix b/nixpkgs/pkgs/development/libraries/kmsxx/default.nix
index 5bd311af2d85..65dce915f144 100644
--- a/nixpkgs/pkgs/development/libraries/kmsxx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/kmsxx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig, libdrm
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libdrm
 , withPython ? false, python }:
 
 stdenv.mkDerivation {
@@ -13,14 +13,12 @@ stdenv.mkDerivation {
     sha256 = "0xz4m9bk0naawxwpx5cy1j3cm6c8c9m5y551csk88y88x1g0z0xh";
   };
 
-  enableParallelBuilding = true;
+  cmakeFlags = lib.optional (!withPython) "-DKMSXX_ENABLE_PYTHON=OFF";
 
-  cmakeFlags = stdenv.lib.optional (!withPython) "-DKMSXX_ENABLE_PYTHON=OFF";
-
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
   buildInputs = [ libdrm python ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/kpmcore/default.nix b/nixpkgs/pkgs/development/libraries/kpmcore/default.nix
index 1c00b6be2f20..837333407b29 100644
--- a/nixpkgs/pkgs/development/libraries/kpmcore/default.nix
+++ b/nixpkgs/pkgs/development/libraries/kpmcore/default.nix
@@ -24,9 +24,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ extra-cmake-modules ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     maintainers = with lib.maintainers; [ peterhoeg ];
     # The build requires at least Qt 5.14:
     broken = lib.versionOlder qtbase.version "5.14";
diff --git a/nixpkgs/pkgs/development/libraries/kyotocabinet/default.nix b/nixpkgs/pkgs/development/libraries/kyotocabinet/default.nix
index 9c360ce0531d..4e8aa57d9568 100644
--- a/nixpkgs/pkgs/development/libraries/kyotocabinet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/kyotocabinet/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, zlib }:
+{ lib, stdenv, fetchurl, zlib }:
 
 stdenv.mkDerivation rec {
   name = "kyotocabinet-1.2.76";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0g6js20x7vnpq4p8ghbw3mh9wpqksya9vwhzdx6dnlf354zjsal1";
   };
 
-  prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  prePatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace kccommon.h \
       --replace tr1/unordered_map unordered_map \
       --replace tr1/unordered_set unordered_set \
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ zlib ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://fallabs.com/kyotocabinet";
     description = "A library of routines for managing a database";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/l-smash/default.nix b/nixpkgs/pkgs/development/libraries/l-smash/default.nix
index 34dab6bb3ff4..b1b5fd012062 100644
--- a/nixpkgs/pkgs/development/libraries/l-smash/default.nix
+++ b/nixpkgs/pkgs/development/libraries/l-smash/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, which }:
+{ lib, stdenv, fetchFromGitHub, which }:
 
 stdenv.mkDerivation rec {
   pname = "l-smash";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ which ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://l-smash.github.io/l-smash/";
     description = "MP4 container utilities";
     license = licenses.isc;
diff --git a/nixpkgs/pkgs/development/libraries/lame/default.nix b/nixpkgs/pkgs/development/libraries/lame/default.nix
index da3784100ab6..8ed0962bece8 100644
--- a/nixpkgs/pkgs/development/libraries/lame/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lame/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ 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
@@ -20,7 +20,7 @@ let
   mkFlag = optSet: flag: if optSet then "--enable-${flag}" else "--disable-${flag}";
 in
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "lame";
   version = "3.100";
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/frog.nix b/nixpkgs/pkgs/development/libraries/languagemachines/frog.nix
index 4829d67de45a..a44535fbf90e 100644
--- a/nixpkgs/pkgs/development/libraries/languagemachines/frog.nix
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/frog.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl
-, automake, autoconf, bzip2, libtar, libtool, pkgconfig, autoconf-archive
+{ lib, stdenv, fetchurl
+, automake, autoconf, bzip2, libtar, libtool, pkg-config, autoconf-archive
 , libxml2, icu
 , languageMachines
 }:
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   version = release.version;
   src = fetchurl { inherit (release) url sha256;
                    name = "frog-v${release.version}.tar.gz"; };
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ automake autoconf bzip2 libtar libtool autoconf-archive
                   libxml2 icu
                   languageMachines.ticcutils
@@ -37,7 +37,7 @@ stdenv.mkDerivation {
     make check
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A Tagger-Lemmatizer-Morphological-Analyzer-Dependency-Parser for Dutch";
     homepage    = "https://languagemachines.github.io/frog";
     license     = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/frogdata.nix b/nixpkgs/pkgs/development/libraries/languagemachines/frogdata.nix
index 196a697d8f6f..7e890a8d09c9 100644
--- a/nixpkgs/pkgs/development/libraries/languagemachines/frogdata.nix
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/frogdata.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl
-, automake, autoconf, libtool, pkgconfig, autoconf-archive
+{ lib, stdenv, fetchurl
+, automake, autoconf, libtool, pkg-config, autoconf-archive
 }:
 
 let
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
   version = release.version;
   src = fetchurl { inherit (release) url sha256;
                    name = "frogdata-${release.version}.tar.gz"; };
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ automake autoconf libtool autoconf-archive
                 ];
 
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
     sh bootstrap.sh
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/libfolia.nix b/nixpkgs/pkgs/development/libraries/languagemachines/libfolia.nix
index 852615cbf3b2..fc5e622bcf4f 100644
--- a/nixpkgs/pkgs/development/libraries/languagemachines/libfolia.nix
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/libfolia.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl
-, automake, autoconf, libtool, pkgconfig, autoconf-archive
+{ lib, stdenv, fetchurl
+, automake, autoconf, libtool, pkg-config, autoconf-archive
 , libxml2, icu, bzip2, libtar
 , languageMachines }:
 
@@ -12,14 +12,14 @@ stdenv.mkDerivation {
   version = release.version;
   src = fetchurl { inherit (release) url sha256;
                    name = "libfolia-${release.version}.tar.gz"; };
-  nativeBuildInputs = [ pkgconfig ];
+  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 stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/mbt.nix b/nixpkgs/pkgs/development/libraries/languagemachines/mbt.nix
index 9477abeef3fc..efa9ada7d56c 100644
--- a/nixpkgs/pkgs/development/libraries/languagemachines/mbt.nix
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/mbt.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl
-, automake, autoconf, bzip2, libtar, libtool, pkgconfig, autoconf-archive
+{ lib, stdenv, fetchurl
+, automake, autoconf, bzip2, libtar, libtool, pkg-config, autoconf-archive
 , libxml2
 , languageMachines
 }:
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   version = release.version;
   src = fetchurl { inherit (release) url sha256;
                    name = "mbt-${release.version}.tar.gz"; };
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ automake autoconf bzip2 libtar libtool autoconf-archive
                   libxml2
                   languageMachines.ticcutils
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
     sh bootstrap.sh
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Memory Based Tagger";
     homepage    = "https://languagemachines.github.io/mbt/";
     license     = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/ticcutils.nix b/nixpkgs/pkgs/development/libraries/languagemachines/ticcutils.nix
index 8676e08e4174..c09f00b1160b 100644
--- a/nixpkgs/pkgs/development/libraries/languagemachines/ticcutils.nix
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/ticcutils.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl
-, automake, autoconf, libtool, pkgconfig, autoconf-archive
+{ lib, stdenv, fetchurl
+, automake, autoconf, libtool, pkg-config, autoconf-archive
 , libxml2, zlib, bzip2, libtar }:
 
 let
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
   version = release.version;
   src = fetchurl { inherit (release) url sha256;
                    name = "ticcutils-${release.version}.tar.gz"; };
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ automake autoconf libtool autoconf-archive libxml2
                   # optional:
                   zlib bzip2 libtar
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
                 ];
   preConfigure = "sh bootstrap.sh";
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/timbl.nix b/nixpkgs/pkgs/development/libraries/languagemachines/timbl.nix
index b912ed97bd5a..de22c41ec497 100644
--- a/nixpkgs/pkgs/development/libraries/languagemachines/timbl.nix
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/timbl.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl
-, automake, autoconf, libtool, pkgconfig, autoconf-archive
+{ lib, stdenv, fetchurl
+, automake, autoconf, libtool, pkg-config, autoconf-archive
 , libxml2, bzip2, libtar
 , languageMachines
 }:
@@ -13,14 +13,14 @@ stdenv.mkDerivation {
   version = release.version;
   src = fetchurl { inherit (release) url sha256;
                    name = "timbl-${release.version}.tar.gz"; };
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ automake autoconf bzip2 libtar libtool autoconf-archive
                   libxml2
                   languageMachines.ticcutils
                 ];
   preConfigure = "sh bootstrap.sh";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "TiMBL implements several memory-based learning algorithms";
     homepage    = "https://github.com/LanguageMachines/timbl/";
     license     = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/timblserver.nix b/nixpkgs/pkgs/development/libraries/languagemachines/timblserver.nix
index e0634103a7ee..27812e8b3f05 100644
--- a/nixpkgs/pkgs/development/libraries/languagemachines/timblserver.nix
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/timblserver.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl
-, automake, autoconf, bzip2, libtar, libtool, pkgconfig, autoconf-archive
+{ lib, stdenv, fetchurl
+, automake, autoconf, bzip2, libtar, libtool, pkg-config, autoconf-archive
 , libxml2
 , languageMachines
 }:
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   version = release.version;
   src = fetchurl { inherit (release) url sha256;
                    name = "timblserver-${release.version}.tar.gz"; };
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ automake autoconf bzip2 libtar libtool autoconf-archive
                   libxml2
                   languageMachines.ticcutils
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
                 ];
   preConfigure = "sh bootstrap.sh";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "This server for TiMBL implements several memory-based learning algorithms";
     homepage    = "https://github.com/LanguageMachines/timblserver/";
     license     = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/ucto.nix b/nixpkgs/pkgs/development/libraries/languagemachines/ucto.nix
index d60ff5fa2460..d8c8d99552c8 100644
--- a/nixpkgs/pkgs/development/libraries/languagemachines/ucto.nix
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/ucto.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl
-, automake, autoconf, libtool, pkgconfig, autoconf-archive
+{ lib, stdenv, fetchurl
+, automake, autoconf, libtool, pkg-config, autoconf-archive
 , libxml2, icu, bzip2, libtar
 , languageMachines
 }:
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   version = release.version;
   src = fetchurl { inherit (release) url sha256;
                    name = "ucto-${release.version}.tar.gz"; };
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ automake autoconf bzip2 libtool autoconf-archive
                   icu libtar libxml2
                   languageMachines.ticcutils
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
     done;
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A rule-based tokenizer for natural language";
     homepage    = "https://languagemachines.github.io/ucto/";
     license     = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/languagemachines/uctodata.nix b/nixpkgs/pkgs/development/libraries/languagemachines/uctodata.nix
index 29eaf78b75a8..cad636227249 100644
--- a/nixpkgs/pkgs/development/libraries/languagemachines/uctodata.nix
+++ b/nixpkgs/pkgs/development/libraries/languagemachines/uctodata.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl
-, automake, autoconf, libtool, pkgconfig, autoconf-archive
+{ lib, stdenv, fetchurl
+, automake, autoconf, libtool, pkg-config, autoconf-archive
  }:
 
 let
@@ -11,11 +11,11 @@ stdenv.mkDerivation {
   version = release.version;
   src = fetchurl { inherit (release) url sha256;
                    name = "uctodata-${release.version}.tar.gz"; };
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ automake autoconf libtool autoconf-archive ];
   preConfigure = "sh bootstrap.sh";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A rule-based tokenizer for natural language";
     homepage    = "https://languagemachines.github.io/ucto/";
     license     = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/lasem/default.nix b/nixpkgs/pkgs/development/libraries/lasem/default.nix
index b3742514ced6..22f0436edca9 100644
--- a/nixpkgs/pkgs/development/libraries/lasem/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lasem/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, pkgconfig, intltool, gobject-introspection, glib, gdk-pixbuf
+{ fetchurl, lib, stdenv, pkg-config, intltool, gobject-introspection, glib, gdk-pixbuf
 , libxml2, cairo, pango, gnome3 }:
 
 stdenv.mkDerivation rec {
@@ -8,11 +8,11 @@ stdenv.mkDerivation rec {
   outputs = [ "bin" "out" "dev" "man" "doc" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0fds3fsx84ylsfvf55zp65y8xqjj5n8gbhcsk02vqglivk7izw4v";
   };
 
-  nativeBuildInputs = [ pkgconfig intltool gobject-introspection ];
+  nativeBuildInputs = [ pkg-config intltool gobject-introspection ];
 
   propagatedBuildInputs = [
     glib gdk-pixbuf libxml2 cairo pango
@@ -31,8 +31,8 @@ stdenv.mkDerivation rec {
     description = "SVG and MathML rendering library";
 
     homepage = "https://wiki.gnome.org/Projects/Lasem";
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/lasso/default.nix b/nixpkgs/pkgs/development/libraries/lasso/default.nix
index c79b4a51262a..24efa689c581 100644
--- a/nixpkgs/pkgs/development/libraries/lasso/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lasso/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, autoconf, automake, autoreconfHook, fetchurl, glib, gobject-introspection, gtk-doc, libtool, libxml2, libxslt, openssl, pkgconfig, python27Packages, xmlsec, zlib }:
+{ lib, stdenv, autoconf, automake, autoreconfHook, fetchurl, glib, gobject-introspection, gtk-doc, libtool, libxml2, libxslt, openssl, pkg-config, python27Packages, xmlsec, zlib }:
 
 stdenv.mkDerivation rec {
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ autoconf automake glib gobject-introspection gtk-doc libtool libxml2 libxslt openssl python27Packages.six xmlsec zlib ];
 
   configurePhase = ''
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
                 --prefix=$out
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://lasso.entrouvert.org/";
     description = "Liberty Alliance Single Sign-On library";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/lcms/default.nix b/nixpkgs/pkgs/development/libraries/lcms/default.nix
index 8fe2484facaf..9a957a119243 100644
--- a/nixpkgs/pkgs/development/libraries/lcms/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lcms/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   pname = "lcms";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Color management engine";
     homepage = "http://www.littlecms.com/";
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.unix;
+    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
index 6e81dfc0718a..129b57851989 100644
--- a/nixpkgs/pkgs/development/libraries/lcms2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lcms2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libtiff, libjpeg, zlib }:
+{ lib, stdenv, fetchurl, libtiff, libjpeg, zlib }:
 
 stdenv.mkDerivation rec {
   name = "lcms2-2.11";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   # See https://trac.macports.org/ticket/60656
   LDFLAGS = if stdenv.hostPlatform.isDarwin then "-Wl,-w" else null;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Color management engine";
     homepage = "http://www.littlecms.com/";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/ldacbt/default.nix b/nixpkgs/pkgs/development/libraries/ldacbt/default.nix
index 36a0c8e1316b..36092507b8ae 100644
--- a/nixpkgs/pkgs/development/libraries/ldacbt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ldacbt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 }:
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     cmake
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "AOSP libldac dispatcher";
     homepage    = "https://github.com/EHfive/ldacBT";
     license     = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/ldb/default.nix b/nixpkgs/pkgs/development/libraries/ldb/default.nix
index 9810234eefa6..ba035eed05bc 100644
--- a/nixpkgs/pkgs/development/libraries/ldb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ldb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , python3
 , pkg-config
@@ -54,7 +54,7 @@ stdenv.mkDerivation rec {
 
   stripDebugList = [ "bin" "lib" "modules" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A LDAP-like embedded database";
     homepage = "https://ldb.samba.org/";
     license = licenses.lgpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/ldns/default.nix b/nixpkgs/pkgs/development/libraries/ldns/default.nix
index f64d263901bd..5873e707e7cc 100644
--- a/nixpkgs/pkgs/development/libraries/ldns/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ldns/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, openssl, perl, which, dns-root-data }:
+{ lib, stdenv, fetchurl, openssl, perl, which, dns-root-data }:
 
 stdenv.mkDerivation rec {
   pname = "ldns";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     "--with-drill"
     "--disable-gost"
     "--with-examples"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "ac_cv_func_malloc_0_nonnull=yes"
     "ac_cv_func_realloc_0_nonnull=yes"
   ];
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
     moveToOutput "bin/ldns-config" "$dev"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library with the aim of simplifying DNS programming in C";
     license = licenses.bsd3;
     homepage = "http://www.nlnetlabs.nl/projects/ldns/";
diff --git a/nixpkgs/pkgs/development/libraries/leatherman/default.nix b/nixpkgs/pkgs/development/libraries/leatherman/default.nix
index a1de88ef1ca4..8a9c80a61754 100644
--- a/nixpkgs/pkgs/development/libraries/leatherman/default.nix
+++ b/nixpkgs/pkgs/development/libraries/leatherman/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, boost, cmake, curl, ruby }:
+{ lib, stdenv, fetchFromGitHub, boost, cmake, curl, ruby }:
 
 stdenv.mkDerivation rec {
   pname = "leatherman";
@@ -16,9 +16,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
   buildInputs = [ boost curl ruby ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/puppetlabs/leatherman/";
     description = "A collection of C++ and CMake utility libraries";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/lensfun/default.nix b/nixpkgs/pkgs/development/libraries/lensfun/default.nix
index 830facc56720..23675c9f9f89 100644
--- a/nixpkgs/pkgs/development/libraries/lensfun/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lensfun/default.nix
@@ -1,24 +1,45 @@
-{ stdenv, fetchurl, pkgconfig, glib, zlib, libpng, cmake }:
+{ lib, stdenv, fetchFromGitHub, pkg-config, glib, zlib, libpng, cmake }:
 
-stdenv.mkDerivation rec {
+let
   version = "0.3.95";
   pname = "lensfun";
 
-  src = fetchurl {
-    url = "mirror://sourceforge/lensfun/${version}/${pname}-${version}.tar.gz";
-    sha256 = "0218f3xrlln0jmh4gcf1zbpvi2bidgl3b2mblf6c810n7j1rrhl2";
+  # Fetch a more recent version of the repo containing a more recent lens
+  # database
+  lensfunDatabase = fetchFromGitHub {
+    owner = "lensfun";
+    repo = "lensfun";
+    rev = "4672d765a17bfef7bc994ca7008cb717c61045d5";
+    sha256 = "00x35xhpn55j7f8qzakb6wl1ccbljg1gqjb93jl9w3mha2bzsr41";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+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 ];
 
-  configureFlags = [ "-v" ];
+  cmakeFlags = [ "-DINSTALL_HELPER_SCRIPTS=OFF" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     platforms = platforms.linux ++ platforms.darwin;
-    maintainers = with maintainers; [ enzime ];
-    license = stdenv.lib.licenses.lgpl3;
+    maintainers = with maintainers; [ flokli ];
+    license = lib.licenses.lgpl3;
     description = "An opensource database of photographic lenses and their characteristics";
-    homepage = "http://lensfun.sourceforge.net/";
+    homepage = "https://lensfun.github.io";
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/leptonica/default.nix b/nixpkgs/pkgs/development/libraries/leptonica/default.nix
index a0f0814fec53..11f1c7fd9c67 100644
--- a/nixpkgs/pkgs/development/libraries/leptonica/default.nix
+++ b/nixpkgs/pkgs/development/libraries/leptonica/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, pkgconfig, which, gnuplot
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, which, gnuplot
 , giflib, libjpeg, libpng, libtiff, libwebp, openjpeg, zlib
 }:
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "192bs676ind8627f0v3v8d1q7r4xwc7q0zvbdbxn1fgvmv14d77c";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ giflib libjpeg libpng libtiff libwebp openjpeg zlib ];
   enableParallelBuilding = true;
 
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Image processing and analysis library";
     homepage = "http://www.leptonica.org/";
-    license = stdenv.lib.licenses.bsd2; # http://www.leptonica.org/about-the-license.html
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.bsd2; # http://www.leptonica.org/about-the-license.html
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/lesstif/default.nix b/nixpkgs/pkgs/development/libraries/lesstif/default.nix
index 6e68a9128d0d..d0ba47186559 100644
--- a/nixpkgs/pkgs/development/libraries/lesstif/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lesstif/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, xlibsWrapper, libXp, libXau}:
+{lib, stdenv, fetchurl, xlibsWrapper, libXp, libXau}:
 
 stdenv.mkDerivation rec {
   name = "lesstif-0.95.2";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     ./c-xpmpipethrough.patch
     ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An open source clone of the Motif widget set";
     homepage = "http://lesstif.sourceforge.net";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/leveldb/default.nix b/nixpkgs/pkgs/development/libraries/leveldb/default.nix
index 14d426701ba3..0a1dabef328c 100644
--- a/nixpkgs/pkgs/development/libraries/leveldb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/leveldb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fixDarwinDylibNames, snappy }:
+{ lib, stdenv, fetchFromGitHub, fixDarwinDylibNames, snappy }:
 
 stdenv.mkDerivation rec {
   pname = "leveldb";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ snappy ];
 
   nativeBuildInputs = []
-    ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
+    ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
   buildPhase = ''
     make all
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
     cp out-static/leveldbutil $out/bin
   ";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/google/leveldb";
     description = "Fast and lightweight key/value database library by Google";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/levmar/default.nix b/nixpkgs/pkgs/development/libraries/levmar/default.nix
index e8ef17081c9f..c5d6877a8446 100644
--- a/nixpkgs/pkgs/development/libraries/levmar/default.nix
+++ b/nixpkgs/pkgs/development/libraries/levmar/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl }:
-        
+{ lib, stdenv, fetchurl }:
+
 stdenv.mkDerivation rec {
   name = "levmar-2.6";
 
@@ -19,10 +19,10 @@ stdenv.mkDerivation rec {
     cp liblevmar.a $out/lib
   '';
 
-  meta = { 
+  meta = {
     description = "ANSI C implementations of Levenberg-Marquardt, usable also from C++";
     homepage = "https://www.ics.forth.gr/~lourakis/levmar/";
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/lib3ds/default.nix b/nixpkgs/pkgs/development/libraries/lib3ds/default.nix
index 406b61e43938..db0bd26f4d29 100644
--- a/nixpkgs/pkgs/development/libraries/lib3ds/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lib3ds/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, unzip }:
-        
+{ lib, stdenv, fetchurl, unzip }:
+
 stdenv.mkDerivation rec {
   name = "lib3ds-1.3.0";
 
@@ -10,11 +10,11 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ unzip ];
 
-  meta = { 
+  meta = {
     description = "Library for managing 3D-Studio Release 3 and 4 \".3DS\" files";
     homepage = "http://lib3ds.sourceforge.net/";
     license = "LGPL";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
 
diff --git a/nixpkgs/pkgs/development/libraries/lib3mf/default.nix b/nixpkgs/pkgs/development/libraries/lib3mf/default.nix
index 10732a14e488..fec910bd5952 100644
--- a/nixpkgs/pkgs/development/libraries/lib3mf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lib3mf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, ninja, libuuid, libossp_uuid, gtest }:
+{ lib, stdenv, fetchFromGitHub, cmake, ninja, libuuid, libossp_uuid, gtest }:
 
 stdenv.mkDerivation rec {
   pname = "lib3mf";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     sed -i 's,=''${\(exec_\)\?prefix}/,=,' lib3MF.pc.in
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Reference implementation of the 3D Manufacturing Format file standard";
     homepage = "https://3mf.io/";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/libAfterImage/default.nix b/nixpkgs/pkgs/development/libraries/libAfterImage/default.nix
index 8936603d18b0..1c88459ba9b6 100644
--- a/nixpkgs/pkgs/development/libraries/libAfterImage/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libAfterImage/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, zlib }:
+{ lib, stdenv, fetchurl, zlib }:
 
 stdenv.mkDerivation {
   pname = "libAfterImage";
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ zlib ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.afterstep.org/afterimage/";
     description = "A generic image manipulation library";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/libHX/default.nix b/nixpkgs/pkgs/development/libraries/libHX/default.nix
index 59afede9cae7..c059b9d412aa 100644
--- a/nixpkgs/pkgs/development/libraries/libHX/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libHX/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoconf, automake, libtool }:
+{ lib, stdenv, fetchurl, autoconf, automake, libtool }:
 
 stdenv.mkDerivation rec {
   name = "libHX-3.22";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     sh autogen.sh
     '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://libhx.sourceforge.net/";
     longDescription = ''
       libHX is a C library (with some C++ bindings available) that provides data structures
diff --git a/nixpkgs/pkgs/development/libraries/libLAS/default.nix b/nixpkgs/pkgs/development/libraries/libLAS/default.nix
index 27db14e71660..7d762fc80775 100644
--- a/nixpkgs/pkgs/development/libraries/libLAS/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libLAS/default.nix
@@ -1,16 +1,15 @@
-{ stdenv, fetchurl, boost, cmake, gdal, libgeotiff, libtiff, LASzip2, fixDarwinDylibNames }:
+{ 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 = stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
-  buildInputs = [ boost cmake gdal libgeotiff libtiff LASzip2 ];
+  nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+  buildInputs = [ boost gdal libgeotiff libtiff LASzip2 ];
 
   cmakeFlags = [
     "-DGDAL_CONFIG=${gdal}/bin/gdal-config"
@@ -21,15 +20,15 @@ stdenv.mkDerivation rec {
     "-DCMAKE_EXE_LINKER_FLAGS=-pthread"
   ];
 
-  postFixup = stdenv.lib.optionalString stdenv.isDarwin ''
+  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 = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = [ stdenv.lib.maintainers.michelk ];
+    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
index d6c90ee172b6..c3934db5b3fb 100644
--- a/nixpkgs/pkgs/development/libraries/libaacs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libaacs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libgcrypt, libgpgerror, yacc, flex }:
+{ lib, stdenv, fetchurl, libgcrypt, libgpgerror, yacc, 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.
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ yacc flex ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.videolan.org/developers/libaacs.html";
     description = "Library to access AACS protected Blu-Ray disks";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libaal/default.nix b/nixpkgs/pkgs/development/libraries/libaal/default.nix
index fdfd855470d9..e3c960681c5f 100644
--- a/nixpkgs/pkgs/development/libraries/libaal/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libaal/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   version = "1.0.6";
@@ -20,8 +20,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://www.namesys.com/";
     description = "Support library for Reiser4";
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = with stdenv.lib.maintainers; [ ];
-    platforms = with stdenv.lib.platforms; linux;
+    license = lib.licenses.gpl2;
+    maintainers = with lib.maintainers; [ ];
+    platforms = with lib.platforms; linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libabigail/default.nix b/nixpkgs/pkgs/development/libraries/libabigail/default.nix
index 54dbb349eb6d..7543c6ddff73 100644
--- a/nixpkgs/pkgs/development/libraries/libabigail/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libabigail/default.nix
@@ -1,9 +1,9 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , autoreconfHook
 , elfutils
 , libxml2
-, pkgconfig
+, pkg-config
 , strace
 , python3
 }:
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     autoreconfHook
-    pkgconfig
+    pkg-config
     strace
   ];
 
@@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
     patchShebangs tests/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "ABI Generic Analysis and Instrumentation Library";
     homepage = "https://sourceware.org/libabigail/";
     license = licenses.lgpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libabw/default.nix b/nixpkgs/pkgs/development/libraries/libabw/default.nix
index 91107ad4cb06..f1c4f49adc67 100644
--- a/nixpkgs/pkgs/development/libraries/libabw/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libabw/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, boost, doxygen, gperf, pkgconfig, librevenge, libxml2, perl }:
+{ lib, stdenv, fetchurl, boost, doxygen, gperf, pkg-config, librevenge, libxml2, perl }:
 
 stdenv.mkDerivation rec {
   pname = "libabw";
@@ -15,10 +15,10 @@ stdenv.mkDerivation rec {
     sed -i 's,^CPPFLAGS.*,\0 -DBOOST_ERROR_CODE_HEADER_ONLY -DBOOST_SYSTEM_NO_DEPRECATED,' src/lib/Makefile.in
   '';
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ boost doxygen gperf librevenge libxml2 perl ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://wiki.documentfoundation.org/DLP/Libraries/libabw";
     description = "Library parsing abiword documents";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/libaccounts-glib/default.nix b/nixpkgs/pkgs/development/libraries/libaccounts-glib/default.nix
index 07e0a3500a76..8dfc222f36ac 100644
--- a/nixpkgs/pkgs/development/libraries/libaccounts-glib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libaccounts-glib/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchFromGitLab, meson, ninja, glib, check, python3, vala, gtk-doc, glibcLocales
-, libxml2, libxslt, pkgconfig, sqlite, docbook_xsl, docbook_xml_dtd_43, gobject-introspection }:
+{ 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";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
     gtk-doc
     meson
     ninja
-    pkgconfig
+    pkg-config
     vala
   ];
 
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
     "-Dpy-overrides-dir=${placeholder "py"}/${python3.sitePackages}/gi/overrides"
   ];
 
-  meta = with stdenv.lib; {
+  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/libaec/default.nix b/nixpkgs/pkgs/development/libraries/libaec/default.nix
index bf6fd029de16..4c539860be72 100644
--- a/nixpkgs/pkgs/development/libraries/libaec/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libaec/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab
+{ lib, stdenv, fetchFromGitLab
 , cmake
 }:
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     cmake
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://gitlab.dkrz.de/k202009/libaec";
     description = "Adaptive Entropy Coding library";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/libagar/default.nix b/nixpkgs/pkgs/development/libraries/libagar/default.nix
index 616879a979cb..7aeccdf583e0 100644
--- a/nixpkgs/pkgs/development/libraries/libagar/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libagar/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libtool, perl, bsdbuild, gettext, mandoc
+{ lib, stdenv, fetchurl, pkg-config, libtool, perl, bsdbuild, gettext, mandoc
 , libpng, libjpeg, xlibsWrapper, libXinerama, freetype, SDL, libGLU, libGL
 , libsndfile, portaudio, libmysqlclient, fontconfig
 }:
@@ -26,14 +26,14 @@ stdenv.mkDerivation {
 
   outputs = [ "out" "devdoc" ];
 
-  nativeBuildInputs = [ pkgconfig libtool gettext ];
+  nativeBuildInputs = [ pkg-config libtool gettext ];
 
   buildInputs = [
     bsdbuild perl xlibsWrapper libXinerama SDL libGL libmysqlclient mandoc
     freetype.dev libpng libjpeg.dev fontconfig portaudio libsndfile
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Cross-platform GUI toolkit";
     homepage = "http://libagar.org/index.html";
     license = with licenses; bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libagar/libagar_test.nix b/nixpkgs/pkgs/development/libraries/libagar/libagar_test.nix
index 4de113718d4a..2b31da7aa535 100644
--- a/nixpkgs/pkgs/development/libraries/libagar/libagar_test.nix
+++ b/nixpkgs/pkgs/development/libraries/libagar/libagar_test.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, bsdbuild, libagar, perl, libjpeg, libpng, openssl }:
+{ lib, stdenv, fetchurl, bsdbuild, libagar, perl, libjpeg, libpng, openssl }:
 
 let srcs = import ./srcs.nix { inherit fetchurl; }; in
 stdenv.mkDerivation {
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ perl bsdbuild libagar libjpeg libpng openssl ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Tests for libagar";
     homepage = "http://libagar.org/index.html";
     license = with licenses; bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libamqpcpp/default.nix b/nixpkgs/pkgs/development/libraries/libamqpcpp/default.nix
index eca7170bfff2..67404f9e5cf9 100644
--- a/nixpkgs/pkgs/development/libraries/libamqpcpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libamqpcpp/default.nix
@@ -1,14 +1,14 @@
-{ stdenv, fetchFromGitHub, openssl }:
+{ lib, stdenv, fetchFromGitHub, openssl }:
 
 stdenv.mkDerivation rec {
   pname = "libamqpcpp";
-  version = "4.3.10";
+  version = "4.3.11";
 
   src = fetchFromGitHub {
     owner = "CopernicaMarketingSoftware";
     repo = "AMQP-CPP";
     rev = "v${version}";
-    sha256 = "0yy6sq4rvv9c0f09vljnqx92zvr39bn1spl735hzn6253d7fm3a5";
+    sha256 = "sha256-ZEvzZ++0f7Kf3iVbf3vQbyE8yd/dasU+dSxDDUu8Xug=";
   };
 
   buildInputs = [ openssl ];
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for communicating with a RabbitMQ server";
     homepage = "https://github.com/CopernicaMarketingSoftware/AMQP-CPP";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/libantlr3c/default.nix b/nixpkgs/pkgs/development/libraries/libantlr3c/default.nix
index 4c3d1d2a2132..d51eac7bdb6e 100644
--- a/nixpkgs/pkgs/development/libraries/libantlr3c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libantlr3c/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation {
   name = "libantlr3c-3.4";
@@ -7,9 +7,9 @@ stdenv.mkDerivation {
     sha256 ="0lpbnb4dq4azmsvlhp6khq1gy42kyqyjv8gww74g5lm2y6blm4fa";
   };
 
-  configureFlags = stdenv.lib.optional stdenv.is64bit "--enable-64bit";
+  configureFlags = lib.optional stdenv.is64bit "--enable-64bit";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C runtime libraries of ANTLR v3";
     homepage = "https://www.antlr3.org/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libao/default.nix b/nixpkgs/pkgs/development/libraries/libao/default.nix
index 3ecee2599f61..99d38f0cfc43 100644
--- a/nixpkgs/pkgs/development/libraries/libao/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libao/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkgconfig, libpulseaudio, alsaLib, libcap
+{ stdenv, lib, fetchFromGitHub, autoreconfHook, pkg-config, libpulseaudio, alsaLib, libcap
 , CoreAudio, CoreServices, AudioUnit
 , usePulseAudio }:
 
@@ -26,9 +26,9 @@ stdenv.mkDerivation rec {
     lib.optionals stdenv.isLinux  [ alsaLib libcap ] ++
     lib.optionals stdenv.isDarwin [ CoreAudio CoreServices AudioUnit ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libaom/default.nix b/nixpkgs/pkgs/development/libraries/libaom/default.nix
index 2c67e6ac1588..9706cda03f8b 100644
--- a/nixpkgs/pkgs/development/libraries/libaom/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libaom/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, yasm, perl, cmake, pkgconfig, python3 }:
+{ lib, stdenv, fetchgit, yasm, perl, cmake, pkg-config, python3 }:
 
 stdenv.mkDerivation rec {
   pname = "libaom";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   patches = [ ./outputs.patch ];
 
   nativeBuildInputs = [
-    yasm perl cmake pkgconfig python3
+    yasm perl cmake pkg-config python3
   ];
 
   preConfigure = ''
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "bin" "dev" "static" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Alliance for Open Media AV1 codec library";
     longDescription = ''
       Libaom is the reference implementation of the AV1 codec from the Alliance
diff --git a/nixpkgs/pkgs/development/libraries/libaosd/default.nix b/nixpkgs/pkgs/development/libraries/libaosd/default.nix
index c33f3a873a68..a6b9d531abf6 100644
--- a/nixpkgs/pkgs/development/libraries/libaosd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libaosd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkgconfig, cairo, pango,
+{ lib, stdenv, fetchFromGitHub, pkg-config, cairo, pango,
   libX11, libXcomposite, autoconf, automake }:
 
 stdenv.mkDerivation rec {
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "1cn7k0n74p6jp25kxwcyblhmbdvgw3mikvj0m2jh4c6xccfrgb9a";
   };
 
-  nativeBuildInputs = [ autoconf automake pkgconfig ];
+  nativeBuildInputs = [ autoconf automake pkg-config ];
   buildInputs = [ cairo pango libX11 libXcomposite ];
   enableParallelBuilding = true;
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     ./autogen.sh
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     longDescription = ''
       libaosd is an advanced on screen display library.
 
diff --git a/nixpkgs/pkgs/development/libraries/libappindicator/default.nix b/nixpkgs/pkgs/development/libraries/libappindicator/default.nix
index 7a7ad22756c7..469235e2e6af 100644
--- a/nixpkgs/pkgs/development/libraries/libappindicator/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libappindicator/default.nix
@@ -1,7 +1,7 @@
 # TODO: Resolve the issues with the Mono bindings.
 
 { stdenv, fetchgit, lib
-, pkgconfig, autoreconfHook
+, pkg-config, autoreconfHook
 , glib, dbus-glib, gtkVersion ? "3"
 , gtk2 ? null, libindicator-gtk2 ? null, libdbusmenu-gtk2 ? null
 , gtk3 ? null, libindicator-gtk3 ? null, libdbusmenu-gtk3 ? null
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     sha256 = "0xjvbl4gn7ra2fs6gn2g9s787kzb5cg9hv79iqsz949rxh4iw32d";
   };
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook vala gobject-introspection gtk-doc ];
+  nativeBuildInputs = [ pkg-config autoreconfHook vala gobject-introspection gtk-doc ];
 
   propagatedBuildInputs =
     if gtkVersion == "2"
diff --git a/nixpkgs/pkgs/development/libraries/libarchive/default.nix b/nixpkgs/pkgs/development/libraries/libarchive/default.nix
index 787745a6bdad..a8fb7e382659 100644
--- a/nixpkgs/pkgs/development/libraries/libarchive/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libarchive/default.nix
@@ -1,5 +1,5 @@
 {
-  fetchFromGitHub, stdenv, pkgconfig, autoreconfHook,
+  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
@@ -23,17 +23,17 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "lib" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
   buildInputs =
-    stdenv.lib.optional stdenv.hostPlatform.isUnix sharutils
+    lib.optional stdenv.hostPlatform.isUnix sharutils
     ++ [ zlib bzip2 openssl xz lzo zstd ]
-    ++ stdenv.lib.optionals stdenv.isLinux [ e2fsprogs attr acl ]
-    ++ stdenv.lib.optional xarSupport libxml2;
+    ++ lib.optionals stdenv.isLinux [ e2fsprogs attr acl ]
+    ++ lib.optional xarSupport libxml2;
 
-  # Without this, pkgconfig-based dependencies are unhappy
-  propagatedBuildInputs = stdenv.lib.optionals stdenv.isLinux [ attr acl ];
+  # Without this, pkg-config-based dependencies are unhappy
+  propagatedBuildInputs = lib.optionals stdenv.isLinux [ attr acl ];
 
-  configureFlags = stdenv.lib.optional (!xarSupport) "--without-xml2";
+  configureFlags = lib.optional (!xarSupport) "--without-xml2";
 
   preBuild = if stdenv.isCygwin then ''
     echo "#include <windows.h>" >> config.h
@@ -58,8 +58,8 @@ stdenv.mkDerivation rec {
     '';
     homepage = "http://libarchive.org";
     changelog = "https://github.com/libarchive/libarchive/releases/tag/v${version}";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = with stdenv.lib.platforms; all;
-    maintainers = with stdenv.lib.maintainers; [ jcumming ];
+    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
index f559c10456bb..2003c8957ffa 100644
--- a/nixpkgs/pkgs/development/libraries/libargon2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libargon2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, fixDarwinDylibNames }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, fixDarwinDylibNames }:
 
 stdenv.mkDerivation rec {
   pname = "libargon2";
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     "PKGCONFIG_REL=lib"
   ];
 
-  meta = with stdenv.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
diff --git a/nixpkgs/pkgs/development/libraries/libasr/default.nix b/nixpkgs/pkgs/development/libraries/libasr/default.nix
index 561e7e1017da..8d5b6d128ddf 100644
--- a/nixpkgs/pkgs/development/libraries/libasr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libasr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libevent, openssl }:
+{ lib, stdenv, fetchurl, libevent, openssl }:
 
 stdenv.mkDerivation rec {
   pname = "libasr";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libevent openssl ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/OpenSMTPD/libasr";
     description = "Free, simple and portable asynchronous resolver library";
     license = licenses.isc;
diff --git a/nixpkgs/pkgs/development/libraries/libass/default.nix b/nixpkgs/pkgs/development/libraries/libass/default.nix
index 9d8cf7434c23..6a180cb62c19 100644
--- a/nixpkgs/pkgs/development/libraries/libass/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libass/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, yasm
+{ lib, stdenv, fetchurl, pkg-config, yasm
 , freetype, fribidi, harfbuzz
 , encaSupport ? true, enca ? null # enca support
 , fontconfigSupport ? true, fontconfig ? null # fontconfig support
@@ -14,7 +14,7 @@ let
   mkFlag = optSet: flag: if optSet then "--enable-${flag}" else "--disable-${flag}";
 in
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "libass";
   version = "0.15.0";
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     (mkFlag largeTilesSupport "large-tiles")
   ];
 
-  nativeBuildInputs = [ pkgconfig yasm ];
+  nativeBuildInputs = [ pkg-config yasm ];
 
   buildInputs = [ freetype fribidi harfbuzz ]
     ++ optional encaSupport enca
diff --git a/nixpkgs/pkgs/development/libraries/libassuan/default.nix b/nixpkgs/pkgs/development/libraries/libassuan/default.nix
index aa798668f8ea..a531cdff5b96 100644
--- a/nixpkgs/pkgs/development/libraries/libassuan/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libassuan/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, gettext, npth, libgpgerror, buildPackages }:
+{ fetchurl, lib, stdenv, gettext, npth, libgpgerror, buildPackages }:
 
 stdenv.mkDerivation rec {
   pname = "libassuan";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
     sed -i 's,#include <gpg-error.h>,#include "${libgpgerror.dev}/include/gpg-error.h",g' $dev/include/assuan.h
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "IPC library used by GnuPG and related software";
     longDescription = ''
       Libassuan is a small library implementing the so-called Assuan
diff --git a/nixpkgs/pkgs/development/libraries/libast/default.nix b/nixpkgs/pkgs/development/libraries/libast/default.nix
index dfe2dd76ef7d..b48971bc4313 100644
--- a/nixpkgs/pkgs/development/libraries/libast/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libast/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl
-, pkgconfig }:
+{ lib, stdenv, fetchurl
+, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "libast";
@@ -10,9 +10,9 @@ stdenv.mkDerivation rec {
     sha256 = "1w7bs46r4lykfd83kc3bg9i1rxzzlb4ydk23ikf8mx8avz05q1aj";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library of Assorted Spiffy Things";
     homepage = "https://www.eterm.org";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/libasyncns/default.nix b/nixpkgs/pkgs/development/libraries/libasyncns/default.nix
index 9a91551c3a43..0dc26b686117 100644
--- a/nixpkgs/pkgs/development/libraries/libasyncns/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libasyncns/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "libasyncns-0.8";
@@ -8,12 +8,12 @@ stdenv.mkDerivation rec {
     sha256 = "0x5b6lcic4cd7q0bx00x93kvpyzl7n2abbgvqbrlzrfb8vknc6jg";
   };
 
-  configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+  configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "ac_cv_func_malloc_0_nonnull=yes"
     "ac_cv_func_realloc_0_nonnull=yes"
   ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libatomic_ops/default.nix b/nixpkgs/pkgs/development/libraries/libatomic_ops/default.nix
index b576896876e4..f9e850f91ffa 100644
--- a/nixpkgs/pkgs/development/libraries/libatomic_ops/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libatomic_ops/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoconf, automake, libtool }:
+{ lib, stdenv, fetchurl, autoconf, automake, libtool }:
 
 stdenv.mkDerivation rec {
   pname = "libatomic_ops";
@@ -14,17 +14,17 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "doc" ];
 
-  nativeBuildInputs = stdenv.lib.optionals stdenv.isCygwin [ autoconf automake libtool ];
+  nativeBuildInputs = lib.optionals stdenv.isCygwin [ autoconf automake libtool ];
 
-  preConfigure = stdenv.lib.optionalString stdenv.isCygwin ''
+  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 = stdenv.lib.licenses.gpl2Plus ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = with stdenv.lib.platforms; unix ++ windows;
+    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
index ad33c624b141..f90815f4ee9f 100644
--- a/nixpkgs/pkgs/development/libraries/libaudclient/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libaudclient/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib, dbus-glib }:
+{ lib, stdenv, fetchurl, pkg-config, glib, dbus-glib }:
 
 stdenv.mkDerivation rec {
   name = "libaudclient-3.5-rc2";
@@ -9,10 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "0nhpgz0kg8r00z54q5i96pjk7s57krq3fvdypq496c7fmlv9kdap";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ glib dbus-glib ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Legacy D-Bus client library for Audacious";
     homepage = "https://audacious-media-player.org/";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/libav/default.nix b/nixpkgs/pkgs/development/libraries/libav/default.nix
index 15b6a275214d..51aa634e4084 100644
--- a/nixpkgs/pkgs/development/libraries/libav/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libav/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, yasm, bzip2, zlib, perl, bash
+{ lib, stdenv, fetchurl, pkg-config, yasm, bzip2, zlib, perl, bash
 , mp3Support    ? true,   lame      ? null
 , speexSupport  ? true,   speex     ? null
 , theoraSupport ? true,   libtheora ? null
@@ -17,7 +17,7 @@
 
 assert faacSupport -> enableUnfree;
 
-let inherit (stdenv.lib) optional hasPrefix enableFeature; in
+let inherit (lib) optional hasPrefix enableFeature; in
 
 /* ToDo:
     - more deps, inspiration: https://packages.ubuntu.com/raring/libav-tools
@@ -52,7 +52,7 @@ let
     '';
 
     configurePlatforms = [];
-    configureFlags = assert stdenv.lib.all (x: x!=null) buildInputs; [
+    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
@@ -81,7 +81,7 @@ let
       "--enable-cross-compile"
     ];
 
-  nativeBuildInputs = [ pkgconfig perl ];
+  nativeBuildInputs = [ pkg-config perl ];
     buildInputs = [ lame yasm zlib bzip2 SDL bash ]
       ++ [ perl ] # for install-man target
       ++ optional mp3Support lame
@@ -120,7 +120,7 @@ let
 
     passthru = { inherit vdpauSupport; };
 
-    meta = with stdenv.lib; {
+    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?
diff --git a/nixpkgs/pkgs/development/libraries/libavc1394/default.nix b/nixpkgs/pkgs/development/libraries/libavc1394/default.nix
index 01f39052e930..d9c10415b67a 100644
--- a/nixpkgs/pkgs/development/libraries/libavc1394/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libavc1394/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libraw1394 }:
+{ lib, stdenv, fetchurl, pkg-config, libraw1394 }:
 
 stdenv.mkDerivation rec {
   name = "libavc1394-0.5.4";
@@ -8,13 +8,13 @@ stdenv.mkDerivation rec {
     sha256 = "0lsv46jdqvdx5hx92v0z2cz3yh6212pz9gk0k3513sbaa04zzcbw";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   propagatedBuildInputs = [ libraw1394 ];
 
-  meta = { 
+  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 = stdenv.lib.licenses.lgpl21Plus;
-    platforms = stdenv.lib.platforms.linux;
+    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
index 25422c8b7d90..8c33e6f1b6dd 100644
--- a/nixpkgs/pkgs/development/libraries/libavif/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libavif/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , libaom
 , cmake
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
     dav1d
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description  = "C implementation of the AV1 Image File Format";
     longDescription = ''
       Libavif aims to be a friendly, portable C implementation of the
diff --git a/nixpkgs/pkgs/development/libraries/libayatana-appindicator/default.nix b/nixpkgs/pkgs/development/libraries/libayatana-appindicator/default.nix
index 248c33f7e0e5..ef9823130f43 100644
--- a/nixpkgs/pkgs/development/libraries/libayatana-appindicator/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libayatana-appindicator/default.nix
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--with-gtk=${gtkVersion}" ];
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/libayatana-indicator/default.nix b/nixpkgs/pkgs/development/libraries/libayatana-indicator/default.nix
index dd9bc616944d..c3c271c17194 100644
--- a/nixpkgs/pkgs/development/libraries/libayatana-indicator/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libayatana-indicator/default.nix
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--with-gtk=${gtkVersion}" ];
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/libb2/default.nix b/nixpkgs/pkgs/development/libraries/libb2/default.nix
index dad5d40ea530..b142a0a41565 100644
--- a/nixpkgs/pkgs/development/libraries/libb2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libb2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoconf, automake, libtool, pkg-config }:
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "libb2";
@@ -16,13 +16,13 @@ stdenv.mkDerivation rec {
     ./autogen.sh
   '';
 
-  configureFlags = stdenv.lib.optional stdenv.hostPlatform.isx86 "--enable-fat=yes";
+  configureFlags = lib.optional stdenv.hostPlatform.isx86 "--enable-fat=yes";
 
   nativeBuildInputs = [ autoconf automake libtool pkg-config ];
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The BLAKE2 family of cryptographic hash functions";
     homepage = "https://blake2.net/";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/libb64/default.nix b/nixpkgs/pkgs/development/libraries/libb64/default.nix
index 3c9a97684275..f524e9321f9d 100644
--- a/nixpkgs/pkgs/development/libraries/libb64/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libb64/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip }:
+{ lib, stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation rec {
   pname = "libb64";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   meta = {
     inherit version;
     description = "ANSI C routines for fast base64 encoding/decoding";
-    license = stdenv.lib.licenses.publicDomain;
-    platforms = stdenv.lib.platforms.unix;
+    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
index ea7f4eb9fa8a..93927807af85 100644
--- a/nixpkgs/pkgs/development/libraries/libbacktrace/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libbacktrace/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, callPackage, fetchFromGitHub
+{ lib, stdenv, callPackage, fetchFromGitHub
 , enableStatic ? stdenv.hostPlatform.isStatic
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
@@ -17,7 +17,7 @@ in stdenv.mkDerivation rec {
     "--enable-static=${yesno enableStatic}"
     "--enable-shared=${yesno enableShared}"
   ];
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/libbap/default.nix b/nixpkgs/pkgs/development/libraries/libbap/default.nix
index 411c3ae740f2..7c458bae19ce 100644
--- a/nixpkgs/pkgs/development/libraries/libbap/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libbap/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, bap, ocaml, findlib, ctypes, autoreconfHook,
+{ lib, stdenv, fetchFromGitHub, bap, ocaml, findlib, ctypes, autoreconfHook,
   which }:
 
 stdenv.mkDerivation {
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
     mkdir -p $out/include
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/binaryanalysisplatform/bap-bindings";
     description = "A C library for interacting with BAP";
     maintainers = [ maintainers.maurer ];
diff --git a/nixpkgs/pkgs/development/libraries/libbdplus/default.nix b/nixpkgs/pkgs/development/libraries/libbdplus/default.nix
index c9b7bfa3c0e6..ca7b305122e3 100644
--- a/nixpkgs/pkgs/development/libraries/libbdplus/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libbdplus/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libgcrypt, libgpgerror, gettext }:
+{ 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.
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.videolan.org/developers/libbdplus.html";
     description = "Library to access BD+ protected Blu-Ray disks";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libbfd/default.nix b/nixpkgs/pkgs/development/libraries/libbfd/default.nix
index 75db780b7bb6..499f04349b5d 100644
--- a/nixpkgs/pkgs/development/libraries/libbfd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libbfd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchpatch, gnu-config, autoreconfHook, bison, binutils-unwrapped
 , libiberty, zlib
 }:
@@ -43,7 +43,7 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libbladeRF/default.nix b/nixpkgs/pkgs/development/libraries/libbladeRF/default.nix
index b2853011b140..f9bac3835d45 100644
--- a/nixpkgs/pkgs/development/libraries/libbladeRF/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libbladeRF/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, pkgconfig, cmake, git, doxygen, help2man, ncurses, tecla
+{ stdenv, lib, fetchFromGitHub, fetchpatch, pkg-config, cmake, git, doxygen, help2man, ncurses, tecla
 , libusb1, udev }:
 
 let
@@ -23,9 +23,18 @@ in stdenv.mkDerivation {
     sha256 = "0g89al4kwfbx1l3zjddgb9ay4mhr7zk0ndchca3sm1vq2j47nf4l";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  # 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 = [ cmake git doxygen help2man tecla libusb1 ]
+  buildInputs = [ tecla libusb1 ]
     ++ lib.optionals stdenv.isLinux [ udev ]
     ++ lib.optionals stdenv.isDarwin [ ncurses ];
 
diff --git a/nixpkgs/pkgs/development/libraries/libblockdev/default.nix b/nixpkgs/pkgs/development/libraries/libblockdev/default.nix
index 39646db87ecd..11a65006422f 100644
--- a/nixpkgs/pkgs/development/libraries/libblockdev/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libblockdev/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, substituteAll, autoreconfHook, pkgconfig, gtk-doc
+{ lib, stdenv, fetchFromGitHub, 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
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
   '';
 
   nativeBuildInputs = [
-    autoreconfHook pkgconfig gtk-doc libxslt docbook_xsl docbook_xml_dtd_43
+    autoreconfHook pkg-config gtk-doc libxslt docbook_xsl docbook_xml_dtd_43
     python3 gobject-introspection autoconf-archive makeWrapper
   ];
 
@@ -40,10 +40,10 @@ stdenv.mkDerivation rec {
 
   postInstall = ''
     wrapProgram $out/bin/lvm-cache-stats --prefix PATH : \
-      ${stdenv.lib.makeBinPath [ thin-provisioning-tools ]}
+      ${lib.makeBinPath [ thin-provisioning-tools ]}
   '';
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libblocksruntime/default.nix b/nixpkgs/pkgs/development/libraries/libblocksruntime/default.nix
index aff56994f498..6ba832fb3cda 100644
--- a/nixpkgs/pkgs/development/libraries/libblocksruntime/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libblocksruntime/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, clang }:
+{ lib, stdenv, fetchFromGitHub, clang }:
 
 stdenv.mkDerivation {
   name = "blocksruntime-20140624";
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
 
   installPhase = ''prefix="/" DESTDIR=$out ./installlib'';
 
-  meta = with stdenv.lib; {
+  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
index d9639cf5c145..7cb4c9e2b32c 100644
--- a/nixpkgs/pkgs/development/libraries/libbluedevil/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libbluedevil/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, qt4 }:
+{ lib, stdenv, fetchurl, cmake, qt4 }:
 
 stdenv.mkDerivation rec {
   pname = "libbluedevil";
@@ -11,10 +11,11 @@ stdenv.mkDerivation rec {
     sha256 = "0p4f0brhcz9gfxfd6114fa5x6swfdmgzv350xwncdr0s1qnamk8c";
   };
 
-  buildInputs = [ cmake qt4 ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ qt4 ];
 
   meta = {
-    platforms = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
+    license = lib.licenses.gpl2Plus;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libbluray/default.nix b/nixpkgs/pkgs/development/libraries/libbluray/default.nix
index a00e2272d668..3f90bb878adc 100644
--- a/nixpkgs/pkgs/development/libraries/libbluray/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libbluray/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, fontconfig, autoreconfHook, DiskArbitration
+{ lib, stdenv, fetchurl, pkg-config, fontconfig, autoreconfHook, DiskArbitration
 , withJava ? false, jdk ? null, ant ? null
 , withAACS ? false, libaacs ? null
 , withBDplus ? false, libbdplus ? null
@@ -6,7 +6,7 @@
 , withFonts ? true, freetype ? null
 }:
 
-with stdenv.lib;
+with lib;
 
 assert withJava -> jdk != null && ant != null;
 assert withAACS -> libaacs != null;
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
 
   patches = optional withJava ./BDJ-JARFILE-path.patch;
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ]
+  nativeBuildInputs = [ pkg-config autoreconfHook ]
                       ++ optionals withJava [ ant ]
                       ;
 
@@ -50,13 +50,13 @@ stdenv.mkDerivation rec {
     ${optionalString withJava ''export JDK_HOME="${jdk.home}"''}
   '';
 
-  configureFlags =  with stdenv.lib;
+  configureFlags =  with lib;
                     optional (! withJava) "--disable-bdjava-jar"
                  ++ optional (! withMetadata) "--without-libxml2"
                  ++ optional (! withFonts) "--without-freetype"
                  ;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.videolan.org/developers/libbluray.html";
     description = "Library to access Blu-Ray disks for video playback";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libbsd/default.nix b/nixpkgs/pkgs/development/libraries/libbsd/default.nix
index 7aea38bdb58d..778b61d83158 100644
--- a/nixpkgs/pkgs/development/libraries/libbsd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libbsd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook }:
+{ lib, stdenv, fetchurl, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "libbsd";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./darwin.patch ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Common functions found on BSD systems";
     homepage = "https://libbsd.freedesktop.org/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libbson/default.nix b/nixpkgs/pkgs/development/libraries/libbson/default.nix
index 1d2043b20cd4..e03d7c194847 100644
--- a/nixpkgs/pkgs/development/libraries/libbson/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libbson/default.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, perl, stdenv, cmake }:
+{ fetchFromGitHub, perl, lib, stdenv, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "libbson";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
   buildInputs = [ perl ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A C Library for parsing, editing, and creating BSON documents";
     homepage = "https://github.com/mongodb/libbson";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/libburn/default.nix b/nixpkgs/pkgs/development/libraries/libburn/default.nix
index 42c680835f14..02e73b0c04cf 100644
--- a/nixpkgs/pkgs/development/libraries/libburn/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libburn/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "libburn";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1xrp9c2sppbds0agqzmdym7rvdwpjrq6v6q2c3718cwvbjmh66c8";
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libbytesize/default.nix b/nixpkgs/pkgs/development/libraries/libbytesize/default.nix
index c93a59d462fe..a84f010b9e67 100644
--- a/nixpkgs/pkgs/development/libraries/libbytesize/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libbytesize/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, gettext
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, gettext
 , gtk-doc, libxslt, docbook_xml_dtd_43, docbook_xsl
 , python3, pcre2, gmp, mpfr
 }:
@@ -18,11 +18,11 @@ in stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "devdoc" ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig gettext gtk-doc libxslt docbook_xml_dtd_43 docbook_xsl python3 ];
+  nativeBuildInputs = [ autoreconfHook pkg-config gettext gtk-doc libxslt docbook_xml_dtd_43 docbook_xsl python3 ];
 
   buildInputs = [ pcre2 gmp mpfr ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libcaca/default.nix b/nixpkgs/pkgs/development/libraries/libcaca/default.nix
index 84df50e117a5..ca879a60c7a0 100644
--- a/nixpkgs/pkgs/development/libraries/libcaca/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcaca/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ncurses, zlib, pkgconfig, imlib2
+{ lib, stdenv, fetchurl, ncurses, zlib, pkg-config, imlib2
 , x11Support ? !stdenv.isDarwin, libX11, libXext
 }:
 
@@ -19,12 +19,12 @@ stdenv.mkDerivation rec {
     (if x11Support then "--enable-x11" else "--disable-x11")
     ];
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!x11Support) "-DX_DISPLAY_MISSING";
+  NIX_CFLAGS_COMPILE = lib.optionalString (!x11Support) "-DX_DISPLAY_MISSING";
 
   enableParallelBuilding = true;
 
-  propagatedBuildInputs = [ ncurses zlib pkgconfig (imlib2.override { inherit x11Support; }) ]
-    ++ stdenv.lib.optionals x11Support [ libX11 libXext ];
+  propagatedBuildInputs = [ ncurses zlib pkg-config (imlib2.override { inherit x11Support; }) ]
+    ++ lib.optionals x11Support [ libX11 libXext ];
 
   postInstall = ''
     mkdir -p $dev/bin
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://libcaca.zoy.org/";
     description = "A graphics library that outputs text instead of pixels";
-    license = stdenv.lib.licenses.wtfpl;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.wtfpl;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libcacard/default.nix b/nixpkgs/pkgs/development/libraries/libcacard/default.nix
index 474e51e8c465..c484a49b1a2b 100644
--- a/nixpkgs/pkgs/development/libraries/libcacard/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcacard/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib, nss }:
+{ lib, stdenv, fetchurl, pkg-config, glib, nss }:
 
 stdenv.mkDerivation rec {
   pname = "libcacard";
@@ -9,10 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "0vyvkk4b6xjwq1ccggql13c1x7g4y90clpkqw28257azgn2a1c8n";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ glib nss ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Smart card emulation library";
     homepage = "https://gitlab.freedesktop.org/spice/libcacard";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libcanberra/default.nix b/nixpkgs/pkgs/development/libraries/libcanberra/default.nix
index 9dea5956d652..a2dfe1322f84 100644
--- a/nixpkgs/pkgs/development/libraries/libcanberra/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcanberra/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, fetchpatch, pkgconfig, libtool
+{ stdenv, lib, fetchurl, fetchpatch, pkg-config, libtool
 , gtk ? null
 , libpulseaudio, gst_all_1, libvorbis, libcap
 , CoreServices
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "0wps39h8rx2b00vyvkia5j40fkak3dpipp1kzilqla0cgvk73dn2";
   };
 
-  nativeBuildInputs = [ pkgconfig libtool ];
+  nativeBuildInputs = [ pkg-config libtool ];
   buildInputs = [
     libpulseaudio libvorbis gtk
   ] ++ (with gst_all_1; [ gstreamer gst-plugins-base ])
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  postPatch = (stdenv.lib.optional stdenv.isDarwin) ''
+  postPatch = (lib.optional stdenv.isDarwin) ''
     patch -p0 < ${fetchpatch {
       url = "https://raw.githubusercontent.com/macports/macports-ports/master/audio/libcanberra/files/patch-configure.diff";
       sha256 = "1f7h7ifpqvbfhqygn1b7klvwi80zmpv3538vbmq7ql7bkf1q8h31";
@@ -60,9 +60,9 @@ stdenv.mkDerivation rec {
 
     homepage = "http://0pointer.de/lennart/projects/libcanberra/";
 
-    license = stdenv.lib.licenses.lgpl2Plus;
+    license = lib.licenses.lgpl2Plus;
 
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libcangjie/default.nix b/nixpkgs/pkgs/development/libraries/libcangjie/default.nix
index b71b630675de..c6bbbcdb61ab 100644
--- a/nixpkgs/pkgs/development/libraries/libcangjie/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcangjie/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, autoconf, automake, libtool, m4, fetchurl, bash, pkgconfig, sqlite }:
+{ lib, stdenv, autoconf, automake, libtool, m4, fetchurl, bash, pkg-config, sqlite }:
 
 stdenv.mkDerivation rec {
   pname = "libcangjie";
@@ -10,11 +10,11 @@ stdenv.mkDerivation rec {
     sha256 = "0i5svvcx099fc9hh5dvr3gpb1041v6vn5fnylxy82zjy239114lg";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  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 '{}' ';'
   '';
@@ -27,9 +27,9 @@ stdenv.mkDerivation rec {
       libcangjie is a library implementing the Cangjie input method.
     '';
     homepage = "http://cangjians.github.io/projects/libcangjie/";
-    license = stdenv.lib.licenses.lgpl3Plus;
+    license = lib.licenses.lgpl3Plus;
 
-    maintainers = [ stdenv.lib.maintainers.linquize ];
-    platforms = stdenv.lib.platforms.all;
+    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
index ae5154eac034..349b715d8520 100644
--- a/nixpkgs/pkgs/development/libraries/libcbor/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcbor/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, cmocka }:
+{ lib, stdenv, fetchFromGitHub, cmake, cmocka }:
 
 stdenv.mkDerivation rec {
   pname = "libcbor";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [ "-DCMAKE_INSTALL_LIBDIR=lib" "-DBUILD_SHARED_LIBS=on" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "CBOR protocol implementation for C and others";
     homepage = "https://github.com/PJK/libcbor";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libcdaudio/default.nix b/nixpkgs/pkgs/development/libraries/libcdaudio/default.nix
index abc5f84a0e32..e5f6324e261c 100644
--- a/nixpkgs/pkgs/development/libraries/libcdaudio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcdaudio/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation {
   name = "libcdaudio-0.99.12p2";
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
   meta = {
     description = "A portable library for controlling audio CDs";
     homepage = "http://libcdaudio.sourceforge.net";
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.lgpl2;
+    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
index 2b837ff1ce1a..c1b28e22e103 100644
--- a/nixpkgs/pkgs/development/libraries/libcddb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcddb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libiconv }:
+{ lib, stdenv, fetchurl, libiconv }:
 
 stdenv.mkDerivation rec {
   name = "libcddb-1.3.2";
@@ -8,16 +8,16 @@ stdenv.mkDerivation rec {
     sha256 = "0fr21a7vprdyy1bq6s99m0x420c9jm5fipsd63pqv8qyfkhhxkim";
   };
 
-  buildInputs = stdenv.lib.optional stdenv.isDarwin libiconv;
+  buildInputs = lib.optional stdenv.isDarwin libiconv;
 
-  configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+  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 stdenv.lib; {
+  meta = with lib; {
     description = "C library to access data on a CDDB server (freedb.org)";
     homepage = "http://libcddb.sourceforge.net/";
     license = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libcdio-paranoia/default.nix b/nixpkgs/pkgs/development/libraries/libcdio-paranoia/default.nix
index 8ad3231dc36b..905d39dbd8ea 100644
--- a/nixpkgs/pkgs/development/libraries/libcdio-paranoia/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcdio-paranoia/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, libcdio, pkgconfig,
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, libcdio, pkg-config,
   libiconv, IOKit, DiskArbitration}:
 
 stdenv.mkDerivation {
@@ -11,17 +11,17 @@ stdenv.mkDerivation {
     sha256 = "1wjgmmaca4baw7k5c3vdap9hnjc49ciagi5kvpvync3aqfmdvkha";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ libcdio ] ++
-    stdenv.lib.optionals stdenv.isDarwin [ libiconv IOKit DiskArbitration ];
+    lib.optionals stdenv.isDarwin [ libiconv IOKit DiskArbitration ];
 
-  propagatedBuildInputs = stdenv.lib.optional stdenv.isDarwin DiskArbitration;
+  propagatedBuildInputs = lib.optional stdenv.isDarwin DiskArbitration;
 
-  configureFlags = stdenv.lib.optionals stdenv.isDarwin [
+  configureFlags = lib.optionals stdenv.isDarwin [
     "--disable-ld-version-script"
   ];
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libcdio/default.nix b/nixpkgs/pkgs/development/libraries/libcdio/default.nix
index b0b7b55a19db..cfe796b14d06 100644
--- a/nixpkgs/pkgs/development/libraries/libcdio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcdio/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libcddb, pkgconfig, ncurses, help2man, libiconv, Carbon, IOKit }:
+{ lib, stdenv, fetchurl, libcddb, pkg-config, ncurses, help2man, libiconv, Carbon, IOKit }:
 
 stdenv.mkDerivation rec {
   name = "libcdio-2.1.0";
@@ -12,13 +12,13 @@ stdenv.mkDerivation rec {
     patchShebangs .
   '';
 
-  nativeBuildInputs = [ pkgconfig help2man ];
+  nativeBuildInputs = [ pkg-config help2man ];
   buildInputs = [ libcddb ncurses ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv Carbon IOKit ];
+    ++ lib.optionals stdenv.isDarwin [ libiconv Carbon IOKit ];
 
   doCheck = !stdenv.isDarwin;
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libcdr/default.nix b/nixpkgs/pkgs/development/libraries/libcdr/default.nix
index 72996e28996c..087c928b79ce 100644
--- a/nixpkgs/pkgs/development/libraries/libcdr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcdr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libwpg, libwpd, lcms, pkgconfig, librevenge, icu, boost, cppunit }:
+{ lib, stdenv, fetchurl, libwpg, libwpd, lcms, pkg-config, librevenge, icu, boost, cppunit }:
 
 stdenv.mkDerivation rec {
   name = "libcdr-0.1.6";
@@ -10,14 +10,14 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libwpg libwpd lcms librevenge icu boost cppunit ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  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 = stdenv.lib.platforms.all;
-    license = stdenv.lib.licenses.mpl20;
+    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
index 792d899333e0..341754376aae 100644
--- a/nixpkgs/pkgs/development/libraries/libcec/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcec/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, pkgconfig, udev, libcec_platform, libraspberrypi ? null }:
+{ lib, stdenv, fetchurl, cmake, pkg-config, udev, libcec_platform, libraspberrypi ? null }:
 
 let version = "4.0.7"; in
 
@@ -11,9 +11,9 @@ stdenv.mkDerivation {
     sha256 = "0nii8qh3qrn92g8x3canj4glb2bjn6gc1p3f6hfp59ckd4vjrndw";
   };
 
-  nativeBuildInputs = [ pkgconfig cmake ];
+  nativeBuildInputs = [ pkg-config cmake ];
   buildInputs = [ udev libcec_platform ] ++
-    stdenv.lib.optional (libraspberrypi != null) libraspberrypi;
+    lib.optional (libraspberrypi != null) libraspberrypi;
 
   cmakeFlags = [ "-DBUILD_SHARED_LIBS=1" ];
 
@@ -22,11 +22,11 @@ stdenv.mkDerivation {
     substituteInPlace include/cecloader.h --replace "libcec.so" "$out/lib/libcec.so"
   '';
 
-  meta = with stdenv.lib; {
+  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 = stdenv.lib.licenses.gpl2Plus;
+    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
index 2132cf7a065e..15972272a187 100644
--- a/nixpkgs/pkgs/development/libraries/libcec/platform.nix
+++ b/nixpkgs/pkgs/development/libraries/libcec/platform.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake }:
+{ lib, stdenv, fetchurl, cmake }:
 
 let version = "2.1.0.1"; in
 
@@ -13,11 +13,11 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  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 = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
     platforms = platforms.linux;
     maintainers = [ maintainers.titanous ];
   };
diff --git a/nixpkgs/pkgs/development/libraries/libcef/default.nix b/nixpkgs/pkgs/development/libraries/libcef/default.nix
index 93aaebc110e2..ec1a5ee38281 100644
--- a/nixpkgs/pkgs/development/libraries/libcef/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcef/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, alsaLib, atk, cairo, cups, dbus, expat, fontconfig
+{ lib, stdenv, fetchurl, cmake, alsaLib, atk, cairo, cups, dbus, expat, fontconfig
 , GConf, gdk-pixbuf, glib, gtk2, libX11, libxcb, libXcomposite, libXcursor
 , libXdamage, libXext, libXfixes, libXi, libXrandr, libXrender, libXScrnSaver
 , libXtst, nspr, nss, pango, libpulseaudio, systemd, at-spi2-atk, at-spi2-core
@@ -6,7 +6,7 @@
 
 let
   libPath =
-    stdenv.lib.makeLibraryPath [
+    lib.makeLibraryPath [
       alsaLib atk cairo cups dbus expat fontconfig GConf gdk-pixbuf glib gtk2
       libX11 libxcb libXcomposite libXcursor libXdamage libXext libXfixes libXi
       libXrandr libXrender libXScrnSaver libXtst nspr nss pango libpulseaudio
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
     cp -r ../include $out/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Simple framework for embedding Chromium-based browsers in other applications";
     homepage = "http://opensource.spotify.com/cefbuilds/index.html";
     maintainers = with maintainers; [ puffnfresh ];
diff --git a/nixpkgs/pkgs/development/libraries/libcello/default.nix b/nixpkgs/pkgs/development/libraries/libcello/default.nix
index 908c9cb15dd2..100077bcc706 100644
--- a/nixpkgs/pkgs/development/libraries/libcello/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcello/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "libcello";
@@ -14,8 +14,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://libcello.org/";
     description = "Higher level programming in C";
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = [ stdenv.lib.maintainers.MostAwesomeDude ];
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.MostAwesomeDude ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libchamplain/default.nix b/nixpkgs/pkgs/development/libraries/libchamplain/default.nix
index 6a74941a3a0f..22a062acd6ef 100644
--- a/nixpkgs/pkgs/development/libraries/libchamplain/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libchamplain/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, meson, ninja, vala, gtk-doc, docbook_xsl, docbook_xml_dtd_412, pkgconfig, glib, gtk3, cairo, sqlite, gnome3
+{ fetchurl, lib, stdenv, meson, ninja, vala, gtk-doc, docbook_xsl, docbook_xml_dtd_412, pkg-config, glib, gtk3, cairo, sqlite, gnome3
 , clutter-gtk, libsoup, gobject-introspection /*, libmemphis */ }:
 
 stdenv.mkDerivation rec {
@@ -6,13 +6,13 @@ stdenv.mkDerivation rec {
   version = "0.12.20";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0rihpb0npqpihqcdz4w03rq6xl7jdckfqskvv9diq2hkrnzv8ch2";
   };
 
   outputs = [ "out" "dev" "devdoc" ];
 
-  nativeBuildInputs = [ meson ninja pkgconfig gobject-introspection vala gtk-doc docbook_xsl docbook_xml_dtd_412 ];
+  nativeBuildInputs = [ meson ninja pkg-config gobject-introspection vala gtk-doc docbook_xsl docbook_xml_dtd_412 ];
 
   buildInputs = [ sqlite libsoup ];
 
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://wiki.gnome.org/Projects/libchamplain";
     license = licenses.lgpl2Plus;
 
diff --git a/nixpkgs/pkgs/development/libraries/libchardet/default.nix b/nixpkgs/pkgs/development/libraries/libchardet/default.nix
index 168217678c0a..260c332f7ef4 100644
--- a/nixpkgs/pkgs/development/libraries/libchardet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libchardet/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, perl }:
+{ lib, stdenv, fetchFromGitHub, perl }:
 
 stdenv.mkDerivation rec {
   pname = "libchardet";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libchewing/default.nix b/nixpkgs/pkgs/development/libraries/libchewing/default.nix
index cd2df385f488..1436d4bd59dc 100644
--- a/nixpkgs/pkgs/development/libraries/libchewing/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libchewing/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, sqlite }:
+{ lib, stdenv, fetchurl, sqlite }:
 
 stdenv.mkDerivation rec {
   pname = "libchewing";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ sqlite ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Intelligent Chinese phonetic input method";
     homepage = "http://chewing.im/";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libchop/default.nix b/nixpkgs/pkgs/development/libraries/libchop/default.nix
index d2040b72311c..f02ac04621fc 100644
--- a/nixpkgs/pkgs/development/libraries/libchop/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libchop/default.nix
@@ -1,6 +1,6 @@
-{ fetchurl, stdenv, zlib, bzip2, libgcrypt
+{ fetchurl, lib, stdenv, zlib, bzip2, libgcrypt
 , gdbm, gperf, tdb, gnutls, db, libuuid
-, lzo, pkgconfig, guile, rpcsvc-proto, libtirpc
+, lzo, pkg-config, guile, rpcsvc-proto, libtirpc
 }:
 
 stdenv.mkDerivation rec {
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./gets-undeclared.patch ./size_t.patch ./0001-Fix-RPC-compilation-when-using-libtirpc-rather-than-.patch ];
 
-  nativeBuildInputs = [ pkgconfig gperf rpcsvc-proto ];
+  nativeBuildInputs = [ pkg-config gperf rpcsvc-proto ];
 
   NIX_CFLAGS_COMPILE = [ "-I${libtirpc.dev}/include/tirpc" ];
   NIX_LDFLAGS = [ "-ltirpc" ];
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     sed -re 's%@GUILE@%&/guile%' -i */Makefile.* Makefile.*
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Tools & library for data backup and distributed storage";
 
     longDescription =
diff --git a/nixpkgs/pkgs/development/libraries/libcint/default.nix b/nixpkgs/pkgs/development/libraries/libcint/default.nix
index 8415b964bb99..bd8e8bd4aaf0 100644
--- a/nixpkgs/pkgs/development/libraries/libcint/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcint/default.nix
@@ -9,13 +9,13 @@
 
 stdenv.mkDerivation rec {
   pname = "libcint";
-  version = "4.0.6";
+  version = "4.0.7";
 
   src = fetchFromGitHub {
     owner = "sunqm";
     repo = "libcint";
     rev = "v${version}";
-    sha256 = "1bgzsyz1i0hvla5ax0lawp1kw25fkhzh9ddhq92mplizrj9y05c1";
+    sha256 = "sha256-/S5LcaIIAXq9QiH8wGPSw8KpWC3afX9HqiHrWHmGQ6s=";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/nixpkgs/pkgs/development/libraries/libck/default.nix b/nixpkgs/pkgs/development/libraries/libck/default.nix
index c4f38e96f3d2..accb6556011d 100644
--- a/nixpkgs/pkgs/development/libraries/libck/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libck/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "ck";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   dontDisableStatic = true;
 
-  meta = with stdenv.lib; {
+  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.
diff --git a/nixpkgs/pkgs/development/libraries/libclc/default.nix b/nixpkgs/pkgs/development/libraries/libclc/default.nix
index 0672e7942cbb..a6334bf9998c 100644
--- a/nixpkgs/pkgs/development/libraries/libclc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libclc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, python, llvmPackages }:
+{ lib, stdenv, fetchFromGitHub, python, llvmPackages }:
 
 let
   llvm = llvmPackages.llvm;
@@ -30,7 +30,7 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://libclc.llvm.org/";
     description = "Implementation of the library requirements of the OpenCL C programming language";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libcli/default.nix b/nixpkgs/pkgs/development/libraries/libcli/default.nix
index 6cabe1343c48..ceb0338e5cc1 100644
--- a/nixpkgs/pkgs/development/libraries/libcli/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcli/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchurl }:
+{ lib, stdenv, fetchFromGitHub, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "libcli";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "PREFIX=$(out)" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Emulate a Cisco-style telnet command-line interface";
     homepage = "http://sites.dparrish.com/libcli";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libcloudproviders/default.nix b/nixpkgs/pkgs/development/libraries/libcloudproviders/default.nix
index 87c86ea2fbea..08601db08342 100644
--- a/nixpkgs/pkgs/development/libraries/libcloudproviders/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcloudproviders/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig, gobject-introspection, vala, gtk-doc, docbook_xsl, glib }:
+{ 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
 
@@ -17,11 +17,11 @@ stdenv.mkDerivation rec {
     "-Denable-gtk-doc=true"
   ];
 
-  nativeBuildInputs = [ meson ninja pkgconfig gobject-introspection vala gtk-doc docbook_xsl ];
+  nativeBuildInputs = [ meson ninja pkg-config gobject-introspection vala gtk-doc docbook_xsl ];
 
   buildInputs = [ glib ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libclthreads/default.nix b/nixpkgs/pkgs/development/libraries/libclthreads/default.nix
index 53cff9a19d3d..e4548420a057 100644
--- a/nixpkgs/pkgs/development/libraries/libclthreads/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libclthreads/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "libclthreads";
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     ln $out/lib/libclthreads.so $out/lib/libclthreads.so.2
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Zita thread library";
     homepage = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libclxclient/default.nix b/nixpkgs/pkgs/development/libraries/libclxclient/default.nix
index b086dfc08f68..0d39a5e55b26 100644
--- a/nixpkgs/pkgs/development/libraries/libclxclient/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libclxclient/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libclthreads, libX11, libXft, xorg, pkgconfig }:
+{ lib, stdenv, fetchurl, libclthreads, libX11, libXft, xorg, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "libclxclient";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libclthreads libX11 libXft xorg.xorgproto ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   NIX_CFLAGS_COMPILE = "-I${xorg.xorgproto}/include -I${libXft.dev}/include";
 
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
     ln $out/lib/libclxclient.so $out/lib/libclxclient.so.3
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Zita X11 library";
     homepage = "http://kokkinizita.linuxaudio.org/linuxaudio/downloads/index.html";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libcmis/default.nix b/nixpkgs/pkgs/development/libraries/libcmis/default.nix
index 8b1093ac21fc..2898c9a1c835 100644
--- a/nixpkgs/pkgs/development/libraries/libcmis/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcmis/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, boost, libxml2, pkgconfig, docbook2x, curl, autoreconfHook, cppunit }:
+{ lib, stdenv, fetchFromGitHub, boost, libxml2, pkg-config, docbook2x, curl, autoreconfHook, cppunit }:
 
 stdenv.mkDerivation rec {
   pname = "libcmis";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0s6prfh55hn11vrs72ph1gs01v0vngly81pvyjm5v1sgwymdxx57";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig docbook2x ];
+  nativeBuildInputs = [ autoreconfHook pkg-config docbook2x ];
   buildInputs = [ boost libxml2 curl cppunit ];
 
   configureFlags = [
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ client library for the CMIS interface";
     homepage = "https://sourceforge.net/projects/libcmis/";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libco-canonical/default.nix b/nixpkgs/pkgs/development/libraries/libco-canonical/default.nix
index 56974fcca7b6..a01bbf7419cc 100644
--- a/nixpkgs/pkgs/development/libraries/libco-canonical/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libco-canonical/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchFromGitHub, pkgconfig }:
+{ lib, stdenv, fetchFromGitHub, pkg-config }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "libco-canonical";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "0r5b1r0sxngx349s5a3zkkvfw5by9y492kr34b25gjspzvjchlxq";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   makeFlags = [ "PREFIX=${placeholder "out"}" ];
 
diff --git a/nixpkgs/pkgs/development/libraries/libcollectdclient/default.nix b/nixpkgs/pkgs/development/libraries/libcollectdclient/default.nix
index f945434842ee..df8db3ac9f89 100644
--- a/nixpkgs/pkgs/development/libraries/libcollectdclient/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcollectdclient/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, collectd }:
-with stdenv.lib;
+{ lib, stdenv, collectd }:
+with lib;
 
 collectd.overrideAttrs (oldAttrs: {
   name = "libcollectdclient-${collectd.version}";
@@ -12,7 +12,7 @@ collectd.overrideAttrs (oldAttrs: {
 
   postInstall = "rm -rf $out/{bin,etc,sbin,share}";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C Library for collectd, a daemon which collects system performance statistics periodically";
     homepage = "http://collectd.org";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libcommuni/default.nix b/nixpkgs/pkgs/development/libraries/libcommuni/default.nix
index 3f91c8e579f5..47360e11bc5e 100644
--- a/nixpkgs/pkgs/development/libraries/libcommuni/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcommuni/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , qtbase, qtdeclarative, qmake, which
 }:
 
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
   # Hack to avoid TMPDIR in RPATHs.
   preFixup = "rm -rf lib";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A cross-platform IRC framework written with Qt";
     homepage = "https://communi.github.io";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libconfig/default.nix b/nixpkgs/pkgs/development/libraries/libconfig/default.nix
index 7d7f95d757ce..ae5f11764633 100644
--- a/nixpkgs/pkgs/development/libraries/libconfig/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libconfig/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "libconfig";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.hyperrealm.com/libconfig";
     description = "A simple library for processing structured configuration files";
     license = licenses.lgpl3;
diff --git a/nixpkgs/pkgs/development/libraries/libconfuse/default.nix b/nixpkgs/pkgs/development/libraries/libconfuse/default.nix
index b7afe5ed03af..7545fe9617cc 100644
--- a/nixpkgs/pkgs/development/libraries/libconfuse/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libconfuse/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, flex }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, flex }:
 
 stdenv.mkDerivation rec {
   pname = "libconfuse";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   doInstallCheck = true;
   installCheckTarget = "check";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit (src.meta) homepage;
     description = "Small configuration file parser library for C";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/libcouchbase/default.nix b/nixpkgs/pkgs/development/libraries/libcouchbase/default.nix
index 92b000bc4efe..9f75eafdf247 100644
--- a/nixpkgs/pkgs/development/libraries/libcouchbase/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcouchbase/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig, libevent, openssl}:
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libevent, openssl}:
 
 stdenv.mkDerivation rec {
   pname = "libcouchbase";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [ "-DLCB_NO_MOCK=ON" ];
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
   buildInputs = [ libevent openssl ];
 
   # Running tests in parallel does not work
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
   doCheck = !stdenv.isDarwin;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C client library for Couchbase";
     homepage = "https://github.com/couchbase/libcouchbase";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/libcrafter/default.nix b/nixpkgs/pkgs/development/libraries/libcrafter/default.nix
index 20bcc9183ec4..e7a6e6c98372 100644
--- a/nixpkgs/pkgs/development/libraries/libcrafter/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcrafter/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, autoconf, automake, libtool, libpcap }:
+{ lib, stdenv, fetchzip, autoconf, automake, libtool, libpcap }:
 
 stdenv.mkDerivation rec {
   pname = "libcrafter";
@@ -22,8 +22,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://github.com/pellegre/libcrafter";
     description = "High level C++ network packet sniffing and crafting library";
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = [ stdenv.lib.maintainers.lethalman ];
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.lethalman ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libcredis/default.nix b/nixpkgs/pkgs/development/libraries/libcredis/default.nix
index 1368cd30adbb..902f5a6ee26f 100644
--- a/nixpkgs/pkgs/development/libraries/libcredis/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcredis/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   name = "libcredis-0.2.3";
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
     cp -v *.h "$out/include/"
   '';
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libcrossguid/default.nix b/nixpkgs/pkgs/development/libraries/libcrossguid/default.nix
index 8e2be72987cf..c81dbb86f6a0 100644
--- a/nixpkgs/pkgs/development/libraries/libcrossguid/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcrossguid/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, libuuid }:
+{ lib, stdenv, fetchFromGitHub, libuuid }:
 
 stdenv.mkDerivation rec {
   name = "lib" + pname + "-" + version;
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     install -D -m644 guid.h "$out/include/guid.h"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Lightweight cross platform C++ GUID/UUID library";
     license = licenses.mit;
     maintainers = with maintainers; [ edwtjo ];
diff --git a/nixpkgs/pkgs/development/libraries/libcryptui/default.nix b/nixpkgs/pkgs/development/libraries/libcryptui/default.nix
index df1558a1e49a..5fdd60abe115 100644
--- a/nixpkgs/pkgs/development/libraries/libcryptui/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcryptui/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, autoreconfHook, pkgconfig, intltool, glib, gnome3, gtk3, gnupg22, gpgme, dbus-glib, libgnome-keyring }:
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, intltool, glib, gnome3, gtk3, gnupg22, gpgme, dbus-glib, libgnome-keyring }:
 
 stdenv.mkDerivation rec {
   pname = "libcryptui";
   version = "3.12.2";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0rh8wa5k2iwbwppyvij2jdxmnlfjbna7kbh2a5n7zw4nnjkx3ski";
   };
 
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     ./fix-gnupg-2.2.patch # based on https://gitlab.gnome.org/GNOME/libcryptui/-/commit/b05e301d1b264a5d8f07cb96e5edc243d99bff79.patch
   ];
 
-  nativeBuildInputs = [ pkgconfig intltool autoreconfHook ];
+  nativeBuildInputs = [ pkg-config intltool autoreconfHook ];
   buildInputs = [ glib gtk3 gnupg22 gpgme dbus-glib libgnome-keyring ];
   propagatedBuildInputs = [ dbus-glib ];
 
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Interface components for OpenPGP";
     homepage = "https://gitlab.gnome.org/GNOME/libcryptui";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libcsptr/default.nix b/nixpkgs/pkgs/development/libraries/libcsptr/default.nix
index fcb5aa2bbfee..e30165054aa0 100644
--- a/nixpkgs/pkgs/development/libraries/libcsptr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcsptr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "libcsptr";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Smart pointer constructs for the (GNU) C programming language";
     homepage = "https://github.com/Snaipe/libcsptr";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libctb/default.nix b/nixpkgs/pkgs/development/libraries/libctb/default.nix
index 161c7c98c63f..d52adac556d8 100644
--- a/nixpkgs/pkgs/development/libraries/libctb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libctb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 stdenv.mkDerivation rec {
   pname = "libctb";
   version = "0.16";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   makeFlags = [
     "prefix=$(out)"
   ];
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Communications toolbox";
     homepage = "https://iftools.com";
     license = licenses.lgpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libctemplate/default.nix b/nixpkgs/pkgs/development/libraries/libctemplate/default.nix
index b571e816fc40..2aa36bfe9914 100644
--- a/nixpkgs/pkgs/development/libraries/libctemplate/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libctemplate/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, python3, autoconf, automake, libtool }:
+{ lib, stdenv, fetchFromGitHub, python3, autoconf, automake, libtool }:
 
 stdenv.mkDerivation rec {
   pname = "ctemplate";
@@ -29,6 +29,6 @@ stdenv.mkDerivation rec {
       embed application logic in this template language.
     '';
     homepage = "https://github.com/OlafvdSpek/ctemplate";
-    license = stdenv.lib.licenses.bsd3;
+    license = lib.licenses.bsd3;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libcue/default.nix b/nixpkgs/pkgs/development/libraries/libcue/default.nix
index 73a110c07f69..227dfd77f463 100644
--- a/nixpkgs/pkgs/development/libraries/libcue/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcue/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, bison, flex }:
+{ lib, stdenv, fetchFromGitHub, cmake, bison, flex }:
 
 stdenv.mkDerivation rec {
   pname = "libcue";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # fails all the tests (ctest)
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "CUE Sheet Parser Library";
     longDescription = ''
       libcue is intended to parse a so called cue sheet from a char string or
diff --git a/nixpkgs/pkgs/development/libraries/libcutl/default.nix b/nixpkgs/pkgs/development/libraries/libcutl/default.nix
index b13805aa37aa..7a5c39849291 100644
--- a/nixpkgs/pkgs/development/libraries/libcutl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libcutl/default.nix
@@ -1,14 +1,14 @@
-{ stdenv, fetchurl, xercesc }:
+{ lib, stdenv, fetchurl, xercesc }:
 
 stdenv.mkDerivation rec {
   pname = "libcutl";
   version = "1.10.0";
 
-  meta = with stdenv.lib; {
+  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 
+        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/";
diff --git a/nixpkgs/pkgs/development/libraries/libdaemon/default.nix b/nixpkgs/pkgs/development/libraries/libdaemon/default.nix
index d906e119dca6..eeb034ed0678 100644
--- a/nixpkgs/pkgs/development/libraries/libdaemon/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdaemon/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   name = "libdaemon-0.14";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   patches = [ ./fix-includes.patch ];
 
   configureFlags = [ "--disable-lynx" ]
-    ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
+    ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
     [ # Can't run this test while cross-compiling
       "ac_cv_func_setpgrp_void=yes"
     ];
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Lightweight C library that eases the writing of UNIX daemons";
     homepage = "http://0pointer.de/lennart/projects/libdaemon/";
-    license = stdenv.lib.licenses.lgpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.lgpl2Plus;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libdap/default.nix b/nixpkgs/pkgs/development/libraries/libdap/default.nix
index a643c25f0bfd..8eacd9706a88 100644
--- a/nixpkgs/pkgs/development/libraries/libdap/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdap/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, bison, libuuid, curl, libxml2, flex }:
+{ lib, stdenv, fetchurl, bison, libuuid, curl, libxml2, flex }:
 
 stdenv.mkDerivation rec {
   version = "3.20.6";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "0jn5bi8k2lq6mmrsw7r1r5aviyf8gb39b2iy20v4kpkj5napzk1m";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A C++ SDK which contains an implementation of DAP";
     homepage = "https://www.opendap.org/software/libdap";
     license = licenses.lgpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libdatrie/default.nix b/nixpkgs/pkgs/development/libraries/libdatrie/default.nix
index 168773662f6a..f4e2df36d917 100644
--- a/nixpkgs/pkgs/development/libraries/libdatrie/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdatrie/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, makeWrapper
+{ lib, stdenv, fetchFromGitHub, makeWrapper
 , autoreconfHook, autoconf-archive
 , installShellFiles, libiconv }:
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     installShellFiles
   ];
 
-  buildInputs = stdenv.lib.optional stdenv.isDarwin libiconv;
+  buildInputs = lib.optional stdenv.isDarwin libiconv;
 
   preAutoreconf = let
     reports = "https://github.com/tlwg/libdatrie/issues";
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
     installManPage man/trietool.1
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libdazzle/default.nix b/nixpkgs/pkgs/development/libraries/libdazzle/default.nix
index 6c430682251f..d6ecb6e9747e 100644
--- a/nixpkgs/pkgs/development/libraries/libdazzle/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdazzle/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ninja, meson, pkgconfig, vala, gobject-introspection, libxml2
+{ lib, stdenv, fetchurl, ninja, meson, pkg-config, vala, gobject-introspection, libxml2
 , gtk-doc, docbook_xsl, docbook_xml_dtd_43, dbus, xvfb_run, glib, gtk3, gnome3 }:
 
 stdenv.mkDerivation rec {
@@ -9,11 +9,11 @@ stdenv.mkDerivation rec {
   outputBin = "dev";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/libdazzle/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/libdazzle/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "13v7s46cgw135ycx0byn7am4inn33slrhljq0v0wwfwl2y1g52p1";
   };
 
-  nativeBuildInputs = [ ninja meson pkgconfig vala gobject-introspection libxml2 gtk-doc docbook_xsl docbook_xml_dtd_43 dbus xvfb_run glib ];
+  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 = [
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libdbi-drivers/default.nix b/nixpkgs/pkgs/development/libraries/libdbi-drivers/default.nix
index 871c9f971675..6a86d4941bff 100644
--- a/nixpkgs/pkgs/development/libraries/libdbi-drivers/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdbi-drivers/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchurl, libdbi
+{ lib, stdenv, fetchurl, libdbi
 , libmysqlclient ? null
 , sqlite ? null
 , postgresql ? null
 }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   name = "libdbi-drivers-0.9.0";
 
diff --git a/nixpkgs/pkgs/development/libraries/libdbi/default.nix b/nixpkgs/pkgs/development/libraries/libdbi/default.nix
index 64c511503d09..48812f091bea 100644
--- a/nixpkgs/pkgs/development/libraries/libdbi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdbi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "libdbi-0.9.0";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "00s5ra7hdlq25iv23nwf4h1v3kmbiyzx0v9bhggjiii4lpf6ryys";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://libdbi.sourceforge.net/";
     description = "DB independent interface to DB";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/default.nix b/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/default.nix
index 6b4be0db4144..e44f3e37d200 100644
--- a/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qt4, cmake }:
+{ lib, stdenv, fetchurl, qt4, cmake }:
 
 let
   baseName = "libdbusmenu-qt";
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
 
   cmakeFlags = [ "-DWITH_DOC=OFF" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Provides a Qt implementation of the DBusMenu spec";
     inherit homepage;
     inherit (qt4.meta) platforms;
diff --git a/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix b/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix
index d7eab2968092..5ce811e9fea2 100644
--- a/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix
+++ b/nixpkgs/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, cmake, qtbase }:
+{ lib, stdenv, fetchgit, cmake, qtbase }:
 
 stdenv.mkDerivation rec {
   pname = "libdbusmenu-qt";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [ "-DWITH_DOC=OFF" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://launchpad.net/libdbusmenu-qt";
     description = "Provides a Qt implementation of the DBusMenu spec";
     maintainers = [ maintainers.ttuegel ];
diff --git a/nixpkgs/pkgs/development/libraries/libdbusmenu/default.nix b/nixpkgs/pkgs/development/libraries/libdbusmenu/default.nix
index 5e11864b1f17..8e9fe4de88ae 100644
--- a/nixpkgs/pkgs/development/libraries/libdbusmenu/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdbusmenu/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, lib, file
-, pkgconfig, intltool
+, pkg-config, intltool
 , glib, dbus-glib, json-glib
 , gobject-introspection, vala
 , gtkVersion ? null, gtk2 ? null, gtk3 ? null }:
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     sha256 = "12l7z8dhl917iy9h02sxmpclnhkdjryn08r8i4sr8l3lrlm4mk5r";
   };
 
-  nativeBuildInputs = [ vala pkgconfig intltool gobject-introspection ];
+  nativeBuildInputs = [ vala pkg-config intltool gobject-introspection ];
 
   buildInputs = [
     glib dbus-glib json-glib
diff --git a/nixpkgs/pkgs/development/libraries/libdc1394/default.nix b/nixpkgs/pkgs/development/libraries/libdc1394/default.nix
index 8a688ef37c6d..a666eb3a650b 100644
--- a/nixpkgs/pkgs/development/libraries/libdc1394/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdc1394/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libraw1394
+{ lib, stdenv, fetchurl, libraw1394
 , libusb1, CoreServices }:
 
 stdenv.mkDerivation rec {
@@ -11,10 +11,10 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ libusb1 ]
-    ++ stdenv.lib.optional stdenv.isLinux libraw1394
-    ++ stdenv.lib.optional stdenv.isDarwin CoreServices;
+    ++ lib.optional stdenv.isLinux libraw1394
+    ++ lib.optional stdenv.isDarwin CoreServices;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://sourceforge.net/projects/libdc1394/";
     description = "Capture and control API for IIDC compliant cameras";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libde265/default.nix b/nixpkgs/pkgs/development/libraries/libde265/default.nix
index 6c2f3b8e1071..bbbcdc3f0544 100644
--- a/nixpkgs/pkgs/development/libraries/libde265/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libde265/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config }:
 
 stdenv.mkDerivation rec {
   version = "1.0.8";
@@ -11,16 +11,16 @@ stdenv.mkDerivation rec {
     sha256 = "1dzflqbk248lz5ws0ni5acmf32b3rmnq5gsfaz7691qqjxkl1zml";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
   enableParallelBuilding = true;
 
   meta = {
     homepage = "https://github.com/strukturag/libde265";
     description = "Open h.265 video codec implementation";
-    license = stdenv.lib.licenses.lgpl3;
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ gebner ];
+    license = lib.licenses.lgpl3;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ gebner ];
   };
 
 }
diff --git a/nixpkgs/pkgs/development/libraries/libdevil/default.nix b/nixpkgs/pkgs/development/libraries/libdevil/default.nix
index 5d00d6b01ff3..fa48c773dfc9 100644
--- a/nixpkgs/pkgs/development/libraries/libdevil/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdevil/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, libjpeg, libpng, libmng, lcms1, libtiff, openexr, libGL
-, libX11, pkgconfig, OpenGL
+{ lib, stdenv, fetchurl, libjpeg, libpng, libmng, lcms1, libtiff, openexr, libGL
+, libX11, pkg-config, OpenGL
 }:
 
 stdenv.mkDerivation rec {
@@ -15,15 +15,15 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   buildInputs = [ libjpeg libpng libmng lcms1 libtiff openexr libGL libX11 ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ OpenGL ];
-  nativeBuildInputs = [ pkgconfig ];
+    ++ 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
-  '' + stdenv.lib.optionalString stdenv.cc.isClang ''
+  '' + lib.optionalString stdenv.cc.isClang ''
     sed -i 's/libIL_la_CXXFLAGS = $(AM_CFLAGS)/libIL_la_CXXFLAGS =/g' lib/Makefile.in
   '';
 
@@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libdigidoc/default.nix b/nixpkgs/pkgs/development/libraries/libdigidoc/default.nix
index 5936853dcbcb..7ee268e4e7d9 100644
--- a/nixpkgs/pkgs/development/libraries/libdigidoc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdigidoc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, openssl, pcsclite, opensc, libxml2, Security }:
+{ lib, stdenv, fetchurl, cmake, openssl, pcsclite, opensc, libxml2, Security }:
 
 stdenv.mkDerivation rec {
 
@@ -13,11 +13,11 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
 
   buildInputs = [ openssl pcsclite opensc libxml2 ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ Security ];
+    ++ lib.optionals stdenv.isDarwin [ Security ];
 
-  cmakeFlags = stdenv.lib.optionals stdenv.isDarwin [ "-DFRAMEWORK=OFF" ];
+  cmakeFlags = lib.optionals stdenv.isDarwin [ "-DFRAMEWORK=OFF" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for creating DigiDoc signature files";
     homepage = "https://github.com/open-eid/libdigidoc";
     license = licenses.lgpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libdigidocpp/default.nix b/nixpkgs/pkgs/development/libraries/libdigidocpp/default.nix
index d966631dc276..f7170fa7f103 100644
--- a/nixpkgs/pkgs/development/libraries/libdigidocpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdigidocpp/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, cmake, libdigidoc, minizip, pcsclite, opensc, openssl
-, xercesc, xml-security-c, pkgconfig, xsd, zlib, xalanc, xxd }:
+{ 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.4";
@@ -10,14 +10,14 @@ stdenv.mkDerivation rec {
      sha256 = "1x72icq5lp5cfv6kyxqc3863wa164s0g41nbi6gldr8syprzdk1l";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig xxd ];
+  nativeBuildInputs = [ cmake pkg-config xxd ];
 
   buildInputs = [
     libdigidoc minizip pcsclite opensc openssl xercesc
     xml-security-c xsd zlib xalanc
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for creating DigiDoc signature files";
     homepage = "http://www.id.ee/";
     license = licenses.lgpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libdiscid/default.nix b/nixpkgs/pkgs/development/libraries/libdiscid/default.nix
index 698aac87b892..3021aced93f6 100644
--- a/nixpkgs/pkgs/development/libraries/libdiscid/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdiscid/default.nix
@@ -1,21 +1,21 @@
-{ stdenv, fetchurl, cmake, pkgconfig, darwin }:
+{ lib, stdenv, fetchurl, cmake, pkg-config, darwin }:
 
 stdenv.mkDerivation rec {
   pname = "libdiscid";
   version = "0.6.2";
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
+
+  buildInputs = lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.IOKit ];
 
-  buildInputs = stdenv.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 = stdenv.lib.optionalString stdenv.isDarwin "-framework CoreFoundation -framework IOKit";
+  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-framework CoreFoundation -framework IOKit";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A C library for creating MusicBrainz DiscIDs from audio CDs";
     homepage = "http://musicbrainz.org/doc/libdiscid";
     maintainers = with maintainers; [ ehmry ];
diff --git a/nixpkgs/pkgs/development/libraries/libdivecomputer/default.nix b/nixpkgs/pkgs/development/libraries/libdivecomputer/default.nix
index 5f9417bd03c8..0f65a5cee5ce 100644
--- a/nixpkgs/pkgs/development/libraries/libdivecomputer/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdivecomputer/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "libdivecomputer";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/libdivsufsort/default.nix b/nixpkgs/pkgs/development/libraries/libdivsufsort/default.nix
index 0d82db7cee4e..0f332f8ac74c 100644
--- a/nixpkgs/pkgs/development/libraries/libdivsufsort/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdivsufsort/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation {
   name = "libdivsufsort-2.0.1";
@@ -10,8 +10,8 @@ stdenv.mkDerivation {
 
   meta = {
     homepage = "https://github.com/y-256/libdivsufsort";
-    license = stdenv.lib.licenses.mit;
+    license = lib.licenses.mit;
     description = "Library to construct the suffix array and the BW transformed string";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libdmtx/default.nix b/nixpkgs/pkgs/development/libraries/libdmtx/default.nix
index 0bdf3fbe15a0..994f010252fd 100644
--- a/nixpkgs/pkgs/development/libraries/libdmtx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdmtx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig }:
+{ lib, stdenv, fetchurl, pkg-config }:
 
 stdenv.mkDerivation rec {
   name = "libdmtx-0.7.4";
@@ -8,13 +8,13 @@ stdenv.mkDerivation rec {
     sha256 = "0xnxx075ycy58n92yfda2z9zgd41h3d4ik5d9l197lzsqim5hb5n";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   meta = {
     description = "An open source software for reading and writing Data Matrix barcodes";
     homepage = "http://libdmtx.org";
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
     maintainers = [ ];
-    license = stdenv.lib.licenses.bsd2;
+    license = lib.licenses.bsd2;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libdnet/default.nix b/nixpkgs/pkgs/development/libraries/libdnet/default.nix
index 176e0a22abaf..43d9d2077fe3 100644
--- a/nixpkgs/pkgs/development/libraries/libdnet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdnet/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, automake, autoconf, libtool}:
+{lib, stdenv, fetchurl, automake, autoconf, libtool}:
 
 stdenv.mkDerivation {
   name = "libdnet-1.12";
@@ -22,8 +22,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Provides a simplified, portable interface to several low-level networking routines";
     homepage = "https://github.com/dugsong/libdnet";
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = [stdenv.lib.maintainers.marcweber];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.bsd3;
+    maintainers = [lib.maintainers.marcweber];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libdrm/default.nix b/nixpkgs/pkgs/development/libraries/libdrm/default.nix
index b9825d9cfdff..3b5daad854c2 100644
--- a/nixpkgs/pkgs/development/libraries/libdrm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdrm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, pkgconfig, meson, ninja, libpthreadstubs, libpciaccess
+{ stdenv, lib, fetchurl, pkg-config, meson, ninja, libpthreadstubs, libpciaccess
 , withValgrind ? valgrind-light.meta.available, valgrind-light, fetchpatch
 }:
 
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "bin" ];
 
-  nativeBuildInputs = [ pkgconfig meson ninja ];
+  nativeBuildInputs = [ pkg-config meson ninja ];
   buildInputs = [ libpthreadstubs libpciaccess ]
     ++ lib.optional withValgrind valgrind-light;
 
diff --git a/nixpkgs/pkgs/development/libraries/libdv/default.nix b/nixpkgs/pkgs/development/libraries/libdv/default.nix
index ed1e2cd74a3b..ff3c7f6f8631 100644
--- a/nixpkgs/pkgs/development/libraries/libdv/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdv/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, popt }:
+{ lib, stdenv, fetchurl, popt }:
 
 stdenv.mkDerivation rec {
   name = "libdv-1.0.0";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   # 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 = stdenv.lib.optionalString stdenv.isDarwin "-undefined dynamic_lookup";
+  LDFLAGS = lib.optionalString stdenv.isDarwin "-undefined dynamic_lookup";
 
   configureFlags = [
     "--disable-asm"
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ popt ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libdvbpsi/default.nix b/nixpkgs/pkgs/development/libraries/libdvbpsi/default.nix
index 327aacb6f37e..5d539a7a4882 100644
--- a/nixpkgs/pkgs/development/libraries/libdvbpsi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdvbpsi/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   pname = "libdvbpsi";
@@ -12,8 +12,8 @@ stdenv.mkDerivation rec {
   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 = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.lgpl21;
+    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
index f097aad702ae..278e3d60d906 100644
--- a/nixpkgs/pkgs/development/libraries/libdvdcss/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdvdcss/default.nix
@@ -1,17 +1,17 @@
-{stdenv, fetchurl, IOKit}:
+{lib, stdenv, fetchurl, IOKit}:
 
 stdenv.mkDerivation rec {
   pname = "libdvdcss";
   version = "1.4.2";
 
-  buildInputs = stdenv.lib.optional stdenv.isDarwin IOKit;
+  buildInputs = lib.optional stdenv.isDarwin IOKit;
 
   src = fetchurl {
     url = "http://get.videolan.org/libdvdcss/${version}/${pname}-${version}.tar.bz2";
     sha256 = "0x957zzpf4w2cp8zlk29prj8i2q6hay3lzdzsyz8y3cwxivyvhkq";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.videolan.org/developers/libdvdcss.html";
     description = "A library for decrypting DVDs";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libdvdnav/4.2.1.nix b/nixpkgs/pkgs/development/libraries/libdvdnav/4.2.1.nix
index c8ebf180b315..1f832de5bb3b 100644
--- a/nixpkgs/pkgs/development/libraries/libdvdnav/4.2.1.nix
+++ b/nixpkgs/pkgs/development/libraries/libdvdnav/4.2.1.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, pkgconfig, libdvdread}:
+{lib, stdenv, fetchurl, pkg-config, libdvdread}:
 
 stdenv.mkDerivation {
   name = "libdvdnav-4.2.1";
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
     sha256 = "7fca272ecc3241b6de41bbbf7ac9a303ba25cb9e0c82aa23901d3104887f2372";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [libdvdread];
 
   configureScript = "./configure2"; # wtf?
@@ -20,9 +20,9 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://dvdnav.mplayerhq.hu/";
     description = "A library that implements DVD navigation features such as DVD menus";
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = [ stdenv.lib.maintainers.wmertens ];
-    platforms = stdenv.lib.platforms.linux;
+    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
index 2afc11c60095..3eb1032b2a79 100644
--- a/nixpkgs/pkgs/development/libraries/libdvdnav/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdvdnav/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, pkgconfig, libdvdread}:
+{lib, stdenv, fetchurl, pkg-config, libdvdread}:
 
 stdenv.mkDerivation rec {
   pname = "libdvdnav";
@@ -9,15 +9,15 @@ stdenv.mkDerivation rec {
     sha256 = "0nzf1ir27s5vs1jrisdiw9ag2sc160k3gv7nplv9ypppm5gb35zn";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [libdvdread];
 
   meta = {
     homepage = "http://dvdnav.mplayerhq.hu/";
     description = "A library that implements DVD navigation features such as DVD menus";
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = [ stdenv.lib.maintainers.wmertens ];
-    platforms = stdenv.lib.platforms.unix;
+    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
index 33b04b0f7c03..7049e1dd9935 100644
--- a/nixpkgs/pkgs/development/libraries/libdvdread/4.9.9.nix
+++ b/nixpkgs/pkgs/development/libraries/libdvdread/4.9.9.nix
@@ -1,8 +1,8 @@
-{stdenv, fetchurl, libdvdcss}:
+{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";
@@ -19,8 +19,8 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://dvdnav.mplayerhq.hu/";
     description = "A library for reading DVDs";
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = [ stdenv.lib.maintainers.wmertens ];
-    platforms = stdenv.lib.platforms.linux;
+    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
index 997018a29709..32dfe4ee0fa5 100644
--- a/nixpkgs/pkgs/development/libraries/libdvdread/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdvdread/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, libdvdcss}:
+{lib, stdenv, fetchurl, libdvdcss}:
 
 stdenv.mkDerivation rec {
   pname = "libdvdread";
@@ -20,8 +20,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://dvdnav.mplayerhq.hu/";
     description = "A library for reading DVDs";
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = [ stdenv.lib.maintainers.wmertens ];
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    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
index ba4ebaec111a..0d512b04201a 100644
--- a/nixpkgs/pkgs/development/libraries/libdwarf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdwarf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libelf, zlib }:
+{ lib, stdenv, fetchurl, libelf, zlib }:
 
 let
   version = "20181024";
@@ -11,8 +11,8 @@ let
   };
   meta = {
     homepage = "https://www.prevanders.net/dwarf.html";
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.lgpl21Plus;
+    platforms = lib.platforms.linux;
+    license = lib.licenses.lgpl21Plus;
   };
 
 in rec {
diff --git a/nixpkgs/pkgs/development/libraries/libdwg/default.nix b/nixpkgs/pkgs/development/libraries/libdwg/default.nix
index 9b1aa3132e93..5a0347e59542 100644
--- a/nixpkgs/pkgs/development/libraries/libdwg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdwg/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, indent}:
+{lib, stdenv, fetchurl, indent}:
 
 stdenv.mkDerivation {
   name = "libdwg-0.6";
@@ -18,8 +18,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Library reading dwg files";
     homepage = "http://libdwg.sourceforge.net/en/";
-    license = stdenv.lib.licenses.gpl3;
-    maintainers = [stdenv.lib.maintainers.marcweber];
-    platforms = stdenv.lib.platforms.linux;
+    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
index cc9018421feb..4f1fd3904d98 100644
--- a/nixpkgs/pkgs/development/libraries/libdynd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libdynd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 let version = "0.7.2"; in
 stdenv.mkDerivation {
@@ -26,12 +26,12 @@ stdenv.mkDerivation {
     "-Wno-error=deprecated-copy"
   ];
 
-  buildInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   outputs = [ "out" "dev" ];
   outputDoc = "dev";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ dynamic ndarray library, with Python exposure";
     homepage = "http://libdynd.org";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/libe-book/default.nix b/nixpkgs/pkgs/development/libraries/libe-book/default.nix
index 805b1869ac38..f467a01ea7ab 100644
--- a/nixpkgs/pkgs/development/libraries/libe-book/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libe-book/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gperf, pkgconfig, librevenge, libxml2, boost, icu
+{ lib, stdenv, fetchurl, gperf, pkg-config, librevenge, libxml2, boost, icu
 , cppunit, zlib, liblangtag
 }:
 
@@ -13,7 +13,7 @@ let
     sha256="1yg1vws1wggzhjw672bpgh2x541g5i9wryf67g51m0r79zrqz3by";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [
     gperf librevenge libxml2 boost icu cppunit zlib liblangtag
   ];
@@ -33,9 +33,9 @@ stdenv.mkDerivation {
   NIX_CFLAGS_COMPILE = "-Wno-error=unused-function";
   meta = {
     inherit (s) version;
-    description = ''Library for import of reflowable e-book formats'';
-    license = stdenv.lib.licenses.lgpl21Plus ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.unix;
+    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/libe57format/default.nix b/nixpkgs/pkgs/development/libraries/libe57format/default.nix
index 137c73990f6a..49b75906bdbc 100644
--- a/nixpkgs/pkgs/development/libraries/libe57format/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libe57format/default.nix
@@ -1,5 +1,5 @@
 {
-  stdenv,
+  lib, stdenv,
   cmake,
   fetchFromGitHub,
   boost,
@@ -78,7 +78,7 @@ stdenv.mkDerivation rec {
     fi
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for reading & writing the E57 file format (fork of E57RefImpl)";
     homepage = "https://github.com/asmaloney/libE57Format";
     license = licenses.boost;
diff --git a/nixpkgs/pkgs/development/libraries/libeatmydata/default.nix b/nixpkgs/pkgs/development/libraries/libeatmydata/default.nix
index da7a186bea6f..70fab2da5688 100644
--- a/nixpkgs/pkgs/development/libraries/libeatmydata/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libeatmydata/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, strace, which }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, strace, which }:
 
 stdenv.mkDerivation rec {
   pname = "libeatmydata";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     autoreconfHook
-  ] ++ stdenv.lib.optionals doCheck [ strace which ];
+  ] ++ 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
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Small LD_PRELOAD library to disable fsync and friends";
     homepage = "https://www.flamingspork.com/projects/libeatmydata/";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libeb/default.nix b/nixpkgs/pkgs/development/libraries/libeb/default.nix
index 2fdb1d071b62..fe0011f9c997 100644
--- a/nixpkgs/pkgs/development/libraries/libeb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libeb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, zlib }:
+{ lib, stdenv, fetchurl, perl, zlib }:
 stdenv.mkDerivation rec {
   pname = "libeb";
   version = "4.4.3";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ perl ];
   buildInputs = [ zlib ];
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libebml/default.nix b/nixpkgs/pkgs/development/libraries/libebml/default.nix
index 29c4b4c3b09f..5a8f1f003165 100644
--- a/nixpkgs/pkgs/development/libraries/libebml/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libebml/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig }:
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "libebml";
@@ -11,13 +11,13 @@ stdenv.mkDerivation rec {
     sha256 = "052v4mjynndj9xgfl4lmlsnx9ai0pah0kjyr5fm34l7gj8vhc5s7";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
   cmakeFlags = [
     "-DBUILD_SHARED_LIBS=YES"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Extensible Binary Meta Language library";
     homepage = "https://dl.matroska.org/downloads/libebml/";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libebur128/default.nix b/nixpkgs/pkgs/development/libraries/libebur128/default.nix
index cb5291922989..ba4f84f8c803 100644
--- a/nixpkgs/pkgs/development/libraries/libebur128/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libebur128/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, speexdsp, pkgconfig }:
+{ lib, stdenv, fetchFromGitHub, cmake, speexdsp, pkg-config }:
 
 stdenv.mkDerivation rec {
   version = "1.2.4";
@@ -11,10 +11,10 @@ stdenv.mkDerivation rec {
     sha256 = "0n81rnm8dm1zmibkr2v3q79rsd609y0dbbsrbay18njcjva88p0g";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ cmake speexdsp ];
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ speexdsp ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Implementation of the EBU R128 loudness standard";
     homepage = "https://github.com/jiixyj/libebur128";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libechonest/default.nix b/nixpkgs/pkgs/development/libraries/libechonest/default.nix
index cde046bf1327..29a0a63a03e7 100644
--- a/nixpkgs/pkgs/development/libraries/libechonest/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libechonest/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, cmake, doxygen, qt4, qjson }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, doxygen, qt4, qjson }:
 
 stdenv.mkDerivation rec {
   pname = "libechonest";
@@ -25,13 +25,12 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake doxygen ];
   buildInputs = [ qt4 qjson ];
 
-  enableParallelBuilding = true;
   doCheck = false; # requires network access
 
   meta = {
     description = "A C++/Qt wrapper around the Echo Nest API";
     homepage = "https://projects.kde.org/projects/playground/libs/libechonest";
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libedit/default.nix b/nixpkgs/pkgs/development/libraries/libedit/default.nix
index 09bd41dbed0b..92f3eeb79957 100644
--- a/nixpkgs/pkgs/development/libraries/libedit/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libedit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ncurses }:
+{ lib, stdenv, fetchurl, ncurses }:
 
 stdenv.mkDerivation rec {
   pname = "libedit";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
       -e 's,-lncurses[a-z]*,-L${ncurses.out}/lib -lncursesw,g'
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.thrysoee.dk/editline/";
     description = "A port of the NetBSD Editline library (libedit)";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libee/default.nix b/nixpkgs/pkgs/development/libraries/libee/default.nix
index 36d88f88786d..7172df01e223 100644
--- a/nixpkgs/pkgs/development/libraries/libee/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libee/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libestr }:
+{ lib, stdenv, fetchurl, pkg-config, libestr }:
 stdenv.mkDerivation {
   name = "libee-0.4.1";
 
@@ -7,13 +7,13 @@ stdenv.mkDerivation {
     sha256 = "09xhgzmsq0g3jsyj24vy67bhzk2fv971w5ixdkhfwgar70cw1nn0";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libestr];
 
   meta = {
     homepage = "http://www.libee.org/";
     description = "An Event Expression Library inspired by CEE";
-    platforms = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.lgpl21Plus;
+    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
index 635070512073..c3a4986c8321 100644
--- a/nixpkgs/pkgs/development/libraries/libelf-freebsd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libelf-freebsd/default.nix
@@ -6,7 +6,7 @@ stdenv.mkDerivation (rec {
 
   src = fetchsvn {
     url = "svn://svn.code.sf.net/p/elftoolchain/code/trunk";
-    rev = (stdenv.lib.strings.toInt version);
+    rev = (lib.strings.toInt version);
     name = "elftoolchain-${version}";
   };
 
@@ -29,9 +29,9 @@ stdenv.mkDerivation (rec {
 
     homepage = "https://sourceforge.net/p/elftoolchain/wiki/Home/";
 
-    license = stdenv.lib.licenses.bsd2;
+    license = lib.licenses.bsd2;
 
-    platforms = stdenv.lib.platforms.freebsd;
+    platforms = lib.platforms.freebsd;
     maintainers = [ ];
   };
 })
diff --git a/nixpkgs/pkgs/development/libraries/libelf/default.nix b/nixpkgs/pkgs/development/libraries/libelf/default.nix
index 2b56f973b5db..2b8cd51ba5f6 100644
--- a/nixpkgs/pkgs/development/libraries/libelf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libelf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl, autoreconfHook, gettext
 }:
 
@@ -27,26 +27,26 @@ stdenv.mkDerivation rec {
   configureFlags = []
        # Configure check for dynamic lib support is broken, see
        # http://lists.uclibc.org/pipermail/uclibc-cvs/2005-August/019383.html
-    ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "mr_cv_target_elf=yes"
+    ++ 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.
-    ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin "--disable-nls";
+    ++ lib.optional stdenv.hostPlatform.isDarwin "--disable-nls";
 
   nativeBuildInputs = [ gettext ]
        # Need to regenerate configure script with newer version in order to pass
        # "mr_cv_target_elf=yes", but `autoreconfHook` brings in `makeWrapper`
        # which doesn't work with the bootstrapTools bash, so can only do this
        # for cross builds when `stdenv.shell` is a newer bash.
-    ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) autoreconfHook;
+    ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) autoreconfHook;
 
   meta = {
     description = "ELF object file access library";
 
     homepage = "https://github.com/Distrotech/libelf";
 
-    license = stdenv.lib.licenses.lgpl2Plus;
+    license = lib.licenses.lgpl2Plus;
 
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
     maintainers = [ ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libelfin/default.nix b/nixpkgs/pkgs/development/libraries/libelfin/default.nix
index 8a8de854fc90..950639850db5 100644
--- a/nixpkgs/pkgs/development/libraries/libelfin/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libelfin/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, python3, substituteAll }:
+{ lib, stdenv, fetchFromGitHub, python3, substituteAll }:
 
 stdenv.mkDerivation rec {
   pname = "libelfin";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "PREFIX=${placeholder "out"}" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/aclements/libelfin/";
     license = licenses.mit;
     description = "C++11 ELF/DWARF parser";
diff --git a/nixpkgs/pkgs/development/libraries/libepc/default.nix b/nixpkgs/pkgs/development/libraries/libepc/default.nix
index b8b28f49d1d5..ee8dfb6e94f7 100644
--- a/nixpkgs/pkgs/development/libraries/libepc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libepc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, intltool, gtk-doc, glib, avahi, gnutls, libuuid, libsoup, gtk3, gnome3 }:
+{ lib, stdenv, fetchurl, pkg-config, intltool, gtk-doc, glib, avahi, gnutls, libuuid, libsoup, gtk3, gnome3 }:
 
 let
   avahiWithGtk = avahi.override { gtk3Support = true; };
@@ -9,12 +9,12 @@ in stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1s3svb2slqjsrqfv50c2ymnqcijcxb5gnx6bfibwh9l5ga290n91";
   };
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     intltool
     gtk-doc
   ];
@@ -37,7 +37,7 @@ in stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Easy Publish and Consume Library";
     homepage = "https://wiki.gnome.org/Projects/libepc";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/liberfa/default.nix b/nixpkgs/pkgs/development/libraries/liberfa/default.nix
index a1ca15536da6..8ffd86cd3169 100644
--- a/nixpkgs/pkgs/development/libraries/liberfa/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liberfa/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "erfa";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--enable-shared" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Essential Routines for Fundamental Astronomy";
     homepage = "https://github.com/liberfa/erfa";
     maintainers = with maintainers; [ mir06 ];
diff --git a/nixpkgs/pkgs/development/libraries/liberio/default.nix b/nixpkgs/pkgs/development/libraries/liberio/default.nix
index b4023d5f36a9..743455b836d5 100644
--- a/nixpkgs/pkgs/development/libraries/liberio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liberio/default.nix
@@ -1,4 +1,5 @@
 { stdenv
+, lib
 , fetchFromGitHub
 , autoreconfHook
 , systemd
@@ -27,7 +28,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Ettus Research DMA I/O Library";
     homepage = "https://github.com/EttusResearch/liberio";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libesmtp/default.nix b/nixpkgs/pkgs/development/libraries/libesmtp/default.nix
index e5a7f5609a38..542cff712c82 100644
--- a/nixpkgs/pkgs/development/libraries/libesmtp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libesmtp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   pname = "libESMTP";
@@ -9,7 +9,7 @@ stdenv.mkDerivation {
     sha256 = "02zbniyz7qys1jmx3ghx21kxmns1wc3hmv80gp7ag7yra9f1m9nh";
   };
 
-  meta = with stdenv.lib; {
+  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
index add7ea00a980..8699e83d0fd0 100644
--- a/nixpkgs/pkgs/development/libraries/libestr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libestr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "libestr-0.1.11";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0910ifzcs8kpd3srrr4fvbacgh2zrc6yn7i4rwfj6jpzhlkjnqs6";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://libestr.adiscon.com/";
     description = "Some essentials for string handling";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libetpan/default.nix b/nixpkgs/pkgs/development/libraries/libetpan/default.nix
index 9050320773af..b4b48dcb777d 100644
--- a/nixpkgs/pkgs/development/libraries/libetpan/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libetpan/default.nix
@@ -1,31 +1,29 @@
-{ stdenv, fetchFromGitHub
-, autoconf
-, automake
-, libtool
-, openssl
+{ stdenv, lib, fetchFromGitHub
+, autoconf, automake, libtool, openssl, pkg-config
 }:
 
 stdenv.mkDerivation rec {
   pname = "libetpan";
-  version = "1.9.3";
+  version = "1.9.4";
 
   src = fetchFromGitHub {
     owner = "dinhviethoa";
     repo = "libetpan";
     rev = version;
-    sha256 = "19g4qskg71jv7sxfxsdkjmrxk9mk5kf9b6fhw06g6wvm3205n95f";
+    sha256 = "0g7an003simfdn7ihg9yjv7hl2czsmjsndjrp39i7cad8icixscn";
   };
 
-  nativeBuildInputs = [ libtool autoconf automake ];
+  nativeBuildInputs = [ autoconf automake libtool pkg-config ];
 
   buildInputs = [ openssl ];
 
   configureScript = "./autogen.sh";
 
-  meta = with stdenv.lib; {
-    description = "An efficient, portable library for different kinds of mail access: IMAP, SMTP, POP, and NNTP";
+  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
index 1ea0615dc234..750cb3974cf7 100644
--- a/nixpkgs/pkgs/development/libraries/libev/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libev/default.nix
@@ -1,4 +1,7 @@
-{ stdenv, fetchurl, static ? false }:
+{ 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
@@ -14,12 +17,12 @@ stdenv.mkDerivation rec {
     sha256 = "1sjs4324is7fp21an4aas2z4dwsvs6z4xwrmp72vwpq1s6wbfzjh";
   };
 
-  configureFlags = stdenv.lib.optional (static) "LDFLAGS=-static";
+  configureFlags = lib.optional (static) "LDFLAGS=-static";
 
   meta = {
     description = "A high-performance event loop/event model with lots of features";
-    maintainers = [ stdenv.lib.maintainers.raskin ];
-    platforms = stdenv.lib.platforms.all;
-    license = stdenv.lib.licenses.bsd2; # or GPL2+
+    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
index ba846ed07db2..daae6984ab25 100644
--- a/nixpkgs/pkgs/development/libraries/libevdev/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libevdev/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, python3 }:
+{ lib, stdenv, fetchurl, fetchpatch, python3 }:
 
 stdenv.mkDerivation rec {
   pname = "libevdev";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ python3 ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Wrapper library for evdev devices";
     homepage = "http://www.freedesktop.org/software/libevdev/doc/latest/index.html";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libevdevplus/default.nix b/nixpkgs/pkgs/development/libraries/libevdevplus/default.nix
index 0f2b3e052665..66c5f1b06964 100644
--- a/nixpkgs/pkgs/development/libraries/libevdevplus/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libevdevplus/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig }:
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "libevdevplus";
@@ -11,9 +11,9 @@ stdenv.mkDerivation rec {
     sha256 = "18z6pn4j7fhmwwh0q22ip5nn7sc1hfgwvkdzqhkja60i8cw2cvvj";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit (src.meta) homepage;
     description = "Easy-to-use event device library in C++";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libevent/default.nix b/nixpkgs/pkgs/development/libraries/libevent/default.nix
index cbde32067172..b33e94114f63 100644
--- a/nixpkgs/pkgs/development/libraries/libevent/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libevent/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, findutils, fixDarwinDylibNames
+{ lib, stdenv, fetchurl, findutils, fixDarwinDylibNames
 , sslSupport? true, openssl
 }:
 
@@ -16,25 +16,25 @@ stdenv.mkDerivation rec {
   # libevent_openssl is moved into its own output, so that openssl isn't present
   # in the default closure.
   outputs = [ "out" "dev" ]
-    ++ stdenv.lib.optional sslSupport "openssl"
+    ++ lib.optional sslSupport "openssl"
     ;
   outputBin = "dev";
   propagatedBuildOutputs = [ "out" ]
-    ++ stdenv.lib.optional sslSupport "openssl"
+    ++ lib.optional sslSupport "openssl"
     ;
 
   nativeBuildInputs = []
-    ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames
+    ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames
     ;
 
   buildInputs = []
-    ++ stdenv.lib.optional sslSupport openssl
-    ++ stdenv.lib.optional stdenv.isCygwin findutils
+    ++ lib.optional sslSupport openssl
+    ++ lib.optional stdenv.isCygwin findutils
     ;
 
   doCheck = false; # needs the net
 
-  postInstall = stdenv.lib.optionalString sslSupport ''
+  postInstall = lib.optionalString sslSupport ''
     moveToOutput "lib/libevent_openssl*" "$openssl"
     substituteInPlace "$dev/lib/pkgconfig/libevent_openssl.pc" \
       --replace "$out" "$openssl"
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Event notification library";
     longDescription = ''
       The libevent API provides a mechanism to execute a callback function
diff --git a/nixpkgs/pkgs/development/libraries/libewf/default.nix b/nixpkgs/pkgs/development/libraries/libewf/default.nix
index ff644599b8a6..f38f09410ff1 100644
--- a/nixpkgs/pkgs/development/libraries/libewf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libewf/default.nix
@@ -1,23 +1,23 @@
-{ fetchurl, stdenv, zlib, openssl, libuuid, pkgconfig }:
+{ fetchurl, lib, stdenv, zlib, openssl, libuuid, pkg-config }:
 
 stdenv.mkDerivation rec {
-  version = "20201129";
+  version = "20201210";
   pname = "libewf";
 
   src = fetchurl {
     url = "https://github.com/libyal/libewf/releases/download/${version}/libewf-experimental-${version}.tar.gz";
-    sha256 = "168k1az9hm0lajh57zlbknsq5m8civ1rzp81zz4sd7v64xilzxdk";
+    sha256 = "sha256-dI1We2bsBRDcyqd6HLC7eBE99dpzSkhHtNgt0ZE4aDc=";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  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 = stdenv.lib.licenses.lgpl3;
-    maintainers = [ stdenv.lib.maintainers.raskin ] ;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.lgpl3;
+    maintainers = [ lib.maintainers.raskin ] ;
+    platforms = lib.platforms.unix;
     inherit version;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libexecinfo/default.nix b/nixpkgs/pkgs/development/libraries/libexecinfo/default.nix
index feee754590b6..f3f89209707a 100644
--- a/nixpkgs/pkgs/development/libraries/libexecinfo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libexecinfo/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch
+{ lib, stdenv, fetchurl, fetchpatch
 , enableStatic ? true
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
@@ -33,21 +33,21 @@ stdenv.mkDerivation rec {
   makeFlags = [ "CC:=$(CC)" "AR:=$(AR)" ];
 
   buildFlags =
-      stdenv.lib.optional enableStatic "static"
-   ++ stdenv.lib.optional enableShared "dynamic";
+      lib.optional enableStatic "static"
+   ++ lib.optional enableShared "dynamic";
 
   patchFlags = [ "-p0" ];
 
   installPhase = ''
     install -Dm644 execinfo.h stacktraverse.h -t $out/include
-  '' + stdenv.lib.optionalString enableShared ''
+  '' + lib.optionalString enableShared ''
     install -Dm755 libexecinfo.so.1 -t $out/lib
     ln -s $out/lib/libexecinfo.so{.1,}
-  '' + stdenv.lib.optionalString enableStatic ''
+  '' + lib.optionalString enableStatic ''
     install -Dm755 libexecinfo.a -t $out/lib
   '';
 
-  meta = with stdenv.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";
diff --git a/nixpkgs/pkgs/development/libraries/libexif/default.nix b/nixpkgs/pkgs/development/libraries/libexif/default.nix
index a0f831e927ef..20e69c4ad664 100644
--- a/nixpkgs/pkgs/development/libraries/libexif/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libexif/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, gettext }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, gettext }:
 
 stdenv.mkDerivation rec {
   pname = "libexif";
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook gettext ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://libexif.github.io/";
     description = "A library to read and manipulate EXIF data in digital photographs";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libextractor/default.nix b/nixpkgs/pkgs/development/libraries/libextractor/default.nix
index f7e9606bbe77..59916bfb33f7 100644
--- a/nixpkgs/pkgs/development/libraries/libextractor/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libextractor/default.nix
@@ -1,6 +1,6 @@
-{ fetchurl, stdenv, substituteAll
+{ fetchurl, lib, stdenv, substituteAll
 , libtool, gettext, zlib, bzip2, flac, libvorbis
-, exiv2, libgsf, rpm, pkgconfig, fetchpatch
+, exiv2, libgsf, rpm, pkg-config, fetchpatch
 , 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%).
@@ -41,12 +41,12 @@ stdenv.mkDerivation rec {
       sha256 = "01xhcjbzv6p53wz7y2ii76kb8m9iwvnm4ip9w4a0bpgaxqz4b9fw";
       excludes = [ "ChangeLog" ];
     })
-  ] ++ stdenv.lib.optionals gstreamerSupport [
+  ] ++ 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 = stdenv.lib.concatMapStrings
+      load_gst_plugins = lib.concatMapStrings
         (plugin: ''gst_registry_scan_path(gst_registry_get(), "${plugin}/lib/gstreamer-1.0");'')
         (gstPlugins gst_all_1);
     })
@@ -61,11 +61,11 @@ stdenv.mkDerivation rec {
   buildInputs =
    [ libtool gettext zlib bzip2 flac libvorbis exiv2
      libgsf rpm
-     pkgconfig
-   ] ++ stdenv.lib.optionals gstreamerSupport
+     pkg-config
+   ] ++ lib.optionals gstreamerSupport
           ([ gst_all_1.gstreamer ] ++ gstPlugins gst_all_1)
-     ++ stdenv.lib.optionals gtkSupport [ glib gtk3 ]
-     ++ stdenv.lib.optionals videoSupport [ ffmpeg_3 libmpeg2 ];
+     ++ lib.optionals gtkSupport [ glib gtk3 ]
+     ++ lib.optionals videoSupport [ ffmpeg_3 libmpeg2 ];
 
   configureFlags = [
     "--disable-ltdl-install"
@@ -105,9 +105,9 @@ stdenv.mkDerivation rec {
          additional MIME types are detected.
       '';
 
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libexttextcat/default.nix b/nixpkgs/pkgs/development/libraries/libexttextcat/default.nix
index 3adb606dd2d5..8e5cc8685da9 100644
--- a/nixpkgs/pkgs/development/libraries/libexttextcat/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libexttextcat/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "libexttextcat-3.4.5";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1j6sjwkyhqvsgyw938bxxfwkzzi1mahk66g5342lv6j89jfvrz8k";
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libf2c/default.nix b/nixpkgs/pkgs/development/libraries/libf2c/default.nix
index 66b193d4ea8d..85ff493ca04e 100644
--- a/nixpkgs/pkgs/development/libraries/libf2c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libf2c/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, unzip}:
+{lib, stdenv, fetchurl, unzip}:
 
 stdenv.mkDerivation rec {
   name = "libf2c-20160102";
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "F2c converts Fortran 77 source code to C";
     homepage = "http://www.netlib.org/f2c/";
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.unix;
+    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
index f95d150cc250..3e568759c1bc 100644
--- a/nixpkgs/pkgs/development/libraries/libfakekey/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfakekey/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libX11, libXi, libXtst, pkgconfig, xorgproto }:
+{ lib, stdenv, fetchurl, libX11, libXi, libXtst, pkg-config, xorgproto }:
 
 stdenv.mkDerivation rec {
   pname = "libfakekey";
@@ -9,11 +9,11 @@ stdenv.mkDerivation rec {
     sha256 = "10msplyn535hmzbmbdnx4zc20hkaw6d81if5lzxs82k8sq2mkx9k";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libX11 libXi libXtst xorgproto ];
   NIX_LDFLAGS = "-lX11";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "X virtual keyboard library";
     homepage = "https://www.yoctoproject.org/tools-resources/projects/matchbox";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libfaketime/default.nix b/nixpkgs/pkgs/development/libraries/libfaketime/default.nix
index 6c751e07b831..170bb116a8a8 100644
--- a/nixpkgs/pkgs/development/libraries/libfaketime/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfaketime/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl }:
+{ lib, stdenv, fetchurl, perl }:
 
 stdenv.mkDerivation rec {
   pname = "libfaketime";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   patches = [
     ./no-date-in-gzip-man-page.patch
-  ] ++ (stdenv.lib.optionals stdenv.cc.isClang [
+  ] ++ (lib.optionals stdenv.cc.isClang [
     # https://github.com/wolfcw/libfaketime/issues/277
     ./0001-Remove-unsupported-clang-flags.patch
   ]);
@@ -27,11 +27,11 @@ stdenv.mkDerivation rec {
   PREFIX = placeholder "out";
   LIBDIRNAME = "/lib";
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=cast-function-type -Wno-error=format-truncation";
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=cast-function-type -Wno-error=format-truncation";
 
   checkInputs = [ perl ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libff/default.nix b/nixpkgs/pkgs/development/libraries/libff/default.nix
index 874f45cae709..72d2406aa82b 100644
--- a/nixpkgs/pkgs/development/libraries/libff/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libff/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, boost, gmp, openssl, pkg-config }:
+{ lib, stdenv, fetchFromGitHub, cmake, boost, gmp, openssl, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "libff";
@@ -16,14 +16,14 @@ stdenv.mkDerivation rec {
 
   # CMake is hardcoded to always build static library which causes linker
   # failure for Haskell applications depending on haskellPackages.hevm on macOS.
-  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace libff/CMakeLists.txt --replace "STATIC" "SHARED"
   '';
 
   nativeBuildInputs = [ cmake pkg-config ];
   buildInputs = [ boost gmp openssl ];
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/libffcall/default.nix b/nixpkgs/pkgs/development/libraries/libffcall/default.nix
index 7fdc04d116ef..8967ec49a094 100644
--- a/nixpkgs/pkgs/development/libraries/libffcall/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libffcall/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "libffcall";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     rm -rf $out/share
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Foreign function call library";
     homepage = "https://www.gnu.org/software/libffcall/";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libffi/default.nix b/nixpkgs/pkgs/development/libraries/libffi/default.nix
index d7dad6d956d7..29b76e34d652 100644
--- a/nixpkgs/pkgs/development/libraries/libffi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libffi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch
+{ lib, stdenv, fetchurl, fetchpatch
 , autoreconfHook
 
 }:
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
 
   dontStrip = stdenv.hostPlatform != stdenv.buildPlatform; # Don't run the native `strip' when cross-compiling.
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A foreign function call interface library";
     longDescription = ''
       The libffi library provides a portable, high level programming
diff --git a/nixpkgs/pkgs/development/libraries/libfido2/default.nix b/nixpkgs/pkgs/development/libraries/libfido2/default.nix
index 48b457b09ded..f44ae4d01f24 100644
--- a/nixpkgs/pkgs/development/libraries/libfido2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfido2/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
 , cmake
-, pkgconfig
+, pkg-config
 , hidapi
 , libcbor
 , openssl
@@ -17,10 +17,10 @@ stdenv.mkDerivation rec {
     sha256 = "08iizxq3w8mpkwfrfpl59csffc20yz8x398bl3kf23rrr4izk42r";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
   buildInputs = [ hidapi libcbor openssl ]
-    ++ stdenv.lib.optionals stdenv.isLinux [ udev ];
+    ++ lib.optionals stdenv.isLinux [ udev ];
 
   cmakeFlags = [
     "-DUDEV_RULES_DIR=${placeholder "out"}/etc/udev/rules.d"
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     "-DCMAKE_INSTALL_LIBDIR=lib"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = ''
     Provides library functionality for FIDO 2.0, including communication with a device over USB.
     '';
diff --git a/nixpkgs/pkgs/development/libraries/libfilezilla/default.nix b/nixpkgs/pkgs/development/libraries/libfilezilla/default.nix
index e5b76b1435fa..daacf325e973 100644
--- a/nixpkgs/pkgs/development/libraries/libfilezilla/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfilezilla/default.nix
@@ -1,31 +1,31 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , autoreconfHook
 , gettext
 , gnutls
 , nettle
-, pkgconfig
+, pkg-config
 , libiconv
 , ApplicationServices
 }:
 
 stdenv.mkDerivation rec {
   pname = "libfilezilla";
-  version = "0.25.0";
+  version = "0.26.0";
 
   src = fetchurl {
     url = "https://download.filezilla-project.org/${pname}/${pname}-${version}.tar.bz2";
-    sha256 = "0akvki7n5rwmc52wss25i3h4nwl935flhjypf8dx3lvf4jszxxiv";
+    sha256 = "sha256-F+0iZZPo5GbOPD+M5YOzbHnxYxierVTWMWE8w9pcgL0=";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
   buildInputs = [ gettext gnutls nettle ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv ApplicationServices ];
+    ++ lib.optionals stdenv.isDarwin [ libiconv ApplicationServices ];
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libfishsound/default.nix b/nixpkgs/pkgs/development/libraries/libfishsound/default.nix
index 23d828033e3e..72dc29867115 100644
--- a/nixpkgs/pkgs/development/libraries/libfishsound/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfishsound/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libvorbis, speex, flac, pkgconfig }:
+{ lib, stdenv, fetchurl, libvorbis, speex, flac, pkg-config }:
 
 stdenv.mkDerivation rec {
   name = "libfishsound-1.0.0";
@@ -10,9 +10,9 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ libvorbis speex flac ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
-  meta = with stdenv.lib; {
+  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.
diff --git a/nixpkgs/pkgs/development/libraries/libfive/default.nix b/nixpkgs/pkgs/development/libraries/libfive/default.nix
index 2670f94fbc2f..0f6ad84fe755 100644
--- a/nixpkgs/pkgs/development/libraries/libfive/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfive/default.nix
@@ -4,7 +4,7 @@
 , fetchFromGitHub
 , cmake
 , ninja
-, pkgconfig
+, pkg-config
 , eigen
 , zlib
 , libpng
@@ -23,7 +23,7 @@ mkDerivation {
     sha256 = "102zw2n3vzv84i323is4qrwwqqha8v1cniw54ss8f4bq6dmic0bg";
   };
 
-  nativeBuildInputs = [ wrapQtAppsHook cmake ninja pkgconfig ];
+  nativeBuildInputs = [ wrapQtAppsHook cmake ninja pkg-config ];
   buildInputs = [ eigen zlib libpng boost guile ];
 
   # Link "Studio" binary to "libfive-studio" to be more obvious:
diff --git a/nixpkgs/pkgs/development/libraries/libfixposix/default.nix b/nixpkgs/pkgs/development/libraries/libfixposix/default.nix
index 4fdb22f8bd49..d8659b9e15f0 100644
--- a/nixpkgs/pkgs/development/libraries/libfixposix/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfixposix/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "libfixposix";
@@ -11,9 +11,9 @@ stdenv.mkDerivation rec {
     sha256 = "1x4q6yspi5g2s98vq4qszw4z3zjgk9l5zs8471w4d4cs6l97w08j";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/sionescu/libfixposix";
     description = "Thin wrapper over POSIX syscalls and some replacement functionality";
     license = licenses.boost;
diff --git a/nixpkgs/pkgs/development/libraries/libfm/default.nix b/nixpkgs/pkgs/development/libraries/libfm/default.nix
index 94476984de00..dc8359241257 100644
--- a/nixpkgs/pkgs/development/libraries/libfm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfm/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl, glib, intltool, menu-cache, pango, pkgconfig, vala
+{ 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 (stdenv.lib) optional;
+    inherit (lib) optional;
 in
 stdenv.mkDerivation rec {
   name = if extraOnly
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     sha256 = "1r6gl49xrykldwz8y4h2s7gjarxigg3bbkrj0gphxjj1vr5j9ccn";
   };
 
-  nativeBuildInputs = [ vala pkgconfig intltool ];
+  nativeBuildInputs = [ vala pkg-config intltool ];
   buildInputs = [ glib gtk pango ] ++ optional (!extraOnly) menu-cache;
 
   configureFlags = [
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://blog.lxde.org/category/pcmanfm/";
     license = licenses.lgpl21Plus;
     description = "A glib-based library for file management";
diff --git a/nixpkgs/pkgs/development/libraries/libfprint/default.nix b/nixpkgs/pkgs/development/libraries/libfprint/default.nix
index 4984d95ffa4e..f3f7313accbb 100644
--- a/nixpkgs/pkgs/development/libraries/libfprint/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfprint/default.nix
@@ -1,6 +1,6 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitLab
-, pkgconfig
+, pkg-config
 , meson
 , ninja
 , gusb
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     meson
     ninja
     gtk-doc
@@ -44,11 +44,13 @@ stdenv.mkDerivation rec {
     nss
   ];
 
+  NIX_CFLAGS_COMPILE = "-Wno-error=array-bounds";
+
   mesonFlags = [
     "-Dudev_rules_dir=${placeholder "out"}/lib/udev/rules.d"
   ];
 
-  meta = with stdenv.lib; {
+  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.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libfpx/default.nix b/nixpkgs/pkgs/development/libraries/libfpx/default.nix
index 52c64ed8629c..2576d426af55 100644
--- a/nixpkgs/pkgs/development/libraries/libfpx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfpx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch }:
+{ lib, stdenv, fetchurl, fetchpatch }:
 
 stdenv.mkDerivation rec {
   name = "libfpx-1.3.1-7";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   # Darwin gets misdetected as Windows without this
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-D__unix";
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-D__unix";
 
   patches = [
     (fetchpatch {
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     substituteInPlace jpeg/ejpeg.h --replace "int No_JPEG_Header_Flag" ""
   '' else null;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.imagemagick.org";
     description = "A library for manipulating FlashPIX images";
     license = "Flashpix";
diff --git a/nixpkgs/pkgs/development/libraries/libfreefare/default.nix b/nixpkgs/pkgs/development/libraries/libfreefare/default.nix
index 4af7d44a2945..9fd8c1e6b613 100644
--- a/nixpkgs/pkgs/development/libraries/libfreefare/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfreefare/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libnfc, openssl
+{ lib, stdenv, fetchurl, pkg-config, libnfc, openssl
 , libobjc ? null }:
 
 stdenv.mkDerivation {
@@ -10,10 +10,10 @@ stdenv.mkDerivation {
     sha256 = "0r5wfvwgf35lb1v65wavnwz2wlfyfdims6a9xpslf4lsm4a1v8xz";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ libnfc openssl ] ++ stdenv.lib.optional stdenv.isDarwin libobjc;
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ libnfc openssl ] ++ lib.optional stdenv.isDarwin libobjc;
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/libfsm/default.nix b/nixpkgs/pkgs/development/libraries/libfsm/default.nix
index e1c7f892aabd..5e3c40da82c7 100644
--- a/nixpkgs/pkgs/development/libraries/libfsm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfsm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , bmake
 }:
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  # fix up multi-output install. we also have to fix the pkgconfig libdir
+  # 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 = ''
@@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "lib" "dev" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "DFA regular expression library & friends";
     homepage    = "https://github.com/katef/libfsm";
     license     = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/libftdi/1.x.nix b/nixpkgs/pkgs/development/libraries/libftdi/1.x.nix
index 0e2e24d0f3b4..ae599a97529b 100644
--- a/nixpkgs/pkgs/development/libraries/libftdi/1.x.nix
+++ b/nixpkgs/pkgs/development/libraries/libftdi/1.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, pkgconfig, libusb1, libconfuse
+{ lib, stdenv, fetchurl, cmake, pkg-config, libusb1, libconfuse
 , cppSupport ? true, boost ? null
 , pythonSupport ? true, python3 ? null, swig ? null
 , docSupport ? true, doxygen ? null
@@ -16,13 +16,13 @@ stdenv.mkDerivation rec {
     sha256 = "0x0vncf6i92slgrn0h7ghkskqbglbs534220qa84d0qg114zndpc";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
-  buildInputs = with stdenv.lib; [ libconfuse ]
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = with lib; [ libconfuse ]
     ++ optionals cppSupport [ boost ]
     ++ optionals pythonSupport [ python3 swig ]
     ++ optionals docSupport [ doxygen ];
 
-  preBuild = stdenv.lib.optionalString docSupport ''
+  preBuild = lib.optionalString docSupport ''
     make doc_i
   '';
 
@@ -32,12 +32,12 @@ stdenv.mkDerivation rec {
     mkdir -p "$out/etc/udev/rules.d/"
     cp ../packages/99-libftdi.rules "$out/etc/udev/rules.d/"
     cp -r doc/man "$out/share/"
-  '' + stdenv.lib.optionalString docSupport ''
+  '' + lib.optionalString docSupport ''
     mkdir -p "$out/share/libftdi/doc/"
     cp -r doc/html "$out/share/libftdi/doc/"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library to talk to FTDI chips using libusb";
     homepage = "https://www.intra2net.com/en/developer/libftdi/";
     license = with licenses; [ lgpl2 gpl2 ];
diff --git a/nixpkgs/pkgs/development/libraries/libfyaml/default.nix b/nixpkgs/pkgs/development/libraries/libfyaml/default.nix
index 5ce8cd6c6a1d..69b7bdc7d1e1 100644
--- a/nixpkgs/pkgs/development/libraries/libfyaml/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libfyaml/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gnum4 }:
+{ lib, stdenv, fetchurl, gnum4 }:
 
 stdenv.mkDerivation rec {
   pname = "libfyaml";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ gnum4 ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libgadu/default.nix b/nixpkgs/pkgs/development/libraries/libgadu/default.nix
index 4e9ce765b963..72bf067b2db4 100644
--- a/nixpkgs/pkgs/development/libraries/libgadu/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgadu/default.nix
@@ -1,21 +1,25 @@
-{stdenv, fetchurl, zlib}:
+{ lib, stdenv, fetchFromGitHub, zlib, protobufc, autoreconfHook }:
 
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
+  pname = "libgadu";
+  version = "1.12.2";
 
-  name = "libgadu-1.11.2";
-
-  src = fetchurl {
-    url = "http://toxygen.net/libgadu/files/libgadu-1.11.2.tar.gz";
-    sha256 = "0kifi9blhbimihqw4kaf6wyqhlx8fpp8nq4s6y280ar9p0il2n3z";
+  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 = "http://toxygen.net/libgadu/";
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.lgpl21;
+    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
index c0aa67238bff..f059d6c73a2f 100644
--- a/nixpkgs/pkgs/development/libraries/libgaminggear/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgaminggear/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, pkgconfig, gettext
+{ lib, stdenv, fetchurl, cmake, pkg-config, gettext
 , gtk2, libcanberra, libnotify, pcre, sqlite, xorg
 , harfbuzz
 }:
@@ -14,14 +14,12 @@ stdenv.mkDerivation rec {
 
   outputs = [ "dev" "out" "bin" ];
 
-  nativeBuildInputs = [ cmake pkgconfig gettext ];
+  nativeBuildInputs = [ cmake pkg-config gettext ];
 
   propagatedBuildInputs = [
     gtk2 libcanberra libnotify pcre sqlite xorg.libXdmcp xorg.libpthreadstubs
   ];
 
-  enableParallelBuilding = true;
-
   cmakeFlags = [
     "-DINSTALL_CMAKE_MODULESDIR=lib/cmake"
     "-DINSTALL_PKGCONFIGDIR=lib/pkgconfig"
@@ -38,7 +36,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Provides functionality for gaming input devices";
     homepage = "https://sourceforge.net/projects/libgaminggear/";
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.gpl2Plus;
+    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
index 9de5cf2d2d1b..f90ea502c406 100644
--- a/nixpkgs/pkgs/development/libraries/libgcrypt/1.5.nix
+++ b/nixpkgs/pkgs/development/libraries/libgcrypt/1.5.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "0ydy7bgra5jbq9mxl5x031nif3m6y3balc6ndw2ngj11wnsjc61h";
   };
 
-  patches = stdenv.lib.optionals stdenv.isDarwin [
+  patches = lib.optionals stdenv.isDarwin [
     (fetchpatch {
       name = "fix-x86_64-apple-darwin.patch";
       sha256 = "138sfwl1avpy19320dbd63mskspc1khlc93j1f1zmylxx3w19csi";
@@ -26,13 +26,13 @@ stdenv.mkDerivation rec {
   # 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
-  '' + stdenv.lib.optionalString enableCapabilities ''
+  '' + lib.optionalString enableCapabilities ''
     sed -i 's,\(-lcap\),-L${libcap.lib}/lib \1,' $out/lib/libgcrypt.la
   '';
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.gnu.org/software/libgcrypt/";
     description = "General-pupose cryptographic library";
     license = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libgcrypt/default.nix b/nixpkgs/pkgs/development/libraries/libgcrypt/default.nix
index cd529cb06ee6..6c6d73740f20 100644
--- a/nixpkgs/pkgs/development/libraries/libgcrypt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgcrypt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gettext, libgpgerror, enableCapabilities ? false, libcap
+{ lib, stdenv, fetchurl, gettext, libgpgerror, enableCapabilities ? false, libcap
 , buildPackages
 }:
 
@@ -19,16 +19,16 @@ stdenv.mkDerivation rec {
   # 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 = stdenv.lib.optional stdenv.cc.isClang "fortify";
+  hardeningDisable = lib.optional stdenv.cc.isClang "fortify";
 
   depsBuildBuild = [ buildPackages.stdenv.cc ];
 
   buildInputs = [ libgpgerror ]
-    ++ stdenv.lib.optional stdenv.isDarwin gettext
-    ++ stdenv.lib.optional enableCapabilities libcap;
+    ++ lib.optional stdenv.isDarwin gettext
+    ++ lib.optional enableCapabilities libcap;
 
   configureFlags = [ "--with-libgpg-error-prefix=${libgpgerror.dev}" ]
-   ++ stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-asm";
+   ++ lib.optional stdenv.hostPlatform.isMusl "--disable-asm";
 
   # Necessary to generate correct assembly when compiling for aarch32 on
   # aarch64
@@ -43,20 +43,20 @@ stdenv.mkDerivation rec {
   # 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"
-  '' + stdenv.lib.optionalString enableCapabilities ''
+  '' + 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 = stdenv.lib.optionalString stdenv.isDarwin ''
+  preCheck = lib.optionalString stdenv.isDarwin ''
     mkdir -p $out/lib
     cp src/.libs/libgcrypt.20.dylib $out/lib
   '';
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.gnu.org/software/libgcrypt/";
     description = "General-purpose cryptographic library";
     license = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libgda/default.nix b/nixpkgs/pkgs/development/libraries/libgda/default.nix
index f0b430c91d81..73e71de4aac6 100644
--- a/nixpkgs/pkgs/development/libraries/libgda/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgda/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, pkgconfig, intltool, itstool, libxml2, gtk3, openssl, gnome3, gobject-introspection, vala, libgee
-, overrideCC, gcc6
+{ lib, stdenv, fetchurl, pkg-config, intltool, itstool, libxml2, gtk3, openssl, gnome3, gobject-introspection, vala, libgee
+, overrideCC, gcc6, fetchpatch, autoreconfHook, gtk-doc, autoconf-archive, yelp-tools
 , mysqlSupport ? false, libmysqlclient ? null
 , postgresSupport ? false, postgresql ? null
 }:
@@ -12,11 +12,19 @@ assert postgresSupport -> postgresql != null;
   version = "5.2.10";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1j1l4dwjgw6w4d1v4bl5a4kwyj7bcih8mj700ywm7xakh1xxyv3g";
   };
-  configureFlags = with stdenv.lib; [
-    "--enable-gi-system-install=no"
+
+  patches = [
+    # fix compile error with mysql
+    (fetchpatch {
+      url = "https://gitlab.gnome.org/GNOME/libgda/-/commit/9859479884fad5f39e6c37e8995e57c28b11b1b9.diff";
+      sha256 = "158sncc5bg9lkri1wb0i1ri1nhx4c34rzi47gbfkwphlp7qd4qqv";
+    })
+  ];
+
+  configureFlags = with lib; [
     "--with-mysql=${if mysqlSupport then "yes" else "no"}"
     "--with-postgres=${if postgresSupport then "yes" else "no"}"
 
@@ -32,8 +40,8 @@ assert postgresSupport -> postgresql != null;
 
   hardeningDisable = [ "format" ];
 
-  nativeBuildInputs = [ pkgconfig intltool itstool libxml2 gobject-introspection vala ];
-  buildInputs = with stdenv.lib; [ gtk3 openssl libgee ]
+  nativeBuildInputs = [ pkg-config intltool itstool libxml2 gobject-introspection vala autoreconfHook gtk-doc autoconf-archive yelp-tools ];
+  buildInputs = with lib; [ gtk3 openssl libgee ]
     ++ optional (mysqlSupport) libmysqlclient
     ++ optional (postgresSupport) postgresql;
 
@@ -43,7 +51,7 @@ assert postgresSupport -> postgresql != null;
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Database access library";
     homepage = "https://www.gnome-db.org/";
     license = [ licenses.lgpl2 licenses.gpl2 ];
diff --git a/nixpkgs/pkgs/development/libraries/libgdamm/default.nix b/nixpkgs/pkgs/development/libraries/libgdamm/default.nix
index be3e2e469ade..44a0e8bc2121 100644
--- a/nixpkgs/pkgs/development/libraries/libgdamm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgdamm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glibmm, libgda, libxml2, gnome3
+{ lib, stdenv, fetchurl, pkg-config, glibmm, libgda, libxml2, gnome3
 , mysqlSupport ? false
 , postgresSupport ? false }:
 
@@ -13,11 +13,11 @@ in stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1fyh15b3f8hmwbswalxk1g4l04yvvybksn5nm7gznn5jl5q010p9";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ glibmm libxml2 ];
   propagatedBuildInputs = [ gda ];
 
@@ -29,7 +29,7 @@ in stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ bindings for libgda";
     homepage = "https://www.gnome-db.org/";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libgdata/default.nix b/nixpkgs/pkgs/development/libraries/libgdata/default.nix
index 50eac4057062..86e3f4274fcf 100644
--- a/nixpkgs/pkgs/development/libraries/libgdata/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgdata/default.nix
@@ -1,6 +1,6 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
-, pkgconfig
+, pkg-config
 , meson
 , ninja
 , nixosTests
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "installedTests" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0bj7ij6k3lxjn62jgh8vabr8vfjs48aylnnl3779warw5iwyzfga";
   };
 
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
     gobject-introspection
     meson
     ninja
-    pkgconfig
+    pkg-config
     vala
   ];
 
@@ -76,7 +76,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GData API library";
     homepage = "https://wiki.gnome.org/Projects/libgdata";
     maintainers = with maintainers; [ raskin lethalman ] ++ teams.gnome.members;
diff --git a/nixpkgs/pkgs/development/libraries/libgdiplus/default.nix b/nixpkgs/pkgs/development/libraries/libgdiplus/default.nix
index 70043d1132d0..705205df396c 100644
--- a/nixpkgs/pkgs/development/libraries/libgdiplus/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgdiplus/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkgconfig, glib, cairo, Carbon, fontconfig
+{ lib, stdenv, fetchFromGitHub, pkg-config, glib, cairo, Carbon, fontconfig
 , libtiff, giflib, libjpeg, libpng
 , libXrender, libexif, autoreconfHook, fetchpatch }:
 
@@ -19,9 +19,9 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "format" ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
-  configureFlags = stdenv.lib.optional stdenv.cc.isClang "--host=${stdenv.hostPlatform.system}";
+  configureFlags = lib.optional stdenv.cc.isClang "--host=${stdenv.hostPlatform.system}";
 
   enableParallelBuilding = true;
 
@@ -29,9 +29,9 @@ stdenv.mkDerivation rec {
     [ glib cairo fontconfig libtiff giflib
       libjpeg libpng libXrender libexif
     ]
-    ++ stdenv.lib.optional stdenv.isDarwin Carbon;
+    ++ lib.optional stdenv.isDarwin Carbon;
 
-  postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
+  postInstall = lib.optionalString stdenv.isDarwin ''
     ln -s $out/lib/libgdiplus.0.dylib $out/lib/libgdiplus.so
   '';
 
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
     make check -w
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libgee/default.nix b/nixpkgs/pkgs/development/libraries/libgee/default.nix
index c2d1c197fe96..407b99b5a57b 100644
--- a/nixpkgs/pkgs/development/libraries/libgee/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgee/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoconf, vala, pkgconfig, glib, gobject-introspection, gnome3 }:
+{ lib, stdenv, fetchurl, autoconf, vala, pkg-config, glib, gobject-introspection, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "libgee";
@@ -7,13 +7,13 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1pm525wm11dhwz24m8bpcln9547lmrigl6cxf3qsbg4cr3pyvdfh";
   };
 
   doCheck = true;
 
-  nativeBuildInputs = [ pkgconfig autoconf vala gobject-introspection ];
+  nativeBuildInputs = [ pkg-config autoconf vala gobject-introspection ];
   buildInputs = [ glib ];
 
   PKG_CONFIG_GOBJECT_INTROSPECTION_1_0_GIRDIR = "${placeholder "dev"}/share/gir-1.0";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libgeotiff/default.nix b/nixpkgs/pkgs/development/libraries/libgeotiff/default.nix
index 1b973fd5eeeb..eb35d5316c0e 100644
--- a/nixpkgs/pkgs/development/libraries/libgeotiff/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgeotiff/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, libtiff, libjpeg, proj, zlib, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, libtiff, libjpeg, proj, zlib, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   version = "1.5.1";
@@ -29,8 +29,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Library implementing attempt to create a tiff based interchange format for georeferenced raster imagery";
     homepage = "https://github.com/OSGeo/libgeotiff";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [stdenv.lib.maintainers.marcweber];
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    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
index cf62e0cabc9d..e058c7ed5af3 100644
--- a/nixpkgs/pkgs/development/libraries/libgepub/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgepub/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig, glib, gobject-introspection, gnome3
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, glib, gobject-introspection, gnome3
 , webkitgtk, libsoup, libxml2, libarchive }:
 
 stdenv.mkDerivation rec {
@@ -6,13 +6,13 @@ stdenv.mkDerivation rec {
   version = "0.6.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "16dkyywqdnfngmwsgbyga0kl9vcnzczxi3lmhm27pifrq5f3k2n7";
   };
 
   doCheck = true;
 
-  nativeBuildInputs = [ meson ninja pkgconfig gobject-introspection ];
+  nativeBuildInputs = [ meson ninja pkg-config gobject-introspection ];
   buildInputs = [ glib webkitgtk libsoup libxml2 libarchive ];
 
   passthru = {
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GObject based library for handling and rendering epub documents";
     license = licenses.lgpl21Plus;
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/libgig/default.nix b/nixpkgs/pkgs/development/libraries/libgig/default.nix
index 84d44969a142..f78a51db5de6 100644
--- a/nixpkgs/pkgs/development/libraries/libgig/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgig/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoconf, automake, libsndfile, libtool, pkgconfig, libuuid }:
+{ lib, stdenv, fetchurl, autoconf, automake, libsndfile, libtool, pkg-config, libuuid }:
 
 stdenv.mkDerivation rec {
   pname = "libgig";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "1zs5yy124bymfyapsnljr6rv2lnn5inwchm0xnwiw44b2d39l8hn";
   };
 
-  nativeBuildInputs = [ autoconf automake libtool pkgconfig ];
+  nativeBuildInputs = [ autoconf automake libtool pkg-config ];
 
   buildInputs = [ libsndfile libuuid ];
 
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.linuxsampler.org";
     description = "Gigasampler file access library";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libgit2-glib/default.nix b/nixpkgs/pkgs/development/libraries/libgit2-glib/default.nix
index 9a05a01bee61..fe36a9d663f3 100644
--- a/nixpkgs/pkgs/development/libraries/libgit2-glib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgit2-glib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gnome3, meson, ninja, pkgconfig, vala, libssh2
+{ lib, stdenv, fetchurl, gnome3, meson, ninja, pkg-config, vala, libssh2
 , gtk-doc, gobject-introspection, libgit2, glib, python3 }:
 
 stdenv.mkDerivation rec {
@@ -6,7 +6,7 @@ stdenv.mkDerivation rec {
   version = "0.99.0.1";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1pmrcnsa7qdda73c3dxf47733mwprmj5ljpw3acxbj6r8k27anp0";
   };
 
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [
-    meson ninja pkgconfig vala gtk-doc gobject-introspection
+    meson ninja pkg-config vala gtk-doc gobject-introspection
   ];
 
   propagatedBuildInputs = [
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
     python3.pkgs.pygobject3 # this should really be a propagated input of python output
   ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libgksu/default.nix b/nixpkgs/pkgs/development/libraries/libgksu/default.nix
index 9ead3a97c048..cf8f5ab48786 100644
--- a/nixpkgs/pkgs/development/libraries/libgksu/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgksu/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, wrapGAppsHook, gtk2, gnome2, gnome3,
+{ lib, stdenv, fetchurl, pkg-config, wrapGAppsHook, gtk2, gnome2, gnome3,
   libstartup_notification, libgtop, perlPackages,
   autoreconfHook, intltool, docbook_xsl, xauth
 }:
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [
-    pkgconfig autoreconfHook intltool docbook_xsl wrapGAppsHook
+    pkg-config autoreconfHook intltool docbook_xsl wrapGAppsHook
   ];
 
   buildInputs = [
@@ -79,8 +79,8 @@ stdenv.mkDerivation rec {
       programs in an X session.
     '';
     homepage = "https://www.nongnu.org/gksu/";
-    license = stdenv.lib.licenses.lgpl2;
-    maintainers = [ stdenv.lib.maintainers.romildo ];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.lgpl2;
+    maintainers = [ lib.maintainers.romildo ];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libglvnd/default.nix b/nixpkgs/pkgs/development/libraries/libglvnd/default.nix
index 3a4737d483bf..88ba7dacc22f 100644
--- a/nixpkgs/pkgs/development/libraries/libglvnd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libglvnd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, fetchpatch, autoreconfHook, python3, pkgconfig, libX11, libXext, xorgproto, addOpenGLRunpath }:
+{ stdenv, lib, fetchFromGitHub, fetchpatch, autoreconfHook, python3, pkg-config, libX11, libXext, xorgproto, addOpenGLRunpath }:
 
 stdenv.mkDerivation rec {
   pname = "libglvnd";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "10x7fgb114r4gikdg6flszl3kwzcb9y5qa7sj9936mk0zxhjaylz";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig python3 addOpenGLRunpath ];
+  nativeBuildInputs = [ autoreconfHook pkg-config python3 addOpenGLRunpath ];
   buildInputs = [ libX11 libXext xorgproto ];
 
   postPatch = lib.optionalString stdenv.isDarwin ''
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
   ] ++ lib.optional stdenv.cc.isClang "-Wno-error");
 
   # Indirectly: https://bugs.freedesktop.org/show_bug.cgi?id=35268
-  configureFlags  = stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-tls";
+  configureFlags  = lib.optional stdenv.hostPlatform.isMusl "--disable-tls";
 
   outputs = [ "out" "dev" ];
 
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
 
   passthru = { inherit (addOpenGLRunpath) driverLink; };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The GL Vendor-Neutral Dispatch library";
     homepage = "https://github.com/NVIDIA/libglvnd";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/libgnome-keyring/default.nix b/nixpkgs/pkgs/development/libraries/libgnome-keyring/default.nix
index 33a6a075ae44..3f5a5961ba0f 100644
--- a/nixpkgs/pkgs/development/libraries/libgnome-keyring/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgnome-keyring/default.nix
@@ -1,22 +1,22 @@
-{ stdenv, fetchurl, glib, dbus, libgcrypt, pkgconfig, intltool }:
+{ 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}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
     sha256 = "030gka96kzqg1r19b4xrmac89hf1xj1kr5p461yvbzfxh46qqf2n";
   };
 
   outputs = [ "out" "dev" ];
 
   propagatedBuildInputs = [ glib dbus libgcrypt ];
-  nativeBuildInputs = [ pkgconfig intltool ];
+  nativeBuildInputs = [ pkg-config intltool ];
 
   meta = {
     inherit (glib.meta) platforms maintainers;
     homepage = "https://wiki.gnome.org/Projects/GnomeKeyring";
-    license = with stdenv.lib.licenses; [ gpl2 lgpl2 ];
+    license = with lib.licenses; [ gpl2 lgpl2 ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libgnomekbd/default.nix b/nixpkgs/pkgs/development/libraries/libgnomekbd/default.nix
index c02fd503eb0d..62228b8837a8 100644
--- a/nixpkgs/pkgs/development/libraries/libgnomekbd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgnomekbd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, file, intltool, glib, gtk3, libxklavier, wrapGAppsHook, gnome3 }:
+{ lib, stdenv, fetchurl, pkg-config, file, intltool, glib, gtk3, libxklavier, wrapGAppsHook, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "libgnomekbd";
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0y962ykn3rr9gylj0pwpww7bi20lmhvsw6qvxs5bisbn2mih5jpp";
   };
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     file
     intltool
-    pkgconfig
+    pkg-config
     wrapGAppsHook
   ];
 
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     glib
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Keyboard management library";
     maintainers = teams.gnome.members;
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libgnurl/default.nix b/nixpkgs/pkgs/development/libraries/libgnurl/default.nix
index 5daeba2c06e6..a7d91d0c81ad 100644
--- a/nixpkgs/pkgs/development/libraries/libgnurl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgnurl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libtool, groff, perl, pkgconfig, python2, zlib, gnutls,
+{ lib, stdenv, fetchurl, libtool, groff, perl, pkg-config, python2, zlib, gnutls,
   libidn2, libunistring, nghttp2 }:
 
 stdenv.mkDerivation rec {
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1y4laraq37kw8hc8jlzgcw7y37bfd0n71q0sy3d3z6yg7zh2prxi";
   };
 
-  nativeBuildInputs = [ libtool groff perl pkgconfig python2 ];
+  nativeBuildInputs = [ libtool groff perl pkg-config python2 ];
 
   buildInputs = [ gnutls zlib libidn2 libunistring nghttp2 ];
 
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
     "--without-librtmp"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A fork of libcurl used by GNUnet";
     homepage    = "https://gnunet.org/en/gnurl.html";
     maintainers = with maintainers; [ vrthra ];
diff --git a/nixpkgs/pkgs/development/libraries/libgpg-error/default.nix b/nixpkgs/pkgs/development/libraries/libgpg-error/default.nix
index 972ca4c04a57..39d0b185660f 100644
--- a/nixpkgs/pkgs/development/libraries/libgpg-error/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgpg-error/default.nix
@@ -65,7 +65,7 @@ in stdenv.mkDerivation (rec {
 
   doCheck = true; # not cross
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.gnupg.org/related_software/libgpg-error/index.html";
     description = "A small library that defines common error values for all GnuPG components";
 
diff --git a/nixpkgs/pkgs/development/libraries/libgphoto2/default.nix b/nixpkgs/pkgs/development/libraries/libgphoto2/default.nix
index 89bca2ee75fb..4dec3151a7cd 100644
--- a/nixpkgs/pkgs/development/libraries/libgphoto2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgphoto2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, gettext
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, gettext
 , libusb1
 , libtool
 , libexif
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     autoreconfHook
-    pkgconfig
+    pkg-config
     gettext
     libtool
   ];
@@ -49,8 +49,8 @@ stdenv.mkDerivation rec {
       from digital cameras.
     '';
     # XXX: the homepage claims LGPL, but several src files are lgpl21Plus
-    license = stdenv.lib.licenses.lgpl21Plus;
-    platforms = with stdenv.lib.platforms; unix;
-    maintainers = with stdenv.lib.maintainers; [ jcumming ];
+    license = lib.licenses.lgpl21Plus;
+    platforms = with lib.platforms; unix;
+    maintainers = with lib.maintainers; [ jcumming ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libgpiod/default.nix b/nixpkgs/pkgs/development/libraries/libgpiod/default.nix
index a3178e548048..8f6d9fcab5ed 100644
--- a/nixpkgs/pkgs/development/libraries/libgpiod/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgpiod/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, autoreconfHook, autoconf-archive, pkgconfig, kmod
+{ lib, stdenv, fetchurl, autoreconfHook, autoconf-archive, pkg-config, kmod
 , enable-tools ? true
 , enablePython ? false, python3, ncurses }:
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ kmod ] ++ lib.optionals enablePython [ python3 ncurses ];
   nativeBuildInputs = [
     autoconf-archive
-    pkgconfig
+    pkg-config
     autoreconfHook
   ];
 
diff --git a/nixpkgs/pkgs/development/libraries/libgpod/default.nix b/nixpkgs/pkgs/development/libraries/libgpod/default.nix
index d23a52382950..49dcec3ee781 100644
--- a/nixpkgs/pkgs/development/libraries/libgpod/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgpod/default.nix
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
     homepage = "https://gtkpod.sourceforge.net/";
     description = "Library used by gtkpod to access the contents of an ipod";
     license = "LGPL";
-    platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;
+    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
index 323f5af70973..16595a12eb50 100644
--- a/nixpkgs/pkgs/development/libraries/libgringotts/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgringotts/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, zlib, bzip2, libmcrypt, libmhash }:
+{ lib, stdenv, fetchurl, pkg-config, zlib, bzip2, libmcrypt, libmhash }:
 
 stdenv.mkDerivation rec {
   pname = "libgringotts";
@@ -9,10 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "1ldz1lyl1aml5ci1mpnys8dg6n7khpcs4zpycak3spcpgdsnypm7";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ zlib bzip2 libmcrypt libmhash ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A small library to encapsulate data in an encrypted structure";
     homepage = "http://libgringotts.sourceforge.net/";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libgroove/default.nix b/nixpkgs/pkgs/development/libraries/libgroove/default.nix
index 3fea527c450e..963bf722b2a3 100644
--- a/nixpkgs/pkgs/development/libraries/libgroove/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgroove/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, libav, SDL2, chromaprint, libebur128 }:
+{ lib, stdenv, fetchFromGitHub, cmake, libav, SDL2, chromaprint, libebur128 }:
 
 stdenv.mkDerivation rec {
   version = "4.3.0";
@@ -13,9 +13,10 @@ stdenv.mkDerivation rec {
 
   patches = [ ./no-warnings-as-errors.patch ];
 
-  buildInputs = [ cmake libav SDL2 chromaprint libebur128 ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libav SDL2 chromaprint libebur128 ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Streaming audio processing library";
     homepage = "https://github.com/andrewrk/libgroove";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libgrss/default.nix b/nixpkgs/pkgs/development/libraries/libgrss/default.nix
index fdad5369813f..b8c7c7bc4977 100644
--- a/nixpkgs/pkgs/development/libraries/libgrss/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgrss/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, vala, gobject-introspection, gtk-doc, docbook_xsl, docbook_xml_dtd_412, glib, libxml2, libsoup, gnome3 }:
+{ lib, stdenv, fetchurl, pkg-config, vala, gobject-introspection, gtk-doc, docbook_xsl, docbook_xml_dtd_412, glib, libxml2, libsoup, gnome3 }:
 
 let
   version = "0.7.0";
@@ -10,11 +10,11 @@ stdenv.mkDerivation {
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1nalslgyglvhpva3px06fj6lv5zgfg0qmj0sbxyyl5d963vc02b7";
   };
 
-  nativeBuildInputs = [ pkgconfig vala gobject-introspection gtk-doc docbook_xsl docbook_xml_dtd_412 ];
+  nativeBuildInputs = [ pkg-config vala gobject-introspection gtk-doc docbook_xsl docbook_xml_dtd_412 ];
   buildInputs = [ glib libxml2 libsoup ];
 
   configureFlags = [
@@ -30,7 +30,7 @@ stdenv.mkDerivation {
     };
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libgsf/default.nix b/nixpkgs/pkgs/development/libraries/libgsf/default.nix
index 34cb1ef3381f..77fa161b773a 100644
--- a/nixpkgs/pkgs/development/libraries/libgsf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgsf/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, pkgconfig, intltool, gettext, glib, libxml2, zlib, bzip2
+{ fetchurl, lib, stdenv, pkg-config, intltool, gettext, glib, libxml2, zlib, bzip2
 , perl, gdk-pixbuf, libiconv, libintl, gnome3 }:
 
 stdenv.mkDerivation rec {
@@ -6,11 +6,11 @@ stdenv.mkDerivation rec {
   version = "1.14.47";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0kbpp9ksl7977xiga37sk1gdw1r039v6zviqznl7alvvg39yp26i";
   };
 
-  nativeBuildInputs = [ pkgconfig intltool libintl ];
+  nativeBuildInputs = [ pkg-config intltool libintl ];
 
   buildInputs = [ gettext bzip2 zlib ];
   checkInputs = [ perl ];
@@ -28,12 +28,12 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GNOME's Structured File Library";
     homepage    = "https://www.gnome.org/projects/libgsf";
     license     = licenses.lgpl2Plus;
     maintainers = with maintainers; [ lovek323 ];
-    platforms   = stdenv.lib.platforms.unix;
+    platforms   = lib.platforms.unix;
 
     longDescription = ''
       Libgsf aims to provide an efficient extensible I/O abstraction for
diff --git a/nixpkgs/pkgs/development/libraries/libgssglue/default.nix b/nixpkgs/pkgs/development/libraries/libgssglue/default.nix
index d13c0940205f..678af459a30d 100644
--- a/nixpkgs/pkgs/development/libraries/libgssglue/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgssglue/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, kerberos }:
+{ lib, stdenv, fetchurl, kerberos }:
 
 stdenv.mkDerivation rec {
   name = "libgssglue-0.4";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     EOF
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libgtop/default.nix b/nixpkgs/pkgs/development/libraries/libgtop/default.nix
index 65f5e2750e51..af4fe04a0b42 100644
--- a/nixpkgs/pkgs/development/libraries/libgtop/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgtop/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , glib
-, pkgconfig
+, pkg-config
 , perl
 , gettext
 , gobject-introspection
@@ -14,12 +14,12 @@ stdenv.mkDerivation rec {
   version = "2.40.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1m6jbqk8maa52gxrf223442fr5bvvxgb7ham6v039i3r1i62gwvq";
   };
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     gtk-doc
     perl
     gettext
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library that reads information about processes and the running system";
     license = licenses.gpl2Plus;
     maintainers = teams.gnome.members;
diff --git a/nixpkgs/pkgs/development/libraries/libgudev/default.nix b/nixpkgs/pkgs/development/libraries/libgudev/default.nix
index c7c3064acb8d..feeae05bf526 100644
--- a/nixpkgs/pkgs/development/libraries/libgudev/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgudev/default.nix
@@ -1,6 +1,6 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
-, pkgconfig
+, pkg-config
 , udev
 , glib
 , gobject-introspection
@@ -14,11 +14,11 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0drf39qhsdz35kwb18hnfj2ig4yfxhfks66m783zlhnvy2narbhv";
   };
 
-  nativeBuildInputs = [ pkgconfig gobject-introspection ];
+  nativeBuildInputs = [ pkg-config gobject-introspection ];
   buildInputs = [ udev glib ];
 
   # There's a dependency cycle with umockdev and the tests fail to LD_PRELOAD anyway.
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libguestfs/default.nix b/nixpkgs/pkgs/development/libraries/libguestfs/default.nix
index b875b3579037..0f56f8c97f38 100644
--- a/nixpkgs/pkgs/development/libraries/libguestfs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libguestfs/default.nix
@@ -1,13 +1,13 @@
-{ stdenv, fetchurl, pkgconfig, autoreconfHook, makeWrapper
+{ lib, stdenv, fetchurl, 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, xen, libapparmor, jansson
+, gmp, readline, file, numactl, libapparmor, jansson
 , getopt, perlPackages, ocamlPackages
 , libtirpc
 , appliance ? null
 , javaSupport ? false, jdk ? null }:
 
-assert appliance == null || stdenv.lib.isDerivation appliance;
+assert appliance == null || lib.isDerivation appliance;
 assert javaSupport -> jdk != null;
 
 stdenv.mkDerivation rec {
@@ -19,16 +19,16 @@ stdenv.mkDerivation rec {
     sha256 = "ad6562c48c38e922a314cb45a90996843d81045595c4917f66b02a6c2dfe8058";
   };
 
-  nativeBuildInputs = [ autoreconfHook makeWrapper pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook makeWrapper pkg-config ];
   buildInputs = [
     ncurses cpio gperf jansson
     cdrkit flex bison qemu pcre augeas libxml2 acl libcap libcap_ng libconfig
     systemd fuse yajl libvirt gmp readline file hivex db
-    numactl xen libapparmor getopt perlPackages.ModuleBuild
+    numactl libapparmor getopt perlPackages.ModuleBuild
     libtirpc
   ] ++ (with perlPackages; [ perl libintl_perl GetoptLong SysVirt ])
     ++ (with ocamlPackages; [ ocaml findlib ocamlbuild ocaml_libvirt gettext-stub ounit ])
-    ++ stdenv.lib.optional javaSupport jdk;
+    ++ lib.optional javaSupport jdk;
 
   prePatch = ''
     # build-time scripts
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
     patchShebangs .
   '';
   configureFlags = [ "--disable-appliance" "--disable-daemon" "--with-distro=NixOS" ]
-    ++ stdenv.lib.optionals (!javaSupport) [ "--disable-java" "--without-java" ];
+    ++ lib.optionals (!javaSupport) [ "--disable-java" "--without-java" ];
   patches = [ ./libguestfs-syms.patch ];
   NIX_CFLAGS_COMPILE="-I${libxml2.dev}/include/libxml2/";
   installFlags = [ "REALLY_INSTALL=yes" ];
@@ -59,7 +59,7 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  postFixup = stdenv.lib.optionalString (appliance != null) ''
+  postFixup = lib.optionalString (appliance != null) ''
     mkdir -p $out/{lib,lib64}
     ln -s ${appliance} $out/lib64/guestfs
     ln -s ${appliance} $out/lib/guestfs
@@ -85,7 +85,7 @@ stdenv.mkDerivation rec {
     runHook postInstallCheck
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Tools for accessing and modifying virtual machine disk images";
     license = with licenses; [ gpl2 lgpl21 ];
     homepage = "https://libguestfs.org/";
diff --git a/nixpkgs/pkgs/development/libraries/libgumath/default.nix b/nixpkgs/pkgs/development/libraries/libgumath/default.nix
index 55e89d876649..f82401f524fa 100644
--- a/nixpkgs/pkgs/development/libraries/libgumath/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgumath/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , libndtypes
 , libxnd
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library supporting function dispatch on general data containers. C base and Python wrapper";
     homepage = "https://xnd.io/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libgweather/default.nix b/nixpkgs/pkgs/development/libraries/libgweather/default.nix
index 5493343fc239..9351d3f707fa 100644
--- a/nixpkgs/pkgs/development/libraries/libgweather/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgweather/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig, libxml2, glib, gtk3, gettext, libsoup
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, libxml2, glib, gtk3, gettext, libsoup
 , gtk-doc, docbook_xsl, docbook_xml_dtd_43, gobject-introspection, python3, tzdata, geocode-glib, vala, gnome3 }:
 
 stdenv.mkDerivation rec {
@@ -8,11 +8,11 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0l74hc02rvzm4p530y539a67jwb080fqdaazdl8j0fr3xvq0j9yy";
   };
 
-  nativeBuildInputs = [ meson ninja pkgconfig gettext vala gtk-doc docbook_xsl docbook_xml_dtd_43 gobject-introspection python3 ];
+  nativeBuildInputs = [ meson ninja pkg-config gettext vala gtk-doc docbook_xsl docbook_xml_dtd_43 gobject-introspection python3 ];
   buildInputs = [ glib gtk3 libsoup libxml2 geocode-glib ];
 
   postPatch = ''
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libgxps/default.nix b/nixpkgs/pkgs/development/libraries/libgxps/default.nix
index 095b5c8f61cf..f7392ffb7dd5 100644
--- a/nixpkgs/pkgs/development/libraries/libgxps/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libgxps/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig, glib, gobject-introspection, cairo
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, glib, gobject-introspection, cairo
 , libarchive, freetype, libjpeg, libtiff, gnome3, lcms2
 }:
 
@@ -7,11 +7,11 @@ stdenv.mkDerivation rec {
   version = "0.3.1";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "157s4c9gjjss6yd7qp7n4q6s72gz1k4ilsx4xjvp357azk49z4qs";
   };
 
-  nativeBuildInputs = [ meson ninja pkgconfig gobject-introspection ];
+  nativeBuildInputs = [ meson ninja pkg-config gobject-introspection ];
   buildInputs = [ glib cairo freetype libjpeg libtiff lcms2 ];
   propagatedBuildInputs = [ libarchive ];
 
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A GObject based library for handling and rendering XPS documents";
     homepage = "https://wiki.gnome.org/Projects/libgxps";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libhandy/0.x.nix b/nixpkgs/pkgs/development/libraries/libhandy/0.x.nix
index 9cf4f615dd28..ff2093255cf0 100644
--- a/nixpkgs/pkgs/development/libraries/libhandy/0.x.nix
+++ b/nixpkgs/pkgs/development/libraries/libhandy/0.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, meson, ninja, pkgconfig, gobject-introspection, vala
+{ lib, stdenv, fetchFromGitLab, meson, ninja, pkg-config, gobject-introspection, vala
 , gtk-doc, docbook_xsl, docbook_xml_dtd_43
 , gtk3, gnome3
 , dbus, xvfb_run, libxml2
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [
-    meson ninja pkgconfig gobject-introspection vala libxml2
+    meson ninja pkg-config gobject-introspection vala libxml2
     gtk-doc docbook_xsl docbook_xml_dtd_43
   ];
   buildInputs = [ gnome3.gnome-desktop gtk3 libxml2 ];
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
       meson test --print-errorlogs
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library full of GTK widgets for mobile phones";
     homepage = "https://source.puri.sm/Librem5/libhandy";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libhandy/default.nix b/nixpkgs/pkgs/development/libraries/libhandy/default.nix
index 7dce08b4cc24..5ab6dde09d78 100644
--- a/nixpkgs/pkgs/development/libraries/libhandy/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libhandy/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , gobject-introspection
 , vala
 , gtk-doc
@@ -23,14 +23,14 @@
 
 stdenv.mkDerivation rec {
   pname = "libhandy";
-  version = "1.0.2";
+  version = "1.0.3";
 
   outputs = [ "out" "dev" "devdoc" "glade" ];
   outputBin = "dev";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "0b8wvjabv5mg8jbng8rsd5g84lk571nm0qpna20pwp0njh2qvmrs";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    sha256 = "sha256-VZuzrMLDYkiJF+ty7SW9wYH0riaslNF3Y0zF00yGf3o=";
   };
 
   nativeBuildInputs = [
@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
     libxml2
     meson
     ninja
-    pkgconfig
+    pkg-config
     vala
   ];
 
@@ -65,7 +65,7 @@ stdenv.mkDerivation rec {
     "-Dgtk_doc=true"
   ];
 
-  # Uses define_variable in pkgconfig, but we still need it to use the glade output
+  # 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";
 
@@ -80,7 +80,7 @@ stdenv.mkDerivation rec {
       meson test --print-errorlogs
   '';
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/libhangul/default.nix b/nixpkgs/pkgs/development/libraries/libhangul/default.nix
index eb62337c502e..eea513a137cf 100644
--- a/nixpkgs/pkgs/development/libraries/libhangul/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libhangul/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   name = "libhangul-0.1.0";
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
     sha256 = "0ni9b0v70wkm0116na7ghv03pgxsfpfszhgyj3hld3bxamfal1ar";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Core algorithm library for Korean input routines";
     homepage = "https://github.com/choehwanjin/libhangul";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libharu/default.nix b/nixpkgs/pkgs/development/libraries/libharu/default.nix
index 68dba64618f5..53c14027ff36 100644
--- a/nixpkgs/pkgs/development/libraries/libharu/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libharu/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, cmake, zlib, libpng }:
+{ lib, stdenv, fetchzip, cmake, zlib, libpng }:
 
 stdenv.mkDerivation {
   name = "libharu-2.3.0";
@@ -8,13 +8,14 @@ stdenv.mkDerivation {
     sha256 = "15s9hswnl3qqi7yh29jyrg0hma2n99haxznvcywmsp8kjqlyg75q";
   };
 
-  buildInputs = [ zlib libpng cmake ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zlib libpng ];
 
   meta = {
     description = "Cross platform, open source library for generating PDF files";
     homepage = "http://libharu.org/";
-    license = stdenv.lib.licenses.zlib;
-    maintainers = [ stdenv.lib.maintainers.marcweber ];
-    platforms = stdenv.lib.platforms.unix;
+    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
index 577457afdbf8..ab0ad6fab23e 100644
--- a/nixpkgs/pkgs/development/libraries/libhdhomerun/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libhdhomerun/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ 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:
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "1v80jk056ii2iv2w7sq24i3prjrbhxql5vqhafs7vq54qmwvgbnb";
   };
 
-  patchPhase = stdenv.lib.optionalString stdenv.isDarwin ''
+  patchPhase = lib.optionalString stdenv.isDarwin ''
     substituteInPlace Makefile --replace "gcc" "cc"
     substituteInPlace Makefile --replace "-arch i386" ""
   '';
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     cp *.h $out/include/hdhomerun
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libheif/default.nix b/nixpkgs/pkgs/development/libraries/libheif/default.nix
index 4a5f6ab3bd88..b0872b9da1e4 100644
--- a/nixpkgs/pkgs/development/libraries/libheif/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libheif/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libde265, x265, libpng,
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, libde265, x265, libpng,
   libjpeg, libaom }:
 
 stdenv.mkDerivation rec {
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     sha256 = "0hjs1i076jmy4ryj8y2zs293wx53kzg38y8i42cbcsqydvsdp6hz";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ libde265 x265 libpng libjpeg libaom ];
   # TODO: enable dav1d and rav1e codecs when libheif can find them via pkg-config
 
@@ -23,9 +23,9 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://www.libheif.org/";
     description = "ISO/IEC 23008-12:2017 HEIF image file format decoder and encoder";
-    license = stdenv.lib.licenses.lgpl3;
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ gebner ];
+    license = lib.licenses.lgpl3;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ gebner ];
   };
 
 }
diff --git a/nixpkgs/pkgs/development/libraries/libhttpseverywhere/default.nix b/nixpkgs/pkgs/development/libraries/libhttpseverywhere/default.nix
index 2de7e08fb025..f54929c5378b 100644
--- a/nixpkgs/pkgs/development/libraries/libhttpseverywhere/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libhttpseverywhere/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, meson, ninja, makeFontsConf, vala, fetchpatch
+{ lib, stdenv, fetchurl, pkg-config, meson, ninja, makeFontsConf, vala, fetchpatch
 , gnome3, glib, json-glib, libarchive, libsoup, gobject-introspection }:
 
 let
@@ -8,11 +8,11 @@ in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "1jmn6i4vsm89q1axlq4ajqkzqmlmjaml9xhw3h9jnal46db6y00w";
   };
 
-  nativeBuildInputs = [ vala gobject-introspection meson ninja pkgconfig ];
+  nativeBuildInputs = [ vala gobject-introspection meson ninja pkg-config ];
   buildInputs = [ glib gnome3.libgee json-glib libsoup libarchive ];
 
   # Fixes build with vala >=0.42
@@ -39,7 +39,7 @@ in stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library to use HTTPSEverywhere in desktop applications";
     homepage = "https://gitlab.gnome.org/GNOME/libhttpseverywhere";
     license = licenses.lgpl3;
diff --git a/nixpkgs/pkgs/development/libraries/libiberty/default.nix b/nixpkgs/pkgs/development/libraries/libiberty/default.nix
index c7babb3038d3..2040ef3bee08 100644
--- a/nixpkgs/pkgs/development/libraries/libiberty/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libiberty/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildPackages
+{ lib, stdenv, buildPackages
 , staticBuild ? stdenv.hostPlatform.isStatic
 }:
 
@@ -15,13 +15,13 @@ stdenv.mkDerivation {
   postUnpack = "sourceRoot=\${sourceRoot}/libiberty";
 
   configureFlags = [ "--enable-install-libiberty" ]
-    ++ stdenv.lib.optional (!staticBuild) "--enable-shared";
+    ++ lib.optional (!staticBuild) "--enable-shared";
 
-  postInstall = stdenv.lib.optionalString (!staticBuild) ''
+  postInstall = lib.optionalString (!staticBuild) ''
     cp pic/libiberty.a $out/lib*/libiberty.a
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://gcc.gnu.org/";
     license = licenses.lgpl2;
     description = "Collection of subroutines used by various GNU programs";
diff --git a/nixpkgs/pkgs/development/libraries/libibmad/default.nix b/nixpkgs/pkgs/development/libraries/libibmad/default.nix
index 8c46efa9710a..b6df338f122e 100644
--- a/nixpkgs/pkgs/development/libraries/libibmad/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libibmad/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libibumad }:
+{ lib, stdenv, fetchurl, libibumad }:
 
 stdenv.mkDerivation rec {
   name = "libibmad-1.3.13";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libibumad ];
 
-  meta = with stdenv.lib; {
+  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
index 4c37f8564b0a..6de97ad77cd7 100644
--- a/nixpkgs/pkgs/development/libraries/libibumad/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libibumad/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "libibumad-1.3.10.2";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0bkygb3lbpaj6s4vsyixybrrkcnilbijv4ga5p1xdwyr3gip83sh";
   };
 
-  meta = with stdenv.lib; {
+  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
index c03367da97ba..7f5e739a99cd 100644
--- a/nixpkgs/pkgs/development/libraries/libical/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libical/default.nix
@@ -9,7 +9,7 @@
 , libxml2
 , ninja
 , perl
-, pkgconfig
+, pkg-config
 , libical
 , python3
 , tzdata
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
     cmake
     ninja
     perl
-    pkgconfig
+    pkg-config
     # Docs building fails:
     # https://github.com/NixOS/nixpkgs/pull/67204
     # previously with https://github.com/NixOS/nixpkgs/pull/61657#issuecomment-495579489
@@ -96,7 +96,7 @@ stdenv.mkDerivation rec {
     runHook postInstallCheck
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/libical/libical";
     description = "An Open Source implementation of the iCalendar protocols";
     license = licenses.mpl20;
diff --git a/nixpkgs/pkgs/development/libraries/libicns/default.nix b/nixpkgs/pkgs/development/libraries/libicns/default.nix
index 10d68ee3a4e9..1df2a8abb82c 100644
--- a/nixpkgs/pkgs/development/libraries/libicns/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libicns/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, autoreconfHook, libpng, openjpeg }:
+{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, libpng, openjpeg }:
 
 stdenv.mkDerivation rec {
   pname = "libicns";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ libpng openjpeg ];
   NIX_CFLAGS_COMPILE = [ "-I${openjpeg.dev}/include/${openjpeg.incDir}" ];
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/libid3tag/default.nix b/nixpkgs/pkgs/development/libraries/libid3tag/default.nix
index 9847312a34a9..8cedd1bcb418 100644
--- a/nixpkgs/pkgs/development/libraries/libid3tag/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libid3tag/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, zlib, gperf}:
+{lib, stdenv, fetchurl, zlib, gperf}:
 
 stdenv.mkDerivation rec {
   pname = "libid3tag";
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
       --subst-var-by version "${version}"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "ID3 tag manipulation library";
     homepage = "http://mad.sourceforge.net/";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libidn/default.nix b/nixpkgs/pkgs/development/libraries/libidn/default.nix
index e936f3fd92a2..afe5e550b339 100644
--- a/nixpkgs/pkgs/development/libraries/libidn/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libidn/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, libiconv }:
+{ fetchurl, lib, stdenv, libiconv }:
 
 stdenv.mkDerivation rec {
   name = "libidn-1.36";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "format" ];
 
-  buildInputs = stdenv.lib.optional stdenv.isDarwin libiconv;
+  buildInputs = lib.optional stdenv.isDarwin libiconv;
 
   doCheck = false; # fails
 
@@ -40,8 +40,8 @@ stdenv.mkDerivation rec {
     '';
 
     repositories.git = "git://git.savannah.gnu.org/libidn.git";
-    license = stdenv.lib.licenses.lgpl2Plus;
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.lgpl2Plus;
+    platforms = lib.platforms.all;
     maintainers = [ ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libidn2/default.nix b/nixpkgs/pkgs/development/libraries/libidn2/default.nix
index c5af2d16bb21..30a334266395 100644
--- a/nixpkgs/pkgs/development/libraries/libidn2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libidn2/default.nix
@@ -1,11 +1,11 @@
-{ fetchurl, stdenv, libiconv, libunistring, help2man, buildPackages }:
+{ fetchurl, lib, stdenv, libiconv, libunistring, help2man, 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 stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "libidn2";
@@ -38,8 +38,8 @@ stdenv.mkDerivation rec {
     '';
 
     repositories.git = "https://gitlab.com/jas/libidn2";
-    license = with stdenv.lib.licenses; [ lgpl3Plus gpl2Plus gpl3Plus ];
-    platforms = stdenv.lib.platforms.all;
-    maintainers = with stdenv.lib.maintainers; [ fpletz ];
+    license = with lib.licenses; [ lgpl3Plus gpl2Plus gpl3Plus ];
+    platforms = lib.platforms.all;
+    maintainers = with lib.maintainers; [ fpletz ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libiec61883/default.nix b/nixpkgs/pkgs/development/libraries/libiec61883/default.nix
index 77b2424bfee7..911210202fe0 100644
--- a/nixpkgs/pkgs/development/libraries/libiec61883/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libiec61883/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libraw1394 }:
+{ lib, stdenv, fetchurl, pkg-config, libraw1394 }:
 
 stdenv.mkDerivation rec {
   version = "1.2.0";
@@ -10,11 +10,11 @@ stdenv.mkDerivation rec {
     sha256 = "7c7879c6b9add3148baea697dfbfdcefffbc8ac74e8e6bcf46125ec1d21b373a";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   propagatedBuildInputs = [ libraw1394 ];
 
-  meta = with stdenv.lib; {
+  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
index b5708a83a7d3..7c20d1b4947c 100644
--- a/nixpkgs/pkgs/development/libraries/libieee1284/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libieee1284/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoconf, automake, libtool, xmlto, docbook_xml_dtd_412, docbook_xsl }:
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, xmlto, docbook_xml_dtd_412, docbook_xsl }:
 
 stdenv.mkDerivation rec {
   pname = "libieee1284";
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     ./bootstrap
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Parallel port communication library";
     homepage = "http://cyberelk.net/tim/software/libieee1284/";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libiio/default.nix b/nixpkgs/pkgs/development/libraries/libiio/default.nix
index 3c3ccf27884f..043e27fb4b2a 100644
--- a/nixpkgs/pkgs/development/libraries/libiio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libiio/default.nix
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
     moveToOutput ${python.sitePackages} "$python"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "API for interfacing with the Linux Industrial I/O Subsystem";
     homepage = "https://github.com/analogdevicesinc/libiio";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libimagequant/default.nix b/nixpkgs/pkgs/development/libraries/libimagequant/default.nix
index 2bca09be45f4..83a5a462ee00 100644
--- a/nixpkgs/pkgs/development/libraries/libimagequant/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libimagequant/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "libimagequant";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     patchShebangs ./configure
   '';
 
-  meta = with stdenv.lib; {
+  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.";
diff --git a/nixpkgs/pkgs/development/libraries/libime/default.nix b/nixpkgs/pkgs/development/libraries/libime/default.nix
new file mode 100644
index 000000000000..f9fcdedf1803
--- /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 = "20200715";
+  dict = fetchurl {
+    url = "https://download.fcitx-im.org/data/dict.utf8-${dictVer}.tar.xz";
+    sha256 = "1ln7r64j8mc7wz4j0q4v8wd68wy7qqz4bz1dpxk7zqbdvza6rhr3";
+  };
+in
+stdenv.mkDerivation rec {
+  pname = "libime";
+  version = "1.0.3";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = "libime";
+    rev = version;
+    sha256 = "sha256-Ykj4/3yKUqK0BRqW1E2zFYNgeUOXQ1DsotmKU6c8vEg=";
+    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
index a9a2fb6b4c18..b805be1257bd 100644
--- a/nixpkgs/pkgs/development/libraries/libimobiledevice/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libimobiledevice/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, automake, autoconf, libtool, pkgconfig, gnutls
+{ lib, stdenv, fetchFromGitHub, automake, autoconf, libtool, pkg-config, gnutls
 , libgcrypt, libtasn1, glib, libplist, libusbmuxd }:
 
 stdenv.mkDerivation rec {
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     autoconf
     automake
     libtool
-    pkgconfig
+    pkg-config
   ];
   propagatedBuildInputs = [
     glib
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
     "--without-cython"
   ];
 
-  meta = with stdenv.lib; {
+  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 = ''
diff --git a/nixpkgs/pkgs/development/libraries/libindicator/default.nix b/nixpkgs/pkgs/development/libraries/libindicator/default.nix
index 8bb90180300c..139672f6d805 100644
--- a/nixpkgs/pkgs/development/libraries/libindicator/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libindicator/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchurl, lib, file
-, pkgconfig
+, pkg-config
 , gtkVersion ? "3", gtk2 ? null, gtk3 ? null }:
 
 with lib;
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     sha256 = "b2d2e44c10313d5c9cd60db455d520f80b36dc39562df079a3f29495e8f9447f";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ (if gtkVersion == "2" then gtk2 else gtk3) ];
 
diff --git a/nixpkgs/pkgs/development/libraries/libinfinity/default.nix b/nixpkgs/pkgs/development/libraries/libinfinity/default.nix
index e018c1a9f5ea..e68d27cacff5 100644
--- a/nixpkgs/pkgs/development/libraries/libinfinity/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libinfinity/default.nix
@@ -1,6 +1,6 @@
 { gtkWidgets ? false # build GTK widgets for libinfinity
 , avahiSupport ? false # build support for Avahi in libinfinity
-, stdenv, fetchurl, pkgconfig, glib, libxml2, gnutls, gsasl
+, 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 }:
@@ -13,18 +13,18 @@ let
 
   self = stdenv.mkDerivation rec {
     pname = "libinfinity";
-    version = "0.7.1";
+    version = "0.7.2";
     src = fetchurl {
-      url = "http://releases.0x539.de/libinfinity/${pname}-${version}.tar.gz";
-      sha256 = "1jw2fhrcbpyz99bij07iyhy9ffyqdn87vl8cb1qz897y3f2f0vk2";
+      url = "https://github.com/gobby/${pname}/releases/download/${version}/${pname}-${version}.tar.gz";
+      sha256 = "17i3g61hxz9pzl3ryd1yr15142r25m06jfzjrpdy7ic1b8vjjw3f";
     };
 
     outputs = [ "bin" "out" "dev" "man" "devdoc" ];
 
-    nativeBuildInputs = [ pkgconfig gtk-doc docbook_xsl docbook_xml_dtd_412 gobject-introspection ];
+    nativeBuildInputs = [ pkg-config gtk-doc docbook_xsl docbook_xml_dtd_412 gobject-introspection ];
     buildInputs = [ glib libxml2 gsasl libidn gss libintl libdaemon ]
-      ++ stdenv.lib.optional gtkWidgets gtk3
-      ++ stdenv.lib.optional avahiSupport avahi;
+      ++ lib.optional gtkWidgets gtk3
+      ++ lib.optional avahiSupport avahi;
 
     propagatedBuildInputs = [ gnutls ];
 
@@ -39,15 +39,15 @@ let
     ];
 
     passthru = {
-      infinoted = "${self.bin}/bin/infinoted-${stdenv.lib.versions.majorMinor version}";
+      infinoted = "${self.bin}/bin/infinoted-${lib.versions.majorMinor version}";
     };
 
     meta = {
-      homepage = "http://gobby.0x539.de/";
+      homepage = "https://gobby.github.io/";
       description = "An implementation of the Infinote protocol written in GObject-based C";
-      license = stdenv.lib.licenses.lgpl2Plus;
-      maintainers = [ stdenv.lib.maintainers.phreedom ];
-      platforms = with stdenv.lib.platforms; linux ++ darwin;
+      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
index b3bdbb41588a..f678136637ae 100644
--- a/nixpkgs/pkgs/development/libraries/libinjection/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libinjection/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , python
 }:
 
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
   # no binaries, so out = library, dev = headers
   outputs = [ "out" "dev" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SQL / SQLI tokenizer parser analyzer";
     homepage    = "https://github.com/client9/libinjection";
     license     = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libinklevel/default.nix b/nixpkgs/pkgs/development/libraries/libinklevel/default.nix
index 90f6936d458a..c5dc7987ca62 100644
--- a/nixpkgs/pkgs/development/libraries/libinklevel/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libinklevel/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, libusb1 }:
+{ lib, stdenv, fetchurl, pkg-config, libusb1 }:
 
 stdenv.mkDerivation rec {
   pname = "libinklevel";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "doc" ];
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libinotify-kqueue/default.nix b/nixpkgs/pkgs/development/libraries/libinotify-kqueue/default.nix
index 074d2954ef18..ff74060d3d46 100644
--- a/nixpkgs/pkgs/development/libraries/libinotify-kqueue/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libinotify-kqueue/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, autoreconfHook }:
+{ lib, stdenv, fetchzip, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "libinotify-kqueue";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
   checkFlags = [ "test" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Inotify shim for macOS and BSD";
     homepage = "https://github.com/libinotify-kqueue/libinotify-kqueue";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libinput/default.nix b/nixpkgs/pkgs/development/libraries/libinput/default.nix
index dff2ca829559..8f1511de3304 100644
--- a/nixpkgs/pkgs/development/libraries/libinput/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libinput/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, pkgconfig, meson, ninja
+{ 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
@@ -10,7 +10,7 @@ assert eventGUISupport -> cairo != null && glib != null && gtk3 != null;
 assert testsSupport -> check != null && valgrind != null && python3 != null;
 
 let
-  mkFlag = optSet: flag: "-D${flag}=${stdenv.lib.boolToString optSet}";
+  mkFlag = optSet: flag: "-D${flag}=${lib.boolToString optSet}";
 
   sphinx-build = if documentationSupport then
     python3.pkgs.sphinx.overrideAttrs (super: {
@@ -24,7 +24,7 @@ let
   else null;
 in
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "libinput";
   version = "1.16.4";
@@ -47,7 +47,7 @@ stdenv.mkDerivation rec {
     "--libexecdir=${placeholder "bin"}/libexec"
   ];
 
-  nativeBuildInputs = [ pkgconfig meson ninja ]
+  nativeBuildInputs = [ pkg-config meson ninja ]
     ++ optionals documentationSupport [ doxygen graphviz sphinx-build ];
 
   buildInputs = [
diff --git a/nixpkgs/pkgs/development/libraries/libiodbc/default.nix b/nixpkgs/pkgs/development/libraries/libiodbc/default.nix
index c80a9bb1f920..29d4c3432ebd 100644
--- a/nixpkgs/pkgs/development/libraries/libiodbc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libiodbc/default.nix
@@ -1,4 +1,4 @@
-{ config, stdenv, fetchurl, pkgconfig, gtk2, Carbon
+{ config, lib, stdenv, fetchurl, pkg-config, gtk2, Carbon
 , useGTK ? config.libiodbc.gtk or false }:
 
 stdenv.mkDerivation rec {
@@ -9,16 +9,16 @@ stdenv.mkDerivation rec {
     sha256 = "0qpvklgr1lcn5g8xbz7fbc9rldqf9r8s6xybhqj20m4sglxgziai";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = stdenv.lib.optionals useGTK [ gtk2 ]
-                ++ stdenv.lib.optional stdenv.isDarwin Carbon;
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = lib.optionals useGTK [ gtk2 ]
+                ++ lib.optional stdenv.isDarwin Carbon;
 
   preBuild =
     ''
       export NIX_LDFLAGS_BEFORE="-rpath $out/lib"
     '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "iODBC driver manager";
     homepage = "http://www.iodbc.org";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/libipfix/default.nix b/nixpkgs/pkgs/development/libraries/libipfix/default.nix
index 69918b5d36c7..173bfafc8cc9 100644
--- a/nixpkgs/pkgs/development/libraries/libipfix/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libipfix/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   pname = "libipfix";
@@ -7,7 +7,7 @@ stdenv.mkDerivation {
     url = "mirror://sourceforge/libipfix/files/libipfix/libipfix_110209.tgz";
     sha256 = "0h7v0sxjjdc41hl5vq2x0yhyn04bczl11bqm97825mivrvfymhn6";
   };
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libipt/default.nix b/nixpkgs/pkgs/development/libraries/libipt/default.nix
index e585a2b090fc..272c61c47a5e 100644
--- a/nixpkgs/pkgs/development/libraries/libipt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libipt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "libipt";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Intel Processor Trace decoder library";
     homepage = "https://github.com/intel/libipt";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libiptcdata/default.nix b/nixpkgs/pkgs/development/libraries/libiptcdata/default.nix
index 01b23d9e2d28..140faab43b1a 100644
--- a/nixpkgs/pkgs/development/libraries/libiptcdata/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libiptcdata/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   name = "libiptcdata-1.0.4";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Library for reading and writing the IPTC metadata in images and other files";
     homepage = "http://libiptcdata.sourceforge.net/";
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
+    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
index 4bef2de28c05..56a9f1b961cf 100644
--- a/nixpkgs/pkgs/development/libraries/libircclient/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libircclient/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   version = "1.10";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
       --replace "cp "              "install "
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libirecovery/default.nix b/nixpkgs/pkgs/development/libraries/libirecovery/default.nix
index bc91593a960d..6a2f926d79ef 100644
--- a/nixpkgs/pkgs/development/libraries/libirecovery/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libirecovery/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, automake, autoconf, libtool, pkgconfig
+{ lib, stdenv, fetchFromGitHub, automake, autoconf, libtool, pkg-config
 , libusb1
 , readline
 }:
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     autoconf
     automake
     libtool
-    pkgconfig
+    pkg-config
   ];
 
   buildInputs = [
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
     ''--with-udevrule="OWNER=\"root\", GROUP=\"myusergroup\", MODE=\"0660\""''
   ];
 
-  meta = with stdenv.lib; {
+  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 = ''
diff --git a/nixpkgs/pkgs/development/libraries/libiscsi/default.nix b/nixpkgs/pkgs/development/libraries/libiscsi/default.nix
new file mode 100644
index 000000000000..adc721bc6d07
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libiscsi/default.nix
@@ -0,0 +1,26 @@
+{ 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 problem is gone on libiscsi master.
+  NIX_CFLAGS_COMPILE = if stdenv.hostPlatform.is32bit then "-Wno-error=sign-compare" else null;
+
+  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
index 28a8d7d874b8..268acb2f948d 100644
--- a/nixpkgs/pkgs/development/libraries/libisds/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libisds/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , expat
 , gpgme
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ expat gpgme libgcrypt libxml2 libxslt curl docbook_xsl ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libisoburn/default.nix b/nixpkgs/pkgs/development/libraries/libisoburn/default.nix
index 0b4984fc82a3..1e2ae41f3f22 100644
--- a/nixpkgs/pkgs/development/libraries/libisoburn/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libisoburn/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, acl, attr, zlib, libburn, libisofs }:
+{ lib, stdenv, fetchurl, acl, attr, zlib, libburn, libisofs }:
 
 stdenv.mkDerivation rec {
   pname = "libisoburn";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ attr zlib libburn libisofs ];
   propagatedBuildInputs = [ acl ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://libburnia-project.org/";
     description = "Enables creation and expansion of ISO-9660 filesystems on CD/DVD/BD ";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libisofs/default.nix b/nixpkgs/pkgs/development/libraries/libisofs/default.nix
index 0c01389f0b82..a291410941c6 100644
--- a/nixpkgs/pkgs/development/libraries/libisofs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libisofs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, acl, attr, zlib }:
+{ lib, stdenv, fetchurl, acl, attr, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "libisofs";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ attr zlib ];
   propagatedBuildInputs = [ acl ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libite/default.nix b/nixpkgs/pkgs/development/libraries/libite/default.nix
index 240636d518c3..c57876e9c4fd 100644
--- a/nixpkgs/pkgs/development/libraries/libite/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libite/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libconfuse }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, libconfuse }:
 
 stdenv.mkDerivation rec {
   pname = "libite";
@@ -11,10 +11,10 @@ stdenv.mkDerivation rec {
     sha256 = "0kad501mrvn0s0sw9pz5spjq7ymk117hnff249z6026gswrxv1mh";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ libconfuse ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit (src.meta) homepage;
     description = "Lightweight library of frog DNA";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/libivykis/default.nix b/nixpkgs/pkgs/development/libraries/libivykis/default.nix
index 1226d1c489ef..9a1c728bd55d 100644
--- a/nixpkgs/pkgs/development/libraries/libivykis/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libivykis/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, pkgconfig, file, protobufc }:
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, file, protobufc }:
 
 stdenv.mkDerivation rec {
   pname = "libivykis";
@@ -10,10 +10,10 @@ stdenv.mkDerivation rec {
     sha256 = "0abi0rc3wnncvr68hy6rmzp96x6napd7fs1mff20dr8lb0jyvy3f";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ file protobufc ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://libivykis.sourceforge.net/";
     description = ''
       A thin wrapper over various OS'es implementation of I/O readiness
diff --git a/nixpkgs/pkgs/development/libraries/libixp-hg/default.nix b/nixpkgs/pkgs/development/libraries/libixp-hg/default.nix
index e971136b088b..489f526248aa 100644
--- a/nixpkgs/pkgs/development/libraries/libixp-hg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libixp-hg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, txt2tags }:
+{ lib, stdenv, fetchurl, unzip, txt2tags }:
 
 stdenv.mkDerivation rec {
   rev = "148";
@@ -19,9 +19,9 @@ stdenv.mkDerivation rec {
   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 stdenv.lib.maintainers; [ kovirobi ];
-    license = stdenv.lib.licenses.mit;
+    maintainers = with lib.maintainers; [ kovirobi ];
+    license = lib.licenses.mit;
     inherit version;
-    platforms = with stdenv.lib.platforms; unix;
+    platforms = with lib.platforms; unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libjcat/default.nix b/nixpkgs/pkgs/development/libraries/libjcat/default.nix
index 1eca110f8cb5..974f1f6674fb 100644
--- a/nixpkgs/pkgs/development/libraries/libjcat/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libjcat/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , docbook_xml_dtd_43
 , docbook-xsl-nons
@@ -19,7 +19,7 @@
 
 stdenv.mkDerivation rec {
   pname = "libjcat";
-  version = "0.1.4";
+  version = "0.1.5";
 
   outputs = [ "bin" "out" "dev" "devdoc" "man" "installedTests" ];
 
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     owner = "hughsie";
     repo = "libjcat";
     rev = version;
-    sha256 = "156sykcdzdfmd7va59qld4gyzhbf2yk1dfgifi494g6i99zyigfh";
+    sha256 = "sha256-xf/hzTzhxKJDL5Way0Qbrs8pXCvAQ+ADtgJO2GbEvmc=";
   };
 
   patches = [
@@ -74,7 +74,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for reading and writing Jcat files";
     homepage = "https://github.com/hughsie/libjcat";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix b/nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix
index c4e81d034fc9..5fe1c2ee9ecf 100644
--- a/nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libjpeg-turbo/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, nasm
+{ lib, stdenv, fetchFromGitHub, cmake, nasm
 , enableStatic ? stdenv.hostPlatform.isStatic
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   };
 
   patches =
-    stdenv.lib.optional (stdenv.hostPlatform.libc or null == "msvcrt")
+    lib.optional (stdenv.hostPlatform.libc or null == "msvcrt")
       ./mingw-boolean.patch;
 
   outputs = [ "bin" "dev" "out" "man" "doc" ];
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
   doInstallCheck = true;
   installCheckTarget = "test";
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libjpeg/default.nix b/nixpkgs/pkgs/development/libraries/libjpeg/default.nix
index 05fbb7de701e..f462d9824a42 100644
--- a/nixpkgs/pkgs/development/libraries/libjpeg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libjpeg/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, static ? false }:
+{ lib, stdenv, fetchurl, static ? false }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation {
   name = "libjpeg-9d";
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://www.ijg.org/";
     description = "A library that implements the JPEG image file format";
-    license = stdenv.lib.licenses.free;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.free;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libjreen/default.nix b/nixpkgs/pkgs/development/libraries/libjreen/default.nix
index 141598839b06..5a70e4b01dd8 100644
--- a/nixpkgs/pkgs/development/libraries/libjreen/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libjreen/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, qt4, pkgconfig, gsasl }:
+{ lib, stdenv, fetchurl, cmake, qt4, pkg-config, gsasl }:
 
 stdenv.mkDerivation rec {
   pname = "libjreen";
@@ -9,14 +9,13 @@ stdenv.mkDerivation rec {
     sha256 = "14nwwk40xx8w6x7yaysgcr0lgzhs7l064f7ikp32s5y9a8mmp582";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ cmake qt4 gsasl ];
-  enableParallelBuilding = true;
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ qt4 gsasl ];
 
   meta = {
     description = "C++ Jabber library using Qt framework";
     homepage = "https://qutim.org/jreen/";
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
+    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
index 03d77c11bec3..e2dd30fc616f 100644
--- a/nixpkgs/pkgs/development/libraries/libjson-rpc-cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libjson-rpc-cpp/default.nix
@@ -1,19 +1,47 @@
-{ stdenv, fetchFromGitHub, cmake, jsoncpp, argtable, curl, libmicrohttpd
-, doxygen, catch, pkgconfig
+{ lib, stdenv
+, fetchFromGitHub
+, fetchpatch
+, pkg-config
+, cmake
+, argtable
+, catch2
+, curl
+, doxygen
+, hiredis
+, jsoncpp
+, libmicrohttpd
 }:
 
 stdenv.mkDerivation rec {
   pname = "libjson-rpc-cpp";
-  version = "0.7.0";
+  version = "1.3.0";
 
   src = fetchFromGitHub {
     owner = "cinemast";
     repo = "libjson-rpc-cpp";
-    sha256 = "07bg4nyvx0yyhy8c4x9i22kwqpx5jlv36dvpabgbb46ayyndhr7a";
+    sha256 = "sha256-EAakiqlfMprwLjloDekOssaB/EnAmn5njcwHGZtYs9w=";
     rev = "v${version}";
   };
 
-  NIX_CFLAGS_COMPILE = "-I${catch}/include/catch";
+  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 \
@@ -26,39 +54,45 @@ stdenv.mkDerivation rec {
     sed -i -re 's#MATCHES "jsoncpp"#MATCHES ".*/jsoncpp/json$"#g' cmake/FindJsoncpp.cmake
   '';
 
-  configurePhase = ''
+  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
   '';
 
-  installPhase = ''
-    mkdir -p $out
-
+  preInstall = ''
     function fixRunPath {
       p=$(patchelf --print-rpath $1)
-      q="$p:${stdenv.lib.makeLibraryPath [ jsoncpp argtable libmicrohttpd curl ]}:$out/lib"
+      q="$p:${lib.makeLibraryPath [ jsoncpp argtable libmicrohttpd curl ]}:$out/lib"
       patchelf --set-rpath $q $1
     }
 
-    make install
+    mkdir -p $out
+  '';
 
-    sed -i -re "s#-([LI]).*/Build/Install(.*)#-\1$out\2#g" Install/lib/pkgconfig/*.pc
-    for f in Install/lib/*.so* $(find Install/bin -executable -type f); do
+  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
   '';
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ cmake jsoncpp argtable curl libmicrohttpd doxygen catch ];
-
-  enableParallelBuilding = true;
+  installPhase = ''
+    runHook preInstall
+    make install
+    runHook postInstall
+  '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ framework for json-rpc (json remote procedure call)";
     homepage = "https://github.com/cinemast/libjson-rpc-cpp";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libjson/default.nix b/nixpkgs/pkgs/development/libraries/libjson/default.nix
index 1d6fb1e72897..42d723b3b1b4 100644
--- a/nixpkgs/pkgs/development/libraries/libjson/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libjson/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip }:
+{ lib, stdenv, fetchurl, unzip }:
 let
   version = "7.6.1";
 in stdenv.mkDerivation {
@@ -13,7 +13,7 @@ in stdenv.mkDerivation {
   makeFlags = [ "prefix=$(out)" ];
   preInstall = "mkdir -p $out/lib";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://libjson.sourceforge.net/";
     description = "A JSON reader and writer";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/libkate/default.nix b/nixpkgs/pkgs/development/libraries/libkate/default.nix
index a999f813fbb4..2135cc37d91e 100644
--- a/nixpkgs/pkgs/development/libraries/libkate/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libkate/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libogg, libpng }:
+{ lib, stdenv, fetchurl, libogg, libpng }:
 
 stdenv.mkDerivation rec {
   name = "libkate-0.4.1";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libogg libpng ];
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libkeyfinder/default.nix b/nixpkgs/pkgs/development/libraries/libkeyfinder/default.nix
index b6aa19c442a7..d2aecccdedff 100644
--- a/nixpkgs/pkgs/development/libraries/libkeyfinder/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libkeyfinder/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fftw, qtbase, qmake }:
+{ lib, stdenv, fetchFromGitHub, fftw, qtbase, qmake }:
 
 stdenv.mkDerivation rec {
   pname = "libkeyfinder";
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     cp -a lib*.so* $out/lib
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Musical key detection for digital audio (C++ library)";
     homepage = "http://www.ibrahimshaath.co.uk/keyfinder/";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libkml/default.nix b/nixpkgs/pkgs/development/libraries/libkml/default.nix
index 690d9b9801ca..0e2ab21ee792 100644
--- a/nixpkgs/pkgs/development/libraries/libkml/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libkml/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , boost
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
   cmakeFlags = [
     "-DBUILD_TESTING=ON"
   # Darwin tests require rpath for libs in build dir
-  ] ++ stdenv.lib.optional stdenv.isDarwin [
+  ] ++ lib.optional stdenv.isDarwin [
     "-DCMAKE_SKIP_BUILD_RPATH=OFF"
   ];
 
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Reference implementation of OGC KML 2.2";
     homepage = "https://github.com/libkml/libkml";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libksba/default.nix b/nixpkgs/pkgs/development/libraries/libksba/default.nix
index 7e14c1b533b5..e623aa0d1119 100644
--- a/nixpkgs/pkgs/development/libraries/libksba/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libksba/default.nix
@@ -1,4 +1,4 @@
-{ buildPackages, stdenv, fetchurl, gettext, libgpgerror }:
+{ buildPackages, lib, stdenv, fetchurl, gettext, libgpgerror }:
 
 stdenv.mkDerivation rec {
   name = "libksba-1.5.0";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     rmdir --ignore-fail-on-non-empty $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.gnupg.org";
     description = "CMS and X.509 access library";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/libksi/default.nix b/nixpkgs/pkgs/development/libraries/libksi/default.nix
index 2701cc513598..015121811710 100644
--- a/nixpkgs/pkgs/development/libraries/libksi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libksi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, openssl, curl }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, openssl, curl }:
 
 stdenv.mkDerivation rec {
   pname = "libksi";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     "--with-cafile=/etc/ssl/certs/ca-certificates.crt"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/GuardTime/libksi";
     description = "Keyless Signature Infrastructure API library";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/libktorrent/default.nix b/nixpkgs/pkgs/development/libraries/libktorrent/default.nix
index 19c24ec37549..610efa7ed4f4 100644
--- a/nixpkgs/pkgs/development/libraries/libktorrent/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libktorrent/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, extra-cmake-modules
+{ lib, stdenv, fetchurl, cmake, extra-cmake-modules
 , karchive, kcrash, ki18n, kio, solid
 , boost, gmp, qca-qt5, libgcrypt
 }:
@@ -23,13 +23,11 @@ in stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ gmp boost ];
 
-  enableParallelBuilding = true;
-
   passthru = {
     inherit mainVersion;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A BitTorrent library used by KTorrent";
     homepage    = "https://www.kde.org/applications/internet/ktorrent/";
     maintainers = with maintainers; [ eelco ];
diff --git a/nixpkgs/pkgs/development/libraries/liblangtag/default.nix b/nixpkgs/pkgs/development/libraries/liblangtag/default.nix
index b724789188cd..5a7f2fe4b36f 100644
--- a/nixpkgs/pkgs/development/libraries/liblangtag/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liblangtag/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, fetchFromBitbucket, autoreconfHook, gtk-doc, gettext
-, pkgconfig, glib, libxml2, gobject-introspection, gnome-common, unzip
+{ lib, stdenv, fetchurl, fetchFromBitbucket, autoreconfHook, gtk-doc, gettext
+, pkg-config, glib, libxml2, gobject-introspection, gnome-common, unzip
 }:
 
 stdenv.mkDerivation rec {
@@ -32,19 +32,19 @@ stdenv.mkDerivation rec {
   '';
 
   configureFlags = [
-    ''--with-locale-alias=${stdenv.cc.libc}/share/locale/locale.alias''
+    "--with-locale-alias=${stdenv.cc.libc}/share/locale/locale.alias"
   ];
 
   buildInputs = [ gettext glib libxml2 gobject-introspection gnome-common
     unzip ];
-  nativeBuildInputs = [ autoreconfHook gtk-doc gettext pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook gtk-doc gettext pkg-config ];
 
   meta = {
     inherit version;
     description = "An interface library to access tags for identifying languages";
-    license = stdenv.lib.licenses.mpl20;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.mpl20;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
     # 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
index 830e125685e7..10cdb3014791 100644
--- a/nixpkgs/pkgs/development/libraries/liblastfm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liblastfm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, pkgconfig, which, cmake
+{ lib, stdenv, fetchFromGitHub, fetchpatch, pkg-config, which, cmake
 , fftwSinglePrec, libsamplerate, qtbase
 , darwin }:
 
@@ -19,11 +19,11 @@ stdenv.mkDerivation rec {
     sha256 = "04r14prydxshjgfws3pjajjmp2msszhjjs1mjh8s66yg29vq620l";
   })];
 
-  nativeBuildInputs = [ pkgconfig which cmake ];
+  nativeBuildInputs = [ pkg-config which cmake ];
   buildInputs = [ fftwSinglePrec libsamplerate qtbase ]
-    ++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.SystemConfiguration;
+    ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.SystemConfiguration;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/lastfm/liblastfm";
     repositories.git = "git://github.com/lastfm/liblastfm.git";
     description = "Official LastFM library";
diff --git a/nixpkgs/pkgs/development/libraries/liblastfmSF/default.nix b/nixpkgs/pkgs/development/libraries/liblastfmSF/default.nix
index 46152e792763..fe3038c3249a 100644
--- a/nixpkgs/pkgs/development/libraries/liblastfmSF/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liblastfmSF/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl, pkgconfig, curl, openssl }:
+{ lib, stdenv, fetchurl, pkg-config, curl, openssl }:
 
 stdenv.mkDerivation {
   name = "liblastfm-SF-0.5";
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   propagatedBuildInputs = [ curl openssl ];
 
@@ -15,6 +15,6 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://liblastfm.sourceforge.net";
     description = "Unofficial C lastfm library";
-    license = stdenv.lib.licenses.gpl3;
+    license = lib.licenses.gpl3;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/liblaxjson/default.nix b/nixpkgs/pkgs/development/libraries/liblaxjson/default.nix
index b932f9e928b3..9464714d5cc9 100644
--- a/nixpkgs/pkgs/development/libraries/liblaxjson/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liblaxjson/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   version = "1.0.5";
@@ -11,9 +11,9 @@ stdenv.mkDerivation rec {
     sha256 = "01iqbpbhnqfifhv82m6hi8190w5sdim4qyrkss7z1zyv3gpchc5s";
   };
 
-  buildInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for parsing JSON config files";
     homepage = "https://github.com/andrewrk/liblaxjson";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/liblcf/default.nix b/nixpkgs/pkgs/development/libraries/liblcf/default.nix
index 82ac1b3144ea..2c7f09892820 100644
--- a/nixpkgs/pkgs/development/libraries/liblcf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liblcf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, expat, icu }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, expat, icu }:
 
 stdenv.mkDerivation rec {
   pname = "liblcf";
@@ -11,10 +11,10 @@ stdenv.mkDerivation rec {
     sha256 = "0b0bz9ydpc98mxbg78bgf8kil85kxyqgkzxgsjq7awzmyw7f3c1c";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   propagatedBuildInputs = [ expat icu ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library to handle RPG Maker 2000/2003 and EasyRPG projects";
     homepage = "https://github.com/EasyRPG/liblcf";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/liblinear/default.nix b/nixpkgs/pkgs/development/libraries/liblinear/default.nix
index 67eb8748f16c..3989cc59e4d8 100644
--- a/nixpkgs/pkgs/development/libraries/liblinear/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liblinear/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fixDarwinDylibNames }:
+{ lib, stdenv, fetchFromGitHub, fixDarwinDylibNames }:
 
 let
   soVersion = "4";
@@ -15,7 +15,7 @@ in stdenv.mkDerivation rec {
 
   outputs = [ "bin" "dev" "out" ];
 
-  nativeBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
+  nativeBuildInputs = lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
 
   buildFlags = [ "lib" "predict" "train" ];
 
@@ -32,7 +32,7 @@ in stdenv.mkDerivation rec {
     install -Dm444 -t $dev/include linear.h
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library for large linear classification";
     homepage = "https://www.csie.ntu.edu.tw/~cjlin/liblinear/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/liblinphone/default.nix b/nixpkgs/pkgs/development/libraries/liblinphone/default.nix
index 7d7f035f77f1..f56e6a9a5c78 100644
--- a/nixpkgs/pkgs/development/libraries/liblinphone/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liblinphone/default.nix
@@ -34,13 +34,13 @@
 , openldap
 , ortp
 , pango
-, pkgconfig
+, pkg-config
 , python
 , readline
 , soci
 , speex
 , sqlite
-, stdenv
+, lib, stdenv
 , udev
 , xercesc
 , xsd
@@ -111,7 +111,7 @@ stdenv.mkDerivation rec {
     graphviz
     intltool
     makeWrapper
-    pkgconfig
+    pkg-config
   ];
 
   # Some grammar files needed to be copied too from some dependencies. I suppose
@@ -123,7 +123,7 @@ stdenv.mkDerivation rec {
     ln -s ${belcard}/share/belr/grammars/* $out/share/belr/grammars/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.linphone.org/technical-corner/liblinphone";
     description = "Library for SIP calls and instant messaging";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/liblo/default.nix b/nixpkgs/pkgs/development/libraries/liblo/default.nix
index a25666dfcf26..5f5b23cdc3a1 100644
--- a/nixpkgs/pkgs/development/libraries/liblo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liblo/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "liblo-0.31";
@@ -13,8 +13,8 @@ stdenv.mkDerivation rec {
   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 = stdenv.lib.licenses.gpl2;
-    maintainers = [stdenv.lib.maintainers.marcweber];
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    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
index 6ed995572ef3..a2587702bb3f 100644
--- a/nixpkgs/pkgs/development/libraries/liblockfile/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liblockfile/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   _name   = "liblockfile";
@@ -21,9 +21,9 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Shared library with NFS-safe locking functions";
     homepage = "http://packages.debian.org/unstable/libs/liblockfile1";
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
-    maintainers = [ stdenv.lib.maintainers.bluescreen303 ];
-    platforms = stdenv.lib.platforms.all;
+    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
index b9b787f41829..4a28bf677412 100644
--- a/nixpkgs/pkgs/development/libraries/liblogging/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liblogging/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig
+{ lib, stdenv, fetchurl, pkg-config
 , systemd ? null
 }:
 
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "14xz00mq07qmcgprlj5b2r21ljgpa4sbwmpr6jm2wrf8wms6331k";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ systemd ];
 
   configureFlags = [
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     "--enable-man-pages"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.liblogging.org/";
     description = "Lightweight signal-safe logging library";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/liblognorm/default.nix b/nixpkgs/pkgs/development/libraries/liblognorm/default.nix
index bef1048dde46..293f72d67b2b 100644
--- a/nixpkgs/pkgs/development/libraries/liblognorm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liblognorm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libestr, json_c, pcre, fastJson }:
+{ lib, stdenv, fetchurl, pkg-config, libestr, json_c, pcre, fastJson }:
 
 stdenv.mkDerivation rec {
   name = "liblognorm-2.0.6";
@@ -8,12 +8,12 @@ stdenv.mkDerivation rec {
     sha256 = "1wpn15c617r7lfm1z9d5aggmmi339s6yn4pdz698j0r2bkl5gw6g";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libestr json_c pcre fastJson ];
 
   configureFlags = [ "--enable-regexp" ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/liblouis/default.nix b/nixpkgs/pkgs/development/libraries/liblouis/default.nix
index d29cbf6a7195..1dec830566f8 100644
--- a/nixpkgs/pkgs/development/libraries/liblouis/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liblouis/default.nix
@@ -1,7 +1,7 @@
 { fetchFromGitHub
-, stdenv
+, lib, stdenv
 , autoreconfHook
-, pkgconfig
+, pkg-config
 , gettext
 , python3
 , texinfo
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     autoreconfHook
-    pkgconfig
+    pkg-config
     gettext
     python3
     # Docs, man, info
@@ -58,7 +58,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Open-source braille translator and back-translator";
     homepage = "http://liblouis.org/";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/liblqr-1/default.nix b/nixpkgs/pkgs/development/libraries/liblqr-1/default.nix
index 5f37989c20b8..b871dbdb19d2 100644
--- a/nixpkgs/pkgs/development/libraries/liblqr-1/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liblqr-1/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib }:
+{ lib, stdenv, fetchurl, pkg-config, glib }:
 
 stdenv.mkDerivation rec {
   name = "liblqr-1-0.4.2";
@@ -8,10 +8,10 @@ stdenv.mkDerivation rec {
     sha256 = "0dzikxzjz5zmy3vnydh90aqk23q0qm8ykx6plz6p4z90zlp84fhp";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   propagatedBuildInputs = [ glib ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://liblqr.wikidot.com";
     description = "Seam-carving C/C++ library called Liquid Rescaling";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/liblscp/default.nix b/nixpkgs/pkgs/development/libraries/liblscp/default.nix
index 101e11deaa51..dcb862f2cd4d 100644
--- a/nixpkgs/pkgs/development/libraries/liblscp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liblscp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoconf, automake, libtool, pkgconfig }:
+{ lib, stdenv, fetchurl, autoconf, automake, libtool, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "liblscp";
@@ -9,13 +9,13 @@ stdenv.mkDerivation rec {
     sha256 = "1rl7ssdzj0z3658yvdijmb27n2lcwmplx4qxg5mwrm07pvs7i75k";
   };
 
-  nativeBuildInputs = [ autoconf automake libtool pkgconfig ];
+  nativeBuildInputs = [ autoconf automake libtool pkg-config ];
 
   preConfigure = "make -f Makefile.git";
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.linuxsampler.org";
     description = "LinuxSampler Control Protocol (LSCP) wrapper library";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libltc/default.nix b/nixpkgs/pkgs/development/libraries/libltc/default.nix
index 4513396d7eaf..2391d281d46a 100644
--- a/nixpkgs/pkgs/development/libraries/libltc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libltc/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation {
   name = "libltc-1.3.1";
@@ -8,7 +8,7 @@ stdenv.mkDerivation {
     sha256 = "173h9dgmain3nyrwk6q2d7yl4fnh4vacag4s2p01n5b7nyrkxrjh";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://x42.github.io/libltc/";
     description = "POSIX-C Library for handling Linear/Logitudinal Time Code (LTC)";
     license = licenses.lgpl3Plus;
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
index 84800f309fb4..dd7923486865 100644
--- a/nixpkgs/pkgs/development/libraries/libmad/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmad/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, autoconf }:
+{ lib, stdenv, fetchurl, fetchpatch, autoconf }:
 
 stdenv.mkDerivation rec {
   pname = "libmad";
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
   # optimize.diff is taken from https://projects.archlinux.org/svntogit/packages.git/tree/trunk/optimize.diff?h=packages/libmad
   # It is included here in order to fix a build failure in Clang
   # But it may be useful to fix other, currently unknown problems as well
-  ++ stdenv.lib.optionals stdenv.cc.isClang [
+  ++ lib.optionals stdenv.cc.isClang [
     (fetchpatch {
       url = "https://github.com/KaOSx/main/raw/1270b8080f37fb6cca562829a521991800b0a497/libmad/optimize.diff";
       sha256 = "0hcxzz9ql1fizyqbsgdchdwi7bvchfr72172j43hpyj53p0yabc6";
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
 
   preConfigure = "autoconf";
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libmanette/default.nix b/nixpkgs/pkgs/development/libraries/libmanette/default.nix
index 0cb233ad271c..76dd4eb20c1a 100644
--- a/nixpkgs/pkgs/development/libraries/libmanette/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmanette/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , ninja
 , meson
-, pkgconfig
+, pkg-config
 , vala
 , gobject-introspection
 , gtk-doc
@@ -21,14 +21,14 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1b3bcdkk5xd5asq797cch9id8692grsjxrc1ss87vv11m1ck4rb3";
   };
 
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     vala
     gobject-introspection
     gtk-doc
@@ -54,7 +54,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A simple GObject game controller library";
     homepage = "https://gnome.pages.gitlab.gnome.org/libmanette/";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libmatchbox/default.nix b/nixpkgs/pkgs/development/libraries/libmatchbox/default.nix
index 49769359ed32..50b66eccfb3d 100644
--- a/nixpkgs/pkgs/development/libraries/libmatchbox/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmatchbox/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libX11, libXext, libpng, libXft, libICE, pango, libjpeg}:
+{ lib, stdenv, fetchurl, libX11, libXext, libpng, libXft, libICE, pango, libjpeg}:
 
 stdenv.mkDerivation rec {
   pname = "libmatchbox";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Library of the matchbox X window manager";
     homepage = "http://matchbox-project.org/";
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
+    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
index a24b931c6605..b0fe1c35ef3a 100644
--- a/nixpkgs/pkgs/development/libraries/libmatheval/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmatheval/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchurl, pkgconfig, guile, autoconf, flex, fetchpatch }:
+{ lib, stdenv, fetchurl, pkg-config, guile, autoconf, flex, fetchpatch }:
 
 stdenv.mkDerivation rec {
   version = "1.1.11";
   pname = "libmatheval";
 
-  nativeBuildInputs = [ pkgconfig autoconf flex ];
+  nativeBuildInputs = [ pkg-config autoconf flex ];
   buildInputs = [ guile ];
 
   src = fetchurl {
@@ -38,9 +38,9 @@ stdenv.mkDerivation rec {
       symbolic derivatives and output expressions to strings.
     '';
     homepage = "https://www.gnu.org/software/libmatheval/";
-    license = stdenv.lib.licenses.gpl3;
-    maintainers = [ stdenv.lib.maintainers.bzizou ];
-    platforms = stdenv.lib.platforms.linux;
+    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
index 5d065636a922..1d3cf4032dda 100644
--- a/nixpkgs/pkgs/development/libraries/libmatroska/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmatroska/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
 , libebml }:
 
 stdenv.mkDerivation rec {
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "0yhr9hhgljva1fx3b0r4s3wkkypdfgsysbl35a4g3krkbhaa9rsd";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
   buildInputs = [ libebml ];
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     "-DBUILD_SHARED_LIBS=YES"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library to parse Matroska files";
     homepage = "https://matroska.org/";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libmaxminddb/default.nix b/nixpkgs/pkgs/development/libraries/libmaxminddb/default.nix
index 94a4b9ec57c6..078865198a45 100644
--- a/nixpkgs/pkgs/development/libraries/libmaxminddb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmaxminddb/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "libmaxminddb";
-  version = "1.4.3";
+  version = "1.5.0";
 
   src = fetchurl {
     url = meta.homepage + "/releases/download/${version}/${pname}-${version}.tar.gz";
-    sha256 = "0fd4a4sxiiwzbd5h74wl1ijnb7xybjyybb7q41vdq3w8nk3zdzd5";
+    sha256 = "sha256-fFbnkf8qZVIV5+04ZLH/3X00o4g1d57+1WpC8Fa9WKo=";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C library for working with MaxMind geolocation DB files";
     homepage = "https://github.com/maxmind/libmaxminddb";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/libmbim/default.nix b/nixpkgs/pkgs/development/libraries/libmbim/default.nix
index fdf724c09fda..850c7aa1df0c 100644
--- a/nixpkgs/pkgs/development/libraries/libmbim/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmbim/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , pkg-config
 , gobject-introspection
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libmcrypt/default.nix b/nixpkgs/pkgs/development/libraries/libmcrypt/default.nix
index a29fca45a99f..44c55cb4682b 100644
--- a/nixpkgs/pkgs/development/libraries/libmcrypt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmcrypt/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchurl, darwin, disablePosixThreads ? false }:
+{ lib, stdenv, fetchurl, darwin, disablePosixThreads ? false }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation {
   name = "libmcrypt-2.5.8";
-  
+
   src = fetchurl {
     url = "mirror://sourceforge/mcrypt/Libmcrypt/2.5.8/libmcrypt-2.5.8.tar.gz";
     sha256 = "0gipgb939vy9m66d3k8il98rvvwczyaw2ixr8yn6icds9c3nrsz4";
diff --git a/nixpkgs/pkgs/development/libraries/libmd/default.nix b/nixpkgs/pkgs/development/libraries/libmd/default.nix
index e3dd0b206f10..7093376aa7e5 100644
--- a/nixpkgs/pkgs/development/libraries/libmd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook }:
+{ lib, stdenv, fetchurl, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "libmd";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook ];
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libmediaart/default.nix b/nixpkgs/pkgs/development/libraries/libmediaart/default.nix
index 38adebb2a487..28c8ae6db940 100644
--- a/nixpkgs/pkgs/development/libraries/libmediaart/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmediaart/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig, vala, gtk-doc, docbook_xsl, docbook_xml_dtd_412, glib, gdk-pixbuf, gobject-introspection, gnome3, fetchpatch }:
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, vala, gtk-doc, docbook_xsl, docbook_xml_dtd_412, glib, gdk-pixbuf, gobject-introspection, gnome3, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "libmediaart";
@@ -7,11 +7,11 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "a57be017257e4815389afe4f58fdacb6a50e74fd185452b23a652ee56b04813d";
   };
 
-  nativeBuildInputs = [ meson ninja pkgconfig vala gtk-doc docbook_xsl docbook_xml_dtd_412 gobject-introspection ];
+  nativeBuildInputs = [ meson ninja pkg-config vala gtk-doc docbook_xsl docbook_xml_dtd_412 gobject-introspection ];
   buildInputs = [ glib gdk-pixbuf ];
 
   patches = [
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library tasked with managing, extracting and handling media art caches";
     maintainers = teams.gnome.members;
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libmediainfo/default.nix b/nixpkgs/pkgs/development/libraries/libmediainfo/default.nix
index 31d64101e6bf..d78ccbc50aba 100644
--- a/nixpkgs/pkgs/development/libraries/libmediainfo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmediainfo/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, pkgconfig, libzen, zlib }:
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, libzen, zlib }:
 
 stdenv.mkDerivation rec {
   version = "20.09";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "15ni9pnch6688m72swwax109a7mg4a08yx75qknrx7qa6dbyhz6h";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ libzen zlib ];
 
   sourceRoot = "./MediaInfoLib/Project/GNU/Library/";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     install -vD -m 644 libmediainfo.pc "$out/lib/pkgconfig/libmediainfo.pc"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Shared library for mediainfo";
     homepage = "https://mediaarea.net/";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/libmemcached/default.nix b/nixpkgs/pkgs/development/libraries/libmemcached/default.nix
index 8cbb76377fb0..0ee0701d9290 100644
--- a/nixpkgs/pkgs/development/libraries/libmemcached/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmemcached/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, cyrus_sasl, libevent }:
+{ lib, stdenv, fetchurl, fetchpatch, cyrus_sasl, libevent }:
 
 stdenv.mkDerivation {
   name = "libmemcached-1.0.18";
@@ -13,19 +13,19 @@ stdenv.mkDerivation {
   # https://bugs.launchpad.net/libmemcached/+bug/1281907
   # Fix building on macOS (patch from Homebrew)
   # https://bugs.launchpad.net/libmemcached/+bug/1245562
-  patches = stdenv.lib.optional stdenv.isLinux ./libmemcached-fix-linking-with-libpthread.patch
-    ++ stdenv.lib.optional stdenv.isDarwin (fetchpatch {
+  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";
     })
-    ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./musl-fixes.patch;
+    ++ lib.optional stdenv.hostPlatform.isMusl ./musl-fixes.patch;
 
   buildInputs = [ libevent ];
   propagatedBuildInputs = [ cyrus_sasl ];
 
   NIX_CFLAGS_COMPILE = "-fpermissive";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://libmemcached.org";
     description = "Open source C/C++ client library and tools for the memcached server";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libmesode/default.nix b/nixpkgs/pkgs/development/libraries/libmesode/default.nix
index 54ff0dccb90e..128975246a8a 100644
--- a/nixpkgs/pkgs/development/libraries/libmesode/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmesode/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook
 , libtool
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Fork of libstrophe (https://github.com/strophe/libstrophe) for use with Profanity XMPP Client";
     longDescription = ''
       Reasons for forking:
diff --git a/nixpkgs/pkgs/development/libraries/libmhash/default.nix b/nixpkgs/pkgs/development/libraries/libmhash/default.nix
index 2a61c5710669..f569ce7fac75 100644
--- a/nixpkgs/pkgs/development/libraries/libmhash/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmhash/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "mhash";
@@ -23,6 +23,6 @@ stdenv.mkDerivation rec {
     '';
     homepage = "http://mhash.sourceforge.net";
     license = "LGPL";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libmicrodns/default.nix b/nixpkgs/pkgs/development/libraries/libmicrodns/default.nix
index 69dd052dc036..c9dd899a2b00 100644
--- a/nixpkgs/pkgs/development/libraries/libmicrodns/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmicrodns/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 }:
 
 stdenv.mkDerivation rec {
@@ -19,10 +19,10 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Minimal mDNS resolver library, used by VLC";
     homepage = "https://github.com/videolabs/libmicrodns";
     license = licenses.lgpl21;
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..8eeb94cdc295
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libmicrohttpd/0.9.72.nix
@@ -0,0 +1,10 @@
+{ stdenv, 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
index 9b817f21b94c..336b66ac8323 100644
--- a/nixpkgs/pkgs/development/libraries/libmicrohttpd/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/libmicrohttpd/generic.nix
@@ -1,11 +1,11 @@
-{ stdenv, libgcrypt, curl, gnutls, pkgconfig, libiconv, libintl, version, src }:
+{ 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 = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libgcrypt curl gnutls libiconv libintl ];
 
   preCheck = ''
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   # Disabled because the tests can time-out.
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Embeddable HTTP server library";
 
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/libmikmod/default.nix b/nixpkgs/pkgs/development/libraries/libmikmod/default.nix
index 59967bcba5a2..a734a4b80092 100644
--- a/nixpkgs/pkgs/development/libraries/libmikmod/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmikmod/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, texinfo, alsaLib, libpulseaudio, CoreAudio }:
+{ lib, stdenv, fetchurl, texinfo, alsaLib, libpulseaudio, CoreAudio }:
 
 let
-  inherit (stdenv.lib) optional optionalString;
+  inherit (lib) optional optionalString;
 
 in stdenv.mkDerivation rec {
   name = "libmikmod-3.3.11.1";
@@ -18,7 +18,7 @@ in stdenv.mkDerivation rec {
 
   NIX_LDFLAGS = optionalString stdenv.isLinux "-lasound";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library for playing tracker music module files";
     homepage    = "https://mikmod.shlomifish.org/";
     license     = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libmilter/default.nix b/nixpkgs/pkgs/development/libraries/libmilter/default.nix
index f937d818a559..9287b0a0dea7 100644
--- a/nixpkgs/pkgs/development/libraries/libmilter/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmilter/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, m4 }:
+{ lib, stdenv, fetchurl, m4 }:
 
 stdenv.mkDerivation rec {
   pname = "libmilter";
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ m4 ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Sendmail Milter mail filtering API library";
     platforms = platforms.unix;
     maintainers = with maintainers; [ fpletz ];
diff --git a/nixpkgs/pkgs/development/libraries/libminc/default.nix b/nixpkgs/pkgs/development/libraries/libminc/default.nix
index ce39285e0d23..2440082cce9d 100644
--- a/nixpkgs/pkgs/development/libraries/libminc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libminc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, zlib, netcdf, nifticlib, hdf5 }:
+{ lib, stdenv, fetchFromGitHub, cmake, zlib, netcdf, nifticlib, hdf5 }:
 
 stdenv.mkDerivation rec {
   pname   = "libminc";
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
     # ezminc_rw_test: can't find libminc_io.so.5.2.0
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/BIC-MNI/libminc";
     description = "Medical imaging library based on HDF5";
     maintainers = with maintainers; [ bcdarwin ];
diff --git a/nixpkgs/pkgs/development/libraries/libmkv/default.nix b/nixpkgs/pkgs/development/libraries/libmkv/default.nix
index 9a754eda592f..584d76e1cf2b 100644
--- a/nixpkgs/pkgs/development/libraries/libmkv/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmkv/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, libtool, autoconf, automake }:
+{ lib, stdenv, fetchFromGitHub, libtool, autoconf, automake }:
 
 stdenv.mkDerivation rec {
   pname = "libmkv";
@@ -22,8 +22,8 @@ stdenv.mkDerivation rec {
       It is written in plain C, and intended to be very portable.
     '';
     homepage = "https://github.com/saintdev/libmkv";
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = [ stdenv.lib.maintainers.wmertens ];
-    platforms = stdenv.lib.platforms.unix;
+    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
index 3753101ebf98..83add1d42a5d 100644
--- a/nixpkgs/pkgs/development/libraries/libmms/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmms/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, glib, pkgconfig }:
+{ lib, stdenv, fetchurl, glib, pkg-config }:
 
 stdenv.mkDerivation rec {
   name = "libmms-0.6.4";
@@ -10,9 +10,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ glib ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for downloading (streaming) media files using the mmst and mmsh protocols";
     homepage = "http://libmms.sourceforge.net";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/libmng/default.nix b/nixpkgs/pkgs/development/libraries/libmng/default.nix
index e13bda567932..f1704a527b44 100644
--- a/nixpkgs/pkgs/development/libraries/libmng/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmng/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, zlib, libpng, libjpeg, lcms2 }:
+{ lib, stdenv, fetchurl, zlib, libpng, libjpeg, lcms2 }:
 
 stdenv.mkDerivation rec {
   name = "libmng-2.0.3";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ zlib libpng libjpeg lcms2 ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Reference library for reading, displaying, writing and examining Multiple-Image Network Graphics";
     homepage = "http://www.libmng.com";
     license = licenses.zlib;
diff --git a/nixpkgs/pkgs/development/libraries/libmnl/default.nix b/nixpkgs/pkgs/development/libraries/libmnl/default.nix
index 3db6ab0da081..4e99258a3e80 100644
--- a/nixpkgs/pkgs/development/libraries/libmnl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmnl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "libmnl-1.0.4";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
       re-inventing the wheel.
     '';
     homepage = "https://netfilter.org/projects/libmnl/index.html";
-    license = stdenv.lib.licenses.lgpl21Plus;
+    license = lib.licenses.lgpl21Plus;
 
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libmodbus/default.nix b/nixpkgs/pkgs/development/libraries/libmodbus/default.nix
index 14f80e9b2e5a..b311c4f04181 100644
--- a/nixpkgs/pkgs/development/libraries/libmodbus/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmodbus/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "libmodbus-3.1.6";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     "ac_cv_func_realloc_0_nonnull=yes"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library to send/receive data according to the Modbus protocol";
     homepage = "https://libmodbus.org/";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libmodplug/default.nix b/nixpkgs/pkgs/development/libraries/libmodplug/default.nix
index 2d38a5021e51..790674f1649e 100644
--- a/nixpkgs/pkgs/development/libraries/libmodplug/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmodplug/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, file }:
+{ lib, stdenv, fetchurl, file }:
 
 let
   version = "0.8.9.0";
@@ -12,7 +12,7 @@ in stdenv.mkDerivation rec {
         --replace /usr/bin/file ${file}/bin/file
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "MOD playing library";
     homepage    = "http://modplug-xmms.sourceforge.net/";
     license     = licenses.publicDomain;
diff --git a/nixpkgs/pkgs/development/libraries/libmodule/default.nix b/nixpkgs/pkgs/development/libraries/libmodule/default.nix
index d608a08d2d92..d77d2bcbdcd7 100644
--- a/nixpkgs/pkgs/development/libraries/libmodule/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmodule/default.nix
@@ -1,23 +1,23 @@
-{ stdenv, fetchFromGitHub
-, cmake, pkgconfig }:
+{ lib, stdenv, fetchFromGitHub
+, cmake, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "libmodule";
-  version = "5.0.0";
+  version = "5.0.1";
 
   src = fetchFromGitHub {
     owner = "FedeDP";
     repo = "libmodule";
     rev = version;
-    sha256 = "1cf81sl33xmfn5g150iqcdrjn0lpjlgp53mganwi6x7jda2qk7r6";
+    sha256 = "sha256-wkRiDWO9wUyxkAeqvm99u22Jq4xnQJx6zS7Sb+R8iMg=";
   };
 
   nativeBuildInputs = [
     cmake
-    pkgconfig
+    pkg-config
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C simple and elegant implementation of an actor library";
     homepage = "https://github.com/FedeDP/libmodule";
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/libmodulemd/default.nix b/nixpkgs/pkgs/development/libraries/libmodulemd/default.nix
index a0d32f5178a9..8a8d9adf53d8 100644
--- a/nixpkgs/pkgs/development/libraries/libmodulemd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmodulemd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , substituteAll
 , fetchFromGitHub
 , fetchpatch
@@ -78,7 +78,7 @@ stdenv.mkDerivation rec {
     echo "$out ${python3.pkgs.pygobject3} ${python3.pkgs.six}" > "$py/nix-support/propagated-build-inputs"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C Library for manipulating module metadata files";
     homepage = "https://github.com/fedora-modularity/libmodulemd";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libmongo-client/default.nix b/nixpkgs/pkgs/development/libraries/libmongo-client/default.nix
index b3231d1af91c..f81f63133384 100644
--- a/nixpkgs/pkgs/development/libraries/libmongo-client/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmongo-client/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, glib }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, glib }:
 
 stdenv.mkDerivation rec {
   name = "libmongo-client-0.1.8";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1cjx06i3gd9zkyvwm2ysjrf0hkhr7bjg3c27s7n0y31j10igfjp0";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ ];
   propagatedBuildInputs = [ glib ];
 
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     sed -i 's/Requires.private/Requires/g' src/libmongo-client.pc.in
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://algernon.github.io/libmongo-client/";
     description = "An alternative C driver for MongoDB";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/libmowgli/default.nix b/nixpkgs/pkgs/development/libraries/libmowgli/default.nix
index ae3a9efef24f..e227c09b2b61 100644
--- a/nixpkgs/pkgs/development/libraries/libmowgli/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmowgli/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "libmowgli";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0xx4vndmwz40pxa5gikl8z8cskpdl9a30i2i5fjncqzlp4pspymp";
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libmp3splt/default.nix b/nixpkgs/pkgs/development/libraries/libmp3splt/default.nix
index 237e3f94cfc9..58da7560e137 100644
--- a/nixpkgs/pkgs/development/libraries/libmp3splt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmp3splt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libtool, libmad, libid3tag }:
+{ lib, stdenv, fetchurl, libtool, libmad, libid3tag }:
 
 stdenv.mkDerivation rec {
   name = "libmp3splt-0.9.2";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--disable-pcre" ];
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/libmpack/default.nix b/nixpkgs/pkgs/development/libraries/libmpack/default.nix
index 736474d29a5f..b62da40499cd 100644
--- a/nixpkgs/pkgs/development/libraries/libmpack/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmpack/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, libtool }:
+{ lib, stdenv, fetchFromGitHub, libtool }:
 
 stdenv.mkDerivation rec {
   pname = "libmpack";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "LIBTOOL=libtool" "PREFIX=$(out)" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Simple implementation of msgpack in C";
     homepage = "https://github.com/tarruda/libmpack/";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libmpc/default.nix b/nixpkgs/pkgs/development/libraries/libmpc/default.nix
index 79fa17437819..66e38fbfbc04 100644
--- a/nixpkgs/pkgs/development/libraries/libmpc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmpc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , gmp, mpfr
 }:
 
@@ -33,9 +33,9 @@ stdenv.mkDerivation {
       '';
 
     homepage = "http://mpc.multiprecision.org/";
-    license = stdenv.lib.licenses.lgpl2Plus;
+    license = lib.licenses.lgpl2Plus;
 
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
     maintainers = [ ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libmpcdec/default.nix b/nixpkgs/pkgs/development/libraries/libmpcdec/default.nix
index 3ee37e6ae9c6..b42d9a3d1e43 100644
--- a/nixpkgs/pkgs/development/libraries/libmpcdec/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmpcdec/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   name = "libmpcdec-1.2.6";
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
 
   meta = {
     description = "Musepack SV7 decoder library";
-    platforms = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.bsd3;
+    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
index d6fb28c0e88c..bf5f25ca43f8 100644
--- a/nixpkgs/pkgs/development/libraries/libmpeg2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmpeg2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   version = "0.5.1";
@@ -10,13 +10,13 @@ stdenv.mkDerivation rec {
   };
 
   # Otherwise clang fails with 'duplicate symbol ___sputc'
-  buildFlags = stdenv.lib.optional stdenv.isDarwin "CFLAGS=-std=gnu89";
+  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 = stdenv.lib.licenses.gpl2;
-    maintainers = with stdenv.lib.maintainers; [ ];
-    platforms = with stdenv.lib.platforms; unix;
+    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
index aa70e4c4ddff..df3460970d17 100644
--- a/nixpkgs/pkgs/development/libraries/libmrss/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmrss/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, curl, libnxml, pkgconfig}:
+{lib, stdenv, fetchurl, curl, libnxml, pkg-config}:
 
 stdenv.mkDerivation {
   name = "libmrss-0.19.2";
@@ -8,15 +8,15 @@ stdenv.mkDerivation {
     sha256 = "02r1bgj8qlkn63xqfi5yq8y7wrilxcnkycaag8qskhg5ranic507";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  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 = stdenv.lib.licenses.lgpl2;
+    license = lib.licenses.lgpl2;
 
-    platforms = stdenv.lib.platforms.all;
-    maintainers = [ stdenv.lib.maintainers.viric ];
+    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
index 70fdd7e913ed..4ad60bcfb181 100644
--- a/nixpkgs/pkgs/development/libraries/libmspack/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmspack/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   name = "libmspack-0.7.1alpha";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A de/compression library for various Microsoft formats";
     homepage = "https://www.cabextract.org.uk/libmspack";
-    license = stdenv.lib.licenses.lgpl2;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.lgpl2;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libmtp/default.nix b/nixpkgs/pkgs/development/libraries/libmtp/default.nix
index e9cfd0f9856a..a49026c35dcd 100644
--- a/nixpkgs/pkgs/development/libraries/libmtp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmtp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoconf, automake, gettext, libtool, pkgconfig
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, gettext, libtool, pkg-config
 , libusb1
 , libiconv
 }:
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     automake
     gettext
     libtool
-    pkgconfig
+    pkg-config
   ];
 
   buildInputs = [
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
   # tried to install files to /lib/udev, hopefully OK
   configureFlags = [ "--with-udev=$$bin/lib/udev" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://libmtp.sourceforge.net";
     description = "An implementation of Microsoft's Media Transfer Protocol";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/libmusicbrainz/5.x.nix b/nixpkgs/pkgs/development/libraries/libmusicbrainz/5.x.nix
index 2fdcdc7d86d6..3e7a2f1a0ba0 100644
--- a/nixpkgs/pkgs/development/libraries/libmusicbrainz/5.x.nix
+++ b/nixpkgs/pkgs/development/libraries/libmusicbrainz/5.x.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchFromGitHub, cmake, neon, libdiscid, libxml2, pkgconfig }:
+{ lib, stdenv, fetchFromGitHub, cmake, neon, libdiscid, libxml2, pkg-config }:
 
 stdenv.mkDerivation rec {
   version = "5.1.0";
   pname = "libmusicbrainz";
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ cmake neon libdiscid libxml2 ];
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ neon libdiscid libxml2 ];
 
   src = fetchFromGitHub {
     owner  = "metabrainz";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   dontUseCmakeBuildDir=true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://musicbrainz.org/doc/libmusicbrainz";
     description = "MusicBrainz Client Library (5.x version)";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/libmusicbrainz/default.nix b/nixpkgs/pkgs/development/libraries/libmusicbrainz/default.nix
index 0db539a23afe..ab67d544a1df 100644
--- a/nixpkgs/pkgs/development/libraries/libmusicbrainz/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmusicbrainz/default.nix
@@ -1,16 +1,17 @@
-{ stdenv, fetchurl, cmake, neon, libdiscid }:
+{ lib, stdenv, fetchurl, cmake, neon, libdiscid }:
 
 stdenv.mkDerivation rec {
   name = "libmusicbrainz-3.0.3";
 
-  buildInputs = [ cmake neon libdiscid ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ neon libdiscid ];
 
   src = fetchurl {
     url = "ftp://ftp.musicbrainz.org/pub/musicbrainz/${name}.tar.gz";
     sha256 = "1i9qly13bwwmgj68vma766hgvsd1m75236haqsp9zgh5znlmkm3z";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://musicbrainz.org/doc/libmusicbrainz";
     description = "MusicBrainz Client Library (3.x version)";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/libmwaw/default.nix b/nixpkgs/pkgs/development/libraries/libmwaw/default.nix
index 2ab23015af32..17e20e3d3997 100644
--- a/nixpkgs/pkgs/development/libraries/libmwaw/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmwaw/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, boost, pkgconfig, cppunit, zlib, libwpg, libwpd, librevenge}:
+{lib, stdenv, fetchurl, boost, pkg-config, cppunit, zlib, libwpg, libwpd, librevenge}:
 let
   s = # Generated upstream information
   rec {
@@ -10,7 +10,7 @@ let
     sha256="074ipcq9w7jbd5x316dzclddgia2ydw098ph9d7p3d713pmkf5cf";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [
     boost cppunit zlib libwpg libwpd librevenge
   ];
@@ -23,9 +23,9 @@ stdenv.mkDerivation {
   };
   meta = {
     inherit (s) version;
-    description = ''Import library for some old mac text documents'';
-    license = stdenv.lib.licenses.mpl20 ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.unix;
+    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/libmx/default.nix b/nixpkgs/pkgs/development/libraries/libmx/default.nix
index 623c872fa1ac..f4256de6981b 100644
--- a/nixpkgs/pkgs/development/libraries/libmx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmx/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl
-, libtool, pkgconfig, automake, autoconf, intltool
+{ lib, stdenv, fetchurl
+, libtool, pkg-config, automake, autoconf, intltool
 , glib, gobject-introspection, gtk2, gtk-doc
 , clutter, clutter-gtk
 }:
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
 
   configureScript = "sh autogen.sh";
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [
     automake autoconf libtool
     intltool
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
     sed -i 's/GLfloat/gfloat/g' mx/mx-texture-frame.c
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.clutter-project.org/";
     description = "A Clutter-based toolkit";
     longDescription =
diff --git a/nixpkgs/pkgs/development/libraries/libmypaint/default.nix b/nixpkgs/pkgs/development/libraries/libmypaint/default.nix
index 074e38429331..655480f75a2f 100644
--- a/nixpkgs/pkgs/development/libraries/libmypaint/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmypaint/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , autoconf
 , automake
 , fetchFromGitHub
@@ -6,7 +6,7 @@
 , intltool
 , json_c
 , libtool
-, pkgconfig
+, pkg-config
 , python3
 }:
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     automake
     intltool
     libtool
-    pkgconfig
+    pkg-config
     python3
   ];
 
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
 
   preConfigure = "./autogen.sh";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://mypaint.org/";
     description = "Library for making brushstrokes which is used by MyPaint and other projects";
     license = licenses.isc;
diff --git a/nixpkgs/pkgs/development/libraries/libmysqlconnectorcpp/default.nix b/nixpkgs/pkgs/development/libraries/libmysqlconnectorcpp/default.nix
index 6c4874112b73..4c00d6425880 100644
--- a/nixpkgs/pkgs/development/libraries/libmysqlconnectorcpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libmysqlconnectorcpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , cmake
 , boost
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://dev.mysql.com/downloads/connector/cpp/";
     description = "C++ library for connecting to mysql servers";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.unix;
+    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
index 4c3ceee1e561..af5e78c25d66 100644
--- a/nixpkgs/pkgs/development/libraries/libnabo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnabo/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, cmake, eigen, boost}:
+{lib, stdenv, fetchFromGitHub, cmake, eigen, boost}:
 
 stdenv.mkDerivation rec {
   version = "1.0.7";
@@ -11,9 +11,8 @@ stdenv.mkDerivation rec {
     sha256 = "17vxlmszzpm95vvfdxnm98d5p297i10fyblblj6kf0ynq8r2mpsh";
   };
 
-  buildInputs = [cmake eigen boost];
-
-  enableParallelBuilding = true;
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ eigen boost ];
 
   cmakeFlags = [
     "-DEIGEN_INCLUDE_DIR=${eigen}/include/eigen3"
@@ -22,7 +21,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
   checkTarget = "test";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit (src.meta) homepage;
     description = "A fast K Nearest Neighbor library for low-dimensional spaces";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libnatpmp/default.nix b/nixpkgs/pkgs/development/libraries/libnatpmp/default.nix
index a2aae1263597..dd902c0021dd 100644
--- a/nixpkgs/pkgs/development/libraries/libnatpmp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnatpmp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "libnatpmp";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "INSTALLPREFIX=$(out)" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://miniupnp.free.fr/libnatpmp.html";
     description = "NAT-PMP client";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libnats-c/default.nix b/nixpkgs/pkgs/development/libraries/libnats-c/default.nix
index 3916ff35f696..3d1e2b7ac4a3 100644
--- a/nixpkgs/pkgs/development/libraries/libnats-c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnats-c/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , cmake, protobuf, protobufc
 , libsodium, openssl
 }:
@@ -18,10 +18,9 @@ stdenv.mkDerivation rec {
   buildInputs = [ libsodium openssl protobuf protobufc ];
 
   separateDebugInfo = true;
-  enableParallelBuilding = true;
   outputs = [ "out" "dev" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C API for the NATS messaging system";
     homepage    = "https://github.com/nats-io/nats.c";
     license     = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/libnatspec/default.nix b/nixpkgs/pkgs/development/libraries/libnatspec/default.nix
index 8ac2859faeda..17e43ec29d94 100644
--- a/nixpkgs/pkgs/development/libraries/libnatspec/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnatspec/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, popt, libiconv }:
+{ lib, stdenv, fetchurl, autoreconfHook, popt, libiconv }:
 
 stdenv.mkDerivation (rec {
   name = "libnatspec-0.3.0";
@@ -12,12 +12,12 @@ stdenv.mkDerivation (rec {
 
   buildInputs = [ popt ];
 
-  meta = with stdenv.lib; {
+  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;
   };
-} // stdenv.lib.optionalAttrs (!stdenv.isLinux) {
+} // lib.optionalAttrs (!stdenv.isLinux) {
   propagatedBuildInputs = [ libiconv ];
 })
diff --git a/nixpkgs/pkgs/development/libraries/libndctl/default.nix b/nixpkgs/pkgs/development/libraries/libndctl/default.nix
index 6ca6c3018316..b7e082f2b9ba 100644
--- a/nixpkgs/pkgs/development/libraries/libndctl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libndctl/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchFromGitHub, autoreconfHook
-, asciidoctor, pkgconfig, xmlto, docbook_xsl, docbook_xml_dtd_45, libxslt
+{ lib, stdenv, fetchFromGitHub, autoreconfHook
+, asciidoctor, pkg-config, xmlto, docbook_xsl, docbook_xml_dtd_45, libxslt
 , json_c, kmod, which, util-linux, udev, keyutils
 }:
 
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "lib" "man" "dev" ];
 
   nativeBuildInputs =
-    [ autoreconfHook asciidoctor pkgconfig xmlto docbook_xml_dtd_45 docbook_xsl libxslt
+    [ autoreconfHook asciidoctor pkg-config xmlto docbook_xml_dtd_45 docbook_xsl libxslt
       which
     ];
 
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
     echo "m4_define([GIT_VERSION], [${version}])" > version.m4;
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Tools for managing the Linux Non-Volatile Memory Device sub-system";
     homepage    = "https://github.com/pmem/ndctl";
     license     = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libndp/default.nix b/nixpkgs/pkgs/development/libraries/libndp/default.nix
index 2592b7184f8e..fc68149c14c3 100644
--- a/nixpkgs/pkgs/development/libraries/libndp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libndp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "libndp-1.7";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1dlinhl39va00v55qygjc9ap77yqf7xvn4rwmvdr49xhzzxhlj1c";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://libndp.org/";
     description = "Library for Neighbor Discovery Protocol";
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/libndtypes/default.nix b/nixpkgs/pkgs/development/libraries/libndtypes/default.nix
index d27c1ba376d1..1f0709af6cfc 100644
--- a/nixpkgs/pkgs/development/libraries/libndtypes/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libndtypes/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 }:
 
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Dynamic types for data description and in-memory computations";
     homepage = "https://xnd.io/";
     license = licenses.bsdOriginal;
diff --git a/nixpkgs/pkgs/development/libraries/libnest2d/default.nix b/nixpkgs/pkgs/development/libraries/libnest2d/default.nix
index ee61ef8a7232..567598500d61 100644
--- a/nixpkgs/pkgs/development/libraries/libnest2d/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnest2d/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, clipper, nlopt, boost, python3 }:
+{ lib, stdenv, fetchFromGitHub, cmake, clipper, nlopt, boost, python3 }:
 
 stdenv.mkDerivation rec {
   version = "2020-10-09-unstable";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   CLIPPER_PATH = "${clipper.out}";
   cmakeFlags = [ "-DLIBNEST2D_HEADER_ONLY=OFF" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description =
       "2D irregular bin packaging and nesting library written in modern C++";
     homepage = "https://github.com/Ultimaker/libnest2d";
diff --git a/nixpkgs/pkgs/development/libraries/libnet/default.nix b/nixpkgs/pkgs/development/libraries/libnet/default.nix
index 7987fccc06fb..cb3375708df1 100644
--- a/nixpkgs/pkgs/development/libraries/libnet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnet/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "libnet";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./fix-includes.patch ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/sam-github/libnet";
     description = "Portable framework for low-level network packet construction";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libnetfilter_acct/default.nix b/nixpkgs/pkgs/development/libraries/libnetfilter_acct/default.nix
index 268da3813e73..72766471d2f1 100644
--- a/nixpkgs/pkgs/development/libraries/libnetfilter_acct/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnetfilter_acct/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libmnl }:
+{ lib, stdenv, fetchurl, pkg-config, libmnl }:
 
 stdenv.mkDerivation rec {
   version = "1.0.3";
@@ -9,10 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "06lsjndgfjsgfjr43px2n2wk3nr7whz6r405mks3887y7vpwwl22";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libmnl ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.netfilter.org/projects/libnetfilter_acct/";
     description = "Userspace library providing interface to extended accounting infrastructure";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libnetfilter_conntrack/default.nix b/nixpkgs/pkgs/development/libraries/libnetfilter_conntrack/default.nix
index 851357f6404f..a2097bb17e25 100644
--- a/nixpkgs/pkgs/development/libraries/libnetfilter_conntrack/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnetfilter_conntrack/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libnfnetlink, libmnl }:
+{ lib, stdenv, fetchurl, pkg-config, libnfnetlink, libmnl }:
 
 stdenv.mkDerivation rec {
   pname = "libnetfilter_conntrack";
@@ -11,9 +11,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libmnl ];
   propagatedBuildInputs = [ libnfnetlink ];
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libnetfilter_cthelper/default.nix b/nixpkgs/pkgs/development/libraries/libnetfilter_cthelper/default.nix
index ca1671989899..b8b05e57dad2 100644
--- a/nixpkgs/pkgs/development/libraries/libnetfilter_cthelper/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnetfilter_cthelper/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libmnl }:
+{ lib, stdenv, fetchurl, pkg-config, libmnl }:
 
 stdenv.mkDerivation rec {
   pname = "libnetfilter_cthelper";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "07618e71c4d9a6b6b3dc1986540486ee310a9838ba754926c7d14a17d8fccf3d";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libmnl ];
 
   meta = {
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
       is used by conntrack-tools.
     '';
     homepage = "http://www.netfilter.org/projects/libnetfilter_cthelper/";
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.linux;
+    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
index 64bcc08ffb91..a8d0c2680dfe 100644
--- a/nixpkgs/pkgs/development/libraries/libnetfilter_cttimeout/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnetfilter_cttimeout/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libmnl }:
+{ lib, stdenv, fetchurl, pkg-config, libmnl }:
 
 stdenv.mkDerivation rec {
   pname = "libnetfilter_cttimeout";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "aeab12754f557cba3ce2950a2029963d817490df7edb49880008b34d7ff8feba";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libmnl ];
 
   meta = {
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
       be attached to traffic flows. This library is used by conntrack-tools.
     '';
     homepage = "https://netfilter.org/projects/libnetfilter_cttimeout/";
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.linux;
+    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
index 18346814750b..4ac20cf29cb4 100644
--- a/nixpkgs/pkgs/development/libraries/libnetfilter_log/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnetfilter_log/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libnfnetlink, libmnl }:
+{ lib, stdenv, fetchurl, pkg-config, libnfnetlink, libmnl }:
 
 stdenv.mkDerivation rec {
   pname = "libnetfilter_log";
@@ -11,9 +11,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libmnl ];
   propagatedBuildInputs = [ libnfnetlink ];
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libnetfilter_queue/default.nix b/nixpkgs/pkgs/development/libraries/libnetfilter_queue/default.nix
index 7a0796166270..7dafcd42223f 100644
--- a/nixpkgs/pkgs/development/libraries/libnetfilter_queue/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnetfilter_queue/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libmnl, libnfnetlink }:
+{ lib, stdenv, fetchurl, pkg-config, libmnl, libnfnetlink }:
 
 stdenv.mkDerivation rec {
   version = "1.0.5";
@@ -9,10 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "1xdra6i4p8jkv943ygjw646qx8df27f7p5852kc06vjx608krzzr";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libmnl libnfnetlink ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.netfilter.org/projects/libnetfilter_queue/";
     description = "Userspace API to packets queued by the kernel packet filter";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libnfc/default.nix b/nixpkgs/pkgs/development/libraries/libnfc/default.nix
index ed7412d66110..b4daab97388e 100644
--- a/nixpkgs/pkgs/development/libraries/libnfc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnfc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libusb-compat-0_1, readline }:
+{ lib, stdenv, fetchurl, libusb-compat-0_1, readline }:
 
 stdenv.mkDerivation {
   pname = "libnfc";
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ libusb-compat-0_1 readline ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Open source library libnfc for Near Field Communication";
     license = licenses.gpl3;
     homepage = "https://github.com/nfc-tools/libnfc";
diff --git a/nixpkgs/pkgs/development/libraries/libnfnetlink/default.nix b/nixpkgs/pkgs/development/libraries/libnfnetlink/default.nix
index ecce38ac23e3..4c7b4a5cc2dd 100644
--- a/nixpkgs/pkgs/development/libraries/libnfnetlink/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnfnetlink/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "libnfnetlink-1.0.1";
@@ -24,8 +24,8 @@ stdenv.mkDerivation rec {
       It is only used by other netfilter.org projects, like the aforementioned ones.
     '';
     homepage = "http://www.netfilter.org/projects/libnfnetlink/index.html";
-    license = stdenv.lib.licenses.gpl2;
+    license = lib.licenses.gpl2;
 
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libnfs/default.nix b/nixpkgs/pkgs/development/libraries/libnfs/default.nix
index 03a4dbe02d5f..4e12553b00ba 100644
--- a/nixpkgs/pkgs/development/libraries/libnfs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnfs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "libnfs";
@@ -13,11 +13,11 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook ];
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=tautological-compare";
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=tautological-compare";
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "NFS client library";
     homepage    = "https://github.com/sahlberg/libnfs";
     license     = with licenses; [ lgpl2 bsd2 gpl3 ];
diff --git a/nixpkgs/pkgs/development/libraries/libnftnl/default.nix b/nixpkgs/pkgs/development/libraries/libnftnl/default.nix
index 3da2ccce4422..025ddf8e7b1d 100644
--- a/nixpkgs/pkgs/development/libraries/libnftnl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnftnl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libmnl }:
+{ lib, stdenv, fetchurl, pkg-config, libmnl }:
 
 stdenv.mkDerivation rec {
   version = "1.1.8";
@@ -9,10 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "04dp797llg3cqzivwrql30wg9mfr0ngnp0v5gs7jcdmp11dzm8q4";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libmnl ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libngspice/default.nix b/nixpkgs/pkgs/development/libraries/libngspice/default.nix
index 84bd9b33e790..72fbcd1ab084 100644
--- a/nixpkgs/pkgs/development/libraries/libngspice/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libngspice/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, bison, flex, fftw}:
+{lib, stdenv, fetchurl, bison, flex, fftw}:
 
 # Note that this does not provide the ngspice command-line utility. For that see
 # the ngspice derivation.
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--with-ngshared" "--enable-xspice" "--enable-cider" ];
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libnice/default.nix b/nixpkgs/pkgs/development/libraries/libnice/default.nix
index e7b01ca29cb1..7c5043165f9d 100644
--- a/nixpkgs/pkgs/development/libraries/libnice/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnice/default.nix
@@ -1,9 +1,9 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , python3
 , gobject-introspection
 , gtk-doc
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     python3
     gobject-introspection
 
@@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
   # see https://github.com/NixOS/nixpkgs/pull/53293#issuecomment-453739295
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GLib ICE implementation";
     longDescription = ''
       Libnice is an implementation of the IETF's Interactice Connectivity
diff --git a/nixpkgs/pkgs/development/libraries/libnih/default.nix b/nixpkgs/pkgs/development/libraries/libnih/default.nix
index 0c38a9c17d7c..fbe01bf4062d 100644
--- a/nixpkgs/pkgs/development/libraries/libnih/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnih/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, dbus, expat }:
+{ lib, stdenv, fetchurl, pkg-config, dbus, expat }:
 
 let version = "1.0.3"; in
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
     sha256 = "01glc6y7z1g726zwpvp2zm79pyb37ki729jkh45akh35fpgp4xc9";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ dbus expat ];
 
   doCheck = false; # fails 1 of 17 test
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
   meta = {
     description = "A small library for C application development";
     homepage = "https://launchpad.net/libnih";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.linux;
+    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
index 5741d4cb5b8a..abbffcf0f942 100644
--- a/nixpkgs/pkgs/development/libraries/libnixxml/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnixxml/default.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, stdenv, autoreconfHook, pkgconfig, libxml2, gd, glib, getopt, libxslt, nix }:
+{ fetchFromGitHub, lib, stdenv, autoreconfHook, pkg-config, libxml2, gd, glib, getopt, libxslt, nix }:
 
 stdenv.mkDerivation {
   name = "libnixxml";
@@ -11,13 +11,13 @@ stdenv.mkDerivation {
   configureFlags = [ "--with-gd" "--with-glib" ];
   CFLAGS = "-Wall";
   nativeBuildInputs = [ autoreconfHook ];
-  buildInputs = [ pkgconfig libxml2 gd.dev glib getopt libxslt nix ];
+  buildInputs = [ pkg-config libxml2 gd.dev glib getopt libxslt nix ];
   doCheck = false;
   postPatch = ''
     ./bootstrap
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "XML-based Nix-friendly data integration library";
     homepage = https://github.com/svanderburg/libnixxml;
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libnotify/default.nix b/nixpkgs/pkgs/development/libraries/libnotify/default.nix
index 34d8d800c38b..29b371642280 100644
--- a/nixpkgs/pkgs/development/libraries/libnotify/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnotify/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , libxslt
 , docbook-xsl-ns
 , glib
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "man" "dev" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0qa7cx6ra5hwqnxw95b9svgjg5q6ynm8y843iqjszxvds5z53h36";
   };
 
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
     gobject-introspection
     meson
     ninja
-    pkgconfig
+    pkg-config
     libxslt
     docbook-xsl-ns
   ];
@@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://developer.gnome.org/notification-spec/";
     description = "A library that sends desktop notifications to a notification daemon";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/libnova/default.nix b/nixpkgs/pkgs/development/libraries/libnova/default.nix
index 8cdbdbd747a9..f6a8d01ab845 100644
--- a/nixpkgs/pkgs/development/libraries/libnova/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnova/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, autoreconfHook }:
+{ lib, stdenv, fetchgit, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "libnova";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     autoreconfHook
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Celestial Mechanics, Astrometry and Astrodynamics Library";
     homepage = "http://libnova.sf.net";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libnsl/default.nix b/nixpkgs/pkgs/development/libraries/libnsl/default.nix
index 76aa3c99e335..ac4c6bf9ad3f 100644
--- a/nixpkgs/pkgs/development/libraries/libnsl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnsl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, libtirpc, pkgconfig }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, libtirpc, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "libnsl";
@@ -11,10 +11,10 @@ stdenv.mkDerivation rec {
     sha256 = "1dayj5i4bh65gn7zkciacnwv2a0ghm6nn58d78rsi4zby4lyj5w5";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ libtirpc ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Client interface library for NIS(YP) and NIS+";
     homepage = "https://github.com/thkukuk/libnsl";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libnxml/default.nix b/nixpkgs/pkgs/development/libraries/libnxml/default.nix
index dc5e8dfc55e9..846170011437 100644
--- a/nixpkgs/pkgs/development/libraries/libnxml/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libnxml/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, curl}:
+{lib, stdenv, fetchurl, curl}:
 
 stdenv.mkDerivation {
   name = "libnxml-0.18.3";
@@ -13,9 +13,9 @@ stdenv.mkDerivation {
   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 = stdenv.lib.licenses.lgpl2;
+    license = lib.licenses.lgpl2;
 
-    platforms = stdenv.lib.platforms.all;
-    maintainers = [ stdenv.lib.maintainers.viric ];
+    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
index c816bdc90e57..caab0a83fcf6 100644
--- a/nixpkgs/pkgs/development/libraries/liboauth/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liboauth/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, nss, nspr, pkgconfig }:
+{ fetchurl, lib, stdenv, nss, nspr, pkg-config }:
 
 
 stdenv.mkDerivation rec {
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   propagatedBuildInputs = [ nss nspr ];
 
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
       --replace "-lnss3" "-L${nss.out}/lib -lnss3"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     platforms = platforms.linux;
     description = "C library implementing the OAuth secure authentication protocol";
     homepage = "http://liboauth.sourceforge.net/";
diff --git a/nixpkgs/pkgs/development/libraries/libodfgen/default.nix b/nixpkgs/pkgs/development/libraries/libodfgen/default.nix
index 1723219e8597..b891c320e868 100644
--- a/nixpkgs/pkgs/development/libraries/libodfgen/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libodfgen/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, boost, pkgconfig, cppunit, zlib, libwpg, libwpd, librevenge}:
+{lib, stdenv, fetchurl, boost, pkg-config, cppunit, zlib, libwpg, libwpd, librevenge}:
 let
   s = # Generated upstream information
   rec {
@@ -9,7 +9,7 @@ let
     url="mirror://sourceforge/project/libwpd/libodfgen/libodfgen-0.1.7/libodfgen-0.1.7.tar.xz";
     sha256="0cdq48wlpp8m0qmndybv64r0m4vh0qsqx69cn6ms533cjlgljgij";
   };
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [
     boost cppunit zlib libwpg libwpd librevenge
   ];
@@ -22,9 +22,9 @@ stdenv.mkDerivation {
   };
   meta = {
     inherit (s) version;
-    description = ''A base library for generating ODF documents'';
-    license = stdenv.lib.licenses.mpl20 ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.unix;
+    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/libofa/default.nix b/nixpkgs/pkgs/development/libraries/libofa/default.nix
index c24023380340..c78aa3f617ef 100644
--- a/nixpkgs/pkgs/development/libraries/libofa/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libofa/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, expat, curl, fftw }:
+{ lib, stdenv, fetchurl, expat, curl, fftw }:
 
 let
   version = "0.9.3";
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ expat curl fftw ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://code.google.com/archive/p/musicip-libofa/";
     description = "Library Open Fingerprint Architecture";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/libofx/default.nix b/nixpkgs/pkgs/development/libraries/libofx/default.nix
index 692bddeab7dd..10197bd8db09 100644
--- a/nixpkgs/pkgs/development/libraries/libofx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libofx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, opensp, pkgconfig, libxml2, curl
+{ lib, stdenv, fetchFromGitHub, opensp, pkg-config, libxml2, curl
 , autoconf, automake, libtool, gengetopt, libiconv }:
 
 stdenv.mkDerivation rec {
@@ -14,14 +14,14 @@ stdenv.mkDerivation rec {
 
   preConfigure = "./autogen.sh";
   configureFlags = [ "--with-opensp-includes=${opensp}/include/OpenSP" ];
-  nativeBuildInputs = [ pkgconfig libtool autoconf automake gengetopt ];
-  buildInputs = [ opensp libxml2 curl ] ++ stdenv.lib.optional stdenv.isDarwin libiconv;
+  nativeBuildInputs = [ pkg-config libtool autoconf automake gengetopt ];
+  buildInputs = [ opensp libxml2 curl ] ++ lib.optional stdenv.isDarwin libiconv;
 
-  meta = { 
+  meta = {
     description = "Opensource implementation of the Open Financial eXchange specification";
     homepage = "http://libofx.sourceforge.net/";
     license = "LGPL";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
     maintainers = [ ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libogg/default.nix b/nixpkgs/pkgs/development/libraries/libogg/default.nix
index 50950a15a870..83555ccab8ce 100644
--- a/nixpkgs/pkgs/development/libraries/libogg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libogg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch }:
+{ lib, stdenv, fetchurl, fetchpatch }:
 
 stdenv.mkDerivation rec {
   name = "libogg-1.3.4";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "doc" ];
 
-  patches = stdenv.lib.optionals stdenv.isDarwin [
+  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";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Media container library to manipulate Ogg files";
     longDescription = ''
       Library to work with Ogg multimedia container format.
diff --git a/nixpkgs/pkgs/development/libraries/liboggz/default.nix b/nixpkgs/pkgs/development/libraries/liboggz/default.nix
index 07613f0564b0..15856c0262c7 100644
--- a/nixpkgs/pkgs/development/libraries/liboggz/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liboggz/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libogg, pkgconfig }:
+{ lib, stdenv, fetchurl, libogg, pkg-config }:
 
 stdenv.mkDerivation rec {
   name = "liboggz-1.1.1";
@@ -10,9 +10,9 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ libogg ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://xiph.org/oggz/";
     description = "A C library and tools for manipulating with Ogg files and streams";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/liboil/default.nix b/nixpkgs/pkgs/development/libraries/liboil/default.nix
index 22adceccecf2..8d9299758159 100644
--- a/nixpkgs/pkgs/development/libraries/liboil/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liboil/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, pkgconfig }:
+{lib, stdenv, fetchurl, pkg-config }:
 
 stdenv.mkDerivation rec {
   name = "liboil-0.3.17";
@@ -13,16 +13,16 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
   outputBin = "dev"; # oil-bugreport
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   # fix "argb_paint_i386.c:53:Incorrect register `%rax' used with `l' suffix"
   # errors
-  configureFlags = stdenv.lib.optional stdenv.isDarwin "--build=x86_64";
+  configureFlags = lib.optional stdenv.isDarwin "--build=x86_64";
 
   # fixes a cast in inline asm: easier than patching
-  buildFlags = stdenv.lib.optional stdenv.isDarwin "CFLAGS=-fheinous-gnu-extensions";
+  buildFlags = lib.optional stdenv.isDarwin "CFLAGS=-fheinous-gnu-extensions";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library of simple functions that are optimized for various CPUs";
     homepage    = "https://liboil.freedesktop.org";
     license     = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/libomxil-bellagio/default.nix b/nixpkgs/pkgs/development/libraries/libomxil-bellagio/default.nix
index 854c2732c12c..5e3b0c6798a6 100644
--- a/nixpkgs/pkgs/development/libraries/libomxil-bellagio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libomxil-bellagio/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "libomxil-bellagio";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   };
 
   configureFlags =
-    stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" ];
+    lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ "ac_cv_func_malloc_0_nonnull=yes" ];
 
   patches = [ ./fedora-fixes.patch ];
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   # developed anymore. Alternatively, gcc7Stdenv could be used.
   NIX_CFLAGS_COMPILE = "-Wno-error=array-bounds -Wno-error=stringop-overflow=8";
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/liboop/default.nix b/nixpkgs/pkgs/development/libraries/liboop/default.nix
index 6438fd5eb322..5d849ebe1caf 100644
--- a/nixpkgs/pkgs/development/libraries/liboop/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liboop/default.nix
@@ -1,8 +1,8 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation {
   name = "liboop-1.0";
-  
+
   src = fetchurl {
     url = "http://download.ofb.net/liboop/liboop.tar.gz";
     sha256 = "34d83c6e0f09ee15cb2bc3131e219747c3b612bb57cf7d25318ab90da9a2d97c";
@@ -12,6 +12,6 @@ stdenv.mkDerivation {
     description = "Event loop library";
     homepage = "http://liboop.ofb.net/";
     license = "LGPL";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libopcodes/default.nix b/nixpkgs/pkgs/development/libraries/libopcodes/default.nix
index 8db034683dc7..e448d225b993 100644
--- a/nixpkgs/pkgs/development/libraries/libopcodes/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libopcodes/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildPackages
+{ lib, stdenv, buildPackages
 , autoreconfHook, bison, binutils-unwrapped
 , libiberty, libbfd
 }:
@@ -34,7 +34,7 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library from binutils for manipulating machine code";
     homepage = "https://www.gnu.org/software/binutils/";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libopenaptx/default.nix b/nixpkgs/pkgs/development/libraries/libopenaptx/default.nix
index 5b02d70f6836..9cc57d1a465a 100644
--- a/nixpkgs/pkgs/development/libraries/libopenaptx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libopenaptx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "libopenaptx";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Audio Processing Technology codec (aptX)";
     license = licenses.lgpl21Plus;
     homepage = "https://github.com/pali/libopenaptx";
diff --git a/nixpkgs/pkgs/development/libraries/liboping/default.nix b/nixpkgs/pkgs/development/libraries/liboping/default.nix
index 956538b76240..c309c70e3d3b 100644
--- a/nixpkgs/pkgs/development/libraries/liboping/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liboping/default.nix
@@ -13,9 +13,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ ncurses perl ];
 
-  configureFlags = stdenv.lib.optional (perl == null) "--with-perl-bindings=no";
+  configureFlags = lib.optional (perl == null) "--with-perl-bindings=no";
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libopus/default.nix b/nixpkgs/pkgs/development/libraries/libopus/default.nix
index e8d3682b8b31..51179ecb9a05 100644
--- a/nixpkgs/pkgs/development/libraries/libopus/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libopus/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , fixedPoint ? false, withCustomModes ? true }:
 
 let
@@ -15,14 +15,14 @@ stdenv.mkDerivation {
 
   outputs = [ "out" "dev" ];
 
-  configureFlags = stdenv.lib.optional fixedPoint "--enable-fixed-point"
-                ++ stdenv.lib.optional withCustomModes "--enable-custom-modes";
+  configureFlags = lib.optional fixedPoint "--enable-fixed-point"
+                ++ lib.optional withCustomModes "--enable-custom-modes";
 
   doCheck = !stdenv.isi686; # test_unit_LPC_inv_pred_gain fails
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Open, royalty-free, highly versatile audio codec";
-    license = stdenv.lib.licenses.bsd3;
+    license = lib.licenses.bsd3;
     homepage = "https://www.opus-codec.org/";
     platforms = platforms.unix;
   };
diff --git a/nixpkgs/pkgs/development/libraries/libopusenc/default.nix b/nixpkgs/pkgs/development/libraries/libopusenc/default.nix
index 989dfc517f0d..c2d77185e692 100644
--- a/nixpkgs/pkgs/development/libraries/libopusenc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libopusenc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libopus }:
+{ lib, stdenv, fetchurl, pkg-config, libopus }:
 
 let
   version = "0.2.1";
@@ -16,10 +16,10 @@ stdenv.mkDerivation {
 
   doCheck = true;
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libopus ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for encoding .opus audio files and live streams";
     license = licenses.bsd3;
     homepage = "https://www.opus-codec.org/";
diff --git a/nixpkgs/pkgs/development/libraries/libosinfo/default.nix b/nixpkgs/pkgs/development/libraries/libosinfo/default.nix
index 6e7512535949..a6b170167198 100644
--- a/nixpkgs/pkgs/development/libraries/libosinfo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libosinfo/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
-, pkgconfig
+, pkg-config
 , meson
 , ninja
 , gettext
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     meson
     ninja
     vala
@@ -74,7 +74,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libosmium/default.nix b/nixpkgs/pkgs/development/libraries/libosmium/default.nix
index 830465fb113c..c5b801f5d47b 100644
--- a/nixpkgs/pkgs/development/libraries/libosmium/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libosmium/default.nix
@@ -1,23 +1,25 @@
-{ stdenv, fetchFromGitHub, cmake, protozero, expat, zlib, bzip2, boost }:
+{ lib, stdenv, fetchFromGitHub, cmake, protozero, expat, zlib, bzip2, boost }:
 
 stdenv.mkDerivation rec {
   pname = "libosmium";
-  version = "2.15.6";
+  version = "2.16.0";
 
   src = fetchFromGitHub {
     owner = "osmcode";
     repo = "libosmium";
     rev = "v${version}";
-    sha256 = "0rqy18bbakp41f44y5id9ixh0ar2dby46z17p4115z8k1vv9znq2";
+    sha256 = "1na51g6xfm1bx0d0izbg99cwmqn0grp0g41znn93xnhs202qnb2h";
   };
 
   nativeBuildInputs = [ cmake ];
 
   buildInputs = [ protozero zlib bzip2 expat boost ];
 
+  cmakeFlags = [ "-DINSTALL_GDALCPP:BOOL=ON" ];
+
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Fast and flexible C++ library for working with OpenStreetMap data";
     homepage = "https://osmcode.org/libosmium/";
     license = licenses.boost;
diff --git a/nixpkgs/pkgs/development/libraries/libosmpbf/default.nix b/nixpkgs/pkgs/development/libraries/libosmpbf/default.nix
index d1f6ea5c2ea3..1cbfe44ef4e5 100644
--- a/nixpkgs/pkgs/development/libraries/libosmpbf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libosmpbf/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, protobuf}:
+{lib, stdenv, fetchurl, protobuf}:
 
 stdenv.mkDerivation {
   name = "libosmpbf-1.3.3";
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://github.com/scrosby/OSM-binary";
     description = "C library to read and write OpenStreetMap PBF files";
-    license = stdenv.lib.licenses.lgpl3;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.lgpl3;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libossp-uuid/default.nix b/nixpkgs/pkgs/development/libraries/libossp-uuid/default.nix
index 15b6da0ac5bc..824dac3a2f56 100644
--- a/nixpkgs/pkgs/development/libraries/libossp-uuid/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libossp-uuid/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 let version = "1.6.2"; in
 
@@ -13,11 +13,11 @@ stdenv.mkDerivation {
 
   configureFlags = [
     "ac_cv_va_copy=yes"
-  ] ++ stdenv.lib.optional stdenv.isFreeBSD "--with-pic";
+  ] ++ lib.optional stdenv.isFreeBSD "--with-pic";
 
   patches = [ ./shtool.patch ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.ossp.org/pkg/lib/uuid/";
     description = "OSSP uuid ISO-C and C++ shared library";
     longDescription =
diff --git a/nixpkgs/pkgs/development/libraries/libotr/default.nix b/nixpkgs/pkgs/development/libraries/libotr/default.nix
index 10619f9682bf..7c2a2b9a6b9a 100644
--- a/nixpkgs/pkgs/development/libraries/libotr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libotr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libgcrypt, autoreconfHook }:
+{ lib, stdenv, fetchurl, libgcrypt, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   name = "libotr-4.1.1";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoreconfHook ];
   propagatedBuildInputs = [ libgcrypt ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.cypherpunks.ca/otr/";
     repositories.git = "git://git.code.sf.net/p/otr/libotr";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libow/default.nix b/nixpkgs/pkgs/development/libraries/libow/default.nix
index d7e83e7a9e3d..e4a8d95f4b0e 100644
--- a/nixpkgs/pkgs/development/libraries/libow/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libow/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoconf, automake, pkgconfig, libtool }:
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, pkg-config, libtool }:
 
 stdenv.mkDerivation rec {
   version = "3.2p4";
@@ -11,9 +11,9 @@ stdenv.mkDerivation rec {
     sha256 = "0dln1ar7bxwhpi36sccmpwapy7iz4j097rbf02mgn42lw5vrcg3s";
   };
 
-  nativeBuildInputs = [ autoconf automake pkgconfig ];
+  nativeBuildInputs = [ autoconf automake pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "1-Wire File System full library";
     homepage = "https://owfs.org/";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libowfat/default.nix b/nixpkgs/pkgs/development/libraries/libowfat/default.nix
index 068711586091..14270a36ec5d 100644
--- a/nixpkgs/pkgs/development/libraries/libowfat/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libowfat/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "libowfat-0.32";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   makeFlags = [ "prefix=$(out)" ];
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A GPL reimplementation of libdjb";
     homepage = "https://www.fefe.de/libowfat/";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libp11/default.nix b/nixpkgs/pkgs/development/libraries/libp11/default.nix
index a1e6d05440c0..eb577a7f5a17 100644
--- a/nixpkgs/pkgs/development/libraries/libp11/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libp11/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, libtool, pkgconfig
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, libtool, pkg-config
 , openssl }:
 
 stdenv.mkDerivation rec {
@@ -16,13 +16,13 @@ stdenv.mkDerivation rec {
     "--with-enginesdir=${placeholder "out"}/lib/engines"
   ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig libtool ];
+  nativeBuildInputs = [ autoreconfHook pkg-config libtool ];
 
   buildInputs = [ openssl ];
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libpam-wrapper/default.nix b/nixpkgs/pkgs/development/libraries/libpam-wrapper/default.nix
index f8359cded93a..7d026eb5a091 100644
--- a/nixpkgs/pkgs/development/libraries/libpam-wrapper/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpam-wrapper/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchgit
 , cmake
 , linux-pam
@@ -18,12 +18,12 @@ stdenv.mkDerivation rec {
     sha256 = "00mqhsashx7njrvxz085d0b88nizhdy7m3x17ip5yhvwsl63km6p";
   };
 
-  nativeBuildInputs = [ cmake ] ++ stdenv.lib.optional enablePython [ python ];
+  nativeBuildInputs = [ cmake ] ++ lib.optional enablePython [ python ];
 
   # We must use linux-pam, using openpam will result in broken fprintd.
   buildInputs = [ linux-pam ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Wrapper for testing PAM modules";
     homepage = "https://cwrap.org/pam_wrapper.html";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libpaper/default.nix b/nixpkgs/pkgs/development/libraries/libpaper/default.nix
index d7863e29d58d..b9372ba1d407 100644
--- a/nixpkgs/pkgs/development/libraries/libpaper/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpaper/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook }:
+{ lib, stdenv, fetchurl, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   version = "1.1.28";
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Library for handling paper characteristics";
     homepage = "http://packages.debian.org/unstable/source/libpaper";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.unix;
+    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
index 9447b83af170..625e780d1921 100644
--- a/nixpkgs/pkgs/development/libraries/libpar2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpar2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libsigcxx }:
+{ lib, stdenv, fetchurl, pkg-config, libsigcxx }:
 
 let version = "0.4"; in
 
@@ -11,17 +11,17 @@ stdenv.mkDerivation rec {
     sha256 = "1m4ncws1h03zq7zyqbaymvjzzbh1d3lc4wb1aksrdf0ync76yv9i";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libsigcxx ];
 
   patches = [ ./libpar2-0.4-external-verification.patch ];
 
-  CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11";
+  CXXFLAGS = lib.optionalString stdenv.cc.isClang "-std=c++11";
 
   meta = {
     homepage = "http://parchive.sourceforge.net/";
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
     description = "A library for using Parchives (parity archive volume sets)";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libpcap/default.nix b/nixpkgs/pkgs/development/libraries/libpcap/default.nix
index 604fd3ee4465..0b30bf6c2b0d 100644
--- a/nixpkgs/pkgs/development/libraries/libpcap/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpcap/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, flex, bison, bluez, pkgconfig, withBluez ? false }:
+{ lib, stdenv, fetchurl, flex, bison, bluez, pkg-config, withBluez ? false }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "libpcap";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ flex bison ]
-    ++ optionals withBluez [ bluez.dev pkgconfig ];
+    ++ optionals withBluez [ bluez.dev pkg-config ];
 
   # We need to force the autodetection because detection doesn't
   # work in pure build environments.
diff --git a/nixpkgs/pkgs/development/libraries/libpeas/default.nix b/nixpkgs/pkgs/development/libraries/libpeas/default.nix
index 1d360b45052a..a8ef9e2f9bb2 100644
--- a/nixpkgs/pkgs/development/libraries/libpeas/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpeas/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig, gettext, gnome3
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, gettext, gnome3
 , glib, gtk3, gobject-introspection, python3, ncurses
 }:
 
@@ -9,11 +9,11 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "05cb7drn6arc4gi02wgsvzibigi2riz5gnfnmlb0zmbfnj9ikna2";
   };
 
-  nativeBuildInputs = [ pkgconfig meson ninja gettext gobject-introspection ];
+  nativeBuildInputs = [ pkg-config meson ninja gettext gobject-introspection ];
   buildInputs =  [ glib gtk3 ncurses python3 python3.pkgs.pygobject3 ];
   propagatedBuildInputs = [
     # Required by libpeas-1.0.pc
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A GObject-based plugins engine";
     homepage = "https://wiki.gnome.org/Projects/Libpeas";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libpfm/default.nix b/nixpkgs/pkgs/development/libraries/libpfm/default.nix
index 63b826258ae6..20c4c0a1c6e2 100644
--- a/nixpkgs/pkgs/development/libraries/libpfm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpfm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation (rec {
 
   NIX_CFLAGS_COMPILE = "-Wno-error";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Helper library to program the performance monitoring events";
     longDescription = ''
       This package provides a library, called libpfm4 which is used to
@@ -32,7 +32,7 @@ stdenv.mkDerivation (rec {
     maintainers = [ maintainers.pierron ];
     platforms = platforms.linux;
   };
-} // stdenv.lib.optionalAttrs ( ! enableShared )
+} // lib.optionalAttrs ( ! enableShared )
 {
   CONFIG_PFMLIB_SHARED = "n";
 }
diff --git a/nixpkgs/pkgs/development/libraries/libpgf/default.nix b/nixpkgs/pkgs/development/libraries/libpgf/default.nix
index 7710c2081996..682ff485d65c 100644
--- a/nixpkgs/pkgs/development/libraries/libpgf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpgf/default.nix
@@ -1,29 +1,25 @@
-{ stdenv, fetchurl, autoconf, automake, libtool, dos2unix }:
+{ lib, stdenv, fetchzip, autoreconfHook }:
 
-with stdenv.lib;
-
-let
-  version = "6.14.12";
-in
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   pname = "libpgf";
-  inherit version;
+  version = "7.21.2";
 
-  src = fetchurl {
-    url = "mirror://sourceforge/libpgf/libpgf-src-${version}.tar.gz";
-    sha256 = "1ssqjbh6l5jc04f67n47m9bqcigl46c6lgyabyi6cabnh1frk9dx";
+  src = fetchzip {
+    url = "mirror://sourceforge/${pname}/${pname}/${version}/${pname}.zip";
+    sha256 = "0l1j5b1d02jn27miggihlppx656i0pc70cn6x89j1rpj33zn0g9r";
   };
 
-  buildInputs = [ autoconf automake libtool dos2unix ];
-
-  preConfigure = "dos2unix configure.ac; sh autogen.sh";
+  nativeBuildInputs = [ autoreconfHook ];
 
-# configureFlags = optional static "--enable-static --disable-shared";
+  autoreconfPhase = ''
+    mv README.txt README
+    sh autogen.sh
+  '';
 
   meta = {
     homepage = "https://www.libpgf.org/";
     description = "Progressive Graphics Format";
-    license = stdenv.lib.licenses.lgpl21Plus;
-    platforms = stdenv.lib.platforms.unix;
+    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
index 918c663dfb46..2ff59e055f98 100644
--- a/nixpkgs/pkgs/development/libraries/libphonenumber/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libphonenumber/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, gmock, boost, pkgconfig, protobuf, icu }:
+{ lib, stdenv, fetchFromGitHub, cmake, gmock, boost, pkg-config, protobuf, icu }:
 
 stdenv.mkDerivation rec {
   pname = "phonenumber";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     cmake
     gmock
-    pkgconfig
+    pkg-config
   ];
 
   buildInputs = [
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
 
   checkPhase = "./libphonenumber_test";
 
-  meta = with stdenv.lib; {
+  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
index 63035f74ea0e..2d802cf28d76 100644
--- a/nixpkgs/pkgs/development/libraries/libpinyin/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpinyin/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchurl, fetchFromGitHub
+{ lib, stdenv, fetchurl, fetchFromGitHub
 , autoreconfHook
 , glib
 , db
-, pkgconfig
+, pkg-config
 }:
 
 let
@@ -26,9 +26,9 @@ stdenv.mkDerivation rec {
     tar -xzf ${modelData} -C $sourceRoot/data
   '';
 
-  nativeBuildInputs = [ autoreconfHook glib db pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook glib db pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for intelligent sentence-based Chinese pinyin input method";
     homepage    = "https://sourceforge.net/projects/libpinyin";
     license     = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libpipeline/default.nix b/nixpkgs/pkgs/development/libraries/libpipeline/default.nix
index be3ab953c0a5..b5310c3cb8ca 100644
--- a/nixpkgs/pkgs/development/libraries/libpipeline/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpipeline/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "libpipeline-1.5.3";
@@ -8,9 +8,9 @@ stdenv.mkDerivation rec {
     sha256 = "1c5dl017xil2ssb6a5vg927bnsbc9vymfgi9ahvqbb8gypx0igsx";
   };
 
-  patches = stdenv.lib.optionals stdenv.isDarwin [ ./fix-on-osx.patch ];
+  patches = lib.optionals stdenv.isDarwin [ ./fix-on-osx.patch ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libplacebo/default.nix b/nixpkgs/pkgs/development/libraries/libplacebo/default.nix
index ac8552fa9ef4..94301b34fbce 100644
--- a/nixpkgs/pkgs/development/libraries/libplacebo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libplacebo/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitLab
 , fetchpatch
 , meson
@@ -11,18 +11,28 @@
 , glslang
 , lcms2
 , epoxy
+, libGL
+, xorg
 }:
 
 stdenv.mkDerivation rec {
   pname = "libplacebo";
-  version = "2.72.2";
+  version = "3.104.0";
+
+  patches = [
+    (fetchpatch {
+      # support glslang>=11.0.0; Upstream MR: https://code.videolan.org/videolan/libplacebo/-/merge_requests/131
+      url = "https://code.videolan.org/videolan/libplacebo/-/commit/affd15a2faa1340d40dcf277a8acffe2987f517c.patch";
+      sha256 = "1nm27mdm9rn3wsbjdif46pici6mbzmfb6521ijl8ah4mxn9p1ikc";
+    })
+  ];
 
   src = fetchFromGitLab {
     domain = "code.videolan.org";
     owner = "videolan";
     repo = pname;
     rev = "v${version}";
-    sha256 = "1ijqpx1pagc6qg63ynqrinvckwc8aaw1i0lx48gg5szwk8afib4i";
+    sha256 = "0p5mx8ch7cp7b54yrkl4fs8bcvqma1h461gx6ps4kagn4dsx8asb";
   };
 
   nativeBuildInputs = [
@@ -39,13 +49,15 @@ stdenv.mkDerivation rec {
     glslang
     lcms2
     epoxy
+    libGL
+    xorg.libX11
   ];
 
   mesonFlags = [
     "-Dvulkan-registry=${vulkan-headers}/share/vulkan/registry/vk.xml"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Reusable library for GPU-accelerated video/image rendering primitives";
     longDescription = ''
       Reusable library for GPU-accelerated image/view processing primitives and
diff --git a/nixpkgs/pkgs/development/libraries/libplist/default.nix b/nixpkgs/pkgs/development/libraries/libplist/default.nix
index 1f311dda9f02..c8e9ddb82c5f 100644
--- a/nixpkgs/pkgs/development/libraries/libplist/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libplist/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, autoreconfHook, fetchFromGitHub, pkgconfig, enablePython ? false, python, glib }:
+{ lib, stdenv, autoreconfHook, fetchFromGitHub, pkg-config, enablePython ? false, python, glib }:
 
 stdenv.mkDerivation rec {
   pname = "libplist";
@@ -11,27 +11,27 @@ stdenv.mkDerivation rec {
     sha256 = "1vxhpjxniybqsg5wcygmdmr5dv7p2zb34dqnd3bi813rnnzsdjm6";
   };
 
-  outputs = ["bin" "dev" "out" ] ++ stdenv.lib.optional enablePython "py";
+  outputs = ["bin" "dev" "out" ] ++ lib.optional enablePython "py";
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     autoreconfHook
-  ] ++ stdenv.lib.optionals enablePython [
+  ] ++ lib.optionals enablePython [
     python
     python.pkgs.cython
   ];
 
-  configureFlags = stdenv.lib.optionals (!enablePython) [
+  configureFlags = lib.optionals (!enablePython) [
     "--without-cython"
   ];
 
   propagatedBuildInputs = [ glib ];
 
-  postFixup = stdenv.lib.optionalString enablePython ''
+  postFixup = lib.optionalString enablePython ''
     moveToOutput "lib/${python.libPrefix}" "$py"
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libpng/12.nix b/nixpkgs/pkgs/development/libraries/libpng/12.nix
index 7199695ae74b..bf3d5168d6c6 100644
--- a/nixpkgs/pkgs/development/libraries/libpng/12.nix
+++ b/nixpkgs/pkgs/development/libraries/libpng/12.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, zlib }:
+{ lib, stdenv, fetchurl, zlib }:
 
 assert stdenv.hostPlatform == stdenv.buildPlatform -> zlib != null;
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   postInstall = ''mv "$out/bin" "$dev/bin"'';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libpng/default.nix b/nixpkgs/pkgs/development/libraries/libpng/default.nix
index 489007bc417d..aeb3fcba06fa 100644
--- a/nixpkgs/pkgs/development/libraries/libpng/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpng/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, zlib, apngSupport ? true }:
+{ lib, stdenv, fetchurl, zlib, apngSupport ? true }:
 
 assert zlib != null;
 
@@ -8,7 +8,7 @@ let
     url = "mirror://sourceforge/libpng-apng/libpng-${patchVersion}-apng.patch.gz";
     sha256 = "1dh0250mw9b2hx7cdmnb2blk7ddl49n6vx8zz7jdmiwxy38v4fw2";
   };
-  whenPatched = stdenv.lib.optionalString apngSupport;
+  whenPatched = lib.optionalString apngSupport;
 
 in stdenv.mkDerivation rec {
   name = "libpng" + whenPatched "-apng" + "-${version}";
@@ -29,7 +29,7 @@ in stdenv.mkDerivation rec {
 
   passthru = { inherit zlib; };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libpointmatcher/default.nix b/nixpkgs/pkgs/development/libraries/libpointmatcher/default.nix
index 20b2988417cc..31fb5cb05ba7 100644
--- a/nixpkgs/pkgs/development/libraries/libpointmatcher/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpointmatcher/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, eigen, boost, libnabo }:
+{ lib, stdenv, fetchFromGitHub, cmake, eigen, boost, libnabo }:
 
 stdenv.mkDerivation rec {
   pname = "libpointmatcher";
@@ -14,8 +14,6 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
   buildInputs = [ eigen boost libnabo ];
 
-  enableParallelBuilding = true;
-
   cmakeFlags = [
     "-DEIGEN_INCLUDE_DIR=${eigen}/include/eigen3"
   ];
@@ -26,7 +24,7 @@ stdenv.mkDerivation rec {
     ./utest/utest --path ../examples/data/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit (src.meta) homepage;
     description = "An \"Iterative Closest Point\" library for 2-D/3-D mapping in robotic";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libportal/default.nix b/nixpkgs/pkgs/development/libraries/libportal/default.nix
index 0f31115f50f0..5eacdaa8f3c8 100644
--- a/nixpkgs/pkgs/development/libraries/libportal/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libportal/default.nix
@@ -1,9 +1,9 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , gtk-doc
 , docbook-xsl-nons
 , docbook_xml_dtd_45
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     gtk-doc
     docbook-xsl-nons
     docbook_xml_dtd_45
@@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
     glib
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Flatpak portal library";
     homepage = "https://github.com/flatpak/libportal";
     license = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libproxy/default.nix b/nixpkgs/pkgs/development/libraries/libproxy/default.nix
index 7fcc8c58c1ce..afd1a6365b45 100644
--- a/nixpkgs/pkgs/development/libraries/libproxy/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libproxy/default.nix
@@ -1,6 +1,6 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
-, pkgconfig
+, pkg-config
 , cmake
 , zlib
 , fetchpatch
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "py3" ];
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     cmake
     makeWrapper
   ];
@@ -82,21 +82,21 @@ stdenv.mkDerivation rec {
       sha256 = "0pdy9sw49lxpaiwq073cisk0npir5bkch70nimdmpszxwp3fv1d8";
     })
 
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.isDarwin [
     (fetchpatch {
       url = "https://github.com/libproxy/libproxy/commit/44158f03f8522116758d335688ed840dfcb50ac8.patch";
       sha256 = "0axfvb6j7gcys6fkwi9dkn006imhvm3kqr83gpwban8419n0q5v1";
     })
   ];
 
-  postFixup = stdenv.lib.optionalString stdenv.isLinux ''
+  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 stdenv.lib; {
+  meta = with lib; {
     platforms = platforms.linux ++ platforms.darwin;
     license = licenses.lgpl21;
     homepage = "http://libproxy.github.io/libproxy/";
diff --git a/nixpkgs/pkgs/development/libraries/libpseudo/default.nix b/nixpkgs/pkgs/development/libraries/libpseudo/default.nix
index e08feaddc606..f06381505739 100644
--- a/nixpkgs/pkgs/development/libraries/libpseudo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpseudo/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, pkgconfig, glib, ncurses}:
+{lib, stdenv, fetchurl, pkg-config, glib, ncurses}:
 stdenv.mkDerivation rec {
   name = "libpseudo-1.2.0";
 
@@ -16,10 +16,10 @@ stdenv.mkDerivation rec {
     mkdir -p $out/lib
   '';
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ glib ncurses ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://libpseudo.sourceforge.net/";
     description = "Simple, thread-safe messaging between threads";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libpsl/default.nix b/nixpkgs/pkgs/development/libraries/libpsl/default.nix
index 67e87a5faab4..e68219f63485 100644
--- a/nixpkgs/pkgs/development/libraries/libpsl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpsl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , autoreconfHook
 , docbook_xsl
@@ -8,7 +8,7 @@
 , libidn2
 , libunistring
 , libxslt
-, pkgconfig
+, pkg-config
 , python3
 , valgrind
 , publicsuffix-list
@@ -29,10 +29,10 @@ stdenv.mkDerivation rec {
     docbook_xml_dtd_43
     gtk-doc
     lzip
-    pkgconfig
+    pkg-config
     python3
     libxslt
-  ] ++ stdenv.lib.optionals (!stdenv.isDarwin) [
+  ] ++ lib.optionals (!stdenv.isDarwin) [
     valgrind
   ];
 
@@ -60,7 +60,7 @@ stdenv.mkDerivation rec {
     "--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"
-  ] ++ stdenv.lib.optionals (!stdenv.isDarwin) [
+  ] ++ lib.optionals (!stdenv.isDarwin) [
     "--enable-valgrind-tests"
   ];
 
@@ -68,7 +68,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  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"
diff --git a/nixpkgs/pkgs/development/libraries/libpst/default.nix b/nixpkgs/pkgs/development/libraries/libpst/default.nix
index e69cc04d6f0b..40f6b3b1aee1 100644
--- a/nixpkgs/pkgs/development/libraries/libpst/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libpst/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, autoreconfHook, boost, libgsf,
-  pkgconfig, bzip2, xmlto, gettext, imagemagick, doxygen }:
+{ lib, stdenv, fetchurl, autoreconfHook, boost, libgsf,
+  pkg-config, bzip2, xmlto, gettext, imagemagick, doxygen }:
 
 stdenv.mkDerivation rec {
   name = "libpst-0.6.75";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "11wrf47i3brlxg25wsfz17373q7m5fpjxn2lr41dj252ignqzaac";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [
     boost libgsf bzip2
     xmlto gettext imagemagick doxygen
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.five-ten-sg.com/libpst/";
     description = "A library to read PST (MS Outlook Personal Folders) files";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libqalculate/default.nix b/nixpkgs/pkgs/development/libraries/libqalculate/default.nix
index bc142b0a57c2..80e6e6fe6689 100644
--- a/nixpkgs/pkgs/development/libraries/libqalculate/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libqalculate/default.nix
@@ -1,21 +1,22 @@
-{ stdenv, fetchFromGitHub, mpfr, libxml2, intltool, pkgconfig, doxygen,
+{ lib, stdenv, fetchFromGitHub, mpfr, libxml2, intltool, pkg-config, doxygen,
   autoreconfHook, readline, libiconv, icu, curl, gnuplot, gettext }:
 
 stdenv.mkDerivation rec {
   pname = "libqalculate";
-  version = "3.14.0";
+  version = "3.16.0";
 
   src = fetchFromGitHub {
     owner = "qalculate";
     repo = "libqalculate";
     rev = "v${version}";
-    sha256 = "1j4sr9s7152xmci677pnz64spv8s3ia26fbp5cqx8ydv7swlivh2";
+    sha256 = "0nrf03q3qrsvxf6kjpv69l49yfal79834a3jv75mzi6y674ach9g";
   };
 
   outputs = [ "out" "dev" "doc" ];
 
-  nativeBuildInputs = [ intltool pkgconfig autoreconfHook doxygen ];
+  nativeBuildInputs = [ intltool pkg-config autoreconfHook doxygen ];
   buildInputs = [ curl gettext libiconv readline ];
+  configureFlags = ["--with-readline=${readline.dev}"];
   propagatedBuildInputs = [ libxml2 mpfr icu ];
   enableParallelBuilding = true;
 
@@ -27,7 +28,7 @@ stdenv.mkDerivation rec {
     substituteInPlace libqalculate/Calculator-plot.cc \
       --replace 'commandline = "gnuplot"' 'commandline = "${gnuplot}/bin/gnuplot"' \
       --replace '"gnuplot - ' '"${gnuplot}/bin/gnuplot - '
-  '' + stdenv.lib.optionalString stdenv.cc.isClang ''
+  '' + lib.optionalString stdenv.cc.isClang ''
     substituteInPlace src/qalc.cc \
       --replace 'printf(_("aborted"))' 'printf("%s", _("aborted"))'
   '';
@@ -38,7 +39,7 @@ stdenv.mkDerivation rec {
     popd
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An advanced calculator library";
     homepage = "http://qalculate.github.io";
     maintainers = with maintainers; [ gebner ];
diff --git a/nixpkgs/pkgs/development/libraries/libqb/default.nix b/nixpkgs/pkgs/development/libraries/libqb/default.nix
index 244dcf0999b4..3f0a9a28d194 100644
--- a/nixpkgs/pkgs/development/libraries/libqb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libqb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig }:
+{ lib, stdenv, fetchurl, pkg-config }:
 
 stdenv.mkDerivation rec {
   name = "libqb-0.17.2";
@@ -8,9 +8,9 @@ stdenv.mkDerivation rec {
     sha256 = "1zpl45p3n6dn1jgbsrrmccrmv2mvp8aqmnl0qxfjf7ymkrj9qhcs";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/clusterlabs/libqb";
     description = "A library providing high performance logging, tracing, ipc, and poll";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libqglviewer/default.nix b/nixpkgs/pkgs/development/libraries/libqglviewer/default.nix
index 0d1da964adb5..4fc50f207309 100644
--- a/nixpkgs/pkgs/development/libraries/libqglviewer/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libqglviewer/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qmake, qtbase, libGLU, AGL }:
+{ lib, stdenv, fetchurl, qmake, qtbase, libGLU, AGL }:
 
 stdenv.mkDerivation rec {
   pname = "libqglviewer";
@@ -11,13 +11,13 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ qmake ];
   buildInputs = [ qtbase libGLU ]
-    ++ stdenv.lib.optional stdenv.isDarwin AGL;
+    ++ lib.optional stdenv.isDarwin AGL;
 
   postPatch = ''
     cd QGLViewer
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ library based on Qt that eases the creation of OpenGL 3D viewers";
     homepage = "http://libqglviewer.com";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libqmi/default.nix b/nixpkgs/pkgs/development/libraries/libqmi/default.nix
index de38e5d3b6e7..e616fae92502 100644
--- a/nixpkgs/pkgs/development/libraries/libqmi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libqmi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkg-config, gobject-introspection, glib, python3, libgudev, libmbim }:
+{ lib, stdenv, fetchurl, pkg-config, gobject-introspection, glib, python3, libgudev, libmbim }:
 
 stdenv.mkDerivation rec {
   pname = "libqmi";
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.freedesktop.org/wiki/Software/libqmi/";
     description = "Modem protocol helper library";
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/libquotient/default.nix b/nixpkgs/pkgs/development/libraries/libquotient/default.nix
index 84d7c51fd59e..10b2451e7c85 100644
--- a/nixpkgs/pkgs/development/libraries/libquotient/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libquotient/default.nix
@@ -2,13 +2,13 @@
 
 mkDerivation rec {
   pname = "libquotient";
-  version = "0.6.3";
+  version = "0.6.4";
 
   src = fetchFromGitHub {
     owner = "quotient-im";
     repo = "libQuotient";
     rev = version;
-    sha256 = "sha256-RYEcFClRdAippG0kspNi9QZIzZAuU4++9LOQTZcqpVc=";
+    sha256 = "sha256-bWqZiRv/mJzw+WY+7dLIzYBu8jhglBqgTjiXyQ1y6IQ=";
   };
 
   buildInputs = [ qtbase qtmultimedia ];
diff --git a/nixpkgs/pkgs/development/libraries/libr3/default.nix b/nixpkgs/pkgs/development/libraries/libr3/default.nix
index 0584203a581a..34ac547f4920 100644
--- a/nixpkgs/pkgs/development/libraries/libr3/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libr3/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , pcre
-, pkgconfig
+, pkg-config
 , check
 , autoreconfHook
 }:
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     sha256 = "09cixbms817p6nb77wz3rxp0znnac8ybycvsrrzgwlbfn58a3zwl";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
   buildInputs = [ check ];
   propagatedBuildInputs = [ pcre ];
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A high-performance path dispatching library";
     homepage = "https://github.com/c9s/r3";
-    license = [ stdenv.lib.licenses.mit ];
+    license = [ lib.licenses.mit ];
   };
 
 }
diff --git a/nixpkgs/pkgs/development/libraries/libraspberrypi/default.nix b/nixpkgs/pkgs/development/libraries/libraspberrypi/default.nix
index 664b8d1a7e0d..217a83bcebc3 100644
--- a/nixpkgs/pkgs/development/libraries/libraspberrypi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libraspberrypi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 , cmake
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     "-DVMCS_INSTALL_PREFIX=${placeholder "out"}"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Userland tools & libraries for interfacing with Raspberry Pi hardware";
     homepage = "https://github.com/raspberrypi/userland";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libraw/default.nix b/nixpkgs/pkgs/development/libraries/libraw/default.nix
index f59f63c38ac7..3ff7e725f3d8 100644
--- a/nixpkgs/pkgs/development/libraries/libraw/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libraw/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, lcms2, pkgconfig }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, lcms2, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "libraw";
@@ -15,11 +15,11 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ lcms2 ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libraw1394/default.nix b/nixpkgs/pkgs/development/libraries/libraw1394/default.nix
index a99e4d22077e..7bf99e739f31 100644
--- a/nixpkgs/pkgs/development/libraries/libraw1394/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libraw1394/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "libraw1394-2.1.2";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0z5md84941ky5l7afayx2z6j0sk0mildxbjajq6niznd44ky7i6x";
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/librdf/raptor.nix b/nixpkgs/pkgs/development/libraries/librdf/raptor.nix
index ef194bb0b1ec..8d1b1f2a0ea4 100644
--- a/nixpkgs/pkgs/development/libraries/librdf/raptor.nix
+++ b/nixpkgs/pkgs/development/libraries/librdf/raptor.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libxml2, curl }:
+{ lib, stdenv, fetchurl, libxml2, curl }:
 
 stdenv.mkDerivation rec {
   name = "raptor-1.4.21";
@@ -17,8 +17,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "The RDF Parser Toolkit";
     homepage = "http://librdf.org/raptor";
-    license = with stdenv.lib.licenses; [ lgpl21 asl20 ];
-    maintainers = [ stdenv.lib.maintainers.marcweber ];
-    platforms = stdenv.lib.platforms.linux;
+    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
index 4645b5ea0d83..bb8aeefa102c 100644
--- a/nixpkgs/pkgs/development/libraries/librdf/raptor2.nix
+++ b/nixpkgs/pkgs/development/libraries/librdf/raptor2.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libxml2, libxslt }:
+{ lib, stdenv, fetchurl, libxml2, libxslt }:
 
 stdenv.mkDerivation rec {
   pname = "raptor2";
@@ -24,8 +24,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "The RDF Parser Toolkit";
     homepage = "http://librdf.org/raptor";
-    license = with stdenv.lib.licenses; [ lgpl21 asl20 ];
-    maintainers = with stdenv.lib.maintainers; [ marcweber ];
-    platforms = stdenv.lib.platforms.unix;
+    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
index d9b94a668c60..88acc372f7f5 100644
--- a/nixpkgs/pkgs/development/libraries/librdf/rasqal.nix
+++ b/nixpkgs/pkgs/development/libraries/librdf/rasqal.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, librdf_raptor2, gmp, pkgconfig, pcre, libxml2, perl }:
+{ lib, stdenv, fetchurl, librdf_raptor2, gmp, pkg-config, pcre, libxml2, perl }:
 
 stdenv.mkDerivation rec {
   name = "rasqal-0.9.33";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0z6rrwn4jsagvarg8d5zf0j352kjgi33py39jqd29gbhcnncj939";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ gmp pcre libxml2 ];
 
@@ -23,8 +23,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Library that handles Resource Description Framework (RDF)";
     homepage = "http://librdf.org/rasqal";
-    license = with stdenv.lib.licenses; [ lgpl21 asl20 ];
-    maintainers = with stdenv.lib.maintainers; [ marcweber ];
-    platforms = stdenv.lib.platforms.unix;
+    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
index a85500d2c6ec..731d1cf18684 100644
--- a/nixpkgs/pkgs/development/libraries/librdf/redland.nix
+++ b/nixpkgs/pkgs/development/libraries/librdf/redland.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, openssl, libxslt, perl
+{ lib, stdenv, fetchurl, pkg-config, openssl, libxslt, perl
 , curl, pcre, libxml2, librdf_rasqal, gmp
 , libmysqlclient, withMysql ? false
 , postgresql, withPostgresql ? false
@@ -14,13 +14,13 @@ stdenv.mkDerivation rec {
     sha256 = "de1847f7b59021c16bdc72abb4d8e2d9187cd6124d69156f3326dd34ee043681";
   };
 
-  nativeBuildInputs = [ perl pkgconfig ];
+  nativeBuildInputs = [ perl pkg-config ];
 
   buildInputs = [ openssl libxslt curl pcre libxml2 gmp ]
-    ++ stdenv.lib.optional withMysql libmysqlclient
-    ++ stdenv.lib.optional withSqlite sqlite
-    ++ stdenv.lib.optional withPostgresql postgresql
-    ++ stdenv.lib.optional withBdb db;
+    ++ lib.optional withMysql libmysqlclient
+    ++ lib.optional withSqlite sqlite
+    ++ lib.optional withPostgresql postgresql
+    ++ lib.optional withBdb db;
 
   propagatedBuildInputs = [ librdf_rasqal ];
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
 
   configureFlags =
     [ "--with-threads" ]
-    ++ stdenv.lib.optionals withBdb [
+    ++ lib.optionals withBdb [
       "--with-bdb-include=${db.dev}/include"
       "--with-bdb-lib=${db.out}/lib"
     ];
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # fails 1 out of 17 tests with a segmentation fault
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C libraries that provide support for the Resource Description Framework (RDF)";
     homepage = "http://librdf.org/";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/libre/default.nix b/nixpkgs/pkgs/development/libraries/libre/default.nix
index 6e1d0a8ce3c4..e960fe8f4b26 100644
--- a/nixpkgs/pkgs/development/libraries/libre/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libre/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, zlib, openssl}:
+{lib, stdenv, fetchurl, zlib, openssl}:
 stdenv.mkDerivation rec {
   version = "0.6.1";
   pname = "libre";
@@ -8,15 +8,15 @@ stdenv.mkDerivation rec {
   };
   buildInputs = [ zlib openssl ];
   makeFlags = [ "USE_ZLIB=1" "USE_OPENSSL=1" "PREFIX=$(out)" ]
-  ++ stdenv.lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${stdenv.cc.cc}"
-  ++ stdenv.lib.optional (stdenv.cc.libc != null) "SYSROOT=${stdenv.lib.getDev stdenv.cc.libc}"
+  ++ 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 stdenv.lib.platforms; linux;
-    maintainers = with stdenv.lib.maintainers; [raskin];
-    license = stdenv.lib.licenses.bsd3;
+    platforms = with lib.platforms; linux;
+    maintainers = with lib.maintainers; [raskin];
+    license = lib.licenses.bsd3;
     inherit version;
     downloadPage = "http://www.creytiv.com/pub/";
     updateWalker = true;
diff --git a/nixpkgs/pkgs/development/libraries/librealsense/default.nix b/nixpkgs/pkgs/development/libraries/librealsense/default.nix
index 2ceb2125dbc9..82761dc3d009 100644
--- a/nixpkgs/pkgs/development/libraries/librealsense/default.nix
+++ b/nixpkgs/pkgs/development/libraries/librealsense/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, config, lib, fetchFromGitHub, cmake, libusb1, ninja, pkgconfig, gcc
+{ stdenv, config, lib, fetchFromGitHub, cmake, libusb1, ninja, pkg-config, gcc
 , cudaSupport ? config.cudaSupport or false, cudatoolkit
 , enablePython ? false, pythonPackages ? null }:
 
@@ -7,7 +7,7 @@ assert enablePython -> pythonPackages != null;
 
 stdenv.mkDerivation rec {
   pname = "librealsense";
-  version = "2.40.0";
+  version = "2.41.0";
 
   outputs = [ "out" "dev" ];
 
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     owner = "IntelRealSense";
     repo = pname;
     rev = "v${version}";
-    sha256 = "KZNriNDxRKR14KFJrAbzZLfSQ3iiZ8PKC80fVh0AQls=";
+    sha256 = "0ngv9fgja72vg7hq1aiwpa7x4dhniawhpd8mqm85pqkjxiph8s1k";
   };
 
   buildInputs = [
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     cmake
     ninja
-    pkgconfig
+    pkg-config
   ];
 
   cmakeFlags = [
@@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
     cp ../wrappers/python/pyrealsense2/__init__.py $out/${pythonPackages.python.sitePackages}/pyrealsense2
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libredwg/default.nix b/nixpkgs/pkgs/development/libraries/libredwg/default.nix
index 71667460e239..5fca199acb0a 100644
--- a/nixpkgs/pkgs/development/libraries/libredwg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libredwg/default.nix
@@ -6,17 +6,17 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "libredwg";
-  version = "0.10.1.3707";
+  version = "0.12";
 
   src = fetchFromGitHub {
     owner = "LibreDWG";
     repo = pname;
     rev = version;
-    sha256 = "009n96lx4ahf05ryvm09z0l9956vz94r8pliyb88j0jficl0pxkf";
+    sha256 = "0ayhp3ym30hzp5f6dz7mmp9hpxf6a48nx3kq5crcmzycm5fllbn7";
     fetchSubmodules = true;
   };
 
-  nativeBuildInputs = [ autoreconfHook pkg-config texinfo ] 
+  nativeBuildInputs = [ autoreconfHook pkg-config texinfo ]
     ++ lib.optional enablePython swig;
 
   buildInputs = [ pcre2 ]
diff --git a/nixpkgs/pkgs/development/libraries/librelp/default.nix b/nixpkgs/pkgs/development/libraries/librelp/default.nix
index 7d0eb7f67dd8..edf927e86647 100644
--- a/nixpkgs/pkgs/development/libraries/librelp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/librelp/default.nix
@@ -1,26 +1,26 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , autoreconfHook
 , gnutls
 , openssl
-, pkgconfig
+, pkg-config
 , zlib
 }:
 
 stdenv.mkDerivation rec {
   pname = "librelp";
-  version = "1.6.0";
+  version = "1.7.0";
 
   src = fetchFromGitHub {
     owner = "rsyslog";
     repo = "librelp";
     rev = "v${version}";
-    sha256 = "132i1b1m7c7hkbxsnpa7n07cbghxjxmcbb8zhgwziaxg4nzxsa6l";
+    sha256 = "0miqjck9zh1hgsx1v395n0d4f1a1p5a8khybv2nsfjq04g9359c9";
   };
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
   buildInputs = [ gnutls zlib openssl ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A reliable logging library";
     homepage = "https://www.librelp.com/";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/librem/default.nix b/nixpkgs/pkgs/development/libraries/librem/default.nix
index 012ac2a46a74..349384b4674c 100644
--- a/nixpkgs/pkgs/development/libraries/librem/default.nix
+++ b/nixpkgs/pkgs/development/libraries/librem/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, zlib, openssl, libre}:
+{lib, stdenv, fetchurl, zlib, openssl, libre}:
 stdenv.mkDerivation rec {
   version = "0.6.0";
   pname = "librem";
@@ -10,17 +10,17 @@ stdenv.mkDerivation rec {
   makeFlags = [
     "LIBRE_MK=${libre}/share/re/re.mk"
     "LIBRE_INC=${libre}/include/re"
-    ''PREFIX=$(out)''
+    "PREFIX=$(out)"
   ]
-  ++ stdenv.lib.optional (stdenv.cc.cc != null) "SYSROOT_ALT=${stdenv.lib.getDev stdenv.cc.cc}"
-  ++ stdenv.lib.optional (stdenv.cc.libc != null) "SYSROOT=${stdenv.lib.getDev stdenv.cc.libc}"
+  ++ 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 stdenv.lib.platforms; linux;
-    maintainers = with stdenv.lib.maintainers; [raskin];
-    license = stdenv.lib.licenses.bsd3;
+    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
index bed92477a3fc..74c45f00adcf 100644
--- a/nixpkgs/pkgs/development/libraries/librep/default.nix
+++ b/nixpkgs/pkgs/development/libraries/librep/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl
-, pkgconfig, autoreconfHook
+{ lib, stdenv, fetchurl
+, pkg-config, autoreconfHook
 , readline, texinfo
 , gdbm, gmp, libffi }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "librep";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     sha256 = "1bmcjl1x1rdh514q9z3hzyjmjmwwwkziipjpjsl301bwmiwrd8a8";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ readline texinfo ];
   propagatedBuildInputs = [ gdbm gmp libffi ];
 
diff --git a/nixpkgs/pkgs/development/libraries/libresample/default.nix b/nixpkgs/pkgs/development/libraries/libresample/default.nix
index 85d8d5c586b5..0756874b3e75 100644
--- a/nixpkgs/pkgs/development/libraries/libresample/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libresample/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, cmake}:
+{lib, stdenv, fetchurl, cmake}:
 
 let
   patch = fetchurl {
@@ -16,13 +16,13 @@ stdenv.mkDerivation {
   preConfigure = ''
     cat debian/patches/1001_shlib-cmake.patch | patch -p1
   '';
-  buildInputs = [ cmake ];
-  
+  nativeBuildInputs = [ cmake ];
+
   meta = {
     description = "A real-time library for sampling rate conversion library";
-    license = stdenv.lib.licenses.lgpl2Plus;
+    license = lib.licenses.lgpl2Plus;
     homepage = "https://ccrma.stanford.edu/~jos/resample/Free_Resampling_Software.html";
-    maintainers = [ stdenv.lib.maintainers.sander ];
-    platforms = stdenv.lib.platforms.unix;
+    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
index 1f6313d8caab..d67342eebc11 100644
--- a/nixpkgs/pkgs/development/libraries/libressl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libressl/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchurl, lib, cmake, cacert, fetchpatch, buildShared ? true }:
+{ stdenv, fetchurl, lib, cmake, cacert, fetchpatch
+, buildShared ? !stdenv.hostPlatform.isStatic
+}:
 
 let
 
@@ -40,8 +42,6 @@ let
       substituteInPlace ./tls/tls_config.c --replace '"/etc/ssl/cert.pem"' '"${cacert}/etc/ssl/certs/ca-bundle.crt"'
     '';
 
-    enableParallelBuilding = true;
-
     outputs = [ "bin" "dev" "out" "man" "nc" ];
 
     postFixup = ''
diff --git a/nixpkgs/pkgs/development/libraries/librest/default.nix b/nixpkgs/pkgs/development/libraries/librest/default.nix
index e1d7b336273d..7b1ff8235aac 100644
--- a/nixpkgs/pkgs/development/libraries/librest/default.nix
+++ b/nixpkgs/pkgs/development/libraries/librest/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, pkgconfig, glib, libsoup, gobject-introspection, gnome3 }:
+{ lib, stdenv, fetchurl, pkg-config, glib, libsoup, gobject-introspection, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "rest";
   version = "0.8.1";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0513aad38e5d3cedd4ae3c551634e3be1b9baaa79775e53b2dba9456f15b01c9";
   };
 
-  nativeBuildInputs = [ pkgconfig gobject-introspection ];
+  nativeBuildInputs = [ pkg-config gobject-introspection ];
   buildInputs = [ glib libsoup ];
 
   configureFlags = [ "--with-ca-certificates=/etc/ssl/certs/ca-certificates.crt" ];
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Helper library for RESTful services";
     homepage = "https://wiki.gnome.org/Projects/Librest";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/librevenge/default.nix b/nixpkgs/pkgs/development/libraries/librevenge/default.nix
index 2c6e792ae8ce..1d7754bfcaef 100644
--- a/nixpkgs/pkgs/development/libraries/librevenge/default.nix
+++ b/nixpkgs/pkgs/development/libraries/librevenge/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, boost, pkgconfig, cppunit, zlib}:
+{lib, stdenv, fetchurl, boost, pkg-config, cppunit, zlib}:
 let
   s = # Generated upstream information
   rec {
@@ -9,7 +9,7 @@ let
     url="mirror://sourceforge/project/libwpd/librevenge/librevenge-0.0.4/librevenge-0.0.4.tar.xz";
     sha256="1cj76cz4mqcy2mgv9l5xlc95bypyk8zbq0ls9cswqrs2y0lhfgwk";
   };
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [
     boost cppunit zlib
   ];
@@ -34,9 +34,9 @@ stdenv.mkDerivation {
 
   meta = {
     inherit (s) version;
-    description = ''A base library for writing document import filters'';
-    license = stdenv.lib.licenses.mpl20 ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.unix;
+    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/librevisa/default.nix b/nixpkgs/pkgs/development/libraries/librevisa/default.nix
index b49fb3f7ee77..892bbbbbfc04 100644
--- a/nixpkgs/pkgs/development/libraries/librevisa/default.nix
+++ b/nixpkgs/pkgs/development/libraries/librevisa/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libusb1 }:
+{ lib, stdenv, fetchurl, pkg-config, libusb1 }:
 
 # TODO: add VXI development files, for VXI-11 (TCPIP) support
 
@@ -10,10 +10,10 @@ stdenv.mkDerivation rec {
     sha256 = "0bjzq23s3xzw0l9qx4l8achrx5id8xdd6r52lvdl4a28dxzbcfhq";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libusb1 ];
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/librime/default.nix b/nixpkgs/pkgs/development/libraries/librime/default.nix
index a9a17eca786a..b6db462f3c34 100644
--- a/nixpkgs/pkgs/development/libraries/librime/default.nix
+++ b/nixpkgs/pkgs/development/libraries/librime/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, boost, glog, leveldb, marisa, opencc,
+{ lib, stdenv, fetchFromGitHub, cmake, boost, glog, leveldb, marisa, opencc,
   libyamlcpp, gmock }:
 
 stdenv.mkDerivation rec {
@@ -16,9 +16,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ boost glog leveldb marisa opencc libyamlcpp gmock ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage    = "https://rime.im/";
     description = "Rime Input Method Engine, the core library";
     license     = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libroxml/default.nix b/nixpkgs/pkgs/development/libraries/libroxml/default.nix
index b72ffb5b7ecc..de1877f2ab40 100644
--- a/nixpkgs/pkgs/development/libraries/libroxml/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libroxml/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   name = "libroxml-2.3.0";
@@ -6,7 +6,7 @@ stdenv.mkDerivation {
     url = "http://download.libroxml.net/pool/v2.x/libroxml-2.3.0.tar.gz";
     sha256  = "0y0vc9n4rfbimjp28nx4kdfzz08j5xymh5xjy84l9fhfac5z5a0x";
   };
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.libroxml.net/";
     description = "This library is minimum, easy-to-use, C implementation for xml file parsing";
     license = licenses.lgpl3;
diff --git a/nixpkgs/pkgs/development/libraries/librseq/default.nix b/nixpkgs/pkgs/development/libraries/librseq/default.nix
index 4fd8bb7e33a4..12b9b4109c70 100644
--- a/nixpkgs/pkgs/development/libraries/librseq/default.nix
+++ b/nixpkgs/pkgs/development/libraries/librseq/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , autoreconfHook, linuxHeaders
 }:
 
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
     rm -rf $out/share
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Userspace library for the Linux Restartable Sequence API";
     homepage    = "https://github.com/compudj/librseq";
     license     = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/librsvg/default.nix b/nixpkgs/pkgs/development/libraries/librsvg/default.nix
index ecf518d04dae..efdbf5934630 100644
--- a/nixpkgs/pkgs/development/libraries/librsvg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/librsvg/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, pkgconfig, glib, gdk-pixbuf, pango, cairo, libxml2
+{ lib, stdenv, fetchurl, pkg-config, glib, gdk-pixbuf, pango, cairo, libxml2
 , bzip2, libintl, darwin, rustc, cargo, gnome3
 , vala, gobject-introspection }:
 
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "02csvx2nzygh8kyal2qiy3y6xb7d52vszxxr37dzav704a9pkncv";
   };
 
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ glib gdk-pixbuf cairo ];
 
-  nativeBuildInputs = [ pkgconfig rustc cargo vala gobject-introspection ]
+  nativeBuildInputs = [ pkg-config rustc cargo vala gobject-introspection ]
     ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
       ApplicationServices
     ]);
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
     "--enable-vala"
     "--enable-installed-tests"
     "--enable-always-build-tests"
-  ] ++ stdenv.lib.optional stdenv.isDarwin "--disable-Bsymbolic";
+  ] ++ lib.optional stdenv.isDarwin "--disable-Bsymbolic";
 
   makeFlags = [
     "installed_test_metadir=$(installedTests)/share/installed-tests/RSVG"
@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
   ];
 
   NIX_CFLAGS_COMPILE
-    = stdenv.lib.optionalString stdenv.isDarwin "-I${cairo.dev}/include/cairo";
+    = lib.optionalString stdenv.isDarwin "-I${cairo.dev}/include/cairo";
 
   # It wants to add loaders and update the loaders.cache in gdk-pixbuf
   # Patching the Makefiles to it creates rsvg specific loaders and the
@@ -78,7 +78,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A small library to render SVG images to Cairo surfaces";
     homepage = "https://wiki.gnome.org/Projects/LibRsvg";
     license = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/librsync/0.9.nix b/nixpkgs/pkgs/development/libraries/librsync/0.9.nix
index 35ccdcdf0782..74dca4e30854 100644
--- a/nixpkgs/pkgs/development/libraries/librsync/0.9.nix
+++ b/nixpkgs/pkgs/development/libraries/librsync/0.9.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   name = "librsync-0.9.7";
@@ -11,16 +11,16 @@ stdenv.mkDerivation {
   hardeningDisable = [ "format" ];
 
   configureFlags = [
-    (stdenv.lib.enableFeature stdenv.isCygwin    "static")
-    (stdenv.lib.enableFeature (!stdenv.isCygwin) "shared")
+    (lib.enableFeature stdenv.isCygwin    "static")
+    (lib.enableFeature (!stdenv.isCygwin) "shared")
   ];
 
   dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
 
   meta = {
     homepage = "http://librsync.sourceforge.net/";
-    license = stdenv.lib.licenses.lgpl2Plus;
+    license = lib.licenses.lgpl2Plus;
     description = "Implementation of the rsync remote-delta algorithm";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/librsync/default.nix b/nixpkgs/pkgs/development/libraries/librsync/default.nix
index 9499be80f033..9211d9d233f8 100644
--- a/nixpkgs/pkgs/development/libraries/librsync/default.nix
+++ b/nixpkgs/pkgs/development/libraries/librsync/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, perl, zlib, bzip2, popt }:
+{ lib, stdenv, fetchFromGitHub, cmake, perl, zlib, bzip2, popt }:
 
 stdenv.mkDerivation rec {
   pname = "librsync";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   dontStrip = stdenv.hostPlatform != stdenv.buildPlatform;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://librsync.sourceforge.net/";
     license = licenses.lgpl2Plus;
     description = "Implementation of the rsync remote-delta algorithm";
diff --git a/nixpkgs/pkgs/development/libraries/librtprocess/default.nix b/nixpkgs/pkgs/development/libraries/librtprocess/default.nix
index adabbe11cb3e..3e44bfd3d7dd 100644
--- a/nixpkgs/pkgs/development/libraries/librtprocess/default.nix
+++ b/nixpkgs/pkgs/development/libraries/librtprocess/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "librtprocess";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/CarVac/librtprocess";
     description = "Highly optimized library for processing RAW images";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/libs3/default.nix b/nixpkgs/pkgs/development/libraries/libs3/default.nix
index 3012263cb414..5a2b8636774f 100644
--- a/nixpkgs/pkgs/development/libraries/libs3/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libs3/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, curl, libxml2 }:
+{ lib, stdenv, fetchFromGitHub, curl, libxml2 }:
 
 stdenv.mkDerivation {
   name = "libs3-2018-12-03";
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
 
   makeFlags = [ "DESTDIR=$(out)" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/bji/libs3";
     description = "A library for interfacing with amazon s3";
     license = licenses.lgpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libsamplerate/default.nix b/nixpkgs/pkgs/development/libraries/libsamplerate/default.nix
index 92958f389f04..5cf872c3fc39 100644
--- a/nixpkgs/pkgs/development/libraries/libsamplerate/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsamplerate/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, pkgconfig, libsndfile, ApplicationServices, Carbon, CoreServices }:
+{ lib, stdenv, fetchurl, pkg-config, libsndfile, ApplicationServices, Carbon, CoreServices }:
 
 let
-  inherit (stdenv.lib) optionals optionalString;
+  inherit (lib) optionals optionalString;
 
 in stdenv.mkDerivation rec {
   name = "libsamplerate-0.1.9";
@@ -11,7 +11,7 @@ in stdenv.mkDerivation rec {
     sha256 = "1ha46i0nbibq0pl0pjwcqiyny4hj8lp1bnl4dpxm64zjw9lb2zha";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libsndfile ]
     ++ optionals stdenv.isDarwin [ ApplicationServices CoreServices ];
 
@@ -27,7 +27,7 @@ in stdenv.mkDerivation rec {
     substituteInPlace examples/Makefile --replace "-fpascal-strings" ""
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Sample Rate Converter for audio";
     homepage    = "http://www.mega-nerd.com/SRC/index.html";
     license     = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/libsass/default.nix b/nixpkgs/pkgs/development/libraries/libsass/default.nix
index cebfdfe38389..f4caa22b3229 100644
--- a/nixpkgs/pkgs/development/libraries/libsass/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsass/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "libsass";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A C/C++ implementation of a Sass compiler";
     homepage = "https://github.com/sass/libsass";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libschrift/default.nix b/nixpkgs/pkgs/development/libraries/libschrift/default.nix
new file mode 100644
index 000000000000..3781d9346125
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libschrift/default.nix
@@ -0,0 +1,28 @@
+{ lib, stdenv, fetchFromGitHub }:
+
+stdenv.mkDerivation rec {
+  pname = "libschrift";
+  version = "0.9.1";
+
+  src = fetchFromGitHub {
+    owner = "tomolt";
+    repo = pname;
+    rev = "c6d20460d6e602e8829d3a227fd7be4c4c3cda86";
+    hash = "sha256-BuTmWaWFZ0DXujlbhbmK3Woit8fR9F4DWmKszHX6gOI=";
+  };
+
+  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
index 7eaa8f855784..1bd22b2f7901 100644
--- a/nixpkgs/pkgs/development/libraries/libscrypt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libscrypt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "libscrypt";
@@ -11,14 +11,14 @@ stdenv.mkDerivation rec {
     sha256 = "1d76ys6cp7fi4ng1w3mz2l0p9dbr7ljbk33dcywyimzjz8bahdng";
   };
 
-  buildFlags = stdenv.lib.optional stdenv.isDarwin "LDFLAGS= CFLAGS_EXTRA=";
+  buildFlags = lib.optional stdenv.isDarwin "LDFLAGS= CFLAGS_EXTRA=";
 
   installFlags = [ "PREFIX=$(out)" ];
-  installTargets = stdenv.lib.optional stdenv.isDarwin "install-osx";
+  installTargets = lib.optional stdenv.isDarwin "install-osx";
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Shared library that implements scrypt() functionality";
     homepage = "https://lolware.net/2014/04/29/libscrypt.html";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/libsearpc/default.nix b/nixpkgs/pkgs/development/libraries/libsearpc/default.nix
index c9c105d1b18a..1ac5cef7c5f6 100644
--- a/nixpkgs/pkgs/development/libraries/libsearpc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsearpc/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, automake, autoconf, pkgconfig, libtool, python2Packages, glib, jansson}:
+{lib, stdenv, fetchFromGitHub, automake, autoconf, pkg-config, libtool, python2Packages, glib, jansson}:
 
 stdenv.mkDerivation rec {
   version = "3.2.0";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   patches = [ ./libsearpc.pc.patch ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ automake autoconf libtool python2Packages.python python2Packages.simplejson ];
   propagatedBuildInputs = [ glib jansson ];
 
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   preConfigure = "./autogen.sh";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/haiwen/libsearpc";
     description = "A simple and easy-to-use C language RPC framework (including both server side & client side) based on GObject System";
     license = licenses.lgpl3;
diff --git a/nixpkgs/pkgs/development/libraries/libseccomp/default.nix b/nixpkgs/pkgs/development/libraries/libseccomp/default.nix
index a0414f5ba55f..7ea7add23f3e 100644
--- a/nixpkgs/pkgs/development/libraries/libseccomp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libseccomp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, getopt, util-linux, gperf }:
+{ lib, stdenv, fetchurl, getopt, util-linux, gperf }:
 
 stdenv.mkDerivation rec {
   pname = "libseccomp";
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     tar -zcf $pythonsrc --mtime="@$SOURCE_DATE_EPOCH" --sort=name --transform s/tmp-pythonsrc/python-foundationdb/ ./tmp-pythonsrc/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "High level library for the Linux Kernel seccomp filter";
     homepage = "https://github.com/seccomp/libseccomp";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libsecret/default.nix b/nixpkgs/pkgs/development/libraries/libsecret/default.nix
index d614ab01297e..6c28b7d16c16 100644
--- a/nixpkgs/pkgs/development/libraries/libsecret/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsecret/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, glib, pkgconfig, gettext, libxslt, python3
+{ lib, stdenv, fetchurl, fetchpatch, glib, pkg-config, gettext, libxslt, python3
 , docbook_xsl, docbook_xml_dtd_42 , libgcrypt, gobject-introspection, vala
 , gtk-doc, gnome3, gjs, libintl, dbus, xvfb_run }:
 
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
   version = "0.20.4";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0a4xnfmraxchd9cq5ai66j12jv2vrgjmaaxz25kl031jvda4qnij";
   };
 
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ glib ];
   nativeBuildInputs = [
-    pkgconfig gettext libxslt docbook_xsl docbook_xml_dtd_42 libintl
+    pkg-config gettext libxslt docbook_xsl docbook_xml_dtd_42 libintl
     gobject-introspection vala gtk-doc glib
   ];
   buildInputs = [ libgcrypt ];
@@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A library for storing and retrieving passwords and other secrets";
     homepage = "https://wiki.gnome.org/Projects/Libsecret";
-    license = stdenv.lib.licenses.lgpl21Plus;
+    license = lib.licenses.lgpl21Plus;
     inherit (glib.meta) platforms maintainers;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libserialport/default.nix b/nixpkgs/pkgs/development/libraries/libserialport/default.nix
index c7f34362f39f..0a2adc4126f1 100644
--- a/nixpkgs/pkgs/development/libraries/libserialport/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libserialport/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, udev, darwin }:
+{ lib, stdenv, fetchurl, pkg-config, udev, darwin }:
 
 stdenv.mkDerivation rec {
   name = "libserialport-0.1.1";
@@ -8,11 +8,11 @@ stdenv.mkDerivation rec {
     sha256 = "17ajlwgvyyrap8z7f16zcs59pksvncwbmd3mzf98wj7zqgczjaja";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = stdenv.lib.optional stdenv.isLinux udev
-    ++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.IOKit;
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = lib.optional stdenv.isLinux udev
+    ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.IOKit;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Cross-platform shared library for serial port access";
     homepage = "https://sigrok.org/";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libshout/default.nix b/nixpkgs/pkgs/development/libraries/libshout/default.nix
index 075855fada46..c810034f8478 100644
--- a/nixpkgs/pkgs/development/libraries/libshout/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libshout/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, pkgconfig
+{ lib, stdenv, fetchurl, pkg-config
 , libvorbis, libtheora, speex }:
 
-# need pkgconfig so that libshout installs ${out}/lib/pkgconfig/shout.pc
+# need pkg-config so that libshout installs ${out}/lib/pkgconfig/shout.pc
 
 stdenv.mkDerivation rec {
   name = "libshout-2.4.4";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "doc" ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   propagatedBuildInputs = [ libvorbis libtheora speex ];
 
   meta = {
@@ -26,8 +26,8 @@ stdenv.mkDerivation rec {
     '';
 
     homepage = "http://www.icecast.org";
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = with stdenv.lib.maintainers; [ jcumming ];
-    platforms = with stdenv.lib.platforms; unix;
+    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
index 5845916239c3..d5f8dd6e5730 100644
--- a/nixpkgs/pkgs/development/libraries/libsidplayfp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsidplayfp/default.nix
@@ -1,7 +1,7 @@
 { stdenv
 , lib
 , fetchurl
-, pkgconfig
+, pkg-config
 , docSupport ? true
 , doxygen ? null
 , graphviz ? null
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     sha256 = "04vdrrkh5y9x9rrmj6gdp242ah70b4sslwqfby8wp2riis4hr9z0";
   };
 
-  nativeBuildInputs = [ pkgconfig ]
+  nativeBuildInputs = [ pkg-config ]
     ++ optionals docSupport [ doxygen graphviz ];
 
   installTargets = [ "install" ]
diff --git a/nixpkgs/pkgs/development/libraries/libsieve/default.nix b/nixpkgs/pkgs/development/libraries/libsieve/default.nix
index e1c6f3efe526..8253d1df74fe 100644
--- a/nixpkgs/pkgs/development/libraries/libsieve/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsieve/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 stdenv.mkDerivation rec {
   version = "2.3.1";
   pname = "libsieve";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1gllhl9hbmc86dq3k98d4kjs5bwk0p2rlk7ywqj3fjn7jw6mbhcj";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An interpreter for RFC 3028 Sieve and various extensions";
     homepage = "http://sodabrew.com/libsieve/";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libsigcxx/1.2.nix b/nixpkgs/pkgs/development/libraries/libsigcxx/1.2.nix
index 0fc19d207596..a417e0bcc1d7 100644
--- a/nixpkgs/pkgs/development/libraries/libsigcxx/1.2.nix
+++ b/nixpkgs/pkgs/development/libraries/libsigcxx/1.2.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, pkgconfig, m4}:
+{lib, stdenv, fetchurl, pkg-config, m4}:
 
 stdenv.mkDerivation rec {
   name = "libsigc++-1.2.7";
@@ -8,10 +8,10 @@ stdenv.mkDerivation rec {
     sha256 = "099224v5y0y1ggqrfc8vga8afr3nb93iicn7cj8xxgsrwa83s5nr";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ m4];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://libsigcplusplus.github.io/libsigcplusplus/";
     description = "A typesafe callback system for standard C++";
     branch = "1.2";
diff --git a/nixpkgs/pkgs/development/libraries/libsigcxx/default.nix b/nixpkgs/pkgs/development/libraries/libsigcxx/default.nix
index 8f883626d823..eac383fae0d9 100644
--- a/nixpkgs/pkgs/development/libraries/libsigcxx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsigcxx/default.nix
@@ -1,15 +1,15 @@
-{ stdenv, fetchurl, pkgconfig, gnum4, gnome3 }:
+{ lib, stdenv, fetchurl, pkg-config, gnum4, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "libsigc++";
   version = "2.10.1";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "00v08km4wwzbh6vjxb21388wb9dm6g2xh14rgwabnv4c2wk5z8n9";
   };
 
-  nativeBuildInputs = [ pkgconfig gnum4 ];
+  nativeBuildInputs = [ pkg-config gnum4 ];
 
   doCheck = true;
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://libsigcplusplus.github.io/libsigcplusplus/";
     description = "A typesafe callback system for standard C++";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libsignal-protocol-c/default.nix b/nixpkgs/pkgs/development/libraries/libsignal-protocol-c/default.nix
index 6278f6234f0b..203d3613af85 100644
--- a/nixpkgs/pkgs/development/libraries/libsignal-protocol-c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsignal-protocol-c/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, openssl }:
+{ lib, stdenv, fetchFromGitHub, cmake, openssl }:
 
 stdenv.mkDerivation rec {
   pname = "libsignal-protocol-c";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Signal Protocol C Library";
     homepage = "https://github.com/signalapp/libsignal-protocol-c";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/libsignon-glib/default.nix b/nixpkgs/pkgs/development/libraries/libsignon-glib/default.nix
index 1f453dc291e4..ae7a6775de55 100644
--- a/nixpkgs/pkgs/development/libraries/libsignon-glib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsignon-glib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, nix-update-script, pkgconfig, meson, ninja, vala, python3, gtk-doc, docbook_xsl, docbook_xml_dtd_43, docbook_xml_dtd_412, glib, check, gobject-introspection }:
+{ 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";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     gtk-doc
     meson
     ninja
-    pkgconfig
+    pkg-config
     python3
     vala
   ];
@@ -48,7 +48,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libsigsegv/default.nix b/nixpkgs/pkgs/development/libraries/libsigsegv/default.nix
index 30921ade4cf5..20cb80b1ff85 100644
--- a/nixpkgs/pkgs/development/libraries/libsigsegv/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsigsegv/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , enableSigbusFix ? false # required by kernels < 3.18.6
 }:
 
@@ -28,9 +28,9 @@ stdenv.mkDerivation rec {
       more.
     '';
 
-    license = stdenv.lib.licenses.gpl2Plus;
+    license = lib.licenses.gpl2Plus;
 
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libsixel/default.nix b/nixpkgs/pkgs/development/libraries/libsixel/default.nix
index 9e151931e653..e82ecde5ddd2 100644
--- a/nixpkgs/pkgs/development/libraries/libsixel/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsixel/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub}:
+{lib, stdenv, fetchFromGitHub}:
 stdenv.mkDerivation rec {
   version = "1.8.6";
   pname = "libsixel";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The SIXEL library for console graphics, and converter programs";
     homepage = "http://saitoha.github.com/libsixel";
     maintainers = with maintainers; [ vrthra ];
diff --git a/nixpkgs/pkgs/development/libraries/libskk/default.nix b/nixpkgs/pkgs/development/libraries/libskk/default.nix
index e5fd031b5fff..c4b36704cb97 100644
--- a/nixpkgs/pkgs/development/libraries/libskk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libskk/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchFromGitHub,
-  libtool, gettext, pkgconfig,
+{ lib, stdenv, fetchFromGitHub,
+  libtool, gettext, pkg-config,
   vala, gnome-common, gobject-introspection,
   libgee, json-glib, skk-dicts, libxkbcommon }:
 
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ skk-dicts libxkbcommon ];
-  nativeBuildInputs = [ vala gnome-common gobject-introspection libtool gettext pkgconfig ];
+  nativeBuildInputs = [ vala gnome-common gobject-introspection libtool gettext pkg-config ];
   propagatedBuildInputs = [ libgee json-glib ];
 
   preConfigure = ''
@@ -42,8 +42,8 @@ stdenv.mkDerivation rec {
       user dictionary, skkserv, and CDB format dictionary.
     '';
     homepage = "https://github.com/ueno/libskk";
-    license = stdenv.lib.licenses.gpl3Plus;
-    maintainers = with stdenv.lib.maintainers; [ yuriaisaka ];
-    platforms = stdenv.lib.platforms.linux;
+    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
index af6d26bc22b6..8bd74d292430 100644
--- a/nixpkgs/pkgs/development/libraries/libslirp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libslirp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitLab
 , meson
 , ninja
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
     echo ${version} > .tarball-version
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "General purpose TCP-IP emulator";
     homepage = "https://gitlab.freedesktop.org/slirp/libslirp";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libsmartcols/default.nix b/nixpkgs/pkgs/development/libraries/libsmartcols/default.nix
index bb3de08cf72e..3ef1f3148994 100644
--- a/nixpkgs/pkgs/development/libraries/libsmartcols/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsmartcols/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, python3 }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, python3, gtk-doc}:
 
 stdenv.mkDerivation rec {
   name = "libsmartcols";
   version = "v2.36.1";
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig python3 ];
+  nativeBuildInputs = [ autoreconfHook pkg-config python3 gtk-doc ];
 
   src = fetchFromGitHub {
     owner = "karelzak";
@@ -24,9 +24,9 @@ stdenv.mkDerivation rec {
   meta = {
     description = "smart column output alignment library";
     homepage = https://github.com/karelzak/util-linux/tree/master/libsmartcols;
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
-    maintainers = with stdenv.lib.maintainers; [ rb2k ];
+    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
index 881af18d5592..9b71a91efed2 100644
--- a/nixpkgs/pkgs/development/libraries/libsmi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsmi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv , fetchurl }:
+{ lib, stdenv , fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "libsmi";
@@ -9,10 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "1lslaxr2qcj6hf4naq5n5mparfhmswsgq4wa7zm2icqvvgdcq6pj";
   };
 
-  meta = with stdenv.lib; {
+  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 = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    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
index 227353e0a9f8..3864a99f5e98 100644
--- a/nixpkgs/pkgs/development/libraries/libsnark/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsnark/default.nix
@@ -1,13 +1,14 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig, openssl, boost, gmp, procps }:
+{ stdenv, fetchFromGitHub, cmake, pkg-config, openssl, boost, gmp, procps }:
 
 let
   rev = "9e6b19ff15bc19fba5da1707ba18e7f160e5ed07";
   inherit (stdenv) lib;
 in stdenv.mkDerivation rec {
   name = "libsnark-pre${version}";
-  version = stdenv.lib.substring 0 8 rev;
+  version = lib.substring 0 8 rev;
 
-  buildInputs = [ cmake pkgconfig openssl boost gmp ] ++ lib.optional stdenv.hostPlatform.isLinux procps;
+  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" ];
 
@@ -19,12 +20,10 @@ in stdenv.mkDerivation rec {
     fetchSubmodules = true;
   };
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ library for zkSNARKs";
     homepage = "https://github.com/scipr-lab/libsnark";
     license = licenses.mit;
-    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    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
index 739bc7d73323..61e6d9cd7652 100644
--- a/nixpkgs/pkgs/development/libraries/libsndfile/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsndfile/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, autogen, flac, libogg, libopus, libvorbis, pkgconfig, python3
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, autogen, flac, libogg, libopus, libvorbis, pkg-config, python3
 , Carbon, AudioToolbox
 }:
 
@@ -13,9 +13,9 @@ stdenv.mkDerivation rec {
     sha256 = "1rh79y4s4m2wcm2kahmzs2kijpdpayif2gyca6m71f3k7jbhgcwa";
   };
 
-  nativeBuildInputs = [ autoreconfHook autogen pkgconfig python3 ];
+  nativeBuildInputs = [ autoreconfHook autogen pkg-config python3 ];
   buildInputs = [ flac libogg libopus libvorbis ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ Carbon AudioToolbox ];
+    ++ lib.optionals stdenv.isDarwin [ Carbon AudioToolbox ];
 
   enableParallelBuilding = true;
 
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
   # need headers from the Carbon.framework in /System/Library/Frameworks to
   # compile this on darwin -- not sure how to handle
-  preConfigure = stdenv.lib.optionalString stdenv.isDarwin
+  preConfigure = lib.optionalString stdenv.isDarwin
     ''
       NIX_CFLAGS_COMPILE+=" -I$SDKROOT/System/Library/Frameworks/Carbon.framework/Versions/A/Headers"
     '';
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
   # Needed on Darwin.
   NIX_CFLAGS_LINK = "-logg -lvorbis";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A C library for reading and writing files containing sampled sound";
     homepage    = "https://libsndfile.github.io/libsndfile/";
     license     = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libsodium/default.nix b/nixpkgs/pkgs/development/libraries/libsodium/default.nix
index c6381e2a1414..db2cd044592b 100644
--- a/nixpkgs/pkgs/development/libraries/libsodium/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsodium/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "libsodium-1.0.18";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A modern and easy-to-use crypto library";
     homepage = "http://doc.libsodium.org/";
     license = licenses.isc;
diff --git a/nixpkgs/pkgs/development/libraries/libsolv/default.nix b/nixpkgs/pkgs/development/libraries/libsolv/default.nix
index d75d9cc07805..bfacecde256d 100644
--- a/nixpkgs/pkgs/development/libraries/libsolv/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsolv/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, ninja, zlib, expat, rpm, db }:
+{ lib, stdenv, fetchFromGitHub, cmake, ninja, zlib, expat, rpm, db }:
 
 stdenv.mkDerivation rec {
   version  = "0.7.16";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ninja ];
   buildInputs = [ zlib expat rpm db ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A free package dependency solver";
     homepage    = "https://github.com/openSUSE/libsolv";
     license     = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libsoundio/default.nix b/nixpkgs/pkgs/development/libraries/libsoundio/default.nix
index a4a81af532ad..ac9f3b256546 100644
--- a/nixpkgs/pkgs/development/libraries/libsoundio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsoundio/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, alsaLib, libjack2, libpulseaudio, AudioUnit }:
+{ lib, stdenv, fetchFromGitHub, cmake, alsaLib, libjack2, libpulseaudio, AudioUnit }:
 
 stdenv.mkDerivation rec {
   version = "2.0.0";
@@ -14,12 +14,12 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
 
   buildInputs = [ libjack2 libpulseaudio ]
-    ++ stdenv.lib.optional stdenv.isLinux alsaLib
-    ++ stdenv.lib.optional stdenv.isDarwin AudioUnit;
+    ++ lib.optional stdenv.isLinux alsaLib
+    ++ lib.optional stdenv.isDarwin AudioUnit;
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-Wno-strict-prototypes";
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-Wno-strict-prototypes";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Cross platform audio input and output";
     homepage = "http://libsound.io/";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libsoup/default.nix b/nixpkgs/pkgs/development/libraries/libsoup/default.nix
index 88c6a359ba8d..47fcdd41f8ab 100644
--- a/nixpkgs/pkgs/development/libraries/libsoup/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsoup/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, glib, libxml2, meson, ninja, pkgconfig, gnome3, libsysprof-capture
+{ stdenv, lib, fetchurl, glib, libxml2, meson, ninja, pkg-config, gnome3, libsysprof-capture
 , gnomeSupport ? true, sqlite, glib-networking, gobject-introspection, vala
 , libpsl, python3, brotli
 }:
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
   version = "2.72.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "11skbyw2pw32178q3h8pi7xqa41b2x4k6q4k9f75zxmh8s23y30p";
   };
 
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
   ] ++ lib.optionals stdenv.isLinux [
     libsysprof-capture
   ];
-  nativeBuildInputs = [ meson ninja pkgconfig gobject-introspection vala glib ];
+  nativeBuildInputs = [ meson ninja pkg-config gobject-introspection vala glib ];
   propagatedBuildInputs = [ glib libxml2 ];
 
   NIX_CFLAGS_COMPILE = [ "-lpthread" ];
@@ -54,7 +54,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "HTTP client/server library for GNOME";
     homepage = "https://wiki.gnome.org/Projects/libsoup";
-    license = stdenv.lib.licenses.lgpl2Plus;
+    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
index 4b5f7f4b3f10..4c778fbd6902 100644
--- a/nixpkgs/pkgs/development/libraries/libspatialindex/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libspatialindex/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 let version = "1.8.5"; in
 
@@ -16,7 +16,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Extensible spatial index library in C++";
     homepage = "http://libspatialindex.github.io/";
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.unix;
+    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
index bdc4504ad5ac..2e9dadf0bf5d 100644
--- a/nixpkgs/pkgs/development/libraries/libspatialite/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libspatialite/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, pkgconfig, libxml2, sqlite, zlib, proj, geos, libiconv }:
+{ stdenv, lib, fetchurl, pkg-config, libxml2, sqlite, zlib, proj, geos, libiconv }:
 
 with lib;
 
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "16d4lpl7xrm9zy4gphy6nwanpjp8wn9g4wq2i2kh8abnlhq01448";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ libxml2 sqlite zlib proj geos libiconv ];
 
diff --git a/nixpkgs/pkgs/development/libraries/libspectre/default.nix b/nixpkgs/pkgs/development/libraries/libspectre/default.nix
index 11400a6a3e23..465aa941f396 100644
--- a/nixpkgs/pkgs/development/libraries/libspectre/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libspectre/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, pkgconfig, ghostscript, cairo }:
+{ fetchurl, lib, stdenv, pkg-config, ghostscript, cairo }:
 
 stdenv.mkDerivation rec {
   name = "libspectre-0.2.7";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     # Need `libgs.so'.
-    pkgconfig ghostscript cairo /*for tests*/
+    pkg-config ghostscript cairo /*for tests*/
   ];
 
   doCheck = true;
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
       handling and rendering Postscript documents.
     '';
 
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libspectrum/default.nix b/nixpkgs/pkgs/development/libraries/libspectrum/default.nix
index 24b9b9241c21..8922bedccdc8 100644
--- a/nixpkgs/pkgs/development/libraries/libspectrum/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libspectrum/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, perl, pkgconfig, audiofile, bzip2, glib, libgcrypt, zlib }:
+{ lib, stdenv, fetchurl, perl, pkg-config, audiofile, bzip2, glib, libgcrypt, zlib }:
 
 stdenv.mkDerivation rec {
   name = "libspectrum-1.4.4";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1cc0jx617sym6qj1f9fm115q44cq5azsxplqq2cgrg0pmlmjpyzx";
   };
 
-  nativeBuildInputs = [ perl pkgconfig ];
+  nativeBuildInputs = [ perl pkg-config ];
 
   buildInputs = [ audiofile bzip2 glib libgcrypt zlib ];
 
diff --git a/nixpkgs/pkgs/development/libraries/libspf2/default.nix b/nixpkgs/pkgs/development/libraries/libspf2/default.nix
index 42b39179b204..6a9cb8b647cc 100644
--- a/nixpkgs/pkgs/development/libraries/libspf2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libspf2/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, autoreconfHook }:
+{ lib, stdenv, fetchurl, autoreconfHook }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "libspf2";
diff --git a/nixpkgs/pkgs/development/libraries/libspiro/default.nix b/nixpkgs/pkgs/development/libraries/libspiro/default.nix
index a77e209119bb..03bfe14d3bee 100644
--- a/nixpkgs/pkgs/development/libraries/libspiro/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libspiro/default.nix
@@ -1,4 +1,4 @@
-{stdenv, pkgconfig, autoreconfHook, fetchFromGitHub }:
+{lib, stdenv, pkg-config, autoreconfHook, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "libspiro";
@@ -11,9 +11,9 @@ stdenv.mkDerivation rec {
     sha256 = "1b5bw5qxqlral96y1n5f3sh9yxm2yij3zkqjmlgd8r1k4j0d3nqw";
   };
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library that simplifies the drawing of beautiful curves";
     homepage = "https://github.com/fontforge/libspiro";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libspotify/default.nix b/nixpkgs/pkgs/development/libraries/libspotify/default.nix
index 69cd24dfd6e8..b39944d13dca 100644
--- a/nixpkgs/pkgs/development/libraries/libspotify/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libspotify/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libspotify, alsaLib, readline, pkgconfig, apiKey ? null, unzip, gnused }:
+{ lib, stdenv, fetchurl, libspotify, alsaLib, readline, pkg-config, apiKey ? null, unzip, gnused }:
 
 let
   version = "12.1.51";
@@ -47,14 +47,14 @@ else stdenv.mkDerivation {
 
 
   # darwin-specific
-  buildInputs = stdenv.lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") unzip;
+  buildInputs = lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") unzip;
 
   # linux-specific
-  installFlags = stdenv.lib.optional isLinux
+  installFlags = lib.optional isLinux
     "prefix=$(out)";
-  patchPhase = stdenv.lib.optionalString isLinux
+  patchPhase = lib.optionalString isLinux
     "${gnused}/bin/sed -i 's/ldconfig//' Makefile";
-  postInstall = stdenv.lib.optionalString isLinux
+  postInstall = lib.optionalString isLinux
     "mv -v share $out";
 
   passthru = {
@@ -65,9 +65,9 @@ else stdenv.mkDerivation {
         pname = "libspotify-samples";
         inherit version;
         src = libspotify.src;
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
         buildInputs = [ libspotify readline ]
-          ++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib;
+          ++ lib.optional (!stdenv.isDarwin) alsaLib;
         postUnpack = "sourceRoot=$sourceRoot/share/doc/libspotify/examples";
         patchPhase = "cp ${apiKey} appkey.c";
         installPhase = ''
@@ -82,7 +82,7 @@ else stdenv.mkDerivation {
     inherit apiKey;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Spotify API library";
     homepage    = "https://developer.spotify.com/technologies/libspotify";
     maintainers = with maintainers; [ lovek323 ];
diff --git a/nixpkgs/pkgs/development/libraries/libsrs2/default.nix b/nixpkgs/pkgs/development/libraries/libsrs2/default.nix
index 0d186204f92f..3da48f772545 100644
--- a/nixpkgs/pkgs/development/libraries/libsrs2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsrs2/default.nix
@@ -13,6 +13,6 @@ stdenv.mkDerivation rec {
     description = "The next generation SRS library from the original designer of SRS";
     license = with lib.licenses; [ gpl2 bsd3 ];
     homepage = "https://www.libsrs2.org/";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libssh/default.nix b/nixpkgs/pkgs/development/libraries/libssh/default.nix
index c6accad9c3c8..c613cfab777b 100644
--- a/nixpkgs/pkgs/development/libraries/libssh/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libssh/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, cmake, zlib, openssl, libsodium }:
+{ lib, stdenv, fetchurl, pkg-config, cmake, zlib, openssl, libsodium }:
 
 stdenv.mkDerivation rec {
   pname = "libssh";
@@ -19,9 +19,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ zlib openssl libsodium ];
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SSH client library";
     homepage = "https://libssh.org";
     license = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libssh2/default.nix b/nixpkgs/pkgs/development/libraries/libssh2/default.nix
index 8ce9c814df05..ed09e8ba5624 100644
--- a/nixpkgs/pkgs/development/libraries/libssh2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libssh2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, openssl, zlib, windows }:
+{ lib, stdenv, fetchurl, openssl, zlib, windows }:
 
 stdenv.mkDerivation rec {
   pname = "libssh2";
@@ -12,14 +12,14 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
 
   buildInputs = [ openssl zlib ]
-    ++ stdenv.lib.optional stdenv.hostPlatform.isMinGW windows.mingw_w64;
+    ++ lib.optional stdenv.hostPlatform.isMinGW windows.mingw_w64;
 
   patches = [
     # Not able to use fetchpatch here: infinite recursion
     ./CVE-2019-17498.patch
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A client-side C library implementing the SSH2 protocol";
     homepage = "https://www.libssh2.org";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/libstatgrab/default.nix b/nixpkgs/pkgs/development/libraries/libstatgrab/default.nix
index 70a632dd4a79..6d874fe23678 100644
--- a/nixpkgs/pkgs/development/libraries/libstatgrab/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libstatgrab/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , IOKit ? null }:
 
 stdenv.mkDerivation rec {
@@ -9,9 +9,9 @@ stdenv.mkDerivation rec {
     sha256 = "15m1sl990l85ijf8pnc6hdfha6fqyiq74mijrzm3xz4zzxm91wav";
   };
 
-  buildInputs = [] ++ stdenv.lib.optional stdenv.isDarwin IOKit;
+  buildInputs = [] ++ lib.optional stdenv.isDarwin IOKit;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.i-scream.org/libstatgrab/";
     description = "A library that provides cross platforms access to statistics about the running system";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libstroke/default.nix b/nixpkgs/pkgs/development/libraries/libstroke/default.nix
index e97b96d71d09..76f5b6b4b8c6 100644
--- a/nixpkgs/pkgs/development/libraries/libstroke/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libstroke/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, automake, autoconf, xlibsWrapper}:
+{lib, stdenv, fetchurl, automake, autoconf, xlibsWrapper}:
 
 stdenv.mkDerivation {
   name = "libstroke-0.5.1";
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
   meta = {
     description = "A library for simple gesture recognition";
     homepage = "https://web.archive.org/web/20161204100704/http://etla.net/libstroke/";
-    license = stdenv.lib.licenses.gpl2;
+    license = lib.licenses.gpl2;
 
     longDescription =
       '' libstroke, last updated in 2001, still successfully provides a basic
@@ -29,6 +29,6 @@ stdenv.mkDerivation {
         easy to work with, and notably used by FVWM.
       '';
 
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libstrophe/default.nix b/nixpkgs/pkgs/development/libraries/libstrophe/default.nix
index 428e23f33f51..ccc6fedd9169 100644
--- a/nixpkgs/pkgs/development/libraries/libstrophe/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libstrophe/default.nix
@@ -1,26 +1,32 @@
-{ stdenv, fetchFromGitHub, automake, autoconf, libtool, openssl, expat, pkgconfig, check }:
+{ lib, stdenv
+, fetchFromGitHub
+, autoreconfHook
+, libtool
+, openssl
+, expat
+, pkg-config
+, check
+}:
 
 stdenv.mkDerivation rec {
   pname = "libstrophe";
-  version = "0.10.0";
+  version = "0.10.1";
 
   src = fetchFromGitHub {
     owner = "strophe";
     repo = pname;
     rev = version;
-    sha256 = "1hizw695fw0cy88h1dpl9pvniapml2zw9yvxck8xvxbqfz54jwja";
+    sha256 = "11d341avsfr0z4lq15cy5dkmff6qpy91wkgzdpfdy31l27pa1g79";
   };
 
-  nativeBuildInputs = [ automake autoconf pkgconfig libtool check ];
-  buildInputs = [ openssl expat ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
+  buildInputs = [ openssl expat libtool check ];
 
   dontDisableStatic = true;
 
-  preConfigure = "mkdir m4 && sh bootstrap.sh";
-
   doCheck = true;
 
-  meta = {
+  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
@@ -28,8 +34,10 @@ stdenv.mkDerivation rec {
       runs well on both Linux, Unix, and Windows based platforms.
     '';
     homepage = "https://strophe.im/libstrophe/";
-    license = with stdenv.lib.licenses; [ gpl3 mit ];
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ devhell flosse ];
+    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
index 5dc4deb30be9..6f4741ed4d05 100644
--- a/nixpkgs/pkgs/development/libraries/libsvm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsvm/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   pname = "libsvm";
@@ -25,11 +25,11 @@ stdenv.mkDerivation rec {
     ln -s $out/include/svm.h $out/include/libsvm/svm.h
   '';
 
-  postFixup = stdenv.lib.optionalString stdenv.isDarwin ''
+  postFixup = lib.optionalString stdenv.isDarwin ''
     install_name_tool -id libsvm.2.dylib $out/lib/libsvm.2.dylib;
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library for support vector machines";
     homepage = "https://www.csie.ntu.edu.tw/~cjlin/libsvm/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libsystemtap/default.nix b/nixpkgs/pkgs/development/libraries/libsystemtap/default.nix
index b46a848a0416..1ce7ef58c886 100644
--- a/nixpkgs/pkgs/development/libraries/libsystemtap/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libsystemtap/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchgit, gettext, python, elfutils}:
+{lib, stdenv, fetchgit, gettext, python, elfutils}:
 
 stdenv.mkDerivation {
   pname = "libsystemtap";
@@ -20,11 +20,11 @@ stdenv.mkDerivation {
     cp -r includes/* $out/include/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Statically defined probes development files";
     homepage = "https://sourceware.org/systemtap/";
     license = licenses.bsd3;
     platforms = platforms.unix;
-    maintainers = [ stdenv.lib.maintainers.farlion ];
+    maintainers = [ lib.maintainers.farlion ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libtap/default.nix b/nixpkgs/pkgs/development/libraries/libtap/default.nix
index c1c506ef5e32..ce7cb6bfd1ee 100644
--- a/nixpkgs/pkgs/development/libraries/libtap/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libtap/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, pkgconfig, cmake, perl }:
+{ lib, stdenv, fetchurl, pkg-config, cmake, perl }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
 
   pname = "libtap";
@@ -11,10 +11,10 @@ stdenv.mkDerivation rec {
     sha256 = "1ga7rqmppa8ady665736cx443icscqlgflkqmxd4xbkzypmdj9bk";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   propagatedBuildInputs = [ cmake perl ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library to implement a test protocol";
     longDescription = ''
       libtap is a library to implement the Test Anything Protocol for
diff --git a/nixpkgs/pkgs/development/libraries/libtar/default.nix b/nixpkgs/pkgs/development/libraries/libtar/default.nix
index a31fde0d31d2..3e5b4cd23e9d 100644
--- a/nixpkgs/pkgs/development/libraries/libtar/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libtar/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, fetchpatch, autoreconfHook }:
+{ lib, stdenv, fetchgit, fetchpatch, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   version = "1.2.20";
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoreconfHook ];
   buildInputs = [ ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C library for manipulating POSIX tar files";
     homepage = "https://repo.or.cz/libtar";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libtasn1/default.nix b/nixpkgs/pkgs/development/libraries/libtasn1/default.nix
index 90dde37a4161..2239d7311f5a 100644
--- a/nixpkgs/pkgs/development/libraries/libtasn1/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libtasn1/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, texinfo }:
+{ lib, stdenv, fetchurl, perl, texinfo }:
 
 stdenv.mkDerivation rec {
   name = "libtasn1-4.16.0";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   else
     null;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.gnu.org/software/libtasn1/";
     description = "An ASN.1 library";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/libtcod/default.nix b/nixpkgs/pkgs/development/libraries/libtcod/default.nix
index c8c59b15f3ae..3e77d0876be8 100644
--- a/nixpkgs/pkgs/development/libraries/libtcod/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libtcod/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromBitbucket, cmake, SDL, libGLU, libGL, upx, zlib }:
+{ lib, stdenv, fetchFromBitbucket, cmake, SDL, libGLU, libGL, upx, zlib }:
 
 stdenv.mkDerivation {
 
@@ -21,13 +21,14 @@ stdenv.mkDerivation {
 
   cmakeFlags = [ "-DLIBTCOD_SAMPLES=OFF" ];
 
-  buildInputs = [ cmake SDL libGLU libGL upx zlib ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ SDL libGLU libGL upx zlib ];
 
   meta = {
     description = "API for roguelike games";
     homepage = "http://roguecentral.org/doryen/libtcod/";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.skeidel ];
+    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
index df500cd7a419..eebaee394ee0 100644
--- a/nixpkgs/pkgs/development/libraries/libtelnet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libtelnet/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkgconfig, autoreconfHook, zlib }:
+{ lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook, zlib }:
 
 stdenv.mkDerivation {
   pname = "libtelnet";
@@ -11,14 +11,14 @@ stdenv.mkDerivation {
     sha256 = "1lp6gdbndsp2w8mhy88c2jknxj2klvnggvq04ln7qjg8407ifpda";
   };
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
   buildInputs = [ zlib ];
 
   meta = {
     description = "Simple RFC-complient TELNET implementation as a C library";
     homepage = "https://github.com/seanmiddleditch/libtelnet";
-    license = stdenv.lib.licenses.publicDomain;
-    maintainers = [ stdenv.lib.maintainers.tomberek ];
-    platforms = stdenv.lib.platforms.linux;
+    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
index bb2e1b05bcec..9779ad6b9e5f 100644
--- a/nixpkgs/pkgs/development/libraries/libtermkey/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libtermkey/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchzip, libtool, pkgconfig, ncurses, unibilium }:
+{ stdenv, lib, fetchzip, libtool, pkg-config, ncurses, unibilium }:
 
 stdenv.mkDerivation rec {
   pname = "libtermkey";
@@ -11,9 +11,9 @@ stdenv.mkDerivation rec {
   };
 
   makeFlags = [ "PREFIX=$(out)" ]
-    ++ stdenv.lib.optional stdenv.isDarwin "LIBTOOL=${libtool}/bin/libtool";
+    ++ lib.optional stdenv.isDarwin "LIBTOOL=${libtool}/bin/libtool";
 
-  nativeBuildInputs = [ libtool pkgconfig ];
+  nativeBuildInputs = [ libtool pkg-config ];
   buildInputs = [ ncurses unibilium ];
 
   meta = with lib; {
diff --git a/nixpkgs/pkgs/development/libraries/libthai/default.nix b/nixpkgs/pkgs/development/libraries/libthai/default.nix
index 6179ad0f6bda..ad00906bb8cc 100644
--- a/nixpkgs/pkgs/development/libraries/libthai/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libthai/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, makeWrapper, installShellFiles, pkg-config, libdatrie }:
+{ lib, stdenv, fetchurl, makeWrapper, installShellFiles, pkg-config, libdatrie }:
 
 stdenv.mkDerivation rec {
   pname = "libthai";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     installManPage man/man3/*.3
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://linux.thai.net/projects/libthai/";
     description = "Set of Thai language support routines";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libtheora/default.nix b/nixpkgs/pkgs/development/libraries/libtheora/default.nix
index 656204fb0ce8..1638150c2632 100644
--- a/nixpkgs/pkgs/development/libraries/libtheora/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libtheora/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, libogg, libvorbis, pkgconfig}:
+{lib, stdenv, fetchurl, libogg, libvorbis, pkg-config}:
 
 stdenv.mkDerivation rec {
   name = "libtheora-1.1.1";
@@ -11,16 +11,16 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
   outputDoc = "devdoc";
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   propagatedBuildInputs = [ libogg libvorbis ];
 
   # GCC's -fforce-addr flag is not supported by clang
   # It's just an optimization, so it's safe to simply remove it
-  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace configure --replace "-fforce-addr" ""
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.theora.org/";
     description = "Library for Theora, a free and open video compression format";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libthreadar/default.nix b/nixpkgs/pkgs/development/libraries/libthreadar/default.nix
index 587ef2e208a3..c67be246928c 100644
--- a/nixpkgs/pkgs/development/libraries/libthreadar/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libthreadar/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   version = "1.3.1";
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..6eb013a7ffd7
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libticalcs2/default.nix
@@ -0,0 +1,50 @@
+{ stdenv
+, lib
+, fetchurl
+, pkg-config
+, autoreconfHook
+, glib
+, libticonv
+, libtifiles2
+, libticables2
+, lzma
+, 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
+    lzma
+    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/default.nix b/nixpkgs/pkgs/development/libraries/libtiff/default.nix
index 6d4109621826..3d3b3529483a 100644
--- a/nixpkgs/pkgs/development/libraries/libtiff/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libtiff/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 
-, pkgconfig
+, pkg-config
 
 , zlib
 , libjpeg
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "bin" "dev" "out" "man" "doc" ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   propagatedBuildInputs = [ zlib libjpeg xz ]; #TODO: opengl support (bogus configure detection)
 
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true; # not cross;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library and utilities for working with the TIFF image file format";
     homepage = "http://download.osgeo.org/libtiff";
     license = licenses.libtiff;
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
index fbc726a45198..094ff565b3c5 100644
--- a/nixpkgs/pkgs/development/libraries/libtiger/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libtiger/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, libkate, pango, cairo, pkgconfig, darwin }:
+{ stdenv, lib, fetchurl, libkate, pango, cairo, pkg-config, darwin }:
 
 stdenv.mkDerivation rec {
   name = "libtiger-0.3.4";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0rj1bmr9kngrgbxrjbn4f4f9pww0wmf6viflinq7ava7zdav4hkk";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libkate pango cairo ]
     ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.ApplicationServices;
 
diff --git a/nixpkgs/pkgs/development/libraries/libtins/default.nix b/nixpkgs/pkgs/development/libraries/libtins/default.nix
index bde1cbf44e1f..7279dc9ddfa2 100644
--- a/nixpkgs/pkgs/development/libraries/libtins/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libtins/default.nix
@@ -1,4 +1,4 @@
-{ boost, cmake, fetchFromGitHub, gtest, libpcap, openssl, stdenv }:
+{ boost, cmake, fetchFromGitHub, gtest, libpcap, openssl, lib, stdenv }:
 
 stdenv.mkDerivation rec {
   pname = "libtins";
@@ -29,7 +29,6 @@ stdenv.mkDerivation rec {
     "--with-boost=${boost.dev}"
   ];
 
-  enableParallelBuilding = true;
   doCheck = true;
   preCheck = ''
     export LD_LIBRARY_PATH=$LD_LIBRARY_PATH''${LD_LIBRARY_PATH:+:}$PWD${placeholder "out"}/lib
@@ -37,12 +36,12 @@ stdenv.mkDerivation rec {
   '';
   checkTarget = "tests test";
 
-  meta = with stdenv.lib; {
+  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 = stdenv.lib.licenses.bsd2;
+    license = lib.licenses.bsd2;
     maintainers = with maintainers; [ fdns ];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libtomcrypt/default.nix b/nixpkgs/pkgs/development/libraries/libtomcrypt/default.nix
index 4587701011dd..7ed8fca3babd 100644
--- a/nixpkgs/pkgs/development/libraries/libtomcrypt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libtomcrypt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, libtool }:
+{ lib, stdenv, fetchurl, fetchpatch, libtool }:
 
 stdenv.mkDerivation rec {
   pname = "libtomcrypt";
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.libtom.net/LibTomCrypt/";
     description = "A fairly comprehensive, modular and portable cryptographic toolkit";
     license = with licenses; [ publicDomain wtfpl ];
diff --git a/nixpkgs/pkgs/development/libraries/libtommath/default.nix b/nixpkgs/pkgs/development/libraries/libtommath/default.nix
index 9a0a2def4b71..058ae5242315 100644
--- a/nixpkgs/pkgs/development/libraries/libtommath/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libtommath/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libtool }:
+{ lib, stdenv, fetchurl, libtool }:
 
 stdenv.mkDerivation rec {
   pname = "libtommath";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.libtom.net/LibTomMath/";
     description = "A library for integer-based number-theoretic applications";
     license = with licenses; [ publicDomain wtfpl ];
diff --git a/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.1.nix b/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.1.nix
index b2c958795f3e..a898dd8e24e6 100644
--- a/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.1.nix
+++ b/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.1.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, pkgconfig, automake, autoconf
+{ stdenv, lib, fetchFromGitHub, pkg-config, automake, autoconf
 , zlib, boost, openssl, libtool, python, libiconv, ncurses
 }:
 
@@ -22,7 +22,7 @@ in stdenv.mkDerivation {
   };
 
   enableParallelBuilding = true;
-  nativeBuildInputs = [ automake autoconf libtool pkgconfig ];
+  nativeBuildInputs = [ automake autoconf libtool pkg-config ];
   buildInputs = [ boostPython openssl zlib python libiconv ncurses ];
   preConfigure = "./autotool.sh";
 
@@ -40,7 +40,7 @@ in stdenv.mkDerivation {
     "--with-boost-libdir=${boostPython.out}/lib"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://libtorrent.org/";
     description = "A C++ BitTorrent implementation focusing on efficiency and scalability";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.2.nix b/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.2.nix
index 9a165780b7e2..fc97b629a52f 100644
--- a/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.2.nix
+++ b/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/1.2.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkg-config, automake, autoconf
+{ lib, stdenv, fetchFromGitHub, pkg-config, automake, autoconf
 , zlib, boost, openssl, libtool, python, libiconv, ncurses, SystemConfiguration
 }:
 
@@ -25,7 +25,7 @@ in stdenv.mkDerivation {
   nativeBuildInputs = [ automake autoconf libtool pkg-config ];
 
   buildInputs = [ boostPython openssl zlib python libiconv ncurses ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ SystemConfiguration ];
+    ++ lib.optionals stdenv.isDarwin [ SystemConfiguration ];
 
   preConfigure = "./autotool.sh";
 
@@ -43,7 +43,7 @@ in stdenv.mkDerivation {
     "--with-boost-libdir=${boostPython.out}/lib"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://libtorrent.org/";
     description = "A C++ BitTorrent implementation focusing on efficiency and scalability";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/default.nix b/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/default.nix
index e9c59ed97e82..ad3a47f99ce3 100644
--- a/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libtorrent-rasterbar/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake
+{ lib, stdenv, fetchFromGitHub, cmake
 , zlib, boost, openssl, python, ncurses, SystemConfiguration
 }:
 
@@ -23,7 +23,7 @@ in stdenv.mkDerivation {
   nativeBuildInputs = [ cmake ];
 
   buildInputs = [ boostPython openssl zlib python ncurses ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ SystemConfiguration ];
+    ++ lib.optionals stdenv.isDarwin [ SystemConfiguration ];
 
   postInstall = ''
     moveToOutput "include" "$dev"
@@ -36,7 +36,7 @@ in stdenv.mkDerivation {
     "-Dpython-bindings=on"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://libtorrent.org/";
     description = "A C++ BitTorrent implementation focusing on efficiency and scalability";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libtoxcore/default.nix b/nixpkgs/pkgs/development/libraries/libtoxcore/default.nix
index 6d170c798d0a..4badf32fe8cc 100644
--- a/nixpkgs/pkgs/development/libraries/libtoxcore/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libtoxcore/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchFromGitHub, cmake, libsodium, ncurses, libopus, msgpack
-, libvpx, check, libconfig, pkgconfig }:
+{ lib, stdenv, fetchFromGitHub, cmake, libsodium, ncurses, libopus, msgpack
+, libvpx, check, libconfig, pkg-config }:
 
 let
   generic = { version, sha256 }:
@@ -22,13 +22,11 @@ let
 
     buildInputs = [
       libsodium msgpack ncurses libconfig
-    ] ++ stdenv.lib.optionals (!stdenv.isAarch32) [
+    ] ++ lib.optionals (!stdenv.isAarch32) [
       libopus libvpx
     ];
 
-    nativeBuildInputs = [ cmake pkgconfig ];
-
-    enableParallelBuilding = true;
+    nativeBuildInputs = [ cmake pkg-config ];
 
     doCheck = false; # hangs, tries to access the net?
     checkInputs = [ check ];
@@ -39,7 +37,7 @@ let
         -e "s|^includedir=.*|includedir=$out/include|"
     '';
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       description = "P2P FOSS instant messaging application aimed to replace Skype";
       homepage = "https://tox.chat";
       license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libtoxcore/new-api.nix b/nixpkgs/pkgs/development/libraries/libtoxcore/new-api.nix
index 6cd5f9122a4f..77119e2830fe 100644
--- a/nixpkgs/pkgs/development/libraries/libtoxcore/new-api.nix
+++ b/nixpkgs/pkgs/development/libraries/libtoxcore/new-api.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, libsodium, ncurses, libopus
-, libvpx, check, libconfig, pkgconfig }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, libsodium, ncurses, libopus
+, libvpx, check, libconfig, pkg-config }:
 
 stdenv.mkDerivation {
   name = "tox-core-new-20160727";
@@ -30,14 +30,14 @@ stdenv.mkDerivation {
   ];
 
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [
     autoreconfHook libsodium ncurses check libconfig
-  ] ++ stdenv.lib.optionals (!stdenv.isAarch32) [
+  ] ++ lib.optionals (!stdenv.isAarch32) [
     libopus
   ];
 
-  propagatedBuildInputs = stdenv.lib.optionals (!stdenv.isAarch32) [ libvpx ];
+  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}
@@ -47,7 +47,7 @@ stdenv.mkDerivation {
   # NOTE: run the tests locally on your machine before upgrading this package!
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "P2P FOSS instant messaging application aimed to replace Skype with crypto";
     license = licenses.gpl3Plus;
     maintainers = with maintainers; [ ];
diff --git a/nixpkgs/pkgs/development/libraries/libtsm/default.nix b/nixpkgs/pkgs/development/libraries/libtsm/default.nix
index 21108fa108e4..d959306c9718 100644
--- a/nixpkgs/pkgs/development/libraries/libtsm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libtsm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, libxkbcommon, pkgconfig, cmake }:
+{ lib, stdenv, fetchFromGitHub, libxkbcommon, pkg-config, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "libtsm";
@@ -13,9 +13,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libxkbcommon ];
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Terminal-emulator State Machine";
     homepage = "http://www.freedesktop.org/wiki/Software/kmscon/libtsm/";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libu2f-host/default.nix b/nixpkgs/pkgs/development/libraries/libu2f-host/default.nix
index a9c62673115a..3be758c906f1 100644
--- a/nixpkgs/pkgs/development/libraries/libu2f-host/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libu2f-host/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, pkgconfig, json_c, hidapi }:
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, json_c, hidapi }:
 
 stdenv.mkDerivation rec {
   pname = "libu2f-host";
@@ -18,12 +18,12 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ json_c hidapi ];
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/libu2f-server/default.nix b/nixpkgs/pkgs/development/libraries/libu2f-server/default.nix
index cd961cde1d28..7f596978cf06 100644
--- a/nixpkgs/pkgs/development/libraries/libu2f-server/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libu2f-server/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, pkgconfig, json_c, openssl, check, file, help2man, which, gengetopt }:
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, json_c, openssl, check, file, help2man, which, gengetopt }:
 
 stdenv.mkDerivation rec {
   name = "libu2f-server-1.1.0";
@@ -16,10 +16,10 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ json_c openssl check file help2man which gengetopt ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libubox/default.nix b/nixpkgs/pkgs/development/libraries/libubox/default.nix
index 2cd5bd8a3412..f8dfa80a9597 100644
--- a/nixpkgs/pkgs/development/libraries/libubox/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libubox/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchgit, cmake, pkgconfig, json_c }:
+{ stdenv, lib, fetchgit, cmake, pkg-config, json_c }:
 
 stdenv.mkDerivation {
   pname = "libubox";
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   cmakeFlags = [ "-DBUILD_LUA=OFF" "-DBUILD_EXAMPLES=OFF" ];
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
   buildInputs = [ json_c ];
 
   meta = with lib; {
diff --git a/nixpkgs/pkgs/development/libraries/libuchardet/default.nix b/nixpkgs/pkgs/development/libraries/libuchardet/default.nix
index 43fa300f1076..443791f24519 100644
--- a/nixpkgs/pkgs/development/libraries/libuchardet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libuchardet/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake }:
+{ lib, stdenv, fetchurl, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "uchardet";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Mozilla's Universal Charset Detector C/C++ API";
     homepage = "https://www.freedesktop.org/wiki/Software/uchardet/";
     license = licenses.mpl11;
diff --git a/nixpkgs/pkgs/development/libraries/libucl/default.nix b/nixpkgs/pkgs/development/libraries/libucl/default.nix
index b9b33453a4c6..e65d0d475ff9 100644
--- a/nixpkgs/pkgs/development/libraries/libucl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libucl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , pkg-config
 , autoreconfHook
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkg-config autoreconfHook ];
 
-  buildInputs = with stdenv.lib;
+  buildInputs = with lib;
     concatLists (
       mapAttrsToList (feat: enabled:
         optionals enabled (featureDeps."${feat}" or [])
@@ -45,10 +45,10 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  configureFlags = with stdenv.lib;
+  configureFlags = with lib;
     mapAttrsToList (feat: enabled: strings.enableFeature enabled feat) features;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Universal configuration library parser";
     homepage = "https://github.com/vstakhov/libucl";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/libuecc/default.nix b/nixpkgs/pkgs/development/libraries/libuecc/default.nix
index ff6801ef18f4..1cc3ac8ebea1 100644
--- a/nixpkgs/pkgs/development/libraries/libuecc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libuecc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, cmake }:
+{ lib, stdenv, fetchgit, cmake }:
 
 stdenv.mkDerivation rec {
   version = "7";
@@ -10,11 +10,9 @@ stdenv.mkDerivation rec {
     sha256 = "1sm05aql75sh13ykgsv3ns4x4zzw9lvzid6misd22gfgf6r9n5fs";
   };
 
-  buildInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Very small Elliptic Curve Cryptography library";
     homepage = "https://git.universe-factory.net/libuecc";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/libui/default.nix b/nixpkgs/pkgs/development/libraries/libui/default.nix
index 5cb19f863ccc..7002f75cc45e 100644
--- a/nixpkgs/pkgs/development/libraries/libui/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libui/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig, gtk3, Cocoa }:
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, gtk3, Cocoa }:
 
 let
   shortName = "libui";
@@ -15,21 +15,21 @@ stdenv.mkDerivation {
     sha256 = "0bm6xvqk4drg2kw6d304x6mlfal7gh8mbl5a9f0509smmdzgdkwm";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
-  propagatedBuildInputs = stdenv.lib.optional stdenv.isLinux gtk3
-    ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa ];
+  nativeBuildInputs = [ cmake pkg-config ];
+  propagatedBuildInputs = lib.optional stdenv.isLinux gtk3
+    ++ lib.optionals stdenv.isDarwin [ Cocoa ];
 
-  preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
+  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
-  '' + stdenv.lib.optionalString stdenv.isLinux ''
+  '' + lib.optionalString stdenv.isLinux ''
     mv ./out/${shortName}.so.0 $out/lib/
     ln -s $out/lib/${shortName}.so.0 $out/lib/${shortName}.so
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     mv ./out/${shortName}.A.dylib $out/lib/
     ln -s $out/lib/${shortName}.A.dylib $out/lib/${shortName}.dylib
   '' + ''
@@ -41,11 +41,11 @@ stdenv.mkDerivation {
       --subst-var-by out $out \
       --subst-var-by version "${version}"
   '';
-  postInstall = stdenv.lib.optionalString stdenv.isDarwin ''
+  postInstall = lib.optionalString stdenv.isDarwin ''
     install_name_tool -id $out/lib/${shortName}.A.dylib $out/lib/${shortName}.A.dylib
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libuinputplus/default.nix b/nixpkgs/pkgs/development/libraries/libuinputplus/default.nix
index 700a4701fc87..9085b8610789 100644
--- a/nixpkgs/pkgs/development/libraries/libuinputplus/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libuinputplus/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig }:
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "libuinputplus";
@@ -11,9 +11,9 @@ stdenv.mkDerivation rec {
     sha256 = "0jy5i7bmjad7hw1qcyjl4swqribp2027s9g3609zwj7lj8z5x0bg";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit (src.meta) homepage;
     description = "Easy-to-use uinput library in C++";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libunarr/default.nix b/nixpkgs/pkgs/development/libraries/libunarr/default.nix
index 3bc5f1370918..523ce82ce22d 100644
--- a/nixpkgs/pkgs/development/libraries/libunarr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libunarr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake }:
+{ lib, stdenv, fetchurl, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "libunarr";
@@ -11,9 +11,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  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
index d30c84b52a2e..9e6cec471d4d 100644
--- a/nixpkgs/pkgs/development/libraries/libunibreak/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libunibreak/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchFromGitHub, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "libunibreak";
   version = "4.3";
 
   src = let
-      rev_version = stdenv.lib.replaceStrings ["."] ["_"] version;
+      rev_version = lib.replaceStrings ["."] ["_"] version;
   in fetchFromGitHub {
     owner = "adah1972";
     repo = pname;
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libuninameslist/default.nix b/nixpkgs/pkgs/development/libraries/libuninameslist/default.nix
index afae04cb6b23..2e75c783681e 100644
--- a/nixpkgs/pkgs/development/libraries/libuninameslist/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libuninameslist/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook
 }:
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     autoreconfHook
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/fontforge/libuninameslist/";
     description = "A Library of Unicode names and annotation data";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libunique/3.x.nix b/nixpkgs/pkgs/development/libraries/libunique/3.x.nix
index e960117125e6..72027b85ed43 100644
--- a/nixpkgs/pkgs/development/libraries/libunique/3.x.nix
+++ b/nixpkgs/pkgs/development/libraries/libunique/3.x.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl, pkgconfig
+{ lib, stdenv, fetchurl, pkg-config
 , dbus, dbus-glib, gtk3, gobject-introspection
 , gtk-doc, docbook_xml_dtd_45, docbook_xsl
 , libxslt, libxml2 }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
 
   majorVer = "3.0";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     sha256 = "0f70lkw66v9cj72q0iw1s2546r6bwwcd8idcm3621fg2fgh2rw58";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ dbus dbus-glib gtk3 gobject-introspection gtk-doc docbook_xml_dtd_45 docbook_xsl libxslt libxml2 ];
 
   meta = {
@@ -25,6 +25,6 @@ stdenv.mkDerivation rec {
     description = "A library for writing single instance applications";
     license = licenses.lgpl21;
     maintainers = [ maintainers.AndersonTorres ];
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libunique/default.nix b/nixpkgs/pkgs/development/libraries/libunique/default.nix
index 502fd27ebb6c..27db05ee98ab 100644
--- a/nixpkgs/pkgs/development/libraries/libunique/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libunique/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, pkgconfig, glib, gtk2, dbus-glib }:
+{ 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}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.bz2";
     sha256 = "1fsgvmncd9caw552lyfg8swmsd6bh4ijjsph69bwacwfxwf09j75";
   };
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     ./1.1.6-include-terminator.patch
   ] ++ [ ./gcc7-bug.patch ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ glib gtk2 dbus-glib ];
 
   # Don't make deprecated usages hard errors
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://wiki.gnome.org/Attic/LibUnique";
     description = "A library for writing single instance applications";
-    license = stdenv.lib.licenses.lgpl21;
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    license = lib.licenses.lgpl21;
+    platforms = with lib.platforms; linux ++ darwin;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libunistring/default.nix b/nixpkgs/pkgs/development/libraries/libunistring/default.nix
index 5f300ef51997..f7a77832c183 100644
--- a/nixpkgs/pkgs/development/libraries/libunistring/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libunistring/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, libiconv }:
+{ fetchurl, lib, stdenv, libiconv }:
 
 # Note: this package is used for bootstrapping fetchurl, and thus
 # cannot use fetchpatch! All mutable patches (generated by GitHub or
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "info" "doc" ];
 
-  propagatedBuildInputs = stdenv.lib.optional (!stdenv.isLinux) libiconv;
+  propagatedBuildInputs = lib.optional (!stdenv.isLinux) libiconv;
 
   configureFlags = [
     "--with-libiconv-prefix=${libiconv}"
@@ -64,9 +64,9 @@ stdenv.mkDerivation rec {
       strings as internal in-memory representation.
     '';
 
-    license = stdenv.lib.licenses.lgpl3Plus;
+    license = lib.licenses.lgpl3Plus;
 
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libunity/default.nix b/nixpkgs/pkgs/development/libraries/libunity/default.nix
index 037e84069b42..f6fb9a13e4cd 100644
--- a/nixpkgs/pkgs/development/libraries/libunity/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libunity/default.nix
@@ -1,6 +1,6 @@
-{ stdenv
+{ lib, stdenv
 , fetchgit
-, pkgconfig
+, pkg-config
 , glib
 , vala
 , dee
@@ -28,7 +28,7 @@ stdenv.mkDerivation {
     autoreconfHook
     gobject-introspection
     intltool
-    pkgconfig
+    pkg-config
     python3
     vala
   ];
@@ -56,7 +56,7 @@ stdenv.mkDerivation {
     "--with-pygi-overrides-dir=${placeholder "py"}/${python3.sitePackages}/gi/overrides"
   ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libunwind/default.nix b/nixpkgs/pkgs/development/libraries/libunwind/default.nix
index 3816788f9299..b2b5db2309c1 100644
--- a/nixpkgs/pkgs/development/libraries/libunwind/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libunwind/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   # Without latex2man, no man pages are installed despite being
   # prebuilt in the source tarball.
-  configureFlags = "LATEX2MAN=${coreutils}/bin/true";
+  configureFlags = [ "LATEX2MAN=${coreutils}/bin/true" ];
 
   propagatedBuildInputs = [ xz ];
 
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # fails
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/liburcu/default.nix b/nixpkgs/pkgs/development/libraries/liburcu/default.nix
index 6046bcf8eab3..d108bf4e6df4 100644
--- a/nixpkgs/pkgs/development/libraries/liburcu/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liburcu/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl }:
+{ lib, stdenv, fetchurl, perl }:
 
 stdenv.mkDerivation rec {
   version = "0.12.1";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   preCheck = "patchShebangs tests/unit";
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Userspace RCU (read-copy-update) library";
     homepage = "https://lttng.org/urcu";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/liburing/default.nix b/nixpkgs/pkgs/development/libraries/liburing/default.nix
index 938846ace54f..6a94f37181d4 100644
--- a/nixpkgs/pkgs/development/libraries/liburing/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liburing/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit
+{ lib, stdenv, fetchgit
 , fetchpatch
 }:
 
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
   ''
   ;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Userspace library for the Linux io_uring API";
     homepage    = "https://git.kernel.dk/cgit/liburing/";
     license     = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libusb-compat/0.1.nix b/nixpkgs/pkgs/development/libraries/libusb-compat/0.1.nix
index 2830ef284587..b23123f56eaa 100644
--- a/nixpkgs/pkgs/development/libraries/libusb-compat/0.1.nix
+++ b/nixpkgs/pkgs/development/libraries/libusb-compat/0.1.nix
@@ -3,7 +3,7 @@
 , fetchFromGitHub
 , autoreconfHook
 , patchelf
-, pkgconfig
+, pkg-config
 , libusb1
 }:
 
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ]; # get rid of propagating systemd closure
   outputBin = "dev";
 
-  nativeBuildInputs = [ autoreconfHook patchelf pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook patchelf pkg-config ];
 
   buildInputs = [ libusb1 ];
 
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     sha256 = "1nybccgjs14b3phhaycq2jx1gym4nf6sghvnv9qdfmlqxacx0jz5";
   };
 
-  patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ./fix-headers.patch;
+  patches = lib.optional stdenv.hostPlatform.isMusl ./fix-headers.patch;
 
   # without this, libusb-compat is unable to find libusb1
   postFixup = ''
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
       patchelf --set-rpath ${lib.makeLibraryPath buildInputs} {} \;
   '';
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/libusb1/default.nix b/nixpkgs/pkgs/development/libraries/libusb1/default.nix
index 10310e22da7b..33cd34ea5a0e 100644
--- a/nixpkgs/pkgs/development/libraries/libusb1/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libusb1/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook
-, pkgconfig
+, pkg-config
 , enableUdev ? stdenv.isLinux && !stdenv.hostPlatform.isMusl
 , udev ? null
 , libobjc
@@ -24,20 +24,20 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
   propagatedBuildInputs =
-    stdenv.lib.optional enableUdev udev ++
-    stdenv.lib.optionals stdenv.isDarwin [ libobjc IOKit ];
+    lib.optional enableUdev udev ++
+    lib.optionals stdenv.isDarwin [ libobjc IOKit ];
 
   dontDisableStatic = withStatic;
 
-  configureFlags = stdenv.lib.optional (!enableUdev) "--disable-udev";
+  configureFlags = lib.optional (!enableUdev) "--disable-udev";
 
-  preFixup = stdenv.lib.optionalString enableUdev ''
-    sed 's,-ludev,-L${stdenv.lib.getLib udev}/lib -ludev,' -i $out/lib/libusb-1.0.la
+  preFixup = lib.optionalString enableUdev ''
+    sed 's,-ludev,-L${lib.getLib udev}/lib -ludev,' -i $out/lib/libusb-1.0.la
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://libusb.info/";
     repositories.git = "https://github.com/libusb/libusb";
     description = "cross-platform user-mode USB device library";
diff --git a/nixpkgs/pkgs/development/libraries/libusbmuxd/default.nix b/nixpkgs/pkgs/development/libraries/libusbmuxd/default.nix
index e2e0a6d9d75d..66198a6ec33f 100644
--- a/nixpkgs/pkgs/development/libraries/libusbmuxd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libusbmuxd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libplist }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, libplist }:
 
 stdenv.mkDerivation rec {
   pname = "libusbmuxd";
@@ -11,10 +11,10 @@ stdenv.mkDerivation rec {
     sha256 = "139pzsnixkck6ly1q6p0diqr0hgd0mx0pr4xx1jamm3f3656kpf9";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ libplist ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A client library to multiplex connections from and to iOS devices";
     homepage    = "https://github.com/libimobiledevice/libusbmuxd";
     license     = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libuv/default.nix b/nixpkgs/pkgs/development/libraries/libuv/default.nix
index fa661446b9a1..a4447ed33789 100644
--- a/nixpkgs/pkgs/development/libraries/libuv/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libuv/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, autoconf, automake, libtool, pkgconfig, ApplicationServices, CoreServices }:
+{ stdenv, lib, fetchFromGitHub, autoconf, automake, libtool, pkg-config, ApplicationServices, CoreServices }:
 
 stdenv.mkDerivation rec {
   version = "1.40.0";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
       "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
-    ] ++ stdenv.lib.optionals stdenv.isDarwin [
+    ] ++ 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.
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
         "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"
-    ] ++ stdenv.lib.optionals stdenv.isAarch32 [
+    ] ++ lib.optionals stdenv.isAarch32 [
       # I observe this test failing with some regularity on ARMv7:
       # https://github.com/libuv/libuv/issues/1871
       "shutdown_close_pipe"
@@ -50,8 +50,8 @@ stdenv.mkDerivation rec {
       sed '/${tdRegexp}/d' -i test/test-list.h
     '';
 
-  nativeBuildInputs = [ automake autoconf libtool pkgconfig ];
-  buildInputs = stdenv.lib.optionals stdenv.isDarwin [ ApplicationServices CoreServices ];
+  nativeBuildInputs = [ automake autoconf libtool pkg-config ];
+  buildInputs = lib.optionals stdenv.isDarwin [ ApplicationServices CoreServices ];
 
   preConfigure = ''
     LIBTOOLIZE=libtoolize ./autogen.sh
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
index 1debefed0ad9..ade56ac16ee9 100644
--- a/nixpkgs/pkgs/development/libraries/libva/1.0.0.nix
+++ b/nixpkgs/pkgs/development/libraries/libva/1.0.0.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, libX11, pkgconfig, libXext, libdrm, libXfixes, wayland, libffi
+{ stdenv, lib, fetchurl, libX11, pkg-config, libXext, libdrm, libXfixes, wayland, libffi
 , libGL, mesa
 , minimal ? false, libva1-minimal
 }:
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "bin" "dev" "out" ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ libdrm ]
     ++ lib.optionals (!minimal) [ libva1-minimal libX11 libXext libXfixes wayland libffi libGL ];
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
 
   installFlags = [ "dummy_drv_video_ladir=$(out)/lib/dri" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.freedesktop.org/wiki/Software/vaapi";
     license = licenses.mit;
     description = "VAAPI library: Video Acceleration API";
diff --git a/nixpkgs/pkgs/development/libraries/libva/default.nix b/nixpkgs/pkgs/development/libraries/libva/default.nix
index f37780f5d6d6..d78332bf5aae 100644
--- a/nixpkgs/pkgs/development/libraries/libva/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libva/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     "-Ddriverdir=${mesa.drivers.driverLink}/lib/dri:/usr/lib/dri:/usr/lib32/dri"
   ];
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libva/utils.nix b/nixpkgs/pkgs/development/libraries/libva/utils.nix
index f860c328fe7a..bcd24d519535 100644
--- a/nixpkgs/pkgs/development/libraries/libva/utils.nix
+++ b/nixpkgs/pkgs/development/libraries/libva/utils.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, meson, ninja, pkg-config
+{ lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config
 , libdrm, libva, libX11, libXext, libXfixes, wayland
 }:
 
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libdrm libva libX11 libXext libXfixes wayland ];
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libvdpau-va-gl/default.nix b/nixpkgs/pkgs/development/libraries/libvdpau-va-gl/default.nix
index 98176cd41f14..85ebef12fe1f 100644
--- a/nixpkgs/pkgs/development/libraries/libvdpau-va-gl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libvdpau-va-gl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig, libX11, libpthreadstubs, libXau, libXdmcp
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libX11, libpthreadstubs, libXau, libXdmcp
 , libXext, libvdpau, glib, libva, ffmpeg_3, libGLU }:
 
 stdenv.mkDerivation rec {
@@ -12,12 +12,12 @@ stdenv.mkDerivation rec {
     sha256 = "0asndybfv8xb0fx73sjjw5kydqrahqkm6n04lh589pbf18s5qlld";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
   buildInputs = [ libX11 libpthreadstubs libXau libXdmcp libXext libvdpau glib libva ffmpeg_3 libGLU ];
 
   doCheck = false; # fails. needs DRI access
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/i-rinat/libvdpau-va-gl";
     description = "VDPAU driver with OpenGL/VAAPI backend";
     license = licenses.lgpl3;
diff --git a/nixpkgs/pkgs/development/libraries/libvdpau/default.nix b/nixpkgs/pkgs/development/libraries/libvdpau/default.nix
index cbb312e0f0d8..75dcd337c38b 100644
--- a/nixpkgs/pkgs/development/libraries/libvdpau/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libvdpau/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, xorg, mesa, meson, ninja }:
+{ lib, stdenv, fetchurl, pkg-config, xorg, mesa, meson, ninja }:
 
 stdenv.mkDerivation rec {
   pname = "libvdpau";
@@ -12,17 +12,17 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ meson ninja pkgconfig ];
+  nativeBuildInputs = [ meson ninja pkg-config ];
   buildInputs = with xorg; [ xorgproto libXext ];
 
   propagatedBuildInputs = [ xorg.libX11 ];
 
-  mesonFlags = stdenv.lib.optional stdenv.isLinux
+  mesonFlags = lib.optional stdenv.isLinux
     [ "-Dmoduledir=${mesa.drivers.driverLink}/lib/vdpau" ];
 
-  NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lX11";
+  NIX_LDFLAGS = lib.optionalString stdenv.isDarwin "-lX11";
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/libversion/default.nix b/nixpkgs/pkgs/development/libraries/libversion/default.nix
index a26aa9b56941..98ad4ef7feec 100644
--- a/nixpkgs/pkgs/development/libraries/libversion/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libversion/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
   checkTarget = "test";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Advanced version string comparison library";
     homepage = "https://github.com/repology/libversion";
     license = with licenses; [ mit ];
diff --git a/nixpkgs/pkgs/development/libraries/libviper/default.nix b/nixpkgs/pkgs/development/libraries/libviper/default.nix
index f9c695aedf71..e3b3674acc9f 100644
--- a/nixpkgs/pkgs/development/libraries/libviper/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libviper/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, pkgconfig, glib, ncurses, gpm}:
+{lib, stdenv, fetchurl, pkg-config, glib, ncurses, gpm}:
 stdenv.mkDerivation rec {
   name = "libviper-1.4.6";
 
@@ -16,10 +16,10 @@ stdenv.mkDerivation rec {
     mkdir -p $out/lib
   '';
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ glib ncurses gpm];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://libviper.sourceforge.net/";
     description = "Simple window creation and management facilities for the console";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libvirt-glib/default.nix b/nixpkgs/pkgs/development/libraries/libvirt-glib/default.nix
index bf8d0b373f08..a61094d17fe8 100644
--- a/nixpkgs/pkgs/development/libraries/libvirt-glib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libvirt-glib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, gobject-introspection, intltool, vala
+{ lib, stdenv, fetchurl, pkg-config, gobject-introspection, intltool, vala
 , libcap_ng, libvirt, libxml2
 }:
 
@@ -12,13 +12,13 @@ stdenv.mkDerivation rec {
     sha256 = "1zpbv4ninc57c9rw4zmmkvvqn7154iv1qfr20kyxn8xplalqrzvz";
   };
 
-  nativeBuildInputs = [ pkgconfig intltool vala gobject-introspection ];
+  nativeBuildInputs = [ pkg-config intltool vala gobject-introspection ];
   buildInputs = [ libcap_ng libvirt libxml2 gobject-introspection ];
 
   enableParallelBuilding = true;
   strictDeps = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for working with virtual machines";
     longDescription = ''
       libvirt-glib wraps libvirt to provide a high-level object-oriented API better
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..8c164f354990
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/libvirt/0001-meson-patch-in-an-install-prefix-for-building-on-nix.patch
@@ -0,0 +1,340 @@
+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 2e57a435df..4a72902a63 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 74de064384..0a21eb845e 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 3bb6cc5f2e..78d7be0ace 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 8a28310e40..9da81cc574 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 f8e2a8852a..96d6687c5d 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 29c8210ab2..bc960e0b69 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 13dd2c26b2..1be020081f 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',
+   ]
+ 
+   uuidgen_prog = find_program('uuidgen', required: false)
+@@ -98,7 +98,7 @@ if conf.has('WITH_NETWORK')
+       ],
+       capture: true,
+       install: true,
+-      install_dir: confdir / 'qemu' / 'networks',
++      install_dir: install_prefix + confdir / 'qemu' / 'networks',
+     )
+   else
+     configure_file(
+@@ -106,13 +106,13 @@ if conf.has('WITH_NETWORK')
+       output: '@BASENAME@',
+       copy: true,
+       install: true,
+-      install_dir: confdir / 'qemu' / 'networks',
++      install_dir: install_prefix + confdir / 'qemu' / 'networks',
+     )
+   endif
+ 
+   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 95af75bb15..7fe99076f4 100644
+--- a/src/nwfilter/xml/meson.build
++++ b/src/nwfilter/xml/meson.build
+@@ -19,4 +19,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 4e599d1e69..ba558d78f8 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 9ad2f6ab1c..429a15b326 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 af43780211..e2d6c812f8 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 b8c6802f0a..dacd0ff1ce 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',
+   )
+ 
+-- 
+2.29.2
+
diff --git a/nixpkgs/pkgs/development/libraries/libvirt/5.9.0.nix b/nixpkgs/pkgs/development/libraries/libvirt/5.9.0.nix
index b880d3642745..76466a1a9f50 100644
--- a/nixpkgs/pkgs/development/libraries/libvirt/5.9.0.nix
+++ b/nixpkgs/pkgs/development/libraries/libvirt/5.9.0.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, fetchgit
-, pkgconfig, makeWrapper, libtool, autoconf, automake, fetchpatch
+{ lib, stdenv, fetchurl, fetchgit
+, pkg-config, makeWrapper, libtool, autoconf, automake, fetchpatch
 , coreutils, libxml2, gnutls, perl, python2, attr
 , iproute, iptables, readline, lvm2, util-linux, systemd, libpciaccess, gettext
 , libtasn1, ebtables, libgcrypt, yajl, pmutils, libcap_ng, libapparmor
@@ -10,7 +10,7 @@
 , enableCeph ? false, ceph
 }:
 
-with stdenv.lib;
+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
@@ -33,7 +33,7 @@ in stdenv.mkDerivation rec {
         fetchSubmodules = true;
       };
 
-  nativeBuildInputs = [ makeWrapper pkgconfig rpcsvc-proto ];
+  nativeBuildInputs = [ makeWrapper pkg-config rpcsvc-proto ];
   buildInputs = [
     libxml2 gnutls perl python2 readline gettext libtasn1 libgcrypt yajl
     libxslt xhtml1 perlPackages.XMLXPath curl libpcap glib
@@ -54,7 +54,7 @@ in stdenv.mkDerivation rec {
 
   preConfigure = ''
     ${ optionalString (!buildFromTarball) "./bootstrap --no-git --gnulib-srcdir=$(pwd)/.gnulib" }
-    PATH=${stdenv.lib.makeBinPath ([ dnsmasq ] ++ optionals stdenv.isLinux [ iproute iptables ebtables lvm2 systemd numad ] ++ optionals enableIscsi [ openiscsi ])}:$PATH
+    PATH=${lib.makeBinPath ([ dnsmasq ] ++ optionals stdenv.isLinux [ iproute 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 \
diff --git a/nixpkgs/pkgs/development/libraries/libvirt/default.nix b/nixpkgs/pkgs/development/libraries/libvirt/default.nix
index 224168888c02..f3f48cec770b 100644
--- a/nixpkgs/pkgs/development/libraries/libvirt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libvirt/default.nix
@@ -1,42 +1,58 @@
-{ stdenv, fetchurl, fetchgit
-, pkgconfig, makeWrapper, autoreconfHook, fetchpatch
+{ lib, stdenv, fetchurl, fetchgit
+, makeWrapper, autoreconfHook, fetchpatch
 , coreutils, libxml2, gnutls, perl, python2, attr, glib, docutils
-, iproute, iptables, readline, lvm2, util-linux, systemd, libpciaccess, gettext
-, libtasn1, ebtables, libgcrypt, yajl, pmutils, libcap_ng, libapparmor
+, iproute, 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
 }:
 
-with stdenv.lib;
+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 = "6.6.0";
+  version = "6.8.0";
 
   src =
     if buildFromTarball then
       fetchurl {
         url = "https://libvirt.org/sources/${pname}-${version}.tar.xz";
-        sha256 = "1y8y13zvh820f4b15287wb77wq7ra7kbfnpblzhm1dki5pfjvrcl";
+        sha256 = "0hhk2r0dnm9zmfwmnsnmnacm4pik6z60llp22axx7kcpqxv98nv5";
       }
     else
       fetchgit {
         url = "https://gitlab.com/libvirt/libvirt.git";
         rev = "v${version}";
-        sha256 = "09hsbm2qmx0jfmm418rf5lx374g85bwgg0kzlga62x5180jhsssn";
+        sha256 = "sha256-BQZPdmDE0g7xWd6QOHMKosP2HgVpIjsfgfohA9VxEHs=";
         fetchSubmodules = true;
       };
 
+  patches = [
+    ./0001-meson-patch-in-an-install-prefix-for-building-on-nix.patch
+  ];
+
   nativeBuildInputs = [
-    makeWrapper pkgconfig docutils
-  ] ++ optionals (!buildFromTarball) [
-    autoreconfHook
+    ninja meson cmake makeWrapper pkg-config docutils
   ] ++ optional (!stdenv.isDarwin) [
     rpcsvc-proto
   ] ++ optionals stdenv.isDarwin [
@@ -44,10 +60,11 @@ in stdenv.mkDerivation rec {
   ];
 
   buildInputs = [
+    bash-completion pkg-config
     libxml2 gnutls perl python2 readline gettext libtasn1 libgcrypt yajl
     libxslt xhtml1 perlPackages.XMLXPath curl libpcap glib dbus
   ] ++ optionals stdenv.isLinux [
-    libpciaccess lvm2 util-linux systemd libnl numad zfs
+    audit libpciaccess lvm2 util-linux systemd libnl numad zfs
     libapparmor libcap_ng numactl attr parted libtirpc
   ] ++ optionals (enableXen && stdenv.isLinux && stdenv.isx86_64) [
     xen
@@ -59,69 +76,67 @@ in stdenv.mkDerivation rec {
     libiconv gmp
   ];
 
-  preConfigure = ''
-    PATH=${stdenv.lib.makeBinPath ([ dnsmasq ] ++ optionals stdenv.isLinux [ iproute iptables ebtables lvm2 systemd numad ] ++ optionals enableIscsi [ openiscsi ])}:$PATH
+  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 [ iproute 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 . # fixes /usr/bin/python references
-    mkdir -p build && cd build
-  '';
+  ''
+  + (lib.concatStringsSep "\n" (lib.mapAttrsToList patchBuilder overrides));
 
-  configureScript = "../configure";
+  mesonAutoFeatures = "auto";
 
-  dontAddDisableDepTrack = true;
-
-  configureFlags = [
-    "--with-runstatedir=/run" # TODO: remove when autoconf 2.70 is released
-    "--localstatedir=/var"
+  mesonFlags = let
+    opt = option: enable: "-D${option}=${if enable then "enabled" else "disabled"}";
+  in [
     "--sysconfdir=/var/lib"
-    "--with-libpcap"
-    "--with-qemu"
-    "--with-vmware"
-    "--with-vbox"
-    "--with-test"
-    "--with-esx"
-    "--with-remote"
-    "--with-polkit"
+    "-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"
+    "-Ddbus=enabled"
+    (opt "storage_iscsi" enableIscsi)
   ] ++ 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"
+    (opt "storage_zfs" (zfs != null))
+    "-Dattr=enabled"
+    "-Dapparmor=enabled"
+    "-Dsecdriver_apparmor=enabled"
+    "-Dnumad=enabled"
+    "-Dmacvtap=enabled"
+    "-Dvirtualport=enabled"
+    "-Dstorage_disk=enabled"
+    (opt "storage_rbd" enableCeph)
   ] ++ optionals stdenv.isDarwin [
-    "--with-init-script=none"
-  ];
-
-  installFlags = [
-    "runstatedir=${placeholder "out"}/run"
-    "localstatedir=$(TMPDIR)/var"
-    "sysconfdir=$(out)/var/lib"
+    "-Dinit_script=none"
   ];
 
   postInstall = let
-    binPath = [ iptables iproute pmutils numad numactl bridge-utils dmidecode dnsmasq ebtables ] ++ optionals enableIscsi [ openiscsi ];
+    # Keep the legacy iptables binary for now for backwards compatibility (comment on #109332)
+    binPath = [ iptables ebtables-compat iproute 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
+      --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" "$@"; }
   '
@@ -132,8 +147,6 @@ in stdenv.mkDerivation rec {
       --prefix PATH : /run/libvirt/nix-emulators:${makeBinPath binPath}
   '';
 
-  enableParallelBuilding = true;
-
   meta = {
     homepage = "https://libvirt.org/";
     repositories.git = "git://libvirt.org/libvirt.git";
diff --git a/nixpkgs/pkgs/development/libraries/libvisio/default.nix b/nixpkgs/pkgs/development/libraries/libvisio/default.nix
index b84ba92e2bfb..42051fe66a63 100644
--- a/nixpkgs/pkgs/development/libraries/libvisio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libvisio/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, boost, libwpd, libwpg, pkgconfig, zlib, gperf
+{ lib, stdenv, fetchurl, boost, libwpd, libwpg, pkg-config, zlib, gperf
 , librevenge, libxml2, icu, perl, cppunit, doxygen
 }:
 
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "0k7adcbbf27l7n453cca1m6s9yj6qvb5j6bsg2db09ybf3w8vbwg";
   };
 
-  nativeBuildInputs = [ pkgconfig cppunit doxygen ];
+  nativeBuildInputs = [ pkg-config cppunit doxygen ];
   buildInputs = [ boost libwpd libwpg zlib gperf librevenge libxml2 icu perl ];
 
   configureFlags = [
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libvisual/default.nix b/nixpkgs/pkgs/development/libraries/libvisual/default.nix
index 8fe53acc2456..7a996d3b8079 100644
--- a/nixpkgs/pkgs/development/libraries/libvisual/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libvisual/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib }:
+{ lib, stdenv, fetchurl, pkg-config, glib }:
 
 stdenv.mkDerivation rec {
   name = "libvisual-0.4.0";
@@ -8,12 +8,12 @@ stdenv.mkDerivation rec {
     sha256 = "1my1ipd5k1ixag96kwgf07bgxkjlicy9w22jfxb2kq95f6wgsk8b";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ glib ];
 
   hardeningDisable = [ "format" ];
 
-  configureFlags = stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+  configureFlags = lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "ac_cv_func_malloc_0_nonnull=yes"
     "ac_cv_func_realloc_0_nonnull=yes"
   ];
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "An abstraction library for audio visualisations";
     homepage = "https://sourceforge.net/projects/libvisual/";
-    license = stdenv.lib.licenses.lgpl21Plus;
-    platforms = stdenv.lib.platforms.linux;
+    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
index 9f7e84558f7d..c4b945bed446 100644
--- a/nixpkgs/pkgs/development/libraries/libvmaf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libvmaf/default.nix
@@ -1,25 +1,29 @@
-{ stdenv, fetchFromGitHub, meson, ninja, nasm }:
+{ lib, stdenv, fetchFromGitHub, meson, ninja, nasm }:
 
 stdenv.mkDerivation rec {
   pname = "libvmaf";
-  version = "1.5.3";
+  version = "2.1.1";
 
   src = fetchFromGitHub {
     owner = "netflix";
     repo = "vmaf";
     rev = "v${version}";
-    sha256 = "0x3l3g0hgrrjh3ygmxr1pd3rd5589s07c7id35nvj76ch5b7gy63";
+    sha256 = "0dynk1pmsyf23vfxljaazqkr27vfrvhj3dyjzm06zxpzsn59aif3";
   };
 
   sourceRoot = "source/libvmaf";
 
   nativeBuildInputs = [ meson ninja nasm ];
+
+  mesonFlags = [ "-Denable_avx512=true" ];
+
   outputs = [ "out" "dev" ];
-  doCheck = true;
+  doCheck = false;
 
-  meta = with stdenv.lib; {
+  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
index 1603d32ba797..9d9e47407b62 100644
--- a/nixpkgs/pkgs/development/libraries/libvmi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libvmi/default.nix
@@ -1,16 +1,16 @@
-{ stdenv,
+{ lib, stdenv,
   fetchFromGitHub,
   autoreconfHook,
   bison,
   flex,
   glib,
-  pkgconfig,
+  pkg-config,
   json_c,
   xen,
   libvirt,
   xenSupport ? true }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "libvmi";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ glib libvirt json_c ] ++ (optional xenSupport xen);
-  nativeBuildInputs = [ autoreconfHook bison flex pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook bison flex pkg-config ];
 
   configureFlags = optional (!xenSupport) "--disable-xen";
 
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
     patchelf --set-rpath "$oldrpath:${makeLibraryPath [ xen ]}" "$libvmi"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://libvmi.com/";
     description = "A C library for virtual machine introspection";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/libvncserver/default.nix b/nixpkgs/pkgs/development/libraries/libvncserver/default.nix
index c4e82b1c326c..7c8d4a76fc95 100644
--- a/nixpkgs/pkgs/development/libraries/libvncserver/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libvncserver/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, fetchpatch, cmake
+{ lib, stdenv, fetchzip, fetchpatch, cmake
 , libjpeg, openssl, zlib, libgcrypt, libpng
 , systemd
 }:
@@ -21,14 +21,14 @@ stdenv.mkDerivation {
   nativeBuildInputs = [ cmake ];
   buildInputs = [
     libjpeg openssl libgcrypt libpng
-  ] ++ stdenv.lib.optional stdenv.isLinux systemd;
+  ] ++ lib.optional stdenv.isLinux systemd;
   propagatedBuildInputs = [ zlib ];
   meta = {
     inherit (s) version;
     description = "VNC server library";
     homepage = "https://libvnc.github.io/";
-    license = stdenv.lib.licenses.gpl2Plus ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.unix;
+    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
index 2a9f97cf67f5..9fd3fc59ab39 100644
--- a/nixpkgs/pkgs/development/libraries/libvorbis/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libvorbis/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libogg, pkgconfig }:
+{ lib, stdenv, fetchurl, libogg, pkg-config }:
 
 stdenv.mkDerivation rec {
   name = "libvorbis-1.3.7";
@@ -10,12 +10,12 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "doc" ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   propagatedBuildInputs = [ libogg ];
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Vorbis audio compression reference implementation";
     homepage = "https://xiph.org/vorbis/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libvpx/1_8.nix b/nixpkgs/pkgs/development/libraries/libvpx/1_8.nix
index c82b7a674acc..f1a2bf377cc0 100644
--- a/nixpkgs/pkgs/development/libraries/libvpx/1_8.nix
+++ b/nixpkgs/pkgs/development/libraries/libvpx/1_8.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, perl, yasm
+{ lib, stdenv, fetchFromGitHub, perl, yasm
 , vp8DecoderSupport ? true # VP8 decoder
 , vp8EncoderSupport ? true # VP8 encoder
 , vp9DecoderSupport ? true # VP9 decoder
@@ -40,7 +40,7 @@
 
 let
   inherit (stdenv) is64bit isMips isDarwin isCygwin;
-  inherit (stdenv.lib) enableFeature optional optionals;
+  inherit (lib) enableFeature optional optionals;
 in
 
 assert vp8DecoderSupport || vp8EncoderSupport || vp9DecoderSupport || vp9EncoderSupport;
@@ -69,7 +69,7 @@ stdenv.mkDerivation rec {
 #    ./CVE-2019-9232.CVE-2019-9325.CVE-2019-9371.CVE-2019-9433.patch
   ];
 
-  postPatch = ''patchShebangs .'';
+  postPatch = "patchShebangs .";
 
   outputs = [ "bin" "dev" "out" ];
   setOutputFlags = false;
@@ -173,7 +173,7 @@ stdenv.mkDerivation rec {
 
   postInstall = ''moveToOutput bin "$bin" '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "WebM VP8/VP9 codec SDK";
     homepage    = "https://www.webmproject.org/";
     license     = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libvpx/default.nix b/nixpkgs/pkgs/development/libraries/libvpx/default.nix
index 83e60466c146..5aa8cf704910 100644
--- a/nixpkgs/pkgs/development/libraries/libvpx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libvpx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, perl, yasm
+{ lib, stdenv, fetchFromGitHub, perl, yasm
 , vp8DecoderSupport ? true # VP8 decoder
 , vp8EncoderSupport ? true # VP8 encoder
 , vp9DecoderSupport ? true # VP9 decoder
@@ -40,7 +40,7 @@
 
 let
   inherit (stdenv) is64bit isMips isDarwin isCygwin;
-  inherit (stdenv.lib) enableFeature optional optionals;
+  inherit (lib) enableFeature optional optionals;
 in
 
 assert vp8DecoderSupport || vp8EncoderSupport || vp9DecoderSupport || vp9EncoderSupport;
@@ -169,7 +169,7 @@ stdenv.mkDerivation rec {
 
   postInstall = ''moveToOutput bin "$bin" '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "WebM VP8/VP9 codec SDK";
     homepage    = "https://www.webmproject.org/";
     license     = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libvterm-neovim/default.nix b/nixpkgs/pkgs/development/libraries/libvterm-neovim/default.nix
index ca50345f5b21..e4a053601833 100644
--- a/nixpkgs/pkgs/development/libraries/libvterm-neovim/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libvterm-neovim/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , perl
 , libtool
@@ -20,11 +20,11 @@ stdenv.mkDerivation {
   nativeBuildInputs = [ libtool ];
 
   makeFlags = [ "PREFIX=$(out)" ]
-    ++ stdenv.lib.optional stdenv.isDarwin "LIBTOOL=${libtool}/bin/libtool";
+    ++ lib.optional stdenv.isDarwin "LIBTOOL=${libtool}/bin/libtool";
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "VT220/xterm/ECMA-48 terminal emulator library";
     homepage = "http://www.leonerd.org.uk/code/libvterm/";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libvterm/default.nix b/nixpkgs/pkgs/development/libraries/libvterm/default.nix
index 40324ec49327..90914d4186ea 100644
--- a/nixpkgs/pkgs/development/libraries/libvterm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libvterm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib, ncurses }:
+{ lib, stdenv, fetchurl, pkg-config, glib, ncurses }:
 
 stdenv.mkDerivation rec {
   name = "libvterm-0.99.7";
@@ -17,10 +17,10 @@ stdenv.mkDerivation rec {
     mkdir -p $out/lib
   '';
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ glib ncurses ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://libvterm.sourceforge.net/";
     description = "Terminal emulator library to mimic both vt100 and rxvt";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libwacom/default.nix b/nixpkgs/pkgs/development/libraries/libwacom/default.nix
index 6ae116356f8a..14b996145aff 100644
--- a/nixpkgs/pkgs/development/libraries/libwacom/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libwacom/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, meson, ninja, glib, pkgconfig, udev, libgudev, doxygen }:
+{ lib, stdenv, fetchFromGitHub, meson, ninja, glib, pkg-config, udev, libgudev, doxygen }:
 
 stdenv.mkDerivation rec {
   pname = "libwacom";
@@ -13,13 +13,13 @@ stdenv.mkDerivation rec {
     sha256 = "10wphlk5v591mlvcyr6bjqp60zmhbpqg3lmsq9dza738v97ws8ci";
   };
 
-  nativeBuildInputs = [ pkgconfig meson ninja doxygen ];
+  nativeBuildInputs = [ pkg-config meson ninja doxygen ];
 
   mesonFlags = [ "-Dtests=disabled" ];
 
   buildInputs = [ glib udev libgudev ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     platforms = platforms.linux;
     homepage = "https://linuxwacom.github.io/";
     description = "Libraries, configuration, and diagnostic tools for Wacom tablets running under Linux";
diff --git a/nixpkgs/pkgs/development/libraries/libwebp/default.nix b/nixpkgs/pkgs/development/libraries/libwebp/default.nix
index 6d24ba7f2ed2..4908dc4a9ce1 100644
--- a/nixpkgs/pkgs/development/libraries/libwebp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libwebp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, libtool
+{ 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
@@ -24,7 +24,7 @@ let
   mkFlag = optSet: flag: if optSet then "--enable-${flag}" else "--disable-${flag}";
 in
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "libwebp";
   version = "1.1.0";
diff --git a/nixpkgs/pkgs/development/libraries/libwebsockets/default.nix b/nixpkgs/pkgs/development/libraries/libwebsockets/default.nix
index c56781931f3f..8f749d9fe6aa 100644
--- a/nixpkgs/pkgs/development/libraries/libwebsockets/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libwebsockets/default.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, stdenv, cmake, openssl, zlib, libuv }:
+{ fetchFromGitHub, lib, stdenv, cmake, openssl, zlib, libuv }:
 
 let
   generic = { version, sha256 }: stdenv.mkDerivation rec {
@@ -22,9 +22,9 @@ let
       "-DLWS_WITH_SOCKS5=ON"
     ];
 
-    NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=unused-but-set-variable";
+    NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=unused-but-set-variable";
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       description = "Light, portable C library for websockets";
       longDescription = ''
         Libwebsockets is a lightweight pure C library built to
diff --git a/nixpkgs/pkgs/development/libraries/libwhereami/default.nix b/nixpkgs/pkgs/development/libraries/libwhereami/default.nix
index 59e349b4e6a1..d0dd593a03dd 100644
--- a/nixpkgs/pkgs/development/libraries/libwhereami/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libwhereami/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, boost, curl, leatherman }:
+{ lib, stdenv, fetchFromGitHub, cmake, boost, curl, leatherman }:
 
 stdenv.mkDerivation rec {
   pname = "libwhereami";
@@ -17,9 +17,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ boost curl leatherman ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit (src.meta) homepage;
     description = "Library to report hypervisor information from inside a VM";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/libwmf/default.nix b/nixpkgs/pkgs/development/libraries/libwmf/default.nix
index 5c684c7fd778..e955fee57207 100644
--- a/nixpkgs/pkgs/development/libraries/libwmf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libwmf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkgconfig
+{ lib, stdenv, fetchFromGitHub, pkg-config
 , freetype, glib, imagemagick, libjpeg, libpng, libxml2, zlib
 }:
 
@@ -15,11 +15,11 @@ stdenv.mkDerivation rec {
     sha256 = "0i2w5hg8mbgmgabxyd48qp1gx2mhk33hgr3jqvg72k0nhkd2jhf6";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ zlib imagemagick libpng glib freetype libjpeg libxml2 ];
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "WMF library from wvWare";
     homepage = "http://wvware.sourceforge.net/libwmf.html";
     downloadPage = "https://github.com/caolanm/libwmf/releases";
diff --git a/nixpkgs/pkgs/development/libraries/libwnck/3.x.nix b/nixpkgs/pkgs/development/libraries/libwnck/3.x.nix
index 78aa231bda3a..3792b826f594 100644
--- a/nixpkgs/pkgs/development/libraries/libwnck/3.x.nix
+++ b/nixpkgs/pkgs/development/libraries/libwnck/3.x.nix
@@ -1,9 +1,9 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , gtk-doc
 , docbook_xsl
 , docbook_xml_dtd_412
@@ -27,14 +27,14 @@ stdenv.mkDerivation rec {
   outputBin = "dev";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0pwjdhca9lz2n1gf9b60xf0m6ipf9snp8rqf9csj4pgdnd882l5w";
   };
 
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     gettext
     gobject-introspection
     gtk-doc
@@ -62,11 +62,11 @@ stdenv.mkDerivation rec {
   passthru = {
     updateScript = gnome3.updateScript {
       packageName = pname;
-      attrPath = "${pname}${stdenv.lib.versions.major version}";
+      attrPath = "${pname}${lib.versions.major version}";
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library to manage X windows and workspaces (via pagers, tasklists, etc.)";
     license = licenses.lgpl21Plus;
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/libwnck/default.nix b/nixpkgs/pkgs/development/libraries/libwnck/default.nix
index 2872181a36d8..c0019ee268af 100644
--- a/nixpkgs/pkgs/development/libraries/libwnck/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libwnck/default.nix
@@ -1,18 +1,18 @@
-{ stdenv, fetchurl, pkgconfig, gtk2, intltool, xorg }:
+{ lib, stdenv, fetchurl, pkg-config, gtk2, intltool, xorg }:
 
 stdenv.mkDerivation rec {
   pname = "libwnck";
   version = "2.31.0";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "17isfjvrzgj5znld2a7zsk9vd39q9wnsysnw5jr8iz410z935xw3";
   };
 
   outputs = [ "out" "dev" "devdoc" ];
   outputBin = "dev";
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ gtk2 intltool xorg.libX11 xorg.libXres ];
   # ?another optional: startup-notification
 
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A library for creating task lists and pagers";
     homepage = "https://gitlab.gnome.org/GNOME/libwnck";
-    license = stdenv.lib.licenses.lgpl21;
-    maintainers = with stdenv.lib.maintainers; [ johnazoidberg ];
+    license = lib.licenses.lgpl21;
+    maintainers = with lib.maintainers; [ johnazoidberg ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libwpd/0.8.nix b/nixpkgs/pkgs/development/libraries/libwpd/0.8.nix
index f47208cda440..df21f2640966 100644
--- a/nixpkgs/pkgs/development/libraries/libwpd/0.8.nix
+++ b/nixpkgs/pkgs/development/libraries/libwpd/0.8.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib, libgsf, libxml2, bzip2 }:
+{ lib, stdenv, fetchurl, pkg-config, glib, libgsf, libxml2, bzip2 }:
 
 stdenv.mkDerivation rec {
   name = "libwpd-0.8.14";
@@ -12,9 +12,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ glib libgsf libxml2 ];
 
-  nativeBuildInputs = [ pkgconfig bzip2 ];
+  nativeBuildInputs = [ pkg-config bzip2 ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for importing WordPerfect documents";
     homepage = "http://libwpd.sourceforge.net";
     license = with licenses; [ lgpl21 mpl20 ];
diff --git a/nixpkgs/pkgs/development/libraries/libwpd/default.nix b/nixpkgs/pkgs/development/libraries/libwpd/default.nix
index 3464c55805dd..8afe549cb68f 100644
--- a/nixpkgs/pkgs/development/libraries/libwpd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libwpd/default.nix
@@ -1,18 +1,18 @@
-{ stdenv, fetchurl, zlib, pkgconfig, glib, libgsf, libxml2, librevenge }:
+{ 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 = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library for importing and exporting WordPerfect documents";
     homepage = "http://libwpd.sourceforge.net/";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/libwpe/default.nix b/nixpkgs/pkgs/development/libraries/libwpe/default.nix
new file mode 100644
index 000000000000..102d658000c3
--- /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.7.1";
+
+  src = fetchurl {
+    url = "https://wpewebkit.org/releases/${pname}-${version}.tar.xz";
+    sha256 = "0h6kh8wy2b370y705pl2vp6vp18dkdsgdxh0243ji2v51kxbg157";
+  };
+
+  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
index c844daf51f03..cf85d57a7f20 100644
--- a/nixpkgs/pkgs/development/libraries/libwpg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libwpg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libwpd, zlib, librevenge }:
+{ lib, stdenv, fetchurl, pkg-config, libwpd, zlib, librevenge }:
 
 stdenv.mkDerivation rec {
   name = "libwpg-0.3.3";
@@ -9,9 +9,9 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ libwpd zlib librevenge ];
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://libwpg.sourceforge.net";
     description = "C++ library to parse WPG";
     license = with licenses; [ lgpl21 mpl20 ];
diff --git a/nixpkgs/pkgs/development/libraries/libwps/default.nix b/nixpkgs/pkgs/development/libraries/libwps/default.nix
index 3d40d204bdc6..7dd7153bae9f 100644
--- a/nixpkgs/pkgs/development/libraries/libwps/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libwps/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, boost, pkgconfig, librevenge, zlib }:
+{ lib, stdenv, fetchurl, boost, pkg-config, librevenge, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "libwps";
@@ -9,12 +9,12 @@ stdenv.mkDerivation rec {
     sha256 = "16c6vq6hhi5lcvgyb9dwarr3kz69l1g5fs39b2hwqhkwzx5igpcl";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ boost librevenge zlib ];
 
   NIX_CFLAGS_COMPILE = "-Wno-error=implicit-fallthrough";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://libwps.sourceforge.net/";
     description = "Microsoft Works document format import filter library";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/libx86/default.nix b/nixpkgs/pkgs/development/libraries/libx86/default.nix
index 271823ace288..1abefa8f4374 100644
--- a/nixpkgs/pkgs/development/libraries/libx86/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libx86/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "libx86";
@@ -13,14 +13,14 @@ stdenv.mkDerivation rec {
   #  http://www.mail-archive.com/suspend-devel@lists.sourceforge.net/msg02355.html
   makeFlags = [
     "DESTDIR=$(out)"
-  ] ++ stdenv.lib.optional (!stdenv.isi686) "BACKEND=x86emu";
+  ] ++ 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 stdenv.lib; {
+  meta = with lib; {
     description = "Real-mode x86 code emulator";
     maintainers = with maintainers; [ raskin ];
     platforms = [ "x86_64-linux" "i686-linux" ];
diff --git a/nixpkgs/pkgs/development/libraries/libx86/src-for-default.nix b/nixpkgs/pkgs/development/libraries/libx86/src-for-default.nix
index 30be467f9fd2..a681d9e58902 100644
--- a/nixpkgs/pkgs/development/libraries/libx86/src-for-default.nix
+++ b/nixpkgs/pkgs/development/libraries/libx86/src-for-default.nix
@@ -4,6 +4,6 @@ rec {
    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-1.1.tar.gz";
-  
-  
+
+
 }
diff --git a/nixpkgs/pkgs/development/libraries/libx86emu/default.nix b/nixpkgs/pkgs/development/libraries/libx86emu/default.nix
index 1b10ac5fdaab..8f9669561d62 100644
--- a/nixpkgs/pkgs/development/libraries/libx86emu/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libx86emu/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, perl }:
+{ lib, stdenv, fetchFromGitHub, perl }:
 
 stdenv.mkDerivation rec {
   pname = "libx86emu";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   installFlags = [ "DESTDIR=$(out)" "LIBDIR=/lib" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "x86 emulation library";
     license = licenses.bsd2;
     homepage = "https://github.com/wfeldt/libx86emu";
diff --git a/nixpkgs/pkgs/development/libraries/libxc/default.nix b/nixpkgs/pkgs/development/libraries/libxc/default.nix
index 3f687ad26c8b..d26518c7de98 100644
--- a/nixpkgs/pkgs/development/libraries/libxc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gfortran, perl }:
+{ lib, stdenv, fetchurl, gfortran, perl }:
 
 let
   version = "4.3.4";
@@ -23,7 +23,7 @@ in stdenv.mkDerivation {
   doCheck = true;
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library of exchange-correlation functionals for density-functional theory";
     homepage = "https://octopus-code.org/wiki/Libxc";
     license = licenses.lgpl3;
diff --git a/nixpkgs/pkgs/development/libraries/libxcomp/default.nix b/nixpkgs/pkgs/development/libraries/libxcomp/default.nix
index 9ecfa0ffd1ad..b66fe5c5a21a 100644
--- a/nixpkgs/pkgs/development/libraries/libxcomp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxcomp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, pkgconfig, libjpeg, libpng, libX11, zlib }:
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, libjpeg, libpng, libX11, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "libxcomp";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ libjpeg libpng libX11 zlib ];
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
   preAutoreconf = ''
     cd nxcomp/
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "NX compression library";
     homepage = "http://wiki.x2go.org/doku.php/wiki:libs:nx-libs";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/libxdg-basedir/default.nix b/nixpkgs/pkgs/development/libraries/libxdg-basedir/default.nix
index fdf62e38269e..58a58f2726bd 100644
--- a/nixpkgs/pkgs/development/libraries/libxdg-basedir/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxdg-basedir/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, fetchpatch}:
+{lib, stdenv, fetchurl, fetchpatch}:
 
 stdenv.mkDerivation rec {
   name = "libxdg-basedir-1.2.0";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/devnev/libxdg-basedir";
     description = "Implementation of the XDG Base Directory specification";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libxkbcommon/default.nix b/nixpkgs/pkgs/development/libraries/libxkbcommon/default.nix
index 6ed331a8a6b9..c0785b34e891 100644
--- a/nixpkgs/pkgs/development/libraries/libxkbcommon/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxkbcommon/default.nix
@@ -1,32 +1,49 @@
-{ stdenv, fetchurl, fetchpatch, meson, ninja, pkgconfig, yacc, xkeyboard_config, libxcb, libX11, doxygen }:
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, yacc, doxygen
+, xkeyboard_config, libxcb, libxml2
+, python3
+, libX11
+}:
 
 stdenv.mkDerivation rec {
   pname = "libxkbcommon";
-  version = "0.10.0";
+  version = "1.0.3";
 
   src = fetchurl {
     url = "https://xkbcommon.org/download/${pname}-${version}.tar.xz";
-    sha256 = "1wmnl0hngn6vrqrya4r8hvimlkr4jag39yjprls4gyrqvh667hsp";
+    sha256 = "0lmwglj16anhpaq0h830xsl1ivknv75i4lir9bk88aq73s2jy852";
   };
 
   outputs = [ "out" "dev" "doc" ];
 
-  nativeBuildInputs = [ meson ninja pkgconfig yacc doxygen ];
-  buildInputs = [ xkeyboard_config libxcb ];
+  nativeBuildInputs = [ meson ninja pkg-config yacc doxygen ];
+  buildInputs = [ xkeyboard_config libxcb libxml2 ];
+  checkInputs = [ python3 ];
 
   mesonFlags = [
-    "-Denable-wayland=false"
     "-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=false"
+    "-Denable-xkbregistry=false" # Optional, separate library (TODO: Install into extra output)
   ];
 
-  doCheck = false; # fails, needs unicode locale
+  doCheck = true;
+  preCheck = ''
+    patchShebangs ../test/
+  '';
 
-  meta = with stdenv.lib; {
+  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; [ ttuegel ];
+    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
index a73fb7cb870e..cf5f6e320c0b 100644
--- a/nixpkgs/pkgs/development/libraries/libxkbcommon/libxkbcommon_7.nix
+++ b/nixpkgs/pkgs/development/libraries/libxkbcommon/libxkbcommon_7.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, yacc, flex, xkeyboard_config, libxcb, libX11 }:
+{ lib, stdenv, fetchurl, pkg-config, yacc, flex, xkeyboard_config, libxcb, libX11 }:
 
 stdenv.mkDerivation rec {
   name = "libxkbcommon-0.7.2";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ yacc flex xkeyboard_config libxcb ];
 
   configureFlags = [
@@ -18,11 +18,11 @@ stdenv.mkDerivation rec {
     "--with-x-locale-root=${libX11.out}/share/X11/locale"
   ];
 
-  preBuild = stdenv.lib.optionalString stdenv.isDarwin ''
+  preBuild = lib.optionalString stdenv.isDarwin ''
     sed -i 's/,--version-script=.*$//' Makefile
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library to handle keyboard descriptions";
     homepage = "https://xkbcommon.org";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libxklavier/default.nix b/nixpkgs/pkgs/development/libraries/libxklavier/default.nix
index febe7f7b38ca..60b52152f67f 100644
--- a/nixpkgs/pkgs/development/libraries/libxklavier/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxklavier/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, autoreconfHook, pkgconfig, gtk-doc, xkeyboard_config, libxml2, xorg, docbook_xsl
+{ lib, stdenv, fetchgit, autoreconfHook, pkg-config, gtk-doc, xkeyboard_config, libxml2, xorg, docbook_xsl
 , glib, isocodes, gobject-introspection }:
 
 let
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   # TODO: enable xmodmap support, needs xmodmap DB
   propagatedBuildInputs = with xorg; [ libX11 libXi xkeyboard_config libxml2 libICE glib libxkbfile isocodes ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig gtk-doc docbook_xsl ];
+  nativeBuildInputs = [ autoreconfHook pkg-config gtk-doc docbook_xsl ];
 
   buildInputs = [ gobject-introspection ];
 
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
     "--enable-gtk-doc"
   ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libxl/default.nix b/nixpkgs/pkgs/development/libraries/libxl/default.nix
index 6f11d4c461f9..600e94d0a757 100644
--- a/nixpkgs/pkgs/development/libraries/libxl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "libxl";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     cp -rva lib64 $out/lib
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library for parsing Excel files";
     homepage    = "https://www.libxl.com/";
     license     = licenses.unfree;
diff --git a/nixpkgs/pkgs/development/libraries/libxls/default.nix b/nixpkgs/pkgs/development/libraries/libxls/default.nix
index 00300899589a..3e8034f8baa8 100644
--- a/nixpkgs/pkgs/development/libraries/libxls/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxls/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip }:
+{ lib, stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation rec {
   pname = "libxls";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Extract Cell Data From Excel xls files";
     homepage = "https://sourceforge.net/projects/libxls/";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/libxmi/default.nix b/nixpkgs/pkgs/development/libraries/libxmi/default.nix
index 89b96467155c..037e7036f499 100644
--- a/nixpkgs/pkgs/development/libraries/libxmi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxmi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libtool }:
+{ lib, stdenv, fetchurl, libtool }:
 
 stdenv.mkDerivation {
   name = "libxmi-1.2";
@@ -14,8 +14,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Library for rasterizing 2-D vector graphics";
     homepage = "https://www.gnu.org/software/libxmi/";
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;  # arbitrary choice
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.gnu ++ lib.platforms.linux;  # arbitrary choice
     maintainers = [ ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/libxml2/default.nix b/nixpkgs/pkgs/development/libraries/libxml2/default.nix
index 10ad110d24e5..30a65e3a0a36 100644
--- a/nixpkgs/pkgs/development/libraries/libxml2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxml2/default.nix
@@ -89,7 +89,7 @@ stdenv.mkDerivation rec {
   preInstall = lib.optionalString pythonSupport
     ''substituteInPlace python/libxml2mod.la --replace "${python}" "$py"'';
   installFlags = lib.optional pythonSupport
-    "pythondir=\"${placeholder ''py''}/lib/${python.libPrefix}/site-packages\"";
+    "pythondir=\"${placeholder "py"}/lib/${python.libPrefix}/site-packages\"";
 
   postFixup = ''
     moveToOutput bin/xml2-config "$dev"
diff --git a/nixpkgs/pkgs/development/libraries/libxmlb/default.nix b/nixpkgs/pkgs/development/libraries/libxmlb/default.nix
index 97e8d23c0700..b958f018b604 100644
--- a/nixpkgs/pkgs/development/libraries/libxmlb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxmlb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , docbook_xml_dtd_43
 , docbook_xsl
@@ -7,7 +7,7 @@
 , gtk-doc
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , python3
 , shared-mime-info
 , nixosTests
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
     gtk-doc
     meson
     ninja
-    pkgconfig
+    pkg-config
     (python3.withPackages (pkgs: with pkgs; [ setuptools ]))
     shared-mime-info
   ];
@@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library to help create and query binary XML blobs";
     homepage = "https://github.com/hughsie/libxmlb";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libxmlxx/default.nix b/nixpkgs/pkgs/development/libraries/libxmlxx/default.nix
index c80808081ffb..19282ddc822d 100644
--- a/nixpkgs/pkgs/development/libraries/libxmlxx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxmlxx/default.nix
@@ -1,17 +1,17 @@
-{ stdenv, fetchurl, pkgconfig, libxml2, glibmm, perl, gnome3 }:
+{ lib, stdenv, fetchurl, pkg-config, libxml2, glibmm, perl, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "libxml++";
   version = "2.40.1";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1sb3akryklvh2v6m6dihdnbpf1lkx441v972q9hlz1sq6bfspm2a";
   };
 
   outputs = [ "out" "devdoc" ];
 
-  nativeBuildInputs = [ pkgconfig perl ];
+  nativeBuildInputs = [ pkg-config perl ];
 
   propagatedBuildInputs = [ libxml2 glibmm ];
 
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://libxmlplusplus.sourceforge.net/";
     description = "C++ wrapper for the libxml2 XML parser library";
     license = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libxmlxx/v3.nix b/nixpkgs/pkgs/development/libraries/libxmlxx/v3.nix
index be5c019e31ee..41c842220c7d 100644
--- a/nixpkgs/pkgs/development/libraries/libxmlxx/v3.nix
+++ b/nixpkgs/pkgs/development/libraries/libxmlxx/v3.nix
@@ -1,17 +1,17 @@
-{ stdenv, fetchurl, pkgconfig, libxml2, glibmm, perl }:
+{ lib, stdenv, fetchurl, pkg-config, libxml2, glibmm, perl }:
 
 stdenv.mkDerivation rec {
   pname = "libxml++";
   version = "3.0.1";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/libxml++/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/libxml++/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "19kik79fmg61nv0by0a5f9wchrcfjwzvih4v2waw01hqflhqvp0r";
   };
 
   outputs = [ "out" "dev" "doc" "devdoc" ];
 
-  nativeBuildInputs = [ pkgconfig perl ];
+  nativeBuildInputs = [ pkg-config perl ];
 
   buildInputs = [ glibmm ];
 
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
       --replace 'docdir=''${datarootdir}' "docdir=$doc/share"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://libxmlplusplus.sourceforge.net/";
     description = "C++ wrapper for the libxml2 XML parser library, version 3";
     license = licenses.lgpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libxmp/default.nix b/nixpkgs/pkgs/development/libraries/libxmp/default.nix
index ca4d7edbf32d..0b953f95d7eb 100644
--- a/nixpkgs/pkgs/development/libraries/libxmp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxmp/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "libxmp-4.4.1";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Extended module player library";
     homepage    = "http://xmp.sourceforge.net/";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/libxslt/default.nix b/nixpkgs/pkgs/development/libraries/libxslt/default.nix
index cf91d7656bf0..eff9f2b2b792 100644
--- a/nixpkgs/pkgs/development/libraries/libxslt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxslt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, libxml2, findXMLCatalogs, gettext, python, libgcrypt
+{ lib, stdenv, fetchurl, fetchpatch, libxml2, findXMLCatalogs, gettext, python, libgcrypt
 , cryptoSupport ? false
 , pythonSupport ? stdenv.buildPlatform == stdenv.hostPlatform
 }:
@@ -12,12 +12,12 @@ stdenv.mkDerivation rec {
     sha256 = "0zrzz6kjdyavspzik6fbkpvfpbd25r2qg6py5nnjaabrsr3bvccq";
   };
 
-  outputs = [ "bin" "dev" "out" "man" "doc" ] ++ stdenv.lib.optional pythonSupport "py";
+  outputs = [ "bin" "dev" "out" "man" "doc" ] ++ lib.optional pythonSupport "py";
 
   buildInputs = [ libxml2.dev ]
-    ++ stdenv.lib.optional stdenv.isDarwin gettext
-    ++ stdenv.lib.optionals pythonSupport [ libxml2.py python ]
-    ++ stdenv.lib.optionals cryptoSupport [ libgcrypt ];
+    ++ lib.optional stdenv.isDarwin gettext
+    ++ lib.optionals pythonSupport [ libxml2.py python ]
+    ++ lib.optionals cryptoSupport [ libgcrypt ];
 
   propagatedBuildInputs = [ findXMLCatalogs ];
 
@@ -26,14 +26,14 @@ stdenv.mkDerivation rec {
     "--without-debug"
     "--without-mem-debug"
     "--without-debugger"
-  ] ++ stdenv.lib.optional pythonSupport "--with-python=${python}"
-    ++ stdenv.lib.optional (!cryptoSupport) "--without-crypto";
+  ] ++ lib.optional pythonSupport "--with-python=${python}"
+    ++ lib.optional (!cryptoSupport) "--without-crypto";
 
   postFixup = ''
     moveToOutput bin/xslt-config "$dev"
     moveToOutput lib/xsltConf.sh "$dev"
     moveToOutput share/man/man1 "$bin"
-  '' + stdenv.lib.optionalString pythonSupport ''
+  '' + lib.optionalString pythonSupport ''
     mkdir -p $py/nix-support
     echo ${libxml2.py} >> $py/nix-support/propagated-build-inputs
     moveToOutput ${python.libPrefix} "$py"
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
     inherit pythonSupport;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://xmlsoft.org/XSLT/";
     description = "A C library and tools to do XSL transformations";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libxsmm/default.nix b/nixpkgs/pkgs/development/libraries/libxsmm/default.nix
index 5e4a56a6d4de..a2b4800ec4c4 100644
--- a/nixpkgs/pkgs/development/libraries/libxsmm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libxsmm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, coreutils, gfortran, gnused
+{ lib, stdenv, fetchFromGitHub, coreutils, gfortran, gnused
 , python3, util-linux, which
 
 , enableStatic ? stdenv.hostPlatform.isStatic
@@ -42,11 +42,11 @@ in stdenv.mkDerivation {
     patchShebangs .
   '';
 
-  meta = with stdenv.lib; {
+  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 stdenv.lib.maintainers; [ chessai ];
+    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
index cf880ef1e16c..13141923202a 100644
--- a/nixpkgs/pkgs/development/libraries/libyaml-cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libyaml-cpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "libyaml-cpp";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DYAML_CPP_BUILD_TESTS=OFF" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit (src.meta) homepage;
     description = "A YAML parser and emitter for C++";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libyaml/default.nix b/nixpkgs/pkgs/development/libraries/libyaml/default.nix
index 37b8ebcc3efa..03e7e4715f88 100644
--- a/nixpkgs/pkgs/development/libraries/libyaml/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libyaml/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook
 }:
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://pyyaml.org/";
     description = "A YAML 1.1 parser and emitter written in C";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/libykclient/default.nix b/nixpkgs/pkgs/development/libraries/libykclient/default.nix
index ea900477f356..6aacfc5ea2fa 100644
--- a/nixpkgs/pkgs/development/libraries/libykclient/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libykclient/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, help2man, curl }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, help2man, curl }:
 
 stdenv.mkDerivation {
   pname = "libykclient";
@@ -10,10 +10,10 @@ stdenv.mkDerivation {
     sha256 = "01b19jgv2lypih6lhw9yjjsfl8q1ahl955vhr2ai8ccshh0050yj";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig help2man ];
+  nativeBuildInputs = [ autoreconfHook pkg-config help2man ];
   buildInputs = [ curl ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Yubikey C client library";
     homepage = "https://developers.yubico.com/yubico-c-client";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/libykneomgr/default.nix b/nixpkgs/pkgs/development/libraries/libykneomgr/default.nix
index cb4f3bec0118..a7d35950f034 100644
--- a/nixpkgs/pkgs/development/libraries/libykneomgr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libykneomgr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, pcsclite, libzip, help2man }:
+{ lib, stdenv, fetchurl, pkg-config, pcsclite, libzip, help2man }:
 
 stdenv.mkDerivation rec {
   name = "libykneomgr-0.1.8";
@@ -8,14 +8,14 @@ stdenv.mkDerivation rec {
     sha256 = "12gqblz400kr11m1fdr1vvwr85lgy5v55zy0cf782whpk8lyyj97";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ pcsclite libzip help2man ];
 
   configureFlags = [
     "--with-backend=pcsc"
   ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/libyubikey/default.nix b/nixpkgs/pkgs/development/libraries/libyubikey/default.nix
index 75170d7ff8aa..b3aa2b57bdf8 100644
--- a/nixpkgs/pkgs/development/libraries/libyubikey/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libyubikey/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "libyubikey-1.13";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "009l3k2zyn06dbrlja2d4p2vfnzjhlcqxi88v02mlrnb17mx1v84";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://opensource.yubico.com/yubico-c/";
     description = "C library for manipulating Yubico YubiKey One-Time Passwords (OTPs)";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/libzapojit/default.nix b/nixpkgs/pkgs/development/libraries/libzapojit/default.nix
index 4341b1e20412..d16f34039f19 100644
--- a/nixpkgs/pkgs/development/libraries/libzapojit/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libzapojit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib, intltool, json-glib, librest, libsoup, gnome3, gnome-online-accounts, gobject-introspection }:
+{ lib, stdenv, fetchurl, pkg-config, glib, intltool, json-glib, librest, libsoup, gnome3, gnome-online-accounts, gobject-introspection }:
 
 stdenv.mkDerivation rec {
   pname = "libzapojit";
@@ -7,11 +7,11 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0zn3s7ryjc3k1abj4k55dr2na844l451nrg9s6cvnnhh569zj99x";
   };
 
-  nativeBuildInputs = [ pkgconfig intltool gobject-introspection ];
+  nativeBuildInputs = [ pkg-config intltool gobject-introspection ];
   propagatedBuildInputs = [ glib json-glib librest libsoup gnome-online-accounts ]; # zapojit-0.0.pc
 
   passthru = {
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GObject wrapper for the SkyDrive and Hotmail REST APIs";
     homepage = "https://wiki.gnome.org/Projects/Zapojit";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/libzdb/default.nix b/nixpkgs/pkgs/development/libraries/libzdb/default.nix
index 95f8e78cfb26..986f27e27c89 100644
--- a/nixpkgs/pkgs/development/libraries/libzdb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libzdb/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, sqlite}:
+{lib, stdenv, fetchurl, sqlite}:
 
 stdenv.mkDerivation rec
 {
@@ -17,8 +17,8 @@ stdenv.mkDerivation rec
   {
     homepage = "http://www.tildeslash.com/libzdb/";
     description = "A small, easy to use Open Source Database Connection Pool Library";
-    license = stdenv.lib.licenses.gpl3;
-    platforms = stdenv.lib.platforms.linux;
+    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
index 80a570dd697f..2d19ca4b22be 100644
--- a/nixpkgs/pkgs/development/libraries/libzen/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libzen/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook }:
+{ lib, stdenv, fetchurl, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   version = "0.4.38";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Shared library for libmediainfo and mediainfo";
     homepage = "https://mediaarea.net/";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/libzip/default.nix b/nixpkgs/pkgs/development/libraries/libzip/default.nix
index 79933d402f7a..c65a9b6f583a 100644
--- a/nixpkgs/pkgs/development/libraries/libzip/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libzip/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, perl, zlib }:
+{ lib, stdenv, fetchurl, cmake, perl, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "libzip";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "120xgf7cgjmz9d3yp10lks6lhkgxqb4skbmbiiwf46gx868qxsq6";
   };
 
-  # Fix pkgconfig file paths
+  # Fix pkg-config file paths
   postPatch = ''
     sed -i CMakeLists.txt \
       -e 's#\\''${exec_prefix}/''${CMAKE_INSTALL_LIBDIR}#''${CMAKE_INSTALL_FULL_LIBDIR}#' \
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
     patchShebangs regress
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.nih.at/libzip";
     description = "A C library for reading, creating and modifying zip archives";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/libzmf/default.nix b/nixpkgs/pkgs/development/libraries/libzmf/default.nix
index d3cbc430efc4..f71b6d0c0b97 100644
--- a/nixpkgs/pkgs/development/libraries/libzmf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libzmf/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, boost, icu, libpng, librevenge, zlib, doxygen, pkgconfig, cppunit}:
+{lib, stdenv, fetchurl, boost, icu, libpng, librevenge, zlib, doxygen, pkg-config, cppunit}:
 
 stdenv.mkDerivation rec {
   pname = "libzmf";
@@ -10,15 +10,15 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ boost icu libpng librevenge zlib cppunit ];
-  nativeBuildInputs = [ doxygen pkgconfig ];
+  nativeBuildInputs = [ doxygen pkg-config ];
   configureFlags = [ "--disable-werror" ];
 
   meta = {
     inherit version;
-    description = ''A library that parses the file format of Zoner Callisto/Draw documents'';
-    license = stdenv.lib.licenses.mpl20;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.unix;
+    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
index b5fe6e593566..3ebfc21095d1 100644
--- a/nixpkgs/pkgs/development/libraries/libzra/default.nix
+++ b/nixpkgs/pkgs/development/libraries/libzra/default.nix
@@ -1,23 +1,23 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 }:
 
 stdenv.mkDerivation rec {
   pname = "libzra";
-  version = "unstable-2020-08-10";
+  version = "unstable-2020-09-11";
 
   src = fetchFromGitHub {
     owner = "zraorg";
     repo = "zra";
-    rev = "e678980ae7e79efd716b4a6610fe9f148425fd6b";
-    sha256 = "132xyzhadahm01nas8gycjza5hs839fnpsh73im2a7wwfdw76z4h";
+    rev = "57abf2774dfc4624f14a0bc5bba71f044ce54a38";
+    sha256 = "10rlqj6ma02005gdcp57wp48d6cg0vkbv4vl9ai0zlgxyx1g6kc4";
     fetchSubmodules = true;
   };
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/zraorg/ZRA";
     description = "Library for ZStandard random access";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/lief/default.nix b/nixpkgs/pkgs/development/libraries/lief/default.nix
index 0854987436e6..3b57d0c2f7ae 100644
--- a/nixpkgs/pkgs/development/libraries/lief/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lief/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchzip }:
+{ lib, stdenv, fetchzip }:
 
 fetchzip {
   url = "https://github.com/lief-project/LIEF/releases/download/0.9.0/LIEF-0.9.0-Linux.tar.gz";
   sha256 = "1c47hwd00bp4mqd4p5b6xjfl89c3wwk9ccyc3a2gk658250g2la6";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library to Instrument Executable Formats";
     homepage = "https://lief.quarkslab.com/";
     license = [ licenses.asl20 ];
diff --git a/nixpkgs/pkgs/development/libraries/lightning/default.nix b/nixpkgs/pkgs/development/libraries/lightning/default.nix
index 65d0a18cedd0..5fdc06bce012 100644
--- a/nixpkgs/pkgs/development/libraries/lightning/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lightning/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, libopcodes }:
+{ lib, stdenv, fetchurl, libopcodes }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
 
   pname = "lightning";
@@ -27,6 +27,6 @@ stdenv.mkDerivation rec {
     '';
     maintainers = [ maintainers.AndersonTorres ];
     license = licenses.lgpl3Plus;
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/lightstep-tracer-cpp/default.nix b/nixpkgs/pkgs/development/libraries/lightstep-tracer-cpp/default.nix
index 2e6b36446285..d47c7b50abef 100644
--- a/nixpkgs/pkgs/development/libraries/lightstep-tracer-cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lightstep-tracer-cpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, pkgconfig, cmake
+{ stdenv, lib, fetchFromGitHub, pkg-config, cmake
 , opentracing-cpp, protobuf, zlib
 , enableGrpc ? false, grpc ? null, openssl ? null, c-ares ? null
 }:
@@ -9,17 +9,17 @@ assert enableGrpc -> c-ares != null;
 
 stdenv.mkDerivation rec {
   pname = "lightstep-tracer-cpp";
-  version = "0.13.0";
+  version = "0.14.0";
 
   src = fetchFromGitHub {
     owner = "lightstep";
     repo = pname;
     rev = "v${version}";
-    sha256 = "0d7z9isf0n8s63mvp3j75949w0yv7jsva29i62lq8yxbym688fxb";
+    sha256 = "1xr11dm94qpbx3nxb7si7zy7hzg2akj01pyxkd8pzzbvmkmic16j";
   };
 
   nativeBuildInputs = [
-    cmake pkgconfig
+    cmake pkg-config
   ];
 
   buildInputs = [
diff --git a/nixpkgs/pkgs/development/libraries/lime/default.nix b/nixpkgs/pkgs/development/libraries/lime/default.nix
index aa34ff2e927c..3a16b5202c47 100644
--- a/nixpkgs/pkgs/development/libraries/lime/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lime/default.nix
@@ -4,7 +4,7 @@
 , fetchFromGitLab
 , soci
 , sqlite
-, stdenv
+, lib, stdenv
 }:
 
 stdenv.mkDerivation rec {
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
   # Do not build static libraries
   cmakeFlags = [ "-DENABLE_STATIC=NO" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "End-to-end encryption library for instant messaging";
     homepage = "http://www.linphone.org/technical-corner/lime";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/linbox/default.nix b/nixpkgs/pkgs/development/libraries/linbox/default.nix
index 7bca0c295c4b..8a21bd3bcde4 100644
--- a/nixpkgs/pkgs/development/libraries/linbox/default.nix
+++ b/nixpkgs/pkgs/development/libraries/linbox/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook
 , givaro
-, pkgconfig
+, pkg-config
 , blas
 , lapack
 , fflas-ffpack
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     autoreconfHook
-    pkgconfig
+    pkg-config
   ];
 
   buildInputs = [
@@ -52,7 +52,7 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--with-blas-libs=-lblas"
     "--disable-optimization"
-  ] ++ stdenv.lib.optionals stdenv.isx86_64 [
+  ] ++ 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"
@@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
     "--${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"
-  ] ++ stdenv.lib.optionals withSage [
+  ] ++ lib.optionals withSage [
     "--enable-sage"
   ];
 
@@ -70,7 +70,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit version;
     description = "C++ library for exact, high-performance linear algebra";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/linenoise-ng/default.nix b/nixpkgs/pkgs/development/libraries/linenoise-ng/default.nix
index 0a2dacb48db9..d19d6748147c 100644
--- a/nixpkgs/pkgs/development/libraries/linenoise-ng/default.nix
+++ b/nixpkgs/pkgs/development/libraries/linenoise-ng/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "linenoise-ng";
@@ -16,8 +16,8 @@ stdenv.mkDerivation rec {
   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 stdenv.lib.maintainers; [ cstrahan ];
-    platforms = stdenv.lib.platforms.all;
-    license = stdenv.lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [ cstrahan ];
+    platforms = lib.platforms.all;
+    license = lib.licenses.bsd3;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/linenoise/default.nix b/nixpkgs/pkgs/development/libraries/linenoise/default.nix
index 3de9f08bf971..d465b48a8f46 100644
--- a/nixpkgs/pkgs/development/libraries/linenoise/default.nix
+++ b/nixpkgs/pkgs/development/libraries/linenoise/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation {
   pname = "linenoise";
@@ -23,8 +23,8 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://github.com/antirez/linenoise";
     description = "A minimal, zero-config, BSD licensed, readline replacement";
-    maintainers = with stdenv.lib.maintainers; [ mpsyco ];
-    platforms = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.bsd2;
+    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
index b882e233c079..746771f44fe4 100644
--- a/nixpkgs/pkgs/development/libraries/liquid-dsp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liquid-dsp/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, autoreconfHook }:
+{lib, stdenv, fetchFromGitHub, autoreconfHook }:
 
 stdenv.mkDerivation {
   pname = "liquid-dsp";
@@ -16,8 +16,8 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://liquidsdr.org/";
     description = "Digital signal processing library for software-defined radios";
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.unix;
+    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
index 1beae81ad16f..29531a299966 100644
--- a/nixpkgs/pkgs/development/libraries/liquidfun/default.nix
+++ b/nixpkgs/pkgs/development/libraries/liquidfun/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, requireFile, cmake, libGLU, libGL, libX11, libXi }:
+{ lib, stdenv, requireFile, cmake, libGLU, libGL, libX11, libXi }:
 
-let 
+let
   sourceInfo = rec {
     version="1.1.0";
     name="liquidfun-${version}";
@@ -16,7 +16,8 @@ stdenv.mkDerivation {
   };
 
   inherit (sourceInfo) name version;
-  buildInputs = [ cmake libGLU libGL libX11 libXi ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ libGLU libGL libX11 libXi ];
 
   sourceRoot = "liquidfun/Box2D/";
 
@@ -26,23 +27,22 @@ stdenv.mkDerivation {
     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; 
+    cd Build;
     cmake -DBOX2D_INSTALL=ON -DBOX2D_BUILD_SHARED=ON -DCMAKE_INSTALL_PREFIX=$out ..
   '';
 
   meta = {
     description = "2D physics engine based on Box2D";
-    maintainers = with stdenv.lib.maintainers;
+    maintainers = with lib.maintainers;
     [
       qknight
     ];
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
     hydraPlatforms = [];
-    license = stdenv.lib.licenses.bsd2;
+    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
index 97079be09623..6b7f0c102ee8 100644
--- a/nixpkgs/pkgs/development/libraries/lirc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lirc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, autoreconfHook, pkgconfig, help2man, python3,
+{ lib, stdenv, fetchurl, fetchpatch, autoreconfHook, pkg-config, help2man, python3,
   alsaLib, xlibsWrapper, libxslt, systemd, libusb-compat-0_1, libftdi1 }:
 
 stdenv.mkDerivation rec {
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     touch lib/lirc/input_map.inc
   '';
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig help2man
+  nativeBuildInputs = [ autoreconfHook pkg-config help2man
     (python3.withPackages (p: with p; [ pyyaml setuptools ])) ];
 
   buildInputs = [ alsaLib xlibsWrapper libxslt systemd libusb-compat-0_1 libftdi1 ];
@@ -48,7 +48,7 @@ stdenv.mkDerivation rec {
     "localstatedir=$TMPDIR"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Allows to receive and send infrared signals";
     homepage = "https://www.lirc.org/";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/live555/default.nix b/nixpkgs/pkgs/development/libraries/live555/default.nix
index 84907a428605..85302bc7c966 100644
--- a/nixpkgs/pkgs/development/libraries/live555/default.nix
+++ b/nixpkgs/pkgs/development/libraries/live555/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     sed \
       -e 's/$(INCLUDES) -I. -O2 -DSOCKLEN_T/$(INCLUDES) -I. -O2 -I. -fPIC -DRTSPCLIENT_SYNCHRONOUS_INTERFACE=1 -DSOCKLEN_T/g' \
       -i config.linux
-  '' + stdenv.lib.optionalString (stdenv ? glibc) ''
+  '' + lib.optionalString (stdenv ? glibc) ''
     substituteInPlace liveMedia/include/Locale.hh \
       --replace '<xlocale.h>' '<locale.h>'
   '';
diff --git a/nixpkgs/pkgs/development/libraries/lmdb/default.nix b/nixpkgs/pkgs/development/libraries/lmdb/default.nix
index 64f6fccefa79..a59b460734d0 100644
--- a/nixpkgs/pkgs/development/libraries/lmdb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lmdb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit }:
+{ lib, stdenv, fetchgit }:
 
 stdenv.mkDerivation rec {
   pname = "lmdb";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     "CC=${stdenv.cc.targetPrefix}cc"
     "AR=${stdenv.cc.targetPrefix}ar"
   ]
-    ++ stdenv.lib.optional stdenv.isDarwin "LDFLAGS=-Wl,-install_name,$(out)/lib/liblmdb.so";
+    ++ lib.optional stdenv.isDarwin "LDFLAGS=-Wl,-install_name,$(out)/lib/liblmdb.so";
 
   doCheck = true;
   checkPhase = "make test";
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
     EOF
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Lightning memory-mapped database";
     longDescription = ''
       LMDB is an ultra-fast, ultra-compact key-value embedded data store
diff --git a/nixpkgs/pkgs/development/libraries/lmdbxx/default.nix b/nixpkgs/pkgs/development/libraries/lmdbxx/default.nix
index 95d8f45eec46..9b1d320678a0 100644
--- a/nixpkgs/pkgs/development/libraries/lmdbxx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lmdbxx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , lmdb }:
 
@@ -19,8 +19,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://github.com/drycpp/lmdbxx#readme";
     description = "C++11 wrapper for the LMDB embedded B+ tree database library";
-    license = stdenv.lib.licenses.unlicense;
-    maintainers = with stdenv.lib.maintainers; [ fgaz ];
+    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
index 097ff0c48c90..1e16ee96ae7f 100644
--- a/nixpkgs/pkgs/development/libraries/log4cplus/default.nix
+++ b/nixpkgs/pkgs/development/libraries/log4cplus/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 let
   name = "log4cplus-2.0.5";
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "http://log4cplus.sourceforge.net/";
     description = "A port the log4j library from Java to C++";
-    license = stdenv.lib.licenses.asl20;
-    platforms = stdenv.lib.platforms.unix;
+    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
index d2918c87f335..d4b703a2bda7 100644
--- a/nixpkgs/pkgs/development/libraries/log4cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/log4cpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "log4cpp-1.1.3";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage    = "http://log4cpp.sourceforge.net/";
     description = "A logging framework for C++ patterned after Apache log4j";
     license     = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/log4cxx/default.nix b/nixpkgs/pkgs/development/libraries/log4cxx/default.nix
index cec0ec9ab287..aaf7ea5ee9c9 100644
--- a/nixpkgs/pkgs/development/libraries/log4cxx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/log4cxx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libtool, libxml2, cppunit, boost
+{ lib, stdenv, fetchurl, libtool, libxml2, cppunit, boost
 , apr, aprutil, db, expat
 }:
 
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     }' src/examples/cpp/console.cpp \
        src/main/cpp/inputstreamreader.cpp \
        src/main/cpp/socketoutputstream.cpp
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + 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
   '';
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://logging.apache.org/log4cxx/index.html";
     description = "A logging framework for C++ patterned after Apache log4j";
-    license = stdenv.lib.licenses.asl20;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/log4shib/default.nix b/nixpkgs/pkgs/development/libraries/log4shib/default.nix
index 17046d17b78a..0602b4c3b523 100644
--- a/nixpkgs/pkgs/development/libraries/log4shib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/log4shib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, autoreconfHook }:
+{ lib, stdenv, fetchgit, autoreconfHook }:
 
 stdenv.mkDerivation {
   pname = "log4shib";
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ autoreconfHook ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A forked version of log4cpp that has been created for the Shibboleth project";
     maintainers = [ maintainers.jammerful ];
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/loki/default.nix b/nixpkgs/pkgs/development/libraries/loki/default.nix
index 9c7e36113d86..49b850eae65b 100644
--- a/nixpkgs/pkgs/development/libraries/loki/default.nix
+++ b/nixpkgs/pkgs/development/libraries/loki/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "loki";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/loudmouth/default.nix b/nixpkgs/pkgs/development/libraries/loudmouth/default.nix
index e00fc07480e2..0245417bbf9b 100644
--- a/nixpkgs/pkgs/development/libraries/loudmouth/default.nix
+++ b/nixpkgs/pkgs/development/libraries/loudmouth/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, openssl, libidn, glib, pkgconfig, zlib }:
+{ lib, stdenv, fetchurl, openssl, libidn, glib, pkg-config, zlib }:
 
 stdenv.mkDerivation rec {
   version = "1.5.3";
@@ -16,9 +16,9 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ openssl libidn glib zlib ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A lightweight C library for the Jabber protocol";
     platforms = platforms.linux;
     downloadPage = "http://mcabber.com/files/loudmouth/";
diff --git a/nixpkgs/pkgs/development/libraries/lrdf/default.nix b/nixpkgs/pkgs/development/libraries/lrdf/default.nix
index 80c8702b0b94..51b2635b89e0 100644
--- a/nixpkgs/pkgs/development/libraries/lrdf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lrdf/default.nix
@@ -1,4 +1,4 @@
-{ config, stdenv, fetchFromGitHub, pkgconfig, autoreconfHook
+{ config, lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook
 , librdf_raptor2, ladspaH, openssl, zlib
 , doCheck ? config.doCheckByDefault or false, ladspaPlugins
 }:
@@ -14,11 +14,11 @@ stdenv.mkDerivation rec {
     sha256 = "00wzkfb8y0aqd519ypz067cq099dpc89w69zw8ln39vl6f9x2pd4";
   };
 
-  postPatch = stdenv.lib.optionalString doCheck ''
+  postPatch = lib.optionalString doCheck ''
     sed -i -e 's:usr/local:${ladspaPlugins}:' examples/{instances,remove}_test.c
   '';
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
   propagatedBuildInputs = [ librdf_raptor2 ];
 
@@ -29,8 +29,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Lightweight RDF library with special support for LADSPA plugins";
     homepage = "https://sourceforge.net/projects/lrdf/";
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = [ stdenv.lib.maintainers.marcweber ];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl2;
+    maintainers = [ lib.maintainers.marcweber ];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/luabind/default.nix b/nixpkgs/pkgs/development/libraries/luabind/default.nix
index eded6b6527fe..d7aed656fdb9 100644
--- a/nixpkgs/pkgs/development/libraries/luabind/default.nix
+++ b/nixpkgs/pkgs/development/libraries/luabind/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, boost-build, lua, boost}:
+{lib, stdenv, fetchurl, boost-build, lua, boost}:
 
 stdenv.mkDerivation {
   name = "luabind-0.9.1";
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://github.com/luabind/luabind";
     description = "A library that helps you create bindings between C++ and Lua";
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.linux;
+    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
index 3d54cf5e7c13..2761329ea23c 100644
--- a/nixpkgs/pkgs/development/libraries/lucene++/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lucene++/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, boost, gtest }:
+{ lib, stdenv, fetchurl, cmake, boost, gtest }:
 
 stdenv.mkDerivation rec {
   pname = "lucene++";
@@ -17,16 +17,16 @@ stdenv.mkDerivation rec {
   '';
 
   cmakeFlags = [ "-DGTEST_INCLUDE_DIR=${gtest}/include" ];
-  buildInputs = [ cmake boost gtest ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost gtest ];
 
-  enableParallelBuilding = true;
   doCheck = true;
   checkTarget = "test";
 
   meta = {
     description = "C++ port of the popular Java Lucene search engine";
     homepage = "https://github.com/luceneplusplus/LucenePlusPlus";
-    license = with stdenv.lib.licenses; [ asl20 lgpl3Plus ];
-    platforms = stdenv.lib.platforms.linux;
+    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
index 9e01605d2df1..afefcfed82c7 100644
--- a/nixpkgs/pkgs/development/libraries/luksmeta/default.nix
+++ b/nixpkgs/pkgs/development/libraries/luksmeta/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, asciidoc
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, asciidoc
 , cryptsetup
 }:
 
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "10nslwk7m1qwskd12c204ipa3cbad0q6fn0v084z2f7q6xxbkd2d";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig asciidoc ];
+  nativeBuildInputs = [ autoreconfHook pkg-config asciidoc ];
   buildInputs = [ cryptsetup ];
 
   meta = {
diff --git a/nixpkgs/pkgs/development/libraries/lyra/default.nix b/nixpkgs/pkgs/development/libraries/lyra/default.nix
index 8d5d083d82b0..9f5fd1d3a342 100644
--- a/nixpkgs/pkgs/development/libraries/lyra/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lyra/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, installShellFiles, meson, ninja }:
+{ lib, stdenv, fetchFromGitHub, installShellFiles, meson, ninja }:
 
 stdenv.mkDerivation rec {
   pname = "lyra";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     cp -R $src/include/* $out/include
   '';
 
-  meta = with stdenv.lib; {
+  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.linux;
diff --git a/nixpkgs/pkgs/development/libraries/lzo/default.nix b/nixpkgs/pkgs/development/libraries/lzo/default.nix
index 446f91464145..8ea933f0e3ab 100644
--- a/nixpkgs/pkgs/development/libraries/lzo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/lzo/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   name = "lzo-2.10";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true; # not cross;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Real-time data (de)compression library";
     longDescription = ''
       LZO is a portable lossless data compression library written in ANSI C.
diff --git a/nixpkgs/pkgs/development/libraries/mac/default.nix b/nixpkgs/pkgs/development/libraries/mac/default.nix
index a896b9261d52..7445d283c6f4 100644
--- a/nixpkgs/pkgs/development/libraries/mac/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mac/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, yasm }:
+{ lib, stdenv, fetchurl, fetchpatch, yasm }:
 
 stdenv.mkDerivation rec {
   pname = "mac";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ yasm ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/mailcore2/default.nix b/nixpkgs/pkgs/development/libraries/mailcore2/default.nix
index d5f20f6761c2..4e5a5fdbcdbc 100644
--- a/nixpkgs/pkgs/development/libraries/mailcore2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mailcore2/default.nix
@@ -1,5 +1,5 @@
 { stdenv, lib, fetchFromGitHub, cmake, libetpan, icu, cyrus_sasl, libctemplate
-, libuchardet, pkgconfig, glib, html-tidy, libxml2, libuuid, openssl
+, libuchardet, pkg-config, glib, html-tidy, libxml2, libuuid, openssl
 }:
 
 stdenv.mkDerivation rec {
@@ -14,9 +14,9 @@ stdenv.mkDerivation rec {
     sha256 = "0a69q11z194fdfwyazjyyylx57sqs9j4lz7jwh5qcws8syqgb23z";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
   buildInputs = [
-    libetpan cmake icu cyrus_sasl libctemplate libuchardet glib
+    libetpan icu cyrus_sasl libctemplate libuchardet glib
     html-tidy libxml2 libuuid openssl
   ];
 
diff --git a/nixpkgs/pkgs/development/libraries/malcontent/default.nix b/nixpkgs/pkgs/development/libraries/malcontent/default.nix
index 49ffade85460..641f3b87c3fe 100644
--- a/nixpkgs/pkgs/development/libraries/malcontent/default.nix
+++ b/nixpkgs/pkgs/development/libraries/malcontent/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitLab
 , fetchpatch
 , meson
@@ -90,7 +90,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  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" ];
diff --git a/nixpkgs/pkgs/development/libraries/malcontent/ui.nix b/nixpkgs/pkgs/development/libraries/malcontent/ui.nix
index 54382cfc0d57..e306267154ae 100644
--- a/nixpkgs/pkgs/development/libraries/malcontent/ui.nix
+++ b/nixpkgs/pkgs/development/libraries/malcontent/ui.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , meson
 , ninja
 , pkg-config
@@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
     "-Dui=enabled"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "UI components for parental controls library";
     homepage = "https://gitlab.freedesktop.org/pwithnall/malcontent";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/mapnik/default.nix b/nixpkgs/pkgs/development/libraries/mapnik/default.nix
index cf0539fe266f..40ef1fde563a 100644
--- a/nixpkgs/pkgs/development/libraries/mapnik/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mapnik/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip
+{ lib, stdenv, fetchzip
 , boost, cairo, freetype, gdal, harfbuzz, icu, libjpeg, libpng, libtiff
 , libwebp, libxml2, proj, python, sqlite, zlib
 
@@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
     "XML2_LIBS=${libxml2.out}/lib"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An open source toolkit for developing mapping applications";
     homepage = "https://mapnik.org";
     maintainers = with maintainers; [ hrdinka ];
diff --git a/nixpkgs/pkgs/development/libraries/marisa/default.nix b/nixpkgs/pkgs/development/libraries/marisa/default.nix
index 99d82970fe06..4a3f8be04172 100644
--- a/nixpkgs/pkgs/development/libraries/marisa/default.nix
+++ b/nixpkgs/pkgs/development/libraries/marisa/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "marisa";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage    = "https://github.com/s-yata/marisa-trie";
     description = "Static and space-efficient trie data structure library";
     license     = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/marl/default.nix b/nixpkgs/pkgs/development/libraries/marl/default.nix
index 2bf23962d53e..4545264aad9e 100644
--- a/nixpkgs/pkgs/development/libraries/marl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/marl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, fetchFromGitHub }:
+{ lib, stdenv, cmake, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "marl";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   # Turn on the flag to install after building the library.
   cmakeFlags = ["-DMARL_INSTALL=ON"];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/google/marl";
     description = "A hybrid thread / fiber task scheduler written in C++ 11";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/martyr/default.nix b/nixpkgs/pkgs/development/libraries/martyr/default.nix
index 51fd6962e704..609033e22ead 100644
--- a/nixpkgs/pkgs/development/libraries/martyr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/martyr/default.nix
@@ -1,12 +1,12 @@
-{stdenv, fetchurl, ant, jdk}:
+{lib, stdenv, fetchurl, ant, jdk}:
 
 stdenv.mkDerivation rec {
-	pname = "martyr";
+  pname = "martyr";
   version = "0.3.9";
-	src = fetchurl {
-		url = "mirror://sourceforge/martyr/${pname}-${version}.tar.gz";
-		sha256 = "1ks8j413bcby345kmq1i7av8kwjvz5vxdn1zpv0p7ywxq54i4z59";
-	};
+  src = fetchurl {
+    url = "mirror://sourceforge/martyr/${pname}-${version}.tar.gz";
+    sha256 = "1ks8j413bcby345kmq1i7av8kwjvz5vxdn1zpv0p7ywxq54i4z59";
+  };
 
   buildInputs = [ ant jdk ];
 
@@ -20,6 +20,6 @@ stdenv.mkDerivation rec {
   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 = stdenv.lib.licenses.lgpl21;
+    license = lib.licenses.lgpl21;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/matio/default.nix b/nixpkgs/pkgs/development/libraries/matio/default.nix
index bc629dc25064..b6330f69e302 100644
--- a/nixpkgs/pkgs/development/libraries/matio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/matio/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 stdenv.mkDerivation rec {
   name = "matio-1.5.19";
   src = fetchurl {
@@ -6,7 +6,7 @@ stdenv.mkDerivation rec {
     sha256 = "0vr8c1mz1k6mz0sgh6n3scl5c3a71iqmy5fnydrgq504icj4vym4";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A C library for reading and writing Matlab MAT files";
     license = licenses.bsd2;
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/mbedtls/default.nix b/nixpkgs/pkgs/development/libraries/mbedtls/default.nix
index f24232ac7aec..e3e0d2ecd78d 100644
--- a/nixpkgs/pkgs/development/libraries/mbedtls/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mbedtls/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 
 , cmake
@@ -23,14 +23,14 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ninja perl python ];
 
-  postConfigure = stdenv.lib.optionals enableThreading ''
+  postConfigure = lib.optionals 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" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://tls.mbed.org/";
     description = "Portable cryptographic and TLS library, formerly known as PolarSSL";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/mdds/default.nix b/nixpkgs/pkgs/development/libraries/mdds/default.nix
index b69e99de414d..0fc749632994 100644
--- a/nixpkgs/pkgs/development/libraries/mdds/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mdds/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, boost, llvmPackages }:
+{ lib, stdenv, fetchurl, boost, llvmPackages }:
 
 stdenv.mkDerivation rec {
   pname = "mdds";
@@ -14,11 +14,11 @@ stdenv.mkDerivation rec {
     cp "$out/share/pkgconfig/"* "$out/lib/pkgconfig"
   '';
 
-  buildInputs = stdenv.lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ];
+  buildInputs = lib.optionals stdenv.cc.isClang [ llvmPackages.openmp ];
 
   checkInputs = [ boost ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit version;
     homepage = "https://gitlab.com/mdds/mdds";
     description = "A collection of multi-dimensional data structure and indexing algorithm";
diff --git a/nixpkgs/pkgs/development/libraries/medfile/default.nix b/nixpkgs/pkgs/development/libraries/medfile/default.nix
index 246bdb1480c0..a89cb43d2611 100644
--- a/nixpkgs/pkgs/development/libraries/medfile/default.nix
+++ b/nixpkgs/pkgs/development/libraries/medfile/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, hdf5 }:
+{ lib, stdenv, fetchurl, cmake, hdf5 }:
 
 stdenv.mkDerivation rec {
   pname = "medfile";
@@ -9,8 +9,6 @@ stdenv.mkDerivation rec {
     sha256 = "1khzclkrd1yn9mz3g14ndgpsbj8j50v8dsjarcj6kkn9zgbbazc4";
   };
 
-  enableParallelBuilding = true;
-
   nativeBuildInputs = [ cmake ];
   buildInputs = [ hdf5 ];
 
@@ -18,7 +16,7 @@ stdenv.mkDerivation rec {
 
   postInstall = "rm -r $out/bin/testc";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library to read and write MED files";
     homepage = "http://salome-platform.org/";
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/mediastreamer/default.nix b/nixpkgs/pkgs/development/libraries/mediastreamer/default.nix
index 64ddba517df8..3cda9ff3006d 100644
--- a/nixpkgs/pkgs/development/libraries/mediastreamer/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mediastreamer/default.nix
@@ -23,12 +23,12 @@
 , libv4l
 , libvpx
 , ortp
-, pkgconfig
+, pkg-config
 , python
 , SDL
 , speex
 , srtp
-, stdenv
+, lib, stdenv
 }:
 
 stdenv.mkDerivation rec {
@@ -57,7 +57,7 @@ stdenv.mkDerivation rec {
     cmake
     doxygen
     intltool
-    pkgconfig
+    pkg-config
     python
   ];
 
@@ -99,7 +99,7 @@ stdenv.mkDerivation rec {
   ];
   NIX_LDFLAGS = "-lXext";
 
-  meta = with stdenv.lib; {
+  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.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/mediastreamer/msopenh264.nix b/nixpkgs/pkgs/development/libraries/mediastreamer/msopenh264.nix
index 45b3c83bfe24..08842889f865 100644
--- a/nixpkgs/pkgs/development/libraries/mediastreamer/msopenh264.nix
+++ b/nixpkgs/pkgs/development/libraries/mediastreamer/msopenh264.nix
@@ -4,8 +4,8 @@
 , fetchpatch
 , mediastreamer
 , openh264
-, pkgconfig
-, stdenv
+, pkg-config
+, lib, stdenv
 }:
 
 stdenv.mkDerivation rec {
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     sha256 = "140hs5lzpshzswvl39klcypankq3v2qck41696j22my7s4wsa0hr";
   };
 
-  nativeBuildInputs = [ autoreconfHook cmake pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook cmake pkg-config ];
   buildInputs = [ mediastreamer openh264 ];
 
   # Do not build static libraries
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
     cp src/libmsopenh264.so $out/lib/mediastreamer/plugins/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "H.264 encoder/decoder plugin for mediastreamer2";
     homepage = "https://www.linphone.org/technical-corner/mediastreamer2";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/menu-cache/default.nix b/nixpkgs/pkgs/development/libraries/menu-cache/default.nix
index d7b39c28a425..b2f06b9e627b 100644
--- a/nixpkgs/pkgs/development/libraries/menu-cache/default.nix
+++ b/nixpkgs/pkgs/development/libraries/menu-cache/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, glib, pkgconfig, libfm-extra }:
+{ lib, stdenv, fetchurl, glib, pkg-config, libfm-extra }:
 
 let name = "menu-cache-1.1.0";
 in
@@ -9,11 +9,11 @@ stdenv.mkDerivation {
     sha256 = "1iry4zlpppww8qai2cw4zid4081hh7fz8nzsp5lqyffbkm2yn0pd";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ glib libfm-extra ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library to read freedesktop.org menu files";
     homepage = "https://blog.lxde.org/tag/menu-cache/";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/mesa-glu/default.nix b/nixpkgs/pkgs/development/libraries/mesa-glu/default.nix
index 9679ddb94e8c..85950daea68a 100644
--- a/nixpkgs/pkgs/development/libraries/mesa-glu/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mesa-glu/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libGL, ApplicationServices }:
+{ lib, stdenv, fetchurl, pkg-config, libGL, ApplicationServices }:
 
 stdenv.mkDerivation rec {
   pname = "glu";
@@ -9,17 +9,17 @@ stdenv.mkDerivation rec {
     sha256 = "1g2m634p73mixkzv1qz1d0flwm390ydi41bwmchiqvdssqnlqnpv";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   propagatedBuildInputs = [ libGL ]
-    ++ stdenv.lib.optional stdenv.isDarwin ApplicationServices;
+    ++ lib.optional stdenv.isDarwin ApplicationServices;
 
   outputs = [ "out" "dev" ];
 
   meta = {
     description = "OpenGL utility library";
     homepage = "https://cgit.freedesktop.org/mesa/glu/";
-    license = stdenv.lib.licenses.sgi-b-20;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.sgi-b-20;
+    platforms = lib.platforms.unix;
     broken = stdenv.hostPlatform.isAndroid;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/mesa/default.nix b/nixpkgs/pkgs/development/libraries/mesa/default.nix
index c96d1edfadfe..44dddac7d32c 100644
--- a/nixpkgs/pkgs/development/libraries/mesa/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mesa/default.nix
@@ -1,5 +1,5 @@
 { stdenv, lib, fetchurl, fetchpatch, buildPackages
-, pkgconfig, intltool, ninja, meson
+, pkg-config, intltool, ninja, meson
 , file, flex, bison, expat, libdrm, xorg, wayland, wayland-protocols, openssl
 , llvmPackages, libffi, libomxil-bellagio, libva-minimal
 , libelf, libvdpau, python3Packages
@@ -26,12 +26,12 @@
   - libOSMesa is in $osmesa (~4 MB)
 */
 
-with stdenv.lib;
+with lib;
 
 let
   # Release calendar: https://www.mesa3d.org/release-calendar.html
   # Release frequency: https://www.mesa3d.org/releasing.html#schedule
-  version = "20.3.1";
+  version = "20.3.2";
   branch  = versions.major version;
 in
 
@@ -46,7 +46,7 @@ stdenv.mkDerivation {
       "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 = "03vqm9kqrcpijg6bxldj0bg360z8d7c767n3b16jdc1apd4inxdg";
+    sha256 = "0gakhsj5qgm4wran7nlnz7kzgg3aj0a8f4q4dfbznfnjhnv03q6c";
   };
 
   prePatch = "patchShebangs .";
@@ -65,10 +65,9 @@ stdenv.mkDerivation {
       url = "https://gitlab.freedesktop.org/mesa/mesa/commit/aebbf819df6d1e.patch";
       sha256 = "17248hyzg43d73c86p077m4lv1pkncaycr3l27hwv9k4ija9zl8q";
     })
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [
-    # Fix for pre macOS SDK 10.13
-    # TODO(r-burns) can be applied unconditionally, at the cost of a mass linux rebuild
-    (fetchpatch {
+    # Fix for pre macOS SDK 10.13:
+    (fetchpatch { # util: Disable memstream for Apple builds
+      # MR: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8269
       url = "https://gitlab.freedesktop.org/mesa/mesa/-/commit/f4403f70fe5bf2ec41af5546122f0d78caffa984.patch";
       sha256 = "03j2aj255m7ms848nkb41vj3s3yb72zb5rz3w3fzp5l9wzzargw5";
     })
@@ -130,10 +129,10 @@ stdenv.mkDerivation {
     ++ lib.optionals stdenv.isLinux [ libomxil-bellagio libva-minimal ]
     ++ lib.optional withValgrind valgrind-light;
 
-  depsBuildBuild = [ pkgconfig ];
+  depsBuildBuild = [ pkg-config ];
 
   nativeBuildInputs = [
-    pkgconfig meson ninja
+    pkg-config meson ninja
     intltool bison flex file
     python3Packages.python python3Packages.Mako
   ] ++ lib.optionals (elem "wayland" eglPlatforms) [
@@ -208,7 +207,7 @@ stdenv.mkDerivation {
     done
   '';
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-fno-common";
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin "-fno-common";
 
   passthru = {
     inherit libdrm;
diff --git a/nixpkgs/pkgs/development/libraries/metal/default.nix b/nixpkgs/pkgs/development/libraries/metal/default.nix
index 7e047c28d0a6..18b1f116b876 100644
--- a/nixpkgs/pkgs/development/libraries/metal/default.nix
+++ b/nixpkgs/pkgs/development/libraries/metal/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 stdenv.mkDerivation rec {
   pname = "metal";
   version = "2.1.1";
@@ -12,9 +12,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/microsoft_gsl/default.nix b/nixpkgs/pkgs/development/libraries/microsoft_gsl/default.nix
index a0356497818a..af1c1c91a94f 100644
--- a/nixpkgs/pkgs/development/libraries/microsoft_gsl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/microsoft_gsl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, catch, cmake
+{ lib, stdenv, fetchFromGitHub, catch, cmake
 }:
 
 let
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     mv ../include/ $out/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ Core Guideline support library";
     longDescription = ''
      The Guideline Support Library (GSL) contains functions and types that are suggested for
diff --git a/nixpkgs/pkgs/development/libraries/mimalloc/default.nix b/nixpkgs/pkgs/development/libraries/mimalloc/default.nix
index 7382ed57c640..2ac2087054fe 100644
--- a/nixpkgs/pkgs/development/libraries/mimalloc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mimalloc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, ninja
+{ lib, stdenv, fetchFromGitHub, cmake, ninja
 , secureBuild ? false
 }:
 
@@ -17,11 +17,10 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ cmake ninja ];
-  enableParallelBuilding = true;
-  cmakeFlags = stdenv.lib.optional secureBuild [ "-DMI_SECURE=ON" ];
+  cmakeFlags = lib.optional secureBuild [ "-DMI_SECURE=ON" ];
 
   postInstall = let
-    rel = stdenv.lib.versions.majorMinor version;
+    rel = lib.versions.majorMinor version;
   in ''
     # first, install headers, that's easy
     mkdir -p $dev
@@ -47,7 +46,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Compact, fast, general-purpose memory allocator";
     homepage    = "https://github.com/microsoft/mimalloc";
     license     = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/mimetic/default.nix b/nixpkgs/pkgs/development/libraries/mimetic/default.nix
index 0147a2973053..1638caa0d1f8 100644
--- a/nixpkgs/pkgs/development/libraries/mimetic/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mimetic/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cutee }:
+{ lib, stdenv, fetchurl, cutee }:
 
 stdenv.mkDerivation rec {
   pname = "mimetic";
@@ -11,9 +11,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ cutee ];
 
-  patches = stdenv.lib.optional stdenv.isAarch64 ./narrowing.patch;
+  patches = lib.optional stdenv.isAarch64 ./narrowing.patch;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "MIME handling library";
     homepage    = "http://www.codesink.org/mimetic_mime_library.html";
     license     = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/miniball/default.nix b/nixpkgs/pkgs/development/libraries/miniball/default.nix
index d1804b9bf95f..e48857861d68 100644
--- a/nixpkgs/pkgs/development/libraries/miniball/default.nix
+++ b/nixpkgs/pkgs/development/libraries/miniball/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   pname = "miniball";
@@ -19,8 +19,8 @@ stdenv.mkDerivation {
   meta = {
     description = "Smallest Enclosing Balls of Points";
     homepage = "https://www.inf.ethz.ch/personal/gaertner/miniball.html";
-    license = stdenv.lib.licenses.gpl3;
-    maintainers = [ stdenv.lib.maintainers.erikryb ];
-    platforms = stdenv.lib.platforms.unix;
+    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
index 8938ab90fbc1..93c03b31a8a7 100644
--- a/nixpkgs/pkgs/development/libraries/minixml/default.nix
+++ b/nixpkgs/pkgs/development/libraries/minixml/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "mxml";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A small XML library";
     homepage = "https://www.msweet.org/mxml/";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/minizip/default.nix b/nixpkgs/pkgs/development/libraries/minizip/default.nix
index 5ee1f38ca8b5..bb62a9b3b2ba 100644
--- a/nixpkgs/pkgs/development/libraries/minizip/default.nix
+++ b/nixpkgs/pkgs/development/libraries/minizip/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, zlib, autoreconfHook }:
+{ lib, stdenv, zlib, autoreconfHook }:
 
 stdenv.mkDerivation {
   name = "minizip-${zlib.version}";
@@ -12,6 +12,6 @@ stdenv.mkDerivation {
   meta = {
     description = "Compression library implementing the deflate compression method found in gzip and PKZIP";
     inherit (zlib.meta) license homepage;
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/minizip2/default.nix b/nixpkgs/pkgs/development/libraries/minizip2/default.nix
index 6c6d8b3ef86c..16bb2b8d44e6 100644
--- a/nixpkgs/pkgs/development/libraries/minizip2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/minizip2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkg-config, zlib, bzip2, xz, zstd, openssl }:
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, zlib, bzip2, xz, zstd, openssl }:
 
 stdenv.mkDerivation rec {
   pname = "minizip";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ zlib bzip2 xz zstd openssl ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/mlt/default.nix b/nixpkgs/pkgs/development/libraries/mlt/default.nix
index 1f2915c5071b..633a7325b098 100644
--- a/nixpkgs/pkgs/development/libraries/mlt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mlt/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchFromGitHub, makeWrapper
+{ lib, stdenv, fetchFromGitHub, makeWrapper
 , SDL, ffmpeg, frei0r, libjack2, libdv, libsamplerate, libexif
-, libvorbis, libxml2, movit, pkgconfig, sox, fftw, opencv4, SDL2
+, libvorbis, libxml2, movit, pkg-config, sox, fftw, opencv4, SDL2
 , gtk2, genericUpdater, common-updater-scripts, libebur128
 }:
 
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     SDL ffmpeg frei0r libjack2 libdv libsamplerate libvorbis libxml2
-    makeWrapper movit pkgconfig sox libexif gtk2 fftw libebur128
+    makeWrapper movit pkg-config sox libexif gtk2 fftw libebur128
     opencv4 SDL2
   ];
 
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
     rev-prefix = "v";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Open source multimedia framework, designed for television broadcasting";
     homepage = "https://www.mltframework.org";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/mlt/qt-5.nix b/nixpkgs/pkgs/development/libraries/mlt/qt-5.nix
index 7bcbff78767f..7004a5e11c04 100644
--- a/nixpkgs/pkgs/development/libraries/mlt/qt-5.nix
+++ b/nixpkgs/pkgs/development/libraries/mlt/qt-5.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , SDL
 , ffmpeg
@@ -9,7 +9,7 @@
 , libvorbis
 , libxml2
 , movit
-, pkgconfig
+, pkg-config
 , sox
 , qtbase
 , qtsvg
@@ -23,7 +23,7 @@
 , mkDerivation
 , which
 }:
-let inherit (stdenv.lib) getDev; in
+let inherit (lib) getDev; in
 mkDerivation rec {
   pname = "mlt";
   version = "6.22.1";
@@ -45,7 +45,7 @@ mkDerivation rec {
     libvorbis
     libxml2
     movit
-    pkgconfig
+    pkg-config
     qtbase
     qtsvg
     sox
@@ -75,8 +75,6 @@ mkDerivation rec {
 
   CXXFLAGS = "-std=c++11";
 
-  enableParallelBuilding = true;
-
   qtWrapperArgs = [
     "--prefix FREI0R_PATH : ${frei0r}/lib/frei0r-1"
     "--prefix LADSPA_PATH : ${ladspaPlugins}/lib/ladspa"
@@ -104,7 +102,7 @@ mkDerivation rec {
     rev-prefix = "v";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Open source multimedia framework, designed for television broadcasting";
     homepage = "https://www.mltframework.org/";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/mm-common/default.nix b/nixpkgs/pkgs/development/libraries/mm-common/default.nix
index 3981e05ef067..a43d99503a3f 100644
--- a/nixpkgs/pkgs/development/libraries/mm-common/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mm-common/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , gnome3
 , meson
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   version = "1.0.2";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "07b4s5ckcz9q5gwx8vchim19mhfgl8wysqwi30pndks3m4zrzad2";
   };
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Common build files of GLib/GTK C++ bindings";
     longDescription = ''
       The mm-common module provides the build infrastructure and utilities
diff --git a/nixpkgs/pkgs/development/libraries/mongoc/default.nix b/nixpkgs/pkgs/development/libraries/mongoc/default.nix
index d011419cea7f..e9779cf0a054 100644
--- a/nixpkgs/pkgs/development/libraries/mongoc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mongoc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, perl, pkgconfig, libbson
+{ lib, stdenv, fetchzip, perl, pkg-config, libbson
 , openssl, which, zlib, snappy
 }:
 
@@ -11,13 +11,13 @@ stdenv.mkDerivation rec {
     sha256 = "1vnnk3pwbcmwva1010bl111kdcdx3yb2w7j7a78hhvrm1k9r1wp8";
   };
 
-  nativeBuildInputs = [ pkgconfig which perl ];
+  nativeBuildInputs = [ pkg-config which perl ];
   buildInputs = [ openssl zlib ];
   propagatedBuildInputs = [ libbson snappy ];
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The official C client library for MongoDB";
     homepage = "https://github.com/mongodb/mongo-c-driver";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/mono-addins/default.nix b/nixpkgs/pkgs/development/libraries/mono-addins/default.nix
index d9c1636e59ba..158b39a8186a 100644
--- a/nixpkgs/pkgs/development/libraries/mono-addins/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mono-addins/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, mono4, gtk-sharp-2_0 }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, mono4, gtk-sharp-2_0 }:
 
 stdenv.mkDerivation rec {
   pname = "mono-addins";
@@ -12,14 +12,14 @@ stdenv.mkDerivation rec {
     sha256 = "018g3bd8afjc39h22h2j5r6ldsdn08ynx7wg889gdvnxg3hrxgl2";
   };
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  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 stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.mono-project.com/archived/monoaddins/";
     description = "A generic framework for creating extensible applications";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/motif/default.nix b/nixpkgs/pkgs/development/libraries/motif/default.nix
index f03ba81e8686..0499aaec532d 100644
--- a/nixpkgs/pkgs/development/libraries/motif/default.nix
+++ b/nixpkgs/pkgs/development/libraries/motif/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libtool
+{ lib, stdenv, fetchurl, pkg-config, libtool
 , xlibsWrapper, xbitmaps, libXrender, libXmu, libXt
 , expat, libjpeg, libpng, libiconv
 , flex
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     expat libjpeg libpng libiconv
   ];
 
-  nativeBuildInputs = [ pkgconfig flex ];
+  nativeBuildInputs = [ pkg-config flex ];
 
   propagatedBuildInputs = [ libXp libXau ];
 
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
 
   prePatch = ''
     rm lib/Xm/Xm.h
-  '' + stdenv.lib.optionalString (!demoSupport) ''
+  '' + lib.optionalString (!demoSupport) ''
     sed '/^SUBDIRS =,^$/s/\<demos\>//' -i Makefile.{am,in}
   '';
 
@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
               ./Add-X.Org-to-bindings-file.patch
             ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://motif.ics.com";
     description = "Unix standard widget-toolkit and window-manager";
     platforms = with platforms; linux ++ darwin;
diff --git a/nixpkgs/pkgs/development/libraries/movit/default.nix b/nixpkgs/pkgs/development/libraries/movit/default.nix
index 901d299728fa..9c03a9f6c491 100644
--- a/nixpkgs/pkgs/development/libraries/movit/default.nix
+++ b/nixpkgs/pkgs/development/libraries/movit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, SDL2, eigen, epoxy, fftw, gtest, pkgconfig }:
+{ lib, stdenv, fetchurl, SDL2, eigen, epoxy, fftw, gtest, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "movit";
@@ -15,12 +15,12 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ eigen epoxy ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ SDL2 fftw gtest ];
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "High-performance, high-quality video filters for the GPU";
     homepage = "https://movit.sesse.net";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/mp4v2/default.nix b/nixpkgs/pkgs/development/libraries/mp4v2/default.nix
index 3a036fcf6fbf..7a6bbb552027 100644
--- a/nixpkgs/pkgs/development/libraries/mp4v2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mp4v2/default.nix
@@ -19,6 +19,9 @@ stdenv.mkDerivation rec {
       url = "https://git.archlinux.org/svntogit/packages.git/plain/trunk/libmp4v2-c++11.patch?id=203f5a72bc97ffe089b424c47b07dd9eaea35713";
       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" ];
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
index 88617e9a7409..399c5416d781 100644
--- a/nixpkgs/pkgs/development/libraries/mpfi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mpfi/default.nix
@@ -1,22 +1,22 @@
-{stdenv, fetchurl, mpfr}:
+{lib, stdenv, fetchurl, mpfr}:
 stdenv.mkDerivation rec {
   pname = "mpfi";
-  version = "1.5.3";
+  version = "1.5.4";
   file_nr = "37331";
   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}.tar.bz2";
-    sha256 = "0bqr8yibl7jbrp0bw7xk1lm7nis7rv26jsz6y8ycvih8n9bx90r3";
+    sha256 = "sha256-I4PUV7IIxs088uZracTOR0d7Kg2zH77AzUseuqJHGS8=";
   };
   buildInputs = [mpfr];
   meta = {
     inherit version;
-    description = ''A multiple precision interval arithmetic library based on MPFR'';
+    description = "A multiple precision interval arithmetic library based on MPFR";
     homepage = "https://gforge.inria.fr/projects/mpfi/";
-    license = stdenv.lib.licenses.lgpl21Plus;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.unix;
+    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
index 4a744b7483ea..fc7eeeab9420 100644
--- a/nixpkgs/pkgs/development/libraries/mpfr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mpfr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gmp }:
+{ lib, stdenv, fetchurl, gmp }:
 
 # Note: this package is used for bootstrapping fetchurl, and thus
 # cannot use fetchpatch! All mutable patches (generated by GitHub or
@@ -23,8 +23,8 @@ stdenv.mkDerivation rec {
   propagatedBuildInputs = [ gmp ];
 
   configureFlags =
-    stdenv.lib.optional stdenv.hostPlatform.isSunOS "--disable-thread-safe" ++
-    stdenv.lib.optional stdenv.hostPlatform.is64bit "--with-pic";
+    lib.optional stdenv.hostPlatform.isSunOS "--disable-thread-safe" ++
+    lib.optional stdenv.hostPlatform.is64bit "--with-pic";
 
   doCheck = true; # not cross;
 
@@ -46,9 +46,9 @@ stdenv.mkDerivation rec {
       floating-point arithmetic (53-bit mantissa).
     '';
 
-    license = stdenv.lib.licenses.lgpl2Plus;
+    license = lib.licenses.lgpl2Plus;
 
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/mpich/default.nix b/nixpkgs/pkgs/development/libraries/mpich/default.nix
index 0c1ea8be1c83..f7cdf7f97c02 100644
--- a/nixpkgs/pkgs/development/libraries/mpich/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mpich/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl, gfortran
+{ lib, stdenv, fetchurl, perl, gfortran
 ,  openssh, hwloc
 } :
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation  rec {
     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
   ''
-  + stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  + lib.optionalString (!stdenv.isDarwin) ''
     # /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"
@@ -36,7 +36,7 @@ stdenv.mkDerivation  rec {
     done
     '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Implementation of the Message Passing Interface (MPI) standard";
 
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/mpir/default.nix b/nixpkgs/pkgs/development/libraries/mpir/default.nix
index 8da59530ea5a..7f7df407e4e8 100644
--- a/nixpkgs/pkgs/development/libraries/mpir/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mpir/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, m4, which, yasm }:
+{ lib, stdenv, fetchurl, m4, which, yasm }:
 
 stdenv.mkDerivation rec {
   pname = "mpir";
@@ -15,10 +15,10 @@ stdenv.mkDerivation rec {
 
   meta = {
     inherit version;
-    description = ''A highly optimised library for bignum arithmetic forked from GMP'';
-    license = stdenv.lib.licenses.lgpl3Plus;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.unix;
+    description = "A highly optimised library for bignum arithmetic forked from GMP";
+    license = lib.licenses.lgpl3Plus;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.unix;
     downloadPage = "http://mpir.org/downloads.html";
     homepage = "http://mpir.org/";
     updateWalker = true;
diff --git a/nixpkgs/pkgs/development/libraries/mps/default.nix b/nixpkgs/pkgs/development/libraries/mps/default.nix
index 8c1f3aea4667..81b102d9bc36 100644
--- a/nixpkgs/pkgs/development/libraries/mps/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mps/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, sqlite }:
+{ lib, stdenv, fetchurl, autoreconfHook, sqlite }:
 
 stdenv.mkDerivation rec {
   pname = "mps";
@@ -23,8 +23,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A flexible memory management and garbage collection library";
     homepage    = "https://www.ravenbrook.com/project/mps";
-    license     = stdenv.lib.licenses.sleepycat;
-    platforms   = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.thoughtpolice ];
+    license     = lib.licenses.sleepycat;
+    platforms   = lib.platforms.linux;
+    maintainers = [ lib.maintainers.thoughtpolice ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/msgpack/generic.nix b/nixpkgs/pkgs/development/libraries/msgpack/generic.nix
index 4cb743a38f8f..a784bc026361 100644
--- a/nixpkgs/pkgs/development/libraries/msgpack/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/msgpack/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake
+{ lib, stdenv, cmake
 , version, src, patches ? [ ]
 , ...
 }:
@@ -11,14 +11,9 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ cmake ];
 
-  enableParallelBuilding = true;
+  cmakeFlags = lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) "-DMSGPACK_BUILD_EXAMPLES=OFF";
 
-  cmakeFlags = []
-    ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
-                           "-DMSGPACK_BUILD_EXAMPLES=OFF"
-    ;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "MessagePack implementation for C and C++";
     homepage    = "https://msgpack.org";
     license     = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/msgpuck/default.nix b/nixpkgs/pkgs/development/libraries/msgpuck/default.nix
index 26066f1194f0..53fb3bec908c 100644
--- a/nixpkgs/pkgs/development/libraries/msgpuck/default.nix
+++ b/nixpkgs/pkgs/development/libraries/msgpuck/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig }:
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "msgpuck";
@@ -13,10 +13,10 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
-  meta = with stdenv.lib; {
-     description = ''A simple and efficient MsgPack binary serialization library in a self-contained header file'';
+  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.linux;
diff --git a/nixpkgs/pkgs/development/libraries/msilbc/default.nix b/nixpkgs/pkgs/development/libraries/msilbc/default.nix
index 601e70427a13..cdcc0548abbc 100644
--- a/nixpkgs/pkgs/development/libraries/msilbc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/msilbc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ilbc, mediastreamer, pkgconfig }:
+{ lib, stdenv, fetchurl, ilbc, mediastreamer, pkg-config }:
 
 stdenv.mkDerivation rec {
   name = "msilbc-2.1.2";
@@ -9,14 +9,14 @@ stdenv.mkDerivation rec {
   };
 
   propagatedBuildInputs = [ ilbc mediastreamer ];
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   configureFlags = [
     "ILBC_LIBS=ilbc" "ILBC_CFLAGS=-I${ilbc}/include"
     "MEDIASTREAMER_LIBS=mediastreamer" "MEDIASTREAMER_CFLAGS=-I${mediastreamer}/include"
   ];
 
-  meta = with stdenv.lib; {
+  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
index 5c04c6a69428..7873608e5891 100644
--- a/nixpkgs/pkgs/development/libraries/mtdev/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mtdev/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "mtdev-1.1.6";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1q700h9dqcm3zl6c3gj0qxxjcx6ibw2c51wjijydhwdcm26v5mqm";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://bitmath.org/code/mtdev/";
     description = "Multitouch Protocol Translation Library";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/mtxclient/default.nix b/nixpkgs/pkgs/development/libraries/mtxclient/default.nix
index 842d144005d7..d1834de55588 100644
--- a/nixpkgs/pkgs/development/libraries/mtxclient/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mtxclient/default.nix
@@ -1,12 +1,10 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 , cmake
-, pkgconfig
+, pkg-config
 , boost17x
 , openssl
-, zlib
-, libsodium
 , olm
 , spdlog
 , nlohmann_json
@@ -14,13 +12,13 @@
 
 stdenv.mkDerivation rec {
   pname = "mtxclient";
-  version = "0.3.1";
+  version = "0.4.0";
 
   src = fetchFromGitHub {
     owner = "Nheko-Reborn";
     repo = "mtxclient";
     rev = "v${version}";
-    sha256 = "1dg4dq20g0ah62j5s3gpsxqq4ny7lxkxdxa9q6g54hdwkrb9ms7x";
+    sha256 = "1x820rcfz5r203dc8a0rzavcjjx10fsv1dicqg65m6kxx1w95j5r";
   };
 
   cmakeFlags = [
@@ -36,22 +34,20 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     cmake
-    pkgconfig
+    pkg-config
   ];
   buildInputs = [
     spdlog
     boost17x
     openssl
-    zlib
-    libsodium
     olm
   ];
 
-  meta = with stdenv.lib; {
+  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 ];
+    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
diff --git a/nixpkgs/pkgs/development/libraries/multipart-parser-c/default.nix b/nixpkgs/pkgs/development/libraries/multipart-parser-c/default.nix
index b2bdf5d04476..45b0abdee71b 100644
--- a/nixpkgs/pkgs/development/libraries/multipart-parser-c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/multipart-parser-c/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 }:
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Http multipart parser implemented in C ";
     homepage = "https://github.com/iafonov/multipart-parser-c";
-    license = [ stdenv.lib.licenses.mit ];
+    license = [ lib.licenses.mit ];
   };
 
 }
diff --git a/nixpkgs/pkgs/development/libraries/mumlib/default.nix b/nixpkgs/pkgs/development/libraries/mumlib/default.nix
index f936fc8b3df6..02f0cd671f28 100644
--- a/nixpkgs/pkgs/development/libraries/mumlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mumlib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig
+{ stdenv, lib, fetchFromGitHub, cmake, pkg-config
 , boost, openssl, log4cpp, libopus, protobuf }:
 with lib; stdenv.mkDerivation {
   pname = "mumlib";
@@ -12,7 +12,7 @@ with lib; stdenv.mkDerivation {
   };
 
   buildInputs = [ boost openssl libopus protobuf log4cpp ];
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
   installPhase = ''
     install -Dm555 libmumlib.so $out/lib/libmumlib.so
     cp -a ../include $out
diff --git a/nixpkgs/pkgs/development/libraries/muparser/default.nix b/nixpkgs/pkgs/development/libraries/muparser/default.nix
index 8aac20e19d0f..85c9f781cc60 100644
--- a/nixpkgs/pkgs/development/libraries/muparser/default.nix
+++ b/nixpkgs/pkgs/development/libraries/muparser/default.nix
@@ -1,9 +1,9 @@
-{stdenv, fetchurl, unzip, setfile}:
+{lib, stdenv, fetchurl, unzip, setfile}:
 
 stdenv.mkDerivation rec {
   pname = "muparser";
   version = "2.2.3";
-  url-version = stdenv.lib.replaceChars ["."] ["_"] version;
+  url-version = lib.replaceChars ["."] ["_"] version;
 
   src = fetchurl {
     url = "mirror://sourceforge/muparser/muparser_v${url-version}.zip";
@@ -12,12 +12,12 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     unzip
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [setfile];
+  ] ++ lib.optionals stdenv.isDarwin [setfile];
 
   meta = {
     homepage = "http://muparser.sourceforge.net";
     description = "An extensible high performance math expression parser library written in C++";
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    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
index d7de5ff00f3f..ef6b254b8a37 100644
--- a/nixpkgs/pkgs/development/libraries/muparserx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/muparserx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 }:
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
     fi
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/mutest/default.nix b/nixpkgs/pkgs/development/libraries/mutest/default.nix
index ae40ab9f8953..9470b812586a 100644
--- a/nixpkgs/pkgs/development/libraries/mutest/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mutest/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , meson
 , ninja
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/mygui/default.nix b/nixpkgs/pkgs/development/libraries/mygui/default.nix
index 894d35eb3d8a..4260e30561b4 100644
--- a/nixpkgs/pkgs/development/libraries/mygui/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mygui/default.nix
@@ -1,5 +1,5 @@
-{  stdenv, fetchFromGitHub, libX11, unzip, cmake, ois, freetype, libuuid,
-   boost, pkgconfig, withOgre ? false, ogre ? null, libGL, libGLU ? null } :
+{  lib, stdenv, fetchFromGitHub, libX11, unzip, cmake, ois, freetype, libuuid,
+   boost, pkg-config, withOgre ? false, ogre ? null, libGL, libGLU ? null } :
 
 let
   renderSystem = if withOgre then "3" else "4";
@@ -14,16 +14,14 @@ in stdenv.mkDerivation rec {
     sha256 = "0a4zi8w18pjj813n7kmxldl1d9r1jp0iyhkw7pbqgl8f7qaq994w";
   };
 
-  enableParallelBuilding = true;
-
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ libX11 unzip cmake ois freetype libuuid boost ]
-    ++ (if withOgre then [ ogre ] else [libGL libGLU]);
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = [ libX11 unzip 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 stdenv.lib; {
+  meta = with lib; {
     homepage = "http://mygui.info/";
     description = "Library for creating GUIs for games and 3D applications";
     license = licenses.lgpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/mypaint-brushes/1.0.nix b/nixpkgs/pkgs/development/libraries/mypaint-brushes/1.0.nix
index 570588e22fb7..73acfd9287f7 100644
--- a/nixpkgs/pkgs/development/libraries/mypaint-brushes/1.0.nix
+++ b/nixpkgs/pkgs/development/libraries/mypaint-brushes/1.0.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , autoconf
 , automake
 , fetchFromGitHub
-, pkgconfig
+, pkg-config
 }:
 
 stdenv.mkDerivation rec {
@@ -19,12 +19,12 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     autoconf
     automake
-    pkgconfig
+    pkg-config
   ];
 
   preConfigure = "./autogen.sh";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://mypaint.org/";
     description = "Brushes used by MyPaint and other software using libmypaint";
     license = licenses.cc0;
diff --git a/nixpkgs/pkgs/development/libraries/mypaint-brushes/default.nix b/nixpkgs/pkgs/development/libraries/mypaint-brushes/default.nix
index d2fb8ed143a0..acdee52b85ef 100644
--- a/nixpkgs/pkgs/development/libraries/mypaint-brushes/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mypaint-brushes/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , autoconf
 , automake
 , fetchFromGitHub
-, pkgconfig
+, pkg-config
 }:
 
 stdenv.mkDerivation rec {
@@ -19,12 +19,12 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     autoconf
     automake
-    pkgconfig
+    pkg-config
   ];
 
   preConfigure = "./autogen.sh";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://mypaint.org/";
     description = "Brushes used by MyPaint and other software using libmypaint";
     license = licenses.cc0;
diff --git a/nixpkgs/pkgs/development/libraries/mysocketw/default.nix b/nixpkgs/pkgs/development/libraries/mysocketw/default.nix
index 1e2e3982d55d..3b5da68a59d7 100644
--- a/nixpkgs/pkgs/development/libraries/mysocketw/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mysocketw/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, openssl }:
+{ lib, stdenv, fetchurl, openssl }:
 
 stdenv.mkDerivation {
   name = "mysocketw-031026";
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
 
   buildInputs = [ openssl ];
 
-  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace src/Makefile \
         --replace -Wl,-soname, -Wl,-install_name,$out/lib/
   '';
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
 
   meta = {
     description = "Cross platform (Linux/FreeBSD/Unix/Win32) streaming socket C++";
-    license = stdenv.lib.licenses.lgpl21Plus;
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.lgpl21Plus;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/mythes/default.nix b/nixpkgs/pkgs/development/libraries/mythes/default.nix
index 1cd8612c3bb0..b678baf98819 100644
--- a/nixpkgs/pkgs/development/libraries/mythes/default.nix
+++ b/nixpkgs/pkgs/development/libraries/mythes/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, hunspell, ncurses, pkgconfig, perl }:
+{ lib, stdenv, fetchurl, hunspell, ncurses, pkg-config, perl }:
 
 stdenv.mkDerivation rec {
   name = "mythes-1.2.4";
@@ -9,12 +9,12 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ hunspell ];
-  nativeBuildInputs = [ ncurses pkgconfig perl ];
+  nativeBuildInputs = [ ncurses pkg-config perl ];
 
   meta = {
     homepage = "http://hunspell.sourceforge.net/";
     description = "Thesaurus library from Hunspell project";
-    license = stdenv.lib.licenses.bsd3;
+    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
index 3bd6bb02a054..0dbbd461dc21 100644
--- a/nixpkgs/pkgs/development/libraries/nanoflann/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nanoflann/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchFromGitHub, cmake}:
+{lib, stdenv, fetchFromGitHub, cmake}:
 
 stdenv.mkDerivation rec {
   version = "1.3.2";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0lq1zqwjvk8wv15hd7aw57jsqbvv45cwb8ngdh1d2iyw5rvnbhsn";
   };
 
-  buildInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   cmakeFlags = [
     "-DBUILD_EXAMPLES=OFF"
@@ -22,8 +22,8 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage = "https://github.com/jlblancoc/nanoflann";
-    license = stdenv.lib.licenses.bsd2;
+    license = lib.licenses.bsd2;
     description = "Header only C++ library for approximate nearest neighbor search";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/nanomsg/default.nix b/nixpkgs/pkgs/development/libraries/nanomsg/default.nix
index 5772581d5ec1..49a93abd7fb0 100644
--- a/nixpkgs/pkgs/development/libraries/nanomsg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nanomsg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, fetchFromGitHub }:
+{ lib, stdenv, cmake, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   version = "1.1.5";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description= "Socket library that provides several common communication patterns";
     homepage = "https://nanomsg.org/";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/nco/default.nix b/nixpkgs/pkgs/development/libraries/nco/default.nix
index 5f6c85411b18..e8053ce27023 100644
--- a/nixpkgs/pkgs/development/libraries/nco/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nco/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchzip, netcdf, netcdfcxx4, gsl, udunits, antlr, which, curl, flex, coreutils }:
+{ lib, stdenv, fetchzip, netcdf, netcdfcxx4, gsl, udunits, antlr, which, curl, flex, coreutils }:
 
 stdenv.mkDerivation rec {
-  version = "4.9.6";
+  version = "4.9.7";
   pname = "nco";
 
   nativeBuildInputs = [ flex which ];
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
 
   src = fetchzip {
     url = "https://github.com/nco/nco/archive/${version}.tar.gz";
-    sha256 = "0f8vf66700dcr48jqd371bbldc61xkrilby13xp8j5l9q4xal808";
+    sha256 = "sha256-Q4okOoyodofAsMrSmAhFISeY05Be+i7OX4qy2annQq4=";
   };
 
   prePatch = ''
@@ -23,8 +23,8 @@ stdenv.mkDerivation rec {
     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 = stdenv.lib.licenses.gpl3;
-    maintainers = [ stdenv.lib.maintainers.bzizou ];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.gpl3;
+    maintainers = [ lib.maintainers.bzizou ];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/ncurses/default.nix b/nixpkgs/pkgs/development/libraries/ncurses/default.nix
index 17a924e6e74c..742de6cf92e7 100644
--- a/nixpkgs/pkgs/development/libraries/ncurses/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ncurses/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, pkgconfig
+{ lib, stdenv, fetchurl, pkg-config
 
 , abiVersion ? "6"
 , mouseSupport ? false
@@ -52,7 +52,7 @@ stdenv.mkDerivation rec {
 
   depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
   ] ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
     buildPackages.ncurses
   ];
diff --git a/nixpkgs/pkgs/development/libraries/ndi/default.nix b/nixpkgs/pkgs/development/libraries/ndi/default.nix
index c0e1816c0e12..75d2a2db0218 100644
--- a/nixpkgs/pkgs/development/libraries/ndi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ndi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, requireFile, avahi }:
+{ lib, stdenv, requireFile, avahi }:
 
 stdenv.mkDerivation rec {
   pname = "ndi";
@@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
   # Stripping breaks ndi-record.
   dontStrip = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://ndi.tv/sdk/";
     description = "NDI Software Developer Kit";
     platforms = ["x86_64-linux"];
diff --git a/nixpkgs/pkgs/development/libraries/ndn-cxx/default.nix b/nixpkgs/pkgs/development/libraries/ndn-cxx/default.nix
index 893f82a6d526..f2510d6f6bbe 100644
--- a/nixpkgs/pkgs/development/libraries/ndn-cxx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ndn-cxx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , doxygen
 , pkg-config
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     "--boost-libs=${boost.out}/lib"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://named-data.net/";
     description = "A Named Data Neworking (NDN) or Content Centric Networking (CCN) abstraction";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/ndpi/default.nix b/nixpkgs/pkgs/development/libraries/ndpi/default.nix
index 43da97c2edd8..c3df23052e22 100644
--- a/nixpkgs/pkgs/development/libraries/ndpi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ndpi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, which, autoconf, automake, libtool, libpcap
+{ lib, stdenv, fetchFromGitHub, which, autoconf, automake, libtool, libpcap
 , pkg-config }:
 
 let version = "3.4"; in
@@ -22,7 +22,7 @@ stdenv.mkDerivation {
     pkg-config
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library for deep-packet inspection";
     longDescription = ''
       nDPI is a library for deep-packet inspection based on OpenDPI.
diff --git a/nixpkgs/pkgs/development/libraries/neardal/default.nix b/nixpkgs/pkgs/development/libraries/neardal/default.nix
index 6f0dbf032a9a..5e02a9fd5222 100644
--- a/nixpkgs/pkgs/development/libraries/neardal/default.nix
+++ b/nixpkgs/pkgs/development/libraries/neardal/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoconf, automake, libtool, pkgconfig, glib, readline, makeWrapper }:
+{ lib, stdenv, fetchFromGitHub, autoconf, automake, libtool, pkg-config, glib, readline, makeWrapper }:
 
 stdenv.mkDerivation {
   name = "neardal-0.7-post-git-20150930";
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
     sha256 = "12qwg7qiw2wfpaxfg2fjkmj5lls0g33xp6w433g8bnkvwlq4s29g";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ autoconf automake libtool glib readline makeWrapper ];
 
   preConfigure = ''
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
 
   configureFlags = [ "--disable-dependency-tracking" "--disable-traces" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C APIs to exchange datas with the NFC daemon 'Neard'";
     license = licenses.lgpl2;
     homepage = "https://01.org/linux-nfc";
diff --git a/nixpkgs/pkgs/development/libraries/neatvnc/default.nix b/nixpkgs/pkgs/development/libraries/neatvnc/default.nix
index db7940536f1b..980424b7fd48 100644
--- a/nixpkgs/pkgs/development/libraries/neatvnc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/neatvnc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, meson, pkg-config, ninja
+{ lib, stdenv, fetchFromGitHub, meson, pkg-config, ninja
 , pixman, gnutls, libdrm, libjpeg_turbo, zlib, aml
 }:
 
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ meson pkg-config ninja ];
   buildInputs = [ pixman gnutls libdrm libjpeg_turbo zlib aml ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A VNC server library";
     longDescription = ''
       This is a liberally licensed VNC server library that's intended to be
diff --git a/nixpkgs/pkgs/development/libraries/neon/0.29.nix b/nixpkgs/pkgs/development/libraries/neon/0.29.nix
index c60f5e60fb8f..e0437fb7cea1 100644
--- a/nixpkgs/pkgs/development/libraries/neon/0.29.nix
+++ b/nixpkgs/pkgs/development/libraries/neon/0.29.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libxml2, pkgconfig, perl
+{ lib, stdenv, fetchurl, libxml2, pkg-config, perl
 , compressionSupport ? true, zlib ? null
 , sslSupport ? true, openssl ? null
 , static ? false
@@ -10,7 +10,7 @@ assert sslSupport -> openssl != null;
 assert static || shared;
 
 let
-   inherit (stdenv.lib) optionals;
+   inherit (lib) optionals;
 in
 
 stdenv.mkDerivation rec {
@@ -24,15 +24,15 @@ stdenv.mkDerivation rec {
 
   patches = optionals stdenv.isDarwin [ ./0.29.6-darwin-fix-configure.patch ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [libxml2 openssl]
-    ++ stdenv.lib.optional compressionSupport zlib;
+    ++ lib.optional compressionSupport zlib;
 
   configureFlags = [
-    (stdenv.lib.enableFeature shared "shared")
-    (stdenv.lib.enableFeature static "static")
-    (stdenv.lib.withFeature compressionSupport "zlib")
-    (stdenv.lib.withFeature sslSupport "ssl")
+    (lib.enableFeature shared "shared")
+    (lib.enableFeature static "static")
+    (lib.withFeature compressionSupport "zlib")
+    (lib.withFeature sslSupport "ssl")
   ];
 
   passthru = {inherit compressionSupport sslSupport;};
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
   checkInputs = [ perl ];
   doCheck = false; # fails, needs the net
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An HTTP and WebDAV client library";
     homepage = "http://www.webdav.org/neon/";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/neon/default.nix b/nixpkgs/pkgs/development/libraries/neon/default.nix
index e9ce6ee18b4f..c0c62deb0ace 100644
--- a/nixpkgs/pkgs/development/libraries/neon/default.nix
+++ b/nixpkgs/pkgs/development/libraries/neon/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libxml2, pkgconfig, perl
+{ lib, stdenv, fetchurl, libxml2, pkg-config, perl
 , compressionSupport ? true, zlib ? null
 , sslSupport ? true, openssl ? null
 , static ? stdenv.hostPlatform.isStatic
@@ -10,7 +10,7 @@ assert sslSupport -> openssl != null;
 assert static || shared;
 
 let
-   inherit (stdenv.lib) optionals;
+   inherit (lib) optionals;
 in
 
 stdenv.mkDerivation rec {
@@ -24,15 +24,15 @@ stdenv.mkDerivation rec {
 
   patches = optionals stdenv.isDarwin [ ./0.29.6-darwin-fix-configure.patch ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [libxml2 openssl]
-    ++ stdenv.lib.optional compressionSupport zlib;
+    ++ lib.optional compressionSupport zlib;
 
   configureFlags = [
-    (stdenv.lib.enableFeature shared "shared")
-    (stdenv.lib.enableFeature static "static")
-    (stdenv.lib.withFeature compressionSupport "zlib")
-    (stdenv.lib.withFeature sslSupport "ssl")
+    (lib.enableFeature shared "shared")
+    (lib.enableFeature static "static")
+    (lib.withFeature compressionSupport "zlib")
+    (lib.withFeature sslSupport "ssl")
   ];
 
   passthru = {inherit compressionSupport sslSupport;};
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
   checkInputs = [ perl ];
   doCheck = false; # fails, needs the net
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An HTTP and WebDAV client library";
     homepage = "http://www.webdav.org/neon/";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/netcdf-cxx4/default.nix b/nixpkgs/pkgs/development/libraries/netcdf-cxx4/default.nix
index 526e02e89079..b594a672140f 100644
--- a/nixpkgs/pkgs/development/libraries/netcdf-cxx4/default.nix
+++ b/nixpkgs/pkgs/development/libraries/netcdf-cxx4/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, netcdf, hdf5, curl }:
+{ lib, stdenv, fetchurl, netcdf, hdf5, curl }:
 stdenv.mkDerivation rec {
   pname = "netcdf-cxx4";
   version = "4.3.0";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "C++ API to manipulate netcdf files";
     homepage = "https://www.unidata.ucar.edu/software/netcdf/";
-    license = stdenv.lib.licenses.free;
-    platforms = stdenv.lib.platforms.unix;
+    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
index ab10c6861635..0cdeda238792 100644
--- a/nixpkgs/pkgs/development/libraries/netcdf-fortran/default.nix
+++ b/nixpkgs/pkgs/development/libraries/netcdf-fortran/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, netcdf, hdf5, curl, gfortran }:
+{ lib, stdenv, fetchurl, netcdf, hdf5, curl, gfortran }:
 stdenv.mkDerivation rec {
   pname = "netcdf-fortran";
   version = "4.4.5";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ netcdf hdf5 curl gfortran ];
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Fortran API to manipulate netcdf files";
     homepage = "https://www.unidata.ucar.edu/software/netcdf/";
     license = licenses.free;
diff --git a/nixpkgs/pkgs/development/libraries/netcdf/default.nix b/nixpkgs/pkgs/development/libraries/netcdf/default.nix
index fecc4100f5e6..c345f66e872a 100644
--- a/nixpkgs/pkgs/development/libraries/netcdf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/netcdf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , hdf5
 , m4
@@ -41,7 +41,7 @@ in stdenv.mkDerivation rec {
       "--enable-shared"
       "--disable-dap-remote-tests"
   ]
-  ++ (stdenv.lib.optionals mpiSupport [ "--enable-parallel-tests" "CC=${mpi}/bin/mpicc" ]);
+  ++ (lib.optionals mpiSupport [ "--enable-parallel-tests" "CC=${mpi}/bin/mpicc" ]);
 
   disallowedReferences = [ stdenv.cc ];
 
@@ -53,7 +53,7 @@ in stdenv.mkDerivation rec {
 
   meta = {
       description = "Libraries for the Unidata network Common Data Format";
-      platforms = stdenv.lib.platforms.unix;
+      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/generic.nix b/nixpkgs/pkgs/development/libraries/nettle/generic.nix
index 4c3c6d04ca88..735fe373533d 100644
--- a/nixpkgs/pkgs/development/libraries/nettle/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/nettle/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv, buildPackages, gmp, gnum4
+{ lib, stdenv, buildPackages, gmp, gnum4
 
 # Version specific args
 , version, src
@@ -22,10 +22,10 @@ stdenv.mkDerivation ({
 
   enableParallelBuilding = true;
 
-  patches = stdenv.lib.optional (stdenv.hostPlatform.system == "i686-cygwin")
+  patches = lib.optional (stdenv.hostPlatform.system == "i686-cygwin")
               ./cygwin.patch;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Cryptographic library";
 
     longDescription = ''
@@ -61,7 +61,7 @@ stdenv.mkDerivation ({
 
 //
 
-stdenv.lib.optionalAttrs stdenv.isSunOS {
+lib.optionalAttrs stdenv.isSunOS {
   # 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>
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
index 41d9671b204e..dc6b604bd8e2 100644
--- a/nixpkgs/pkgs/development/libraries/newt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/newt/default.nix
@@ -31,11 +31,11 @@ stdenv.mkDerivation rec {
     unset CPP
   '';
 
-  makeFlags = stdenv.lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
+  makeFlags = lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [
     "CROSS_COMPILE=${stdenv.cc.targetPrefix}"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://fedorahosted.org/newt/";
     description = "Library for color text mode, widget based user interfaces";
 
diff --git a/nixpkgs/pkgs/development/libraries/nghttp2/default.nix b/nixpkgs/pkgs/development/libraries/nghttp2/default.nix
index c9ccf63f8895..6464679b9489 100644
--- a/nixpkgs/pkgs/development/libraries/nghttp2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nghttp2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig
+{ lib, stdenv, fetchurl, pkg-config
 
 # Optional Dependencies
 , openssl ? null, zlib ? null
@@ -8,7 +8,7 @@
 , enableAsioLib ? false, boost ? null
 , enableGetAssets ? false, libxml2 ? null
 , enableJemalloc ? false, jemalloc ? null
-, enableApp ? !stdenv.hostPlatform.isWindows
+, enableApp ? with stdenv.hostPlatform; !isWindows && !isStatic
 , enablePython ? false, python ? null, cython ? null, ncurses ? null, setuptools ? null
 }:
 
@@ -23,7 +23,7 @@ assert enableGetAssets -> libxml2 != null;
 assert enableJemalloc -> jemalloc != null;
 assert enablePython -> python != null && cython != null && ncurses != null && setuptools != null;
 
-let inherit (stdenv.lib) optional optionals optionalString; in
+let inherit (lib) optional optionals optionalString; in
 
 stdenv.mkDerivation rec {
   pname = "nghttp2";
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
   outputs = [ "bin" "out" "dev" "lib" ]
     ++ optional enablePython "python";
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ openssl ]
     ++ optional enableLibEv libev
     ++ [ zlib ]
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--with-spdylay=no"
     "--disable-examples"
-    (stdenv.lib.enableFeature enableApp "app")
+    (lib.enableFeature enableApp "app")
   ] ++ optional enableAsioLib "--enable-asio-lib --with-boost-libdir=${boost}/lib"
     ++ (if enablePython then [
     "--with-cython=${cython}/bin/cython"
@@ -73,7 +73,7 @@ stdenv.mkDerivation rec {
 
   #doCheck = true;  # requires CUnit ; currently failing at test_util_localtime_date in util_test.cc
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://nghttp2.org/";
     description = "A C implementation of HTTP/2";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/ngt/default.nix b/nixpkgs/pkgs/development/libraries/ngt/default.nix
index 977bdf9afe37..385f2d84f8a6 100644
--- a/nixpkgs/pkgs/development/libraries/ngt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ngt/default.nix
@@ -1,8 +1,13 @@
-{ stdenv, fetchFromGitHub, cmake, llvmPackages, enableAVX ? false }:
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, llvmPackages
+, enableAVX ? stdenv.hostPlatform.avxSupport
+}:
+
 stdenv.mkDerivation rec {
   pname = "NGT";
   version = "v1.12.3-alpha";
-  nativeBuildInputs = [ cmake ];
 
   src = fetchFromGitHub {
     owner = "yahoojapan";
@@ -11,13 +16,13 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-nu0MJNpaenOB4+evoSVLKmPIuZXVj1Rm9x53+TfhezY=";
   };
 
+  nativeBuildInputs = [ cmake ];
   buildInputs = [ llvmPackages.openmp ];
-  NIX_ENFORCE_NO_NATIVE=! enableAVX;
-  __AVX2__ = if enableAVX then 1 else 0;
 
-  enableParallelBuilding = true;
+  NIX_ENFORCE_NO_NATIVE = ! enableAVX;
+  __AVX2__ = if enableAVX then 1 else 0;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/nix-plugins/default.nix b/nixpkgs/pkgs/development/libraries/nix-plugins/default.nix
index f7a608d5c0a9..915e733473e1 100644
--- a/nixpkgs/pkgs/development/libraries/nix-plugins/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nix-plugins/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, nix, cmake, pkgconfig, boost }:
+{ lib, stdenv, fetchFromGitHub, nix, cmake, pkg-config, boost }:
 let version = "6.0.0"; in
 stdenv.mkDerivation {
   pname = "nix-plugins";
@@ -11,14 +11,14 @@ stdenv.mkDerivation {
     sha256 = "08kxdci0sijj1hfkn3dbr7nbpb9xck0xr3xa3a0j116n4kvwb6qv";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  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 = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.all;
+    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
index 84b86b47157d..742135345328 100644
--- a/nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nlohmann_json/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake
+{ lib, stdenv, fetchFromGitHub, cmake
 }:
 
 stdenv.mkDerivation rec {
@@ -14,8 +14,6 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  enableParallelBuilding = true;
-
   cmakeFlags = [
     "-DBuildTests=${if doCheck then "ON" else "OFF"}"
     "-DJSON_MultipleHeaders=ON"
@@ -27,7 +25,7 @@ stdenv.mkDerivation rec {
 
   postInstall = "rm -rf $out/lib64";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Header only C++ library for the JSON file format";
     homepage = "https://github.com/nlohmann/json";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/nlopt/default.nix b/nixpkgs/pkgs/development/libraries/nlopt/default.nix
index 64eb6d79abd1..36fcf9081182 100644
--- a/nixpkgs/pkgs/development/libraries/nlopt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nlopt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, octave ? null }:
+{ lib, stdenv, fetchFromGitHub, cmake, octave ? null }:
 
 stdenv.mkDerivation rec {
   pname = "nlopt";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     "--without-guile"
     "--without-python"
     "--without-matlab"
-  ] ++ stdenv.lib.optionals (octave != null) [
+  ] ++ lib.optionals (octave != null) [
     "--with-octave"
     "M_INSTALL_DIR=$(out)/${octave.sitePath}/m"
     "OCT_INSTALL_DIR=$(out)/${octave.sitePath}/oct"
@@ -30,8 +30,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://nlopt.readthedocs.io/en/latest/";
     description = "Free open-source library for nonlinear optimization";
-    license = stdenv.lib.licenses.lgpl21Plus;
-    hydraPlatforms = stdenv.lib.platforms.linux;
+    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
index 189e36c1b448..7b9bffb9bc95 100644
--- a/nixpkgs/pkgs/development/libraries/notcurses/default.nix
+++ b/nixpkgs/pkgs/development/libraries/notcurses/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, pkgconfig, pandoc, libunistring, ncurses, ffmpeg,
+{ stdenv, cmake, pkg-config, pandoc, libunistring, ncurses, ffmpeg,
   fetchFromGitHub, lib,
   multimediaSupport ? true
 }:
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ cmake pkgconfig pandoc ];
+  nativeBuildInputs = [ cmake pkg-config pandoc ];
 
   buildInputs = [ libunistring ncurses ]
     ++ lib.optional multimediaSupport ffmpeg;
diff --git a/nixpkgs/pkgs/development/libraries/notify-sharp/default.nix b/nixpkgs/pkgs/development/libraries/notify-sharp/default.nix
index 58d35767d1e0..1cd69074911b 100644
--- a/nixpkgs/pkgs/development/libraries/notify-sharp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/notify-sharp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, pkgconfig, autoreconfHook
+{ lib, stdenv, fetchFromGitLab, pkg-config, autoreconfHook
 , mono, gtk-sharp-3_0, dbus-sharp-1_0, dbus-sharp-glib-1_0 }:
 
 stdenv.mkDerivation rec {
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [
-    pkgconfig autoreconfHook
+    pkg-config autoreconfHook
   ];
 
   buildInputs = [
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     sed -i 's#^[ \t]*DOCDIR=.*$#DOCDIR=$out/lib/monodoc#' ./configure.ac
   '';
 
-  meta = with stdenv.lib; {
+  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
index c3ef724501e2..6611f99bdfc2 100644
--- a/nixpkgs/pkgs/development/libraries/npapi-sdk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/npapi-sdk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "npapi-sdk";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0xxfcsjmmgbbyl9zwpzdshbx27grj5fnzjfmldmm9apws2yk9gq1";
   };
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/npth/default.nix b/nixpkgs/pkgs/development/libraries/npth/default.nix
index 51512a160570..a5ac9ce99127 100644
--- a/nixpkgs/pkgs/development/libraries/npth/default.nix
+++ b/nixpkgs/pkgs/development/libraries/npth/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "npth-1.6";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/nspr/default.nix b/nixpkgs/pkgs/development/libraries/nspr/default.nix
index e8893bc2040d..17b8b9226d50 100644
--- a/nixpkgs/pkgs/development/libraries/nspr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nspr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , CoreServices ? null
 , buildPackages }:
 
@@ -22,7 +22,7 @@ stdenv.mkDerivation {
 
   preConfigure = ''
     cd nspr
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     substituteInPlace configure --replace '@executable_path/' "$out/lib/"
     substituteInPlace configure.in --replace '@executable_path/' "$out/lib/"
   '';
@@ -32,18 +32,18 @@ stdenv.mkDerivation {
   configureFlags = [
     "--enable-optimize"
     "--disable-debug"
-  ] ++ stdenv.lib.optional stdenv.is64bit "--enable-64bit";
+  ] ++ lib.optional stdenv.is64bit "--enable-64bit";
 
   postInstall = ''
     find $out -name "*.a" -delete
     moveToOutput share "$dev" # just aclocal
   '';
 
-  buildInputs = [] ++ stdenv.lib.optionals stdenv.isDarwin [ CoreServices ];
+  buildInputs = [] ++ lib.optionals stdenv.isDarwin [ CoreServices ];
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.mozilla.org/projects/nspr/";
     description = "Netscape Portable Runtime, a platform-neutral API for system-level and libc-like functions";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/nss/3.44.nix b/nixpkgs/pkgs/development/libraries/nss/3.44.nix
index 1c89dd793316..b08b8b3ed2a7 100644
--- a/nixpkgs/pkgs/development/libraries/nss/3.44.nix
+++ b/nixpkgs/pkgs/development/libraries/nss/3.44.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, nspr, perl, zlib, sqlite, fixDarwinDylibNames, buildPackages }:
+{ lib, stdenv, fetchurl, nspr, perl, zlib, sqlite, fixDarwinDylibNames, buildPackages }:
 
 let
   nssPEM = fetchurl {
@@ -20,7 +20,7 @@ in stdenv.mkDerivation rec {
   depsBuildBuild = [ buildPackages.stdenv.cc ];
 
   nativeBuildInputs = [ perl ]
-    ++ stdenv.lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
+    ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames;
 
   buildInputs = [ zlib sqlite ];
 
@@ -39,7 +39,7 @@ in stdenv.mkDerivation rec {
 
   patchFlags = [ "-p0" ];
 
-  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace nss/coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)"
   '';
 
@@ -61,16 +61,16 @@ in stdenv.mkDerivation rec {
     "USE_SYSTEM_ZLIB=1"
     "NSS_USE_SYSTEM_SQLITE=1"
     "NATIVE_CC=${buildPackages.stdenv.cc}/bin/cc"
-  ] ++ stdenv.lib.optionals (!stdenv.isDarwin) [
+  ] ++ lib.optionals (!stdenv.isDarwin) [
     # Pass in CPU even if we're not cross compiling, because otherwise it tries to guess with
     # uname, which can be wrong if e.g. we're compiling for aarch32 on aarch64
     "OS_TEST=${cpu}"
     "CPU_ARCH=${cpu}"
-  ] ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
+  ] ++ lib.optional (stdenv.hostPlatform != stdenv.buildPlatform) [
     "CROSS_COMPILE=1"
     "NSS_DISABLE_GTESTS=1" # don't want to build tests when cross-compiling
-  ] ++ stdenv.lib.optional stdenv.is64bit "USE_64=1"
-    ++ stdenv.lib.optional stdenv.isDarwin "CCC=clang++";
+  ] ++ lib.optional stdenv.is64bit "USE_64=1"
+    ++ lib.optional stdenv.isDarwin "CCC=clang++";
 
   NIX_CFLAGS_COMPILE = "-Wno-error";
 
@@ -135,7 +135,7 @@ in stdenv.mkDerivation rec {
     rm -f "$out"/lib/*.a
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://developer.mozilla.org/en-US/docs/NSS";
     description = "A set of libraries for development of security-enabled client and server applications";
     license = licenses.mpl20;
diff --git a/nixpkgs/pkgs/development/libraries/nss/3.53.nix b/nixpkgs/pkgs/development/libraries/nss/3.53.nix
index dcd9ade629b7..9f281743f6cf 100644
--- a/nixpkgs/pkgs/development/libraries/nss/3.53.nix
+++ b/nixpkgs/pkgs/development/libraries/nss/3.53.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, nspr, perl, zlib, sqlite, darwin, fixDarwinDylibNames, buildPackages, ninja
+{ 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
@@ -24,7 +24,7 @@ in stdenv.mkDerivation rec {
   depsBuildBuild = [ buildPackages.stdenv.cc ];
 
   nativeBuildInputs = [ perl ninja (buildPackages.python3.withPackages (ps: with ps; [ gyp ])) ]
-    ++ stdenv.lib.optionals stdenv.hostPlatform.isDarwin [ darwin.cctools fixDarwinDylibNames ];
+    ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.cctools fixDarwinDylibNames ];
 
   buildInputs = [ zlib sqlite ];
 
@@ -57,7 +57,7 @@ in stdenv.mkDerivation rec {
 
   patchFlags = [ "-p0" ];
 
-  postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+  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'"
    '';
@@ -90,9 +90,9 @@ in stdenv.mkDerivation rec {
       -Dhost_arch=${host} \
       -Duse_system_zlib=1 \
       --enable-libpkix \
-      ${stdenv.lib.optionalString enableFIPS "--enable-fips"} \
-      ${stdenv.lib.optionalString stdenv.isDarwin "--clang"} \
-      ${stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "--disable-tests"}
+      ${lib.optionalString enableFIPS "--enable-fips"} \
+      ${lib.optionalString stdenv.isDarwin "--clang"} \
+      ${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "--disable-tests"}
 
     runHook postBuild
   '';
@@ -137,7 +137,7 @@ in stdenv.mkDerivation rec {
     isCross = stdenv.hostPlatform != stdenv.buildPlatform;
     nss = if isCross then buildPackages.nss.tools else "$out";
   in
-  (stdenv.lib.optionalString enableFIPS (''
+  (lib.optionalString enableFIPS (''
     for libname in freebl3 nssdbm3 softokn3
     do '' +
     (if stdenv.isDarwin
@@ -160,7 +160,7 @@ in stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://developer.mozilla.org/en-US/docs/NSS";
     description = "A set of libraries for development of security-enabled client and server applications";
     license = licenses.mpl20;
diff --git a/nixpkgs/pkgs/development/libraries/nss/default.nix b/nixpkgs/pkgs/development/libraries/nss/default.nix
index 17dc93c9f1ea..8c98d7ae9bbd 100644
--- a/nixpkgs/pkgs/development/libraries/nss/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nss/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, nspr, perl, zlib, sqlite, darwin, fixDarwinDylibNames, buildPackages, ninja
+{ 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
@@ -30,7 +30,7 @@ in stdenv.mkDerivation rec {
   depsBuildBuild = [ buildPackages.stdenv.cc ];
 
   nativeBuildInputs = [ perl ninja (buildPackages.python3.withPackages (ps: with ps; [ gyp ])) ]
-    ++ stdenv.lib.optionals stdenv.hostPlatform.isDarwin [ darwin.cctools fixDarwinDylibNames ];
+    ++ lib.optionals stdenv.hostPlatform.isDarwin [ darwin.cctools fixDarwinDylibNames ];
 
   buildInputs = [ zlib sqlite ];
 
@@ -63,7 +63,7 @@ in stdenv.mkDerivation rec {
 
   patchFlags = [ "-p0" ];
 
-  postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+  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'"
    '';
@@ -96,9 +96,9 @@ in stdenv.mkDerivation rec {
       -Dhost_arch=${host} \
       -Duse_system_zlib=1 \
       --enable-libpkix \
-      ${stdenv.lib.optionalString enableFIPS "--enable-fips"} \
-      ${stdenv.lib.optionalString stdenv.isDarwin "--clang"} \
-      ${stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "--disable-tests"}
+      ${lib.optionalString enableFIPS "--enable-fips"} \
+      ${lib.optionalString stdenv.isDarwin "--clang"} \
+      ${lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) "--disable-tests"}
 
     runHook postBuild
   '';
@@ -143,7 +143,7 @@ in stdenv.mkDerivation rec {
     isCross = stdenv.hostPlatform != stdenv.buildPlatform;
     nss = if isCross then buildPackages.nss.tools else "$out";
   in
-  (stdenv.lib.optionalString enableFIPS (''
+  (lib.optionalString enableFIPS (''
     for libname in freebl3 nssdbm3 softokn3
     do '' +
     (if stdenv.isDarwin
@@ -166,7 +166,7 @@ in stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://developer.mozilla.org/en-US/docs/NSS";
     description = "A set of libraries for development of security-enabled client and server applications";
     license = licenses.mpl20;
diff --git a/nixpkgs/pkgs/development/libraries/nss_wrapper/default.nix b/nixpkgs/pkgs/development/libraries/nss_wrapper/default.nix
index c03b09447789..3cdeb93dc9b1 100644
--- a/nixpkgs/pkgs/development/libraries/nss_wrapper/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nss_wrapper/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, pkgconfig }:
+{ lib, stdenv, fetchurl, cmake, pkg-config }:
 
 stdenv.mkDerivation rec {
   name = "nss_wrapper-1.1.11";
@@ -8,10 +8,9 @@ stdenv.mkDerivation rec {
     sha256 = "1q5l6w69yc71ly8gcbnkrcbnq6b64cbiiv99m0z5vn5lgwp36igv";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ cmake ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/nsss/default.nix b/nixpkgs/pkgs/development/libraries/nsss/default.nix
index 3e3530215bf8..4e71c4d65e6e 100644
--- a/nixpkgs/pkgs/development/libraries/nsss/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nsss/default.nix
@@ -4,8 +4,8 @@ with skawarePackages;
 
 buildPackage {
   pname = "nsss";
-  version = "0.0.2.2";
-  sha256 = "0am195wabv63n545ykqnch9gs8cs1g5zw35k2ddxb9dnamhxfi9k";
+  version = "0.1.0.0";
+  sha256 = "15rxbwf16wm1la079yr2xn4bccjgd7m8dh6r7bpr6s57cj93i2mq";
 
   description = "An implementation of a subset of the pwd.h, group.h and shadow.h family of functions.";
 
diff --git a/nixpkgs/pkgs/development/libraries/ntbtls/default.nix b/nixpkgs/pkgs/development/libraries/ntbtls/default.nix
index 5ea43097b8ca..98ea6fa943f8 100644
--- a/nixpkgs/pkgs/development/libraries/ntbtls/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ntbtls/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, gettext, libgpgerror, libgcrypt, libksba, zlib }:
+{ lib, stdenv, fetchurl, gettext, libgpgerror, libgcrypt, libksba, zlib }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "ntbtls";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   outputs = [ "dev" "out" ];
 
   buildInputs = [ libgcrypt libgpgerror libksba zlib ]
-    ++ stdenv.lib.optional stdenv.isDarwin gettext;
+    ++ lib.optional stdenv.isDarwin gettext;
 
   postInstall = ''
     moveToOutput "bin/ntbtls-config" $dev
diff --git a/nixpkgs/pkgs/development/libraries/ntdb/default.nix b/nixpkgs/pkgs/development/libraries/ntdb/default.nix
index d0a9a2e5b49a..021436516c22 100644
--- a/nixpkgs/pkgs/development/libraries/ntdb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ntdb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , python2
 , python3
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
     "--builtin-libraries=replace,ccan"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The not-so trivial database";
     homepage = "https://tdb.samba.org/";
     license = licenses.lgpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/ntirpc/default.nix b/nixpkgs/pkgs/development/libraries/ntirpc/default.nix
index 48ef98dab499..e98cfac78581 100644
--- a/nixpkgs/pkgs/development/libraries/ntirpc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ntirpc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake
+{ lib, stdenv, fetchFromGitHub, cmake
 , krb5, liburcu , libtirpc, libnsl
 } :
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     cp ${libtirpc}/etc/netconfig $out/etc/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Transport-independent RPC (TI-RPC)";
     homepage = "https://github.com/nfs-ganesha/ntirpc";
     maintainers = [ maintainers.markuskowa ];
diff --git a/nixpkgs/pkgs/development/libraries/ntrack/default.nix b/nixpkgs/pkgs/development/libraries/ntrack/default.nix
index 17a294adc4b7..cb9f9ff575f8 100644
--- a/nixpkgs/pkgs/development/libraries/ntrack/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ntrack/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qt4, pkgconfig, libnl, python }:
+{ lib, stdenv, fetchurl, qt4, pkg-config, libnl, python }:
 
 let
   version = "016";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libnl qt4 ];
 
-  nativeBuildInputs = [ pkgconfig python ];
+  nativeBuildInputs = [ pkg-config python ];
 
   # error: ISO C does not support '__FUNCTION__' predefined identifier [-Werror=pedantic]
   NIX_CFLAGS_COMPILE = "-Wno-error";
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     sed -e "s@/usr\(/lib/ntrack/modules/\)@$out&@" -i common/ntrack.c
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Network Connectivity Tracking library for Desktop Applications";
     homepage = "https://launchpad.net/ntrack";
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/nuraft/default.nix b/nixpkgs/pkgs/development/libraries/nuraft/default.nix
index 1554e1678156..58e5e4013590 100644
--- a/nixpkgs/pkgs/development/libraries/nuraft/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nuraft/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, boost172, asio, openssl, zlib }:
+{ lib, stdenv, fetchFromGitHub, cmake, boost172, asio, openssl, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "nuraft";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
   buildInputs = [ boost172 asio openssl zlib ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/eBay/NuRaft";
     description = "C++ implementation of Raft core logic as a replication library";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/nuspell/default.nix b/nixpkgs/pkgs/development/libraries/nuspell/default.nix
index b0a9227b8c93..c16305018d71 100644
--- a/nixpkgs/pkgs/development/libraries/nuspell/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nuspell/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig, icu, catch2, pandoc }:
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, icu, catch2, pandoc }:
 
 stdenv.mkDerivation rec {
   pname = "nuspell";
@@ -11,13 +11,11 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-sQ3Q2+FOf2bXCKcgd6XvEb+QZzzDccs/4+CpJbEd1PQ=";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig pandoc ];
+  nativeBuildInputs = [ cmake pkg-config pandoc ];
   buildInputs = [ icu ];
 
   outputs = [ "out" "lib" "dev" "man" ];
 
-  enableParallelBuilding = true;
-
   postPatch = ''
     rm -rf external/Catch2
     ln -sf ${catch2.src} external/Catch2
@@ -27,7 +25,7 @@ stdenv.mkDerivation rec {
     rm -rf $out/share/doc
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Free and open source C++ spell checking library";
     homepage = "https://nuspell.github.io/";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/nv-codec-headers/default.nix b/nixpkgs/pkgs/development/libraries/nv-codec-headers/default.nix
index 8d3c2179bff9..9b8323e6c978 100644
--- a/nixpkgs/pkgs/development/libraries/nv-codec-headers/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nv-codec-headers/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit }:
+{ lib, stdenv, fetchgit }:
 
 stdenv.mkDerivation rec {
   pname = "nv-codec-headers";
@@ -15,8 +15,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "FFmpeg version of headers for NVENC";
     homepage = "https://ffmpeg.org/";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.MP2E ];
-    platforms = stdenv.lib.platforms.all;
+    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
index 667f3d94e05a..f9c2547d4246 100644
--- a/nixpkgs/pkgs/development/libraries/nvidia-optical-flow-sdk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nvidia-optical-flow-sdk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation {
   pname = "nvidia-optical-flow-sdk";
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
     cp -R * $out/include
   '';
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/nvidia-texture-tools/default.nix b/nixpkgs/pkgs/development/libraries/nvidia-texture-tools/default.nix
index a2bdbc798eb0..676245967202 100644
--- a/nixpkgs/pkgs/development/libraries/nvidia-texture-tools/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nvidia-texture-tools/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, fetchpatch }:
+{ lib, stdenv, fetchFromGitHub, cmake, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "nvidia-texture-tools";
@@ -37,9 +37,7 @@ stdenv.mkDerivation rec {
     moveToOutput lib "$lib"
   '';
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.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;
diff --git a/nixpkgs/pkgs/development/libraries/nvidia-video-sdk/default.nix b/nixpkgs/pkgs/development/libraries/nvidia-video-sdk/default.nix
index d08f71855882..3a63bad03dcb 100644
--- a/nixpkgs/pkgs/development/libraries/nvidia-video-sdk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/nvidia-video-sdk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip }:
+{ lib, stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation {
   name = "nvidia-video-sdk-6.0.1";
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
     cp -R Samples/common/inc/* $out/include
   '';
 
-  meta = with stdenv.lib; {
+  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
index 38c021707615..084f3c4a935b 100644
--- a/nixpkgs/pkgs/development/libraries/oatpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/oatpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 }:
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   # Tests fail on darwin. See https://github.com/NixOS/nixpkgs/pull/105419#issuecomment-735826894
   doCheck = !stdenv.isDarwin;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/ocl-icd/default.nix b/nixpkgs/pkgs/development/libraries/ocl-icd/default.nix
index 30a8790b99a4..b84aa6a146d7 100644
--- a/nixpkgs/pkgs/development/libraries/ocl-icd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ocl-icd/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, ruby, opencl-headers, addOpenGLRunpath }:
+{lib, stdenv, fetchurl, ruby, opencl-headers, addOpenGLRunpath }:
 
 stdenv.mkDerivation rec {
   pname = "ocl-icd";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     sed -i 's,"/etc/OpenCL/vendors","${addOpenGLRunpath.driverLink}/etc/OpenCL/vendors",g' ocl_icd_loader.c
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "OpenCL ICD Loader for ${opencl-headers.name}";
     homepage    = "https://forge.imag.fr/projects/ocl-icd/";
     license     = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/ode/default.nix b/nixpkgs/pkgs/development/libraries/ode/default.nix
index d6047d1b1921..d9c82f79bb35 100644
--- a/nixpkgs/pkgs/development/libraries/ode/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ode/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "ode";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0l63ymlkgfp5cb0ggqwm386lxmc3al21nb7a07dd49f789d33ib5";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Open Dynamics Engine";
     homepage = "https://sourceforge.net/projects/opende";
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/odpic/default.nix b/nixpkgs/pkgs/development/libraries/odpic/default.nix
index 22d48c8c6092..b79de9278d46 100644
--- a/nixpkgs/pkgs/development/libraries/odpic/default.nix
+++ b/nixpkgs/pkgs/development/libraries/odpic/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchFromGitHub, fixDarwinDylibNames, oracle-instantclient, libaio }:
+{ lib, stdenv, fetchFromGitHub, fixDarwinDylibNames, oracle-instantclient, libaio }:
 
 let
   version = "4.1.0";
-  libPath = stdenv.lib.makeLibraryPath [ oracle-instantclient.lib ];
+  libPath = lib.makeLibraryPath [ oracle-instantclient.lib ];
 
 in stdenv.mkDerivation {
   inherit version;
@@ -16,24 +16,24 @@ in stdenv.mkDerivation {
     sha256 = "1zk08z74q7njbj329xfy8aszphj27rqlkhsyglai60wfzl6mcf4x";
   };
 
-  nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
+  nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
   buildInputs = [ oracle-instantclient ]
-    ++ stdenv.lib.optionals stdenv.isLinux [ libaio ];
+    ++ lib.optionals stdenv.isLinux [ libaio ];
 
   dontPatchELF = true;
   makeFlags = [ "PREFIX=$(out)" "CC=cc" "LD=cc"];
 
   postFixup = ''
-    ${stdenv.lib.optionalString (stdenv.isLinux) ''
+    ${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}
     ''}
-    ${stdenv.lib.optionalString (stdenv.isDarwin) ''
+    ${lib.optionalString (stdenv.isDarwin) ''
       install_name_tool -add_rpath "${libPath}" $out/lib/libodpic${stdenv.hostPlatform.extensions.sharedLibrary}
     ''}
     '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Oracle ODPI-C library";
     homepage = "https://oracle.github.io/odpi/";
     maintainers = with maintainers; [ mkazulak flokli ];
diff --git a/nixpkgs/pkgs/development/libraries/ogdf/default.nix b/nixpkgs/pkgs/development/libraries/ogdf/default.nix
index bbef1d8b93d6..bee64afd2900 100644
--- a/nixpkgs/pkgs/development/libraries/ogdf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ogdf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, doxygen }:
+{ lib, stdenv, fetchFromGitHub, cmake, doxygen }:
 
 stdenv.mkDerivation rec {
   pname = "ogdf";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   #> 766 |      sprintf(messageOut_,format_+2);
   hardeningDisable = [ "format" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Open Graph Drawing Framework/Open Graph algorithms and Data structure Framework";
     homepage = "http://www.ogdf.net";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix b/nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix
index fe23181cfc67..849db216b921 100644
--- a/nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix
+++ b/nixpkgs/pkgs/development/libraries/ogre/1.10.x.nix
@@ -2,7 +2,7 @@
 , cmake, libGLU, libGL
 , freetype, freeimage, zziplib, xorgproto, libXrandr
 , libXaw, freeglut, libXt, libpng, boost, ois
-, libX11, libXmu, libSM, pkgconfig
+, libX11, libXmu, libSM, pkg-config
 , libXxf86vm, libICE
 , libXrender
 , withNvidiaCg ? false, nvidia_cg_toolkit
@@ -21,13 +21,12 @@ stdenv.mkDerivation {
            ([ "BSP" "OCTREE" "PCZ" "PFX" ] ++ lib.optional withNvidiaCg "CG")
     ++ map (x: "-DOGRE_BUILD_RENDERSYSTEM_${x}=on") [ "GL" ];
 
-  enableParallelBuilding = true;
-
+  nativeBuildInputs = [ cmake pkg-config ];
   buildInputs =
-   [ cmake libGLU libGL
+   [ libGLU libGL
      freetype freeimage zziplib xorgproto libXrandr
      libXaw freeglut libXt libpng boost ois
-     libX11 libXmu libSM pkgconfig
+     libX11 libXmu libSM
      libXxf86vm libICE
      libXrender
    ] ++ lib.optional withNvidiaCg nvidia_cg_toolkit;
@@ -35,8 +34,8 @@ stdenv.mkDerivation {
   meta = {
     description = "A 3D engine";
     homepage = "https://www.ogre3d.org/";
-    maintainers = [ stdenv.lib.maintainers.raskin ];
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.mit;
+    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
index 29c83a2962ee..30d1dd185547 100644
--- a/nixpkgs/pkgs/development/libraries/ogre/1.9.x.nix
+++ b/nixpkgs/pkgs/development/libraries/ogre/1.9.x.nix
@@ -2,7 +2,7 @@
 , cmake, libGLU, libGL
 , freetype, freeimage, zziplib, xorgproto, libXrandr
 , libXaw, freeglut, libXt, libpng, boost, ois
-, libX11, libXmu, libSM, pkgconfig
+, libX11, libXmu, libSM, pkg-config
 , libXxf86vm, libICE
 , libXrender
 , withNvidiaCg ? false, nvidia_cg_toolkit
@@ -24,13 +24,13 @@ stdenv.mkDerivation rec {
            ([ "BSP" "OCTREE" "PCZ" "PFX" ] ++ lib.optional withNvidiaCg "CG")
     ++ map (x: "-DOGRE_BUILD_RENDERSYSTEM_${x}=on") [ "GL" ];
 
-  enableParallelBuilding = true;
 
+  nativeBuildInputs = [ cmake pkg-config ];
   buildInputs =
-   [ cmake libGLU libGL
+   [ libGLU libGL
      freetype freeimage zziplib xorgproto libXrandr
      libXaw freeglut libXt libpng boost ois
-     libX11 libXmu libSM pkgconfig
+     libX11 libXmu libSM
      libXxf86vm libICE
      libXrender
    ] ++ lib.optional withNvidiaCg nvidia_cg_toolkit;
@@ -38,8 +38,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A 3D engine";
     homepage = "https://www.ogre3d.org/";
-    maintainers = [ stdenv.lib.maintainers.raskin ];
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.mit;
+    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
index 491ff4edddc6..ae65da3f418b 100644
--- a/nixpkgs/pkgs/development/libraries/ogre/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ogre/default.nix
@@ -2,7 +2,7 @@
 , cmake, libGLU, libGL
 , freetype, freeimage, zziplib, xorgproto, libXrandr
 , libXaw, freeglut, libXt, libpng, boost, ois
-, libX11, libXmu, libSM, pkgconfig
+, libX11, libXmu, libSM, pkg-config
 , libXxf86vm, libICE
 , unzip
 , libXrender
@@ -23,24 +23,22 @@ stdenv.mkDerivation rec {
            ([ "BSP" "OCTREE" "PCZ" "PFX" ] ++ lib.optional withNvidiaCg "CG")
     ++ map (x: "-DOGRE_BUILD_RENDERSYSTEM_${x}=on") [ "GL" ];
 
-  enableParallelBuilding = true;
 
+  nativeBuildInputs = [ cmake unzip pkg-config ];
   buildInputs =
    [ cmake libGLU libGL
      freetype freeimage zziplib xorgproto libXrandr
      libXaw freeglut libXt libpng boost ois
-     libX11 libXmu libSM pkgconfig
+     libX11 libXmu libSM
      libXxf86vm libICE
      libXrender
    ] ++ lib.optional withNvidiaCg nvidia_cg_toolkit;
 
-  nativeBuildInputs = [ unzip ];
-
   meta = {
     description = "A 3D engine";
     homepage = "https://www.ogre3d.org/";
-    maintainers = [ stdenv.lib.maintainers.raskin ];
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.mit;
+    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
index e4dc186f389c..0aefedb52575 100644
--- a/nixpkgs/pkgs/development/libraries/ogrepaged/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ogrepaged/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, cmake, pkgconfig, ois, ogre, libX11, boost }:
+{ lib, stdenv, fetchurl, fetchpatch, cmake, pkg-config, ois, ogre, libX11, boost }:
 
 stdenv.mkDerivation rec {
   pname = "ogre-paged";
@@ -27,16 +27,14 @@ stdenv.mkDerivation rec {
   ];
 
   buildInputs = [ ois ogre libX11 boost ];
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
   cmakeFlags = [ "-DPAGEDGEOMETRY_BUILD_SAMPLES=OFF" ];
 
-  enableParallelBuilding = true;
-
   meta = {
     description = "Paged Geometry for Ogre3D";
     homepage = "https://github.com/RigsOfRods/ogre-paged";
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.linux;
+    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
index ee85e64966f6..2edbc35aa899 100644
--- a/nixpkgs/pkgs/development/libraries/ois/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ois/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libX11 ] ++ lib.optionals stdenv.isDarwin [ Cocoa IOKit Kernel ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Object-oriented C++ input system";
     maintainers = [ maintainers.raskin ];
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/olm/default.nix b/nixpkgs/pkgs/development/libraries/olm/default.nix
index 9efe524b12d0..4fbc34bcce63 100644
--- a/nixpkgs/pkgs/development/libraries/olm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/olm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake }:
+{ lib, stdenv, fetchurl, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "olm";
@@ -15,8 +15,8 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Implements double cryptographic ratchet and Megolm ratchet";
-    license = stdenv.lib.licenses.asl20;
+    license = lib.licenses.asl20;
     homepage = "https://gitlab.matrix.org/matrix-org/olm";
-    platforms = with stdenv.lib.platforms; darwin ++ linux;
+    platforms = with lib.platforms; darwin ++ linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/oniguruma/default.nix b/nixpkgs/pkgs/development/libraries/oniguruma/default.nix
index 44420c85cf55..016207c13060 100644
--- a/nixpkgs/pkgs/development/libraries/oniguruma/default.nix
+++ b/nixpkgs/pkgs/development/libraries/oniguruma/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "onig";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/kkos/oniguruma";
     description = "Regular expressions library";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/opae/default.nix b/nixpkgs/pkgs/development/libraries/opae/default.nix
index 683f2c43bdc8..cba7e7b285d9 100644
--- a/nixpkgs/pkgs/development/libraries/opae/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opae/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake
+{ lib, stdenv, fetchFromGitHub, cmake
 , libuuid, json_c
 , doxygen, perl, python2, python2Packages
 }:
@@ -37,9 +37,8 @@ stdenv.mkDerivation rec {
   '';
 
   cmakeFlags = [ "-DBUILD_ASE=1" ];
-  enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Open Programmable Acceleration Engine SDK";
     homepage    = "https://01.org/opae";
     license     = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/openal-soft/default.nix b/nixpkgs/pkgs/development/libraries/openal-soft/default.nix
index efc5a18f2b0f..43c781cf52ce 100644
--- a/nixpkgs/pkgs/development/libraries/openal-soft/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openal-soft/default.nix
@@ -1,10 +1,10 @@
-{ stdenv, fetchFromGitHub, cmake
+{ lib, stdenv, fetchFromGitHub, cmake
 , alsaSupport ? !stdenv.isDarwin, alsaLib ? null
 , pulseSupport ? !stdenv.isDarwin, libpulseaudio ? null
 , CoreServices, AudioUnit, AudioToolbox
 }:
 
-with stdenv.lib;
+with lib;
 
 assert alsaSupport -> alsaLib != null;
 assert pulseSupport -> libpulseaudio != null;
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
index d074db7d165c..63784d94d8f0 100644
--- a/nixpkgs/pkgs/development/libraries/openbabel/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openbabel/default.nix
@@ -1,34 +1,45 @@
-{stdenv, fetchurl, fetchpatch, cmake, zlib, libxml2, eigen, python, cairo, pcre, pkgconfig }:
+{stdenv, lib, fetchurl, cmake, zlib, libxml2, eigen, python, cairo, pcre, pkg-config, swig, rapidjson }:
 
 stdenv.mkDerivation rec {
   pname = "openbabel";
-  version = "2.4.1";
+  version = "3.1.1";
 
   src = fetchurl {
-    url = "https://github.com/openbabel/openbabel/archive/openbabel-${stdenv.lib.replaceStrings ["."] ["-"] version}.tar.gz";
-    sha256 = "0xm7y859ivq2cp0q08mwshfxm0jq31xkyr4x8s0j6l7khf57yk2r";
+    url = "https://github.com/openbabel/openbabel/archive/openbabel-${lib.replaceStrings ["."] ["-"] version}.tar.gz";
+    sha256 = "c97023ac6300d26176c97d4ef39957f06e68848d64f1a04b0b284ccff2744f02";
   };
 
-  patches = [
-    # ARM / AArch64 fixes.
-    (fetchpatch {
-      url = "https://github.com/openbabel/openbabel/commit/ee11c98a655296550710db1207b294f00e168216.patch";
-      sha256 = "0wjqjrkr4pfirzzicdvlyr591vppydk572ix28jd2sagnfnf566g";
-    })
+
+  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"
   ];
 
-  # TODO : perl & python bindings;
-  # TODO : wxGTK: I have no time to compile
-  # TODO : separate lib and apps
-  buildInputs = [ zlib libxml2 eigen python cairo pcre ];
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  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 = {
+  meta = with lib; {
     description = "A toolbox designed to speak the many languages of chemical data";
     homepage = "http://openbabel.org";
-    platforms = stdenv.lib.platforms.all;
-    maintainers = [ ];
-    license = stdenv.lib.licenses.gpl2Plus;
+    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
index 1516e675d739..8e56e250ac40 100644
--- a/nixpkgs/pkgs/development/libraries/openbr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openbr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, opencv, qtbase, qtsvg }:
+{ lib, stdenv, fetchFromGitHub, cmake, opencv, qtbase, qtsvg }:
 
 stdenv.mkDerivation {
 
@@ -16,14 +16,12 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ cmake ];
 
-  enableParallelBuilding = true;
-
   meta = {
     description = "Open Source Biometric Recognition";
     homepage = "http://openbiometrics.org/";
-    license = stdenv.lib.licenses.asl20;
-    maintainers = with stdenv.lib.maintainers; [flosse];
-    platforms = with stdenv.lib.platforms; linux;
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [flosse];
+    platforms = with lib.platforms; linux;
     broken = true;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/opencascade-occt/default.nix b/nixpkgs/pkgs/development/libraries/opencascade-occt/default.nix
index ac2b8ba6d1ed..59c1f0ef7dbc 100644
--- a/nixpkgs/pkgs/development/libraries/opencascade-occt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opencascade-occt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, cmake, ninja, tcl, tk,
+{ lib, stdenv, fetchurl, fetchpatch, cmake, ninja, tcl, tk,
   libGL, libGLU, libXext, libXmu, libXi, darwin }:
 
 stdenv.mkDerivation rec {
@@ -14,9 +14,9 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ninja ];
   buildInputs = [ tcl tk libGL libGLU libXext libXmu libXi ]
-    ++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Cocoa;
+    ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Cocoa;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Open CASCADE Technology, libraries for 3D modeling and numerical simulation";
     homepage = "https://www.opencascade.org/";
     license = licenses.lgpl21;  # essentially...
diff --git a/nixpkgs/pkgs/development/libraries/opencascade/default.nix b/nixpkgs/pkgs/development/libraries/opencascade/default.nix
index c0b2366ab7fc..5c262a3680c5 100644
--- a/nixpkgs/pkgs/development/libraries/opencascade/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opencascade/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchFromGitHub, fetchpatch, libGL, libGLU, libXmu, cmake, ninja,
-  pkgconfig, fontconfig, freetype, expat, freeimage, vtk, gl2ps, tbb,
+{ lib, stdenv, fetchFromGitHub, fetchpatch, libGL, libGLU, libXmu, cmake, ninja,
+  pkg-config, fontconfig, freetype, expat, freeimage, vtk, gl2ps, tbb,
   OpenCL, Cocoa
 }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "opencascade-oce";
   version = "0.18.3";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     sha256 = "17wy8dcf44vqisishv1jjf3cmcxyygqq29y9c3wjdj983qi2hsig";
   };
 
-  nativeBuildInputs = [ cmake ninja pkgconfig ];
+  nativeBuildInputs = [ cmake ninja pkg-config ];
   buildInputs = [
     libGL libGLU libXmu freetype fontconfig expat freeimage vtk
     gl2ps tbb
diff --git a/nixpkgs/pkgs/development/libraries/opencl-clang/default.nix b/nixpkgs/pkgs/development/libraries/opencl-clang/default.nix
index 8b7df317b2ba..8bbde9796d9a 100644
--- a/nixpkgs/pkgs/development/libraries/opencl-clang/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opencl-clang/default.nix
@@ -1,4 +1,5 @@
-{ stdenv
+{ lib
+, stdenv
 , fetchFromGitHub
 , fetchpatch
 , cmake
@@ -15,10 +16,10 @@ let
     inherit spirv-llvm-translator;
   };
 
-  inherit (stdenv.lib) getVersion;
+  inherit (lib) getVersion;
 
   addPatches = component: pkg:
-    with builtins; with stdenv.lib;
+    with builtins; with lib;
     let path = "${passthru.patchesOut}/${component}";
     in pkg.overrideAttrs (super: {
       postPatch = (if super ? postPatch then super.postPatch + "\n" else "") + ''
@@ -39,7 +40,7 @@ let
 
     patchesOut = stdenv.mkDerivation rec {
       pname = "opencl-clang-patches";
-      inherit (lib) version src patches;
+      inherit (library) version src patches;
       installPhase = ''
         [ -d patches ] && cp -r patches/ $out || mkdir $out
         mkdir -p $out/clang $out/spirv
@@ -50,7 +51,7 @@ let
 
   };
 
-  lib = let
+  library = let
     inherit (llvmPkgs) llvm;
     inherit (if buildWithPatches then passthru else llvmPkgs) clang-unwrapped spirv-llvm-translator;
   in
@@ -85,7 +86,7 @@ let
         "-DSPIRV_TRANSLATOR_DIR=${spirv-llvm-translator}"
       ];
 
-      meta = with stdenv.lib; {
+      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;
@@ -94,4 +95,4 @@ let
       };
     };
 in
-  lib
+  library
diff --git a/nixpkgs/pkgs/development/libraries/opencl-clhpp/default.nix b/nixpkgs/pkgs/development/libraries/opencl-clhpp/default.nix
index 1486ea93175b..ec40bc393d51 100644
--- a/nixpkgs/pkgs/development/libraries/opencl-clhpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opencl-clhpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, python, opencl-headers }:
+{ lib, stdenv, fetchFromGitHub, cmake, python, opencl-headers }:
 
 stdenv.mkDerivation rec {
   pname = "opencl-clhpp";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     "-DBUILD_TESTS=OFF"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "OpenCL Host API C++ bindings";
     homepage = "http://github.khronos.org/OpenCL-CLHPP/";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/opencl-headers/default.nix b/nixpkgs/pkgs/development/libraries/opencl-headers/default.nix
index aaf6390d00a5..1ef27bf58316 100644
--- a/nixpkgs/pkgs/development/libraries/opencl-headers/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opencl-headers/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 }:
 
 stdenv.mkDerivation rec {
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     cp CL/* $out/include/CL
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Khronos OpenCL headers version ${version}";
     homepage = "https://www.khronos.org/registry/cl/";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/opencollada/default.nix b/nixpkgs/pkgs/development/libraries/opencollada/default.nix
index 388c473125b8..d05822174339 100644
--- a/nixpkgs/pkgs/development/libraries/opencollada/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opencollada/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, cmake, pkgconfig, libxml2, pcre
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, libxml2, pcre
 , darwin}:
 
 stdenv.mkDerivation rec {
@@ -13,14 +13,11 @@ stdenv.mkDerivation rec {
     sha256 = "1ym16fxx9qhf952vva71sdzgbm7ifis0h1n5fj1bfdj8zvvkbw5w";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ cmake ]
-    ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ AGL ]);
+  nativeBuildInputs = [ cmake pkg-config ];
+  buildInputs = lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ AGL ]);
 
   propagatedBuildInputs = [ libxml2 pcre ];
 
-  enableParallelBuilding = true;
-
   patchPhase = ''
     patch -p1 < ${./pcre.patch}
   '' + lib.optionalString stdenv.isDarwin ''
@@ -31,8 +28,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A library for handling the COLLADA file format";
     homepage = "https://github.com/KhronosGroup/OpenCOLLADA/";
-    maintainers = [ stdenv.lib.maintainers.eelco ];
-    platforms = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.mit;
+    maintainers = [ lib.maintainers.eelco ];
+    platforms = lib.platforms.unix;
+    license = lib.licenses.mit;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/opencolorio/default.nix b/nixpkgs/pkgs/development/libraries/opencolorio/default.nix
index a60051dbd5f5..8908f4866156 100644
--- a/nixpkgs/pkgs/development/libraries/opencolorio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opencolorio/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, cmake, boost, pkgconfig, lcms2, tinyxml, git }:
+{ stdenv, lib, fetchFromGitHub, cmake, boost, pkg-config, lcms2, tinyxml, git }:
 
 with lib;
 
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   outputs = [ "bin" "out" "dev" ];
 
   # TODO: Investigate whether git can be dropped: It's only used to apply patches
-  nativeBuildInputs = [ cmake pkgconfig git ];
+  nativeBuildInputs = [ cmake pkg-config git ];
 
   buildInputs = [ lcms2 tinyxml ] ++ optional stdenv.isDarwin boost;
 
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
     mkdir -p $bin/bin; mv $out/bin $bin/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://opencolorio.org";
     description = "A color management framework for visual effects and animation";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/opencore-amr/default.nix b/nixpkgs/pkgs/development/libraries/opencore-amr/default.nix
index 4848ef864bf2..d1348d96e3b1 100644
--- a/nixpkgs/pkgs/development/libraries/opencore-amr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opencore-amr/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 let
     version = "0.1.5";
-in 
+in
 stdenv.mkDerivation {
   pname = "opencore-amr";
   inherit version;
@@ -10,12 +10,12 @@ stdenv.mkDerivation {
     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. 
+    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 = stdenv.lib.licenses.asl20;
-    maintainers = [ stdenv.lib.maintainers.kiloreux ];
+    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
index 00d489508add..53adbdf414f7 100644
--- a/nixpkgs/pkgs/development/libraries/opencsg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opencsg/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, libGLU, libGL, freeglut, glew, libXmu, libXext, libX11
+{lib, stdenv, fetchurl, libGLU, libGL, freeglut, glew, libXmu, libXext, libX11
 , qmake, GLUT, fixDarwinDylibNames }:
 
 stdenv.mkDerivation rec {
@@ -10,11 +10,11 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ qmake ]
-    ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
+    ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
   buildInputs = [ glew ]
-    ++ stdenv.lib.optionals stdenv.isLinux [ libGLU libGL freeglut libXmu libXext libX11 ]
-    ++ stdenv.lib.optional stdenv.isDarwin GLUT;
+    ++ lib.optionals stdenv.isLinux [ libGLU libGL freeglut libXmu libXext libX11 ]
+    ++ lib.optional stdenv.isDarwin GLUT;
 
   doCheck = false;
 
@@ -27,13 +27,13 @@ stdenv.mkDerivation rec {
 
   postInstall = ''
     install -D license.txt "$out/share/doc/opencsg/license.txt"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     mkdir -p $out/Applications
     mv $out/bin/*.app $out/Applications
     rmdir $out/bin || true
   '';
 
-  postFixup = stdenv.lib.optionalString stdenv.isDarwin ''
+  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 }') \
@@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
       $app
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Constructive Solid Geometry library";
     homepage = "http://www.opencsg.org/";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/openct/default.nix b/nixpkgs/pkgs/development/libraries/openct/default.nix
index 27a832daf475..92dec5ee2334 100644
--- a/nixpkgs/pkgs/development/libraries/openct/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openct/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, pcsclite, libusb-compat-0_1
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, pcsclite, libusb-compat-0_1
 , doxygen, libxslt
 }:
 
@@ -25,14 +25,14 @@ stdenv.mkDerivation rec {
     "--sysconfdir=/etc"
   ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ pcsclite libusb-compat-0_1 doxygen libxslt ];
 
   preInstall = ''
     mkdir -p $out/etc
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/OpenSC/openct/";
     license = licenses.lgpl21;
     description = "Drivers for several smart card readers";
diff --git a/nixpkgs/pkgs/development/libraries/opencv/3.x.nix b/nixpkgs/pkgs/development/libraries/opencv/3.x.nix
index 2ad2d016c9fd..11872cd47cc3 100644
--- a/nixpkgs/pkgs/development/libraries/opencv/3.x.nix
+++ b/nixpkgs/pkgs/development/libraries/opencv/3.x.nix
@@ -1,6 +1,6 @@
 { lib, stdenv
 , fetchFromGitHub, fetchpatch
-, cmake, pkgconfig, unzip, zlib, pcre, hdf5
+, cmake, pkg-config, unzip, zlib, pcre, hdf5
 , glog, boost, gflags, protobuf
 , config
 
@@ -206,7 +206,7 @@ stdenv.mkDerivation {
 
   propagatedBuildInputs = lib.optional enablePython pythonPackages.numpy;
 
-  nativeBuildInputs = [ cmake pkgconfig unzip ];
+  nativeBuildInputs = [ cmake pkg-config unzip ];
 
   NIX_CFLAGS_COMPILE = lib.optionalString enableEXR "-I${ilmbase.dev}/include/OpenEXR";
 
@@ -245,8 +245,6 @@ stdenv.mkDerivation {
     "-DEIGEN_INCLUDE_PATH=${eigen}/include/eigen3"
   ];
 
-  enableParallelBuilding = true;
-
   postBuild = lib.optionalString enableDocs ''
     make doxygen
   '';
@@ -271,7 +269,7 @@ stdenv.mkDerivation {
 
   passthru = lib.optionalAttrs enablePython { pythonPath = []; };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/opencv/4.x.nix b/nixpkgs/pkgs/development/libraries/opencv/4.x.nix
index c6547f118d06..c9ac76b65544 100644
--- a/nixpkgs/pkgs/development/libraries/opencv/4.x.nix
+++ b/nixpkgs/pkgs/development/libraries/opencv/4.x.nix
@@ -1,6 +1,6 @@
 { lib, stdenv
 , fetchurl, fetchFromGitHub, fetchpatch
-, cmake, pkgconfig, unzip, zlib, pcre, hdf5
+, cmake, pkg-config, unzip, zlib, pcre, hdf5
 , glog, boost, gflags, protobuf
 , config
 
@@ -216,7 +216,7 @@ stdenv.mkDerivation {
 
   propagatedBuildInputs = lib.optional enablePython pythonPackages.numpy;
 
-  nativeBuildInputs = [ cmake pkgconfig unzip ];
+  nativeBuildInputs = [ cmake pkg-config unzip ];
 
   NIX_CFLAGS_COMPILE = lib.optionalString enableEXR "-I${ilmbase.dev}/include/OpenEXR";
 
@@ -253,8 +253,6 @@ stdenv.mkDerivation {
     "-DOPENCV_SKIP_PYTHON_LOADER=ON"
   ];
 
-  enableParallelBuilding = true;
-
   postBuild = lib.optionalString enableDocs ''
     make doxygen
   '';
@@ -280,7 +278,7 @@ stdenv.mkDerivation {
 
   passthru = lib.optionalAttrs enablePython { pythonPath = []; };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/opencv/default.nix b/nixpkgs/pkgs/development/libraries/opencv/default.nix
index 56414cfa3979..2575f6bb45d5 100644
--- a/nixpkgs/pkgs/development/libraries/opencv/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opencv/default.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchFromGitHub, cmake, pkgconfig, unzip
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, unzip
 , zlib
 , enablePython ? false, pythonPackages
 , enableGtk2 ? false, gtk2
@@ -57,7 +57,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = lib.optional enablePython pythonPackages.numpy;
 
-  nativeBuildInputs = [ cmake pkgconfig unzip ];
+  nativeBuildInputs = [ cmake pkg-config unzip ];
 
   NIX_CFLAGS_COMPILE = lib.optionalString enableEXR "-I${ilmbase.dev}/include/OpenEXR";
 
@@ -69,11 +69,9 @@ stdenv.mkDerivation rec {
     (opencvFlag "GSTREAMER" enableGStreamer)
   ];
 
-  enableParallelBuilding = true;
-
   hardeningDisable = [ "bindnow" "relro" ];
 
-  # Fix pkgconfig file that gets broken with multiple outputs
+  # 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|"
@@ -81,7 +79,7 @@ stdenv.mkDerivation rec {
 
   passthru = lib.optionalAttrs enablePython { pythonPath = []; };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Open Computer Vision Library with more than 500 algorithms";
     homepage = "https://opencv.org/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/opendbx/default.nix b/nixpkgs/pkgs/development/libraries/opendbx/default.nix
index 954e6cc6b663..a9eb209edda8 100644
--- a/nixpkgs/pkgs/development/libraries/opendbx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opendbx/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, readline, libmysqlclient, postgresql, sqlite }:
+{ lib, stdenv, fetchurl, readline, libmysqlclient, postgresql, sqlite }:
 
-let inherit (stdenv.lib) getDev; in
+let inherit (lib) getDev; in
 
 stdenv.mkDerivation rec {
   name = "opendbx-1.4.6";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ readline libmysqlclient postgresql sqlite ];
 
-  meta = with stdenv.lib; {
+  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
index e160bfb7d367..7f4f186c923d 100644
--- a/nixpkgs/pkgs/development/libraries/opendht/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opendht/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , cmake, pkg-config
 , asio, nettle, gnutls, msgpack, readline, libargon2
 }:
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "lib" "dev" "man" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A C++11 Kademlia distributed hash table implementation";
     homepage    = "https://github.com/savoirfairelinux/opendht";
     license     = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/opendkim/default.nix b/nixpkgs/pkgs/development/libraries/opendkim/default.nix
index 7cbd85055ef6..90c7fb85d426 100644
--- a/nixpkgs/pkgs/development/libraries/opendkim/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opendkim/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libbsd, openssl, libmilter
+{ lib, stdenv, fetchurl, pkg-config, libbsd, openssl, libmilter
 , autoreconfHook, perl, makeWrapper }:
 
 stdenv.mkDerivation rec {
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     "ac_cv_func_realloc_0_nonnull=yes"
   ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig makeWrapper ];
+  nativeBuildInputs = [ autoreconfHook pkg-config makeWrapper ];
 
   buildInputs = [ libbsd openssl libmilter perl ];
 
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
       --prefix PATH : ${openssl.bin}/bin
   '';
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/opendmarc/default.nix b/nixpkgs/pkgs/development/libraries/opendmarc/default.nix
index 9b45cc244f26..0dedfa3a85ed 100644
--- a/nixpkgs/pkgs/development/libraries/opendmarc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opendmarc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, libmilter, perl, perlPackages, makeWrapper }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, libmilter, perl, perlPackages, makeWrapper }:
 
 stdenv.mkDerivation rec {
   pname = "opendmarc";
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/openexr/default.nix b/nixpkgs/pkgs/development/libraries/openexr/default.nix
index b33b284f45cb..4e04de30d654 100644
--- a/nixpkgs/pkgs/development/libraries/openexr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openexr/default.nix
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
   propagatedBuildInputs = [ ilmbase zlib ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A high dynamic-range (HDR) image file format";
     homepage = "https://www.openexr.com/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/openexrid-unstable/default.nix b/nixpkgs/pkgs/development/libraries/openexrid-unstable/default.nix
index 92cd343cf6a1..ce35aa1c655e 100644
--- a/nixpkgs/pkgs/development/libraries/openexrid-unstable/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openexrid-unstable/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, unzip, re2, openfx, zlib, ilmbase, libGLU, libGL, openexr }:
+{ lib, stdenv, fetchFromGitHub, unzip, re2, openfx, zlib, ilmbase, libGLU, libGL, openexr }:
 
 stdenv.mkDerivation {
   pname = "openexrid-unstable";
@@ -44,7 +44,7 @@ stdenv.mkDerivation {
       mv $out/lib $lib/
   '';
 
-  meta = with stdenv.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 ];
diff --git a/nixpkgs/pkgs/development/libraries/openfst/default.nix b/nixpkgs/pkgs/development/libraries/openfst/default.nix
index f652c5ee7b7c..51e661eabb3b 100644
--- a/nixpkgs/pkgs/development/libraries/openfst/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openfst/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook }:
+{ lib, stdenv, fetchurl, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "openfst";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for working with finite-state transducers";
     longDescription = ''
       Library for constructing, combining, optimizing, and searching weighted finite-state transducers (FSTs).
diff --git a/nixpkgs/pkgs/development/libraries/openfx/default.nix b/nixpkgs/pkgs/development/libraries/openfx/default.nix
index 4a7927bfcb2e..0d8afe53df8b 100644
--- a/nixpkgs/pkgs/development/libraries/openfx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openfx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, unzip }:
+{ lib, stdenv, fetchFromGitHub, unzip }:
 
 stdenv.mkDerivation {
   pname = "openfx";
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
      cp -r include/* $dev/include/OpenFX/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Image processing plug-in standard";
     homepage = "http://openeffects.org/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/opengrm-ngram/default.nix b/nixpkgs/pkgs/development/libraries/opengrm-ngram/default.nix
index ab546c6d0d45..9b105808b8bb 100644
--- a/nixpkgs/pkgs/development/libraries/opengrm-ngram/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opengrm-ngram/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, autoreconfHook, fetchurl, openfst }:
+{ lib, stdenv, autoreconfHook, fetchurl, openfst }:
 
 stdenv.mkDerivation rec {
   pname = "opengrm-ngram";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/openh264/default.nix b/nixpkgs/pkgs/development/libraries/openh264/default.nix
index ee430f800dd3..6e856b04ac4a 100644
--- a/nixpkgs/pkgs/development/libraries/openh264/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openh264/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, nasm }:
+{ lib, stdenv, fetchFromGitHub, nasm }:
 
 stdenv.mkDerivation rec {
   pname = "openh264";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "PREFIX=${placeholder "out"}" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A codec library which supports H.264 encoding and decoding";
     homepage = "https://www.openh264.org";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/openhmd/default.nix b/nixpkgs/pkgs/development/libraries/openhmd/default.nix
index 66656a142342..a692dcb5e4e3 100644
--- a/nixpkgs/pkgs/development/libraries/openhmd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openhmd/default.nix
@@ -1,45 +1,52 @@
-{ lib, stdenv, fetchFromGitHub, pkgconfig, cmake, hidapi
-, withExamples ? true, SDL2 ? null, libGL ? null, glew ? null
+{ lib, stdenv
+, fetchFromGitHub
+, cmake
+, pkg-config
+, hidapi
+, SDL2
+, libGL
+, glew
+, withExamples ? true
 }:
 
-with lib;
+let examplesOnOff = if withExamples then "ON" else "OFF"; in
 
-let onoff = if withExamples then "ON" else "OFF"; in
-
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   pname = "openhmd";
-  version = "0.3.0-rc1-20181218";
+  version = "0.3.0";
 
   src = fetchFromGitHub {
     owner = "OpenHMD";
     repo = "OpenHMD";
-    rev = "80d51bea575a5bf71bb3a0b9683b80ac3146596a";
-    sha256 = "09011vnlsn238r5vbb1ab57x888ljaa34xibrnfbm5bl9417ii4z";
+    rev = version;
+    sha256 = "1hkpdl4zgycag5k8njvqpx01apxmm8m8pvhlsxgxpqiqy9a38ccg";
   };
 
-  nativeBuildInputs = [ pkgconfig cmake ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
   buildInputs = [
     hidapi
-  ] ++ optionals withExamples [
-    SDL2 libGL glew
+  ] ++ lib.optionals withExamples [
+    SDL2
+    glew
+    libGL
   ];
 
   cmakeFlags = [
     "-DBUILD_BOTH_STATIC_SHARED_LIBS=ON"
-    "-DOPENHMD_EXAMPLE_SIMPLE=${onoff}"
-    "-DOPENHMD_EXAMPLE_SDL=${onoff}"
+    "-DOPENHMD_EXAMPLE_SIMPLE=${examplesOnOff}"
+    "-DOPENHMD_EXAMPLE_SDL=${examplesOnOff}"
     "-DOpenGL_GL_PREFERENCE=GLVND"
   ];
 
-  postInstall = optionalString withExamples ''
+  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 = {
-    homepage = "http://www.openhmd.net";
+  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
@@ -48,7 +55,7 @@ stdenv.mkDerivation {
       Oculus Rift, HTC Vive, Windows Mixed Reality, and etc.
     '';
     license = licenses.boost;
-    maintainers = [ maintainers.oxij ];
+    maintainers = with maintainers; [ oxij ];
     platforms = platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/openimagedenoise/default.nix b/nixpkgs/pkgs/development/libraries/openimagedenoise/default.nix
index 2ac74c6c240b..03f9118ef7c0 100644
--- a/nixpkgs/pkgs/development/libraries/openimagedenoise/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openimagedenoise/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, cmake, tbb, python, ispc }:
+{ lib, stdenv, fetchzip, cmake, tbb, python, ispc }:
 
 stdenv.mkDerivation rec {
   pname = "openimagedenoise";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake python ispc ];
   buildInputs = [ tbb ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://openimagedenoise.github.io";
     description = "High-Performance Denoising Library for Ray Tracing";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/openjpeg/2.x.nix b/nixpkgs/pkgs/development/libraries/openjpeg/2.x.nix
index fe0e5aeb6914..edb9c9bf8c90 100644
--- a/nixpkgs/pkgs/development/libraries/openjpeg/2.x.nix
+++ b/nixpkgs/pkgs/development/libraries/openjpeg/2.x.nix
@@ -1,10 +1,10 @@
 { callPackage, fetchpatch, ... } @ args:
 
 callPackage ./generic.nix (args // rec {
-  version = "2.3.1";
-  branch = "2.3";
+  version = "2.4.0";
+  branch = "2.4";
   revision = "v${version}";
-  sha256 = "1dn98d2dfa1lqyxxmab6rrcv52dyhjr4g7i4xf2w54fqsx14ynrb";
+  sha256 = "143dvy5g6v6129lzvl0r8mrgva2fppkn0zl099qmi9yi9l9h7yyf";
 
   extraFlags = [
     "-DOPENJPEG_INSTALL_INCLUDE_DIR=${placeholder "dev"}/include/openjpeg-${branch}"
@@ -14,24 +14,8 @@ callPackage ./generic.nix (args // rec {
   patches = [
     ./fix-cmake-config-includedir.patch
     (fetchpatch {
-      url = "https://github.com/uclouvain/openjpeg/commit/21399f6b7d318fcdf4406d5e88723c4922202aa3.patch";
-      name = "CVE-2019-12973-1.patch";
-      sha256 = "161yvnfbzy2016qqapm0ywfgglgs1v8ljnk6fj8d2bwdh1cxxz8f";
-    })
-    (fetchpatch {
-      url = "https://github.com/uclouvain/openjpeg/commit/3aef207f90e937d4931daf6d411e092f76d82e66.patch";
-      name = "CVE-2019-12973-2.patch";
-      sha256 = "1jkkfw13l7nx4hxdhc7z17f4vfgqcaf09zpl235kypbxx1ygc7vq";
-    })
-    (fetchpatch {
-      url = "https://github.com/uclouvain/openjpeg/commit/024b8407392cb0b82b04b58ed256094ed5799e04.patch";
-      name = "CVE-2020-6851.patch";
-      sha256 = "1lfwlzqxb69cwzjp8v9lijz4c2qhf3b8m6sq1khipqlgrb3l58xw";
-    })
-    (fetchpatch {
-      url = "https://github.com/uclouvain/openjpeg/commit/05f9b91e60debda0e83977e5e63b2e66486f7074.patch";
-      name = "CVE-2020-8112.patch";
-      sha256 = "16kykc8wbq9kx9w9kkf3i7snak82m184qrl9bpxvkjl7h0n9aw49";
+      url = "https://patch-diff.githubusercontent.com/raw/uclouvain/openjpeg/pull/1321.patch";
+      sha256 = "1cjpr76nf9g65nqkfnxnjzi3bv7ifbxpc74kxxibh58pzjlp6al8";
     })
   ];
 })
diff --git a/nixpkgs/pkgs/development/libraries/openjpeg/fix-cmake-config-includedir.patch b/nixpkgs/pkgs/development/libraries/openjpeg/fix-cmake-config-includedir.patch
index 6ff720ead4e1..21306400dd46 100644
--- a/nixpkgs/pkgs/development/libraries/openjpeg/fix-cmake-config-includedir.patch
+++ b/nixpkgs/pkgs/development/libraries/openjpeg/fix-cmake-config-includedir.patch
@@ -1,14 +1,3 @@
---- a/cmake/OpenJPEGConfig.cmake.in
-+++ b/cmake/OpenJPEGConfig.cmake.in
-@@ -32,7 +32,7 @@
-   set(INC_DIR "@CMAKE_INSTALL_PREFIX@/@OPENJPEG_INSTALL_INCLUDE_DIR@")
-   file(RELATIVE_PATH PKG_TO_INC_RPATH "${PKG_DIR}" "${INC_DIR}")
- 
--  get_filename_component(OPENJPEG_INCLUDE_DIRS "${SELF_DIR}/${PKG_TO_INC_RPATH}" ABSOLUTE)
-+  get_filename_component(OPENJPEG_INCLUDE_DIRS "@OPENJPEG_INSTALL_INCLUDE_DIR@" ABSOLUTE)
- 
- else()
-   if(EXISTS ${SELF_DIR}/OpenJPEGExports.cmake)
 --- a/src/lib/openjp2/libopenjp2.pc.cmake.in
 +++ b/src/lib/openjp2/libopenjp2.pc.cmake.in
 @@ -3,7 +3,7 @@
diff --git a/nixpkgs/pkgs/development/libraries/openjpeg/generic.nix b/nixpkgs/pkgs/development/libraries/openjpeg/generic.nix
index 07d7b19ede4b..8c1f18b987d5 100644
--- a/nixpkgs/pkgs/development/libraries/openjpeg/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/openjpeg/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
 , libpng, libtiff, lcms2, jpylyzer
 , mj2Support ? true # MJ2 executables
 , jpwlLibSupport ? true # JPWL library & executables
@@ -19,7 +19,7 @@ assert jpipServerSupport -> jpipLibSupport && curl != null && fcgi != null;
 assert (openjpegJarSupport || jpipLibSupport) -> jdk != null;
 
 let
-  inherit (stdenv.lib) optional optionals;
+  inherit (lib) optional optionals;
   mkFlag = optSet: flag: "-D${flag}=${if optSet then "ON" else "OFF"}";
 in
 
@@ -54,7 +54,7 @@ stdenv.mkDerivation {
     (mkFlag testsSupport "BUILD_TESTING")
   ] ++ extraFlags;
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
   buildInputs = [ ]
     ++ optionals jpipServerSupport [ curl fcgi ]
@@ -74,9 +74,9 @@ stdenv.mkDerivation {
     incDir = "openjpeg-${branch}";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Open-source JPEG 2000 codec written in C language";
-    homepage = "http://www.openjpeg.org/";
+    homepage = "https://www.openjpeg.org/";
     license = licenses.bsd2;
     maintainers = with maintainers; [ codyopel ];
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/openldap/default.nix b/nixpkgs/pkgs/development/libraries/openldap/default.nix
index fdf3298a6fad..4d4ec1763f0f 100644
--- a/nixpkgs/pkgs/development/libraries/openldap/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openldap/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, openssl, cyrus_sasl, db, groff, libtool }:
+{ lib, stdenv, fetchurl, openssl, cyrus_sasl, db, groff, libtool }:
 
 stdenv.mkDerivation rec {
   pname = "openldap";
@@ -34,12 +34,12 @@ stdenv.mkDerivation rec {
     "--sysconfdir=/etc"
     "--localstatedir=/var"
     "--enable-crypt"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "--with-yielding_select=yes"
     "ac_cv_func_memcmp_working=yes"
-  ] ++ stdenv.lib.optional (openssl == null) "--without-tls"
-    ++ stdenv.lib.optional (cyrus_sasl == null) "--without-cyrus-sasl"
-    ++ stdenv.lib.optional stdenv.isFreeBSD "--with-pic";
+  ] ++ lib.optional (openssl == null) "--without-tls"
+    ++ lib.optional (cyrus_sasl == null) "--without-cyrus-sasl"
+    ++ lib.optional stdenv.isFreeBSD "--with-pic";
 
   postBuild = ''
     make $makeFlags CC=$CC -C contrib/slapd-modules/passwd/sha2
@@ -75,7 +75,7 @@ stdenv.mkDerivation rec {
     chmod +x "$out"/lib/*.{so,dylib}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.openldap.org/";
     description = "An open source implementation of the Lightweight Directory Access Protocol";
     license = licenses.openldap;
diff --git a/nixpkgs/pkgs/development/libraries/openmpi/default.nix b/nixpkgs/pkgs/development/libraries/openmpi/default.nix
index 95c2a9c3fcf4..802685970ace 100644
--- a/nixpkgs/pkgs/development/libraries/openmpi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openmpi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, gfortran, perl, libnl
+{ lib, stdenv, fetchurl, fetchpatch, gfortran, perl, libnl
 , rdma-core, zlib, numactl, libevent, hwloc, targetPackages, symlinkJoin
 , libpsm2, libfabric, pmix, ucx
 
@@ -28,7 +28,7 @@ in stdenv.mkDerivation rec {
   pname = "openmpi";
   inherit version;
 
-  src = with stdenv.lib.versions; fetchurl {
+  src = with lib.versions; fetchurl {
     url = "https://www.open-mpi.org/software/ompi/v${major version}.${minor version}/downloads/${pname}-${version}.tar.bz2";
     sha256 = "02f0r9d3xgs08svkmj8v7lzviyxqnkk4yd3z0wql550xnriki3y5";
   };
@@ -97,7 +97,7 @@ in stdenv.mkDerivation rec {
     inherit cudaSupport cudatoolkit;
   };
 
-  meta = with stdenv.lib; {
+  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.";
diff --git a/nixpkgs/pkgs/development/libraries/openpa/default.nix b/nixpkgs/pkgs/development/libraries/openpa/default.nix
index 46729f660b14..bc8efdc857eb 100644
--- a/nixpkgs/pkgs/development/libraries/openpa/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openpa/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, file }:
+{ lib, stdenv, fetchurl, file }:
 
 stdenv.mkDerivation rec {
   pname = "openpa";
@@ -9,16 +9,16 @@ stdenv.mkDerivation rec {
     sha256 = "0flyi596hm6fv7xyw2iykx3s65p748s62bf15624xcnwpfrh8ncy";
   };
 
-  prePatch = ''substituteInPlace configure --replace /usr/bin/file ${file}/bin/file'';
+  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 = stdenv.lib.licenses.mit;
-    maintainers = with stdenv.lib.maintainers; [ leenaars ];
-    platforms = with stdenv.lib.platforms; linux;
+    license = lib.licenses.mit;
+    maintainers = with lib.maintainers; [ leenaars ];
+    platforms = with lib.platforms; linux;
     longDescription = ''
       OPA (or sometimes OpenPA or Open Portable Atomics) is an
       open source library intended to provide a consistent C API for performing
diff --git a/nixpkgs/pkgs/development/libraries/opensaml-cpp/default.nix b/nixpkgs/pkgs/development/libraries/opensaml-cpp/default.nix
index 0edf6dfa7283..4f83f22856e3 100644
--- a/nixpkgs/pkgs/development/libraries/opensaml-cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opensaml-cpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, autoreconfHook, pkgconfig
+{ lib, stdenv, fetchgit, autoreconfHook, pkg-config
 , boost, openssl, log4shib, xercesc, xml-security-c, xml-tooling-c, zlib
 }:
 
@@ -15,13 +15,13 @@ stdenv.mkDerivation rec {
   buildInputs = [
     boost openssl log4shib xercesc xml-security-c xml-tooling-c zlib
   ];
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
   configureFlags = [ "--with-xmltooling=${xml-tooling-c}" ];
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/openscenegraph/default.nix b/nixpkgs/pkgs/development/libraries/openscenegraph/default.nix
index e2a52a933333..8eeff3de9435 100644
--- a/nixpkgs/pkgs/development/libraries/openscenegraph/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openscenegraph/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig, doxygen,
+{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, doxygen,
   libX11, libXinerama, libXrandr, libGLU, libGL,
   glib, ilmbase, libxml2, pcre, zlib,
   AGL, Carbon, Cocoa, Foundation,
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
     sha256 = "0x8hdbzw0b71j91fzp9cwmy9a7ava8v8wwyj8nxijq942vdx1785";
   };
 
-  nativeBuildInputs = [ pkgconfig cmake doxygen ];
+  nativeBuildInputs = [ pkg-config cmake doxygen ];
 
   buildInputs = [
     libX11 libXinerama libXrandr libGLU libGL
@@ -66,7 +66,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = lib.optional (!withApps) "-DBUILD_OSG_APPLICATIONS=OFF" ++ lib.optional withExamples "-DBUILD_OSG_EXAMPLES=ON";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A 3D graphics toolkit";
     homepage = "http://www.openscenegraph.org/";
     maintainers = with maintainers; [ aanderse raskin ];
diff --git a/nixpkgs/pkgs/development/libraries/openslp/default.nix b/nixpkgs/pkgs/development/libraries/openslp/default.nix
index 68cb40abf723..ddc0e893596f 100644
--- a/nixpkgs/pkgs/development/libraries/openslp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openslp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch }:
+{ lib, stdenv, fetchurl, fetchpatch }:
 
 stdenv.mkDerivation {
   name = "openslp-2.0.0";
@@ -22,7 +22,7 @@ stdenv.mkDerivation {
     ./CVE-2016-4912.patch
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.openslp.org/";
     description = "An open-source implementation of the IETF Service Location Protocol";
     maintainers = with maintainers; [ ttuegel ];
diff --git a/nixpkgs/pkgs/development/libraries/openssl/chacha.nix b/nixpkgs/pkgs/development/libraries/openssl/chacha.nix
index b37142082d81..bae3e53f441f 100644
--- a/nixpkgs/pkgs/development/libraries/openssl/chacha.nix
+++ b/nixpkgs/pkgs/development/libraries/openssl/chacha.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchFromGitHub, perl, zlib
+{ lib, stdenv, fetchFromGitHub, perl, zlib
 , withCryptodev ? false, cryptodev
 }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation {
   pname = "openssl-chacha";
   version = "2016-08-22";
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
   setOutputFlags = false;
 
   nativeBuildInputs = [ perl zlib ];
-  buildInputs = stdenv.lib.optional withCryptodev cryptodev;
+  buildInputs = lib.optional withCryptodev cryptodev;
 
   configureScript = "./config";
 
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
     "enable-gost"
     "--libdir=lib"
     "--openssldir=etc/ssl"
-  ] ++ stdenv.lib.optionals withCryptodev [
+  ] ++ lib.optionals withCryptodev [
     "-DHAVE_CRYPTODEV"
     "-DUSE_CRYPTODEV_DIGESTS"
   ];
@@ -75,7 +75,7 @@ stdenv.mkDerivation {
     homepage = "https://www.openssl.org/";
     description = "A cryptographic library that implements the SSL and TLS protocols";
     platforms = [ "x86_64-linux" ];
-    maintainers = [ stdenv.lib.maintainers.cstrahan ];
+    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
index 2570c7cdb25a..ce4374be3312 100644
--- a/nixpkgs/pkgs/development/libraries/openssl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openssl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, buildPackages, perl, coreutils
+{ lib, stdenv, fetchurl, buildPackages, perl, coreutils
 , withCryptodev ? false, cryptodev
 , enableSSL2 ? false
 , enableSSL3 ? false
@@ -10,7 +10,7 @@
 # cgit) that are needed here should be included directly in Nixpkgs as
 # files.
 
-with stdenv.lib;
+with lib;
 
 let
   common = { version, sha256, patches ? [], withDocs ? false, extraMeta ? {} }:
@@ -46,7 +46,7 @@ let
     separateDebugInfo = !(stdenv.hostPlatform.useLLVM or false) && stdenv.cc.isGNU;
 
     nativeBuildInputs = [ perl ];
-    buildInputs = stdenv.lib.optional withCryptodev cryptodev;
+    buildInputs = lib.optional withCryptodev cryptodev;
 
     # TODO(@Ericson2314): Improve with mass rebuild
     configurePlatforms = [];
@@ -78,16 +78,16 @@ let
       "shared" # "shared" builds both shared and static libraries
       "--libdir=lib"
       "--openssldir=etc/ssl"
-    ] ++ stdenv.lib.optionals withCryptodev [
+    ] ++ lib.optionals withCryptodev [
       "-DHAVE_CRYPTODEV"
       "-DUSE_CRYPTODEV_DIGESTS"
-    ] ++ stdenv.lib.optional enableSSL2 "enable-ssl2"
-      ++ stdenv.lib.optional enableSSL3 "enable-ssl3"
-      ++ stdenv.lib.optional (versionAtLeast version "1.1.0" && stdenv.hostPlatform.isAarch64) "no-afalgeng"
+    ] ++ 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.
-      ++ stdenv.lib.optional (versionAtLeast version "1.1.0" && static) "no-shared";
+      ++ lib.optional (versionAtLeast version "1.1.0" && static) "no-shared";
 
     makeFlags = [
       "MANDIR=$(man)/share/man"
@@ -101,7 +101,7 @@ let
     enableParallelBuilding = true;
 
     postInstall =
-    stdenv.lib.optionalString (!static) ''
+    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
@@ -111,7 +111,7 @@ let
     '' +
     ''
       mkdir -p $bin
-    '' + stdenv.lib.optionalString (!stdenv.hostPlatform.isWindows)
+    '' + lib.optionalString (!stdenv.hostPlatform.isWindows)
     ''
       substituteInPlace $out/bin/c_rehash --replace ${buildPackages.perl} ${perl}
     '' +
@@ -127,7 +127,7 @@ let
       rmdir $out/etc/ssl/{certs,private}
     '';
 
-    postFixup = stdenv.lib.optionalString (!stdenv.hostPlatform.isWindows) ''
+    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
@@ -135,7 +135,7 @@ let
       fi
     '';
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       homepage = "https://www.openssl.org/";
       description = "A cryptographic library that implements the SSL and TLS protocols";
       license = licenses.openssl;
diff --git a/nixpkgs/pkgs/development/libraries/opensubdiv/default.nix b/nixpkgs/pkgs/development/libraries/opensubdiv/default.nix
index 35a8358b5148..9228424797e2 100644
--- a/nixpkgs/pkgs/development/libraries/opensubdiv/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opensubdiv/default.nix
@@ -1,4 +1,4 @@
-{ config, lib, stdenv, fetchFromGitHub, cmake, pkgconfig, xorg, libGLU
+{ config, lib, stdenv, fetchFromGitHub, cmake, pkg-config, xorg, libGLU
 , libGL, glew, ocl-icd, python3
 , cudaSupport ? config.cudaSupport or false, cudatoolkit
 , darwin
@@ -17,8 +17,9 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
+  nativeBuildInputs = [ cmake pkg-config ];
   buildInputs =
-    [ cmake pkgconfig libGLU libGL python3
+    [ 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
@@ -40,8 +41,6 @@ stdenv.mkDerivation rec {
       "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/cc"
     ];
 
-  enableParallelBuilding = true;
-
   postInstall = "rm $out/lib/*.a";
 
   meta = {
diff --git a/nixpkgs/pkgs/development/libraries/opentracing-cpp/default.nix b/nixpkgs/pkgs/development/libraries/opentracing-cpp/default.nix
index a31350a5f962..9c99ee6027dd 100644
--- a/nixpkgs/pkgs/development/libraries/opentracing-cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/opentracing-cpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 stdenv.mkDerivation rec {
   pname = "opentracing-cpp";
   version = "1.5.1";
@@ -8,13 +8,14 @@ stdenv.mkDerivation rec {
     rev = "v${version}";
     sha256 = "04kw19g8qrv3kd40va3sqbfish7kfczkdpxdwraifk9950wfs3gx";
   };
-  buildInputs = [ cmake ];
+
+  nativeBuildInputs = [ cmake ];
 
   meta = {
     description = "C++ implementation of the OpenTracing API";
     homepage = "https://opentracing.io";
-    license = stdenv.lib.licenses.asl20;
-    maintainers = with stdenv.lib.maintainers; [ rob ];
+    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
index 38e50fb367e1..5f3a03a3f5bf 100644
--- a/nixpkgs/pkgs/development/libraries/openvdb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openvdb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, unzip, openexr, boost, jemalloc, c-blosc, ilmbase, tbb }:
+{ lib, stdenv, fetchFromGitHub, unzip, openexr, boost, jemalloc, c-blosc, ilmbase, tbb }:
 
 stdenv.mkDerivation rec
 {
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec
   NIX_CFLAGS_COMPILE="-I${openexr.dev}/include/OpenEXR -I${ilmbase.dev}/include/OpenEXR/";
   NIX_LDFLAGS="-lboost_iostreams";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An open framework for voxel";
     homepage = "https://www.openvdb.org";
     maintainers = [ maintainers.guibou ];
diff --git a/nixpkgs/pkgs/development/libraries/openwsman/default.nix b/nixpkgs/pkgs/development/libraries/openwsman/default.nix
index a16b8356e618..05f1ef65a304 100644
--- a/nixpkgs/pkgs/development/libraries/openwsman/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openwsman/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config
 , curl, libxml2, pam, sblim-sfcc }:
 
 stdenv.mkDerivation rec {
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "19dj38jyzhhhvk863cikcwk5awzlq3337pxmsaqqm4wrcygrkfmx";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
   buildInputs = [ curl libxml2 pam sblim-sfcc ];
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--disable-more-warnings" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description  = "Openwsman server implementation and client API with bindings";
     downloadPage = "https://github.com/Openwsman/openwsman/releases";
     homepage     = "https://openwsman.github.io";
diff --git a/nixpkgs/pkgs/development/libraries/openxr-loader/default.nix b/nixpkgs/pkgs/development/libraries/openxr-loader/default.nix
index f0c4c47db03b..2f901f0e4128 100644
--- a/nixpkgs/pkgs/development/libraries/openxr-loader/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openxr-loader/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, python3, libX11, libXxf86vm, libXrandr, vulkan-headers, libGL }:
+{ lib, stdenv, fetchFromGitHub, cmake, python3, libX11, libXxf86vm, libXrandr, vulkan-headers, libGL }:
 
 stdenv.mkDerivation rec {
   pname = "openxr-loader";
@@ -13,7 +13,6 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake python3 ];
   buildInputs = [ libX11 libXxf86vm libXrandr vulkan-headers libGL ];
-  enableParallelBuilding = true;
 
   cmakeFlags = [ "-DBUILD_TESTS=OFF" ];
 
@@ -30,7 +29,7 @@ stdenv.mkDerivation rec {
     mv "$out/lib/libXrApiLayer"* "$layers/lib"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Khronos OpenXR loader";
     homepage    = "https://www.khronos.org/openxr";
     platforms   = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/openzwave/default.nix b/nixpkgs/pkgs/development/libraries/openzwave/default.nix
index dd7a367652d7..0a617561a892 100644
--- a/nixpkgs/pkgs/development/libraries/openzwave/default.nix
+++ b/nixpkgs/pkgs/development/libraries/openzwave/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchFromGitHub
-, doxygen, fontconfig, graphviz-nox, libxml2, pkgconfig, which
+{ lib, stdenv, fetchFromGitHub
+, doxygen, fontconfig, graphviz-nox, libxml2, pkg-config, which
 , systemd }:
 
 let
@@ -18,7 +18,7 @@ in stdenv.mkDerivation {
     sha256 = "04g8fb4f4ihakvvsmzcnncgfdd2ikmki7s22i9c6layzdwavbwf1";
   };
 
-  nativeBuildInputs = [ doxygen fontconfig graphviz-nox libxml2 pkgconfig which ];
+  nativeBuildInputs = [ doxygen fontconfig graphviz-nox libxml2 pkg-config which ];
 
   buildInputs = [ systemd ];
 
@@ -48,10 +48,10 @@ in stdenv.mkDerivation {
       --replace dir=    dir=$out
 
     substituteInPlace $out/bin/ozw_config \
-      --replace pcfile=${pkgconfig} pcfile=$out
+      --replace pcfile=${pkg-config} pcfile=$out
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/oracle-instantclient/default.nix b/nixpkgs/pkgs/development/libraries/oracle-instantclient/default.nix
index aba9c75ad465..c6efc901e8ae 100644
--- a/nixpkgs/pkgs/development/libraries/oracle-instantclient/default.nix
+++ b/nixpkgs/pkgs/development/libraries/oracle-instantclient/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , autoPatchelfHook
 , fixDarwinDylibNames
@@ -12,7 +12,7 @@
 assert odbcSupport -> unixODBC != null;
 
 let
-  inherit (stdenv.lib) optional optionals optionalString;
+  inherit (lib) optional optionals optionalString;
 
   throwSystem = throw "Unsupported system: ${stdenv.hostPlatform.system}";
 
@@ -114,7 +114,7 @@ in stdenv.mkDerivation {
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Oracle instant client libraries and sqlplus CLI";
     longDescription = ''
       Oracle instant client provides access to Oracle databases (OCI,
diff --git a/nixpkgs/pkgs/development/libraries/orcania/default.nix b/nixpkgs/pkgs/development/libraries/orcania/default.nix
index 4a01de54a6d9..5c9c2c8da7f2 100644
--- a/nixpkgs/pkgs/development/libraries/orcania/default.nix
+++ b/nixpkgs/pkgs/development/libraries/orcania/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, check, subunit }:
+{ lib, stdenv, fetchFromGitHub, cmake, check, subunit }:
 stdenv.mkDerivation rec {
   pname = "orcania";
   version = "2.1.1";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     export DYLD_FALLBACK_LIBRARY_PATH="$(pwd):$DYLD_FALLBACK_LIBRARY_PATH"
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/ortp/default.nix b/nixpkgs/pkgs/development/libraries/ortp/default.nix
index ecd15498432c..196cac4bcafc 100644
--- a/nixpkgs/pkgs/development/libraries/ortp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ortp/default.nix
@@ -1,7 +1,7 @@
 { bctoolbox
 , cmake
 , fetchFromGitLab
-, stdenv
+, lib, stdenv
 }:
 
 stdenv.mkDerivation rec {
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ bctoolbox ];
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A Real-Time Transport Protocol (RFC3550) stack";
     homepage = "https://linphone.org/technical-corner/ortp";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/osip/default.nix b/nixpkgs/pkgs/development/libraries/osip/default.nix
index 8b2dce1d950f..322ed30a8476 100644
--- a/nixpkgs/pkgs/development/libraries/osip/default.nix
+++ b/nixpkgs/pkgs/development/libraries/osip/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 stdenv.mkDerivation rec {
   version = "5.2.0";
   src = fetchurl {
@@ -8,11 +8,11 @@ stdenv.mkDerivation rec {
   pname = "libosip2";
 
   meta = {
-    license = stdenv.lib.licenses.lgpl21Plus;
+    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 stdenv.lib.maintainers; [ raskin ];
-    platforms = stdenv.lib.platforms.linux;
+    maintainers = with lib.maintainers; [ raskin ];
+    platforms = lib.platforms.linux;
     inherit version;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/osm-gps-map/default.nix b/nixpkgs/pkgs/development/libraries/osm-gps-map/default.nix
index e34a80e1d4a5..17a3af68a808 100644
--- a/nixpkgs/pkgs/development/libraries/osm-gps-map/default.nix
+++ b/nixpkgs/pkgs/development/libraries/osm-gps-map/default.nix
@@ -1,4 +1,4 @@
-{ cairo, fetchzip, glib, gnome3, gtk3, gobject-introspection, pkgconfig, stdenv }:
+{ cairo, fetchzip, glib, gnome3, gtk3, gobject-introspection, pkg-config, lib, stdenv }:
 
 stdenv.mkDerivation rec {
   pname = "osm-gps-map";
@@ -11,14 +11,14 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "doc" ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [
     cairo glib gobject-introspection
     gnome3.gnome-common gtk3 gnome3.libsoup
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GTK widget for displaying OpenStreetMap tiles";
     homepage = "https://nzjrs.github.io/osm-gps-map";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/p11-kit/default.nix b/nixpkgs/pkgs/development/libraries/p11-kit/default.nix
index 31a7e7e90867..0e09d563ea1f 100644
--- a/nixpkgs/pkgs/development/libraries/p11-kit/default.nix
+++ b/nixpkgs/pkgs/development/libraries/p11-kit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, pkgconfig, which
+{ lib, stdenv, fetchFromGitHub, fetchpatch, autoreconfHook, pkg-config, which
 , gettext, libffi, libiconv, libtasn1
 }:
 
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   # 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 pkgconfig which libtasn1 ];
+  nativeBuildInputs = [ autoreconfHook pkg-config which libtasn1 ];
   buildInputs = [ gettext libffi libiconv libtasn1 ];
 
   autoreconfPhase = ''
@@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
     "exampledir=${placeholder "out"}/etc/pkcs11"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for loading and sharing PKCS#11 modules";
     longDescription = ''
       Provides a way to load and enumerate PKCS#11 modules.
diff --git a/nixpkgs/pkgs/development/libraries/packr/default.nix b/nixpkgs/pkgs/development/libraries/packr/default.nix
index 017cb25a9d17..7bf0cb2c5fbc 100644
--- a/nixpkgs/pkgs/development/libraries/packr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/packr/default.nix
@@ -22,7 +22,7 @@ let p2 = buildGoModule rec {
 
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/pagmo2/default.nix b/nixpkgs/pkgs/development/libraries/pagmo2/default.nix
index 4723292199da..abef3d6cd1dd 100644
--- a/nixpkgs/pkgs/development/libraries/pagmo2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pagmo2/default.nix
@@ -1,5 +1,5 @@
 { fetchFromGitHub
-, stdenv
+, lib, stdenv
 , cmake
 , eigen
 , nlopt
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
   # tests pass but take 30+ minutes
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://esa.github.io/pagmo2/";
     description = "Scientific library for massively parallel optimization";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/pango/default.nix b/nixpkgs/pkgs/development/libraries/pango/default.nix
index b3dd2062ca0b..68511003215c 100644
--- a/nixpkgs/pkgs/development/libraries/pango/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pango/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, fetchpatch, pkgconfig, cairo, harfbuzz
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, cairo, harfbuzz
 , libintl, libthai, gobject-introspection, darwin, fribidi, gnome3
 , gtk-doc, docbook_xsl, docbook_xml_dtd_43, makeFontsConf, freefont_ttf
 , meson, ninja, glib
 , x11Support? !stdenv.isDarwin, libXft
 }:
 
-with stdenv.lib;
+with lib;
 
 let
   pname = "pango";
@@ -14,7 +14,7 @@ in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.xz";
     sha256 = "0ry3j9n0lvdfmjwi2w7wa4gkalnip56kghqq6bh8hcf45xjvh3bk";
   };
 
@@ -24,7 +24,7 @@ in stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson ninja
     glib # for glib-mkenum
-    pkgconfig gobject-introspection gtk-doc docbook_xsl docbook_xml_dtd_43
+    pkg-config gobject-introspection gtk-doc docbook_xsl docbook_xml_dtd_43
   ];
   buildInputs = [
     fribidi
@@ -40,7 +40,7 @@ in stdenv.mkDerivation rec {
 
   mesonFlags = [
     "-Dgtk_doc=${if stdenv.isDarwin then "false" else "true"}"
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.isDarwin [
     "-Dxft=disabled"  # only works with x11
   ];
 
@@ -59,7 +59,7 @@ in stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library for laying out and rendering of text, with an emphasis on internationalization";
 
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/pangolin/default.nix b/nixpkgs/pkgs/development/libraries/pangolin/default.nix
index 2b0e15468b12..0e5d705a1ce6 100644
--- a/nixpkgs/pkgs/development/libraries/pangolin/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pangolin/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, cmake, pkgconfig, doxygen, libGL, glew
+{ stdenv, lib, fetchFromGitHub, cmake, pkg-config, doxygen, libGL, glew
 , xorg , ffmpeg_3, python3 , libjpeg, libpng, libtiff, eigen
 , Carbon ? null, Cocoa ? null
 }:
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
     sha256 = "0pfbaarlsw7f7cmsppm7m13nz0k530wwwyczy2l9k448p3v7x9j0";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig doxygen ];
+  nativeBuildInputs = [ cmake pkg-config doxygen ];
 
   buildInputs = [
     libGL
@@ -30,8 +30,6 @@ stdenv.mkDerivation {
   ]
   ++ lib.optionals stdenv.isDarwin [ Carbon Cocoa ];
 
-  enableParallelBuilding = true;
-
   # The tests use cmake's findPackage to find the installed version of
   # pangolin, which isn't what we want (or available).
   doCheck = false;
@@ -50,8 +48,8 @@ stdenv.mkDerivation {
       graphical data.
     '';
     homepage = "https://github.com/stevenlovegrove/Pangolin";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.expipiplus1 ];
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.mit;
+    maintainers = [ lib.maintainers.expipiplus1 ];
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/pangomm/default.nix b/nixpkgs/pkgs/development/libraries/pangomm/default.nix
index b0488435ded6..0ff0d9a7d4e9 100644
--- a/nixpkgs/pkgs/development/libraries/pangomm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pangomm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, pango, glibmm, cairomm, gnome3
+{ lib, stdenv, fetchurl, pkg-config, pango, glibmm, cairomm, gnome3
 , ApplicationServices }:
 
 stdenv.mkDerivation rec {
@@ -6,13 +6,13 @@ stdenv.mkDerivation rec {
   version= "2.42.1";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "03zli5amizhv9bfklwfq7xyf0b5dagchx1lnz9f0v1rhk69h9gql";
   };
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig ] ++ stdenv.lib.optional stdenv.isDarwin [
+  nativeBuildInputs = [ pkg-config ] ++ lib.optional stdenv.isDarwin [
     ApplicationServices
   ];
   propagatedBuildInputs = [ pango glibmm cairomm ];
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ interface to the Pango text rendering library";
     homepage    = "https://www.pango.org/";
     license     = with licenses; [ lgpl2 lgpl21 ];
diff --git a/nixpkgs/pkgs/development/libraries/pangoxsl/default.nix b/nixpkgs/pkgs/development/libraries/pangoxsl/default.nix
index 26d012e81e1d..7d314a930f25 100644
--- a/nixpkgs/pkgs/development/libraries/pangoxsl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pangoxsl/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, pkgconfig, glib, pango}:
+{lib, stdenv, fetchurl, pkg-config, glib, pango}:
 
 stdenv.mkDerivation {
   name = "pangoxsl-1.6.0.3";
@@ -7,13 +7,13 @@ stdenv.mkDerivation {
     sha256 = "1wcd553nf4nwkrfrh765cyzwj9bsg7zpkndg2hjs8mhwgx04lm8n";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [
     glib
     pango
   ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/partio/default.nix b/nixpkgs/pkgs/development/libraries/partio/default.nix
index ba042562320b..0247d12715f6 100644
--- a/nixpkgs/pkgs/development/libraries/partio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/partio/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, unzip, cmake, freeglut, libGLU, libGL, zlib, swig, python, doxygen, xorg }:
+{ lib, stdenv, fetchFromGitHub, unzip, cmake, freeglut, libGLU, libGL, zlib, swig, python, doxygen, xorg }:
 
 stdenv.mkDerivation {
   pname = "partio";
@@ -16,8 +16,6 @@ stdenv.mkDerivation {
   nativeBuildInputs = [ unzip cmake doxygen ];
   buildInputs = [ freeglut libGLU libGL zlib swig python xorg.libXi xorg.libXmu ];
 
-  enableParallelBuilding = true;
-
   buildPhase = ''
     make partio
 
@@ -34,7 +32,7 @@ stdenv.mkDerivation {
     mv $dev/include/*.h $dev/include/partio
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/pc-ble-driver/default.nix b/nixpkgs/pkgs/development/libraries/pc-ble-driver/default.nix
index 7d7dbd53383b..1777b0856f80 100644
--- a/nixpkgs/pkgs/development/libraries/pc-ble-driver/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pc-ble-driver/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, git, cmake, catch2, asio, udev, IOKit }:
+{ lib, stdenv, fetchFromGitHub, git, cmake, catch2, asio, udev, IOKit }:
 
 stdenv.mkDerivation rec {
   pname = "pc-ble-driver";
@@ -20,13 +20,13 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [
 
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.isDarwin [
     IOKit
-  ] ++ stdenv.lib.optionals stdenv.isLinux [
+  ] ++ lib.optionals stdenv.isLinux [
     udev
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Desktop library for Bluetooth low energy development";
     homepage = "https://github.com/NordicSemiconductor/pc-ble-driver";
     license = licenses.unfreeRedistributable;
diff --git a/nixpkgs/pkgs/development/libraries/pcaudiolib/default.nix b/nixpkgs/pkgs/development/libraries/pcaudiolib/default.nix
index e9c5301aac56..ebdacdfc9bdb 100644
--- a/nixpkgs/pkgs/development/libraries/pcaudiolib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pcaudiolib/default.nix
@@ -1,5 +1,5 @@
 { config, stdenv, lib, fetchFromGitHub
-, autoconf, automake, which, libtool, pkgconfig
+, autoconf, automake, which, libtool, pkg-config
 , portaudio, alsaLib
 , pulseaudioSupport ? config.pulseaudio or stdenv.isLinux, libpulseaudio }:
 
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     sha256 = "0c55hlqqh0m7bcb3nlgv1s4a22s5bgczr1cakjh3767rjb10khi0";
   };
 
-  nativeBuildInputs = [ autoconf automake which libtool pkgconfig ];
+  nativeBuildInputs = [ autoconf automake which libtool pkg-config ];
 
   buildInputs = [ portaudio ]
     ++ lib.optionals stdenv.isLinux [ alsaLib ]
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   preConfigure = "./autogen.sh";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Provides a C API to different audio devices";
     homepage = "https://github.com/espeak-ng/pcaudiolib";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/pcg-c/default.nix b/nixpkgs/pkgs/development/libraries/pcg-c/default.nix
index 593794c9c4df..9722210b9d10 100644
--- a/nixpkgs/pkgs/development/libraries/pcg-c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pcg-c/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchzip }:
+{ lib, stdenv, fetchzip }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   version = "0.94";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A family of better random number generators";
     homepage = "https://www.pcg-random.org/";
-    license = stdenv.lib.licenses.asl20;
+    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,
diff --git a/nixpkgs/pkgs/development/libraries/pcl/default.nix b/nixpkgs/pkgs/development/libraries/pcl/default.nix
index 753f5ae39110..436e0f85e162 100644
--- a/nixpkgs/pkgs/development/libraries/pcl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pcl/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchFromGitHub, cmake
-, qhull, flann, boost, vtk, eigen, pkgconfig, qtbase
+{ lib, stdenv, fetchFromGitHub, cmake
+, qhull, flann, boost, vtk, eigen, pkg-config, qtbase
 , libusb1, libpcap, libXt, libpng, Cocoa, AGL, OpenGL
 }:
 
@@ -13,23 +13,21 @@ stdenv.mkDerivation rec {
     sha256 = "1cli2rxqsk6nxp36p5mgvvahjz8hm4fb68yi8cf9nw4ygbcvcwb1";
   };
 
-  enableParallelBuilding = true;
-
-  nativeBuildInputs = [ pkgconfig cmake ];
+  nativeBuildInputs = [ pkg-config cmake ];
   buildInputs = [ qhull flann boost eigen libusb1 libpcap
                   libpng vtk qtbase libXt ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa AGL ];
+    ++ lib.optionals stdenv.isDarwin [ Cocoa AGL ];
 
-  cmakeFlags = stdenv.lib.optionals stdenv.isDarwin [
+  cmakeFlags = lib.optionals stdenv.isDarwin [
     "-DOPENGL_INCLUDE_DIR=${OpenGL}/Library/Frameworks"
   ];
 
   meta = {
     homepage = "https://pointclouds.org/";
-    broken = stdenv.lib.versionAtLeast qtbase.version "5.15";
+    broken = lib.versionAtLeast qtbase.version "5.15";
     description = "Open project for 2D/3D image and point cloud processing";
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    license = lib.licenses.bsd3;
+    maintainers = with lib.maintainers; [viric];
+    platforms = with lib.platforms; linux ++ darwin;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/pcre/default.nix b/nixpkgs/pkgs/development/libraries/pcre/default.nix
index 8f19034c924b..8d9b9ec02599 100644
--- a/nixpkgs/pkgs/development/libraries/pcre/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pcre/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , pcre, windows ? null
 , variant ? null
 }:
 
-with stdenv.lib;
+with lib;
 
 assert elem variant [ null "cpp" "pcre16" "pcre32" ];
 
@@ -50,7 +50,7 @@ in stdenv.mkDerivation {
   meta = {
     homepage = "http://www.pcre.org/";
     description = "A library for Perl Compatible Regular Expressions";
-    license = stdenv.lib.licenses.bsd3;
+    license = lib.licenses.bsd3;
 
     longDescription = ''
       The PCRE library is a set of functions that implement regular
diff --git a/nixpkgs/pkgs/development/libraries/pcre2/default.nix b/nixpkgs/pkgs/development/libraries/pcre2/default.nix
index 8f06630882c8..6bf6cff98bbe 100644
--- a/nixpkgs/pkgs/development/libraries/pcre2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pcre2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "pcre2";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--enable-pcre2-16"
     "--enable-pcre2-32"
-  ] ++ stdenv.lib.optional (!stdenv.hostPlatform.isRiscV) "--enable-jit";
+  ] ++ lib.optional (!stdenv.hostPlatform.isRiscV) "--enable-jit";
 
   outputs = [ "bin" "dev" "out" "doc" "man" "devdoc" ];
 
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     moveToOutput bin/pcre2-config "$dev"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Perl Compatible Regular Expressions";
     homepage = "http://www.pcre.org/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/pdal/default.nix b/nixpkgs/pkgs/development/libraries/pdal/default.nix
index 4405d3812b76..42e05d5d7ff4 100644
--- a/nixpkgs/pkgs/development/libraries/pdal/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pdal/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 , cmake
@@ -71,7 +71,7 @@ stdenv.mkDerivation rec {
     "-DBUILD_PLUGIN_RIVLIB=OFF"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "PDAL is Point Data Abstraction Library. GDAL for point cloud data";
     homepage = "https://pdal.io";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/pdf2xml/default.nix b/nixpkgs/pkgs/development/libraries/pdf2xml/default.nix
index 855df954eb14..2dfd35466858 100644
--- a/nixpkgs/pkgs/development/libraries/pdf2xml/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pdf2xml/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, libxpdf, libxml2}:
+{lib, stdenv, fetchurl, libxpdf, libxml2}:
 
 stdenv.mkDerivation {
   name = "pdf2xml";
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
     cp exe/* $out/bin
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "PDF to XML converter";
     platforms = platforms.unix;
     license = licenses.gpl2;
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
index 16d19f570d1c..250089c30b1c 100644
--- a/nixpkgs/pkgs/development/libraries/phash/default.nix
+++ b/nixpkgs/pkgs/development/libraries/phash/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkgconfig, cimg, imagemagick }:
+{ lib, stdenv, fetchFromGitHub, pkg-config, cimg, imagemagick }:
 
 stdenv.mkDerivation rec {
   pname = "pHash";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   # at runtime
   propagatedBuildInputs = [ imagemagick ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   configureFlags = ["--enable-video-hash=no" "--enable-audio-hash=no"];
   postInstall = ''
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     sha256 = "0y4gknfkns5sssfaj0snyx29752my20xmxajg6xggijx0myabbv0";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit version;
     description = "Compute the perceptual hash of an image";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/phonetisaurus/default.nix b/nixpkgs/pkgs/development/libraries/phonetisaurus/default.nix
index 126a91fe2900..9ba00833d623 100644
--- a/nixpkgs/pkgs/development/libraries/phonetisaurus/default.nix
+++ b/nixpkgs/pkgs/development/libraries/phonetisaurus/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , openfst
 , pkg-config
@@ -7,12 +7,12 @@
 
 stdenv.mkDerivation rec {
   pname = "phonetisaurus";
-  version = "2020-07-31";
+  version = "0.9.1";
 
   src = fetchFromGitHub {
     owner = "AdolfVonKleist";
     repo = pname;
-    rev = "2831870697de5b4fbcb56a6e1b975e0e1ea10deb";
+    rev = version;
     sha256 = "1b18s5zz0l0fhqh9n9jnmgjz2hzprwzf6hx5a12zibmmam3qyriv";
   };
 
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ python3 openfst ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Framework for Grapheme-to-phoneme models for speech recognition using the OpenFst framework";
     inherit (src.meta) homepage;
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix b/nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix
index 5c0901596b04..249ce4e3629a 100644
--- a/nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix
+++ b/nixpkgs/pkgs/development/libraries/phonon/backends/gstreamer.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, cmake, gst_all_1, phonon, pkgconfig
+{ stdenv, lib, fetchurl, cmake, gst_all_1, phonon, pkg-config
 , extra-cmake-modules, qttools, qtbase, qtx11extras
 , debug ? false
 }:
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   pname = "phonon-backend-gstreamer";
   version = "4.10.0";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://phonon.kde.org/";
     description = "GStreamer backend for Phonon";
     platforms = platforms.linux;
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
             gst-libav
           ]);
     in toString [
-      # This flag should be picked up through pkgconfig, but it isn't.
+      # 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}"''
@@ -54,7 +54,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     cmake
-    pkgconfig
+    pkg-config
     extra-cmake-modules
     qttools
   ];
diff --git a/nixpkgs/pkgs/development/libraries/phonon/backends/vlc.nix b/nixpkgs/pkgs/development/libraries/phonon/backends/vlc.nix
index d54ee6e56304..07e6ccf1f346 100644
--- a/nixpkgs/pkgs/development/libraries/phonon/backends/vlc.nix
+++ b/nixpkgs/pkgs/development/libraries/phonon/backends/vlc.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, cmake, phonon, pkgconfig, libvlc
+{ stdenv, lib, fetchurl, cmake, phonon, pkg-config, libvlc
 , extra-cmake-modules, qttools, qtbase, qtx11extras
 , debug ? false
 }:
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   pname = "phonon-backend-vlc";
   version = "0.11.1";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://phonon.kde.org/";
     description = "GStreamer backend for Phonon";
     platforms = platforms.linux;
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     cmake
-    pkgconfig
+    pkg-config
     qttools
     extra-cmake-modules
   ];
diff --git a/nixpkgs/pkgs/development/libraries/phonon/default.nix b/nixpkgs/pkgs/development/libraries/phonon/default.nix
index 85ba37a9d8a6..88a6af658dd4 100644
--- a/nixpkgs/pkgs/development/libraries/phonon/default.nix
+++ b/nixpkgs/pkgs/development/libraries/phonon/default.nix
@@ -4,7 +4,7 @@
 , cmake
 , libGLU
 , libGL
-, pkgconfig
+, pkg-config
 , libpulseaudio
 , extra-cmake-modules
 , qtbase
@@ -26,9 +26,9 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://community.kde.org/Phonon";
     description = "Multimedia API for Qt";
-    license = stdenv.lib.licenses.lgpl2;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ ttuegel ];
+    license = lib.licenses.lgpl2;
+    platforms = lib.platforms.linux;
+    maintainers = with lib.maintainers; [ ttuegel ];
   };
 
   src = fetchurl {
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     cmake
-    pkgconfig
+    pkg-config
     extra-cmake-modules
   ];
 
diff --git a/nixpkgs/pkgs/development/libraries/physfs/default.nix b/nixpkgs/pkgs/development/libraries/physfs/default.nix
index 160f2f64cf40..3eb4077d9852 100644
--- a/nixpkgs/pkgs/development/libraries/physfs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physfs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, doxygen, darwin
+{ lib, stdenv, fetchurl, cmake, doxygen, darwin
 , zlib }:
 
 let
@@ -15,9 +15,7 @@ let
     nativeBuildInputs = [ cmake doxygen ];
 
     buildInputs = [ zlib ]
-      ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Foundation ];
-
-    enableParallelBuilding = true;
+      ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Foundation ];
 
     patchPhase = ''
       sed s,-Werror,, -i CMakeLists.txt
@@ -29,7 +27,7 @@ let
       ./test_physfs --version
     '';
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       homepage = "http://icculus.org/physfs/";
       description = "Library to provide abstract access to various archives";
       license = licenses.free;
diff --git a/nixpkgs/pkgs/development/libraries/physics/apfel/default.nix b/nixpkgs/pkgs/development/libraries/physics/apfel/default.nix
index 7b201cf9b164..e3fd0a26a7fd 100644
--- a/nixpkgs/pkgs/development/libraries/physics/apfel/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/apfel/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, gfortran, lhapdf, python2, zlib }:
+{ lib, stdenv, fetchFromGitHub, gfortran, lhapdf, python2, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "apfel";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A PDF Evolution Library";
     license     = licenses.gpl3;
     homepage    = "https://apfel.mi.infn.it/";
diff --git a/nixpkgs/pkgs/development/libraries/physics/apfelgrid/default.nix b/nixpkgs/pkgs/development/libraries/physics/apfelgrid/default.nix
index 5c63ce7c4b9e..33ca03267270 100644
--- a/nixpkgs/pkgs/development/libraries/physics/apfelgrid/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/apfelgrid/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, apfel, applgrid, lhapdf, root5 }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, apfel, applgrid, lhapdf, root5 }:
 
 stdenv.mkDerivation rec {
   pname = "apfelgrid";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Ultra-fast theory predictions for collider observables";
     license     = licenses.mit;
     homepage    = "http://nhartland.github.io/APFELgrid/";
diff --git a/nixpkgs/pkgs/development/libraries/physics/applgrid/default.nix b/nixpkgs/pkgs/development/libraries/physics/applgrid/default.nix
index 6b1bc71c660c..65aa7b8b4703 100644
--- a/nixpkgs/pkgs/development/libraries/physics/applgrid/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/applgrid/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gfortran, hoppet, lhapdf, root5, zlib }:
+{ lib, stdenv, fetchurl, gfortran, hoppet, lhapdf, root5, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "applgrid";
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/physics/cernlib/default.nix b/nixpkgs/pkgs/development/libraries/physics/cernlib/default.nix
index 3c2cd4c69145..84657d726797 100644
--- a/nixpkgs/pkgs/development/libraries/physics/cernlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/cernlib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gfortran, gnumake, imake, makedepend, motif, xorg }:
+{ lib, stdenv, fetchurl, gfortran, gnumake, imake, makedepend, motif, xorg }:
 
 stdenv.mkDerivation rec {
   version = "2006";
@@ -63,7 +63,7 @@ stdenv.mkDerivation rec {
     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 stdenv.lib.maintainers; [ veprbl ];
-    license = stdenv.lib.licenses.gpl2;
+    maintainers = with lib.maintainers; [ veprbl ];
+    license = lib.licenses.gpl2;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/physics/fastjet-contrib/default.nix b/nixpkgs/pkgs/development/libraries/physics/fastjet-contrib/default.nix
index 68e07e7b42dd..a09f031e7651 100644
--- a/nixpkgs/pkgs/development/libraries/physics/fastjet-contrib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/fastjet-contrib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fastjet }:
+{ lib, stdenv, fetchurl, fastjet }:
 
 stdenv.mkDerivation rec {
   pname = "fastjet-contrib";
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     make fragile-shared-install
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Third party extensions for FastJet";
     homepage = "http://fastjet.fr/";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/physics/fastjet/default.nix b/nixpkgs/pkgs/development/libraries/physics/fastjet/default.nix
index b854fa88cd67..35ce8dedca74 100644
--- a/nixpkgs/pkgs/development/libraries/physics/fastjet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/fastjet/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python2 }:
+{ lib, stdenv, fetchurl, python2 }:
 
 stdenv.mkDerivation rec {
   pname = "fastjet";
@@ -20,9 +20,9 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "A software package for jet finding in pp and e+e− collisions";
-    license     = stdenv.lib.licenses.gpl2Plus;
+    license     = lib.licenses.gpl2Plus;
     homepage    = "http://fastjet.fr/";
-    platforms   = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ veprbl ];
+    platforms   = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ veprbl ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/physics/fastnlo/default.nix b/nixpkgs/pkgs/development/libraries/physics/fastnlo/default.nix
index 22251e10a4f1..916303f00cec 100644
--- a/nixpkgs/pkgs/development/libraries/physics/fastnlo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/fastnlo/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, boost, fastjet, gfortran, lhapdf, python2, root, yoda, zlib }:
+{ lib, stdenv, fetchurl, boost, fastjet, gfortran, lhapdf, python2, root, yoda, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "fastnlo_toolkit";
@@ -25,9 +25,9 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "A computer code to create and evaluate fast interpolation tables of pre-computed coefficients in perturbation theory for observables in hadron-induced processes";
-    license      = stdenv.lib.licenses.gpl3;
+    license      = lib.licenses.gpl3;
     homepage     = "http://fastnlo.hepforge.org";
-    platforms    = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ veprbl ];
+    platforms    = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ veprbl ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix b/nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix
index 42014949c0b6..5646f4e02bac 100644
--- a/nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/geant4/datasets.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, geant_version }:
+{ lib, stdenv, fetchurl, geant_version }:
 
 let
   mkDataset = { name, version, sha256, envvar }:
@@ -24,7 +24,7 @@ let
       inherit envvar;
       setupHook = ./datasets-hook.sh;
 
-      meta = with stdenv.lib; {
+      meta = with lib; {
         description = "Data files for the Geant4 toolkit";
         homepage = "https://geant4.web.cern.ch/support/download";
         license = licenses.g4sl;
diff --git a/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix b/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix
index 7caae2c52d33..159c746fecd8 100644
--- a/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/geant4/default.nix
@@ -9,7 +9,7 @@
 , enableRaytracerX11   ? false
 
 # Standard build environment with cmake.
-, stdenv, fetchurl, fetchpatch, cmake
+, lib, stdenv, fetchurl, fetchpatch, cmake
 
 # Optional system packages, otherwise internal GEANT4 packages are used.
 , clhep ? null # not packaged currently
@@ -80,24 +80,23 @@ stdenv.mkDerivation rec {
     "-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"}"
-  ] ++ stdenv.lib.optionals (enableMultiThreading && enablePython) [
+  ] ++ lib.optionals (enableMultiThreading && enablePython) [
     "-DGEANT4_BUILD_TLS_MODEL=global-dynamic"
-  ] ++ stdenv.lib.optionals enableInventor [
+  ] ++ lib.optionals enableInventor [
     "-DINVENTOR_INCLUDE_DIR=${coin3d}/include"
     "-DINVENTOR_LIBRARY_RELEASE=${coin3d}/lib/libCoin.so"
   ];
 
-  enableParallelBuilding = true;
   nativeBuildInputs =  [ cmake ];
 
   buildInputs = [ libGLU xlibsWrapper libXmu ]
-    ++ stdenv.lib.optionals enableInventor [ libXpm coin3d soxt motif ]
-    ++ stdenv.lib.optionals enablePython [ boost_python python3 ];
+    ++ lib.optionals enableInventor [ libXpm coin3d soxt motif ]
+    ++ lib.optionals enablePython [ boost_python python3 ];
 
   propagatedBuildInputs = [ clhep expat zlib libGL ]
-    ++ stdenv.lib.optionals enableGDML [ xercesc ]
-    ++ stdenv.lib.optionals enableXM [ motif ]
-    ++ stdenv.lib.optionals enableQT [ qtbase ];
+    ++ lib.optionals enableGDML [ xercesc ]
+    ++ lib.optionals enableXM [ motif ]
+    ++ lib.optionals enableQT [ qtbase ];
 
   postFixup = ''
     # Don't try to export invalid environment variables.
@@ -108,7 +107,7 @@ stdenv.mkDerivation rec {
 
   passthru = {
     data = import ./datasets.nix {
-          inherit stdenv fetchurl;
+          inherit lib stdenv fetchurl;
           geant_version = version;
       };
 
@@ -120,7 +119,7 @@ stdenv.mkDerivation rec {
     source $out/nix-support/setup-hook
   '';
 
-  meta = with stdenv.lib; {
+  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.
diff --git a/nixpkgs/pkgs/development/libraries/physics/hepmc2/default.nix b/nixpkgs/pkgs/development/libraries/physics/hepmc2/default.nix
index b27d947ea5c4..e2ab42c418a0 100644
--- a/nixpkgs/pkgs/development/libraries/physics/hepmc2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/hepmc2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake }:
+{ lib, stdenv, fetchurl, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "hepmc";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     "-Dlength:STRING=MM"
   ];
 
-  meta = with stdenv.lib; {
+  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/";
diff --git a/nixpkgs/pkgs/development/libraries/physics/hepmc3/default.nix b/nixpkgs/pkgs/development/libraries/physics/hepmc3/default.nix
index 10b789f514f9..0b1b1f8fa578 100644
--- a/nixpkgs/pkgs/development/libraries/physics/hepmc3/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/hepmc3/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, cmake, coreutils, python, root }:
+{ lib, stdenv, fetchurl, cmake, coreutils, python, root }:
 
 let
-  pythonVersion = with stdenv.lib.versions; "${major python.version}${minor python.version}";
+  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;
@@ -18,11 +18,11 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ root_py ]
-    ++ stdenv.lib.optional withPython python;
+    ++ lib.optional withPython python;
 
   cmakeFlags = [
     "-DHEPMC3_ENABLE_PYTHON=${if withPython then "ON" else "OFF"}"
-  ] ++ stdenv.lib.optionals withPython [
+  ] ++ lib.optionals withPython [
     "-DHEPMC3_PYTHON_VERSIONS=${if python.isPy3k then "3.X" else "2.X"}"
     "-DHEPMC3_Python_SITEARCH${pythonVersion}=${placeholder "out"}/${python.sitePackages}"
   ];
@@ -35,11 +35,11 @@ stdenv.mkDerivation rec {
 
   doInstallCheck = withPython;
   # prevent nix from trying to dereference a null python
-  installCheckPhase = stdenv.lib.optionalString withPython ''
+  installCheckPhase = lib.optionalString withPython ''
     PYTHONPATH=${placeholder "out"}/${python.sitePackages} python -c 'import pyHepMC3'
   '';
 
-  meta = with stdenv.lib; {
+  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/";
diff --git a/nixpkgs/pkgs/development/libraries/physics/herwig/default.nix b/nixpkgs/pkgs/development/libraries/physics/herwig/default.nix
index c1a803fd314b..d3f6bcb74747 100644
--- a/nixpkgs/pkgs/development/libraries/physics/herwig/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/herwig/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, boost, fastjet, gfortran, gsl, lhapdf, thepeg, zlib, autoconf, automake, libtool }:
+{ lib, stdenv, fetchurl, boost, fastjet, gfortran, gsl, lhapdf, thepeg, zlib, autoconf, automake, libtool }:
 
 stdenv.mkDerivation rec {
   pname = "herwig";
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A multi-purpose particle physics event generator";
     homepage = "https://herwig.hepforge.org/";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/physics/hoppet/default.nix b/nixpkgs/pkgs/development/libraries/physics/hoppet/default.nix
index 6ac3b950be34..7ad5b9861a1d 100644
--- a/nixpkgs/pkgs/development/libraries/physics/hoppet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/hoppet/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gfortran, perl }:
+{ lib, stdenv, fetchurl, gfortran, perl }:
 
 stdenv.mkDerivation rec {
   pname = "hoppet";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
     patchShebangs .
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Higher Order Perturbative Parton Evolution Toolkit";
     license     = licenses.gpl2;
     homepage    = "https://hoppet.hepforge.org";
diff --git a/nixpkgs/pkgs/development/libraries/physics/lhapdf/default.nix b/nixpkgs/pkgs/development/libraries/physics/lhapdf/default.nix
index 7d412f86596d..19e9f9d9ec86 100644
--- a/nixpkgs/pkgs/development/libraries/physics/lhapdf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/lhapdf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python2, makeWrapper }:
+{ lib, stdenv, fetchurl, python2, makeWrapper }:
 
 stdenv.mkDerivation rec {
   pname = "lhapdf";
@@ -15,18 +15,18 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   passthru = {
-    pdf_sets = import ./pdf_sets.nix { inherit stdenv fetchurl; };
+    pdf_sets = import ./pdf_sets.nix { inherit lib stdenv fetchurl; };
   };
 
   postInstall = ''
     wrapProgram $out/bin/lhapdf --prefix PYTHONPATH : "$(toPythonPath "$out")"
   '';
 
-  meta = {
+  meta = with lib; {
     description = "A general purpose interpolator, used for evaluating Parton Distribution Functions from discretised data files";
-    license     = stdenv.lib.licenses.gpl2;
+    license     = licenses.gpl2;
     homepage    = "http://lhapdf.hepforge.org";
-    platforms   = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ veprbl ];
+    platforms   = platforms.unix;
+    maintainers = with maintainers; [ veprbl ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/physics/lhapdf/pdf_sets.nix b/nixpkgs/pkgs/development/libraries/physics/lhapdf/pdf_sets.nix
index 2309e6671f85..7fb3e640c7d6 100644
--- a/nixpkgs/pkgs/development/libraries/physics/lhapdf/pdf_sets.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/lhapdf/pdf_sets.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 let
   mkPdfSet = name: sha256:
@@ -20,7 +20,7 @@ let
       setupHook = ./pdfset-hook.sh;
     };
 in
-  stdenv.lib.mapAttrs mkPdfSet {
+  lib.mapAttrs mkPdfSet {
     "ABMP15_3_nnlo" = "028q5xixxjxhb8sr7l5v5mwh9mkszm5m59fgnpb69yxvv40a70v0";
     "ABMP15_4_nnlo" = "11zjp4dxmgp69kdkmdwqkpsajvwjrbwylmwgs56mgjb0vgb8wk0i";
     "ABMP15_5_nnlo" = "0z47g5fwh53gg5ws5bbip5q2m5mm7vl09q2w58g6ah9dk25r10ll";
diff --git a/nixpkgs/pkgs/development/libraries/physics/mela/default.nix b/nixpkgs/pkgs/development/libraries/physics/mela/default.nix
index 1e31577026c1..90cf5ac8b2d1 100644
--- a/nixpkgs/pkgs/development/libraries/physics/mela/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/mela/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, gfortran }:
+{ lib, stdenv, fetchFromGitHub, gfortran }:
 
 stdenv.mkDerivation rec {
   pname = "mela";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "a Mellin Evolution LibrAry";
     license     = licenses.gpl3;
     homepage    = "https://github.com/vbertone/MELA";
diff --git a/nixpkgs/pkgs/development/libraries/physics/nlojet/default.nix b/nixpkgs/pkgs/development/libraries/physics/nlojet/default.nix
index 20df49d9ae7f..f84c1bda32d3 100644
--- a/nixpkgs/pkgs/development/libraries/physics/nlojet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/nlojet/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "nlojet++";
@@ -15,9 +15,9 @@ stdenv.mkDerivation rec {
 
   meta = {
     homepage    = "http://www.desy.de/~znagy/Site/NLOJet++.html";
-    license     = stdenv.lib.licenses.gpl2;
+    license     = lib.licenses.gpl2;
     description = "Implementation of calculation of the hadron jet cross sections";
-    platforms   = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ veprbl ];
+    platforms   = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ veprbl ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/physics/pythia/default.nix b/nixpkgs/pkgs/development/libraries/physics/pythia/default.nix
index 53b2889a25c8..1bec3300f80a 100644
--- a/nixpkgs/pkgs/development/libraries/physics/pythia/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/pythia/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, boost, fastjet, hepmc, lhapdf, rsync, zlib }:
+{ lib, stdenv, fetchurl, boost, fastjet, hepmc, lhapdf, rsync, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "pythia";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--enable-shared"
     "--with-lhapdf6=${lhapdf}"
-  ] ++ (if stdenv.lib.versions.major hepmc.version == "3" then [
+  ] ++ (if lib.versions.major hepmc.version == "3" then [
     "--with-hepmc3=${hepmc}"
   ] else [
     "--with-hepmc2=${hepmc}"
@@ -28,9 +28,9 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "A program for the generation of high-energy physics events";
-    license     = stdenv.lib.licenses.gpl2;
+    license     = lib.licenses.gpl2;
     homepage    = "http://home.thep.lu.se/~torbjorn/Pythia.html";
-    platforms   = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ veprbl ];
+    platforms   = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ veprbl ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix b/nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix
index 1c17b318c9dc..834e3fcbba89 100644
--- a/nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/qcdnum/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gfortran, zlib }:
+{ lib, stdenv, fetchurl, gfortran, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "QCDNUM";
@@ -16,9 +16,9 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "A very fast QCD evolution program written in FORTRAN77";
-    license     = stdenv.lib.licenses.gpl3;
+    license     = lib.licenses.gpl3;
     homepage    = "https://www.nikhef.nl/~h24/qcdnum/index.html";
-    platforms   = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ veprbl ];
+    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
index f95328964bfb..ce905bff17c5 100644
--- a/nixpkgs/pkgs/development/libraries/physics/rivet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/rivet/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fastjet, fastjet-contrib, ghostscript, gsl, hepmc, imagemagick, less, python3, rsync, texlive, yoda, which, makeWrapper }:
+{ lib, stdenv, fetchurl, fastjet, fastjet-contrib, ghostscript, gsl, hepmc, imagemagick, less, python3, rsync, texlive, yoda, which, makeWrapper }:
 
 stdenv.mkDerivation rec {
   pname = "rivet";
@@ -60,7 +60,7 @@ stdenv.mkDerivation rec {
   configureFlags = [
     "--with-fastjet=${fastjet}"
     "--with-yoda=${yoda}"
-  ] ++ (if stdenv.lib.versions.major hepmc.version == "3" then [
+  ] ++ (if lib.versions.major hepmc.version == "3" then [
     "--with-hepmc3=${hepmc}"
   ] else [
     "--with-hepmc=${hepmc}"
@@ -74,7 +74,7 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/physics/thepeg/default.nix b/nixpkgs/pkgs/development/libraries/physics/thepeg/default.nix
index 876aeec0fab7..d5a272955f40 100644
--- a/nixpkgs/pkgs/development/libraries/physics/thepeg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/thepeg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, boost, fastjet, gsl, hepmc2, lhapdf, rivet, zlib }:
+{ lib, stdenv, fetchurl, boost, fastjet, gsl, hepmc2, lhapdf, rivet, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "thepeg";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Toolkit for High Energy Physics Event Generation";
     homepage = "https://herwig.hepforge.org/";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/physics/yoda/default.nix b/nixpkgs/pkgs/development/libraries/physics/yoda/default.nix
index 39bffb65237e..bf53cfcb62c9 100644
--- a/nixpkgs/pkgs/development/libraries/physics/yoda/default.nix
+++ b/nixpkgs/pkgs/development/libraries/physics/yoda/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python, root, makeWrapper, zlib, withRootSupport ? false }:
+{ lib, stdenv, fetchurl, python, root, makeWrapper, zlib, withRootSupport ? false }:
 
 stdenv.mkDerivation rec {
   pname = "yoda";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = with python.pkgs; [ cython makeWrapper ];
   buildInputs = [ python ]
     ++ (with python.pkgs; [ numpy matplotlib ])
-    ++ stdenv.lib.optional withRootSupport root;
+    ++ lib.optional withRootSupport root;
   propagatedBuildInputs = [ zlib ];
 
   enableParallelBuilding = true;
@@ -35,10 +35,10 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Provides small set of data analysis (specifically histogramming) classes";
-    license     = stdenv.lib.licenses.gpl3;
+    license     = lib.licenses.gpl3;
     homepage    = "https://yoda.hepforge.org";
-    platforms   = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ veprbl ];
+    platforms   = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ veprbl ];
     # https://gitlab.com/hepcedar/yoda/-/issues/24
     broken      = withRootSupport;
   };
diff --git a/nixpkgs/pkgs/development/libraries/pipewire/0.2.nix b/nixpkgs/pkgs/development/libraries/pipewire/0.2.nix
index eaedc2c0ac3e..1e686b980043 100644
--- a/nixpkgs/pkgs/development/libraries/pipewire/0.2.nix
+++ b/nixpkgs/pkgs/development/libraries/pipewire/0.2.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, meson, ninja, pkgconfig, doxygen, graphviz, valgrind
+{ lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config, doxygen, graphviz, valgrind
 , glib, dbus, gst_all_1, alsaLib, ffmpeg_4, libjack2, udev, libva, xorg
 , sbc, SDL2, makeFontsConf
 }:
@@ -21,7 +21,7 @@ in stdenv.mkDerivation rec {
   outputs = [ "out" "lib" "dev" "doc" ];
 
   nativeBuildInputs = [
-    meson ninja pkgconfig doxygen graphviz valgrind
+    meson ninja pkg-config doxygen graphviz valgrind
   ];
   buildInputs = [
     glib dbus gst_all_1.gst-plugins-base gst_all_1.gstreamer
@@ -39,7 +39,7 @@ in stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Server and user space API to deal with multimedia pipelines";
     homepage = "https://pipewire.org/";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/pipewire/default.nix b/nixpkgs/pkgs/development/libraries/pipewire/default.nix
index c9697ee1a424..fdd45b4bb0d9 100644
--- a/nixpkgs/pkgs/development/libraries/pipewire/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pipewire/default.nix
@@ -6,7 +6,7 @@
 , meson
 , ninja
 , systemd
-, pkgconfig
+, pkg-config
 , doxygen
 , graphviz
 , valgrind
@@ -75,7 +75,7 @@ stdenv.mkDerivation rec {
     graphviz
     meson
     ninja
-    pkgconfig
+    pkg-config
   ];
 
   buildInputs = [
@@ -136,7 +136,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Server and user space API to deal with multimedia pipelines";
     homepage = "https://pipewire.org/";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/pixman/default.nix b/nixpkgs/pkgs/development/libraries/pixman/default.nix
index d7f5b34e5d75..a8cea4638069 100644
--- a/nixpkgs/pkgs/development/libraries/pixman/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pixman/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libpng, glib /*just passthru*/ }:
+{ lib, stdenv, fetchurl, pkg-config, libpng, glib /*just passthru*/ }:
 
 stdenv.mkDerivation rec {
   pname = "pixman";
@@ -9,17 +9,17 @@ stdenv.mkDerivation rec {
     sha256 = "0l0m48lnmdlmnaxn2021qi5cj366d9fzfjxkqgcj9bs14pxbgaw4";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ libpng ];
 
-  configureFlags = stdenv.lib.optional stdenv.isAarch32 "--disable-arm-iwmmxt";
+  configureFlags = lib.optional stdenv.isAarch32 "--disable-arm-iwmmxt";
 
   doCheck = true;
 
   postInstall = glib.flattenInclude;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://pixman.org";
     description = "A low-level library for pixel manipulation";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/pkcs11helper/default.nix b/nixpkgs/pkgs/development/libraries/pkcs11helper/default.nix
index cb8e05b6a76e..4148ca4fc47d 100644
--- a/nixpkgs/pkgs/development/libraries/pkcs11helper/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pkcs11helper/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkgconfig, openssl, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, pkg-config, openssl, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "pkcs11-helper";
@@ -11,12 +11,12 @@ stdenv.mkDerivation rec {
     sha256 = "1idrqip59bqzcgddpnk2inin5n5yn4y0dmcyaggfpdishraiqgd5";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ openssl ];
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/pkger/default.nix b/nixpkgs/pkgs/development/libraries/pkger/default.nix
index 8c8fd4f8fd6b..4d7c682f0229 100644
--- a/nixpkgs/pkgs/development/libraries/pkger/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pkger/default.nix
@@ -19,7 +19,7 @@ buildGoModule rec {
 
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  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}";
diff --git a/nixpkgs/pkgs/development/libraries/plib/default.nix b/nixpkgs/pkgs/development/libraries/plib/default.nix
index 2736de0630f6..7a1c39715797 100644
--- a/nixpkgs/pkgs/development/libraries/plib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/plib/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, fetchpatch, stdenv, libGLU, libGL, freeglut, SDL
+{ fetchurl, fetchpatch, lib, stdenv, libGLU, libGL, freeglut, SDL
 , libXi, libSM, libXmu, libXext, libX11 }:
 
 stdenv.mkDerivation rec {
@@ -42,9 +42,9 @@ stdenv.mkDerivation rec {
       GLUT, or FLTK instead of PLIB's 'PW' windowing library, you can.
     '';
 
-    license = stdenv.lib.licenses.lgpl2Plus;
+    license = lib.licenses.lgpl2Plus;
 
     homepage = "http://plib.sourceforge.net/";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/plplot/default.nix b/nixpkgs/pkgs/development/libraries/plplot/default.nix
index e99ddc3dd085..05f12d0148be 100644
--- a/nixpkgs/pkgs/development/libraries/plplot/default.nix
+++ b/nixpkgs/pkgs/development/libraries/plplot/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake }:
+{ lib, stdenv, fetchurl, cmake }:
 
 stdenv.mkDerivation rec {
   pname   = "plplot";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Cross-platform scientific graphics plotting library";
     homepage    = "https://plplot.org";
     maintainers = with maintainers; [ bcdarwin ];
diff --git a/nixpkgs/pkgs/development/libraries/pmdk/default.nix b/nixpkgs/pkgs/development/libraries/pmdk/default.nix
index fe3176f9f76e..01392f232d9c 100644
--- a/nixpkgs/pkgs/development/libraries/pmdk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pmdk/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchFromGitHub
-, autoconf, libndctl, pkgconfig
+{ lib, stdenv, fetchFromGitHub
+, autoconf, libndctl, pkg-config
 }:
 
 stdenv.mkDerivation rec {
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "1833sq0f1msaqwn31dn1fp37a6d5zp995i9gkazanydmppi2qy0i";
   };
 
-  nativeBuildInputs = [ autoconf pkgconfig ];
+  nativeBuildInputs = [ autoconf pkg-config ];
   buildInputs = [ libndctl ];
   enableParallelBuilding = true;
 
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     mv $out/lib     $lib/lib
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Persistent Memory Development Kit";
     homepage    = "https://github.com/pmem/pmdk";
     license     = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/pmix/default.nix b/nixpkgs/pkgs/development/libraries/pmix/default.nix
index f68833bdac4d..bb8debbce916 100644
--- a/nixpkgs/pkgs/development/libraries/pmix/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pmix/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, perl, autoconf, automake
+{ lib, stdenv, fetchFromGitHub, perl, autoconf, automake
 , libtool, flex, libevent, hwloc, munge, zlib, pandoc
 } :
 
@@ -37,7 +37,7 @@ in stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Process Management Interface for HPC environments";
     homepage = "https://openpmix.github.io/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/png++/default.nix b/nixpkgs/pkgs/development/libraries/png++/default.nix
index 7ae7406c9896..dfd74e495e76 100644
--- a/nixpkgs/pkgs/development/libraries/png++/default.nix
+++ b/nixpkgs/pkgs/development/libraries/png++/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libpng
+{ lib, stdenv, fetchurl, libpng
 , docSupport ? true, doxygen ? null
 }:
 assert docSupport -> doxygen != null;
@@ -21,21 +21,21 @@ stdenv.mkDerivation rec {
 
   postCheck = "cat test/test.log";
 
-  buildInputs = stdenv.lib.optional docSupport doxygen;
+  buildInputs = lib.optional docSupport doxygen;
 
   propagatedBuildInputs = [ libpng ];
 
-  preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
+  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 = stdenv.lib.optional docSupport "docs";
+  makeFlags = lib.optional docSupport "docs";
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.nongnu.org/pngpp/";
     description = "C++ wrapper for libpng library";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/pocketsphinx/default.nix b/nixpkgs/pkgs/development/libraries/pocketsphinx/default.nix
index 0f9be199d958..18d5d0bcfa22 100644
--- a/nixpkgs/pkgs/development/libraries/pocketsphinx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pocketsphinx/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , sphinxbase
-, pkgconfig
+, pkg-config
 , python27 # >= 2.6
 , swig2 # 2.0
 }:
@@ -16,14 +16,14 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ sphinxbase ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ python27 swig2 ];
 
   meta = {
     description = "Voice recognition library written in C";
     homepage = "http://cmusphinx.sourceforge.net";
-    license = stdenv.lib.licenses.free;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.free;
+    platforms = lib.platforms.linux;
   };
 }
 
diff --git a/nixpkgs/pkgs/development/libraries/poco/default.nix b/nixpkgs/pkgs/development/libraries/poco/default.nix
index b2a4fb1b0c32..8f963bb366a9 100644
--- a/nixpkgs/pkgs/development/libraries/poco/default.nix
+++ b/nixpkgs/pkgs/development/libraries/poco/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, pkgconfig, zlib, pcre, expat, sqlite, openssl, unixODBC, libmysqlclient }:
+{ lib, stdenv, fetchurl, cmake, pkg-config, zlib, pcre, expat, sqlite, openssl, unixODBC, libmysqlclient }:
 
 stdenv.mkDerivation rec {
   pname = "poco";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1jilzh0h6ik5lr167nax7q6nrpzxl99p11pkl202ig06pgh32nbz";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
   buildInputs = [ zlib pcre expat sqlite openssl unixODBC libmysqlclient ];
 
@@ -21,9 +21,7 @@ stdenv.mkDerivation rec {
     "-DPOCO_UNBUNDLED=ON"
   ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://pocoproject.org/";
     description = "Cross-platform C++ libraries with a network/internet focus";
     license = licenses.boost;
diff --git a/nixpkgs/pkgs/development/libraries/podofo/default.nix b/nixpkgs/pkgs/development/libraries/podofo/default.nix
index 242645ebfdbc..e50a2111b437 100644
--- a/nixpkgs/pkgs/development/libraries/podofo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/podofo/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, cmake, zlib, freetype, libjpeg, libtiff, fontconfig
-, openssl, libpng, lua5, pkgconfig, libidn, expat, fetchpatch
+{ lib, stdenv, fetchurl, cmake, zlib, freetype, libjpeg, libtiff, fontconfig
+, openssl, libpng, lua5, pkg-config, libidn, expat, fetchpatch
 }:
 
 stdenv.mkDerivation rec {
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "lib" ];
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
   buildInputs = [ zlib freetype libjpeg libtiff fontconfig openssl libpng
                   libidn expat lua5 ];
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
     moveToOutput lib "$lib"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://podofo.sourceforge.net";
     description = "A library to work with the PDF file format";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/polkit-qt-1/qt-4.nix b/nixpkgs/pkgs/development/libraries/polkit-qt-1/qt-4.nix
index b13335561ac0..0da6e15eb274 100644
--- a/nixpkgs/pkgs/development/libraries/polkit-qt-1/qt-4.nix
+++ b/nixpkgs/pkgs/development/libraries/polkit-qt-1/qt-4.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, cmake, pkgconfig, polkit, automoc4, glib, qt4 }:
+{ lib, stdenv, fetchurl, cmake, pkg-config, polkit, automoc4, glib, qt4 }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation {
   name = "polkit-qt-1-qt4-0.112.0";
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ cmake pkgconfig automoc4 ];
+  nativeBuildInputs = [ cmake pkg-config automoc4 ];
 
   propagatedBuildInputs = [ polkit glib qt4 ];
 
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
       done
     '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A Qt wrapper around PolKit";
     maintainers = [ maintainers.ttuegel ];
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/polkit-qt-1/qt-5.nix b/nixpkgs/pkgs/development/libraries/polkit-qt-1/qt-5.nix
index f6cbf7e972b3..be425b394019 100644
--- a/nixpkgs/pkgs/development/libraries/polkit-qt-1/qt-5.nix
+++ b/nixpkgs/pkgs/development/libraries/polkit-qt-1/qt-5.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, cmake, pkgconfig, polkit, glib, qtbase }:
+{ lib, stdenv, fetchurl, cmake, pkg-config, polkit, glib, qtbase }:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation {
   name = "polkit-qt-1-qt5-0.112.0";
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
     sha256 = "1ip78x20hjqvm08kxhp6gb8hf6k5n6sxyx6kk2yvvq53djzh7yv7";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
   propagatedBuildInputs = [ polkit glib qtbase ];
 
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
 
   meta = {
     description = "A Qt wrapper around PolKit";
-    maintainers = with stdenv.lib.maintainers; [ ttuegel ];
-    platforms = with stdenv.lib.platforms; linux;
+    maintainers = with lib.maintainers; [ ttuegel ];
+    platforms = with lib.platforms; linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/polkit/default.nix b/nixpkgs/pkgs/development/libraries/polkit/default.nix
index 2ec49a2d3c08..7e8e95ef1eac 100644
--- a/nixpkgs/pkgs/development/libraries/polkit/default.nix
+++ b/nixpkgs/pkgs/development/libraries/polkit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, glib, expat, pam, perl, fetchpatch
+{ 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
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
       url = "https://gitlab.freedesktop.org/polkit/polkit/commit/5dd4e22efd05d55833c4634b56e473812b5acbf2.patch";
       sha256 = "17lv7xj5ksa27iv4zpm4zwd4iy8zbwjj4ximslfq3sasiz9kxhlp";
     })
-  ] ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
+  ] ++ 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.
@@ -45,20 +45,20 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  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 pkgconfig intltool perl ]
+    [ 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.
-    ++ stdenv.lib.optional stdenv.isLinux (if useSystemd then systemd else elogind)
-    ++ stdenv.lib.optional withIntrospection gobject-introspection;
+    ++ lib.optional stdenv.isLinux (if useSystemd then systemd else elogind)
+    ++ lib.optional withIntrospection gobject-introspection;
 
   propagatedBuildInputs = [
     glib # in .pc Requires
@@ -77,7 +77,7 @@ stdenv.mkDerivation rec {
       --replace   /bin/true ${coreutils}/bin/true \
       --replace   /bin/false ${coreutils}/bin/false
 
-  '' + stdenv.lib.optionalString useSystemd /* bogus chroot detection */ ''
+  '' + lib.optionalString useSystemd /* bogus chroot detection */ ''
     sed '/libsystemd autoconfigured/s/.*/:/' -i configure
   '';
 
@@ -88,7 +88,7 @@ stdenv.mkDerivation rec {
     "--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")
-  ] ++ stdenv.lib.optional (!doCheck) "--disable-test";
+  ] ++ lib.optional (!doCheck) "--disable-test";
 
   makeFlags = [
     "INTROSPECTION_GIRDIR=${placeholder "out"}/share/gir-1.0"
@@ -111,7 +111,7 @@ stdenv.mkDerivation rec {
     dbus-run-session --config-file=${./system_bus.conf} -- sh -c 'DBUS_SYSTEM_BUS_ADDRESS=$DBUS_SESSION_BUS_ADDRESS make check'
   '';
 
-  meta = with stdenv.lib; {
+  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.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/poly2tri-c/default.nix b/nixpkgs/pkgs/development/libraries/poly2tri-c/default.nix
index a3e42b3ae4b2..1f0ee81da951 100644
--- a/nixpkgs/pkgs/development/libraries/poly2tri-c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/poly2tri-c/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook
-, pkgconfig
+, pkg-config
 , glib
 }:
 
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   outputs = [ "bin" "out" "dev" ];
 
   src = fetchFromGitHub {
-    owner = "Paul-Browne";
+    owner = "Mattey40";
     repo = "poly2tri-c";
     rev = "p2tc-${version}";
     sha256 = "158vm3wqfxs22b74kqc4prlvjny38qqm3kz5wrgasmx0qciwh0g8";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     autoreconfHook
-    pkgconfig
+    pkg-config
   ];
 
   buildInputs = [
@@ -32,11 +32,11 @@ stdenv.mkDerivation rec {
     "-Wno-error"
   ];
 
-  meta = with stdenv.lib; {
+  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 stdenv.lib.maintainers; [ jtojnar ];
+    maintainers = with lib.maintainers; [ jtojnar ];
     platforms = platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/poppler/0.61.nix b/nixpkgs/pkgs/development/libraries/poppler/0.61.nix
index 0603f49fad41..a49bfad7ab31 100644
--- a/nixpkgs/pkgs/development/libraries/poppler/0.61.nix
+++ b/nixpkgs/pkgs/development/libraries/poppler/0.61.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, cmake, ninja, pkgconfig, libiconv, libintl
+{ stdenv, lib, fetchurl, cmake, ninja, pkg-config, libiconv, libintl
 , zlib, curl, cairo, freetype, fontconfig, lcms, libjpeg, openjpeg, fetchpatch
 , withData ? true, poppler_data
 , qt5Support ? false, qtbase ? null
@@ -39,10 +39,10 @@ stdenv.mkDerivation rec {
     ++ optional qt5Support qtbase
     ++ optional introspectionSupport gobject-introspection;
 
-  nativeBuildInputs = [ cmake ninja pkgconfig ];
+  nativeBuildInputs = [ cmake ninja pkg-config ];
 
   # Not sure when and how to pass it.  It seems an upstream bug anyway.
-  CXXFLAGS = stdenv.lib.optionalString stdenv.cc.isClang "-std=c++11";
+  CXXFLAGS = lib.optionalString stdenv.cc.isClang "-std=c++11";
 
   cmakeFlags = [
     (mkFlag true "XPDF_HEADERS")
diff --git a/nixpkgs/pkgs/development/libraries/poppler/default.nix b/nixpkgs/pkgs/development/libraries/poppler/default.nix
index e7b9a26f19fd..3f2b8453d7f0 100644
--- a/nixpkgs/pkgs/development/libraries/poppler/default.nix
+++ b/nixpkgs/pkgs/development/libraries/poppler/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, fetchpatch, cmake, ninja, pkgconfig, libiconv, libintl
+{ stdenv, lib, fetchurl, fetchpatch, cmake, ninja, pkg-config, libiconv, libintl
 , zlib, curl, cairo, freetype, fontconfig, lcms, libjpeg, openjpeg
 , withData ? true, poppler_data
 , qt5Support ? false, qtbase ? null
@@ -31,10 +31,10 @@ stdenv.mkDerivation rec {
     ++ optional utils nss
     ++ optional introspectionSupport gobject-introspection;
 
-  nativeBuildInputs = [ cmake ninja pkgconfig ];
+  nativeBuildInputs = [ cmake ninja pkg-config ];
 
   # Workaround #54606
-  preConfigure = stdenv.lib.optionalString stdenv.isDarwin ''
+  preConfigure = lib.optionalString stdenv.isDarwin ''
     sed -i -e '1i cmake_policy(SET CMP0025 NEW)' CMakeLists.txt
   '';
 
diff --git a/nixpkgs/pkgs/development/libraries/popt/default.nix b/nixpkgs/pkgs/development/libraries/popt/default.nix
index b04a2242ab7a..393ef2c2c33a 100644
--- a/nixpkgs/pkgs/development/libraries/popt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/popt/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   pname = "popt";
@@ -9,14 +9,14 @@ stdenv.mkDerivation rec {
     sha256 = "1j2c61nn2n351nhj4d25mnf3vpiddcykq005w2h6kw79dwlysa77";
   };
 
-  patches = stdenv.lib.optionals stdenv.isCygwin [
+  patches = lib.optionals stdenv.isCygwin [
     ./1.16-cygwin.patch
     ./1.16-vpath.patch
   ];
 
   doCheck = false; # fails
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Command line option parsing library";
     platforms = platforms.unix;
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/portaudio/default.nix b/nixpkgs/pkgs/development/libraries/portaudio/default.nix
index aa8afb7ac97f..c7de116e879b 100644
--- a/nixpkgs/pkgs/development/libraries/portaudio/default.nix
+++ b/nixpkgs/pkgs/development/libraries/portaudio/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, pkgconfig, libjack2
+{ lib, stdenv, fetchurl, alsaLib, pkg-config, libjack2
 , AudioUnit, AudioToolbox, CoreAudio, CoreServices, Carbon }:
 
 stdenv.mkDerivation {
@@ -9,17 +9,17 @@ stdenv.mkDerivation {
     sha256 = "04qmin6nj144b8qb9kkd9a52xfvm0qdgm8bg8jbl7s3frmyiv8pm";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libjack2 ]
-    ++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib;
+    ++ lib.optional (!stdenv.isDarwin) alsaLib;
 
   configureFlags = [ "--disable-mac-universal" "--enable-cxx" ];
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=nullability-inferred-on-nested-type -Wno-error=nullability-completeness-on-arrays";
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-Wno-error=nullability-inferred-on-nested-type -Wno-error=nullability-completeness-on-arrays";
 
-  propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ AudioUnit AudioToolbox CoreAudio CoreServices Carbon ];
+  propagatedBuildInputs = lib.optionals stdenv.isDarwin [ AudioUnit AudioToolbox CoreAudio CoreServices Carbon ];
 
-  patchPhase = stdenv.lib.optionalString stdenv.isDarwin ''
+  patchPhase = lib.optionalString stdenv.isDarwin ''
     sed -i '50 i\
       #include <CoreAudio/AudioHardware.h>\
       #include <CoreAudio/AudioHardwareBase.h>\
@@ -30,14 +30,14 @@ stdenv.mkDerivation {
   # not sure why, but all the headers seem to be installed by the make install
   installPhase = ''
     make install
-  '' + stdenv.lib.optionalString (!stdenv.isDarwin) ''
+  '' + lib.optionalString (!stdenv.isDarwin) ''
     # fixup .pc file to find alsa library
     sed -i "s|-lasound|-L${alsaLib.out}/lib -lasound|" "$out/lib/pkgconfig/"*.pc
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     cp include/pa_mac_core.h $out/include/pa_mac_core.h
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Portable cross-platform Audio API";
     homepage    = "http://www.portaudio.com/";
     # Not exactly a bsd license, but alike
diff --git a/nixpkgs/pkgs/development/libraries/portmidi/default.nix b/nixpkgs/pkgs/development/libraries/portmidi/default.nix
index a0001691302e..e9a868240bb3 100644
--- a/nixpkgs/pkgs/development/libraries/portmidi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/portmidi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, cmake, /*jdk,*/ alsaLib }:
+{ lib, stdenv, fetchurl, unzip, cmake, /*jdk,*/ alsaLib }:
 
 stdenv.mkDerivation rec {
   pname = "portmidi";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   ];
 
   # XXX: This is to deactivate Java support.
-  patches = stdenv.lib.singleton (fetchurl {
+  patches = lib.singleton (fetchurl {
     url = "https://raw.github.com/Rogentos/argent-gentoo/master/media-libs/"
         + "portmidi/files/portmidi-217-cmake-libdir-java-opts.patch";
     sha256 = "1jbjwan61iqq9fqfpq2a4fd30k3clg7a6j0gfgsw87r8c76kqf6h";
@@ -44,14 +44,15 @@ stdenv.mkDerivation rec {
     ln -s libportmidi.so "$out/lib/libporttime.so"
   '';
 
-  buildInputs = [ unzip cmake /*jdk*/ alsaLib ];
+  nativeBuildInputs = [ unzip cmake ];
+  buildInputs = [ alsaLib ];
 
   hardeningDisable = [ "format" ];
 
   meta = {
     homepage = "http://portmedia.sourceforge.net/portmidi/";
     description = "Platform independent library for MIDI I/O";
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.mit;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/ppl/default.nix b/nixpkgs/pkgs/development/libraries/ppl/default.nix
index f1c93e0fa7c7..a94cf9e38d0e 100644
--- a/nixpkgs/pkgs/development/libraries/ppl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ppl/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, fetchpatch, stdenv, gmpxx, perl, gnum4 }:
+{ fetchurl, fetchpatch, lib, stdenv, gmpxx, perl, gnum4 }:
 
 let version = "1.2"; in
 
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
   propagatedBuildInputs = [ gmpxx ];
 
   configureFlags = [ "--disable-watchdog" ] ++
-    stdenv.lib.optionals stdenv.isDarwin [
+    lib.optionals stdenv.isDarwin [
       "CPPFLAGS=-fexceptions"
       "--disable-ppl_lcdd" "--disable-ppl_lpsol" "--disable-ppl_pips"
     ];
@@ -53,9 +53,9 @@ stdenv.mkDerivation {
 
     homepage = "http://bugseng.com/products/ppl/";
 
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
 
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/precice/default.nix b/nixpkgs/pkgs/development/libraries/precice/default.nix
index e8ae15ed31f4..c3c75e2413f0 100644
--- a/nixpkgs/pkgs/development/libraries/precice/default.nix
+++ b/nixpkgs/pkgs/development/libraries/precice/default.nix
@@ -1,14 +1,14 @@
-{ lib, stdenv, fetchFromGitHub, cmake, gcc, boost, eigen, libxml2, openmpi, python3, petsc }:
+{ lib, stdenv, fetchFromGitHub, cmake, gcc, boost, eigen, libxml2, mpi, python3, petsc }:
 
 stdenv.mkDerivation rec {
   pname = "precice";
-  version = "2.1.1";
+  version = "2.2.0";
 
   src = fetchFromGitHub {
     owner = "precice";
     repo = pname;
     rev = "v${version}";
-    sha256 = "180db4nlir2409wzdnsc1bkyrllnki8d551qbm1rg82zkz3vdmqg";
+    sha256 = "sha256-AQc+p/twsfkzwpWeznGpLLSqINKSrWCwH+PdNIrdYA8=";
   };
 
   cmakeFlags = [
@@ -21,8 +21,7 @@ stdenv.mkDerivation rec {
   NIX_CFLAGS_COMPILE = lib.optional stdenv.isDarwin [ "-D_GNU_SOURCE" ];
 
   nativeBuildInputs = [ cmake gcc ];
-  buildInputs = [ boost eigen libxml2 openmpi python3 python3.pkgs.numpy ];
-  enableParallelBuilding = true;
+  buildInputs = [ boost eigen libxml2 mpi python3 python3.pkgs.numpy ];
 
   meta = {
     description = "preCICE stands for Precise Code Interaction Coupling Environment";
diff --git a/nixpkgs/pkgs/development/libraries/prison/default.nix b/nixpkgs/pkgs/development/libraries/prison/default.nix
index d40b4442e38e..4275622c24f4 100644
--- a/nixpkgs/pkgs/development/libraries/prison/default.nix
+++ b/nixpkgs/pkgs/development/libraries/prison/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, qrencode, qt4, libdmtx }:
+{ lib, stdenv, fetchurl, cmake, qrencode, qt4, libdmtx }:
 
 let v = "1.0"; in
 
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   meta = {
     description = "Qt4 library for QR-codes";
-    license = stdenv.lib.licenses.mit;
+    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
index c7a25f621714..93e415f62699 100644
--- a/nixpkgs/pkgs/development/libraries/proj-datumgrid/default.nix
+++ b/nixpkgs/pkgs/development/libraries/proj-datumgrid/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   name = "proj-datumgrid";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     cp nad2bin $out/bin/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Repository for proj datum grids";
     homepage = "https://proj4.org";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/proj/5.2.nix b/nixpkgs/pkgs/development/libraries/proj/5.2.nix
index 7a97491d8ea1..ee76c668716c 100644
--- a/nixpkgs/pkgs/development/libraries/proj/5.2.nix
+++ b/nixpkgs/pkgs/development/libraries/proj/5.2.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   name = "proj-5.2.0";
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
 
   doCheck = stdenv.is64bit;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Cartographic Projections Library";
     homepage = "https://proj4.org";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/proj/default.nix b/nixpkgs/pkgs/development/libraries/proj/default.nix
index 8618d62e834f..22d6206fd851 100644
--- a/nixpkgs/pkgs/development/libraries/proj/default.nix
+++ b/nixpkgs/pkgs/development/libraries/proj/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkg-config, sqlite, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, pkg-config, sqlite, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "proj";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
 
   doCheck = stdenv.is64bit;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Cartographic Projections Library";
     homepage = "https://proj4.org";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/prometheus-client-c/default.nix b/nixpkgs/pkgs/development/libraries/prometheus-client-c/default.nix
index 57f4ef5956f6..9b18b25c7268 100644
--- a/nixpkgs/pkgs/development/libraries/prometheus-client-c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/prometheus-client-c/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 , cmake
@@ -50,9 +50,9 @@ let
       meta = {
         homepage = "https://github.com/digitalocean/prometheus-client-c/";
         inherit description;
-        platforms = stdenv.lib.platforms.unix;
-        license = stdenv.lib.licenses.asl20;
-        maintainers = [ stdenv.lib.maintainers.cfsmp3 ];
+        platforms = lib.platforms.unix;
+        license = lib.licenses.asl20;
+        maintainers = [ lib.maintainers.cfsmp3 ];
       };
     };
 in
diff --git a/nixpkgs/pkgs/development/libraries/prometheus-cpp/default.nix b/nixpkgs/pkgs/development/libraries/prometheus-cpp/default.nix
index 5377d2b96d00..173ee6d2e09d 100644
--- a/nixpkgs/pkgs/development/libraries/prometheus-cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/prometheus-cpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , gbenchmark
@@ -33,10 +33,15 @@ stdenv.mkDerivation rec {
 
   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 = [ stdenv.lib.licenses.mit ];
+    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
index 54fea18fd17e..431e6348b3fa 100644
--- a/nixpkgs/pkgs/development/libraries/properties-cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/properties-cpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , cmake
 , pkg-config
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ gtest doxygen graphviz lcov ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/generic-v3.nix b/nixpkgs/pkgs/development/libraries/protobuf/generic-v3.nix
index 4166aac7246b..f31a7868d5ec 100644
--- a/nixpkgs/pkgs/development/libraries/protobuf/generic-v3.nix
+++ b/nixpkgs/pkgs/development/libraries/protobuf/generic-v3.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook, zlib, gmock, buildPackages
 , version, sha256
@@ -25,7 +25,7 @@ mkProtobufDerivation = buildProtobuf: stdenv: stdenv.mkDerivation {
     chmod -R a+w gmock
     chmod -R a+w googletest
     ln -s ../googletest gmock/gtest
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     substituteInPlace src/google/protobuf/testing/googletest.cc \
       --replace 'tmpnam(b)' '"'$TMPDIR'/foo"'
   '';
@@ -48,8 +48,8 @@ mkProtobufDerivation = buildProtobuf: stdenv: stdenv.mkDerivation {
         yet extensible format. Google uses Protocol Buffers for almost all of
         its internal RPC protocols and file formats.
       '';
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.bsd3;
+    platforms = lib.platforms.unix;
     homepage = "https://developers.google.com/protocol-buffers/";
   };
 
diff --git a/nixpkgs/pkgs/development/libraries/protobuf/generic.nix b/nixpkgs/pkgs/development/libraries/protobuf/generic.nix
index 32d6f70d1eb6..7d64df436260 100644
--- a/nixpkgs/pkgs/development/libraries/protobuf/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/protobuf/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv, version, src
+{ lib, stdenv, version, src
 , autoreconfHook, zlib, gtest
 , ...
 }:
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
     rm -rf gtest
     cp -r ${gtest.src}/googletest gtest
     chmod -R a+w gtest
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     substituteInPlace src/google/protobuf/testing/googletest.cc \
       --replace 'tmpnam(b)' '"'$TMPDIR'/foo"'
   '';
@@ -54,7 +54,7 @@ stdenv.mkDerivation {
       '';
     license = "mBSD";
     homepage = "https://developers.google.com/protocol-buffers/";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 
   passthru.version = version;
diff --git a/nixpkgs/pkgs/development/libraries/protobufc/generic.nix b/nixpkgs/pkgs/development/libraries/protobufc/generic.nix
index 4b0d273ac44d..b64d75076baf 100644
--- a/nixpkgs/pkgs/development/libraries/protobufc/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/protobufc/generic.nix
@@ -1,5 +1,5 @@
-{ stdenv, src, version
-, autoreconfHook, pkgconfig, protobuf, zlib
+{ lib, stdenv, src, version
+, autoreconfHook, pkg-config, protobuf, zlib
 , ...
 }:
 
@@ -9,10 +9,10 @@ stdenv.mkDerivation {
 
   inherit src;
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ protobuf zlib ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/protobuf-c/protobuf-c/";
     description = "C bindings for Google's Protocol Buffers";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/prototypejs/default.nix b/nixpkgs/pkgs/development/libraries/prototypejs/default.nix
index 3753dfacac3b..81e72036694b 100644
--- a/nixpkgs/pkgs/development/libraries/prototypejs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/prototypejs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ... }:
+{ lib, stdenv, fetchurl, ... }:
 let
   version = "1.7.3.0";
 in fetchurl {
@@ -6,7 +6,7 @@ in fetchurl {
   url = "https://ajax.googleapis.com/ajax/libs/prototype/${version}/prototype.js";
   sha256 = "0q43vvrsb22h4jvavs1gk3v4ps61yx9k85b5n6q9mxivhmxprg26";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A foundation for ambitious web user interfaces";
     longDescription = ''
       Prototype takes the complexity out of client-side web
diff --git a/nixpkgs/pkgs/development/libraries/protozero/default.nix b/nixpkgs/pkgs/development/libraries/protozero/default.nix
index 1c8e7e99313a..6bff5998b56d 100644
--- a/nixpkgs/pkgs/development/libraries/protozero/default.nix
+++ b/nixpkgs/pkgs/development/libraries/protozero/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "protozero";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Minimalistic protocol buffer decoder and encoder in C++";
     homepage = "https://github.com/mapbox/protozero";
     license = with licenses; [ bsd2 asl20 ];
diff --git a/nixpkgs/pkgs/development/libraries/pslib/default.nix b/nixpkgs/pkgs/development/libraries/pslib/default.nix
index 08accd5d7df1..ec2362009ff3 100644
--- a/nixpkgs/pkgs/development/libraries/pslib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pslib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, pkgconfig, zlib, libpng, libjpeg, libungif, libtiff
+{ lib, stdenv, fetchurl, cmake, pkg-config, zlib, libpng, libjpeg, libungif, libtiff
 }:
 
 stdenv.mkDerivation rec {
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0m191ckqj1kj2yvxiilqw26x4vrn7pnlc2vy636yphjxr02q8bk4";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
   buildInputs = [ zlib libpng libjpeg libungif libtiff ];
 
   doCheck = true;
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     cp -r ../doc/. $doc/share/doc/${pname}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A C-library for generating multi page PostScript documents";
     homepage = "http://pslib.sourceforge.net/";
     changelog =
diff --git a/nixpkgs/pkgs/development/libraries/psol/generic.nix b/nixpkgs/pkgs/development/libraries/psol/generic.nix
index c61926fe13fa..57784c3a5028 100644
--- a/nixpkgs/pkgs/development/libraries/psol/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/psol/generic.nix
@@ -1,4 +1,4 @@
-{ fetchzip, stdenv }:
+{ fetchzip, lib, stdenv }:
 { version, sha256 }:
 { inherit version; } // fetchzip {
   inherit sha256;
@@ -8,9 +8,9 @@
   meta = {
     description = "PageSpeed Optimization Libraries";
     homepage    = "https://developers.google.com/speed/pagespeed/psol";
-    license     = stdenv.lib.licenses.asl20;
+    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   = stdenv.lib.platforms.linux;
+    platforms   = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/psqlodbc/default.nix b/nixpkgs/pkgs/development/libraries/psqlodbc/default.nix
index 43da67d3d9b6..82ee5c3ae44d 100644
--- a/nixpkgs/pkgs/development/libraries/psqlodbc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/psqlodbc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libiodbc, postgresql, openssl }:
+{ lib, stdenv, fetchurl, libiodbc, postgresql, openssl }:
 
 stdenv.mkDerivation rec {
   name = "psqlodbc-09.01.0200";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--with-iodbc=${libiodbc}" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://odbc.postgresql.org/";
     description = "ODBC driver for PostgreSQL";
     license = licenses.lgpl2;
diff --git a/nixpkgs/pkgs/development/libraries/pstreams/default.nix b/nixpkgs/pkgs/development/libraries/pstreams/default.nix
index e3cb9dd67a3b..bb9b6bc9c84b 100644
--- a/nixpkgs/pkgs/development/libraries/pstreams/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pstreams/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchgit
 }:
 
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
 
   src = fetchgit {
     url = "https://git.code.sf.net/p/pstreams/code";
-    rev = let dot2Underscore = stdenv.lib.strings.stringAsChars (c: if c == "." then "_" else c);
+    rev = let dot2Underscore = lib.strings.stringAsChars (c: if c == "." then "_" else c);
           in "RELEASE_${dot2Underscore version}";
     sha256 = "0r8aj0nh5mkf8cvnzl8bdy4nm7i74vs83axxfimcd74kjfn0irys";
   };
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     # `make install` fails on case-insensitive file systems (e.g. APFS by
     # default) because this target exists
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "POSIX Process Control in C++";
     longDescription = ''
       PStreams allows you to run another program from your C++ application and
diff --git a/nixpkgs/pkgs/development/libraries/ptex/default.nix b/nixpkgs/pkgs/development/libraries/ptex/default.nix
index b4571d07fbf3..3f62d672ea97 100644
--- a/nixpkgs/pkgs/development/libraries/ptex/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ptex/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, zlib, python, cmake, pkg-config }:
+{ lib, stdenv, fetchFromGitHub, zlib, python, cmake, pkg-config }:
 
 stdenv.mkDerivation rec
 {
@@ -14,9 +14,8 @@ stdenv.mkDerivation rec
 
   outputs = [ "bin" "dev" "out" "lib" ];
 
-  buildInputs = [ zlib python cmake pkg-config ];
-
-  enableParallelBuilding = true;
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ zlib python pkg-config ];
 
   # Can be removed in the next release
   # https://github.com/wdas/ptex/pull/42
@@ -24,7 +23,7 @@ stdenv.mkDerivation rec
     echo v${version} >version
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Per-Face Texture Mapping for Production Rendering";
     homepage = "http://ptex.us/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/pth/default.nix b/nixpkgs/pkgs/development/libraries/pth/default.nix
index c64d0b37686b..240c903a8a77 100644
--- a/nixpkgs/pkgs/development/libraries/pth/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pth/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "pth-2.0.7";
@@ -8,13 +8,13 @@ stdenv.mkDerivation rec {
     sha256 = "0ckjqw5kz5m30srqi87idj7xhpw6bpki43mj07bazjm2qmh3cdbj";
   };
 
-  preConfigure = stdenv.lib.optionalString stdenv.isAarch32 ''
+  preConfigure = lib.optionalString stdenv.isAarch32 ''
     configureFlagsArray=("CFLAGS=-DJB_SP=8 -DJB_PC=9")
-  '' + stdenv.lib.optionalString (stdenv.hostPlatform.libc == "glibc") ''
+  '' + lib.optionalString (stdenv.hostPlatform.libc == "glibc") ''
     configureFlagsArray+=("ac_cv_check_sjlj=ssjlj")
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The GNU Portable Threads library";
     homepage = "https://www.gnu.org/software/pth";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/pupnp/default.nix b/nixpkgs/pkgs/development/libraries/pupnp/default.nix
index 4930b222d03c..150005646379 100644
--- a/nixpkgs/pkgs/development/libraries/pupnp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pupnp/default.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, stdenv, autoreconfHook, pkg-config }:
+{ fetchFromGitHub, lib, stdenv, autoreconfHook, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "libupnp";
@@ -29,6 +29,6 @@ stdenv.mkDerivation rec {
     license = "BSD-style";
 
     homepage = "http://pupnp.sourceforge.net/";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/pxlib/default.nix b/nixpkgs/pkgs/development/libraries/pxlib/default.nix
index 2624c718d274..3acaf8bac157 100644
--- a/nixpkgs/pkgs/development/libraries/pxlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pxlib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, intltool }:
+{ lib, stdenv, fetchurl, intltool }:
 
 stdenv.mkDerivation rec {
   pname = "pxlib";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ intltool ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library to read and write Paradox files";
     homepage = "http://pxlib.sourceforge.net/";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/pyotherside/default.nix b/nixpkgs/pkgs/development/libraries/pyotherside/default.nix
index 047142c8a5df..58d38651a760 100644
--- a/nixpkgs/pkgs/development/libraries/pyotherside/default.nix
+++ b/nixpkgs/pkgs/development/libraries/pyotherside/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub
+{ lib, stdenv, fetchFromGitHub
 , python3, qmake, qtbase, qtquickcontrols, qtsvg, ncurses }:
 
 stdenv.mkDerivation rec {
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   patches = [ ./qml-path.patch ];
   installTargets = [ "sub-src-install_subtargets" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Asynchronous Python 3 Bindings for Qt 5";
     homepage = "https://thp.io/2011/pyotherside/";
     license = licenses.isc;
diff --git a/nixpkgs/pkgs/development/libraries/python-qt/default.nix b/nixpkgs/pkgs/development/libraries/python-qt/default.nix
index 6f2550ca9aca..bd778f1a945d 100644
--- a/nixpkgs/pkgs/development/libraries/python-qt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/python-qt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, python, qmake,
+{ lib, stdenv, fetchurl, python, qmake,
   qtwebengine, qtxmlpatterns,
   qttools, unzip }:
 
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     cp -r ./extensions $out/include/PythonQt
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/qca-qt5/default.nix b/nixpkgs/pkgs/development/libraries/qca-qt5/default.nix
index 06de3f7c5693..d1b545884b53 100644
--- a/nixpkgs/pkgs/development/libraries/qca-qt5/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qca-qt5/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, openssl, pkgconfig, qtbase }:
+{ lib, stdenv, fetchurl, cmake, openssl, pkg-config, qtbase }:
 
 stdenv.mkDerivation rec {
   pname = "qca-qt5";
@@ -10,19 +10,19 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ openssl qtbase ];
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
   # Without this patch cmake fails with a "No known features for CXX compiler"
   # error on darwin
-  patches = stdenv.lib.optional stdenv.isDarwin ./move-project.patch ;
+  patches = lib.optional stdenv.isDarwin ./move-project.patch ;
 
   # tells CMake to use this CA bundle file if it is accessible
-  preConfigure = ''export QC_CERTSTORE_PATH=/etc/ssl/certs/ca-certificates.crt'';
+  preConfigure = "export QC_CERTSTORE_PATH=/etc/ssl/certs/ca-certificates.crt";
 
   # tricks CMake into using this CA bundle file if it is not accessible (in a sandbox)
   cmakeFlags = [ "-Dqca_CERTSTORE=/etc/ssl/certs/ca-certificates.crt" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Qt 5 Cryptographic Architecture";
     homepage = "http://delta.affinix.com/qca";
     maintainers = with maintainers; [ ttuegel ];
diff --git a/nixpkgs/pkgs/development/libraries/qca2/default.nix b/nixpkgs/pkgs/development/libraries/qca2/default.nix
index bb89d6926815..42dcf1a87d36 100644
--- a/nixpkgs/pkgs/development/libraries/qca2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qca2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, openssl, cmake, pkgconfig, qt, darwin }:
+{ lib, stdenv, fetchurl, openssl, cmake, pkg-config, qt, darwin }:
 
 stdenv.mkDerivation rec {
   pname = "qca";
@@ -9,11 +9,9 @@ stdenv.mkDerivation rec {
     sha256 = "00kv1vsrc8fp556hm8s6yw3240vx3l4067q6vfxrb3gdwgcd45np";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
   buildInputs = [ openssl qt ]
-    ++ stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
-
-  enableParallelBuilding = true;
+    ++ lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.Security;
 
   # tells CMake to use this CA bundle file if it is accessible
   preConfigure = ''
@@ -27,7 +25,7 @@ stdenv.mkDerivation rec {
     sed -i -e '1i cmake_policy(SET CMP0025 NEW)' CMakeLists.txt
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Qt Cryptographic Architecture";
     license = "LGPL";
     homepage = "http://delta.affinix.com/qca";
diff --git a/nixpkgs/pkgs/development/libraries/qgnomeplatform/default.nix b/nixpkgs/pkgs/development/libraries/qgnomeplatform/default.nix
index 3ff642bbfb98..f739c1bc275e 100644
--- a/nixpkgs/pkgs/development/libraries/qgnomeplatform/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qgnomeplatform/default.nix
@@ -2,7 +2,7 @@
 , lib
 , fetchFromGitHub
 , nix-update-script
-, pkgconfig
+, pkg-config
 , gtk3
 , glib
 , qtbase
@@ -33,7 +33,7 @@ mkDerivation rec {
   ];
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     qmake
   ];
 
diff --git a/nixpkgs/pkgs/development/libraries/qhull/default.nix b/nixpkgs/pkgs/development/libraries/qhull/default.nix
index 689a4877541c..78e111353115 100644
--- a/nixpkgs/pkgs/development/libraries/qhull/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qhull/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation {
   name = "qhull-2016.1";
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.qhull.org/";
     description = "Compute the convex hull, Delaunay triangulation, Voronoi diagram and more";
     license = licenses.qhull;
diff --git a/nixpkgs/pkgs/development/libraries/qimageblitz/default.nix b/nixpkgs/pkgs/development/libraries/qimageblitz/default.nix
index 51253676341f..709a3fb1533d 100644
--- a/nixpkgs/pkgs/development/libraries/qimageblitz/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qimageblitz/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, cmake, qt4}:
+{lib, stdenv, fetchurl, cmake, qt4}:
 
 let
   pn = "qimageblitz";
@@ -13,14 +13,15 @@ stdenv.mkDerivation {
     sha256 = "0pnaf3qi7rgkxzs2mssmslb3f9ya4cyx09wzwlis3ppyvf72j0p9";
   };
 
-  buildInputs = [ cmake qt4 ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ qt4 ];
 
   patches = [ ./qimageblitz-9999-exec-stack.patch ];
 
   meta = {
     description = "Graphical effect and filter library for KDE4";
-    license = stdenv.lib.licenses.bsd2;
+    license = lib.licenses.bsd2;
     homepage = "http://${pn}.sourceforge.net";
-    platforms = stdenv.lib.platforms.linux;
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/qjson/default.nix b/nixpkgs/pkgs/development/libraries/qjson/default.nix
index ab4a96e65ea6..a6ee272a38b5 100644
--- a/nixpkgs/pkgs/development/libraries/qjson/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qjson/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, qt4 }:
+{ lib, stdenv, fetchFromGitHub, cmake, qt4 }:
 
 stdenv.mkDerivation rec {
   version = "0.9.0";
@@ -11,9 +11,10 @@ stdenv.mkDerivation rec {
     sha256 = "1f4wnxzx0qdmxzc7hqk28m0sva7z9p9xmxm6aifvjlp0ha6pmfxs";
   };
 
-  buildInputs = [ cmake qt4 ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ qt4 ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Lightweight data-interchange format";
     homepage = "http://qjson.sourceforge.net/";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/qmlbox2d/default.nix b/nixpkgs/pkgs/development/libraries/qmlbox2d/default.nix
index 03247f9d695b..88c945430451 100644
--- a/nixpkgs/pkgs/development/libraries/qmlbox2d/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qmlbox2d/default.nix
@@ -1,4 +1,4 @@
-{stdenv, qtdeclarative, fetchFromGitHub, qmake }:
+{lib, stdenv, qtdeclarative, fetchFromGitHub, qmake }:
 stdenv.mkDerivation {
   name = "qml-box2d-2018-04-06";
   src = fetchFromGitHub {
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
 
   installFlags = [ "INSTALL_ROOT=$(out)" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A QML plugin for Box2D engine";
     homepage = "https://github.com/qml-box2d/qml-box2d";
     maintainers = [ maintainers.guibou ];
diff --git a/nixpkgs/pkgs/development/libraries/qmltermwidget/default.nix b/nixpkgs/pkgs/development/libraries/qmltermwidget/default.nix
index ac2584573114..75f95a53800a 100644
--- a/nixpkgs/pkgs/development/libraries/qmltermwidget/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qmltermwidget/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, qtbase, qtquick1, qmake, qtmultimedia, utmp }:
+{ lib, stdenv, fetchFromGitHub, qtbase, qtquick1, qmake, qtmultimedia, utmp, fetchpatch }:
 
 stdenv.mkDerivation {
   version = "2018-11-24";
@@ -12,10 +12,18 @@ stdenv.mkDerivation {
   };
 
   buildInputs = [ qtbase qtquick1 qtmultimedia ]
-                ++ stdenv.lib.optional stdenv.isDarwin utmp;
+                ++ lib.optional stdenv.isDarwin utmp;
   nativeBuildInputs = [ qmake ];
 
-  patchPhase = ''
+  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/"
   '';
@@ -27,8 +35,8 @@ stdenv.mkDerivation {
   meta = {
     description = "A QML port of qtermwidget";
     homepage = "https://github.com/Swordfish90/qmltermwidget";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
-    maintainers = with stdenv.lib.maintainers; [ skeidel ];
+    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
index 41e4b80d9c3a..8afa19c229fa 100644
--- a/nixpkgs/pkgs/development/libraries/qoauth/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qoauth/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qtbase, qmake, qca-qt5 }:
+{ lib, stdenv, fetchurl, qtbase, qmake, qca-qt5 }:
 
 stdenv.mkDerivation {
   name = "qoauth-2.0.0";
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
   NIX_CFLAGS_COMPILE = "-I${qca-qt5}/include/Qca-qt5/QtCrypto";
   NIX_LDFLAGS = "-lqca-qt5";
 
-  meta = with stdenv.lib; {
+  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
index a427bd5d0518..aba9e77691a9 100644
--- a/nixpkgs/pkgs/development/libraries/qpdf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qpdf/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, libjpeg, zlib, perl }:
+{ lib, stdenv, fetchFromGitHub, libjpeg, zlib, perl }:
 
 stdenv.mkDerivation rec {
   pname = "qpdf";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/qrcodegen/default.nix b/nixpkgs/pkgs/development/libraries/qrcodegen/default.nix
index b5faaf90ef7a..80ce9e1d0f85 100644
--- a/nixpkgs/pkgs/development/libraries/qrcodegen/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qrcodegen/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 stdenv.mkDerivation rec {
   pname = "qrcodegen";
   version = "1.6.0";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     cp qrcodegen.h $out/include/qrcodegen/
   '';
 
-  meta = with stdenv.lib;
+  meta = with lib;
     {
       description = "qrcode generator library in multiple languages";
 
diff --git a/nixpkgs/pkgs/development/libraries/qrencode/default.nix b/nixpkgs/pkgs/development/libraries/qrencode/default.nix
index 2c60c4c10d07..c005b835a932 100644
--- a/nixpkgs/pkgs/development/libraries/qrencode/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qrencode/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, SDL2, libpng, libiconv }:
+{ lib, stdenv, fetchurl, pkg-config, SDL2, libpng, libiconv }:
 
 stdenv.mkDerivation rec {
   pname = "qrencode";
@@ -11,8 +11,8 @@ stdenv.mkDerivation rec {
     sha256 = "sha256-2kSO1PUqumvLDNSMrA3VG4aSvMxM0SdDFAL8pvgXHo4=";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ SDL2 libpng ] ++ stdenv.lib.optionals stdenv.isDarwin [ libiconv ];
+  nativeBuildInputs = [ pkg-config ];
+  buildInputs = [ SDL2 libpng ] ++ lib.optionals stdenv.isDarwin [ libiconv ];
 
   configureFlags = [
     "--with-tests"
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     runHook postCheck
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://fukuchi.org/works/qrencode/";
     description = "C library for encoding data in a QR Code symbol";
 
diff --git a/nixpkgs/pkgs/development/libraries/qrupdate/default.nix b/nixpkgs/pkgs/development/libraries/qrupdate/default.nix
index b941021cb688..ad7e88d4647e 100644
--- a/nixpkgs/pkgs/development/libraries/qrupdate/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qrupdate/default.nix
@@ -1,4 +1,5 @@
 { stdenv
+, lib
 , fetchurl
 , gfortran
 , blas
@@ -24,7 +25,7 @@ stdenv.mkDerivation rec {
       "LAPACK=-L${lapack}/lib -llapack"
       "BLAS=-L${blas}/lib -lblas"
       "PREFIX=${placeholder "out"}"
-      ${stdenv.lib.optionalString blas.isILP64
+      ${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
@@ -39,13 +40,13 @@ stdenv.mkDerivation rec {
 
   buildFlags = [ "lib" "solib" ];
 
-  installTargets = stdenv.lib.optionals stdenv.isDarwin [ "install-staticlib" "install-shlib" ];
+  installTargets = lib.optionals stdenv.isDarwin [ "install-staticlib" "install-shlib" ];
 
   buildInputs = [ gfortran ];
 
   nativeBuildInputs = [ which ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for fast updating of qr and cholesky decompositions";
     homepage = "https://sourceforge.net/projects/qrupdate/";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/qscintilla/default.nix b/nixpkgs/pkgs/development/libraries/qscintilla/default.nix
index 19aebd715d6b..26a3c2e36d3b 100644
--- a/nixpkgs/pkgs/development/libraries/qscintilla/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qscintilla/default.nix
@@ -46,7 +46,7 @@ in stdenv.mkDerivation rec {
       --replace '$$[QT_INSTALL_DATA]'         $out/share${lib.optionalString (! withQt5) "/qt"}
   '';
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/qt-3/default.nix b/nixpkgs/pkgs/development/libraries/qt-3/default.nix
index f5837717622c..b2d818a2972d 100644
--- a/nixpkgs/pkgs/development/libraries/qt-3/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-3/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl
+{ lib, stdenv, fetchurl
 , xftSupport ? true, libXft ? null
 , xrenderSupport ? true, libXrender ? null
 , xrandrSupport ? true, libXrandr ? null
@@ -6,8 +6,8 @@
 , cursorSupport ? true, libXcursor ? null
 , threadSupport ? true
 , mysqlSupport ? false, libmysqlclient ? null
-, libGLSupported ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
-, openglSupport ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
+, openglSupport ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
 , libGL ? null, libGLU ? null, libXmu ? null
 , xlibsWrapper, xorgproto, zlib, libjpeg, libpng, which
 }:
@@ -37,7 +37,7 @@ stdenv.mkDerivation {
   hardeningDisable = [ "format" ];
 
   configureFlags = let
-    mk = cond: name: "-${stdenv.lib.optionalString (!cond) "no-"}${name}";
+    mk = cond: name: "-${lib.optionalString (!cond) "no-"}${name}";
   in [
     "-v"
     "-system-zlib" "-system-libpng" "-system-libjpeg"
@@ -49,21 +49,21 @@ stdenv.mkDerivation {
     (mk xineramaSupport "xinerama")
     (mk xrandrSupport "xrandr")
     (mk xftSupport "xft")
-  ] ++ stdenv.lib.optionals openglSupport [
+  ] ++ lib.optionals openglSupport [
     "-dlopen-opengl"
     "-L${libGL}/lib" "-I${libGLU}/include"
     "-L${libXmu.out}/lib" "-I${libXmu.dev}/include"
-  ] ++ stdenv.lib.optionals xrenderSupport [
+  ] ++ lib.optionals xrenderSupport [
     "-L${libXrender.out}/lib" "-I${libXrender.dev}/include"
-  ] ++ stdenv.lib.optionals xrandrSupport [
+  ] ++ lib.optionals xrandrSupport [
     "-L${libXrandr.out}/lib" "-I${libXrandr.dev}/include"
-  ] ++ stdenv.lib.optionals xineramaSupport [
+  ] ++ lib.optionals xineramaSupport [
     "-L${libXinerama.out}/lib" "-I${libXinerama.dev}/include"
-  ] ++ stdenv.lib.optionals cursorSupport [
+  ] ++ lib.optionals cursorSupport [
     "-L${libXcursor.out}/lib -I${libXcursor.dev}/include"
-  ] ++ stdenv.lib.optionals mysqlSupport [
+  ] ++ lib.optionals mysqlSupport [
     "-qt-sql-mysql" "-L${libmysqlclient}/lib/mysql" "-I${libmysqlclient}/include/mysql"
-  ] ++ stdenv.lib.optionals xftSupport [
+  ] ++ lib.optionals xftSupport [
     "-L${libXft.out}/lib" "-I${libXft.dev}/include"
     "-L${libXft.freetype.out}/lib" "-I${libXft.freetype.dev}/include"
     "-L${libXft.fontconfig.lib}/lib" "-I${libXft.fontconfig.dev}/include"
@@ -85,7 +85,7 @@ stdenv.mkDerivation {
 
   passthru = {inherit mysqlSupport;};
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     license = with licenses; [ gpl2 qpl ];
     platforms = platforms.linux;
   };
diff --git a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/default.nix b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/default.nix
index 3deea882bb6c..7dddd2bc67d2 100644
--- a/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-4.x/4.8/default.nix
@@ -1,10 +1,10 @@
 { stdenv, lib, fetchurl, fetchpatch, substituteAll
 , libXrender, libXinerama, libXcursor, libXv, libXext
 , libXfixes, libXrandr, libSM, freetype, fontconfig, zlib, libjpeg, libpng
-, libmng, which, libGLU, openssl, dbus, cups, pkgconfig
+, libmng, which, libGLU, openssl, dbus, cups, pkg-config
 , libtiff, glib, icu, libmysqlclient, postgresql, sqlite, perl, coreutils, libXi
 , alsaLib
-, libGLSupported ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
 , flashplayerFix ? false, gdk-pixbuf
 , gtkStyle ? stdenv.hostPlatform == stdenv.buildPlatform, gtk2
 , gnomeStyle ? false, libgnomeui, GConf, gnome_vfs
@@ -199,7 +199,7 @@ stdenv.mkDerivation rec {
     ++ lib.optionals gtkStyle [ gtk2 gdk-pixbuf ]
     ++ lib.optionals stdenv.isDarwin [ ApplicationServices OpenGL Cocoa AGL libcxx libobjc ];
 
-  nativeBuildInputs = [ perl pkgconfig which ];
+  nativeBuildInputs = [ perl pkg-config which ];
 
   enableParallelBuilding = true;
 
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.12/default.nix b/nixpkgs/pkgs/development/libraries/qt-5/5.12/default.nix
index 87a88ddf9b0d..cf5a0de11ad1 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/5.12/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.12/default.nix
@@ -16,7 +16,7 @@ top-level attribute to `top-level/all-packages.nix`.
 
 {
   newScope,
-  stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper,
+  lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper,
   bison, cups ? null, harfbuzz, libGL, perl,
   gstreamer, gst-plugins-base, gtk3, dconf,
   llvmPackages_5,
@@ -27,7 +27,7 @@ top-level attribute to `top-level/all-packages.nix`.
   debug ? false,
 }:
 
-with stdenv.lib;
+with lib;
 
 let
 
@@ -119,7 +119,7 @@ let
     import ../qtModule.nix
     {
       inherit perl;
-      inherit (stdenv) lib;
+      inherit lib;
       # Use a variant of mkDerivation that does not include wrapQtApplications
       # to avoid cyclic dependencies between Qt modules.
       mkDerivation =
@@ -136,7 +136,7 @@ let
 
       mkDerivationWith =
         import ../mkDerivation.nix
-        { inherit (stdenv) lib; inherit debug; inherit (self) wrapQtAppsHook; };
+        { inherit lib; inherit debug; inherit (self) wrapQtAppsHook; };
 
       mkDerivation = mkDerivationWith stdenvActual.mkDerivation;
 
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.14/default.nix b/nixpkgs/pkgs/development/libraries/qt-5/5.14/default.nix
index 3eefd23fde73..7139a3b73541 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/5.14/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.14/default.nix
@@ -16,7 +16,7 @@ top-level attribute to `top-level/all-packages.nix`.
 
 {
   newScope,
-  stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper,
+  lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper,
   bison, cups ? null, harfbuzz, libGL, perl,
   gstreamer, gst-plugins-base, gtk3, dconf,
   llvmPackages_5,
@@ -27,7 +27,7 @@ top-level attribute to `top-level/all-packages.nix`.
   debug ? false,
 }:
 
-with stdenv.lib;
+with lib;
 
 let
 
@@ -87,6 +87,22 @@ let
         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/";
+      })
     ]
       ++ optional stdenv.isDarwin ./qtwebengine-darwin-no-platform-check.patch;
     qtwebkit = [
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix b/nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix
index 08fd3a9720cf..a3a0496f160f 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/5.15/default.nix
@@ -16,7 +16,7 @@ top-level attribute to `top-level/all-packages.nix`.
 
 {
   newScope,
-  stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper,
+  lib, stdenv, fetchurl, fetchpatch, fetchFromGitHub, makeSetupHook, makeWrapper,
   bison, cups ? null, harfbuzz, libGL, perl,
   gstreamer, gst-plugins-base, gtk3, dconf,
   llvmPackages_5,
@@ -27,7 +27,7 @@ top-level attribute to `top-level/all-packages.nix`.
   debug ? false,
 }:
 
-with stdenv.lib;
+with lib;
 
 let
 
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix
index cc6e45e3ebde..24f1d6f81a24 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtbase.nix
@@ -2,7 +2,7 @@
   stdenv, lib,
   src, patches, version, qtCompatVersion,
 
-  coreutils, bison, flex, gdb, gperf, lndir, perl, pkgconfig, python3,
+  coreutils, bison, flex, gdb, gperf, lndir, perl, pkg-config, python3,
   which,
   # darwin support
   darwin, libiconv,
@@ -87,7 +87,7 @@ stdenv.mkDerivation {
     ++ lib.optional (postgresql != null) postgresql;
 
   nativeBuildInputs =
-    [ bison flex gperf lndir perl pkgconfig which ];
+    [ bison flex gperf lndir perl pkg-config which ];
 
   propagatedNativeBuildInputs = [ lndir ];
 
@@ -356,8 +356,6 @@ stdenv.mkDerivation {
         ]
     );
 
-  enableParallelBuilding = true;
-
   postInstall =
     # Move selected outputs.
     ''
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtconnectivity.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtconnectivity.nix
index 36a736d03dc5..f6aeb23fb7b4 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtconnectivity.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtconnectivity.nix
@@ -1,8 +1,8 @@
-{ qtModule, stdenv, qtbase, qtdeclarative, bluez }:
+{ qtModule, lib, stdenv, qtbase, qtdeclarative, bluez }:
 
 qtModule {
   name = "qtconnectivity";
   qtInputs = [ qtbase qtdeclarative ];
-  buildInputs = stdenv.lib.optional stdenv.isLinux bluez;
+  buildInputs = lib.optional stdenv.isLinux bluez;
   outputs = [ "out" "dev" "bin" ];
 }
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtgamepad.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtgamepad.nix
index 281f6e0b8ecd..6bc023eb9bbd 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtgamepad.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtgamepad.nix
@@ -1,9 +1,9 @@
-{ qtModule, qtbase, qtdeclarative, pkgconfig }:
+{ qtModule, qtbase, qtdeclarative, pkg-config }:
 
 qtModule {
   name = "qtgamepad";
   qtInputs = [ qtbase qtdeclarative ];
   buildInputs = [ ];
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   outputs = [ "out" "dev" "bin" ];
 }
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtlocation.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtlocation.nix
index a80785d8099a..182b5f5bc334 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtlocation.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtlocation.nix
@@ -1,10 +1,10 @@
-{ stdenv, qtModule, qtbase, qtmultimedia }:
+{ lib, stdenv, qtModule, qtbase, qtmultimedia }:
 
 qtModule {
   name = "qtlocation";
   qtInputs = [ qtbase qtmultimedia ];
   outputs = [ "bin" "out" "dev" ];
-  qmakeFlags = stdenv.lib.optional stdenv.isDarwin [
+  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
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtmacextras.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtmacextras.nix
index 11964caf17b1..6639e4c8d697 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtmacextras.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtmacextras.nix
@@ -1,9 +1,9 @@
-{ stdenv, qtModule, qtbase }:
+{ lib, stdenv, qtModule, qtbase }:
 
 qtModule {
   name = "qtmacextras";
   qtInputs = [ qtbase ];
-  meta = with stdenv.lib; {
+  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
index 42ed23bb6dc9..eb2c3bc7431d 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtmultimedia.nix
@@ -1,13 +1,13 @@
-{ qtModule, stdenv, qtbase, qtdeclarative, pkgconfig
+{ qtModule, lib, stdenv, qtbase, qtdeclarative, pkg-config
 , alsaLib, gstreamer, gst-plugins-base, libpulseaudio, wayland
 }:
 
-with stdenv.lib;
+with lib;
 
 qtModule {
   name = "qtmultimedia";
   qtInputs = [ qtbase qtdeclarative ];
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ gstreamer gst-plugins-base libpulseaudio ]
     ++ optional (stdenv.isLinux) alsaLib
     ++ optional (versionAtLeast qtbase.version "5.14.0" && stdenv.isLinux) wayland;
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwayland.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwayland.nix
index c7a7704f2837..5291ea9c9a78 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwayland.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwayland.nix
@@ -1,9 +1,9 @@
-{ qtModule, qtbase, qtquickcontrols, wayland, pkgconfig }:
+{ qtModule, qtbase, qtquickcontrols, wayland, pkg-config }:
 
 qtModule {
   name = "qtwayland";
   qtInputs = [ qtbase qtquickcontrols ];
   buildInputs = [ wayland ];
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   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
index b98b711c0f5d..b79479e5dbab 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebengine.nix
@@ -1,7 +1,7 @@
 { qtModule
 , qtdeclarative, qtquickcontrols, qtlocation, qtwebchannel
 
-, bison, coreutils, flex, git, gperf, ninja, pkgconfig, python2, which
+, bison, coreutils, flex, git, gperf, ninja, pkg-config, python2, which
 
 , xorg, libXcursor, libXScrnSaver, libXrandr, libXtst
 , fontconfig, freetype, harfbuzz, icu, dbus, libdrm
@@ -18,13 +18,13 @@
 , lib, stdenv, fetchpatch
 }:
 
-with stdenv.lib;
+with lib;
 
 qtModule {
   name = "qtwebengine";
   qtInputs = [ qtdeclarative qtquickcontrols qtlocation qtwebchannel ];
   nativeBuildInputs = [
-    bison coreutils flex git gperf ninja pkgconfig python2 which gn
+    bison coreutils flex git gperf ninja pkg-config python2 which gn
   ] ++ optional stdenv.isDarwin xcbuild;
   doCheck = true;
   outputs = [ "bin" "dev" "out" ];
@@ -88,7 +88,7 @@ qtModule {
   NIX_CFLAGS_COMPILE = lib.optionals stdenv.cc.isGNU [
     # with gcc8, -Wclass-memaccess became part of -Wall and this exceeds the logging limit
     "-Wno-class-memaccess"
-  ] ++ lib.optionals (stdenv.hostPlatform.platform.gcc.arch or "" == "sandybridge") [
+  ] ++ 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"
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebkit.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
index 3d9e72bb54fa..ed41a4ac9bc0 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebkit.nix
@@ -2,7 +2,7 @@
 , qtbase, qtdeclarative, qtlocation, qtmultimedia, qtsensors, qtwebchannel
 , fontconfig, gtk2, libwebp, libxml2, libxslt
 , sqlite, systemd, glib, gst_all_1, cmake
-, bison, flex, gdb, gperf, perl, pkgconfig, python2, ruby
+, bison, flex, gdb, gperf, perl, pkg-config, python2, ruby
 , darwin
 , flashplayerFix ? false
 }:
@@ -31,7 +31,7 @@ qtModule {
     ++ optionals (stdenv.isDarwin) (with darwin; with apple_sdk.frameworks; [ ICU OpenGL ])
     ++ optional usingAnnulenWebkitFork hyphen;
   nativeBuildInputs = [
-    bison flex gdb gperf perl pkgconfig python2 ruby
+    bison flex gdb gperf perl pkg-config python2 ruby
   ] ++ optional usingAnnulenWebkitFork cmake;
 
   cmakeFlags = optionals usingAnnulenWebkitFork ([ "-DPORT=Qt" ]
@@ -43,7 +43,7 @@ qtModule {
 
   # 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 = stdenv.lib.optionalString (!usingAnnulenWebkitFork) ''
+  preConfigure = lib.optionalString (!usingAnnulenWebkitFork) ''
     QMAKEPATH="$PWD/Tools/qmake''${QMAKEPATH:+:}$QMAKEPATH"
     fixQtBuiltinPaths . '*.pr?'
     # Fix hydra's "Log limit exceeded"
@@ -72,6 +72,6 @@ qtModule {
   preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
 
   meta = {
-    maintainers = with stdenv.lib.maintainers; [ abbradar periklis ];
+    maintainers = with lib.maintainers; [ abbradar periklis ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebview.nix b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebview.nix
index 906d750c5d3f..4034dce49f56 100644
--- a/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebview.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-5/modules/qtwebview.nix
@@ -1,6 +1,6 @@
-{ darwin, stdenv, qtModule, qtdeclarative, qtwebengine }:
+{ darwin, lib, stdenv, qtModule, qtdeclarative, qtwebengine }:
 
-with stdenv.lib;
+with lib;
 
 qtModule {
   name = "qtwebview";
diff --git a/nixpkgs/pkgs/development/libraries/qt-mobility/default.nix b/nixpkgs/pkgs/development/libraries/qt-mobility/default.nix
index ba44a217e3d7..60c1d2754d70 100644
--- a/nixpkgs/pkgs/development/libraries/qt-mobility/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qt-mobility/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, qt4, libX11, coreutils, bluez, perl }:
+{ lib, stdenv, fetchFromGitHub, qt4, libX11, coreutils, bluez, perl }:
 # possible additional dependencies: pulseaudio udev networkmanager immerson qmf
 
 stdenv.mkDerivation rec {
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ qt4 libX11 bluez perl ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Qt Mobility";
     homepage = "http://qt.nokia.com/products/qt-addons/mobility";
     maintainers = [ maintainers.qknight ];
diff --git a/nixpkgs/pkgs/development/libraries/qtinstaller/default.nix b/nixpkgs/pkgs/development/libraries/qtinstaller/default.nix
index 3c4c192bd4b9..91f853711066 100644
--- a/nixpkgs/pkgs/development/libraries/qtinstaller/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qtinstaller/default.nix
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
   '';
 
   meta = {
-    description = ''Qt installer framework'';
+    description = "Qt installer framework";
     inherit (qtbase.meta) platforms license homepage;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/qtkeychain/default.nix b/nixpkgs/pkgs/development/libraries/qtkeychain/default.nix
index ddfdc2f67d30..6da4abb756e6 100644
--- a/nixpkgs/pkgs/development/libraries/qtkeychain/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qtkeychain/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig, qt4 ? null
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, qt4 ? null
 , withQt5 ? false, qtbase ? null, qttools ? null
 , darwin ? null
 , libsecret
@@ -24,12 +24,12 @@ stdenv.mkDerivation rec {
   cmakeFlags = [ "-DQT_TRANSLATIONS_DIR=share/qt/translations" ];
 
   nativeBuildInputs = [ cmake ]
-    ++ stdenv.lib.optionals (!stdenv.isDarwin) [ pkgconfig ] # for finding libsecret
+    ++ lib.optionals (!stdenv.isDarwin) [ pkg-config ] # for finding libsecret
   ;
 
-  buildInputs = stdenv.lib.optionals (!stdenv.isDarwin) [ libsecret ]
+  buildInputs = lib.optionals (!stdenv.isDarwin) [ libsecret ]
     ++ (if withQt5 then [ qtbase qttools ] else [ qt4 ])
-    ++ stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+    ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
       CoreFoundation Security
     ])
   ;
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Platform-independent Qt API for storing passwords securely";
     homepage = "https://github.com/frankosterfeld/qtkeychain";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.unix;
+    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
index ecff7f7f8215..3558201015c6 100644
--- a/nixpkgs/pkgs/development/libraries/qtpbfimageplugin/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qtpbfimageplugin/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, qmake, qtbase, protobuf }:
+{ lib, stdenv, fetchFromGitHub, qmake, qtbase, protobuf }:
 
 stdenv.mkDerivation rec {
   pname = "qtpbfimageplugin";
@@ -18,13 +18,13 @@ stdenv.mkDerivation rec {
     # Fix plugin dir
     substituteInPlace pbfplugin.pro \
       --replace "\$\$[QT_INSTALL_PLUGINS]" "$out/$qtPluginPrefix"
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     # Fix darwin build
     substituteInPlace pbfplugin.pro \
       --replace '$$PROTOBUF/lib/libprotobuf-lite.a' '${protobuf}/lib/libprotobuf-lite.dylib'
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Qt image plugin for displaying Mapbox vector tiles";
     longDescription = ''
       QtPBFImagePlugin is a Qt image plugin that enables applications capable of
diff --git a/nixpkgs/pkgs/development/libraries/qtscriptgenerator/default.nix b/nixpkgs/pkgs/development/libraries/qtscriptgenerator/default.nix
index a6cffd73c3ff..0164f8884a27 100644
--- a/nixpkgs/pkgs/development/libraries/qtscriptgenerator/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qtscriptgenerator/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qt4 }:
+{ lib, stdenv, fetchurl, qt4 }:
 
 stdenv.mkDerivation {
   name = "qtscriptgenerator-0.1.0";
@@ -43,6 +43,6 @@ stdenv.mkDerivation {
     description = "QtScript bindings generator";
     homepage = "https://code.qt.io/cgit/qt-labs/qtscriptgenerator.git/";
     inherit (qt4.meta) platforms;
-    license = stdenv.lib.licenses.lgpl21;
+    license = lib.licenses.lgpl21;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix b/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix
index a5c96dc351b9..7290b3830d07 100644
--- a/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum-qt4/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, qmake4Hook , qt4, libX11, libXext }:
+{ lib, stdenv, fetchFromGitHub, qmake4Hook , qt4, libX11, libXext }:
 
 stdenv.mkDerivation rec {
   pname = "qtstyleplugin-kvantum-qt4";
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     mv $TMP/kvantum/${qt4}/lib $out
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SVG-based Qt4 theme engine";
     homepage = "https://github.com/tsujan/Kvantum";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix b/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
index 71ca8e720a41..c2fa32b6d05a 100644
--- a/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qtstyleplugin-kvantum/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, qmake, qtbase, qtsvg, qtx11extras, kwindowsystem
+{ lib, stdenv, fetchFromGitHub, qmake, qtbase, qtsvg, qtx11extras, kwindowsystem
 , libX11, libXext, qttools, wrapQtAppsHook
 }:
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
       --replace "\$\$[QT_INSTALL_PLUGINS]" "$out/$qtPluginPrefix"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SVG-based Qt5 theme engine plus a config tool and extra themes";
     homepage = "https://github.com/tsujan/Kvantum";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/qtstyleplugins/default.nix b/nixpkgs/pkgs/development/libraries/qtstyleplugins/default.nix
index 1970dd183c1c..84d7f46a2b29 100644
--- a/nixpkgs/pkgs/development/libraries/qtstyleplugins/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qtstyleplugins/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, mkDerivation, fetchFromGitHub, qmake, pkgconfig, gtk2 }:
+{ lib, stdenv, mkDerivation, fetchFromGitHub, qmake, pkg-config, gtk2 }:
 
 mkDerivation {
   name = "qtstyleplugins-2017-03-11";
@@ -12,10 +12,10 @@ mkDerivation {
 
   patches = [ ./fix-build-against-Qt-5.15.patch ];
 
-  nativeBuildInputs = [ pkgconfig qmake ];
+  nativeBuildInputs = [ pkg-config qmake ];
   buildInputs = [ gtk2 ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/qtutilities/default.nix b/nixpkgs/pkgs/development/libraries/qtutilities/default.nix
index 916e381ab4da..831c51fa234d 100644
--- a/nixpkgs/pkgs/development/libraries/qtutilities/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qtutilities/default.nix
@@ -1,4 +1,12 @@
-{ stdenv, fetchFromGitHub, cpp-utilities, qttools, qtbase, cmake, pkgconfig }:
+{ stdenv
+, lib
+, fetchFromGitHub
+, cpp-utilities
+, qttools
+, qtbase
+, cmake
+, pkg-config
+}:
 
 stdenv.mkDerivation rec {
   pname = "qtutilities";
@@ -14,7 +22,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ qtbase cpp-utilities ];
   nativeBuildInputs = [ cmake qttools ];
 
-  meta = with stdenv.lib; {
+  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.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/qtwebkit-plugins/default.nix b/nixpkgs/pkgs/development/libraries/qtwebkit-plugins/default.nix
index d1b921deac02..652c49aa6ca2 100644
--- a/nixpkgs/pkgs/development/libraries/qtwebkit-plugins/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qtwebkit-plugins/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, qmake, qtwebkit, hunspell }:
+{ lib, stdenv, fetchFromGitHub, qmake, qtwebkit, hunspell }:
 
 stdenv.mkDerivation {
   name = "qtwebkit-plugins-2017-01-25";
@@ -15,11 +15,11 @@ stdenv.mkDerivation {
   buildInputs = [ qtwebkit hunspell ];
 
   postPatch = ''
-    sed -i "s,-lhunspell,-lhunspell-${stdenv.lib.versions.majorMinor hunspell.version}," src/spellcheck/spellcheck.pri
+    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 stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/quazip/default.nix b/nixpkgs/pkgs/development/libraries/quazip/default.nix
index c399298b8f86..3f186314d013 100644
--- a/nixpkgs/pkgs/development/libraries/quazip/default.nix
+++ b/nixpkgs/pkgs/development/libraries/quazip/default.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, stdenv, zlib, qtbase, cmake, fixDarwinDylibNames }:
+{ fetchFromGitHub, lib, stdenv, zlib, qtbase, cmake, fixDarwinDylibNames }:
 
 stdenv.mkDerivation rec {
   pname = "quazip";
@@ -13,9 +13,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ zlib qtbase ];
   nativeBuildInputs = [ cmake ]
-    ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
+    ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
-  meta = with stdenv.lib; {
+  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/
diff --git a/nixpkgs/pkgs/development/libraries/quesoglc/default.nix b/nixpkgs/pkgs/development/libraries/quesoglc/default.nix
index 6aebb7a6511d..1a4fcca9d9b0 100644
--- a/nixpkgs/pkgs/development/libraries/quesoglc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/quesoglc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libGLU, libGL, glew, freetype, fontconfig, fribidi, libX11 }:
+{ lib, stdenv, fetchurl, libGLU, libGL, glew, freetype, fontconfig, fribidi, libX11 }:
 stdenv.mkDerivation rec {
   pname = "quesoglc";
   version = "0.7.2";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
   };
   buildInputs = [ libGLU libGL glew freetype fontconfig fribidi libX11 ];
   # FIXME: Configure fails to use system glew.
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/quickder/default.nix b/nixpkgs/pkgs/development/libraries/quickder/default.nix
index e5346b42b9fb..28933f96fa1c 100644
--- a/nixpkgs/pkgs/development/libraries/quickder/default.nix
+++ b/nixpkgs/pkgs/development/libraries/quickder/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, python2Packages, hexio
+{ lib, stdenv, fetchFromGitHub, python2Packages, hexio
 , cmake, bash, arpa2cm, git, asn2quickder }:
 
 stdenv.mkDerivation rec {
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
     export PREFIX=$out
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Quick (and Easy) DER, a Library for parsing ASN.1";
     homepage = "https://github.com/vanrein/quick-der";
     license = licenses.bsd2;
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
index 1a29bb90fbb4..edfd3b4e24a3 100644
--- a/nixpkgs/pkgs/development/libraries/qwt/6.nix
+++ b/nixpkgs/pkgs/development/libraries/qwt/6.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qtbase, qtsvg, qttools, qmake }:
+{ lib, stdenv, fetchurl, qtbase, qtsvg, qttools, qmake }:
 
 stdenv.mkDerivation rec {
   name = "qwt-6.1.5";
@@ -17,11 +17,11 @@ stdenv.mkDerivation rec {
 
   qmakeFlags = [ "-after doc.path=$out/share/doc/${name}" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Qt widgets for technical applications";
     homepage = "http://qwt.sourceforge.net/";
     # LGPL 2.1 plus a few exceptions (more liberal)
-    license = stdenv.lib.licenses.qwt;
+    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
index 4b7aa9cf7f98..61903af93fac 100644
--- a/nixpkgs/pkgs/development/libraries/qwt/6_qt4.nix
+++ b/nixpkgs/pkgs/development/libraries/qwt/6_qt4.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qt4, qmake4Hook, AGL }:
+{ lib, stdenv, fetchurl, qt4, qmake4Hook, AGL }:
 
 stdenv.mkDerivation rec {
   name = "qwt-6.1.5";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     qt4
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [ AGL ];
+  ] ++ lib.optionals stdenv.isDarwin [ AGL ];
 
   nativeBuildInputs = [ qmake4Hook ];
 
@@ -22,18 +22,18 @@ stdenv.mkDerivation rec {
 
   # qwt.framework output includes a relative reference to itself, which breaks dependents
   preFixup =
-    stdenv.lib.optionalString stdenv.isDarwin ''
+    lib.optionalString stdenv.isDarwin ''
       echo "Attempting to repair qwt"
       install_name_tool -id "$out/lib/qwt.framework/Versions/6/qwt" "$out/lib/qwt.framework/Versions/6/qwt"
     '';
 
   qmakeFlags = [ "-after doc.path=$out/share/doc/${name}" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Qt widgets for technical applications";
     homepage = "http://qwt.sourceforge.net/";
     # LGPL 2.1 plus a few exceptions (more liberal)
-    license = stdenv.lib.licenses.qwt;
+    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
index c206ffdd5db0..e158fe348856 100644
--- a/nixpkgs/pkgs/development/libraries/qwt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qwt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, qt4, qmake4Hook }:
+{ lib, stdenv, fetchurl, qt4, qmake4Hook }:
 
 stdenv.mkDerivation rec {
   name = "qwt-5.2.3";
@@ -20,11 +20,11 @@ stdenv.mkDerivation rec {
     qmakeFlags="$qmakeFlags INSTALLBASE=$out -after doc.path=$out/share/doc/${name}"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Qt widgets for technical applications";
     homepage = "http://qwt.sourceforge.net/";
     # LGPL 2.1 plus a few exceptions (more liberal)
-    license = stdenv.lib.licenses.qwt;
+    license = lib.licenses.qwt;
     platforms = platforms.unix;
     maintainers = [ maintainers.bjornfor ];
   };
diff --git a/nixpkgs/pkgs/development/libraries/qxt/default.nix b/nixpkgs/pkgs/development/libraries/qxt/default.nix
index 3104aefb9edb..9d035ce9d89a 100644
--- a/nixpkgs/pkgs/development/libraries/qxt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/qxt/default.nix
@@ -1,9 +1,9 @@
-{ stdenv, which, coreutils, fetchzip, qt4 }:
+{ 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";
@@ -26,9 +26,9 @@ stdenv.mkDerivation rec {
       classes to add functionality not readily available in the Qt toolkit by Qt
       Development Frameworks, Nokia.
     '';
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = with stdenv.lib.maintainers; [ forkk ];
+    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
index d24bce96997d..94a9adcae877 100644
--- a/nixpkgs/pkgs/development/libraries/rabbitmq-c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rabbitmq-c/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, openssl, popt, xmlto }:
+{ lib, stdenv, fetchFromGitHub, cmake, openssl, popt, xmlto }:
 
 stdenv.mkDerivation rec {
   pname = "rabbitmq-c";
@@ -11,9 +11,10 @@ stdenv.mkDerivation rec {
     sha256 = "1iv7aww4pam8497s524xjxbbxypyqd01qgrb0b429y3q9x06m4sw";
   };
 
-  buildInputs = [ cmake openssl popt xmlto ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ openssl popt xmlto ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "RabbitMQ C AMQP client library";
     homepage = "https://github.com/alanxz/rabbitmq-c";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/rabbitmq-java-client/default.nix b/nixpkgs/pkgs/development/libraries/rabbitmq-java-client/default.nix
index e84770ec0f5b..b649b1d9c113 100644
--- a/nixpkgs/pkgs/development/libraries/rabbitmq-java-client/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rabbitmq-java-client/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, ant, jdk, jre, python, makeWrapper }:
+{ fetchurl, lib, stdenv, ant, jdk, jre, python, makeWrapper }:
 
 stdenv.mkDerivation {
   name = "rabbitmq-java-client-3.3.4";
@@ -21,7 +21,7 @@ stdenv.mkDerivation {
       --add-flags "-Djava.awt.headless=true -cp $out/share/java/\* com.rabbitmq.examples.PerfTest"
   '';
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/raft-canonical/default.nix b/nixpkgs/pkgs/development/libraries/raft-canonical/default.nix
index 68c4a95d0b68..69fa7f6eadc5 100644
--- a/nixpkgs/pkgs/development/libraries/raft-canonical/default.nix
+++ b/nixpkgs/pkgs/development/libraries/raft-canonical/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, file, libuv }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config, file, libuv }:
 
 stdenv.mkDerivation rec {
   pname = "raft-canonical";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0swn95cf11fqczllmxr0nj3ig532rw4n3w6g3ckdnqka8520xjyr";
   };
 
-  nativeBuildInputs = [ autoreconfHook file pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook file pkg-config ];
   buildInputs = [ libuv ];
 
   preConfigure = ''
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "dev" "out" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = ''
       Fully asynchronous C implementation of the Raft consensus protocol
     '';
diff --git a/nixpkgs/pkgs/development/libraries/randomx/default.nix b/nixpkgs/pkgs/development/libraries/randomx/default.nix
index 6de7ecdfef36..8e99ca1be354 100644
--- a/nixpkgs/pkgs/development/libraries/randomx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/randomx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "randomX";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "13h2cw8drq7xn3v8fbpxrlsl8zq3fs8gd2pc1pv28ahr9qqjz1gc";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Proof of work algorithm based on random code execution";
     homepage = "https://github.com/tevador/RandomX";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/rang/default.nix b/nixpkgs/pkgs/development/libraries/rang/default.nix
index b3d300baca2e..79ab52fc8351 100644
--- a/nixpkgs/pkgs/development/libraries/rang/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rang/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 stdenv.mkDerivation rec {
   pname = "rang";
   version = "v3.1.0";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     "sha256" = "0v2pz0l2smagr3j4abjccshg4agaccfz79m5ayvrvqq5d4rlds0s";
   };
   nativeBuildInputs = [ cmake ];
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description =
       "A Minimal, Header only Modern c++ library for terminal goodies";
     homepage = "https://agauniyal.github.io/rang/";
diff --git a/nixpkgs/pkgs/development/libraries/range-v3/default.nix b/nixpkgs/pkgs/development/libraries/range-v3/default.nix
index 3799ccbb59c6..1e9df5be2346 100644
--- a/nixpkgs/pkgs/development/libraries/range-v3/default.nix
+++ b/nixpkgs/pkgs/development/libraries/range-v3/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "range-v3";
@@ -19,14 +19,12 @@ stdenv.mkDerivation rec {
 
   # Building the tests currently fails on AArch64 due to internal compiler
   # errors (with GCC 9.2):
-  cmakeFlags = stdenv.lib.optional stdenv.isAarch64 "-DRANGE_V3_TESTS=OFF";
+  cmakeFlags = lib.optional stdenv.isAarch64 "-DRANGE_V3_TESTS=OFF";
 
   doCheck = !stdenv.isAarch64;
   checkTarget = "test";
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  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}";
diff --git a/nixpkgs/pkgs/development/libraries/rapidcheck/default.nix b/nixpkgs/pkgs/development/libraries/rapidcheck/default.nix
index 492e12289781..4df98c3026e5 100644
--- a/nixpkgs/pkgs/development/libraries/rapidcheck/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rapidcheck/default.nix
@@ -1,14 +1,14 @@
-{ stdenv, cmake, fetchFromGitHub }:
+{ lib, stdenv, cmake, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "rapidcheck";
-  version = "unstable-2018-09-27";
+  version = "unstable-2020-12-19";
 
   src = fetchFromGitHub {
     owner = "emil-e";
     repo  = "rapidcheck";
-    rev   = "de54478fa35c0d9cea14ec0c5c9dfae906da524c";
-    sha256 = "0n8l0mlq9xqmpkgcj5xicicd1my2cfwxg25zdy8347dqkl1ppgbs";
+    rev   = "b78f89288c7e086d06e2a1e10b605d8375517a8a";
+    sha256 = "0fj11gbhkaxbsgix2im7vdfvr26l75b8djk462sfw8xrwrfkjbdz";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     rm $out/extras/**/CMakeLists.txt
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A C++ framework for property based testing inspired by QuickCheck";
     inherit (src.meta) homepage;
     maintainers = with maintainers; [ jb55 ];
diff --git a/nixpkgs/pkgs/development/libraries/rapidjson/default.nix b/nixpkgs/pkgs/development/libraries/rapidjson/default.nix
index ea91c1507dc3..52a0877e77f3 100644
--- a/nixpkgs/pkgs/development/libraries/rapidjson/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rapidjson/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, pkgconfig, cmake }:
+{ stdenv, lib, fetchFromGitHub, pkg-config, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "rapidjson";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "1jixgb8w97l9gdh3inihz7avz7i770gy2j2irvvlyrq3wi41f5ab";
   };
 
-  nativeBuildInputs = [ pkgconfig cmake ];
+  nativeBuildInputs = [ pkg-config cmake ];
 
   preConfigure = ''
     substituteInPlace CMakeLists.txt --replace "-Werror" ""
diff --git a/nixpkgs/pkgs/development/libraries/rapidxml/default.nix b/nixpkgs/pkgs/development/libraries/rapidxml/default.nix
index ca072f2ca4b0..e5ae16087cbd 100644
--- a/nixpkgs/pkgs/development/libraries/rapidxml/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rapidxml/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip }:
+{ lib, stdenv, fetchurl, unzip }:
 
 stdenv.mkDerivation rec {
   pname = "rapidxml";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     cp * $out/include/${pname}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Fast XML DOM-style parser in C++";
     homepage = "http://rapidxml.sourceforge.net/";
     license = licenses.boost;
diff --git a/nixpkgs/pkgs/development/libraries/rarian/default.nix b/nixpkgs/pkgs/development/libraries/rarian/default.nix
index 1e2d954fa942..522456cfa40d 100644
--- a/nixpkgs/pkgs/development/libraries/rarian/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rarian/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, pkgconfig, perlPackages, libxml2, libxslt, docbook_xml_dtd_42, gnome3}:
+{lib, stdenv, fetchurl, pkg-config, perlPackages, libxml2, libxslt, docbook_xml_dtd_42, gnome3}:
 let
   pname = "rarian";
   version = "0.8.1";
@@ -6,11 +6,11 @@ in stdenv.mkDerivation rec {
   name = "${pname}-${version}";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.gz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${name}.tar.gz";
     sha256 = "aafe886d46e467eb3414e91fa9e42955bd4b618c3e19c42c773026b205a84577";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libxml2 libxslt ]
     ++ (with perlPackages; [ perl XMLParser ]);
   configureFlags = [ "--with-xml-catalog=${docbook_xml_dtd_42}/xml/dtd/docbook/docbook.cat" ];
@@ -21,7 +21,7 @@ in stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Documentation metadata library based on the proposed Freedesktop.org spec";
     homepage = "https://rarian.freedesktop.org/";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/rdkafka/default.nix b/nixpkgs/pkgs/development/libraries/rdkafka/default.nix
index da595dfb3b67..2a4f9973bde6 100644
--- a/nixpkgs/pkgs/development/libraries/rdkafka/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rdkafka/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, zlib, perl, pkgconfig, python, openssl }:
+{ lib, stdenv, fetchFromGitHub, zlib, perl, pkg-config, python, openssl }:
 
 stdenv.mkDerivation rec {
   pname = "rdkafka";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "12cc7l5vpxyrm8ca0cpm8sdl54hb8dranal8sz55r9y8igz1q1wb";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ zlib perl python openssl ];
 
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "librdkafka - Apache Kafka C/C++ client library";
     homepage = "https://github.com/edenhill/librdkafka";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/re2/default.nix b/nixpkgs/pkgs/development/libraries/re2/default.nix
index d36b24d61084..2d8d00597647 100644
--- a/nixpkgs/pkgs/development/libraries/re2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/re2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation {
   pname = "re2";
@@ -17,17 +17,21 @@ stdenv.mkDerivation {
     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 = stdenv.lib.licenses.bsd3;
-    platforms = with stdenv.lib.platforms; all;
+    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
index 5833ca714e41..b2eab66387f5 100644
--- a/nixpkgs/pkgs/development/libraries/readline/5.x.nix
+++ b/nixpkgs/pkgs/development/libraries/readline/5.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ncurses }:
+{ lib, stdenv, fetchurl, ncurses }:
 
 stdenv.mkDerivation {
   name = "readline-5.2";
@@ -10,9 +10,9 @@ stdenv.mkDerivation {
 
   propagatedBuildInputs = [ncurses];
 
-  patches = stdenv.lib.optional stdenv.isDarwin ./shobj-darwin.patch;
+  patches = lib.optional stdenv.isDarwin ./shobj-darwin.patch;
 
-  meta = with stdenv.lib; {
+  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
index 3f3ca01961df..98db664dd8fc 100644
--- a/nixpkgs/pkgs/development/libraries/readline/6.2.nix
+++ b/nixpkgs/pkgs/development/libraries/readline/6.2.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, ncurses
+{ fetchurl, lib, stdenv, ncurses
 }:
 
 stdenv.mkDerivation (rec {
@@ -47,11 +47,11 @@ stdenv.mkDerivation (rec {
 
     homepage = "https://savannah.gnu.org/projects/readline/";
 
-    license = stdenv.lib.licenses.gpl3Plus;
+    license = lib.licenses.gpl3Plus;
 
     maintainers = [ ];
     branch = "6.2";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
 
diff --git a/nixpkgs/pkgs/development/libraries/readline/6.3.nix b/nixpkgs/pkgs/development/libraries/readline/6.3.nix
index 2b0cf978d43e..2f63c4a3043c 100644
--- a/nixpkgs/pkgs/development/libraries/readline/6.3.nix
+++ b/nixpkgs/pkgs/development/libraries/readline/6.3.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, ncurses }:
+{ fetchurl, lib, stdenv, ncurses }:
 
 stdenv.mkDerivation {
   name = "readline-6.3p08";
@@ -14,14 +14,14 @@ stdenv.mkDerivation {
 
   patchFlags = [ "-p0" ];
 
-  configureFlags = stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
+  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
-    ] ++ stdenv.lib.optional stdenv.hostPlatform.useAndroidPrebuilt ./android.patch
+    ] ++ lib.optional stdenv.hostPlatform.useAndroidPrebuilt ./android.patch
     ++
     (let
        patch = nr: sha256:
@@ -32,7 +32,7 @@ stdenv.mkDerivation {
      in
        import ./readline-6.3-patches.nix patch);
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for interactive line editing";
 
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/readline/7.0.nix b/nixpkgs/pkgs/development/libraries/readline/7.0.nix
index 248ef55cce88..25ef4b97a863 100644
--- a/nixpkgs/pkgs/development/libraries/readline/7.0.nix
+++ b/nixpkgs/pkgs/development/libraries/readline/7.0.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, ncurses
+{ fetchurl, lib, stdenv, ncurses
 }:
 
 stdenv.mkDerivation rec {
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     ]
     ++ upstreamPatches;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for interactive line editing";
 
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/readline/8.0.nix b/nixpkgs/pkgs/development/libraries/readline/8.0.nix
index 6e1182647c29..9ea0277467e5 100644
--- a/nixpkgs/pkgs/development/libraries/readline/8.0.nix
+++ b/nixpkgs/pkgs/development/libraries/readline/8.0.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, ncurses
+{ fetchurl, lib, stdenv, ncurses
 }:
 
 stdenv.mkDerivation rec {
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     ]
     ++ upstreamPatches;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for interactive line editing";
 
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/readosm/default.nix b/nixpkgs/pkgs/development/libraries/readosm/default.nix
index 6aed49d65e35..760546fc471c 100644
--- a/nixpkgs/pkgs/development/libraries/readosm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/readosm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, expat, zlib, geos, libspatialite }:
+{ lib, stdenv, fetchurl, expat, zlib, geos, libspatialite }:
 
 stdenv.mkDerivation rec {
   name = "readosm-1.1.0a";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   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 stdenv.lib.licenses; [ mpl11 gpl2Plus lgpl21Plus ];
-    platforms = stdenv.lib.platforms.linux;
+    license = with lib.licenses; [ mpl11 gpl2Plus lgpl21Plus ];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/redkite/default.nix b/nixpkgs/pkgs/development/libraries/redkite/default.nix
index ce3ac37895e0..bc82e95be713 100644
--- a/nixpkgs/pkgs/development/libraries/redkite/default.nix
+++ b/nixpkgs/pkgs/development/libraries/redkite/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, cairo }:
+{ lib, stdenv, fetchFromGitHub, cmake, cairo }:
 
 stdenv.mkDerivation rec {
   pname = "redkite";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ cairo ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://gitlab.com/iurie-sw/redkite";
     description = "A small GUI toolkit";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/rep-gtk/default.nix b/nixpkgs/pkgs/development/libraries/rep-gtk/default.nix
index 0f8caecf8083..618c91421b6a 100644
--- a/nixpkgs/pkgs/development/libraries/rep-gtk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rep-gtk/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, pkgconfig, autoreconfHook, librep, gtk2 }:
+{ lib, stdenv, fetchurl, pkg-config, autoreconfHook, librep, gtk2 }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
 
   pname = "rep-gtk";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "0hgkkywm8zczir3lqr727bn7ybgg71x9cwj1av8fykkr8pdpard9";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ ];
   propagatedBuildInputs = [ librep gtk2 ];
 
diff --git a/nixpkgs/pkgs/development/libraries/resolv_wrapper/default.nix b/nixpkgs/pkgs/development/libraries/resolv_wrapper/default.nix
index 168b82eec160..5b73bc41475d 100644
--- a/nixpkgs/pkgs/development/libraries/resolv_wrapper/default.nix
+++ b/nixpkgs/pkgs/development/libraries/resolv_wrapper/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, pkgconfig }:
+{ lib, stdenv, fetchurl, cmake, pkg-config }:
 
 stdenv.mkDerivation rec {
   name = "resolv_wrapper-1.1.6";
@@ -8,9 +8,9 @@ stdenv.mkDerivation rec {
     sha256 = "13k76l4s0v032xyyaf19qw6p4qc81ybx1wynkz2pzjhiljazsdpa";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/rlog/default.nix b/nixpkgs/pkgs/development/libraries/rlog/default.nix
index cbc564fe2300..88a96209993b 100644
--- a/nixpkgs/pkgs/development/libraries/rlog/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rlog/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   name = "rlog-1.4";
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://www.arg0.net/rlog";
     description = "A C++ logging library used in encfs";
-    platforms = stdenv.lib.platforms.linux;
-    license = stdenv.lib.licenses.lgpl3;
+    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
index 3713bcf1df79..a8cd88cae507 100644
--- a/nixpkgs/pkgs/development/libraries/rlottie/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rlottie/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, meson, ninja, pkg-config }:
+{ lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "rlottie";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ meson ninja pkg-config ];
 
-  meta = with stdenv.lib; {
+  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 = licenses.unfree; # Mixed, see https://github.com/Samsung/rlottie/blob/master/COPYING
diff --git a/nixpkgs/pkgs/development/libraries/rnnoise-plugin/default.nix b/nixpkgs/pkgs/development/libraries/rnnoise-plugin/default.nix
index 9ec9eabebebb..e68f74e28960 100644
--- a/nixpkgs/pkgs/development/libraries/rnnoise-plugin/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rnnoise-plugin/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, SDL2, fetchFromGitHub, cmake }:
+{ lib, stdenv, SDL2, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "rnnoise-plugin";
@@ -11,11 +11,11 @@ stdenv.mkDerivation rec {
     sha256 = "11pwisbcks7g0mdgcrrv49v3ci1l6m26bbb7f67xz4pr1hai5dwc";
   };
 
-  buildInputs = [ cmake ];
+  nativeBuildInputs = [ cmake ];
 
   cmakeFlags = [ "-DCMAKE_BUILD_TYPE=Release" ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/robin-map/default.nix b/nixpkgs/pkgs/development/libraries/robin-map/default.nix
index 9c0774f925bc..a0a068dc1422 100644
--- a/nixpkgs/pkgs/development/libraries/robin-map/default.nix
+++ b/nixpkgs/pkgs/development/libraries/robin-map/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 }:
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/rocclr/default.nix b/nixpkgs/pkgs/development/libraries/rocclr/default.nix
index 5e6ce5d67978..9337680f55c7 100644
--- a/nixpkgs/pkgs/development/libraries/rocclr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rocclr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , rocm-cmake
@@ -54,7 +54,7 @@ stdenv.mkDerivation rec {
       --replace "/build/source/build" "$out"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Radeon Open Compute common language runtime";
     homepage = "https://github.com/ROCm-Developer-Tools/ROCclr";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/rocksdb/default.nix b/nixpkgs/pkgs/development/libraries/rocksdb/default.nix
index 12a731385ffe..d6f685ff4dee 100644
--- a/nixpkgs/pkgs/development/libraries/rocksdb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rocksdb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 , cmake
@@ -28,9 +28,9 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ bzip2 lz4 snappy zlib zstd ];
 
-  buildInputs = stdenv.lib.optional enableJemalloc jemalloc;
+  buildInputs = lib.optional enableJemalloc jemalloc;
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=deprecated-copy -Wno-error=pessimizing-move";
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-error=deprecated-copy -Wno-error=pessimizing-move";
 
   cmakeFlags = [
     "-DPORTABLE=1"
@@ -47,17 +47,17 @@ stdenv.mkDerivation rec {
     "-DWITH_GFLAGS=0"
     "-DUSE_RTTI=1"
     "-DROCKSDB_INSTALL_ON_WINDOWS=YES" # harmless elsewhere
-    (stdenv.lib.optional
+    (lib.optional
         (stdenv.hostPlatform.isx86 && stdenv.hostPlatform.isLinux)
         "-DFORCE_SSE42=1")
-    (stdenv.lib.optional enableLite "-DROCKSDB_LITE=1")
+    (lib.optional enableLite "-DROCKSDB_LITE=1")
     "-DFAIL_ON_WARNINGS=${if stdenv.hostPlatform.isMinGW then "NO" else "YES"}"
-  ] ++ stdenv.lib.optional (!enableShared) "-DROCKSDB_BUILD_SHARED=0";
+  ] ++ lib.optional (!enableShared) "-DROCKSDB_BUILD_SHARED=0";
 
   # otherwise "cc1: error: -Wformat-security ignored without -Wformat [-Werror=format-security]"
-  hardeningDisable = stdenv.lib.optional stdenv.hostPlatform.isWindows "format";
+  hardeningDisable = lib.optional stdenv.hostPlatform.isWindows "format";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://rocksdb.org";
     description = "A library that provides an embeddable, persistent key-value store for fast storage";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/rocm-comgr/default.nix b/nixpkgs/pkgs/development/libraries/rocm-comgr/default.nix
index f8254991013c..96f7108e3fe0 100644
--- a/nixpkgs/pkgs/development/libraries/rocm-comgr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rocm-comgr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, clang, device-libs, lld, llvm }:
+{ lib, stdenv, fetchFromGitHub, cmake, clang, device-libs, lld, llvm }:
 
 stdenv.mkDerivation rec {
   pname = "rocm-comgr";
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
         -i CMakeLists.txt
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/rocm-device-libs/default.nix b/nixpkgs/pkgs/development/libraries/rocm-device-libs/default.nix
index 7c50e3752280..965d92179b67 100644
--- a/nixpkgs/pkgs/development/libraries/rocm-device-libs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rocm-device-libs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , clang
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     "-DCLANG=${clang}/bin/clang"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Set of AMD-specific device-side language runtime libraries";
     homepage = "https://github.com/RadeonOpenCompute/ROCm-Device-Libs";
     license = licenses.ncsa;
diff --git a/nixpkgs/pkgs/development/libraries/rocm-opencl-icd/default.nix b/nixpkgs/pkgs/development/libraries/rocm-opencl-icd/default.nix
index 5f2188f6e7e6..903c238f4553 100644
--- a/nixpkgs/pkgs/development/libraries/rocm-opencl-icd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rocm-opencl-icd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, rocm-opencl-runtime }:
+{ lib, stdenv, rocm-opencl-runtime }:
 
 stdenv.mkDerivation rec {
   pname = "rocm-opencl-icd";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     echo "${rocm-opencl-runtime}/lib/libamdocl64.so" > $out/etc/OpenCL/vendors/amdocl64.icd
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "OpenCL ICD definition for AMD GPUs using the ROCm stack";
     license = licenses.mit;
     maintainers = with maintainers; [ danieldk ];
diff --git a/nixpkgs/pkgs/development/libraries/rocm-opencl-runtime/default.nix b/nixpkgs/pkgs/development/libraries/rocm-opencl-runtime/default.nix
index ecd9e0f7e825..ab0957474adc 100644
--- a/nixpkgs/pkgs/development/libraries/rocm-opencl-runtime/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rocm-opencl-runtime/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , addOpenGLRunpath
 , cmake
@@ -73,7 +73,7 @@ stdenv.mkDerivation rec {
     echo 'add_dependencies(amdocl64 OpenCL)' >> amdocl/CMakeLists.txt
   '';
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/rocm-runtime/default.nix b/nixpkgs/pkgs/development/libraries/rocm-runtime/default.nix
index 15435e7914d3..beb0c61e683c 100644
--- a/nixpkgs/pkgs/development/libraries/rocm-runtime/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rocm-runtime/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , addOpenGLRunpath
 , clang-unwrapped
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
     rm -rf $out/hsa
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Platform runtime for ROCm";
     homepage = "https://github.com/RadeonOpenCompute/ROCR-Runtime";
     license = with licenses; [ ncsa ];
diff --git a/nixpkgs/pkgs/development/libraries/rocm-thunk/default.nix b/nixpkgs/pkgs/development/libraries/rocm-thunk/default.nix
index 535f686f23d0..5863e1f0a57c 100644
--- a/nixpkgs/pkgs/development/libraries/rocm-thunk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rocm-thunk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , pkg-config
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     cp -r $src/include $out
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Radeon open compute thunk interface";
     homepage = "https://github.com/RadeonOpenCompute/ROCT-Thunk-Interface";
     license = with licenses; [ bsd2 mit ];
diff --git a/nixpkgs/pkgs/development/libraries/rote/default.nix b/nixpkgs/pkgs/development/libraries/rote/default.nix
index 5ae66f676d64..e5fb04626836 100644
--- a/nixpkgs/pkgs/development/libraries/rote/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rote/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ncurses }:
+{ lib, stdenv, fetchurl, ncurses }:
 
 stdenv.mkDerivation rec {
   pname = "rote";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Our Own Terminal Emulation Library";
     longDescription = ''
       ROTE is a simple C library for VT102 terminal emulation. It allows the
diff --git a/nixpkgs/pkgs/development/libraries/rttr/default.nix b/nixpkgs/pkgs/development/libraries/rttr/default.nix
index b4d9204c226f..b0f4f2a567a2 100644
--- a/nixpkgs/pkgs/development/libraries/rttr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rttr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, ninja }:
+{ lib, stdenv, fetchFromGitHub, cmake, ninja }:
 
 stdenv.mkDerivation rec {
   pname = "rttr";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     "-DBUILD_PACKAGE=OFF"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ Reflection Library";
     homepage = "https://www.rttr.org";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/rubberband/default.nix b/nixpkgs/pkgs/development/libraries/rubberband/default.nix
index 54bb57e2e662..7fc8fe98db29 100644
--- a/nixpkgs/pkgs/development/libraries/rubberband/default.nix
+++ b/nixpkgs/pkgs/development/libraries/rubberband/default.nix
@@ -1,28 +1,19 @@
-{ stdenv, fetchurl, fetchpatch,  pkgconfig, libsamplerate, libsndfile, fftw
+{ lib, stdenv, fetchurl, pkg-config, libsamplerate, libsndfile, fftw
 , vamp-plugin-sdk, ladspaH }:
 
 stdenv.mkDerivation rec {
   pname = "rubberband";
-  version = "1.8.2";
+  version = "1.9.0";
 
   src = fetchurl {
     url = "https://breakfastquay.com/files/releases/${pname}-${version}.tar.bz2";
-    sha256 = "1jn3ys16g4rz8j3yyj5np589lly0zhs3dr9asd0l9dhmf5mx1gl6";
+    sha256 = "4f5b9509364ea876b4052fc390c079a3ad4ab63a2683aad09662fb905c2dc026";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libsamplerate libsndfile fftw vamp-plugin-sdk ladspaH ];
 
-  # https://github.com/breakfastquay/rubberband/issues/17
-  # In master, but there hasn't been an official release
-  patches = [
-    (fetchpatch {
-      url = "https://github.com/breakfastquay/rubberband/commit/419a9bcf7066473b0d31e9a8a81fe0b2a8e41fed.patch";
-      sha256 = "0drkfb2ahi31g4w1cawgsjjz26wszgg52yn3ih5l2ql1g25dqqn9";
-    })
-  ];
-
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/s2n/default.nix b/nixpkgs/pkgs/development/libraries/s2n/default.nix
new file mode 100644
index 000000000000..3ec66ebf52d1
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/s2n/default.nix
@@ -0,0 +1,29 @@
+{ lib, stdenv, fetchFromGitHub, cmake, openssl }:
+
+stdenv.mkDerivation rec {
+  pname = "s2n";
+  version = "0.10.23";
+
+  src = fetchFromGitHub {
+    owner = "awslabs";
+    repo = pname;
+    rev = "v${version}";
+    sha256 = "063wqpszhfcbxm7a7s6d6kinqd6b6dxij85lk9jjkrslg5fgqbki";
+  };
+
+  nativeBuildInputs = [ cmake ];
+
+  propagatedBuildInputs = [ openssl ]; # s2n-config has find_dependency(LibCrypto).
+
+  cmakeFlags = [
+    "-DBUILD_SHARED_LIBS=ON"
+  ];
+
+  meta = with lib; {
+    description = "C99 implementation of the TLS/SSL protocols";
+    homepage = "https://github.com/awslabs/s2n";
+    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
index e4a3e586614d..db18621d8e43 100644
--- a/nixpkgs/pkgs/development/libraries/safefile/default.nix
+++ b/nixpkgs/pkgs/development/libraries/safefile/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, path, runtimeShell }:
+{ lib, stdenv, fetchurl, path, runtimeShell }:
 stdenv.mkDerivation rec {
   pname = "safefile";
   version = "1.0.5";
@@ -19,9 +19,9 @@ stdenv.mkDerivation rec {
   meta = {
     inherit version;
     description = "File open routines to safely open a file when in the presence of an attack";
-    license = stdenv.lib.licenses.asl20 ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    license = lib.licenses.asl20 ;
+    maintainers = [lib.maintainers.raskin];
+    platforms = lib.platforms.linux;
     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
index d3710043e6f6..0ff6db175611 100644
--- a/nixpkgs/pkgs/development/libraries/sbc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sbc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libsndfile }:
+{ lib, stdenv, fetchurl, pkg-config, libsndfile }:
 
 stdenv.mkDerivation rec {
   name = "sbc-1.4";
@@ -8,10 +8,10 @@ stdenv.mkDerivation rec {
     sha256 = "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libsndfile ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "SubBand Codec Library";
     homepage = "http://www.bluez.org/";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/sblim-sfcc/default.nix b/nixpkgs/pkgs/development/libraries/sblim-sfcc/default.nix
index 91baa8d03b88..c871f18e69b3 100644
--- a/nixpkgs/pkgs/development/libraries/sblim-sfcc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sblim-sfcc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, curl }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, curl }:
 
 stdenv.mkDerivation rec {
   pname = "sblim-sfcc";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Small Footprint CIM Client Library";
     homepage    = "https://sourceforge.net/projects/sblim/";
     license     = licenses.cpl10;
diff --git a/nixpkgs/pkgs/development/libraries/schroedinger/default.nix b/nixpkgs/pkgs/development/libraries/schroedinger/default.nix
index 712138b0edfc..7706366dd6da 100644
--- a/nixpkgs/pkgs/development/libraries/schroedinger/default.nix
+++ b/nixpkgs/pkgs/development/libraries/schroedinger/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, orc, pkgconfig, fetchpatch, autoreconfHook }:
+{ lib, stdenv, fetchurl, orc, pkg-config, fetchpatch, autoreconfHook }:
 
 stdenv.mkDerivation {
   name = "schroedinger-1.0.11";
@@ -10,7 +10,7 @@ stdenv.mkDerivation {
 
   outputs = [ "out" "dev" "devdoc" ];
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook ];
+  nativeBuildInputs = [ pkg-config autoreconfHook ];
   buildInputs = [ orc ];
 
   doCheck = (!stdenv.isDarwin);
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
     })
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An implementation of the Dirac video codec in ANSI C";
     homepage = "https://sourceforge.net/projects/schrodinger/";
     maintainers = [ maintainers.spwhitt ];
diff --git a/nixpkgs/pkgs/development/libraries/science/benchmark/papi/default.nix b/nixpkgs/pkgs/development/libraries/science/benchmark/papi/default.nix
index 00a6e50aa7f7..c265f24c182b 100644
--- a/nixpkgs/pkgs/development/libraries/science/benchmark/papi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/benchmark/papi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 }:
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
   doCheck = true;
   checkTarget = "test";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://icl.utk.edu/papi/";
     description = "PAPI provides the tool designer and application engineer with a consistent interface and methodology for use of the performance counter hardware found in most major microprocessors";
     license = licenses.bsdOriginal;
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/EBTKS/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/EBTKS/default.nix
index c60fe31aaaff..b75ac06627fb 100644
--- a/nixpkgs/pkgs/development/libraries/science/biology/EBTKS/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/biology/EBTKS/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, libminc }:
+{ lib, stdenv, fetchFromGitHub, cmake, libminc }:
 
 stdenv.mkDerivation rec {
   pname = "EBTKS";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [ "-DLIBMINC_DIR=${libminc}/lib/cmake" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/BIC-MNI/${pname}";
     description = "Library for working with MINC files";
     maintainers = with maintainers; [ bcdarwin ];
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/bicgl/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/bicgl/default.nix
index 4cc7dcada522..bc2de6e882f9 100644
--- a/nixpkgs/pkgs/development/libraries/science/biology/bicgl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/biology/bicgl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, libminc, bicpl, freeglut, mesa_glu }:
+{ lib, stdenv, fetchFromGitHub, cmake, libminc, bicpl, freeglut, mesa_glu }:
 
 stdenv.mkDerivation rec {
   pname = "bicgl";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     "-DBICPL_DIR=${bicpl}/lib"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/${owner}/${pname}";
     description = "Brain Imaging Centre graphics library";
     maintainers = with maintainers; [ bcdarwin ];
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/bicpl/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/bicpl/default.nix
index 96199f0478ea..0bdcbf5a828a 100644
--- a/nixpkgs/pkgs/development/libraries/science/biology/bicpl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/biology/bicpl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, libminc, netpbm }:
+{ lib, stdenv, fetchFromGitHub, cmake, libminc, netpbm }:
 
 stdenv.mkDerivation rec {
   pname = "bicpl";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   doCheck = false;
   # internal_volume_io.h: No such file or directory
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/${owner}/${pname}";
     description = "Brain Imaging Centre programming library";
     maintainers = with maintainers; [ bcdarwin ];
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/bpp-core/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/bpp-core/default.nix
index cfbe19d724be..d1eb096e08e6 100644
--- a/nixpkgs/pkgs/development/libraries/science/biology/bpp-core/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/biology/bpp-core/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "bpp-core";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   doCheck = !stdenv.isDarwin;
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/bpp-seq/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/bpp-seq/default.nix
index 79fd0fe67716..ef3f3d5756e9 100644
--- a/nixpkgs/pkgs/development/libraries/science/biology/bpp-seq/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/biology/bpp-seq/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
 
   doCheck = !stdenv.isDarwin;
 
-  meta = bpp-core.meta // { 
+  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
index e55a72fb9f84..55ee5ab4fb66 100644
--- a/nixpkgs/pkgs/development/libraries/science/biology/elastix/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/biology/elastix/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, cmake, itk, python3, Cocoa }:
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, itk, python3, Cocoa }:
 
 stdenv.mkDerivation rec {
   pname    = "elastix";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   ];
 
   nativeBuildInputs = [ cmake python3 ];
-  buildInputs = [ itk ] ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa ];
+  buildInputs = [ itk ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
 
   doCheck = !stdenv.isDarwin;  # usual dynamic linker issues
 
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     export LD_LIBRARY_PATH=$(pwd)/bin
   ";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://elastix.isi.uu.nl/";
     description = "Image registration toolkit based on ITK";
     maintainers = with maintainers; [ bcdarwin ];
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/gifticlib/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/gifticlib/default.nix
index dddf29fb0193..306324129cbd 100644
--- a/nixpkgs/pkgs/development/libraries/science/biology/gifticlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/biology/gifticlib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, expat, nifticlib, zlib }:
+{ lib, stdenv, fetchFromGitHub, cmake, expat, nifticlib, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "gifticlib";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     runHook postCheck
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.nitrc.org/projects/gifti";
     description = "Medical imaging geometry format C API";
     maintainers = with maintainers; [ bcdarwin ];
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix
index 9da6595e7a43..cb3a543ad2af 100644
--- a/nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/biology/htslib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, zlib, bzip2, lzma, curl, perl }:
+{ lib, stdenv, fetchurl, zlib, bzip2, lzma, curl, perl }:
 
 stdenv.mkDerivation rec {
   pname = "htslib";
@@ -26,7 +26,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A C library for reading/writing high-throughput sequencing data";
     license = licenses.mit;
     homepage = "http://www.htslib.org/";
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/mirtk/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/mirtk/default.nix
index 4291e11ed33f..0d23489696f1 100644
--- a/nixpkgs/pkgs/development/libraries/science/biology/mirtk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/biology/mirtk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, gtest, fetchFromGitHub, cmake, boost, eigen, python, vtk, zlib, tbb }:
+{ lib, stdenv, gtest, fetchFromGitHub, cmake, boost, eigen, python, vtk, zlib, tbb }:
 
 stdenv.mkDerivation rec {
   version = "2.0.0";
@@ -31,12 +31,10 @@ stdenv.mkDerivation rec {
     install -Dm644 -t "$out/share/bash-completion/completions/mirtk" share/completion/bash/mirtk
   '';
 
-  enableParallelBuilding = true;
-
   nativeBuildInputs = [ cmake gtest ];
   buildInputs = [ boost eigen python vtk zlib tbb ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/BioMedIA/MIRTK";
     description = "Medical image registration library and tools";
     maintainers = with maintainers; [ bcdarwin ];
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/nifticlib/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/nifticlib/default.nix
index 572c31dd1e52..fee2ea8772b4 100644
--- a/nixpkgs/pkgs/development/libraries/science/biology/nifticlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/biology/nifticlib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, zlib }:
+{ lib, stdenv, fetchFromGitHub, cmake, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "nifticlib";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
   '';
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://nifti-imaging.github.io";
     description = "Medical imaging format C API";
     maintainers = with maintainers; [ bcdarwin ];
diff --git a/nixpkgs/pkgs/development/libraries/science/biology/oobicpl/default.nix b/nixpkgs/pkgs/development/libraries/science/biology/oobicpl/default.nix
index e5ecda0390bd..626e6475ba18 100644
--- a/nixpkgs/pkgs/development/libraries/science/biology/oobicpl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/biology/oobicpl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, libminc, bicpl, arguments, pcre-cpp }:
+{ lib, stdenv, fetchFromGitHub, cmake, libminc, bicpl, arguments, pcre-cpp }:
 
 stdenv.mkDerivation rec {
   pname = "oobicpl";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
                  "-DARGUMENTS_DIR=${arguments}/lib"
                  "-DOOBICPL_BUILD_SHARED_LIBS=TRUE" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/${owner}/${pname}";
     description = "Brain Imaging Centre object-oriented programming library (and tools)";
     maintainers = with maintainers; [ bcdarwin ];
diff --git a/nixpkgs/pkgs/development/libraries/science/electronics/qcsxcad/default.nix b/nixpkgs/pkgs/development/libraries/science/electronics/qcsxcad/default.nix
index 7e73354363ea..a20f6973384a 100644
--- a/nixpkgs/pkgs/development/libraries/science/electronics/qcsxcad/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/electronics/qcsxcad/default.nix
@@ -37,8 +37,6 @@ mkDerivation {
     qtbase
   ];
 
-  enableParallelBuilding = true;
-
   meta = with lib; {
     description = "Qt library for CSXCAD";
     homepage = "https://github.com/thliebig/QCSXCAD";
diff --git a/nixpkgs/pkgs/development/libraries/science/math/QuadProgpp/default.nix b/nixpkgs/pkgs/development/libraries/science/math/QuadProgpp/default.nix
index b5fa5c8825e0..254ce08dc60f 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/QuadProgpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/QuadProgpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "QuadProgpp";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
   buildInputs = [ ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/liuq/QuadProgpp";
     license = licenses.mit;
     description = ''
diff --git a/nixpkgs/pkgs/development/libraries/science/math/amd-blis/default.nix b/nixpkgs/pkgs/development/libraries/science/math/amd-blis/default.nix
index 9bddba0261fe..42c84b3ed610 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/amd-blis/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/amd-blis/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , perl
 , python3
@@ -43,7 +43,7 @@ in stdenv.mkDerivation rec {
   configureFlags = [
     "--enable-cblas"
     "--blas-int-size=${blasIntSize}"
-  ] ++ stdenv.lib.optionals withOpenMP [ "--enable-threading=openmp" ]
+  ] ++ lib.optionals withOpenMP [ "--enable-threading=openmp" ]
     ++ [ withArchitecture ];
 
   postPatch = ''
@@ -57,7 +57,7 @@ in stdenv.mkDerivation rec {
     ln -s $out/lib/libcblas.so.3 $out/lib/libcblas.so
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "BLAS-compatible library optimized for AMD CPUs";
     homepage = "https://developer.amd.com/amd-aocl/blas-library/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/amd-libflame/default.nix b/nixpkgs/pkgs/development/libraries/science/math/amd-libflame/default.nix
index 1e331bca695c..ac35385f9835 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/amd-libflame/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/amd-libflame/default.nix
@@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
     ln -s $out/lib/libflame.so.${version} $out/lib/liblapacke.so.3
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/arpack/default.nix b/nixpkgs/pkgs/development/libraries/science/math/arpack/default.nix
index 0b927bb3eac8..382f868a99ac 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/arpack/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/arpack/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake
+{ lib, stdenv, fetchFromGitHub, cmake
 , gfortran, blas, lapack, eigen }:
 
 stdenv.mkDerivation rec {
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [
     "-DBUILD_SHARED_LIBS=ON"
-    "-DINTERFACE64=${stdenv.lib.optionalString blas.isILP64 "1"}"
+    "-DINTERFACE64=${lib.optionalString blas.isILP64 "1"}"
   ];
 
   preCheck = if stdenv.isDarwin then ''
@@ -48,8 +48,8 @@ stdenv.mkDerivation rec {
       A collection of Fortran77 subroutines to solve large scale eigenvalue
       problems.
     '';
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = [ stdenv.lib.maintainers.ttuegel ];
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.bsd3;
+    maintainers = [ lib.maintainers.ttuegel ];
+    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
index c240a19cca67..332806c495c9 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/blas/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/blas/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gfortran }:
+{ lib, stdenv, fetchurl, gfortran }:
 
 stdenv.mkDerivation rec {
   pname = "blas";
@@ -38,13 +38,13 @@ stdenv.mkDerivation rec {
   installPhase =
     # FreeBSD's stdenv doesn't use Coreutils.
     let dashD = if stdenv.isFreeBSD then "" else "-D"; in
-    (stdenv.lib.optionalString stdenv.isFreeBSD "mkdir -p $out/lib ;")
+    (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 pkgconfig alias.
+    # Write pkg-config alias.
     # See also openblas/default.nix
     mkdir $out/lib/pkgconfig
     cat <<EOF > $out/lib/pkgconfig/blas.pc
@@ -55,7 +55,7 @@ Libs: -L$out/lib -lblas
 EOF
   '';
 
-  preFixup = stdenv.lib.optionalString stdenv.isDarwin ''
+  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"
@@ -64,8 +64,8 @@ EOF
 
   meta = {
     description = "Basic Linear Algebra Subprograms";
-    license = stdenv.lib.licenses.publicDomain;
+    license = lib.licenses.publicDomain;
     homepage = "http://www.netlib.org/blas/";
-    platforms = stdenv.lib.platforms.unix;
+    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
index 3943c4dbbcaa..eb91e0a3d222 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/blis/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/blis/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , perl
 , python3
@@ -40,7 +40,7 @@ in stdenv.mkDerivation rec {
   configureFlags = [
     "--enable-cblas"
     "--blas-int-size=${blasIntSize}"
-  ] ++ stdenv.lib.optionals withOpenMP [ "--enable-threading=openmp" ]
+  ] ++ lib.optionals withOpenMP [ "--enable-threading=openmp" ]
     ++ [ withArchitecture ];
 
   postPatch = ''
@@ -54,7 +54,7 @@ in stdenv.mkDerivation rec {
     ln -s $out/lib/libcblas.so.3 $out/lib/libcblas.so
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "BLAS-compatible linear algebra library";
     homepage = "https://github.com/flame/blis";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/brial/default.nix b/nixpkgs/pkgs/development/libraries/science/math/brial/default.nix
index 175de67ad7ee..870568c9ac95 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/brial/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/brial/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook
-, pkgconfig
+, pkg-config
 , boost
 , m4ri
 , gd
@@ -33,10 +33,10 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     autoreconfHook
-    pkgconfig
+    pkg-config
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/BRiAl/BRiAl";
     description = "Legacy version of PolyBoRi maintained by sagemath developers";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/caffe2/default.nix b/nixpkgs/pkgs/development/libraries/science/math/caffe2/default.nix
index 7755efb30658..fe9a8b671459 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/caffe2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/caffe2/default.nix
@@ -90,26 +90,26 @@ stdenv.mkDerivation rec {
     ./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''
+  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''
+                 "-DCUDA_TOOLKIT_ROOT_DIR=${cudatoolkit}"
+                 "-DCUDA_FAST_MATH=ON"
+                 "-DCUDA_HOST_COMPILER=${cudatoolkit.cc}/bin/gcc"
                ];
 
   preConfigure = ''
@@ -126,7 +126,6 @@ stdenv.mkDerivation rec {
   '';
 
   doCheck = false;
-  enableParallelBuilding = true;
 
   meta = {
     homepage = "https://caffe2.ai/";
@@ -137,8 +136,8 @@ stdenv.mkDerivation rec {
       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 stdenv.lib.platforms; linux;
-    license = stdenv.lib.licenses.asl20;
-    maintainers = with stdenv.lib.maintainers; [ yuriaisaka ];
+    platforms = with lib.platforms; linux;
+    license = lib.licenses.asl20;
+    maintainers = with lib.maintainers; [ yuriaisaka ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/science/math/cholmod-extra/default.nix b/nixpkgs/pkgs/development/libraries/science/math/cholmod-extra/default.nix
index c381f56277e8..38d1b126ea4e 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/cholmod-extra/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/cholmod-extra/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, gfortran, suitesparse, blas, lapack }:
+{ lib, stdenv, fetchFromGitHub, gfortran, suitesparse, blas, lapack }:
 stdenv.mkDerivation rec {
   pname = "cholmod-extra";
   version = "1.2.0";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/jluttine/cholmod-extra";
     description = "A set of additional routines for SuiteSparse CHOLMOD Module";
     license = with licenses; [ gpl2Plus ];
diff --git a/nixpkgs/pkgs/development/libraries/science/math/clblas/default.nix b/nixpkgs/pkgs/development/libraries/science/math/clblas/default.nix
index 8a474e06e556..aca395001f96 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/clblas/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/clblas/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , gfortran
@@ -35,27 +35,25 @@ stdenv.mkDerivation rec {
      "-DBUILD_TEST=OFF"
   ];
 
+  nativeBuildInputs = [ cmake ];
   buildInputs = [
-    cmake
     gfortran
     blas
     python
     boost
-  ] ++ stdenv.lib.optionals (!stdenv.isDarwin) [
+  ] ++ lib.optionals (!stdenv.isDarwin) [
     ocl-icd
     opencl-headers
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+  ] ++ lib.optionals stdenv.isDarwin [
     Accelerate
     CoreGraphics
     CoreVideo
   ];
-  propagatedBuildInputs = stdenv.lib.optionals stdenv.isDarwin [
+  propagatedBuildInputs = lib.optionals stdenv.isDarwin [
     OpenCL
   ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/clMathLibraries/clBLAS";
     description = "A software library containing BLAS functions written in OpenCL";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/science/math/cliquer/default.nix b/nixpkgs/pkgs/development/libraries/science/math/cliquer/default.nix
index 7fe80c323f68..0d8bafffb44f 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/cliquer/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/cliquer/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook
 }:
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
     autoreconfHook
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://users.aalto.fi/~pat/cliquer.html";
     downloadPage = src.meta.homepage; # autocliquer
     description = "Routines for clique searching";
diff --git a/nixpkgs/pkgs/development/libraries/science/math/clmagma/default.nix b/nixpkgs/pkgs/development/libraries/science/math/clmagma/default.nix
index 2e798a6b83e7..60a3afb50774 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/clmagma/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/clmagma/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, gfortran, opencl-headers, clblas, ocl-icd, mkl, intel-ocl }:
+{ lib, stdenv, fetchurl, gfortran, opencl-headers, clblas, ocl-icd, mkl, intel-ocl }:
 
-with stdenv.lib;
+with lib;
 
 let 
   version = "1.3.0";
@@ -65,7 +65,7 @@ in stdenv.mkDerivation {
     cp ${incfile} make.inc
   '';
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix b/nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix
index e727218c0555..59c0b7f44980 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/cudnn/generic.nix
@@ -57,7 +57,7 @@ stdenv.mkDerivation {
     majorVersion = lib.versions.major version;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "NVIDIA CUDA Deep Neural Network library (cuDNN)";
     homepage = "https://developer.nvidia.com/cudnn";
     license = licenses.unfree;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/ecos/default.nix b/nixpkgs/pkgs/development/libraries/science/math/ecos/default.nix
index 2ba69a34a4a7..b60bd1fe76c1 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/ecos/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/ecos/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "ecos";
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     cp -r include $out/
   '';
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix b/nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix
index 4e89aeebe2b7..e80607ab9556 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/fenics/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
 , boost
@@ -50,8 +50,8 @@ let
     meta = {
       description = "Distributed just-in-time shared library building";
       homepage = "https://fenicsproject.org/";
-      platforms = stdenv.lib.platforms.all;
-      license = stdenv.lib.licenses.lgpl3;
+      platforms = lib.platforms.all;
+      license = lib.licenses.lgpl3;
     };
   };
 
@@ -80,8 +80,8 @@ let
     meta = {
       description = "Automatic generation of finite element basis functions";
       homepage = "https://fenicsproject.org/";
-      platforms = stdenv.lib.platforms.all;
-      license = stdenv.lib.licenses.lgpl3;
+      platforms = lib.platforms.all;
+      license = lib.licenses.lgpl3;
     };
   };
 
@@ -102,8 +102,8 @@ let
     meta = {
       description = "A domain-specific language for finite element variational forms";
       homepage = "https://fenicsproject.org/";
-      platforms = stdenv.lib.platforms.all;
-      license = stdenv.lib.licenses.lgpl3;
+      platforms = lib.platforms.all;
+      license = lib.licenses.lgpl3;
     };
   };
 
@@ -139,8 +139,8 @@ let
     meta = {
       description = "A compiler for finite element variational forms";
       homepage = "https://fenicsproject.org/";
-      platforms = stdenv.lib.platforms.all;
-      license = stdenv.lib.licenses.lgpl3;
+      platforms = lib.platforms.all;
+      license = lib.licenses.lgpl3;
     };
   };
   dolfin = stdenv.mkDerivation {
@@ -215,7 +215,7 @@ let
     meta = {
       description = "The FEniCS Problem Solving Environment in Python and C++";
       homepage = "https://fenicsproject.org/";
-      license = stdenv.lib.licenses.lgpl3;
+      license = lib.licenses.lgpl3;
     };
   };
   python-dolfin = pythonPackages.buildPythonPackage rec {
@@ -233,8 +233,8 @@ let
       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 'pkgconfig.exists("dolfin")' 'pkgconfig.exists("${dolfin}/lib/pkgconfig/dolfin.pc")' \
-        --replace 'pkgconfig.parse("dolfin")' 'pkgconfig.parse("${dolfin}/lib/pkgconfig/dolfin.pc")'
+        --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
@@ -254,8 +254,8 @@ let
     meta = {
       description = "Python bindings for the DOLFIN FEM compiler";
       homepage = "https://fenicsproject.org/";
-      platforms = stdenv.lib.platforms.all;
-      license = stdenv.lib.licenses.lgpl3;
+      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
index 32fb70978cf9..c956eae4f710 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/flintqs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/flintqs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook
 , gmp
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/sagemath/FlintQS";
     description = "Highly optimized multi-polynomial quadratic sieve for integer factorization";
     license = with licenses; [ gpl2 ];
diff --git a/nixpkgs/pkgs/development/libraries/science/math/ipopt/default.nix b/nixpkgs/pkgs/development/libraries/science/math/ipopt/default.nix
index 97374fb0d477..d1d7a9b9f342 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/ipopt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/ipopt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, blas, lapack, gfortran }:
+{ lib, stdenv, fetchurl, unzip, blas, lapack, gfortran }:
 
 assert (!blas.isILP64) && (!lapack.isILP64);
 
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A software package for large-scale nonlinear optimization";
     homepage = "https://projects.coin-or.org/Ipopt";
     license = licenses.epl10;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/itpp/default.nix b/nixpkgs/pkgs/development/libraries/science/math/itpp/default.nix
index c74a7408e98e..81303a3653ec 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/itpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/itpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , cmake
 , gtest
@@ -35,8 +35,6 @@ stdenv.mkDerivation rec {
     "-DGTEST_DIR:PATH=${gtest.src}/googletest"
   ];
 
-  enableParallelBuilding = true;
-
   doCheck = true;
 
   checkPhase = ''
@@ -45,7 +43,7 @@ stdenv.mkDerivation rec {
     ./gtests/itpp_gtests
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/lcalc/default.nix b/nixpkgs/pkgs/development/libraries/science/math/lcalc/default.nix
index 6f80e1fd23e0..95034c3637a9 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/lcalc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/lcalc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
 , pari
@@ -68,13 +68,13 @@ stdenv.mkDerivation rec {
       url = "https://git.archlinux.org/svntogit/community.git/plain/trunk/lcalc-c++11.patch?h=packages/lcalc&id=3607b97df5a8c231191115b0cb5c62426b339e71";
       sha256 = "1ccrl61lv2vvx8ggldq54m5d0n1iy6mym7qz0i8nj6yj0dshnpk3";
     })
-  ] ++ stdenv.lib.optional stdenv.isDarwin
+  ] ++ lib.optional stdenv.isDarwin
   (fetchpatch {
     url = "https://git.sagemath.org/sage.git/plain/build/pkgs/lcalc/patches/clang.patch";
     sha256 = "0bb7656z6cp6i4p2qj745cmq0lhh52v2akl9whi760dynfdxbl18";
   });
 
-  postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  postPatch = lib.optionalString stdenv.isDarwin ''
     substituteInPlace src/Makefile --replace g++ c++
   '';
 
@@ -87,7 +87,7 @@ stdenv.mkDerivation rec {
     "PARI_PREFIX=${pari}"
   ];
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/science/math/libbraiding/default.nix b/nixpkgs/pkgs/development/libraries/science/math/libbraiding/default.nix
index 36d4ad54c3df..cc5d3baf3442 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/libbraiding/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/libbraiding/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook
 }:
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   # no tests included for now (2018-08-05), but can't hurt to activate
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/miguelmarco/libbraiding/";
     description = "C++ library for computations on braid groups";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/science/math/libhomfly/default.nix b/nixpkgs/pkgs/development/libraries/science/math/libhomfly/default.nix
index 788f534cc779..b756109aa8fc 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/libhomfly/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/libhomfly/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook
 , boehmgc
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/miguelmarco/libhomfly/";
     description = "Library to compute the homfly polynomial of knots and links";
     license = licenses.unlicense;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix b/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix
index 045cccbd2ebf..c742cc60b27f 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/liblapack/default.nix
@@ -1,5 +1,5 @@
 {
-  stdenv,
+  lib, stdenv,
   fetchFromGitHub,
   gfortran,
   cmake,
@@ -7,7 +7,7 @@
   shared ? true
 }:
 let
-  inherit (stdenv.lib) optional;
+  inherit (lib) optional;
   version = "3.9.0";
 in
 
@@ -33,9 +33,7 @@ stdenv.mkDerivation {
 
   doCheck = true;
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit version;
     description = "Linear Algebra PACKage";
     homepage = "http://www.netlib.org/lapack/";
diff --git a/nixpkgs/pkgs/development/libraries/science/math/liblbfgs/default.nix b/nixpkgs/pkgs/development/libraries/science/math/liblbfgs/default.nix
index 49108e5e3305..20c5a2070a05 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/liblbfgs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/liblbfgs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 stdenv.mkDerivation {
   name = "liblbfgs-1.10";
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
   meta = {
     description = "Library of Limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS)";
     homepage = "http://www.chokkan.org/software/liblbfgs/";
-    license = stdenv.lib.licenses.mit;
-    platforms = stdenv.lib.platforms.unix;
+    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
index fba8bcb9367b..9631f3931cab 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/libtorch/bin.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/libtorch/bin.nix
@@ -25,7 +25,7 @@ in stdenv.mkDerivation {
   nativeBuildInputs =
     if stdenv.isDarwin then [ fixDarwinDylibNames ]
     else [ addOpenGLRunpath patchelf ]
-      ++ stdenv.lib.optionals cudaSupport [ addOpenGLRunpath ];
+      ++ lib.optionals cudaSupport [ addOpenGLRunpath ];
 
   buildInputs = [
     stdenv.cc.cc
@@ -57,9 +57,9 @@ in stdenv.mkDerivation {
 
   postFixup = let
     libPaths = [ stdenv.cc.cc.lib ]
-      ++ stdenv.lib.optionals cudaSupport [ nvidia_x11 ];
-    rpath = stdenv.lib.makeLibraryPath libPaths;
-  in stdenv.lib.optionalString stdenv.isLinux ''
+      ++ lib.optionals cudaSupport [ nvidia_x11 ];
+    rpath = lib.makeLibraryPath libPaths;
+  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"
@@ -67,7 +67,7 @@ in stdenv.mkDerivation {
         addOpenGLRunpath "$lib"
       ''}
     done
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + 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
@@ -110,7 +110,7 @@ in stdenv.mkDerivation {
 
   passthru.tests.cmake = callPackage ./test { };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++ API of the PyTorch machine learning framework";
     homepage = "https://pytorch.org/";
     license = licenses.unfree; # Includes CUDA and Intel MKL.
diff --git a/nixpkgs/pkgs/development/libraries/science/math/lrs/default.nix b/nixpkgs/pkgs/development/libraries/science/math/lrs/default.nix
index b0cfbca5aa33..f7f981e223b2 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/lrs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/lrs/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, gmp}:
+{lib, stdenv, fetchurl, gmp}:
 
 stdenv.mkDerivation rec {
   pname = "lrs";
@@ -18,9 +18,9 @@ stdenv.mkDerivation rec {
   meta = {
     inherit version;
     description = "Implementation of the reverse search algorithm for vertex enumeration/convex hull problems";
-    license = stdenv.lib.licenses.gpl2 ;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = stdenv.lib.platforms.linux;
+    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
index f50c15abbdf1..26e26e4ffdbc 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/m4ri/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/m4ri/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromBitbucket
 , autoreconfHook
 }:
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     autoreconfHook
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://malb.bitbucket.io/m4ri/";
     description = "Library to do fast arithmetic with dense matrices over F_2";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/m4rie/default.nix b/nixpkgs/pkgs/development/libraries/science/math/m4rie/default.nix
index 532285991a3c..38a633e58c71 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/m4rie/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/m4rie/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromBitbucket
 , autoreconfHook
 , m4ri
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
     autoreconfHook
   ];
 
-  meta = with stdenv.lib; {
+  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 = ''
diff --git a/nixpkgs/pkgs/development/libraries/science/math/magma/default.nix b/nixpkgs/pkgs/development/libraries/science/math/magma/default.nix
index b4ac119ce6cf..b8e3999ffe83 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/magma/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/magma/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, cmake, gfortran, ninja, cudatoolkit, libpthreadstubs, lapack, blas }:
+{ lib, stdenv, fetchurl, cmake, gfortran, ninja, cudatoolkit, libpthreadstubs, lapack, blas }:
 
-with stdenv.lib;
+with lib;
 
 let version = "2.5.4";
 
@@ -43,7 +43,7 @@ in stdenv.mkDerivation {
         > $out/lib/pkgconfig/magma.pc
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Matrix Algebra on GPU and Multicore Architectures";
     license = licenses.bsd3;
     homepage = "http://icl.cs.utk.edu/magma/index.html";
diff --git a/nixpkgs/pkgs/development/libraries/science/math/metis/default.nix b/nixpkgs/pkgs/development/libraries/science/math/metis/default.nix
index 8d6381c8d48d..b06b432372a7 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/metis/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/metis/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, cmake }:
+{ lib, stdenv, fetchurl, unzip, cmake }:
 
 stdenv.mkDerivation {
   name = "metis-5.1.0";
@@ -9,12 +9,12 @@ stdenv.mkDerivation {
   };
 
   cmakeFlags = [ "-DGKLIB_PATH=../GKlib" ];
-  buildInputs = [ unzip cmake ];
+  nativeBuildInputs = [ unzip cmake ];
 
   meta = {
     description = "Serial graph partitioning and fill-reducing matrix ordering";
     homepage = "http://glaros.dtc.umn.edu/gkhome/metis/metis/overview";
-    license = stdenv.lib.licenses.asl20;
-    platforms = stdenv.lib.platforms.all;
+    license = lib.licenses.asl20;
+    platforms = lib.platforms.all;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/science/math/mongoose/default.nix b/nixpkgs/pkgs/development/libraries/science/math/mongoose/default.nix
index 36c53b2994f5..7dd52f3b663d 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/mongoose/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/mongoose/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 }:
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     cmake
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Graph Coarsening and Partitioning Library";
     homepage = "https://github.com/ScottKolo/Mongoose";
     license = licenses.gpl3;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/nccl/default.nix b/nixpkgs/pkgs/development/libraries/science/math/nccl/default.nix
index eb194c0e9e47..5036ad890799 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/nccl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/nccl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, which, cudatoolkit, addOpenGLRunpath }:
+{ lib, stdenv, fetchFromGitHub, which, cudatoolkit, addOpenGLRunpath }:
 
 stdenv.mkDerivation rec {
   name = "nccl-${version}-cuda-${cudatoolkit.majorVersion}";
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Multi-GPU and multi-node collective communication primitives for NVIDIA GPUs";
     homepage = "https://developer.nvidia.com/nccl";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix b/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix
index 8df04e80ceb3..bd7b739bd77f 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/openblas/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, perl, which
+{ lib, stdenv, fetchFromGitHub, 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).
@@ -19,7 +19,7 @@
 , enableShared ? !stdenv.hostPlatform.isStatic
 }:
 
-with stdenv.lib;
+with lib;
 
 let blas64_ = blas64; in
 
@@ -68,7 +68,6 @@ let
       BINARY = 64;
       TARGET = setTarget "ATHLON";
       DYNAMIC_ARCH = true;
-      NO_AVX512 = true;
       USE_OPENMP = !stdenv.hostPlatform.isMusl;
     };
 
@@ -106,7 +105,7 @@ let
 in
 stdenv.mkDerivation rec {
   pname = "openblas";
-  version = "0.3.12";
+  version = "0.3.13";
 
   outputs = [ "out" "dev" ];
 
@@ -114,7 +113,7 @@ stdenv.mkDerivation rec {
     owner = "xianyi";
     repo = "OpenBLAS";
     rev = "v${version}";
-    sha256 = "0mk1kjkr96bvvcq2zigzjrs0cnhwsf6gfi0855mp9yifn8lvp20y";
+    sha256 = "14jxh0v3jfbw4mfjx4mcz4dd51lyq7pqvh9k8dg94539ypzjr2lj";
   };
 
   inherit blas64;
@@ -161,7 +160,7 @@ stdenv.mkDerivation rec {
     NO_BINARY_MODE = if stdenv.isx86_64
         then toString (stdenv.hostPlatform != stdenv.buildPlatform)
         else stdenv.hostPlatform != stdenv.buildPlatform;
-  } // (stdenv.lib.optionalAttrs singleThreaded {
+  } // (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
@@ -189,14 +188,14 @@ EOF
     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}
-  '' + stdenv.lib.optionalString stdenv.hostPlatform.isLinux ''
+  '' + 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 stdenv.lib; {
+  meta = with lib; {
     description = "Basic Linear Algebra Subprograms";
     license = licenses.bsd3;
     homepage = "https://github.com/xianyi/OpenBLAS";
diff --git a/nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix b/nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix
index 17197823d6ef..2c4198d9679a 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/openlibm/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "openlibm";
@@ -13,8 +13,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "High quality system independent, portable, open source libm implementation";
     homepage = "https://openlibm.org/";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.ttuegel ];
-    platforms = stdenv.lib.platforms.all;
+    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
index 3689df607074..a341264d9894 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/openspecfun/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/openspecfun/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gfortran }:
+{ lib, stdenv, fetchurl, gfortran }:
 
 stdenv.mkDerivation {
   name = "openspecfun-0.5.3";
@@ -14,8 +14,8 @@ stdenv.mkDerivation {
   meta = {
     description = "A collection of special mathematical functions";
     homepage = "https://github.com/JuliaLang/openspecfun";
-    license = stdenv.lib.licenses.mit;
-    maintainers = [ stdenv.lib.maintainers.ttuegel ];
-    platforms = stdenv.lib.platforms.all;
+    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
index 926f7ba4789c..53c117233d20 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/or-tools/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/or-tools/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, abseil-cpp, gflags, which
+{ lib, stdenv, fetchFromGitHub, cmake, abseil-cpp, gflags, which
 , lsb-release, glog, protobuf, cbc, zlib
 , ensureNewerSourcesForZipFilesHook, python, swig }:
 
@@ -53,11 +53,9 @@ stdenv.mkDerivation rec {
     python.pkgs.protobuf python.pkgs.six
   ];
 
-  enableParallelBuilding = true;
-
   outputs = [ "out" "python" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/google/or-tools";
     license = licenses.asl20;
     description = ''
diff --git a/nixpkgs/pkgs/development/libraries/science/math/osi/default.nix b/nixpkgs/pkgs/development/libraries/science/math/osi/default.nix
index b6f367ff4fe9..b61cd8406064 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/osi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/osi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, gfortran, pkgconfig
+{ stdenv, lib, fetchurl, gfortran, pkg-config
 , blas, zlib, bzip2
 , withGurobi ? false, gurobi
 , withCplex ? false, cplex }:
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
     [ blas zlib bzip2 ]
     ++ lib.optional withGurobi gurobi
     ++ lib.optional withCplex cplex;
-  nativeBuildInputs = [ gfortran pkgconfig ];
+  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}" ];
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
 
   passthru = { inherit withGurobi withCplex; };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/osqp/default.nix b/nixpkgs/pkgs/development/libraries/science/math/osqp/default.nix
index 9cd062d21f2f..00f2726f60fe 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/osqp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/osqp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 }:
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A quadratic programming solver using operator splitting";
     homepage = "https://osqp.org";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/parmetis/default.nix b/nixpkgs/pkgs/development/libraries/science/math/parmetis/default.nix
index 8f24356c7336..db70bf8dd7a4 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/parmetis/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/parmetis/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , cmake
 , mpi
@@ -13,7 +13,8 @@ stdenv.mkDerivation rec {
     sha256 = "0pvfpvb36djvqlcc3lq7si0c5xpb2cqndjg8wvzg35ygnwqs5ngj";
   };
 
-  buildInputs = [ cmake mpi ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ mpi ];
 
   # metis and GKlib are packaged with distribution
   # AUR https://aur.archlinux.org/packages/parmetis/ has reported that
@@ -23,7 +24,7 @@ stdenv.mkDerivation rec {
     make config metis_path=$PWD/metis gklib_path=$PWD/metis/GKlib prefix=$out
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/petsc/default.nix b/nixpkgs/pkgs/development/libraries/science/math/petsc/default.nix
index a1e9d1e30515..f06a028fe64f 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/petsc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/petsc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv , darwin , fetchurl , blas , gfortran , lapack , python }:
+{ lib, stdenv , darwin , fetchurl , blas , gfortran , lapack , python }:
 
 stdenv.mkDerivation rec {
   pname = "petsc";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   prePatch = ''
     substituteInPlace configure \
       --replace /bin/sh /usr/bin/python
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     substituteInPlace config/install.py \
       --replace /usr/bin/install_name_tool ${darwin.cctools}/bin/install_name_tool
   '';
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
     )
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = ''
       Library of linear algebra algorithms for solving partial differential
       equations
diff --git a/nixpkgs/pkgs/development/libraries/science/math/planarity/default.nix b/nixpkgs/pkgs/development/libraries/science/math/planarity/default.nix
index b1d6a072e130..a257b84ca54b 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/planarity/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/planarity/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
 , autoreconfHook
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/graph-algorithms/edge-addition-planarity-suite";
     description = "A library for implementing graph algorithms";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix b/nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix
index 46709ff218a0..d99026bc5659 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/primesieve/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake }:
+{ lib, stdenv, fetchurl, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "primesieve";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0g60br3p8di92jx3pr2bb51xh15gg57l7qvwzwn7xf7l585hgi7v";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Fast C/C++ prime number generator";
     homepage = "https://primesieve.org/";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/rankwidth/default.nix b/nixpkgs/pkgs/development/libraries/science/math/rankwidth/default.nix
index 53f4313a2069..38c9444d0d31 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/rankwidth/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/rankwidth/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 }:
 
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   # check phase is empty for now (as of version 0.7)
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Calculates rank-width and rank-decompositions";
     license = with licenses; [ gpl2Plus ];
     maintainers = teams.sage.members;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/rubiks/default.nix b/nixpkgs/pkgs/development/libraries/science/math/rubiks/default.nix
index 44f8150386e7..b4b670884989 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/rubiks/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/rubiks/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
 , coreutils
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix b/nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix
index 1cf9c2ed8d53..3b84a9d99cbe 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/scalapack/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, openssh
+{ lib, stdenv, fetchFromGitHub, cmake, openssh
 , gfortran, mpi, blas, lapack
 } :
 
@@ -18,8 +18,6 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake openssh ];
   buildInputs = [ mpi gfortran blas lapack ];
 
-  enableParallelBuilding = true;
-
   doCheck = true;
 
   preConfigure = ''
@@ -38,13 +36,16 @@ stdenv.mkDerivation rec {
     # 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 stdenv.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;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/scs/default.nix b/nixpkgs/pkgs/development/libraries/science/math/scs/default.nix
index 3820f2b95275..96f543e430f0 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/scs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/scs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, blas, lapack, gfortran, fixDarwinDylibNames }:
+{ lib, stdenv, fetchFromGitHub, blas, lapack, gfortran, fixDarwinDylibNames }:
 
 assert (!blas.isILP64) && (!lapack.isILP64);
 
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
       --replace "gcc" "cc"
   '';
 
-  nativeBuildInputs = stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
+  nativeBuildInputs = lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
   buildInputs = [ blas lapack gfortran.cc.lib ];
 
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Splitting Conic Solver";
     longDescription = ''
       Numerical optimization package for solving large-scale convex cone problems
diff --git a/nixpkgs/pkgs/development/libraries/science/math/spooles/default.nix b/nixpkgs/pkgs/development/libraries/science/math/spooles/default.nix
index c55a1b8002e1..6f4ddb3f787e 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/spooles/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/spooles/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gfortran, perl }:
+{ lib, stdenv, fetchurl, gfortran, perl }:
 
 stdenv.mkDerivation rec {
   pname = "spooles";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
     ./spooles.patch
   ];
 
-  postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
     substituteInPlace makefile --replace '-Wl,-soname' '-Wl,-install_name'
   '';
 
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ perl ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/suitesparse-graphblas/default.nix b/nixpkgs/pkgs/development/libraries/science/math/suitesparse-graphblas/default.nix
index 1c910a4f75bb..7696b18e7ca4 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/suitesparse-graphblas/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/suitesparse-graphblas/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , gnum4
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
     gnum4
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Graph algorithms in the language of linear algebra";
     homepage = "http://faculty.cse.tamu.edu/davis/GraphBLAS.html";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.2.nix b/nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.2.nix
index b1c1202c5780..b8ce3eca888c 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.2.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.2.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gfortran, blas, lapack }:
+{ lib, stdenv, fetchurl, gfortran, blas, lapack }:
 
 let
   int_t = if blas.isILP64 then "int64_t" else "int32_t";
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
     "LAPACK=-llapack"
   ];
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.4.nix b/nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.4.nix
index 81a80c920b53..1ebac6ac445d 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.4.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/suitesparse/4.4.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, gfortran, blas, lapack
+{ lib, stdenv, fetchurl, gfortran, blas, lapack
 , enableCuda ? false, cudatoolkit
 }:
 
@@ -27,11 +27,11 @@ stdenv.mkDerivation {
         -e '/CHOLMOD_CONFIG/ s/$/-DNPARTITION -DLONGBLAS=${int_t}/' \
         -e '/UMFPACK_CONFIG/ s/$/-DLONGBLAS=${int_t}/'
   ''
-  + stdenv.lib.optionalString stdenv.isDarwin ''
+  + lib.optionalString stdenv.isDarwin ''
     sed -i "SuiteSparse_config/SuiteSparse_config.mk" \
         -e 's/^[[:space:]]*\(LIB = -lm\) -lrt/\1/'
   ''
-  + stdenv.lib.optionalString enableCuda ''
+  + 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)|' \
@@ -55,7 +55,7 @@ stdenv.mkDerivation {
     "LAPACK=-llapack"
   ];
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin " -DNTIMER";
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin " -DNTIMER";
 
   postInstall = ''
     # Build and install shared library
@@ -64,7 +64,7 @@ stdenv.mkDerivation {
         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 ${stdenv.lib.optionalString enableCuda "-lcublas"}
+        ${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}
@@ -90,7 +90,7 @@ stdenv.mkDerivation {
   nativeBuildInputs = [ gfortran ];
   buildInputs = [ blas lapack ];
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/science/math/suitesparse/default.nix b/nixpkgs/pkgs/development/libraries/science/math/suitesparse/default.nix
index 2e76050aa989..f0c82e7190f9 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/suitesparse/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/suitesparse/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , gfortran
 , blas, lapack
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [
-  ] ++ stdenv.lib.optional stdenv.isDarwin fixDarwinDylibNames;
+  ] ++ lib.optional stdenv.isDarwin fixDarwinDylibNames;
 
   # Use compatible indexing for lapack and blas used
   buildInputs = assert (blas.isILP64 == lapack.isILP64); [
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
     gfortran.cc.lib
     gmp
     mpfr
-  ] ++ stdenv.lib.optional enableCuda cudatoolkit;
+  ] ++ lib.optional enableCuda cudatoolkit;
 
   preConfigure = ''
     # Mongoose and GraphBLAS are packaged separately
@@ -45,13 +45,13 @@ stdenv.mkDerivation rec {
     "INSTALL_INCLUDE=${placeholder "dev"}/include"
     "JOBS=$(NIX_BUILD_CORES)"
     "MY_METIS_LIB=-lmetis"
-  ] ++ stdenv.lib.optionals blas.isILP64 [
+  ] ++ lib.optionals blas.isILP64 [
     "CFLAGS=-DBLAS64"
-  ] ++ stdenv.lib.optionals enableCuda [
+  ] ++ lib.optionals enableCuda [
     "CUDA_PATH=${cudatoolkit}"
     "CUDART_LIB=${cudatoolkit.lib}/lib/libcudart.so"
     "CUBLAS_LIB=${cudatoolkit}/lib/libcublas.so"
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [
+  ] ++ 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.8.1/SuiteSparse_config/SuiteSparse_config.mk#L368
     "BLAS=-lblas"
@@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
     "library"
   ];
 
-  meta = with stdenv.lib; {
+  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 ];
diff --git a/nixpkgs/pkgs/development/libraries/science/math/superlu/default.nix b/nixpkgs/pkgs/development/libraries/science/math/superlu/default.nix
index ff59297bd839..26dd00d96069 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/superlu/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/superlu/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake,
+{ lib, stdenv, fetchurl, cmake,
   gfortran, blas, lapack}:
 
 assert (!blas.isILP64) && (!lapack.isILP64);
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "0qzlb7cd608q62kyppd0a8c65l03vrwqql6gsm465rky23b6dyr8";
   };
 
-  buildInputs = [ cmake gfortran ];
+  nativeBuildInputs = [ cmake gfortran ];
 
   propagatedBuildInputs = [ blas ];
 
@@ -32,6 +32,6 @@ stdenv.mkDerivation rec {
     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 = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/science/math/sympow/default.nix b/nixpkgs/pkgs/development/libraries/science/math/sympow/default.nix
index a83e2c835461..3c31ed8a361b 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/sympow/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/sympow/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitLab
 , makeWrapper
 , which
@@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
     "$out/bin/sympow" -sp 2p16 -curve "[1,2,3,4,5]" | grep '8.3705'
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Compute special values of symmetric power elliptic curve L-functions";
     license = {
       shortName = "sympow";
diff --git a/nixpkgs/pkgs/development/libraries/science/math/tensorflow/bin.nix b/nixpkgs/pkgs/development/libraries/science/math/tensorflow/bin.nix
index dc0ca5da4cfa..d42026c13cf9 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/tensorflow/bin.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/tensorflow/bin.nix
@@ -1,30 +1,25 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , addOpenGLRunpath
 , cudaSupport ? false, symlinkJoin, cudatoolkit, cudnn, nvidia_x11
 }:
 
-with stdenv.lib;
+with lib;
 let
-  unavailable = throw "libtensorflow is not available for this platform!";
+  broken = !stdenv.isLinux && !stdenv.isDarwin;
 
   tfType = if cudaSupport then "gpu" else "cpu";
 
-  system = 
-    if      stdenv.isLinux  then "linux"
-    else if stdenv.isDarwin then "darwin"
-    else unavailable;
+  system =
+    if stdenv.isLinux then "linux"
+    else "darwin";
 
-  platform =
-    if stdenv.isx86_64 then "x86_64"
-    else unavailable;
+  platform =  "x86_64";
 
-  rpath = makeLibraryPath ([stdenv.cc.libc stdenv.cc.cc.lib] ++
-            optionals cudaSupport [ cudatoolkit.out cudatoolkit.lib cudnn nvidia_x11 ]);
+  rpath = makeLibraryPath ([stdenv.cc.libc stdenv.cc.cc.lib]
+                           ++ optionals cudaSupport [ cudatoolkit.out cudatoolkit.lib cudnn nvidia_x11 ]);
 
   packages = import ./binary-hashes.nix;
-  packageName = "${tfType}-${system}-${platform}";
-  url = packages.${packageName} or unavailable;
 
   patchLibs =
     if stdenv.isDarwin
@@ -44,7 +39,7 @@ in stdenv.mkDerivation rec {
   pname = "libtensorflow";
   inherit (packages) version;
 
-  src = fetchurl url;
+  src = fetchurl packages."${tfType}-${system}-${platform}";
 
   nativeBuildInputs = optional cudaSupport addOpenGLRunpath;
 
@@ -55,7 +50,7 @@ in stdenv.mkDerivation rec {
     chmod -R +w $out
     ${patchLibs}
 
-    # Write pkgconfig file.
+    # Write pkg-config file.
     mkdir $out/lib/pkgconfig
     cat > $out/lib/pkgconfig/tensorflow.pc << EOF
     Name: TensorFlow
@@ -72,6 +67,5 @@ in stdenv.mkDerivation rec {
     homepage = "https://www.tensorflow.org/install/lang_c";
     license = licenses.asl20;
     platforms = [ "x86_64-linux" "x86_64-darwin" ];
-    maintainers = with maintainers; [ basvandijk ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/science/math/tensorflow/binary-hashes.nix b/nixpkgs/pkgs/development/libraries/science/math/tensorflow/binary-hashes.nix
index 76f0c5eea7fa..b606e45477a9 100644
--- a/nixpkgs/pkgs/development/libraries/science/math/tensorflow/binary-hashes.nix
+++ b/nixpkgs/pkgs/development/libraries/science/math/tensorflow/binary-hashes.nix
@@ -1,15 +1,15 @@
 {
-version = "1.14.0";
-cpu-linux-x86_64 = {
-  url = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.14.0.tar.gz";
-  sha256 = "04bi3ijq4sbb8c5vk964zlv0j9mrjnzzxd9q9knq3h273nc1a36k";
+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-1.14.0.tar.gz";
-  sha256 = "1ffnpyj9jjgwxpjfiyjvq4dm3n6nwiksim5jld9zw7fdswh215x6";
+"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-1.14.0.tar.gz";
-  sha256 = "0zsd5ils1a17j6jzh0c7q1z56fw46gkzybbnms7h2rgg8al0rh92";
+"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
index 515f25df4c1f..d571d38f7719 100755
--- a/nixpkgs/pkgs/development/libraries/science/math/tensorflow/prefetcher.sh
+++ b/nixpkgs/pkgs/development/libraries/science/math/tensorflow/prefetcher.sh
@@ -1,7 +1,9 @@
 #!/usr/bin/env bash
 
-version=1.14.0
-hashfile=binary-hashes.nix
+# ./prefetcher.sh 2.4.0 binary-hashes.nix
+
+version="$1"
+hashfile="$2"
 rm -f $hashfile
 echo "{" >> $hashfile
 echo "version = \"$version\";" >> $hashfile
diff --git a/nixpkgs/pkgs/development/libraries/science/networking/ns-3/default.nix b/nixpkgs/pkgs/development/libraries/science/networking/ns-3/default.nix
index b611a2baf8e2..4a90f082dc08 100644
--- a/nixpkgs/pkgs/development/libraries/science/networking/ns-3/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/networking/ns-3/default.nix
@@ -1,5 +1,6 @@
 { stdenv
 , fetchFromGitLab
+, fetchpatch
 , python
 , wafHook
 
@@ -32,22 +33,22 @@
 
 let
   pythonEnv = python.withPackages(ps:
-    stdenv.lib.optional withManual ps.sphinx
-    ++ stdenv.lib.optionals pythonSupport (with ps;[ pybindgen pygccxml ])
+    lib.optional withManual ps.sphinx
+    ++ lib.optionals pythonSupport (with ps;[ pybindgen pygccxml ])
   );
 in
 stdenv.mkDerivation rec {
   pname = "ns-3";
-  version = "32";
+  version = "33";
 
   src = fetchFromGitLab {
     owner = "nsnam";
     repo   = "ns-3-dev";
     rev    = "ns-3.${version}";
-    sha256 = "158yjhsrmslj1q4zcq5p16hv9i82qnxx714l7idicncn0wzrfx7k";
+    sha256 = "0ds8h0f2qcb0gc2a8bk38cbhdb122i4sbg589bjn59rblzw0hkq4";
   };
 
-  nativeBuildInputs = [ wafHook ];
+  nativeBuildInputs = [ wafHook python ];
 
   outputs = [ "out" ] ++ lib.optional pythonSupport "py";
 
@@ -60,11 +61,9 @@ stdenv.mkDerivation rec {
 
   postPatch = ''
     patchShebangs doc/ns3_html_theme/get_version.sh
-    # FIX/Remove when https://github.com/NixOS/nixpkgs/pull/69310 gets merged
-    sed -i 's/program.ns3_module_dependencies.copy()/program.ns3_module_dependencies[:]/g' wscript
   '';
 
-  wafConfigureFlags = with stdenv.lib; [
+  wafConfigureFlags = with lib; [
       "--enable-modules=${concatStringsSep "," modules}"
       "--with-python=${pythonEnv.interpreter}"
   ]
@@ -82,7 +81,7 @@ stdenv.mkDerivation rec {
   # to prevent fatal error: 'backward_warning.h' file not found
   CXXFLAGS = "-D_GLIBCXX_PERMIT_BACKWARD_HASH";
 
-  postBuild = with stdenv.lib; let flags = concatStringsSep ";" (
+  postBuild = with lib; let flags = concatStringsSep ";" (
       optional enableDoxygen "./waf doxygen"
       ++ optional withManual "./waf sphinx"
     );
@@ -99,14 +98,22 @@ stdenv.mkDerivation rec {
     ${pythonEnv.interpreter} ./test.py --nowaf
   '';
 
+  patches = [
+    (fetchpatch {
+      name = "upstream-issue-336.patch";
+      url = "https://gitlab.com/nsnam/ns-3-dev/-/commit/673004edae1112e6cb249b698aad856d728530fb.patch";
+      sha256 = "0q96ividinbh9xlws014b2ir6gaavygnln5ca9m1db06m4vfwhng";
+    })
+  ];
+
   # strictoverflow prevents clang from discovering pyembed when bindings
   hardeningDisable = [ "fortify" "strictoverflow"];
 
-  meta = with stdenv.lib; {
+  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 ];
+    maintainers = with maintainers; [ teto rgrunbla ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/science/robotics/ispike/default.nix b/nixpkgs/pkgs/development/libraries/science/robotics/ispike/default.nix
index 39f412e8dd56..b3eed2e326e6 100644
--- a/nixpkgs/pkgs/development/libraries/science/robotics/ispike/default.nix
+++ b/nixpkgs/pkgs/development/libraries/science/robotics/ispike/default.nix
@@ -1,5 +1,4 @@
-{ stdenv, fetchurl, cmake, boost
-}:
+{ lib, stdenv, fetchurl, cmake, boost }:
 
 stdenv.mkDerivation rec {
   pname = "ispike";
@@ -10,15 +9,14 @@ stdenv.mkDerivation rec {
     sha256 = "0khrxp43bi5kisr8j4lp9fl4r5marzf7b4inys62ac108sfb28lp";
   };
 
-  buildInputs = [ cmake boost ];
+  nativeBuildInputs = [ cmake ];
+  buildInputs = [ boost ];
 
   meta = {
     description = "Spiking neural interface between iCub and a spiking neural simulator";
     homepage = "https://sourceforge.net/projects/ispike/";
-    license = stdenv.lib.licenses.lgpl3;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.nico202 ];
+    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
index 0d980d9d1a2b..0fcb4884de5c 100644
--- a/nixpkgs/pkgs/development/libraries/scmccid/default.nix
+++ b/nixpkgs/pkgs/development/libraries/scmccid/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, patchelf, libusb-compat-0_1}:
+{lib, stdenv, fetchurl, patchelf, libusb-compat-0_1}:
 
 assert stdenv ? cc && stdenv.cc.libc != null;
 
@@ -33,8 +33,8 @@ stdenv.mkDerivation {
   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 = stdenv.lib.licenses.unfree;
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
+    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
index f4e5ae378928..c2beda45ab3a 100644
--- a/nixpkgs/pkgs/development/libraries/scriptaculous/default.nix
+++ b/nixpkgs/pkgs/development/libraries/scriptaculous/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip, ... }: stdenv.mkDerivation rec {
+{ lib, stdenv, fetchurl, unzip, ... }: stdenv.mkDerivation rec {
   pname = "scriptaculous";
   version = "1.9.0";
 
@@ -14,7 +14,7 @@
     cp src/*.js $out
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A set of JavaScript libraries to enhance the user interface of web sites";
     longDescription = ''
       script.aculo.us provides you with
diff --git a/nixpkgs/pkgs/development/libraries/seasocks/default.nix b/nixpkgs/pkgs/development/libraries/seasocks/default.nix
index 241046b09fe8..8c5b4e87d9bb 100644
--- a/nixpkgs/pkgs/development/libraries/seasocks/default.nix
+++ b/nixpkgs/pkgs/development/libraries/seasocks/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, python, zlib }:
+{ lib, stdenv, fetchFromGitHub, cmake, python, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "seasocks";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
   buildInputs = [ zlib python ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/mattgodbolt/seasocks";
     description = "Tiny embeddable C++ HTTP and WebSocket server";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/sentencepiece/default.nix b/nixpkgs/pkgs/development/libraries/sentencepiece/default.nix
index e918a3b3d1d2..8ab0f8ef69a6 100644
--- a/nixpkgs/pkgs/development/libraries/sentencepiece/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sentencepiece/default.nix
@@ -9,20 +9,22 @@
 
 stdenv.mkDerivation rec {
   pname = "sentencepiece";
-  version = "0.1.94";
+  version = "0.1.95";
 
   src = fetchFromGitHub {
     owner = "google";
     repo = pname;
     rev = "v${version}";
-    sha256 = "sha256:11cqw4hx33gw2jmrg11jyp7fj9pwzwjwzqcn24jfsbgh6n8gks5x";
+    sha256 = "0mv7vgsvd7hjssidxy7fjfmwqy68vjcia8pajji11q2fkfp3cg67";
   };
 
-  nativeBuildInputs = [ cmake ] ++ lib.optional withGPerfTools gperftools;
+  nativeBuildInputs = [ cmake ];
+
+  buildInputs = lib.optionals withGPerfTools [ gperftools ];
 
   outputs = [ "bin" "dev" "out" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/google/sentencepiece";
     description = "Unsupervised text tokenizer for Neural Network-based text generation";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/serd/default.nix b/nixpkgs/pkgs/development/libraries/serd/default.nix
index 88fd1ea82d3b..641a5120e8d9 100644
--- a/nixpkgs/pkgs/development/libraries/serd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/serd/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, python3, wafHook }:
+{ lib, stdenv, fetchurl, pkg-config, python3, wafHook }:
 
 stdenv.mkDerivation rec {
   pname = "serd";
@@ -9,9 +9,9 @@ stdenv.mkDerivation rec {
     sha256 = "168rn3m32c59qbar120f83ibcnnd987ij9p053kybgl7cmm6358c";
   };
 
-  nativeBuildInputs = [ pkgconfig python3 wafHook ];
+  nativeBuildInputs = [ pkg-config python3 wafHook ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/serf/default.nix b/nixpkgs/pkgs/development/libraries/serf/default.nix
index 92dde2111fc8..dbdc9ce28714 100644
--- a/nixpkgs/pkgs/development/libraries/serf/default.nix
+++ b/nixpkgs/pkgs/development/libraries/serf/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, apr, sconsPackages, openssl, aprutil, zlib, kerberos
-, pkgconfig, libiconv }:
+{ lib, stdenv, fetchurl, apr, sconsPackages, openssl, aprutil, zlib, kerberos
+, pkg-config, libiconv }:
 
 stdenv.mkDerivation rec {
   name = "serf-1.3.9";
@@ -9,9 +9,9 @@ stdenv.mkDerivation rec {
     sha256 = "1k47gbgpp52049andr28y28nbwh9m36bbb0g8p0aka3pqlhjv72l";
   };
 
-  nativeBuildInputs = [ pkgconfig sconsPackages.scons_3_1_2 ];
+  nativeBuildInputs = [ pkg-config sconsPackages.scons_3_1_2 ];
   buildInputs = [ apr openssl aprutil zlib libiconv ]
-    ++ stdenv.lib.optional (!stdenv.isCygwin) kerberos;
+    ++ lib.optional (!stdenv.isCygwin) kerberos;
 
   patches = [ ./scons.patch ];
 
@@ -23,13 +23,13 @@ stdenv.mkDerivation rec {
     sconsFlags+=" CC=$CC"
     sconsFlags+=" OPENSSL=${openssl}"
     sconsFlags+=" ZLIB=${zlib}"
-  '' + stdenv.lib.optionalString (!stdenv.isCygwin) ''
+  '' + lib.optionalString (!stdenv.isCygwin) ''
     sconsFlags+=" GSSAPI=${kerberos.dev}"
   '';
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "HTTP client library based on APR";
     license = licenses.asl20;
     maintainers = with maintainers; [ orivej raskin ];
diff --git a/nixpkgs/pkgs/development/libraries/serialdv/default.nix b/nixpkgs/pkgs/development/libraries/serialdv/default.nix
index 47d4e68f6589..d1d9c6299b35 100644
--- a/nixpkgs/pkgs/development/libraries/serialdv/default.nix
+++ b/nixpkgs/pkgs/development/libraries/serialdv/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "serialdv";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/sfml/default.nix b/nixpkgs/pkgs/development/libraries/sfml/default.nix
index 7b5e1dcdb2b4..c9a326afa7fe 100644
--- a/nixpkgs/pkgs/development/libraries/sfml/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sfml/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchzip, cmake, libX11, freetype, libjpeg, openal, flac, libvorbis
+{ lib, stdenv, fetchzip, cmake, libX11, freetype, libjpeg, openal, flac, libvorbis
 , glew, libXrandr, libXrender, udev, xcbutilimage
 , IOKit, Foundation, AppKit, OpenAL
 }:
@@ -18,16 +18,16 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ freetype libjpeg openal flac libvorbis glew ]
-    ++ stdenv.lib.optional stdenv.isLinux udev
-    ++ stdenv.lib.optionals (!stdenv.isDarwin) [ libX11 libXrandr libXrender xcbutilimage ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ IOKit Foundation AppKit OpenAL ];
+    ++ 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 stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.sfml-dev.org/";
     description = "Simple and fast multimedia library";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/sfsexp/default.nix b/nixpkgs/pkgs/development/libraries/sfsexp/default.nix
index 40009a8b7c36..7c3fbb9f39e4 100644
--- a/nixpkgs/pkgs/development/libraries/sfsexp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sfsexp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "sfsexp";
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "18gdwxjja0ip378hlzs8sp7q2g6hrmy7x10yf2wnxfmmylbpqn8k";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Small, fast s-expression library";
     homepage = "http://sexpr.sourceforge.net/";
     maintainers = with maintainers; [ jb55 ];
diff --git a/nixpkgs/pkgs/development/libraries/shapelib/default.nix b/nixpkgs/pkgs/development/libraries/shapelib/default.nix
index 8fd4987ac70c..abb27a132c23 100644
--- a/nixpkgs/pkgs/development/libraries/shapelib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/shapelib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "shapelib-1.5.0";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1qfsgb8b3yiqwvr6h9m81g6k9fjhfys70c22p7kzkbick20a9h0z";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C Library for reading, writing and updating ESRI Shapefiles";
     homepage = "http://shapelib.maptools.org/";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/shhmsg/default.nix b/nixpkgs/pkgs/development/libraries/shhmsg/default.nix
index 04b764afc946..0c736e4cb911 100644
--- a/nixpkgs/pkgs/development/libraries/shhmsg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/shhmsg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "shhmsg-1.4.2";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   installFlags = [ "INSTBASEDIR=$(out)" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library for displaying messages";
     homepage = "https://shh.thathost.com/pub-unix/";
     license = licenses.artistic1;
diff --git a/nixpkgs/pkgs/development/libraries/shhopt/default.nix b/nixpkgs/pkgs/development/libraries/shhopt/default.nix
index 45ec31ca4dff..da1b820fcd54 100644
--- a/nixpkgs/pkgs/development/libraries/shhopt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/shhopt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "shhopt-1.1.7";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   installFlags = [ "INSTBASEDIR=$(out)" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A library for parsing command line options";
     homepage = "https://shh.thathost.com/pub-unix/";
     license = licenses.artistic1;
diff --git a/nixpkgs/pkgs/development/libraries/shibboleth-sp/default.nix b/nixpkgs/pkgs/development/libraries/shibboleth-sp/default.nix
index 77b9714066dd..f3b80c0b548f 100644
--- a/nixpkgs/pkgs/development/libraries/shibboleth-sp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/shibboleth-sp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, autoreconfHook, boost, fcgi, openssl, opensaml-cpp, log4shib, pkgconfig, xercesc, xml-security-c, xml-tooling-c }:
+{ 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";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1qb4dbz5gk10b9w1rf6f4vv7c2wb3a8bfzif6yiaq96ilqad7gdr";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ boost fcgi openssl opensaml-cpp log4shib xercesc xml-security-c xml-tooling-c ];
 
   configureFlags = [
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/silgraphite/default.nix b/nixpkgs/pkgs/development/libraries/silgraphite/default.nix
index 9d0aca0ab14b..06cf75876162 100644
--- a/nixpkgs/pkgs/development/libraries/silgraphite/default.nix
+++ b/nixpkgs/pkgs/development/libraries/silgraphite/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, freetype, libXft, pango, fontconfig }:
+{ stdenv, fetchurl, pkg-config, freetype, libXft, pango, fontconfig }:
 
 stdenv.mkDerivation rec {
   version = "2.3.1";
@@ -9,14 +9,14 @@ stdenv.mkDerivation rec {
     sha256 = "9b07c6e91108b1fa87411af4a57e25522784cfea0deb79b34ced608444f2ed65";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ freetype libXft pango fontconfig];
 
   NIX_CFLAGS_COMPILE = "-I${freetype.dev}/include/freetype2";
 
   meta = {
     description = "An advanced font engine";
-    maintainers = [ stdenv.lib.maintainers.raskin ];
-    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ lib.maintainers.raskin ];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/silgraphite/graphite2.nix b/nixpkgs/pkgs/development/libraries/silgraphite/graphite2.nix
index 564c32bf10db..166d0f2911d6 100644
--- a/nixpkgs/pkgs/development/libraries/silgraphite/graphite2.nix
+++ b/nixpkgs/pkgs/development/libraries/silgraphite/graphite2.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, freetype, cmake, python }:
+{ lib, stdenv, fetchurl, pkg-config, freetype, cmake, python }:
 
 stdenv.mkDerivation rec {
   version = "1.3.14";
@@ -10,15 +10,15 @@ stdenv.mkDerivation rec {
     sha256 = "1790ajyhk0ax8xxamnrk176gc9gvhadzy78qia4rd8jzm89ir7gr";
   };
 
-  nativeBuildInputs = [ pkgconfig cmake ];
+  nativeBuildInputs = [ pkg-config cmake ];
   buildInputs = [ freetype ];
 
-  patches = stdenv.lib.optionals stdenv.isDarwin [ ./macosx.patch ];
+  patches = lib.optionals stdenv.isDarwin [ ./macosx.patch ];
 
   checkInputs = [ python ];
   doCheck = false; # fails, probably missing something
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An advanced font engine";
     maintainers = [ maintainers.raskin ];
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/simdjson/default.nix b/nixpkgs/pkgs/development/libraries/simdjson/default.nix
index 63ad97cbe2bf..e41d08c7cd38 100644
--- a/nixpkgs/pkgs/development/libraries/simdjson/default.nix
+++ b/nixpkgs/pkgs/development/libraries/simdjson/default.nix
@@ -1,23 +1,23 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "simdjson";
-  version = "0.7.0";
+  version = "0.8.0";
 
   src = fetchFromGitHub {
     owner = "simdjson";
     repo = "simdjson";
     rev = "v${version}";
-    sha256 = "14gi2zq430nfjy424q6r57imc2gnz30nhx4r0wbajzp9qvna819w";
+    sha256 = "0lpb8la74xwd78d5mgwnzx4fy632jbmh0ip19v0dydwm0kagm0a3";
   };
 
   nativeBuildInputs = [ cmake ];
 
   cmakeFlags = [
     "-DSIMDJSON_JUST_LIBRARY=ON"
-  ];
+  ] ++ lib.optional stdenv.hostPlatform.isStatic "-DSIMDJSON_BUILD_STATIC=ON";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://simdjson.org/";
     description = "Parsing gigabytes of JSON per second";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/simgear/default.nix b/nixpkgs/pkgs/development/libraries/simgear/default.nix
index e6fb1d7caf75..2f1006404b7a 100644
--- a/nixpkgs/pkgs/development/libraries/simgear/default.nix
+++ b/nixpkgs/pkgs/development/libraries/simgear/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, plib, freeglut, xorgproto, libX11, libXext, libXi
+{ lib, stdenv, fetchurl, plib, freeglut, xorgproto, libX11, libXext, libXi
 , libICE, libSM, libXt, libXmu, libGLU, libGL, boost, zlib, libjpeg, freealut
 , openscenegraph, openal, expat, cmake, apr
 , curl
@@ -21,9 +21,7 @@ stdenv.mkDerivation rec {
                   libICE libSM libXt libXmu libGLU libGL boost zlib libjpeg freealut
                   openscenegraph openal expat apr curl ];
 
-  enableParallelBuilding = true;
-
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Simulation construction toolkit";
     homepage = "https://gitorious.org/fg/simgear";
     maintainers = with maintainers; [ raskin ];
diff --git a/nixpkgs/pkgs/development/libraries/simpleitk/default.nix b/nixpkgs/pkgs/development/libraries/simpleitk/default.nix
index e6b013aa1370..2ae8b28b64f2 100644
--- a/nixpkgs/pkgs/development/libraries/simpleitk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/simpleitk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, swig, lua, itk }:
+{ lib, stdenv, fetchFromGitHub, cmake, swig, lua, itk }:
 
 stdenv.mkDerivation rec {
   pname = "simpleitk";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   # 2.0.0: linker error building examples
   cmakeFlags = [ "-DBUILD_EXAMPLES=OFF" "-DBUILD_SHARED_LIBS=ON" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.simpleitk.org";
     description = "Simplified interface to ITK";
     maintainers = with maintainers; [ bcdarwin ];
diff --git a/nixpkgs/pkgs/development/libraries/skalibs/default.nix b/nixpkgs/pkgs/development/libraries/skalibs/default.nix
index a691107f9a1d..1efac7fc5e48 100644
--- a/nixpkgs/pkgs/development/libraries/skalibs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/skalibs/default.nix
@@ -4,8 +4,8 @@ with skawarePackages;
 
 buildPackage {
   pname = "skalibs";
-  version = "2.9.3.0";
-  sha256 = "0i1vg3bh0w3bpj7cv0kzs6q9v2dd8wa2by8h8j39fh1qkl20f6ph";
+  version = "2.10.0.1";
+  sha256 = "1chwjzlh13jbrldk77h3i4qjqv8hjpvvd3papcb8j46mvj7sxysg";
 
   description = "A set of general-purpose C programming libraries";
 
diff --git a/nixpkgs/pkgs/development/libraries/slang/default.nix b/nixpkgs/pkgs/development/libraries/slang/default.nix
index 9b7905c180a9..a3db5ce0d3be 100644
--- a/nixpkgs/pkgs/development/libraries/slang/default.nix
+++ b/nixpkgs/pkgs/development/libraries/slang/default.nix
@@ -1,10 +1,19 @@
-{ stdenv, fetchurl, ncurses, pcre, libpng, zlib, readline, libiconv }:
+{ lib, stdenv, fetchurl
+, libiconv
+, libpng
+, ncurses
+, pcre
+, readline
+, zlib
+}:
 
 stdenv.mkDerivation rec {
-  name = "slang-2.3.2";
+  pname = "slang";
+  version = "2.3.2";
+
   src = fetchurl {
-    url = "https://www.jedsoft.org/releases/slang/${name}.tar.bz2";
-    sha256 = "06p379fqn6w38rdpqi98irxi2bf4llb0rja3dlgkqz7nqh7kp7pw";
+    url = "https://www.jedsoft.org/releases/slang/${pname}-${version}.tar.bz2";
+    sha256 = "sha256-/J47D8T2fDwfbUPJDBalxC0Re44oRXxbRoMbi1064xo=";
   };
 
   outputs = [ "out" "dev" "man" "doc" ];
@@ -13,22 +22,25 @@ stdenv.mkDerivation rec {
 
   # Fix some wrong hardcoded paths
   preConfigure = ''
-    sed -i -e "s|/usr/lib/terminfo|${ncurses.out}/lib/terminfo|" configure
-    sed -i -e "s|/usr/lib/terminfo|${ncurses.out}/lib/terminfo|" src/sltermin.c
-    sed -i -e "s|/bin/ln|ln|" src/Makefile.in
-    sed -i -e "s|-ltermcap|-lncurses|" ./configure
+    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-png=${libpng.dev}"
-    "--with-z=${zlib.dev}"
     "--with-pcre=${pcre.dev}"
+    "--with-png=${libpng.dev}"
     "--with-readline=${readline.dev}"
+    "--with-z=${zlib.dev}"
   ];
 
   buildInputs = [
-    pcre libpng zlib readline
-  ] ++ stdenv.lib.optionals (stdenv.isDarwin) [ libiconv ];
+    libpng
+    pcre
+    readline
+    zlib
+  ] ++ lib.optionals (stdenv.isDarwin) [ libiconv ];
 
   propagatedBuildInputs = [ ncurses ];
 
@@ -40,11 +52,31 @@ stdenv.mkDerivation rec {
     sed '/^Libs:/s/$/ -lncurses/' -i "$dev"/lib/pkgconfig/slang.pc
   '';
 
-  meta = with stdenv.lib; {
-    description = "A multi-platform programmer's library designed to allow a developer to create robust software";
+  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; [ ];
+    maintainers = with maintainers; [ AndersonTorres ];
     platforms = platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/slib/default.nix b/nixpkgs/pkgs/development/libraries/slib/default.nix
index 401564342b59..47f633f5096b 100644
--- a/nixpkgs/pkgs/development/libraries/slib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/slib/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, unzip, scheme, texinfo }:
+{ fetchurl, lib, stdenv, unzip, scheme, texinfo }:
 
 stdenv.mkDerivation rec {
   name = "slib-3b5";
@@ -42,11 +42,11 @@ stdenv.mkDerivation rec {
     '';
 
     # Public domain + permissive (non-copyleft) licensing of some files.
-    license = stdenv.lib.licenses.publicDomain;
+    license = lib.licenses.publicDomain;
 
     homepage = "http://people.csail.mit.edu/jaffer/SLIB";
 
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/smarty3-i18n/default.nix b/nixpkgs/pkgs/development/libraries/smarty3-i18n/default.nix
index d93a59efe6e7..7fb6b1adb5a8 100644
--- a/nixpkgs/pkgs/development/libraries/smarty3-i18n/default.nix
+++ b/nixpkgs/pkgs/development/libraries/smarty3-i18n/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, ... }: stdenv.mkDerivation rec {
+{ lib, stdenv, fetchFromGitHub, ... }: stdenv.mkDerivation rec {
   pname = "smarty-i18n";
   version = "1.0";
 
@@ -14,7 +14,7 @@
     cp block.t.php $out
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "gettext for the smarty3 framework";
     license = licenses.lgpl21;
     homepage = "https://github.com/kikimosha/smarty3-i18n";
diff --git a/nixpkgs/pkgs/development/libraries/smarty3/default.nix b/nixpkgs/pkgs/development/libraries/smarty3/default.nix
index d5708cb6b1e8..2070a3bab790 100644
--- a/nixpkgs/pkgs/development/libraries/smarty3/default.nix
+++ b/nixpkgs/pkgs/development/libraries/smarty3/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, ... }: stdenv.mkDerivation rec {
+{ lib, stdenv, fetchFromGitHub, ... }: stdenv.mkDerivation rec {
   pname = "smarty3";
   version = "3.1.36";
 
@@ -14,7 +14,7 @@
     cp -r libs/* $out
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Smarty 3 template engine";
     longDescription = ''
       Smarty is a template engine for PHP, facilitating the
diff --git a/nixpkgs/pkgs/development/libraries/smesh/default.nix b/nixpkgs/pkgs/development/libraries/smesh/default.nix
index 1b1f590109fd..8494799333be 100644
--- a/nixpkgs/pkgs/development/libraries/smesh/default.nix
+++ b/nixpkgs/pkgs/development/libraries/smesh/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fetchpatch, cmake, ninja, opencascade
+{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, ninja, opencascade
 , Cocoa }:
 
 stdenv.mkDerivation rec {
@@ -21,9 +21,9 @@ stdenv.mkDerivation rec {
   ];
 
   nativeBuildInputs = [ cmake ninja ];
-  buildInputs = [ opencascade ] ++ stdenv.lib.optionals stdenv.isDarwin [ Cocoa ];
+  buildInputs = [ opencascade ] ++ lib.optionals stdenv.isDarwin [ Cocoa ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Extension to OCE providing advanced meshing features";
     homepage = "https://github.com/tpaviot/smesh";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/smpeg/default.nix b/nixpkgs/pkgs/development/libraries/smpeg/default.nix
index 3a34bf54c3cb..83b4b2193c03 100644
--- a/nixpkgs/pkgs/development/libraries/smpeg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/smpeg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchsvn, SDL, autoconf, automake, libtool, gtk2, m4, pkgconfig, libGLU, libGL, makeWrapper }:
+{ lib, stdenv, fetchsvn, SDL, autoconf, automake, libtool, gtk2, m4, pkg-config, libGLU, libGL, makeWrapper }:
 
 stdenv.mkDerivation rec {
   name = "smpeg-svn${version}";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ SDL gtk2 libGLU libGL ];
 
-  nativeBuildInputs = [ autoconf automake libtool m4 pkgconfig makeWrapper ];
+  nativeBuildInputs = [ autoconf automake libtool m4 pkg-config makeWrapper ];
 
   preConfigure = ''
     touch NEWS AUTHORS ChangeLog
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
       $out/include/smpeg/*.h
 
     wrapProgram $out/bin/smpeg-config \
-      --prefix PATH ":" "${pkgconfig}/bin" \
+      --prefix PATH ":" "${pkg-config}/bin" \
       --prefix PKG_CONFIG_PATH ":" "${SDL.dev}/lib/pkgconfig"
   '';
 
@@ -45,7 +45,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://icculus.org/smpeg/";
     description = "MPEG decoding library";
-    license = stdenv.lib.licenses.gpl2Plus;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.gpl2Plus;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/smpeg2/default.nix b/nixpkgs/pkgs/development/libraries/smpeg2/default.nix
index 270e418174e4..d57cc91f26e2 100644
--- a/nixpkgs/pkgs/development/libraries/smpeg2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/smpeg2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , autoconf
 , automake
 , darwin
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoconf automake makeWrapper pkg-config ];
 
   buildInputs = [ SDL2 ]
-    ++ stdenv.lib.optional stdenv.isDarwin darwin.libobjc;
+    ++ lib.optional stdenv.isDarwin darwin.libobjc;
 
   preConfigure = ''
     sh autogen.sh
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://icculus.org/smpeg/";
     description = "SDL2 MPEG Player Library";
     license = licenses.lgpl2;
diff --git a/nixpkgs/pkgs/development/libraries/snack/default.nix b/nixpkgs/pkgs/development/libraries/snack/default.nix
index 7aa7cf3d452f..4948e481ff58 100644
--- a/nixpkgs/pkgs/development/libraries/snack/default.nix
+++ b/nixpkgs/pkgs/development/libraries/snack/default.nix
@@ -1,6 +1,6 @@
 # alsaLib vorbis-tools python can be made optional
 
-{ stdenv, fetchurl, python, tcl, tk, vorbis-tools, pkgconfig, xlibsWrapper }:
+{ lib, stdenv, fetchurl, python, tcl, tk, vorbis-tools, pkg-config, xlibsWrapper }:
 
 stdenv.mkDerivation {
   name = "snack-2.2.10";
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
 
   postUnpack = ''sourceRoot="$sourceRoot/unix"'';
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ python tcl tk vorbis-tools xlibsWrapper ];
 
   hardeningDisable = [ "format" ];
@@ -23,13 +23,13 @@ stdenv.mkDerivation {
 
   installPhase = ''
     mkdir -p $out
-    make install DESTDIR="$out" 
+    make install DESTDIR="$out"
   '';
 
-  meta = { 
+  meta = {
     description = "The Snack Sound Toolkit (Tcl)";
     homepage = "http://www.speech.kth.se/snack/";
-    license = stdenv.lib.licenses.gpl2;
+    license = lib.licenses.gpl2;
     broken = true;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/snappy/default.nix b/nixpkgs/pkgs/development/libraries/snappy/default.nix
index e626db8efb78..ece425e85c41 100644
--- a/nixpkgs/pkgs/development/libraries/snappy/default.nix
+++ b/nixpkgs/pkgs/development/libraries/snappy/default.nix
@@ -1,4 +1,6 @@
-{ stdenv, fetchFromGitHub, cmake, static ? false }:
+{ lib, stdenv, fetchFromGitHub, cmake
+, static ? stdenv.hostPlatform.isStatic
+}:
 
 stdenv.mkDerivation rec {
   pname = "snappy";
@@ -31,7 +33,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://google.github.io/snappy/";
     license = licenses.bsd3;
     description = "Compression/decompression library for very high speeds";
diff --git a/nixpkgs/pkgs/development/libraries/soci/default.nix b/nixpkgs/pkgs/development/libraries/soci/default.nix
index 1f9b77cc3c92..f561864a7502 100644
--- a/nixpkgs/pkgs/development/libraries/soci/default.nix
+++ b/nixpkgs/pkgs/development/libraries/soci/default.nix
@@ -1,7 +1,7 @@
 { cmake
 , fetchFromGitHub
 , sqlite
-, stdenv
+, lib, stdenv
 }:
 
 stdenv.mkDerivation rec {
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake ];
   buildInputs = [ sqlite ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Database access library for C++";
     homepage = "http://soci.sourceforge.net/";
     license = licenses.boost;
diff --git a/nixpkgs/pkgs/development/libraries/socket_wrapper/default.nix b/nixpkgs/pkgs/development/libraries/socket_wrapper/default.nix
index 188405365cd3..e1ba9dbc1e61 100644
--- a/nixpkgs/pkgs/development/libraries/socket_wrapper/default.nix
+++ b/nixpkgs/pkgs/development/libraries/socket_wrapper/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, pkgconfig }:
+{ lib, stdenv, fetchurl, cmake, pkg-config }:
 
 stdenv.mkDerivation rec {
   name = "socket_wrapper-1.2.5";
@@ -8,9 +8,9 @@ stdenv.mkDerivation rec {
     sha256 = "1wb3gq0rj5h92mhq6f1hb2qy4ypkxvn8y87ag88c7gc71nkpa1fx";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/sofia-sip/default.nix b/nixpkgs/pkgs/development/libraries/sofia-sip/default.nix
index f8b1c1028520..1395f3e60cf8 100644
--- a/nixpkgs/pkgs/development/libraries/sofia-sip/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sofia-sip/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, glib, openssl, pkgconfig, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, glib, openssl, pkg-config, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "sofia-sip";
@@ -12,9 +12,9 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ glib openssl ];
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
-  meta = with stdenv.lib; {
+  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.linux;
diff --git a/nixpkgs/pkgs/development/libraries/sonic/default.nix b/nixpkgs/pkgs/development/libraries/sonic/default.nix
index fc45e220a51c..38dcee84a928 100644
--- a/nixpkgs/pkgs/development/libraries/sonic/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sonic/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, fftw, installShellFiles }:
+{ lib, stdenv, fetchFromGitHub, fftw, installShellFiles }:
 
 stdenv.mkDerivation {
   pname = "sonic-unstable";
@@ -19,11 +19,11 @@ stdenv.mkDerivation {
 
   postInstall = ''
     installManPage sonic.1
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + lib.optionalString stdenv.isDarwin ''
     install_name_tool -id $out/lib/libsonic.so.0.3.0 $out/lib/libsonic.so.0.3.0
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Simple library to speed up or slow down speech";
     homepage = "https://github.com/waywardgeek/sonic";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/soprano/default.nix b/nixpkgs/pkgs/development/libraries/soprano/default.nix
index 40ec30c6c858..c9debd36110e 100644
--- a/nixpkgs/pkgs/development/libraries/soprano/default.nix
+++ b/nixpkgs/pkgs/development/libraries/soprano/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, cmake, qt4, clucene_core, librdf_redland, libiodbc
-, pkgconfig }:
+{ lib, stdenv, fetchurl, cmake, qt4, clucene_core, librdf_redland, libiodbc
+, pkg-config }:
 
 stdenv.mkDerivation rec {
   name = "soprano-2.9.4";
@@ -14,13 +14,13 @@ stdenv.mkDerivation rec {
   # 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 pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
   meta = {
     homepage = "http://soprano.sourceforge.net/";
     description = "An object-oriented C++/Qt4 framework for RDF data";
     license = "LGPL";
-    maintainers = with stdenv.lib.maintainers; [ sander ];
+    maintainers = with lib.maintainers; [ sander ];
     inherit (qt4.meta) platforms;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/soqt/default.nix b/nixpkgs/pkgs/development/libraries/soqt/default.nix
index 8d69c328eed9..2be6c6621454 100644
--- a/nixpkgs/pkgs/development/libraries/soqt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/soqt/default.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, stdenv, coin3d, qtbase, cmake, pkgconfig }:
+{ fetchFromGitHub, lib, stdenv, coin3d, qtbase, cmake, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "soqt";
@@ -15,9 +15,9 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ coin3d qtbase ];
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/coin3d/soqt";
     license = licenses.bsd3;
     description = "Glue between Coin high-level 3D visualization library and Qt";
diff --git a/nixpkgs/pkgs/development/libraries/sord/default.nix b/nixpkgs/pkgs/development/libraries/sord/default.nix
index eb91ec2986a3..820c577908ab 100644
--- a/nixpkgs/pkgs/development/libraries/sord/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sord/default.nix
@@ -1,19 +1,23 @@
-{ stdenv, fetchurl, pkgconfig, python3, serd, pcre, wafHook }:
+{ lib, stdenv, fetchFromGitHub, pkg-config, python3, serd, pcre, wafHook }:
 
 stdenv.mkDerivation rec {
   pname = "sord";
-  version = "0.16.4";
+  version = "unstable-2021-01-12";
 
-  src = fetchurl {
-    url = "https://download.drobilla.net/${pname}-${version}.tar.bz2";
-    sha256 = "1mwh4qvp9q4vgrgg5bz9sgjhxscncrylf2b06h0q55ddwzs9hndi";
+  # Commit picked in mitigation of #109729
+  src = fetchFromGitHub {
+    owner = "drobilla";
+    repo = pname;
+    rev = "d2efdb2d026216449599350b55c2c85c0d3efb89";
+    sha256 = "hHTwK+K6cj9MGO77a1IXiUZtEbXZ08cLGkYZ5eMOIVA=";
+    fetchSubmodules = true;
   };
 
-  nativeBuildInputs = [ pkgconfig python3 wafHook ];
+  nativeBuildInputs = [ pkg-config python3 wafHook ];
   buildInputs = [ pcre ];
   propagatedBuildInputs = [ serd ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://drobilla.net/software/sord";
     description = "A lightweight C library for storing RDF data in memory";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/soxt/default.nix b/nixpkgs/pkgs/development/libraries/soxt/default.nix
index fe0d93344c0e..5ea23aae8791 100644
--- a/nixpkgs/pkgs/development/libraries/soxt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/soxt/default.nix
@@ -1,4 +1,4 @@
-{ fetchhg, stdenv, cmake, coin3d, motif, xlibsWrapper, libXmu, libGLU, libGL }:
+{ fetchhg, lib, stdenv, cmake, coin3d, motif, xlibsWrapper, libXmu, libGLU, libGL }:
 
 stdenv.mkDerivation {
   pname = "soxt";
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
   nativeBuildInputs = [ cmake ];
   buildInputs = [ coin3d motif xlibsWrapper libGLU libGL libXmu ];
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/spandsp/3.nix b/nixpkgs/pkgs/development/libraries/spandsp/3.nix
index ac587f0492b0..b3522afdf860 100644
--- a/nixpkgs/pkgs/development/libraries/spandsp/3.nix
+++ b/nixpkgs/pkgs/development/libraries/spandsp/3.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, audiofile, libtiff, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, audiofile, libtiff, autoreconfHook }:
 stdenv.mkDerivation rec {
   version = "3.0.0";
   pname = "spandsp";
@@ -17,8 +17,8 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A portable and modular SIP User-Agent with audio and video support";
     homepage = "https://github.com/freeswitch/spandsp";
-    platforms = with stdenv.lib.platforms; linux;
-    maintainers = with stdenv.lib.maintainers; [ ajs124 ];
-    license = stdenv.lib.licenses.gpl2;
+    platforms = with lib.platforms; linux;
+    maintainers = with lib.maintainers; [ ajs124 ];
+    license = lib.licenses.gpl2;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/spandsp/default.nix b/nixpkgs/pkgs/development/libraries/spandsp/default.nix
index 1f9834c08f47..85a3059f27bc 100644
--- a/nixpkgs/pkgs/development/libraries/spandsp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/spandsp/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, audiofile, libtiff}:
+{lib, stdenv, fetchurl, audiofile, libtiff}:
 stdenv.mkDerivation rec {
   version = "0.0.6";
   pname = "spandsp";
@@ -13,9 +13,9 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A portable and modular SIP User-Agent with audio and video support";
     homepage = "http://www.creytiv.com/baresip.html";
-    platforms = with stdenv.lib.platforms; linux;
-    maintainers = with stdenv.lib.maintainers; [raskin];
-    license = stdenv.lib.licenses.gpl2;
+    platforms = with lib.platforms; linux;
+    maintainers = with lib.maintainers; [raskin];
+    license = lib.licenses.gpl2;
     downloadPage = "http://www.soft-switch.org/downloads/spandsp/";
     inherit version;
     updateWalker = true;
diff --git a/nixpkgs/pkgs/development/libraries/sparsehash/default.nix b/nixpkgs/pkgs/development/libraries/sparsehash/default.nix
index 6007560a11ff..41b765bcb07d 100644
--- a/nixpkgs/pkgs/development/libraries/sparsehash/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sparsehash/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   name = "sparsehash-2.0.4";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "1pf1cjvcjdmb9cd6gcazz64x0cd2ndpwh6ql2hqpypjv725xwxy7";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/sparsehash/sparsehash";
     description = "An extremely memory-efficient hash_map implementation";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/spatialite-tools/default.nix b/nixpkgs/pkgs/development/libraries/spatialite-tools/default.nix
index 939371e9209f..ffded04510b4 100644
--- a/nixpkgs/pkgs/development/libraries/spatialite-tools/default.nix
+++ b/nixpkgs/pkgs/development/libraries/spatialite-tools/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, sqlite, expat, zlib, proj, geos, libspatialite, readosm }:
+{ lib, stdenv, fetchurl, pkg-config, sqlite, expat, zlib, proj, geos, libspatialite, readosm }:
 
 stdenv.mkDerivation rec {
   name = "spatialite-tools-4.1.1";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "14aqmhvab63ydbb82fglsbig7jw1wmci8jjvci07aavdhvh1pyrv";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ sqlite expat zlib proj geos libspatialite readosm ];
 
   configureFlags = [ "--disable-freexl" ];
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A complete sqlite3-compatible CLI front-end for libspatialite";
     homepage = "https://www.gaia-gis.it/fossil/spatialite-tools";
-    license = with stdenv.lib.licenses; [ mpl11 gpl2Plus lgpl21Plus ];
-    platforms = stdenv.lib.platforms.linux;
+    license = with lib.licenses; [ mpl11 gpl2Plus lgpl21Plus ];
+    platforms = lib.platforms.linux;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/spdk/default.nix b/nixpkgs/pkgs/development/libraries/spdk/default.nix
index 1b5abe16f370..a0c875079c44 100644
--- a/nixpkgs/pkgs/development/libraries/spdk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/spdk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchFromGitHub
 , fetchpatch
@@ -57,7 +57,7 @@ in stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Set of libraries for fast user-mode storage";
     homepage = "https://spdk.io/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/spdlog/default.nix b/nixpkgs/pkgs/development/libraries/spdlog/default.nix
index fbe7af1825ed..ac74b74ccf1e 100644
--- a/nixpkgs/pkgs/development/libraries/spdlog/default.nix
+++ b/nixpkgs/pkgs/development/libraries/spdlog/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, fmt }:
+{ lib, stdenv, fetchFromGitHub, cmake, fmt }:
 
 let
   generic = { version, sha256 }:
@@ -17,7 +17,8 @@ let
       buildInputs = [ fmt ];
 
       cmakeFlags = [
-        "-DSPDLOG_BUILD_SHARED=ON"
+        "-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"
@@ -34,7 +35,7 @@ let
       doCheck = true;
       preCheck = "export LD_LIBRARY_PATH=$(pwd):$LD_LIBRARY_PATH";
 
-      meta = with stdenv.lib; {
+      meta = with lib; {
         description    = "Very fast, header only, C++ logging library";
         homepage       = "https://github.com/gabime/spdlog";
         license        = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/speech-tools/default.nix b/nixpkgs/pkgs/development/libraries/speech-tools/default.nix
index 771ad033ed91..c54b4a3721f6 100644
--- a/nixpkgs/pkgs/development/libraries/speech-tools/default.nix
+++ b/nixpkgs/pkgs/development/libraries/speech-tools/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, alsaLib, ncurses }:
+{ lib, stdenv, fetchurl, alsaLib, ncurses }:
 
 stdenv.mkDerivation rec {
   name = "speech_tools-${version}.0";
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
 
   checkTarget = "test";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Text-to-speech engine";
     maintainers = with maintainers; [ raskin ];
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/speechd/default.nix b/nixpkgs/pkgs/development/libraries/speechd/default.nix
index 483b8eeb2065..e85b6d4cbf40 100644
--- a/nixpkgs/pkgs/development/libraries/speechd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/speechd/default.nix
@@ -1,6 +1,6 @@
-{ stdenv
+{ lib, stdenv
 , substituteAll
-, pkgconfig
+, pkg-config
 , fetchurl
 , python3Packages
 , gettext
@@ -24,7 +24,7 @@
 }:
 
 let
-  inherit (stdenv.lib) optional optionals;
+  inherit (lib) optional optionals;
   inherit (python3Packages) python pyxdg wrapPython;
 
   # speechd hard-codes espeak, even when built without support for it.
@@ -54,7 +54,7 @@ in stdenv.mkDerivation rec {
   ];
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     autoreconfHook
     gettext
     libtool
@@ -88,7 +88,7 @@ in stdenv.mkDerivation rec {
   configureFlags = [
     # Audio method falls back from left to right.
     "--with-default-audio-method=\"libao,pulse,alsa,oss\""
-    "--with-systemdsystemunitdir=${placeholder ''out''}/lib/systemd/system"
+    "--with-systemdsystemunitdir=${placeholder "out"}/lib/systemd/system"
   ] ++ optional withPulse "--with-pulse"
     ++ optional withAlsa "--with-alsa"
     ++ optional withLibao "--with-libao"
@@ -110,7 +110,7 @@ in stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Common interface to speech synthesis";
     homepage = "https://devel.freebsoft.org/speechd";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/speex/default.nix b/nixpkgs/pkgs/development/libraries/speex/default.nix
index f7c3fc50fd79..9633f435fb8e 100644
--- a/nixpkgs/pkgs/development/libraries/speex/default.nix
+++ b/nixpkgs/pkgs/development/libraries/speex/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, pkgconfig, fftw, speexdsp }:
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, fftw, speexdsp }:
 
 stdenv.mkDerivation rec {
   name = "speex-1.2.0";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "doc" ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ fftw speexdsp ];
 
   # TODO: Remove this will help with immediate backward compatability
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     "--with-fft=gpl-fftw3"
   ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/speexdsp/default.nix b/nixpkgs/pkgs/development/libraries/speexdsp/default.nix
index 421b3ec08c48..f87d79ca6e48 100644
--- a/nixpkgs/pkgs/development/libraries/speexdsp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/speexdsp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, pkgconfig, fftw }:
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, fftw }:
 
 stdenv.mkDerivation rec {
   name = "speexdsp-1.2.0";
@@ -13,14 +13,14 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" "doc" ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ fftw ];
 
   configureFlags = [
     "--with-fft=gpl-fftw3"
-  ] ++ stdenv.lib.optional stdenv.isAarch64 "--disable-neon";
+  ] ++ lib.optional stdenv.isAarch64 "--disable-neon";
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/sphinxbase/default.nix b/nixpkgs/pkgs/development/libraries/sphinxbase/default.nix
index 008fb608ca08..a7d59cd8bf6f 100644
--- a/nixpkgs/pkgs/development/libraries/sphinxbase/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sphinxbase/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , bison
-, pkgconfig
+, pkg-config
 , python27 # >= 2.6
 , swig2 # 2.0
 , multipleOutputs ? false #Uses incomplete features of nix!
@@ -15,18 +15,18 @@ stdenv.mkDerivation (rec {
     sha256 = "0vr4k8pv5a8nvq9yja7kl13b5lh0f9vha8fc8znqnm8bwmcxnazp";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ swig2 python27 bison ];
 
   meta = {
     description = "Support Library for Pocketsphinx";
     homepage = "http://cmusphinx.sourceforge.net";
-    license = stdenv.lib.licenses.bsd2;
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ ];
+    license = lib.licenses.bsd2;
+    platforms = lib.platforms.unix;
+    maintainers = with lib.maintainers; [ ];
   };
 
-} // (stdenv.lib.optionalAttrs multipleOutputs {
+} // (lib.optionalAttrs multipleOutputs {
   outputs = [ "out" "lib" "headers" ];
 
   postInstall = ''
diff --git a/nixpkgs/pkgs/development/libraries/spice-gtk/default.nix b/nixpkgs/pkgs/development/libraries/spice-gtk/default.nix
index 22370cee448e..3d76e67f67ad 100644
--- a/nixpkgs/pkgs/development/libraries/spice-gtk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/spice-gtk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , acl
 , cyrus_sasl
@@ -23,7 +23,7 @@
 , perl
 , phodav
 , pixman
-, pkgconfig
+, pkg-config
 , polkit
 , python3
 , spice-protocol
@@ -81,7 +81,7 @@ stdenv.mkDerivation rec {
     meson
     ninja
     perl
-    pkgconfig
+    pkg-config
     python3
     python3.pkgs.pyparsing
     python3.pkgs.six
@@ -109,7 +109,7 @@ stdenv.mkDerivation rec {
     spice-protocol
     usbredir
     zlib
-  ] ++ stdenv.lib.optionals withPolkit [ polkit acl usbutils ] ;
+  ] ++ lib.optionals withPolkit [ polkit acl usbutils ] ;
 
   PKG_CONFIG_POLKIT_GOBJECT_1_POLICYDIR = "${placeholder "out"}/share/polkit-1/actions";
 
@@ -118,7 +118,7 @@ stdenv.mkDerivation rec {
     "-Dpulse=disabled" # is deprecated upstream
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "GTK 3 SPICE widget";
     longDescription = ''
       spice-gtk is a GTK 3 SPICE widget. It features glib-based
diff --git a/nixpkgs/pkgs/development/libraries/spice-protocol/default.nix b/nixpkgs/pkgs/development/libraries/spice-protocol/default.nix
index cae975b9a589..07b670a2718f 100644
--- a/nixpkgs/pkgs/development/libraries/spice-protocol/default.nix
+++ b/nixpkgs/pkgs/development/libraries/spice-protocol/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "spice-protocol";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     ln -sv ../share/pkgconfig $out/lib/pkgconfig
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Protocol headers for the SPICE protocol";
     homepage = "https://www.spice-space.org/";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/spice/default.nix b/nixpkgs/pkgs/development/libraries/spice/default.nix
index 2e158b98b583..584b1e15a8e3 100644
--- a/nixpkgs/pkgs/development/libraries/spice/default.nix
+++ b/nixpkgs/pkgs/development/libraries/spice/default.nix
@@ -1,8 +1,8 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , pixman
 , alsaLib
 , openssl
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
     spice-protocol
     python3
     python3.pkgs.six
@@ -85,7 +85,7 @@ stdenv.mkDerivation rec {
     ln -s spice-server $out/include/spice
   '';
 
-  meta = with stdenv.lib; {
+  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
diff --git a/nixpkgs/pkgs/development/libraries/spirv-headers/default.nix b/nixpkgs/pkgs/development/libraries/spirv-headers/default.nix
index 79b8e7c2dda1..9d464f7300ae 100644
--- a/nixpkgs/pkgs/development/libraries/spirv-headers/default.nix
+++ b/nixpkgs/pkgs/development/libraries/spirv-headers/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "spirv-headers";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit (src.meta) homepage;
     description = "Machine-readable components of the Khronos SPIR-V Registry";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/sqlcipher/default.nix b/nixpkgs/pkgs/development/libraries/sqlcipher/default.nix
index f40c80391a23..cc5656dcc643 100644
--- a/nixpkgs/pkgs/development/libraries/sqlcipher/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sqlcipher/default.nix
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
     installManPage sqlcipher.1
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.zetetic.net/sqlcipher/";
     description = "SQLite extension that provides 256 bit AES encryption of database files";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/sqlite/default.nix b/nixpkgs/pkgs/development/libraries/sqlite/default.nix
index f0bbc93a6f1d..2b7a472d1e78 100644
--- a/nixpkgs/pkgs/development/libraries/sqlite/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sqlite/default.nix
@@ -1,11 +1,13 @@
-{ stdenv, fetchurl, zlib, interactive ? false, readline ? null, ncurses ? null }:
+{ lib, stdenv, fetchurl, zlib, interactive ? false, readline ? null, ncurses ? null
+, python3Packages
+}:
 
 assert interactive -> readline != null && ncurses != null;
 
-with stdenv.lib;
+with lib;
 
 let
-  archiveVersion = import ./archive-version.nix stdenv.lib;
+  archiveVersion = import ./archive-version.nix lib;
 in
 
 stdenv.mkDerivation rec {
@@ -73,6 +75,10 @@ stdenv.mkDerivation rec {
 
   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";
diff --git a/nixpkgs/pkgs/development/libraries/sqlite/sqlar.nix b/nixpkgs/pkgs/development/libraries/sqlite/sqlar.nix
index 78ac8ba6448a..0828f2f45543 100644
--- a/nixpkgs/pkgs/development/libraries/sqlite/sqlar.nix
+++ b/nixpkgs/pkgs/development/libraries/sqlite/sqlar.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fuse, zlib }:
+{ lib, stdenv, fetchurl, fuse, zlib }:
 
 stdenv.mkDerivation {
   pname = "sqlar";
@@ -11,13 +11,13 @@ stdenv.mkDerivation {
 
   buildInputs = [ fuse zlib ];
 
-  buildFlags = [ "sqlar" "sqlarfs" ];
+  buildFlags = [ "sqlar" "sqlarfs" "CFLAGS=-Wno-error" ];
 
   installPhase = ''
     install -D -t $out/bin sqlar sqlarfs
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://sqlite.org/sqlar";
     description = "SQLite Archive utilities";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/sqlite/tools.nix b/nixpkgs/pkgs/development/libraries/sqlite/tools.nix
index 0eb913adb3b9..3ec528719e9e 100644
--- a/nixpkgs/pkgs/development/libraries/sqlite/tools.nix
+++ b/nixpkgs/pkgs/development/libraries/sqlite/tools.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, unzip, sqlite, tcl, Foundation }:
+{ lib, stdenv, fetchurl, unzip, sqlite, tcl, Foundation }:
 
 let
-  archiveVersion = import ./archive-version.nix stdenv.lib;
+  archiveVersion = import ./archive-version.nix lib;
   mkTool = { pname, makeTarget, description, homepage }: stdenv.mkDerivation rec {
     inherit pname;
     version = "3.34.0";
@@ -12,13 +12,13 @@ let
     };
 
     nativeBuildInputs = [ unzip ];
-    buildInputs = [ tcl ] ++ stdenv.lib.optional stdenv.isDarwin Foundation;
+    buildInputs = [ tcl ] ++ lib.optional stdenv.isDarwin Foundation;
 
     makeFlags = [ makeTarget ];
 
     installPhase = "install -Dt $out/bin ${makeTarget}";
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       inherit description homepage;
       downloadPage = http://sqlite.org/download.html;
       license = licenses.publicDomain;
diff --git a/nixpkgs/pkgs/development/libraries/srt/default.nix b/nixpkgs/pkgs/development/libraries/srt/default.nix
index 6947c674a914..c8d8fafbf355 100644
--- a/nixpkgs/pkgs/development/libraries/srt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/srt/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchFromGitHub, cmake, openssl
+{ lib, stdenv, fetchFromGitHub, cmake, openssl
 }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "srt";
   version = "1.4.2";
diff --git a/nixpkgs/pkgs/development/libraries/srtp/default.nix b/nixpkgs/pkgs/development/libraries/srtp/default.nix
index e8a3ca944343..0dbfef2c6394 100644
--- a/nixpkgs/pkgs/development/libraries/srtp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/srtp/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchFromGitHub, pkgconfig
+{ lib, stdenv, fetchFromGitHub, pkg-config
 , openssl ? null, libpcap ? null
 }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "libsrtp";
   version = "2.3.0";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   # libsrtp.pc references -lcrypto -lpcap without -L
   propagatedBuildInputs = [ openssl libpcap ];
diff --git a/nixpkgs/pkgs/development/libraries/startup-notification/default.nix b/nixpkgs/pkgs/development/libraries/startup-notification/default.nix
index bf2522ca780b..f334bb2f35a4 100644
--- a/nixpkgs/pkgs/development/libraries/startup-notification/default.nix
+++ b/nixpkgs/pkgs/development/libraries/startup-notification/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, libX11, libxcb, pkgconfig, xcbutil}:
+{lib, stdenv, fetchurl, libX11, libxcb, pkg-config, xcbutil}:
 
 let
   version = "0.12";
@@ -11,12 +11,12 @@ stdenv.mkDerivation {
     sha256 = "3c391f7e930c583095045cd2d10eb73a64f085c7fde9d260f2652c7cb3cfbe4a";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ libX11 libxcb xcbutil ];
 
   meta = {
     homepage = "http://www.freedesktop.org/software/startup-notification";
     description = "Application startup notification and feedback library";
-    license = stdenv.lib.licenses.lgpl2;
+    license = lib.licenses.lgpl2;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/stb/default.nix b/nixpkgs/pkgs/development/libraries/stb/default.nix
index 8e57222ded0b..a3020e14d3e1 100644
--- a/nixpkgs/pkgs/development/libraries/stb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/stb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation {
   pname = "stb";
@@ -18,7 +18,7 @@ stdenv.mkDerivation {
     cp *.h $out/include/stb/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Single-file public domain libraries for C/C++";
     homepage = "https://github.com/nothings/stb";
     license = licenses.publicDomain;
diff --git a/nixpkgs/pkgs/development/libraries/stellarsolver/default.nix b/nixpkgs/pkgs/development/libraries/stellarsolver/default.nix
index 69417299615b..8badf60d9421 100644
--- a/nixpkgs/pkgs/development/libraries/stellarsolver/default.nix
+++ b/nixpkgs/pkgs/development/libraries/stellarsolver/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, mkDerivation, fetchFromGitHub, cmake,
+{ lib, stdenv, mkDerivation, fetchFromGitHub, cmake,
   qtbase, cfitsio, gsl, wcslib, withTester ? false }:
 
 mkDerivation rec {
@@ -20,7 +20,7 @@ mkDerivation rec {
     "-DBUILD_TESTER=${if withTester then "on" else "off"}"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/rlancaste/stellarsolver";
     description = "Astrometric plate solving library";
     license = licenses.gpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/stfl/default.nix b/nixpkgs/pkgs/development/libraries/stfl/default.nix
index b0da3dbfa278..20676c16b9c6 100644
--- a/nixpkgs/pkgs/development/libraries/stfl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/stfl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, ncurses, libiconv }:
+{ lib, stdenv, fetchurl, ncurses, libiconv }:
 
 stdenv.mkDerivation rec {
   name = "stfl-0.24";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   buildPhase = ''
     sed -i s/gcc/cc/g Makefile
     sed -i s%ncursesw/ncurses.h%ncurses.h% stfl_internals.h
-  '' + ( stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + ( lib.optionalString stdenv.isDarwin ''
     sed -i s/-soname/-install_name/ Makefile
   '' ) + ''
     make
@@ -29,8 +29,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage    = "http://www.clifford.at/stfl/";
     description = "A library which implements a curses-based widget set for text terminals";
-    maintainers = with stdenv.lib.maintainers; [ lovek323 ];
-    license     = stdenv.lib.licenses.lgpl3;
-    platforms   = stdenv.lib.platforms.unix;
+    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
index 2d344ab293d8..5af77d90053f 100644
--- a/nixpkgs/pkgs/development/libraries/stlport/default.nix
+++ b/nixpkgs/pkgs/development/libraries/stlport/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl}:
+{lib, stdenv, fetchurl}:
 
 stdenv.mkDerivation rec {
   name = "STLport-5.2.1";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "An implementation of the C++ Standard Library";
     homepage = "https://sourceforge.net/projects/stlport/";
-    license = stdenv.lib.licenses.free; # seems BSD-like
+    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
index fead2c8c1a53..eec4f722d411 100644
--- a/nixpkgs/pkgs/development/libraries/stxxl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/stxxl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake
+{ lib, stdenv, fetchurl, cmake
 , parallel ? true
 }:
 
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     inherit parallel;
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/subunit/default.nix b/nixpkgs/pkgs/development/libraries/subunit/default.nix
index bf3b6a9ffd13..cb824decc6ca 100644
--- a/nixpkgs/pkgs/development/libraries/subunit/default.nix
+++ b/nixpkgs/pkgs/development/libraries/subunit/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, check, cppunit, perl, pythonPackages }:
+{ lib, stdenv, fetchurl, pkg-config, check, cppunit, perl, pythonPackages }:
 
 # NOTE: for subunit python library see pkgs/top-level/python-packages.nix
 
@@ -11,14 +11,14 @@ stdenv.mkDerivation rec {
     sha256 = "1h7i5ifcx20qkya24j11nbwa829klw7dvnlljdgivgvcx6b20y80";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ check cppunit perl pythonPackages.wrapPython ];
 
   propagatedBuildInputs = with pythonPackages; [ testtools testscenarios ];
 
   postFixup = "wrapPythonPrograms";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A streaming protocol for test results";
     homepage = "https://launchpad.net/subunit";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/sundials/default.nix b/nixpkgs/pkgs/development/libraries/sundials/default.nix
index 2e1fd527e9a7..f8db8f3c379a 100644
--- a/nixpkgs/pkgs/development/libraries/sundials/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sundials/default.nix
@@ -1,6 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , cmake
 , fetchurl
+, fetchpatch
 , python
 , blas
 , lapack
@@ -12,12 +13,30 @@
 
 stdenv.mkDerivation rec {
   pname = "sundials";
-  version = "5.3.0";
+  version = "5.6.1";
+
+  outputs = [ "out" "examples" ];
+
+  src = fetchurl {
+    url = "https://computation.llnl.gov/projects/${pname}/download/${pname}-${version}.tar.gz";
+    sha256 = "Frd5mex+fyFXqh0Eyh3kojccqBUOBW0klR0MWJZvKoM=";
+  };
+
+  patches = [
+    # Fixing an upstream regression in treating cmake prefix directories:
+    # https://github.com/LLNL/sundials/pull/58
+    (fetchpatch {
+      url = "https://github.com/LLNL/sundials/commit/dd32ff9baa05618f36e44aadb420bbae4236ea1e.patch";
+      sha256 = "kToAuma+2iHFyL1v/l29F3+nug4AdK5cPG6IcXv2afc=";
+    })
+  ];
+
+  nativeBuildInputs = [ cmake ];
 
   buildInputs = [
     python
   ]
-    ++ stdenv.lib.optionals (lapackSupport)
+    ++ lib.optionals (lapackSupport)
     # Check that the same index size is used for both libraries
     (assert (blas.isILP64 == lapack.isILP64); [
       gfortran
@@ -27,46 +46,34 @@ stdenv.mkDerivation rec {
   # 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)
-  ++ stdenv.lib.optionals (kluSupport) [
+  ++ lib.optionals (kluSupport) [
     suitesparse
   ];
 
-  nativeBuildInputs = [ cmake ];
-
-  src = fetchurl {
-    url = "https://computation.llnl.gov/projects/${pname}/download/${pname}-${version}.tar.gz";
-    sha256 = "19xwi7pz35s2nqgldm6r0jl2k0bs36zhbpnmmzc56s1n3bhzgpw8";
-  };
-
-  patches = [
-    (fetchurl {
-      # https://github.com/LLNL/sundials/pull/19
-      url = "https://github.com/LLNL/sundials/commit/1350421eab6c5ab479de5eccf6af2dcad1eddf30.patch";
-      sha256 = "0g67lixp9m85fqpb9rzz1hl1z8ibdg0ldwq5z6flj5zl8a7cw52l";
-    })
-  ];
-
   cmakeFlags = [
-    "-DEXAMPLES_INSTALL_PATH=${placeholder "out"}/share/examples"
-  ] ++ stdenv.lib.optionals (lapackSupport) [
-    "-DLAPACK_ENABLE=ON"
+    "-DEXAMPLES_INSTALL_PATH=${placeholder "examples"}/share/examples"
+  ] ++ lib.optionals (lapackSupport) [
+    "-DENABLE_LAPACK=ON"
     "-DLAPACK_LIBRARIES=${lapack}/lib/liblapack${stdenv.hostPlatform.extensions.sharedLibrary}"
-  ] ++ stdenv.lib.optionals (kluSupport) [
-    "-DKLU_ENABLE=ON"
+  ] ++ lib.optionals (kluSupport) [
+    "-DENABLE_KLU=ON"
     "-DKLU_INCLUDE_DIR=${suitesparse.dev}/include"
     "-DKLU_LIBRARY_DIR=${suitesparse}/lib"
-  ] ++ stdenv.lib.optionals (lapackSupport && !lapack.isILP64) [
-    # Use the correct index type according to lapack which is supposed to be
-    # the same index type compatible with blas, thanks to the assertion of
-    # buildInputs
-    "-DSUNDIALS_INDEX_TYPE=int32_t"
-  ]
+  ] ++ [(
+    # 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 stdenv.lib; {
+  meta = with lib; {
     description = "Suite of nonlinear differential/algebraic equation solvers";
     homepage    = "https://computation.llnl.gov/projects/sundials";
     platforms   = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/svrcore/default.nix b/nixpkgs/pkgs/development/libraries/svrcore/default.nix
index 628ab7e28ef1..fbc17a5e7b21 100644
--- a/nixpkgs/pkgs/development/libraries/svrcore/default.nix
+++ b/nixpkgs/pkgs/development/libraries/svrcore/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, nss, nspr }:
+{ lib, stdenv, fetchurl, pkg-config, nss, nspr }:
 
 stdenv.mkDerivation rec {
   pname = "svrcore";
@@ -9,10 +9,10 @@ stdenv.mkDerivation rec {
     sha256 = "0n3alg6bxml8952fb6h0bi0l29farvq21q6k20gy2ba90m3znwj7";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ nss nspr ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Secure PIN handling using NSS crypto";
     license = licenses.mpl11;
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/swiften/default.nix b/nixpkgs/pkgs/development/libraries/swiften/default.nix
index 2fe20cc9e882..980d034682f5 100644
--- a/nixpkgs/pkgs/development/libraries/swiften/default.nix
+++ b/nixpkgs/pkgs/development/libraries/swiften/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, python, fetchurl, openssl, boost, sconsPackages }:
+{ lib, stdenv, python, fetchurl, openssl, boost, sconsPackages }:
 stdenv.mkDerivation rec {
   pname = "swiften";
   version = "4.0.2";
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An XMPP library for C++, used by the Swift client";
     homepage    = "http://swift.im/swiften.html";
     license     = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/swiftshader/default.nix b/nixpkgs/pkgs/development/libraries/swiftshader/default.nix
index 3631b8b4fe7c..2c508a3735f9 100644
--- a/nixpkgs/pkgs/development/libraries/swiftshader/default.nix
+++ b/nixpkgs/pkgs/development/libraries/swiftshader/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, python3, cmake, jq, libX11, libXext, zlib }:
+{ lib, stdenv, fetchgit, python3, cmake, jq, libX11, libXext, zlib }:
 
 stdenv.mkDerivation rec {
   pname = "swiftshader";
@@ -50,7 +50,7 @@ stdenv.mkDerivation rec {
     runHook postInstall
   '';
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/sword/default.nix b/nixpkgs/pkgs/development/libraries/sword/default.nix
index 7349d7f81eb6..35c1e6e15e29 100644
--- a/nixpkgs/pkgs/development/libraries/sword/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sword/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, icu, clucene_core, curl }:
+{ lib, stdenv, fetchurl, pkg-config, icu, clucene_core, curl }:
 
 stdenv.mkDerivation rec {
 
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     sha256 = "14syphc47g6svkbg018nrsgq4z6hid1zydax243g8dx747vsi6nf";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ icu clucene_core curl ];
 
   prePatch = ''
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     "-DU_USING_ICU_NAMESPACE=1"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A software framework that allows research manipulation of Biblical texts";
     homepage = "http://www.crosswire.org/sword/";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/sycl-info/default.nix b/nixpkgs/pkgs/development/libraries/sycl-info/default.nix
index f294c887b0ce..9d86017e084e 100644
--- a/nixpkgs/pkgs/development/libraries/sycl-info/default.nix
+++ b/nixpkgs/pkgs/development/libraries/sycl-info/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , installShellFiles
 , cmake
@@ -40,13 +40,13 @@ stdenv.mkDerivation rec {
     "-DBUILD_TESTING=ON"
     "-DBUILD_DOCS=ON"
     "-DBUILD_SHARED_LIBS=ON"
-    "-DLYRA_INCLUDE_DIRS=${stdenv.lib.getDev lyra}/include"
+    "-DLYRA_INCLUDE_DIRS=${lib.getDev lyra}/include"
   ];
 
   # Required for ronn to compile the manpage.
   RUBYOPT = "-KU -E utf-8:utf-8";
 
-  meta = with stdenv.lib;
+  meta = with lib;
     {
       homepage = "https://github.com/codeplaysoftware/sycl-info";
       description = "Tool to show information about available SYCL implementations";
diff --git a/nixpkgs/pkgs/development/libraries/symengine/default.nix b/nixpkgs/pkgs/development/libraries/symengine/default.nix
index cc3abd80d6f6..3a3f5c79763e 100644
--- a/nixpkgs/pkgs/development/libraries/symengine/default.nix
+++ b/nixpkgs/pkgs/development/libraries/symengine/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 , gmp
@@ -36,7 +36,7 @@ stdenv.mkDerivation rec {
     ctest
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A fast symbolic manipulation library";
     homepage = "https://github.com/symengine/symengine";
     platforms = platforms.unix ++ platforms.windows;
diff --git a/nixpkgs/pkgs/development/libraries/szip/default.nix b/nixpkgs/pkgs/development/libraries/szip/default.nix
index 2419cf554421..f6d0c619c770 100644
--- a/nixpkgs/pkgs/development/libraries/szip/default.nix
+++ b/nixpkgs/pkgs/development/libraries/szip/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl }:
-    
+{ lib, stdenv, fetchurl }:
+
 stdenv.mkDerivation rec {
   pname = "szip";
   version = "2.1.1";
@@ -11,6 +11,6 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Compression library that can be used with the hdf5 library";
     homepage = "https://www.hdfgroup.org/doc_resource/SZIP/";
-    license = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/t1lib/default.nix b/nixpkgs/pkgs/development/libraries/t1lib/default.nix
index 7d42abc6ea19..495993a64ab6 100644
--- a/nixpkgs/pkgs/development/libraries/t1lib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/t1lib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, libX11, libXaw }:
+{ lib, stdenv, fetchurl, fetchpatch, libX11, libXaw }:
 
 let
   getPatch = { name, sha256 }: fetchpatch {
@@ -28,9 +28,9 @@ stdenv.mkDerivation {
   buildInputs = [ libX11 libXaw ];
   buildFlags = [ "without_doc" ];
 
-  postInstall = stdenv.lib.optional (!stdenv.isDarwin) "chmod +x $out/lib/*.so.*"; # ??
+  postInstall = lib.optional (!stdenv.isDarwin) "chmod +x $out/lib/*.so.*"; # ??
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A type 1 font rasterizer library for UNIX/X11";
     homepage = "http://www.t1lib.org/";
     license = with licenses; [ gpl2 lgpl2 ];
diff --git a/nixpkgs/pkgs/development/libraries/tachyon/default.nix b/nixpkgs/pkgs/development/libraries/tachyon/default.nix
index 20dc80b253d2..f536442295ef 100644
--- a/nixpkgs/pkgs/development/libraries/tachyon/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tachyon/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , Carbon ? null
 , libjpeg ? null
@@ -18,19 +18,19 @@ stdenv.mkDerivation rec {
     url = "http://jedi.ks.uiuc.edu/~johns/tachyon/files/${version}/${pname}-${version}.tar.gz";
     sha256 = "04m0bniszyg7ryknj8laj3rl5sspacw5nr45x59j2swcsxmdvn1v";
   };
-  buildInputs = stdenv.lib.optionals stdenv.isDarwin [
+  buildInputs = lib.optionals stdenv.isDarwin [
     Carbon
-  ] ++ stdenv.lib.optionals withJpegSupport [
+  ] ++ lib.optionals withJpegSupport [
     libjpeg
-  ] ++ stdenv.lib.optionals withPngSupport [
+  ] ++ lib.optionals withPngSupport [
     libpng
   ];
   preBuild = ''
     cd unix
-  '' + stdenv.lib.optionalString withJpegSupport ''
+  '' + lib.optionalString withJpegSupport ''
     export USEJPEG=" -DUSEJPEG"
     export JPEGLIB=" -ljpeg"
-  '' + stdenv.lib.optionalString withPngSupport ''
+  '' + lib.optionalString withPngSupport ''
     export USEPNG=" -DUSEPNG"
     export PNGLIB=" -lpng -lz"
   '';
@@ -52,7 +52,7 @@ stdenv.mkDerivation rec {
     ./make-archs.patch
   ] ++
   # Ensure looks for nix-provided Carbon, not system frameworks
-  stdenv.lib.optional stdenv.isDarwin ./darwin.patch;
+  lib.optional stdenv.isDarwin ./darwin.patch;
 
   installPhase = ''
     cd ../compile/${arch}
@@ -66,10 +66,10 @@ stdenv.mkDerivation rec {
   '';
   meta = {
     inherit version;
-    description = ''A Parallel / Multiprocessor Ray Tracing System'';
-    license = stdenv.lib.licenses.bsd3;
-    maintainers = [stdenv.lib.maintainers.raskin];
-    platforms = with stdenv.lib.platforms; linux ++ cygwin ++ darwin;
+    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/taglib-extras/default.nix b/nixpkgs/pkgs/development/libraries/taglib-extras/default.nix
index b667e6047400..44e107693c97 100644
--- a/nixpkgs/pkgs/development/libraries/taglib-extras/default.nix
+++ b/nixpkgs/pkgs/development/libraries/taglib-extras/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, cmake, taglib}:
+{lib, stdenv, fetchurl, cmake, taglib}:
 
 stdenv.mkDerivation rec {
   name = "taglib-extras-1.0.1";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     sed -i -e 's/STRLESS/VERSION_LESS/g' cmake/modules/FindTaglib.cmake
   '';
 
-  meta = with stdenv.lib; {
+  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
index 89d676cf3a34..78a4026455e6 100644
--- a/nixpkgs/pkgs/development/libraries/taglib-sharp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/taglib-sharp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, which, pkgconfig, mono }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, which, pkg-config, mono }:
 
 stdenv.mkDerivation rec {
   pname = "taglib-sharp";
@@ -11,14 +11,14 @@ stdenv.mkDerivation rec {
     sha256 = "12pk4z6ag8w7kj6vzplrlasq5lwddxrww1w1ya5ivxrfki15h5cp";
   };
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook which ];
+  nativeBuildInputs = [ pkg-config autoreconfHook which ];
   buildInputs = [ mono ];
 
   dontStrip = true;
 
   configureFlags = [ "--disable-docs" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for reading and writing metadata in media files";
     homepage = "https://github.com/mono/taglib-sharp";
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/taglib/default.nix b/nixpkgs/pkgs/development/libraries/taglib/default.nix
index 28373605a6bd..3fcfaa12339a 100644
--- a/nixpkgs/pkgs/development/libraries/taglib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/taglib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, fetchpatch
+{ lib, stdenv, fetchurl, cmake, fetchpatch
 , zlib
 }:
 
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" ];
 
-  meta = with stdenv.lib; {
+  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";
diff --git a/nixpkgs/pkgs/development/libraries/talloc/default.nix b/nixpkgs/pkgs/development/libraries/talloc/default.nix
index fa920d037a92..553c42da7c4f 100644
--- a/nixpkgs/pkgs/development/libraries/talloc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/talloc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , python3
 , pkg-config
@@ -43,7 +43,7 @@ stdenv.mkDerivation (rec {
   ];
 
   # this must not be exported before the ConfigurePhase otherwise waf whines
-  preBuild = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+  preBuild = lib.optionalString stdenv.hostPlatform.isMusl ''
     export NIX_CFLAGS_LINK="-no-pie -shared";
   '';
 
@@ -51,13 +51,13 @@ stdenv.mkDerivation (rec {
     ${stdenv.cc.targetPrefix}ar q $out/lib/libtalloc.a bin/default/talloc.c.[0-9]*.o
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Hierarchical pool based memory allocator with destructors";
     homepage = "https://tdb.samba.org/";
     license = licenses.gpl3;
     platforms = platforms.all;
   };
-} // stdenv.lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
+} // lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
   # 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 when cross-compiling.
diff --git a/nixpkgs/pkgs/development/libraries/tbb/default.nix b/nixpkgs/pkgs/development/libraries/tbb/default.nix
index 8f045802d3af..2047b0d5bc2e 100644
--- a/nixpkgs/pkgs/development/libraries/tbb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tbb/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchFromGitHub, fixDarwinDylibNames, compiler ? if stdenv.cc.isClang then "clang" else null, stdver ? null }:
+{ lib, stdenv, fetchFromGitHub, fixDarwinDylibNames, compiler ? if stdenv.cc.isClang then "clang" else null, stdver ? null }:
 
-with stdenv.lib; stdenv.mkDerivation rec {
+with lib; stdenv.mkDerivation rec {
   pname = "tbb";
   version = "2019_U9";
 
@@ -16,13 +16,17 @@ with stdenv.lib; stdenv.mkDerivation rec {
   makeFlags = optional (compiler != null) "compiler=${compiler}"
     ++ optional (stdver != null) "stdver=${stdver}";
 
-  patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ./glibc-struct-mallinfo.patch;
+  patches = lib.optional stdenv.hostPlatform.isMusl ./glibc-struct-mallinfo.patch;
 
   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
   '';
 
   enableParallelBuilding = true;
diff --git a/nixpkgs/pkgs/development/libraries/tclap/default.nix b/nixpkgs/pkgs/development/libraries/tclap/default.nix
index 22fd7b11681c..451f17a2cd72 100644
--- a/nixpkgs/pkgs/development/libraries/tclap/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tclap/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "tclap-1.2.2";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0dsqvsgzam3mypj2ladn6v1yjq9zd47p3lg21jx6kz5azkkkn0gm";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://tclap.sourceforge.net/";
     description = "Templatized C++ Command Line Parser Library";
     platforms = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/tcllib/default.nix b/nixpkgs/pkgs/development/libraries/tcllib/default.nix
index 2cb65b9c6981..4cab15ca5c22 100644
--- a/nixpkgs/pkgs/development/libraries/tcllib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tcllib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, tcl }:
+{ lib, stdenv, fetchurl, tcl }:
 
 stdenv.mkDerivation rec {
   pname = "tcllib";
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://sourceforge.net/projects/tcllib/";
     description = "Tcl-only library of standard routines for Tcl";
-    license = stdenv.lib.licenses.tcltk;
-    platforms = stdenv.lib.platforms.unix;
+    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
index c26394f6cd50..e88358bbce0a 100644
--- a/nixpkgs/pkgs/development/libraries/tcltls/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tcltls/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, tcl, openssl }:
+{ lib, stdenv, fetchurl, tcl, openssl }:
 
 stdenv.mkDerivation rec {
   pname = "tcltls";
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://tls.sourceforge.net/";
     description = "An OpenSSL / RSA-bsafe Tcl extension";
-    license = stdenv.lib.licenses.tcltk;
-    platforms = stdenv.lib.platforms.unix;
+    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
index 5d4727a1831e..85eae730575f 100644
--- a/nixpkgs/pkgs/development/libraries/tclx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tclx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, tcl }:
+{ lib, stdenv, fetchurl, tcl }:
 
 stdenv.mkDerivation rec {
   name = "tclx-${version}.${patch}";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://tclx.sourceforge.net/";
     description = "Tcl extensions";
-    license = stdenv.lib.licenses.tcltk;
-    maintainers = with stdenv.lib.maintainers; [ kovirobi ];
+    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
index b8e6552bc7b5..658bdb2f9d5d 100644
--- a/nixpkgs/pkgs/development/libraries/tdb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tdb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , pkg-config
 , wafHook
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
     "--builtin-libraries=replace"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "The trivial database";
     longDescription = ''
       TDB is a Trivial Database. In concept, it is very much like GDBM,
diff --git a/nixpkgs/pkgs/development/libraries/tdlib/default.nix b/nixpkgs/pkgs/development/libraries/tdlib/default.nix
index 1a36a68a33bd..895faa8847ac 100644
--- a/nixpkgs/pkgs/development/libraries/tdlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tdlib/default.nix
@@ -1,4 +1,4 @@
-{ fetchFromGitHub, gperf, openssl, readline, zlib, cmake, stdenv }:
+{ fetchFromGitHub, gperf, openssl, readline, zlib, cmake, lib, stdenv }:
 
 stdenv.mkDerivation rec {
   version = "1.7.0";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ gperf openssl readline zlib ];
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Cross-platform library for building Telegram clients";
     homepage = "https://core.telegram.org/tdlib/";
     license = [ licenses.boost ];
diff --git a/nixpkgs/pkgs/development/libraries/tecla/default.nix b/nixpkgs/pkgs/development/libraries/tecla/default.nix
index a47f39be10a7..6d8a334ce3fb 100644
--- a/nixpkgs/pkgs/development/libraries/tecla/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tecla/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "tecla-1.6.3";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     description = "Command-line editing library";
     license = "as-is";
 
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = [ stdenv.lib.maintainers.peti ];
+    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
index 455c761f6ee9..2885f3cbb12d 100644
--- a/nixpkgs/pkgs/development/libraries/telepathy/farstream/default.nix
+++ b/nixpkgs/pkgs/development/libraries/telepathy/farstream/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, telepathy-glib, farstream, dbus-glib }:
+{ lib, stdenv, fetchurl, pkg-config, telepathy-glib, farstream, dbus-glib }:
 
 stdenv.mkDerivation rec {
   name = "${pname}-0.6.2";
@@ -10,9 +10,9 @@ stdenv.mkDerivation rec {
   };
 
   propagatedBuildInputs = [ dbus-glib telepathy-glib farstream ];
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/telepathy/glib/default.nix b/nixpkgs/pkgs/development/libraries/telepathy/glib/default.nix
index ee2f34776d66..8bb7522b1976 100644
--- a/nixpkgs/pkgs/development/libraries/telepathy/glib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/telepathy/glib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, dbus-glib, glib, python2, pkgconfig, libxslt
+{ lib, stdenv, fetchurl, dbus-glib, glib, python2, pkg-config, libxslt
 , gobject-introspection, vala, glibcLocales }:
 
 stdenv.mkDerivation rec {
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   LC_ALL = "en_US.UTF-8";
   propagatedBuildInputs = [ dbus-glib glib ];
 
-  nativeBuildInputs = [ pkgconfig libxslt gobject-introspection vala ];
+  nativeBuildInputs = [ pkg-config libxslt gobject-introspection vala ];
   buildInputs = [ glibcLocales python2 ];
 
   enableParallelBuilding = true;
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
 
   passthru.python = python2;
 
-  meta = with stdenv.lib; {
+  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
index 2addb86246dd..b606c56445ed 100644
--- a/nixpkgs/pkgs/development/libraries/telepathy/qt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/telepathy/qt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, qtbase, pkgconfig, python3Packages, dbus-glib, dbus
+{ lib, stdenv, fetchurl, cmake, qtbase, pkg-config, python3Packages, dbus-glib, dbus
 , telepathy-farstream, telepathy-glib, fetchpatch }:
 
 let
@@ -11,19 +11,18 @@ in stdenv.mkDerivation rec {
     sha256 = "bf8e2a09060addb80475a4938105b9b41d9e6837999b7a00e5351783857e18ad";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig python ];
+  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 = stdenv.lib.optional (!doCheck) "-DENABLE_TESTS=OFF";
+  cmakeFlags = lib.optional (!doCheck) "-DENABLE_TESTS=OFF";
 
-  enableParallelBuilding = true;
   doCheck = false; # giving up for now
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Telepathy Qt bindings";
     homepage = "https://telepathy.freedesktop.org/components/telepathy-qt/";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/template-glib/default.nix b/nixpkgs/pkgs/development/libraries/template-glib/default.nix
index 385b198a755a..2c89e3f433ab 100644
--- a/nixpkgs/pkgs/development/libraries/template-glib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/template-glib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig, glib, gobject-introspection, flex, bison, vala, gettext, gnome3, gtk-doc, docbook_xsl, docbook_xml_dtd_43 }:
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, glib, gobject-introspection, flex, bison, vala, gettext, gnome3, gtk-doc, docbook_xsl, docbook_xml_dtd_43 }:
 let
   version = "3.34.0";
   pname = "template-glib";
@@ -9,11 +9,11 @@ stdenv.mkDerivation {
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1z9xkin5fyfh071ma9y045jcw83hgx33dfbjraw6cxk0qdmfysr1";
   };
 
-  buildInputs = [ meson ninja pkgconfig gettext flex bison vala glib gtk-doc docbook_xsl docbook_xml_dtd_43 ];
+  buildInputs = [ meson ninja pkg-config gettext flex bison vala glib gtk-doc docbook_xsl docbook_xml_dtd_43 ];
   nativeBuildInputs = [ glib gobject-introspection ];
 
   mesonFlags = [
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
     };
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/tepl/default.nix b/nixpkgs/pkgs/development/libraries/tepl/default.nix
index 77cf9fd0247d..d9d740817355 100644
--- a/nixpkgs/pkgs/development/libraries/tepl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tepl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , meson
 , ninja
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "0x2s0ks575b57jdqnp9r9miz40pm705n2dlj2k8bfj1hyl22kgf6";
   };
 
@@ -48,7 +48,7 @@ stdenv.mkDerivation rec {
 
   passthru.updateScript = gnome3.updateScript { packageName = pname; };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://wiki.gnome.org/Projects/Tepl";
     description = "Text editor product line";
     maintainers = teams.gnome.members ++ [ maintainers.manveru ];
diff --git a/nixpkgs/pkgs/development/libraries/termbox/default.nix b/nixpkgs/pkgs/development/libraries/termbox/default.nix
index 22082f7198f4..e809240bcd10 100644
--- a/nixpkgs/pkgs/development/libraries/termbox/default.nix
+++ b/nixpkgs/pkgs/development/libraries/termbox/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, python3, wafHook, fetchpatch }:
+{ lib, stdenv, fetchFromGitHub, python3, wafHook, fetchpatch }:
 
 stdenv.mkDerivation rec {
   pname = "termbox";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ python3 wafHook ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for writing text-based user interfaces";
     license = licenses.mit;
     homepage = "https://github.com/nsf/termbox#readme";
diff --git a/nixpkgs/pkgs/development/libraries/tevent/default.nix b/nixpkgs/pkgs/development/libraries/tevent/default.nix
index 2d5fd0564bad..568751f48aa3 100644
--- a/nixpkgs/pkgs/development/libraries/tevent/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tevent/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , python3
 , pkg-config
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
     "--builtin-libraries=replace"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "An event system based on the talloc memory management library";
     homepage = "https://tevent.samba.org/";
     license = licenses.lgpl3Plus;
diff --git a/nixpkgs/pkgs/development/libraries/theft/default.nix b/nixpkgs/pkgs/development/libraries/theft/default.nix
index 646cc60406a5..3d39075dd26a 100644
--- a/nixpkgs/pkgs/development/libraries/theft/default.nix
+++ b/nixpkgs/pkgs/development/libraries/theft/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   version = "0.4.5";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
   checkTarget = "test";
-  
+
   installFlags = [ "PREFIX=$(out)" ];
 
   # fix the libtheft.pc file to use the right installation
@@ -26,8 +26,8 @@ stdenv.mkDerivation rec {
     substituteInPlace $out/lib/pkgconfig/libtheft.pc \
       --replace "/usr/local" "$out"
   '';
-  
-  meta = with stdenv.lib; {
+
+  meta = with lib; {
     description = "A C library for property-based testing";
     homepage    = "https://github.com/silentbicycle/theft/";
     platforms   = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/thrift/0.10.nix b/nixpkgs/pkgs/development/libraries/thrift/0.10.nix
index d626673a227a..a735e146214a 100644
--- a/nixpkgs/pkgs/development/libraries/thrift/0.10.nix
+++ b/nixpkgs/pkgs/development/libraries/thrift/0.10.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, boost, zlib, libevent, openssl, python, pkgconfig, bison
+{ lib, stdenv, fetchurl, boost, zlib, libevent, openssl, python, pkg-config, bison
 , flex, twisted
 }:
 
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   # pythonFull.buildEnv.override { extraLibs = [ thrift ]; }
   pythonPath = [];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [
     boost zlib libevent openssl python bison flex twisted
   ];
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
   configureFlags = [ "--enable-tests=no" ];
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for scalable cross-language services";
     homepage = "http://thrift.apache.org/";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/thrift/default.nix b/nixpkgs/pkgs/development/libraries/thrift/default.nix
index f5c8f64633bb..669dff21147e 100644
--- a/nixpkgs/pkgs/development/libraries/thrift/default.nix
+++ b/nixpkgs/pkgs/development/libraries/thrift/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, boost, zlib, libevent, openssl, python, cmake, pkgconfig
+{ lib, stdenv, fetchurl, fetchpatch, boost, zlib, libevent, openssl, python, cmake, pkg-config
 , bison, flex, twisted
 , static ? stdenv.hostPlatform.isStatic
 }:
@@ -25,9 +25,9 @@ stdenv.mkDerivation rec {
   # pythonFull.buildEnv.override { extraLibs = [ thrift ]; }
   pythonPath = [];
 
-  nativeBuildInputs = [ cmake pkgconfig ];
-  buildInputs = [ boost zlib libevent openssl python bison flex ]
-    ++ stdenv.lib.optional (!static) twisted;
+  nativeBuildInputs = [ cmake pkg-config bison flex ];
+  buildInputs = [ boost zlib libevent openssl ]
+    ++ lib.optionals (!static) [ python twisted ];
 
   preConfigure = "export PY_PREFIX=$out";
 
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
     # FIXME: Fails to link in static mode with undefined reference to
     # `boost::unit_test::unit_test_main(bool (*)(), int, char**)'
     "-DBUILD_TESTING:BOOL=${if static then "OFF" else "ON"}"
-  ] ++ stdenv.lib.optionals static [
+  ] ++ lib.optionals static [
     "-DWITH_STATIC_LIB:BOOL=ON"
     "-DOPENSSL_USE_STATIC_LIBS=ON"
   ];
@@ -44,13 +44,13 @@ stdenv.mkDerivation rec {
   checkPhase = ''
     runHook preCheck
 
-    ${stdenv.lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH=$PWD/lib ctest -E PythonTestSSLSocket
+    ${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH=$PWD/lib ctest -E PythonTestSSLSocket
 
     runHook postCheck
   '';
   enableParallelChecking = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for scalable cross-language services";
     homepage = "http://thrift.apache.org/";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/ti-rpc/default.nix b/nixpkgs/pkgs/development/libraries/ti-rpc/default.nix
index 3d163ef6ded6..044c09a5bc48 100644
--- a/nixpkgs/pkgs/development/libraries/ti-rpc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ti-rpc/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, autoreconfHook, libkrb5 }:
+{ fetchurl, lib, stdenv, autoreconfHook, libkrb5 }:
 
 stdenv.mkDerivation rec {
   pname = "libtirpc";
@@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://sourceforge.net/projects/libtirpc/";
     description = "The transport-independent Sun RPC implementation (TI-RPC)";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/ticpp/default.nix b/nixpkgs/pkgs/development/libraries/ticpp/default.nix
index 37b093c8e2ec..20de3d7f2b89 100644
--- a/nixpkgs/pkgs/development/libraries/ticpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ticpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 }:
@@ -28,7 +28,7 @@ stdenv.mkDerivation {
 
   meta = {
     description = "Interface to TinyXML";
-    license = stdenv.lib.licenses.mit;
+    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
index f75b8cb01510..5c0ad8463b4a 100644
--- a/nixpkgs/pkgs/development/libraries/tidyp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tidyp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   name = "tidyp-1.04";
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "format" ];
 
-  meta = with stdenv.lib; {
+  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.linux;
diff --git a/nixpkgs/pkgs/development/libraries/tiledb/default.nix b/nixpkgs/pkgs/development/libraries/tiledb/default.nix
index eb65d07b2837..560a991c44af 100644
--- a/nixpkgs/pkgs/development/libraries/tiledb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tiledb/default.nix
@@ -47,8 +47,6 @@ stdenv.mkDerivation rec {
     gtest
   ];
 
-  enableParallelBuilding = true;
-
   buildInputs = [
     catch2
     zlib
diff --git a/nixpkgs/pkgs/development/libraries/timezonemap/default.nix b/nixpkgs/pkgs/development/libraries/timezonemap/default.nix
index 131d66e45cce..372b0e74b06f 100644
--- a/nixpkgs/pkgs/development/libraries/timezonemap/default.nix
+++ b/nixpkgs/pkgs/development/libraries/timezonemap/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , autoreconfHook
 , fetchbzr
-, pkgconfig
+, pkg-config
 , gtk3
 , glib
 , file
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     autoreconfHook
     gobject-introspection
   ];
@@ -55,7 +55,7 @@ stdenv.mkDerivation rec {
     sed "s|/usr/share/libtimezonemap|$out/share/libtimezonemap|g" -i ./src/tz.h
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://launchpad.net/timezonemap";
     description = "A GTK+3 Timezone Map Widget";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/tinycbor/default.nix b/nixpkgs/pkgs/development/libraries/tinycbor/default.nix
index 62f2a8071852..d03e20cb7e21 100644
--- a/nixpkgs/pkgs/development/libraries/tinycbor/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tinycbor/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "tinycbor";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "prefix=$(out)" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Concise Binary Object Representation (CBOR) Library";
     homepage = "https://github.com/intel/tinycbor";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/tinyobjloader/default.nix b/nixpkgs/pkgs/development/libraries/tinyobjloader/default.nix
index 92eb5b3d8f4b..c7939a6be255 100644
--- a/nixpkgs/pkgs/development/libraries/tinyobjloader/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tinyobjloader/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
 }:
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/tinyobjloader/tinyobjloader";
     description = "Tiny but powerful single file wavefront obj loader";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/tinyxml-2/default.nix b/nixpkgs/pkgs/development/libraries/tinyxml-2/default.nix
index 310b5a447c7a..1e2eea7ac899 100644
--- a/nixpkgs/pkgs/development/libraries/tinyxml-2/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tinyxml-2/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "tinyxml-2";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "A simple, small, efficient, C++ XML parser";
     homepage = "http://www.grinninglizard.com/tinyxml2/index.html";
-    platforms = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.zlib;
+    platforms = lib.platforms.unix;
+    license = lib.licenses.zlib;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2.nix b/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2.nix
index 9c909d5e14d6..e8c5dd1dacdf 100644
--- a/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2.nix
+++ b/nixpkgs/pkgs/development/libraries/tinyxml/2.6.2.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, unzip }:
+{ lib, stdenv, fetchurl, unzip }:
 
 let
   version = "2.6.2";
@@ -13,7 +13,7 @@ in stdenv.mkDerivation {
   };
 
   patches = [
-    # add pkgconfig file
+    # 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
@@ -28,7 +28,7 @@ in stdenv.mkDerivation {
   hardeningDisable = [ "format" ];
 
   NIX_CFLAGS_COMPILE =
-    stdenv.lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.9";
+    lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.9";
 
   nativeBuildInputs = [ unzip ];
   buildPhase = ''
@@ -67,14 +67,14 @@ in stdenv.mkDerivation {
     cp -v tinyxml.pc $out/lib/pkgconfig/
 
     cp -v docs/* $out/share/doc/tinyxml/
-  '' + stdenv.lib.optionalString stdenv.isDarwin ''
+  '' + 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 = stdenv.lib.licenses.free;
-    platforms = stdenv.lib.platforms.unix;
+    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
index f0b460b6f3dc..e0f91330efca 100644
--- a/nixpkgs/pkgs/development/libraries/tix/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tix/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, tcl, tk, fetchpatch } :
+{ lib, stdenv, fetchurl, tcl, tk, fetchpatch } :
 
 stdenv.mkDerivation {
   version = "8.4.3";
@@ -7,13 +7,13 @@ stdenv.mkDerivation {
      url = "mirror://sourceforge/tix/tix/8.4.3/Tix8.4.3-src.tar.gz";
      sha256 = "1jq3dkyk9mqkj4cg7mdk5r0cclqsby9l2b7wrysi0zk5yw7h8bsn";
   };
-  patches = [ 
+  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";
     })
-  ] ++ stdenv.lib.optional (tcl.release == "8.6")
+  ] ++ 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";
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
   buildInputs = [ tcl 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 
+  # 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 = ''
@@ -42,7 +42,7 @@ stdenv.mkDerivation {
     "--libdir=\${prefix}/lib"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A widget library for Tcl/Tk";
     homepage    = "http://tix.sourceforge.net/";
     platforms   = platforms.all;
diff --git a/nixpkgs/pkgs/development/libraries/tk/8.6.nix b/nixpkgs/pkgs/development/libraries/tk/8.6.nix
index c30f9a819478..fdffbeba2c93 100644
--- a/nixpkgs/pkgs/development/libraries/tk/8.6.nix
+++ b/nixpkgs/pkgs/development/libraries/tk/8.6.nix
@@ -1,4 +1,4 @@
-{ callPackage, fetchurl, tcl, stdenv, ... } @ args:
+{ callPackage, fetchurl, tcl, lib, stdenv, ... } @ args:
 
 callPackage ./generic.nix (args // {
 
@@ -7,6 +7,6 @@ callPackage ./generic.nix (args // {
     sha256 = "1d7bfkxpacy33w5nahf73lkwxqpff44w1jplg7i2gmwgiaawvjwg";
   };
 
-  patches = [ ./different-prefix-with-tcl.patch ] ++ stdenv.lib.optionals stdenv.isDarwin [ ./Fix-bad-install_name-for-libtk8.6.dylib.patch ];
+  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/generic.nix b/nixpkgs/pkgs/development/libraries/tk/generic.nix
index 1cbf4026cb88..57dc3dac2d09 100644
--- a/nixpkgs/pkgs/development/libraries/tk/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/tk/generic.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, src, pkgconfig, tcl, libXft, patches ? []
+{ stdenv, lib, src, pkg-config, tcl, libXft, patches ? []
 , enableAqua ? stdenv.isDarwin, darwin
 , ... }:
 
@@ -21,17 +21,17 @@ stdenv.mkDerivation {
     cp ../{unix,generic}/*.h $out/include
     ln -s $out/lib/libtk${tcl.release}${stdenv.hostPlatform.extensions.sharedLibrary} $out/lib/libtk${stdenv.hostPlatform.extensions.sharedLibrary}
   ''
-  + stdenv.lib.optionalString (stdenv.isDarwin) ''
+  + lib.optionalString (stdenv.isDarwin) ''
     cp ../macosx/*.h $out/include
   '';
 
   configureFlags = [
     "--enable-threads"
     "--with-tcl=${tcl}/lib"
-  ] ++ stdenv.lib.optional stdenv.is64bit "--enable-64bit"
-    ++ stdenv.lib.optional enableAqua "--enable-aqua";
+  ] ++ lib.optional stdenv.is64bit "--enable-64bit"
+    ++ lib.optional enableAqua "--enable-aqua";
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = lib.optional enableAqua (with darwin.apple_sdk.frameworks; [ Cocoa ]);
 
   propagatedBuildInputs = [ tcl libXft ];
@@ -46,7 +46,7 @@ stdenv.mkDerivation {
     libdir = "lib/${libPrefix}";
   };
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/tl-expected/default.nix b/nixpkgs/pkgs/development/libraries/tl-expected/default.nix
index e91c42c884cb..4915fd7e700d 100644
--- a/nixpkgs/pkgs/development/libraries/tl-expected/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tl-expected/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "tl-expected-unstable";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/tnt/default.nix b/nixpkgs/pkgs/development/libraries/tnt/default.nix
index 7e8aa2983cfd..932239a485fd 100644
--- a/nixpkgs/pkgs/development/libraries/tnt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tnt/default.nix
@@ -1,9 +1,9 @@
-{stdenv, fetchurl, unzip}:
+{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";
@@ -19,7 +19,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://math.nist.gov/tnt/";
     description = "Template Numerical Toolkit: C++ headers for array and matrices";
-    license = stdenv.lib.licenses.publicDomain;
-    platforms = stdenv.lib.platforms.unix;
+    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
index ff14c8c3305e..a21a71b89bfd 100644
--- a/nixpkgs/pkgs/development/libraries/tntdb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tntdb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cxxtools, postgresql, libmysqlclient, sqlite, zlib, openssl }:
+{ lib, stdenv, fetchurl, cxxtools, postgresql, libmysqlclient, sqlite, zlib, openssl }:
 
 stdenv.mkDerivation rec {
   pname = "tntdb";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.tntnet.org/tntdb.html";
     description = "C++ library which makes accessing SQL databases easy and robust";
     platforms = platforms.linux ;
diff --git a/nixpkgs/pkgs/development/libraries/tntnet/default.nix b/nixpkgs/pkgs/development/libraries/tntnet/default.nix
index 332750d7694c..a80b923e2358 100644
--- a/nixpkgs/pkgs/development/libraries/tntnet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tntnet/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cxxtools, zlib, openssl, zip }:
+{ lib, stdenv, fetchurl, cxxtools, zlib, openssl, zip }:
 
 stdenv.mkDerivation rec {
   pname = "tntnet";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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 ;
diff --git a/nixpkgs/pkgs/development/libraries/tokyo-cabinet/default.nix b/nixpkgs/pkgs/development/libraries/tokyo-cabinet/default.nix
index b8969588b3c5..22d3266b93a6 100644
--- a/nixpkgs/pkgs/development/libraries/tokyo-cabinet/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tokyo-cabinet/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, zlib, bzip2 }:
+{ fetchurl, lib, stdenv, zlib, bzip2 }:
 
 stdenv.mkDerivation rec {
   name = "tokyocabinet-1.4.48";
@@ -35,9 +35,9 @@ stdenv.mkDerivation rec {
          robustness, supports 64-bit architecture.
       '';
 
-    license = stdenv.lib.licenses.lgpl2Plus;
+    license = lib.licenses.lgpl2Plus;
 
     maintainers = [ ];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/tokyo-tyrant/default.nix b/nixpkgs/pkgs/development/libraries/tokyo-tyrant/default.nix
index 5b58bf416724..6431e6a1a7a5 100644
--- a/nixpkgs/pkgs/development/libraries/tokyo-tyrant/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tokyo-tyrant/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl, stdenv, tokyocabinet, pkgconfig }:
+{ fetchurl, lib, stdenv, tokyocabinet, pkg-config }:
 
 stdenv.mkDerivation rec {
   name = "tokyotyrant-1.1.41";
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "13xqcinhydqmh7231qlir6pymacjwcf98drybkhd9597kzxp1bs2";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ tokyocabinet ];
 
   doCheck = false;                                # FIXME
@@ -33,9 +33,9 @@ stdenv.mkDerivation rec {
 
     homepage = "https://fallabs.com/tokyotyrant/";
 
-    license = stdenv.lib.licenses.lgpl21Plus;
+    license = lib.licenses.lgpl21Plus;
 
-    platforms = stdenv.lib.platforms.gnu ++ stdenv.lib.platforms.linux;         # arbitrary choice
+    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
index 266538d43c25..c93ec8dccf9b 100644
--- a/nixpkgs/pkgs/development/libraries/totem-pl-parser/default.nix
+++ b/nixpkgs/pkgs/development/libraries/totem-pl-parser/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchurl, meson, ninja, pkgconfig, gettext, libxml2, gobject-introspection, gnome3 }:
+{ lib, stdenv, fetchurl, meson, ninja, pkg-config, gettext, libxml2, gobject-introspection, gnome3 }:
 
 stdenv.mkDerivation rec {
   pname = "totem-pl-parser";
   version = "3.26.5";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "132jihnf51zs98yjkc6jxyqib4f3dawpjm17g4bj4j78y93dww2k";
   };
 
@@ -15,10 +15,10 @@ stdenv.mkDerivation rec {
     };
   };
 
-  nativeBuildInputs = [ meson ninja pkgconfig gettext gobject-introspection ];
+  nativeBuildInputs = [ meson ninja pkg-config gettext gobject-introspection ];
   buildInputs = [ libxml2 ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/tracker-miners/default.nix b/nixpkgs/pkgs/development/libraries/tracker-miners/default.nix
index 0670fdcdbd15..2ca5dd6bd93a 100644
--- a/nixpkgs/pkgs/development/libraries/tracker-miners/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tracker-miners/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , substituteAll
 , asciidoc
@@ -11,7 +11,7 @@
 , tracker
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , vala
 , wrapGAppsHook
 , bzip2
@@ -51,7 +51,7 @@ stdenv.mkDerivation rec {
   version = "3.0.1";
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1kfi5d6pccqx28hbnja6k1mpwjd53k5zs704sg01rlzmbshz1zn6";
   };
 
@@ -64,7 +64,7 @@ stdenv.mkDerivation rec {
     libxslt
     meson
     ninja
-    pkgconfig
+    pkg-config
     vala
     wrapGAppsHook
   ];
@@ -128,7 +128,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://wiki.gnome.org/Projects/Tracker";
     description = "Desktop-neutral user information store, search tool and indexer";
     maintainers = teams.gnome.members;
diff --git a/nixpkgs/pkgs/development/libraries/tracker/default.nix b/nixpkgs/pkgs/development/libraries/tracker/default.nix
index e37db9f25330..38885048fcc5 100644
--- a/nixpkgs/pkgs/development/libraries/tracker/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tracker/default.nix
@@ -1,10 +1,10 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , fetchpatch
 , gettext
 , meson
 , ninja
-, pkgconfig
+, pkg-config
 , asciidoc
 , gobject-introspection
 , python3
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" "devdoc" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "1rhcs75axga7p7hl37h6jzb2az89jddlcwc7ykrnb2khyhka78rr";
   };
 
@@ -57,7 +57,7 @@ stdenv.mkDerivation rec {
     meson
     ninja
     vala
-    pkgconfig
+    pkg-config
     asciidoc
     gettext
     libxslt
@@ -68,7 +68,7 @@ stdenv.mkDerivation rec {
     docbook_xml_dtd_45
     python3 # for data-generators
     systemd # used for checks to install systemd user service
-    dbus # used for checks and pkgconfig to install dbus service/s
+    dbus # used for checks and pkg-config to install dbus service/s
   ];
 
   buildInputs = [
@@ -133,7 +133,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://wiki.gnome.org/Projects/Tracker";
     description = "Desktop-neutral user information store, search tool and indexer";
     maintainers = teams.gnome.members;
diff --git a/nixpkgs/pkgs/development/libraries/tre/default.nix b/nixpkgs/pkgs/development/libraries/tre/default.nix
index 80806848846f..e515dd1673fa 100644
--- a/nixpkgs/pkgs/development/libraries/tre/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tre/default.nix
@@ -1,4 +1,4 @@
-{stdenv, fetchurl, fetchpatch}:
+{lib, stdenv, fetchurl, fetchpatch}:
 
 stdenv.mkDerivation rec {
   name = "tre-0.8.0";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "Lightweight and robust POSIX compliant regexp matching library";
     homepage = "https://laurikari.net/tre/";
-    platforms = stdenv.lib.platforms.unix;
-    license = stdenv.lib.licenses.bsd2;
+    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
index 722094f859c5..16e1a78d396e 100644
--- a/nixpkgs/pkgs/development/libraries/tremor/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tremor/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitLab, autoreconfHook, pkgconfig, libogg }:
+{ lib, stdenv, fetchFromGitLab, autoreconfHook, pkg-config, libogg }:
 
 stdenv.mkDerivation {
   name = "tremor-unstable-2018-03-16";
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   propagatedBuildInputs = [ libogg ];
 
   preConfigure = ''
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://xiph.org/tremor/";
     description = "Fixed-point version of the Ogg Vorbis decoder";
-    license = stdenv.lib.licenses.bsd3;
-    platforms = stdenv.lib.platforms.unix;
+    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
index 929627f3e1bf..800b35640111 100644
--- a/nixpkgs/pkgs/development/libraries/trompeloeil/default.nix
+++ b/nixpkgs/pkgs/development/libraries/trompeloeil/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "trompeloeil";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Header only C++14 mocking framework";
     homepage = "https://github.com/rollbear/trompeloeil";
     license = licenses.boost;
diff --git a/nixpkgs/pkgs/development/libraries/tsocks/default.nix b/nixpkgs/pkgs/development/libraries/tsocks/default.nix
index f2018286a3ea..728c6e71f7fb 100644
--- a/nixpkgs/pkgs/development/libraries/tsocks/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tsocks/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "tsocks";
@@ -25,10 +25,10 @@ stdenv.mkDerivation rec {
       -e "/SAVE/d" Makefile
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Transparent SOCKS v4 proxying library";
     homepage = "http://tsocks.sourceforge.net/";
-    license = stdenv.lib.licenses.gpl2;
+    license = lib.licenses.gpl2;
     maintainers = with maintainers; [ edwtjo phreedom ];
     platforms = platforms.unix;
     broken = stdenv.hostPlatform.isDarwin;
diff --git a/nixpkgs/pkgs/development/libraries/tweeny/default.nix b/nixpkgs/pkgs/development/libraries/tweeny/default.nix
index f2de470288de..8340e47fbf9b 100644
--- a/nixpkgs/pkgs/development/libraries/tweeny/default.nix
+++ b/nixpkgs/pkgs/development/libraries/tweeny/default.nix
@@ -1,4 +1,5 @@
 { stdenv
+, lib
 , fetchFromGitHub
 , cmake
 }:
@@ -20,7 +21,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A modern C++ tweening library";
     license = licenses.mit;
     homepage = "http://mobius3.github.io/tweeny";
diff --git a/nixpkgs/pkgs/development/libraries/twolame/default.nix b/nixpkgs/pkgs/development/libraries/twolame/default.nix
index cb8ee14535dc..3537dd3029b6 100644
--- a/nixpkgs/pkgs/development/libraries/twolame/default.nix
+++ b/nixpkgs/pkgs/development/libraries/twolame/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchFromGitHub
-, autoreconfHook, pkgconfig
+{ lib, stdenv, fetchFromGitHub
+, autoreconfHook, pkg-config
 , libsndfile }:
 
 stdenv.mkDerivation {
@@ -14,12 +14,12 @@ stdenv.mkDerivation {
     sha256 = "1rq3yc8ygzdqid9zk6pixmm4w9sk2vrlx217lhn5bjaglv7iyf7x";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
   buildInputs = [ libsndfile ];
 
   doCheck = false; # fails with "../build-scripts/test-driver: line 107: -Mstrict: command not found"
 
-  meta = with stdenv.lib;{
+  meta = with lib;{
     description = "A MP2 encoder";
     longDescription = ''
       TwoLAME is an optimised MPEG Audio Layer 2 (MP2) encoder based on
diff --git a/nixpkgs/pkgs/development/libraries/ubus/default.nix b/nixpkgs/pkgs/development/libraries/ubus/default.nix
index 1f7124411ac3..db947d373a2d 100644
--- a/nixpkgs/pkgs/development/libraries/ubus/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ubus/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, fetchgit, libubox, libjson }:
+{ lib, stdenv, cmake, fetchgit, libubox, libjson }:
 
 stdenv.mkDerivation {
   pname = "ubus";
@@ -14,7 +14,7 @@ stdenv.mkDerivation {
   buildInputs = [ libubox libjson ];
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "OpenWrt system message/RPC bus";
     homepage = "https://git.openwrt.org/?p=project/ubus.git;a=summary";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/uci/default.nix b/nixpkgs/pkgs/development/libraries/uci/default.nix
index aa2a88653bb3..0a5af8b907b8 100644
--- a/nixpkgs/pkgs/development/libraries/uci/default.nix
+++ b/nixpkgs/pkgs/development/libraries/uci/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, cmake, fetchgit, pkgconfig, libubox }:
+{ lib, stdenv, cmake, fetchgit, pkg-config, libubox }:
 
 stdenv.mkDerivation {
   pname = "uci";
@@ -13,9 +13,9 @@ stdenv.mkDerivation {
   hardeningDisable = [ "all" ];
   cmakeFlags = [ "-D BUILD_LUA:BOOL=OFF" ];
   buildInputs = [ libubox ];
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "OpenWrt Unified Configuration Interface";
     homepage = "https://git.openwrt.org/?p=project/uci.git;a=summary";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/ucl/default.nix b/nixpkgs/pkgs/development/libraries/ucl/default.nix
index f25a63137526..43f7ddf63af9 100644
--- a/nixpkgs/pkgs/development/libraries/ucl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ucl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   name = "ucl-1.03";
@@ -8,12 +8,12 @@ stdenv.mkDerivation {
   };
 
   # needed to successfully compile with gcc 6
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-std=c90";
+  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 = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.unix;
+    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
index 1c20ce6d9c83..7cfd9f1edf5c 100644
--- a/nixpkgs/pkgs/development/libraries/ucommon/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ucommon/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig
+{ lib, stdenv, fetchurl, pkg-config
 , openssl ? null, zlib ? null, gnutls ? null
 }:
 
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     sha256 = "6ac9f76c2af010f97e916e4bae1cece341dc64ca28e3881ff4ddc3bc334060d7";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   # disable flaky networking test
   postPatch = ''
@@ -33,9 +33,9 @@ stdenv.mkDerivation rec {
   meta = {
     description = "C++ library to facilitate using C++ design patterns";
     homepage = "https://www.gnu.org/software/commoncpp/";
-    license = stdenv.lib.licenses.lgpl3Plus;
+    license = lib.licenses.lgpl3Plus;
 
-    maintainers = with stdenv.lib.maintainers; [ ];
-    platforms = stdenv.lib.platforms.linux;
+    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
index a4120b7ba43b..fae81276878e 100644
--- a/nixpkgs/pkgs/development/libraries/ucx/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ucx/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, doxygen
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, doxygen
 , numactl, rdma-core, libbfd, libiberty, perl, zlib
 }:
 
@@ -29,7 +29,7 @@ in stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Unified Communication X library";
     homepage = "http://www.openucx.org";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/udns/default.nix b/nixpkgs/pkgs/development/libraries/udns/default.nix
index 41fb6e7abff6..fc0b4a42b55d 100644
--- a/nixpkgs/pkgs/development/libraries/udns/default.nix
+++ b/nixpkgs/pkgs/development/libraries/udns/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 # this expression is mostly based on debian's packaging
 # https://tracker.debian.org/media/packages/u/udns/rules-0.4-1
@@ -35,7 +35,7 @@ stdenv.mkDerivation rec {
   # keep man3
   outputDevdoc = "out";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.corpit.ru/mjt/udns.html";
     description = "Async-capable DNS stub resolver library";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/udunits/default.nix b/nixpkgs/pkgs/development/libraries/udunits/default.nix
index 65e88f8fd8c1..deed5b64d2c5 100644
--- a/nixpkgs/pkgs/development/libraries/udunits/default.nix
+++ b/nixpkgs/pkgs/development/libraries/udunits/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchFromGitHub, autoreconfHook,
+{ lib, stdenv, fetchFromGitHub, autoreconfHook,
   texinfo, bison, flex, expat, file
 }:
 
 stdenv.mkDerivation rec {
   pname = "udunits";
   version = "2.2.27.6";
-  
+
   src = fetchFromGitHub {
     owner = "Unidata";
     repo = "UDUNITS-2";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoreconfHook texinfo bison flex file ];
   buildInputs = [ expat ];
 
-  meta = with stdenv.lib; {
+  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";
     license = licenses.bsdOriginal;
diff --git a/nixpkgs/pkgs/development/libraries/uhttpmock/default.nix b/nixpkgs/pkgs/development/libraries/uhttpmock/default.nix
index 085741a66f88..5420eb204e3d 100644
--- a/nixpkgs/pkgs/development/libraries/uhttpmock/default.nix
+++ b/nixpkgs/pkgs/development/libraries/uhttpmock/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitLab, autoconf, gtk-doc, automake, libtool, pkgconfig, glib, libsoup, gobject-introspection }:
+{ stdenv, lib, fetchFromGitLab, autoconf, gtk-doc, automake, libtool, pkg-config, glib, libsoup, gobject-introspection }:
 
 stdenv.mkDerivation rec {
   version="0.5.0";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "0kkf670abkq5ikm3mqls475lydfsd9by1kv5im4k757xrl1br1d4";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ autoconf gtk-doc automake libtool glib libsoup gobject-introspection ];
 
   preConfigure = "./autogen.sh";
diff --git a/nixpkgs/pkgs/development/libraries/uid_wrapper/default.nix b/nixpkgs/pkgs/development/libraries/uid_wrapper/default.nix
index e78e72bf9b87..ec7626a7e8bc 100644
--- a/nixpkgs/pkgs/development/libraries/uid_wrapper/default.nix
+++ b/nixpkgs/pkgs/development/libraries/uid_wrapper/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, pkgconfig }:
+{ lib, stdenv, fetchurl, cmake, pkg-config }:
 
 stdenv.mkDerivation rec {
   name = "uid_wrapper-1.2.8";
@@ -8,9 +8,9 @@ stdenv.mkDerivation rec {
     sha256 = "0swm9d8l69dw7nbrw6xh7rdy7cfrqflw3hxshicsrhd9v03iwvqf";
   };
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/umockdev/default.nix b/nixpkgs/pkgs/development/libraries/umockdev/default.nix
index 5050650635f4..d27adb2a061d 100644
--- a/nixpkgs/pkgs/development/libraries/umockdev/default.nix
+++ b/nixpkgs/pkgs/development/libraries/umockdev/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , docbook_xsl
 , fetchurl
 , glib
@@ -53,7 +53,7 @@ stdenv.mkDerivation rec {
     mv docs/reference $doc/share/doc/umockdev/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Mock hardware devices for creating unit tests";
     license = licenses.lgpl2;
     maintainers = with maintainers; [ flokli ];
diff --git a/nixpkgs/pkgs/development/libraries/unibilium/default.nix b/nixpkgs/pkgs/development/libraries/unibilium/default.nix
index dca24c7f9ea5..f5fd4f82bae2 100644
--- a/nixpkgs/pkgs/development/libraries/unibilium/default.nix
+++ b/nixpkgs/pkgs/development/libraries/unibilium/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchFromGitHub, libtool, pkgconfig, perl, ncurses }:
+{ stdenv, lib, fetchFromGitHub, libtool, pkg-config, perl, ncurses }:
 
 stdenv.mkDerivation rec {
   pname = "unibilium-unstable";
@@ -13,9 +13,9 @@ stdenv.mkDerivation rec {
   };
 
   makeFlags = [ "PREFIX=$(out)" ]
-    ++ stdenv.lib.optional stdenv.isDarwin "LIBTOOL=${libtool}/bin/libtool";
+    ++ lib.optional stdenv.isDarwin "LIBTOOL=${libtool}/bin/libtool";
 
-  nativeBuildInputs = [ pkgconfig perl ];
+  nativeBuildInputs = [ pkg-config perl ];
   buildInputs = [ libtool ncurses ];
 
   meta = with lib; {
diff --git a/nixpkgs/pkgs/development/libraries/unicap/default.nix b/nixpkgs/pkgs/development/libraries/unicap/default.nix
index 87ca28fee983..17e91f7e2365 100644
--- a/nixpkgs/pkgs/development/libraries/unicap/default.nix
+++ b/nixpkgs/pkgs/development/libraries/unicap/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libusb-compat-0_1, libraw1394, dcraw, intltool, perl, v4l-utils }:
+{ lib, stdenv, fetchurl, libusb-compat-0_1, libraw1394, dcraw, intltool, perl, v4l-utils }:
 
 stdenv.mkDerivation rec {
   pname = "libunicap";
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
     sed -e 's@/etc/udev@'"$out"'/&@' -i data/Makefile.*
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Universal video capture API";
     homepage = "http://www.unicap-imaging.org/";
     maintainers = [ maintainers.raskin ];
diff --git a/nixpkgs/pkgs/development/libraries/unicorn/default.nix b/nixpkgs/pkgs/development/libraries/unicorn/default.nix
index cea35519ad87..7f768d9631bb 100644
--- a/nixpkgs/pkgs/development/libraries/unicorn/default.nix
+++ b/nixpkgs/pkgs/development/libraries/unicorn/default.nix
@@ -1,6 +1,6 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
-, pkgconfig
+, pkg-config
 , cmake
 }:
 
@@ -15,9 +15,9 @@ stdenv.mkDerivation rec {
     sha256 = "0jgnyaq6ykpbg5hrwc0p3pargmr9hpzqfsj6ymp4k07pxnqal76j";
   };
 
-  nativeBuildInputs = [ pkgconfig cmake ];
+  nativeBuildInputs = [ pkg-config cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Lightweight multi-platform CPU emulator library";
     homepage = "http://www.unicorn-engine.org";
     license = licenses.gpl2Only;
diff --git a/nixpkgs/pkgs/development/libraries/unittest-cpp/default.nix b/nixpkgs/pkgs/development/libraries/unittest-cpp/default.nix
index 7dd8e071567a..d185d32c816f 100644
--- a/nixpkgs/pkgs/development/libraries/unittest-cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/unittest-cpp/default.nix
@@ -1,6 +1,6 @@
-{stdenv, fetchFromGitHub, cmake}:
+{lib, stdenv, fetchFromGitHub, cmake}:
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "unittest-cpp";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "0sxb3835nly1jxn071f59fwbdzmqi74j040r81fanxyw3s1azw0i";
   };
 
-  buildInputs = [cmake];
+  nativeBuildInputs = [ cmake ];
 
   doCheck = false;
 
@@ -22,6 +22,6 @@ stdenv.mkDerivation rec {
     description = "Lightweight unit testing framework for C++";
     license = licenses.mit;
     maintainers = [];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/unixODBC/default.nix b/nixpkgs/pkgs/development/libraries/unixODBC/default.nix
index a4fcac2a3580..8b2558c08504 100644
--- a/nixpkgs/pkgs/development/libraries/unixODBC/default.nix
+++ b/nixpkgs/pkgs/development/libraries/unixODBC/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "unixODBC";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--disable-gui" "--sysconfdir=/etc" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "ODBC driver manager for Unix";
     homepage = "http://www.unixodbc.org/";
     license = licenses.lgpl2;
diff --git a/nixpkgs/pkgs/development/libraries/unixODBCDrivers/default.nix b/nixpkgs/pkgs/development/libraries/unixODBCDrivers/default.nix
index 04aa7e6c6854..edbe51998c3e 100644
--- a/nixpkgs/pkgs/development/libraries/unixODBCDrivers/default.nix
+++ b/nixpkgs/pkgs/development/libraries/unixODBCDrivers/default.nix
@@ -19,7 +19,7 @@
       driver = "lib/psqlodbcw.so";
     };
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       description = "Official PostgreSQL ODBC Driver";
       homepage =  "https://odbc.postgresql.org/";
       license = licenses.lgpl2;
@@ -60,7 +60,7 @@
       driver = if stdenv.isDarwin then "lib/libmaodbc.dylib" else "lib/libmaodbc.so";
     };
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       description = "MariaDB ODBC database driver";
       homepage =  "https://downloads.mariadb.org/connector-odbc/";
       license = licenses.gpl2;
@@ -88,7 +88,7 @@
       driver = "lib/libmyodbc3-3.51.12.so";
     };
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       description = "MariaDB ODBC database driver";
       homepage = "https://dev.mysql.com/downloads/connector/odbc/";
       license = licenses.gpl2;
@@ -123,7 +123,7 @@
       driver = "lib/libsqlite3odbc.so";
     };
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       description = "ODBC driver for SQLite";
       homepage = "http://www.ch-werner.de/sqliteodbc";
       license = licenses.bsd2;
@@ -166,7 +166,7 @@
       driver = "lib/libmsodbcsql-${versionMajor}.${versionMinor}.so.${versionAdditional}";
     };
 
-    meta = with stdenv.lib; {
+    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;
diff --git a/nixpkgs/pkgs/development/libraries/unqlite/default.nix b/nixpkgs/pkgs/development/libraries/unqlite/default.nix
index 9d0ab3868565..c0e405c8849c 100644
--- a/nixpkgs/pkgs/development/libraries/unqlite/default.nix
+++ b/nixpkgs/pkgs/development/libraries/unqlite/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake }:
 
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://unqlite.org/";
     description = "Self-contained, serverless, zero-conf, transactional NoSQL DB library";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/uri/default.nix b/nixpkgs/pkgs/development/libraries/uri/default.nix
index c96629072f99..48a80aacdf59 100644
--- a/nixpkgs/pkgs/development/libraries/uri/default.nix
+++ b/nixpkgs/pkgs/development/libraries/uri/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, doxygen }:
+{ lib, stdenv, fetchFromGitHub, cmake, doxygen }:
 
 stdenv.mkDerivation rec {
   name = "uri-${version}";
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
   meta = {
     description = "C++ URI library";
     homepage = "https://cpp-netlib.org";
-    license = stdenv.lib.licenses.boost;
-    platforms = stdenv.lib.platforms.all;
+    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
index a12f040bf49c..ad1719984807 100644
--- a/nixpkgs/pkgs/development/libraries/uriparser/default.nix
+++ b/nixpkgs/pkgs/development/libraries/uriparser/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   checkInputs = [ gtest ];
   doCheck = stdenv.targetPlatform.system == stdenv.hostPlatform.system;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://uriparser.github.io/";
     description = "Strictly RFC 3986 compliant URI parsing library";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/usbredir/default.nix b/nixpkgs/pkgs/development/libraries/usbredir/default.nix
index 2ac7c823e22a..0313b8c81ef2 100644
--- a/nixpkgs/pkgs/development/libraries/usbredir/default.nix
+++ b/nixpkgs/pkgs/development/libraries/usbredir/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, libusb1 }:
+{ lib, stdenv, fetchurl, pkg-config, libusb1 }:
 
 stdenv.mkDerivation rec {
   pname = "usbredir";
@@ -11,12 +11,12 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = "-Wno-error";
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   propagatedBuildInputs = [ libusb1 ];
 
   outputs = [ "out" "dev" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "USB traffic redirection protocol";
     homepage = "https://www.spice-space.org/usbredir.html";
     license = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/ustr/default.nix b/nixpkgs/pkgs/development/libraries/ustr/default.nix
index b6bb02d56e44..2b04d8c0c5b7 100644
--- a/nixpkgs/pkgs/development/libraries/ustr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/ustr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "ustr";
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
     find $out/lib -name \*debug\* -delete
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.and.org/ustr/";
     description = "Micro String API for C language";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/utf8cpp/default.nix b/nixpkgs/pkgs/development/libraries/utf8cpp/default.nix
index ef02ca2c3134..e627b97849a0 100644
--- a/nixpkgs/pkgs/development/libraries/utf8cpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/utf8cpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "utf8cpp";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/nemtrif/utfcpp";
     description = "UTF-8 with C++ in a Portable Way";
     license = licenses.free;
diff --git a/nixpkgs/pkgs/development/libraries/utf8proc/default.nix b/nixpkgs/pkgs/development/libraries/utf8proc/default.nix
index ea455e2c92c1..b78999e96a76 100644
--- a/nixpkgs/pkgs/development/libraries/utf8proc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/utf8proc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "utf8proc";
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A clean C library for processing UTF-8 Unicode data";
     homepage = "https://juliastrings.github.io/utf8proc/";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/uthash/default.nix b/nixpkgs/pkgs/development/libraries/uthash/default.nix
index d2c5b6ab11d6..7ddae062f766 100644
--- a/nixpkgs/pkgs/development/libraries/uthash/default.nix
+++ b/nixpkgs/pkgs/development/libraries/uthash/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, perl }:
+{ lib, stdenv, fetchurl, perl }:
 
 let
   version = "2.1.0";
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
     cp ./src/* "$out/include/"
   '';
 
-  meta = with stdenv.lib; {
+  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
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
index 16b4cd563b2b..107c23dcb59b 100644
--- a/nixpkgs/pkgs/development/libraries/utmps/default.nix
+++ b/nixpkgs/pkgs/development/libraries/utmps/default.nix
@@ -4,8 +4,8 @@ with skawarePackages;
 
 buildPackage {
   pname = "utmps";
-  version = "0.0.3.2";
-  sha256 = "0zri5pqnva48bm8za4ic5mx0ymv70y4ga16bjh4i5pscs40sj5dh";
+  version = "0.1.0.0";
+  sha256 = "09p0k2sgxr7jlsbrn66fzvzf9zxvpjp85y79xk10hxjglypszyml";
 
   description = "A secure utmpx and wtmp implementation";
 
diff --git a/nixpkgs/pkgs/development/libraries/v8/5_x.nix b/nixpkgs/pkgs/development/libraries/v8/5_x.nix
index 050abe9e81bf..441a5559b527 100644
--- a/nixpkgs/pkgs/development/libraries/v8/5_x.nix
+++ b/nixpkgs/pkgs/development/libraries/v8/5_x.nix
@@ -151,11 +151,11 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ which ];
   buildInputs = [ readline python icu ]
-    ++ stdenv.lib.optional stdenv.isDarwin xcbuild
-    ++ stdenv.lib.optional stdenv.isLinux patchelf;
+    ++ lib.optional stdenv.isDarwin xcbuild
+    ++ lib.optional stdenv.isLinux patchelf;
 
   NIX_CFLAGS_COMPILE = "-Wno-error=strict-overflow -Wno-error=unused-function -Wno-error=attributes"
-    + stdenv.lib.optionalString stdenv.cc.isClang " -Wno-error=unused-lambda-capture";
+    + lib.optionalString stdenv.cc.isClang " -Wno-error=unused-lambda-capture";
 
   buildFlags = [
     "LINK=c++"
diff --git a/nixpkgs/pkgs/development/libraries/v8/default.nix b/nixpkgs/pkgs/development/libraries/v8/default.nix
index e6696626cb5d..c79073f04e4c 100644
--- a/nixpkgs/pkgs/development/libraries/v8/default.nix
+++ b/nixpkgs/pkgs/development/libraries/v8/default.nix
@@ -1,5 +1,5 @@
 { stdenv, lib, fetchgit, fetchFromGitHub
-, gn, ninja, python, glib, pkgconfig, icu
+, gn, ninja, python, glib, pkg-config, icu
 , xcbuild, darwin
 , fetchpatch
 }:
@@ -73,7 +73,7 @@ stdenv.mkDerivation rec {
     chmod u+w -R .
   '';
 
-  postPatch = stdenv.lib.optionalString stdenv.isAarch64 ''
+  postPatch = lib.optionalString stdenv.isAarch64 ''
     substituteInPlace build/toolchain/linux/BUILD.gn \
       --replace 'toolprefix = "aarch64-linux-gnu-"' 'toolprefix = ""'
   '';
@@ -95,14 +95,14 @@ stdenv.mkDerivation rec {
     # ''custom_toolchain="//build/toolchain/linux/unbundle:default"''
     ''host_toolchain="//build/toolchain/linux/unbundle:default"''
     ''v8_snapshot_toolchain="//build/toolchain/linux/unbundle:default"''
-  ] ++ stdenv.lib.optional stdenv.cc.isClang ''clang_base_path="${stdenv.cc}"'';
+  ] ++ lib.optional stdenv.cc.isClang ''clang_base_path="${stdenv.cc}"'';
 
   # with gcc8, -Wclass-memaccess became part of -Wall and causes logging limit
   # to be exceeded
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-class-memaccess";
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isGNU "-Wno-class-memaccess";
 
-  nativeBuildInputs = [ gn ninja pkgconfig python ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ xcbuild darwin.DarwinTools ];
+  nativeBuildInputs = [ gn ninja pkg-config python ]
+    ++ lib.optionals stdenv.isDarwin [ xcbuild darwin.DarwinTools ];
   buildInputs = [ glib icu ];
 
   ninjaFlags = [ ":d8" "v8_monolith" ];
diff --git a/nixpkgs/pkgs/development/libraries/v8/plv8_6_x.nix b/nixpkgs/pkgs/development/libraries/v8/plv8_6_x.nix
index 782d324c8be0..71e14a82c3e5 100644
--- a/nixpkgs/pkgs/development/libraries/v8/plv8_6_x.nix
+++ b/nixpkgs/pkgs/development/libraries/v8/plv8_6_x.nix
@@ -4,7 +4,7 @@
 # 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, pkgconfig
+{ stdenv, lib, fetchgit, fetchFromGitHub, gn, ninja, python, glib, pkg-config
 , doCheck ? false
 , snapshot ? true
 }:
@@ -158,7 +158,7 @@ stdenv.mkDerivation rec {
         use_custom_libcxx_for_host=false
   '';
 
-  nativeBuildInputs = [ gn ninja pkgconfig ];
+  nativeBuildInputs = [ gn ninja pkg-config ];
   buildInputs = [ python glib ];
 
   buildPhase = ''
diff --git a/nixpkgs/pkgs/development/libraries/vaapi-intel-hybrid/default.nix b/nixpkgs/pkgs/development/libraries/vaapi-intel-hybrid/default.nix
index 6462bfd5e624..00e9a2042b7a 100644
--- a/nixpkgs/pkgs/development/libraries/vaapi-intel-hybrid/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vaapi-intel-hybrid/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, pkgconfig, cmrt, libdrm, libva, libX11, libGL, wayland }:
+{ lib, stdenv, fetchurl, autoreconfHook, pkg-config, cmrt, libdrm, libva, libX11, libGL, wayland }:
 
 stdenv.mkDerivation rec {
   pname = "intel-hybrid-driver";
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
   buildInputs = [ cmrt libdrm libva libX11 libGL wayland ];
 
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
     sed -i -e "s,LIBVA_DRIVERS_PATH=.*,LIBVA_DRIVERS_PATH=$out/lib/dri," configure
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://01.org/linuxmedia";
     description = "Intel driver for the VAAPI library with partial HW acceleration";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/vaapi-intel/default.nix b/nixpkgs/pkgs/development/libraries/vaapi-intel/default.nix
index 81edb9caea0d..f21a947a533f 100644
--- a/nixpkgs/pkgs/development/libraries/vaapi-intel/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vaapi-intel/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, gnum4, pkg-config, python3
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, gnum4, pkg-config, python3
 , intel-gpu-tools, libdrm, libva, libX11, libGL, wayland, libXext
 , enableHybridCodec ? false, vaapi-intel-hybrid
 }:
@@ -17,23 +17,23 @@ stdenv.mkDerivation rec {
   # Set the correct install path:
   LIBVA_DRIVERS_PATH = "${placeholder "out"}/lib/dri";
 
-  postInstall = stdenv.lib.optionalString enableHybridCodec ''
+  postInstall = lib.optionalString enableHybridCodec ''
     ln -s ${vaapi-intel-hybrid}/lib/dri/* $out/lib/dri/
   '';
 
   configureFlags = [
     "--enable-x11"
     "--enable-wayland"
-  ] ++ stdenv.lib.optional enableHybridCodec "--enable-hybrid-codec";
+  ] ++ lib.optional enableHybridCodec "--enable-hybrid-codec";
 
   nativeBuildInputs = [ autoreconfHook gnum4 pkg-config python3 ];
 
   buildInputs = [ intel-gpu-tools libdrm libva libX11 libXext libGL wayland ]
-    ++ stdenv.lib.optional enableHybridCodec vaapi-intel-hybrid;
+    ++ lib.optional enableHybridCodec vaapi-intel-hybrid;
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://01.org/linuxmedia";
     license = licenses.mit;
     description = "VA-API user mode driver for Intel GEN Graphics family";
diff --git a/nixpkgs/pkgs/development/libraries/vaapi-vdpau/default.nix b/nixpkgs/pkgs/development/libraries/vaapi-vdpau/default.nix
index 94f96b867d55..fd38eba73974 100644
--- a/nixpkgs/pkgs/development/libraries/vaapi-vdpau/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vaapi-vdpau/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, libvdpau, libGLU, libGL, libva, pkgconfig }:
+{ lib, stdenv, fetchurl, fetchpatch, libvdpau, libGLU, libGL, libva, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "libva-vdpau-driver";
@@ -24,14 +24,14 @@ stdenv.mkDerivation rec {
                   sha256 = "1m4is6lk580mppsx2mvdv1xifj6gvx724si4qynsm9qrdfdc9fby"; })
   ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  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 stdenv.lib; {
+  meta = with lib; {
     homepage = "https://cgit.freedesktop.org/vaapi/vdpau-driver";
     license = licenses.gpl2Plus;
     description = "VDPAU driver for the VAAPI library";
diff --git a/nixpkgs/pkgs/development/libraries/vapoursynth-mvtools/default.nix b/nixpkgs/pkgs/development/libraries/vapoursynth-mvtools/default.nix
index 1030aefc1a54..76ce9a36c713 100644
--- a/nixpkgs/pkgs/development/libraries/vapoursynth-mvtools/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vapoursynth-mvtools/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkgconfig, autoreconfHook,
+{ lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook,
   vapoursynth, nasm, fftwFloat
 }:
 
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
     sha256 = "0lngkvxnzn82rz558nvl96rvclrck07ja1pny7wcfixp9b68ppkn";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [
     autoreconfHook
     nasm vapoursynth fftwFloat
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--libdir=$(out)/lib/vapoursynth" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A set of filters for motion estimation and compensation";
     homepage = "https://github.com/dubhater/vapoursynth-mvtools";
     license  = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/vapoursynth/default.nix b/nixpkgs/pkgs/development/libraries/vapoursynth/default.nix
index 87f35fbf60c2..93f8d3c5ae5f 100644
--- a/nixpkgs/pkgs/development/libraries/vapoursynth/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vapoursynth/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, pkgconfig, autoreconfHook, makeWrapper
+{ lib, stdenv, fetchFromGitHub, pkg-config, autoreconfHook, makeWrapper
 , zimg, libass, python3, libiconv
 , ApplicationServices
 , ocrSupport ?  false, tesseract ? null
@@ -8,20 +8,20 @@
 assert ocrSupport   -> tesseract != null;
 assert imwriSupport -> imagemagick7 != null;
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "vapoursynth";
-  version = "R49";
+  version = "R52";
 
   src = fetchFromGitHub {
     owner  = "vapoursynth";
     repo   = "vapoursynth";
     rev    = version;
-    sha256 = "1d298mlb24nlc2x7pixfbkd0qbpv4c706c32idsgpi96z1spkhvl";
+    sha256 = "1krfdzc2x2vxv4nq9kiv1c09hgj525qn120ah91fw2ikq8ldvmx4";
   };
 
-  nativeBuildInputs = [ pkgconfig autoreconfHook makeWrapper ];
+  nativeBuildInputs = [ pkg-config autoreconfHook makeWrapper ];
   buildInputs = [
     zimg libass
     (python3.withPackages (ps: with ps; [ sphinx cython ]))
@@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
         --prefix PYTHONPATH : $out/${python3.sitePackages}
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A video processing framework with the future in mind";
     homepage    = "http://www.vapoursynth.com/";
     license     = licenses.lgpl21;
diff --git a/nixpkgs/pkgs/development/libraries/vapoursynth/editor.nix b/nixpkgs/pkgs/development/libraries/vapoursynth/editor.nix
index 196c700af17a..76b50a10907e 100644
--- a/nixpkgs/pkgs/development/libraries/vapoursynth/editor.nix
+++ b/nixpkgs/pkgs/development/libraries/vapoursynth/editor.nix
@@ -1,4 +1,4 @@
-{ stdenv, mkDerivation, fetchFromBitbucket
+{ lib, stdenv, mkDerivation, fetchFromBitbucket
 , python3, vapoursynth
 , qmake, qtbase, qtwebsockets
 }:
@@ -10,7 +10,7 @@ mkDerivation rec {
   src = fetchFromBitbucket {
     owner = "mystery_keeper";
     repo = pname;
-    rev = stdenv.lib.toLower version;
+    rev = lib.toLower version;
     sha256 = "1zlaynkkvizf128ln50yvzz3b764f5a0yryp6993s9fkwa7djb6n";
   };
 
@@ -33,7 +33,7 @@ mkDerivation rec {
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Cross-platform editor for VapourSynth scripts";
     homepage = "https://bitbucket.org/mystery_keeper/vapoursynth-editor";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/vc/0.7.nix b/nixpkgs/pkgs/development/libraries/vc/0.7.nix
index 46a3a3e52f0f..dd5b03f2dc50 100644
--- a/nixpkgs/pkgs/development/libraries/vc/0.7.nix
+++ b/nixpkgs/pkgs/development/libraries/vc/0.7.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "Vc";
@@ -13,14 +13,12 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  enableParallelBuilding = true;
-
   postPatch = ''
     sed -i '/OptimizeForArchitecture()/d' cmake/VcMacros.cmake
     sed -i '/AutodetectHostArchitecture()/d' print_target_architecture.cmake
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for multiprecision complex arithmetic with exact rounding";
     homepage = "https://github.com/VcDevel/Vc";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/vc/default.nix b/nixpkgs/pkgs/development/libraries/vc/default.nix
index 49d3f9af7193..40347940ff04 100644
--- a/nixpkgs/pkgs/development/libraries/vc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "Vc";
@@ -13,14 +13,12 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  enableParallelBuilding = true;
-
   postPatch = ''
     sed -i '/OptimizeForArchitecture()/d' cmake/VcMacros.cmake
     sed -i '/AutodetectHostArchitecture()/d' print_target_architecture.cmake
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for multiprecision complex arithmetic with exact rounding";
     homepage = "https://github.com/VcDevel/Vc";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/vcdimager/default.nix b/nixpkgs/pkgs/development/libraries/vcdimager/default.nix
index c7f375c20789..0235912ce539 100644
--- a/nixpkgs/pkgs/development/libraries/vcdimager/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vcdimager/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, lib, fetchurl, pkgconfig, libcdio, libxml2, popt
+{ stdenv, lib, fetchurl, pkg-config, libcdio, libxml2, popt
 , libiconv, darwin }:
 
 stdenv.mkDerivation rec {
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "0ypnb1vp49nmzp5571ynlz6n1gh90f23w3z4x95hb7c2p7pmylb7";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ libxml2 popt libiconv ]
              ++ lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ IOKit DiskArbitration ]);
diff --git a/nixpkgs/pkgs/development/libraries/vcg/default.nix b/nixpkgs/pkgs/development/libraries/vcg/default.nix
index a8a24750744b..380f533fe6f7 100644
--- a/nixpkgs/pkgs/development/libraries/vcg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vcg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, eigen }:
+{ lib, stdenv, fetchFromGitHub, eigen }:
 
 stdenv.mkDerivation rec {
   pname = "vcg";
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
     find $out -name \*.h -exec sed -i 's,<eigenlib/,<eigen3/,g' {} \;
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/vid-stab/default.nix b/nixpkgs/pkgs/development/libraries/vid-stab/default.nix
index 2921719e7554..d224c2f3be58 100644
--- a/nixpkgs/pkgs/development/libraries/vid-stab/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vid-stab/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, openmp }:
+{ lib, stdenv, fetchFromGitHub, cmake, openmp }:
 
 stdenv.mkDerivation rec {
   pname = "vid.stab";
@@ -13,9 +13,9 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  buildInputs = stdenv.lib.optionals stdenv.cc.isClang [ openmp ];
+  buildInputs = lib.optionals stdenv.cc.isClang [ openmp ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Video stabilization library";
     homepage = "http://public.hronopik.de/vid.stab/";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/vigra/default.nix b/nixpkgs/pkgs/development/libraries/vigra/default.nix
index 8720a39f301a..56402172d9ff 100644
--- a/nixpkgs/pkgs/development/libraries/vigra/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vigra/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, boost, cmake, fftw, fftwSinglePrec, hdf5, ilmbase
+{ lib, stdenv, fetchurl, boost, cmake, fftw, fftwSinglePrec, hdf5, ilmbase
 , libjpeg, libpng, libtiff, openexr, python2Packages }:
 
 let
@@ -9,7 +9,7 @@ in stdenv.mkDerivation rec {
   version = "1.11.1";
 
   src = fetchurl {
-    url = "https://github.com/ukoethe/vigra/archive/Version-${stdenv.lib.replaceChars ["."] ["-"] version}.tar.gz";
+    url = "https://github.com/ukoethe/vigra/archive/Version-${lib.replaceChars ["."] ["-"] version}.tar.gz";
     sha256 = "03i5wfscv83jb8vnwwhfmm8yfiniwkvk13myzhr1kbwbs9884wdj";
   };
 
@@ -21,21 +21,20 @@ in stdenv.mkDerivation rec {
                                 sha256 = "1i1w6smijgb5z8bg9jaq84ccy00k2sxm87s37lgjpyix901gjlgi"; };
     in [ clangPatch ];
 
-  buildInputs = [ boost cmake fftw fftwSinglePrec hdf5 ilmbase libjpeg libpng
+  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" ]
-            ++ stdenv.lib.optionals (stdenv.hostPlatform.system == "x86_64-linux")
+            ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-linux")
                   [ "-DCMAKE_CXX_FLAGS=-fPIC" "-DCMAKE_C_FLAGS=-fPIC" ];
 
-  enableParallelBuilding = true;
-
   # 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 stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/virglrenderer/default.nix b/nixpkgs/pkgs/development/libraries/virglrenderer/default.nix
index 8951ed4b002a..38688d90246e 100644
--- a/nixpkgs/pkgs/development/libraries/virglrenderer/default.nix
+++ b/nixpkgs/pkgs/development/libraries/virglrenderer/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, meson, ninja, pkgconfig, python3
+{ lib, stdenv, fetchurl, cmake, meson, ninja, pkg-config, python3
 , libGLU, epoxy, libX11, libdrm, mesa
 }:
 
@@ -13,11 +13,11 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libGLU epoxy libX11 libdrm mesa ];
 
-  nativeBuildInputs = [ cmake meson ninja pkgconfig python3 ];
+  nativeBuildInputs = [ cmake meson ninja pkg-config python3 ];
 
   dontUseCmakeConfigure = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/vmime/default.nix b/nixpkgs/pkgs/development/libraries/vmime/default.nix
index e0c58096cfa5..3f33df66339e 100644
--- a/nixpkgs/pkgs/development/libraries/vmime/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vmime/default.nix
@@ -1,5 +1,5 @@
-{stdenv, fetchFromGitHub
-, gsasl, gnutls, pkgconfig, cmake, zlib, libtasn1, libgcrypt, gtk3
+{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"
 }:
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ gsasl gnutls zlib libtasn1 libgcrypt gtk3 ];
-  nativeBuildInputs = [ pkgconfig cmake ];
+  nativeBuildInputs = [ pkg-config cmake ];
 
   cmakeFlags = [
     "-DVMIME_SENDMAIL_PATH=${sendmailPath}"
@@ -24,8 +24,8 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://www.vmime.org/";
     description = "Free mail library for C++";
-    license = stdenv.lib.licenses.gpl3;
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
+    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
index f191a9764378..4aa525feb193 100644
--- a/nixpkgs/pkgs/development/libraries/vmmlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vmmlib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig, boost, lapack
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, boost, lapack
 , Accelerate, CoreGraphics, CoreVideo
 }:
 
@@ -17,17 +17,15 @@ stdenv.mkDerivation rec {
     ./disable-cpack.patch   #disable the need of cpack/rpm
   ];
 
-  nativeBuildInputs = [ pkgconfig cmake ];
+  nativeBuildInputs = [ pkg-config cmake ];
   buildInputs = [ boost lapack ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ Accelerate CoreGraphics CoreVideo ];
-
-  enableParallelBuilding = true;
+    ++ lib.optionals stdenv.isDarwin [ Accelerate CoreGraphics CoreVideo ];
 
   doCheck = !stdenv.isDarwin;
 
   checkTarget = "test";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A vector and matrix math library implemented using C++ templates";
 
     longDescription = ''vmmlib is a vector and matrix math library implemented
diff --git a/nixpkgs/pkgs/development/libraries/vo-amrwbenc/default.nix b/nixpkgs/pkgs/development/libraries/vo-amrwbenc/default.nix
index 9f35bf4ad84e..dccbd1349d2c 100644
--- a/nixpkgs/pkgs/development/libraries/vo-amrwbenc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vo-amrwbenc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook }:
+{ lib, stdenv, fetchurl, autoreconfHook }:
 
 let
     version = "0.1.3";
@@ -15,8 +15,8 @@ stdenv.mkDerivation {
   meta = {
     homepage = "https://sourceforge.net/projects/opencore-amr/";
     description = "VisualOn Adaptive Multi Rate Wideband (AMR-WB) encoder";
-    license = stdenv.lib.licenses.asl20;
-    maintainers = [ stdenv.lib.maintainers.Esteth ];
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.asl20;
+    maintainers = [ lib.maintainers.Esteth ];
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/volume-key/default.nix b/nixpkgs/pkgs/development/libraries/volume-key/default.nix
index 084b42c9a2dc..567a5e3e251a 100644
--- a/nixpkgs/pkgs/development/libraries/volume-key/default.nix
+++ b/nixpkgs/pkgs/development/libraries/volume-key/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, autoreconfHook, pkgconfig, gettext, python3
+{ lib, stdenv, fetchgit, autoreconfHook, pkg-config, gettext, python3
 , ncurses, swig, glib, util-linux, cryptsetup, nss, gpgme
 , autoconf, automake, libtool
 , buildPackages
@@ -18,7 +18,7 @@ in stdenv.mkDerivation {
 
   outputs = [ "out" "man" "dev" "py" ];
 
-  nativeBuildInputs = [ autoconf automake libtool pkgconfig gettext swig ];
+  nativeBuildInputs = [ autoconf automake libtool pkg-config gettext swig ];
 
   buildInputs = [ autoreconfHook glib cryptsetup nss util-linux gpgme ncurses ];
 
@@ -38,7 +38,7 @@ in stdenv.mkDerivation {
 
   doCheck = false; # fails 1 out of 1 tests, needs `certutil`
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/vrb/default.nix b/nixpkgs/pkgs/development/libraries/vrb/default.nix
index a85e27d42b7c..1ebc37cdf2f3 100644
--- a/nixpkgs/pkgs/development/libraries/vrb/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vrb/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "vrb";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     cp -p vrb/man/man3/*.3 $out/share/man/man3/
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A virtual ring buffer library written in C";
     license     = licenses.lgpl21;
     homepage    = "http://vrb.sourceforge.net/";
diff --git a/nixpkgs/pkgs/development/libraries/vrpn/default.nix b/nixpkgs/pkgs/development/libraries/vrpn/default.nix
index b45c83ab1ae8..f9eed6b2f747 100644
--- a/nixpkgs/pkgs/development/libraries/vrpn/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vrpn/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, unzip, cmake, libGLU, libGL }:
+{ lib, stdenv, fetchFromGitHub, unzip, cmake, libGLU, libGL }:
 
 stdenv.mkDerivation rec {
   name    = "${pname}-${date}";
@@ -12,12 +12,13 @@ stdenv.mkDerivation rec {
     sha256 = "032q295d68w34rk5q8nfqdd29s55n00bfik84y7xzkjrpspaprlh";
   };
 
-  buildInputs = [ unzip cmake libGLU libGL ];
+  nativeBuildInputs = [ cmake unzip ];
+  buildInputs = [ libGLU libGL ];
 
   doCheck = false; # FIXME: test failure
   checkTarget = "test";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Virtual Reality Peripheral Network";
     longDescription = ''
       The Virtual-Reality Peripheral Network (VRPN) is a set of classes
diff --git a/nixpkgs/pkgs/development/libraries/vsqlite/default.nix b/nixpkgs/pkgs/development/libraries/vsqlite/default.nix
index a4c9cb556b9b..6981de6aa074 100644
--- a/nixpkgs/pkgs/development/libraries/vsqlite/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vsqlite/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, boost, sqlite }:
+{ lib, stdenv, fetchurl, boost, sqlite }:
 
 stdenv.mkDerivation rec {
   pname = "vsqlite";
@@ -11,14 +11,14 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ boost sqlite ];
 
-  prePatch = stdenv.lib.optionalString stdenv.isDarwin ''
+  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 stdenv.lib; {
+  meta = with lib; {
     homepage = "http://vsqlite.virtuosic-bytes.com/";
     description = "C++ wrapper library for sqlite";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/vte/2.90.nix b/nixpkgs/pkgs/development/libraries/vte/2.90.nix
index 59d0acada137..4a9e4d8a66c9 100644
--- a/nixpkgs/pkgs/development/libraries/vte/2.90.nix
+++ b/nixpkgs/pkgs/development/libraries/vte/2.90.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, intltool, pkgconfig, glib, gtk3, ncurses, gobject-introspection }:
+{ lib, stdenv, fetchurl, intltool, pkg-config, glib, gtk3, ncurses, gobject-introspection }:
 
 stdenv.mkDerivation rec {
   versionMajor = "0.36";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "54e5b07be3c0f7b158302f54ee79d4de1cb002f4259b6642b79b1e0e314a959c";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ gobject-introspection intltool glib gtk3 ncurses ];
 
   configureFlags = [ "--enable-introspection" ];
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     substituteInPlace $out/lib/libvte2_90.la --replace "-lncurses" "-L${ncurses.out}/lib -lncurses"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.gnome.org/";
     description = "A library implementing a terminal emulator widget for GTK";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/vte/default.nix b/nixpkgs/pkgs/development/libraries/vte/default.nix
index 014b2615d5bf..9f2722a9ae8f 100644
--- a/nixpkgs/pkgs/development/libraries/vte/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vte/default.nix
@@ -3,7 +3,7 @@
 , fetchurl
 , fetchpatch
 , gettext
-, pkgconfig
+, pkg-config
 , meson
 , ninja
 , gnome3
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
   outputs = [ "out" "dev" ];
 
   src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
+    url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
     sha256 = "139had0zcggzrxx9rjy0a67mahzm474amafh168y11421iyfhsf3";
   };
 
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
     libxml2
     meson
     ninja
-    pkgconfig
+    pkg-config
     vala
   ];
 
@@ -80,7 +80,7 @@ stdenv.mkDerivation rec {
     patchShebangs src/box_drawing_generate.sh
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.gnome.org/";
     description = "A library implementing a terminal emulator widget for GTK";
     longDescription = ''
diff --git a/nixpkgs/pkgs/development/libraries/vtk/7.x.nix b/nixpkgs/pkgs/development/libraries/vtk/7.x.nix
index 55f950e0ac90..860f17639454 100644
--- a/nixpkgs/pkgs/development/libraries/vtk/7.x.nix
+++ b/nixpkgs/pkgs/development/libraries/vtk/7.x.nix
@@ -5,5 +5,10 @@ import ./generic.nix {
   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
index 1563991f47f3..ad84ec163cfa 100644
--- a/nixpkgs/pkgs/development/libraries/vtk/8.x.nix
+++ b/nixpkgs/pkgs/development/libraries/vtk/8.x.nix
@@ -5,5 +5,14 @@ import ./generic.nix {
   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/generic.nix b/nixpkgs/pkgs/development/libraries/vtk/generic.nix
index 7bfd8d9fcfff..273bff8852ee 100644
--- a/nixpkgs/pkgs/development/libraries/vtk/generic.nix
+++ b/nixpkgs/pkgs/development/libraries/vtk/generic.nix
@@ -1,5 +1,5 @@
 { majorVersion, minorVersion, sourceSha256, patchesToFetch ? [] }:
-{ stdenv, lib, fetchurl, cmake, libGLU, libGL, libX11, xorgproto, libXt, libtiff
+{ 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."
@@ -24,7 +24,7 @@ in stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  buildInputs = [ libtiff ]
+  buildInputs = [ libpng libtiff ]
     ++ optionals enableQt [ qtbase qtx11extras qttools ]
     ++ optionals stdenv.isLinux [
       libGLU
@@ -65,6 +65,7 @@ in stdenv.mkDerivation rec {
   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"
@@ -84,8 +85,6 @@ in stdenv.mkDerivation rec {
     sed -i 's/fprintf(output, shift)/fprintf(output, "%s", shift)/g' ./ThirdParty/libxml2/vtklibxml2/xpath.c
   '';
 
-  enableParallelBuilding = true;
-
   meta = with lib; {
     description = "Open source libraries for 3D computer graphics, image processing and visualization";
     homepage = "https://www.vtk.org/";
diff --git a/nixpkgs/pkgs/development/libraries/vulkan-headers/default.nix b/nixpkgs/pkgs/development/libraries/vulkan-headers/default.nix
index 154ed9deb490..f065b83bcc84 100644
--- a/nixpkgs/pkgs/development/libraries/vulkan-headers/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vulkan-headers/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 stdenv.mkDerivation rec {
   pname = "vulkan-headers";
   version = "1.2.162.0";
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "057c49w1138l02v9gqsk1z8wdz0iilp96jblnldycwm9jc1a1ipq";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Vulkan Header files and API registry";
     homepage    = "https://www.lunarg.com";
     platforms   = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/vulkan-loader/default.nix b/nixpkgs/pkgs/development/libraries/vulkan-loader/default.nix
index f2fb44f8b9d1..b3882a919421 100644
--- a/nixpkgs/pkgs/development/libraries/vulkan-loader/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vulkan-loader/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, python3, vulkan-headers, pkgconfig
+{ lib, stdenv, fetchFromGitHub, cmake, python3, vulkan-headers, pkg-config
 , xlibsWrapper, libxcb, libXrandr, libXext, wayland, addOpenGLRunpath }:
 
 stdenv.mkDerivation rec {
@@ -12,24 +12,27 @@ stdenv.mkDerivation rec {
     sha256 = "0w9i2pliw4ccmjyfzff4i2f3hxwsfd54jg7ahv2v634qmx59bsbi";
   };
 
-  nativeBuildInputs = [ pkgconfig cmake ];
+  nativeBuildInputs = [ pkg-config cmake ];
   buildInputs = [ python3 xlibsWrapper libxcb libXrandr libXext wayland ];
-  enableParallelBuilding = true;
-
-  preConfigure = ''
-    substituteInPlace loader/vulkan.pc.in \
-      --replace 'includedir=''${prefix}/include' 'includedir=${vulkan-headers}/include' \
-      --replace 'libdir=''${exec_prefix}/@CMAKE_INSTALL_LIBDIR@' 'libdir=@CMAKE_INSTALL_LIBDIR@'
-  '';
 
   cmakeFlags = [
     "-DSYSCONFDIR=${addOpenGLRunpath.driverLink}/share"
     "-DVULKAN_HEADERS_INSTALL_DIR=${vulkan-headers}"
+    "-DCMAKE_INSTALL_INCLUDEDIR=${vulkan-headers}/include"
   ];
 
   outputs = [ "out" "dev" ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/vxl/default.nix b/nixpkgs/pkgs/development/libraries/vxl/default.nix
index 58622cb98cb7..6858cd93ab36 100644
--- a/nixpkgs/pkgs/development/libraries/vxl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/vxl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, unzip, cmake, libtiff, expat, zlib, libpng, libjpeg }:
+{ lib, stdenv, fetchFromGitHub, unzip, cmake, libtiff, expat, zlib, libpng, libjpeg }:
 stdenv.mkDerivation {
   name = "vxl-1.17.0-nix1";
 
@@ -9,7 +9,8 @@ stdenv.mkDerivation {
     sha256 = "0xpkwwb93ka6c3da8zjhfg9jk5ssmh9ifdh1by54sz6c7mbp55m8";
   };
 
-  buildInputs = [ cmake unzip libtiff expat zlib libpng libjpeg ];
+  nativeBuildInputs = [ cmake unzip ];
+  buildInputs = [ libtiff expat zlib libpng libjpeg ];
 
   cmakeFlags = [
     # BUILD_OUL wants old linux headers for videodev.h, not available
@@ -18,18 +19,16 @@ stdenv.mkDerivation {
     # BUILD_BRL fails to find open()
     "-DBUILD_BRL=OFF"
     "-DBUILD_CONTRIB=OFF"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [
+  ] ++ lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [
     "-DCMAKE_CXX_FLAGS=-fPIC"
     "-DCMAKE_C_FLAGS=-fPIC"
   ];
 
-  enableParallelBuilding = true;
-
   meta = {
     description = "C++ Libraries for Computer Vision Research and Implementation";
     homepage = "http://vxl.sourceforge.net/";
     license = "VXL License";
-    maintainers = with stdenv.lib.maintainers; [viric];
-    platforms = with stdenv.lib.platforms; linux;
+    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
index 0f1e36b35795..dd783036f230 100644
--- a/nixpkgs/pkgs/development/libraries/waffle/default.nix
+++ b/nixpkgs/pkgs/development/libraries/waffle/default.nix
@@ -32,14 +32,14 @@ stdenv.mkDerivation rec {
 
   buildInputs = [
     libGL
-  ] ++ stdenv.lib.optionals (with stdenv.hostPlatform; isUnix && !isDarwin) [
+  ] ++ lib.optionals (with stdenv.hostPlatform; isUnix && !isDarwin) [
     libglvnd
-  ] ++ stdenv.lib.optionals x11Support [
+  ] ++ lib.optionals x11Support [
     libX11
     libxcb
-  ] ++ stdenv.lib.optionals waylandSupport [
+  ] ++ lib.optionals waylandSupport [
     wayland
-  ] ++ stdenv.lib.optionals useGbm [
+  ] ++ lib.optionals useGbm [
     mesa
     libudev
   ];
@@ -54,7 +54,7 @@ stdenv.mkDerivation rec {
 
   postInstall = ''
     wrapProgram $out/bin/wflinfo \
-      --prefix LD_LIBRARY_PATH : ${stdenv.lib.makeLibraryPath [ libGL libglvnd ]}
+      --prefix LD_LIBRARY_PATH : ${lib.makeLibraryPath [ libGL libglvnd ]}
   '';
 
   meta = with lib; {
diff --git a/nixpkgs/pkgs/development/libraries/wasilibc/default.nix b/nixpkgs/pkgs/development/libraries/wasilibc/default.nix
index bca025d622af..f8142f046b74 100644
--- a/nixpkgs/pkgs/development/libraries/wasilibc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wasilibc/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation {
     ln -s $out/share/wasm32-wasi/undefined-symbols.txt $out/lib/wasi.imports
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "WASI libc implementation for WebAssembly";
     homepage    = "https://wasi.dev";
     platforms   = platforms.wasi;
diff --git a/nixpkgs/pkgs/development/libraries/wavpack/default.nix b/nixpkgs/pkgs/development/libraries/wavpack/default.nix
index 78794430860c..41f3076dbe94 100644
--- a/nixpkgs/pkgs/development/libraries/wavpack/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wavpack/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libiconv }:
+{ lib, stdenv, fetchurl, libiconv }:
 
 stdenv.mkDerivation rec {
   pname = "wavpack";
@@ -6,14 +6,14 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  buildInputs = stdenv.lib.optional stdenv.isDarwin libiconv;
+  buildInputs = lib.optional stdenv.isDarwin libiconv;
 
   src = fetchurl {
     url = "http://www.wavpack.com/${pname}-${version}.tar.bz2";
     sha256 = "00baiag7rlkzc6545dqdp4p5sr7xc3n97n7qdkgx58c544x0pw5n";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Hybrid audio compression format";
     homepage    = "http://www.wavpack.com/";
     license     = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/wayland/default.nix b/nixpkgs/pkgs/development/libraries/wayland/default.nix
index 2b18bc31a452..7ec8936267bb 100644
--- a/nixpkgs/pkgs/development/libraries/wayland/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wayland/default.nix
@@ -3,7 +3,7 @@
 , fetchurl
 , fetchpatch
 , meson
-, pkgconfig
+, pkg-config
 , substituteAll
 , ninja
 , libffi
@@ -57,12 +57,12 @@ stdenv.mkDerivation rec {
   '';
 
   depsBuildBuild = [
-    pkgconfig
+    pkg-config
   ];
 
   nativeBuildInputs = [
     meson
-    pkgconfig
+    pkg-config
     ninja
   ] ++ lib.optionals isCross [
     wayland # For wayland-scanner during the build
diff --git a/nixpkgs/pkgs/development/libraries/wayland/protocols.nix b/nixpkgs/pkgs/development/libraries/wayland/protocols.nix
index 66d5d50c9d81..23258aff3e93 100644
--- a/nixpkgs/pkgs/development/libraries/wayland/protocols.nix
+++ b/nixpkgs/pkgs/development/libraries/wayland/protocols.nix
@@ -1,4 +1,4 @@
-{ lib, stdenv, fetchurl, pkgconfig
+{ lib, stdenv, fetchurl, pkg-config
 , wayland
 }:
 
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "1rsdgvkkvxs3cjhpl6agvbkm53vm7k8rg127j9y2vn33m2hvg0lp";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ wayland ];
 
diff --git a/nixpkgs/pkgs/development/libraries/waylandpp/default.nix b/nixpkgs/pkgs/development/libraries/waylandpp/default.nix
index 5fc466cec201..0aa77b771e48 100644
--- a/nixpkgs/pkgs/development/libraries/waylandpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/waylandpp/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , cmake
-, pkgconfig
+, pkg-config
 , pugixml
 , wayland
 , libGL
@@ -13,7 +13,7 @@
 
 assert docSupport -> doxygen != null;
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "waylandpp";
   version = "0.2.8";
@@ -25,18 +25,18 @@ stdenv.mkDerivation rec {
     sha256 = "1kxiqab48p0n97pwg8c2zx56wqq32m3rcq7qd2pjj33ipcanb3qq";
   };
 
-  cmakeFlags = [ 
-    "-DCMAKE_INSTALL_DATADIR=${placeholder "dev"}" 
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
+  cmakeFlags = [
+    "-DCMAKE_INSTALL_DATADIR=${placeholder "dev"}"
+  ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
     "-DWAYLAND_SCANNERPP=${buildPackages.waylandpp}/bin/wayland-scanner++"
   ];
 
-  nativeBuildInputs = [ cmake pkgconfig ] ++ optional docSupport doxygen;
+  nativeBuildInputs = [ cmake pkg-config ] ++ optional docSupport doxygen;
   buildInputs = [ pugixml wayland libGL libffi ];
 
   outputs = [ "bin" "dev" "lib" "out" ] ++ optionals docSupport [ "doc" "devman" ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Wayland C++ binding";
     homepage = "https://github.com/NilsBrause/waylandpp/";
     license = with licenses; [ bsd2 hpnd ];
diff --git a/nixpkgs/pkgs/development/libraries/wcslib/default.nix b/nixpkgs/pkgs/development/libraries/wcslib/default.nix
index 2b3414df1a4b..c12118a99de4 100644
--- a/nixpkgs/pkgs/development/libraries/wcslib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wcslib/default.nix
@@ -1,4 +1,4 @@
-{ fetchurl,  stdenv, flex }:
+{ fetchurl,  lib, stdenv, flex }:
 
 stdenv.mkDerivation rec {
   version = "7.3.1";
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     systems. This is the standard library for this purpose in
     astronomy.'';
 
-    license = stdenv.lib.licenses.lgpl3Plus;
-    platforms = stdenv.lib.platforms.unix;
+    license = lib.licenses.lgpl3Plus;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/webkitgtk/default.nix b/nixpkgs/pkgs/development/libraries/webkitgtk/default.nix
index ed97e1c8a85b..1abfd3a9194c 100644
--- a/nixpkgs/pkgs/development/libraries/webkitgtk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/webkitgtk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , perl
 , python3
@@ -7,7 +7,7 @@
 , gperf
 , cmake
 , ninja
-, pkgconfig
+, pkg-config
 , gettext
 , gobject-introspection
 , libnotify
@@ -51,11 +51,13 @@
 , xdg-dbus-proxy
 , substituteAll
 , glib
+, libwpe
+, libwpe-fdo
 }:
 
 assert enableGeoLocation -> geoclue2 != null;
 
-with stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "webkitgtk";
@@ -78,7 +80,7 @@ stdenv.mkDerivation rec {
     ./libglvnd-headers.patch
   ];
 
-  preConfigure = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.buildPlatform) ''
+  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
@@ -94,11 +96,11 @@ stdenv.mkDerivation rec {
     gperf
     ninja
     perl
-    pkgconfig
+    pkg-config
     python3
     ruby
     glib # for gdbus-codegen
-  ] ++ stdenv.lib.optionals stdenv.isLinux [
+  ] ++ lib.optionals stdenv.isLinux [
     wayland # for wayland-scanner
   ];
 
@@ -120,6 +122,8 @@ stdenv.mkDerivation rec {
     libsecret
     libtasn1
     libwebp
+    libwpe
+    libwpe-fdo
     libxkbcommon
     libxml2
     libxslt
@@ -154,7 +158,6 @@ stdenv.mkDerivation rec {
     "-DENABLE_INTROSPECTION=ON"
     "-DPORT=GTK"
     "-DUSE_LIBHYPHEN=OFF"
-    "-DUSE_WPE_RENDERER=OFF"
   ] ++ optionals stdenv.isDarwin [
     "-DENABLE_GRAPHICS_CONTEXT_3D=OFF"
     "-DENABLE_GTKDOC=OFF"
diff --git a/nixpkgs/pkgs/development/libraries/webrtc-audio-processing/default.nix b/nixpkgs/pkgs/development/libraries/webrtc-audio-processing/default.nix
index 91d93352da1b..efd2ce3b1fcc 100644
--- a/nixpkgs/pkgs/development/libraries/webrtc-audio-processing/default.nix
+++ b/nixpkgs/pkgs/development/libraries/webrtc-audio-processing/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, darwin }:
+{ lib, stdenv, fetchurl, darwin }:
 
 stdenv.mkDerivation rec {
   name = "webrtc-audio-processing-0.3.1";
@@ -8,13 +8,13 @@ stdenv.mkDerivation rec {
     sha256 = "1gsx7k77blfy171b6g3m0k0s0072v6jcawhmx1kjs9w5zlwdkzd0";
   };
 
-  buildInputs = stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ ApplicationServices ]);
+  buildInputs = lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [ ApplicationServices ]);
 
-  patchPhase = stdenv.lib.optionalString stdenv.hostPlatform.isMusl ''
+  patchPhase = lib.optionalString stdenv.hostPlatform.isMusl ''
     substituteInPlace webrtc/base/checks.cc --replace 'defined(__UCLIBC__)' 1
   '';
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/websocket++/default.nix b/nixpkgs/pkgs/development/libraries/websocket++/default.nix
index d04cadb483b0..5c9271f2a85a 100644
--- a/nixpkgs/pkgs/development/libraries/websocket++/default.nix
+++ b/nixpkgs/pkgs/development/libraries/websocket++/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake }:
+{ lib, stdenv, fetchFromGitHub, cmake }:
 
 stdenv.mkDerivation rec {
   pname = "websocket++";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.zaphoyd.com/websocketpp/";
     description = "C++/Boost Asio based websocket client/server library";
     license = licenses.bsd3;
diff --git a/nixpkgs/pkgs/development/libraries/wildmidi/default.nix b/nixpkgs/pkgs/development/libraries/wildmidi/default.nix
index ea63a73fc925..880823a84732 100644
--- a/nixpkgs/pkgs/development/libraries/wildmidi/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wildmidi/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake, alsaLib, freepats }:
+{ lib, stdenv, fetchurl, cmake, alsaLib, freepats }:
 
 stdenv.mkDerivation rec {
   name = "wildmidi-0.4.3";
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     echo "source ${freepats}/freepats.cfg" >> "$out"/etc/wildmidi.cfg
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Software MIDI player and library";
     longDescription = ''
       WildMIDI is a simple software midi player which has a core softsynth
diff --git a/nixpkgs/pkgs/development/libraries/wiredtiger/default.nix b/nixpkgs/pkgs/development/libraries/wiredtiger/default.nix
index 9a7cee6623ee..469da2523d99 100644
--- a/nixpkgs/pkgs/development/libraries/wiredtiger/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wiredtiger/default.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchFromGitHub, automake, autoconf, libtool
+{ lib, stdenv, fetchFromGitHub, automake, autoconf, libtool
 
 # Optional Dependencies
 , lz4 ? null, snappy ? null, zlib ? null, bzip2 ? null, db ? null
 , gperftools ? null, leveldb ? null
 }:
 
-with stdenv.lib;
+with lib;
 let
   mkFlag = trueStr: falseStr: cond: name: val: "--"
     + (if cond then trueStr else falseStr)
@@ -14,7 +14,7 @@ let
   mkEnable = mkFlag "enable-" "disable-";
   mkWith = mkFlag "with-" "without-";
 
-  shouldUsePkg = pkg: if pkg != null && stdenv.lib.any (stdenv.lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;
+  shouldUsePkg = pkg: if pkg != null && lib.any (lib.meta.platformMatch stdenv.hostPlatform) pkg.meta.platforms then pkg else null;
 
   optLz4 = shouldUsePkg lz4;
   optSnappy = shouldUsePkg snappy;
diff --git a/nixpkgs/pkgs/development/libraries/wlroots/default.nix b/nixpkgs/pkgs/development/libraries/wlroots/default.nix
index 13132c8cc1c9..a21179e20259 100644
--- a/nixpkgs/pkgs/development/libraries/wlroots/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wlroots/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, meson, ninja, pkg-config, wayland
+{ lib, stdenv, fetchFromGitHub, meson, ninja, pkg-config, wayland
 , libGL, wayland-protocols, libinput, libxkbcommon, pixman
 , xcbutilwm, libX11, libcap, xcbutilimage, xcbutilerrors, mesa
 , libpng, ffmpeg
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
     done
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A modular Wayland compositor library";
     longDescription = ''
       Pluggable, composable, unopinionated modules for building a Wayland
diff --git a/nixpkgs/pkgs/development/libraries/wolfssl/default.nix b/nixpkgs/pkgs/development/libraries/wolfssl/default.nix
index 30fc90ec8c09..c0c0218a318f 100644
--- a/nixpkgs/pkgs/development/libraries/wolfssl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wolfssl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "wolfssl";
@@ -25,11 +25,11 @@ stdenv.mkDerivation rec {
      mkdir -p "$out"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A small, fast, portable implementation of TLS/SSL for embedded devices";
     homepage    = "https://www.wolfssl.com/";
     platforms   = platforms.all;
-    license = stdenv.lib.licenses.gpl2;
+    license = lib.licenses.gpl2;
     maintainers = with maintainers; [ mcmtroffaes ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/wt/default.nix b/nixpkgs/pkgs/development/libraries/wt/default.nix
index 7c819487a334..8887c4410f4c 100644
--- a/nixpkgs/pkgs/development/libraries/wt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, boost, pkgconfig, doxygen, qt48Full, libharu
+{ lib, stdenv, fetchFromGitHub, cmake, boost, pkg-config, doxygen, qt48Full, libharu
 , pango, fcgi, firebird, libmysqlclient, postgresql, graphicsmagick, glew, openssl
 , pcre, harfbuzz
 }:
@@ -17,11 +17,9 @@ let
         inherit sha256;
       };
 
-      enableParallelBuilding = true;
-
-      nativeBuildInputs = [ pkgconfig ];
+      nativeBuildInputs = [ cmake pkg-config ];
       buildInputs = [
-        cmake boost doxygen qt48Full libharu
+        boost doxygen qt48Full libharu
         pango fcgi firebird libmysqlclient postgresql graphicsmagick glew
         openssl pcre
       ];
@@ -30,16 +28,16 @@ let
         "-DWT_CPP_11_MODE=-std=c++11"
         "--no-warn-unused-cli"
       ]
-      ++ stdenv.lib.optionals (graphicsmagick != null) [
+      ++ lib.optionals (graphicsmagick != null) [
         "-DWT_WRASTERIMAGE_IMPLEMENTATION=GraphicsMagick"
         "-DGM_PREFIX=${graphicsmagick}"
       ]
-      ++ stdenv.lib.optional (harfbuzz != null)
+      ++ lib.optional (harfbuzz != null)
         "-DHARFBUZZ_INCLUDE_DIR=${harfbuzz.dev}/include"
-      ++ stdenv.lib.optional (libmysqlclient != null)
+      ++ lib.optional (libmysqlclient != null)
         "-DMYSQL_PREFIX=${libmysqlclient}";
 
-      meta = with stdenv.lib; {
+      meta = with lib; {
         homepage = "https://www.webtoolkit.eu/wt";
         description = "C++ library for developing web applications";
         platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/wtk/default.nix b/nixpkgs/pkgs/development/libraries/wtk/default.nix
index d66a628dac79..9ddc95a9ccc7 100644
--- a/nixpkgs/pkgs/development/libraries/wtk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wtk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, requireFile, unzip, xorg }:
+{ lib, stdenv, requireFile, unzip, xorg }:
 
 assert stdenv.hostPlatform.system == "i686-linux";
 
@@ -20,6 +20,6 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "http://java.sun.com/products/sjwtoolkit/download.html";
     description = "Sun Java Wireless Toolkit 2.5.2_01 for CLDC";
-    license = stdenv.lib.licenses.unfree;
+    license = lib.licenses.unfree;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/wxSVG/default.nix b/nixpkgs/pkgs/development/libraries/wxSVG/default.nix
index 9fa64be4d53e..5e7f7b71fbe5 100644
--- a/nixpkgs/pkgs/development/libraries/wxSVG/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wxSVG/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl
-, pkgconfig, wxGTK
+{ lib, stdenv, fetchurl
+, pkg-config, wxGTK
 , ffmpeg_3, libexif
 , cairo, pango }:
 
@@ -14,13 +14,13 @@ stdenv.mkDerivation rec {
     sha256 = "0agmmwg0zlsw1idygvqjpj1nk41akzlbdha0hsdk1k8ckz6niq8d";
   };
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   propagatedBuildInputs = [ wxGTK ffmpeg_3 libexif ];
 
   buildInputs = [ cairo pango ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A SVG manipulation library built with wxWidgets";
     longDescription = ''
     wxSVG is C++ library to create, manipulate and render
diff --git a/nixpkgs/pkgs/development/libraries/wxsqlite3/default.nix b/nixpkgs/pkgs/development/libraries/wxsqlite3/default.nix
index db5e91b74d66..8acd4e99636b 100644
--- a/nixpkgs/pkgs/development/libraries/wxsqlite3/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wxsqlite3/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook
 , wxGTK
@@ -20,9 +20,9 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoreconfHook ];
 
   buildInputs = [ wxGTK sqlite ]
-    ++ stdenv.lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Cocoa darwin.stubs.setfile darwin.stubs.rez darwin.stubs.derez ];
+    ++ lib.optionals stdenv.isDarwin [ darwin.apple_sdk.frameworks.Cocoa darwin.stubs.setfile darwin.stubs.rez darwin.stubs.derez ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/wxsqliteplus/default.nix b/nixpkgs/pkgs/development/libraries/wxsqliteplus/default.nix
index 18ecea4cbe18..7cf5484bef77 100644
--- a/nixpkgs/pkgs/development/libraries/wxsqliteplus/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wxsqliteplus/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, wxGTK, wxsqlite3, sqlite }:
+{ lib, stdenv, fetchFromGitHub, wxGTK, wxsqlite3, sqlite }:
 
 stdenv.mkDerivation rec {
   pname = "wxsqliteplus";
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
     install -D wxsqliteplus $out/bin/wxsqliteplus
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/guanlisheng/wxsqliteplus";
     description = "A simple SQLite database browser built with wxWidgets";
     platforms = platforms.unix;
diff --git a/nixpkgs/pkgs/development/libraries/wxwidgets/2.8/default.nix b/nixpkgs/pkgs/development/libraries/wxwidgets/2.8/default.nix
index deb7d19c0de1..8029477708df 100644
--- a/nixpkgs/pkgs/development/libraries/wxwidgets/2.8/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wxwidgets/2.8/default.nix
@@ -1,14 +1,14 @@
-{ stdenv, fetchurl, pkgconfig, gtk2, libXinerama, libSM, libXxf86vm, xorgproto
+{ lib, stdenv, fetchurl, pkg-config, gtk2, libXinerama, libSM, libXxf86vm, xorgproto
 , libX11, cairo
-, libGLSupported ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
-, withMesa ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+, 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 stdenv.lib;
+with lib;
 
 stdenv.mkDerivation rec {
   version = "2.8.12.1";
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ gtk2 libXinerama libSM libXxf86vm xorgproto libX11 cairo ]
     ++ optional withMesa libGLU;
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   hardeningDisable = [ "format" ];
 
diff --git a/nixpkgs/pkgs/development/libraries/wxwidgets/2.9/default.nix b/nixpkgs/pkgs/development/libraries/wxwidgets/2.9/default.nix
index 5db7cfc26ba9..77e0e20eaf5e 100644
--- a/nixpkgs/pkgs/development/libraries/wxwidgets/2.9/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wxwidgets/2.9/default.nix
@@ -1,7 +1,7 @@
-{ stdenv, fetchurl, pkgconfig, gtk2, libXinerama, libSM, libXxf86vm, xorgproto
+{ lib, stdenv, fetchurl, pkg-config, gtk2, libXinerama, libSM, libXxf86vm, xorgproto
 , setfile
-, libGLSupported ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
-, withMesa ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+, 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
@@ -9,7 +9,7 @@
 
 assert withMesa -> libGLU != null && libGL != null;
 
-with stdenv.lib;
+with lib;
 
 let
   version = "2.9.4";
@@ -36,7 +36,7 @@ stdenv.mkDerivation {
     ++ optional withMesa libGLU
     ++ optionals stdenv.isDarwin [ setfile Carbon Cocoa Kernel QuickTime ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   propagatedBuildInputs = optional stdenv.isDarwin AGL;
 
diff --git a/nixpkgs/pkgs/development/libraries/wxwidgets/3.0/default.nix b/nixpkgs/pkgs/development/libraries/wxwidgets/3.0/default.nix
index df90342a972e..a1c2820a5fdb 100644
--- a/nixpkgs/pkgs/development/libraries/wxwidgets/3.0/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wxwidgets/3.0/default.nix
@@ -1,8 +1,8 @@
-{ stdenv, fetchFromGitHub, fetchurl, pkgconfig
+{ lib, stdenv, fetchFromGitHub, fetchurl, pkg-config
 , libXinerama, libSM, libXxf86vm
 , gtk2, gtk3
 , xorgproto, gst_all_1, setfile
-, libGLSupported ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
 , withMesa ? libGLSupported
 , libGLU ? null, libGL ? null
 , compat24 ? false, compat26 ? true, unicode ? true
@@ -11,7 +11,7 @@
 , AGL ? null, Carbon ? null, Cocoa ? null, Kernel ? null, QTKit ? null
 }:
 
-with stdenv.lib;
+with lib;
 
 assert withMesa -> libGLU != null && libGL != null;
 assert withWebKit -> webkitgtk != null;
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
     ++ optional withWebKit webkitgtk
     ++ optionals stdenv.isDarwin [ setfile Carbon Cocoa Kernel QTKit ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   propagatedBuildInputs = optional stdenv.isDarwin AGL;
 
diff --git a/nixpkgs/pkgs/development/libraries/wxwidgets/3.0/mac.nix b/nixpkgs/pkgs/development/libraries/wxwidgets/3.0/mac.nix
index 1b4c67024515..22e818409913 100644
--- a/nixpkgs/pkgs/development/libraries/wxwidgets/3.0/mac.nix
+++ b/nixpkgs/pkgs/development/libraries/wxwidgets/3.0/mac.nix
@@ -1,11 +1,11 @@
-{ stdenv, fetchzip, expat, libiconv, libjpeg, libpng, libtiff, zlib
+{ lib, stdenv, fetchzip, expat, libiconv, libjpeg, libpng, libtiff, zlib
 # darwin only attributes
 , derez, rez, setfile
-, AGL, Cocoa, Kernel
+, AGL, Cocoa, Kernel, WebKit
 }:
 
 stdenv.mkDerivation rec {
-  version = "3.0.4";
+  version = "3.0.5.1";
   pname = "wxmac";
 
   src = fetchzip {
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   buildInputs = [
     expat libiconv libjpeg libpng libtiff zlib
     derez rez setfile
-    AGL Cocoa Kernel
+    AGL Cocoa Kernel WebKit
   ];
 
   postPatch = ''
@@ -58,7 +58,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     platforms = platforms.darwin;
     license = licenses.wxWindows;
     maintainers = [ maintainers.lnl7 ];
diff --git a/nixpkgs/pkgs/development/libraries/wxwidgets/3.1/default.nix b/nixpkgs/pkgs/development/libraries/wxwidgets/3.1/default.nix
index 8b0e6811efff..cab0197c9390 100644
--- a/nixpkgs/pkgs/development/libraries/wxwidgets/3.1/default.nix
+++ b/nixpkgs/pkgs/development/libraries/wxwidgets/3.1/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchurl
-, pkgconfig
+, pkg-config
 , libXinerama
 , libSM
 , libXxf86vm
@@ -12,7 +12,7 @@
 , xorgproto
 , gst_all_1
 , setfile
-, libGLSupported ? stdenv.lib.elem stdenv.hostPlatform.system stdenv.lib.platforms.mesaPlatforms
+, libGLSupported ? lib.elem stdenv.hostPlatform.system lib.platforms.mesaPlatforms
 , withMesa ? libGLSupported
 , libGLU ? null
 , libGL ? null
@@ -29,7 +29,7 @@
 , QTKit ? null
 }:
 
-with stdenv.lib;
+with lib;
 
 assert withMesa -> libGLU != null && libGL != null;
 assert withWebKit -> webkitgtk != null;
@@ -62,7 +62,7 @@ stdenv.mkDerivation rec {
   ++ optional withWebKit webkitgtk
   ++ optionals stdenv.isDarwin [ setfile Carbon Cocoa Kernel QTKit ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   propagatedBuildInputs = optional stdenv.isDarwin AGL;
 
diff --git a/nixpkgs/pkgs/development/libraries/x264/default.nix b/nixpkgs/pkgs/development/libraries/x264/default.nix
index 49797b5dd759..93d0b42a889f 100644
--- a/nixpkgs/pkgs/development/libraries/x264/default.nix
+++ b/nixpkgs/pkgs/development/libraries/x264/default.nix
@@ -29,12 +29,12 @@ stdenv.mkDerivation rec {
   '';
 
   configureFlags = [ "--enable-shared" ]
-    ++ stdenv.lib.optional (!stdenv.isi686) "--enable-pic"
-    ++ stdenv.lib.optional (stdenv.buildPlatform != stdenv.hostPlatform) "--cross-prefix=${stdenv.cc.targetPrefix}";
+    ++ 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 stdenv.lib; {
+  meta = with lib; {
     description = "Library for encoding H264/AVC video streams";
     homepage    = "http://www.videolan.org/developers/x264.html";
     license     = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/x265/default.nix b/nixpkgs/pkgs/development/libraries/x265/default.nix
index 3ad200cfc637..495bbc4aaabb 100644
--- a/nixpkgs/pkgs/development/libraries/x265/default.nix
+++ b/nixpkgs/pkgs/development/libraries/x265/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromBitbucket, cmake, nasm, numactl
+{ 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
@@ -21,7 +21,7 @@ let
     (mkFlag custatsSupport "DETAILED_CU_STATS")
     (mkFlag unittestsSupport "ENABLE_TESTS")
     (mkFlag werrorSupport "WARNINGS_AS_ERRORS")
-  ] ++ stdenv.lib.optionals stdenv.hostPlatform.isPower [
+  ] ++ lib.optionals stdenv.hostPlatform.isPower [
     "-DENABLE_ALTIVEC=OFF"
   ];
 
@@ -37,7 +37,6 @@ let
   buildLib = has12Bit: stdenv.mkDerivation rec {
     name = "libx265-${if has12Bit then "12" else "10"}-${version}";
     inherit src;
-    enableParallelBuilding = true;
 
     postPatch = ''
       sed -i 's/unknown/${version}/g' source/cmake/version.cmake
@@ -57,7 +56,7 @@ let
       cd source
     '';
 
-    nativeBuildInputs = [cmake nasm] ++ stdenv.lib.optional numaSupport numactl;
+    nativeBuildInputs = [cmake nasm] ++ lib.optional numaSupport numactl;
   };
 
   libx265-10 = buildLib false;
@@ -68,8 +67,6 @@ stdenv.mkDerivation rec {
   pname = "x265";
   inherit version src;
 
-  enableParallelBuilding = true;
-
   postPatch = ''
     sed -i 's/unknown/${version}/g' source/cmake/version.cmake
     sed -i 's/0.0/${version}/g' source/cmake/version.cmake
@@ -79,7 +76,7 @@ stdenv.mkDerivation rec {
     "-DENABLE_SHARED=ON"
     "-DHIGH_BIT_DEPTH=OFF"
     "-DENABLE_HDR10_PLUS=OFF"
-  ] ++ stdenv.lib.optionals (is64bit && !(stdenv.isAarch64 && stdenv.isLinux)) [
+  ] ++ 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"
@@ -95,9 +92,9 @@ stdenv.mkDerivation rec {
     rm $out/lib/*.a
   '';
 
-  nativeBuildInputs = [ cmake nasm ] ++ stdenv.lib.optional numaSupport numactl;
+  nativeBuildInputs = [ cmake nasm ] ++ lib.optional numaSupport numactl;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for encoding h.265/HEVC video streams";
     homepage    = "http://x265.org";
     license     = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/xalanc/default.nix b/nixpkgs/pkgs/development/libraries/xalanc/default.nix
index 30ab7f4496d8..b757b737f976 100644
--- a/nixpkgs/pkgs/development/libraries/xalanc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xalanc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, xercesc, getopt }:
+{ lib, stdenv, fetchurl, xercesc, getopt }:
 
 let
   platform = if stdenv.isLinux then "linux" else
@@ -25,8 +25,8 @@ in stdenv.mkDerivation rec {
   meta = {
     homepage = "http://xalan.apache.org/";
     description = "A XSLT processor for transforming XML documents";
-    license = stdenv.lib.licenses.asl20;
-    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
-    maintainers = [ stdenv.lib.maintainers.jagajaga ];
+    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
index 195aea5c2f18..cfca33a62d2e 100644
--- a/nixpkgs/pkgs/development/libraries/xapian/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xapian/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook
+{ lib, stdenv, fetchurl, autoreconfHook
 , libuuid, zlib }:
 
 let
@@ -20,16 +20,16 @@ let
     doCheck = true;
     AUTOMATED_TESTING = true; # https://trac.xapian.org/changeset/8be35f5e1/git
 
-    patches = stdenv.lib.optionals stdenv.isDarwin [ ./skip-flaky-darwin-test.patch ];
+    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 = stdenv.lib.optionalString stdenv.isDarwin ''
+    postConfigure = lib.optionalString stdenv.isDarwin ''
       substituteInPlace config.h \
         --replace "#define HAVE___EXP10 1" "#undef HAVE___EXP10"
     '';
 
-    meta = with stdenv.lib; {
+    meta = with lib; {
       description = "Search engine library";
       homepage = "https://xapian.org/";
       license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/xapian/tools/omega/default.nix b/nixpkgs/pkgs/development/libraries/xapian/tools/omega/default.nix
index a496e3886d83..79e5786f0488 100644
--- a/nixpkgs/pkgs/development/libraries/xapian/tools/omega/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xapian/tools/omega/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, xapian, perl, pcre, zlib, libmagic }:
+{ lib, stdenv, fetchurl, pkg-config, xapian, perl, pcre, zlib, libmagic }:
 
 stdenv.mkDerivation rec {
   pname = "xapian-omega";
@@ -10,9 +10,9 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ xapian perl pcre zlib libmagic ];
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Indexer and CGI search front-end built on Xapian library";
     homepage = "https://xapian.org/";
     license = licenses.gpl2Plus;
diff --git a/nixpkgs/pkgs/development/libraries/xavs/default.nix b/nixpkgs/pkgs/development/libraries/xavs/default.nix
index 18b10376315f..11d73a9decb7 100644
--- a/nixpkgs/pkgs/development/libraries/xavs/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xavs/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchsvn }:
+{ lib, stdenv, fetchsvn }:
 
 stdenv.mkDerivation rec {
   pname = "xavs";
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
     patchShebangs tools/patcheck
     patchShebangs tools/regression-test.pl
     patchShebangs tools/xavs-format
-    '' + stdenv.lib.optionalString stdenv.isDarwin ''
+    '' + lib.optionalString stdenv.isDarwin ''
     substituteInPlace config.guess --replace 'uname -p' 'uname -m'
     substituteInPlace configure \
       --replace '-O4' '-O3' \
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
     "--disable-asm"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "AVS encoder and decoder";
     homepage    = "http://xavs.sourceforge.net/";
     license     = licenses.lgpl2;
diff --git a/nixpkgs/pkgs/development/libraries/xbase/default.nix b/nixpkgs/pkgs/development/libraries/xbase/default.nix
index ae7ceb18c0ab..db36c2a34c15 100644
--- a/nixpkgs/pkgs/development/libraries/xbase/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xbase/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation {
   name = "xbase-3.1.2";
@@ -25,7 +25,7 @@ stdenv.mkDerivation {
     })
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://linux.techass.com/projects/xdb/";
     description = "C++ class library formerly known as XDB";
     platforms = platforms.linux;
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..a3bcc822b367
--- /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.2";
+
+  src = fetchFromGitHub {
+    owner = "fcitx";
+    repo = "xcb-imdkit";
+    rev = version;
+    sha256 = "sha256-ISaVsMtDsyfhbhsAwDSWkQ7ZcpNtvC7M9NFQsWA5ju8=";
+  };
+
+  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
index 5457487edcc7..f296f59d408b 100644
--- a/nixpkgs/pkgs/development/libraries/xcb-util-cursor/HEAD.nix
+++ b/nixpkgs/pkgs/development/libraries/xcb-util-cursor/HEAD.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, autoconf, automake, libtool, pkgconfig
+{ lib, stdenv, fetchgit, autoconf, automake, libtool, pkg-config
 , xorg, gnum4, libxcb, gperf }:
 
 stdenv.mkDerivation {
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
     sha256 = "127zfmihd8nqlj8jjaja06xb84xdgl263w0av1xnprx05mkbkcyc";
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "XCB cursor library (libxcursor port)";
     homepage    = "https://cgit.freedesktop.org/xcb/util-cursor";
     license     = licenses.mit;
@@ -28,7 +28,7 @@ stdenv.mkDerivation {
     gperf
     libtool
     libxcb
-    pkgconfig
+    pkg-config
     xorg.utilmacros
     xorg.xcbutilimage
     xorg.xcbutilrenderutil
diff --git a/nixpkgs/pkgs/development/libraries/xdg-dbus-proxy/default.nix b/nixpkgs/pkgs/development/libraries/xdg-dbus-proxy/default.nix
index 38d7d447e289..21d6b6fa73e8 100644
--- a/nixpkgs/pkgs/development/libraries/xdg-dbus-proxy/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xdg-dbus-proxy/default.nix
@@ -1,6 +1,6 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
-, pkgconfig
+, pkg-config
 , libxslt
 , docbook_xsl
 , docbook_xml_dtd_43
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [
-    pkgconfig
+    pkg-config
     libxslt
     docbook_xsl
     docbook_xml_dtd_43
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
   # dbus[2345]: Failed to start message bus: Failed to open "/etc/dbus-1/session.conf": No such file or directory
   doCheck = false;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "DBus proxy for Flatpak and others";
     homepage = "https://github.com/flatpak/xdg-dbus-proxy";
     license = licenses.lgpl21Plus;
diff --git a/nixpkgs/pkgs/development/libraries/xdg-desktop-portal-gtk/default.nix b/nixpkgs/pkgs/development/libraries/xdg-desktop-portal-gtk/default.nix
index b7e589485534..be96001c46fb 100644
--- a/nixpkgs/pkgs/development/libraries/xdg-desktop-portal-gtk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xdg-desktop-portal-gtk/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , autoreconfHook
 , pkg-config
@@ -38,7 +38,7 @@ stdenv.mkDerivation rec {
     gnome3.gnome-settings-daemon # schemas needed for settings api (fonts, etc)
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Desktop integration portals for sandboxed apps";
     maintainers = with maintainers; [ jtojnar ];
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/xdg-desktop-portal-wlr/default.nix b/nixpkgs/pkgs/development/libraries/xdg-desktop-portal-wlr/default.nix
index c6faa4fc017a..151c74f0b70d 100644
--- a/nixpkgs/pkgs/development/libraries/xdg-desktop-portal-wlr/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xdg-desktop-portal-wlr/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchFromGitHub
-, meson, ninja, pkgconfig, wayland-protocols
+{ lib, stdenv, fetchFromGitHub
+, meson, ninja, pkg-config, wayland-protocols
 , pipewire, wayland, elogind, systemd, libdrm }:
 
 stdenv.mkDerivation rec {
@@ -13,10 +13,10 @@ stdenv.mkDerivation rec {
     sha256 = "12k92h9dmn1fyn8nzxk69cyv0gnb7g9gj7a66mw5dcl5zqnl07nc";
   };
 
-  nativeBuildInputs = [ meson ninja pkgconfig wayland-protocols ];
+  nativeBuildInputs = [ meson ninja pkg-config wayland-protocols ];
   buildInputs = [ pipewire wayland elogind systemd libdrm ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/emersion/xdg-desktop-portal-wlr";
     description = "xdg-desktop-portal backend for wlroots";
     maintainers = with maintainers; [ minijackson ];
diff --git a/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix b/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix
index 83b4dda0c6e2..cab358528311 100644
--- a/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xdg-desktop-portal/default.nix
@@ -1,9 +1,9 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , nixosTests
 , substituteAll
 , autoreconfHook
-, pkgconfig
+, pkg-config
 , libxml2
 , glib
 , pipewire
@@ -42,7 +42,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [
     autoreconfHook
-    pkgconfig
+    pkg-config
     libxml2
     wrapGAppsHook
   ];
@@ -76,7 +76,7 @@ stdenv.mkDerivation rec {
     };
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Desktop integration portals for sandboxed apps";
     license = licenses.lgpl21;
     maintainers = with maintainers; [ jtojnar ];
diff --git a/nixpkgs/pkgs/development/libraries/xed/default.nix b/nixpkgs/pkgs/development/libraries/xed/default.nix
index 1d6dcdc67ade..395b399d8fe2 100644
--- a/nixpkgs/pkgs/development/libraries/xed/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xed/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, python3Packages }:
+{ lib, stdenv, fetchFromGitHub, python3Packages }:
 
 let
   # mbuild is a custom build system used only to build xed
@@ -36,7 +36,7 @@ in stdenv.mkDerivation rec {
 
   dontInstall = true; # already installed during buildPhase
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Intel X86 Encoder Decoder (Intel XED)";
     homepage    = "https://intelxed.github.io/";
     license     = licenses.apsl20;
diff --git a/nixpkgs/pkgs/development/libraries/xercesc/default.nix b/nixpkgs/pkgs/development/libraries/xercesc/default.nix
index 8c7b12320148..f5109a1ebd6a 100644
--- a/nixpkgs/pkgs/development/libraries/xercesc/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xercesc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl }:
+{ lib, stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
   pname = "xerces-c";
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = "https://xerces.apache.org/xerces-c/";
     description = "Validating XML parser written in a portable subset of C++";
-    license = stdenv.lib.licenses.asl20;
-    platforms = stdenv.lib.platforms.linux ++ stdenv.lib.platforms.darwin;
+    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
index d9d660062a25..973e7dc028e0 100644
--- a/nixpkgs/pkgs/development/libraries/xgboost/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xgboost/default.nix
@@ -17,8 +17,6 @@ stdenv.mkDerivation rec {
     sha256 = "1zs15k9crkiq7bnr4gqq53mkn3w8z9dq4nwlavmfcr5xr5gw2pw4";
   };
 
-  enableParallelBuilding = true;
-
   nativeBuildInputs = [ cmake ] ++ lib.optional stdenv.isDarwin llvmPackages.openmp;
 
   buildInputs = lib.optional cudaSupport cudatoolkit
@@ -36,7 +34,7 @@ stdenv.mkDerivation rec {
     install -Dm755 ../xgboost $out/bin/xgboost
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Scalable, Portable and Distributed Gradient Boosting (GBDT, GBRT or GBM) Library";
     homepage = "https://github.com/dmlc/xgboost";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/xine-lib/default.nix b/nixpkgs/pkgs/development/libraries/xine-lib/default.nix
index 4322278e2fd6..cbdc1a2dcf0b 100644
--- a/nixpkgs/pkgs/development/libraries/xine-lib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xine-lib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, pkgconfig, xorg, alsaLib, libGLU, libGL, aalib
+{ lib, stdenv, fetchurl, fetchpatch, pkg-config, xorg, alsaLib, libGLU, libGL, aalib
 , libvorbis, libtheora, speex, zlib, perl, ffmpeg_3
 , flac, libcaca, libpulseaudio, libmng, libcdio, libv4l, vcdimager
 , libmpcdec
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
     sha256 = "13clir4qxl2zvsvvjd9yv3yrdhsnvcn5s7ambbbn5dzy9604xcrj";
   };
 
-  nativeBuildInputs = [ pkgconfig perl ];
+  nativeBuildInputs = [ pkg-config perl ];
 
   buildInputs = [
     xorg.libX11 xorg.libXv xorg.libXinerama xorg.libxcb xorg.libXext
@@ -34,7 +34,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.xine-project.org/";
     description = "A high-performance, portable and reusable multimedia playback engine";
     platforms = platforms.linux;
diff --git a/nixpkgs/pkgs/development/libraries/xlibs-wrapper/default.nix b/nixpkgs/pkgs/development/libraries/xlibs-wrapper/default.nix
index 049c54d792b4..735cc278debf 100644
--- a/nixpkgs/pkgs/development/libraries/xlibs-wrapper/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xlibs-wrapper/default.nix
@@ -1,4 +1,4 @@
-{stdenv, packages}:
+{lib, stdenv, packages}:
 
 stdenv.mkDerivation {
   name = "xlibs-wrapper";
@@ -16,6 +16,6 @@ stdenv.mkDerivation {
   buildClientLibs = true;
 
   meta = {
-    platforms = stdenv.lib.platforms.unix;
+    platforms = lib.platforms.unix;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/xlslib/default.nix b/nixpkgs/pkgs/development/libraries/xlslib/default.nix
index ee3942c360b7..77a11b531100 100644
--- a/nixpkgs/pkgs/development/libraries/xlslib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xlslib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, autoreconfHook, unzip }:
+{ lib, stdenv, fetchurl, autoreconfHook, unzip }:
 
 stdenv.mkDerivation rec {
   pname = "xlslib";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "C++/C library to construct Excel .xls files in code";
     homepage = "https://sourceforge.net/projects/xlslib/";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/xml-security-c/default.nix b/nixpkgs/pkgs/development/libraries/xml-security-c/default.nix
index 3a784a2e38b2..7548a45e5d41 100644
--- a/nixpkgs/pkgs/development/libraries/xml-security-c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xml-security-c/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, xalanc, xercesc, openssl, pkgconfig }:
+{ lib, stdenv, fetchurl, xalanc, xercesc, openssl, pkg-config }:
 
 stdenv.mkDerivation rec {
   pname = "xml-security-c";
@@ -15,14 +15,14 @@ stdenv.mkDerivation rec {
     "--with-xalan"
   ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
   buildInputs = [ xalanc xercesc openssl ];
 
   meta = {
     homepage = "http://santuario.apache.org/";
     description = "C++ Implementation of W3C security standards for XML";
-    license = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = [ stdenv.lib.maintainers.jagajaga ];
+    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
index d5e1eb08fa49..9cf3ddb92190 100644
--- a/nixpkgs/pkgs/development/libraries/xml-tooling-c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xml-tooling-c/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchgit, autoreconfHook, pkgconfig
+{ lib, stdenv, fetchgit, autoreconfHook, pkg-config
 , boost, curl, openssl, log4shib, xercesc, xml-security-c
 }:
 
@@ -13,11 +13,11 @@ stdenv.mkDerivation rec {
   };
 
   buildInputs = [ boost curl openssl log4shib xercesc xml-security-c ];
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
+  nativeBuildInputs = [ autoreconfHook pkg-config ];
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/xmlrpc-c/default.nix b/nixpkgs/pkgs/development/libraries/xmlrpc-c/default.nix
index 41cdbf0b4f16..7b6907a01627 100644
--- a/nixpkgs/pkgs/development/libraries/xmlrpc-c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xmlrpc-c/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, curl, libxml2 }:
+{ lib, stdenv, fetchurl, curl, libxml2 }:
 
 stdenv.mkDerivation rec {
   name = "xmlrpc-c-1.51.06";
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "format" ];
 
-  meta = with stdenv.lib; {
+  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",
diff --git a/nixpkgs/pkgs/development/libraries/xmlsec/default.nix b/nixpkgs/pkgs/development/libraries/xmlsec/default.nix
index 6d310443e70c..8bf987609500 100644
--- a/nixpkgs/pkgs/development/libraries/xmlsec/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xmlsec/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, libxml2, gnutls, libxslt, pkgconfig, libgcrypt, libtool
+{ 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 }:
@@ -18,14 +18,14 @@ stdenv.mkDerivation {
 
   patches = [
     ./lt_dladdsearchdir.patch
-  ] ++ stdenv.lib.optionals stdenv.isDarwin [ ./remove_bsd_base64_decode_flag.patch ];
+  ] ++ lib.optionals stdenv.isDarwin [ ./remove_bsd_base64_decode_flag.patch ];
   postPatch = ''
     substituteAllInPlace src/dl.c
   '';
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ pkgconfig ];
+  nativeBuildInputs = [ pkg-config ];
 
   buildInputs = [ libxml2 gnutls libxslt libgcrypt libtool openssl nss_3_53 ];
 
@@ -52,7 +52,7 @@ stdenv.mkDerivation {
 
   passthru.tests.libxmlsec1-crypto = runCommandCC "libxmlsec1-crypto-test"
     {
-      nativeBuildInputs = [ pkgconfig ];
+      nativeBuildInputs = [ pkg-config ];
       buildInputs = [ self libxml2 libxslt libtool ];
     } ''
     $CC $(pkg-config --cflags --libs xmlsec1) -o crypto-test ${writeText "crypto-test.c" ''
@@ -76,8 +76,8 @@ stdenv.mkDerivation {
     homepage = "http://www.aleksey.com/xmlsec";
     downloadPage = "https://www.aleksey.com/xmlsec/download.html";
     description = "XML Security Library in C based on libxml2";
-    license = stdenv.lib.licenses.mit;
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
+    license = lib.licenses.mit;
+    platforms = with lib.platforms; linux ++ darwin;
     updateWalker = true;
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/xsd/default.nix b/nixpkgs/pkgs/development/libraries/xsd/default.nix
index 7541ee427045..2d614ee0e731 100644
--- a/nixpkgs/pkgs/development/libraries/xsd/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xsd/default.nix
@@ -1,9 +1,8 @@
-{ stdenv, fetchurl, xercesc }:
+{ lib, stdenv, fetchurl, xercesc }:
 
 let
-  fixed_paths = ''LDFLAGS="-L${xercesc}/lib" CPPFLAGS="-I${xercesc}/include"'';
 in
-stdenv.mkDerivation {
+stdenv.mkDerivation rec {
   pname = "xsd";
   version = "4.0.0";
 
@@ -14,25 +13,27 @@ stdenv.mkDerivation {
 
   patches = [ ./xsdcxx.patch ];
 
-  configurePhase = ''
+  postPatch = ''
     patchShebangs .
   '';
 
-  buildPhase = ''
-    make ${fixed_paths}
-  '';
+  enableParallelBuilding = true;
 
-  buildInputs = [ xercesc ];
+  buildFlags = [
+    "LDFLAGS=-L${xercesc}/lib"
+    "CPPFLAGS=-I${xercesc}/include"
+  ];
+  installFlags = buildFlags ++ [
+    "install_prefix=${placeholder "out"}"
+  ];
 
-  installPhase = ''
-    make ${fixed_paths} install_prefix="$out" install
-  '';
+  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 = stdenv.lib.licenses.gpl2;
-    platforms = stdenv.lib.platforms.linux;
-    maintainers = [ stdenv.lib.maintainers.jagajaga ];
+    license = lib.licenses.gpl2;
+    platforms = lib.platforms.linux;
+    maintainers = [ lib.maintainers.jagajaga ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/xvidcore/default.nix b/nixpkgs/pkgs/development/libraries/xvidcore/default.nix
index ab68693ea5ef..dbc3d837a45a 100644
--- a/nixpkgs/pkgs/development/libraries/xvidcore/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xvidcore/default.nix
@@ -1,6 +1,6 @@
-{ stdenv, fetchurl, yasm, autoconf, automake, libtool }:
+{ lib, stdenv, fetchurl, yasm, autoconf, automake, libtool }:
 
-with stdenv.lib;
+with lib;
 stdenv.mkDerivation rec {
   pname = "xvidcore";
   version = "1.3.5";
diff --git a/nixpkgs/pkgs/development/libraries/xxHash/default.nix b/nixpkgs/pkgs/development/libraries/xxHash/default.nix
index e572e8bb31ff..fbeadc2b353a 100644
--- a/nixpkgs/pkgs/development/libraries/xxHash/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xxHash/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   pname = "xxHash";
@@ -11,11 +11,18 @@ stdenv.mkDerivation rec {
     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 stdenv.lib; {
+  meta = with lib; {
     description = "Extremely fast hash algorithm";
     longDescription = ''
       xxHash is an Extremely fast Hash algorithm, running at RAM speed limits.
diff --git a/nixpkgs/pkgs/development/libraries/xylib/default.nix b/nixpkgs/pkgs/development/libraries/xylib/default.nix
index 2b4cb1d56dae..f7d7eed7e70e 100644
--- a/nixpkgs/pkgs/development/libraries/xylib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/xylib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, boost, zlib, bzip2, wxGTK30 }:
+{ lib, stdenv, fetchurl, boost, zlib, bzip2, wxGTK30 }:
 
 stdenv.mkDerivation rec {
   pname = "xylib";
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ boost zlib bzip2 wxGTK30 ];
 
-  meta = with stdenv.lib; {
+  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/";
diff --git a/nixpkgs/pkgs/development/libraries/yajl/default.nix b/nixpkgs/pkgs/development/libraries/yajl/default.nix
index 62fe652724f8..df47168c79b7 100644
--- a/nixpkgs/pkgs/development/libraries/yajl/default.nix
+++ b/nixpkgs/pkgs/development/libraries/yajl/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, cmake }:
+{ lib, stdenv, fetchurl, cmake }:
 
 stdenv.mkDerivation rec {
   name = "yajl-2.1.0";
@@ -18,8 +18,8 @@ stdenv.mkDerivation rec {
       C, and a small validating JSON generator.
     '';
     homepage = "http://lloyd.github.com/yajl/";
-    license = stdenv.lib.licenses.isc;
-    platforms = with stdenv.lib.platforms; linux ++ darwin;
-    maintainers = with stdenv.lib.maintainers; [ maggesi ];
+    license = lib.licenses.isc;
+    platforms = with lib.platforms; linux ++ darwin;
+    maintainers = with lib.maintainers; [ maggesi ];
   };
 }
diff --git a/nixpkgs/pkgs/development/libraries/yojimbo/default.nix b/nixpkgs/pkgs/development/libraries/yojimbo/default.nix
index 9e6cc37e661c..b72820c77a68 100644
--- a/nixpkgs/pkgs/development/libraries/yojimbo/default.nix
+++ b/nixpkgs/pkgs/development/libraries/yojimbo/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, premake5, doxygen, libsodium, mbedtls }:
+{ lib, stdenv, fetchFromGitHub, premake5, doxygen, libsodium, mbedtls }:
 
 stdenv.mkDerivation {
   pname = "yojimbo";
@@ -28,7 +28,7 @@ stdenv.mkDerivation {
 
   doCheck = true;
 
-  meta = with stdenv.lib; {
+  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.
diff --git a/nixpkgs/pkgs/development/libraries/yubico-pam/default.nix b/nixpkgs/pkgs/development/libraries/yubico-pam/default.nix
index 60d3defcb1ff..1289b03618c6 100644
--- a/nixpkgs/pkgs/development/libraries/yubico-pam/default.nix
+++ b/nixpkgs/pkgs/development/libraries/yubico-pam/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig
+{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config
 , asciidoc, libxslt, docbook_xsl
 , pam, yubikey-personalization, libyubikey, libykclient }:
 
@@ -12,10 +12,10 @@ stdenv.mkDerivation rec {
     sha256 = "10dq8dqi3jldllj6p8r9hldx9sank9n82c44w8akxrs1vli6nj3m";
   };
 
-  nativeBuildInputs = [ autoreconfHook pkgconfig asciidoc libxslt docbook_xsl ];
+  nativeBuildInputs = [ autoreconfHook pkg-config asciidoc libxslt docbook_xsl ];
   buildInputs = [ pam yubikey-personalization libyubikey libykclient ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Yubico PAM module";
     homepage = "https://developers.yubico.com/yubico-pam";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/zchunk/default.nix b/nixpkgs/pkgs/development/libraries/zchunk/default.nix
index a0cb85ed71ab..a0d1378aa708 100644
--- a/nixpkgs/pkgs/development/libraries/zchunk/default.nix
+++ b/nixpkgs/pkgs/development/libraries/zchunk/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitHub
 , fetchpatch
-, pkgconfig
+, pkg-config
 , meson
 , ninja
 , zstd
@@ -25,13 +25,13 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     meson
     ninja
-    pkgconfig
+    pkg-config
   ];
 
   buildInputs = [
     zstd
     curl
-  ] ++ stdenv.lib.optional stdenv.isDarwin argp-standalone;
+  ] ++ lib.optional stdenv.isDarwin argp-standalone;
 
   # Darwin needs a patch for argp-standalone usage and differing endian.h location on macOS
   # https://github.com/zchunk/zchunk/pull/35
@@ -43,7 +43,7 @@ stdenv.mkDerivation rec {
   })
 ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "File format designed for highly efficient deltas while maintaining good compression";
     homepage = "https://github.com/zchunk/zchunk";
     license = licenses.bsd2;
diff --git a/nixpkgs/pkgs/development/libraries/zeitgeist/default.nix b/nixpkgs/pkgs/development/libraries/zeitgeist/default.nix
index 95f09f595048..039ecc610f41 100644
--- a/nixpkgs/pkgs/development/libraries/zeitgeist/default.nix
+++ b/nixpkgs/pkgs/development/libraries/zeitgeist/default.nix
@@ -1,7 +1,7 @@
-{ stdenv
+{ lib, stdenv
 , fetchFromGitLab
 , fetchpatch
-, pkgconfig
+, pkg-config
 , glib
 , sqlite
 , gobject-introspection
@@ -22,7 +22,7 @@ stdenv.mkDerivation rec {
   pname = "zeitgeist";
   version = "1.0.2";
 
-  outputs = [ "out" "lib" "dev" "man" ] ++ stdenv.lib.optional pythonSupport "py";
+  outputs = [ "out" "lib" "dev" "man" ] ++ lib.optional pythonSupport "py";
 
   src = fetchFromGitLab {
     domain = "gitlab.freedesktop.org";
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
     autoconf
     automake
     libtool
-    pkgconfig
+    pkg-config
     gettext
     gobject-introspection
     vala
@@ -75,11 +75,11 @@ stdenv.mkDerivation rec {
     NOCONFIGURE=1 ./autogen.sh
   '';
 
-  postFixup = stdenv.lib.optionalString pythonSupport ''
+  postFixup = lib.optionalString pythonSupport ''
     moveToOutput lib/${python3.libPrefix} "$py"
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "A service which logs the users’s activities and events";
     homepage = "https://zeitgeist.freedesktop.org/";
     maintainers = with maintainers; [ lethalman worldofpeace ];
diff --git a/nixpkgs/pkgs/development/libraries/zeroc-ice/3.6.nix b/nixpkgs/pkgs/development/libraries/zeroc-ice/3.6.nix
index 7f6c7323fff3..896973e32eb8 100644
--- a/nixpkgs/pkgs/development/libraries/zeroc-ice/3.6.nix
+++ b/nixpkgs/pkgs/development/libraries/zeroc-ice/3.6.nix
@@ -58,7 +58,7 @@ stdenv.mkDerivation rec {
     rm -rf $out/share/slice
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "http://www.zeroc.com/ice.html";
     description = "The internet communications engine";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/zeroc-ice/default.nix b/nixpkgs/pkgs/development/libraries/zeroc-ice/default.nix
index 2fb36c0aea58..ef16e381bcfd 100644
--- a/nixpkgs/pkgs/development/libraries/zeroc-ice/default.nix
+++ b/nixpkgs/pkgs/development/libraries/zeroc-ice/default.nix
@@ -63,7 +63,7 @@ in stdenv.mkDerivation rec {
     mv $out/share/ice $dev/share
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://www.zeroc.com/ice.html";
     description = "The internet communications engine";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/zeromq/4.x.nix b/nixpkgs/pkgs/development/libraries/zeromq/4.x.nix
index d5819ff7ee9a..a3c35d123b6a 100644
--- a/nixpkgs/pkgs/development/libraries/zeromq/4.x.nix
+++ b/nixpkgs/pkgs/development/libraries/zeromq/4.x.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, asciidoc, pkg-config, libsodium
+{ lib, stdenv, fetchFromGitHub, cmake, asciidoc, pkg-config, libsodium
 , enableDrafts ? false }:
 
 stdenv.mkDerivation rec {
@@ -15,13 +15,11 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ cmake asciidoc pkg-config ];
   buildInputs = [ libsodium ];
 
-  enableParallelBuilding = true;
-
   doCheck = false; # fails all the tests (ctest)
 
-  cmakeFlags = stdenv.lib.optional enableDrafts "-DENABLE_DRAFTS=ON";
+  cmakeFlags = lib.optional enableDrafts "-DENABLE_DRAFTS=ON";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     branch = "4";
     homepage = "http://www.zeromq.org";
     description = "The Intelligent Transport Layer";
diff --git a/nixpkgs/pkgs/development/libraries/zimg/default.nix b/nixpkgs/pkgs/development/libraries/zimg/default.nix
index afb13a03cbbf..56ced97653ea 100644
--- a/nixpkgs/pkgs/development/libraries/zimg/default.nix
+++ b/nixpkgs/pkgs/development/libraries/zimg/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, autoreconfHook }:
+{ lib, stdenv, fetchFromGitHub, autoreconfHook }:
 
 stdenv.mkDerivation rec {
   pname = "zimg";
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Scaling, colorspace conversion and dithering library";
     homepage    = "https://github.com/sekrit-twc/zimg";
     license     = licenses.wtfpl;
diff --git a/nixpkgs/pkgs/development/libraries/zimlib/default.nix b/nixpkgs/pkgs/development/libraries/zimlib/default.nix
index 7f5168080fa3..6dc998cd0e27 100644
--- a/nixpkgs/pkgs/development/libraries/zimlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/zimlib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, lzma }:
+{ lib, stdenv, fetchurl, lzma }:
 
 stdenv.mkDerivation rec {
   pname = "zimlib";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library for reading and writing ZIM files";
     homepage =  "https://www.openzim.org/wiki/Zimlib";
     license = licenses.gpl2;
diff --git a/nixpkgs/pkgs/development/libraries/zlib/default.nix b/nixpkgs/pkgs/development/libraries/zlib/default.nix
index b780fcda3930..da8aac5229b6 100644
--- a/nixpkgs/pkgs/development/libraries/zlib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/zlib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , shared ? !stdenv.hostPlatform.isStatic
 , static ? true
@@ -33,9 +33,9 @@ stdenv.mkDerivation (rec {
     sha256 = "c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1";
   };
 
-  patches = stdenv.lib.optional stdenv.hostPlatform.isCygwin ./disable-cygwin-widechar.patch;
+  patches = lib.optional stdenv.hostPlatform.isCygwin ./disable-cygwin-widechar.patch;
 
-  postPatch = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+  postPatch = lib.optionalString stdenv.hostPlatform.isDarwin ''
     substituteInPlace configure \
       --replace '/usr/bin/libtool' 'ar' \
       --replace 'AR="libtool"' 'AR="ar"' \
@@ -43,7 +43,7 @@ stdenv.mkDerivation (rec {
   '';
 
   outputs = [ "out" "dev" ]
-    ++ stdenv.lib.optional splitStaticOutput "static";
+    ++ lib.optional splitStaticOutput "static";
   setOutputFlags = false;
   outputDoc = "dev"; # single tiny man3 page
 
@@ -60,8 +60,8 @@ stdenv.mkDerivation (rec {
   # 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 = stdenv.lib.optional (static && !shared) "--static"
-                   ++ stdenv.lib.optional shared "--shared";
+  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
@@ -71,33 +71,33 @@ stdenv.mkDerivation (rec {
   # here (in case zlib ever switches to autoconf in the future),
   # but we don't do it simply to avoid mass rebuilds.
 
-  postInstall = stdenv.lib.optionalString splitStaticOutput ''
+  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.
-  + stdenv.lib.optionalString stdenv.hostPlatform.isDarwin ''
+  + 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.
-  + stdenv.lib.optionalString (stdenv.hostPlatform.libc == "msvcrt") ''
+  + lib.optionalString (stdenv.hostPlatform.libc == "msvcrt") ''
     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 = stdenv.lib.optionalString (!stdenv.hostPlatform.isDarwin) "-static-libgcc";
+  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 = stdenv.lib.optionals (stdenv.hostPlatform.libc == "msvcrt") [
+  installFlags = lib.optionals (stdenv.hostPlatform.libc == "msvcrt") [
     "BINARY_PATH=$(out)/bin"
     "INCLUDE_PATH=$(dev)/include"
     "LIBRARY_PATH=$(out)/lib"
@@ -108,9 +108,9 @@ stdenv.mkDerivation (rec {
 
   makeFlags = [
     "PREFIX=${stdenv.cc.targetPrefix}"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform.libc == "msvcrt") [
+  ] ++ lib.optionals (stdenv.hostPlatform.libc == "msvcrt") [
     "-f" "win32/Makefile.gcc"
-  ] ++ stdenv.lib.optionals shared [
+  ] ++ 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"
@@ -120,16 +120,16 @@ stdenv.mkDerivation (rec {
     inherit version;
   };
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://zlib.net";
     description = "Lossless data-compression library";
     license = licenses.zlib;
     platforms = platforms.all;
   };
-} // stdenv.lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
+} // lib.optionalAttrs (stdenv.hostPlatform != stdenv.buildPlatform) {
   preConfigure = ''
     export CHOST=${stdenv.hostPlatform.config}
   '';
-} // stdenv.lib.optionalAttrs (stdenv.hostPlatform.libc == "msvcrt") {
+} // lib.optionalAttrs (stdenv.hostPlatform.libc == "msvcrt") {
   dontConfigure = true;
 })
diff --git a/nixpkgs/pkgs/development/libraries/zlog/default.nix b/nixpkgs/pkgs/development/libraries/zlog/default.nix
index f0ca99b76679..b115cf7b675b 100644
--- a/nixpkgs/pkgs/development/libraries/zlog/default.nix
+++ b/nixpkgs/pkgs/development/libraries/zlog/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 
 stdenv.mkDerivation rec {
   version = "1.2.15";
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "PREFIX=${placeholder "out"}" ];
 
-  meta = with stdenv.lib; {
+  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;
diff --git a/nixpkgs/pkgs/development/libraries/zmqpp/default.nix b/nixpkgs/pkgs/development/libraries/zmqpp/default.nix
index 98211e6e3eb5..733573b3e237 100644
--- a/nixpkgs/pkgs/development/libraries/zmqpp/default.nix
+++ b/nixpkgs/pkgs/development/libraries/zmqpp/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, cmake, pkgconfig, zeromq }:
+{ lib, stdenv, fetchFromGitHub, cmake, pkg-config, zeromq }:
 
 stdenv.mkDerivation rec {
   pname = "zmqpp";
@@ -13,11 +13,11 @@ stdenv.mkDerivation rec {
 
   outputs = [ "out" "dev" ];
 
-  nativeBuildInputs = [ cmake pkgconfig ];
+  nativeBuildInputs = [ cmake pkg-config ];
 
   propagatedBuildInputs = [ zeromq ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     inherit (src.meta) homepage;
     description = "C++ wrapper for czmq. Aims to be minimal, simple and consistent";
     license = licenses.lgpl3;
diff --git a/nixpkgs/pkgs/development/libraries/zookeeper_mt/default.nix b/nixpkgs/pkgs/development/libraries/zookeeper_mt/default.nix
index ea786d770eb6..978321f96e7e 100644
--- a/nixpkgs/pkgs/development/libraries/zookeeper_mt/default.nix
+++ b/nixpkgs/pkgs/development/libraries/zookeeper_mt/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , fetchurl
 , autoreconfHook
 , jre
@@ -10,7 +10,7 @@
 
 stdenv.mkDerivation rec {
   pname = "zookeeper_mt";
-  version = stdenv.lib.getVersion zookeeper;
+  version = lib.getVersion zookeeper;
 
   src = fetchurl {
     url = "mirror://apache/zookeeper/${zookeeper.pname}-${version}/apache-${zookeeper.pname}-${version}.tar.gz";
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
     "--without-cppunit"
   ];
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://zookeeper.apache.org";
     description = "Apache Zookeeper";
     license = licenses.asl20;
diff --git a/nixpkgs/pkgs/development/libraries/zxcvbn-c/default.nix b/nixpkgs/pkgs/development/libraries/zxcvbn-c/default.nix
index 7a524e72318f..e74bb9ddc32e 100644
--- a/nixpkgs/pkgs/development/libraries/zxcvbn-c/default.nix
+++ b/nixpkgs/pkgs/development/libraries/zxcvbn-c/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub }:
+{ lib, stdenv, fetchFromGitHub }:
 stdenv.mkDerivation rec {
   pname = "zxcvbn-c";
   version = "2.4";
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     install -D -t $out/lib libzxcvbn.so*
   '';
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     homepage = "https://github.com/tsyrogit/zxcvbn-c";
     description = "A C/C++ implementation of the zxcvbn password strength estimation";
     license = licenses.mit;
diff --git a/nixpkgs/pkgs/development/libraries/zziplib/default.nix b/nixpkgs/pkgs/development/libraries/zziplib/default.nix
index 228dfdcf77a4..8cfec83af542 100644
--- a/nixpkgs/pkgs/development/libraries/zziplib/default.nix
+++ b/nixpkgs/pkgs/development/libraries/zziplib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv
+{ lib, stdenv
 , perl
 , pkg-config
 , fetchFromGitHub
@@ -58,7 +58,7 @@ stdenv.mkDerivation rec {
   doCheck = false;
   checkTarget = "check";
 
-  meta = with stdenv.lib; {
+  meta = with lib; {
     description = "Library to extract data from files archived in a zip file";
 
     longDescription = ''