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/agda/agda-iowa-stdlib/default.nix15
-rw-r--r--pkgs/development/libraries/arrow-cpp/default.nix49
-rw-r--r--pkgs/development/libraries/arrow-cpp/double-conversion_cmake.patch43
-rw-r--r--pkgs/development/libraries/babl/default.nix4
-rw-r--r--pkgs/development/libraries/boost/generic.nix15
-rw-r--r--pkgs/development/libraries/c-ares/default.nix2
-rw-r--r--pkgs/development/libraries/caf/default.nix4
-rw-r--r--pkgs/development/libraries/fmt/default.nix31
-rw-r--r--pkgs/development/libraries/git2/0.27.nix4
-rw-r--r--pkgs/development/libraries/gpgme/default.nix6
-rw-r--r--pkgs/development/libraries/harfbuzz/default.nix4
-rw-r--r--pkgs/development/libraries/hspell/default.nix2
-rw-r--r--pkgs/development/libraries/java/commons/compress/default.nix4
-rw-r--r--pkgs/development/libraries/java/commons/math/default.nix4
-rw-r--r--pkgs/development/libraries/leatherman/default.nix4
-rw-r--r--pkgs/development/libraries/lesstif/default.nix11
-rw-r--r--pkgs/development/libraries/libHX/default.nix7
-rw-r--r--pkgs/development/libraries/libaccounts-glib/default.nix6
-rw-r--r--pkgs/development/libraries/libaom/default.nix1
-rw-r--r--pkgs/development/libraries/libbap/default.nix7
-rw-r--r--pkgs/development/libraries/libbsd/cdefs.patch222
-rw-r--r--pkgs/development/libraries/libbsd/darwin.patch752
-rw-r--r--pkgs/development/libraries/libbsd/default.nix15
-rw-r--r--pkgs/development/libraries/libbsd/features.patch26
-rw-r--r--pkgs/development/libraries/libbsd/musl.patch14
-rw-r--r--pkgs/development/libraries/libbsd/non-glibc.patch74
-rw-r--r--pkgs/development/libraries/libcacard/default.nix22
-rw-r--r--pkgs/development/libraries/libdbusmenu-qt/default.nix2
-rw-r--r--pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix1
-rw-r--r--pkgs/development/libraries/libexttextcat/default.nix5
-rw-r--r--pkgs/development/libraries/libgdiplus/default.nix7
-rw-r--r--pkgs/development/libraries/libgnome-keyring/default.nix1
-rw-r--r--pkgs/development/libraries/libgnurl/default.nix1
-rw-r--r--pkgs/development/libraries/libharu/default.nix2
-rw-r--r--pkgs/development/libraries/libicns/default.nix7
-rw-r--r--pkgs/development/libraries/libiodbc/default.nix10
-rw-r--r--pkgs/development/libraries/libite/default.nix1
-rw-r--r--pkgs/development/libraries/libjson/default.nix13
-rw-r--r--pkgs/development/libraries/libkate/default.nix6
-rw-r--r--pkgs/development/libraries/liblastfm/default.nix5
-rw-r--r--pkgs/development/libraries/liblastfmSF/default.nix1
-rw-r--r--pkgs/development/libraries/liblinear/default.nix4
-rw-r--r--pkgs/development/libraries/liblqr-1/default.nix2
-rw-r--r--pkgs/development/libraries/libmilter/default.nix1
-rw-r--r--pkgs/development/libraries/libmms/default.nix7
-rw-r--r--pkgs/development/libraries/libmp3splt/default.nix1
-rw-r--r--pkgs/development/libraries/libmtp/default.nix6
-rw-r--r--pkgs/development/libraries/libmusicbrainz/5.x.nix6
-rw-r--r--pkgs/development/libraries/libmusicbrainz/default.nix6
-rw-r--r--pkgs/development/libraries/libnatspec/default.nix6
-rw-r--r--pkgs/development/libraries/libnetfilter_queue/default.nix6
-rw-r--r--pkgs/development/libraries/libnice/default.nix5
-rw-r--r--pkgs/development/libraries/libnotify/default.nix5
-rw-r--r--pkgs/development/libraries/libnova/default.nix9
-rw-r--r--pkgs/development/libraries/liboauth/default.nix1
-rw-r--r--pkgs/development/libraries/libofa/default.nix5
-rw-r--r--pkgs/development/libraries/liboggz/default.nix6
-rw-r--r--pkgs/development/libraries/libpcap/default.nix1
-rw-r--r--pkgs/development/libraries/libpqxx/default.nix4
-rw-r--r--pkgs/development/libraries/libqalculate/default.nix1
-rw-r--r--pkgs/development/libraries/libraw/default.nix4
-rw-r--r--pkgs/development/libraries/librdf/redland.nix6
-rw-r--r--pkgs/development/libraries/librealsense/default.nix4
-rw-r--r--pkgs/development/libraries/libssh/default.nix6
-rw-r--r--pkgs/development/libraries/libssh2/default.nix5
-rw-r--r--pkgs/development/libraries/libtiger/default.nix1
-rw-r--r--pkgs/development/libraries/libtorrent-rasterbar/default.nix4
-rw-r--r--pkgs/development/libraries/libtoxcore/default.nix4
-rw-r--r--pkgs/development/libraries/libtxc_dxtn/default.nix5
-rw-r--r--pkgs/development/libraries/libui/default.nix5
-rw-r--r--pkgs/development/libraries/libusb/default.nix12
-rw-r--r--pkgs/development/libraries/libusb1/default.nix13
-rw-r--r--pkgs/development/libraries/libuv/default.nix4
-rw-r--r--pkgs/development/libraries/libwacom/default.nix3
-rw-r--r--pkgs/development/libraries/lirc/default.nix20
-rw-r--r--pkgs/development/libraries/mapnik/default.nix4
-rw-r--r--pkgs/development/libraries/mesa/default.nix4
-rw-r--r--pkgs/development/libraries/msgpack/generic.nix2
-rw-r--r--pkgs/development/libraries/nanoflann/default.nix4
-rw-r--r--pkgs/development/libraries/nghttp2/default.nix9
-rw-r--r--pkgs/development/libraries/nlohmann_json/default.nix6
-rw-r--r--pkgs/development/libraries/parquet-cpp/default.nix39
-rw-r--r--pkgs/development/libraries/postgis/default.nix4
-rw-r--r--pkgs/development/libraries/range-v3/default.nix4
-rw-r--r--pkgs/development/libraries/sbc/default.nix4
-rw-r--r--pkgs/development/libraries/science/math/ipopt/default.nix4
-rw-r--r--pkgs/development/libraries/science/math/mkl/default.nix85
-rw-r--r--pkgs/development/libraries/spice/default.nix6
-rw-r--r--pkgs/development/libraries/sqlite/default.nix2
-rw-r--r--pkgs/development/libraries/vigra/default.nix8
-rw-r--r--pkgs/development/libraries/vulkan-headers/default.nix2
-rw-r--r--pkgs/development/libraries/vulkan-loader/default.nix14
-rw-r--r--pkgs/development/libraries/xdg-desktop-portal/default.nix4
-rw-r--r--pkgs/development/libraries/zlib/default.nix2
94 files changed, 695 insertions, 1100 deletions
diff --git a/pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix b/pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix
index ce25521ad2e5..3ab4ed3e9623 100644
--- a/pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix
+++ b/pkgs/development/libraries/agda/agda-iowa-stdlib/default.nix
@@ -1,13 +1,14 @@
-{ stdenv, agda, fetchsvn }:
+{ stdenv, agda, fetchFromGitHub }:
 
 agda.mkDerivation (self: rec {
-  version = "18734";
+  version = "1.4.0";
   name = "agda-iowa-stdlib-${version}";
 
-  src = fetchsvn {
-    url = "https://svn.divms.uiowa.edu/repos/clc/projects/agda/lib";
-    rev = version;
-    sha256 = "0aqib88m5n6aqb5lmns9nl62x40yqhg6zpj0zjxibbn4s4qjw9ky";
+  src = fetchFromGitHub {
+    owner = "cedille";
+    repo  = "ial";
+    rev = "v${version}";
+    sha256 = "1gwxpybxwdj5ipbb3gapm7r5hfl3g6sj9kp13954pdmx8d5b0gma";
   };
 
   sourceDirectories = [ "./." ];
@@ -22,7 +23,5 @@ agda.mkDerivation (self: rec {
     license = stdenv.lib.licenses.free;
     platforms = stdenv.lib.platforms.unix;
     maintainers = with stdenv.lib.maintainers; [ fuuzetsu ];
-
-    broken = true;
   };
 })
diff --git a/pkgs/development/libraries/arrow-cpp/default.nix b/pkgs/development/libraries/arrow-cpp/default.nix
index 16fc7e0c960d..77ce77dee5ad 100644
--- a/pkgs/development/libraries/arrow-cpp/default.nix
+++ b/pkgs/development/libraries/arrow-cpp/default.nix
@@ -1,42 +1,75 @@
-{ stdenv, symlinkJoin, fetchurl, boost, brotli, cmake, flatbuffers, gtest, gflags, lz4, python, rapidjson, snappy, zlib, zstd }:
+{ stdenv, symlinkJoin, fetchurl, fetchFromGitHub, boost, brotli, cmake, double-conversion, flatbuffers, gflags, glog, gtest, lz4, perl, python, rapidjson, snappy, thrift, which, zlib, zstd }:
+
+let
+  parquet-testing = fetchFromGitHub {
+    owner = "apache";
+    repo = "parquet-testing";
+    rev = "46ae2605c2de306f5740587107dcf333a527f2d1";
+    sha256 = "07ps745gas2zcfmg56m3vwl63yyzmalnxwb5dc40vd004cx5hdik";
+  };
+in
 
 stdenv.mkDerivation rec {
   name = "arrow-cpp-${version}";
-  version = "0.10.0";
+  version = "0.11.0";
 
   src = fetchurl {
     url = "mirror://apache/arrow/arrow-${version}/apache-arrow-${version}.tar.gz";
-    sha256 = "0bc4krapz1kzdm16npzmgdz7zvg9lip6rnqbwph8vfn7zji0fcll";
+    sha256 = "0pc5pqr0dbnx8s1ji102dhw9bbrsq3ml4ac3mmi2022yfyizlf0q";
   };
 
   sourceRoot = "apache-arrow-${version}/cpp";
 
-  # patch to fix python-test
-  patches = [ ./darwin.patch ];
+  patches = [
+    # fix ARROW-3467
+    ./double-conversion_cmake.patch
+
+    # patch to fix python-test
+    ./darwin.patch
+    ];
 
   nativeBuildInputs = [ cmake ];
-  buildInputs = [ boost python.pkgs.python python.pkgs.numpy ];
+  buildInputs = [ boost double-conversion glog python.pkgs.python python.pkgs.numpy ];
 
   preConfigure = ''
+    substituteInPlace cmake_modules/FindThrift.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
     substituteInPlace cmake_modules/FindBrotli.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
+    substituteInPlace cmake_modules/FindGLOG.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
     substituteInPlace cmake_modules/FindLz4.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
     substituteInPlace cmake_modules/FindSnappy.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
+
+    patchShebangs build-support/
   '';
 
   BROTLI_HOME = symlinkJoin { name="brotli-wrap"; paths = [ brotli.lib brotli.dev ]; };
+  DOUBLE_CONVERSION_HOME = double-conversion;
   FLATBUFFERS_HOME = flatbuffers;
-  GTEST_HOME = gtest;
   GFLAGS_HOME = gflags;
+  GLOG_HOME = glog;
+  GTEST_HOME = gtest;
   LZ4_HOME = symlinkJoin { name="lz4-wrap"; paths = [ lz4 lz4.dev ]; };
   RAPIDJSON_HOME = rapidjson;
   SNAPPY_HOME = symlinkJoin { name="snappy-wrap"; paths = [ snappy snappy.dev ]; };
-  ZLIB_HOME = symlinkJoin { name="zlib-wrap"; paths = [ zlib.dev zlib.static ]; };
+  THRIFT_HOME = thrift;
+  ZLIB_HOME = symlinkJoin { name="zlib-wrap"; paths = [ zlib zlib.dev ]; };
   ZSTD_HOME = zstd;
 
   cmakeFlags = [
     "-DARROW_PYTHON=ON"
+    "-DARROW_PARQUET=ON"
   ];
 
+  doInstallCheck = true;
+  PARQUET_TEST_DATA = if doInstallCheck then "${parquet-testing}/data" else null;
+  installCheckInputs = [ perl which ];
+  installCheckPhase = (stdenv.lib.optionalString stdenv.isDarwin ''
+    for f in release/*-test; do
+      install_name_tool -add_rpath "$out"/lib  "$f"
+    done
+  '') + ''
+    ctest -L unittest -V
+  '';
+
   meta = {
     description = "A  cross-language development platform for in-memory data";
     homepage = https://arrow.apache.org/;
diff --git a/pkgs/development/libraries/arrow-cpp/double-conversion_cmake.patch b/pkgs/development/libraries/arrow-cpp/double-conversion_cmake.patch
new file mode 100644
index 000000000000..336fdde9e8fb
--- /dev/null
+++ b/pkgs/development/libraries/arrow-cpp/double-conversion_cmake.patch
@@ -0,0 +1,43 @@
+diff --git a/CMakeLists.txt b/cpp/CMakeLists.txt
+--- a/CMakeLists.txt
++++ b/CMakeLists.txt
+@@ -615,7 +615,7 @@ endif(UNIX)
+ set(ARROW_LINK_LIBS)
+ 
+ # Libraries to link statically with libarrow.so
+-set(ARROW_STATIC_LINK_LIBS double-conversion)
++set(ARROW_STATIC_LINK_LIBS ${DOUBLE_CONVERSION_TARGET})
+ 
+ if (ARROW_WITH_BROTLI)
+   SET(ARROW_STATIC_LINK_LIBS
+@@ -694,7 +694,7 @@ else ()
+   set(ARROW_MIN_TEST_LIBS
+     arrow_shared
+     ${ARROW_LINK_LIBS}
+-    double-conversion
++    ${DOUBLE_CONVERSION_TARGET}
+     ${BOOST_SYSTEM_LIBRARY}
+     ${BOOST_FILESYSTEM_LIBRARY}
+     ${BOOST_REGEX_LIBRARY}
+diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cpp/cmake_modules/ThirdpartyToolchain.cmake
+--- a/cmake_modules/ThirdpartyToolchain.cmake
++++ b/cmake_modules/ThirdpartyToolchain.cmake
+@@ -469,14 +469,16 @@ if("${DOUBLE_CONVERSION_HOME}" STREQUAL "")
+   set(DOUBLE_CONVERSION_VENDORED 1)
+ else()
+   find_package(double-conversion REQUIRED)
++  set(DOUBLE_CONVERSION_TARGET double-conversion::double-conversion)
+   set(DOUBLE_CONVERSION_VENDORED 0)
+ endif()
+ 
+ include_directories(SYSTEM ${DOUBLE_CONVERSION_INCLUDE_DIR})
+-ADD_THIRDPARTY_LIB(double-conversion
+-  STATIC_LIB ${DOUBLE_CONVERSION_STATIC_LIB})
+ 
+ if (DOUBLE_CONVERSION_VENDORED)
++  ADD_THIRDPARTY_LIB(double-conversion
++    STATIC_LIB ${DOUBLE_CONVERSION_STATIC_LIB})
++  set(DOUBLE_CONVERSION_TARGET double-conversion)
+   add_dependencies(arrow_dependencies double-conversion_ep)
+ endif()
+ 
diff --git a/pkgs/development/libraries/babl/default.nix b/pkgs/development/libraries/babl/default.nix
index 1e341d3124b4..027b86a97747 100644
--- a/pkgs/development/libraries/babl/default.nix
+++ b/pkgs/development/libraries/babl/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  name = "babl-0.1.56";
+  name = "babl-0.1.58";
 
   src = fetchurl {
     url = "https://ftp.gtk.org/pub/babl/0.1/${name}.tar.bz2";
-    sha256 = "0a2dvihah1j7qi5dp1qzzlwklcqnndmxsm7lc7i78g7c2yknrlla";
+    sha256 = "0mgdii9v89ay0nra36cz9i0q7cqv8wi8hk01jsc4bf0rc1bsxjbr";
   };
 
   doCheck = true;
diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix
index 1ab0718e7960..c79b874ecb69 100644
--- a/pkgs/development/libraries/boost/generic.nix
+++ b/pkgs/development/libraries/boost/generic.nix
@@ -101,21 +101,17 @@ stdenv.mkDerivation {
 
   inherit src;
 
-  patchFlags = optionalString (stdenv.hostPlatform.libc == "msvcrt") "-p0";
+  patchFlags = "";
+
   patches = patches
-    ++ optional stdenv.isDarwin ./darwin-no-system-python.patch
-    ++ optional (stdenv.hostPlatform.libc == "msvcrt") (fetchurl {
-      url = "https://svn.boost.org/trac/boost/raw-attachment/tickaet/7262/"
-          + "boost-mingw.patch";
-      sha256 = "0s32kwll66k50w6r5np1y5g907b7lcpsjhfgr7rsw7q5syhzddyj";
-    });
+    ++ optional stdenv.isDarwin ./darwin-no-system-python.patch;
 
   meta = {
     homepage = http://boost.org/;
     description = "Collection of C++ libraries";
     license = stdenv.lib.licenses.boost;
 
-    platforms = (if versionOlder version "1.59" then remove "aarch64-linux" else id) platforms.unix;
+    platforms = (if versionOlder version "1.59" then remove "aarch64-linux" else id) (platforms.unix ++ platforms.windows);
     maintainers = with maintainers; [ peti wkennington ];
   };
 
@@ -139,7 +135,8 @@ stdenv.mkDerivation {
 
   enableParallelBuilding = true;
 
-  nativeBuildInputs = [ which buildPackages.stdenv.cc ];
+  nativeBuildInputs = [ which ];
+  depsBuildBuild = [ buildPackages.stdenv.cc ];
   buildInputs = [ expat zlib bzip2 libiconv ]
     ++ optional (stdenv.hostPlatform == stdenv.buildPlatform) icu
     ++ optional stdenv.isDarwin fixDarwinDylibNames
diff --git a/pkgs/development/libraries/c-ares/default.nix b/pkgs/development/libraries/c-ares/default.nix
index 1835356e627d..099d02c82639 100644
--- a/pkgs/development/libraries/c-ares/default.nix
+++ b/pkgs/development/libraries/c-ares/default.nix
@@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
     sha256 = "0vnwmbvymw677k780kpb6sb8i3szdp89rzy8mz1fwg1657yw3ls5";
   };
 
+  configureFlags = if stdenv.hostPlatform.isWindows then [ "--disable-shared" "--enable-static" ] else null;
+
   # ares_android.h header is missing
   # see issue https://github.com/c-ares/c-ares/issues/216
   postPatch = if stdenv.hostPlatform.isAndroid then ''
diff --git a/pkgs/development/libraries/caf/default.nix b/pkgs/development/libraries/caf/default.nix
index 397e80961e06..09c1560d6f60 100644
--- a/pkgs/development/libraries/caf/default.nix
+++ b/pkgs/development/libraries/caf/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "actor-framework-${version}";
-  version = "0.15.7";
+  version = "0.16.0";
 
   src = fetchFromGitHub {
     owner = "actor-framework";
     repo = "actor-framework";
     rev = "${version}";
-    sha256 = "0qmb18k162xdvf8z03mybjazkwb2vqda5xd1qh5bwkvxracwq3sb";
+    sha256 = "01i6sclxwa7k91ngi7jw9vlss8wjpv1hz4y5934jq0lx8hdf7s02";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/fmt/default.nix b/pkgs/development/libraries/fmt/default.nix
new file mode 100644
index 000000000000..c120f7c9b43f
--- /dev/null
+++ b/pkgs/development/libraries/fmt/default.nix
@@ -0,0 +1,31 @@
+{ stdenv, fetchFromGitHub, cmake, enableShared ? true }:
+
+stdenv.mkDerivation rec {
+  version = "5.2.1";
+  name = "fmt-${version}";
+  src = fetchFromGitHub {
+    owner = "fmtlib";
+    repo = "fmt";
+    rev = "${version}";
+    sha256 = "1cd8yq8va457iir1hlf17ksx11fx2hlb8i4jml8gj1875pizm0pk";
+  };
+  nativeBuildInputs = [ cmake ];
+  doCheck = true;
+  # preCheckHook ensures the test binaries can find libfmt.so.5
+  preCheck = if enableShared
+             then "export LD_LIBRARY_PATH=\"$PWD\""
+             else "";
+  cmakeFlags = [ "-DFMT_TEST=yes"
+                 "-DBUILD_SHARED_LIBS=${if enableShared then "ON" else "OFF"}" ];
+  meta = with stdenv.lib; {
+    homepage = http://fmtlib.net/;
+    description = "Small, safe and fast formatting library";
+    longDescription = ''
+      fmt (formerly cppformat) is an open-source formatting library. It can be
+      used as a fast and safe alternative to printf and IOStreams.
+    '';
+    maintainers = [ maintainers.jdehaas ];
+    license = licenses.bsd2;
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/git2/0.27.nix b/pkgs/development/libraries/git2/0.27.nix
index bafd6be37df6..db627449e1ba 100644
--- a/pkgs/development/libraries/git2/0.27.nix
+++ b/pkgs/development/libraries/git2/0.27.nix
@@ -4,14 +4,14 @@
 }:
 
 stdenv.mkDerivation rec {
-  version = "0.27.4";
+  version = "0.27.5";
   name = "libgit2-${version}";
 
   src = fetchFromGitHub {
     owner = "libgit2";
     repo = "libgit2";
     rev = "v${version}";
-    sha256 = "1cmc8ldhpyp62pswb7dmjjya3ng0ssaggcsxs1labvp6xyxjvp6s";
+    sha256 = "1f6jxgw4pf6jln439v1pj8a0kgym5sq5xry8x0gq18dr5gv3wims";
   };
 
   cmakeFlags = [ "-DTHREADSAFE=ON" ];
diff --git a/pkgs/development/libraries/gpgme/default.nix b/pkgs/development/libraries/gpgme/default.nix
index 416ecb5631ed..8e7d10782157 100644
--- a/pkgs/development/libraries/gpgme/default.nix
+++ b/pkgs/development/libraries/gpgme/default.nix
@@ -14,11 +14,11 @@ in
 
 stdenv.mkDerivation rec {
   name = "gpgme-${version}";
-  version = "1.11.1";
+  version = "1.12.0";
 
   src = fetchurl {
     url = "mirror://gnupg/gpgme/${name}.tar.bz2";
-    sha256 = "0vxx5xaag3rhp4g2arp5qm77gvz4kj0m3hnpvhkdvqyjfhbi26rd";
+    sha256 = "1n4c1q2ls7sqx1vpr3p5n8vbjkw6kqp8jxqa28p0x9j36wf9bp5l";
   };
 
   outputs = [ "out" "dev" "info" ];
@@ -49,7 +49,7 @@ stdenv.mkDerivation rec {
 
   checkInputs = [ which ];
 
-  doCheck = false; # fails 8 out of 26 tests with "GPGME: Decryption failed". Spooky!
+  doCheck = true;
 
   meta = with stdenv.lib; {
     homepage = https://gnupg.org/software/gpgme/index.html;
diff --git a/pkgs/development/libraries/harfbuzz/default.nix b/pkgs/development/libraries/harfbuzz/default.nix
index b3ab9c7881a9..130bc6f97bf0 100644
--- a/pkgs/development/libraries/harfbuzz/default.nix
+++ b/pkgs/development/libraries/harfbuzz/default.nix
@@ -8,7 +8,7 @@
 }:
 
 let
-  version = "1.8.8";
+  version = "1.9.0";
   inherit (stdenv.lib) optional optionals optionalString;
 in
 
@@ -17,7 +17,7 @@ stdenv.mkDerivation {
 
   src = fetchurl {
     url = "https://www.freedesktop.org/software/harfbuzz/release/harfbuzz-${version}.tar.bz2";
-    sha256 = "1ag3scnm1fcviqgx2p4858y433mr0ndqw6zccnccrqcr9mpcird8";
+    sha256 = "004b4j812wgfv8pmcypyrlwrjfa6149lwpz5df6rnm5cy0msdv0i";
   };
 
   postPatch = ''
diff --git a/pkgs/development/libraries/hspell/default.nix b/pkgs/development/libraries/hspell/default.nix
index 9d2088808c13..32743e617970 100644
--- a/pkgs/development/libraries/hspell/default.nix
+++ b/pkgs/development/libraries/hspell/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
     version = "1.1";
   };
 
-  PERL_USE_UNSAFE_INC = stdenv.lib.optionalString (stdenv.lib.versionAtLeast (stdenv.lib.getVersion perl) "5.26") "1";
+  PERL_USE_UNSAFE_INC = "1";
 
   src = fetchurl {
     url = "${meta.homepage}${name}.tar.gz";
diff --git a/pkgs/development/libraries/java/commons/compress/default.nix b/pkgs/development/libraries/java/commons/compress/default.nix
index cf9c554d57f4..3c729f42320a 100644
--- a/pkgs/development/libraries/java/commons/compress/default.nix
+++ b/pkgs/development/libraries/java/commons/compress/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  version = "1.17";
+  version = "1.18";
   name    = "commons-compress-${version}";
 
   src = fetchurl {
     url    = "mirror://apache/commons/compress/binaries/${name}-bin.tar.gz";
-    sha256 = "1ydm6mhy0kja47mns674iyrhz5mqlhhnh2l8rglzxnq5iawpi2m0";
+    sha256 = "0ciwzq134rqh1fp7qba091rajf2pdagfb665rarni7glb2x4lha1";
   };
 
   installPhase = ''
diff --git a/pkgs/development/libraries/java/commons/math/default.nix b/pkgs/development/libraries/java/commons/math/default.nix
index d43dcd2a91d5..10c39f037890 100644
--- a/pkgs/development/libraries/java/commons/math/default.nix
+++ b/pkgs/development/libraries/java/commons/math/default.nix
@@ -1,12 +1,12 @@
 { stdenv, fetchurl }:
 
 stdenv.mkDerivation rec {
-  version = "3.3";
+  version = "3.6.1";
   name    = "commons-math-${version}";
 
   src = fetchurl {
     url    = "mirror://apache/commons/math/binaries/commons-math3-${version}-bin.tar.gz";
-    sha256 = "1xs71c4vbai6zr84982g4ggv6c18dhkilkzw9n1irjqnjbgm5kzc";
+    sha256 = "0x4nx5pngv2n4ga11c1s4w2mf6cwydwkgs7da6wwvcjraw57bhkz";
   };
 
   installPhase = ''
diff --git a/pkgs/development/libraries/leatherman/default.nix b/pkgs/development/libraries/leatherman/default.nix
index b01d902fd91a..259975815d8e 100644
--- a/pkgs/development/libraries/leatherman/default.nix
+++ b/pkgs/development/libraries/leatherman/default.nix
@@ -2,10 +2,10 @@
 
 stdenv.mkDerivation rec {
   name = "leatherman-${version}";
-  version = "1.5.0";
+  version = "1.5.2";
 
   src = fetchFromGitHub {
-    sha256 = "1plx111mfci8z33mwy56y54n597gi8965s7bmnribkk8bvdn10dy";
+    sha256 = "0drn8wdl4mwqz84lwc7cjmc6pxj2jwpx7n2dxwzwj43ps624zhbj";
     rev = version;
     repo = "leatherman";
     owner = "puppetlabs";
diff --git a/pkgs/development/libraries/lesstif/default.nix b/pkgs/development/libraries/lesstif/default.nix
index 04e8eab4d287..b678a0893867 100644
--- a/pkgs/development/libraries/lesstif/default.nix
+++ b/pkgs/development/libraries/lesstif/default.nix
@@ -14,12 +14,15 @@ stdenv.mkDerivation rec {
   # in Debian, so we assume they have been sent upstream.
   #
   patches = [
-    ./c-missing_xm_h.patch        
-    ./c-render_table_crash.patch 
+    ./c-missing_xm_h.patch
+    ./c-render_table_crash.patch
     ./c-xpmpipethrough.patch
     ];
 
-  meta = {
-    platforms = stdenv.lib.platforms.unix;
+  meta = with stdenv.lib; {
+    description = "An open source clone of the Motif widget set";
+    homepage = http://lesstif.sourceforge.net;
+    platforms = platforms.unix;
+    license = with licenses; [ gpl2 lgpl2 ];
   };
 }
diff --git a/pkgs/development/libraries/libHX/default.nix b/pkgs/development/libraries/libHX/default.nix
index 7de72ed73a65..39f493d821c3 100644
--- a/pkgs/development/libraries/libHX/default.nix
+++ b/pkgs/development/libraries/libHX/default.nix
@@ -16,14 +16,15 @@ stdenv.mkDerivation rec {
     sh autogen.sh
     '';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://libhx.sourceforge.net/;
     longDescription = ''
       libHX is a C library (with some C++ bindings available) that provides data structures
       and functions commonly needed, such as maps, deques, linked lists, string formatting
       and autoresizing, option and config file parsing, type checking casts and more.
       '';
-    maintainers = [ stdenv.lib.maintainers.tstrobel ];
-    platforms = stdenv.lib.platforms.linux;
+    maintainers = [ maintainers.tstrobel ];
+    platforms = platforms.linux;
+    license = with licenses; [ gpl3 lgpl21Plus wtfpl ];
   };
 }
diff --git a/pkgs/development/libraries/libaccounts-glib/default.nix b/pkgs/development/libraries/libaccounts-glib/default.nix
index 4bb806b91d8a..16e9f213ed48 100644
--- a/pkgs/development/libraries/libaccounts-glib/default.nix
+++ b/pkgs/development/libraries/libaccounts-glib/default.nix
@@ -25,7 +25,9 @@ stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations"; # since glib-2.46
 
-  meta = {
-    platforms = stdenv.lib.platforms.linux;
+  meta = with stdenv.lib; {
+    description = "Library for managing accounts which can be used from GLib applications";
+    platforms = platforms.linux;
+    license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/libraries/libaom/default.nix b/pkgs/development/libraries/libaom/default.nix
index b94c845479aa..a08a1e335232 100644
--- a/pkgs/development/libraries/libaom/default.nix
+++ b/pkgs/development/libraries/libaom/default.nix
@@ -18,5 +18,6 @@ stdenv.mkDerivation rec {
     homepage    = https://aomedia.org/av1-features/get-started/;
     maintainers = with maintainers; [ kiloreux ];
     platforms   = platforms.all;
+    license = licenses.bsd2;
   };
 }
diff --git a/pkgs/development/libraries/libbap/default.nix b/pkgs/development/libraries/libbap/default.nix
index 54fb89df0451..5153b63e91c5 100644
--- a/pkgs/development/libraries/libbap/default.nix
+++ b/pkgs/development/libraries/libbap/default.nix
@@ -20,10 +20,11 @@ stdenv.mkDerivation rec {
     mkdir -p $out/include
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = https://github.com/binaryanalysisplatform/bap-bindings;
     description = "A C library for interacting with BAP";
-    maintainers = [ stdenv.lib.maintainers.maurer ];
-    platforms = stdenv.lib.platforms.unix;
+    maintainers = [ maintainers.maurer ];
+    platforms = platforms.unix;
+    license = licenses.mit;
   };
 }
diff --git a/pkgs/development/libraries/libbsd/cdefs.patch b/pkgs/development/libraries/libbsd/cdefs.patch
deleted file mode 100644
index 81822654aeb4..000000000000
--- a/pkgs/development/libraries/libbsd/cdefs.patch
+++ /dev/null
@@ -1,222 +0,0 @@
-From 11ec8f1e5dfa1c10e0c9fb94879b6f5b96ba52dd Mon Sep 17 00:00:00 2001
-From: Guillem Jover <guillem@hadrons.org>
-Date: Tue, 6 Mar 2018 01:41:35 +0100
-Subject: Handle systems missing <sys/cdefs.h>
-
-This is a non-portable header, and we cannot expect it to be provided by
-the system libc (e.g. musl). We just need and rely on declaration that
-we have defined ourselves in our own <bsd/sys/cdefs.h>. So we switch to
-only ever assume that.
-
-Fixes: https://bugs.freedesktop.org/105281
----
- include/bsd/libutil.h        | 4 ++++
- include/bsd/md5.h            | 4 ++++
- include/bsd/nlist.h          | 4 ++++
- include/bsd/readpassphrase.h | 4 ++++
- include/bsd/stdlib.h         | 4 ++++
- include/bsd/string.h         | 4 ++++
- include/bsd/stringlist.h     | 5 +++++
- include/bsd/sys/queue.h      | 4 ++++
- include/bsd/sys/tree.h       | 4 ++++
- include/bsd/timeconv.h       | 4 ++++
- include/bsd/vis.h            | 4 ++++
- include/bsd/wchar.h          | 4 ++++
- 12 files changed, 49 insertions(+)
-
-diff --git a/include/bsd/libutil.h b/include/bsd/libutil.h
-index 45b3b15..ccca29a 100644
---- a/include/bsd/libutil.h
-+++ b/include/bsd/libutil.h
-@@ -40,7 +40,11 @@
- #define LIBBSD_LIBUTIL_H
- 
- #include <features.h>
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- #include <sys/types.h>
- #include <stdint.h>
- #include <stdio.h>
-diff --git a/include/bsd/md5.h b/include/bsd/md5.h
-index 5f3ae46..bf36a30 100644
---- a/include/bsd/md5.h
-+++ b/include/bsd/md5.h
-@@ -27,7 +27,11 @@ typedef struct MD5Context {
- 	uint8_t buffer[MD5_BLOCK_LENGTH];	/* input buffer */
- } MD5_CTX;
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- #include <sys/types.h>
- 
- __BEGIN_DECLS
-diff --git a/include/bsd/nlist.h b/include/bsd/nlist.h
-index cb297e8..8767117 100644
---- a/include/bsd/nlist.h
-+++ b/include/bsd/nlist.h
-@@ -27,7 +27,11 @@
- #ifndef LIBBSD_NLIST_H
- #define LIBBSD_NLIST_H
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- 
- struct nlist {
- 	union {
-diff --git a/include/bsd/readpassphrase.h b/include/bsd/readpassphrase.h
-index 14744b8..5eb8021 100644
---- a/include/bsd/readpassphrase.h
-+++ b/include/bsd/readpassphrase.h
-@@ -31,7 +31,11 @@
- #define RPP_SEVENBIT    0x10		/* Strip the high bit from input. */
- #define RPP_STDIN       0x20		/* Read from stdin, not /dev/tty */
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- #include <sys/types.h>
- 
- __BEGIN_DECLS
-diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h
-index ebc9638..8d33d1f 100644
---- a/include/bsd/stdlib.h
-+++ b/include/bsd/stdlib.h
-@@ -42,7 +42,11 @@
- #ifndef LIBBSD_STDLIB_H
- #define LIBBSD_STDLIB_H
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- #include <sys/stat.h>
- #include <stdint.h>
- 
-diff --git a/include/bsd/string.h b/include/bsd/string.h
-index 6798bf6..29097f6 100644
---- a/include/bsd/string.h
-+++ b/include/bsd/string.h
-@@ -33,7 +33,11 @@
- #ifndef LIBBSD_STRING_H
- #define LIBBSD_STRING_H
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- #include <sys/types.h>
- 
- __BEGIN_DECLS
-diff --git a/include/bsd/stringlist.h b/include/bsd/stringlist.h
-index ff30cac..dd71496 100644
---- a/include/bsd/stringlist.h
-+++ b/include/bsd/stringlist.h
-@@ -31,7 +31,12 @@
- 
- #ifndef LIBBSD_STRINGLIST_H
- #define LIBBSD_STRINGLIST_H
-+
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- #include <sys/types.h>
- 
- /*
-diff --git a/include/bsd/sys/queue.h b/include/bsd/sys/queue.h
-index 4a94ea7..ac00026 100644
---- a/include/bsd/sys/queue.h
-+++ b/include/bsd/sys/queue.h
-@@ -33,7 +33,11 @@
- #ifndef LIBBSD_SYS_QUEUE_H
- #define LIBBSD_SYS_QUEUE_H
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- 
- /*
-  * This file defines four types of data structures: singly-linked lists,
-diff --git a/include/bsd/sys/tree.h b/include/bsd/sys/tree.h
-index 628bec0..325b382 100644
---- a/include/bsd/sys/tree.h
-+++ b/include/bsd/sys/tree.h
-@@ -30,7 +30,11 @@
- #ifndef LIBBSD_SYS_TREE_H
- #define LIBBSD_SYS_TREE_H
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- 
- /*
-  * This file defines data structures for different types of trees:
-diff --git a/include/bsd/timeconv.h b/include/bsd/timeconv.h
-index e2a2c55..a426bd3 100644
---- a/include/bsd/timeconv.h
-+++ b/include/bsd/timeconv.h
-@@ -41,7 +41,11 @@
- #ifndef LIBBSD_TIMECONV_H
- #define LIBBSD_TIMECONV_H
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- #include <stdint.h>
- #include <time.h>
- 
-diff --git a/include/bsd/vis.h b/include/bsd/vis.h
-index 970dfdd..ab5430c 100644
---- a/include/bsd/vis.h
-+++ b/include/bsd/vis.h
-@@ -72,7 +72,11 @@
-  */
- #define	UNVIS_END	1	/* no more characters */
- 
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- 
- __BEGIN_DECLS
- char	*vis(char *, int, int, int);
-diff --git a/include/bsd/wchar.h b/include/bsd/wchar.h
-index 33a500e..7216503 100644
---- a/include/bsd/wchar.h
-+++ b/include/bsd/wchar.h
-@@ -40,7 +40,11 @@
- #define LIBBSD_WCHAR_H
- 
- #include <stddef.h>
-+#ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
-+#else
-+#include <bsd/sys/cdefs.h>
-+#endif
- #include <sys/types.h>
- 
- __BEGIN_DECLS
--- 
-cgit v1.1
-
diff --git a/pkgs/development/libraries/libbsd/darwin.patch b/pkgs/development/libraries/libbsd/darwin.patch
index 4bddec6b0ffd..0f9cc9aaf964 100644
--- a/pkgs/development/libraries/libbsd/darwin.patch
+++ b/pkgs/development/libraries/libbsd/darwin.patch
@@ -1,497 +1,103 @@
 diff --git a/configure.ac b/configure.ac
-index 88ccd91..0857782 100644
+index 55fcfe6..1e26c93 100644
 --- a/configure.ac
 +++ b/configure.ac
-@@ -59,7 +59,7 @@ AS_CASE([$host_os],
- )
+@@ -51,15 +51,19 @@ AS_CASE([$host_os],
+     AC_SEARCH_LIBS([clock_gettime], [rt], [CLOCK_GETTIME_LIBS="-lrt"])
+     AC_SUBST([CLOCK_GETTIME_LIBS])
+     LIBS="$saved_LIBS"
++    AM_CONDITIONAL([BUILD_LINK_VERSION_SCRIPT], [1])
+   ],
+   [*-musl*], [
+     # Upstream refuses to define this, we will do it ourselves then.
+     AC_DEFINE([__MUSL__], [1], [Define to 1 if we are building for musl])
++    AM_CONDITIONAL([BUILD_LINK_VERSION_SCRIPT], [1])
+   ],
+-)
++  [
++  AM_CONDITIONAL([BUILD_LINK_VERSION_SCRIPT], [1])
++  ])
  
  # Checks for header files.
 -AC_CHECK_HEADERS([sys/ndir.h sys/dir.h ndir.h dirent.h])
-+AC_CHECK_HEADERS([sys/ndir.h sys/dir.h ndir.h dirent.h stdio_ext.h])
++AC_CHECK_HEADERS([sys/ndir.h sys/dir.h ndir.h dirent.h nlist.h])
  
  # Checks for typedefs, structures, and compiler characteristics.
  AC_C_INLINE
-@@ -146,6 +146,31 @@ AC_CHECK_FUNCS([clearenv dirfd fopencookie __fpurge \
-                 pstat_getproc sysconf])
+@@ -143,7 +147,8 @@ AC_LINK_IFELSE(
+ 
+ AC_CHECK_FUNCS([clearenv dirfd fopencookie __fpurge \
+                 getauxval getentropy getexecname getline \
+-                pstat_getproc sysconf])
++                pstat_getproc sysconf \
++		strlcpy strlcat strnstr strmode fpurge])
  AM_CONDITIONAL([HAVE_GETENTROPY], [test "x$ac_cv_func_getentropy" = "xtrue"])
  
-+HostOS=`echo "$host" | sed 's/.*-//'`
-+os_is_macosx=false
-+nonLinuxOS=false
-+AC_SUBST(HostOS)
-+case ${HostOS} in
-+	darwin* | powerpc*-*-darwin* | freebsd* | netbsd* | openbsd*)
-+		os_is_macosx=true
-+		nonLinuxOS=true
-+		echo HostOS="$HostOS"
-+		;;
-+	*)
-+		echo host="$host"
-+		echo HostOS="$HostOS"
-+		os_is_macosx=false
-+		nonLinuxOS=false
-+		;;
-+esac		
-+AM_CONDITIONAL([IS_DARWIN], [test x$os_is_macosx = xtrue])
-+AM_COND_IF([IS_DARWIN],
-+	[AC_DEFINE([IS_DARWIN], [1], [Get HostOS Type is Darwin])])
-+
-+AM_CONDITIONAL([NON_LINUX], [test x$userdefine_gethostbyname_r = xtrue])
-+AM_COND_IF([NON_LINUX],
-+	[AC_DEFINE([NON_LINUX], [1], [Get HostOS Type])])
-+
  AC_CONFIG_FILES([
- 	Makefile
- 	include/Makefile
-diff --git a/include/bsd/libutil.h b/include/bsd/libutil.h
-index 45b3b15..d0d4043 100644
---- a/include/bsd/libutil.h
-+++ b/include/bsd/libutil.h
-@@ -39,7 +39,9 @@
- #ifndef LIBBSD_LIBUTIL_H
- #define LIBBSD_LIBUTIL_H
- 
-+#ifdef HAVE_FEATURES_H
- #include <features.h>
-+#endif
- #include <sys/cdefs.h>
- #include <sys/types.h>
- #include <stdint.h>
-diff --git a/include/bsd/stdio.h b/include/bsd/stdio.h
-index 4b69983..c75151b 100644
---- a/include/bsd/stdio.h
-+++ b/include/bsd/stdio.h
-@@ -48,12 +48,16 @@
- __BEGIN_DECLS
- const char *fmtcheck(const char *, const char *);
- 
-+#if !defined(darwin) && !defined(__APPLE__) && !defined(MACOSX)
- /* XXX: The function requires cooperation from the system libc to store the
-  * line buffer in the FILE struct itself. */
- char *fgetln(FILE *fp, size_t *lenp)
--	LIBBSD_DEPRECATED("This functions cannot be safely ported, "
--	                  "use getline(3) instead, as it is supported "
--	                  "by GNU and POSIX.1-2008.");
-+	__attribute__((deprecated("This functions cannot be safely ported, "
-+	                          "use getline(3) instead, as it is supported "
-+	                          "by GNU and POSIX.1-2008.")));
-+#else
-+char *fgetln(FILE *fp, size_t *lenp);
-+#endif
- 
- /*
-  * Note: We diverge from the FreeBSD, OpenBSD and DragonFlyBSD declarations,
-diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h
-index ebc9638..6cd7943 100644
---- a/include/bsd/stdlib.h
-+++ b/include/bsd/stdlib.h
-@@ -67,9 +67,11 @@ int sradixsort(const unsigned char **base, int nmemb,
-                const unsigned char *table, unsigned endbyte);
- 
- void *reallocf(void *ptr, size_t size);
--#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 26)
-+#if defined(_GNU_SOURCE) && defined(__GLIBC__) && defined(__GLIBC_PREREQ)
-+#if !__GLIBC_PREREQ(2, 26)
- void *reallocarray(void *ptr, size_t nmemb, size_t size);
- #endif
-+#endif
- 
- long long strtonum(const char *nptr, long long minval, long long maxval,
-                    const char **errstr);
 diff --git a/include/bsd/string.h b/include/bsd/string.h
-index 6798bf6..6baaa14 100644
+index f987fee..a1e17ed 100644
 --- a/include/bsd/string.h
 +++ b/include/bsd/string.h
-@@ -37,6 +37,12 @@
+@@ -41,10 +41,21 @@
  #include <sys/types.h>
  
  __BEGIN_DECLS
-+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
-+size_t bsd_strlcpy(char *dst, const char *src, size_t siz);
-+size_t bsd_strlcat(char *dst, const char *src, size_t siz);
-+char *bsd_strnstr(const char *str, const char *find, size_t str_len);
-+void bsd_strmode(mode_t mode, char *str);
-+#else
++#if !HAVE_STRLCPY
  size_t strlcpy(char *dst, const char *src, size_t siz);
++#endif
++
++#if !HAVE_STRLCAT
  size_t strlcat(char *dst, const char *src, size_t siz);
++#endif
++
++#if !HAVE_STRNSTR
  char *strnstr(const char *str, const char *find, size_t str_len);
-@@ -45,6 +51,7 @@ void strmode(mode_t mode, char *str);
- #if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 25)
- void explicit_bzero(void *buf, size_t len);
- #endif
 +#endif
- __END_DECLS
++
++#if !HAVE_STRMODE
+ void strmode(mode_t mode, char *str);
++#endif
  
- #endif
+ #if !defined(__GLIBC__) || \
+     (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 25) || !defined(_GNU_SOURCE)))
 diff --git a/src/Makefile.am b/src/Makefile.am
-index ad83dbf..0f2a7ee 100644
+index f3cc0fa..3aaecd4 100644
 --- a/src/Makefile.am
 +++ b/src/Makefile.am
-@@ -54,17 +54,21 @@ libbsd_la_DEPENDENCIES = \
- 	libbsd.map
+@@ -56,8 +56,10 @@ libbsd_la_DEPENDENCIES = \
  libbsd_la_LIBADD = \
  	$(CLOCK_GETTIME_LIBS)
-+
-+if IS_DARWIN
-+libbsd_la_LDFLAGS = \
-+	-Wl \
-+	-version-number $(LIBBSD_ABI)
-+else
  libbsd_la_LDFLAGS = \
- 	-Wl,--version-script=$(srcdir)/libbsd.map \
+-	-Wl,--version-script=$(srcdir)/libbsd.map \
  	-version-number $(LIBBSD_ABI)
++if BUILD_LINK_VERSION_SCRIPT
++libbsd_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libbsd.map
 +endif
-+
  libbsd_la_SOURCES = \
  	arc4random.c \
--	arc4random.h \
--	arc4random_unix.h \
--	arc4random_openbsd.h \
- 	arc4random_uniform.c \
- 	bsd_getopt.c \
--	chacha_private.h \
- 	closefrom.c \
- 	dehumanize_number.c \
- 	err.c \
-@@ -117,6 +121,15 @@ libbsd_la_SOURCES += \
- 	$(nil)
- endif
- 
-+noinst_HEADERS = \
-+	arc4random.h \
-+	arc4random_bsd.h \
-+	arc4random_linux.h \
-+	arc4random_unix.h \
-+	arc4random_osx.h \
-+	arc4random_openbsd.h \
-+	chacha_private.h
-+
- libbsd_ctor_a_SOURCES = \
- 	setproctitle_ctor.c \
- 	$(nil)
-diff --git a/src/arc4random_bsd.h b/src/arc4random_bsd.h
-new file mode 100644
-index 0000000..ece2f85
---- /dev/null
-+++ b/src/arc4random_bsd.h
-@@ -0,0 +1,86 @@
-+/*	$OpenBSD: arc4random_freebsd.h,v 1.2 2015/01/15 06:57:18 deraadt Exp $	*/
-+
-+/*
-+ * Copyright (c) 1996, David Mazieres <dm@uun.org>
-+ * Copyright (c) 2008, Damien Miller <djm@openbsd.org>
-+ * Copyright (c) 2013, Markus Friedl <markus@openbsd.org>
-+ * Copyright (c) 2014, Theo de Raadt <deraadt@openbsd.org>
-+ *
-+ * Permission to use, copy, modify, and distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+
-+/*
-+ * Stub functions for portability.
-+ */
-+
-+#include <sys/mman.h>
-+
-+#include <pthread.h>
-+#include <signal.h>
-+
-+static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
-+#define _ARC4_LOCK()   pthread_mutex_lock(&arc4random_mtx)
-+#define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx)
-+
-+/*
-+ * Unfortunately, pthread_atfork() is broken on FreeBSD (at least 9 and 10) if
-+ * a program does not link to -lthr. Callbacks registered with pthread_atfork()
-+ * appear to fail silently. So, it is not always possible to detect a PID
-+ * wraparound.
-+ */
-+#define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f))
-+
-+static inline void
-+_getentropy_fail(void)
-+{
-+	raise(SIGKILL);
-+}
-+
-+static volatile sig_atomic_t _rs_forked;
-+
-+static inline void
-+_rs_forkhandler(void)
-+{
-+	_rs_forked = 1;
-+}
-+
-+static inline void
-+_rs_forkdetect(void)
-+{
-+	static pid_t _rs_pid = 0;
-+	pid_t pid = getpid();
-+
-+	if (_rs_pid == 0 || _rs_pid != pid || _rs_forked) {
-+		_rs_pid = pid;
-+		_rs_forked = 0;
-+		if (rs)
-+			memset(rs, 0, sizeof(*rs));
-+	}
-+}
-+
-+static inline int
-+_rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
-+{
-+	if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE,
-+	    MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
-+		return (-1);
-+
-+	if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE,
-+	    MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) {
-+		munmap(*rsp, sizeof(**rsp));
-+		return (-1);
-+	}
-+
-+	_ARC4_ATFORK(_rs_forkhandler);
-+	return (0);
-+}
-diff --git a/src/arc4random_linux.h b/src/arc4random_linux.h
-new file mode 100644
-index 0000000..d61a8db
---- /dev/null
-+++ b/src/arc4random_linux.h
-@@ -0,0 +1,86 @@
-+/*	$OpenBSD: arc4random_linux.h,v 1.8 2014/08/13 06:04:10 deraadt Exp $	*/
-+
-+/*
-+ * Copyright (c) 1996, David Mazieres <dm@uun.org>
-+ * Copyright (c) 2008, Damien Miller <djm@openbsd.org>
-+ * Copyright (c) 2013, Markus Friedl <markus@openbsd.org>
-+ * Copyright (c) 2014, Theo de Raadt <deraadt@openbsd.org>
-+ *
-+ * Permission to use, copy, modify, and distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+
-+/*
-+ * Stub functions for portability.
-+ */
-+
-+#include <sys/mman.h>
-+
-+#include <pthread.h>
-+#include <signal.h>
-+
-+static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
-+#define _ARC4_LOCK()   pthread_mutex_lock(&arc4random_mtx)
-+#define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx)
-+
-+#ifdef __GLIBC__
-+extern void *__dso_handle;
-+extern int __register_atfork(void (*)(void), void(*)(void), void (*)(void), void *);
-+#define _ARC4_ATFORK(f) __register_atfork(NULL, NULL, (f), __dso_handle)
-+#else
-+#define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f))
-+#endif
-+
-+static inline void
-+_getentropy_fail(void)
-+{
-+	raise(SIGKILL);
-+}
-+
-+static volatile sig_atomic_t _rs_forked;
-+
-+static inline void
-+_rs_forkhandler(void)
-+{
-+	_rs_forked = 1;
-+}
-+
-+static inline void
-+_rs_forkdetect(void)
-+{
-+	static pid_t _rs_pid = 0;
-+	pid_t pid = getpid();
-+
-+	if (_rs_pid == 0 || _rs_pid != pid || _rs_forked) {
-+		_rs_pid = pid;
-+		_rs_forked = 0;
-+		if (rs)
-+			memset(rs, 0, sizeof(*rs));
-+	}
-+}
-+
-+static inline int
-+_rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
-+{
-+	if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE,
-+	    MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
-+		return (-1);
-+
-+	if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE,
-+	    MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) {
-+		munmap(*rsp, sizeof(**rsp));
-+		return (-1);
-+	}
-+
-+	_ARC4_ATFORK(_rs_forkhandler);
-+	return (0);
-+}
-diff --git a/src/arc4random_osx.h b/src/arc4random_osx.h
-new file mode 100644
-index 0000000..14771a6
---- /dev/null
-+++ b/src/arc4random_osx.h
-@@ -0,0 +1,82 @@
-+/*	$OpenBSD: arc4random_osx.h,v 1.10 2015/09/11 11:52:55 deraadt Exp $	*/
-+
-+/*
-+ * Copyright (c) 1996, David Mazieres <dm@uun.org>
-+ * Copyright (c) 2008, Damien Miller <djm@openbsd.org>
-+ * Copyright (c) 2013, Markus Friedl <markus@openbsd.org>
-+ * Copyright (c) 2014, Theo de Raadt <deraadt@openbsd.org>
-+ *
-+ * Permission to use, copy, modify, and distribute this software for any
-+ * purpose with or without fee is hereby granted, provided that the above
-+ * copyright notice and this permission notice appear in all copies.
-+ *
-+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
-+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
-+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
-+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
-+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
-+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
-+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-+ */
-+
-+/*
-+ * Stub functions for portability.
-+ */
-+
-+#include <sys/mman.h>
-+
-+#include <unistd.h>
-+#include <pthread.h>
-+#include <signal.h>
-+
-+static pthread_mutex_t arc4random_mtx = PTHREAD_MUTEX_INITIALIZER;
-+#define _ARC4_LOCK()   pthread_mutex_lock(&arc4random_mtx)
-+#define _ARC4_UNLOCK() pthread_mutex_unlock(&arc4random_mtx)
-+
-+#define _ARC4_ATFORK(f) pthread_atfork(NULL, NULL, (f))
-+
-+static inline void
-+_getentropy_fail(void)
-+{
-+	raise(SIGKILL);
-+}
-+
-+static volatile sig_atomic_t _rs_forked;
-+
-+static inline void
-+_rs_forkhandler(void)
-+{
-+	_rs_forked = 1;
-+}
-+
-+static inline void
-+_rs_forkdetect(void)
-+{
-+	static pid_t _rs_pid = 0;
-+	pid_t pid = getpid();
-+
-+	if (_rs_pid == 0 || _rs_pid != pid || _rs_forked) {
-+		_rs_pid = pid;
-+		_rs_forked = 0;
-+		if (rs)
-+			memset(rs, 0, sizeof(*rs));
-+	}
-+}
-+
-+static inline int
-+_rs_allocate(struct _rs **rsp, struct _rsx **rsxp)
-+{
-+	if ((*rsp = mmap(NULL, sizeof(**rsp), PROT_READ|PROT_WRITE,
-+	    MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED)
-+		return (-1);
-+
-+	if ((*rsxp = mmap(NULL, sizeof(**rsxp), PROT_READ|PROT_WRITE,
-+	    MAP_ANON|MAP_PRIVATE, -1, 0)) == MAP_FAILED) {
-+		munmap(*rsp, sizeof(**rsp));
-+		*rsp = NULL;
-+		return (-1);
-+	}
-+
-+	_ARC4_ATFORK(_rs_forkhandler);
-+	return (0);
-+}
-diff --git a/src/fgetln.c b/src/fgetln.c
-index 4d1726e..9c73788 100644
---- a/src/fgetln.c
-+++ b/src/fgetln.c
-@@ -30,7 +30,9 @@
- #include <sys/types.h>
- #include <string.h>
- 
-+#if !defined(darwin) && !defined(__APPLE__) && !defined(MACOSX)
- #include "local-link.h"
-+#endif
- 
- #ifdef HAVE_GETLINE
- struct filebuf {
-@@ -75,9 +77,11 @@ fgetln(FILE *stream, size_t *len)
- 		return fb->buf;
- 	}
- }
-+#if !defined(darwin) && !defined(__APPLE__) && !defined(MACOSX)
- libbsd_link_warning(fgetln,
-                     "This functions cannot be safely ported, use getline(3) "
-                     "instead, as it is supported by GNU and POSIX.1-2008.")
-+#endif
- #else
- #error "Function fgetln() needs to be ported."
- #endif
+ 	arc4random.h \
 diff --git a/src/fpurge.c b/src/fpurge.c
-index 462535a..e7eb46f 100644
+index 462535a..a8941db 100644
 --- a/src/fpurge.c
 +++ b/src/fpurge.c
-@@ -26,9 +26,11 @@
+@@ -26,9 +26,10 @@
  
  #include <errno.h>
  #include <stdio.h>
-+#if HAVE___FPURGE
- #include <stdio_ext.h>
-+#endif
+-#include <stdio_ext.h>
  
--#ifdef HAVE___FPURGE
-+#ifdef HAVE___FPURGE                   /* glibc >= 2.2, Haiku, Solaris >= 7 */
+ #ifdef HAVE___FPURGE
++#include <stdio_ext.h>
++
  int
  fpurge(FILE *fp)
  {
-@@ -42,5 +44,55 @@ fpurge(FILE *fp)
+@@ -41,6 +42,36 @@ fpurge(FILE *fp)
+ 
  	return 0;
  }
- #else
--#error "Function fpurge() needs to be ported."
-+#define fp_ fp
-+//#error "Function fpurge() needs to be ported."
-+//#elif HAVE_FPURGE                   /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin 1.7 */
++/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin 1.7 */
++#elif HAVE_FPURGE
 +int
 +fpurge(FILE *fp)
 +{
@@ -501,12 +107,13 @@ index 462535a..e7eb46f 100644
 +	}
 +
 +  /* Call the system's fpurge function.  */
-+# undef fpurge
-+# if !HAVE_DECL_FPURGE
++#undef fpurge
++#if !HAVE_DECL_FPURGE
 +  extern int fpurge (FILE *);
-+# endif
++#endif
 +  int result = fpurge (fp);
-+# if defined __sferror || defined __DragonFly__ /* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
++/* FreeBSD, NetBSD, OpenBSD, DragonFly, Mac OS X, Cygwin */
++#if defined(__sferror) || defined(__DragonFly__)
 +  if (result == 0)
 +    /* Correct the invariants that fpurge broke.
 +       <stdio.h> on BSD systems says:
@@ -514,69 +121,35 @@ index 462535a..e7eb46f 100644
 +       If this invariant is not fulfilled and the stream is read-write but
 +       currently reading, subsequent putc or fputc calls will write directly
 +       into the buffer, although they shouldn't be allowed to.  */
-+    if ((fp_->_flags & __SRD) != 0)
-+      fp_->_w = 0;
++    if ((fp->_flags & __SRD) != 0)
++      fp->_w = 0;
 +#endif
 +  return result;
 +}
