summary refs log tree commit diff
path: root/pkgs/development/libraries
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries')
-rw-r--r--pkgs/development/libraries/argp-standalone/default.nix2
-rw-r--r--pkgs/development/libraries/audiofile/default.nix5
-rw-r--r--pkgs/development/libraries/aws-c-common/default.nix6
-rw-r--r--pkgs/development/libraries/aws-sdk-cpp/default.nix3
-rw-r--r--pkgs/development/libraries/bamf/default.nix4
-rw-r--r--pkgs/development/libraries/bctoolbox/default.nix2
-rw-r--r--pkgs/development/libraries/belle-sip/default.nix2
-rw-r--r--pkgs/development/libraries/blitz/default.nix2
-rw-r--r--pkgs/development/libraries/boost/generic.nix2
-rw-r--r--pkgs/development/libraries/buddy/default.nix4
-rw-r--r--pkgs/development/libraries/ccrtp/1.8.nix24
-rw-r--r--pkgs/development/libraries/ccrtp/gcc-4.6-fix.patch20
-rw-r--r--pkgs/development/libraries/cfitsio/default.nix2
-rw-r--r--pkgs/development/libraries/commoncpp2/default.nix38
-rw-r--r--pkgs/development/libraries/cpp-hocon/default.nix2
-rw-r--r--pkgs/development/libraries/cppdb/default.nix2
-rw-r--r--pkgs/development/libraries/crc32c/default.nix2
-rw-r--r--pkgs/development/libraries/crypto++/default.nix2
-rw-r--r--pkgs/development/libraries/cutee/default.nix2
-rw-r--r--pkgs/development/libraries/cwiid/default.nix4
-rw-r--r--pkgs/development/libraries/czmq/3.x.nix26
-rw-r--r--pkgs/development/libraries/czmq/czmq3-gcc7.patch26
-rw-r--r--pkgs/development/libraries/czmq/default.nix (renamed from pkgs/development/libraries/czmq/4.x.nix)0
-rw-r--r--pkgs/development/libraries/czmqpp/default.nix28
-rw-r--r--pkgs/development/libraries/czmqpp/socket.patch17
-rw-r--r--pkgs/development/libraries/dirac/default.nix31
-rw-r--r--pkgs/development/libraries/dirac/dirac-1.0.2.patch362
-rw-r--r--pkgs/development/libraries/farbfeld/default.nix2
-rw-r--r--pkgs/development/libraries/ffmpeg/generic.nix14
-rw-r--r--pkgs/development/libraries/filter-audio/default.nix2
-rw-r--r--pkgs/development/libraries/flatbuffers/default.nix4
-rw-r--r--pkgs/development/libraries/flatpak/default.nix4
-rw-r--r--pkgs/development/libraries/flint/default.nix2
-rw-r--r--pkgs/development/libraries/fontconfig/2.10.nix2
-rw-r--r--pkgs/development/libraries/fontconfig/default.nix2
-rw-r--r--pkgs/development/libraries/gdal/gdal-1_11.nix4
-rw-r--r--pkgs/development/libraries/gdbm/default.nix3
-rw-r--r--pkgs/development/libraries/gegl/4.0.nix2
-rw-r--r--pkgs/development/libraries/geis/default.nix2
-rw-r--r--pkgs/development/libraries/gettext/default.nix2
-rw-r--r--pkgs/development/libraries/giflib/default.nix4
-rw-r--r--pkgs/development/libraries/glib-networking/default.nix4
-rw-r--r--pkgs/development/libraries/glib/default.nix6
-rw-r--r--pkgs/development/libraries/glibc/default.nix16
-rw-r--r--pkgs/development/libraries/glm/default.nix4
-rw-r--r--pkgs/development/libraries/gperftools/default.nix5
-rw-r--r--pkgs/development/libraries/gpgme/default.nix4
-rw-r--r--pkgs/development/libraries/gsl/default.nix2
-rw-r--r--pkgs/development/libraries/gsl/gsl-1_16.nix2
-rw-r--r--pkgs/development/libraries/gtk/2.x.nix2
-rw-r--r--pkgs/development/libraries/gtk/3.x.nix8
-rw-r--r--pkgs/development/libraries/hspell/dicts.nix18
-rw-r--r--pkgs/development/libraries/http-parser/default.nix2
-rw-r--r--pkgs/development/libraries/icu/58.nix2
-rw-r--r--pkgs/development/libraries/icu/base.nix2
-rw-r--r--pkgs/development/libraries/ilmbase/default.nix2
-rw-r--r--pkgs/development/libraries/itk/4.x.nix6
-rw-r--r--pkgs/development/libraries/java/swt/default.nix4
-rw-r--r--pkgs/development/libraries/leatherman/default.nix9
-rw-r--r--pkgs/development/libraries/libav/default.nix2
-rw-r--r--pkgs/development/libraries/libbluray/default.nix2
-rw-r--r--pkgs/development/libraries/libcaca/default.nix4
-rw-r--r--pkgs/development/libraries/libcbor/default.nix2
-rw-r--r--pkgs/development/libraries/libcef/default.nix2
-rw-r--r--pkgs/development/libraries/libcouchbase/default.nix2
-rw-r--r--pkgs/development/libraries/libde265/default.nix4
-rw-r--r--pkgs/development/libraries/libdynd/default.nix5
-rw-r--r--pkgs/development/libraries/libev/default.nix4
-rw-r--r--pkgs/development/libraries/libexecinfo/default.nix2
-rw-r--r--pkgs/development/libraries/libf2c/default.nix2
-rw-r--r--pkgs/development/libraries/libfakekey/default.nix4
-rw-r--r--pkgs/development/libraries/libfpx/default.nix2
-rw-r--r--pkgs/development/libraries/libftdi/default.nix2
-rw-r--r--pkgs/development/libraries/libgdiplus/default.nix2
-rw-r--r--pkgs/development/libraries/libglvnd/default.nix4
-rw-r--r--pkgs/development/libraries/libguestfs/default.nix2
-rw-r--r--pkgs/development/libraries/libheif/default.nix4
-rw-r--r--pkgs/development/libraries/libical/default.nix4
-rw-r--r--pkgs/development/libraries/libjpeg-drop/default.nix2
-rw-r--r--pkgs/development/libraries/libmatchbox/default.nix4
-rw-r--r--pkgs/development/libraries/libmbim/default.nix4
-rw-r--r--pkgs/development/libraries/libmemcached/default.nix2
-rw-r--r--pkgs/development/libraries/libmicrohttpd/default.nix4
-rw-r--r--pkgs/development/libraries/libmpeg2/default.nix2
-rw-r--r--pkgs/development/libraries/liboping/default.nix2
-rw-r--r--pkgs/development/libraries/libosmpbf/default.nix2
-rw-r--r--pkgs/development/libraries/libowfat/default.nix2
-rw-r--r--pkgs/development/libraries/libpfm/default.nix2
-rw-r--r--pkgs/development/libraries/libqtav/default.nix2
-rw-r--r--pkgs/development/libraries/libscrypt/default.nix2
-rw-r--r--pkgs/development/libraries/libspotify/default.nix6
-rw-r--r--pkgs/development/libraries/libunique/default.nix2
-rw-r--r--pkgs/development/libraries/libvdpau/default.nix2
-rw-r--r--pkgs/development/libraries/libwhereami/default.nix2
-rw-r--r--pkgs/development/libraries/libwps/default.nix2
-rw-r--r--pkgs/development/libraries/libxml2/default.nix6
-rw-r--r--pkgs/development/libraries/libyaml-cpp/default.nix2
-rw-r--r--pkgs/development/libraries/lmdb/default.nix2
-rw-r--r--pkgs/development/libraries/mediastreamer/default.nix4
-rw-r--r--pkgs/development/libraries/mlt/qt-5.nix2
-rw-r--r--pkgs/development/libraries/mps/default.nix2
-rw-r--r--pkgs/development/libraries/nss/default.nix2
-rw-r--r--pkgs/development/libraries/ntrack/default.nix2
-rw-r--r--pkgs/development/libraries/ois/default.nix2
-rw-r--r--pkgs/development/libraries/olm/default.nix6
-rw-r--r--pkgs/development/libraries/oniguruma/default.nix4
-rw-r--r--pkgs/development/libraries/opae/default.nix5
-rw-r--r--pkgs/development/libraries/opal/default.nix43
-rw-r--r--pkgs/development/libraries/opal/disable-samples-ftbfs.diff14
-rw-r--r--pkgs/development/libraries/opal/libav10.patch208
-rw-r--r--pkgs/development/libraries/opal/libav9.patch543
-rw-r--r--pkgs/development/libraries/openal-soft/default.nix4
-rw-r--r--pkgs/development/libraries/opencv/3.x.nix2
-rw-r--r--pkgs/development/libraries/opencv/4.x.nix2
-rw-r--r--pkgs/development/libraries/opencv/default.nix2
-rw-r--r--pkgs/development/libraries/openvdb/default.nix25
-rw-r--r--pkgs/development/libraries/ortp/default.nix2
-rw-r--r--pkgs/development/libraries/phonon/backends/gstreamer.nix2
-rw-r--r--pkgs/development/libraries/physics/qcdnum/default.nix4
-rw-r--r--pkgs/development/libraries/portaudio/default.nix2
-rw-r--r--pkgs/development/libraries/prometheus-cpp/default.nix2
-rw-r--r--pkgs/development/libraries/ptlib/default.nix59
-rw-r--r--pkgs/development/libraries/ptlib/ptlib-2.10.11-glibc-2.26.patch13
-rw-r--r--pkgs/development/libraries/qoauth/default.nix4
-rw-r--r--pkgs/development/libraries/qrupdate/default.nix4
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/default.nix10
-rw-r--r--pkgs/development/libraries/qt-4.x/4.8/qt4-gcc6.patch4
-rw-r--r--pkgs/development/libraries/qt-5/5.11/default.nix179
-rw-r--r--pkgs/development/libraries/qt-5/mkDerivation.nix4
-rw-r--r--pkgs/development/libraries/qt-5/modules/qtbase.nix26
-rw-r--r--pkgs/development/libraries/qtkeychain/default.nix6
-rw-r--r--pkgs/development/libraries/quickder/default.nix12
-rw-r--r--pkgs/development/libraries/readline/6.2.nix2
-rw-r--r--pkgs/development/libraries/readline/6.3.nix10
-rw-r--r--pkgs/development/libraries/readline/7.0.nix2
-rw-r--r--pkgs/development/libraries/readline/8.0.nix2
-rw-r--r--pkgs/development/libraries/rocksdb/default.nix2
-rw-r--r--pkgs/development/libraries/schroedinger/default.nix2
-rw-r--r--pkgs/development/libraries/science/benchmark/papi/default.nix2
-rw-r--r--pkgs/development/libraries/science/biology/htslib/default.nix2
-rw-r--r--pkgs/development/libraries/science/biology/mirtk/default.nix6
-rw-r--r--pkgs/development/libraries/science/math/fenics/default.nix41
-rw-r--r--pkgs/development/libraries/science/math/osi/default.nix6
-rw-r--r--pkgs/development/libraries/shhmsg/default.nix2
-rw-r--r--pkgs/development/libraries/shhopt/default.nix2
-rw-r--r--pkgs/development/libraries/smpeg/default.nix2
-rw-r--r--pkgs/development/libraries/sord/default.nix4
-rw-r--r--pkgs/development/libraries/spatialite-tools/default.nix2
-rw-r--r--pkgs/development/libraries/spdk/default.nix2
-rw-r--r--pkgs/development/libraries/sqlite/default.nix6
-rw-r--r--pkgs/development/libraries/srt/default.nix4
-rw-r--r--pkgs/development/libraries/t1lib/default.nix2
-rw-r--r--pkgs/development/libraries/tachyon/default.nix2
-rw-r--r--pkgs/development/libraries/tinyxml/2.6.2.nix2
-rw-r--r--pkgs/development/libraries/unixODBCDrivers/default.nix10
-rw-r--r--pkgs/development/libraries/uri/default.nix2
-rw-r--r--pkgs/development/libraries/usbredir/default.nix2
-rw-r--r--pkgs/development/libraries/v8/default.nix2
-rw-r--r--pkgs/development/libraries/vxl/default.nix19
-rw-r--r--pkgs/development/libraries/wxwidgets/2.8/default.nix2
-rw-r--r--pkgs/development/libraries/xmlsec/default.nix2
-rw-r--r--pkgs/development/libraries/zeroc-ice/default.nix2
-rw-r--r--pkgs/development/libraries/zeromq/4.x.nix2
-rw-r--r--pkgs/development/libraries/zookeeper_mt/default.nix2
164 files changed, 485 insertions, 1748 deletions
diff --git a/pkgs/development/libraries/argp-standalone/default.nix b/pkgs/development/libraries/argp-standalone/default.nix
index 8fe3bd287c1..6544c481187 100644
--- a/pkgs/development/libraries/argp-standalone/default.nix
+++ b/pkgs/development/libraries/argp-standalone/default.nix
@@ -31,7 +31,7 @@ stdenv.mkDerivation {
        stdenv.lib.optionals stdenv.hostPlatform.isDarwin [ patch-argp-fmtstream ]
     ++ stdenv.lib.optionals stdenv.hostPlatform.isLinux [ patch-throw-in-funcdef patch-shared ];
 
-  patchFlags = stdenv.lib.optionalString stdenv.hostPlatform.isDarwin "-p0";
+  patchFlags = stdenv.lib.optional stdenv.hostPlatform.isDarwin "-p0";
 
   preConfigure = stdenv.lib.optionalString stdenv.hostPlatform.isLinux "export CFLAGS='-fgnu89-inline'";
 
diff --git a/pkgs/development/libraries/audiofile/default.nix b/pkgs/development/libraries/audiofile/default.nix
index 1ed457aa5fe..680b585643b 100644
--- a/pkgs/development/libraries/audiofile/default.nix
+++ b/pkgs/development/libraries/audiofile/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, alsaLib, AudioUnit, CoreServices }:
+{ stdenv, lib, fetchurl, fetchpatch, alsaLib, AudioUnit, CoreServices }:
 
 let
 
@@ -25,6 +25,9 @@ stdenv.mkDerivation rec {
     sha256 = "0rb927zknk9kmhprd8rdr4azql4gn2dp75a36iazx2xhkbqhvind";
   };
 