-+//#endif
-+#endif
-+
-+#ifdef TEST
-+int
-+main()
-+{
-+	static FILE fp_bad;
-+	FILE *fp;
-+
-+	if (fpurge(&fp_bad) == 0)
-+		return 1;
-+
-+	fp = fopen("/dev/zero", "r");
-+	if (fpurge(fp) < 0)
-+		return 1;
-+
-+	fclose(fp);
-+
-+	return 0;
-+}
+ #else
+ #error "Function fpurge() needs to be ported."
  #endif
 diff --git a/src/funopen.c b/src/funopen.c
-index 1e05c7e..75e61ea 100644
+index 1e05c7e..65ba5a8 100644
 --- a/src/funopen.c
 +++ b/src/funopen.c
 @@ -143,6 +143,7 @@ funopen(const void *cookie,
   * they will not add the needed support to implement it. Just ignore this
   * interface there, as it has never been provided anyway.
   */
-+#elif defined(darwin) || defined(__APPLE__) || defined(MACOSX)
++#elif defined(__MACH__)
  #else
  #error "Function funopen() needs to be ported or disabled."
  #endif
-diff --git a/src/getentropy.c b/src/getentropy.c
-index 3f11a1e..8a23a07 100644
---- a/src/getentropy.c
-+++ b/src/getentropy.c
-@@ -28,9 +28,7 @@
- #include "getentropy_linux.c"
- #elif defined(__GNU__)
- #include "getentropy_hurd.c"
--#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
--#include "getentropy_bsd.c"
--#elif defined(__NetBSD__)
-+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__)
- #include "getentropy_bsd.c"
- #elif defined(__sun)
- #include "getentropy_solaris.c"
 diff --git a/src/hash/sha512.h b/src/hash/sha512.h
-index 4f368a1..ab22fc1 100644
+index 4f368a1..7632e25 100644
 --- a/src/hash/sha512.h
 +++ b/src/hash/sha512.h
 @@ -29,7 +29,11 @@
  #ifndef _SHA512_H_
  #define _SHA512_H_
  
-+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
++#ifdef __MACH__
 +#include <stdint.h>
 +#else
  #include <sys/types.h>
@@ -585,16 +158,15 @@ index 4f368a1..ab22fc1 100644
  #define SHA512_DIGEST_LENGTH		64
  
 diff --git a/src/hash/sha512c.c b/src/hash/sha512c.c
-index b3c8d5e..f69013d 100644
+index b3c8d5e..602f54e 100644
 --- a/src/hash/sha512c.c
 +++ b/src/hash/sha512c.c
-@@ -25,7 +25,13 @@
+@@ -25,7 +25,12 @@
   */
  
  #include <sys/cdefs.h>
-+__FBSDID("$FreeBSD$");
 +
-+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
++#ifdef __MACH__
 +#include <machine/endian.h>
 +#else
  #include <sys/endian.h>
@@ -602,102 +174,188 @@ index b3c8d5e..f69013d 100644
  #include <sys/types.h>
  
  #include <string.h>
+diff --git a/src/local-link.h b/src/local-link.h
+index d518dcf..84694a2 100644
+--- a/src/local-link.h
++++ b/src/local-link.h
+@@ -27,7 +27,11 @@
+ #ifndef LIBBSD_LOCAL_LINK_H
+ #define LIBBSD_LOCAL_LINK_H
+ 
++#ifdef __MACH__
++#define libbsd_link_warning(symbol, msg)
++#else
+ #define libbsd_link_warning(symbol, msg) \
+ 	static const char libbsd_emit_link_warning_##symbol[] \
+ 		__attribute__((used,section(".gnu.warning." #symbol))) = msg;
+ #endif
++#endif
 diff --git a/src/nlist.c b/src/nlist.c
-index 0932f59..598a329 100644
+index 0932f59..4502048 100644
 --- a/src/nlist.c
 +++ b/src/nlist.c
-@@ -27,6 +27,10 @@
-  * SUCH DAMAGE.
-  */
+@@ -41,6 +41,7 @@
+ #include <unistd.h>
+ #include <nlist.h>
  
-+#if !defined(darwin) && !defined(__APPLE__) && !defined(MACOSX)
-+#if defined(LIBC_SCCS) && !defined(lint)
-+static char sccsid[] = "@(#)nlist.c	8.1 (Berkeley) 6/4/93";
-+#endif /* LIBC_SCCS and not lint */
- #include <sys/cdefs.h>
++#if !HAVE_NLIST_H
+ #include "local-elf.h"
  
- #include <sys/param.h>
-@@ -265,3 +269,4 @@ nlist(const char *name, struct nlist *list)
+ #define SIZE_T_MAX 0xffffffffU
+@@ -265,3 +266,4 @@ nlist(const char *name, struct nlist *list)
  	(void)close(fd);
  	return (n);
  }
-+#endif /* _NLIST_DO_ELF */
++#endif
+diff --git a/src/readpassphrase.c b/src/readpassphrase.c
+index f9f6195..2bc5fb4 100644
+--- a/src/readpassphrase.c
++++ b/src/readpassphrase.c
+@@ -36,6 +36,14 @@
+ #define TCSASOFT 0
+ #endif
+ 
++#ifndef _SIGMAX
++#define	_SIGMAX	64
++#endif
++
++#ifndef _NSIG
++#define _NSIG (_SIGMAX + 1)
++#endif
++
+ static volatile sig_atomic_t signo[_NSIG];
+ 
+ static void handler(int);
 diff --git a/src/setproctitle.c b/src/setproctitle.c
-index 038ac7d..d0ef01b 100644
+index 038ac7d..e9ee09c 100644
 --- a/src/setproctitle.c
 +++ b/src/setproctitle.c
-@@ -32,6 +32,11 @@
+@@ -32,6 +32,10 @@
  #include <unistd.h>
  #include <string.h>
  
-+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
-+#define __asm__(x)
++#ifdef __MACH__
 +extern char **environ;
 +#endif
 +
  static struct {
  	/* Original value. */
  	const char *arg0;
-@@ -287,7 +292,14 @@ __asm__(".symver setproctitle_impl,setproctitle@@LIBBSD_0.5");
+@@ -280,16 +284,22 @@ setproctitle_impl(const char *fmt, ...)
+ 		*++nul = '\0';
+ 	}
+ }
++#ifndef __MACH__
+ __asm__(".symver setproctitle_impl,setproctitle@@LIBBSD_0.5");
++#endif
+ 
+ /* The original function introduced in 0.2 was a stub, it only got implemented
+  * in 0.5, make the implementation available in the old version as an alias
   * for code linking against that version, and change the default to use the
   * new version, so that new code depends on the implemented version. */
- #ifdef HAVE_TYPEOF
-+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
-+//
-+// HACK: even weak aliasing breaks in clang so just comment this out for now
-+//
-+// extern typeof(setproctitle_impl) setproctitle_stub __attribute__((weak, alias("setproctitle_impl")));
-+#else
+-#ifdef HAVE_TYPEOF
++#ifdef __MACH__
++void setproctitle_stub(const char *fmt, ...);
++#elif HAVE_TYPEOF
  extern typeof(setproctitle_impl) setproctitle_stub __attribute__((alias("setproctitle_impl")));
-+#endif
  #else
  void setproctitle_stub(const char *fmt, ...)
  	__attribute__((alias("setproctitle_impl")));
+ #endif
++#ifndef __MACH__
+ __asm__(".symver setproctitle_stub,setproctitle@LIBBSD_0.2");
++#endif
 diff --git a/src/strlcat.c b/src/strlcat.c
-index 14c53a1..e01cb60 100644
+index 14c53a1..5961c17 100644
 --- a/src/strlcat.c
 +++ b/src/strlcat.c
-@@ -27,7 +27,11 @@
+@@ -26,6 +26,7 @@
+  * Returns strlen(src) + MIN(dsize, strlen(initial dst)).
   * If retval >= dsize, truncation occurred.
   */
++#if !HAVE_STRLCAT
  size_t
-+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
-+bsd_strlcat(char *dst, const char *src, size_t dsize)
-+#else
  strlcat(char *dst, const char *src, size_t dsize)
-+#endif
  {
- 	const char *odst = dst;
- 	const char *osrc = src;
+@@ -53,3 +54,4 @@ strlcat(char *dst, const char *src, size_t dsize)
+ 
+ 	return(dlen + (src - osrc));	/* count does not include NUL */
+ }
++#endif
 diff --git a/src/strlcpy.c b/src/strlcpy.c
-index e9a7fe4..10a855f 100644
+index e9a7fe4..5137acb 100644
 --- a/src/strlcpy.c
 +++ b/src/strlcpy.c
-@@ -25,7 +25,11 @@
+@@ -24,6 +24,7 @@
+  * chars will be copied.  Always NUL terminates (unless dsize == 0).
   * Returns strlen(src); if retval >= dsize, truncation occurred.
   */
++#if !HAVE_STRLCPY
  size_t
-+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
-+bsd_strlcpy(char *dst, const char *src, size_t dsize)
-+#else
  strlcpy(char *dst, const char *src, size_t dsize)
-+#endif
  {
- 	const char *osrc = src;
- 	size_t nleft = dsize;
+@@ -48,3 +49,4 @@ strlcpy(char *dst, const char *src, size_t dsize)
+ 
+ 	return(src - osrc - 1);	/* count does not include NUL */
+ }
++#endif
 diff --git a/src/strmode.c b/src/strmode.c
-index e6afde5..c463243 100644
+index e6afde5..da680c9 100644
 --- a/src/strmode.c
 +++ b/src/strmode.c
-@@ -33,7 +33,11 @@
+@@ -32,6 +32,7 @@
+ #include <sys/stat.h>
  #include <string.h>
  
++#if !HAVE_STRMODE
  void
-+#if defined(darwin) || defined(__APPLE__) || defined(MACOSX)
-+bsd_strmode(mode_t mode, char *p)
-+#else
  strmode(mode_t mode, char *p)
+ {
+@@ -141,3 +142,4 @@ strmode(mode_t mode, char *p)
+ 	*p++ = ' ';		/* will be a '+' if ACL's implemented */
+ 	*p = '\0';
+ }
++#endif
+diff --git a/src/unvis.c b/src/unvis.c
+index 94e3e7a..fba4c66 100644
+--- a/src/unvis.c
++++ b/src/unvis.c
+@@ -565,11 +565,15 @@ strnunvis_openbsd(char *dst, const char *src, size_t dlen)
+ {
+ 	return strnunvisx(dst, dlen, src, 0);
+ }
++#ifndef __MACH__
+ __asm__(".symver strnunvis_openbsd,strnunvis@@LIBBSD_0.2");
++#endif
+ 
+ int
+ strnunvis_netbsd(char *dst, size_t dlen, const char *src)
+ {
+ 	return strnunvisx(dst, dlen, src, 0);
+ }
++#ifndef __MACH__
+ __asm__(".symver strnunvis_netbsd,strnunvis@LIBBSD_0.9.1");
 +#endif
+diff --git a/src/vis.c b/src/vis.c
+index c2cd2d8..2d84330 100644
+--- a/src/vis.c
++++ b/src/vis.c
+@@ -723,14 +723,18 @@ strnvis_openbsd(char *mbdst, const char *mbsrc, size_t dlen, int flags)
  {
- 	 /* print type */
- 	switch (mode & S_IFMT) {
+ 	return istrsenvisxl(&mbdst, &dlen, mbsrc, flags, "", NULL);
+ }
++#ifndef __MACH__
+ __asm__(".symver strnvis_openbsd,strnvis@@LIBBSD_0.2");
++#endif
+ 
+ int
+ strnvis_netbsd(char *mbdst, size_t dlen, const char *mbsrc, int flags)
+ {
+ 	return istrsenvisxl(&mbdst, &dlen, mbsrc, flags, "", NULL);
+ }
++#ifndef __MACH__
+ __asm__(".symver strnvis_netbsd,strnvis@LIBBSD_0.9.1");
++#endif
+ 
+ int
+ stravis(char **mbdstp, const char *mbsrc, int flags)
diff --git a/pkgs/development/libraries/libbsd/default.nix b/pkgs/development/libraries/libbsd/default.nix
index 36410e842a5d..a8d1925e5c0d 100644
--- a/pkgs/development/libraries/libbsd/default.nix
+++ b/pkgs/development/libraries/libbsd/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "libbsd-${version}";
-  version = "0.8.7";
+  version = "0.9.1";
 
   src = fetchurl {
     url = "https://libbsd.freedesktop.org/releases/${name}.tar.xz";
-    sha256 = "0c9bl49zs0xdddcwj5dh0lay9sxi2m1yi74848g8p87mb87g2j7m";
+    sha256 = "1957w2wi7iqar978qlfsm220dwywnrh5m58nrnn9zmi74ds3bn2n";
   };
 
   # darwin changes configure.ac which means we need to regenerate
@@ -14,15 +14,8 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoreconfHook ];
 
   patches = stdenv.lib.optional stdenv.isDarwin ./darwin.patch
-    # Suitable for all, but limited to musl to avoid rebuilds
-    ++ stdenv.lib.optionals stdenv.hostPlatform.isMusl [
-      # https://cgit.freedesktop.org/libbsd/commit/?id=1f8a3f7bccfc84b195218ad0086ebd57049c3490
-      ./non-glibc.patch
-      # https://cgit.freedesktop.org/libbsd/commit/?id=11ec8f1e5dfa1c10e0c9fb94879b6f5b96ba52dd
-      ./cdefs.patch
-      # https://cgit.freedesktop.org/libbsd/commit/?id=b20272f5a966333b49fdf2bda797e2a9f0227404
-      ./features.patch
-  ];
+    # Suitable for all but limited to musl to avoid rebuild
+    ++ stdenv.lib.optional stdenv.hostPlatform.isMusl ./musl.patch;
 
   meta = with stdenv.lib; {
     description = "Common functions found on BSD systems";
diff --git a/pkgs/development/libraries/libbsd/features.patch b/pkgs/development/libraries/libbsd/features.patch
deleted file mode 100644
index 66bd1e9232ba..000000000000
--- a/pkgs/development/libraries/libbsd/features.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-From b20272f5a966333b49fdf2bda797e2a9f0227404 Mon Sep 17 00:00:00 2001
-From: Guillem Jover <guillem@hadrons.org>
-Date: Tue, 6 Mar 2018 01:42:52 +0100
-Subject: Remove <features.h> inclusion from <bsd/libutil.h>
-
-This is a non-portable header, and we should not assume it is present.
-Let the first system header pull it in if needed.
----
- include/bsd/libutil.h | 1 -
- 1 file changed, 1 deletion(-)
-
-diff --git a/include/bsd/libutil.h b/include/bsd/libutil.h
-index ccca29a..e5f148a 100644
---- a/include/bsd/libutil.h
-+++ b/include/bsd/libutil.h
-@@ -39,7 +39,6 @@
- #ifndef LIBBSD_LIBUTIL_H
- #define LIBBSD_LIBUTIL_H
- 
--#include <features.h>
- #ifdef LIBBSD_OVERLAY
- #include <sys/cdefs.h>
- #else
--- 
-cgit v1.1
-
diff --git a/pkgs/development/libraries/libbsd/musl.patch b/pkgs/development/libraries/libbsd/musl.patch
new file mode 100644
index 000000000000..fc07cfb6e855
--- /dev/null
+++ b/pkgs/development/libraries/libbsd/musl.patch
@@ -0,0 +1,14 @@
+Source: maxice8
+Upstream: no
+Reason: fixes compilation
+
+--- a/src/flopen.c
++++ b/src/flopen.c
+@@ -34,6 +34,7 @@
+ #include <errno.h>
+ #include <stdarg.h>
+ #include <unistd.h>
++#include <fcntl.h>
+ 
+ #include <libutil.h>
+ 
diff --git a/pkgs/development/libraries/libbsd/non-glibc.patch b/pkgs/development/libraries/libbsd/non-glibc.patch
deleted file mode 100644
index f61e0d242943..000000000000
--- a/pkgs/development/libraries/libbsd/non-glibc.patch
+++ /dev/null
@@ -1,74 +0,0 @@
-From 1f8a3f7bccfc84b195218ad0086ebd57049c3490 Mon Sep 17 00:00:00 2001
-From: Guillem Jover <guillem@hadrons.org>
-Date: Tue, 6 Mar 2018 01:39:45 +0100
-Subject: Fix function declaration protection for glibc already providing them
-MIME-Version: 1.0
-Content-Type: text/plain; charset=UTF-8
-Content-Transfer-Encoding: 8bit
-
-On non-glibc based systems we cannot unconditionally use the
-__GLIBC_PREREQ macro as it gets expanded before evaluation. Instead,
-if it is undefined, define it to 0.
-
-We should also always declare these functions on non-glibc based
-systems. And on systems with a new enough glibc, which provides these
-functions, we should still provide the declarations if _GNU_SOURCE
-is *not* defined.
-
-Reported-by: Jörg Krause <joerg.krause@embedded.rocks>
----
- include/bsd/stdlib.h    | 3 ++-
- include/bsd/string.h    | 3 ++-
- include/bsd/sys/cdefs.h | 8 ++++++++
- 3 files changed, 12 insertions(+), 2 deletions(-)
-
-diff --git a/include/bsd/stdlib.h b/include/bsd/stdlib.h
-index 8d33d1f..a5b063c 100644
---- a/include/bsd/stdlib.h
-+++ b/include/bsd/stdlib.h
-@@ -71,7 +71,8 @@ int sradixsort(const unsigned char **base, int nmemb,
-                const unsigned char *table, unsigned endbyte);
- 
- void *reallocf(void *ptr, size_t size);
--#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 26)
-+#if !defined(__GLIBC__) || \
-+    (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 26) || !defined(_GNU_SOURCE)))
- void *reallocarray(void *ptr, size_t nmemb, size_t size);
- #endif
- 
-diff --git a/include/bsd/string.h b/include/bsd/string.h
-index 29097f6..f987fee 100644
---- a/include/bsd/string.h
-+++ b/include/bsd/string.h
-@@ -46,7 +46,8 @@ size_t strlcat(char *dst, const char *src, size_t siz);
- char *strnstr(const char *str, const char *find, size_t str_len);
- void strmode(mode_t mode, char *str);
- 
--#if defined(_GNU_SOURCE) && defined(__GLIBC__) && !__GLIBC_PREREQ(2, 25)
-+#if !defined(__GLIBC__) || \
-+    (defined(__GLIBC__) && (!__GLIBC_PREREQ(2, 25) || !defined(_GNU_SOURCE)))
- void explicit_bzero(void *buf, size_t len);
- #endif
- __END_DECLS
-diff --git a/include/bsd/sys/cdefs.h b/include/bsd/sys/cdefs.h
-index b4c8f30..d1cc419 100644
---- a/include/bsd/sys/cdefs.h
-+++ b/include/bsd/sys/cdefs.h
-@@ -59,6 +59,14 @@
- #endif
- 
- /*
-+ * On non-glibc based systems, we cannot unconditionally use the
-+ * __GLIBC_PREREQ macro as it gets expanded before evaluation.
-+ */
-+#ifndef __GLIBC_PREREQ
-+#define __GLIBC_PREREQ(maj, min) 0
-+#endif
-+
-+/*
-  * Some kFreeBSD headers expect those macros to be set for sanity checks.
-  */
- #ifndef _SYS_CDEFS_H_
--- 
-cgit v1.1
-
diff --git a/pkgs/development/libraries/libcacard/default.nix b/pkgs/development/libraries/libcacard/default.nix
new file mode 100644
index 000000000000..f116360474e4
--- /dev/null
+++ b/pkgs/development/libraries/libcacard/default.nix
@@ -0,0 +1,22 @@
+{ stdenv, fetchurl, pkgconfig, glib, nss }:
+
+stdenv.mkDerivation rec {
+  name = "libcacard-${version}";
+  version = "2.6.1";
+
+  src = fetchurl {
+    url = "https://www.spice-space.org/download/libcacard/${name}.tar.xz";
+    sha256 = "1w6y0kiakhg7dgyf8yqpm4jj6jiv17zhy9lp3d7z32q1pniccxk2";
+  };
+
+  nativeBuildInputs = [ pkgconfig ];
+  buildInputs = [ glib nss ];
+
+  meta = with stdenv.lib; {
+    description = "Smart card emulation library";
+    homepage = https://gitlab.freedesktop.org/spice/libcacard;
+    license = licenses.lgpl21;
+    maintainers = with maintainers; [ yegortimoshenko ];
+    platforms = platforms.unix;
+  };
+}
diff --git a/pkgs/development/libraries/libdbusmenu-qt/default.nix b/pkgs/development/libraries/libdbusmenu-qt/default.nix
index 1342ee6773f7..72c3ca0e2b05 100644
--- a/pkgs/development/libraries/libdbusmenu-qt/default.nix
+++ b/pkgs/development/libraries/libdbusmenu-qt/default.nix
@@ -23,7 +23,7 @@ stdenv.mkDerivation {
   meta = with stdenv.lib; {
     description = "Provides a Qt implementation of the DBusMenu spec";
     inherit homepage;
-    maintainers = [ ];
     inherit (qt4.meta) platforms;
+    license = licenses.lgpl2;
   };
 }