+  # fix build with gcc9
+  NIX_CFLAGS_LINK = lib.optional (stdenv.system == "i686-linux") "-lgcc";
+
   patches = [
     ./gcc-6.patch
     ./CVE-2015-7747.patch
diff --git a/pkgs/development/libraries/aws-c-common/default.nix b/pkgs/development/libraries/aws-c-common/default.nix
index 4286eedc87b..b10797d3d56 100644
--- a/pkgs/development/libraries/aws-c-common/default.nix
+++ b/pkgs/development/libraries/aws-c-common/default.nix
@@ -13,10 +13,8 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  NIX_CFLAGS_COMPILE = lib.optionals stdenv.isDarwin [
-    "-Wno-nullability-extension"
-    "-Wno-typedef-redefinition"
-  ];
+  NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isDarwin
+    "-Wno-nullability-extension -Wno-typedef-redefinition";
 
   meta = with lib; {
     description = "AWS SDK for C common core";
diff --git a/pkgs/development/libraries/aws-sdk-cpp/default.nix b/pkgs/development/libraries/aws-sdk-cpp/default.nix
index 037fd198fef..8024f310951 100644
--- a/pkgs/development/libraries/aws-sdk-cpp/default.nix
+++ b/pkgs/development/libraries/aws-sdk-cpp/default.nix
@@ -42,6 +42,9 @@ stdenv.mkDerivation rec {
   ] ++ lib.optional (apis != ["*"])
     "-DBUILD_ONLY=${lib.concatStringsSep ";" apis}";
 
+  # fix build with gcc9, can be removed after bumping to current version
+  NIX_CFLAGS_COMPILE = [ "-Wno-error" ];
+
   preConfigure =
     ''
       rm aws-cpp-sdk-core-tests/aws/auth/AWSCredentialsProviderTest.cpp
diff --git a/pkgs/development/libraries/bamf/default.nix b/pkgs/development/libraries/bamf/default.nix
index 1bce315878d..60322f53016 100644
--- a/pkgs/development/libraries/bamf/default.nix
+++ b/pkgs/development/libraries/bamf/default.nix
@@ -88,9 +88,7 @@ stdenv.mkDerivation rec {
   doCheck = false;
 
   # glib-2.62 deprecations
-  NIX_CFLAGS_COMPILE = [
-    "-DGLIB_DISABLE_DEPRECATION_WARNINGS"
-  ];
+  NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS";
 
   meta = with stdenv.lib; {
     description = "Application matching framework";
diff --git a/pkgs/development/libraries/bctoolbox/default.nix b/pkgs/development/libraries/bctoolbox/default.nix
index a9d21a1f5a9..1c81dd608cb 100644
--- a/pkgs/development/libraries/bctoolbox/default.nix
+++ b/pkgs/development/libraries/bctoolbox/default.nix
@@ -14,6 +14,8 @@ stdenv.mkDerivation rec {
     sha256 = "1cxx243wyzkd4xnvpyqf97n0rjhfckpvw1vhwnbwshq3q6fra909";
   };
 
+  NIX_CFLAGS_COMPILE = [ "-Wno-error=stringop-truncation" ];
+
   meta = {
     inherit version;
     description = "Utilities library for Linphone";
diff --git a/pkgs/development/libraries/belle-sip/default.nix b/pkgs/development/libraries/belle-sip/default.nix
index 1745614f741..0d3df37d8e0 100644
--- a/pkgs/development/libraries/belle-sip/default.nix
+++ b/pkgs/development/libraries/belle-sip/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ zlib ];
 
-  NIX_CFLAGS_COMPILE = [
+  NIX_CFLAGS_COMPILE = toString [
     "-Wno-error=deprecated-declarations"
     "-Wno-error=format-truncation"
     "-Wno-error=cast-function-type"
diff --git a/pkgs/development/libraries/blitz/default.nix b/pkgs/development/libraries/blitz/default.nix
index fd0da496fa4..f370e45b5fd 100644
--- a/pkgs/development/libraries/blitz/default.nix
+++ b/pkgs/development/libraries/blitz/default.nix
@@ -55,7 +55,7 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  buildFlags = "lib info pdf html";
+  buildFlags = [ "lib" "info" "pdf" "html" ];
   installTargets = [ "install" "install-info" "install-pdf" "install-html" ];
 
   inherit doCheck;
diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix
index 2d0a5a63d6f..82bcd49592d 100644
--- a/pkgs/development/libraries/boost/generic.nix
+++ b/pkgs/development/libraries/boost/generic.nix
@@ -103,7 +103,7 @@ stdenv.mkDerivation {
 
   inherit src version;
 
-  patchFlags = "";
+  patchFlags = [];
 
   patches = patches
   ++ optional stdenv.isDarwin (
diff --git a/pkgs/development/libraries/buddy/default.nix b/pkgs/development/libraries/buddy/default.nix
index fb25b0a5810..9b722602a65 100644
--- a/pkgs/development/libraries/buddy/default.nix
+++ b/pkgs/development/libraries/buddy/default.nix
@@ -11,9 +11,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ bison ];
   patches = [ ./gcc-4.3.3-fixes.patch ];
   configureFlags = [ "CFLAGS=-O3" "CXXFLAGS=-O3" ];
-  NIX_LDFLAGS = [
-    "-lm"
-  ];
+  NIX_LDFLAGS = "-lm";
   doCheck = true;
 
   meta = {
diff --git a/pkgs/development/libraries/ccrtp/1.8.nix b/pkgs/development/libraries/ccrtp/1.8.nix
deleted file mode 100644
index db2d177b710..00000000000
--- a/pkgs/development/libraries/ccrtp/1.8.nix
+++ /dev/null
@@ -1,24 +0,0 @@
-{ stdenv, fetchurl, openssl, pkgconfig, libgcrypt, commoncpp2 }:
-
-stdenv.mkDerivation {
-  name = "ccrtp-1.8.0";
-
-  src = fetchurl {
-    url = mirror://gnu/ccrtp/ccrtp-1.8.0.tar.gz;
-    sha256 = "0wr4dandlfajhmg90nqyvwv61ikn9vdycji001310y3c4zfysprn";
-  };
-
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ openssl libgcrypt commoncpp2 ];
-
-  patches = [ ./gcc-4.6-fix.patch ];
-
-  meta = {
-    description = "GNU ccRTP is an implementation of RTP, the real-time transport protocol from the IETF";
-    homepage = https://www.gnu.org/software/ccrtp/;
-    license = stdenv.lib.licenses.gpl2;
-    maintainers = [ stdenv.lib.maintainers.marcweber ];
-    platforms = stdenv.lib.platforms.linux;
-    broken = true; # fails to compile with libgcrypt >= 1.6
-  };
-}
diff --git a/pkgs/development/libraries/ccrtp/gcc-4.6-fix.patch b/pkgs/development/libraries/ccrtp/gcc-4.6-fix.patch
deleted file mode 100644
index 49d07a89e52..00000000000
--- a/pkgs/development/libraries/ccrtp/gcc-4.6-fix.patch
+++ /dev/null
@@ -1,20 +0,0 @@
-diff -ubr ccrtp-1.8.0-orig/src/ccrtp/sources.h ccrtp-1.8.0/src/ccrtp/sources.h
---- ccrtp-1.8.0-orig/src/ccrtp/sources.h	2010-04-18 20:51:49.000000000 +0200
-+++ ccrtp-1.8.0/src/ccrtp/sources.h	2012-07-07 11:42:50.961179016 +0200
-@@ -45,6 +45,7 @@
- #define CCXX_RTP_SOURCES_H_
- 
- #include <string>
-+#include <cstddef>
- #include <ccrtp/rtcppkt.h>
- 
- #ifdef	CCXX_NAMESPACES
-@@ -406,7 +407,7 @@
- 	public:
- 		typedef std::forward_iterator_tag iterator_category;
- 		typedef Participant value_type;
--		typedef ptrdiff_t difference_type;
-+		typedef std::ptrdiff_t difference_type;
- 		typedef const Participant* pointer;
- 		typedef const Participant& reference;
- 
diff --git a/pkgs/development/libraries/cfitsio/default.nix b/pkgs/development/libraries/cfitsio/default.nix
index 7576c24024a..4b84f73a258 100644
--- a/pkgs/development/libraries/cfitsio/default.nix
+++ b/pkgs/development/libraries/cfitsio/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   hardeningDisable = [ "format" ];
 
   # Shared-only build
-  buildFlags = "shared";
+  buildFlags = [ "shared" ];
   postPatch = '' sed -e '/^install:/s/libcfitsio.a //' -e 's@/bin/@@g' -i Makefile.in
    '';
 
diff --git a/pkgs/development/libraries/commoncpp2/default.nix b/pkgs/development/libraries/commoncpp2/default.nix
deleted file mode 100644
index 0c5ab758583..00000000000
--- a/pkgs/development/libraries/commoncpp2/default.nix
+++ /dev/null
@@ -1,38 +0,0 @@
-{ fetchurl, stdenv }:
-
-stdenv.mkDerivation rec {
-  name = "commoncpp2-1.8.1";
-
-  src = fetchurl {
-    url = "mirror://gnu/commoncpp/${name}.tar.gz";
-    sha256 = "0kmgr5w3b1qwzxnsnw94q6rqs0hr8nbv9clf07ca2a2fyypx9kjk";
-  };
-
-  doCheck = true;
-
-  preBuild = ''
-    echo '#include <sys/stat.h>' >> inc/cc++/config.h
-  '';
-
-  meta = {
-    description = "GNU Common C++, a portable, highly optimized C++ class framework";
-
-    longDescription =
-      '' GNU Common C++ and GNU uCommon are very portable and highly
-         optimized class framework for writing C++ applications that need to
-         use threads and support concurrent sychronization, and that use
-         sockets, XML parsing, object serialization, thread-optimized String
-         and data structure classes, etc.  This framework offers a class
-         foundation that hides platform differences from your C++ application
-         so that you need not write platform specific code.  GNU Common C++
-         has been ported to compile nativily on most platforms which support
-         either posix threads, or on maybe be used with Debian hosted mingw32
-         to build native threading applications for Microsoft Windows.
-      '';
-
-    homepage = https://www.gnu.org/software/commoncpp/;
-    license = stdenv.lib.licenses.gpl2Plus;
-    maintainers = [ stdenv.lib.maintainers.marcweber ];
-    platforms = with stdenv.lib.platforms; linux;
-  };
-}
diff --git a/pkgs/development/libraries/cpp-hocon/default.nix b/pkgs/development/libraries/cpp-hocon/default.nix
index d172ab55fa3..dc742a5c051 100644
--- a/pkgs/development/libraries/cpp-hocon/default.nix
+++ b/pkgs/development/libraries/cpp-hocon/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     owner = "puppetlabs";
   };
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=catch-value" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error=catch-value";
 
   nativeBuildInputs = [ cmake ];
 
diff --git a/pkgs/development/libraries/cppdb/default.nix b/pkgs/development/libraries/cppdb/default.nix
index a21b3cc93fa..bb521ba3ec0 100644
--- a/pkgs/development/libraries/cppdb/default.nix
+++ b/pkgs/development/libraries/cppdb/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ cmake sqlite libmysqlclient postgresql unixODBC ];
 
   cmakeFlags = [ "--no-warn-unused-cli" ];
-  NIX_CFLAGS_COMPILE = [ "-I${libmysqlclient}/include/mysql" "-L${libmysqlclient}/lib/mysql" ];
+  NIX_CFLAGS_COMPILE = "-I${libmysqlclient}/include/mysql -L${libmysqlclient}/lib/mysql";
 
   meta = with stdenv.lib; {
     homepage = http://cppcms.com/sql/cppdb/;
diff --git a/pkgs/development/libraries/crc32c/default.nix b/pkgs/development/libraries/crc32c/default.nix
index 916ec5b703b..a7313c20553 100644
--- a/pkgs/development/libraries/crc32c/default.nix
+++ b/pkgs/development/libraries/crc32c/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ gflags ];
-  NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.isAarch64 "-march=armv8-a+crc";
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isAarch64 "-march=armv8-a+crc";
 
   meta = with stdenv.lib; {
     homepage = https://github.com/google/crc32c;
diff --git a/pkgs/development/libraries/crypto++/default.nix b/pkgs/development/libraries/crypto++/default.nix
index b472733f8ee..3fe27748155 100644
--- a/pkgs/development/libraries/crypto++/default.nix
+++ b/pkgs/development/libraries/crypto++/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   preInstall = "rm libcryptopp.a"; # built for checks but we don't install static lib into the nix store
-  installTargets = "install-lib";
+  installTargets = [ "install-lib" ];
   installFlags = [ "LDCONF=true" ];
   postInstall = optionalString (!stdenv.hostPlatform.isDarwin) ''
     ln -sr $out/lib/libcryptopp.so.${version} $out/lib/libcryptopp.so.${versions.majorMinor version}
diff --git a/pkgs/development/libraries/cutee/default.nix b/pkgs/development/libraries/cutee/default.nix
index 1658f8a6fa7..1c14454af5c 100644
--- a/pkgs/development/libraries/cutee/default.nix
+++ b/pkgs/development/libraries/cutee/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "18bzvhzx8k24mpcim5669n3wg9hd0sfsxj8zjpbr24hywrlppgc2";
   };
 
-  buildFlags = "cutee";
+  buildFlags = [ "cutee" ];
 
   installPhase = ''
     mkdir -p $out/bin
diff --git a/pkgs/development/libraries/cwiid/default.nix b/pkgs/development/libraries/cwiid/default.nix
index 246dd009820..d9a17aff941 100644
--- a/pkgs/development/libraries/cwiid/default.nix
+++ b/pkgs/development/libraries/cwiid/default.nix
@@ -23,9 +23,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
 
-  NIX_LDFLAGS = [
-    "-lbluetooth"
-  ];
+  NIX_LDFLAGS = "-lbluetooth";
 
   postInstall = ''
     # Some programs (for example, cabal-install) have problems with the double 0
diff --git a/pkgs/development/libraries/czmq/3.x.nix b/pkgs/development/libraries/czmq/3.x.nix
deleted file mode 100644
index 73a51cd2731..00000000000
--- a/pkgs/development/libraries/czmq/3.x.nix
+++ /dev/null
@@ -1,26 +0,0 @@
-{ stdenv, fetchurl, zeromq }:
-
-stdenv.mkDerivation rec {
-  version = "3.0.2";
-  pname = "czmq";
-
-  src = fetchurl {
-    url = "http://download.zeromq.org/${pname}-${version}.tar.gz";
-    sha256 = "16k9awrhdsymx7dnmvqcnkaq8lz8x8zppy6sh7ls8prpd6mkkjlb";
-  };
-
-  patches = [ ./czmq3-gcc7.patch ];
-
-  # Fix build on Glibc 2.24.
-  NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
-
-  # Needs to be propagated for the .pc file to work
-  propagatedBuildInputs = [ zeromq ];
-
-  meta = with stdenv.lib; {
-    homepage = http://czmq.zeromq.org/;
-    description = "High-level C Binding for ZeroMQ";
-    license = licenses.mpl20;
-    platforms = platforms.all;
-  };
-}
diff --git a/pkgs/development/libraries/czmq/czmq3-gcc7.patch b/pkgs/development/libraries/czmq/czmq3-gcc7.patch
deleted file mode 100644
index 4ab14685a6c..00000000000
--- a/pkgs/development/libraries/czmq/czmq3-gcc7.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-diff --git a/src/zgossip_engine.inc b/src/zgossip_engine.inc
-index 37dbb4eb..727aaa9b 100644
---- a/src/zgossip_engine.inc
-+++ b/src/zgossip_engine.inc
-@@ -258,7 +258,7 @@ engine_set_log_prefix (client_t *client, const char *string)
- {
-     if (client) {
-         s_client_t *self = (s_client_t *) client;
--        snprintf (self->log_prefix, sizeof (self->log_prefix) - 1,
-+        snprintf (self->log_prefix, sizeof (self->log_prefix),
-             "%6d:%-33s", self->unique_id, string);
-     }
- }
-diff --git a/src/zsys.c b/src/zsys.c
-index 4d0bb8a1..f07db9c8 100644
---- a/src/zsys.c
-+++ b/src/zsys.c
-@@ -1071,7 +1071,7 @@ zsys_run_as (const char *lockfile, const char *group, const char *user)
-             }
-         }
-         //   We record the current process id in the lock file
--        char pid_buffer [10];
-+        char pid_buffer [32];
-         snprintf (pid_buffer, sizeof (pid_buffer), "%6d\n", getpid ());
-         if (write (handle, pid_buffer, strlen (pid_buffer)) != strlen (pid_buffer)) {
-             zsys_error ("cannot write to lockfile: %s", strerror (errno));
diff --git a/pkgs/development/libraries/czmq/4.x.nix b/pkgs/development/libraries/czmq/default.nix
index 05e499c73d0..05e499c73d0 100644
--- a/pkgs/development/libraries/czmq/4.x.nix
+++ b/pkgs/development/libraries/czmq/default.nix
diff --git a/pkgs/development/libraries/czmqpp/default.nix b/pkgs/development/libraries/czmqpp/default.nix
deleted file mode 100644
index 079eb0806d2..00000000000
--- a/pkgs/development/libraries/czmqpp/default.nix
+++ /dev/null
@@ -1,28 +0,0 @@
-{ stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, czmq }:
-
-stdenv.mkDerivation rec {
-  pname = "czmqpp";
-  version = "1.2.0";
-
-  src = fetchFromGitHub {
-    owner = "zeromq";
-    repo = "czmqpp";
-    rev = "v${version}";
-    sha256 = "0z8lwq53yk4h7pgibicx3q9idz15qb95r0pjpz0j5vql6qh46rja";
-  };
-
-  nativeBuildInputs = [ autoreconfHook pkgconfig ];
-
-  propagatedBuildInputs = [ czmq ];
-
-  # https://github.com/zeromq/czmqpp/issues/42
-  patches = [ ./socket.patch ];
-
-  meta = with stdenv.lib; {
-    inherit (src.meta) homepage;
-    description = "C++ wrapper for czmq. Aims to be minimal, simple and consistent";
-    license = licenses.lgpl3;
-    platforms = platforms.linux ++ platforms.darwin;
-    maintainers = with maintainers; [ chris-martin ];
-  };
-}
diff --git a/pkgs/development/libraries/czmqpp/socket.patch b/pkgs/development/libraries/czmqpp/socket.patch
deleted file mode 100644
index 0464bcf7797..00000000000
--- a/pkgs/development/libraries/czmqpp/socket.patch
+++ /dev/null
@@ -1,17 +0,0 @@
---- /src/socket.cpp
-+++ /src/socket.cpp
-@@ -60,12 +60,12 @@
- int socket::bind(const std::string& address)
- {
-     // format-security: format not a string literal and no format arguments.
--    return zsocket_bind(self_, address.c_str());
-+    return zsocket_bind(self_, "%s", address.c_str());
- }
- int socket::connect(const std::string& address)
- {
-     // format-security: format not a string literal and no format arguments.
--    return zsocket_connect(self_, address.c_str());
-+    return zsocket_connect(self_, "%s", address.c_str());
- }
-
- bool operator==(const socket& sock_a, const socket& sock_b)
diff --git a/pkgs/development/libraries/dirac/default.nix b/pkgs/development/libraries/dirac/default.nix
deleted file mode 100644
index 93e5da5b792..00000000000
--- a/pkgs/development/libraries/dirac/default.nix
+++ /dev/null
@@ -1,31 +0,0 @@
-{ stdenv, fetchurl, doxygen }:
-
-stdenv.mkDerivation rec {
-  version = "1.0.2";
-  pname = "dirac";
-
-  src = fetchurl {
-    url = "mirror://sourceforge/dirac/${pname}-${version}.tar.gz";
-    sha256 = "1z803yzp17cj69wn11iyb13swqdd9xdzr58dsk6ghpr3ipqicsw1";
-  };
-
-  buildInputs = [ doxygen ];
-  enableParallelBuilding = true;
-
-  patches = [ ./dirac-1.0.2.patch ];
-
-  NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
-
-  postInstall = ''
-    # keep only necessary binaries
-    find $out/bin \( -name '*RGB*' -or -name '*YUV*' -or -name create_dirac_testfile.pl \) -delete
-  '';
-
-  meta = with stdenv.lib; {
-    homepage = https://sourceforge.net/projects/dirac;
-    description = "A general-purpose video codec based on wavelets";
-    platforms = platforms.linux;
-    license = with licenses; [ mpl11 gpl2 lgpl21 ];
-    maintainers = [ maintainers.igsha ];
-  };
-}
diff --git a/pkgs/development/libraries/dirac/dirac-1.0.2.patch b/pkgs/development/libraries/dirac/dirac-1.0.2.patch
deleted file mode 100644
index 3d253b8f6d6..00000000000
--- a/pkgs/development/libraries/dirac/dirac-1.0.2.patch
+++ /dev/null
@@ -1,362 +0,0 @@
-diff -aur dirac-1.0.2/libdirac_byteio/parseunit_byteio.cpp dirac-1.0.2-modif/libdirac_byteio/parseunit_byteio.cpp
---- dirac-1.0.2/libdirac_byteio/parseunit_byteio.cpp	2008-05-02 09:57:19.000000000 +0400
-+++ dirac-1.0.2-modif/libdirac_byteio/parseunit_byteio.cpp	2016-02-10 19:39:09.838443767 +0300
-@@ -124,12 +124,9 @@
- 
-     if(prefix==PU_PREFIX)
-     {
--        unsigned char next_parse_code;
--
--        next_parse_code = InputUnByte();
-+        (void)InputUnByte();
-         // input next unit parse-offsets
--        int next_unit_next_parse_offset;
--        next_unit_next_parse_offset = ReadUintLit(PU_NEXT_PARSE_OFFSET_SIZE);
-+        (void)ReadUintLit(PU_NEXT_PARSE_OFFSET_SIZE);
- 
-         int next_unit_previous_parse_offset;
-         next_unit_previous_parse_offset = ReadUintLit(PU_PREVIOUS_PARSE_OFFSET_SIZE);
-diff -aur dirac-1.0.2/libdirac_common/mot_comp.cpp dirac-1.0.2-modif/libdirac_common/mot_comp.cpp
---- dirac-1.0.2/libdirac_common/mot_comp.cpp	2008-10-01 05:26:47.000000000 +0400
-+++ dirac-1.0.2-modif/libdirac_common/mot_comp.cpp	2016-02-10 19:50:18.453051800 +0300
-@@ -1064,10 +1064,10 @@
-         // We're doing bounds checking because we'll fall off the edge of the reference otherwise.
- 
-         //weights for doing linear interpolation, calculated from the remainder values
--        const ValueType linear_wts[4] = {  (2 - rmdr.x) * (2 - rmdr.y),    //tl
--                                           rmdr.x * (2 - rmdr.y),          //tr
--                                           (2 - rmdr.x) * rmdr.y,          //bl
--                                           rmdr.x * rmdr.y };              //br
-+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr.x) * (2 - rmdr.y)),    //tl
-+                                           ValueType(rmdr.x * (2 - rmdr.y)),          //tr
-+                                           ValueType((2 - rmdr.x) * rmdr.y),          //bl
-+                                           ValueType(rmdr.x * rmdr.y) };              //br
- 
- 
-        for(int c = 0, uY = ref_start.y,BuY=BChk(uY,trueRefYlen),BuY1=BChk(uY+1,trueRefYlen);
-@@ -1116,10 +1116,10 @@
-     const ImageCoords ref_start( ( start_pos.x<<1 ) + roundvec.x ,( start_pos.y<<1 ) + roundvec.y );
- 
-     //weights for doing linear interpolation, calculated from the remainder values
--    const ValueType linear_wts[4] = {  (4 - rmdr.x) * (4 - rmdr.y),    //tl
--                                    rmdr.x * (4 - rmdr.y),          //tr
--                                    (4 - rmdr.x) * rmdr.y,          //bl
--                                    rmdr.x * rmdr.y };              //br
-+    const ValueType linear_wts[4] = {  ValueType((4 - rmdr.x) * (4 - rmdr.y)),    //tl
-+                                    ValueType(rmdr.x * (4 - rmdr.y)),          //tr
-+                                    ValueType((4 - rmdr.x) * rmdr.y),          //bl
-+                                    ValueType(rmdr.x * rmdr.y) };              //br
- 
-     //An additional stage to make sure the block to be copied does not fall outside
-     //the reference image.
-diff -aur dirac-1.0.2/libdirac_common/mot_comp_mmx.cpp dirac-1.0.2-modif/libdirac_common/mot_comp_mmx.cpp
---- dirac-1.0.2/libdirac_common/mot_comp_mmx.cpp	2008-01-09 13:50:23.000000000 +0300
-+++ dirac-1.0.2-modif/libdirac_common/mot_comp_mmx.cpp	2016-02-10 19:59:51.792793538 +0300
-@@ -244,10 +244,10 @@
-         // We're 2doing bounds checking because we'll fall off the edge of the reference otherwise.
- 
-         //weights for doing linear interpolation, calculated from the remainder values
--        const ValueType linear_wts[4] = {  (2 - rmdr.x) * (2 - rmdr.y),    //tl
--                                           rmdr.x * (2 - rmdr.y),          //tr
--                                           (2 - rmdr.x) * rmdr.y,          //bl
--                                           rmdr.x * rmdr.y };              //br
-+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr.x) * (2 - rmdr.y)),    //tl
-+                                           ValueType(rmdr.x * (2 - rmdr.y)),          //tr
-+                                           ValueType((2 - rmdr.x) * rmdr.y),          //bl
-+                                           ValueType(rmdr.x * rmdr.y) };              //br
- 
-         ValueType act_cols1[4], act_cols2[4];
-         int uX, uY, c, l;
-diff -aur dirac-1.0.2/libdirac_common/mv_codec.cpp dirac-1.0.2-modif/libdirac_common/mv_codec.cpp
---- dirac-1.0.2/libdirac_common/mv_codec.cpp	2008-10-01 05:26:47.000000000 +0400
-+++ dirac-1.0.2-modif/libdirac_common/mv_codec.cpp	2016-02-10 19:51:57.634838245 +0300
-@@ -159,7 +159,7 @@
- // Main code function
- void PredModeCodec::DoWorkCode( MvData& in_data )
- {
--    int step,max; 
-+    int step; 
-     int split_depth;  
- 
-     for (m_sb_yp = 0, m_sb_tlb_y = 0;  m_sb_yp < in_data.SBSplit().LengthY();  ++m_sb_yp, m_sb_tlb_y += 4)
-@@ -169,7 +169,7 @@
-             split_depth = in_data.SBSplit()[m_sb_yp][m_sb_xp]; 
- 
-             step = 4  >>  (split_depth); 
--            max = (1 << split_depth); 
-+            //max = (1 << split_depth); 
-                         
-             //now do all the block modes and mvs in the mb            
-             for (m_b_yp = m_sb_tlb_y; m_b_yp < m_sb_tlb_y+4; m_b_yp += step)
-@@ -334,7 +334,7 @@
- // Main code function
- void VectorElementCodec::DoWorkCode( MvData& in_data )
- {
--    int step,max;
-+    int step;
-     int split_depth;
- 
-     for (m_sb_yp = 0, m_sb_tlb_y = 0;  m_sb_yp < in_data.SBSplit().LengthY();  ++m_sb_yp, m_sb_tlb_y += 4)
-@@ -344,7 +344,7 @@
-             split_depth = in_data.SBSplit()[m_sb_yp][m_sb_xp];
- 
-             step = 4  >>  (split_depth);
--            max = (1 << split_depth);
-+            //max = (1 << split_depth);
-                         
-             //now do all the block modes and mvs in the mb            
-             for (m_b_yp = m_sb_tlb_y; m_b_yp < m_sb_tlb_y+4; m_b_yp += step)
-@@ -500,7 +500,7 @@
- // Main code function
- void DCCodec::DoWorkCode( MvData& in_data )
- {
--    int step,max; 
-+    int step; 
-     int split_depth;  
-     
-     for (m_sb_yp = 0, m_sb_tlb_y = 0;  m_sb_yp < in_data.SBSplit().LengthY();  ++m_sb_yp, m_sb_tlb_y += 4)
-@@ -510,7 +510,7 @@
-             split_depth = in_data.SBSplit()[m_sb_yp][m_sb_xp]; 
- 
-             step = 4  >>  (split_depth); 
--            max = (1 << split_depth); 
-+            //max = (1 << split_depth); 
-                         
-             //now do all the block modes and mvs in the mb            
-             for (m_b_yp = m_sb_tlb_y; m_b_yp < m_sb_tlb_y+4; m_b_yp += step)
-diff -aur dirac-1.0.2/libdirac_common/wavelet_utils.cpp dirac-1.0.2-modif/libdirac_common/wavelet_utils.cpp
---- dirac-1.0.2/libdirac_common/wavelet_utils.cpp	2008-10-20 08:21:02.000000000 +0400
-+++ dirac-1.0.2-modif/libdirac_common/wavelet_utils.cpp	2016-02-10 19:58:16.205006445 +0300
-@@ -198,7 +198,6 @@
-     const bool field_coding = encparams.FieldCoding();
-     const ChromaFormat cformat = pparams.CFormat();
-     const float cpd = encparams.CPD()*cpd_scale_factor;
--    const PictureSort psort = pparams.PicSort();
- 
-     int xlen, ylen, xl, yl, xp, yp;
-     float xfreq, yfreq;
-diff -aur dirac-1.0.2/libdirac_encoder/picture_compress.cpp dirac-1.0.2-modif/libdirac_encoder/picture_compress.cpp
---- dirac-1.0.2/libdirac_encoder/picture_compress.cpp	2009-01-21 08:20:57.000000000 +0300
-+++ dirac-1.0.2-modif/libdirac_encoder/picture_compress.cpp	2016-02-10 20:08:17.935731263 +0300
-@@ -413,14 +413,12 @@
- 
-         const int depth=m_encparams.TransformDepth();
- 
--        PicArray* comp_data[3];
-         CoeffArray* coeff_data[3];
-         OneDArray<unsigned int>* est_bits[3];
-         float lambda[3];
- 
-         // Construction and definition of objects
-         for (int c=0;c<3;++c){
--            comp_data[c] = &my_picture.Data((CompSort) c );
- 	    coeff_data[c] = &my_picture.WltData((CompSort) c );
-             est_bits[c] =  new OneDArray<unsigned int>( Range( 1, 3*depth+1 ) );
-         }// c
-diff -aur dirac-1.0.2/libdirac_encoder/quant_chooser.cpp dirac-1.0.2-modif/libdirac_encoder/quant_chooser.cpp
---- dirac-1.0.2/libdirac_encoder/quant_chooser.cpp	2009-01-21 08:22:05.000000000 +0300
-+++ dirac-1.0.2-modif/libdirac_encoder/quant_chooser.cpp	2016-02-10 20:15:43.792954708 +0300
-@@ -340,7 +340,7 @@
-     {
-         for (int i=cblock.Xstart(); i<cblock.Xend(); ++i )
-         {
--            if ( (std::abs(m_coeff_data[j][i])<<2) >= u_threshold )
-+            if ( (int(std::abs(m_coeff_data[j][i]))<<2) >= u_threshold )
-                 can_skip = false;
-         }   
-     }
-@@ -349,13 +349,13 @@
- 
- CoeffType QuantChooser::BlockAbsMax( const Subband& node )
- {
--    int val( 0 );
-+    CoeffType val( 0 );
- 
-     for (int j=node.Yp() ; j<node.Yp()+node.Yl(); ++j)
-     {
-         for (int i=node.Xp() ; i<node.Xp()+node.Xl(); ++i)
-         {    
--            val = std::max( val , std::abs(m_coeff_data[j][i]) );
-+            val = std::max( val , CoeffType(std::abs(m_coeff_data[j][i])) );
-         }// i
-     }// j
- 
-diff -aur dirac-1.0.2/libdirac_encoder/seq_compress.cpp dirac-1.0.2-modif/libdirac_encoder/seq_compress.cpp
---- dirac-1.0.2/libdirac_encoder/seq_compress.cpp	2008-10-29 05:42:06.000000000 +0300
-+++ dirac-1.0.2-modif/libdirac_encoder/seq_compress.cpp	2016-02-10 20:16:24.108885403 +0300
-@@ -663,7 +663,6 @@
- 
- int FrameSequenceCompressor::CodedToDisplay( const int cnum )
- {
--    int div;
- 
-     if (m_L1_sep>0)
-     {
-@@ -672,7 +671,6 @@
-             return 0;
-         else if ((cnum-1)% m_L1_sep==0)
-         {//we have L1 or subsequent I pictures
--            div=(cnum-1)/m_L1_sep;
-             return cnum+m_L1_sep-1;
-         }
-         else//we have L2 pictures
-diff -aur dirac-1.0.2/libdirac_motionest/me_utils.cpp dirac-1.0.2-modif/libdirac_motionest/me_utils.cpp
---- dirac-1.0.2/libdirac_motionest/me_utils.cpp	2008-10-21 08:55:46.000000000 +0400
-+++ dirac-1.0.2-modif/libdirac_motionest/me_utils.cpp	2016-02-10 20:04:40.068175649 +0300
-@@ -684,10 +684,10 @@
-         // We're doing bounds checking because we'll fall off the edge of the reference otherwise.
- 
-        // weights for doing linear interpolation, calculated from the remainder values
--        const ValueType linear_wts[4] = {  (2 - rmdr.x) * (2 - rmdr.y),    //tl
--                                           rmdr.x * (2 - rmdr.y),          //tr
--                                           (2 - rmdr.x) * rmdr.y,          //bl
--                                           rmdr.x * rmdr.y };              //br
-+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr.x) * (2 - rmdr.y)),    //tl
-+                                           ValueType(rmdr.x * (2 - rmdr.y)),          //tr
-+                                           ValueType((2 - rmdr.x) * rmdr.y),          //bl
-+                                           ValueType(rmdr.x * rmdr.y) };              //br
- 
-         const int refXlen( m_ref_data.LengthX() );
-         const int refYlen( m_ref_data.LengthY() );
-@@ -848,10 +848,10 @@
-         // We're doing bounds checking because we'll fall off the edge of the reference otherwise.
- 
-        // weights for doing linear interpolation, calculated from the remainder values
--        const ValueType linear_wts[4] = {  (2 - rmdr.x) * (2 - rmdr.y),    //tl
--                                           rmdr.x * (2 - rmdr.y),          //tr
--                                           (2 - rmdr.x) * rmdr.y,          //bl
--                                           rmdr.x * rmdr.y };              //br
-+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr.x) * (2 - rmdr.y)),    //tl
-+                                           ValueType(rmdr.x * (2 - rmdr.y)),          //tr
-+                                           ValueType((2 - rmdr.x) * rmdr.y),          //bl
-+                                           ValueType(rmdr.x * rmdr.y) };              //br
- 
-         const int refXlen( m_ref_data.LengthX() );
-         const int refYlen( m_ref_data.LengthY() );
-@@ -908,10 +908,10 @@
-     const int pic_next( m_pic_data.LengthX() - dparams.Xl() );// go down a row and back up
- 
-     //weights for doing linear interpolation, calculated from the remainder values
--    const ValueType linear_wts[4] = {  (4 - rmdr.x) * (4 - rmdr.y),    //tl
--                                       rmdr.x * (4 - rmdr.y),          //tr
--                                       (4 - rmdr.x) * rmdr.y,          //bl
--                                       rmdr.x * rmdr.y };              //br
-+    const ValueType linear_wts[4] = {  ValueType((4 - rmdr.x) * (4 - rmdr.y)),    //tl
-+                                       ValueType(rmdr.x * (4 - rmdr.y)),          //tr
-+                                       ValueType((4 - rmdr.x) * rmdr.y),          //bl
-+                                       ValueType(rmdr.x * rmdr.y) };              //br
- 
-     bool bounds_check( false );
- 
-@@ -1039,10 +1039,10 @@
-     const int pic_next( m_pic_data.LengthX() - dparams.Xl() );// go down a row and back up
- 
-     //weights for doing linear interpolation, calculated from the remainder values
--    const ValueType linear_wts[4] = {  (4 - rmdr.x) * (4 - rmdr.y),    //tl
--                                       rmdr.x * (4 - rmdr.y),          //tr
--                                       (4 - rmdr.x) * rmdr.y,          //bl
--                                       rmdr.x * rmdr.y };              //br
-+    const ValueType linear_wts[4] = {  ValueType((4 - rmdr.x) * (4 - rmdr.y)),    //tl
-+                                       ValueType(rmdr.x * (4 - rmdr.y)),          //tr
-+                                       ValueType((4 - rmdr.x) * rmdr.y),          //bl
-+                                       ValueType(rmdr.x * rmdr.y) };              //br
- 
-     bool bounds_check( false );
- 
-@@ -1403,10 +1403,10 @@
-     }
-     else
-     {
--        const ValueType linear_wts[4] = {  (2 - rmdr1.x) * (2 - rmdr1.y),    //tl
--                                           rmdr1.x * (2 - rmdr1.y),          //tr
--                                           (2 - rmdr1.x) * rmdr1.y,          //bl
--                                           rmdr1.x * rmdr1.y };              //br
-+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr1.x) * (2 - rmdr1.y)),    //tl
-+                                           ValueType(rmdr1.x * (2 - rmdr1.y)),          //tr
-+                                           ValueType((2 - rmdr1.x) * rmdr1.y),          //bl
-+                                           ValueType(rmdr1.x * rmdr1.y) };              //br
- 
-         // We're doing bounds checking because we'll fall off the edge of the reference otherwise.
-         for( int y=dparams.Yl(), ry=ref_start1.y, by=BChk(ry,m_ref_data1.LengthY()), by1=BChk(ry+1,m_ref_data1.LengthY()); 
-@@ -1513,10 +1513,10 @@
-     }
-     else
-     {
--        const ValueType linear_wts[4] = {  (2 - rmdr2.x) * (2 - rmdr2.y),    //tl
--                                           rmdr2.x * (2 - rmdr2.y),          //tr
--                                           (2 - rmdr2.x) * rmdr2.y,          //bl
--                                           rmdr2.x * rmdr2.y };              //br
-+        const ValueType linear_wts[4] = {  ValueType((2 - rmdr2.x) * (2 - rmdr2.y)),    //tl
-+                                           ValueType(rmdr2.x * (2 - rmdr2.y)),          //tr
-+                                           ValueType((2 - rmdr2.x) * rmdr2.y),          //bl
-+                                           ValueType(rmdr2.x * rmdr2.y) };              //br
- 
-         // We're doing bounds checking because we'll fall off the edge of the reference otherwise.
-         for( int y=dparams.Yl(), ry=ref_start2.y, by=BChk(ry,m_ref_data2.LengthY()),by1=BChk(ry+1,m_ref_data2.LengthY()); 
-@@ -1564,14 +1564,14 @@
-     const MVector rmdr2( mv2.x & 3 , mv2.y & 3 );
- 
-     //weights for doing linear interpolation, calculated from the remainder values
--    const ValueType linear_wts1[4] = {  (4 - rmdr1.x) * (4 - rmdr1.y),    //tl
--                                       rmdr1.x * (4 - rmdr1.y),          //tr
--                                       (4 - rmdr1.x) * rmdr1.y,          //bl
--                                       rmdr1.x * rmdr1.y };              //br
--    const ValueType linear_wts2[4] = {  (4 - rmdr2.x) * (4 - rmdr2.y),    //tl
--                                       rmdr2.x * (4 - rmdr2.y),          //tr
--                                       (4 - rmdr2.x) * rmdr2.y,          //bl
--                                       rmdr2.x * rmdr2.y };              //br
-+    const ValueType linear_wts1[4] = {  ValueType((4 - rmdr1.x) * (4 - rmdr1.y)),    //tl
-+                                        ValueType(rmdr1.x * (4 - rmdr1.y)),          //tr
-+                                        ValueType((4 - rmdr1.x) * rmdr1.y),          //bl
-+                                        ValueType(rmdr1.x * rmdr1.y) };              //br
-+    const ValueType linear_wts2[4] = {  ValueType((4 - rmdr2.x) * (4 - rmdr2.y)),    //tl
-+                                        ValueType(rmdr2.x * (4 - rmdr2.y)),          //tr
-+                                        ValueType((4 - rmdr2.x) * rmdr2.y),          //bl
-+                                        ValueType(rmdr2.x * rmdr2.y) };              //br
- 
-     //Where to start in the upconverted images
-     const ImageCoords ref_start1( ( dparams.Xp()<<1 ) + roundvec1.x ,( dparams.Yp()<<1 ) + roundvec1.y );
-diff -aur dirac-1.0.2/util/conversion/common/bitmap.cpp dirac-1.0.2-modif/util/conversion/common/bitmap.cpp
---- dirac-1.0.2/util/conversion/common/bitmap.cpp	2004-06-30 20:44:52.000000000 +0400
-+++ dirac-1.0.2-modif/util/conversion/common/bitmap.cpp	2016-02-10 20:19:58.355494888 +0300
-@@ -142,14 +142,9 @@
-         char signature[2];
-         int fileSize;
-         int dataOffset;
--        int size;
-         int planes;
-         int bitCount;
-         int compression;
--        int imageSize;
--        int xPixelsPerM, yPixelsPerM;
--        int coloursUsed;
--        int coloursImportant;
-         //Define buffer to read bytes into.
-         const int bufferSize = 54;
-         char buffer[bufferSize];
-@@ -175,7 +170,7 @@
-         //Reposition input buffer to skip over extra header data if necessary
-         //Should check success of operation (see The C++ Stand Lib, Josuttis, p665)
-         if (dataOffset>54) inbuf.pubseekoff(dataOffset-54, std::ios_base::cur, std::ios_base::in);
--        size = read4bytes(buffer+14);
-+        (void)read4bytes(buffer+14); // size
-         w = read4bytes(buffer+18);
-         h = read4bytes(buffer+22);
-         if ( fileSize != (dataOffset + height()*lineBufferSize()) ) input.setstate(std::ios::failbit);
-@@ -185,11 +180,11 @@
-         if ( bitCount != 24 ) input.setstate(std::ios::failbit);
-         compression = read4bytes(buffer+30);
-         if ( compression != 0 ) input.setstate(std::ios::failbit);
--        imageSize = read4bytes(buffer+34);
--        xPixelsPerM = read4bytes(buffer+38);
--        yPixelsPerM = read4bytes(buffer+42);
--        coloursUsed = read4bytes(buffer+46);
--        coloursImportant = read4bytes(buffer+50);
-+        (void)read4bytes(buffer+34); // imageSize
-+        (void)read4bytes(buffer+38); // xPixelsPerM
-+        (void)read4bytes(buffer+42); // yPixelsPerM
-+        (void)read4bytes(buffer+46); // coloursUsed
-+        (void)read4bytes(buffer+50); // coloursImportant
-         return input; }
- 
- }  // end namespace dirac_vu
diff --git a/pkgs/development/libraries/farbfeld/default.nix b/pkgs/development/libraries/farbfeld/default.nix
index a29cbb9bbd1..a528ad6f7f6 100644
--- a/pkgs/development/libraries/farbfeld/default.nix
+++ b/pkgs/development/libraries/farbfeld/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ libpng libjpeg ];
   nativeBuildInputs = [ makeWrapper ];
 