diff --git a/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix b/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix
index 9c25757efb03..60572e7676b2 100644
--- a/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix
+++ b/pkgs/development/libraries/libdbusmenu-qt/qt-5.5.nix
@@ -19,5 +19,6 @@ stdenv.mkDerivation {
     description = "Provides a Qt implementation of the DBusMenu spec";
     maintainers = [ maintainers.ttuegel ];
     inherit (qtbase.meta) platforms;
+    license = licenses.lgpl2;
   };
 }
diff --git a/pkgs/development/libraries/libexttextcat/default.nix b/pkgs/development/libraries/libexttextcat/default.nix
index 8d264c929a5b..7b3df42c24c3 100644
--- a/pkgs/development/libraries/libexttextcat/default.nix
+++ b/pkgs/development/libraries/libexttextcat/default.nix
@@ -8,9 +8,10 @@ stdenv.mkDerivation rec {
     sha256 = "1j6sjwkyhqvsgyw938bxxfwkzzi1mahk66g5342lv6j89jfvrz8k";
   };
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "An N-Gram-Based Text Categorization library primarily intended for language guessing";
     homepage = https://wiki.documentfoundation.org/Libexttextcat;
-    platforms = stdenv.lib.platforms.all;
+    platforms = platforms.all;
+    license = licenses.bsd3;
   };
 }
diff --git a/pkgs/development/libraries/libgdiplus/default.nix b/pkgs/development/libraries/libgdiplus/default.nix
index 5e94d00dcdb7..d54f9203d23d 100644
--- a/pkgs/development/libraries/libgdiplus/default.nix
+++ b/pkgs/development/libraries/libgdiplus/default.nix
@@ -34,7 +34,10 @@ stdenv.mkDerivation rec {
     ln -s $out/lib/libgdiplus.0.dylib $out/lib/libgdiplus.so
   '';
 
-  meta = {
-    platforms = stdenv.lib.platforms.unix;
+  meta = with stdenv.lib; {
+    description = "Mono library that provides a GDI+-compatible API on non-Windows operating systems";
+    homepage = https://www.mono-project.com/docs/gui/libgdiplus/;
+    platforms = platforms.unix;
+    license = licenses.mit;
   };
 }
diff --git a/pkgs/development/libraries/libgnome-keyring/default.nix b/pkgs/development/libraries/libgnome-keyring/default.nix
index e7157afbaee5..8dcbab95e976 100644
--- a/pkgs/development/libraries/libgnome-keyring/default.nix
+++ b/pkgs/development/libraries/libgnome-keyring/default.nix
@@ -16,5 +16,6 @@ stdenv.mkDerivation {
 
   meta = {
     inherit (glib.meta) platforms maintainers;
+    license = with stdenv.lib.licenses; [ gpl2 lgpl2 ];
   };
 }
diff --git a/pkgs/development/libraries/libgnurl/default.nix b/pkgs/development/libraries/libgnurl/default.nix
index 33276b424e7c..752d2ce5a1e7 100644
--- a/pkgs/development/libraries/libgnurl/default.nix
+++ b/pkgs/development/libraries/libgnurl/default.nix
@@ -33,5 +33,6 @@ stdenv.mkDerivation rec {
     homepage    = https://gnunet.org/gnurl;
     maintainers = with maintainers; [ falsifian vrthra ];
     platforms = platforms.linux;
+    license = with licenses; [ bsdOriginal mit ];
   };
 }
diff --git a/pkgs/development/libraries/libharu/default.nix b/pkgs/development/libraries/libharu/default.nix
index 5d120f61e086..0830b45b308b 100644
--- a/pkgs/development/libraries/libharu/default.nix
+++ b/pkgs/development/libraries/libharu/default.nix
@@ -15,6 +15,6 @@ stdenv.mkDerivation {
     homepage = http://libharu.org/;
     license = stdenv.lib.licenses.zlib;
     maintainers = [ stdenv.lib.maintainers.marcweber ];
-    platforms = stdenv.lib.platforms.linux;
+    platforms = stdenv.lib.platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/libicns/default.nix b/pkgs/development/libraries/libicns/default.nix
index 08d80bcf9856..298d6124505c 100644
--- a/pkgs/development/libraries/libicns/default.nix
+++ b/pkgs/development/libraries/libicns/default.nix
@@ -10,7 +10,10 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libpng jasper ];
 
-  meta = {
-    platforms = stdenv.lib.platforms.unix;
+  meta = with stdenv.lib; {
+    description = "Library for manipulation of the Mac OS icns resource format";
+    homepage = https://icns.sourceforge.io;
+    license = with licenses; [ gpl2 lgpl2 lgpl21 ];
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/libiodbc/default.nix b/pkgs/development/libraries/libiodbc/default.nix
index 738c11161955..faa070b3468c 100644
--- a/pkgs/development/libraries/libiodbc/default.nix
+++ b/pkgs/development/libraries/libiodbc/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchurl, pkgconfig, gtk2, useGTK ? false }:
+{ stdenv, fetchurl, pkgconfig, gtk2, Carbon, useGTK ? false }:
 
 stdenv.mkDerivation rec {
   name = "libiodbc-3.52.12";
@@ -9,16 +9,18 @@ stdenv.mkDerivation rec {
   };
 
   nativeBuildInputs = [ pkgconfig ];
-  buildInputs = stdenv.lib.optionals useGTK [ gtk2 ];
+  buildInputs = stdenv.lib.optionals useGTK [ gtk2 ]
+                ++ stdenv.lib.optional stdenv.isDarwin Carbon;
 
   preBuild =
     ''
       export NIX_LDFLAGS_BEFORE="-rpath $out/lib"
     '';
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "iODBC driver manager";
     homepage = http://www.iodbc.org;
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.unix;
+    license = licenses.bsd3;
   };
 }
diff --git a/pkgs/development/libraries/libite/default.nix b/pkgs/development/libraries/libite/default.nix
index 7580c1b092e2..0b00cf90ba00 100644
--- a/pkgs/development/libraries/libite/default.nix
+++ b/pkgs/development/libraries/libite/default.nix
@@ -31,6 +31,7 @@ stdenv.mkDerivation rec {
     '';
     platforms = platforms.unix;
     maintainers = with maintainers; [ fpletz ];
+    license = with licenses; [ mit isc bsd2 bsd3 ];
   };
 }
 
diff --git a/pkgs/development/libraries/libjson/default.nix b/pkgs/development/libraries/libjson/default.nix
index a53918fd5f77..c83143dd6b13 100644
--- a/pkgs/development/libraries/libjson/default.nix
+++ b/pkgs/development/libraries/libjson/default.nix
@@ -11,10 +11,17 @@ in stdenv.mkDerivation rec {
   buildInputs = [ unzip ];
   makeFlags = [ "prefix=$(out)" ];
   preInstall = "mkdir -p $out/lib";
-  meta = {
+
+  meta = with stdenv.lib; {
     homepage = http://libjson.sourceforge.net/;
     description = "A JSON reader and writer";
-    longDescription = "A JSON reader and writer which is super-effiecient and usually runs circles around other JSON libraries. It's highly customizable to optimize for your particular project, and very lightweight. For Windows, OSX, or Linux. Works in any language.";
-    platforms = stdenv.lib.platforms.unix;
+    longDescription = ''
+      A JSON reader and writer which is super-efficient and
+      usually runs circles around other JSON libraries.
+      It's highly customizable to optimize for your particular project, and
+      very lightweight. For Windows, OSX, or Linux. Works in any language.
+    '';
+    platforms = platforms.unix;
+    license = licenses.bsd2;
   };
 }
diff --git a/pkgs/development/libraries/libkate/default.nix b/pkgs/development/libraries/libkate/default.nix
index 6c7e5881a784..7eff302397aa 100644
--- a/pkgs/development/libraries/libkate/default.nix
+++ b/pkgs/development/libraries/libkate/default.nix
@@ -10,7 +10,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ libogg libpng ];
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "A library for encoding and decoding Kate streams";
     longDescription = ''
       This is libkate, the reference implementation of a codec for the Kate
@@ -18,7 +18,7 @@ stdenv.mkDerivation rec {
       in an Ogg container. It can carry Unicode text, images, and animate
       them.'';
     homepage = https://code.google.com/archive/p/libkate/;
-    maintainers = [ ];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = platforms.unix;
+    license = licenses.bsd3;
   };
 }