-  installFlags = "PREFIX=/ DESTDIR=$(out)";
+  installFlags = [ "PREFIX=/" "DESTDIR=$(out)" ];
   postInstall = ''
     wrapProgram "$out/bin/2ff" --prefix PATH : "${file}/bin"
   '';
diff --git a/pkgs/development/libraries/ffmpeg/generic.nix b/pkgs/development/libraries/ffmpeg/generic.nix
index 3424493c209..956d2d7223f 100644
--- a/pkgs/development/libraries/ffmpeg/generic.nix
+++ b/pkgs/development/libraries/ffmpeg/generic.nix
@@ -44,7 +44,7 @@
 
 let
   inherit (stdenv) isDarwin isFreeBSD isLinux isAarch32;
-  inherit (stdenv.lib) optional optionals optionalString enableFeature;
+  inherit (stdenv.lib) optional optionals optionalString enableFeature filter;
 
   cmpVer = builtins.compareVersions;
   reqMin = requiredVersion: (cmpVer requiredVersion branch != 1);
@@ -85,7 +85,7 @@ stdenv.mkDerivation rec {
   setOutputFlags = false; # doesn't accept all and stores configureFlags in libs!
 
   configurePlatforms = [];
-  configureFlags = [
+  configureFlags = filter (v: v != null) ([
       "--arch=${stdenv.hostPlatform.parsed.cpu.name}"
       "--target_os=${stdenv.hostPlatform.parsed.kernel.name}"
     # License
@@ -96,13 +96,15 @@ stdenv.mkDerivation rec {
       (ifMinVer "0.6" "--enable-pic")
       (enableFeature runtimeCpuDetectBuild "runtime-cpudetect")
       "--enable-hardcoded-tables"
+    ] ++
       (if multithreadBuild then (
          if stdenv.isCygwin then
-           "--disable-pthreads --enable-w32threads"
+           ["--disable-pthreads" "--enable-w32threads"]
          else # Use POSIX threads by default
-           "--enable-pthreads --disable-w32threads")
+           ["--enable-pthreads" "--disable-w32threads"])
        else
-         "--disable-pthreads --disable-w32threads")
+         ["--disable-pthreads" "--disable-w32threads"])
+    ++ [
       (ifMinVer "0.9" "--disable-os2threads") # We don't support OS/2
       "--enable-network"
       (ifMinVer "2.4" "--enable-pixelutils")
@@ -161,7 +163,7 @@ stdenv.mkDerivation rec {
   ] ++ optionals (stdenv.hostPlatform != stdenv.buildPlatform) [
       "--cross-prefix=${stdenv.cc.targetPrefix}"
       "--enable-cross-compile"
-  ] ++ optional stdenv.cc.isClang "--cc=clang";
+  ] ++ optional stdenv.cc.isClang "--cc=clang");
 
   nativeBuildInputs = [ addOpenGLRunpath perl pkgconfig texinfo yasm ];
 
diff --git a/pkgs/development/libraries/filter-audio/default.nix b/pkgs/development/libraries/filter-audio/default.nix
index 07f1c7ec917..3438bfee07b 100644
--- a/pkgs/development/libraries/filter-audio/default.nix
+++ b/pkgs/development/libraries/filter-audio/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false;
 
-  makeFlags = "PREFIX=$(out)";
+  makeFlags = [ "PREFIX=$(out)" ];
 
   meta = with stdenv.lib; {
     description = "Lightweight audio filtering library made from webrtc code";
diff --git a/pkgs/development/libraries/flatbuffers/default.nix b/pkgs/development/libraries/flatbuffers/default.nix
index d96ceb5d26b..d43c10c8bf9 100644
--- a/pkgs/development/libraries/flatbuffers/default.nix
+++ b/pkgs/development/libraries/flatbuffers/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "flatbuffers";
-  version = "1.10.0";
+  version = "1.11.0";
 
   src = fetchFromGitHub {
     owner = "google";
     repo = "flatbuffers";
     rev = "v${version}";
-    sha256 = "1b32kc5jp83l43w2gs1dkw2vqm2j0wi7xfxqa86m18n3l41ca734";
+    sha256 = "1gl8pnykzifh7pnnvl80f5prmj5ga60dp44inpv9az2k9zaqx3qr";
   };
 
   preConfigure = stdenv.lib.optional stdenv.buildPlatform.isDarwin ''
diff --git a/pkgs/development/libraries/flatpak/default.nix b/pkgs/development/libraries/flatpak/default.nix
index 945f1d4931f..c0a3d3718f3 100644
--- a/pkgs/development/libraries/flatpak/default.nix
+++ b/pkgs/development/libraries/flatpak/default.nix
@@ -52,9 +52,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # TODO: some issues with temporary files
 
-  NIX_LDFLAGS = [
-    "-lpthread"
-  ];
+  NIX_LDFLAGS = "-lpthread";
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/flint/default.nix b/pkgs/development/libraries/flint/default.nix
index 20a80119b13..462d186c72d 100644
--- a/pkgs/development/libraries/flint/default.nix
+++ b/pkgs/development/libraries/flint/default.nix
@@ -39,7 +39,7 @@ stdenv.mkDerivation rec {
   ];
 
   # issues with ntl -- https://github.com/wbhart/flint2/issues/487
-  NIX_CXXSTDLIB_COMPILE = [ "-std=c++11" ];
+  NIX_CXXSTDLIB_COMPILE = "-std=c++11";
 
   patches = [
     (fetchpatch {
diff --git a/pkgs/development/libraries/fontconfig/2.10.nix b/pkgs/development/libraries/fontconfig/2.10.nix
index 1d66735569d..635baff796b 100644
--- a/pkgs/development/libraries/fontconfig/2.10.nix
+++ b/pkgs/development/libraries/fontconfig/2.10.nix
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   # Don't try to write to /var/cache/fontconfig at install time.
-  installFlags = "sysconfdir=$(out)/etc fc_cachedir=$(TMPDIR)/dummy RUN_FC_CACHE_TEST=false";
+  installFlags = [ "sysconfdir=$(out)/etc" "fc_cachedir=$(TMPDIR)/dummy" "RUN_FC_CACHE_TEST=false" ];
 
   passthru = {
     # Empty for backward compatibility, there was no versioning before 2.11
diff --git a/pkgs/development/libraries/fontconfig/default.nix b/pkgs/development/libraries/fontconfig/default.nix
index 5c9a0ecc71b..617e058bd8f 100644
--- a/pkgs/development/libraries/fontconfig/default.nix
+++ b/pkgs/development/libraries/fontconfig/default.nix
@@ -56,7 +56,7 @@ stdenv.mkDerivation rec {
   doCheck = true;
 
   # Don't try to write to /var/cache/fontconfig at install time.
-  installFlags = "fc_cachedir=$(TMPDIR)/dummy RUN_FC_CACHE_TEST=false";
+  installFlags = [ "fc_cachedir=$(TMPDIR)/dummy" "RUN_FC_CACHE_TEST=false" ];
 
   postInstall = ''
     cd "$out/etc/fonts"
diff --git a/pkgs/development/libraries/gdal/gdal-1_11.nix b/pkgs/development/libraries/gdal/gdal-1_11.nix
index a6574053414..6a086d9c998 100644
--- a/pkgs/development/libraries/gdal/gdal-1_11.nix
+++ b/pkgs/development/libraries/gdal/gdal-1_11.nix
@@ -40,9 +40,7 @@ stdenv.mkDerivation rec {
   ];
 
   # Allow use of old proj_api.h
-  NIX_CFLAGS_COMPILE = [
-    "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1"
-  ];
+  NIX_CFLAGS_COMPILE = "-DACCEPT_USE_OF_DEPRECATED_PROJ_API_H=1";
 
   # Prevent this:
   #
diff --git a/pkgs/development/libraries/gdbm/default.nix b/pkgs/development/libraries/gdbm/default.nix
index 972e9022235..830a311db70 100644
--- a/pkgs/development/libraries/gdbm/default.nix
+++ b/pkgs/development/libraries/gdbm/default.nix
@@ -4,9 +4,6 @@ stdenv.mkDerivation rec {
   pname = "gdbm";
   version = "1.18.1";
 
-  # FIXME: remove on update to > 1.18.1
-  NIX_CFLAGS_COMPILE = if stdenv.cc.isClang then "-Wno-error=return-type" else null;
-
   src = fetchurl {
     url = "mirror://gnu/gdbm/${pname}-${version}.tar.gz";
     sha256 = "1p4ibds6z3ccy65lkmd6lm7js0kwifvl53r0fd759fjxgr917rl6";
diff --git a/pkgs/development/libraries/gegl/4.0.nix b/pkgs/development/libraries/gegl/4.0.nix
index 1bdf557f399..75897b036bf 100644
--- a/pkgs/development/libraries/gegl/4.0.nix
+++ b/pkgs/development/libraries/gegl/4.0.nix
@@ -118,7 +118,7 @@ stdenv.mkDerivation rec {
 
   # TODO: Fix missing math symbols in gegl seamless clone.
   # It only appears when we use packaged poly2tri-c instead of vendored one.
-  NIX_CFLAGS_COMPILE = [ "-lm" ];
+  NIX_CFLAGS_COMPILE = "-lm";
 
   postPatch = ''
     chmod +x tests/opencl/opencl_test.sh tests/buffer/buffer-tests-run.sh
diff --git a/pkgs/development/libraries/geis/default.nix b/pkgs/development/libraries/geis/default.nix
index 97b9ba087e2..1b3d5ba4b7c 100644
--- a/pkgs/development/libraries/geis/default.nix
+++ b/pkgs/development/libraries/geis/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
     sha256 = "1svhbjibm448ybq6gnjjzj0ak42srhihssafj0w402aj71lgaq4a";
   };
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=misleading-indentation" "-Wno-error=pointer-compare" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error=misleading-indentation -Wno-error=pointer-compare";
 
   hardeningDisable = [ "format" ];
 
diff --git a/pkgs/development/libraries/gettext/default.nix b/pkgs/development/libraries/gettext/default.nix
index 157f801d2f2..c2165a9d9c7 100644
--- a/pkgs/development/libraries/gettext/default.nix
+++ b/pkgs/development/libraries/gettext/default.nix
@@ -86,5 +86,5 @@ stdenv.mkDerivation rec {
 }
 
 // stdenv.lib.optionalAttrs stdenv.isDarwin {
-  makeFlags = "CFLAGS=-D_FORTIFY_SOURCE=0";
+  makeFlags = [ "CFLAGS=-D_FORTIFY_SOURCE=0" ];
 }
diff --git a/pkgs/development/libraries/giflib/default.nix b/pkgs/development/libraries/giflib/default.nix
index 5d7b95136dd..e2ff96d366a 100644
--- a/pkgs/development/libraries/giflib/default.nix
+++ b/pkgs/development/libraries/giflib/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, fetchpatch, xmlto, docbook_xml_dtd_412, docbook_xsl, libxml2 }:
+{ stdenv, fetchurl, fetchpatch, xmlto, docbook_xml_dtd_412, docbook_xsl, libxml2, fixDarwinDylibNames }:
 
 stdenv.mkDerivation rec {
   name = "giflib-5.2.1";
@@ -21,6 +21,8 @@ stdenv.mkDerivation rec {
       --replace 'PREFIX = /usr/local' 'PREFIX = ${builtins.placeholder "out"}'
   '';
 
+  nativeBuildInputs = stdenv.lib.optionals stdenv.isDarwin [ fixDarwinDylibNames ];
+
   buildInputs = [ xmlto docbook_xml_dtd_412 docbook_xsl libxml2 ];
 
   meta = {
diff --git a/pkgs/development/libraries/glib-networking/default.nix b/pkgs/development/libraries/glib-networking/default.nix
index 802a18dfda5..63a773522a0 100644
--- a/pkgs/development/libraries/glib-networking/default.nix
+++ b/pkgs/development/libraries/glib-networking/default.nix
@@ -18,13 +18,13 @@
 
 stdenv.mkDerivation rec {
   pname = "glib-networking";
-  version = "2.62.1";
+  version = "2.62.2";
 
   outputs = [ "out" "installedTests" ];
 
   src = fetchurl {
     url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "043imcynl3rwdz79wvpdfhkmqmgdhr34z0vac3x7jymdf5kswm9w";
+    sha256 = "0i2mw75297ql72h47vyvff3hqa0kcmqybblj52fqrarb0kfbhi06";
   };
 
   patches = [
diff --git a/pkgs/development/libraries/glib/default.nix b/pkgs/development/libraries/glib/default.nix
index 706e99179f5..0febed9f9c9 100644
--- a/pkgs/development/libraries/glib/default.nix
+++ b/pkgs/development/libraries/glib/default.nix
@@ -48,11 +48,11 @@ in
 
 stdenv.mkDerivation rec {
   pname = "glib";
-  version = "2.62.3";
+  version = "2.62.4";
 
   src = fetchurl {
     url = "mirror://gnome/sources/glib/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1i2mlrd351dnmpfi465qmx9rhgyff01j29a2x3lczzyky34ss024";
+    sha256 = "1g2vj9lyh032kcwij7avx5d6a99rcsnkd07sbl9i55zsfw6h712c";
   };
 
   patches = optionals stdenv.isDarwin [
@@ -118,7 +118,7 @@ stdenv.mkDerivation rec {
     "-Ddevbindir=${placeholder ''dev''}/bin"
   ];
 
-  NIX_CFLAGS_COMPILE = [
+  NIX_CFLAGS_COMPILE = toString [
     "-Wno-error=nonnull"
     # Default for release buildtype but passed manually because
     # we're using plain
diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix
index 50b359da96c..98e579cb7a6 100644
--- a/pkgs/development/libraries/glibc/default.nix
+++ b/pkgs/development/libraries/glibc/default.nix
@@ -5,6 +5,14 @@
 , buildPackages
 }:
 
+let
+  gdCflags = [
+    "-Wno-error=stringop-truncation"
+    "-Wno-error=missing-attributes"
+    "-Wno-error=array-bounds"
+  ];
+in
+
 callPackage ./common.nix { inherit stdenv; } {
     name = "glibc" + stdenv.lib.optionalString withGd "-gd";
 
@@ -47,14 +55,14 @@ callPackage ./common.nix { inherit stdenv; } {
         #       musl-specific flags below.
         #       At next change to non-musl glibc builds, remove this `then`
         #       and the above condition, instead keeping only the `else` below.
-        then (if withGd then "-Wno-error=stringop-truncation" else null)
+        then (if withGd then gdCflags else null)
         else
-          builtins.concatLists [
-            (stdenv.lib.optional withGd "-Wno-error=stringop-truncation")
+          (builtins.concatLists [
+            (stdenv.lib.optionals withGd gdCflags)
             # Fix -Werror build failure when building glibc with musl with GCC >= 8, see:
             # https://github.com/NixOS/nixpkgs/pull/68244#issuecomment-544307798
             (stdenv.lib.optional stdenv.hostPlatform.isMusl "-Wno-error=attribute-alias")
-          ];
+          ]);
 
     # When building glibc from bootstrap-tools, we need libgcc_s at RPATH for
     # any program we run, because the gcc will have been placed at a new
diff --git a/pkgs/development/libraries/glm/default.nix b/pkgs/development/libraries/glm/default.nix
index 88b33601ee7..d39d6f0d7a3 100644
--- a/pkgs/development/libraries/glm/default.nix
+++ b/pkgs/development/libraries/glm/default.nix
@@ -27,9 +27,7 @@ stdenv.mkDerivation rec {
     cp ${gcc7PlatformPatch} glm/simd/platform.h
   '';
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionals stdenv.isDarwin [
-    "-DGLM_COMPILER=0"
-  ];
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-DGLM_COMPILER=0";
 
   postInstall = ''
     mkdir -p $doc/share/doc/glm
diff --git a/pkgs/development/libraries/gperftools/default.nix b/pkgs/development/libraries/gperftools/default.nix
index bc10c9f9bdd..0e985754985 100644
--- a/pkgs/development/libraries/gperftools/default.nix
+++ b/pkgs/development/libraries/gperftools/default.nix
@@ -16,9 +16,8 @@ stdenv.mkDerivation rec {
     substituteInPlace libtool --replace stdc++ c++
   '';
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionals stdenv.isDarwin [
-    "-D_XOPEN_SOURCE" "-Wno-aligned-allocation-unavailable"
-  ];
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin
+    "-D_XOPEN_SOURCE -Wno-aligned-allocation-unavailable";
 
   # some packages want to link to the static tcmalloc_minimal
   # to drop the runtime dependency on gperftools
diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix
index 63072273c2e..ed2b5563bd3 100644
--- a/pkgs/development/libraries/gpgme/default.nix
+++ b/pkgs/development/libraries/gpgme/default.nix
@@ -47,12 +47,12 @@ stdenv.mkDerivation rec {
   # fit in the limit. https://github.com/NixOS/nix/pull/1085
     ++ lib.optionals stdenv.isDarwin [ "--disable-gpg-test" ];
 
-  NIX_CFLAGS_COMPILE =
+  NIX_CFLAGS_COMPILE = toString (
     # qgpgme uses Q_ASSERT which retains build inputs at runtime unless
     # debugging is disabled
     lib.optional (qtbase != null) "-DQT_NO_DEBUG"
     # https://www.gnupg.org/documentation/manuals/gpgme/Largefile-Support-_0028LFS_0029.html
-    ++ lib.optional (system == "i686-linux") "-D_FILE_OFFSET_BITS=64";
+    ++ lib.optional (system == "i686-linux") "-D_FILE_OFFSET_BITS=64");
 
   checkInputs = [ which ];
 
diff --git a/pkgs/development/libraries/gsl/default.nix b/pkgs/development/libraries/gsl/default.nix
index 1fd086ca23c..966d6a8ffd5 100644
--- a/pkgs/development/libraries/gsl/default.nix
+++ b/pkgs/development/libraries/gsl/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   # do not let -march=skylake to enable FMA (https://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html)
-  NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.isx86_64 "-mno-fma";
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isx86_64 "-mno-fma";
 
   # https://lists.gnu.org/archive/html/bug-gsl/2015-11/msg00012.html
   doCheck = stdenv.hostPlatform.system != "i686-linux" && stdenv.hostPlatform.system != "aarch64-linux";
diff --git a/pkgs/development/libraries/gsl/gsl-1_16.nix b/pkgs/development/libraries/gsl/gsl-1_16.nix
index e5772c8772e..ae102ac6030 100644
--- a/pkgs/development/libraries/gsl/gsl-1_16.nix
+++ b/pkgs/development/libraries/gsl/gsl-1_16.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   # do not let -march=skylake to enable FMA (https://lists.gnu.org/archive/html/bug-gsl/2011-11/msg00019.html)
-  NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.isx86_64 "-mno-fma";
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isx86_64 "-mno-fma";
 
   patches = [
     (fetchpatch {
diff --git a/pkgs/development/libraries/gtk/2.x.nix b/pkgs/development/libraries/gtk/2.x.nix
index 4286d6a73fb..932527eed09 100644
--- a/pkgs/development/libraries/gtk/2.x.nix
+++ b/pkgs/development/libraries/gtk/2.x.nix
@@ -30,7 +30,7 @@ stdenv.mkDerivation rec {
     ./hooks/drop-icon-theme-cache.sh
   ];
 
-  nativeBuildInputs = [ setupHooks perl pkgconfig gettext gobject-introspection ];
+  nativeBuildInputs = setupHooks ++ [ perl pkgconfig gettext gobject-introspection ];
 
   patches = [
     ./patches/2.0-immodules.cache.patch
diff --git a/pkgs/development/libraries/gtk/3.x.nix b/pkgs/development/libraries/gtk/3.x.nix
index 7f09b52d51f..60432614433 100644
--- a/pkgs/development/libraries/gtk/3.x.nix
+++ b/pkgs/development/libraries/gtk/3.x.nix
@@ -88,10 +88,7 @@ stdenv.mkDerivation rec {
 
   # These are the defines that'd you'd get with --enable-debug=minimum (default).
   # See: https://developer.gnome.org/gtk3/stable/gtk-building.html#extra-configuration-options
-  NIX_CFLAGS_COMPILE = [
-    "-DG_ENABLE_DEBUG"
-    "-DG_DISABLE_CAST_CHECKS"
-  ];
+  NIX_CFLAGS_COMPILE = "-DG_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS";
 
   postPatch = ''
     files=(
@@ -118,8 +115,7 @@ stdenv.mkDerivation rec {
     pkgconfig
     python3
     sassc
-    setupHooks
-  ] ++ optionals withGtkDoc [
+  ] ++ setupHooks ++ optionals withGtkDoc [
     docbook_xml_dtd_43
     docbook_xsl
     gtk-doc
diff --git a/pkgs/development/libraries/hspell/dicts.nix b/pkgs/development/libraries/hspell/dicts.nix
index ec6b304dc3c..83942c2c1dd 100644
--- a/pkgs/development/libraries/hspell/dicts.nix
+++ b/pkgs/development/libraries/hspell/dicts.nix
@@ -1,42 +1,38 @@
 { stdenv, hspell }:
 
 let
-  dict = a: stdenv.mkDerivation ({
+  dict = variant: a: stdenv.mkDerivation ({
     inherit (hspell) src patchPhase nativeBuildInputs;
+    buildFlags = [ variant ];
+
     meta = hspell.meta // {
       broken = true;
-      description = "${a.buildFlags} Hebrew dictionary";
+      description = "${variant} Hebrew dictionary";
     } // (if a ? meta then a.meta else {});
   } // (removeAttrs a ["meta"]));
 in
 {
   recurseForDerivations = true;
 
-  aspell = dict {
+  aspell = dict "aspell" {
     name = "aspell-dict-he-${hspell.version}";
 
-    buildFlags = "aspell";
-
     installPhase = ''
       mkdir -p $out/lib/aspell
       cp -v he_affix.dat he.wl $out/lib/aspell'';
   };
 
-  myspell = dict {
+  myspell = dict "myspell" {
     name = "myspell-dict-he-${hspell.version}";
 
-    buildFlags = "myspell";
-
     installPhase = ''
       mkdir -p $out/lib/myspell
       cp -v he.dic he.aff $out/lib/myspell'';
   };
 
-  hunspell = dict {
+  hunspell = dict "hunspell" {
     name = "hunspell-dict-he-${hspell.version}";
 
-    buildFlags = "hunspell";
-
     installPhase = ''
       mkdir -p $out/lib
       cp -rv hunspell $out/lib'';
diff --git a/pkgs/development/libraries/http-parser/default.nix b/pkgs/development/libraries/http-parser/default.nix
index 76173bc5b99..4b1a695ca55 100644
--- a/pkgs/development/libraries/http-parser/default.nix
+++ b/pkgs/development/libraries/http-parser/default.nix
@@ -16,7 +16,7 @@ in stdenv.mkDerivation {
   NIX_CFLAGS_COMPILE = "-Wno-error";
   patches = [ ./build-shared.patch ];
   makeFlags = [ "DESTDIR=" "PREFIX=$(out)" ];
-  buildFlags = "library";
+  buildFlags = [ "library" ];
   doCheck = true;
   checkTarget = "test";
 
diff --git a/pkgs/development/libraries/icu/58.nix b/pkgs/development/libraries/icu/58.nix
index f7763ba49da..e53e4e3737e 100644
--- a/pkgs/development/libraries/icu/58.nix
+++ b/pkgs/development/libraries/icu/58.nix
@@ -10,5 +10,5 @@ import ./base.nix {
   version = "58.2";
   sha256 = "036shcb3f8bm1lynhlsb4kpjm9s9c2vdiir01vg216rs2l8482ib";
   patches = [ keywordFix ];
-  patchFlags = "-p4";
+  patchFlags = [ "-p4" ];
 }
diff --git a/pkgs/development/libraries/icu/base.nix b/pkgs/development/libraries/icu/base.nix
index 47ca63fca99..e51224433e8 100644
--- a/pkgs/development/libraries/icu/base.nix
+++ b/pkgs/development/libraries/icu/base.nix
@@ -1,4 +1,4 @@
-{ version, sha256, patches ? [], patchFlags ? "" }:
+{ version, sha256, patches ? [], patchFlags ? [] }:
 { stdenv, lib, fetchurl, fixDarwinDylibNames
   # Cross-compiled icu4c requires a build-root of a native compile
 , buildRootOnly ? false, nativeBuildRoot
diff --git a/pkgs/development/libraries/ilmbase/default.nix b/pkgs/development/libraries/ilmbase/default.nix
index a25a590b370..00cdda1e570 100644
--- a/pkgs/development/libraries/ilmbase/default.nix
+++ b/pkgs/development/libraries/ilmbase/default.nix
@@ -20,7 +20,7 @@ stdenv.mkDerivation rec {
   depsBuildBuild = [ buildPackages.stdenv.cc ];
   nativeBuildInputs = [ automake autoconf libtool which ];
 
-  NIX_CFLAGS_LINK = [ "-pthread" ];
+  NIX_CFLAGS_LINK = "-pthread";
 
   patches = [
     ./bootstrap.patch
diff --git a/pkgs/development/libraries/itk/4.x.nix b/pkgs/development/libraries/itk/4.x.nix
index df016d9fcac..7e24ba901e5 100644
--- a/pkgs/development/libraries/itk/4.x.nix
+++ b/pkgs/development/libraries/itk/4.x.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, cmake, libX11, libuuid, xz, vtk }:
 
 stdenv.mkDerivation rec {
-  name = "itk-4.13.1";
+  name = "itk-4.13.2";
 
   src = fetchurl {
-    url = mirror://sourceforge/itk/InsightToolkit-4.13.1.tar.xz;
-    sha256 = "0p4cspgbnjsnkjz8nfg092yaxz8qkqi2nkxjdv421d0zrmi0i2al";
+    url = mirror://sourceforge/itk/InsightToolkit-4.13.2.tar.xz;
+    sha256 = "19cgfpd63gqrvc3m27m394gy2d7w79g5y6lvznb5qqr49lihbgns";
   };
 
   cmakeFlags = [
diff --git a/pkgs/development/libraries/java/swt/default.nix b/pkgs/development/libraries/java/swt/default.nix
index 6eb5a1f5355..b0fdca11218 100644
--- a/pkgs/development/libraries/java/swt/default.nix
+++ b/pkgs/development/libraries/java/swt/default.nix
@@ -38,8 +38,8 @@ in stdenv.mkDerivation rec {
   nativeBuildInputs = [ unzip pkgconfig ];
   buildInputs = [ jdk gtk2 libXt libXtst libXi libGLU libGL webkitgtk libsoup ];
 
-  NIX_LFLAGS = (map (x: "-L${lib.getLib x}/lib") [ xorg.libX11 pango gdk-pixbuf glib ]) ++
-    [ "-lX11" "-lpango-1.0" "-lgdk_pixbuf-2.0" "-lglib-2.0" ];
+  NIX_LFLAGS = toString (map (x: "-L${lib.getLib x}/lib") [ xorg.libX11 pango gdk-pixbuf glib ]) +
+    " -lX11 -lpango-1.0 -lgdk_pixbuf-2.0 -lglib-2.0";
 
   buildPhase = ''
     unzip src.zip -d src
diff --git a/pkgs/development/libraries/leatherman/default.nix b/pkgs/development/libraries/leatherman/default.nix
index 0af7f29a41f..b7b9b019b63 100644
--- a/pkgs/development/libraries/leatherman/default.nix
+++ b/pkgs/development/libraries/leatherman/default.nix
@@ -11,7 +11,12 @@ stdenv.mkDerivation rec {
     owner = "puppetlabs";
   };
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=ignored-qualifiers" "-Wno-error=class-memaccess" "-Wno-error=catch-value" ];
+  NIX_CFLAGS_COMPILE = builtins.toString [
+    "-Wno-error=ignored-qualifiers"
+    "-Wno-error=class-memaccess"
+    "-Wno-error=catch-value"
+    "-Wno-error=deprecated-copy"
+  ];
 
   nativeBuildInputs = [ cmake ];
   buildInputs = [ boost curl ruby ];
@@ -19,7 +24,7 @@ stdenv.mkDerivation rec {
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
-    homepage = https://github.com/puppetlabs/leatherman/;  
+    homepage = https://github.com/puppetlabs/leatherman/;
     description = "A collection of C++ and CMake utility libraries";
     license = licenses.asl20;
     maintainers = [ maintainers.womfoo ];
diff --git a/pkgs/development/libraries/libav/default.nix b/pkgs/development/libraries/libav/default.nix
index feeb4de15e1..43cfe2ef251 100644
--- a/pkgs/development/libraries/libav/default.nix
+++ b/pkgs/development/libraries/libav/default.nix
@@ -103,7 +103,7 @@ let
     setOutputFlags = false;
 
     # alltools to build smaller tools, incl. aviocat, ismindex, qt-faststart, etc.
-    buildFlags = "all alltools install-man";
+    buildFlags = [ "all" "alltools" "install-man" ];
 
 
     postInstall = ''
diff --git a/pkgs/development/libraries/libbluray/default.nix b/pkgs/development/libraries/libbluray/default.nix
index 517251e137e..daa349ca630 100644
--- a/pkgs/development/libraries/libbluray/default.nix
+++ b/pkgs/development/libraries/libbluray/default.nix
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = optional withAACS libaacs;
 
-  NIX_LDFLAGS = [
+  NIX_LDFLAGS = toString [
     (optionalString withAACS   "-L${libaacs}/lib -laacs")
     (optionalString withBDplus "-L${libbdplus}/lib -lbdplus")
   ];
diff --git a/pkgs/development/libraries/libcaca/default.nix b/pkgs/development/libraries/libcaca/default.nix
index 8949ea8e390..7773fe46c0c 100644
--- a/pkgs/development/libraries/libcaca/default.nix
+++ b/pkgs/development/libraries/libcaca/default.nix
@@ -19,12 +19,12 @@ stdenv.mkDerivation rec {
     (if x11Support then "--enable-x11" else "--disable-x11")
     ];
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optional (!x11Support) "-DX_DISPLAY_MISSING";
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!x11Support) "-DX_DISPLAY_MISSING";
 
   enableParallelBuilding = true;
 
   propagatedBuildInputs = [ ncurses zlib pkgconfig (imlib2.override { inherit x11Support; }) ]
-    ++ stdenv.lib.optionals x11Support [ libX11 libXext];
+    ++ stdenv.lib.optionals x11Support [ libX11 libXext ];
 
   postInstall = ''
     mkdir -p $dev/bin
diff --git a/pkgs/development/libraries/libcbor/default.nix b/pkgs/development/libraries/libcbor/default.nix
index 4d56c0f1403..4949d657669 100644
--- a/pkgs/development/libraries/libcbor/default.nix
+++ b/pkgs/development/libraries/libcbor/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # needs "-DWITH_TESTS=ON", but fails w/compilation error
 
-  NIX_CFLAGS_COMPILE = [ "-fno-lto" ];
+  NIX_CFLAGS_COMPILE = "-fno-lto";
 
   meta = with stdenv.lib; {
     description = "CBOR protocol implementation for C and others";
diff --git a/pkgs/development/libraries/libcef/default.nix b/pkgs/development/libraries/libcef/default.nix
index be418125dfb..03cc3b2beb4 100644
--- a/pkgs/development/libraries/libcef/default.nix
+++ b/pkgs/development/libraries/libcef/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ cmake ];
-  makeFlags = "libcef_dll_wrapper";
+  makeFlags = [ "libcef_dll_wrapper" ];
   dontStrip = true;
   dontPatchELF = true;
 
diff --git a/pkgs/development/libraries/libcouchbase/default.nix b/pkgs/development/libraries/libcouchbase/default.nix
index ccfe241324e..53ec231dec9 100644
--- a/pkgs/development/libraries/libcouchbase/default.nix
+++ b/pkgs/development/libraries/libcouchbase/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "1yfmcx65aqd5l87scha6kmm2s38n85ci3gg0h6qfs16s3jfi6bw7";
   };
 
-  cmakeFlags = "-DLCB_NO_MOCK=ON";
+  cmakeFlags = [ "-DLCB_NO_MOCK=ON" ];
 
   nativeBuildInputs = [ cmake pkgconfig ];
   buildInputs = [ libevent openssl ];
diff --git a/pkgs/development/libraries/libde265/default.nix b/pkgs/development/libraries/libde265/default.nix
index 3c31ba805d8..918f7675389 100644
--- a/pkgs/development/libraries/libde265/default.nix
+++ b/pkgs/development/libraries/libde265/default.nix
@@ -1,14 +1,14 @@
 { stdenv, fetchFromGitHub, autoreconfHook, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  version = "1.0.3";
+  version = "1.0.4";
   pname = "libde265";
 
   src = fetchFromGitHub {
     owner = "strukturag";
     repo = "libde265";
     rev = "v${version}";
-    sha256 = "049g77f6c5sbk1h534zi9akj3y5h8zwnca5c9kqqjkn7f17irk10";
+    sha256 = "0svxrhh1pv7xpj75svz0iw1sq5i6z2grj7sc3q11hl63666hzh7d";
   };
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
diff --git a/pkgs/development/libraries/libdynd/default.nix b/pkgs/development/libraries/libdynd/default.nix
index 249f3f4f21a..c02a6f9a502 100644
--- a/pkgs/development/libraries/libdynd/default.nix
+++ b/pkgs/development/libraries/libdynd/default.nix
@@ -16,13 +16,14 @@ stdenv.mkDerivation {
     "-DDYND_BUILD_BENCHMARKS=OFF"
   ];
 
-  # added to fix build with gcc7
-  NIX_CFLAGS_COMPILE = [
+  # added to fix build with gcc7+
+  NIX_CFLAGS_COMPILE = builtins.toString [
     "-Wno-error=implicit-fallthrough"
     "-Wno-error=nonnull"
     "-Wno-error=tautological-compare"
     "-Wno-error=class-memaccess"
     "-Wno-error=parentheses"
+    "-Wno-error=deprecated-copy"
   ];
 
   buildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/libev/default.nix b/pkgs/development/libraries/libev/default.nix
index 56710945ecb..42d3b943569 100644
--- a/pkgs/development/libraries/libev/default.nix
+++ b/pkgs/development/libraries/libev/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libev";
-  version="4.27";
+  version="4.31";
 
   src = fetchurl {
     url = "http://dist.schmorp.de/libev/Attic/${pname}-${version}.tar.gz";
-    sha256 = "0kil23cgsp0r5shvnwwbsy7fzxb62sxqzqbkbkfp5w54ipy2cm9d";
+    sha256 = "0nkfqv69wfyy2bpga4d53iqydycpik8jp8x6q70353hia8mmv1gd";
   };
 
   meta = {
diff --git a/pkgs/development/libraries/libexecinfo/default.nix b/pkgs/development/libraries/libexecinfo/default.nix
index 2eee9bafe44..4519cc7dd74 100644
--- a/pkgs/development/libraries/libexecinfo/default.nix
+++ b/pkgs/development/libraries/libexecinfo/default.nix
@@ -29,7 +29,7 @@ stdenv.mkDerivation rec {
 
   makeFlags = [ "CC:=$(CC)" "AR:=$(AR)" ];
 
-  patchFlags = "-p0";
+  patchFlags = [ "-p0" ];
 
   installPhase = ''
     install -Dm644 execinfo.h stacktraverse.h -t $out/include
diff --git a/pkgs/development/libraries/libf2c/default.nix b/pkgs/development/libraries/libf2c/default.nix
index 2de407e8f63..10a0d179d3e 100644
--- a/pkgs/development/libraries/libf2c/default.nix
+++ b/pkgs/development/libraries/libf2c/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
     unzip ${src}
   '';
 
-  makeFlags = "-f makefile.u";
+  makeFlags = [ "-f" "makefile.u" ];
 
   installPhase = ''
     mkdir -p $out/include $out/lib
diff --git a/pkgs/development/libraries/libfakekey/default.nix b/pkgs/development/libraries/libfakekey/default.nix
index 196f0e50bef..3c243191543 100644
--- a/pkgs/development/libraries/libfakekey/default.nix
+++ b/pkgs/development/libraries/libfakekey/default.nix
@@ -11,9 +11,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ libX11 libXi libXtst xorgproto ];
-  NIX_LDFLAGS = [
-    "-lX11"
-  ];
+  NIX_LDFLAGS = "-lX11";
 
   meta = with stdenv.lib; {
     description = "X virtual keyboard library";
diff --git a/pkgs/development/libraries/libfpx/default.nix b/pkgs/development/libraries/libfpx/default.nix
index f4863eb33f2..97df5107409 100644
--- a/pkgs/development/libraries/libfpx/default.nix
+++ b/pkgs/development/libraries/libfpx/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
   };
 
   # Darwin gets misdetected as Windows without this
-  NIX_CFLAGS_COMPILE = if stdenv.isDarwin then "-D__unix" else null;
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.isDarwin "-D__unix";
 
   patches = [
     (fetchpatch {
diff --git a/pkgs/development/libraries/libftdi/default.nix b/pkgs/development/libraries/libftdi/default.nix
index 08ec1d84a3f..3dffbd075e9 100644
--- a/pkgs/development/libraries/libftdi/default.nix
+++ b/pkgs/development/libraries/libftdi/default.nix
@@ -14,7 +14,7 @@ with stdenv; mkDerivation rec {
 
   # Hack to avoid TMPDIR in RPATHs.
   preFixup = ''rm -rf "$(pwd)" '';
-  configureFlags = lib.optional (!isDarwin) [ "--with-async-mode" ];
+  configureFlags = lib.optional (!isDarwin) "--with-async-mode";
 
   # allow async mode. from ubuntu. see:
   #   https://bazaar.launchpad.net/~ubuntu-branches/ubuntu/trusty/libftdi/trusty/view/head:/debian/patches/04_async_mode.diff
diff --git a/pkgs/development/libraries/libgdiplus/default.nix b/pkgs/development/libraries/libgdiplus/default.nix
index 1a690ca7aa1..54bf091e5ea 100644
--- a/pkgs/development/libraries/libgdiplus/default.nix
+++ b/pkgs/development/libraries/libgdiplus/default.nix
@@ -21,7 +21,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
 
-  configureFlags = stdenv.lib.optionalString stdenv.cc.isClang "--host=${stdenv.hostPlatform.system}";
+  configureFlags = stdenv.lib.optional stdenv.cc.isClang "--host=${stdenv.hostPlatform.system}";
 
   buildInputs =
     [ glib cairo fontconfig libtiff giflib
diff --git a/pkgs/development/libraries/libglvnd/default.nix b/pkgs/development/libraries/libglvnd/default.nix
index c2a5cfbed74..55b801b0b0d 100644
--- a/pkgs/development/libraries/libglvnd/default.nix
+++ b/pkgs/development/libraries/libglvnd/default.nix
@@ -39,13 +39,13 @@ stdenv.mkDerivation rec {
       --replace "-Xlinker --version-script=$(VERSION_SCRIPT)" "-Xlinker"
   '';
 
-  NIX_CFLAGS_COMPILE = [
+  NIX_CFLAGS_COMPILE = toString ([
     "-UDEFAULT_EGL_VENDOR_CONFIG_DIRS"
     # FHS paths are added so that non-NixOS applications can find vendor files.
     "-DDEFAULT_EGL_VENDOR_CONFIG_DIRS=\"${addOpenGLRunpath.driverLink}/share/glvnd/egl_vendor.d:/etc/glvnd/egl_vendor.d:/usr/share/glvnd/egl_vendor.d\""
 
     "-Wno-error=array-bounds"
-  ] ++ lib.optional stdenv.cc.isClang "-Wno-error";
+  ] ++ lib.optional stdenv.cc.isClang "-Wno-error");
 
   # Indirectly: https://bugs.freedesktop.org/show_bug.cgi?id=35268
   configureFlags  = stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-tls";
diff --git a/pkgs/development/libraries/libguestfs/default.nix b/pkgs/development/libraries/libguestfs/default.nix
index 07f2099f11a..8d480c2d882 100644
--- a/pkgs/development/libraries/libguestfs/default.nix
+++ b/pkgs/development/libraries/libguestfs/default.nix
@@ -46,7 +46,7 @@ stdenv.mkDerivation rec {
     ++ stdenv.lib.optionals (!javaSupport) [ "--disable-java" "--without-java" ];
   patches = [ ./libguestfs-syms.patch ];
   NIX_CFLAGS_COMPILE="-I${libxml2.dev}/include/libxml2/";
-  installFlags = "REALLY_INSTALL=yes";
+  installFlags = [ "REALLY_INSTALL=yes" ];
   enableParallelBuilding = true;
 
   postInstall = ''
diff --git a/pkgs/development/libraries/libheif/default.nix b/pkgs/development/libraries/libheif/default.nix
index 85174e9c3e6..a6e072ef76f 100644
--- a/pkgs/development/libraries/libheif/default.nix
+++ b/pkgs/development/libraries/libheif/default.nix
@@ -2,7 +2,7 @@
 
 stdenv.mkDerivation rec {
   pname = "libheif";
-  version = "1.6.0";
+  version = "1.6.1";
 
   outputs = [ "bin" "out" "dev" "man" ];
 
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
     owner = "strukturag";
     repo = "libheif";
     rev = "v${version}";
-    sha256 = "0im9k2pqghlsppj165kh3nc26c4wx1brckmncdmpy0mcj56jjmba";
+    sha256 = "0l3mj11lp4974kaym3aidm4wriqzls13gz22s67l6341yhsc42n6";
   };
 
   nativeBuildInputs = [ autoreconfHook pkgconfig ];
diff --git a/pkgs/development/libraries/libical/default.nix b/pkgs/development/libraries/libical/default.nix
index 903a1a26eb7..69c4b3aeb74 100644
--- a/pkgs/development/libraries/libical/default.nix
+++ b/pkgs/development/libraries/libical/default.nix
@@ -15,7 +15,7 @@
 
 stdenv.mkDerivation rec {
   pname = "libical";
-  version = "3.0.6";
+  version = "3.0.7";
 
   outputs = [ "out" "dev" ]; # "devdoc" ];
 
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     owner = "libical";
     repo = "libical";
     rev = "v${version}";
-    sha256 = "181lf07fj36fp0rbcjjmb53yzdvv9i4qxpnbpax8hayjhha8pjh3";
+    sha256 = "1ppf8jlpiclq3jprhx889y5lgf6lc2q4d8wy2zavzsxgnsqf67il";
   };
 
   nativeBuildInputs = [
diff --git a/pkgs/development/libraries/libjpeg-drop/default.nix b/pkgs/development/libraries/libjpeg-drop/default.nix
index 4e9c165e71f..8ed1c9bf92f 100644
--- a/pkgs/development/libraries/libjpeg-drop/default.nix
+++ b/pkgs/development/libraries/libjpeg-drop/default.nix
@@ -24,7 +24,7 @@ stdenv.mkDerivation {
   '';
 
   configureFlags = []
-    ++ optional static [ "--enable-static" "--disable-shared" ];
+    ++ optionals static [ "--enable-static" "--disable-shared" ];
 
   outputs = [ "bin" "dev" "out" "man" ];
 
diff --git a/pkgs/development/libraries/libmatchbox/default.nix b/pkgs/development/libraries/libmatchbox/default.nix
index 3786c5e77d3..98875e48f57 100644
--- a/pkgs/development/libraries/libmatchbox/default.nix
+++ b/pkgs/development/libraries/libmatchbox/default.nix
@@ -6,9 +6,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libXft libICE pango libjpeg ];
   propagatedBuildInputs = [ libX11 libXext libpng ];
-  NIX_LDFLAGS = [
-    "-lX11"
-  ];
+  NIX_LDFLAGS = "-lX11";
 
   src = fetchurl {
     url = "https://downloads.yoctoproject.org/releases/matchbox/libmatchbox/${version}/libmatchbox-${version}.tar.bz2";
diff --git a/pkgs/development/libraries/libmbim/default.nix b/pkgs/development/libraries/libmbim/default.nix
index 46255e276f5..a49e0eaaac6 100644
--- a/pkgs/development/libraries/libmbim/default.nix
+++ b/pkgs/development/libraries/libmbim/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libmbim";
-  version = "1.20.2";
+  version = "1.20.4";
 
   src = fetchurl {
     url = "https://www.freedesktop.org/software/libmbim/${pname}-${version}.tar.xz";
-    sha256 = "16q550sy84izi5ic3sbbhjnnka2fwhj8vvdrirpn9xspbsgbc3sm";
+    sha256 = "1s6k6vm4hyma7nafm1gjssl9lq9nkkiska462xpiz7xh16j0h9xc";
   };
 
   outputs = [ "out" "dev" "man" ];
diff --git a/pkgs/development/libraries/libmemcached/default.nix b/pkgs/development/libraries/libmemcached/default.nix
index 57053103417..5655bfe968b 100644
--- a/pkgs/development/libraries/libmemcached/default.nix
+++ b/pkgs/development/libraries/libmemcached/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
   buildInputs = [ libevent ];
   propagatedBuildInputs = [ cyrus_sasl ];
 
-  NIX_CFLAGS_COMPILE = [ "-fpermissive"/*gcc7*/ ];
+  NIX_CFLAGS_COMPILE = "-fpermissive";
 
   meta = with stdenv.lib; {
     homepage = https://libmemcached.org;
diff --git a/pkgs/development/libraries/libmicrohttpd/default.nix b/pkgs/development/libraries/libmicrohttpd/default.nix
index c8340626935..ba4d74e4d48 100644
--- a/pkgs/development/libraries/libmicrohttpd/default.nix
+++ b/pkgs/development/libraries/libmicrohttpd/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "libmicrohttpd";
-  version = "0.9.68";
+  version = "0.9.69";
 
   src = fetchurl {
     url = "mirror://gnu/libmicrohttpd/${pname}-${version}.tar.gz";
-    sha256 = "0q8bc4hrxn6llml7w2vam6n833x8injs39wgdkhwkawr50m6wwf5";
+    sha256 = "0zp34zgcahym5kp2r83gfb5wnr8yf643a26k6zk96x3qica6p6zv";
   };
 
   outputs = [ "out" "dev" "devdoc" "info" ];
diff --git a/pkgs/development/libraries/libmpeg2/default.nix b/pkgs/development/libraries/libmpeg2/default.nix
index 321204a0c4f..2351ce2b554 100644
--- a/pkgs/development/libraries/libmpeg2/default.nix
+++ b/pkgs/development/libraries/libmpeg2/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   };
 
   # Otherwise clang fails with 'duplicate symbol ___sputc'
-  buildFlags = stdenv.lib.optionalString stdenv.isDarwin "CFLAGS=-std=gnu89";
+  buildFlags = stdenv.lib.optional stdenv.isDarwin "CFLAGS=-std=gnu89";
 
   meta = {
     homepage = http://libmpeg2.sourceforge.net/;
diff --git a/pkgs/development/libraries/liboping/default.nix b/pkgs/development/libraries/liboping/default.nix
index ff8f200a3bb..b2594d7c1d7 100644
--- a/pkgs/development/libraries/liboping/default.nix
+++ b/pkgs/development/libraries/liboping/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "1n2wkmvw6n80ybdwkjq8ka43z2x8mvxq49byv61b52iyz69slf7b";
   };
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=format-truncation" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error=format-truncation";
 
   buildInputs = [ ncurses perl ];
 
diff --git a/pkgs/development/libraries/libosmpbf/default.nix b/pkgs/development/libraries/libosmpbf/default.nix
index 4be744e7ba9..416101cad0a 100644
--- a/pkgs/development/libraries/libosmpbf/default.nix
+++ b/pkgs/development/libraries/libosmpbf/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation {
 
   sourceRoot = "OSM-binary-1.3.3/src";
 
-  installFlags = "PREFIX=$(out)";
+  installFlags = [ "PREFIX=$(out)" ];
 
   meta = {
     homepage = https://github.com/scrosby/OSM-binary;
diff --git a/pkgs/development/libraries/libowfat/default.nix b/pkgs/development/libraries/libowfat/default.nix
index 4f1a5f8a179..73029c76818 100644
--- a/pkgs/development/libraries/libowfat/default.nix
+++ b/pkgs/development/libraries/libowfat/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
       'install -m 644 $(INCLUDES) $(DESTDIR)$(INCLUDEDIR)'
   '';
 
-  makeFlags = "prefix=$(out)";
+  makeFlags = [ "prefix=$(out)" ];
   enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/libpfm/default.nix b/pkgs/development/libraries/libpfm/default.nix
index f48c605dafd..3398d3feb94 100644
--- a/pkgs/development/libraries/libpfm/default.nix
+++ b/pkgs/development/libraries/libpfm/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation (rec {
     "SYS=${stdenv.hostPlatform.uname.system}"
   ];
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error";
 
   meta = with stdenv.lib; {
     description = "Helper library to program the performance monitoring events";
diff --git a/pkgs/development/libraries/libqtav/default.nix b/pkgs/development/libraries/libqtav/default.nix
index 22245f5fa2a..dd6318444e7 100644
--- a/pkgs/development/libraries/libqtav/default.nix
+++ b/pkgs/development/libraries/libqtav/default.nix
@@ -30,7 +30,7 @@ mkDerivation rec {
   # Make sure libqtav finds its libGL dependency at both link and run time
   # by adding libGL to rpath. Not sure why it wasn't done automatically like
   # the other libraries as `libGL` is part of our `buildInputs`.
-  NIX_CFLAGS_LINK = [ "-Wl,-rpath,${libGL}/lib"];
+  NIX_CFLAGS_LINK = "-Wl,-rpath,${libGL}/lib";
 
   preFixup = ''
     mkdir -p "$out/bin"
diff --git a/pkgs/development/libraries/libscrypt/default.nix b/pkgs/development/libraries/libscrypt/default.nix
index b9ae1f829a1..3083136526b 100644
--- a/pkgs/development/libraries/libscrypt/default.nix
+++ b/pkgs/development/libraries/libscrypt/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   buildFlags = stdenv.lib.optional stdenv.isDarwin "LDFLAGS= CFLAGS_EXTRA=";
 
   installFlags = [ "PREFIX=$(out)" ];
-  installTargets = if stdenv.isDarwin then "install-osx" else "install";
+  installTargets = stdenv.lib.optional stdenv.isDarwin "install-osx";
 
   doCheck = true;
 
diff --git a/pkgs/development/libraries/libspotify/default.nix b/pkgs/development/libraries/libspotify/default.nix
index 9ef3d665413..1b0953df4e6 100644
--- a/pkgs/development/libraries/libspotify/default.nix
+++ b/pkgs/development/libraries/libspotify/default.nix
@@ -50,11 +50,11 @@ else stdenv.mkDerivation {
   buildInputs = stdenv.lib.optional (stdenv.hostPlatform.system == "x86_64-darwin") unzip;
 
   # linux-specific
-  installFlags = stdenv.lib.optionalString (isLinux)
+  installFlags = stdenv.lib.optional isLinux
     "prefix=$(out)";
-  patchPhase = stdenv.lib.optionalString (isLinux)
+  patchPhase = stdenv.lib.optionalString isLinux
     "${gnused}/bin/sed -i 's/ldconfig//' Makefile";
-  postInstall = stdenv.lib.optionalString (isLinux)
+  postInstall = stdenv.lib.optionalString isLinux
     "mv -v share $out";
 
   passthru = {
diff --git a/pkgs/development/libraries/libunique/default.nix b/pkgs/development/libraries/libunique/default.nix
index e0022411221..d6566978a6b 100644
--- a/pkgs/development/libraries/libunique/default.nix
+++ b/pkgs/development/libraries/libunique/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
   };
 
   # glib-2.62 deprecations
-  NIX_CFLAGS_COMPILE = [ "-DGLIB_DISABLE_DEPRECATION_WARNINGS" ];
+  NIX_CFLAGS_COMPILE = "-DGLIB_DISABLE_DEPRECATION_WARNINGS";
 
   # Patches from Gentoo portage
   patches = [
diff --git a/pkgs/development/libraries/libvdpau/default.nix b/pkgs/development/libraries/libvdpau/default.nix
index 792a31bcf9f..e6a57f1e38c 100644
--- a/pkgs/development/libraries/libvdpau/default.nix
+++ b/pkgs/development/libraries/libvdpau/default.nix
@@ -19,7 +19,7 @@ stdenv.mkDerivation rec {
   configureFlags = stdenv.lib.optional stdenv.isLinux
     "--with-module-dir=${mesa.drivers.driverLink}/lib/vdpau";
 
-  NIX_LDFLAGS = if stdenv.isDarwin then "-lX11" else null;
+  NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lX11";
 
   installFlags = [ "moduledir=$(out)/lib/vdpau" ];
 
diff --git a/pkgs/development/libraries/libwhereami/default.nix b/pkgs/development/libraries/libwhereami/default.nix
index 84bd1847faa..8e190f998d5 100644
--- a/pkgs/development/libraries/libwhereami/default.nix
+++ b/pkgs/development/libraries/libwhereami/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     owner = "puppetlabs";
   };
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=catch-value" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error=catch-value";
 
   nativeBuildInputs = [ cmake ];
 
diff --git a/pkgs/development/libraries/libwps/default.nix b/pkgs/development/libraries/libwps/default.nix
index e8f39754885..61b777a5243 100644
--- a/pkgs/development/libraries/libwps/default.nix
+++ b/pkgs/development/libraries/libwps/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ boost librevenge zlib ];
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=implicit-fallthrough" ]; # newly detected by gcc-7
+  NIX_CFLAGS_COMPILE = "-Wno-error=implicit-fallthrough";
 
   meta = with stdenv.lib; {
     homepage = http://libwps.sourceforge.net/;
diff --git a/pkgs/development/libraries/libxml2/default.nix b/pkgs/development/libraries/libxml2/default.nix
index f5dcb3357f7..57a7294c887 100644
--- a/pkgs/development/libraries/libxml2/default.nix
+++ b/pkgs/development/libraries/libxml2/default.nix
@@ -32,7 +32,7 @@ stdenv.mkDerivation rec {
   outputs = [ "bin" "dev" "out" "man" "doc" ]
     ++ lib.optional pythonSupport "py"
     ++ lib.optional (enableStatic && enableShared) "static";
-  propagatedBuildOutputs = "out bin" + lib.optionalString pythonSupport " py";
+  propagatedBuildOutputs = [ "out" "bin" ] ++ lib.optional pythonSupport "py";
 
   buildInputs = lib.optional pythonSupport python
     ++ lib.optional (pythonSupport && python?isPy3 && python.isPy3) ncurses
@@ -64,8 +64,8 @@ stdenv.mkDerivation rec {
 
   preInstall = lib.optionalString pythonSupport
     ''substituteInPlace python/libxml2mod.la --replace "${python}" "$py"'';
-  installFlags = lib.optionalString pythonSupport
-    ''pythondir="$(py)/lib/${python.libPrefix}/site-packages"'';
+  installFlags = lib.optional pythonSupport
+    "pythondir=\"${placeholder ''py''}/lib/${python.libPrefix}/site-packages\"";
 
   postFixup = ''
     moveToOutput bin/xml2-config "$dev"
diff --git a/pkgs/development/libraries/libyaml-cpp/default.nix b/pkgs/development/libraries/libyaml-cpp/default.nix
index 6d782543099..0dec9daee6a 100644
--- a/pkgs/development/libraries/libyaml-cpp/default.nix
+++ b/pkgs/development/libraries/libyaml-cpp/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake ];
 
-  cmakeFlags = "-DBUILD_SHARED_LIBS=ON -DYAML_CPP_BUILD_TESTS=OFF";
+  cmakeFlags = [ "-DBUILD_SHARED_LIBS=ON" "-DYAML_CPP_BUILD_TESTS=OFF" ];
 
   meta = with stdenv.lib; {
     inherit (src.meta) homepage;
diff --git a/pkgs/development/libraries/lmdb/default.nix b/pkgs/development/libraries/lmdb/default.nix
index 830ec7bdaee..25bac68faf6 100644
--- a/pkgs/development/libraries/lmdb/default.nix
+++ b/pkgs/development/libraries/lmdb/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
   postUnpack = "sourceRoot=\${sourceRoot}/libraries/liblmdb";
 
   patches = [ ./hardcoded-compiler.patch ];
-  patchFlags = "-p3";
+  patchFlags = [ "-p3" ];
 
   outputs = [ "bin" "out" "dev" ];
 
diff --git a/pkgs/development/libraries/mediastreamer/default.nix b/pkgs/development/libraries/mediastreamer/default.nix
index 1605ec355cc..0204223d127 100644
--- a/pkgs/development/libraries/mediastreamer/default.nix
+++ b/pkgs/development/libraries/mediastreamer/default.nix
@@ -32,10 +32,12 @@ stdenv.mkDerivation rec {
     ortp libv4l libpcap srtp bctoolbox libXext libmatroska
   ];
 
-  NIX_CFLAGS_COMPILE = [
+  NIX_CFLAGS_COMPILE = toString [
     "-DGIT_VERSION=\"v${version}\""
     "-Wno-error=deprecated-declarations"
     "-Wno-error=cast-function-type"
+    "-Wno-error=stringop-truncation"
+    "-Wno-error=stringop-overflow"
   ];
   NIX_LDFLAGS = "-lXext";
 
diff --git a/pkgs/development/libraries/mlt/qt-5.nix b/pkgs/development/libraries/mlt/qt-5.nix
index f017e4452a6..0e3750df415 100644
--- a/pkgs/development/libraries/mlt/qt-5.nix
+++ b/pkgs/development/libraries/mlt/qt-5.nix
@@ -33,7 +33,7 @@ stdenv.mkDerivation rec {
 
   # mlt is unable to cope with our multi-prefix Qt build
   # because it does not use CMake or qmake.
-  NIX_CFLAGS_COMPILE = [ "-I${getDev qtsvg}/include/QtSvg" ];
+  NIX_CFLAGS_COMPILE = "-I${getDev qtsvg}/include/QtSvg";
 
   CXXFLAGS = "-std=c++11";
 
diff --git a/pkgs/development/libraries/mps/default.nix b/pkgs/development/libraries/mps/default.nix
index ec3b4e20147..8c1f3aea466 100644
--- a/pkgs/development/libraries/mps/default.nix
+++ b/pkgs/development/libraries/mps/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
   buildInputs = [ sqlite ];
 
   # needed for 1.116.0 to build with gcc7
-  NIX_CFLAGS_COMPILE = [
+  NIX_CFLAGS_COMPILE = toString [
     "-Wno-implicit-fallthrough"
     "-Wno-error=clobbered"
     "-Wno-error=cast-function-type"
diff --git a/pkgs/development/libraries/nss/default.nix b/pkgs/development/libraries/nss/default.nix
index 7499750c1f0..df9c3260878 100644
--- a/pkgs/development/libraries/nss/default.nix
+++ b/pkgs/development/libraries/nss/default.nix
@@ -38,7 +38,7 @@ in stdenv.mkDerivation rec {
       ./ckpem.patch
     ];
 
-  patchFlags = "-p0";
+  patchFlags = [ "-p0" ];
 
   postPatch = stdenv.lib.optionalString stdenv.isDarwin ''
     substituteInPlace nss/coreconf/Darwin.mk --replace '@executable_path/$(notdir $@)' "$out/lib/\$(notdir \$@)"
diff --git a/pkgs/development/libraries/ntrack/default.nix b/pkgs/development/libraries/ntrack/default.nix
index b79f940affa..803906b1343 100644
--- a/pkgs/development/libraries/ntrack/default.nix
+++ b/pkgs/development/libraries/ntrack/default.nix
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig python ];
 
   # error: ISO C does not support '__FUNCTION__' predefined identifier [-Werror=pedantic]
-  NIX_CFLAGS_COMPILE = [ "-Wno-error" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error";
 
   configureFlags = [ "--without-gobject" "CFLAGS=--std=gnu99" ];
 
diff --git a/pkgs/development/libraries/ois/default.nix b/pkgs/development/libraries/ois/default.nix
index 15e83cf9d76..c1b065dbf2b 100644
--- a/pkgs/development/libraries/ois/default.nix
+++ b/pkgs/development/libraries/ois/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
     })
   ];
 
-  patchFlags = "-p0";
+  patchFlags = [ "-p0" ];
 
   buildInputs = [
     autoconf automake libtool libX11 xorgproto libXi libXaw
diff --git a/pkgs/development/libraries/olm/default.nix b/pkgs/development/libraries/olm/default.nix
index 224c01e2c50..8fbdf28965b 100644
--- a/pkgs/development/libraries/olm/default.nix
+++ b/pkgs/development/libraries/olm/default.nix
@@ -15,9 +15,11 @@ stdenv.mkDerivation rec {
   # requires optimisation but memory operations are compiled with -O0
   hardeningDisable = ["fortify"];
 
-  makeFlags = if stdenv.cc.isClang then [ "CC=cc" ] else null;
+  makeFlags = stdenv.lib.optional stdenv.cc.isClang "CC=cc";
 
-  installFlags = "PREFIX=$(out)";
+  installFlags = [
+    "PREFIX=${placeholder ''out''}"
+  ];
 
   meta = {
     description = "Implements double cryptographic ratchet and Megolm ratchet";
diff --git a/pkgs/development/libraries/oniguruma/default.nix b/pkgs/development/libraries/oniguruma/default.nix
index e9041993657..e4cbfc7f0b4 100644
--- a/pkgs/development/libraries/oniguruma/default.nix
+++ b/pkgs/development/libraries/oniguruma/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   pname = "onig";
-  version = "6.9.3";
+  version = "6.9.4";
 
   src = fetchFromGitHub {
     owner = "kkos";
     repo = "oniguruma";
     rev = "v${version}";
-    sha256 = "0wzmqpjmxpryk83acbyhl9gwgm43ixbwraga2g5li9kx88mv4k0n";
+    sha256 = "11imbhj4p5w8lvrmcczccm1zq014h9j85r51z2ibb8jhf5p3lslh";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/opae/default.nix b/pkgs/development/libraries/opae/default.nix
index 32b13115957..46b03720d16 100644
--- a/pkgs/development/libraries/opae/default.nix
+++ b/pkgs/development/libraries/opae/default.nix
@@ -20,6 +20,11 @@ stdenv.mkDerivation rec {
 
   doCheck = false;
 
+  NIX_CFLAGS_COMPILE = [
+    "-Wno-error=format-truncation"
+    "-Wno-error=address-of-packed-member"
+  ];
+
   nativeBuildInputs = [ cmake doxygen perl python2Packages.sphinx ];
   buildInputs = [ libuuid json_c python2 ];
 
diff --git a/pkgs/development/libraries/opal/default.nix b/pkgs/development/libraries/opal/default.nix
deleted file mode 100644
index dd19fccd822..00000000000
--- a/pkgs/development/libraries/opal/default.nix
+++ /dev/null
@@ -1,43 +0,0 @@
-{ stdenv, fetchurl, pkgconfig, ptlib, srtp, libtheora, speex, gnome3
-, ffmpeg, x264, cyrus_sasl, openldap, openssl, expat, unixODBC }:
-
-stdenv.mkDerivation rec {
-  pname = "opal";
-  version = "3.10.10";
-
-  src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "f208985003461b2743575eccac13ad890b3e5baac35b68ddef17162460aff864";
-  };
-
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ ptlib srtp libtheora speex
-                  ffmpeg x264 cyrus_sasl openldap openssl expat unixODBC ];
-  propagatedBuildInputs = [ speex ];
-
-  configureFlags = [ "--enable-h323" ];
-
-  enableParallelBuilding = true;
-
-  NIX_CFLAGS_COMPILE = "-D__STDC_CONSTANT_MACROS=1 -std=gnu++98";
-
-  patches = [ ./disable-samples-ftbfs.diff ./libav9.patch ./libav10.patch ];
-
-  meta = with stdenv.lib; {
-    description = "VoIP library";
-    maintainers = [ maintainers.raskin ];
-    platforms = platforms.linux;
-    homepage = "http://www.opalvoip.org/";
-    license = with licenses; [ bsdOriginal mpl10 gpl2Plus lgpl21 ];
-  };
-
-  passthru = {
-    updateInfo = {
-      downloadPage = "http://ftp.gnome.org/pub/GNOME/sources/opal";
-    };
-    updateScript = gnome3.updateScript {
-      packageName = pname;
-    };
-  };
-}
-
diff --git a/pkgs/development/libraries/opal/disable-samples-ftbfs.diff b/pkgs/development/libraries/opal/disable-samples-ftbfs.diff
deleted file mode 100644
index 1b073821607..00000000000
--- a/pkgs/development/libraries/opal/disable-samples-ftbfs.diff
+++ /dev/null
@@ -1,14 +0,0 @@
-Index: opal-3.10.4~dfsg/Makefile.in
-===================================================================
---- opal-3.10.4~dfsg.orig/Makefile.in	2012-02-22 10:08:36.000000000 +1100
-+++ opal-3.10.4~dfsg/Makefile.in	2012-03-08 08:32:44.000000000 +1100
-@@ -45,8 +45,7 @@
-            samples/codectest \
-            samples/callgen \
-            samples/opalecho \
--           samples/faxopal \
--           samples/c_api
-+           samples/faxopal 
- ifeq ($(OPAL_IVR),yes)
- SUBDIRS += samples/opalmcu \
-            samples/ivropal \
diff --git a/pkgs/development/libraries/opal/libav10.patch b/pkgs/development/libraries/opal/libav10.patch
deleted file mode 100644
index 3e02704f899..00000000000
--- a/pkgs/development/libraries/opal/libav10.patch
+++ /dev/null
@@ -1,208 +0,0 @@
-Description: Fix compilation against libav10 
-Author: Reinhard Tartler <siretart@tauware.de>
-Bug-Debian: http://bugs.debian.org/739439
-
---- a/plugins/video/H.263-1998/h263-1998.cxx
-+++ b/plugins/video/H.263-1998/h263-1998.cxx
-@@ -94,7 +94,7 @@ static struct StdSizes {
-   { CIF16_WIDTH, CIF16_HEIGHT, PLUGINCODEC_CIF16_MPI },
- };
- 
--static FFMPEGLibrary FFMPEGLibraryInstance(CODEC_ID_H263P);
-+static FFMPEGLibrary FFMPEGLibraryInstance(AV_CODEC_ID_H263P);
- 
- 
- /////////////////////////////////////////////////////////////////////////////
-@@ -203,7 +203,7 @@ H263_Base_EncoderContext::~H263_Base_Enc
-   PTRACE(4, m_prefix, "Encoder closed");
- }
- 
--bool H263_Base_EncoderContext::Init(CodecID codecId)
-+bool H263_Base_EncoderContext::Init(AVCodecID codecId)
- {
-   PTRACE(5, m_prefix, "Opening encoder");
- 
-@@ -589,7 +589,7 @@ void H263_RFC2190_EncoderContext::RTPCal
- 
- bool H263_RFC2190_EncoderContext::Init()
- {
--  if (!H263_Base_EncoderContext::Init(CODEC_ID_H263))
-+  if (!H263_Base_EncoderContext::Init(AV_CODEC_ID_H263))
-     return false;
- 
- #if LIBAVCODEC_RTP_MODE
-@@ -632,7 +632,7 @@ H263_RFC2429_EncoderContext::~H263_RFC24
- 
- bool H263_RFC2429_EncoderContext::Init()
- {
--  return H263_Base_EncoderContext::Init(CODEC_ID_H263P);
-+  return H263_Base_EncoderContext::Init(AV_CODEC_ID_H263P);
- }
- 
- 
-@@ -656,7 +656,7 @@ H263_Base_DecoderContext::H263_Base_Deco
-   if (!FFMPEGLibraryInstance.Load())
-     return;
- 
--  if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(CODEC_ID_H263)) == NULL) {
-+  if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(AV_CODEC_ID_H263)) == NULL) {
-     PTRACE(1, m_prefix, "Codec not found for decoder");
-     return;
-   }
---- a/plugins/video/H.264/h264-x264.cxx
-+++ b/plugins/video/H.264/h264-x264.cxx
-@@ -105,7 +105,7 @@ static struct PluginCodec_information Li
- 
- ///////////////////////////////////////////////////////////////////////////////
- 
--FFMPEGLibrary FFMPEGLibraryInstance(CODEC_ID_H264);
-+FFMPEGLibrary FFMPEGLibraryInstance(AV_CODEC_ID_H264);
- 
- PLUGINCODEC_CONTROL_LOG_FUNCTION_DEF
- 
-@@ -1065,17 +1065,17 @@ class MyDecoder : public PluginCodec<MY_
-          allows you to fail the create operation (return false), which cannot
-          be done in the normal C++ constructor. */
- 
--      if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(CODEC_ID_H264)) == NULL)
-+      if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(AV_CODEC_ID_H264)) == NULL)
-         return false;
- 
-       if ((m_context = FFMPEGLibraryInstance.AvcodecAllocContext(m_codec)) == NULL)
-         return false;
- 
-       m_context->workaround_bugs = FF_BUG_AUTODETECT;
--      m_context->idct_algo = FF_IDCT_H264;
-+      m_context->idct_algo = FF_IDCT_AUTO;
-       m_context->error_concealment = FF_EC_GUESS_MVS | FF_EC_DEBLOCK;
-       m_context->flags = CODEC_FLAG_INPUT_PRESERVED | CODEC_FLAG_EMU_EDGE;
--      m_context->flags2 = CODEC_FLAG2_SKIP_RD |
-+      m_context->flags2 = 
- #ifdef CODEC_FLAG2_DROP_FRAME_TIMECODE
-                           CODEC_FLAG2_DROP_FRAME_TIMECODE |
- #endif
---- a/plugins/video/MPEG4-ffmpeg/mpeg4.cxx
-+++ b/plugins/video/MPEG4-ffmpeg/mpeg4.cxx
-@@ -205,7 +205,7 @@ const static struct mpeg4_resolution {
-     { 0 }
- };
- 
--FFMPEGLibrary FFMPEGLibraryInstance(CODEC_ID_MPEG4);
-+FFMPEGLibrary FFMPEGLibraryInstance(AV_CODEC_ID_MPEG4);
- 
- 
- static bool mpeg4IsIframe (BYTE * frameBuffer, unsigned int frameLen )
-@@ -688,7 +688,7 @@ void MPEG4EncoderContext::ResizeEncoding
- 
- bool MPEG4EncoderContext::OpenCodec()
- {
--  if((m_avcodec = FFMPEGLibraryInstance.AvcodecFindEncoder(CODEC_ID_MPEG4)) == NULL){
-+  if((m_avcodec = FFMPEGLibraryInstance.AvcodecFindEncoder(AV_CODEC_ID_MPEG4)) == NULL){
-     PTRACE(1, "MPEG4", "Encoder not found");
-     return false;
-   }
-@@ -1390,7 +1390,7 @@ void MPEG4DecoderContext::ResizeDecoding
- 
- bool MPEG4DecoderContext::OpenCodec()
- {
--    if ((m_avcodec = FFMPEGLibraryInstance.AvcodecFindDecoder(CODEC_ID_MPEG4)) == NULL) {
-+    if ((m_avcodec = FFMPEGLibraryInstance.AvcodecFindDecoder(AV_CODEC_ID_MPEG4)) == NULL) {
-         PTRACE(1, "MPEG4", "Decoder not found for encoder");
-         return false;
-     }
---- a/plugins/video/H.263-1998/h263-1998.h
-+++ b/plugins/video/H.263-1998/h263-1998.h
-@@ -115,7 +115,7 @@ class H263_Base_EncoderContext
-     virtual ~H263_Base_EncoderContext();
- 
-     virtual bool Init() = 0;
--    virtual bool Init(CodecID codecId);
-+    virtual bool Init(AVCodecID codecId);
- 
-     virtual bool SetOptions(const char * const * options);
-     virtual void SetOption(const char * option, const char * value);
---- a/plugins/video/common/dyna.cxx
-+++ b/plugins/video/common/dyna.cxx
-@@ -217,14 +217,14 @@ static void logCallbackFFMPEG(void * avc
- #endif
- 
- 
--FFMPEGLibrary::FFMPEGLibrary(CodecID codec)
-+FFMPEGLibrary::FFMPEGLibrary(AVCodecID codec)
- {
-   m_codec = codec;
--  if (m_codec==CODEC_ID_H264)
-+  if (m_codec==AV_CODEC_ID_H264)
-       snprintf( m_codecString, sizeof(m_codecString), "H264");
--  if (m_codec==CODEC_ID_H263P)
-+  if (m_codec==AV_CODEC_ID_H263P)
-       snprintf( m_codecString, sizeof(m_codecString), "H263+");
--  if (m_codec==CODEC_ID_MPEG4)
-+  if (m_codec==AV_CODEC_ID_MPEG4)
-       snprintf( m_codecString, sizeof(m_codecString), "MPEG4");
-   m_isLoadedOK = false;
- }
-@@ -268,12 +268,12 @@ bool FFMPEGLibrary::Load()
-   return true;
- }
- 
--AVCodec *FFMPEGLibrary::AvcodecFindEncoder(enum CodecID id)
-+AVCodec *FFMPEGLibrary::AvcodecFindEncoder(enum AVCodecID id)
- {
-   return avcodec_find_encoder(id);
- }
- 
--AVCodec *FFMPEGLibrary::AvcodecFindDecoder(enum CodecID id)
-+AVCodec *FFMPEGLibrary::AvcodecFindDecoder(enum AVCodecID id)
- {
-   WaitAndSignal m(processLock);
- 
-@@ -308,13 +308,18 @@ int FFMPEGLibrary::AvcodecClose(AVCodecC
-   return avcodec_close(ctx);
- }
- 
-+#undef  FFMAX
-+#define FFMAX(a,b) ((a) > (b) ? (a) : (b)) 
- int FFMPEGLibrary::AvcodecEncodeVideo(AVCodecContext *ctx, BYTE *buf, int buf_size, const AVFrame *pict)
- {
-+  AVPacket pkt = { 0 };
-+  int ret, got_output;
-   int res;
- 
--  res = avcodec_encode_video(ctx, buf, buf_size, pict);
-+  ret = avcodec_encode_video2(ctx, &pkt, pict, &got_output);
- 
--  PTRACE(6, m_codecString, "DYNA\tEncoded into " << res << " bytes, max " << buf_size);
-+  PTRACE(6, m_codecString, "DYNA\tEncoded into " << ret << " bytes, max " << buf_size);
-+  memcpy(buf, pkt.data, FFMAX(pkt.size, buf_size));
-   return res;
- }
- 
---- a/plugins/video/common/dyna.h
-+++ b/plugins/video/common/dyna.h
-@@ -88,13 +88,13 @@ class DynaLink
- class FFMPEGLibrary 
- {
-   public:
--    FFMPEGLibrary(CodecID codec);
-+    FFMPEGLibrary(AVCodecID codec);
-     ~FFMPEGLibrary();
- 
-     bool Load();
- 
--    AVCodec *AvcodecFindEncoder(enum CodecID id);
--    AVCodec *AvcodecFindDecoder(enum CodecID id);
-+    AVCodec *AvcodecFindEncoder(enum AVCodecID id);
-+    AVCodec *AvcodecFindDecoder(enum AVCodecID id);
-     AVCodecContext *AvcodecAllocContext(AVCodec*);
-     AVFrame *AvcodecAllocFrame(void);
-     int AvcodecOpen(AVCodecContext *ctx, AVCodec *codec);
-@@ -117,7 +117,7 @@ class FFMPEGLibrary
-     DynaLink m_libAvcodec;
-     DynaLink m_libAvutil;
- 
--    CodecID m_codec;
-+    AVCodecID m_codec;
-     char m_codecString[32];
- 
-     bool m_isLoadedOK;
diff --git a/pkgs/development/libraries/opal/libav9.patch b/pkgs/development/libraries/opal/libav9.patch
deleted file mode 100644
index f91a8c033fe..00000000000
--- a/pkgs/development/libraries/opal/libav9.patch
+++ /dev/null
@@ -1,543 +0,0 @@
-Description: Backport changes for the libav 9 API
- Also replace loading of libavcodec and libavutil via dlopen by linking against
- it.
-Author: Sebastian Ramacher <sramacher@debian.org>
-Bug-Debian: http://bugs.debian.org/720824
-Last-Update: 2013-09-12
-
---- a/plugins/video/H.263-1998/h263-1998.cxx
-+++ b/plugins/video/H.263-1998/h263-1998.cxx
-@@ -216,7 +216,7 @@
-     return false;
-   }
- 
--  m_context = FFMPEGLibraryInstance.AvcodecAllocContext();
-+  m_context = FFMPEGLibraryInstance.AvcodecAllocContext(m_codec);
-   if (m_context == NULL) {
-     PTRACE(1, m_prefix, "Failed to allocate context for encoder");
-     return false;
-@@ -312,6 +312,7 @@
-     return;
-   }
- 
-+#ifdef CODEC_FLAG_H263P_UMV
-   if (STRCMPI(option, H263_ANNEX_D) == 0) {
-     // Annex D: Unrestructed Motion Vectors
-     // Level 2+ 
-@@ -322,6 +323,7 @@
-       m_context->flags &= ~CODEC_FLAG_H263P_UMV; 
-     return;
-   }
-+#endif
- 
- #if 0 // DO NOT ENABLE THIS FLAG. FFMPEG IS NOT THREAD_SAFE WHEN THIS FLAG IS SET
-   if (STRCMPI(option, H263_ANNEX_F) == 0) {
-@@ -356,6 +358,7 @@
-     return;
-   }
- 
-+#ifdef CODEC_FLAG_H263P_SLICE_STRUCT
-   if (STRCMPI(option, H263_ANNEX_K) == 0) {
-     // Annex K: Slice Structure
-     // does not work with eyeBeam
-@@ -365,7 +368,9 @@
-       m_context->flags &= ~CODEC_FLAG_H263P_SLICE_STRUCT; 
-     return;
-   }
-+#endif
- 
-+#ifdef CODEC_FLAG_H263P_AIV
-   if (STRCMPI(option, H263_ANNEX_S) == 0) {
-     // Annex S: Alternative INTER VLC mode
-     // does not work with eyeBeam
-@@ -375,6 +380,7 @@
-       m_context->flags &= ~CODEC_FLAG_H263P_AIV; 
-     return;
-   }
-+#endif
- 
-   if (STRCMPI(option, PLUGINCODEC_MEDIA_PACKETIZATION) == 0 ||
-       STRCMPI(option, PLUGINCODEC_MEDIA_PACKETIZATIONS) == 0) {
-@@ -450,15 +456,6 @@
-   PTRACE(5, m_prefix, "qmax set to " << m_context->qmax);
-   PTRACE(5, m_prefix, "payload size set to " << m_context->rtp_payload_size);
- 
--  #define CODEC_TRACER_FLAG(tracer, flag) \
--    PTRACE(4, m_prefix, #flag " is " << ((m_context->flags & flag) ? "enabled" : "disabled"));
--  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_H263P_UMV);
--  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_OBMC);
--  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_AC_PRED);
--  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_H263P_SLICE_STRUCT)
--  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_LOOP_FILTER);
--  CODEC_TRACER_FLAG(tracer, CODEC_FLAG_H263P_AIV);
--
-   return FFMPEGLibraryInstance.AvcodecOpen(m_context, m_codec) == 0;
- }
- 
-@@ -521,7 +518,7 @@
- 
-     // Need to copy to local buffer to guarantee 16 byte alignment
-     memcpy(m_inputFrame->data[0], OPAL_VIDEO_FRAME_DATA_PTR(header), header->width*header->height*3/2);
--    m_inputFrame->pict_type = (flags & PluginCodec_CoderForceIFrame) ? FF_I_TYPE : AV_PICTURE_TYPE_NONE;
-+    m_inputFrame->pict_type = (flags & PluginCodec_CoderForceIFrame) ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_NONE;
- 
-     /*
-     m_inputFrame->pts = (int64_t)srcRTP.GetTimestamp()*m_context->time_base.den/m_context->time_base.num/VIDEO_CLOCKRATE;
-@@ -603,13 +600,19 @@
-   m_context->rtp_callback = &H263_RFC2190_EncoderContext::RTPCallBack;
-   m_context->opaque = this; // used to separate out packets from different encode threads
- 
-+#ifdef CODEC_FLAG_H263P_UMV
-   m_context->flags &= ~CODEC_FLAG_H263P_UMV;
-+#endif
-   m_context->flags &= ~CODEC_FLAG_4MV;
- #if LIBAVCODEC_RTP_MODE
-   m_context->flags &= ~CODEC_FLAG_H263P_AIC;
- #endif
-+#ifdef CODEC_FLAG_H263P_AIV
-   m_context->flags &= ~CODEC_FLAG_H263P_AIV;
-+#endif
-+#ifdef CODEC_FLAG_H263P_SLICE_STRUCT
-   m_context->flags &= ~CODEC_FLAG_H263P_SLICE_STRUCT;
-+#endif
- 
-   return true;
- }
-@@ -658,7 +661,7 @@
-     return;
-   }
- 
--  m_context = FFMPEGLibraryInstance.AvcodecAllocContext();
-+  m_context = FFMPEGLibraryInstance.AvcodecAllocContext(m_codec);
-   if (m_context == NULL) {
-     PTRACE(1, m_prefix, "Failed to allocate context for decoder");
-     return;
---- a/plugins/video/H.264/h264-x264.cxx
-+++ b/plugins/video/H.264/h264-x264.cxx
-@@ -48,6 +48,7 @@
- #include "shared/h264frame.h"
- #include "shared/x264wrap.h"
- 
-+#include <cstdio>
- 
- #define MY_CODEC      x264                                  // Name of codec (use C variable characters)
- #define MY_CODEC_LOG "x264"
-@@ -1067,18 +1068,17 @@
-       if ((m_codec = FFMPEGLibraryInstance.AvcodecFindDecoder(CODEC_ID_H264)) == NULL)
-         return false;
- 
--      if ((m_context = FFMPEGLibraryInstance.AvcodecAllocContext()) == NULL)
-+      if ((m_context = FFMPEGLibraryInstance.AvcodecAllocContext(m_codec)) == NULL)
-         return false;
- 
-       m_context->workaround_bugs = FF_BUG_AUTODETECT;
--      m_context->error_recognition = FF_ER_AGGRESSIVE;
-       m_context->idct_algo = FF_IDCT_H264;
-       m_context->error_concealment = FF_EC_GUESS_MVS | FF_EC_DEBLOCK;
-       m_context->flags = CODEC_FLAG_INPUT_PRESERVED | CODEC_FLAG_EMU_EDGE;
--      m_context->flags2 = CODEC_FLAG2_BRDO |
--                          CODEC_FLAG2_MEMC_ONLY |
-+      m_context->flags2 = CODEC_FLAG2_SKIP_RD |
-+#ifdef CODEC_FLAG2_DROP_FRAME_TIMECODE
-                           CODEC_FLAG2_DROP_FRAME_TIMECODE |
--                          CODEC_FLAG2_SKIP_RD |
-+#endif
-                           CODEC_FLAG2_CHUNKS;
- 
-       if ((m_picture = FFMPEGLibraryInstance.AvcodecAllocFrame()) == NULL)
---- a/plugins/video/MPEG4-ffmpeg/mpeg4.cxx
-+++ b/plugins/video/MPEG4-ffmpeg/mpeg4.cxx
-@@ -589,17 +589,14 @@
-     m_avpicture->quality = m_videoQMin;
- 
- #ifdef USE_ORIG
--    m_avcontext->flags |= CODEC_FLAG_PART;   // data partitioning
-     m_avcontext->flags |= CODEC_FLAG_4MV;    // 4 motion vectors
- #else
-     m_avcontext->max_b_frames=0; /*don't use b frames*/
-     m_avcontext->flags|=CODEC_FLAG_AC_PRED;
--    m_avcontext->flags|=CODEC_FLAG_H263P_UMV;
-     /*c->flags|=CODEC_FLAG_QPEL;*/ /*don't enable this one: this forces profile_level to advanced simple profile */
-     m_avcontext->flags|=CODEC_FLAG_4MV;
-     m_avcontext->flags|=CODEC_FLAG_GMC;
-     m_avcontext->flags|=CODEC_FLAG_LOOP_FILTER;
--    m_avcontext->flags|=CODEC_FLAG_H263P_SLICE_STRUCT;
- #endif
-     m_avcontext->opaque = this;              // for use in RTP callback
- }
-@@ -691,7 +688,12 @@
- 
- bool MPEG4EncoderContext::OpenCodec()
- {
--  m_avcontext = FFMPEGLibraryInstance.AvcodecAllocContext();
-+  if((m_avcodec = FFMPEGLibraryInstance.AvcodecFindEncoder(CODEC_ID_MPEG4)) == NULL){
-+    PTRACE(1, "MPEG4", "Encoder not found");
-+    return false;
-+  }
-+
-+  m_avcontext = FFMPEGLibraryInstance.AvcodecAllocContext(m_avcodec);
-   if (m_avcontext == NULL) {
-     PTRACE(1, "MPEG4", "Encoder failed to allocate context for encoder");
-     return false;
-@@ -703,11 +705,6 @@
-     return false;
-   }
- 
--  if((m_avcodec = FFMPEGLibraryInstance.AvcodecFindEncoder(CODEC_ID_MPEG4)) == NULL){
--    PTRACE(1, "MPEG4", "Encoder not found");
--    return false;
--  }
--
- #if PLUGINCODEC_TRACING
-   // debugging flags
-   if (PTRACE_CHECK(4)) {
-@@ -804,7 +801,7 @@
-         // Should the next frame be an I-Frame?
-         if ((flags & PluginCodec_CoderForceIFrame) || (m_frameNum == 0))
-         {
--            m_avpicture->pict_type = FF_I_TYPE;
-+            m_avpicture->pict_type = AV_PICTURE_TYPE_I;
-         }
-         else // No IFrame requested, let avcodec decide what to do
-         {
-@@ -1325,7 +1322,6 @@
- 
- void MPEG4DecoderContext::SetStaticDecodingParams() {
-     m_avcontext->flags |= CODEC_FLAG_4MV; 
--    m_avcontext->flags |= CODEC_FLAG_PART;
-     m_avcontext->workaround_bugs = 0; // no workaround for buggy implementations
- }
- 
-@@ -1399,7 +1395,7 @@
-         return false;
-     }
-         
--    m_avcontext = FFMPEGLibraryInstance.AvcodecAllocContext();
-+    m_avcontext = FFMPEGLibraryInstance.AvcodecAllocContext(m_avcodec);
-     if (m_avcontext == NULL) {
-         PTRACE(1, "MPEG4", "Decoder failed to allocate context");
-         return false;
---- a/plugins/video/common/dyna.cxx
-+++ b/plugins/video/common/dyna.cxx
-@@ -38,6 +38,13 @@
-  *                 Matthias Schneider (ma30002000@yahoo.de)
-  */
- #include "dyna.h"
-+#include <cstdio>
-+#include <cstdarg>
-+
-+extern "C" {
-+#include <libavcodec/avcodec.h>
-+#include <libavutil/mem.h>
-+}
- 
- bool DynaLink::Open(const char *name)
- {
-@@ -228,101 +235,15 @@
-   m_libAvutil.Close();
- }
- 
--#define CHECK_AVUTIL(name, func) \
--      (seperateLibAvutil ? \
--        m_libAvutil.GetFunction(name,  (DynaLink::Function &)func) : \
--        m_libAvcodec.GetFunction(name, (DynaLink::Function &)func) \
--       ) \
--
--
- bool FFMPEGLibrary::Load()
- {
-   WaitAndSignal m(processLock);
-   if (IsLoaded())
-     return true;
- 
--  bool seperateLibAvutil = false;
--
--#ifdef LIBAVCODEC_LIB_NAME
--  if (m_libAvcodec.Open(LIBAVCODEC_LIB_NAME))
--    seperateLibAvutil = true;
--  else
--#endif
--  if (m_libAvcodec.Open("libavcodec"))
--    seperateLibAvutil = false;
--  else if (m_libAvcodec.Open("avcodec-" AV_STRINGIFY(LIBAVCODEC_VERSION_MAJOR)))
--    seperateLibAvutil = true;
--  else {
--    PTRACE(1, m_codecString, "Failed to load FFMPEG libavcodec library");
--    return false;
--  }
--
--  if (seperateLibAvutil &&
--        !(
--#ifdef LIBAVUTIL_LIB_NAME
--          m_libAvutil.Open(LIBAVUTIL_LIB_NAME) ||
--#endif
--          m_libAvutil.Open("libavutil") ||
--          m_libAvutil.Open("avutil-" AV_STRINGIFY(LIBAVUTIL_VERSION_MAJOR))
--        ) ) {
--    PTRACE(1, m_codecString, "Failed to load FFMPEG libavutil library");
--    return false;
--  }
--
--  strcpy(m_libAvcodec.m_codecString, m_codecString);
--  strcpy(m_libAvutil.m_codecString,  m_codecString);
--
--  if (!m_libAvcodec.GetFunction("avcodec_init", (DynaLink::Function &)Favcodec_init))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("av_init_packet", (DynaLink::Function &)Fav_init_packet))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_register_all", (DynaLink::Function &)Favcodec_register_all))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_find_encoder", (DynaLink::Function &)Favcodec_find_encoder))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_find_decoder", (DynaLink::Function &)Favcodec_find_decoder))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_alloc_context", (DynaLink::Function &)Favcodec_alloc_context))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_alloc_frame", (DynaLink::Function &)Favcodec_alloc_frame))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_open", (DynaLink::Function &)Favcodec_open))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_close", (DynaLink::Function &)Favcodec_close))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_encode_video", (DynaLink::Function &)Favcodec_encode_video))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_decode_video2", (DynaLink::Function &)Favcodec_decode_video))
--    return false;
--
--  if (!m_libAvcodec.GetFunction("avcodec_set_dimensions", (DynaLink::Function &)Favcodec_set_dimensions))
--    return false;
--
--  if (!CHECK_AVUTIL("av_free", Favcodec_free))
--    return false;
--
--  if(!m_libAvcodec.GetFunction("avcodec_version", (DynaLink::Function &)Favcodec_version))
--    return false;
--
--  if (!CHECK_AVUTIL("av_log_set_level", FAv_log_set_level))
--    return false;
--
--  if (!CHECK_AVUTIL("av_log_set_callback", FAv_log_set_callback))
--    return false;
--
-   // must be called before using avcodec lib
- 
--  unsigned libVer = Favcodec_version();
-+  unsigned libVer = avcodec_version();
-   if (libVer != LIBAVCODEC_VERSION_INT) {
-     PTRACE(2, m_codecString, "Warning: compiled against libavcodec headers from version "
-            << LIBAVCODEC_VERSION_MAJOR << '.' << LIBAVCODEC_VERSION_MINOR << '.' << LIBAVCODEC_VERSION_MICRO
-@@ -334,8 +255,7 @@
-            << (libVer >> 16) << ((libVer>>8) & 0xff) << (libVer & 0xff));
-   }
- 
--  Favcodec_init();
--  Favcodec_register_all ();
-+  avcodec_register_all();
- 
- #if PLUGINCODEC_TRACING
-   AvLogSetLevel(AV_LOG_DEBUG);
-@@ -350,49 +270,49 @@
- 
- AVCodec *FFMPEGLibrary::AvcodecFindEncoder(enum CodecID id)
- {
--  return Favcodec_find_encoder(id);
-+  return avcodec_find_encoder(id);
- }
- 
- AVCodec *FFMPEGLibrary::AvcodecFindDecoder(enum CodecID id)
- {
-   WaitAndSignal m(processLock);
- 
--  return Favcodec_find_decoder(id);
-+  return avcodec_find_decoder(id);
- }
- 
--AVCodecContext *FFMPEGLibrary::AvcodecAllocContext(void)
-+AVCodecContext *FFMPEGLibrary::AvcodecAllocContext(AVCodec *codec)
- {
-   WaitAndSignal m(processLock);
- 
--  return Favcodec_alloc_context();
-+  return avcodec_alloc_context3(codec);
- }
- 
- AVFrame *FFMPEGLibrary::AvcodecAllocFrame(void)
- {
-   WaitAndSignal m(processLock);
- 
--  return Favcodec_alloc_frame();
-+  return avcodec_alloc_frame();
- }
- 
- int FFMPEGLibrary::AvcodecOpen(AVCodecContext *ctx, AVCodec *codec)
- {
-   WaitAndSignal m(processLock);
- 
--  return Favcodec_open(ctx, codec);
-+  return avcodec_open2(ctx, codec, NULL);
- }
- 
- int FFMPEGLibrary::AvcodecClose(AVCodecContext *ctx)
- {
-   WaitAndSignal m(processLock);
- 
--  return Favcodec_close(ctx);
-+  return avcodec_close(ctx);
- }
- 
- int FFMPEGLibrary::AvcodecEncodeVideo(AVCodecContext *ctx, BYTE *buf, int buf_size, const AVFrame *pict)
- {
-   int res;
- 
--  res = Favcodec_encode_video(ctx, buf, buf_size, pict);
-+  res = avcodec_encode_video(ctx, buf, buf_size, pict);
- 
-   PTRACE(6, m_codecString, "DYNA\tEncoded into " << res << " bytes, max " << buf_size);
-   return res;
-@@ -401,35 +321,35 @@
- int FFMPEGLibrary::AvcodecDecodeVideo(AVCodecContext *ctx, AVFrame *pict, int *got_picture_ptr, BYTE *buf, int buf_size)
- {
-   AVPacket avpkt;
--  Fav_init_packet(&avpkt);
-+  av_init_packet(&avpkt);
-   avpkt.data = buf;
-   avpkt.size = buf_size;
- 
--  return Favcodec_decode_video(ctx, pict, got_picture_ptr, &avpkt);
-+  return avcodec_decode_video2(ctx, pict, got_picture_ptr, &avpkt);
- }
- 
- void FFMPEGLibrary::AvcodecFree(void * ptr)
- {
-   WaitAndSignal m(processLock);
- 
--  Favcodec_free(ptr);
-+  av_free(ptr);
- }
- 
- void FFMPEGLibrary::AvSetDimensions(AVCodecContext *s, int width, int height)
- {
-   WaitAndSignal m(processLock);
- 
--  Favcodec_set_dimensions(s, width, height);
-+  avcodec_set_dimensions(s, width, height);
- }
- 
- void FFMPEGLibrary::AvLogSetLevel(int level)
- {
--  FAv_log_set_level(level);
-+  av_log_set_level(level);
- }
- 
- void FFMPEGLibrary::AvLogSetCallback(void (*callback)(void*, int, const char*, va_list))
- {
--  FAv_log_set_callback(callback);
-+  av_log_set_callback(callback);
- }
- 
- bool FFMPEGLibrary::IsLoaded()
---- a/plugins/video/common/dyna.h
-+++ b/plugins/video/common/dyna.h
-@@ -95,7 +95,7 @@
- 
-     AVCodec *AvcodecFindEncoder(enum CodecID id);
-     AVCodec *AvcodecFindDecoder(enum CodecID id);
--    AVCodecContext *AvcodecAllocContext(void);
-+    AVCodecContext *AvcodecAllocContext(AVCodec*);
-     AVFrame *AvcodecAllocFrame(void);
-     int AvcodecOpen(AVCodecContext *ctx, AVCodec *codec);
-     int AvcodecClose(AVCodecContext *ctx);
-@@ -120,26 +120,6 @@
-     CodecID m_codec;
-     char m_codecString[32];
- 
--    void (*Favcodec_init)(void);
--    void (*Fav_init_packet)(AVPacket *pkt);
--
--    void (*Favcodec_register_all)(void);
--    AVCodec *(*Favcodec_find_encoder)(enum CodecID id);
--    AVCodec *(*Favcodec_find_decoder)(enum CodecID id);
--    AVCodecContext *(*Favcodec_alloc_context)(void);
--    AVFrame *(*Favcodec_alloc_frame)(void);
--    int (*Favcodec_open)(AVCodecContext *ctx, AVCodec *codec);
--    int (*Favcodec_close)(AVCodecContext *ctx);
--    int (*Favcodec_encode_video)(AVCodecContext *ctx, BYTE *buf, int buf_size, const AVFrame *pict);
--    int (*Favcodec_decode_video)(AVCodecContext *ctx, AVFrame *pict, int *got_picture_ptr, AVPacket *avpkt);
--    unsigned (*Favcodec_version)(void);
--    void (*Favcodec_set_dimensions)(AVCodecContext *ctx, int width, int height);
--
--    void (*Favcodec_free)(void *);
--
--    void (*FAv_log_set_level)(int level);
--    void (*FAv_log_set_callback)(void (*callback)(void*, int, const char*, va_list));
--
-     bool m_isLoadedOK;
- };
- 
---- a/plugins/video/common/ffmpeg.h
-+++ b/plugins/video/common/ffmpeg.h
-@@ -45,11 +45,13 @@
- 
- #include "platform.h"
- 
--#include "libavcodec/avcodec.h"
-+extern "C" {
-+#include <libavcodec/avcodec.h>
- // AVPacket was declared in avformat.h before April 2009
- #if LIBAVCODEC_VERSION_INT <= AV_VERSION_INT(52, 25, 0)
--#include "libavformat/avformat.h"
-+#include <libavformat/avformat.h>
- #endif
-+}
- 
- #ifndef LIBAVCODEC_VERSION_INT
- #error Libavcodec include is not correct
---- a/plugins/video/H.263-1998/Makefile.in
-+++ b/plugins/video/H.263-1998/Makefile.in
-@@ -34,8 +34,8 @@
-              $(COMMONDIR)/mpi.cxx \
-              $(COMMONDIR)/dyna.cxx
- 
--CFLAGS += @LIBAVCODEC_CFLAGS@ -I$(COMMONDIR)
--LIBS   += @DL_LIBS@
-+CFLAGS += @LIBAVCODEC_CFLAGS@ @LIBAVUTIL_CFLAGS@ -I$(COMMONDIR)
-+LIBS   += @DL_LIBS@ @LIBAVCODEC_LIBS@ @LIBAVUTIL_LIBS@
- 
- HAVE_LIBAVCODEC_RTP_MODE=@HAVE_LIBAVCODEC_RTP_MODE@
- ifeq ($(HAVE_LIBAVCODEC_RTP_MODE),yes)
---- a/plugins/video/H.264/Makefile.in
-+++ b/plugins/video/H.264/Makefile.in
-@@ -34,8 +34,8 @@
-            $(SHAREDDIR)/x264wrap.cxx \
-            $(COMMONDIR)/dyna.cxx \
- 
--CFLAGS += @LIBAVCODEC_CFLAGS@ -I$(COMMONDIR) -DLIB_DIR='"$(libdir)"' -DVC_PLUGIN_DIR='"@VC_PLUGIN_DIR@"'
--LIBS   += @DL_LIBS@
-+CFLAGS += @LIBAVCODEC_CFLAGS@ @LIBAVUTIL_CFLAGS@ -I$(COMMONDIR) -DLIB_DIR='"$(libdir)"' -DVC_PLUGIN_DIR='"@VC_PLUGIN_DIR@"'
-+LIBS   += @DL_LIBS@ @LIBAVCODEC_LIBS@ @LIBAVUTIL_LIBS@
- 
- IS_H264_LICENSED:=@IS_H264_LICENSED@
- ifeq ($(IS_H264_LICENSED),yes)
---- a/plugins/video/MPEG4-ffmpeg/Makefile.in
-+++ b/plugins/video/MPEG4-ffmpeg/Makefile.in
-@@ -30,8 +30,8 @@
- SRCDIR    := .
- SRCS      := mpeg4.cxx $(COMMONDIR)/dyna.cxx
- 
--CFLAGS += @LIBAVCODEC_CFLAGS@ -I$(COMMONDIR)
--LIBS   += @DL_LIBS@
-+CFLAGS += @LIBAVCODEC_CFLAGS@ @LIBAVUTIL_CFLAGS@ -I$(COMMONDIR)
-+LIBS   += @DL_LIBS@ @LIBAVCODEC_LIBS@ @LIBAVUTIL_LIBS@
- 
- # Add LIBAVCODEC_SOURCE_DIR to the include path so we can #include <libavcodec/...h>
- # Also add libavutil, so ffmpeg headers can #include "log.h".
diff --git a/pkgs/development/libraries/openal-soft/default.nix b/pkgs/development/libraries/openal-soft/default.nix
index 76f2861428d..20528ac9284 100644
--- a/pkgs/development/libraries/openal-soft/default.nix
+++ b/pkgs/development/libraries/openal-soft/default.nix
@@ -35,9 +35,9 @@ stdenv.mkDerivation rec {
     ++ optional pulseSupport libpulseaudio
     ++ optionals stdenv.isDarwin [ CoreServices AudioUnit AudioToolbox ];
 
-  NIX_LDFLAGS = []
+  NIX_LDFLAGS = toString ([]
     ++ optional alsaSupport "-lasound"
-    ++ optional pulseSupport "-lpulse";
+    ++ optional pulseSupport "-lpulse");
 
   meta = {
     description = "OpenAL alternative";
diff --git a/pkgs/development/libraries/opencv/3.x.nix b/pkgs/development/libraries/opencv/3.x.nix
index 97df84637ef..642facf166a 100644
--- a/pkgs/development/libraries/opencv/3.x.nix
+++ b/pkgs/development/libraries/opencv/3.x.nix
@@ -208,7 +208,7 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ cmake pkgconfig unzip ];
 
-  NIX_CFLAGS_COMPILE = lib.optional enableEXR "-I${ilmbase.dev}/include/OpenEXR";
+  NIX_CFLAGS_COMPILE = lib.optionalString enableEXR "-I${ilmbase.dev}/include/OpenEXR";
 
   # Configure can't find the library without this.
   OpenBLAS_HOME = lib.optionalString enableOpenblas openblas;
diff --git a/pkgs/development/libraries/opencv/4.x.nix b/pkgs/development/libraries/opencv/4.x.nix
index 408368b89c4..9fffd3d9477 100644
--- a/pkgs/development/libraries/opencv/4.x.nix
+++ b/pkgs/development/libraries/opencv/4.x.nix
@@ -221,7 +221,7 @@ stdenv.mkDerivation {
 
   nativeBuildInputs = [ cmake pkgconfig unzip ];
 
-  NIX_CFLAGS_COMPILE = lib.optional enableEXR "-I${ilmbase.dev}/include/OpenEXR";
+  NIX_CFLAGS_COMPILE = lib.optionalString enableEXR "-I${ilmbase.dev}/include/OpenEXR";
 
   # Configure can't find the library without this.
   OpenBLAS_HOME = lib.optionalString enableOpenblas openblas;
diff --git a/pkgs/development/libraries/opencv/default.nix b/pkgs/development/libraries/opencv/default.nix
index db8a5e5a41b..ad27742d0b4 100644
--- a/pkgs/development/libraries/opencv/default.nix
+++ b/pkgs/development/libraries/opencv/default.nix
@@ -61,7 +61,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ cmake pkgconfig unzip ];
 
-  NIX_CFLAGS_COMPILE = lib.optional enableEXR "-I${ilmbase.dev}/include/OpenEXR";
+  NIX_CFLAGS_COMPILE = lib.optionalString enableEXR "-I${ilmbase.dev}/include/OpenEXR";
 
   cmakeFlags = [
     (opencvFlag "TIFF" enableTIFF)
diff --git a/pkgs/development/libraries/openvdb/default.nix b/pkgs/development/libraries/openvdb/default.nix
index 483b3d788e2..840da046170 100644
--- a/pkgs/development/libraries/openvdb/default.nix
+++ b/pkgs/development/libraries/openvdb/default.nix
@@ -20,21 +20,22 @@ stdenv.mkDerivation rec
     sourceRoot=$(echo */openvdb)
   '';
 
-  installTargets = "install_lib";
+  installTargets = [ "install_lib" ];
 
   enableParallelBuilding = true;
 
-  buildFlags = ''lib
-    DESTDIR=$(out)
-    HALF_LIB=-lHalf
-    TBB_LIB=-ltbb
-    BLOSC_LIB=-lblosc
-    LOG4CPLUS_LIB=
-    BLOSC_INCLUDE_DIR=${c-blosc}/include/
-    BLOSC_LIB_DIR=${c-blosc}/lib/
-  '';
-
-  installFlags = ''DESTDIR=$(out)'';
+  buildFlags = [
+    "lib"
+    "DESTDIR=$(out)"
+    "HALF_LIB=-lHalf"
+    "TBB_LIB=-ltbb"
+    "BLOSC_LIB=-lblosc"
+    "LOG4CPLUS_LIB="
+    "BLOSC_INCLUDE_DIR=${c-blosc}/include/"
+    "BLOSC_LIB_DIR=${c-blosc}/lib/"
+  ];
+
+  installFlags = [ "DESTDIR=$(out)" ];
 
   NIX_CFLAGS_COMPILE="-I${openexr.dev}/include/OpenEXR -I${ilmbase.dev}/include/OpenEXR/";
   NIX_LDFLAGS="-lboost_iostreams";
diff --git a/pkgs/development/libraries/ortp/default.nix b/pkgs/development/libraries/ortp/default.nix
index 7be0e4bb06a..68e890e3368 100644
--- a/pkgs/development/libraries/ortp/default.nix
+++ b/pkgs/development/libraries/ortp/default.nix
@@ -11,6 +11,8 @@ stdenv.mkDerivation rec {
     sha256 = "12cwv593bsdnxs0zfcp07vwyk7ghlz2wv7vdbs1ksv293w3vj2rv";
   };
 
+  NIX_CFLAGS_COMPILE = "-Wno-error=stringop-truncation";
+
   buildInputs = [ bctoolbox ];
   nativeBuildInputs = [ cmake ];
 
diff --git a/pkgs/development/libraries/phonon/backends/gstreamer.nix b/pkgs/development/libraries/phonon/backends/gstreamer.nix
index 20723322c1d..d79078c2836 100644
--- a/pkgs/development/libraries/phonon/backends/gstreamer.nix
+++ b/pkgs/development/libraries/phonon/backends/gstreamer.nix
@@ -37,7 +37,7 @@ stdenv.mkDerivation rec {
             gst-plugins-bad
             gst-libav
           ]);
-    in [
+    in toString [
       # This flag should be picked up through pkgconfig, but it isn't.
       "-I${gst_all_1.gstreamer.dev}/lib/gstreamer-1.0/include"
 
diff --git a/pkgs/development/libraries/physics/qcdnum/default.nix b/pkgs/development/libraries/physics/qcdnum/default.nix
index 8b002ce8195..e962303f5f0 100644
--- a/pkgs/development/libraries/physics/qcdnum/default.nix
+++ b/pkgs/development/libraries/physics/qcdnum/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "QCDNUM";
-  version = "17-01-13";
+  version = "17-01-15";
 
   src = fetchurl {
     url = "http://www.nikhef.nl/user/h24/qcdnum-files/download/qcdnum${builtins.replaceStrings ["-"] [""] version}.tar.gz";
-    sha256 = "0568rjviwvjkfihq2ka7g91vmialr31ryn7c69iqf13rcv5vzcw7";
+    sha256 = "0ibk1sppss45qh0g8i2c99alkx82xdbss3p55f5367bxjx4iqvvg";
   };
 
   nativeBuildInputs = [ gfortran ];
diff --git a/pkgs/development/libraries/portaudio/default.nix b/pkgs/development/libraries/portaudio/default.nix
index 92b56467aee..68daece490f 100644
--- a/pkgs/development/libraries/portaudio/default.nix
+++ b/pkgs/development/libraries/portaudio/default.nix
@@ -13,7 +13,7 @@ stdenv.mkDerivation {
   buildInputs = [ libjack2 ]
     ++ stdenv.lib.optional (!stdenv.isDarwin) alsaLib;
 
-  configureFlags = [ "--disable-mac-universal --enable-cxx" ];
+  configureFlags = [ "--disable-mac-universal" "--enable-cxx" ];
 
   NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isClang "-Wno-error=nullability-inferred-on-nested-type -Wno-error=nullability-completeness-on-arrays";
 
diff --git a/pkgs/development/libraries/prometheus-cpp/default.nix b/pkgs/development/libraries/prometheus-cpp/default.nix
index e238ca790be..624b23f4d60 100644
--- a/pkgs/development/libraries/prometheus-cpp/default.nix
+++ b/pkgs/development/libraries/prometheus-cpp/default.nix
@@ -31,7 +31,7 @@ stdenv.mkDerivation rec {
     "-DBUILD_SHARED_LIBS=ON"
   ];
 
-  NIX_LDFLAGS = [ "-ldl" ];
+  NIX_LDFLAGS = "-ldl";
 
   meta = {
     description = "Prometheus Client Library for Modern C++";
diff --git a/pkgs/development/libraries/ptlib/default.nix b/pkgs/development/libraries/ptlib/default.nix
deleted file mode 100644
index e7abedf3121..00000000000
--- a/pkgs/development/libraries/ptlib/default.nix
+++ /dev/null
@@ -1,59 +0,0 @@
-{ stdenv, fetchurl, fetchpatch, pkgconfig, bison, flex, unixODBC, gnome3
-, openssl, openldap, cyrus_sasl, kerberos, expat, SDL, libdv, libv4l, alsaLib }:
-
-stdenv.mkDerivation rec {
-  pname = "ptlib";
-  version = "2.10.11";
-
-  src = fetchurl {
-    url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
-    sha256 = "1jf27mjz8vqnclhrhrpn7niz4c177kcjbd1hc7vn65ihcqfz05rs";
-  };
-
-  NIX_CFLAGS_COMPILE = "-std=gnu++98";
-
-  nativeBuildInputs = [ pkgconfig ];
-  buildInputs = [ bison flex unixODBC openssl openldap
-                  cyrus_sasl kerberos expat SDL libdv libv4l alsaLib ];
-
-  enableParallelBuilding = true;
-
-  patches = [
-    (fetchpatch { url = http://sources.debian.net/data/main/p/ptlib/2.10.11~dfsg-2.1/debian/patches/bison-fix;
-      sha256 = "0vzv9kyn9s628z8wy2gva380gi1rmhxilwlg5pikl5a0wn8p46nw";
-    })
-    (fetchpatch { url = http://sources.debian.net/data/main/p/ptlib/2.10.11~dfsg-2.1/debian/patches/no-sslv3;
-      sha256 = "172s1dnnrl54p9sf1nl7s475sm78rpw3p8jxi0pdx6izzl8hcdr0";
-    })
-    (fetchpatch {
-      name = "openssl-1.1.patch";
-      url = "https://git.archlinux.org/svntogit/packages.git/plain/trunk/openssl-1.1.0.patch?h=packages/ptlib&id=1dfa9f55e7e030d261228fca27dda82979ca7f30";
-      sha256 = "11hdgyyibycg0wf5ls0wk9hksa4jd434i86xqiccbyg17n4l6lc1";
-    })
-    ./ptlib-2.10.11-glibc-2.26.patch
-  ];
-
-  # fix typedef clashes with unixODBC>=2.3.5
-  postPatch = ''
-    substituteInPlace include/ptlib/unix/ptlib/contain.h \
-      --replace "typedef uintptr_t    UINT" "typedef unsigned int    UINT" \
-      --replace "typedef wchar_t                 WCHAR" "typedef unsigned short          WCHAR"
-  '';
-
-  meta = with stdenv.lib; {
-    description = "Portable Tools from OPAL VoIP";
-    maintainers = [ maintainers.raskin ];
-    homepage = "http://www.opalvoip.org/";
-    platforms = platforms.linux;
-    license = with licenses; [ beerware bsdOriginal mpl10 ];
-  };
-
-  passthru = {
-    updateInfo = {
-      downloadPage = "http://ftp.gnome.org/sources/ptlib/";
-    };
-    updateScript = gnome3.updateScript {
-      packageName = pname;
-    };
-  };
-}
diff --git a/pkgs/development/libraries/ptlib/ptlib-2.10.11-glibc-2.26.patch b/pkgs/development/libraries/ptlib/ptlib-2.10.11-glibc-2.26.patch
deleted file mode 100644
index 300c3736abf..00000000000
--- a/pkgs/development/libraries/ptlib/ptlib-2.10.11-glibc-2.26.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/ptlib/unix/channel.cxx b/src/ptlib/unix/channel.cxx
-index 3b17dda..2dcaa18 100644
---- a/src/ptlib/unix/channel.cxx
-+++ b/src/ptlib/unix/channel.cxx
-@@ -36,7 +36,7 @@
- 
- #include <ptlib.h>
- #include <sys/ioctl.h>
--
-+#include <sys/uio.h>
- 
- #include "../common/pchannel.cxx"
- 
diff --git a/pkgs/development/libraries/qoauth/default.nix b/pkgs/development/libraries/qoauth/default.nix
index 0d9ae21e87e..83e904e53eb 100644
--- a/pkgs/development/libraries/qoauth/default.nix
+++ b/pkgs/development/libraries/qoauth/default.nix
@@ -18,8 +18,8 @@ stdenv.mkDerivation {
   buildInputs = [ qt5.qtbase qca2-qt5 ];
   nativeBuildInputs = [ qt5.qmake ];
 
-  NIX_CFLAGS_COMPILE = [ "-I${qca2-qt5}/include/Qca-qt5/QtCrypto" ];
-  NIX_LDFLAGS = [ "-lqca-qt5" ];
+  NIX_CFLAGS_COMPILE = "-I${qca2-qt5}/include/Qca-qt5/QtCrypto";
+  NIX_LDFLAGS = "-lqca-qt5";
 
   meta = with stdenv.lib; {
     description = "Qt library for OAuth authentication";
diff --git a/pkgs/development/libraries/qrupdate/default.nix b/pkgs/development/libraries/qrupdate/default.nix
index 85e45d3fad0..3e0dc99f81f 100644
--- a/pkgs/development/libraries/qrupdate/default.nix
+++ b/pkgs/development/libraries/qrupdate/default.nix
@@ -28,9 +28,7 @@ stdenv.mkDerivation {
 
   buildFlags = [ "lib" "solib" ];
 
-  installTargets = if stdenv.isDarwin
-                   then ["install-staticlib" "install-shlib"]
-                   else "install";
+  installTargets = stdenv.lib.optionals stdenv.isDarwin [ "install-staticlib" "install-shlib" ];
 
   buildInputs = [ gfortran openblas ];
 
diff --git a/pkgs/development/libraries/qt-4.x/4.8/default.nix b/pkgs/development/libraries/qt-4.x/4.8/default.nix
index 7c7f8f51de7..25953949eb7 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/default.nix
+++ b/pkgs/development/libraries/qt-4.x/4.8/default.nix
@@ -93,6 +93,12 @@ stdenv.mkDerivation rec {
       #})
       ./qt4-gcc6.patch
       ./qt4-openssl-1.1.patch
+      (fetchpatch {
+        name = "gcc9-foreach.patch";
+        url = "https://salsa.debian.org/qt-kde-team/qt/qt4-x11/raw/"
+          + "0d4a3dd61ccb156dee556c214dbe91c04d44a717/debian/patches/gcc9-qforeach.patch";
+        sha256 = "0dzn6qxrgxb75rvck9kmy5gspawdn970wsjw56026dhkih8cp3pg";
+      })
     ]
     ++ lib.optional gtkStyle (substituteAll ({
         src = ./dlopen-gtkstyle.diff;
@@ -200,13 +206,13 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  NIX_CFLAGS_COMPILE =
+  NIX_CFLAGS_COMPILE = toString (
     # with gcc7 the warnings blow the log over Hydra's limit
     [ "-Wno-expansion-to-defined" "-Wno-unused-local-typedefs" ]
     ++ lib.optional stdenv.isLinux "-std=gnu++98" # gnu++ in (Obj)C flags is no good on Darwin
     ++ lib.optionals (stdenv.isFreeBSD || stdenv.isDarwin)
       [ "-I${glib.dev}/include/glib-2.0" "-I${glib.out}/lib/glib-2.0/include" ]
-    ++ lib.optional stdenv.isDarwin "-I${libcxx}/include/c++/v1";
+    ++ lib.optional stdenv.isDarwin "-I${libcxx}/include/c++/v1");
 
   NIX_LDFLAGS = lib.optionalString (stdenv.isFreeBSD || stdenv.isDarwin) "-lglib-2.0";
 
diff --git a/pkgs/development/libraries/qt-4.x/4.8/qt4-gcc6.patch b/pkgs/development/libraries/qt-4.x/4.8/qt4-gcc6.patch
index 000e345cf13..dfd1d8b893b 100644
--- a/pkgs/development/libraries/qt-4.x/4.8/qt4-gcc6.patch
+++ b/pkgs/development/libraries/qt-4.x/4.8/qt4-gcc6.patch
@@ -5,7 +5,7 @@
  	# Check gcc's version
  	case "$(${QMAKE_CONF_COMPILER} -dumpversion)" in
 -	    5*|4*|3.4*)
-+	    8*|7*|6*|5*|4*|3.4*)
++	    9*|8*|7*|6*|5*|4*|3.4*)
  		;;
              3.3*)
                  canBuildWebKit="no"
@@ -14,7 +14,7 @@
          COMPILER_VERSION="3.*"
          ;;
 -    5*|4.*)
-+    8*|7*|6*|5*|4.*)
++    9*|8*|7*|6*|5*|4.*)
          COMPILER_VERSION="4"
          ;;
      *)
diff --git a/pkgs/development/libraries/qt-5/5.11/default.nix b/pkgs/development/libraries/qt-5/5.11/default.nix
new file mode 100644
index 00000000000..a10c50c9946
--- /dev/null
+++ b/pkgs/development/libraries/qt-5/5.11/default.nix
@@ -0,0 +1,179 @@
+/*
+
+# Updates
+
+Before a major version update, make a copy of this directory. (We like to
+keep the old version around for a short time after major updates.) Add a
+top-level attribute to `top-level/all-packages.nix`.
+
+1. Update the URL in `pkgs/development/libraries/qt-5/$VERSION/fetch.sh`.
+2. From the top of the Nixpkgs tree, run
+   `./maintainers/scripts/fetch-kde-qt.sh > pkgs/development/libraries/qt-5/$VERSION/srcs.nix`.
+3. Check that the new packages build correctly.
+4. Commit the changes and open a pull request.
+
+*/
+
+{
+  newScope,
+  stdenv, fetchurl, fetchFromGitHub, fetchpatch, makeSetupHook, makeWrapper,
+  bison, cups ? null, harfbuzz, libGL, perl,
+  gstreamer, gst-plugins-base, gtk3, dconf,
+  llvmPackages_5,
+
+  # options
+  developerBuild ? false,
+  decryptSslTraffic ? false,
+  debug ? false,
+}:
+
+with stdenv.lib;
+
+let
+
+  qtCompatVersion = srcs.qtbase.version;
+
+  stdenvActual = if stdenv.cc.isClang then llvmPackages_5.stdenv else stdenv;
+
+  mirror = "https://download.qt.io";
+  srcs = import ./srcs.nix { inherit fetchurl; inherit mirror; } // {
+    # Community port of the now unmaintained upstream qtwebkit.
+    qtwebkit = {
+      src = fetchFromGitHub {
+        owner = "annulen";
+        repo = "webkit";
+        rev = "4ce8ebc4094512b9916bfa5984065e95ac97c9d8";
+        sha256 = "05h1xnxzbf7sp3plw5dndsvpf6iigh0bi4vlj4svx0hkf1giakjf";
+      };
+      version = "5.212-alpha-01-26-2018";
+    };
+  };
+
+  patches = {
+    qtbase = [
+      ./qtbase.patch
+      ./qtbase-fixguicmake.patch
+      (fetchpatch {
+        url = "https://code.qt.io/cgit/qt/qtbase.git/patch/?id=a52d7861edfb5956";
+        sha256 = "0as047qybh6w9xz2wd569kixwsibj3qid5nkd3l5w5v3lk80af3v";
+      })
+    ];
+    qtdeclarative = [ ./qtdeclarative.patch ];
+    qtscript = [
+      ./qtscript.patch
+      # needed due to changes in gcc 8.3, see https://bugreports.qt.io/browse/QTBUG-74196
+      # fixed in qtscript 5.12.2
+      (fetchpatch {
+        url = "https://github.com/qt/qtscript/commit/97ec1d1882a83c23c91f0f7daea48e05858d8c32.diff";
+        sha256 = "0khrapq13xzvxckzc9l7gqyjwibyd98vyqy6gmyhvsbm2kq8n6wi";
+      })
+    ];
+    qtserialport = [ ./qtserialport.patch ];
+    qttools = [ ./qttools.patch ];
+    qtwebengine = [
+      ./qtwebengine-no-build-skip.patch
+      ./qtwebengine-darwin-no-platform-check.patch
+      # https://gitlab.freedesktop.org/pulseaudio/pulseaudio/issues/707
+      # https://bugreports.qt.io/browse/QTBUG-77037
+      (fetchpatch {
+        name = "fix-build-with-pulseaudio-13.0.patch";
+        url = "https://git.archlinux.org/svntogit/packages.git/plain/trunk/qtbug-77037-workaround.patch?h=packages/qt5-webengine&id=fc77d6b3d5ec74e421b58f199efceb2593cbf951";
+        sha256 = "1gv733qfdn9746nbqqxzyjx4ijjqkkb7zb71nxax49nna5bri3am";
+      })
+    ];
+    qtwebkit = [ ./qtwebkit.patch ];
+  };
+
+  qtModule =
+    import ../qtModule.nix
+    {
+      inherit perl;
+      inherit (stdenv) lib;
+      # Use a variant of mkDerivation that does not include wrapQtApplications
+      # to avoid cyclic dependencies between Qt modules.
+      mkDerivation =
+        import ../mkDerivation.nix
+        { inherit (stdenv) lib; inherit debug; wrapQtAppsHook = null; }
+        stdenvActual.mkDerivation;
+    }
+    { inherit self srcs patches; };
+
+  addPackages = self: with self;
+    let
+      callPackage = self.newScope { inherit qtCompatVersion qtModule srcs; };
+    in {
+
+      mkDerivationWith =
+        import ../mkDerivation.nix
+        { inherit (stdenv) lib; inherit debug; inherit (self) wrapQtAppsHook; };
+
+      mkDerivation = mkDerivationWith stdenvActual.mkDerivation;
+
+      qtbase = callPackage ../modules/qtbase.nix {
+        inherit (srcs.qtbase) src version;
+        patches = patches.qtbase;
+        inherit bison cups harfbuzz libGL;
+        withGtk3 = true; inherit dconf gtk3;
+        inherit developerBuild decryptSslTraffic;
+      };
+
+      qtcharts = callPackage ../modules/qtcharts.nix {};
+      qtconnectivity = callPackage ../modules/qtconnectivity.nix {};
+      qtdeclarative = callPackage ../modules/qtdeclarative.nix {};
+      qtdoc = callPackage ../modules/qtdoc.nix {};
+      qtgraphicaleffects = callPackage ../modules/qtgraphicaleffects.nix {};
+      qtimageformats = callPackage ../modules/qtimageformats.nix {};
+      qtlocation = callPackage ../modules/qtlocation.nix { };
+      qtmacextras = callPackage ../modules/qtmacextras.nix {};
+      qtmultimedia = callPackage ../modules/qtmultimedia.nix {
+        inherit gstreamer gst-plugins-base;
+      };
+      qtnetworkauth = callPackage ../modules/qtnetworkauth.nix {};
+      qtquick1 = null;
+      qtquickcontrols = callPackage ../modules/qtquickcontrols.nix {};
+      qtquickcontrols2 = callPackage ../modules/qtquickcontrols2.nix {};
+      qtscript = callPackage ../modules/qtscript.nix {};
+      qtsensors = callPackage ../modules/qtsensors.nix {};
+      qtserialport = callPackage ../modules/qtserialport.nix {};
+      qtspeech = callPackage ../modules/qtspeech.nix {};
+      qtsvg = callPackage ../modules/qtsvg.nix {};
+      qttools = callPackage ../modules/qttools.nix {};
+      qttranslations = callPackage ../modules/qttranslations.nix {};
+      qtvirtualkeyboard = callPackage ../modules/qtvirtualkeyboard.nix {};
+      qtwayland = callPackage ../modules/qtwayland.nix {};
+      qtwebchannel = callPackage ../modules/qtwebchannel.nix {};
+      qtwebengine = callPackage ../modules/qtwebengine.nix {};
+      qtwebglplugin = callPackage ../modules/qtwebglplugin.nix {};
+      qtwebkit = callPackage ../modules/qtwebkit.nix {};
+      qtwebsockets = callPackage ../modules/qtwebsockets.nix {};
+      qtwebview = callPackage ../modules/qtwebview.nix {};
+      qtx11extras = callPackage ../modules/qtx11extras.nix {};
+      qtxmlpatterns = callPackage ../modules/qtxmlpatterns.nix {};
+
+      env = callPackage ../qt-env.nix {};
+      full = env "qt-full-${qtbase.version}" ([
+        qtcharts qtconnectivity qtdeclarative qtdoc qtgraphicaleffects
+        qtimageformats qtlocation qtmultimedia qtquickcontrols qtquickcontrols2
+        qtscript qtsensors qtserialport qtsvg qttools qttranslations
+        qtvirtualkeyboard qtwebchannel qtwebengine qtwebkit qtwebsockets
+        qtwebview qtx11extras qtxmlpatterns
+      ] ++ optional (!stdenv.isDarwin) qtwayland
+        ++ optional (stdenv.isDarwin) qtmacextras);
+
+      qmake = makeSetupHook {
+        deps = [ self.qtbase.dev ];
+        substitutions = {
+          fix_qmake_libtool = ../hooks/fix-qmake-libtool.sh;
+        };
+      } ../hooks/qmake-hook.sh;
+
+      wrapQtAppsHook = makeSetupHook {
+        deps =
+          [ self.qtbase.dev makeWrapper ]
+          ++ optional stdenv.isLinux self.qtwayland.dev;
+      } ../hooks/wrap-qt-apps-hook.sh;
+    };
+
+   self = makeScope newScope addPackages;
+
+in self
diff --git a/pkgs/development/libraries/qt-5/mkDerivation.nix b/pkgs/development/libraries/qt-5/mkDerivation.nix
index 95357c096df..2c6333cb020 100644
--- a/pkgs/development/libraries/qt-5/mkDerivation.nix
+++ b/pkgs/development/libraries/qt-5/mkDerivation.nix
@@ -12,9 +12,9 @@ let
     qmakeFlags = [ ("CONFIG+=" + (if debug then "debug" else "release")) ]
               ++ (args.qmakeFlags or []);
 
-    NIX_CFLAGS_COMPILE =
+    NIX_CFLAGS_COMPILE = toString (
       optional (!debug) "-DQT_NO_DEBUG"
-      ++ lib.toList (args.NIX_CFLAGS_COMPILE or []);
+      ++ lib.toList (args.NIX_CFLAGS_COMPILE or []));
 
     cmakeFlags =
       (args.cmakeFlags or [])
diff --git a/pkgs/development/libraries/qt-5/modules/qtbase.nix b/pkgs/development/libraries/qt-5/modules/qtbase.nix
index c7cb6d509dc..bc23d0f9caf 100644
--- a/pkgs/development/libraries/qt-5/modules/qtbase.nix
+++ b/pkgs/development/libraries/qt-5/modules/qtbase.nix
@@ -170,11 +170,6 @@ stdenv.mkDerivation {
     export LD=$CXX
     ''}
 
-    configureFlags+="\
-        -plugindir $out/$qtPluginPrefix \
-        -qmldir $out/$qtQmlPrefix \
-        -docdir $out/$qtDocPrefix"
-
     NIX_CFLAGS_COMPILE+=" -DNIXPKGS_QT_PLUGIN_PREFIX=\"$qtPluginPrefix\""
   '';
 
@@ -200,20 +195,17 @@ stdenv.mkDerivation {
     done
   '';
 
-  NIX_CFLAGS_COMPILE =
-    [
-      "-Wno-error=sign-compare" # freetype-2.5.4 changed signedness of some struct fields
-      ''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"''
-      ''-D${if compareVersion "5.11.0" >= 0 then "LIBRESOLV_SO" else "NIXPKGS_LIBRESOLV"}="${stdenv.cc.libc.out}/lib/libresolv"''
-      ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"''
-    ]
-
-    ++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"''
+  NIX_CFLAGS_COMPILE = toString ([
+    "-Wno-error=sign-compare" # freetype-2.5.4 changed signedness of some struct fields
+    ''-DNIXPKGS_QTCOMPOSE="${libX11.out}/share/X11/locale"''
+    ''-D${if compareVersion "5.11.0" >= 0 then "LIBRESOLV_SO" else "NIXPKGS_LIBRESOLV"}="${stdenv.cc.libc.out}/lib/libresolv"''
+    ''-DNIXPKGS_LIBXCURSOR="${libXcursor.out}/lib/libXcursor"''
+  ] ++ lib.optional libGLSupported ''-DNIXPKGS_MESA_GL="${libGL.out}/lib/libGL"''
     ++ lib.optionals withGtk3 [
          ''-DNIXPKGS_QGTK3_XDG_DATA_DIRS="${gtk3}/share/gsettings-schemas/${gtk3.name}"''
          ''-DNIXPKGS_QGTK3_GIO_EXTRA_MODULES="${dconf.lib}/lib/gio/modules"''
        ]
-    ++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC";
+    ++ lib.optional decryptSslTraffic "-DQT_DECRYPT_SSL_TRAFFIC");
 
   prefixKey = "-prefix ";
 
@@ -225,6 +217,10 @@ stdenv.mkDerivation {
   # TODO Remove obsolete and useless flags once the build will be totally mastered
   configureFlags =
     [
+      "-plugindir $(out)/$(qtPluginPrefix)"
+      "-qmldir $(out)/$(qtQmlPrefix)"
+      "-docdir $(out)/$(qtDocPrefix)"
+
       "-verbose"
       "-confirm-license"
       "-opensource"
diff --git a/pkgs/development/libraries/qtkeychain/default.nix b/pkgs/development/libraries/qtkeychain/default.nix
index 4951670f896..5b963255b65 100644
--- a/pkgs/development/libraries/qtkeychain/default.nix
+++ b/pkgs/development/libraries/qtkeychain/default.nix
@@ -24,12 +24,12 @@ stdenv.mkDerivation rec {
   cmakeFlags = [ "-DQT_TRANSLATIONS_DIR=share/qt/translations" ];
 
   nativeBuildInputs = [ cmake ]
-    ++ stdenv.lib.optional (!stdenv.isDarwin) [ pkgconfig ] # for finding libsecret
+    ++ stdenv.lib.optionals (!stdenv.isDarwin) [ pkgconfig ] # for finding libsecret
   ;
 
-  buildInputs = stdenv.lib.optional (!stdenv.isDarwin) [ libsecret ]
+  buildInputs = stdenv.lib.optionals (!stdenv.isDarwin) [ libsecret ]
     ++ (if withQt5 then [ qtbase qttools ] else [ qt4 ])
-    ++ stdenv.lib.optional stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
+    ++ stdenv.lib.optionals stdenv.isDarwin (with darwin.apple_sdk.frameworks; [
       CoreFoundation Security
     ])
   ;
diff --git a/pkgs/development/libraries/quickder/default.nix b/pkgs/development/libraries/quickder/default.nix
index 14bfd40a593..529d361f206 100644
--- a/pkgs/development/libraries/quickder/default.nix
+++ b/pkgs/development/libraries/quickder/default.nix
@@ -1,5 +1,5 @@
 { stdenv, fetchFromGitHub, python2Packages, hexio
-, which, cmake, bash, arpa2cm, git, asn2quickder, pkgconfig }:
+, cmake, bash, arpa2cm, git, asn2quickder }:
 
 stdenv.mkDerivation rec {
   pname = "quickder";
@@ -12,20 +12,17 @@ stdenv.mkDerivation rec {
     repo = "quick-der";
   };
 
+  nativeBuildInputs = [ cmake ];
+
   buildInputs = with python2Packages; [
     arpa2cm
     asn1ate
-    bash
-    cmake
-    git
     hexio
     pyparsing
     python
     six
-    which
     asn1ate
     asn2quickder
-    pkgconfig
   ];
 
   postPatch = ''
@@ -39,9 +36,6 @@ stdenv.mkDerivation rec {
   cmakeFlags = [
     "-DNO_TESTING=ON"
     "-DARPA2CM_TOOLCHAIN_DIR=$out/share/ARPA2CM/toolchain/"
-    "-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=ON"
-    "-DCMAKE_FIND_PACKAGE_NO_PACKAGE_REGISTRY=ON"
-    "-DPACKAGE_NO_PACKAGE_REGISTRY=ON"
   ];
 
   preConfigure = ''
diff --git a/pkgs/development/libraries/readline/6.2.nix b/pkgs/development/libraries/readline/6.2.nix
index 54aa42439d9..af59e50ec5e 100644
--- a/pkgs/development/libraries/readline/6.2.nix
+++ b/pkgs/development/libraries/readline/6.2.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation (rec {
 
   propagatedBuildInputs = [ncurses];
 
-  patchFlags = "-p0";
+  patchFlags = [ "-p0" ];
   patches =
     [ ./link-against-ncurses.patch
       ./no-arch_only.patch
diff --git a/pkgs/development/libraries/readline/6.3.nix b/pkgs/development/libraries/readline/6.3.nix
index 73ed823d2be..1e5d9a0a664 100644
--- a/pkgs/development/libraries/readline/6.3.nix
+++ b/pkgs/development/libraries/readline/6.3.nix
@@ -12,13 +12,11 @@ stdenv.mkDerivation {
 
   propagatedBuildInputs = [ncurses];
 
-  patchFlags = "-p0";
+  patchFlags = [ "-p0" ];
 
-  configureFlags =
-    stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
-    [ # This test requires running host code
-      "bash_cv_wcwidth_broken=no"
-    ];
+  configureFlags = stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
+    # This test requires running host code
+    "bash_cv_wcwidth_broken=no";
 
   patches =
     [ ./link-against-ncurses.patch
diff --git a/pkgs/development/libraries/readline/7.0.nix b/pkgs/development/libraries/readline/7.0.nix
index 11d5c378015..065d6544986 100644
--- a/pkgs/development/libraries/readline/7.0.nix
+++ b/pkgs/development/libraries/readline/7.0.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ncurses];
 
-  patchFlags = "-p0";
+  patchFlags = [ "-p0" ];
 
   upstreamPatches =
     (let
diff --git a/pkgs/development/libraries/readline/8.0.nix b/pkgs/development/libraries/readline/8.0.nix
index cdc36617c52..7fbef9a986a 100644
--- a/pkgs/development/libraries/readline/8.0.nix
+++ b/pkgs/development/libraries/readline/8.0.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ncurses];
 
-  patchFlags = "-p0";
+  patchFlags = [ "-p0" ];
 
   upstreamPatches =
     (let
diff --git a/pkgs/development/libraries/rocksdb/default.nix b/pkgs/development/libraries/rocksdb/default.nix
index ac70d6ec0f2..2d3d1e8d722 100644
--- a/pkgs/development/libraries/rocksdb/default.nix
+++ b/pkgs/development/libraries/rocksdb/default.nix
@@ -30,6 +30,8 @@ stdenv.mkDerivation rec {
     substituteInPlace CMakeLists.txt --replace "find_package(zlib " "find_package(ZLIB "
   '';
 
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-error=deprecated-copy -Wno-error=pessimizing-move";
+
   cmakeFlags = [
     "-DPORTABLE=1"
     "-DWITH_JEMALLOC=0"
diff --git a/pkgs/development/libraries/schroedinger/default.nix b/pkgs/development/libraries/schroedinger/default.nix
index f78ed0f7925..1831161979d 100644
--- a/pkgs/development/libraries/schroedinger/default.nix
+++ b/pkgs/development/libraries/schroedinger/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation {
 
   doCheck = (!stdenv.isDarwin);
 
-  patchFlags = "-p0";
+  patchFlags = [ "-p0" ];
   patches = [
     (fetchpatch {
       url = "https://raw.githubusercontent.com/macports/macports-ports/master/multimedia/schroedinger/files/patch-testsuite-Makefile.am.diff";
diff --git a/pkgs/development/libraries/science/benchmark/papi/default.nix b/pkgs/development/libraries/science/benchmark/papi/default.nix
index 35d0914e3f7..53ae70f5bf8 100644
--- a/pkgs/development/libraries/science/benchmark/papi/default.nix
+++ b/pkgs/development/libraries/science/benchmark/papi/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation {
     sha256 = "13mngf9kl0y2wfxqvkad0smdaag7k8fvw82b4312gx62nwhc1i6r";
   };
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=format-truncation" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error=format-truncation";
 
   preConfigure = ''
     cd src
diff --git a/pkgs/development/libraries/science/biology/htslib/default.nix b/pkgs/development/libraries/science/biology/htslib/default.nix
index 0b13696ad5f..7d771414fb0 100644
--- a/pkgs/development/libraries/science/biology/htslib/default.nix
+++ b/pkgs/development/libraries/science/biology/htslib/default.nix
@@ -16,7 +16,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--enable-libcurl" ]; # optional but strongly recommended
 
-  installFlags = "prefix=$(out)";
+  installFlags = [ "prefix=$(out)" ];
 
   preCheck = ''
     patchShebangs test/
diff --git a/pkgs/development/libraries/science/biology/mirtk/default.nix b/pkgs/development/libraries/science/biology/mirtk/default.nix
index fb93961e1bc..4291e11ed33 100644
--- a/pkgs/development/libraries/science/biology/mirtk/default.nix
+++ b/pkgs/development/libraries/science/biology/mirtk/default.nix
@@ -12,7 +12,11 @@ stdenv.mkDerivation rec {
     fetchSubmodules = true;
   };
 
-  cmakeFlags = "-DWITH_VTK=ON -DBUILD_ALL_MODULES=ON -DWITH_TBB=ON";
+  cmakeFlags = [
+    "-DWITH_VTK=ON"
+    "-DBUILD_ALL_MODULES=ON"
+    "-DWITH_TBB=ON"
+  ];
 
   doCheck = true;
 
diff --git a/pkgs/development/libraries/science/math/fenics/default.nix b/pkgs/development/libraries/science/math/fenics/default.nix
index a93ede63a26..2bb284477e6 100644
--- a/pkgs/development/libraries/science/math/fenics/default.nix
+++ b/pkgs/development/libraries/science/math/fenics/default.nix
@@ -142,26 +142,27 @@ stdenv.mkDerivation {
     numpy pkgconfig six sphinx suitesparse sympy ufl vtk zlib
     ] ++ stdenv.lib.optionals pythonBindings [ ply python numpy swig ];
   patches = [ ./unicode.patch ];
-  cmakeFlags = "-DDOLFIN_CXX_FLAGS=-std=c++11"
-    + " -DDOLFIN_AUTO_DETECT_MPI=OFF"
-    + " -DDOLFIN_ENABLE_CHOLMOD=" + (if suitesparse != null then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_DOCS=" + (if docs then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_GTEST=" + (if gtest != null then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_HDF5=" + (if hdf5 != null then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_MPI=" + (if mpi != null then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_PARMETIS=OFF"
-    + " -DDOLFIN_ENABLE_PETSC4PY=OFF"
-    + " -DDOLFIN_ENABLE_PETSC=OFF"
-    + " -DDOLFIN_ENABLE_PYTHON=" + (if pythonBindings then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_SCOTCH=OFF"
-    + " -DDOLFIN_ENABLE_SLEPC4PY=OFF"
-    + " -DDOLFIN_ENABLE_SLEPC=OFF"
-    + " -DDOLFIN_ENABLE_SPHINX=" + (if sphinx != null then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_TESTING=" + (if doCheck then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_TRILINOS=OFF"
-    + " -DDOLFIN_ENABLE_UMFPACK=" + (if suitesparse != null then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_VTK=" + (if vtk != null then "ON" else "OFF")
-    + " -DDOLFIN_ENABLE_ZLIB=" + (if zlib != null then "ON" else "OFF");
+  cmakeFlags = [ "-DDOLFIN_CXX_FLAGS=-std=c++11"
+    "-DDOLFIN_AUTO_DETECT_MPI=OFF"
+    ("-DDOLFIN_ENABLE_CHOLMOD=" + (if suitesparse != null then "ON" else "OFF"))
+    ("-DDOLFIN_ENABLE_DOCS=" + (if docs then "ON" else "OFF"))
+    ("-DDOLFIN_ENABLE_GTEST=" + (if gtest != null then "ON" else "OFF"))
+    ("-DDOLFIN_ENABLE_HDF5=" + (if hdf5 != null then "ON" else "OFF"))
+    ("-DDOLFIN_ENABLE_MPI=" + (if mpi != null then "ON" else "OFF"))
+    "-DDOLFIN_ENABLE_PARMETIS=OFF"
+    "-DDOLFIN_ENABLE_PETSC4PY=OFF"
+    "-DDOLFIN_ENABLE_PETSC=OFF"
+    ("-DDOLFIN_ENABLE_PYTHON=" + (if pythonBindings then "ON" else "OFF"))
+    "-DDOLFIN_ENABLE_SCOTCH=OFF"
+    "-DDOLFIN_ENABLE_SLEPC4PY=OFF"
+    "-DDOLFIN_ENABLE_SLEPC=OFF"
+    ("-DDOLFIN_ENABLE_SPHINX=" + (if sphinx != null then "ON" else "OFF"))
+    ("-DDOLFIN_ENABLE_TESTING=" + (if doCheck then "ON" else "OFF"))
+    "-DDOLFIN_ENABLE_TRILINOS=OFF"
+    ("-DDOLFIN_ENABLE_UMFPACK=" + (if suitesparse != null then "ON" else "OFF"))
+    ("-DDOLFIN_ENABLE_VTK=" + (if vtk != null then "ON" else "OFF"))
+    ("-DDOLFIN_ENABLE_ZLIB=" + (if zlib != null then "ON" else "OFF"))
+  ];
   checkPhase = ''
     make runtests
   '';
diff --git a/pkgs/development/libraries/science/math/osi/default.nix b/pkgs/development/libraries/science/math/osi/default.nix
index 1cc80e78a10..6dc7e746fd3 100644
--- a/pkgs/development/libraries/science/math/osi/default.nix
+++ b/pkgs/development/libraries/science/math/osi/default.nix
@@ -22,10 +22,10 @@ stdenv.mkDerivation rec {
     ++ lib.optionals withCplex [ "--with-cplex-incdir=${cplex}/cplex/include/ilcplex" "--with-cplex-lib=-lcplex${cplex.libSuffix}" ];
 
   NIX_LDFLAGS =
-    lib.optional withCplex "-L${cplex}/cplex/bin/${cplex.libArch}";
+    lib.optionalString withCplex "-L${cplex}/cplex/bin/${cplex.libArch}";
 
-  # Compile errors 
-  NIX_CFLAGS_COMPILE = [ "-Wno-cast-qual" ];
+  # Compile errors
+  NIX_CFLAGS_COMPILE = "-Wno-cast-qual";
   hardeningDisable = [ "format" ];
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/shhmsg/default.nix b/pkgs/development/libraries/shhmsg/default.nix
index 5f14a7bb5ee..596ea1cfaf8 100644
--- a/pkgs/development/libraries/shhmsg/default.nix
+++ b/pkgs/development/libraries/shhmsg/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0ax02fzqpaxr7d30l5xbndy1s5vgg1ag643c7zwiw2wj1czrxil8";
   };
 
-  installFlags = "INSTBASEDIR=$(out)";
+  installFlags = [ "INSTBASEDIR=$(out)" ];
 
   meta = with stdenv.lib; {
     description = "A library for displaying messages";
diff --git a/pkgs/development/libraries/shhopt/default.nix b/pkgs/development/libraries/shhopt/default.nix
index dbac4c85961..985ee59348b 100644
--- a/pkgs/development/libraries/shhopt/default.nix
+++ b/pkgs/development/libraries/shhopt/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     sha256 = "0yd6bl6qw675sxa81nxw6plhpjf9d2ywlm8a5z66zyjf28sl7sds";
   };
 
-  installFlags = "INSTBASEDIR=$(out)";
+  installFlags = [ "INSTBASEDIR=$(out)" ];
 
   meta = with stdenv.lib; {
     description = "A library for parsing command line options";
diff --git a/pkgs/development/libraries/smpeg/default.nix b/pkgs/development/libraries/smpeg/default.nix
index a7ffc146f41..4d74ee7ca06 100644
--- a/pkgs/development/libraries/smpeg/default.nix
+++ b/pkgs/development/libraries/smpeg/default.nix
@@ -40,7 +40,7 @@ stdenv.mkDerivation rec {
       --prefix PKG_CONFIG_PATH ":" "${SDL.dev}/lib/pkgconfig"
   '';
 
-  NIX_LDFLAGS = [ "-lX11" ];
+  NIX_LDFLAGS = "-lX11";
 
   meta = {
     homepage = http://icculus.org/smpeg/;
diff --git a/pkgs/development/libraries/sord/default.nix b/pkgs/development/libraries/sord/default.nix
index 38636776e9d..2113d7bd49b 100644
--- a/pkgs/development/libraries/sord/default.nix
+++ b/pkgs/development/libraries/sord/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   pname = "sord";
-  version = "0.16.2";
+  version = "0.16.4";
 
   src = fetchurl {
     url = "https://download.drobilla.net/${pname}-${version}.tar.bz2";
-    sha256 = "13fshxwpipjrvsah1m2jw1kf022z2q5vpw24bzcznglgvms13x89";
+    sha256 = "1mwh4qvp9q4vgrgg5bz9sgjhxscncrylf2b06h0q55ddwzs9hndi";
   };
 
   nativeBuildInputs = [ pkgconfig python3 wafHook ];
diff --git a/pkgs/development/libraries/spatialite-tools/default.nix b/pkgs/development/libraries/spatialite-tools/default.nix
index 2708e49eb2b..83eef355f2d 100644
--- a/pkgs/development/libraries/spatialite-tools/default.nix
+++ b/pkgs/development/libraries/spatialite-tools/default.nix
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  NIX_LDFLAGS = [ "-lsqlite3" ];
+  NIX_LDFLAGS = "-lsqlite3";
 
   meta = {
     description = "A complete sqlite3-compatible CLI front-end for libspatialite";
diff --git a/pkgs/development/libraries/spdk/default.nix b/pkgs/development/libraries/spdk/default.nix
index e70980afac6..51583fdbbcd 100644
--- a/pkgs/development/libraries/spdk/default.nix
+++ b/pkgs/development/libraries/spdk/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--with-dpdk=${dpdk}" ];
 
-  NIX_CFLAGS_COMPILE = [ "-mssse3" ]; # Necessary to compile.
+  NIX_CFLAGS_COMPILE = "-mssse3"; # Necessary to compile.
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/default.nix
index 529b3ba9e71..d904637fcd3 100644
--- a/pkgs/development/libraries/sqlite/default.nix
+++ b/pkgs/development/libraries/sqlite/default.nix
@@ -10,12 +10,12 @@ in
 
 stdenv.mkDerivation rec {
   pname = "sqlite";
-  version = "3.30.0";
+  version = "3.30.1";
 
   # NB! Make sure to update analyzer.nix src (in the same directory).
   src = fetchurl {
     url = "https://sqlite.org/2019/sqlite-autoconf-${archiveVersion version}.tar.gz";
-    sha256 = "0n7w839y55dc3qqf2zv8xk6238cc6mpx24q4w5amwic7g96cza70";
+    sha256 = "0q4f57a5995wz9c7dfiqy9zwl0kn0b900nxwinqa3llv13dm0nlc";
   };
 
   outputs = [ "bin" "dev" "out" ];
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [ "--enable-threadsafe" ] ++ optional interactive "--enable-readline";
 
-  NIX_CFLAGS_COMPILE = [
+  NIX_CFLAGS_COMPILE = toString [
     "-DSQLITE_ENABLE_COLUMN_METADATA"
     "-DSQLITE_ENABLE_DBSTAT_VTAB"
     "-DSQLITE_ENABLE_JSON1"
diff --git a/pkgs/development/libraries/srt/default.nix b/pkgs/development/libraries/srt/default.nix
index cf8bffe0736..953ba9484fa 100644
--- a/pkgs/development/libraries/srt/default.nix
+++ b/pkgs/development/libraries/srt/default.nix
@@ -4,13 +4,13 @@
 with stdenv.lib;
 stdenv.mkDerivation rec {
   pname = "srt";
-  version = "1.4.0";
+  version = "1.4.1";
 
   src = fetchFromGitHub {
     owner = "Haivision";
     repo = "srt";
     rev = "v${version}";
-    sha256 = "1rmswx4x3p9pdgnd7vvl3vwgh9rynakjhv1mipy2yid5rb61ajlj";
+    sha256 = "01xaq44j95kbgqfl41pnybvqy0yq6wd4wdw88ckylzf0nzp977xz";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/t1lib/default.nix b/pkgs/development/libraries/t1lib/default.nix
index b8e7518cd33..010838efab5 100644
--- a/pkgs/development/libraries/t1lib/default.nix
+++ b/pkgs/development/libraries/t1lib/default.nix
@@ -26,7 +26,7 @@ stdenv.mkDerivation {
   inherit patches;
 
   buildInputs = [ libX11 libXaw ];
-  buildFlags = "without_doc";
+  buildFlags = [ "without_doc" ];
 
   postInstall = stdenv.lib.optional (!stdenv.isDarwin) "chmod +x $out/lib/*.so.*"; # ??
 
diff --git a/pkgs/development/libraries/tachyon/default.nix b/pkgs/development/libraries/tachyon/default.nix
index 5e0f37bbb52..d1d4ee806b8 100644
--- a/pkgs/development/libraries/tachyon/default.nix
+++ b/pkgs/development/libraries/tachyon/default.nix
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
          if stdenv.hostPlatform.system == "x86_64-freebsd" then "bsd"           else
          if stdenv.hostPlatform.system == "x686-freebsd"   then "bsd"           else
          throw "Don't know what arch to select for tachyon build";
-  makeFlags = arch;
+  makeFlags = [ arch ];
   patches = [
     # Remove absolute paths in Make-config (and unset variables so they can be set in preBuild)
     ./no-absolute-paths.patch
diff --git a/pkgs/development/libraries/tinyxml/2.6.2.nix b/pkgs/development/libraries/tinyxml/2.6.2.nix
index cc7c996f7c3..0cc4038b64e 100644
--- a/pkgs/development/libraries/tinyxml/2.6.2.nix
+++ b/pkgs/development/libraries/tinyxml/2.6.2.nix
@@ -28,7 +28,7 @@ in stdenv.mkDerivation {
   hardeningDisable = [ "format" ];
 
   NIX_CFLAGS_COMPILE =
-    stdenv.lib.optional stdenv.isDarwin "-mmacosx-version-min=10.9";
+    stdenv.lib.optionalString stdenv.isDarwin "-mmacosx-version-min=10.9";
 
   buildInputs = [ unzip ];
   buildPhase = ''
diff --git a/pkgs/development/libraries/unixODBCDrivers/default.nix b/pkgs/development/libraries/unixODBCDrivers/default.nix
index 78f85afca91..6cfaef5ef99 100644
--- a/pkgs/development/libraries/unixODBCDrivers/default.nix
+++ b/pkgs/development/libraries/unixODBCDrivers/default.nix
@@ -100,16 +100,16 @@
   sqlite = stdenv.mkDerivation rec {
     pname = "sqlite-connector-odbc";
     version = "0.9993";
- 
+
     src = fetchurl {
       url = "http://www.ch-werner.de/sqliteodbc/sqliteodbc-${version}.tar.gz";
       sha256 = "0dgsj28sc7f7aprmdd0n5a1rmcx6pv7170c8dfjl0x1qsjxim6hs";
     };
- 
+
     buildInputs = [ unixODBC sqlite zlib libxml2 ];
- 
+
     configureFlags = [ "--with-odbc=${unixODBC}" ];
- 
+
     installTargets = [ "install-3" ];
 
     # move libraries to $out/lib where they're expected to be
@@ -117,7 +117,7 @@
       mkdir -p "$out/lib"
       mv "$out"/*.* "$out/lib"
     '';
- 
+
     passthru = {
       fancyName = "SQLite";
       driver = "lib/libsqlite3odbc.so";
diff --git a/pkgs/development/libraries/uri/default.nix b/pkgs/development/libraries/uri/default.nix
index 61246748ac7..5e5f4c9e8ca 100644
--- a/pkgs/development/libraries/uri/default.nix
+++ b/pkgs/development/libraries/uri/default.nix
@@ -11,7 +11,7 @@ stdenv.mkDerivation rec {
     sha256 = "148361pixrm94q6v04k13s1msa04bx9yc3djb0lxpa7dlw19vhcd";
   };
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=parentheses" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error=parentheses";
 
   nativeBuildInputs = [ cmake doxygen ];
 
diff --git a/pkgs/development/libraries/usbredir/default.nix b/pkgs/development/libraries/usbredir/default.nix
index 2eee80a7696..8e43135196c 100644
--- a/pkgs/development/libraries/usbredir/default.nix
+++ b/pkgs/development/libraries/usbredir/default.nix
@@ -9,7 +9,7 @@ stdenv.mkDerivation rec {
     sha256 = "002yik1x7kn0427xahvnhjby2np14a6xqw7c3dx530n9h5d9rg47";
   };
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error";
 
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ libusb ];
diff --git a/pkgs/development/libraries/v8/default.nix b/pkgs/development/libraries/v8/default.nix
index 4e9336172ad..a02e540173d 100644
--- a/pkgs/development/libraries/v8/default.nix
+++ b/pkgs/development/libraries/v8/default.nix
@@ -99,7 +99,7 @@ stdenv.mkDerivation rec {
 
   # with gcc8, -Wclass-memaccess became part of -Wall and causes logging limit
   # to be exceeded
-  NIX_CFLAGS_COMPILE = stdenv.lib.optional stdenv.cc.isGNU "-Wno-class-memaccess";
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString stdenv.cc.isGNU "-Wno-class-memaccess";
 
   nativeBuildInputs = [ gn ninja pkgconfig python ]
     ++ stdenv.lib.optionals stdenv.isDarwin [ xcbuild darwin.DarwinTools ];
diff --git a/pkgs/development/libraries/vxl/default.nix b/pkgs/development/libraries/vxl/default.nix
index 9651e9a5f80..17d11d4fb74 100644
--- a/pkgs/development/libraries/vxl/default.nix
+++ b/pkgs/development/libraries/vxl/default.nix
@@ -11,14 +11,17 @@ stdenv.mkDerivation {
 
   buildInputs = [ cmake unzip libtiff expat zlib libpng libjpeg ];
 
-  # BUILD_OUL wants old linux headers for videodev.h, not available
-  # in stdenv linux headers
-  # BUILD_BRL fails to find open()
-  cmakeFlags = "-DBUILD_OUL=OFF -DBUILD_BRL=OFF -DBUILD_CONTRIB=OFF "
-    + (if stdenv.hostPlatform.system == "x86_64-linux" then
-      "-DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_C_FLAGS=-fPIC"
-    else
-      "");
+  cmakeFlags = [
+    # BUILD_OUL wants old linux headers for videodev.h, not available
+    # in stdenv linux headers
+    "-DBUILD_OUL=OFF"
+    # BUILD_BRL fails to find open()
+    "-DBUILD_BRL=OFF"
+    "-DBUILD_CONTRIB=OFF"
+  ] ++ stdenv.lib.optionals (stdenv.hostPlatform.system == "x86_64-linux") [
+    "-DCMAKE_CXX_FLAGS=-fPIC"
+    "-DCMAKE_C_FLAGS=-fPIC"
+  ];
 
   enableParallelBuilding = true;
 
diff --git a/pkgs/development/libraries/wxwidgets/2.8/default.nix b/pkgs/development/libraries/wxwidgets/2.8/default.nix
index 38ee4376ac2..73dac47307a 100644
--- a/pkgs/development/libraries/wxwidgets/2.8/default.nix
+++ b/pkgs/development/libraries/wxwidgets/2.8/default.nix
@@ -44,7 +44,7 @@ stdenv.mkDerivation rec {
     + optionalString withMesa "${libGLU.out}/lib ${libGL.out}/lib ";
 
   # Work around a bug in configure.
-  NIX_CFLAGS_COMPILE = [ "-DHAVE_X11_XLIB_H=1" "-lX11" "-lcairo" "-Wno-narrowing" ];
+  NIX_CFLAGS_COMPILE = "-DHAVE_X11_XLIB_H=1 -lX11 -lcairo -Wno-narrowing";
 
   preConfigure = "
     substituteInPlace configure --replace 'SEARCH_INCLUDE=' 'DUMMY_SEARCH_INCLUDE='
diff --git a/pkgs/development/libraries/xmlsec/default.nix b/pkgs/development/libraries/xmlsec/default.nix
index 25c5bf45888..a8c751330b7 100644
--- a/pkgs/development/libraries/xmlsec/default.nix
+++ b/pkgs/development/libraries/xmlsec/default.nix
@@ -27,7 +27,7 @@ stdenv.mkDerivation {
   configureFlags = [ "--enable-soap" ];
 
   # otherwise libxmlsec1-gnutls.so won't find libgcrypt.so, after #909
-  NIX_LDFLAGS = [ "-lgcrypt" ];
+  NIX_LDFLAGS = "-lgcrypt";
 
   postInstall = ''
     moveToOutput "bin/xmlsec1-config" "$dev"
diff --git a/pkgs/development/libraries/zeroc-ice/default.nix b/pkgs/development/libraries/zeroc-ice/default.nix
index e4d0c0fde17..3a5b1690f2d 100644
--- a/pkgs/development/libraries/zeroc-ice/default.nix
+++ b/pkgs/development/libraries/zeroc-ice/default.nix
@@ -32,7 +32,7 @@ in stdenv.mkDerivation rec {
   buildInputs = [ zeroc_mcpp bzip2 expat openssl lmdb ]
     ++ lib.optionals stdenv.isDarwin [ darwin.cctools libiconv Security ];
 
-  NIX_CFLAGS_COMPILE = [ "-Wno-error=class-memaccess" ];
+  NIX_CFLAGS_COMPILE = "-Wno-error=class-memaccess -Wno-error=deprecated-copy";
 
   prePatch = lib.optional stdenv.isDarwin ''
     substituteInPlace Make.rules.Darwin \
diff --git a/pkgs/development/libraries/zeromq/4.x.nix b/pkgs/development/libraries/zeromq/4.x.nix
index db5d90e2f02..1a8f07a3ae0 100644
--- a/pkgs/development/libraries/zeromq/4.x.nix
+++ b/pkgs/development/libraries/zeromq/4.x.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # fails all the tests (ctest)
 
-  cmakeFlags = if enableDrafts then [ "-DENABLE_DRAFTS=ON" ] else null;
+  cmakeFlags = stdenv.lib.optional enableDrafts "-DENABLE_DRAFTS=ON";
 
   meta = with stdenv.lib; {
     branch = "4";
diff --git a/pkgs/development/libraries/zookeeper_mt/default.nix b/pkgs/development/libraries/zookeeper_mt/default.nix
index 22d2ab333ca..127ea4f7162 100644
--- a/pkgs/development/libraries/zookeeper_mt/default.nix
+++ b/pkgs/development/libraries/zookeeper_mt/default.nix
@@ -7,7 +7,7 @@ stdenv.mkDerivation rec {
 
   setSourceRoot = "export sourceRoot=${zookeeper.name}/src/c";
 
-  NIX_CFLAGS_COMPILE = stdenv.lib.optionals (!stdenv.isDarwin) [ "-Wno-error=format-overflow" ];
+  NIX_CFLAGS_COMPILE = stdenv.lib.optionalString (!stdenv.isDarwin) "-Wno-error=format-overflow -Wno-error=stringop-truncation";
 
   buildInputs = [ zookeeper bash ];