diff --git a/pkgs/development/libraries/liblastfm/default.nix b/pkgs/development/libraries/liblastfm/default.nix
index 331422dd8929..b7d90100837c 100644
--- a/pkgs/development/libraries/liblastfm/default.nix
+++ b/pkgs/development/libraries/liblastfm/default.nix
@@ -18,11 +18,12 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig which cmake ];
   buildInputs = stdenv.lib.optional stdenv.isDarwin darwin.apple_sdk.frameworks.SystemConfiguration;
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = https://github.com/lastfm/liblastfm;
     repositories.git = git://github.com/lastfm/liblastfm.git;
     description = "Official LastFM library";
     inherit (qt4.meta) platforms;
-    maintainers = with stdenv.lib.maintainers; [ phreedom ];
+    maintainers =  [ maintainers.phreedom ];
+    license = licenses.gpl3;
   };
 }
diff --git a/pkgs/development/libraries/liblastfmSF/default.nix b/pkgs/development/libraries/liblastfmSF/default.nix
index 73d996c5ec86..d9f460d44e8c 100644
--- a/pkgs/development/libraries/liblastfmSF/default.nix
+++ b/pkgs/development/libraries/liblastfmSF/default.nix
@@ -15,5 +15,6 @@ stdenv.mkDerivation rec {
   meta = {
     homepage = http://liblastfm.sourceforge.net;
     description = "Unofficial C lastfm library";
+    license = stdenv.lib.licenses.gpl3;
   };
 }
diff --git a/pkgs/development/libraries/liblinear/default.nix b/pkgs/development/libraries/liblinear/default.nix
index ea05df45169f..5f295009b994 100644
--- a/pkgs/development/libraries/liblinear/default.nix
+++ b/pkgs/development/libraries/liblinear/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "liblinear-${version}";
-  version = "2.20";
+  version = "2.21";
 
   src = fetchurl {
     url = "https://www.csie.ntu.edu.tw/~cjlin/liblinear/liblinear-${version}.tar.gz";
-    sha256 = "13q48azqy9pd8jyhk0c2hzj5xav1snbdrj8pp38vwrv2wwhfz7rz";
+    sha256 = "0jp0z3s32czf748i6dnlabs1psqx1dcn9w96c56m24xq5l789chs";
   };
 
   buildPhase = ''
diff --git a/pkgs/development/libraries/liblqr-1/default.nix b/pkgs/development/libraries/liblqr-1/default.nix
index 4b445c93175f..aa6922ea3421 100644
--- a/pkgs/development/libraries/liblqr-1/default.nix
+++ b/pkgs/development/libraries/liblqr-1/default.nix
@@ -15,6 +15,6 @@ stdenv.mkDerivation rec {
     homepage = http://liblqr.wikidot.com;
     description = "Seam-carving C/C++ library called Liquid Rescaling";
     platforms = platforms.all;
-    maintainers = [ ];
+    license = with licenses; [ gpl3 lgpl3 ];
   };
 }
diff --git a/pkgs/development/libraries/libmilter/default.nix b/pkgs/development/libraries/libmilter/default.nix
index bd0cd9fe9041..7e3c45634d9e 100644
--- a/pkgs/development/libraries/libmilter/default.nix
+++ b/pkgs/development/libraries/libmilter/default.nix
@@ -37,5 +37,6 @@ stdenv.mkDerivation rec {
     description = "Sendmail Milter mail filtering API library";
     platforms = platforms.unix;
     maintainers = with maintainers; [ fpletz ];
+    license = licenses.sendmail;
   };
 }
diff --git a/pkgs/development/libraries/libmms/default.nix b/pkgs/development/libraries/libmms/default.nix
index d1dd7860de4e..7f73fb09cd16 100644
--- a/pkgs/development/libraries/libmms/default.nix
+++ b/pkgs/development/libraries/libmms/default.nix
@@ -12,9 +12,10 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig ];
 
-  meta = {
+  meta = with stdenv.lib; {
+    description = "Library for downloading (streaming) media files using the mmst and mmsh protocols";
     homepage = http://libmms.sourceforge.net;
-    maintainers = [ ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = platforms.all;
+    license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/libraries/libmp3splt/default.nix b/pkgs/development/libraries/libmp3splt/default.nix
index af8297e98549..52072000115c 100644
--- a/pkgs/development/libraries/libmp3splt/default.nix
+++ b/pkgs/development/libraries/libmp3splt/default.nix
@@ -19,5 +19,6 @@ stdenv.mkDerivation rec {
     description = "Utility to split mp3, ogg vorbis and FLAC files without decoding";
     maintainers = with maintainers; [ bosu ];
     platforms   = platforms.unix;
+    license = licenses.gpl2;
   };
 }
diff --git a/pkgs/development/libraries/libmtp/default.nix b/pkgs/development/libraries/libmtp/default.nix
index c3061626a6ae..1d8dd7e20f14 100644
--- a/pkgs/development/libraries/libmtp/default.nix
+++ b/pkgs/development/libraries/libmtp/default.nix
@@ -17,7 +17,7 @@ stdenv.mkDerivation rec {
   # tried to install files to /lib/udev, hopefully OK
   configureFlags = [ "--with-udev=$$bin/lib/udev" ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://libmtp.sourceforge.net;
     description = "An implementation of Microsoft's Media Transfer Protocol";
     longDescription = ''
@@ -25,7 +25,7 @@ stdenv.mkDerivation rec {
       in the form of a library suitable primarily for POSIX compliant operating
       systems. We implement MTP Basic, the stuff proposed for standardization.
       '';
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = [ ];
+    platforms = platforms.unix;
+    license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/libraries/libmusicbrainz/5.x.nix b/pkgs/development/libraries/libmusicbrainz/5.x.nix
index f197d5bcef98..2b59adf8f922 100644
--- a/pkgs/development/libraries/libmusicbrainz/5.x.nix
+++ b/pkgs/development/libraries/libmusicbrainz/5.x.nix
@@ -16,14 +16,14 @@ stdenv.mkDerivation rec {
 
   dontUseCmakeBuildDir=true;
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://musicbrainz.org/doc/libmusicbrainz;
     description = "MusicBrainz Client Library (5.x version)";
     longDescription = ''
       The libmusicbrainz (also known as mb_client or MusicBrainz Client
       Library) is a development library geared towards developers who wish to
       add MusicBrainz lookup capabilities to their applications.'';
-    maintainers = [ ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = platforms.all;
+    license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/libraries/libmusicbrainz/default.nix b/pkgs/development/libraries/libmusicbrainz/default.nix
index 596399c4fa8f..5335b6577f0a 100644
--- a/pkgs/development/libraries/libmusicbrainz/default.nix
+++ b/pkgs/development/libraries/libmusicbrainz/default.nix
@@ -10,14 +10,14 @@ stdenv.mkDerivation rec {
     sha256 = "1i9qly13bwwmgj68vma766hgvsd1m75236haqsp9zgh5znlmkm3z";
   };
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://musicbrainz.org/doc/libmusicbrainz;
     description = "MusicBrainz Client Library (3.x version)";
     longDescription = ''
       The libmusicbrainz (also known as mb_client or MusicBrainz Client
       Library) is a development library geared towards developers who wish to
       add MusicBrainz lookup capabilities to their applications.'';
-    maintainers = [ ];
-    platforms = stdenv.lib.platforms.all;
+    platforms = platforms.all;
+    license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/libraries/libnatspec/default.nix b/pkgs/development/libraries/libnatspec/default.nix
index 9b692e9e3b2e..db4f6f5d4688 100644
--- a/pkgs/development/libraries/libnatspec/default.nix
+++ b/pkgs/development/libraries/libnatspec/default.nix
@@ -12,11 +12,11 @@ stdenv.mkDerivation (rec {
 
   buildInputs = [ popt ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://natspec.sourceforge.net/ ;
     description = "A library intended to smooth national specificities in using of programs";
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = [ ];
+    platforms = platforms.unix;
+    license = licenses.lgpl21;
   };
 } // stdenv.lib.optionalAttrs (!stdenv.isLinux) {
   propagatedBuildInputs = [ libiconv ];
diff --git a/pkgs/development/libraries/libnetfilter_queue/default.nix b/pkgs/development/libraries/libnetfilter_queue/default.nix
index 12a45d088ef6..94b3dc90a0b6 100644
--- a/pkgs/development/libraries/libnetfilter_queue/default.nix
+++ b/pkgs/development/libraries/libnetfilter_queue/default.nix
@@ -12,10 +12,10 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig ];
   buildInputs = [ libmnl libnfnetlink ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://www.netfilter.org/projects/libnetfilter_queue/;
     description = "Userspace API to packets queued by the kernel packet filter";
-
-    platforms = stdenv.lib.platforms.linux;
+    license = licenses.gpl2;
+    platforms = platforms.linux;
   };
 }
diff --git a/pkgs/development/libraries/libnice/default.nix b/pkgs/development/libraries/libnice/default.nix
index 1f58545574cd..8582dc4e1d90 100644
--- a/pkgs/development/libraries/libnice/default.nix
+++ b/pkgs/development/libraries/libnice/default.nix
@@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # fails with "fatal error: nice/agent.h: No such file or directory"
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = https://nice.freedesktop.org/wiki/;
     description = "The GLib ICE implementation";
     longDescription = ''
@@ -24,6 +24,7 @@ stdenv.mkDerivation rec {
 
       It provides a GLib-based library, libnice and a Glib-free library,
       libstun as well as GStreamer elements.'';
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.linux;
+    license = with licenses; [ lgpl21 mpl11 ];
   };
 }
diff --git a/pkgs/development/libraries/libnotify/default.nix b/pkgs/development/libraries/libnotify/default.nix
index fbde49a54d08..11f2731eb725 100644
--- a/pkgs/development/libraries/libnotify/default.nix
+++ b/pkgs/development/libraries/libnotify/default.nix
@@ -17,9 +17,10 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ pkgconfig autoreconfHook gobjectIntrospection ];
   buildInputs = [ glib gdk_pixbuf ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = https://developer.gnome.org/notification-spec/;
     description = "A library that sends desktop notifications to a notification daemon";
-    platforms = stdenv.lib.platforms.unix;
+    platforms = platforms.unix;
+    license = licenses.lgpl21;
   };
 }
diff --git a/pkgs/development/libraries/libnova/default.nix b/pkgs/development/libraries/libnova/default.nix
index a66a1a88c743..cb70d803ac0c 100644
--- a/pkgs/development/libraries/libnova/default.nix
+++ b/pkgs/development/libraries/libnova/default.nix
@@ -2,15 +2,16 @@
 
 stdenv.mkDerivation rec {
   name = "libnova-0.12.3";
-	
+
   src = fetchurl {
     url = "mirror://sourceforge/libnova/${name}.tar.gz";
     sha256 = "18mkx79gyhccp5zqhf6k66sbhv97s7839sg15534ijajirkhw9dc";
   };
-  
-  meta = {
+
+  meta = with stdenv.lib; {
     description = "Celestial Mechanics, Astrometry and Astrodynamics Library";
     homepage = http://libnova.sf.net;
-    platforms = stdenv.lib.platforms.unix;
+    platforms = platforms.unix;
+    license = licenses.gpl2;
   };
 }
diff --git a/pkgs/development/libraries/liboauth/default.nix b/pkgs/development/libraries/liboauth/default.nix
index 855d921206e9..ea792b007bae 100644
--- a/pkgs/development/libraries/liboauth/default.nix
+++ b/pkgs/development/libraries/liboauth/default.nix
@@ -25,6 +25,7 @@ stdenv.mkDerivation rec {
     description = "C library implementing the OAuth secure authentication protocol";
     homepage = http://liboauth.sourceforge.net/;
     repositories.git = https://github.com/x42/liboauth.git;
+    license = licenses.mit;
   };
 
 }
diff --git a/pkgs/development/libraries/libofa/default.nix b/pkgs/development/libraries/libofa/default.nix
index 531e30ba7552..8131420cfd65 100644
--- a/pkgs/development/libraries/libofa/default.nix
+++ b/pkgs/development/libraries/libofa/default.nix
@@ -27,12 +27,13 @@ stdenv.mkDerivation rec {
 
   propagatedBuildInputs = [ expat curl fftw ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = https://code.google.com/archive/p/musicip-libofa/;
     description = "Library Open Fingerprint Architecture";
     longDescription = ''
       LibOFA (Library Open Fingerprint Architecture) is an open-source audio
       fingerprint created and provided by MusicIP'';
-    platforms = stdenv.lib.platforms.linux;
+    platforms = platforms.linux;
+    license = licenses.gpl2;
   };
 }
diff --git a/pkgs/development/libraries/liboggz/default.nix b/pkgs/development/libraries/liboggz/default.nix
index f6fe9ecd03a0..d7c3b747924a 100644
--- a/pkgs/development/libraries/liboggz/default.nix
+++ b/pkgs/development/libraries/liboggz/default.nix
@@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
 
   nativeBuildInputs = [ pkgconfig ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = https://xiph.org/oggz/;
     description = "A C library and tools for manipulating with Ogg files and streams";
     longDescription = ''
@@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
       interleaving data container developed by Monty at Xiph.Org, originally to
       support the Ogg Vorbis audio format but now used for many free codecs
       including Dirac, FLAC, Speex and Theora.'';
-    maintainers = [ ];
-    platforms = stdenv.lib.platforms.unix;
+    platforms = platforms.unix;
+    license = licenses.bsd3;
   };
 }
diff --git a/pkgs/development/libraries/libpcap/default.nix b/pkgs/development/libraries/libpcap/default.nix
index f94f327ea02e..267859cb217c 100644
--- a/pkgs/development/libraries/libpcap/default.nix
+++ b/pkgs/development/libraries/libpcap/default.nix
@@ -50,5 +50,6 @@ stdenv.mkDerivation rec {
     description = "Packet Capture Library";
     platforms = platforms.unix;
     maintainers = with maintainers; [ fpletz ];
+    license = licenses.bsd3;
   };
 }
diff --git a/pkgs/development/libraries/libpqxx/default.nix b/pkgs/development/libraries/libpqxx/default.nix
index 5afed2b2a2f5..fbee81ab677a 100644
--- a/pkgs/development/libraries/libpqxx/default.nix
+++ b/pkgs/development/libraries/libpqxx/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "libpqxx-${version}";
-  version = "6.2.4";
+  version = "6.2.5";
 
   src = fetchFromGitHub {
     owner = "jtv";
     repo = "libpqxx";
     rev = version;
-    sha256 = "18fkyfa3a917ljmarf3jy8ycdhqzpc47cj87542sjpxnpaj9hy59";
+    sha256 = "15x9xlj2v66w81j90cb438qkrrcqaq4dqrvhllwyqfz4lprqnhh9";
   };
 
   nativeBuildInputs = [ gnused python2 ];
diff --git a/pkgs/development/libraries/libqalculate/default.nix b/pkgs/development/libraries/libqalculate/default.nix
index 377d9fe50be7..2c25d4181196 100644
--- a/pkgs/development/libraries/libqalculate/default.nix
+++ b/pkgs/development/libraries/libqalculate/default.nix
@@ -42,6 +42,7 @@ stdenv.mkDerivation rec {
     description = "An advanced calculator library";
     homepage = http://qalculate.github.io;
     maintainers = with maintainers; [ gebner ];
+    license = licenses.gpl2Plus;
     platforms = platforms.all;
   };
 }
diff --git a/pkgs/development/libraries/libraw/default.nix b/pkgs/development/libraries/libraw/default.nix
index 9803e09610e6..e009a9f920b1 100644
--- a/pkgs/development/libraries/libraw/default.nix
+++ b/pkgs/development/libraries/libraw/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "libraw-${version}";
-  version = "0.18.12";
+  version = "0.19.0";
 
   src = fetchurl {
     url = "https://www.libraw.org/data/LibRaw-${version}.tar.gz";
-    sha256 = "1m2khr2cij8z6lawgbmdksjn14fpnjsy8ad4qahnpqapm1slsxap";
+    sha256 = "0nfj7s7qmgfy1cl8s3ck7dxjvprfq5glfi6iidmvmy8r7gl52gz8";
   };
 
   outputs = [ "out" "lib" "dev" "doc" ];
diff --git a/pkgs/development/libraries/librdf/redland.nix b/pkgs/development/libraries/librdf/redland.nix
index 422ace462a94..30d8d8a94e9d 100644
--- a/pkgs/development/libraries/librdf/redland.nix
+++ b/pkgs/development/libraries/librdf/redland.nix
@@ -38,8 +38,10 @@ stdenv.mkDerivation rec {
 
   doCheck = false; # fails 1 out of 17 tests with a segmentation fault
 
-  meta = {
+  meta = with stdenv.lib; {
+    description = "C libraries that provide support for the Resource Description Framework (RDF)";
     homepage = http://librdf.org/;
-    platforms = stdenv.lib.platforms.unix;
+    platforms = platforms.unix;
+    license = licenses.asl20;
   };
 }
diff --git a/pkgs/development/libraries/librealsense/default.nix b/pkgs/development/libraries/librealsense/default.nix
index ea24c9da88b9..f91fa192c034 100644
--- a/pkgs/development/libraries/librealsense/default.nix
+++ b/pkgs/development/libraries/librealsense/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "librealsense-${version}";
-  version = "2.15.0";
+  version = "2.16.1";
 
   src = fetchFromGitHub {
     owner = "IntelRealSense";
     repo = "librealsense";
     rev = "v${version}";
-    sha256 = "12918gcn0w5h6bqgx6s44w44bs1x2pcndn2833xzya69rddkdv6x";
+    sha256 = "0vs2vcfmsb574bvdqrfgdmam0p631c738apk0w9mjdqk59zy1bz2";
   };
 
   buildInputs = [
diff --git a/pkgs/development/libraries/libssh/default.nix b/pkgs/development/libraries/libssh/default.nix
index 9b5c3d530ebf..1ec15e88f13d 100644
--- a/pkgs/development/libraries/libssh/default.nix
+++ b/pkgs/development/libraries/libssh/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, fetchpatch, pkgconfig, cmake, zlib, openssl, libsodium }:
 
 stdenv.mkDerivation rec {
-  name = "libssh-0.7.5";
+  name = "libssh-0.7.6";
 
   src = fetchurl {
-    url = "https://red.libssh.org/attachments/download/218/${name}.tar.xz";
-    sha256 = "15bh6dm9c50ndddzh3gqcgw7axp3ghrspjpkb1z3dr90vkanvs2l";
+    url = "https://www.libssh.org/files/0.7/libssh-0.7.6.tar.xz";
+    sha256 = "14hhdpn2hflywsi9d5bz2pfjxqkyi07znjij89cpakr7b4w7sq0x";
   };
 
   patches = [
diff --git a/pkgs/development/libraries/libssh2/default.nix b/pkgs/development/libraries/libssh2/default.nix
index a6802a7f5183..b050dede8c61 100644
--- a/pkgs/development/libraries/libssh2/default.nix
+++ b/pkgs/development/libraries/libssh2/default.nix
@@ -13,10 +13,11 @@ stdenv.mkDerivation rec {
   buildInputs = [ openssl zlib ]
     ++ stdenv.lib.optional stdenv.hostPlatform.isMinGW windows.mingw_w64;
 
-  meta = {
+  meta = with stdenv.lib; {
     description = "A client-side C library implementing the SSH2 protocol";
     homepage = https://www.libssh2.org;
-    platforms = stdenv.lib.platforms.all;
+    platforms = platforms.all;
+    license = licenses.bsd3;
     maintainers = [ ];
   };
 }
diff --git a/pkgs/development/libraries/libtiger/default.nix b/pkgs/development/libraries/libtiger/default.nix
index bd0084dbaaf7..7a72fa2b7a31 100644
--- a/pkgs/development/libraries/libtiger/default.nix
+++ b/pkgs/development/libraries/libtiger/default.nix
@@ -16,6 +16,7 @@ stdenv.mkDerivation rec {
     homepage = https://code.google.com/archive/p/libtiger/;
     description = "A rendering library for Kate streams using Pango and Cairo";
     platforms = lib.platforms.unix;
+    license = lib.licenses.lgpl21Plus;
     maintainers = with lib.maintainers; [ matthewbauer ];
   };
 }
diff --git a/pkgs/development/libraries/libtorrent-rasterbar/default.nix b/pkgs/development/libraries/libtorrent-rasterbar/default.nix
index f19e9d274313..6b5182fa992f 100644
--- a/pkgs/development/libraries/libtorrent-rasterbar/default.nix
+++ b/pkgs/development/libraries/libtorrent-rasterbar/default.nix
@@ -3,7 +3,7 @@
 }:
 
 let
-  version = "1.1.9";
+  version = "1.1.10";
   formattedVersion = lib.replaceChars ["."] ["_"] version;
 
   # Make sure we override python, so the correct version is chosen
@@ -17,7 +17,7 @@ in stdenv.mkDerivation {
     owner = "arvidn";
     repo = "libtorrent";
     rev = "libtorrent-${formattedVersion}";
-    sha256 = "04w3pjzd6q9wplj1dcphylxn1i2b2x0iw1l0ma58ymh14swdah7a";
+    sha256 = "0qj1rz52jk95m43cr7l3fi9jmf4pwxncp5mq4hi2vzacfnf79yms";
   };
 
   enableParallelBuilding = true;
diff --git a/pkgs/development/libraries/libtoxcore/default.nix b/pkgs/development/libraries/libtoxcore/default.nix
index b3636eef2621..4a8dfc40d4a1 100644
--- a/pkgs/development/libraries/libtoxcore/default.nix
+++ b/pkgs/development/libraries/libtoxcore/default.nix
@@ -49,7 +49,7 @@ in rec {
   };
 
   libtoxcore_0_2 = generic {
-    version = "0.2.3";
-    sha256 = "1z8638cmxssc4jvbf64x549m84pz28729xbxc4c4ss1k792x30ya";
+    version = "0.2.8";
+    sha256 = "0xgnraysz25fbws5zwjk92mwnl8k1yih701qam8kgm3rxh50kyhm";
   };
 }
diff --git a/pkgs/development/libraries/libtxc_dxtn/default.nix b/pkgs/development/libraries/libtxc_dxtn/default.nix
index 21e3a15449c2..b0be3cb3c12d 100644
--- a/pkgs/development/libraries/libtxc_dxtn/default.nix
+++ b/pkgs/development/libraries/libtxc_dxtn/default.nix
@@ -13,9 +13,10 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ autoreconfHook ];
   buildInputs = [ libGLU_combined ];
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = http://dri.freedesktop.org/wiki/S3TC;
     repositories.git = git://people.freedesktop.org/~mareko/libtxc_dxtn;
-    platforms = stdenv.lib.platforms.unix;
+    license = licenses.mit;
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/libui/default.nix b/pkgs/development/libraries/libui/default.nix
index b1e6938a1494..9eb2fe04fe68 100644
--- a/pkgs/development/libraries/libui/default.nix
+++ b/pkgs/development/libraries/libui/default.nix
@@ -49,9 +49,10 @@ in
       install_name_tool -id $out/lib/${shortName}.A.dylib $out/lib/${shortName}.A.dylib
     '';
 
-    meta = {
+    meta = with stdenv.lib; {
       homepage    = https://github.com/andlabs/libui;
       description = "Simple and portable (but not inflexible) GUI library in C that uses the native GUI technologies of each platform it supports.";
-      platforms   = stdenv.lib.platforms.unix;
+      license     = licenses.mit;
+      platforms   = platforms.unix;
     };
   }
diff --git a/pkgs/development/libraries/libusb/default.nix b/pkgs/development/libraries/libusb/default.nix
index 4704a1e5c331..adf354c45f2e 100644
--- a/pkgs/development/libraries/libusb/default.nix
+++ b/pkgs/development/libraries/libusb/default.nix
@@ -16,7 +16,15 @@ stdenv.mkDerivation {
 
   patches = stdenv.lib.optional stdenv.hostPlatform.isMusl ./fix-headers.patch;
 
-  meta = {
-    platforms = stdenv.lib.platforms.unix;
+  meta = with stdenv.lib; {
+    homepage = "https://libusb.info/";
+    repositories.git = "https://github.com/libusb/libusb-compat-0.1";
+    description = "cross-platform user-mode USB device library";
+    longDescription = ''
+      libusb is a cross-platform user-mode library that provides access to USB devices.
+      The current API is of 1.0 version (libusb-1.0 API), this library is a wrapper exposing the legacy API.
+    '';
+    license = licenses.lgpl2Plus;
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/libusb1/default.nix b/pkgs/development/libraries/libusb1/default.nix
index 7ec714f02237..ac5c38a34f11 100644
--- a/pkgs/development/libraries/libusb1/default.nix
+++ b/pkgs/development/libraries/libusb1/default.nix
@@ -21,10 +21,15 @@ stdenv.mkDerivation rec {
     sed 's,-ludev,-L${systemd.lib}/lib -ludev,' -i $out/lib/libusb-1.0.la
   '';
 
-  meta = {
-    homepage = http://www.libusb.info;
-    description = "User-space USB library";
-    platforms = stdenv.lib.platforms.all;
+  meta = with stdenv.lib; {
+    homepage = "https://libusb.info/";
+    repositories.git = "https://github.com/libusb/libusb";
+    description = "cross-platform user-mode USB device library";
+    longDescription = ''
+      libusb is a cross-platform user-mode library that provides access to USB devices.
+    '';
+    platforms = platforms.all;
+    license = licenses.lgpl21Plus;
     maintainers = [ ];
   };
 }
diff --git a/pkgs/development/libraries/libuv/default.nix b/pkgs/development/libraries/libuv/default.nix
index 73d2db8e9993..e608ea300d1a 100644
--- a/pkgs/development/libraries/libuv/default.nix
+++ b/pkgs/development/libraries/libuv/default.nix
@@ -1,14 +1,14 @@
 { stdenv, lib, fetchpatch, fetchFromGitHub, autoconf, automake, libtool, pkgconfig }:
 
 stdenv.mkDerivation rec {
-  version = "1.23.0";
+  version = "1.23.1";
   name = "libuv-${version}";
 
   src = fetchFromGitHub {
     owner = "libuv";
     repo = "libuv";
     rev = "v${version}";
-    sha256 = "1yfx99f7qnq3qvcgbnih27dgwfg6c51xw6n6n2c3c1wb3mh95im0";
+    sha256 = "14h8dcyx81sbckbgmqhagncyz8s6z6qzpx0fy8p79whq5hb3f4jg";
   };
 
   patches = [
diff --git a/pkgs/development/libraries/libwacom/default.nix b/pkgs/development/libraries/libwacom/default.nix
index cc3f19ab7d31..67563e41d01f 100644
--- a/pkgs/development/libraries/libwacom/default.nix
+++ b/pkgs/development/libraries/libwacom/default.nix
@@ -14,7 +14,8 @@ stdenv.mkDerivation rec {
 
   meta = with stdenv.lib; {
     platforms = platforms.linux;
-    homepage = https://sourceforge.net/projects/linuxwacom/;
+    homepage = https://linuxwacom.github.io/;
     description = "Libraries, configuration, and diagnostic tools for Wacom tablets running under Linux";
+    license = licenses.mit;
   };
 }
diff --git a/pkgs/development/libraries/lirc/default.nix b/pkgs/development/libraries/lirc/default.nix
index ad6d2df1d8bd..13fbe2b55b67 100644
--- a/pkgs/development/libraries/lirc/default.nix
+++ b/pkgs/development/libraries/lirc/default.nix
@@ -1,5 +1,5 @@
-{ stdenv, fetchurl, alsaLib, help2man, pkgconfig, xlibsWrapper, python3
-, libxslt, systemd, libusb, libftdi1 }:
+{ stdenv, fetchurl, fetchpatch, autoreconfHook, pkgconfig, help2man, python3,
+  alsaLib, xlibsWrapper, libxslt, systemd, libusb, libftdi1 }:
 
 stdenv.mkDerivation rec {
   name = "lirc-0.10.1";
@@ -9,6 +9,12 @@ stdenv.mkDerivation rec {
     sha256 = "1whlyifvvc7w04ahq07nnk1h18wc8j7c6wnvlb6mszravxh3qxcb";
   };
 
+  # Fix installation of Python bindings
+  patches = [ (fetchpatch {
+    url = "https://sourceforge.net/p/lirc/tickets/339/attachment/0001-Fix-Python-bindings.patch";
+    sha256 = "088a39x8c1qd81qwvbiqd6crb2lk777wmrs8rdh1ga06lglyvbly";
+  }) ];
+
   postPatch = ''
     patchShebangs .
 
@@ -24,17 +30,17 @@ stdenv.mkDerivation rec {
     touch lib/lirc/input_map.inc
   '';
 
-  nativeBuildInputs = [ pkgconfig help2man ];
+  nativeBuildInputs = [ autoreconfHook pkgconfig help2man
+    (python3.withPackages (p: with p; [ pyyaml setuptools ])) ];
 
-  buildInputs = [ alsaLib xlibsWrapper libxslt systemd libusb libftdi1 ]
-  ++ (with python3.pkgs; [ python pyyaml setuptools ]);
+  buildInputs = [ alsaLib xlibsWrapper libxslt systemd libusb libftdi1 ];
 
   configureFlags = [
     "--sysconfdir=/etc"
     "--localstatedir=/var"
     "--with-systemdsystemunitdir=$(out)/lib/systemd/system"
-    "--enable-uinput" # explicite activation because build env has no uinput
-    "--enable-devinput" # explicite activation because build env has not /dev/input
+    "--enable-uinput" # explicit activation because build env has no uinput
+    "--enable-devinput" # explicit activation because build env has no /dev/input
   ];
 
   installFlags = [
diff --git a/pkgs/development/libraries/mapnik/default.nix b/pkgs/development/libraries/mapnik/default.nix
index ebae2a6c3be0..693260af1c76 100644
--- a/pkgs/development/libraries/mapnik/default.nix
+++ b/pkgs/development/libraries/mapnik/default.nix
@@ -8,12 +8,12 @@
 
 stdenv.mkDerivation rec {
   name = "mapnik-${version}";
-  version = "3.0.20";
+  version = "3.0.21";
 
   src = fetchzip {
     # this one contains all git submodules and is cheaper than fetchgit
     url = "https://github.com/mapnik/mapnik/releases/download/v${version}/mapnik-v${version}.tar.bz2";
-    sha256 = "05a2hvvk5s4x3wjvh4spd717vd5ri7h0sql7aarpi9jpc5h6xicc";
+    sha256 = "0cq2gbmf1sssg72sq4b5s3x1z6wvl1pzxliymm06flw5bpim5as2";
   };
 
   # a distinct dev output makes python-mapnik fail
diff --git a/pkgs/development/libraries/mesa/default.nix b/pkgs/development/libraries/mesa/default.nix
index aca9a237b0c7..ff45162c5a89 100644
--- a/pkgs/development/libraries/mesa/default.nix
+++ b/pkgs/development/libraries/mesa/default.nix
@@ -67,7 +67,7 @@ let
 in
 
 let
-  version = "18.2.1";
+  version = "18.2.2";
   branch  = head (splitString "." version);
 in
 
@@ -81,7 +81,7 @@ let self = stdenv.mkDerivation {
       "ftp://ftp.freedesktop.org/pub/mesa/older-versions/${branch}.x/${version}/mesa-${version}.tar.xz"
       "https://mesa.freedesktop.org/archive/mesa-${version}.tar.xz"
     ];
-    sha256 = "0mhhr1id11s1fbdxbvr4a81xjh1nsznpra9dl36bv2hq7mpxqdln";
+    sha256 = "1i3ky3d210vi3f5hlr9la1kspdyv093npndxsbzdklw95aqq5fn3";
   };
 
   prePatch = "patchShebangs .";
diff --git a/pkgs/development/libraries/msgpack/generic.nix b/pkgs/development/libraries/msgpack/generic.nix
index 306becf0c180..de277329961b 100644
--- a/pkgs/development/libraries/msgpack/generic.nix
+++ b/pkgs/development/libraries/msgpack/generic.nix
@@ -15,8 +15,6 @@ stdenv.mkDerivation rec {
   cmakeFlags = []
     ++ stdenv.lib.optional (stdenv.hostPlatform != stdenv.buildPlatform)
                            "-DMSGPACK_BUILD_EXAMPLES=OFF"
-    ++ stdenv.lib.optional (stdenv.hostPlatform.libc == "msvcrt")
-                           "-DCMAKE_SYSTEM_NAME=Windows"
     ;
 
   meta = with stdenv.lib; {
diff --git a/pkgs/development/libraries/nanoflann/default.nix b/pkgs/development/libraries/nanoflann/default.nix
index b5d4ea0f4ebf..f29fb9564f31 100644
--- a/pkgs/development/libraries/nanoflann/default.nix
+++ b/pkgs/development/libraries/nanoflann/default.nix
@@ -1,14 +1,14 @@
 {stdenv, fetchFromGitHub, cmake}:
 
 stdenv.mkDerivation rec {
-  version = "1.2.3";
+  version = "1.3.0";
   name = "nanoflann-${version}";
   
   src = fetchFromGitHub {
     owner = "jlblancoc";
     repo = "nanoflann";
     rev = "v${version}";
-    sha256 = "1jrh73kjvdv7s7zc1sc3z254i17lpvn77b19wx32nvzsfxs4g44i";
+    sha256 = "1bwdmrz1qygp9qy2nzrp1axa1i4nvm0ljkn6mnhlcvbfsyvhzigv";
   };
 
   buildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/nghttp2/default.nix b/pkgs/development/libraries/nghttp2/default.nix
index 68bffd4032d2..471684ea7ddc 100644
--- a/pkgs/development/libraries/nghttp2/default.nix
+++ b/pkgs/development/libraries/nghttp2/default.nix
@@ -6,6 +6,7 @@
 , enableAsioLib ? false, boost ? null
 , enableGetAssets ? false, libxml2 ? null
 , enableJemalloc ? false, jemalloc ? null
+, enableApp ? !stdenv.hostPlatform.isWindows
 }:
 
 assert enableHpack -> jansson != null;
@@ -35,8 +36,12 @@ stdenv.mkDerivation rec {
 
   enableParallelBuilding = true;
 
-  configureFlags = [ "--with-spdylay=no" "--disable-examples" "--disable-python-bindings" "--enable-app" ]
-    ++ optional enableAsioLib "--enable-asio-lib --with-boost-libdir=${boost}/lib";
+  configureFlags = [
+    "--with-spdylay=no"
+    "--disable-examples"
+    "--disable-python-bindings"
+    (stdenv.lib.enableFeature enableApp "app")
+  ] ++ optional enableAsioLib "--enable-asio-lib --with-boost-libdir=${boost}/lib";
 
   #doCheck = true;  # requires CUnit ; currently failing at test_util_localtime_date in util_test.cc
 
diff --git a/pkgs/development/libraries/nlohmann_json/default.nix b/pkgs/development/libraries/nlohmann_json/default.nix
index 15bdbb1b48e8..25d4386cec2c 100644
--- a/pkgs/development/libraries/nlohmann_json/default.nix
+++ b/pkgs/development/libraries/nlohmann_json/default.nix
@@ -3,13 +3,13 @@
 
 stdenv.mkDerivation rec {
   name = "nlohmann_json-${version}";
-  version = "3.2.0";
+  version = "3.3.0";
 
   src = fetchFromGitHub {
     owner = "nlohmann";
     repo = "json";
     rev = "v${version}";
-    sha256 = "0585r6ai9x1bhspffn5w5620wxfl1q1gj476brsnaf7wwnr60hwk";
+    sha256 = "1plg9l1avnjsg6khrd88yj9cbzbbkwzpc5synmicqndb35wndn5h";
   };
 
   nativeBuildInputs = [ cmake ];
@@ -18,8 +18,6 @@ stdenv.mkDerivation rec {
 
   cmakeFlags = [
     "-DBuildTests=${if doCheck then "ON" else "OFF"}"
-  ] ++ stdenv.lib.optionals (stdenv.hostPlatform.libc == "msvcrt") [
-    "-DCMAKE_SYSTEM_NAME=Windows"
   ];
 
   doCheck = stdenv.hostPlatform == stdenv.buildPlatform;
diff --git a/pkgs/development/libraries/parquet-cpp/default.nix b/pkgs/development/libraries/parquet-cpp/default.nix
deleted file mode 100644
index 804ddb136f03..000000000000
--- a/pkgs/development/libraries/parquet-cpp/default.nix
+++ /dev/null
@@ -1,39 +0,0 @@
-{ stdenv, symlinkJoin, fetchurl, arrow-cpp, boost, cmake, gtest, snappy, thrift, zlib }:
-
-stdenv.mkDerivation rec {
-  name = "parquet-cpp-${version}";
-  version = "1.5.0";
-
-  src = fetchurl {
-    url = "https://github.com/apache/parquet-cpp/archive/apache-${name}.tar.gz";
-    sha256 = "19nwqahc0igr0jfprbf2m86rmzz6zicw4z7b8z832wbsyc904wli";
-  };
-
-  patches = [ ./api.patch ];
-
-  nativeBuildInputs = [ cmake ];
-  buildInputs = [ boost ];
-
-  preConfigure = ''
-    substituteInPlace cmake_modules/FindThrift.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
-    substituteInPlace cmake_modules/FindSnappy.cmake --replace CMAKE_STATIC_LIBRARY CMAKE_SHARED_LIBRARY
-  '';
-
-  ARROW_HOME = arrow-cpp;
-  THRIFT_HOME = thrift;
-  GTEST_HOME = gtest;
-  SNAPPY_HOME = symlinkJoin { name="snappy-wrap"; paths = [ snappy snappy.dev ]; };
-  ZLIB_HOME = symlinkJoin { name="zlib-wrap"; paths = [ zlib.dev zlib.static ]; };
-
-  cmakeFlags = [
-    "-DPARQUET_BUILD_BENCHMARKS=OFF"
-  ];
-
-  meta = {
-    description = "A C++ library to read and write the Apache Parquet columnar data format";
-    homepage = http://parquet.apache.org;
-    license = stdenv.lib.licenses.asl20;
-    platforms = stdenv.lib.platforms.unix;
-    maintainers = with stdenv.lib.maintainers; [ veprbl ];
-  };
-}
diff --git a/pkgs/development/libraries/postgis/default.nix b/pkgs/development/libraries/postgis/default.nix
index 0da66acbde2a..04fdeea1fa0b 100644
--- a/pkgs/development/libraries/postgis/default.nix
+++ b/pkgs/development/libraries/postgis/default.nix
@@ -42,8 +42,8 @@
 
 
 let
-  version = "2.4.5";
-  sha256 = "0saxj3w7j9yb9sa1ig3ccxvh2pk0bj47hp7m6199p1a1fpfjgrrg";
+  version = "2.5.0";
+  sha256 = "1m9n1shhqhjrhbq6fd9fyfccxcgpng37s3lffhlmyrp98zbsnwxy";
 in stdenv.mkDerivation rec {
   name = "postgis-${version}";
 
diff --git a/pkgs/development/libraries/range-v3/default.nix b/pkgs/development/libraries/range-v3/default.nix
index cdb5297a6d87..7fe4b504a992 100644
--- a/pkgs/development/libraries/range-v3/default.nix
+++ b/pkgs/development/libraries/range-v3/default.nix
@@ -2,13 +2,13 @@
 
 stdenv.mkDerivation rec {
   name = "range-v3-${version}";
-  version = "0.3.7";
+  version = "0.4.0";
 
   src = fetchFromGitHub {
     owner = "ericniebler";
     repo = "range-v3";
     rev = version;
-    sha256 = "1zhsz1i4jy97idydg7ay3wazp7v2353vckkli5w9g51jka43h5x2";
+    sha256 = "1s5gj799aa94nfg3r24whq7ck69g0zypf70w14wx64pgwg0424vf";
   };
 
   nativeBuildInputs = [ cmake ];
diff --git a/pkgs/development/libraries/sbc/default.nix b/pkgs/development/libraries/sbc/default.nix
index 0dc9c1afd2b4..b9830b65ffb7 100644
--- a/pkgs/development/libraries/sbc/default.nix
+++ b/pkgs/development/libraries/sbc/default.nix
@@ -1,11 +1,11 @@
 { stdenv, fetchurl, pkgconfig, libsndfile }:
 
 stdenv.mkDerivation rec {
-  name = "sbc-1.3";
+  name = "sbc-1.4";
 
   src = fetchurl {
     url = "http://www.kernel.org/pub/linux/bluetooth/${name}.tar.xz";
-    sha256 = "02ckd2z51z0h85qgv7x8vv8ybp5czm9if1z78411j53gaz7j4476";
+    sha256 = "1jal98pnrjkzxlkiqy0ykh4qmgnydz9bmsp1jn581p5kddpg92si";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/science/math/ipopt/default.nix b/pkgs/development/libraries/science/math/ipopt/default.nix
index 4a6aabb447f3..7e58a4c7c982 100644
--- a/pkgs/development/libraries/science/math/ipopt/default.nix
+++ b/pkgs/development/libraries/science/math/ipopt/default.nix
@@ -2,11 +2,11 @@
 
 stdenv.mkDerivation rec {
   name = "ipopt-${version}";
-  version = "3.12.10";
+  version = "3.12.11";
 
   src = fetchurl {
     url = "https://www.coin-or.org/download/source/Ipopt/Ipopt-${version}.zip";
-    sha256 = "004pd90knnnzcx727knb7ffkabb1ggbskb8s607bfvfgdd7wlli9";
+    sha256 = "1qihlwwqsqpbwpp6zqfa7nrmb55dndppzmdy98897aiknaa2650h";
   };
 
   CXXDEFS = [ "-DHAVE_RAND" "-DHAVE_CSTRING" "-DHAVE_CSTDIO" ];
diff --git a/pkgs/development/libraries/science/math/mkl/default.nix b/pkgs/development/libraries/science/math/mkl/default.nix
new file mode 100644
index 000000000000..37814047f975
--- /dev/null
+++ b/pkgs/development/libraries/science/math/mkl/default.nix
@@ -0,0 +1,85 @@
+{ stdenvNoCC, writeText, fetchurl, rpmextract, undmg }:
+/*
+  Some (but not all) mkl functions require openmp, but Intel does not add these
+  to SO_NEEDED and instructs users to put openmp on their LD_LIBRARY_PATH. If
+  you are using mkl and your library/application is using some of the functions
+  that require openmp, add a setupHook like this to your package:
+
+  setupHook = writeText "setup-hook.sh" ''
+    addOpenmp() {
+        addToSearchPath LD_LIBRARY_PATH ${openmp}/lib
+    }
+    addEnvHooks "$targetOffset" addOpenmp
+  '';
+
+  We do not add the setup hook here, because avoiding it allows this large
+  package to be a fixed-output derivation with better cache efficiency.
+ */
+
+stdenvNoCC.mkDerivation rec {
+  name = "mkl-${version}";
+  version = "${date}.${rel}";
+  date = "2019.0";
+  rel = "117";
+
+  src = if stdenvNoCC.isDarwin
+    then
+      (fetchurl {
+        url = "http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/13565/m_mkl_${version}.dmg";
+        sha256 = "1f1jppac7vqwn00hkws0p4njx38ajh0n25bsjyb5d7jcacwfvm02";
+      })
+    else
+      (fetchurl {
+        url = "http://registrationcenter-download.intel.com/akdlm/irc_nas/tec/13575/l_mkl_${version}.tgz";
+        sha256 = "1bf7i54iqlf7x7fn8kqwmi06g30sxr6nq3ac0r871i6g0p3y47sf";
+      });
+
+  buildInputs = if stdenvNoCC.isDarwin then [ undmg ] else [ rpmextract ];
+
+  buildPhase = if stdenvNoCC.isDarwin then ''
+      for f in Contents/Resources/pkg/*.tgz; do
+          tar xzvf $f
+      done
+  '' else ''
+    rpmextract rpm/intel-mkl-common-c-${date}-${rel}-${date}-${rel}.noarch.rpm
+    rpmextract rpm/intel-mkl-core-rt-${date}-${rel}-${date}-${rel}.x86_64.rpm
+  '';
+
+  installPhase = if stdenvNoCC.isDarwin then ''
+      mkdir -p $out/lib
+      cp -r compilers_and_libraries_${version}/mac/mkl/include $out/
+      cp -r compilers_and_libraries_${version}/mac/mkl/lib/* $out/lib/
+      cp -r compilers_and_libraries_${version}/licensing/mkl/en/license.txt $out/lib/
+  '' else ''
+      mkdir -p $out/lib
+      cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/include $out/
+      cp -r opt/intel/compilers_and_libraries_${version}/linux/mkl/lib/intel64_lin/* $out/lib/
+      cp license.txt $out/lib/
+  '';
+
+  # Per license agreement, do not modify the binary
+  dontStrip = true;
+  dontPatchELF = true;
+
+  # Since these are unmodified binaries from Intel, they do not depend on stdenv
+  # and we can make them fixed-output derivations for cache efficiency.
+  outputHashAlgo = "sha256";
+  outputHashMode = "recursive";
+  outputHash = if stdenvNoCC.isDarwin
+    then "1224dln7n8px1rk8biiggf77wjhxh8mzw0hd8zlyjm8i6j8w7i12"
+    else "0d8ai0wi8drp071acqkm1wv6vyg12010y843y56zzi1pql81xqvx";
+
+  meta = with stdenvNoCC.lib; {
+    description = "Intel Math Kernel Library";
+    longDescription = ''
+      Intel Math Kernel Library (Intel MKL) optimizes code with minimal effort
+      for future generations of Intel processors. It is compatible with your
+      choice of compilers, languages, operating systems, and linking and
+      threading models.
+    '';
+    homepage = https://software.intel.com/en-us/mkl;
+    license = [ licenses.issl licenses.unfreeRedistributable ];
+    platforms = [ "x86_64-linux" "x86_64-darwin" ];
+    maintainers = [ maintainers.bhipple ];
+  };
+}
diff --git a/pkgs/development/libraries/spice/default.nix b/pkgs/development/libraries/spice/default.nix
index ba3791a8a8bd..e9b12d169849 100644
--- a/pkgs/development/libraries/spice/default.nix
+++ b/pkgs/development/libraries/spice/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchurl, pkgconfig, pixman, celt, alsaLib
 , openssl, libXrandr, libXfixes, libXext, libXrender, libXinerama
 , libjpeg, zlib, spice-protocol, python, pyparsing, glib, cyrus_sasl
-, lz4 }:
+, libcacard, lz4 }:
 
 with stdenv.lib;
 
@@ -15,7 +15,7 @@ stdenv.mkDerivation rec {
 
   buildInputs = [ pixman celt alsaLib openssl libjpeg zlib
                   libXrandr libXfixes libXrender libXext libXinerama
-                  python pyparsing glib cyrus_sasl lz4 ];
+                  python pyparsing glib cyrus_sasl libcacard lz4 ];
 
   nativeBuildInputs = [ pkgconfig spice-protocol ];
 
@@ -23,7 +23,7 @@ stdenv.mkDerivation rec {
 
   configureFlags = [
     "--with-sasl"
-    "--disable-smartcard"
+    "--enable-smartcard"
     "--enable-client"
     "--enable-lz4"
   ];
diff --git a/pkgs/development/libraries/sqlite/default.nix b/pkgs/development/libraries/sqlite/default.nix
index 166ea39493bf..92574091558a 100644
--- a/pkgs/development/libraries/sqlite/default.nix
+++ b/pkgs/development/libraries/sqlite/default.nix
@@ -79,6 +79,6 @@ stdenv.mkDerivation rec {
     homepage = http://www.sqlite.org/;
     license = licenses.publicDomain;
     maintainers = with maintainers; [ eelco np ];
-    platforms = platforms.unix;
+    platforms = platforms.unix ++ platforms.windows;
   };
 }
diff --git a/pkgs/development/libraries/vigra/default.nix b/pkgs/development/libraries/vigra/default.nix
index 12c166beacbd..fb69d4bf63e7 100644
--- a/pkgs/development/libraries/vigra/default.nix
+++ b/pkgs/development/libraries/vigra/default.nix
@@ -15,6 +15,12 @@ in stdenv.mkDerivation rec {
 
   NIX_CFLAGS_COMPILE = "-I${ilmbase.dev}/include/OpenEXR";
 
+  # Fixes compilation with clang (on darwin) see https://github.com/ukoethe/vigra/issues/414
+  patches =
+    let clangPatch = fetchurl { url = "https://github.com/ukoethe/vigra/commit/81958d302494e137f98a8b1d7869841532f90388.patch";
+                                sha256 = "1i1w6smijgb5z8bg9jaq84ccy00k2sxm87s37lgjpyix901gjlgi"; };
+    in [ clangPatch ];
+
   buildInputs = [ boost cmake fftw fftwSinglePrec hdf5 ilmbase libjpeg libpng
                   libtiff numpy openexr python ];
 
@@ -34,6 +40,6 @@ in stdenv.mkDerivation rec {
     homepage = https://hci.iwr.uni-heidelberg.de/vigra;
     license = licenses.mit;
     maintainers = [ maintainers.viric ];
-    platforms = platforms.linux;
+    platforms = platforms.unix;
   };
 }
diff --git a/pkgs/development/libraries/vulkan-headers/default.nix b/pkgs/development/libraries/vulkan-headers/default.nix
index dd3f14f91928..c93ba1b12909 100644
--- a/pkgs/development/libraries/vulkan-headers/default.nix
+++ b/pkgs/development/libraries/vulkan-headers/default.nix
@@ -8,7 +8,7 @@ stdenv.mkDerivation rec {
   src = fetchFromGitHub {
     owner = "KhronosGroup";
     repo = "Vulkan-Headers";
-    rev = "sdk-${version}";
+    rev = "2fd5a24ec4a6df303b2155b3f85b6b8c1d56f6c0";
     sha256 = "0cj4bd396qddh3nxvr7grnpfz89g3sbvm21cx4k3ga52sp1rslpb";
   };
 
diff --git a/pkgs/development/libraries/vulkan-loader/default.nix b/pkgs/development/libraries/vulkan-loader/default.nix
index 5ffdc4375373..6f720857f7cf 100644
--- a/pkgs/development/libraries/vulkan-loader/default.nix
+++ b/pkgs/development/libraries/vulkan-loader/default.nix
@@ -1,6 +1,10 @@
-{ stdenv, fetchFromGitHub, cmake, python3, vulkan-headers, pkgconfig,
-  xlibsWrapper, libxcb, libXrandr, libXext, wayland, libGL_driver }:
-let version = "1.1.82.0"; in
+{ stdenv, fetchFromGitHub, cmake, python3, vulkan-headers, pkgconfig
+, xlibsWrapper, libxcb, libXrandr, libXext, wayland, libGL_driver }:
+
+let
+  version = "1.1.85";
+in
+
 assert version == vulkan-headers.version;
 stdenv.mkDerivation rec {
   name = "vulkan-loader-${version}";
@@ -9,8 +13,8 @@ stdenv.mkDerivation rec {
   src = fetchFromGitHub {
     owner = "KhronosGroup";
     repo = "Vulkan-Loader";
-    rev = "sdk-${version}";
-    sha256 = "16i4s1adfh822ahj3ywp279lv6szwd2sn2q5pmvpg2kk6mbh410d";
+    rev = "b02f64293680c484e1d7ff6ecb88f89277c0dc8c";
+    sha256 = "1n4vjyxlmi2ygx34srwbvalc5gz95gcsrmdw0k10353xja755gmj";
   };
 
   nativeBuildInputs = [ pkgconfig ];
diff --git a/pkgs/development/libraries/xdg-desktop-portal/default.nix b/pkgs/development/libraries/xdg-desktop-portal/default.nix
index 171ef68cf569..9cdada9bf3b2 100644
--- a/pkgs/development/libraries/xdg-desktop-portal/default.nix
+++ b/pkgs/development/libraries/xdg-desktop-portal/default.nix
@@ -1,7 +1,7 @@
 { stdenv, fetchFromGitHub, autoreconfHook, pkgconfig, libxml2, glib, pipewire, fuse }:
 
 let
-  version = "1.0.2";
+  version = "1.0.3";
 in stdenv.mkDerivation rec {
   name = "xdg-desktop-portal-${version}";
 
@@ -11,7 +11,7 @@ in stdenv.mkDerivation rec {
     owner = "flatpak";
     repo = "xdg-desktop-portal";
     rev = version;
-    sha256 = "1vl0150gz20x106di9yfa6l3zjw0nd2lr44rkq2147n2a254p79p";
+    sha256 = "113k5sr4l58rm8sgp4qbjrhyjg37c5ad54i58njsm98knb5r2ppv";
   };
 
   patches = [
diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix
index d348f877f722..fe1c275aeda5 100644
--- a/pkgs/development/libraries/zlib/default.nix
+++ b/pkgs/development/libraries/zlib/default.nix
@@ -82,4 +82,6 @@ stdenv.mkDerivation (rec {
   preConfigure = ''
     export CHOST=${stdenv.hostPlatform.config}
   '';
+} // stdenv.lib.optionalAttrs (stdenv.hostPlatform.libc == "msvcrt") {
+  configurePhase = ":";
 })